Created
December 4, 2018 18:54
-
-
Save zeldin/7ab71a5316a91eaad7974fe996cd75c9 to your computer and use it in GitHub Desktop.
Small ppc32 assembler program that will run on Linux without any 32-bit libs
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
# compile with: gcc -m32 -static -nostdlib -o hello hello.s | |
.text | |
.globl _start | |
_start: | |
bl 1f | |
1: | |
li 0, 4 | |
li 3, 1 | |
mflr 4 | |
addi 4, 4, 2f-1b | |
li 5, 3f-2f | |
sc | |
li 0, 1 | |
li 3, 0 | |
sc | |
2: | |
.ascii "Hello, world!\n" | |
3: | |
.end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment