Kudzu World

"البرمجة: فنّ و تمرّد"

Kudzu World  »  Blogspace  »  Kudzu's Tech Blog
English - Română - Русский - عربي

RSS Feed

If you want to more easily stay informed of updates etc you can subscribe to the RSS feed. Just point your RSS reader at this page, auto discovery is enabled.

X# - Using C# to create an inline X86 assembler

This is from the Cosmos project but could easily be used to generate any X86 code. It's really neat, write C# like code that has 1:1 mapping to X86, and to generate the X86, just run the C# code.

            public void DebugStub(TextWriter aOutputWriter, UInt16 aComAddr) {
                UInt16 xComStatusAddr = (UInt16)(aComAddr + 5);
                Label = "WriteByteToComPort";
                Label = "WriteByteToComPort_Wait";
                DX = xComStatusAddr;
                AL = Port[DX];
                AL.Test(0x20);
                JumpIfEqual("WriteByteToComPort_Wait");
                DX = aComAddr;
                AL = Memory[ESP + 4];
                Port[DX] = AL;
                Return(4);

Notice even the integration between C# and the asssembly? (aComAddr, etc)

More X# info

<< Previous Entry  Next Entry >>

Comments: 

Ovidiu Buligan 2008-05-16 03:08:33
Very interesting :-?
I wonder if java ever thought of enabling such facility (beside the HotSpot witch you do not "have control")


Add your comment: 

Name:    
E-Mail:  
URL:  
Comment:  
Please add 8 and 4 and type the answer here:



Use my contact form to contact me directly.