Hitachi NJI-350B Video Game Controller User Manual


 
Chapter 5 Instruction Specifications
5-88
Item number Application instructions-16 Name Two's complement (NEGATE)
Ladder format Condition code
Processing time (µs)
Remark
R7F4 R7F3 R7F2 R7F1 R7F0
Average Maximum
NEG (d) DER ERR SD V C Upper case: W
zzzzz 22
Lower case: DW
Instruction format Number of steps
Condition Steps
NEG (d) 2 29
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 I/O to take complement {{ {{
Function
Calculates two's complements of d (Reverses each bit contained in d and adds “1.” However, C (R7F0) remains
unchanged).
1100110000011010
0011001111100101
0011001111100110
1
Before execution
After execution
+
Notes
Use edge trigger as the startup condition for this instruction.
Program example
LD R000
AND DIF0
[
NEG WR0000
]
NEG
(WR0000)
R000 DIF0
Program description
When R000 rises, 2's complement of the content of WR0000 is obtained.
Example) If WR0000 is H1234, WR0000 = HEDCC after the instruction is executed;
WR0000 = H1234 when executed again
NEG (d)