IL汇编字符串连接

在此实现了一个基本的IL汇编程序;

了解MSIL汇编和IL汇编评估堆栈_bcbobo21cn的博客-CSDN博客

它用了下面两句来在屏幕输出字符串,

ldstr "I am from the IL Assembly Language..."

call void [mscorlib]System.Console::WriteLine (string)

下面来看一下IL汇编如何实现字符串连接;

我也不知有没有指令,看到有一句,

call string [mscorlib]System.String::Concat(object, object)

看上去是实现字符串连接,看一下,IL汇编代码如下,

cpp 复制代码
 
.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)

也是一样的情况;有时间继续;

相关推荐
手打猪大屁3 天前
ARM裸机开发——I.MX6U_汇编LED灯驱动
汇编·arm开发
zhmc4 天前
Keil A51汇编伪指令
汇编
攻城狮7号4 天前
【第48节】探究汇编使用特性:从基础到混合编程
汇编·c++·windows
打工人你好10 天前
Visual Studio Code 在.S汇编文件中添加调试断点及功能简介
汇编·ide·vscode
红白小蛋糕11 天前
《操作系统真象还原》第八章(1)——内存管理系统
汇编·笔记·ubuntu
tjsoft12 天前
asm汇编源代码之按键处理相关函数
汇编
tjsoft13 天前
asm汇编源代码之-汉字点阵字库显示程序源代码下载
汇编
AntHub13 天前
汇编获取二进制
汇编
tjsoft14 天前
asm汇编字符串操作
linux·运维·汇编
tjsoft14 天前
asm汇编源代码之CPU型号检测
汇编