/*	 
 *	Example Program common defines and prototypes
 */

#define SWI _asm("swi")
#define GET_CCR (unsigned char)(_asm("tfr ccr, b") )
#define PUT_CCR(X) (_asm("tfr b,ccr", ((unsigned char)X )) )


#define NULL (void *)0

enum FLAG {TRUE,FALSE};
enum BIT_FLAG {CLEAR,SET};

typedef struct bits {
	unsigned char b0:1;
	unsigned char b1:1;
	unsigned char b2:1;
	unsigned char b3:1;
	unsigned char b4:1;
	unsigned char b5:1;
	unsigned char b6:1;
	unsigned char b7:1;
	} BITS;

typedef union bit_char {
	unsigned char byte;
	BITS b;
	} BIT_CHAR;

extern volatile BIT_CHAR PORTX;
extern volatile BIT_CHAR PORTY;
extern volatile BIT_CHAR PORTZ;
extern unsigned int table[];
extern volatile unsigned long swi_count;
extern unsigned char prime_table[];

/*	Function Prototypes 
 */
extern void  toggle_bits(char count);
extern void  clear_ports(void);
extern void  sieve( int loop );
extern void  initialize_date(void);
extern int   fact(int n);
extern void  fill_table(void);
extern float area_cir(long);

#define BIT0 (unsigned char)0x01
#define BIT1 (unsigned char)0x02
#define BIT2 (unsigned char)0x04
#define BIT3 (unsigned char)0x08
#define BIT4 (unsigned char)0x10
#define BIT5 (unsigned char)0x20
#define BIT6 (unsigned char)0x40
#define BIT7 (unsigned char)0x80

