extern printf section .data mystr: db 'X: %d',10,0 mystrlen: equ $-mystr section .text global main main: mov eax,0 mov ebx,1 begin_loop: push eax push ebx push eax push mystr call printf add esp,4*2 pop ebx pop eax cmp ebx,0 jne go_up sub eax,1 cmp eax,0 jne begin_loop mov ebx,1 jmp begin_loop go_up: add eax,1 cmp eax,255 jne begin_loop mov ebx,0 jmp begin_loop mov eax,0 ret