It's been a while since I posted on this forum, but I would seriously appreciate your comments on my newest release of the SoftWire run-time x86 assembler library: http://sourceforge.net/projects/softwire.
Release 3.0.0 includes what I like to call "run-time intrinsics". These are C++ functions with the names of x86 instructions which generate the corresponding code. For example the "Hello World!" program looks like this in run-time intrinsics:
This is extremely useful for writing any kind of compiler back-end without worries about manually writing machine code. It's many times faster than generating an assembly file first and assembling this with e.g. NASM, so it is also useful for just-in-time compilation. Because it is all still C++ code, things like conditional compilation and optimization become trivial...
Release 3.0.0 includes what I like to call "run-time intrinsics". These are C++ functions with the names of x86 instructions which generate the corresponding code. For example the "Hello World!" program looks like this in run-time intrinsics:
Assembler x86;
static char string[] = "Hello World!";
x86.push((int)string);
x86.call((int)printf);
x86.add(esp, 4);
x86.ret();
x86.callable()();
This is extremely useful for writing any kind of compiler back-end without worries about manually writing machine code. It's many times faster than generating an assembly file first and assembling this with e.g. NASM, so it is also useful for just-in-time compilation. Because it is all still C++ code, things like conditional compilation and optimization become trivial...
i thought some implementations of c had inline asm anyway? but this looks cleaner :)
i thought some implementations of c had inline asm anyway?