Upload
jasmyn-edmond
View
213
Download
0
Embed Size (px)
Citation preview
IL Instructions and Stack IL Instructions and Stack TransitionTransition
…
addadd additionaddition سرريز محاسبه بدون سرريز جمع محاسبه بدون جمع add.ovfadd.ovf checked additionchecked addition سرريز محاسبه با سرريز جمع محاسبه با جمع add.ovr.unadd.ovr.un checked unsigned additionchecked unsigned addition محاسبه با عالمت بدون محاسبه جمع با عالمت بدون جمعvalue1, value2 …, value1 + value2 ,… سرريزسرريز
عملياتجمع
: مثال
17
12
ldc.i4
ldc.i4
add
29
و عملياتمنطقي
and …, value1, value2 …, value1 & value2 bitwise AND
…
: مثال
17
12
ldc.i4
ldc.i4
and
0
arglist …, …,handle get argument list handleميکند پشته وارد را تابع يک آرگومانهاي ليست
…
handle
عملياتپرش
beq target branch if equalbge target branch if greater than or equalbge.un target branch if greater than or equal unsignedbgt target branch if greater thanbgt.un target branch if greater than unsignedble target …, value1, value2 …, branch if less than or equalble.un target branch if less than or equal unsignedblt target branch if less thanblt.un target branch if less than unsignedbne.un target branch if not equal unsigned
…
value1: مثال
value2
ldc.i4
ldc.i4
ble.un Loop
box type …,address …, object box value type
…
addressldc.i4
box type
object
br target …, …, unconditional branch بدون پرش شرطbreak …, …, breakpoint توقف دستور
brfalse target branch if zero پشته باالي که صورتي در پرشاست صفر
…, value …brtrue target branch if nonzero پشته باالي که صورتي در پرش
نيست صفر
…
brfalse target
value
call method …, arg1 … argn …, value call
calli signature …, arg1 … argn, address …, value call indirect
callvirt method …, object, arg1 … argn …, value call virtual method
castclass type …, object …, object cast object
عمليات فراخواني
ceq compare valuecgt compare greater thancgt.un …,value1,value2 …,0 or 1 compare greater than unsignedclt compare less thanclt.un compare less than unsigned
عمليات مقايسه
…
30
20
clt.un
0
conv.i convert to I, push Iconv.i1 convert to I1, push I4conv.i2 convert to I2, push I4conv.i4 convert to I4, push I4conv.i8 convert to I8, push I4conv.r.un convert unsigned to F, push Fconv.r4 convert to R4, push Fconv.r8 convert to R8, push Fconv.u ...,value …,result convert to U, push Uconv.u1 convert to U1, push U4conv.u2 convert to U2, push U4conv.u4 convert to U4, push U4conv.u8 convert to U8, push U8conv.ovf.i checked …conv.ovf.i1 checked …conv.ovf.i2 checked …conv.ovf.i4 checked …conv.ovf.i8 checked …
تبديل عملياتنوع
conv.uconv.u1conv.u2conv.u4conv.u8conv.ovf.i.unconv.ovf.i1.unconv.ovf.i2.unconv.ovf.i4.unconv.ovf.i8.unconv.ovf.u.unconv.ovf.u1.unconv.ovf.u2.unconv.ovf.u4.unconv.ovf.u8.un
تبديل عملياتنوع
…
conv.u8
value
result
…
div division تقسيمdiv.un unsigned division عالمت بدون تقسيم
…, value1, value2 …, value1 / value2
تقسيم عمليات
: مثال
18
5
ldc.i4
ldc.i4
div
3.6
dup …, value …, value, value duplicate
initblk …, address, value, size … initialize memory
initobj type …, address … initialize a value type
isinst type …, object …, object or null type test and cast
jmp method … … jump to method
عملياتپرش
ورود عملياتپشته به
ldc.i4 constant push constantldc.i8 constantldc.r4 constant … …, valueldc.r8 constant
…
value
ورود عملياتبه آرايه عنصر
ldelem.iپشتهldelem.i1ldelem.i2ldelem.i4ldelem.i8ldelem.r4 …, object, index …, value push array elementldelem.r8ldelem.refldelem.u1ldelem.u2
ldftn method … …, address push method address
با ورود عملياتآدرسغير به مستقيم
پشتهldind.ildind.i1ldind.i2ldind.i4ldind.i8ldind.r4 …, address …, value push indirectldind.r8ldind.refldind.u1ldind.u2ldind.u4
…
address
value
…
mul multiplication ضرب mul.ovf checked multiplication سرريز محاسبه با ضرب mul.ovf.un checked unsigned multiplication محاسبه با عالمت بدون ضربسرريز
…, value1, value2 …, value1 * value2
عملياتضرب
: مثال
16
3
ldc.i4
ldc.i4
mul
48
neg …, value …, –value negation
nop … … no operation
not …, value …, ¬value bitwise complement
or …, value1, value2 …, value1 | value2 bitwise inclusive OR
pop …, value … discard value
ret ... … return
…, value (callee) …, value (caller)
shl …, value1, value2 …, value1 << value2 left shift
shr …, value1, value2 …, value1 >> value2 arithmetic right shiftshr.un …, value1, value2 …, value1 >> value2 logical right shift
عملياتخروج پشته از
starg n …, value … store to argument
stelem.istelem.i1stelem.i2stelem.i4stelem.i8…, object, index, value … store to array elementstelem.r4stelem.refstelem.r8
stfld field …, object, value … store to instance field
عملياتخروج پشته از
stind.istind.i1stind.i2stind.i4stind.i8 …, address, value … store indirectstind.r4stind.r8stind.ref
stloc n …, value … store to local variable
…
sub subtraction تفريق sub.ovf checked subtraction سرريز محاسبه با تفريق sub.ovr.un checked unsigned subtraction با عالمت بدون تفريق
سرريز محاسبه
…, value1, value2 …, value1 - value2
تفريق عمليات
: مثال
17
12
ldc.i4
ldc.i4
sub
5
IL to Execute.ppt
To part