Author Topic: bitfield in masm  (Read 3541 times)

Emil_halim

  • Member
  • **
  • Posts: 111
bitfield in masm
« on: April 08, 2018, 12:06:57 AM »
Hi all

what is the masm code that similar to this c struct
   
struct LDT_ENTRY {
  WORD    LimitLow;
  WORD    BaseLow;
  union {
    struct {
      BYTE    BaseMid;
      BYTE    Flags1;     // Declare as bytes to avoid alignment
      BYTE    Flags2;     // Problems.
      BYTE    BaseHi;
    } Bytes;
    struct {
      DWORD   BaseMid : 8;
      DWORD   _Type : 5;
      DWORD   Dpl : 2;
      DWORD   Pres : 1;
      DWORD   LimitHi : 4;
      DWORD   Sys : 1;
      DWORD   Reserved_0 : 1;
      DWORD   Default_Big : 1;
      DWORD   Granularity : 1;
      DWORD   BaseHi : 8;
    } Bits;
  } HighWord;
};


nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: bitfield in masm
« Reply #1 on: April 08, 2018, 01:45:09 AM »
deleted
« Last Edit: February 26, 2022, 02:24:57 AM by nidud »

Emil_halim

  • Member
  • **
  • Posts: 111
Re: bitfield in masm
« Reply #2 on: April 08, 2018, 03:11:05 AM »

thanks nidud;