2

In MIPS, a 32-bit jump instruction consists of 6-bits for the opcode and 26-bits for the target (destination) address that we want to set the program counter to.

However, it is possible to set the program counter to a 28-bit target address. How is this possible if we can only fit 26-bits in the jump instruction?

jshapy8
  • 1,983
  • 7
  • 30
  • 60

1 Answers1

4

Instructions on MIPS are always 4-byte aligned, so the low 2 bits of any valid target address can only be zero. Thus, the 26 bits specified in jump instructions are always implicitly left shifted of 2 positions, hence setting the low 28 bits of the PC.

Matteo Italia
  • 123,740
  • 17
  • 206
  • 299