Hello World in 28 bytes

Started by
17 comments, last by Rob Loach 19 years, 4 months ago
Nice! I didn't now that 'int 20h' is sufficient to exit.
My version would like like this:
debuga 100mov ah, 09mov dx, 10bint 21hmov ah, 4cint 21hdb "Hello World!$"rcx18n hello.comwqhello.com

Resulting in 24 bytes. I don't get how the prof could get 28 bytes...

Advertisement
This is depressing ....

I used to think VB was a cool language ....
Then I though I should learn something C based, so I started C# ...
But the .NET framework was too slow, so now C++ .....
But now I have just found out how easy it is to code stuff like this right into the command prompt ! bah, it just keeps betting better :)
__________Michael Dawson"IRC is just multiplayer notepad." - Reverend
20 bytes if you use ret instead of int 20h to exit ;-)

cheers
sam
The way you write a 'Hello World' program speaks volumes about your level of experience. [smile]
Quote:Original post by xyuri
But now I have just found out how easy it is to code stuff like this right into the command prompt ! bah, it just keeps betting better :)


Note that Assembly sure isnt the fastest code in the world, and that some (or rather most) programmers litterally run if you ask them to code assembly. assembly is only good for routines that are called 100ths of time a second (not so much, but u get the point) you can make games with assembly however (Rollercoaster tycoon was writen in it) but i guess u rather learn C (or c++) to keep you from getting mad from assebly :)
Quote:Original post by xyuri
But now I have just found out how easy it is to code stuff like this right into the command prompt ! bah, it just keeps betting better :)


Note that Assembly sure isnt the fastest code in the world, and that some (or rather most) programmers litterally run if you ask them to code assembly. assembly is only good for routines that are called 100ths of time a second (not so much, but u get the point) you can make games with assembly however (Rollercoaster tycoon was writen in it) but i guess u rather learn C (or c++) to keep you from getting mad from assembly :)

also a prob: assembly is processor dependent... what u write fot a pentioum, isnt guaranteed to wotk on, lets say, athlon
The ACM "Hello World" project, hello world in any programming language :D
Just for the record for budding asm programmers: the asm code snippets above aren't really being entered directly at the command prompt. If you'll notice, the first line given is 'debug', which fires up the debugger. Subsequent asm code and other instructions are then passed to debug, which has a small capability for editing and writing assembly language programs. In these examples, debug is writing the program to the file hello.com, which is then being executed after the 'q' command exits debug. It's not the best way for creating extensive assembly, but it is sufficient for testing out small things such as this. For large asm apps you'll want an actual assembler which takes text files as input much like any other kind of compiler or language translator. These more powerful asm tools (such as MASM) include more powerful macros and methods for structuring applications and dealing with data.

Assembly! Yays!! [smile]
Quote:Original post by Zahlman
The way you write a 'Hello World' program speaks volumes about your level of experience. [smile]
Brilliant!
Rob Loach [Website] [Projects] [Contact]

This topic is closed to new replies.

Advertisement