Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <asm/unistd_32.h>
- .data
- .text
- .global _start
- _start:
- pushl %esi
- pushl %edi
- loopa:
- movl $__NR_read, %eax
- movl $0, %ebx
- addl $4, %esp
- movl %esp, %ecx
- movl $1, %edx
- int $0x80
- cmpl $0, %eax
- jle exit
- movl (%esp), %esi
- cmpl $'0', %esi
- jl write
- movl $'9', %edi
- cmpl %esi, %edi
- jl write
- movl $'0', %edi
- movl %edi, (%esp)
- write:
- movl $__NR_write, %eax
- movl $1, %ebx
- movl (%esp), %ecx
- subl $4, %esp
- movl $1, %edx
- int $0x80
- jmp loopa
- exit:
- popl %edi
- popl %esi
- movl $__NR_exit, %eax
- movl $0, %ebx
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement