在此實現(xiàn)了一個基本的IL匯編程序;
了解MSIL匯編和IL匯編評估堆棧_bcbobo21cn的博客-CSDN博客
它用了下面兩句來在屏幕輸出字符串,
? ? ldstr "I am from the IL Assembly Language..."
? ? call void [mscorlib]System.Console::WriteLine (string)
下面來看一下IL匯編如何實現(xiàn)字符串連接;
我也不知有沒有指令,看到有一句,
? ? call string [mscorlib]System.String::Concat(object, object)
?看上去是實現(xiàn)字符串連接,看一下,IL匯編代碼如下,
.assembly extern mscorlib {}
.assembly Test
{
.ver 1:0:1:0
}
.module test.exe
.method static void main() cil managed
{
.maxstack 1
.entrypoint
ldstr "I am AAA and ... "
ldstr "BBB and CCC。 "
call string [mscorlib]System.String::Concat(object, object)
call void [mscorlib]System.Console::WriteLine (string)
ret
}
構建運行一下;
構建出了exe,但是運行出錯;
把 call string [mscorlib]System.String::Concat(object, object) 改為
? ? call string [mscorlib]System.String::Concat(string, string)文章來源:http://www.zghlxwxcb.cn/news/detail-607280.html
也是一樣的情況;有時間繼續(xù);文章來源地址http://www.zghlxwxcb.cn/news/detail-607280.html
到了這里,關于IL匯編字符串連接的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!