From 9db9fafd62ac4a02564eea0a06f55c0391a1e162 Mon Sep 17 00:00:00 2001 From: wheremyfoodat Date: Mon, 29 Aug 2022 04:11:35 +0300 Subject: [PATCH] Fix BLTZAL/BGEZAL info --- docs/cpuspecifications.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/cpuspecifications.md b/docs/cpuspecifications.md index 4a75464..c7da31a 100644 --- a/docs/cpuspecifications.md +++ b/docs/cpuspecifications.md @@ -351,11 +351,12 @@ Note that the instruction following the branch will always be executed.
bgez rs,dest if rs>=0 then pc=$+4+(-8000h..+7FFFh)*4 bgtz rs,dest if rs>0 then pc=$+4+(-8000h..+7FFFh)*4 blez rs,dest if rs<=0 then pc=$+4+(-8000h..+7FFFh)*4 - bltzal rs,dest if rs<0 then pc=$+4+(..)*4, ra=$+8 - bgezal rs,dest if rs>=0 then pc=$+4+(..)*4, ra=$+8 + bltzal rs,dest ra=$+8; if rs<0 then pc=$+4+(..)*4 + bgezal rs,dest ra=$+8; if rs>=0 then pc=$+4+(..)*4 ``` -jr/jalr can be used to jump to an unaligned address, in which case an address error (AdEL) exception will be raised on the next instruction fetch. +jr/jalr can be used to jump to an unaligned address, in which case an address error (AdEL) exception will be raised on the next instruction fetch.
+Additionally, bltzal/bgezal will always place the return address in $ra, whether or not the branch is taken
#### JALR cautions Caution: The JALR source code syntax varies (IDT79R3041 specs say "jalr rs,rd",