Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > C#

C# C# Discussion

Reply
 
Thread Tools Display Modes
Old 02-07-2008, 05:58 AM   #1 (permalink)
Master of the Internet
 
Join Date: Mar 2006
Location: Germany
Age: 17
Posts: 14,785
Send a message via AIM to Suil Ban Send a message via MSN to Suil Ban
Default __asm -> __il?

In C++, you can write ASM code directly into the source using an __asm block. I need similar functionality to this in C#, but I need to write MSIL directly into my program, alongside the C# code itself. I heard there was a VS plug-in out there somewhere that could enable me to do this, but I've not found it. If all else fails, I suppose I could open my build in Reflector and modify the MSIL with Reflexil, but I'd rather do it all in Visual Studio.

Is there any way?
__________________
go fish
Suil Ban is offline   Reply With Quote
Old 02-07-2008, 06:39 AM   #2 (permalink)
Forum Expert
 
Join Date: Jan 2008
Posts: 286
Default

Quote:
Originally Posted by excuse me miss, but uh... View Post
In C++, you can write ASM code directly into the source using an __asm block. I need similar functionality to this in C#, but I need to write MSIL directly into my program, alongside the C# code itself. I heard there was a VS plug-in out there somewhere that could enable me to do this, but I've not found it. If all else fails, I suppose I could open my build in Reflector and modify the MSIL with Reflexil, but I'd rather do it all in Visual Studio.

Is there any way?
What do you need to do in IL that you can't do in C#?

(G-talk me if it is a secret)
Kitchen_ is offline   Reply With Quote
Old 02-07-2008, 09:56 AM   #3 (permalink)
Forum Expert
 
arul's Avatar
 
Join Date: Jan 2005
Location: Hic sunt leones ...
Age: 21
Posts: 1,289
Send a message via MSN to arul
Default

Use the *Builder classes (AsseblyBuilder, TypeBuilder, MethodBuilder ...).

Take a look at the ./scripts/misc/emitter.cs in RunUO, there's a quite working example.
__________________
Angels are falling the very last time, down they're burning in hate and decline, unfaithful and violent we're breaking the spell, we're god, we're scissor, in heaven and hell!
arul is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5