Mail Archives: djgpp/1994/01/18/18:17:53
>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 -