第一个ilasm程序
生活随笔
收集整理的這篇文章主要介紹了
第一个ilasm程序
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
第一個ilasm程序 今天看IL,寫出了第一個ilasm程序,編譯通過,開心 .assembly extern mscorlib{} .assembly Test
{
?.ver 1:0:0:0
}
.module Test.exe .namespace Test
{
?.class public auto ansi Test
?{
??.method public static void Main() cil managed
??{
???.entrypoint
???.maxstack 2
???ldstr "Please input the first number"
???call void [mscorlib]System.Console::WriteLine(string)
???call string [mscorlib]System.Console::ReadLine()
???call int32 [mscorlib]System.Convert::ToInt32(string)
???ldstr "Please input the sencond number"
???call void [mscorlib]System.Console::WriteLine(string)
???call string [mscorlib]System.Console::ReadLine()
???call int32 [mscorlib]System.Convert::ToInt32(string)
???call bool Test.math::IsGreat(int32,int32)
???brfalse.s les
???ldstr "First number is Gread than sencond Number"
???call void [mscorlib]System.Console::WriteLine(string)
???br finished
??les:
???ldstr "First number is less than sencond Number"
???call void [mscorlib]System.Console::WriteLine(string)
??finished:
???ldstr "Thank you"
???call void [mscorlib]System.Console::WriteLine(string)
???ret?
??}
?}
?
?.class public auto ansi math
?{
??.method public static bool IsGreat(int32,int32) cil managed
??{
???.maxstack 2
???ldarg.0
???ldarg.1
???ble.s les
???ldc.i4.1
???ret
??les:
???ldc.i4.0
???ret
??}
?}
} posted on 2006-05-01 11:47 申松淦 閱讀(...) 評論(...) 編輯 收藏
{
?.ver 1:0:0:0
}
.module Test.exe .namespace Test
{
?.class public auto ansi Test
?{
??.method public static void Main() cil managed
??{
???.entrypoint
???.maxstack 2
???ldstr "Please input the first number"
???call void [mscorlib]System.Console::WriteLine(string)
???call string [mscorlib]System.Console::ReadLine()
???call int32 [mscorlib]System.Convert::ToInt32(string)
???ldstr "Please input the sencond number"
???call void [mscorlib]System.Console::WriteLine(string)
???call string [mscorlib]System.Console::ReadLine()
???call int32 [mscorlib]System.Convert::ToInt32(string)
???call bool Test.math::IsGreat(int32,int32)
???brfalse.s les
???ldstr "First number is Gread than sencond Number"
???call void [mscorlib]System.Console::WriteLine(string)
???br finished
??les:
???ldstr "First number is less than sencond Number"
???call void [mscorlib]System.Console::WriteLine(string)
??finished:
???ldstr "Thank you"
???call void [mscorlib]System.Console::WriteLine(string)
???ret?
??}
?}
?
?.class public auto ansi math
?{
??.method public static bool IsGreat(int32,int32) cil managed
??{
???.maxstack 2
???ldarg.0
???ldarg.1
???ble.s les
???ldc.i4.1
???ret
??les:
???ldc.i4.0
???ret
??}
?}
} posted on 2006-05-01 11:47 申松淦 閱讀(...) 評論(...) 編輯 收藏
轉(zhuǎn)載于:https://www.cnblogs.com/yzssg/archive/2006/05/01/389971.html
總結(jié)
以上是生活随笔為你收集整理的第一个ilasm程序的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: OPPOFindX3标准版证件照出炉 浴
- 下一篇: asp.net面试题收集[2006.4.