I hava a question about the iload instruction of jasmin. Is it correct to do iload 1 or it has to be iload_1? Or when is a number between 1 and 3 we have to use the '' and the others we have to not use the ''?
I m generating jasmin code. First i tried every iload intruction with '', but it didn't work. Then I tried every instruction without '', and it also didn't work.
The Java byte code contains a generic
iloadinstruction that takes a value from 0 to 255 as argument (and therefore the encoding is 2 bytes).For compacter byte code it contains 4 special instructions
iload_0toiload_3that have a fixed argument (0 to 3) and are encoded in only one byte.Similar patterns exist for several other byte code instructions.
The
iloadinstructions are described in the JVM specification (https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-6.html#jvms-6.5.iload). On that page you will also find descriptions for all the other byte code instructions.