AN2491 Freescale Semiconductor / Motorola, AN2491 Datasheet - Page 21

no-image

AN2491

Manufacturer Part Number
AN2491
Description
Simplified Mnemonics for PowerPC Instructions
Manufacturer
Freescale Semiconductor / Motorola
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN2491NFHP
Manufacturer:
PANASON
Quantity:
5 510
Part Number:
AN2491NFHP
Manufacturer:
MAXIM
Quantity:
5 510
Trap instructions evaluate a trap condition as follows: The contents of rA are compared with either the
sign-extended SIMM field or the contents of rB, depending on the trap instruction.
The comparison results in five conditions that are ANDed with operand TO. If the result is not 0, the trap
exception handler is invoked. See Table 27 for these conditions.
8 Simplified Mnemonics for Accessing SPRs
The mtspr and mfspr instructions specify a special-purpose register (SPR) as a numeric operand.
Simplified mnemonics are provided that represent the SPR in the mnemonic rather than requiring it to be
coded as a numeric operand. The pattern for mtspr and mfspr simplified mnemonics is straightforward:
replace the -spr portion of the mnemonic with the abbreviation for the spr (for example XER, SRR0, or LR),
eliminate the SPRN operand, leaving the source or destination GPR operand, rS or rD.
Following are examples using the SPR simplified mnemonics:
The examples above show simplified mnemonics for accessing SPRs defined by the AIM version of the
PowerPC architecture; however, the same formula is used for Book E, EIS, and implementation-specific
SPRs, as shown in the following examples:
There is an additional simplified mnemonic formula for accessing IBATs, DBATs, and SPRGs, although not
all of these more complicated simplified mnemonics are supported by all assemblers. These are shown in
Table 28 along with the equivalent simplified mnemonic using the formula described above.
MOTOROLA
4. Trap unconditionally.
1. Copy the contents of rS to the XER.
2. Copy the contents of the LR to rS.
3. Copy the contents of rS to the CTR.
1. Copy the contents of rS to CSRR0.
2. Copy the contents of IVOR0 to rS.
3. Copy the contents of rS to the MAS1.
trap
mtxer rS
mflr rD
mtctr rS
mtcsrr0 rS
mfivor0 rD
mtmas1 rS
Simplified Mnemonics for PowerPC™ Instructions
Freescale Semiconductor, Inc.
For More Information On This Product,
TO Bit
0
1
2
3
4
Table 27. TO Operand Bit Encoding
Less than, using signed comparison
Greater than, using signed comparison
Equal
Less than, using unsigned comparison
Greater than, using unsigned comparison
Go to: www.freescale.com
equivalent to
equivalent to
equivalent to
equivalent to
equivalent to
equivalent to
equivalent to
ANDed with Condition
Simplified Mnemonics for Accessing SPRs
mtspr 1,rS
mfspr rD,8
mtspr 9,rS
mtspr 58,rS
mfspr rD,400
mtspr 625,rS
tw 31,0,0
21

Related parts for AN2491