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

📄 jtypes_h.h

📁 MCS51单片机的宏汇编器源程序。有需要的朋友请下载!
💻 H
字号:
//---------------------------------------------------------------------------
//   Jtypes_H.h
//---------------------------------------------------------------------------
#ifndef	Jtypes_H.h  // 防止被重复引用
#define Jtypes_H.h
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
typedef   signed char      int8;     //    -127 ~ 128
typedef unsigned char      int8u;    //       0 ~ 255
typedef   signed short     int16;    //  -32768 ~ 32767
typedef unsigned short     int16u;   //       0 ~ 65535
typedef   signed long      int32;    //   - 21M ~ + 21M
typedef unsigned long      int32u;   //       0 ~ + 42M
typedef unsigned __int64   int64u;   //       0 ~ +oo
typedef   signed __int64   int64;    //     -oo ~ +oo

typedef         int8       boolean;  // only have 0 & 1, but can be -1 too.
typedef         int8u      ERR;      // 0 = No error; 1 ~ 255 = Have error.
typedef         int16      Status;   // 状态 ( -32768 ~ 32767 )
//--------------------------------------------------------------------------

const ERR OK_no_Err = 0;
const ERR Have_Errs = 1;

const boolean Undefined_value = -1;
const boolean B_false         =  0;
const boolean B_true          =  1;
//---------------------------------------------------------------------------
union pool_8    // 8-bit池
{ int8u pot8;           // 1 byte
  struct
  { int8u potl   :4;    // half byte
    int8u poth   :4;
  }; // end struct
  struct
  { int8u bit0   :1;    // 1 bit
    int8u bit1   :1;
    int8u bit2   :1;
    int8u bit3   :1;
    int8u bit4   :1;
    int8u bit5   :1;
    int8u bit6   :1;
    int8u bit7   :1;
  }; // end struct
}; // end union
//---------------------------------------------------------------------------
union pool_16   // 16-bit池
{ int16u pot16;         // 1 word
   int8u pot8[2];       // 2 bytes

  pool_8 pool8[2];      // 8-bit池(2)
  struct
  { pool_8  pool8l;     //
    pool_8  pool8h;     //
  }; // end struct

  struct
  { int8u lowbyte;      // 低字节
    int8u highbyte;     // 高字节
  }; // end struct
  struct
  { int8u bit0   :1;    // 1 bit
    int8u bit1   :1;
    int8u bit2   :1;
    int8u bit3   :1;
    int8u bit4   :1;
    int8u bit5   :1;
    int8u bit6   :1;
    int8u bit7   :1;

    int8u bit8   :1;    // 1 bit
    int8u bit9   :1;
    int8u bita   :1;
    int8u bitb   :1;
    int8u bitc   :1;
    int8u bitd   :1;
    int8u bite   :1;
    int8u bitf   :1;
  }; // end struct
}; // end union
//---------------------------------------------------------------------------
union pool_32   // 32-bit池
{ int32u pot32;         // 1 double word
  int16u pot16[2];      // 2 words
   int8u pot8[4];       // 4 bytes

 pool_16 pool16[2];     // 16-bit池(2)
 pool_8  pool8[4];      //  8-bit池(4)

  struct
  { pool_16  pool16l;   //
    pool_16  pool16h;   //
  }; // end struct
}; // end union
//---------------------------------------------------------------------------
union pool_64   // 64-bit池
{ int64u pot64;         // 1 quarter word
  int32u pot32[2];      // 2 double word
  int16u pot16[4];      // 4 words
   int8u pot8[8];       // 8 bytes

 pool_32 pool32[2];     // 32-bit池(2)
 pool_16 pool16[4];     // 16-bit池(4)
 pool_8  pool8[8];      //  8-bit池(8)

  struct
  { pool_32  pool32l;   //
    pool_32  pool32h;   //
  }; // end struct
}; // end union
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
#define UseAssertion(str)        str

#define Jassert(p)  UseAssertion( (p)?(void)0:J_assert(#p,__FILE__,__LINE__); )
//---------------------------------------------------------------------------
void J_assert(char* cond, char* f, int l);
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
// 最高抽象类,所有的类都有它派生。它抽象了所有对象的共性。
//---------------------------------------------------------------------------
class JObject // Everything is an object.
{ private:
    // int ID;

  public:
    // If you choose to use show(), then every JObject take 4 more bytes.
    // #include <stdio.h>
    // virtual void show()const    { puts(" [JObject]"); } //

}; // end JObject
//---------------------------------------------------------------------------



#endif
//---------------------------------------------------------------------------
//               Written by JamesyFront.    ZLGmcu Dev.Co.Ltd.  2002.
//---------------------------------------------------------------------------


⌨️ 快捷键说明

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