Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between normal and shortform opcodes in CIL?

Tags:

cil

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

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

like image 941
gradientt Avatar asked Feb 23 '12 09:02

gradientt


People also ask

What is an opcode and operand?

Opcodes and operandsThe opcode is the instruction that is executed by the CPU and the operand is the data or memory location used to execute that instruction.


1 Answers

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).

like image 140
kvb Avatar answered Sep 24 '22 10:09

kvb