Java Virtual Machine (Java Series)

prev next contents
ishl

integer shift left

Jasmin Syntax

ishl Stack

Before

After
value1 result
value2 ...
...
Description

Pops two ints off the stack. Shifts value2 left by the amount indicated in the five low bits of value1. The int result is then pushed back onto the stack.

This is the same as computing the expression:

x * 2s

where s is value1 and x is value2.

Example

; This is like the Java code: ; int x; ; x <<= 3; ; iload_1 ; push integer in local variable 1 onto stack iconst_3 ; push the integer 3 onto the stack ishl ; shift left istore_1 ; store the result in local variable 1 Bytecode

Type

Description
u1 ishl opcode = 0x78 (120)
See Also

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


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

Категории