iload与iload '_'的区别

huangapple go评论63阅读模式
英文:

Difference between iload with '_' and without

问题

I have a question about the iload instruction of Jasmin.
对于Jasmin的iload指令,是iload 1正确还是必须是iload_1?
或者当数字在1和3之间时,我们必须使用下划线 '',而其他情况则不使用下划线 ''?

I'm generating Jasmin code.
我正在生成Jasmin代码。
First, I tried every iload instruction with '', but it didn't work. Then I tried every instruction without '', and it also didn't work.
首先,我尝试了每个带有下划线 '' 的iload指令,但没有成功。然后我尝试了每个不带下划线 '' 的指令,也没有成功。

英文:

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.

答案1

得分: 2

Java字节码中包含一个通用的iload指令,该指令将一个值从0到255作为参数(因此编码为2字节)。

为了更紧凑的字节码,它包含4个特殊指令iload_0iload_3,这些指令具有固定的参数(0到3),并且仅编码为一个字节。

类似的模式也存在于几个其他字节码指令中。

iload指令在JVM规范中有描述(https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-6.html#jvms-6.5.iload)。在该页面上,您还将找到所有其他字节码指令的描述。

英文:

The Java byte code contains a generic iload instruction 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_0 to iload_3 that have a fixed argument (0 to 3) and are encoded in only one byte.

Similar patterns exist for several other byte code instructions.

The iload instructions 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.

huangapple
  • 本文由 发表于 2023年4月17日 01:15:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76029251.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定