Contents Prev Next Up


3.9 Logical Instructions

ishl

Integer shift left
 
ishl = 120

Stack: ..., value1, value2 => ..., result

value1 and value2 must 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
 
ishr = 122

Stack: ..., value1, value2 => ..., result

value1 and value2 must 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
 
iushr = 124

Stack: ..., value1, value2 => ..., result

value1 and value2 must 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
 
lshl = 121

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

value1 must be a long integer and value2 must 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

Long integer arithmetic shift right
 
lshr = 123

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

value1 must be a long integer and value2 must 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
 
lushr = 125

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

value1 must be a long integer and value2 must 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
 
iand = 126

Stack: ..., value1, value2 => ..., result

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

land

Long integer boolean AND
 
land = 127

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

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

ior

Integer boolean OR
 
ior = 128

Stack: ..., value1, value2 => ..., result

value1 and value2 must both be integers. They are replaced on the stack by their bitwise logical or (disjunction).

lor

Long integer boolean OR
 
lor = 129

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

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

ixor

Integer boolean XOR
 
ixor = 130

Stack: ..., value1, value2 => ..., result

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

lxor

Long integer boolean XOR
 
lxor = 131

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

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


Contents Prev Next Up