Hitachi NJI-350B Video Game Controller User Manual


 
Chapter 5 Instruction Specifications
5-48
Item number Arithmetic instructions-3 Name BCD addition (BCD ADDITION)
Ladder format Condition code
Processing time (µs)
Remark
R7F4 R7F3 R7F2 R7F1 R7F0
Average Maximum
d = s1 B+ s2 DER ERR SD V C Upper case: W
zzz
115
Lower case: DW
Instruction format Number of steps
Condition Steps
d = s1 B+ s2 Word 4 177
Double word 6
Bit Word Double word
Usable I/O
XY
R,
M
TD, SS,
CU, CT WX WY
WR,
WM TC DX DY
DR,
DM
Constant
Other
d Substitution destination {{{ {{
s1 Augend {{{{{{{{
s2 Addend
{{{{{{{{
Function
Adds s1 and s2 as the BCD data, and stores the result in d as the BCD data.
The C flag is set to “1” if there is a digit increase, and “0” if not.
The DER flag is set to “1” if the operation result s1 and s2 are invalid as the BCD data. If so, operation is not performed
and the C flag retains the previous state without outputting to d. If the s1 and s2 are valid as the BCD data, the DER is set to
“0.”
When s1, s2 are words: 0000 to 9999 (BCD)
When s1, s2 are double words: 00000000 to 99999999 (BCD)
Notes
The combinations of d, s1 and s2 are as follows.
ds1s2
Word Word Word
Double word Double word Double word
Program example
X00000 DIF0
WR002= WR000 B + WR001
LD X00000
AND DIF0
[
WR002 = WR000 B+ WR001
]
Program description
The sum of WR000 and WR001 values is substituted into WR002 as the BCD data at the leading edge of input X00000.
d = s1 B+ s2