![NEC mPD17120 Subseries Скачать руководство пользователя страница 73](http://html.mh-extra.com/html/nec/mpd17120-subseries/mpd17120-subseries_user-manual_249259073.webp)
CHAPTER 7 SYSTEM REGISTER (SYSREG)
58
Example 4. Processing an array
As shown in Figure 7-13, to perform the operation:
A(N) = A(N) + 4 (0
≤
N
≤
15)
on the element A(N) of a one-dimensional array in which an element is 8 bits, the following
instructions are executed:
M000
MEM 0.00H
M001
MEM 0.01H
MOV
IXH, #0
MOV
IXM, #N SHR 3
;
Set the offset of the row address.
MOV
IXL, #N SHL 1 AND 0FH
;
Set the offset of the column address.
OR
PSW, #.DF.IXE AND 0FH ;
IXE
←
1
ADD
M000, #4
;
ADDC
M001, #0
;
A(N)
←
A(N) + 4
In the example above, because an element is 8 bits, the value resulting from left-shifting the
N's value by 1 bit is set for the index register.
Figure 7-13. Example of Operation When MPE=0 and IXE=1 (Array Processing)
0
1
2
3
4
5
6
7
0
System register
Row address
Column address
A (0)
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
A (0)
A (8)
A (1)
A (9)
A (2)
A (10)
A (3)
A (11)
A (4)
A (12)
A (5)
A (13)
A (6)
A (14)
A (7)
A (15)
00H
01H
b
3
b
2
b
1
b
0
b
7
b
6
b
5
b
4
Содержание mPD17120 Subseries
Страница 15: ... x MEMO ...
Страница 23: ... MEMO 8 ...
Страница 45: ... MEMO 30 ...
Страница 49: ... MEMO 34 ...
Страница 55: ... MEMO 40 ...
Страница 93: ... MEMO 78 ...
Страница 99: ... MEMO 84 ...
Страница 102: ...CHAPTER 11 ARITHMETIC AND LOGIC UNIT 87 MEMO ...
Страница 119: ... MEMO 104 ...
Страница 175: ... MEMO 160 ...
Страница 199: ... MEMO 184 ...
Страница 265: ... MEMO 250 ...
Страница 281: ...266 MEMO ...
Страница 285: ... MEMO 270 ...
Страница 289: ... MEMO 274 ...