Skip to content

Control Flow

Simon Amtoft Pedersen edited this page May 5, 2020 · 5 revisions

Table showcasing an example of each Control Flow instruction.

Example Explanation
br b1 Jumps to the instruction address with the label "b1", after executing the next two instructions. Jump is relative to current PC
brcf b2 Jumps to the address given by the label "b2", after executing the next two instructions, and does a cache fill. Jump is absolute
brcfnd b2 Same as brcf, but without executing the next two instructions
brnd b1 Same as br, but without executing the next two instructions
call b3 Jumps to the absolute address given by the label "b3", after executing the next two instructions. With cache fill
callnd b3 Same as call, but without executing the next two instructions
ret Returns from a function after executing the next two instructions. With cache fill
retnd Same as ret, but without executing the next two instructions
trap A system call via the exception vector. Does a cache fill
xret Return from an exception after executing the next two instructions. With cache fill
xretnd Same as xret, but without executing the next two instructions

Note: Cache fills not implemented in Chora.

Clone this wiki locally