Mail Archives: djgpp/1994/10/06/09:11:11
I was asked more detail on my problem so here is a code fragment. Note
that 0xe0000000 offsets also cause the same result... Any help would
be welcome [ I am trying to access a TSR in the DOS memory area ]
/* Test memory access */
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
#include <sys/farptr.h>
#define peek16(a) _farpeekw(0,a)
#define poke16(a,b) _farpokew(0,a,b)
main (int argc, char *argv[])
{
int ret;
long which = 12;
ret = peek16(which*4);
printf("Result: %x\n", ret);
}
/* Result is same for a bias of 0xe0000000
C:\LIBGNU>go32 test1
go32 version 1.12.maint2 Copyright (C) 1994 DJ Delorie
General Protection Fault at eip=1c2
eax=00000000 ebx=00051d18 ecx=00000000 edx=00000030 esi=00000000 edi=00000000
ebp=00051d04 esp=00051d04 cs=af ds=a7 es=a7 fs=0 gs=bf ss=b7 cr2=00001fe3
Call frame traceback EIPs:
0x000001c2
*/
- Raw text -