如何在C#中编译.asm文件? [英] How do I compile an .asm file in C#?

查看:204
本文介绍了如何在C#中编译.asm文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你能用C#编译.asm文件吗?如果可以的话怎么做?

解决方案

你可以使用一些可用的汇编程序:http://en.wikipedia.org/wiki/Assembler_%28computing%29#Assembler [ ^ ]。



这可以使用 System.Diagnostics.Process.Start

System.Diagnostics.Process.Start(@ a\file\path\to \\\\executable\module \\\\ some \ Assember,一些参数fileName.asm);



请参阅: http: //msdn.microsoft.com/en-us/library/system.diagnostics.process.start%28v=vs.110%29.aspx [ ^ ]。



但是,这很可能毫无意义。客户系统很可能没有Assember。即使你编译它,那么呢?汇编语言和汇编语言与.NET几乎没有关系,它们针对的是特定的系统和特定的处理器。但是,以防万一:您应该了解,使用.NET,您可以使用P / Invoke使用本机代码可执行模块:

http://en.wikipedia.org/wiki/P/Invoke [ ^ ],

http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp [ ^ ]。



-SA

Can you compile an .asm file in C# and if you can how do you do it?

解决方案

You can use some available assembler: http://en.wikipedia.org/wiki/Assembler_%28computing%29#Assembler[^].

This can be done using System.Diagnostics.Process.Start:
System.Diagnostics.Process.Start(@"a\file\path\to\the\executable\module\of\some\Assember", "some parameters fileName.asm");

Please see: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start%28v=vs.110%29.aspx[^].

However, this is most likely quite pointless. The customer system, most likely, does not have an Assember. And even if you compiler it, then what? Assembler and Assembly languages have little to do with .NET, they target particular system and particular processor. However, just in case: you should understand that, with .NET, you can use native-code executable modules using P/Invoke:
http://en.wikipedia.org/wiki/P/Invoke[^],
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp[^].

—SA


这篇关于如何在C#中编译.asm文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆