The instructions that are used to call a subroutine from the main program and return to the main program after execution of called function

Linh Chi

New member
The instructions that are used to call a subroutine from the main program and return to the main program after execution of called function are
A. CALL, JMP
B. JMP, IRET
C. CALL, RET
D. JMP, RET
 
Answer: c
Explanation: At each CALL instruction, the IP and CS of the next instruction are pushed onto the stack, before the control is transferred to the procedure. At the end of the procedure, the RET instruction must be executed to retrieve the stored contents of IP & CS registers from a stack.
 

Tìm kiếm

Back
Top