PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Byte-Reversed Load and Store Instructions

The PowerPC instruction set includes a class of load and store instructions that perform byte swapping based on the size of the data transferred. For example, the load word byte reversed indexed ( lwbrx ) instruction swaps a 4-byte value. The primary purpose of instructions such as lwbrx is to allow efficient access to data in little-endian format, without additional byte-swapping.

For an example, refer to the big-endian DMA descriptor value shown in Figure A-6. If a program uses a PowerPC lwbrx instruction to access field aDescr.A, it reads the value 0x44454647, which is the correct data in little-endian format.

Byte-reversed load and store instructions require more code than other load and store instructions, because they exist only in indexed form without update forms. Either addresses of fields within data structures must be explicitly calculated, or field offsets must be loaded into a register. Also, there is currently no C compiler mechanism available to generate these instructions.


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)