CIL中的普通操作码和简短操作码有什么区别? [英] What is the difference between normal and shortform opcodes in CIL?

查看:83
本文介绍了CIL中的普通操作码和简短操作码有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在CIL中浏览各种操作码,我发现很多类似的代码,例如
Beq,Beq_S
Bge,Bge_S
Bgt,Bgt_S
Br,Br_S

I am going through various opcodes in CIL and I find a lot of similar looking codes like Beq,Beq_S Bge,Bge_S Bgt,Bgt_S Br,Br_S

其中S被认为是简写形式。

Where S is supposedly "short form". What does that mean??

推荐答案

指令的简短形式占用更少的空间(即, CIL指令本身较短,因此您的程序集将占用更少的磁盘或内存空间。因此,如果适用,通常将首选它们。但是,权衡是与指令的完整形式相比,它们的范围有限(例如,分支目标偏移量必须在字节内而不是整数内)。

The short forms of the instructions take up less space (that is, the binary encoding of the CIL instructions are themselves shorter, so your assembly will take up less space on disk or in memory). Therefore, they would typically be preferred when applicable. However, the tradeoff is that they have limited ranges compared to the full forms of the instructions (e.g. branch target offsets must fit within bytes instead of ints).

这篇关于CIL中的普通操作码和简短操作码有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆