Contents Prev Next Up

## The Virtual Machine Instruction Set

# Logical Instructions

ishl
ishr
iushr
lshl
lshr
lushr
iand
land
ior
lor
ixor
lxor

### ishl

Integer shift left

    ..., value1, value2 => ..., result

value1 and value2 should be integers. value1 is shifted left by the amount indicated by the low five bits of value2. The integer result replaces both values on the stack.

### ishr

Integer arithmetic shift right

    ..., value1, value2 => ..., result

value1 and value2 should be integers. value1 is shifted right arithmetically (with sign extension) by the amount indicated by the low five bits of value2. The integer result replaces both values on the stack.

### iushr

Integer logical shift right

    ..., value1, value2 => ..., result

value1 and value2 should be integers. value1 is shifted right logically (with no sign extension) by the amount indicated by the low five bits of value2. The integer result replaces both values on the stack.

### lshl

Long integer shift left

    ..., value1-word1, value1-word2, value2 => ..., result-word1, result-word2

value1 should be a long integer and value2 should be an integer. value1 is shifted left by the amount indicated by the low six bits of value2. The long integer result replaces both values on the stack.

### lshr

L
ong integer arithmetic shift right

    ..., value1-word1, value1-word2, value2 => ..., result-word1, result-word2

value1 should be a long integer and value2 should be an integer. value1 is shifted right arithmetically (with sign extension) by the amount indicated by the low six bits of value2. The long integer result replaces both values on the stack.

### lushr

Long integer logical shift right

    ..., value1-word1, value1-word2, value2-word1, value2-word2 => ..., result-word1, result-word2

value1 should be a long integer and value2 should be an integer. value1 is shifted right logically (with no sign extension) by the amount indicated by the low six bits of value2. The long integer result replaces both values on the stack.

### iand

Integer boolean and

    ..., value1, value2 => ..., result

value1 and value2 should both be integers. They are replaced on the stack by their bitwise conjunction (AND).

### land

Long integer boolean and

    ..., value1-word1, value1-word2, value2-word1, value2-word2 => ..., result-word1, result-word2

value1 and value2 should both be long integers. They are replaced on the stack by their bitwise conjunction (AND).

### ior

Integer boolean or

    ..., value1, value2 => ..., result

value1 and value2 should both be integers. They are replaced on the stack by their bitwise disjunction (OR).

### lor

Long integer boolean or

    ..., value1-word1, value1-word2, value2-word1, value2-word2 => ..., result-word1, result-word2

value1 and value2 should both be long integers. They are replaced on the stack by their bitwise disjunction (OR).

### ixor

Integer boolean xor

    ..., value1, value2 => ..., result

value1 and value2 should both be integers. They are replaced on the stack by their bitwise exclusive disjunction (XOR).

### lxor

Long integer boolean xor

    ..., value1-word1, value1-word2, value2-word1, value2-word2 => ..., result-word1, result-word2

value1 and value2 should both be long integers. They are replaced on the stack by their bitwise exclusive disjunction (XOR).

Contents Prev Next Up

Generated with CERN WebMaker