Hey guys, havent posted in here for a while.
I made my first dynamic x86 instruction encoder in C, which I will use for my code generation backend of my GLSL compiler, in order to directly output x86 machine code. (I am excited for the software rendered GLSL shaders!).
The disassembly is from ndisasm, and when running the machine code it returns 2468 in RAX (I run the machine code as a C function.)
The currently supported instructions are ADD, SUB, ADC, SBB, XOR, AND, OR, CMP, MOV, and RET. There is full 64-bit support. All general purpose registers and immediate values are supported. Memory addresses are not supported right now, but I will add them soon.