
Section 6 ROM
Rev. 6.00 Sep 12, 2006 page 141 of 526
REJ09B0326-0600
Notes: 1. In this sample program, the stack pointer (SP) is set to address H'FF80. On-chip RAM
addresses H'FF7E and H'FF7F are used as a stack area. Therefore addresses H'FF7E
and H'FF7F should not be used when this program is executed, and on-chip RAM
should not be disabled.
2. It is assumed that this program, written in the ROM area, is transferred to the RAM
area and executed there. For #RAMSTR in the program, substitute the start address of
the RAM area to which the program is transferred. The value set for #RAMSTR must
be an even number.
FLMCR: .EQU H'FF80
EBR1: .EQU
H'FF82
EBR2: .EQU
H'FF83
TCSRW: .EQU H'FFBE
TCW: .EQU
H'FFBF
STACK: .EQU H'FF80
.ALIGN
2
START: MOV.W
#STACK, SP
;
Set stack pointer
;
Set R0 value as explained on previous page. This sample program erases
;
all blocks.
MOV.W
#H'0FFF,
R0
;
Select blocks to be erased (R0: EBR1/EBR2)
MOV.B
R0H,
@EBR1
;
Set EBR1
MOV.B
R0L,
@EBR2
;
Set EBR2
;
#RAMSTR is start address of RAM area to which program is transferred
;
Set #RAMSTR to even number
MOV.W
#RAMSTR,
R2
;
Transfer destination start address (RAM)
MOV.W
#ERVADR,
R3
;
ADD.W
R3,
R2
;
# #ERVADR
→
R2
MOV.W
#START,
R3
;
SUB.W
R3,
R2
;
Address of data area used in RAM
MOV.B
#H'00,
R1L
;
Used to test bit R1L in R0
PRETST: CMP.B #H'0C,
R1L
;
R1L = H'0C?
BEQ
ERASES
;
If finished checking all R0 bits, branch to ERASES
CMP.B
#H'08,
R1L
;
BMI
EBR2PW
;
If R1L
≥
8, EBR1 test; if R1L < 8, EBR2 test
MOV.B
R1L,
R1H
;
SUBX
#H'08,
R1H
;
R1L – 8
→
R1H
BTST
R1H,
R0H
;
Test bit R1H in EBR1 (R0H
)
BNE
PREWRT
;
If bit R1H in EBR1 (R0H) is 1, branch to PREWRT
BRA
PWADD1
;
If bit R1H in EBR1 (R0H) is 0, branch to PWADD1
EBR2PW: BTST
R1L,
R0L
;
Test bit R1L in EBR2 (R0L)
BNE
PREWRT
;
If bit R1L in EBR2 (R0L) is 1, branch to PREWRT
PWADD1: INC
R1L
;
R1L + 1
→
R1L
Содержание F-ZTAT H8/3642A Series
Страница 6: ...Rev 6 00 Sep 12 2006 page iv of xx ...
Страница 8: ...Rev 6 00 Sep 12 2006 page vi of xx ...
Страница 21: ...Rev 6 00 Sep 12 2006 page xix of xx Appendix E Product Code Lineup 522 Appendix F Package Dimensions 524 ...
Страница 22: ...Rev 6 00 Sep 12 2006 page xx of xx ...
Страница 124: ...Section 5 Power Down Modes Rev 6 00 Sep 12 2006 page 102 of 526 REJ09B0326 0600 ...
Страница 188: ...Section 6 ROM Rev 6 00 Sep 12 2006 page 166 of 526 REJ09B0326 0600 ...
Страница 190: ...Section 7 RAM Rev 6 00 Sep 12 2006 page 168 of 526 REJ09B0326 0600 ...
Страница 298: ...Section 9 Timers Rev 6 00 Sep 12 2006 page 276 of 526 REJ09B0326 0600 ...
Страница 378: ...Section 12 A D Converter Rev 6 00 Sep 12 2006 page 356 of 526 REJ09B0326 0600 ...
Страница 446: ...Section 13 Electrical Characteristics Rev 6 00 Sep 12 2006 page 424 of 526 REJ09B0326 0600 ...