il代码,
.assembly extern mscorlib {}
.assembly Test
{
.ver 1:0:1:0
}
.module test.exe
.method static void main() cil managed
{
.maxstack 5
.entrypoint
ldstr "Enter First Number"
call void [mscorlib]System.Console::WriteLine (string)
call string [mscorlib]System.Console::ReadLine ()
call int32 [mscorlib]System.Int32::Parse(string)
ldstr "Enter Second Number"
call void [mscorlib]System.Console::WriteLine (string)
call string [mscorlib]System.Console::ReadLine ()
call int32 [mscorlib]System.Int32::Parse(string)
ble smaller
ldstr "Second Number is smaller than first."
call void [mscorlib]System.Console::WriteLine (string)
br exit
smaller:
ldstr "First number is smaller than second."
call void [mscorlib]System.Console::WriteLine (string)
exit:
ret
}
提示输入数,获取输入数,转换输入数为整型;然后这句实现比较,
ble smaller,它告诉编译器去检查栈里面的第一数是否小于或等于第二个数,如果是小于,那么它将会跳转到"smaller"这个标签处;
构建运行如下;
文章来源:https://www.toymoban.com/news/detail-647819.html
还不是很了解IL汇编和其跳转语句,有时间继续; 文章来源地址https://www.toymoban.com/news/detail-647819.html
到了这里,关于了解IL汇编跳转语句的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!