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:


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...
Posted on 2003-03-09 21:08:16 by C0D1F1ED
i thought some implementations of c had inline asm anyway? but this looks cleaner :)
Posted on 2003-03-09 23:03:09 by jademtech

i thought some implementations of c had inline asm anyway?
Inline assembly does not generate code at run-time. It can't be used as a code generator nor is it dynamic.
Posted on 2003-03-10 02:18:01 by C0D1F1ED