retagged by
342 views

1 Answer

Best answer
1 votes
1 votes

If we have to use a register to keep the target 32 address, we'll first need to store it in a register(1 extra instruction), plus even if have it in the register, it'll be slower than having it as an immediate operand(Although not much slower).

So in JUMP instruction target address is in instruction as an immediate operand.

Why 26? 

 In a 32 bit instruction you can not include a 32-bit jump destination. The opcode uses 6 bits, which leaves 26 bits for the instruction. The target address is constructed by taking the first 4 bits of the address of the instruction following the j instruction, then 2 zero bits are appended to the 26 bits from the jump instruction operand. (As the instructions are 32 bits, alignment is useful and allows the omitting of the last two 0's.)

https://stackoverflow.com/questions/7877407/jump-instruction-in-mips-assembly

selected by

Related questions

2 votes
2 votes
0 answers
4