XA User Guide 4-10 3/24/97
4.4.5 The Reset Exception Interrupt
Immediately after the
RST line goes high, the CPU generates a Reset Exception Interrupt. As a
result, the initial PSW and address of the first instruction (the “start-up code”) is fetched from the
reset vector in code memory at location 0. Here’s an example in generalized assembler format of
the setup for the Reset Exception:
code_seg ; establish code segment
org 0h ; start at address 0
; reset_vector
dw initial_PSW ; define a word constant
dw startup_code ; define a word constant
org 120h ; move to address 120h
; (above vector table)
startup_code:
... ; put startup code here
The initial value of PSWL set in the Reset Vector is generally of no special system-wide
importance and may be set to zero or some other value to meet special needs of the XA
application. The initial PSWH value sets the stage for system software initialization and its
value requires more attention. Here’s an example set of declarations that create the
recommended initial value of PSWH:
system_mode equ 8000h
max_priority equ 0F00h
initial_PSW equ system_mode + max_priority
It is generally appropriate to initialize the XA in System Mode so that the start-up code has
unrestricted access to the entire architecture. This is done by using a initial value that sets the
PSWH bit SM.
Philips recommends initializing the execution priority of the start-up code to the highest possible
value of 15 (that is, IM0 through IM3 to all ones) so that the start-up code is recognizable as the
highest priority process. As described above, the hardware initialization sequence turns off all
possible interrupts, so the only potential interrupting process would arise from a non-maskable
interrupt (NMI). It is generally a good idea to prevent NMI generation with a hardware lock-out
until XA start-up procedures are completed.
The PSWH initialization value given in this example sets System Mode (SM), selects register
bank 0 (any register bank could be used) and clears TM so that Trace Mode is inactive.