Some notes on PowerPC assembler

There are three OSes that I know something about that do PowerPC assembler: AIX, OS X, and Linux. All three of these OSes use the same ABI for 64-bit assembly (64-bit PowerPC ELF ABI Supplement 1.7). For 32 bits, the ABIs for AIX and OS X are essentially the same, but Linux differs very slightly in register usage and substantially in the way the stack is defined.

The standard ATLAS include file defines the macros ATL_AS_OSX_PPC, ATL_AS_AIX_PPC and ATL_GAS_LINUX_PPC, which can be used like:

#ifndef ATL_AS_OSX_PPC
   #error "This kernel requires OS X PPC assembler!"
to guard against invalid compilation.


Clint Whaley 2012-07-10