I am a newbee in Java Bytecode. I was understanding the bytecode through some examples but I got stuck in an example.
These are my java and bytecode file
iconst_n is defined for n from 0 to 5
There's no iconst_9
, so you have to use the equivalent (but less efficent) bipush
the i_const instruction only range from 0~5, so it must spit the instuction by push and store
there is no iconst_9 instruction
The instructions iconst_* are optimised to work with small and specific numbers while bipush (push a byte onto the stack as an integer value) works for bigger numbers.
There is no iconst_9
instruction. So to push 9 you cannot use iconst. You must go for bipush
iconst
can push constant values -1 to 5. It is a single-byte instruction.
bipush
can push constant values between -128 and 127. It is a two-byte instruction.
To push 9 you cannot use iconst
. There is no iconst_9
instruction.