Subject: Correction to hello world Hello, I found your site while looking for PPC assembler info, as a complete beginner. I had some trouble with the example hello world code you give, and thought you might be interested in the solution. Basically, it would print the string, but always segfault immediately afterwords. This post on the Apple developers board (http://lists.apple.com/archives/darwin-development/2003/Jun/msg00185.html) gave the answer: the code returns to the instruction immediately after sc only in the event of an error. If the syscall works OK, it returns to the 2nd instruction after the syscall, meaning (in the example) that the r0 register is still loaded with the "write" system call, thus causing an error when you make the second sc. I corrected it as follows, though a nop after the system call works as well: .data txt: .asciz "Hello world!\n" len = . - txt .text .globl _main _main: li r0, 4 li r3, 1 lis r4, ha16(txt) addi r4, r4, lo16(txt) li r5, len sc b _error li r0, 1 li r3, 1 sc _error: li r0, 1 li r3, 0 sc