First download FASMW here [Only registered and activated users can see links. ] (FASMW is a simple ASM editor which makes it very easy to get your code compiled.
Now, lets make a Hello World program, but let us make it count to 1.000.000 before displaying the messagebox.
Code:
format PE GUI 4.0
include 'INCLUDE\win32ax.inc' ;Include the Windows functions.
;This is where we write our code.
.code
Main:
xor eax, eax ;This is a simple way to make sure the eax is 0.
LoopStart: ;Now we want to make a loop to count to 1.000.000.
add eax, 1 ;This will simply add 1 to eax, same as EAX := EAX + 1; in Delphi.
cmp eax, 1000000 ;CMP stands for compare, that is what we do, comparing eax to 1.000.000
jne LoopStart ;JNE is Jump If Not Equal, so that if eax is not 1.000.000 it will go to LoopStart.
;Now we create a MessageBox to notify the user that the program is done counting.
invoke MessageBox, 0, "You have just counted to 1 million!", "Congratz", 0
;This quits the program, if this code was not here it would crash.
invoke ExitProcess, 0
.end Main