/* ---------------------------------------------------------------------- * FILE: main.c * PACKAGE: as31 - 8031/8051 Assembler. * * DESCRIPTION: * The file contains main(). It handles the arguments and makes * sure that pass 1 is done before pass 2 etc... * * REVISION HISTORY: * Jan. 19, 1990 - Created. (Ken Stauffer) * * AUTHOR: * All code in this file written by Ken Stauffer (University of Calgary). * January, 1990. */ static char * id_id= "Written by: Ken Stauffer";/* * */ #include #include extern int lineno; extern int pass,fatal; extern unsigned long lc; jmp_buf main_env; char *asmfile; int dashl=0; FILE *listing; /* ---------------------------------------------------------------------- * checkext: * Check the string s, for the presence of an extenstion e. * Return the position of the start of e in s. * or return NULL. */ char *checkext(s,e) char *s,*e; { register char *ps = s, *pe = e; while( *ps ) ps++; while( *pe ) pe++; for( ; ps>=s && pe>=e && *ps == *pe; ps--, pe-- ) if( pe == e ) return(ps); return(NULL); } main(argc,argv) char *argv[]; { FILE *fin; char *p,*dashF=NULL, *dashA=NULL; char objfile[100]; char lstfile[100]; int i; if( argc < 2 ) { fprintf(stderr,"Usage: %s [-l] [-Ffmt] [-Aarg] infile.asm\n", argv[0]); emitusage(); exit(1); } for(i=1; i