Call Subroutine - Motorola M68EVB912B32 User Manual

Table of Contents

Advertisement

CALL
syntax:
CALL
[<Address>]
where:
<Address>
The CALL command is used to execute a subroutine and return to the D-Bug12 monitor program
when the final RTS of the subroutine is executed. When control is returned to D-Bug12, the
CPU register contents are displayed. All CPU registers contain the values at the time the final
RTS instruction was executed, with the exception of the program counter (PC). The PC contains
the starting address of the subroutine. If a subroutine address is not supplied on the command
line, the current value of the Program Counter (PC) is used as the starting address.
No user breakpoints are placed in memory before execution is
transferred to user code.
restrictions:
If the called subroutine modifies the value of the stack pointer during its execution, it must
restore the stack pointer's original value before executing the final RTS of the called subroutine.
This restriction is required because a return address is placed on the users stack that returns to
D-Bug12 when the final RTS of the subroutine is executed. Obviously, any subroutine must
obey this restriction to execute properly.
The CALL command cannot be issued when the "R>" prompt is displayed, indicating that the
target system is already running a user program.
example:
>CALL 820
Subroutine Call Returned
PC
SP
0820
0A00
>
68EVB912B32UM/D

Call Subroutine

is an optional 16-bit hexadecimal number.
NOTE:
X
Y
D = A:B
057C
0000
CCR = SXHI
0F:F9
1001
OPERATION
CALL
NZVC
0000
3-19

Advertisement

Table of Contents
loading

Table of Contents