BIS BIT SET
Purpose |
perform logical inclusive OR of two integers |
Format |
opcode mask.rx, dst.mx 2 operand opcode mask.rx, src.rx, dst.wx 3 operand |
Operation |
dst . ß dst OR mask; 2 operand dst ß src OR mask; 3 operand |
Condition codes |
N ß dst LSS 0; Z ß dst EQL 0; V ß 0; C ß C; |
Exceptions |
None |
Opcodes |
88 BISB2 Bit Set Byte 2 Operand 89 BISB3 Bit Set Byte 3 Operand A8 BISW2 Bit Set Word 2 Operand A9 BISW3 Bit Set Word 3 Operand C8 BISL2 Bit Set Long 2 Operand C9 BISL3 Bit Set Long 3 Operand |
Description |
In 2 operand format, the mask operand is ORed with the destination operand and the destination operand is replaced by the result. In 3 operand format, the mask operand is ORed with the source operand and the destination operand is replaced by the result. |
Notes |
|
Example 1
Example of using the bisl2 opcode:
.text
main: .word 0
movl $0xF0F0F0F0, r5
bisl2 $0x0A0B0C0D, r5
pushl r5
pushal format
calls $2, .printf
pushl $0
calls $1, .exit
.data
format: .asciz "%lX\n"
The output of the program is FAFBFCFD.
Example 2
Example of using the bisl3 opcode. The output is the same as the previous example.
.text
main: .word 0
movl $0xF0F0F0F0, r5
bisl3 $0x0A0B0C0D, 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