#ifndef xasm_h
#define xasm_h

/* These are common definitions to the 8 bit assembler and subroutines.
 *
 * $Log: xasm.h,v $
 * Revision 1.2  1997/06/04 01:22:33  david
 * ANSI-fied the program.
 *
 */

static char *xasm_h_Id = "$Id: xasm.h,v 1.2 1997/06/04 01:22:33 david Exp $";

#define BYTE unsigned char
#define WORD unsigned short int

/* These are some common variables */
extern int errnum; /* Number of errors this pass */
extern int line; /* Line # */
extern char *lptr2; /* Pointer to assembly line */
extern BYTE pass; /* Assembler pass # */

extern BYTE dp; /* 'Direct Page' register (for MC6809 (xasm09) ) */
extern WORD loc; /* Current location pointer */
extern WORD locinc; /* Amount to increment location pointer */
extern WORD start;  /* Place to start processing */
extern char *objfile; /* Name of Object Code file (if any) */
extern char out_form; /* Format of Object Code file */
extern char *filename; /* Name of Assembler file */
extern char fwdref; /* Forward reference flag (see symtab.c,proper.c) */
extern FILE *infd; /* Pointer to source file */

struct table
   {
   char *opname;    /* Name of instruction */
   char *opcode[6]; /* 6 modes of addressing */
   char irlen;      /* IMM. or REL operand length */
   };

char *proper( char *, char *, char *, struct table * );
char symfind( char *, WORD *, char );
void symins( char *, WORD, char );
void formstr( char *string );
void formind( long, int, int, int, int, int );
void formimm( int );
void formims( char * );
void formde( int, int );
void formpsh( int );
void formtfr( int, int );
void genintel( char * );
void outintel( WORD, char * );
void chk( char * );
void ichk( BYTE );
void gensym( char * );
void outsym( WORD, char * );
char *getline( void );
void doline( char * );
void xerror( char * );

#endif /* xasm_h */
