Datasheet

Monitor Module (MON)
MC68HC908QY/QT Family Data Sheet, Rev. 6
Freescale Semiconductor 147
The MCU executes the SWI and PSHH instructions when it enters monitor mode. The RUN command
tells the MCU to execute the PULH and RTI instructions. Before sending the RUN command, the host can
modify the stacked CPU registers to prepare to run the host program. The READSP command returns
the incremented stack pointer value, SP + 1. The high and low bytes of the program counter are at
addresses SP + 5 and SP + 6.
Figure 15-17. Stack Pointer at Monitor Mode Entry
Table 15-7. READSP (Read Stack Pointer) Command
Description Reads stack pointer
Operand None
Data Returned
Returns incremented stack pointer value (SP + 1) in
high-byte:low-byte order
Opcode $0C
Command Sequence
Table 15-8. RUN (Run User Program) Command
Description Executes PULH and RTI instructions
Operand None
Data Returned None
Opcode $28
Command Sequence
READSPREADSP
ECHO
FROM HOST
SP
RETURN
SP
HIGH LOW
RUN
RUN
ECHO
FROM HOST
CONDITION CODE REGISTER
ACCUMULATOR
LOW BYTE OF INDEX REGISTER
HIGH BYTE OF PROGRAM COUNTER
LOW BYTE OF PROGRAM COUNTER
SP + 1
SP + 2
SP + 3
SP + 4
SP + 5
SP
SP + 6
HIGH BYTE OF INDEX REGISTER
SP + 7