Hitachi NJI-350B Video Game Controller User Manual


 
Chapter 5 Instruction Specifications
5-70
Item number Application instructions-3 Name Bit test
Ladder format Condition code
Processing time (µs)
Remark
R7F4 R7F3 R7F2 R7F1 R7F0
Average Maximum
BTS (d, n) DER ERR SD V C Upper case: W
zzzz
31
Lower case: DW
Instruction format Number of steps
Condition Steps
BTS (d, n) 3 38
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 be tested {{{ {{
n Bit location to be tested
{{{{ {
The constant is set in
decimal.
Function
Checks the contents of the nth bit of the I/O (word or double word) specified by d, and if the result is “1,” '1' is set to C
(R7F0). If the result is “0,” C (R7F0) is reset to “0.”
The contents of d remains unaltered.
5
d
C (R7F0)
43210nn-1n+1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
If d is a word: Designates the bit location depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the bit location depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
Program example
BSET
(
DR0100, WR0001
)
BRES
(
DR0102, WR0001
)
BTS
(
DR0104, WR0001
)
R000 = R7F0
X00000 DIF200
LD X00000
AND DIF200
[
BSET
(
DR0100, WR0001
)
BRES
(
DR0102, WR0001
)
BTS
(
DR0104, WR0001
)
R000 = R7F0
]
BTS (d, n)