S = operand stack V = local variable array, V[0..num_vars) Instruction operands: = local variable index (unsigned) = byte (signed) = element size in bytes (unsigned) = field offset in struct in bytes (unsigned) = = pool index = (c1<<8|c2) (unsigned) = = pc offset = (o1<<8|o2) (signed) Stack operands: a : * = address ("reference") x, i, n : w32 = 32 bit word representing an int, bool, or char ("primitive") v = arbitrary value (v:* or v:w32) Stack operations 0x59 dup S, v -> S, v, v 0x57 pop S, v -> S 0x5F swap S, v1, v2 -> S, v2, v1 Arithmetic 0x60 iadd S, x:w32, y:w32 -> S, x+y:w32 0x7E iand S, x:w32, y:w32 -> S, x&y:w32 0x6C idiv S, x:w32, y:w32 -> S, x/y:w32 0x68 imul S, x:w32, y:w32 -> S, x*y:w32 0x80 ior S, x:w32, y:w32 -> S, x|y:w32 0x70 irem S, x:w32, y:w32 -> S, x%y:w32 0x78 ishl S, x:w32, y:w32 -> S, x< S, x>>y:w32 0x64 isub S, x:w32, y:w32 -> S, x-y:w32 0x82 ixor S, x:w32, y:w32 -> S, x^y:w32 Local Variables 0x15 vload S -> S, v v = V[i] 0x36 vstore S, v -> S V[i] = v Constants 0x01 aconst_null S -> S, null:* 0x10 bipush S -> S, x:w32 (x = (w32)b, sign extended) 0x13 ildc S -> S, x:w32 (x = int_pool[(c1<<8)|c2]) 0x14 aldc S -> S, a:* (a = &string_pool[(c1<<8)|c2]) Control Flow 0x00 nop S -> S 0x9F if_cmpeq S, v1, v2 -> S (pc = pc+(o1<<8|o2) if v1 == v2) 0xA0 if_cmpne S, v1, v2 -> S (pc = pc+(o1<<8|o2) if v1 != v2) 0xA1 if_icmplt S, x:w32, y:w32 -> S (pc = pc+(o1<<8|o2) if x < y) 0xA2 if_icmpge S, x:w32, y:w32 -> S (pc = pc+(o1<<8|o2) if x >= y) 0xA3 if_icmpgt S, x:w32, y:w32 -> S (pc = pc+(o1<<8|o2) if x > y) 0xA4 if_icmple S, x:w32, y:w32 -> S (pc = pc+(o1<<8|o2) if x <= y) 0xA7 goto S -> S (pc = pc+(o1<<8|o2)) 0xBF athrow S, a:* -> S (c0_user_error(a)) 0xCF assert S, x:w32, a:* -> S (c0_assertion_failure(a) if x == 0) Functions 0xB8 invokestatic S, v1, v2, ..., vn -> S, v (function_pool[c1<<8|c2] => g, g(v1,...,vn) = v) 0xB0 return ., v -> . (return v to caller) 0xB7 invokenative S, v1, v2, ..., vn -> S, v (native_pool[c1<<8|c2] => g, g(v1,...,vn) = v) Memory 0xBB new S -> S, a:* (*a is now allocated, size ) 0xBC newarray S, n:w32 -> S, a:* (a[0..n) now allocated) 0xBE arraylength S, a:* -> S, n:w32 (n = \length(a)) 0x62 aaddf S, a:* -> S, (a+f):* (a != NULL; f field offset) 0x63 aadds S, a:*, i:w32 -> S, (a+s*i):* (a != NULL, 0 <= i < \length(a)) 0x2E imload S, a:* -> S, x:w32 (x = *a, a != NULL, load 4 bytes) 0x2F amload S, a:* -> S, b:* (b = *a, a != NULL, load address) 0x4E imstore S, a:*, x:w32 -> S (*a = x, a != NULL, store 4 bytes) 0x4F amstore S, a:*, b:* -> S (*a = b, a != NULL, store address) 0x34 cmload S, a:* -> S, x:w32 (x = (w32)(*a), a != NULL, load 1 byte) 0x55 cmstore S, a:*, x:w32 -> S (*a = x & 0x7f, a != NULL, store 1 byte)