.net - CIL - What is the difference between ldc.i4 33 and ldc.i4.33? -
i'm trying figure out cil code. seems these 2 statements same thing (according have read).
ldc.i4 33
and
ldc.i4.33
both supposedly "load int32 onto stack of value 33".
is correct? why? have thought ldc.i4.33
"load integer local variable index 33 onto stack".
where going wrong here?
the opcode ldc.i4.33
doesn't exist.
there's few special (called macro) opcodes, from:
ldc.i4.m1 // has same effect as: ldc.i4 -1
to
ldc.i4.8 // has same effect as: ldc.i4 8
but short form of ldc.i4
opcode, common cases, optimize cil size.
similarly, ldloc.0
short form (i.e. has more compact cil encoding, doing same as) ldloc 0
, etc.
Comments
Post a Comment