www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/01/18/18:17:53

Date: Tue, 18 Jan 94 14:24:13 PDT
From: Peter Crowley <pcrowley AT qdeck DOT com>
To: dj AT ctron DOT com, ptan AT compudyn DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re[2]: IDTR and GDTR bases in go32

>These structures are UNPACKED.  They will not get the information
>stored in them correctly, as there are four unused bytes between limit
>and base to align the base to a 4 byte boundary.
>
>Try writing into an unsigned char[6] instead.
>
Will this work?

#ifdef __GNUC__ /* HJB/POHC */
#define PACKED __attribute__ ((packed));
#else
#define PACKED
#endif

 typedef struct {
     unsigned short int limit;
     unsigned long int  base PACKED;
 } IDTR;
 typedef struct {
     unsigned short int limit;
     unsigned long int  base PACKED;
 } GDTR;
 typedef struct {
     unsigned short int limit;
     unsigned long int  base PACKED;
 } LDTR;

Peter Crowley
Quarterdeck Offices Systems
pcrowley AT qdeck DOT com


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019