Hitachi NJI-350B Video Game Controller User Manual


 
Chapter 5 Instruction Specifications
5-52
Item number Arithmetic instructions-7 Name BCD multiplication (BCD MULTIPLICATION)
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
zzzz 164
Lower case: DW
Instruction format Number of steps
Condition Steps
d = s1 B× s2
Word 4 447
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 Multiplicand {{{{{{{{
s2 Multiplier {{{{{{{{
Function
Multiplies s1 and s2 as the BCD data, and substitutes the result into d+1 (upper digit) and d (lower digit) as the BCD data.
The DER flag is set to “1” if s1 or s2 is an invalid BCD data. In this case, the operation is not performed. Also, if d+1
exceeds the usable I/O range, the DER flag is set to “1” and only the lower digit word is substituted. The DER flag is set to
“0” if s1 and s2 are valid BCD data and d+1 is within the usable I/O range.
MSB 0
MSB 0
d
0
MSB
d+1
×
WR0014
WR0015
WR0016WR0017
×
Example: WR0016 = WR0014 Bx WR0015
DR0016
WR0019
×
DR0018
WR0018
WR0021
DR0020
WR0020
WR0023
DR0022
WR0022WR0025 WR0024
s1
d+1
d+1
DR0024
Example: DR0022 = DR0018 Bx DR0020
s2
s1
s2
d
s1
s2
d
Notes
The combinations of d, s1 and s2 are as follows:
ds1s2
Word Word Word
Double word Double word Double word
Since the operation results are always substituted into d and d + 1, note that the word or double-word at d + 1 is not used as
the I/O of others.
Program example
X00000
WR0016 = WR0014 B* WR0015
LD X00000
[
WR0016 = WR0014 B * WR0015
]
Program description
When input X00000 is on, the product of WR0014 value and WR0015 value is substituted into WR0016 as the BCD data.
d = s1 B x s2