Instruction Pointer
One of eight
16-bit register on the 8086 architecture, but follows special rules.
Its value stands an offset in the
code segment where the next instruction to be executed is located.
The value of the IP register cannot be directly modified by the
MOV instruction, but the
JMP instruction does practically the same thing. The JMP with a single-byte "
parameter" does a
signed add with
twos complement arithmetic on the IP register. In programming assembler, this +/- value is usually calculated at
compile-time. If a jump needs to go foreward or back more than 126 instructions, MASM will fix this by default without you knowing it, causing you to have hidden instructions. TASM will not fix this, but will generate a compile error. The
CALL instruction will push the current IP onto the
stack, and set the IP to the label given. The
RET instruction will pop two
bytes from the stack, and move them into IP.
m_turner adds, this is sometimes the PC register on other systems.