mfsrr0
Move from SRR0 - 7C 00 02 A6
mfsrr0
Instruction Syntax
Mnemonic | Format | Flags |
mfsrr0 | rD | None |
Instruction Encoding
0
1
1
1
1
1
D
D
D
D
D
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Field | Bits | Description |
Primary Opcode | 0-5 | 011111 (0x1F) |
rD | 6-10 | Destination register |
rA | 11-15 | 00000 (unused) |
rB | 16-20 | 00000 (unused) |
XO | 22-29 | 01010110 (0x56) |
Operation
rD ← SRR0
MFSRR0 copies the contents of the Save/Restore Register 0 (SRR0) into the destination register rD.
- Reads the value from the Save/Restore Register 0 (SRR0)
- Copies it to the destination register rD
Note: SRR0 contains the address of the instruction that caused the exception.
Affected Registers
General Purpose Registers (GPRs)
- rD (Destination register) - Loaded with SRR0 value
Examples
Basic SRR0 Read
# Read the Save/Restore Register 0 mfsrr0 r3 # r3 = SRR0
Exception Handler
# In an exception handler exception_handler: mfsrr0 r3 # Get the exception address # Process the exception using the address in r3
Debug Information
# Get exception address for debugging mfsrr0 r10 # Save exception address # Log or process the address for debugging
Related Instructions
mtsrr0 (Move to SRR0), mfsrr1 (Move from SRR1), mtsrr1 (Move to SRR1), mfdar (Move from DAR)