Table of contents
During the course of my Master’s research project, I’ve had to write and analyze quite a lot of low-level assembly code for the 32-bit PowerPC architecture. I found myself constantly reaching for the PowerPC Programming Environments Manual or Bill Karsh’s PowerPC assembly tutorial to remember the semantics or operands of such-and-such, especially at the beginning.
Since I haven’t found a reference card that is easy to print and easy to use, I wrote my own. I’ve been using it myself, but I am publishing it here in the hope that it might be helpful to someone else.
The reference card contains everything you need for general-purpose user-level code on 32-bit PowerPCs. It can be printed on two double-sided Letter or A4 pages. I printed my version on card stock.
- Registers description
- Label suffixes
- Load and store instructions
- ALU instructions
- Addition, subtraction, negation
- Bitwise logical operations and shifts
- Rotate and Mask, with examples and details (rlwimi, rlwinm, rlwm)
- Comparison instructions
- Condition register manipulation instructions
- Branch instructions (including simplified mnemonics)
- SPR operations
- Trap and System Call instructions
- Condensed alphabetical instructions list
In the interest of keeping it handy and to concentrate on the essential, I voluntarily omitted the following categories of instructions:
- String loads and stores
- Book-E Extensions
- Cache and TLB
- Supervisor-level operations
These instructions are very seldom used, so I don’t think it’s a problem that they are absent. When I use them, I usually need to refer to the complete instruction set manual anyway, because of their complex semantics.
The current version of this page can always be found at the following address: http://www.tentech.ca/ppc-assembly-card. Even though I have thoroughly reviewed the information contained in the card, I may include corrections if they are found. If you find inaccurate information on the reference card, please contact me.
I learned PowerPC assembly initially from Bill Karsh’s series on the PowerPC in MacTech magazine (see Links section). Although these two articles are extremely old, covering the PowerPC 601 and 603, they are still available and I found them much more informative than anything else I have consulted on the subject. They are aimed at people with an existing knowledge of other assembly languages, but are very approachable. The instructions grouping on the card is strongly influenced by the grouping shown in his articles.
The following links are a hand-picked set of resources that I have found useful in my work with PowerPC assembly. Most of these are actually complementary to one another, rather than being repetitions of the same information.
- Bill Karsh’s “Understanding the PowerPC Architecture” article in MacTech Magazine, Vol. 10, Number 8.
- Bill Karsh’s “Understanding PowerPC Assembly” article in MacTech Magazine, Vol. 10, Number 9.
- IBM’s “PowerPC Microprocessor Family: The Programming Environments for 32-Bit Microprocessors“, Publication number G522-0290-01.
- Power.org’s “Power ISA Version 2.06 Revision B“
- Freescale’s “Programming Environments Manual for 32-Bit Implementations of the PowerPC™ Architecture“, Publication ID MPCFPE32B.
- Write Great Code Volume 2 by Randall Hyde: Appendix B, “The Minimal PowerPC Instruction Set“.
- Jeroen Valk’s “Simplified PowerPC Instruction Set” page for the IN1200 course at TU Delft.
- IBM’s “The PowerPC Compiler Writer’s Guide“.
- IBM’s “Developing PowerPC Embedded Application Binary Interface (EABI) Compliant Programs” Application Note.
- Freescale’s “PowerPC Embedded Application Binary Interface (EABI): 32-bit Implementation” Application Note, Publication ID PPCEABI.
- Sunsoft and IBM’s “System V Application Binary Interface: PowerPC Processor Supplement“.
- Freescale’s “PowerPC Architecture Primer“, Publication ID POWRPCARCPRMRM.
- More links at TimeToCome’s blog.
This page was created by Tennessee Carmel-Veilleux on October 24th, 2010.
One thought on “PowerPC Instruction Set Quick Reference Card”