MC logo

Jump Coding

  Coding Examples

<<Branch Coding
Jump instructions are simpler than branches since they contain the target address, rather than an offset. Again, the actual target is not stored, but one fourth of the target, since the low two bits are always zero.

Consider the instruction jal fred Assume that fred is located at address 0x004007E8.

  1. Shift the target address right two bits (divide it by four). This gives 0x1001FA.

  2. Look up the instruction to find its type and format. (You'll find it on p. A-65.) Plug the numbers into the format. Pad the target to 26 bits. For once, no registers.
    00001100000100000000000111111010

  3. Regroup the bits.
    00001100000100000000000111111010

  4. Represent as a hex number: 0C1001FA
<<Branch Coding