Original Post
I am having trouble parsing a pointer into some assembly code from my c++ code. I need to parse a pointer (to a 256 buffer) into the ES:DI registers. The segment needs to be put into the ES register and the offset needs to be put into the DI registers. How would I go about this? So far I have this..
UCHAR vesainfo[256]; // 256 buffer
DWORD status=0; // return status
DWORD segment = ((DWORD)((void*)vesainfo))&0xFFFF0000;
DWORD offset = ((DWORD)((void*)vesainfo))&0xFFFF;
asm( "movl $0x4F00,%%eax\n\t"
"int $0x10"
:"=a" (status)
:"S" (segment), "D" (offset) );
Does this look right? I am not sure. If not, how do you split a 32-bit c++ pointer into its equivalent segment and offset values, ie. far pointer components?