Break Module (BRK)
Break Module Registers
MC68HC908AB32
—
Rev. 1.0 Technical Data
MOTOROLA Break Module (BRK)
371
SBSW — SIM Break Stop/Wait Bit
This status bit is useful in applications requiring a return to wait or stop
mode after exiting from a break interrupt. Clear SBSW by writing a
logic 0 to it. Reset clears SBSW.
1 = Stop mode or wait mode was exited by break interrupt
0 = Stop mode or wait mode was not exited by break interrupt
SBSW can be read within the break interrupt routine. The user can
modify the return address on the stack by subtracting one from it. The
following code is an example.
Address: $FE00
Bit 7 654321Bit 0
Read:
RRRRRR
SBSW
R
Write: Note
Reset: 00000000
Note: Writing a logic 0 clears SBSW.
R = Reserved
Figure 22-6. SIM Break Status Register (SBSR)
;
;
;
This code works if the H register has been pushed onto the stack in the break
service routine software. This code should be executed at the end of the break
service routine software.
HIBYTE EQU 5
LOBYTE EQU 6
; If not SBSW, do RTI
BRCLR SBSW,SBSR, RETURN ;
;
See if wait mode or stop mode was exited by
break.
TST LOBYTE,SP ;If RETURNLO is not zero,
BNE DOLO ;then just decrement low byte.
DEC HIBYTE,SP ;Else deal with high byte, too.
DOLO DEC LOBYTE,SP ;Point to WAIT/STOP opcode.
RETURN PULH
RTI
;Restore H register.