iand

Integer bitwiseAND

Bytecode

Type Description
u1 iand opcode = 0x7E (126)

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

Description

Computes the bitwise and of value1 and value2.

Both value1 and value2 must be of type int. They are popped from the operand stack.

An int result is calculated by taking the bitwise AND (conjunction) of value1 and value2. The result is pushed onto the operand stack.

Example

; This is like the Java code:
;       int x;
;       x &= 2;
;
iload_1          ; push integer in local variable 1 onto stack
iconst_2         ; push the integer 2 onto the stack
iand             ; compute the bitwise and
istore_1         ; store the result in local variable 1