Académique Documents
Professionnel Documents
Culture Documents
Lecture 8
Program Control Instructions
far jump
Indirect jumps
Conditional jumps
Loop instructions
Instruction pointer
Instruction pointer holds the offset of next instruction to be executed
next instruction is located at CS:IP
Example: Consider the following instructions, and assume that IP =
0005, what is the value of IP after executing each instructions
Assembly MachineLanguage
MOVAL,7 B007
MOVBX,0F3h BBF300
CBW 98
IMULBX F7EB
MOV[SI],AX 8904
MOV[SI+2],DX 895402
Instruction pointer
Memory view of the previous
example:
Assembly MachineLanguage
MOVAL,7 B007
MOVBX,0F3h BBF300
CBW 98
IMULBX F7EB
MOV[SI],AX 8904
MOV[SI+2],DX 895402
Jump instructions
Near jump:
Add a 2 byte signed displacement to the value of IP
jumps to a location within -32768 to 32767 bytes of the
current instruction
Far jump:
jumps to any location in the memory
it modifies the value of CS and IP
Jump instructions
Jump instructions
Short jump
EB
Jump instructions
Near jump
0003H
E9
Jump instructions
Far jump
EA
JMP instruction
MOVAX,0
MOVCX,5
next:ADDAX,7
LOOPnext
Loop instruction