Skip to content

Instantly share code, notes, and snippets.

@MrYakobo
Last active May 13, 2022 11:26
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrYakobo/27b7f1dc456bcbdf0d2046aff89a6a66 to your computer and use it in GitHub Desktop.
Save MrYakobo/27b7f1dc456bcbdf0d2046aff89a6a66 to your computer and use it in GitHub Desktop.
print number to stdout in Raspberry Pi ARM Assembly
(this file changes the title of this Gist, ignore this)
gcc:
gcc -o printf printf.s
.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"
@mariochem
Copy link

Modelo de uso do printf no assembly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment