Consider the j(jump) instruction in MIPS. How far can it jump in memory? Would it be 32bits? Can i please have an explanation.
From this page, you'll see that the jump instruction has the following effects:
PC = nPC; nPC = (PC & 0xf0000000) | (target << 2);
target
is a 26 bit number. That means the j
instruction can jump to any absolute address that can be created from the operation above. The largest value for target
, therefore, is 226-1 (0x03FFFFFF), and the highest reachable address is (PC & 0xF0000000) | 0x0FFFFFFC
.