Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .bss
- a resb 1
- section .data
- nwln db 10
- section .text
- global _start
- _start:
- ;; Initialise a=0
- mov [a], byte 0
- ;; loop 20 times
- mov ecx,20
- L:
- mov eax,20
- sub eax,ecx
- cmp eax, 10
- jl INCREMENT
- dec byte [a]
- loop L
- ;; a+48 + echo a
- ETTER:
- mov al,[a]
- add al,'0'
- mov [a],al
- mov ecx,a
- mov edx,1
- call echo
- call exit
- INCREMENT:
- inc byte [a]
- loop L
- jmp ETTER
- echo:
- mov ebx,1
- mov eax,4
- int 0x80
- mov ecx,nwln
- mov edx,2
- mov ebx,1
- mov eax,4
- int 0x80
- ret
- exit:
- mov eax,1
- int 0x80
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement