Download MC81F8816/8616

Transcript
MC81F8816/8616
8.4 Addressing Mode
The MC81F8816/8616 use six addressing modes;
(3) Direct Page Addressing → dp
• Register addressing
In this mode, a address is specified within direct page.
• Immediate addressing
Example; G=0
• Direct page addressing
C535
LDA
;A ←RAM[35H]
35H
• Absolute addressing
• Indexed addressing
35H
• Register-indirect addressing
data
2
~
~
(1) Register Addressing
Register addressing accesses the A, X, Y, C and PSW.
~
~
0E550H
C5
0E551H
35
1
data → A
(2) Immediate Addressing → #imm
In this mode, second byte (operand) is accessed as a data
immediately.
(4) Absolute Addressing → !abs
Example:
0435
ADC
#35H
MEMORY
04
A+35H+C → A
35
Absolute addressing sets corresponding memory data to
Data, i.e. second byte (Operand I) of command becomes
lower level address and third byte (Operand II) becomes
upper level address.
With 3 bytes command, it is possible to access to whole
memory area.
ADC, AND, CMP, CMPX, CMPY, EOR, LDA, LDX,
LDY, OR, SBC, STA, STX, STY
Example;
0735F0
ADC
When G-flag is 1, then RAM address is defined by 16-bit
address which is composed of 8-bit RAM paging register
(RPR) and 8-bit immediate data.
Example: G=1, RPR=01H
E45535
LDM
~
~
0F100H
data
0135H
1
0F100H
42
~
~
data
0F035H
35H,#55H
data ← 55H
;A ←ROM[0F035H]
!0F035H
2
~
~
1
A+data+C → A
07
0F101H
35
0F102H
F0
address: 0F035
~
~
E4
0F101H
55
0F102H
35
December 3, 2012 Ver 1.03