I'm currently creating an application that would take in the user's input and return to them the hex of the branch instruction they wanted.
The input includes:
I can currently fill in most bits of the 32 bits but I am unable to fill in three certain bits which bother me. These are the S bit, the J1 bit, and the J2 bit as shown in the references below:
Do these bits have default values? Otherwise, how do I know the value I need to use for them? Thanks for your time.
I searched the internet further until I found my answer:
Experiments indicate that the J1 and J2 bits are not used and the definition is: imm32 = SignExtend(S:imm6:imm11:'0', 32);
So basically, J1 and J2 are not used and only the S bit is used. This makes sense as it works with my experiments as well. And the S bit seems to be the sign bit, which is equal to 1 when the address is negative, or equal to 0 when the address is positive.