BIC BIT CLEAR
Purpose |
perform complemented AND of two integers |
Format |
opcode mask.rx, dst.mx 2 operand opcode mask.rx, src.rx, dst.wx 3 operand |
Operation |
dst ßdst AND {NOT mask}; 2 operand dst ß src AND {NOT mask}; 3 operand |
Condition codes |
N ß dst LSS 0; Z ß dst EQL 0; V ß 0; C ß C; |
Exceptions |
None |
Opcodes |
8A BICB2 Bit Clear Byte; 2 operand 8B BICB3 Bit Clear Byte; 3 operand AA BICW2 Bit Clear Word; 2 operand AB BICW3 Bit Clear Word; 3 operand CA BICL2 Bit Clear Long; 2 operand GB BICL3 Bit Clear Long; 3 operand |
Description |
In 2 operand format, the destination operand is ANDed with the ones complement of the mask operand and the destination operand is replaced by the result. In 3 operand format, the source operand is ANDed with the l’s ones complement of the mask operand and the destination operand is replaced by the result. |
Notes |
|
Example 1
The following program reset the first byte of r5 using bicl2.
.text
main: .word 0
movl $0xFFFFFFFF, r5
bicl2 $0xFF, r5
pushl r5
pushal format
calls $2, .printf
pushl $0
calls $1, .exit
.data
format: .asciz "%X\n"
Example 2
The following program resets the first byte of r5 using bicl3 and stores the result on r6.
.text
main: .word 0
movl $0xFFFFFFFF, r5
bicl3 $0xFF, r5, r6
pushl r6
pushal format
calls $2, .printf
pushl $0
calls $1, .exit
.data
format: .asciz "%lX\n"
Example 3
The following example demonstrates the effects of BIS and BIC on VAX11 flags.
.text
main: .word 0
movb $0, r4
bisb2 $0xf , r4 # All flags are zero, r4 = 0xF
bisb2 $0xf0 , r4 # N = 1, r4 = 0xFF
bisl2 $0xf0 , r4 # All flags are zero, r4 = 0xFF
bicb2 $0xff , r4 # Z = 1, r4 = 0x00
bicb2 $0xff , r4 # Z = 1, r4 = 0x00
movb $0xFF , r1
incb r1
bisl2 $0x80000000 , r4 # N = 1, C = 1
bisw2 $0x0F0F , r4 # N = 0, C = 1, r4 = 0x80000F0F
bicl2 $0xFFFFFFFF, r4 # Z = 1, C = 1
halt