⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bom.h

📁 为keil c51编写自己display接口
💻 H
📖 第 1 页 / 共 5 页
字号:
  struct fld  {
    BYTE          fwd;      /* Field-Width */
    BYTE          fof;      /* Field-Offset in Basic-Skalar */
    BYTE          bas;      /* 0 = char, 1 = unsigned */
    BYTE         sign;      /* 'signed' field */
  } fld;                    /* Field-Code fuer tp->size */
};


typedef union  {
  BYTE            *pB;
  struct t2_x21  *p21;              // 0x21: Pointer
  struct t2_x22  *p22;              // 0x22: Array
  struct t2_x29  *p29;              // 0x29: Fox-struct union
  struct t2_x23  *p23;              // 0x23: function
  struct t2_x25  *p25;              // 0x25: Field
  struct t2_x26  *p26;              // 0x26: TypeTag
  struct t2_x27  *p27;              // 0x27: Component
  struct t2_x28  *p28;              // 0x27: Component-List
} tpU;
#endif




struct zVal  {
  BYTE       Rep;              // 1:=Bits, 2:=Bytes
  UINT64     v64;
};
#define ZVAL  struct zVal

union v  {                     // expression-value union
  unsigned long       ul;
  signed char          c;
  unsigned char       uc;
  signed short       i16;
  unsigned short     u16;
  unsigned short      ui;
  signed long          l;
  unsigned long  ul2 [2];
  unsigned char  uc8 [8];     // uc[7] holds dpp-info of near-ptr
  int                  i;
  INT64              i64;
  UINT64             u64;
  float                f;
  double               d;
  struct vtr        *pVR;       // VtReg-descriptor
  char                *s;
  BYTE               *pB;
  WORD16             *pW;
  DWORD             *pDW;
  struct zVal        v64;
  void           *vp [2];     // used for dScope-functions
};


struct lPa  {
  DWORD         n1;
  DWORD         n2;
  DWORD         n3;
  DWORD         n4;
  union v        v;
};



/*
 * VTREG structure
 */

struct vtr  {
  char           *name;          // name of VtReg
  TYP              *tp;          // Type of VtReg
  WORD16         vtrNo;          // laufende nummer (0...MAXVTR - 1)
  WORD16    OscFrq : 1;          // special for 'XTAL'
  union v            v;          // VtReg's value
  WORD16           Atr;          // 0 | ATR_RDBRK | ATR_WRBRK
};

#define VTR      struct vtr
#define MAXVTR   256            // max. of 256 VTR-Slots.



struct enode  {                 // Expression-Node
  BYTE              etyp;       // Node-Type
  BYTE              rtyp;       // Rslt-type on operators

  DWORD         cvol : 2;       // const/volatile */
  DWORD          cfl : 1;       // const-expr */
  DWORD         mark : 1;       // expl-cast or struid mark
//DWORD        bable : 1;       // Expr. may have Type 'bit'
  DWORD      TopNeed : 1;       // don't remove Top-cast, if present
  DWORD        tprom : 1;       // Param: promote type (no parm-type given)
  DWORD          one : 1;       // if cfl=1: constant value-1
  DWORD         zero : 1;       // if cfl=1: constant value-0
  DWORD          max : 1;       // if cfl=1: constant has max-value
  DWORD        ssref : 1;       // e_ref for struct/union from nameref()
  DWORD      StruRet : 1;
  DWORD       iStore : 1;       // this e_ref is a store
  DWORD          wid : 6;       // e_reff: field-width
  DWORD          ofs : 6;       // e_reff: field-offset
  DWORD      iNotVis : 1;       // expr is not in Scope
  DWORD       AccBrk : 1;       // Access-break top node
  DWORD       iNoAcc : 1;       // can't access target mem or regs

  BYTE            OpType;       // Op-Type on NOT and all RelOps
  WORD16           space;       // Referencing Memory Space
  WORD16          rspace;       // Resulting Memory Space
  BYTE            nCount;       // temp: used for GenParms
  union v              v;       // Node value
  struct typ         *tp;       // Operation-Type, normally Result-Type
  struct typ        *tp1;       // Result-Type on RelOps and Not

  struct enode        *L;       // left child
  struct enode        *R;       // right child
  WORD16            Line;       // Line-Number
  WORD16           index;       // Line-index
  WORD16            nCnt;       // eg. strlen on e_strcon
  WORD16            nPos;       // Reg-based Bit position
  WORD16             Dpp;       // per dppn:override
  BYTE            nRadix;       // output radix for expr (watch)
};

#define EXP  struct enode



#define WATCH   struct watch
#define ACCESS  struct access

typedef struct watch *pWATCH;

struct watch  {
  WATCH            *next;  // next watch
  WATCH            *prev;  // previous watch
  void      (*fp) (void);  // Watch-function
  DWORD              adr;  // memory Address
  BYTE          acc_type;  // Trigger-Access 1:=READ, 2:=WRITE, 3:=BOTH
  WORD16        acc_size;  // Access-Size: 1:=BYTE, 2:=WORD,  4:=DWORD
  BYTE           special;  // 1=WBREAK
  BYTE              mask;  // iMCS51: Bit-Mask
};

/* ACCESS-LIST STRUCTURE */

typedef struct access *pACCESS;
struct access  {
  DWORD           address;    /* Addresse im Memory */
  WORD16             mask;    /* Read-/Write Mask */
};




struct zxfile  {
  struct zxfile    *next;            /* next file descriptor */
  WORD16             nFI;            /* File-Index */
  WORD16           nMode;            /* 0:=Src, 1:=Lst */
  char             *name;            /* File name */
  char             *path;            /* File path */
  DWORD             time;            /* File time */

  struct lin        *pLn;            /* debug-lines head */
  int             nLines;            /* lines in 'lhd' */
  int               nMax;            /* lines limit for current 'pLn' */
  DWORD            uLine;            /* highest line number in table */

//HANDLE           hFile;            /* File Handle */
//HANDLE           hFmap;            /* View-map handle */
  BYTE               *pB;            /* mapped view of File */
  DWORD            fSize;            /* File size */
  struct _stat       sts;            /* File status */
  DWORD          *pArray;
//DWORD            cline;            /* current line */
//int              cindx;            /* current View-Index */
};

#define ZXFIL   struct zxfile


struct lin  {                        /* LINE-NUMBER structure */
  WORD16          line;              /* the linenumber */
  DWORD           offs;              /* linenumber-offset */
};
#define LIN  struct lin

#pragma pack(1)
struct sym  {                        /* SYMBOL structure */
  struct sym     *next;              /* link to next Symbol */
  struct sym     *alnk;
  char           *name;
  struct zbk     *pBlk;              /* bounding Scope-Block */
  WORD16          type;
  BYTE              sc;              // Stoage class
  union v            v;
  TYP              *tp;              /* type index */
  WORD16           Dpp;
  WORD16           Reg;              /* Register number */
  WORD16           Pos;              // BitPos or FuncAttr
};
#pragma pack()


#define SYM  struct sym

struct adr  {                        /* ADDRESS-FRAME link */
  struct adr     *next;              /* next frame */
  DWORD           ladr;              /* address frame low */
  DWORD           hadr;              /* address frame high */
};


struct vSym  {             // a user created value symbol
  struct vSym  *next;      // next vSym
  char         *name;      // vSym's name
  TYP            *tp;
  union v          v;      // the value (Scalar types only !)
};
#define vSYM  struct vSym



#define ZBK  struct zbk
#define BLK_THEADR   1
#define BLK_PROC     2
#define BLK_DO       3
#define BLK_TASK     4


struct zbk  {                      /* SCOPE-BLOCK structure */
  ZBK            *next;            /* next block */
  char           *name;            /* BlockName */
  ZBK            *anxt;            /* Address: next Block */
  ZBK          *parent;            /* the Parent Block */
  DWORD           offs;            /* BLOCK Start address */
  DWORD           bend;            /* BLOCK End address */
  WORD16           nTI;            /* Type Index */
  ZBK            *down;            /* nested block */
  ZXFIL         *pFile;
  struct sym      *shd;            /* debug-symbols head */
  BYTE          mark : 3;          /* block marker */
  BYTE          ccov : 1;          // nr. of executed instr. has changed
  DWORD          nInst;            // number of instructions in Func-Block
  DWORD          nExec;            // number of executed instructions
};


struct iF66  {
  DWORD         ErrAdr;
  SYM           *Hpubs;        // Public symbols - Head
  SYM           *Tpubs;        // Public symbols - Tail
  SYM            *SfrH;        // Head of SFR symbols
  SYM            *SfrT;        // Tail of SFR symbols
  ZXFIL        *FilesH;        // Files - Head
  ZXFIL        *FilesT;        // Files - Tail
  DWORD         nTypes;        // Nr. of Type-Recs (ab 0x80)
  DWORD            tpN;        // current max Type-Slots
  char           **tpA;        // Type-Pointer Array
  int            yindx;
  ZBK            **pA3;        // a24-a31 Cluster
  ZBK           *pRoot;        // Head of Theader Blocks.

  vSYM         *vShead;        // Head of user-create value symbols
  vSYM         *vStail;        // Tail of user-create value symbols
  
  DWORD            low;        // Low Scope address
  DWORD            hig;        // High Scope address
};





struct scop66  {               // Scope-Descriptor
  DWORD            low;        // Low Scope address
  DWORD            hig;        // High Scope address
  ZXFIL         *pFile;
  LIN             *pLn;        // extracted from 'pFile'
  int           nLines;        // extracted from 'pFile'

  DWORD           targ;  
  WORD16          mode;        // HLL, ASM
  WORD16       set : 1;
  WORD16     isact : 1;        // HLL File is active

  ZBK              *pT;        // Translation-Unit
  ZBK              *pF;        // Function in Theader
  ZBK              *pB;        // Block in Function
  ZBK           *pTask;        // 166: Task Header
};

#define CUS    struct scop66

#define IF66  struct iF66

extern IF66          i66;      // Fox Symbol-Info
extern struct scop66 Sc6;      // Scope-Info


/*
 * Qualified references
 */

struct iqual  {
  int        comps;          // Nr. of Components
  char      *tname;          // \\TASKNAME
  int         tndx;          // Index of TaskName
  char    *name[3];          // \THEADR\FUNCTION\LOCSYM
  int       ndx[3];          // Component Line-Indices
  int         Bank;
  ZBK          *tk;          // Task specifier
  ZBK          *th;          // Parent-Theader
  ZBK          *fc;          // Parent-Function
  SYM          *sp;          // if a fully qualified Symbol
  DWORD     LineNo;          // Linenumber to search for
  DWORD    LineOfs;          // Linenumber-Offset
  int        ErrIx;          // Line-Index in case of error
  int         bufi;
  char   buf [512];
  BYTE        line;          // Qualifier specifies '\line'
};
#define IQUAL struct iqual   // Qualifier-Reference


struct squal  {
  int        index;
  int         Line;
  ZBK        *Task;
  ZBK      *Theadr;
  ZBK        *Func;
  SYM          *sp;
};
#define SQUAL  struct squal  // Qualifier-Reference


#pragma pack()


//--- Basic-types
extern TYP tp_void;    // = { bt_void,   { 0, 0, 0, 0 }, 0, 0, 0,  };
extern TYP tp_bit;     // = { bt_bit,    { 0, 0, 0, 0 }, 0, 0, 1,  };
extern TYP tp_char;    // = { bt_char,   { 0, 0, 0, 0 }, 0, 0, 1,  };
extern TYP tp_uchar;   // = { bt_uchar,  { 0, 0, 0, 0 }, 0, 0, 1,  };
extern TYP tp_int;     // = { bt_int,    { 0, 0, 0, 0 }, 0, 0, 2,  };
extern TYP tp_uint;    // = { bt_uint,   { 0, 0, 0, 0 }, 0, 0, 2,  };
extern TYP tp_short;   // = { bt_short,  { 0, 0, 0, 0 }, 0, 0, 2,  };
extern TYP tp_ushort;  // = { bt_ushort, { 0, 0, 0, 0 }, 0, 0, 2,  };
extern TYP tp_long;    // = { bt_long,   { 0, 0, 0, 0 }, 0, 0, 4,  };
extern TYP tp_ulong;   // = { bt_ulong,  { 0, 0, 0, 0 }, 0, 0, 4,  };
extern TYP tp_float;   // = { bt_float,  { 0, 0, 0, 0 }, 0, 0, 4,  };
extern TYP tp_double;  // = { bt_double, { 0, 0, 0, 0 }, 0, 0, 8,  };
extern TYP tp_func;    // = { bt_func,   { 1, 0, 0, 0 }, 0, 0, 0,  };
extern TYP tp_funcN;   // = { bt_func,   { 1, 0, 0, 0 }, 0, 0, 0,  };
extern TYP tp_funcF;   // = { bt_func,   { 1, 0, 0, 0 }, 0, 0, 0,  };
extern TYP tp_funcS;   // = { bt_func,   { 1, 0, 0, 7 }, 0, 0, 0,  };

extern TYP tp_culong;  // = { bt_ulong,    0, 0, 1, 0, 0, 0, 4,  }; // const !


/*
 * Symbol-Types
 */

#define F66_VAR    0x0001         // non-bit Variables
#define F66_CON    0x0002         // named Constants
#define F66_BIT    0x0004         // Bit in Memory

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -