Mail Archives: djgpp/1993/01/10/03:57:46
Howdy,
I need to check the bios timer tick count located at 40:6c. I couldn't
find a peek macro or function in the GCC libs, so I wrote the following
macros. I think they're OK, but peekdw(0x46c) results in :
segmentation violation pointer 0x0000046c.
I assume that this location has been mapped somewhere else by go32, can someone
explain to me where I need to peek to get this info? thanks...
steve
/**** #macros for peek & poke added 1-9-93 SGR ****/
#define peekb(a) ( *( (unsigned char *)(a) ) ) /* peek a byte */
#define peekw(a) ( *( (unsigned short *)(a) ) ) /* peek a word */
#define peekdw(a) ( *( (unsigned int *)(a) ) ) /* peek a dword */
#define pokeb(a,x) ( ((unsigned char *)a) = (x)) /* poke a byte */
#define pokew(a,x) ( ((unsigned short *)a) = (x)) /* poke a word */
#define pokedw(a,x) ( ((unsigned int *)a) = (x)) /* poke a dword */
- Raw text -