
CHAPTER 2: ARCHITECTURE
•The following six instructions, which handle the X or Y register and have an
LDB | %XL,imm8 | LDB | %YL,imm8 |
ADD | %X,sign8 | ADD | %Y,sign8 |
CMP | %X,imm8 | CMP | %Y,imm8 |
When data is written to the EXT register and the E flag is set immediately before these instructions, the data is processed after extending into
Examples: |
| |
LDB | %EXT,0x15 |
|
LDB | %XL,0x7D | ...Works as "LD %X,0x157D" |
LDB | %EXT,0xB8 |
|
ADD | %X,0x4F | ...Works as "ADD %X, 0xB84F" |
LDB | %EXT,0xE6 |
|
CMP | %X,0xA2 | ...Works as "CMP %X, 0x19A2" |
|
| ∗ 19H = FFH - [EXT] (E6H) |
Above examples use the X register, but work the same even when the Y register is used.
Note: The CMP instruction performs a subtraction with a complement, therefore it is necessary to set the complement (1's complement) of the
EXT register ← [FFH -
The following PC relative branch instructions, which have a signed
JR | sign8 | JRC sign8 | JRNC sign8 | JRZ sign8 | JRNZ sign8 |
CALR sign8
When data is written to the EXT register and the E flag is set immediately before these instructions, the relative address is processed after extending into signed
Examples: |
|
| |
LDB | %EXT,0x64 |
|
|
JR | 0x29 | ...Works as "JR | 0x6429" |
LDB | %EXT,0x00 |
|
|
JR | 127 | ...Works as "JR | 127" |
LDB | %EXT,0xFF |
|
|
JR | ...Works as "JR | ||
LDB | %EXT,0x3A |
|
|
JR∗ | 0x88 | ...Works as "JR∗ | 0x3A88" (∗ = C, NC, Z, or NZ) |
LDB | %EXT,0xF8 |
|
|
CALR | 0x62 | ...Works as "CALR 0xF862" |
See Section 2.2.3, "Branch instructions" for the branch instructions.
10 | EPSON | S1C63000 CORE CPU MANUAL |