25 lines
260 B
Text
25 lines
260 B
Text
|
.constant
|
||
|
OBJREF 0x40
|
||
|
.end-constant
|
||
|
|
||
|
.main
|
||
|
LDC_W OBJREF
|
||
|
BIPUSH 0xF9
|
||
|
INVOKEVIRTUAL even
|
||
|
HALT
|
||
|
.end-main
|
||
|
|
||
|
.method even(x)
|
||
|
.var
|
||
|
.end-var
|
||
|
ILOAD x
|
||
|
BIPUSH 0x01
|
||
|
IAND
|
||
|
IFEQ even
|
||
|
BIPUSH 0x00
|
||
|
IRETURN // odd
|
||
|
even:
|
||
|
BIPUSH 0x01
|
||
|
IRETURN // even
|
||
|
.end-method
|