了解IL汇编创建命名空间和类

cpp 复制代码
.assembly extern

mscorlib {} .assembly Classes

{ .ver 1:0:1:0    } 
.module Classes.exe
.namespace HangamaHouse
{
    .class public ansi auto Myclass extends [mscorlib]System.Object
    {
        .method public static void main() cil managed
        {
            .maxstack 1
            .entrypoint

            ldstr "Hello World MyClass!"
            call void [mscorlib]System.Console::WriteLine(string)

            ret
        }
    }    
}

与前面几个IL汇编程序不同,使用.namespace 指令创建了一个命名空间;在这个命名空间里,用.class 指令定义了一个类,并告诉编译器,这个类是公有的,它继承于System.Object 这个父类;

相关推荐
rockey62718 小时前
AScript函数体系详解
c#·.net·script·eval·expression·function·动态脚本
吴可可1231 天前
C#合并首尾相连多段线实战
算法·c#
钮钴禄·爱因斯晨1 天前
聚焦操作系统中的PV操作
数据库·算法·系统架构·c#
willhuo1 天前
# 自动化数据采集技术研究与实现:基于Playwright的抖音网页自动化方案
运维·selenium·c#·自动化·chrome devtools·webview
xiaoshuaishuai81 天前
C# 实现不掉线的CRM
开发语言·c#
筱璦1 天前
C#期货分仓、策略交易模拟演示系统(含资源下载)
开发语言·c#·策略模式·量化交易·期货交易
唐青枫1 天前
C#.NET Task 与 async await 深入解析:底层原理、执行流程与实战误区
c#·.net
公子小六1 天前
基于.NET的Windows窗体编程之WinForms数据表格
windows·c#·.net·winforms
程序员大辉1 天前
开源LibreOffice(Office办公套件)下载完整安装教程
开发语言·microsoft·c#