Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %include "io.inc"
- section .rodata
- specscanf db "%u", 0
- specprintf db `0x%08X\n`, 0
- section .bss
- n resd 1
- section .text
- CEXTERN scanf
- CEXTERN printf
- global CMAIN
- CMAIN:
- push ebp
- mov ebp, esp
- and esp, -16
- sub esp, 16
- .lp:
- mov ebx, specscanf
- mov dword[esp], ebx
- lea ebx, [n]
- mov dword[esp + 4], ebx
- call scanf
- cmp eax, 0
- jl .end
- mov ebx, dword[n]
- mov dword[esp + 4], ebx
- mov ebx, specprintf
- mov dword[esp], ebx
- call printf
- jmp .lp
- .end:
- add esp, 16
- mov esp, ebp
- pop ebp
- xor eax, eax
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement