Last active
May 13, 2022 11:26
-
-
Save MrYakobo/27b7f1dc456bcbdf0d2046aff89a6a66 to your computer and use it in GitHub Desktop.
print number to stdout in Raspberry Pi ARM Assembly
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
(this file changes the title of this Gist, ignore this) |
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
gcc: | |
gcc -o printf printf.s |
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
.global main | |
.func main | |
main: | |
LDR R0, =string | |
LDR R1, =0xFFFF /*Output number*/ | |
BL printf | |
B exit | |
exit: | |
MOV R7, #1 | |
SWI 0 | |
.data | |
string: | |
.asciz "%d\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Modelo de uso do printf no assembly