Slide 4.16: SUB instruction
Slide 5.1: Programming Laboratory II: searching a string for a pattern
Home

CALL Instruction


          call  DumpRegs            ; display registers
This CALL statement calls a procedure that displays the current values of the CPU registers. The CALL instruction calls a procedure by directing the processor to begin execution at a new memory location. Procedures could be user-defined or built-in.

CALL — Procedure Call
Usage: CALL destination

Flag O D I S Z A P C
Result                

Pushes Instruction Pointer (and Code Segment for far calls) onto stack and loads Instruction Pointer with the address of proc-name. Code continues with execution at CS:IP.
Clocks
Operands 286 386 486
rel16 (near, IP relative) 7 7+m 3
rel32 (near, IP relative)   7+m 3
reg16 (near, register indirect) 7 7+m 5
reg32 (near, register indirect)   7+m 5
mem16 (near, memory indirect) 11 10+m 5
mem32 (near, memory indirect)   10+m 5
... ...


EXIT, ENDP, and END

 exit
 main  ENDP
 END  main
  • EXIT statement, a command defined in Irvine32.inc, calls a pre-defined MS-Windows function that halts the program.

  • ENDP directive marks the end of the main procedure.

  • END directive marks the last line of the program to be assembled. It identifies the name of the program's startup procedure.