how do i write assembly code from c#?
i want to write a string of assembly code in c# and have it sent to some win32 api to compile and execute it and get the results back.
string str = "MOV 1,2;XOR EBP,EBP"...
sounds like hard to do but any suggestion would be helpful.
I doubt there's a win API to compile & execute assembly. Probably the best you could do is write a file, execute MASM (or whatever it's called these days), link it then execute the resulting program. I can't imagine what you are trying to do but this would be pretty much the last way I would try to solve almost any problem!
If you want to compare native & managed code, just write two programs that do more or less the same thing. There is no reason to generate the assembly from .NET. You can use any suitable tool for this. MASM, debug etc.