333
ROM Correction Function (ROMC)
Chapter 9
Siemens VDO Preliminary User’s Manual U17566EE1V2UM00
S
iemens
VDO
spe
ci
fic
JCP
document
9.2.1
“DBTRAP” ROM correction operation
The “DBTRAP” ROM correction unit compares the address on the V850 fetch
bus (VFB) with the contents of the programmable correction address registers
CORADm. If an address matches, the DBTRAP instruction opcode is put on
the V850 fetch bus instead of the ROM contents. If no address matches, the
ROM contents is passed on the fetch bus as normal.
The DBTRAP exception branches to the DBTRAP/ILGOP exception handler
address 0000 0060
H
, which comprises the user’s ROM correction instructions.
Since the ROM correction routines for all correction channels are invoked at
the DBTRAP exception handler address 0000 0060
H
, the exception handler
has to evaluate first the right correction routine to be executed. This is done by
reading the DBPC register, which holds the address next to the correction
address of CORADm, which has caused the DBTRAP exception. If non of
CORADm matches DBPC - 2, DBTRAP was generated by an illegal opcode
detection event ILGOP. For further details concerning DBTRAP/ILGOP
handling refer to
“Exception Trap“ on page 222
.
Figure 9-2
outlines a typical program flow for using the “DBTRAP” ROM
correction.
1. If the address CORADm to be corrected and the fetch address of the
internal ROM memory match, the instruction code fetched from ROM is
replaced by the DBTRAP instruction.
2. When the DBTRAP instruction is executed, execution branches to address
0000 0060
H
.
3. The DBTRAP evaluation routine identifies the cause of the DBTRAP
exception and launches either the appropriate ROM correction routine or
the ILGOP handler.
4. In case several consecutive ROM instruction are replaced by ROM
correction code the return address in DBPC must be corrected. It may also
be required to correct some flags in the DBPSW register.
5. Return processing is started by the DBRET instruction.
electronic components distributor