3.9.6. Program Control Instructions
|call||This instruction calls a subroutine using an immediate value as the subroutine's absolute address, and stores the return address in register ra.|
|callr||This instruction calls a subroutine at the absolute address contained in a register, and stores the return address in register ra. This instruction serves the roll of dereferencing a C function pointer.|
|ret||The ret instruction is used to return from subroutines called by call or callr. ret loads and executes the instruction specified by the address in register ra.|
|jmp||The jmp instruction jumps to an absolute address contained in a register. jmp is used to implement switch statements of the C programming language.|
|jmpi||The jmpi instruction jumps to an absolute address using an immediate value to determine the absolute address.|
|br||This instruction branches relative to the current instruction. A signed immediate value gives the offset of the next instruction to execute.|
The conditional branch instructions compare register values directly, and branch if the expression is true. The conditional branches support the following equality and relational comparisons of the C programming language:
- == and !=
- < and <= (signed and unsigned)
- > and >= (signed and unsigned)
The conditional branch instructions do not have delay slots.
bge bgeu bgt bgtu ble bleu blt bltu beq bne
|These instructions provide relative branches that compare two register values and branch if the expression is true. Refer to the "Comparison Instructions" section of this chapter for a description of the relational operations implemented.|
Did you find the information on this page useful?