I want to embeded ASM code in c# code ,like C++ embed asm:
_asc{
mov ax,3
.....
}
how to do?
thanks! 13 2997
"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.)
"Abubakar" <Ab******@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com... 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.
I tend to agree. Adding an entire sublanguage and primary langauge hookups
for a feature that has very minimal value doesn't make sense. Adding ILASM
could double the complexity of the compiler, IDE, and language to help the
handful of people that would actually use it properly.
I use Reflector to Get ILASM code ,but I can't edit it;
in c# code ,create a new empty function named FunA,such as:
public class test
{
public test(){};
public void FunA(){};
}
then build this code ,I get a test.dll file
Open the test.dll file with Reflector
I get ILASM code
can I edit this code and add ILASM code to the Empty function FunA()?
thanks! I want to embeded ASM code in c# code ,like C++ embed asm: _asc{ mov ax,3 .... }
how to do?
thanks!
"Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl... "Abubakar" <Ab******@discussions.microsoft.com> wrote in message news:B3**********************************@microsof t.com... 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.
I tend to agree. Adding an entire sublanguage and primary langauge hookups for a feature that has very minimal value doesn't make sense. Adding ILASM could double the complexity of the compiler, IDE, and language to help the handful of people that would actually use it properly.
Actually, I agree too. Allowing ILASM and C# files to be linked into the
same assembly would solve the same set of problems much more naturally. (It
still strikes me as bizarre that a system deisgned from day one to support
multiple languages and compiles them all to a common object format doesn't
support heterogeneous linking.)
>> I tend to agree. Adding an entire sublanguage and primary langauge hookups for a feature that has very minimal value doesn't make sense. Adding ILASM could double the complexity of the compiler, IDE, and language to help the handful of people that would actually use it properly.
Actually, I agree too. Allowing ILASM and C# files to be linked into the same assembly would solve the same set of problems much more naturally. (It still strikes me as bizarre that a system deisgned from day one to support multiple languages and compiles them all to a common object format doesn't support heterogeneous linking.)
Ya, that was always odd, although the system itself supports it, the two big
languages(VB and C#) do not. C++ might, I'm not sure off hand. It is
certainly possible at the lowest levels.
It'd be nice if they would just provide an IDE that supports it, not to
mention a good IDE for editing IL code in VS. I'd love to have a good
Reflecter clone in VS, although I know that it would potentially give MS
problems for providing decompilers.
"Jeff Louie" <je********@yahoo.com> wrote in message
news:uD*************@tk2msftngp13.phx.gbl... You can code in IL assembler and call the dll method from c#
I do that now; it just seems stupid to have an entire assembly to hold the
three methods I can't write in C#.
u can also do this: use ildasm to save a file in il file and than change
with notepad and compile with ilasm.
Ab.
"harvie wang" <qu*****@gmail.com> wrote in message
news:5e*************************@news.microsoft.co m... I use Reflector to Get ILASM code ,but I can't edit it; in c# code ,create a new empty function named FunA,such as:
public class test { public test(){}; public void FunA(){}; } then build this code ,I get a test.dll file Open the test.dll file with Reflector I get ILASM code can I edit this code and add ILASM code to the Empty function FunA()?
thanks!
I want to embeded ASM code in c# code ,like C++ embed asm: _asc{ mov ax,3 .... }
how to do?
thanks!
OK..
Here is the assembler code that prints a string to the console wrapped
in a dll
call testildll. To compile this code is the ilasm with the /dll
directive: ilasm testildll.il /dll
You can then add a reference to the dll in your C# project and call the
method.
// testildll.il
// 11.29.04 Jeff Louie
.assembly extern mscorlib {}
.module testildll.dll
.class public auto autochar Class2
{
.method public hidebysig static void Test() cil managed
{
.maxstack 1
ldstr "JAL 11.25.04"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
}
Regards,
Jeff
*** Sent via Developersdex http://www.developersdex.com ***
Hello Jeff,
hoho:)
I see
Thanks! OK.. Here is the assembler code that prints a string to the console wrapped in a dll call testildll. To compile this code is the ilasm with the /dll directive: ilasm testildll.il /dll You can then add a reference to the dll in your C# project and call the method.
// testildll.il // 11.29.04 Jeff Louie .assembly extern mscorlib {} .module testildll.dll .class public auto autochar Class2 { .method public hidebysig static void Test() cil managed { .maxstack 1 ldstr "JAL 11.25.04" call void [mscorlib]System.Console::WriteLine(string) ret } }
Regards, Jeff *** Sent via Developersdex http://www.developersdex.com *** This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Wolfgang Schwanke |
last post by:
Dear usenet,
I'm having the following small problem.
I've been ask to add some Quicktime panoramas to a website. The author of
the panoramas has made two versions of each: One in MOV format,...
|
by: Tony Sutton |
last post by:
I have this following code in my html file:
<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#...
|
by: Anna |
last post by:
Hi all.
I want to embed the EMBED tag in the object tag.
I understood that I need to provide a PARAM tag inside the OBJECT
whose value will hold the content of EMBED src attribute, but after...
|
by: Cris Curtis |
last post by:
When I use an embed tag that uses a dynamic aspx page, the dynamic aspx page
appears to get called 2 times instead.
Below is code that adds an embed tag to a placeholder control that will use...
|
by: Andrew Poulos |
last post by:
With "normal" SWF HTML there's an EMBED tag nested within an OBJECT tag.
How can I check which tag is actually displaying the SWF? I'm using CSS
on them and the style on the OBJECT affects the...
|
by: polymorphic |
last post by:
I am no longer good at Javascript and need help. I'm trying to embed pdf files in html then build some sort of navigation between the pdfs via the pdf numbered file name.
I can generate the...
|
by: dream party |
last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
|
by: MoroccoIT |
last post by:
Greetings -
I have a CF Form that uploads news articles, at times, I like to paste Youtube Videos with my articles. I noticed that on one server, it works fine, but on a different hosting company,...
|
by: movieking81 |
last post by:
This really isn't an ASP question, but the code is ASP so feel free to move this to the right place if necessary. I have two ASP pages with some embed code on them on two different hosting...
|
by: movieking81 |
last post by:
I have some html pages with some embed code on them on two different hosting platforms.
First one (Win2003,IIS)
<object>
<param name='movie' value='st1.mov'>
<embed src='st1.mov' width='725'...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |