John Reiser jreiser@BitWagon.com writes:
- output( "\tmovl %d(%%ecx),%%edx; movl %%edx,%%es:0*4(%%eax)\n", CONTEXTOFFSET(Eax) );
- output( "\tmovl %d(%%ecx),%%edx; movl %%edx,%%es:1*4(%%eax)\n", CONTEXTOFFSET(Ecx) );
- output( "\tmovl %d(%%ecx),%%edx; movl %%edx,%%es:2*4(%%eax)\n", CONTEXTOFFSET(SegDs) );
- output( "\tmovl %d(%%ecx),%%edx; movl %%edx,%%es:3*4(%%eax)\n", CONTEXTOFFSET(Eip) );
- output( "\tmovl %d(%%ecx),%%edx; movl %%edx,%%es:4*4(%%eax)\n", CONTEXTOFFSET(SegCs) );
- output( "\tmovl %d(%%ecx),%%edx; movl %%edx,%%es:5*4(%%eax)\n", CONTEXTOFFSET(EFlags) );
This won't work if the stack is 16-bit, you'd need to truncate the address to 16-bit too.