# Bitwise boolean instructions

Opcode | P/U | Category | Description |

`AND` |
user | ALU: boolean | AND |

`IGF` |
user | ALU: boolean | ignorant false |

`IGT` |
user | ALU: boolean | ignorant true |

`LANR` |
user | ALU: boolean | left AND NOT right |

`LONR` |
user | ALU: boolean | left OR NOT right |

`NAND` |
user | ALU: boolean | NAND |

`NL` |
user | ALU: boolean | NOT left |

`NOR` |
user | ALU: boolean | NOR |

`NR` |
user | ALU: boolean | NOT right |

`OR` |
user | ALU: boolean | OR |

`RANL` |
user | ALU: boolean | right AND NOT left |

`RONL` |
user | ALU: boolean | right OR NOT left |

`XL` |
user | ALU: boolean | exactly left |

`XNOR` |
user | ALU: boolean | exclusive NOR |

`XOR` |
user | ALU: boolean | exclusive OR |

`XR` |
user | ALU: boolean | exactly right |

All 16 bitwise boolean operations use exactly the same flag semantics, namely, `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`AND`

AND

Syntax options |

`c = a and b` |

`c = a & b` |

`c = !a !| !b (De Morgan’s theorem)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`AND`

sets the destination to the bitwise AND of its operands. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`IGF`

Ignorant false

Syntax |

`c = a igf b` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
always cleared |

`Z` |
always set |

`T` |
flag does not change |

`R` |
flag does not change |

`IGF`

sets the destination to all zeros, clears `N`

, and sets `Z`

. `T`

and `R`

do not change.

`IGT`

Ignorant true

Syntax |

`c = a igt b` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
always set |

`Z` |
always cleared |

`T` |
flag does not change |

`R` |
flag does not change |

`IGT`

sets the destination to all ones, sets `N`

, and clears `Z`

. `T`

and `R`

do not change.

`LANR`

Left and not right

Syntax options |

`c = a lanr b` |

`c = a & !b` |

`c = !a !| b (De Morgan’s theorem)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`LANR`

sets the destination to the bitwise AND of the left operand with the bitwise complement of the right operand. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`LONR`

Left or not right

Syntax options |

`c = a lonr b` |

`c = a | !b` |

`c = !a !& b (De Morgan’s theorem)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`LONR`

sets the destination to the bitwise OR of the left operand with the bitwise complement of the right operand. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`NAND`

`NAND`

Syntax options |

`c = a nand b` |

`c = a !& b` |

`c = !a | !b (De Morgan’s theorem)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`NAND`

sets the destination to the bitwise NAND of its operands. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`NL`

Not left

Syntax |

`c = a nl b` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`NL`

sets the destination to the bitwise NOT of the left operand. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`NOR`

`NOR`

Syntax options |

`c = a nor b` |

`c = a !| b` |

`c = !a & !b (De Morgan’s theorem)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`NOR`

sets the destination to the bitwise NOR of its operands. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`NR`

Not right

Syntax options |

`c = a nr b` |

`c = not b` |

`c = !b` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`NR`

sets the destination to the bitwise NOT of the right operand. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`OR`

`OR`

Syntax options |

`c = a or b` |

`c = a | b` |

`c = !a !& !b (De Morgan’s theorem)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`OR`

sets the destination to the bitwise OR of its operands. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`RANL`

Right and not left

Syntax options |

`c = a ranl b` |

`c = !a & b` |

`c = a !| !b (De Morgan’s theorem)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`RANL`

sets the destination to the bitwise AND of the right operand with the bitwise complement of the left operand. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`RONL`

Right or not left

Syntax options |

`c = a ronl b` |

`c = !a | b` |

`c = a !& !b (De Morgan’s theorem)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`RONL`

sets the destination to the bitwise OR of the right operand with the bitwise complement of the left operand. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`XL`

Exactly left

Syntax |

`c = a xl b` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`XL`

copies the left operand to the destination. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`XNOR`

Exclusive `NOR`

Syntax options |

`c = a xnor b` |

`c = a !^ b` |

`c = a ^ !b (by negation)` |

`c = !a ^ b (by negation)` |

`c = !a !^ !b (by negation)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`XNOR`

sets the destination to the bitwise XNOR of its operands (the opposite of `XOR`

). `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`XOR`

Exclusive `OR`

Syntax options |

`c = a xor b` |

`c = a ^ b` |

`c = a !^ !b (by negation)` |

`c = !a !^ b (by negation)` |

`c = !a ^ !b (by negation)` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`XOR`

sets the destination to the bitwise XOR of its operands. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.

`XR`

Exactly right

Syntax |

`c = a xr b` |

Register | Signedness |

All | ignored |

1 opcode only |

Flag | Set if and only if |

`N` |
bit 35 of the result is set |

`Z` |
all result bits are zero |

`T` |
flag does not change |

`R` |
flag does not change |

`XR`

copies the right operand to the destination. `N`

and `Z`

are set as if the destination is a signed register. `T`

and `R`

do not change.