Personally I rather use powerful external macro assemblers like NASM/MASM than inline assemblers, as I mentioned a few times here.

Specially since most inline assemblers I used tend to be rather limited in comparison.

Actually DMD might be the most powerful macro assembler out there:

    import std.stdio;
    import std.conv;

    int test(int Result)()
    {
        asm { naked; }
        mixin(r"
        asm
        {
            mov EAX, " ~ to!string(Result) ~ r";
            ret;
        }"
        );
    }

    void main()
    {
        writefln("%s", test!4());
        writefln("%s", test!5());
    }


Reply via email to