This program, a little bit adapted for FreshLib works like a charm. The core of the program is the same, I simply added some console output. (and well, it is FASM syntax) So, you simply missed to notice that the program is working properly.
include "%lib%/freshlib.inc"
@BinaryType console
include "%lib%/freshlib.asm"
start:
InitializeAll
XOR eax, eax ;; Set eax to 0
MOV ecx, 100 ;; We will loop 100 times
my_loop:
ADD eax, ecx ;; We add the ecx register value to eax, ecx decreses by 1 every iteration untill he reaches 0
LOOP my_loop
;;Exit the program, eax is the exit code
mov ebx, eax
stdcall NumToStr, ebx, ntsDec or ntsSigned
stdcall FileWriteString, [STDOUT], eax
stdcall FileReadLine, [STDIN] ; in order to pause until ENTER is pressed.
stdcall TerminateAll, ebx
@AllDataEmbeded
@AllImportEmbeded