Chapter 10 XGATE (S12XGATEV3)
MC9S12XE-Family Reference Manual , Rev. 1.19
464
Freescale Semiconductor
MOVW
2,X+, 2,Y+
MOVW
2,X+, 2,Y+
MOVW
2,X+, 2,Y+
CPX
#XGATE_CODE_FLASH_END
BLS
COPY_XGATE_CODE_LOOP
;###########################################
;#
START XGATE
#
;###########################################
START_XGATE
MOVW
#XGMCTL_ENABLE, XGMCTL
;enable XGATE
BRA
*
;###########################################
;#
DUMMY INTERRUPT SERVICE ROUTINE
#
;###########################################
DUMMY_ISR
RTI
CPU
XGATE
;###########################################
;#
XGATE DATA
#
;###########################################
ALIGN 1
XGATE_DATA_FLASH
EQU
*
XGATE_DATA_SCI
EQU
*-XGATE_DATA_FLASH
DW
SCI_REGS
;pointer to SCI register space
XGATE_DATA_IDX
EQU
*-XGATE_DATA_FLASH
DB
XGATE_DATA_MSG
;string pointer
XGATE_DATA_MSG
EQU
*-XGATE_DATA_FLASH
FCC
"Hello World!
;ASCII string
DB
$0D
;CR
;###########################################
;#
XGATE CODE
#
;###########################################
ALIGN 1
XGATE_CODE_FLASH
LDW
R2,(R1,#XGATE_DATA_SCI)
;SCI -> R2
LDB
R3,(R1,#XGATE_DATA_IDX)
;msg -> R3
LDB
R4,(R1,R3+)
;curr. char -> R4
STB
R3,(R1,#XGATE_DATA_IDX)
;R3 -> idx
LDB
R0,(R2,#(SCISR1-SCI_REGS))
;initiate SCI transmit
STB
R4,(R2,#(SCIDRL-SCI_REGS))
;initiate SCI transmit
CMPL
R4,#$0D
BEQ
XGATE_CODE_DONE
RTS
XGATE_CODE_DONE
LDL
R4,#$00
;disable SCI interrupts
STB
R4,(R2,#(SCICR2-SCI_REGS))
LDL
R3,#XGATE_DATA_MSG;reset R3
STB
R3,(R1,#XGATE_DATA_IDX)
XGATE_CODE_FLASH_END
RTS
XGATE_DUMMY_ISR_XG
EQU
(XGATE_CODE_FLASH_END-XGATE_CODEXGATE_CODE_XG
10.9.3
Stack Support
To simplify the implementation of a program stack the XGATE can be configured to set RISC core register
R7 to the beginning of a stack region before executing a thread. Two separate stack regions can be defined:
One for threads of priority level 7 to 4 (refer to
Section 10.3.1.5, “XGATE Initial Stack Pointer for
Because
of
an
order
from
the
United
States
International
Trade
Commission,
BGA-packaged
product
lines
and
part
numbers
indicated
here
currently
are
not
available
from
Freescale
for
import
or
sale
in
the
United
States
prior
to
September
2010:
S12XE
products
in
208
MAPBGA
packages