MIPS Instructions
Arithmetic
Memory
Procedures
- Execution
- The control is transferred to the procedure (callee)
- The procedure executes until completion
- The control is transferred back to the main program
- MIPS-support
- Special register to secure the return address:
$ra
- Jump instruction
jal
(jump and link) save return address in $ra
and jumps to start address of the procedure
jr
(jump register) jumps to the provided in the register
jr $ra
jump to the return address in the main program
Addressing
- Direct Addressing: Stores the address directly
- Base Addressing: Stores the address relative to another address
- PC-Relative Addressing: Address stored relative to the current program counter
- Pseudo-direct addressing: Concatenates the provided address with the upper 4 bits of the PC