| # To build with GNU assembler and AIX LD: |
| # as -m regnames -m ppc hello-powerpc-aix.s -o hello-powerpc-aix.o |
| # ld -b noautoimp -b noglink -b textro hello-powerpc-aix.o -o hello-powerpc-aix |
| |
| .text |
| |
| helloworld: |
| .byte "Hello world" |
| .byte 10 |
| |
| sc: |
| crorc cr6, cr6, cr6 |
| sc |
| # It will automatically be branched to the return address stored in lr, when the system call returns |
| |
| .global .__start |
| .__start: |
| bl _start |
| _start: |
| li r5, 12 |
| mflr r4 |
| addi r4, r4, helloworld - .__start - 4 |
| li r3, 1 |
| li r2, 296 |
| bl sc |
| li r3, 0 |
| li r2, 55 |
| bl sc |