MASM汇编语言和ILASM的关系是什么(如果有)?

发布于 2024-10-08 06:41:16 字数 355 浏览 0 评论 0原文

MASM汇编语言和ILASM的关系是什么(如果有的话)。有一对一的转换吗?我正在尝试将量子 GIS 合并到一个程序中,我有点边写边写!我的计算机上有 GIS,我有 RedGate Reflector,它和 Visual Studio 2008 的对象浏览器都无法打开 Quantum 中的 .dll(其中有几个我对它们的行为方式没有强有力的线索)。我使用了 MASM 程序集编辑器并“打开”了同一个 dll,它抛出了一些我一开始并不认为一定能理解的内容。我如何/可以将相同的“代码”转换为我可以在 ILASM 中交互的东西,并且我假设因此在 Csharp 中?非常感谢您的阅读以及对之前问题的所有答复...请记住,我对 Csharp 编程还比较陌生,甚至对 MASM 和 ILASM 还比较陌生。

whats the relation(if any) of MASM assembly language and ILASM. Is there a one to one conversion? Im trying to incorporate Quantum GIS into a program Im kinda writing as I go along! I have GIS on my computer, I have RedGate Reflector and it nor the Object Browser of Visual Studio 2008 couldnt open one(of several which I dont have a strong clue to how they behave) of the .dlls in Quantum. I used the MASM assembly editor and "opened" the same dll and it spewed something I didnt expect to necessarily understand in the first place. How can I/can I make a conversion of that same "code" to something I can interact with in ILASM and Im assuming consequently in Csharp? Thanks a ton for reading and all the responses to earlier questions...please bear in mind Im relatively new to programming in Csharp, and even fresher to MASM and ILASM.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

指尖微凉心微凉 2024-10-15 06:41:16

MASM 处理 x86 指令,并且与平台/处理器相关,而 ILASM 涉及与平台/处理器无关的 .Net CIL(通用中间语言)指令。从特定的东西切换到更通用的东西是很难实现的,这就是为什么,据我所知,没有从 MASM 到 ILASM 的转换器(相反,有!)

MASM deals with the x86 instructions and is platform/processor dependent, while ILASM reffers to the .Net CIL (common intermediary language) instructions which are platform/processor independent. Switching from something specific to something more general is hard to achieve, that's why, AFAIK, there is no converter from MASM to ILASM (inverse, there is!)

墨落画卷 2024-10-15 06:41:16

IL 是本机代码的独立于平台的抽象层。在 .NET 平台上用 C#、VB.NET 或其他 .NET 语言编写的代码都会编译为包含 IL 的程序集 .EXE/.DLL。通常,第一次执行 IL 代码时,.NET 运行时将通过 NGen 运行它,NGen 再次将其编译为本机代码,并将输出存储在实际执行的临时位置。这使得 .NET 平台代码可以部署到支持该 .NET 框架的任何平台,而不管系统的处理器或体系结构如何。

正如您所看到的,Reflector 非常适合查看程序集中的代码,因为可以轻松地以 C# 或 VB.NET 形式预览 IL。这是因为 IL 通常是更高级别的指令,并且还包含许多本机代码通常不会有的元数据,例如类、方法和变量名称。

还可以通过设置 Visual Studio 项目平台或调用 Ngen.exe 直接位于程序集上。一旦完成,就很难理解本机代码。

IL is a platform independent layer of abstraction over native code. Code written on the .NET platform in C#, VB.NET, or other .NET language all compile down to an assembly .EXE/.DLL containing IL. Typically, the first time the IL code is executed the .NET runtime will run it through NGen, which compiles it once again down to native code and stores the output in a temporary location where it is actually executed. This allows .NET platform code to be deployed to any platform supporting that .NET framework, regardless of the processor or architecture of the system.

As you've seen, Reflector is great for viewing the code in an assembly because IL can easily be previewed in C# or VB.NET form. This is because IL is generally a little higher level instructions and also contain a lot of metadata that native code wouldn't normally have, such as class, method, and variable names.

It's also possible to compile a .NET project directly to native code by setting the Visual Studio project platform or by calling Ngen.exe directly on the assembly. Once done, it's really difficult to make sense of the native code.

美男兮 2024-10-15 06:41:16

MASM 汇编语言和ILASM 之间没有关系。我不认为你有任何方法将本机代码转换为 IL 代码。 IL只能被CLR理解,而MASM汇编语言是关于本机机器代码的。 CLR 在运行时将 IL 转换为本机代码

Ther is no relationship between MASM assembly language and ILASM. I don't see you have any way to convert native code to IL code. IL can be understood by CLR only while the MASM assembly language is about native machine code. CLR turns the IL into native code in runtime

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文