![](http://datasheet.mmic.net.cn/Renesas-Electronics-America/UPD78F4225YGC-8BT-A_datasheet_99861/UPD78F4225YGC-8BT-A_514.png)
512
CHAPTER 26
ROM CORRECTION
User’s Manual U12697EJ4V1UD
26.5 Conditions for Executing ROM Correction
In order to use the ROM correction function, it is necessary for the external environment and program to satisfy
the following conditions.
(1) External environment
Must be connected externally to an inactive memory, and be configured to read that data.
(2) Target program
The data setting instruction for CORC, CORAH and CORAL must be previously annotated in the target program
(program stored in the ROM).
The setting data (the items written in lower case in the setting example below) must be read from the external
inactive memory, and the correct number of required correction pointers must be set.
Example of four pointer settings
MOV
CORC,
#00H
; Specified channel 0
MOVW
CORAL, #ch0_datal
; Sets the channel 0 match address
MOV
CORAH, #ch0_datah
; Sets the channel 0 match address
MOV
CORC,
#01H
; Specified channel 1
MOVW
CORAL, #ch1_datal
; Sets the channel 1 match address
MOV
CORAH, #ch1_datah
; Sets the channel 1 match address
MOV
CORC,
#02H
; Specified channel 2
MOVW
CORAL, #ch2_datal
; Sets the channel 2 match address
MOV
CORAH, #ch2_datah
; Sets the channel 2 match address
MOV
CORC,
#03H
; Specified channel 3
MOVW
CORAL, #ch3_datah
; Sets the channel 3 match address
MOV
CORAH, #ch3_datal
; Sets the channel 3 match address
MOV
CORC,
#romcor en
; Sets 00H when correction is disabled
; Sets F0H when correction is operated
$NORMAL
BR
! ! COR_ADDR0
; Specifies the address of the correction program (channel 0)
BR
! ! COR_ADDR1
; Specifies the address of the correction program (channel 1)
BR
! ! COR_ADDR2
; Specifies the address of the correction program (channel 2)
BR
! ! COR_ADDR3
; Specifies the address of the correction program (channel 3)
;
(two-level branch)
NOMAL instruction
; Next instruction
(3) Setting branch instructions in the CALLT table
For the CALLT table that corresponds to each channel, in the case of the above program, the header addresses
for the BR!!COR_ADDR0, BR!!COR_ADDR1, BR!!COR_ADDR2, and BR!!COR_ADDR3 instructions are speci-
fied (COR_ADDR0 to COR_ADDR3 indicate the address where the correction program is located).
These instructions are branched by the CALLT instruction and BR instruction into two levels because only the
base area can be branched to with CALLT. There is no need to branch these instructions into two levels when
they are to be attached to the RAM base area with the LOCATION instruction.