how old is that code?
I am not sure you can do this anymore. I could be wrong. Could also be the wrong instruction sizes for your current execution mode (64 bit vs 32 bit mode or something).
I seem to recall having to do the above this way, and that was some time ago..
__asm //the visual studio version of assembler blocks, or it once was
{
emit(opcode) //I forget the exact syntax but the emit function was direct cpu instruction in integer format as you seem to be doing here.
}
you are jumping into the middle of YOUR program, and attempting to execute code. What about the call stack for your code? Is that being damaged? What about what was in the registers for YOUR code? There are several things that could go wrong here.
think in assembly like a CPU.
its sitting there
move something to ax
move something to bx
do some operation
do some memory addressing
about to write back to memory or process something else and BAM
jack something else into ax, do some other operations, do more stuff,
resume where you left off but the data is changed, the side effects and flags are changed...
kablooie.
your code comments claim to have cleaned up and done this correctly, but I am not convinced. I seem to vaguely recall having to push and pop flag registers, multiple registers, all kinds of stuff when doing this kind of activity.