Skip to main content
gamedev.net
🔒 Locked

Pointer trouble.. :S

Started by drkpriest May 13, 2004 at 11:18 PM 0 replies 300+ views
Original Post
drkpriest
drkpriest
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?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.