prev next contents
iadd

add two integers

Jasmin Syntax


    iadd

Stack

Before

After
value1
result
value2
...
...

Description

Pops two integers from the operand stack, adds them, and pushes the integer result back onto the stack. On overflow, iadd produces a result whose low order bits are correct, but whose sign bit may be incorrect.

Example


bipush  5       ; push first int
bipush  4       ; push second int
iadd            ; add integers

                ; the top of the stack now
                ; contains the integer 9

Bytecode

Type

Description
u1
iadd opcode = 0x60 (96)
See Also

ladd, fadd, dadd


prev next contents
Java Virtual Machine, by Jon Meyer and Troy Downing, O'Reilly Associates