Skip to content

Instantly share code, notes, and snippets.

@zeldin
Created December 4, 2018 18:54
Show Gist options
  • Save zeldin/7ab71a5316a91eaad7974fe996cd75c9 to your computer and use it in GitHub Desktop.
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
# 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