Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section.text global _start ;must be declared for using gcc _start: ;tell linker entry point mov ebx, y mov eax, dword[x] laco: call Fatoracao cmp eax, 1 jg laco jmp fimprog
- impnum: push eax push ebx push ecx mov ebx, msg+7 ; mov eax, dword[x] ; eax = x mov ecx, 8
- laco2:
- dec ecx ; cx=cx-1 mov esi,10 ; divisor por 10, si=10 mov edx, 0 ; limpar o resto edx=0 div esi ; eax = eax/esi, edx = resto ; edx = dh << 8 | dl add dl,'0' ; dl = dl + '0' converto o digito decimal para ASC mov [ebx],dl ; *msg = dl dec ebx cmp ecx,0 ; jz fimlaco2 jmp laco2
- fimlaco2: mov edx, len ;message length mov ecx, msg ;message to write mov ebx, 1 ;file descriptor (stdout) mov eax, 4 ;system call number (sys_write) int 0x80 ;call kernel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement