![]() |
|
| << Previous | Next >> | |
| | |
CBM n Change Bit Mask Rabbit 4000/5000 Instruction
ED 00 n CBM n tmp = [(HL) & ~n] | [A & n]
(HL) = tmp
(DE) = tmp
Description
This instruction sets specified bits in an I/O register, where:
A = requested bits to be set in I/O register
n = 8-bit mask identifies bits that can be changed
HL = address of shadow register for I/O register
A bitwise AND operation is performed on the value in the shadow register and the inverse of the bitmask; which results in preserving any bits already set in the I/O register that are not under the bitmask. A second bitwise AND operation is performed on A and the bitmask; which results in setting all bits that are both requested (A) and allowed (n). The results of the two AND operations are then bitwise OR'd. This final answer is saved first in the shadow register and then in the I/O register.
| Rabbit Instructions | << Previous | Next >> | rabbit.com |