Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data
- msg db "0123456789"
- lf db 0x0A ; line feed
- section .text
- global _start
- _start:
- mov eax, 4747
- mov ebx, 10
- xor ecx, ecx ; set ecx to 0
- call loop_dec
- loop_dec:
- inc ecx
- push edx
- xor edx, edx ; set edx to 0
- div ebx
- test eax, eax ; test if eax is 0
- jne loop_dec
- print_dec:
- dec ecx
- push ecx
- mov eax, 4
- mov ebx, 1
- mov ecx, msg
- add ecx, edx
- mov edx, 1
- int 0x80
- pop ecx
- pop edx
- test ecx, ecx ; test if ecx is 0
- jne print_dec
- mov eax, 4
- mov ebx, 1
- mov ecx, lf
- mov edx, 2
- int 0x80
- mov eax, 1
- mov ebx, 0
- int 0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement