COMM - DDADD.ZIP - MACDEF.H

 
Output of file : MACDEF.H contained in archive : DDADD.ZIP

/*
Header: MACDEF
Version: 1.1
Changed: 880725:1710
Author: M. A. Chase
Copyright: Public Domain

M. A. Chase's commonly used values and macros

History:
871224 1.0 Initial version: include stdlib and stddef,
define NUL, TRUE, FALSE, lo, and hi
880603 1.1 Add MK_LONG, LONG_LOW, LONG_HIGH, peekl, and pokel
880725 2.0 Add ELIF
*/
#include
#include

/* constants */
#define NUL 0x00 /* Character NUL */
#define TRUE 1
#define FALSE 0

/* macros */
/* break out bytes from an int */
#define lo(x) ((unsigned) (x) & 0x00FF)
#define hi(x) (lo((x) >> 8))
/* else if combination for real case statements */
#define ELIF(x) else if (x)

/* long int versions of MK_FP, FP_HIGH, and FP_LOW */
#define MK_LONG(high,low) (((unsigned long)(high) << 16) | (low))
#define LONG_LOW(longint) ((unsigned)(longint))
#define LONG_HIGH(longint) ((unsigned)((unsigned long)(longint) >> 16))

/* long versions of peek and poke */
#define peekl(a,b) (*((long int far*)MK_FP((a),(b))))
#define pokel(a,b,c) (*((long int far*)MK_FP((a),(b))) = (long int)(c))