Last active
November 2, 2020 19:32
-
-
Save sebbekarlsson/e34cd735de51d13df111fe5fa4b97523 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.type to_str, @function | |
to_str: | |
pushl %ebp | |
movl %esp, %ebp | |
movl 8(%esp), %eax | |
jmp to_str_loop | |
to_str_loop: | |
movl $0, %edx | |
movl $10, %ecx | |
div %ecx | |
cmp $0, %edx | |
je to_str_end | |
addl $48, %edx # convert to ascii | |
pushl %edx # remain | |
jmp to_str_loop | |
to_str_end: | |
movl %ebp, %esp | |
popl %ebp | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment