可以在c#中嵌入asm代码 [英] Can embed asm code in c#

查看:281
本文介绍了可以在c#中嵌入asm代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在c#代码中嵌入ASM代码,比如C ++嵌入asm:

_asc {

mov ax,3

.. ...

}


怎么办?


谢谢!

解决方案



" harvie wang" <曲***** @ gmail.com>在留言中写道

新闻:5e ************************* @ news.microsoft.co m ... < blockquote class =post_quotes>我想在c#代码中嵌入ASM代码,比如C ++嵌入asm:
_asc {
mov ax,3
....
}

怎么办?




你不能。 C#以相对独立的方式编译,因此x86

汇编是没有意义的。




Daniel O''Connell [C#MVP]" < onyxkirx @ - NOSPAM--comcast.net>写在

消息新闻:uc **************** @ TK2MSFTNGP14.phx.gbl ...


harvie wang <曲***** @ gmail.com>在消息中写道
新闻:5e ************************* @ news.microsoft.co m ...

我想在c#代码中嵌入ASM代码,比如C ++嵌入asm:
_asc {
mov ax,3
....
}

怎么办?



你不能。 C#以相对独立的方式编译,因此x86
汇编是没有意义的。




你也不能嵌入ILASM,如据我所知,尽管那会是有意义的(甚至在极少数情况下也很有用。)


>而且据我所知,你也不能嵌入ILASM,即使这样会

有意义(甚至在极少数情况下也很有用。)


在C#中的Ilasm中编写正确和实际的代码(如c ++中的__asm)

作为建议提交给微软C#2.0并获得了很多

正面投票,但它仍被拒绝,因为他们说它使

语言变得复杂,并且通过此功能无法实现足够的价值。


Abubakar, http://joehacker.blogspot.com


" Mike Schilling"写道:

Daniel O''Connell [C#MVP]" < onyxkirx @ - NOSPAM--comcast.net>在
消息新闻中写道:uc **************** @ TK2MSFTNGP14.phx.gbl ...


" harvie旺" <曲***** @ gmail.com>在消息中写道
新闻:5e ************************* @ news.microsoft.co m ...

我想在c#代码中嵌入ASM代码,比如C ++嵌入asm:
_asc {
mov ax,3
....
}

怎么办?



你不能。 C#以相对独立的方式编译,因此x86
汇编是没有意义的。



据我所知,你也不能嵌入ILASM ,即使这样有意义(甚至在极少数情况下也很有用。)



I want to embeded ASM code in c# code ,like C++ embed asm:
_asc{
mov ax,3
.....
}

how to do?

thanks!

解决方案


"harvie wang" <qu*****@gmail.com> wrote in message
news:5e*************************@news.microsoft.co m...

I want to embeded ASM code in c# code ,like C++ embed asm:
_asc{
mov ax,3
....
}

how to do?



You can''t. C# compiles in a relativly machien independent manner, so x86
assembly wouldn''t make sense.



"Daniel O''Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
message news:uc****************@TK2MSFTNGP14.phx.gbl...


"harvie wang" <qu*****@gmail.com> wrote in message
news:5e*************************@news.microsoft.co m...

I want to embeded ASM code in c# code ,like C++ embed asm:
_asc{
mov ax,3
....
}

how to do?



You can''t. C# compiles in a relativly machien independent manner, so x86
assembly wouldn''t make sense.



And you can''t embed ILASM either, as far as I know, even though that would
make sense (and even be useful on rare occasions.)


> And you can''t embed ILASM either, as far as I know, even though that would

make sense (and even be useful on rare occasions.)
thats right and infact writing code in Ilasm inside C# (like __asm in c++)
was submitted as a suggestion to microsoft for C# 2.0 and got a lot of
positive votes but still it was rejected cuz they say it was complicating the
language and nothing valueable enough could be achieved through this feature.

Abubakar,
http://joehacker.blogspot.com

"Mike Schilling" wrote:

"Daniel O''Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
message news:uc****************@TK2MSFTNGP14.phx.gbl...


"harvie wang" <qu*****@gmail.com> wrote in message
news:5e*************************@news.microsoft.co m...

I want to embeded ASM code in c# code ,like C++ embed asm:
_asc{
mov ax,3
....
}

how to do?



You can''t. C# compiles in a relativly machien independent manner, so x86
assembly wouldn''t make sense.



And you can''t embed ILASM either, as far as I know, even though that would
make sense (and even be useful on rare occasions.)



这篇关于可以在c#中嵌入asm代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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