
CHAPTER 2: ARCHITECTURE
2.3.2 Addressing for data memory
For addressing to access the data memory, the index registers X and Y, and stack pointers SP1 and SP2 are used. (The next section will explain the stack pointers.)
Index registers X and Y are both
Example: |
|
|
LDB | %EXT,0x00 |
|
LDB | %XL,0x10 | ...Sets 0010H in the X register |
LD | A,[%X] | ...Loads the content of the memory address 0010H into the A register |
The indirect addressing with the X or Y register permits use of the
Example: To copy the
LD [%Y]+,[%X]+
LD [%Y]+,[%X]+
LD [%Y],[%X]
In addition, the S1C63000 has also provided instructions in order to efficiently access only the area which is accessed frequently such as the I/O memory and lower addresses.
One of that is the addressing using the EXT register explained in Section 2.1.5.
•Accessing for addresses 0000H to 00FFH
For absolute addressing in this area, the EXT register and an indirect instruction with the X register ([%X]) are used. To access this area, first write an
Example:
LDB | %EXT,0x37 |
|
LD | %A,[%X] | ...Works as "LD %A, [0x0037]" |
•Accessing for addresses FF00H to FFFFH (I/O memory area)
For absolute addressing in this area, the EXT register and an indirect instruction with the Y register ([%Y]) are used. To access this area, first write an
Example:
LDB | %EXT,0x9C |
|
ADD | [%Y],5 | ...Works as "ADD [0xFF9C], 5" |
Note: The extended addressing function using the EXT register is effective only for the instruction following immediately after writing data to the EXT register or setting the E flag to "1". For that instruction, do not use instructions other than the instructions that permit the extended addressing. Operation cannot be guaranteed if used.
In addition to the above functions, some
18 | EPSON | S1C63000 CORE CPU MANUAL |