[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
CALL Call Procedure Flags: not altered
CALL procedure_name
Logic: if FAR CALL (inter-segment)
PUSH CS
CS . dest_seg
PUSH IP
IP . dest_offset
CALL transfers control to a procedure that can either be within the
current segment (a NEAR procedure) or outside it (a FAR procedure).
The two types of CALLs result in different machine instructions, and
the RET instruction that exits from the procedure must match the type
of the CALL instruction (the potential for mismatch exists if the
procedure and the CALL are assembled separately).
--------------------------------------------------------------------------
Operands Clocks Transfers Bytes Example
byte(word)
near-proc 19(23) 1 3 CALL NEAR_PROC
far-proc 28(36) 2 5 CALL FAR_PROC
memptr 16 21(29) + EA 2 2-4 CALL PROC_TABLE[SI]
regptr 16 16(24) 1 2 CALL AX
memptr 32 37(57) + EA 4 2-4 CALL [BX].ROUTINE
--------------------------------------------------------------------------
Notes: For an inter-segment procedure (procedure in a
different segment), the processor first pushes the
current value of CS onto the stack, then pushes the
current value of IP (which is pointing to the
instruction following the CALL instruction), then
transfers control to the procedure.
For an intra-segment procedure (procedure in the
same segment), the processor first pushes the
current value of IP (which is pointing to the
instruction following the CALL instruction) onto the
stack, then transfers control to the procedure.
CALL can also read the procedure address from a
register or memory location. This form of CALL is
called an indirect CALL.
See Also:
RET
JMP
PROC
NEAR
FAR
EA
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson