Skip to content

Instantly share code, notes, and snippets.

@keleshev
Created November 4, 2019 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keleshev/9b9f159be70430545c91e47fdf23d834 to your computer and use it in GitHub Desktop.
Save keleshev/9b9f159be70430545c91e47fdf23d834 to your computer and use it in GitHub Desktop.
.global main
main:
mov r0, #2
bx lr
root@vultr:~/arm# cat Makefile
.PHONY: always_run
%.exe: %.s always_run
@arm-linux-gnueabihf-gcc -static -o $@ $<
@-qemu-arm-static $@; echo $$?
@rm -f $@
root@vultr:~/arm# cat hello.s
greeting:
.asciz "Hello ARM"
.text
.global main
main:
ldr r0, address_of_greeting
push {lr}
bl puts
pop {lr}
mov r0, #0
bx lr
address_of_greeting: .word greeting
.global puts
root@vultr:~/arm# cat first.s
.global main
main:
mov r0, #2
bx lr
greeting:
.asciz "Hello ARM"
.text
.global main
main:
ldr r0, address_of_greeting
push {lr}
bl puts
pop {lr}
mov r0, #0
bx lr
address_of_greeting: .word greeting
.global puts
.PHONY: always_run
%.exe: %.s always_run
@arm-linux-gnueabihf-gcc -static -o $@ $<
@-qemu-arm-static $@; echo $$?
@rm -f $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment