5 ext register and data extension – Epson S1C63000 User Manual
Page 14
8
EPSON
S1C63000 CORE CPU MANUAL
CHAPTER 2: ARCHITECTURE
• Notes in numbering operations
When performing a numbering operation, set operands in correct notation according to the radix
before operation.
For example, if a decimal operation is done for hexadecimal values (AH to FH), the correct operation
result is not obtained as shown in the following example.
Example:
ADC %B,%A,10
Setting value
Result
F register
B register
A register
B register
E
I
C
Z
1
1001B(9)
1001B(9)
1000B(8)
0
–
1
0
●
●
2
0101B(AH)
1001B(9)
1001B(9)
0
–
1
0
▲
▲
3
1010B(AH)
1010B(AH)
1010B(AH)
0
–
1
0
×
4
1010B(AH)
1111B(FH)
1111B(FH)
0
–
1
0
×
Example 1 operates correctly because a decimal value is loaded in the B and A registers.
Examples 3 and 4 do not operate correctly.
Example 2 operates correctly even though it is a wrong setting.
2.1.5 EXT register and data extension
The S1C63000 has a linear 64K-word addressable space, therefore it is required to handle 16-bit address
data. The EXT register and the F flag that extend 8-bit data into 16-bit data permit 16-bit data processing.
The EXT register is an 8-bit register for storing extension data. The E flag indicates that the EXT register
data is valid (extended addressing mode), and is set to "1" by writing data to the EXT register. The E flag
is reset at 1 cycle after setting (during executing the next instruction), therefore an EXT register data is
valid only for the executable instruction immediately after writing. However, that executable instruction
must be a specific instruction which permits the extended addressing to extend the data using the EXT
register. These instructions are specified in "Instruction List" and "Detailed Explanation of Instructions".
Make sure of the instructions when programming.
Note: Do not use instructions (see Instruction List) which are invalid for the extended addressing when
the E flag is set to "1". (Do not use them following instructions that write data to the EXT register or
that set the E flag.) Normal operations cannot be guaranteed if such instructions are used.
(1) Operation for EXT register and E flag (flag register)
The following explains the operation for the EXT register and the E flag (flag register).
• Data setting to the EXT register
The following two instructions are provided to set data in the EXT register.
LDB
%EXT,imm8
Loads an 8-bit immediate data to the EXT register
LDB
%EXT,%BA
Loads the content of the BA register to the EXT register
By executing the instruction, the EXT flag is set to "1" and it indicates that the content of the EXT
register is valid (the content of the EXT register will be used for data extension in the following
instructions).
Furthermore, the content of the EXT register can be read using the instruction below.
LDB
%BA,%EXT
Loads the content of the EXT register to the BA register
• Setting/resetting the E flag
As mentioned above, the E flag is set to "1" by data setting to the EXT register and reset to "0" while
executing the next instruction.
In addition, the E flag can be set/reset using the following instructions that operate the flags.
LD
%F,%A
Writes all the flag data
LD
%F,imm4
Writes all the flag data
AND
%F,imm4
Resets flag(s)
OR
%F,imm4
Sets flag(s)
XOR
%F,imm4
Inverts flag(s)