NEC PD17062 Datasheet page 64

Mos integrated circuit 4-bit single-chip microcontroller containing pll frequency synthesizer and image display controller
Table of Contents

Advertisement

8.5.5 For MPE = 0 and IXE = 1 (Index Modification)
As shown in Table 8-2, when a data memory manipulation instruction is executed, the bank and row address
of the data memory specified directly by the instruction are ORed with the index register. Then, the instruction
is executed in the data memory address specified by the operation result (real address).
Example 1. When the row address of the general-purpose register is 0 for BANK0
MOV
IXL,
MOV
IXM,
MOV
IXH,
OR
PSW,
ADD
03H,
When the above instruction is executed, the contents of the data memory at address 13H and
the contents of the general-purpose register at address 03H are added and the result stored
in the general-purpose register at address 03H.
This means that the ADD r, m instruction performs the OR operation on the address (in the
above case, 11H of BANK0) specified by m and the index register value (in the above case,
000000010B), the result becoming the real address (in the above case, 13H of BANK0). Then,
the instruction is executed at the real address. (See Fig. 8-5.)
Compared to IXE = 0 (Example 1 in Section 8.5.3), the address of the data memory specified
directly by the instruction is modified (OR operation) by the index register.
Example 2. To clear all bank data memories to 0
MOV
MOV
MOV
LOOP:
OR
MOV
INC
AND
SKT
BR
ADD
ADDC
SKF
SKT
BR
64
#0010B
; IX
000000010B
#0000B
; MPE
0
#0000B
;
#0001B
; IXE
1
11H
IXL,
#0
;
IXM,
#0
; IX
0
IXH,
#0
;
PSW,
#0001B ; IXE
1
00H,
#0
; Sets data memory specified by IX to 0.
IX
; IX
IX + 1
PSW,
#1110B ; IXE
0; IXE is not modified by IX because the address
; is 7FH.
IXM,
#0111B ; Is row address 7 reached?
LOOP
; LOOP if not 7
IXM,
#1
; Specifies the next bank without clearing row address 7.
IXH,
#0
;
IXM,
#1000B ; Were banks cleared up to BANK2?
IXH,
#0001B ;
LOOP
; LOOP unless cleared
PD17062

Advertisement

Table of Contents
loading

Table of Contents