Assembly Jump Question (PC Offsets) - MSP430
Jump instructions on the MSP430 are relative jumps. That means that the opcode for the jump instruction holds the distance of the target from the current instruction. This distance is called the "offset", and it's the number of words to adjust the execution point by. Multiplying by 2 gives the number of bytes (because the processor uses 16-bit, i.e., 2-byte instructions). When the assembler sees JNE FOO it figures out how far the address named FOO is from the jump instruction and sticks that distance (measured in words) into the offset portion of the opcode. Jump instructions for the MSP430 have 001 in the high three bits, the condition code for the jump in the next three bits, and the offset in the remaining ten bits.