Hardware Reference
In-Depth Information
Instruction
Description
When to jump
JNA, JBE
Below or equal
CF=1 or ZF=1
JNB, JAE, JNC
Not below
CF=0
JE, JZ
Zero, equal
ZF=1
JNLE, JG
Greater than
SF=OF and ZF=0
JGE, JNL
Greater equal
SF=OF
JO
Overflow
OF=1
JS
Sign negative
SF=1
JCXZ
CX is zero
CX=0
JB, JNAE, JC
Below
CF=1
JNBE, JA
Above
CF=0&ZF=0
JNE, JNZ
Nonzero, nonequal
ZF=0
JL, JNGE
Less than
SF
OF
JLE, JNG
Less or equal
SF OF or ZF=1
JNO
Nonoverflow
OF=0
JNS
Nonnegative
SF=0
Figure C-5. Conditional jumps.
near call is implemented. The destination is either a label or can be found at an
effective address. Parameters needed in the subroutines have to be pushed onto the
stack in reverse order first, as illustrated in Fig. C-6. In assembly language, param-
eters are usually called arguments , but the terms are interchangeable. Following
these pushes the CALL instruction is executed. The instruction starts by pushing the
current program counter onto the stack. In this way the return address is saved.
The return address is the address at which the execution of the calling routine has
to be resumed when the subroutine returns.
BP+8
...
BP+6
Argument 2
BP+4
Argument 1
BP+2
Return address
BP
Old BP
BP
BP
2
Local variable 1
BP 4
Local variable 2
BP
6
Local variable 3
BP 8
Temporary result
SP
Figure C-6. An example stack.
Next the new program counter is loaded either from the label, or from the
effective address.
If the call is far, then the CS register is pushed before PC and
 
Search WWH ::




Custom Search