Oh noes, backwards she goes!

Ok so while I'm debugging I'm just going to feed the VM a vector of CInstruction's instead of writing an assembler right now. This function takes one such vector and writes the elements into the memory allocated by AllocateBlock (I took major_small & everyone elses advice about the memory allocation BTW).

Ok, I dont exactly know why that happened but I know that your
++*write = *iter->opcode;
is very suspicious. Doing ++*write wont take you to the next location it points to, it will only increment whatever is stored in that memory by 1.

What you probably wanted was this:
*++write
so you might want to try with that too, but then my *write++ should have worked too (at least to some degree since the only difference is the pre/post increment.).

STL Util a small headers-only library with various utility functions. Mainly for fun but feedback is welcome.

ahhh now I remember this: I think it should be this:
*write++ = *iter->opcode;

but at the end of the loop you must restore write to point to the beginning of the memoryblock. See you modify where the pointer points to, and then in write you try to print out the 2 blocks after the ones you allocated.