Skip to content

Instantly share code, notes, and snippets.

@karaketir16
Created May 18, 2023 11:46
Show Gist options
  • Save karaketir16/158fefba3df9403669c40309828bc283 to your computer and use it in GitHub Desktop.
Save karaketir16/158fefba3df9403669c40309828bc283 to your computer and use it in GitHub Desktop.
.syntax unified
.thumb_func
.global main
main:
init: bl stdio_init_all
loop:
ldr r0, DELAY_TIME_MS // Set the delay period
bl sleep_ms // Delay for the specified time
ldr r0, =TEXT0 // Set the printf string
bl printf
b loop // Loop forever
/*
Use four-bytes to store the delay time so that we can load
into r0 a 32-bit value, rather than move in an 8-bit value
*/
.align 4
DELAY_TIME_MS: .word 500
TEXT0: .asciz "Hello World\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment