Created
November 4, 2019 18:46
-
-
Save keleshev/9b9f159be70430545c91e47fdf23d834 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
.global main | |
main: | |
mov r0, #2 | |
bx lr |
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
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 |
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
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 |
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
.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