;; ----===*******===----
	%INCLUDE 'PROLOG.NSM' 
;; --== NASM vers. 26-Mar-2010 ==--
	;; ***---- Program Body ----***
	  [SECTION .cseg]
;/* CCNA_0r1.C for pcdoslib & .exe => CCNA.EXE
;** Vers: 0r1  By: s_dubrovich@yahoo.com
;** ?(c): COPYLEFT - pls rename yours for branch traceability.
;** 22-May-11 01:00:37 PM - v.0r1, chgd deblank to filter CR
;** 23-May-11 09:27:40 PM - chg eof -> eof_flg, eol -> EOL
;** 29-May-11 09:14:55 AM - modify doinclude to use fname_array.
;** 30-May-11 09:27:43 AM - input -> fp_input, output -> fp_output
;**  input2 -> fp_input2
;** 19-Jun-11 07:51:10 AM - expanded 'Input filename' msg.
;*/
;/**----------------------------------------------------**/
;/** File: CCN9_0r0.C                                   **/
;/** Last: 19-Dec-10 09:14:35 AM                        **/
;/** Prev: 19-Dec-10 09:14:35 AM                        **/
;/** Base: 01-Apr-10 09:23:04 PM                        **/
;/** Vers: 0r0 r8 07-Jul-2010                           **/
;/** From: CCN8 v.2r8                                   **/
;/** Goal: build with PowerC, add switch stmt, ansi-fied**/
;/** Note: fixed typo for 'define name', for PowerC     **/
;/**  comment out 'initfcb()'                           **/
;/**----------------------------------------------------**/
;/** File: CCN8_2r8.C                                   **/
;/** Last: 01-Apr-10 09:23:04 PM                        **/
;/** Prev: 28-Mar-10 10:59:04 PM, 30-Mar-10 08:19:35 AM **/
;/** Base: 17-Feb-10 11:23:53 AM                        **/
;/** Vers: 0.0.2 r8 07-Jul-2010                         **/
;/** From: CCN8 v.2r7hd                                 **/
;/** Goal: add LONG as 4 bytes.                         **/
;/**----------------------------------------------------**/
;/** currently, char *x[n] is bad as array of pointers  **/
;/**  to char is seen as array of char, no initializers.**/
;/** Goal: add LONG as 4 bytes.                         **/
;/**----------------------------------------------------**/
;/** File: CCN8    .C                                   **/
;/** Last: 01-Apr-10 09:23:04 PM                        **/
;/** Prev: 28-Mar-10 10:59:04 PM, 30-Mar-10 08:19:35 AM **/
;/** Base: 17-Feb-10 11:23:53 AM                        **/
;/** Vers: 0.0.2 r7hd 26-Mar-2010                       **/
;/**----------------------------------------------------**/
;/** 01-Apr-10 04:14:34 PM  2rhd                        **/
;/** worked on ?:                                       **/
;/**----------------------------------------------------**/
;/** 28-Mar-10 09:08:12 PM  2r7hc                       **/
;/** - worked on - !, ~,                                **/
;/**----------------------------------------------------**/
;/** 20-Mar-10 09:57:15 AM 2r7h                         **/
;/** inbyte()->scan_nxt(), heir1b for '||' boolean      **/
;/**----------------------------------------------------**/
;/** 19-Mar-10 10:22:58 PM 2r7h                         **/
;/** - worked on heir1c for '&&' boolean -              **/
;/**----------------------------------------------------**/
;/** 17-Mar-10 09:22:40 AM 2r7h                         **/
;/** -begin adding fuctionality-                        **/
;/**----------------------------------------------------**/
;/** File: CCN8    .C                                   **/
;/** Last: 16-Mar-10 11:49:51 AM                        **/
;/** Prev: 14-Mar-10 03:51:53 PM, 15-Mar-10 06:39:14 AM **/
;/** Base: 17-Feb-10 11:23:53 AM                        **/
;/** Vers: 0.0.2 r7gi 06-Mar-2010                       **/
;/** Note: The sa_ prefix denotes a codegen fn, i.e. a  **/
;/** syntactic action is performed to output asm code.  **/
;/**----------------------------------------------------**/
;/** 16-Mar-10 07:27:41 AM 2r7gi                        **/
;/** tok_in->is_identifier,                             **/
;/**----------------------------------------------------**/
;/** 15-Mar-10 06:39:14 AM 2r7gh                        **/
;/** c_inspect->inspect_chr, store()->sa_store(), getloc**/
;/** ->sa_deref,type->TYPE,ident->IDENT,name->NAME,     **/
;/** storage->STORAGE,offset->OFFSET,symtbsz->SYMTBSZ,  **/
;/** symsiz->SYMB_SIZE,numbstatics->NUMBSTATICS,namesize**/
;/** ->NAMESIZE,namemax->NAMEMAX                        **/
;/**----------------------------------------------------**/
;/** 14-Mar-10 03:51:53 PM 2r7g                         **/
;/** precedence comments                                **/
;/**----------------------------------------------------**/
;/** 13-Mar-10 07:58:47 AM 2r7f                         **/
;/** - lval->eval,ws_sym->WS_SYM,ws_sp->WS_SP,ws_loop-> **/
;/** WS_LOOP,ws_lbl->WS_LBL,ws_lbl2->WS_LBL2,wstblz->   **/
;/** WSTBLSZ,ws_sz->WS_SZ,ws_max->WS_MAX,litabsz->      **/
;/** LITABSZ,litmax->LITMAX,linesize->LINESIZE,linemax  **/
;/** ->LINEMAX,mpmax->MP_MAX,macqsize->MACQ_SZ,macmax-> **/
;/** MAC_MAX,                                           **/
;/**----------------------------------------------------**/
;/** 12-Mar-10 06:55:53 AM 2r7f                         **/
;/** chg'd while 'queue' lingo to while 'stack' lingo   **/
;/** wq->ws,Zsp->Csp                                    **/
;/**----------------------------------------------------**/
;/** 11-Mar-10 06:47:10 AM 2r7e                         **/
;/** - variable->VARIABLE,array->ARRAY,pointer->POINTER **/
;/** function->FUNCTION,cchar->CCHAR,cint->CINT,statik->**/
;/** C_STATIC,stkloc->C_AUTO,stif->ST_IF,stwhile->      **/
;/** ST_WHILE,streturn->ST_RETURN,stbreak->ST_BREAK,    **/
;/** stcont->ST_CONT,stasm->ST_ASM,stexp->ST_EXPR,ccseg **/
;/** ->sa_cseg,cdseg->sa_dseg,                          **/
;/**----------------------------------------------------**/
;/** File: CCN8    .C                                   **/
;/** Last: 10-Mar-10 11:05:10 PM                        **/
;/** Prev: 08-Mar-10 02:34:40 PM, 09-Mar-10 09:22:38 PM **/
;/** Base: 17-Feb-10 11:23:53 AM                        **/
;/** Vers: 0.0.2 r7d 06-Mar-2010                        **/
;/**----------------------------------------------------**/
;/** 10-Mar-10 06:18:28 AM 2r7c                         **/
;/** - ren: comments()->sa_comments, blanks()->deblank()**/
;/** 10:49:17 AM - modified while(expr) for 'T' label   **/
;/** 11:05:10 PM - completed do..while also             **/
;/**----------------------------------------------------**/
;/** 09-Mar-10 08:20:01 AM 2r7b                         **/
;/** - attempt adding test2(falselabl, T|F) & testjmp2( **/
;/**   falselabl, T|F);                                 **/
;/** - added add'l expr2(comma); logical_tst2(label),   **/
;/**   sa_tst2_jmp(label,tf);                           **/
;/** -= (FAILED) =-                                     **/
;/** - added sa_if_tst(t_lbl,flab1) int t_lbl,flab1; 2if**/
;/** ! works !, next modify while(expr)                 **/
;/**----------------------------------------------------**/
;/** 08-Mar-10 06:53:30 AM 2r6                          **/
;/**  - attempt T-F chg for jmp on condition.           **/
;/**   test (label, ft);testjump (label, ft); & callers **/
;/**   testjump:(heir1a),(heir1b),(heir1c),(dofor).     **/
;/**   test:(doif),(dowhile),(dodo).                    **/
;/**  - name chg'd: pstr -> chr_const, qstr -> str_const**/
;/**  - constant()->kind_const(), chr()->c_inspect(),   **/
;/**  - nch()->lookahead(), gch()->g_nxtchr(), findloc->**/
;/**findauto, findglb->findstatic, addglb()->addstatic()**/
;/**addloc()->addauto(), declloc()->declauto(), glbptr->**/
;/**staticptr, locptr->autoptr, cptr->symbptr, startloc **/
;/** ->startauto, startglb->startstatic, numglbs->      **/
;/** numbstatics, endglb->endstatics, endloc->endautos  **/
;/**declglb->declstatic, dumpglbs->dumpstatics, dumplocs**/
;/**->dumpautos, needsub->mk_subscript.                 **/
;/**----------------------------------------------------**/
;/** 06-Mar-10 11:30:51 AM asm_symb(), removed uppercase**/
;/** 0.0.2 r2 06-Mar-2010 more edits                    **/
;/** 07-Mar-10 12:38:00 PM 0.0.2 r3                     **/
;/**  - chg sa_swapstk() EA as [SS:DI]                  **/
;/**  - chg sa_indirect() EA as [SS:BX]                 **/
;/** 07-Mar-10 02:49:36 PM 0.0.2 r4                     **/
;/**  - chg sa_callstk() EA as [SS:DI]                  **/
;/** 07-Mar-10 03:08:41 PM                              **/
;/** !! anomally noted !! .if. stmt + comments length   **/
;/** exceed some length without  then the parser    **/
;/** gets confused !!                                   **/
;/** 08-Mar-10 06:32:22 AM - Ren rvalue -> rq_val_sa    **/
;/** note, DS,SS separation req's rewrite, now arrays,  **/
;/** and pointers prevent separate segmentation. Revert **/
;/** these back in Vers: 0.0.2 r5                       **/
;/**----------------------------------------------------**/
;/** File: CCN7    .C                                   **/
;/** Last: 06-Mar-10 07:49:07 AM                        **/
;/** Prev: 17-Feb-10 11:23:53 AM                        **/
;/** Base: 17-Feb-10 11:23:53 AM                        **/
;/** Vers: 0.0.2 r1 06-Mar-2010                         **/
;/**----------------------------------------------------**/
;/** 0.0.2 r0 06-Mar-2010 vers with name changes        **/
;/** 0.0.2 r1 06-Mar-2010 chgd raise() -> toupperi()    **/
;/** chgd outname() -> asm_symb(), removed leading "cz" **/
;/** note: removing "cz" requires chging C5LIB versions.**/
;/**----------------------------------------------------**/
;/** File: CCN6    .C                                   **/
;/** Note: sa_ prepended to code generation functions,  **/
;/** which  stands for Syntactic Action.                **/
;/**----------------------------------------------------**/
;/** File: CCN5    .C  before testing EXE header form.  **/
;/** implemented thru the PROLOG as EXEtst5.nsm         **/
;/** Last: 17-Feb-10 11:23:53 AM                        **/
;/** Prev: 14-Feb-10 07:42:44 AM                        **/
;/** Base: 14-Feb-10 07:42:44 AM                        **/
;/** 17-Feb-10 11:23:53 AM - edit added spacing for     **/
;/** readability.                                       **/
;/**----------------------------------------------------**/
;/** File: CCN4    .C  testing INCLUDE C5LIBT.C         **/
;/** Last: 09-Feb-10 06:33:43 AM                        **/
;/** Prev: 08-Feb-10 06:11:31 AM                        **/
;/** Base: 08-Feb-10 06:11:31 AM                        **/
;/** Vers: 0.0.1 r6  10-Jan-2010 version.               **/
;/** Note: This version begins CodeSet 4.               **/
;/**  First, increase symbol name length to 11, and also**/
;/** symbol structure size to 16 for longer ident. len. **/
;/** name prefix,suffix (7,7)->(77,3)                   **/
;/** 09-Feb-10 06:33:43 AM -fiddled with symbols &tbl sz**/ 
;/**----------------------------------------------------**/
;/** File: C86NC5C .C  testing INCLUDE C5LIBT.C         **/
;/** Last: 06-Feb-10 08:32:39 AM                        **/
;/** Prev: 01-Feb-10 06:15:12 PM, 01-Feb-10 11:09:00 PM **/
;/** Base: 11-Jan-10 05:44:51 AM                        **/
;/** Vers: 0.0.1 r6  10-Jan-2010 version.               **/
;/** Note: chg'd ot("], ..") to outasm("], ..") to x the**/
;/** leading tab to ']' for the output. Added nl() to   **/
;/** the frame label at the end of a fn.                **/
;/** ref. test code C86SELF.C, testing INCLUDE C5LIBT.C **/
;/** chgd emits str lits as DB decimal digits to emit as**/
;/** DB 'lits strings', removed 'outbyte(12);' from     **/
;/** ask() as it doesn't clear the screen.              **/
;/**----------------------------------------------------**/
;/** C86NC5C .C  By: s_dubrovich@yahoo.com              **/
;/** Last: 11-Jan-10 05:44:51 AM                        **/
;/** Prev: 09/11/04 08:18:33 PM, 09/11/04 10:14:42 PM   **/
;/** Init: 10-Jan-10 10:04:01 PM                        **/
;/** Vers: 0.0.1 r1                                     **/
;/** Note: This branch uses lval[3], array of 3         **/
;/** Chg eol, Chg include to nasm form #include ""      **/
;/** Chg dumpglbs() for TIMES, chg col->colon();        **/
;/** 11-Jan-10 05:44:51 AM ..Incr macqsize->2176        **/
;/**----------------------------------------------------**/
;/** This version for NASM is codeset 3. It uses C5LIBT **/
;/** which is a minor varient of C5LIB.C, and this ver- **/
;/** sion adds stubs for prolog and epilog code for     **/
;/** inclusion, to allow easier versioning for .com,    **/
;/** .exe or CP/M-86 .cmd, or others.  These %INCLUDE's **/
;/** can be commented out, if desired.                  **/
;/** NCC.C Vers. c0.1.5 is codeset 1.                   **/
;/** NCCR1.C Vers. 0.2.6 is codeset 2.                  **/
;/** C86NC5C.C Vers 0.0.1 r1 is codeset 3.              **/
;/**----------------------------------------------------**/
;/** The main chg in C86N is expansion of lval[] from 2 **/
;/** elements to three, and the dumping of auto's at the**/
;/** end of each function as comments for the programmer**/
;/** and the delineation of code and data as separate.  **/
;/** C86N is the version of Cain's Small-c for CP/M-86  **/
;/** With code and data separate, now memory models of  **/
;/** other than .com can be utilized.                   **/
;/** C86NC5C.C is my NASMication of the C86N port with  **/
;/** the C5LIB Call 5 I/O Library.  C5LIB is a minimal  **/
;/** set of functions.  86Dos implements CP/M-80        **/
;/** functionality thru the Call 5 Interface, available **/
;/** still in XP's cmd.exe, for example.                **/
;/*******************************************************/
;/*							*/
;/*		small-c compiler			*/
;/*							*/
;/*		  by Ron Cain				*/
;/*							*/
;/*******************************************************/
;#include INCLUDE.H
;/*-----------------------------------------------------------------------75
;** include.h,  for include.c
;** 03-Jun-11 02:17:35 PM
;*/
;
;#define TRUE	1
;#define FALSE	0
;#define TAB	9
;
;
;#define EOF	-1
;#define EOL_st	-2
;#define NULL	0
;				/** pcdos, cpm, EOL is (CR,LF)=(0Dh,0Ah) **/
;#define CR	13		/** CR := 0Dh **/
;#define LF	10		/** LF := 0Ah **/
;				/*** #define NL	10 ** LF := 0Ah **/
;#define MAXLINE	128	/** maximum line length **/
;#define MAXLN	129		/** with null **/
;
;#define STDIN	0
;#define STDOUT	1
;#define STDERR	2
;
;/** eo include.h **/
;
;#define BANNER  "* * *  Small-C  V1.1  * * *"
;
;#define VERSION "Based on Version N: July 17, 1980"
;
;#define AUTHOR "       By Ron Cain"
;
;/*	Define system dependent parameters	*/
;/** #define CR 13 ** for pcDos text NL, see deblank **/
;
;/*	Stand-alone definitions			*/
;/** #define NULL 0 **/
;/** #define EOL 13 **/
;#define EOL 10	/** this is correct **/
;
;/*	UNIX definitions (if not stand-alone)	*/
;/* #include 	*/
;/* #define EOL 10	*/
;/**--------------------------------------------**/
;/** #define	FALSE	0 **/
;/** #define	TRUE	1 **/
;#define	NO	0
;#define	YES	1
;
;/** #define	EOF	-1 **/
;/** #define	LF	10 **/
;
;/** #define	comma 44 **/
;/**--------------------------------------------**/
;/*    Define the symbol table parameters        */
;
;#define SYMB_SIZE	18  /** +2, struc len increased **/
;#define SYMTBSZ	6480	/** orig. 5040 **/
;#define NUMBSTATICS	300	/** 300*18=5400 **/
;
;/** #def numautos 60 *18 = 1080 + 5400 = 6480 **/
;
;#define startstatic	symtab
;#define endstatics	startstatic+NUMBSTATICS*SYMB_SIZE
;#define startauto	endstatics+SYMB_SIZE
;#define endautos	symtab+SYMTBSZ-SYMB_SIZE
;
;/* Define symbol table entry format, size is SYMB_SIZE */
;
;#define NAME	0    /** length 13 {0..12}      **/
;                    /** namemax + null = 13    **/
;#define IDENT	13   /** len 1 (indirection ndx)**/
;#define TYPE	14   /** length 1               **/
;#define STORAGE 15  /** length 1               **/
;#define OFFSET	16   /** length 2 {16..17}      **/
;	/** SYMB_SIZE must match tbl len **/
;
;/*	System wide name size (for symbols)	*/
;#define NAMESIZE 13   /** array size with null **/
;#define NAMEMAX  12   /** truncate if needed   **/
;/**--------------------------------------------**/
;
;/*	Define possible entries for "ident"	*/
;#define	VARIABLE 1
;#define	ARRAY    2
;#define	POINTER  3
;#define	FUNCTION 4
;
;/*	Define possible entries for "type"	*/
;#define	CCHAR	1
;#define	CINT	2
;#define	CLONG 4  /** added 30Jun2010 s_d v.2r8 **/
;
;/*	Define possible entries for "storage"	*/
;#define	C_STATIC	1
;#define	C_AUTO	2
;
;/*	Define the "while" statement stack	*/
;#define	WSTBLSZ	100
;#define	WS_SZ		5
;#define	WS_MAX	ws+WSTBLSZ-WS_SZ
;
;/*	Define entry offsets in while stack	*/
;/** indexes of int elements **/
;#define	WS_SYMS 0
;#define	WS_SP   1
;#define	WS_LOOP 2
;#define	WS_LBL  3
;#define	WS_LBL2 4
;
;/** ucc **/
;/* entry offsets in "do"/"for"/"while"/"switch" stack */
;
;#define	WSSYM	0
;#define	WSSP	1
;#define	WSTYP	2
;#define	WSCASEP	3
;#define	WSTEST	3
;#define	WSINCR	4
;#define	WSDEF	4
;#define	WSBODY	5
;#define	WSTAB	5
;#define	WSEXIT	6
;
;/* possible entries for "wstyp" */
;
;#define	WSWHILE	0
;#define	WSFOR		1
;#define	WSDO		2
;#define	WSSWITCH	3
;
;/* "switch" label stack */
;
;#define	SWSTSZ	100
;
;/*	Define the literal pool			*/
;#define	LITABSZ	1000
;#define	LITMAX	LITABSZ-1
;
;/*	Define the input line			*/
;#define	LINESIZE	80
;#define	LINEMAX	LINESIZE-1
;#define	MP_MAX	LINEMAX
;
;/*	Define the macro (define) pool		*/
;#define	MACQ_SZ 2176  /** was 1000 **/
;#define	MAC_MAX	MACQ_SZ-1
;
;/*	Define statement types (tokens)		*/
;#define	ST_IF     1
;#define	ST_WHILE  2
;#define	ST_RETURN 3
;#define	ST_BREAK  4
;#define	ST_CONT   5
;#define	ST_ASM    6
;#define	ST_EXPR   7
;/** ucc **/
;#define	ST_DO		8
;#define	ST_FOR	9
;#define	ST_SWITCH	10
;
;/* Define how to carve up a name too long for the assembler */
;/** originally 7,7 **/
;#define asmpref	11
;#define asmsuff	3
;
;/**------------------------------------**/
;/*    Now reserve some storage words    */
;/**  S T A T I C   V A R I A B L E S   **/
;/**------------------------------------**/
; 
;char	symtab[SYMTBSZ];	/* symbol table */
;char	*staticptr,*autoptr;	/* ptrs to next entries */
;
;int	ws[WSTBLSZ];	/* while stack */
;int	*wsptr;		/* ptr to next entry */
;
;/** ucc **/
;int	swstcase[SWSTSZ];
;int	swstlab[SWSTSZ];
;int	swstp;
;
;char	litq[LITABSZ];	/* literal pool */
;int	litptr;		/* ptr to next entry */
;
;char	macq[MACQ_SZ];	/* macro string buffer */
;int	macptr;		/* and its index */
;
;char	line[LINESIZE];	/* parsing buffer */
;char	mline[LINESIZE];	/* temp macro buffer */
;int	lptr,mptr;		/* ptrs into each */
;
;/*	Misc storage	*/
;int	nxtlab,	/* next avail label # */
;	litlab,	/* label # assigned to literal pool */
;	Msp,		/* Maximum relative stk ptr */
;	Csp,		/* compiler relative stk ptr */
;	argstk,	/* function arg sp */
;	ncmp,		/* # open compound statements */
;	errcnt,	/* # errors in compilation */
;	errstop,	/* stop on error			gtf 7/17/80 */
;	eof_flg,	/* set non-zero on final input eof */
;	fp_input,	/* iob # for input file */
;	fp_output,	/* iob # for output file (if any) */
;	fp_input2,	/* iob # for "include" file */
;	glbflag,	/* non-zero if internal globals */
;	ctext,	/* non-zero to intermix c-source */
;	cmode,	/* non-zero while parsing c-code */
;			/* zero when passing assembly code */
;	lastst,	/* last executed statement type */
;	mainflg,	/* output is to be first asm file	gtf 4/9/80 */
;	saveout,	/* holds output ptr when diverted to console	   */
;			/*					gtf 7/16/80 */
;	fnstart,	/* line# of start of current fn.	gtf 7/2/80 */
;	lineno,	/* line# in current file		gtf 7/2/80 */
;	infunc,	/* "inside function" flag		gtf 7/2/80 */
;	savestart,	/* copy of fnstart "	"		gtf 7/16/80 */
;	saveline,	/* copy of lineno  "	"		gtf 7/16/80 */
;	saveinfn;	/* copy of infunc  "	"		gtf 7/16/80 */
;
;char   *currfn,	/* ptr to symtab entry for current fn.	gtf 7/17/80 */
;       *savecurr;	/* copy of currfn for #include		gtf 7/17/80 */
;char	quote[2];	/* literal string for '"' */
;char	*symbptr;	/* work ptr to any char buffer */
;int	*iptr;	/* work ptr to any int buffer */
;
;/*	>>>>> start cc0 <<<<<<		*/
;
;/*							*/
;/*	Compiler begins execution here	*/
;/*							*/
;main()
main:
	PUSH BP
	SUB  SP, AutoC1
	MOV  BP, SP

;	{
;	staticptr=startstatic;	/* clear global symbols */
	MOV  BX, symtab
	MOV  Word [staticptr], BX
;	autoptr=startauto;	/* clear local symbols */
	MOV  BX, symtab
	PUSH BX
	MOV  BX, +300
	PUSH BX
	MOV  BX, +18
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	MOV  Word [autoptr], BX
;	wsptr=ws;		/* clear while stack */
	MOV  BX, ws
	MOV  Word [wsptr], BX
;	macptr=	/* clear the macro pool */
;	litptr=	/* clear literal pool */
;  	Msp =		/* stack ptr (maximum) */
;  	Csp =		/* stack ptr (relative) */
;	errcnt=	/* no errors */
;	errstop=	/* keep going after an error		gtf 7/17/80 */
;	eof_flg=	/* not eof yet */
;	fp_input=	/* no input file */
;	fp_input2=	/* or include file */
;	fp_output=	/* no open units */
;	saveout=	/* no diverted output */
;	ncmp=		/* no open compound states */
;	lastst=	/* no last statement yet */
;	mainflg=	/* not first file to asm 		gtf 4/9/80 */
;	fnstart=	/* current "function" started at line 0 gtf 7/2/80 */
;	lineno=	/* no lines read from file		gtf 7/2/80 */
;	infunc=	/* not in function now			gtf 7/2/80 */
;	quote[1]=
	MOV  BX, quote
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	PUSH BX
;	0;		/*  ...all set to zero.... */
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
	MOV  Word [infunc], BX
	MOV  Word [lineno], BX
	MOV  Word [fnstart], BX
	MOV  Word [mainflg], BX
	MOV  Word [lastst], BX
	MOV  Word [ncmp], BX
	MOV  Word [saveout], BX
	MOV  Word [fp_output], BX
	MOV  Word [fp_input2], BX
	MOV  Word [fp_input], BX
	MOV  Word [eof_flg], BX
	MOV  Word [errstop], BX
	MOV  Word [errcnt], BX
	MOV  Word [Csp], BX
	MOV  Word [Msp], BX
	MOV  Word [litptr], BX
	MOV  Word [macptr], BX
;	quote[0]='"';	/* fake a quote literal */
	MOV  BX, quote
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +34
	POP  DI
	MOV  Byte [DI], BL
;	currfn=NULL;	/* no function yet		gtf 7/2/80 */
	MOV  BX, +0
	MOV  Word [currfn], BX
;	cmode=1;	/* enable preprocessing */
	MOV  BX, +1
	MOV  Word [cmode], BX
;
;/**--------------------------------------------**/
;/** IO Init code before file use, in C5LIBT.C  **/
;/**	initfcb(); ** comment out for PowerC     **/
;/**--------------------------------------------**/
;	/*				*/
;	/*	compiler body	*/
;	/*				*/
;	ask();		/* get user options */
	CALL ask
;	openout();		/* get an output file */
	CALL openout
;	openin();		/* and initial input file */
	CALL openin
;	header();		/* intro code */
	CALL header
;	parse(); 		/* process ALL input */
	CALL parse
;	dumpstatics();	/* and all static memory */
	CALL dumpstatics
;	trailer();		/* follow-up code */
	CALL trailer
;	closeout();		/* close the output (if any) */
	CALL closeout
;	errorsummary();	/* summarize errors (on console!) */
	CALL errorsummary
;/**	return;		** then exit to system */
;	exit(); /*** sjd 25-JUL-2008 ***/
	CALL exit
;	}
	POP  BP
	RET

AutoC1	EQU 0
;
;/*					*/
;/*	Abort compilation		*/
;/*		gtf 7/17/80		*/
;abort()
abort:
	PUSH BP
	SUB  SP, AutoC2
	MOV  BP, SP

;{
;	int j,k;
;
;	if (fp_input2) endinclude();
	MOV  BX, [Word fp_input2]
	OR   BX, BX
	JNZ  L_3
	JMP  L_4
L_3:
	CALL endinclude
;	if (fp_input)  fclose(fp_input);
L_4:
	MOV  BX, [Word fp_input]
	OR   BX, BX
	JNZ  L_5
	JMP  L_6
L_5:
	MOV  BX, [Word fp_input]
	PUSH BX
	CALL fclose
	ADD  SP, +2
;	closeout();
L_6:
	CALL closeout
;	toconsole();
	CALL toconsole
;	pl("Compilation aborted.");  nl();
	MOV  BX, L_2+0
	PUSH BX
	CALL pl
	ADD  SP, +2
	CALL nl
;	exit();
	CALL exit
;}  /* end abort */
	ADD  SP, AutoC2
	POP  BP
	RET

AutoC2	EQU 4
;	j	VAR	INT	-2
;	k	VAR	INT	-4

	  [SECTION .dseg]
L_2	DB "Compilation aborted.",0

	  [SECTION .cseg]
;
;/*						*/
;/*	Process all input text		*/
;/*						*/
;/* At this level, only static declarations, */
;/*	defines, includes, and function */
;/*	definitions are legal...	*/
;parse()
parse:
	PUSH BP
	SUB  SP, AutoC7
	MOV  BP, SP

;{
;	while (eof_flg == 0)		/* do until no more input */
L_8:
	MOV  BX, [Word eof_flg]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_9
	JMP  L_10
L_9:
;		{
;		if (amatch("char",4))
	MOV  BX, L_7+0
	PUSH BX
	MOV  BX, +4
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_11
	JMP  L_12
L_11:
;			{
;			declstatic(CCHAR);
	MOV  BX, +1
	PUSH BX
	CALL declstatic
	ADD  SP, +2
;			ns();
	CALL ns
;			}
;		else if (amatch("int",3))
	JMP  L_13
L_12:
	MOV  BX, L_7+5
	PUSH BX
	MOV  BX, +3
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_14
	JMP  L_15
L_14:
;			{
;			declstatic(CINT);
	MOV  BX, +2
	PUSH BX
	CALL declstatic
	ADD  SP, +2
;			ns();
	CALL ns
;			}
;		else if (match("#asm")) doasm();
	JMP  L_16
L_15:
	MOV  BX, L_7+9
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_17
	JMP  L_18
L_17:
	CALL doasm
;		else if (match("#include")) doinclude();
	JMP  L_19
L_18:
	MOV  BX, L_7+14
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_20
	JMP  L_21
L_20:
	CALL doinclude
;		else if (match("#define")) addmac();
	JMP  L_22
L_21:
	MOV  BX, L_7+23
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_23
	JMP  L_24
L_23:
	CALL addmac
;		else newfunc();
	JMP  L_25
L_24:
	CALL newfunc
L_25:
L_22:
L_19:
L_16:
L_13:
;		deblank();	/* force eof if pending */
	CALL deblank
;		} /** deblank invokes  preprocess(), inline(), etc. **/
	JMP  L_8
L_10:
;} /** eo parse **/
	POP  BP
	RET

AutoC7	EQU 0

	  [SECTION .dseg]
L_7	DB "char",0
	DB "int",0
	DB "#asm",0
	DB "#include",0
	DB "#define",0

	  [SECTION .cseg]
;
;/*						*/
;/*	Dump the literal pool		*/
;/*						*/
;
;/** Test as DB "Str",0, .. Null terminated **/
;/** litptr represents next free position in table **/
;/** Table Entries are null terminated strings **/
;/** Strings are from litq 0 up to litptr **/
;
;dumplits()
dumplits:
	PUSH BP
	SUB  SP, AutoC26
	MOV  BP, SP

;{
;	int j,k;
;
;	if (litptr == 0) return;	/* if nothing there, exit...*/
	MOV  BX, [Word litptr]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_27
	JMP  L_28
L_27:
	ADD  SP, AutoC26
	POP  BP
	RET
;	sa_dseg();			/* Put back in data segment. */
L_28:
	CALL sa_dseg
;	printlabel (litlab);	/* print literal label */
	MOV  BX, [Word litlab]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	k=0;				/* init an index... */
	LEA  BX, [AutoC26-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;
;	while (k < litptr)	/** loop thru literal strings buffer **/
L_29:
	LEA  BX, [AutoC26-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word litptr]
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_30
	JMP  L_31
L_30:
;		{			/** do one line per string **/
;		j = 1;            /** instring flag, reset for each DB **/
	LEA  BX, [AutoC26-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;		defbyte();		/** B.O.L. pseudo-op to define byte, DB **/
	CALL defbyte
;		if (litq[k]) outbyte(34); /** start string with quote **/
	MOV  BX, litq
	PUSH BX
	LEA  BX, [AutoC26-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_32
	JMP  L_33
L_32:
	MOV  BX, +34
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;
;		while (j)		/** j is control flag **/
L_33:
L_34:
	LEA  BX, [AutoC26-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_35
	JMP  L_36
L_35:
;			{
;			if ((litq[k] & 127) == 0)  
	MOV  BX, litq
	PUSH BX
	LEA  BX, [AutoC26-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_37
	JMP  L_38
L_37:
;				{	/** next is null **/
;				if (j == 1)
	LEA  BX, [AutoC26-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_39
	JMP  L_40
L_39:
;					{ /** leading null is probably an error **/
;					outbyte(',');
	MOV  BX, +44
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;					outbyte('0');
	MOV  BX, +48
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;					nl(); /** one str per DB, next line. **/
	CALL nl
;					j = 0; k++;
	LEA  BX, [AutoC26-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
	LEA  BX, [AutoC26-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;					break;
	JMP  L_36
;					}	/** break while, to ck j **/
;				}
L_40:
;			else if ((litq[k] & 127) < ' ') k++;  /** filter lo **/
	JMP  L_41
L_38:
	MOV  BX, litq
	PUSH BX
	LEA  BX, [AutoC26-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	PUSH BX
	MOV  BX, +32
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_42
	JMP  L_43
L_42:
	LEA  BX, [AutoC26-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;			else if ((litq[k] & 127) > '~') k++;  /** filter hi **/
	JMP  L_44
L_43:
	MOV  BX, litq
	PUSH BX
	LEA  BX, [AutoC26-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	PUSH BX
	MOV  BX, +126
	POP  DX
	CALL ccgt
	OR   BX, BX
	JNZ  L_45
	JMP  L_46
L_45:
	LEA  BX, [AutoC26-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;			else	{	/** xfer chr, lookahead for next is chr **/
	JMP  L_47
L_46:
;				outbyte((litq[k++] & 127));
	MOV  BX, litq
	PUSH BX
	LEA  BX, [AutoC26-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;				if ((litq[k]& 127) == 0) outbyte(34);
	MOV  BX, litq
	PUSH BX
	LEA  BX, [AutoC26-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_48
	JMP  L_49
L_48:
	MOV  BX, +34
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;					/** eo str quote **/
;				}
L_49:
L_47:
L_44:
L_41:
;			}	/** EO Line **/
	JMP  L_34
L_36:
;		}	/** gone thru Literals **/
	JMP  L_29
L_31:
;	sa_cseg();	/* Put back in code segment. */
	CALL sa_cseg
;}  /** eo dumplits **/
	ADD  SP, AutoC26
	POP  BP
	RET

AutoC26	EQU 4
;	j	VAR	INT	-2
;	k	VAR	INT	-4
;
;/*						*/
;/*	Dump all static variables	*/
;/*						*/
;/** modified for NASM 'TIMES amt D{B|W} 0' **/
;
;dumpstatics()
dumpstatics:
	PUSH BP
	SUB  SP, AutoC50
	MOV  BP, SP

;{
;	int j;
;
;	if (glbflag == 0) return;	/* don't if user said no */
	MOV  BX, [Word glbflag]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_51
	JMP  L_52
L_51:
	ADD  SP, AutoC50
	POP  BP
	RET
;
;	sa_dseg();		/* Put back in data segment. */
L_52:
	CALL sa_dseg
;	symbptr = startstatic;
	MOV  BX, symtab
	MOV  Word [symbptr], BX
;
;	while	(symbptr < staticptr)
L_53:
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, [Word staticptr]
	POP  DX
	CALL ccult
	OR   BX, BX
	JNZ  L_54
	JMP  L_55
L_54:
;		{
;		if (symbptr[IDENT] != FUNCTION)
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +4
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_56
	JMP  L_57
L_56:
;			/* do if anything but function */
;			{
;			asm_symb(symbptr);
	MOV  BX, [Word symbptr]
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
;				/* output name as label... */
;			colon();
	CALL colon
;			def_sizein();  /** TIMES Prefix **/
	CALL def_sizein
;
;				/* issue amount needed. */
;			j = ((symbptr[OFFSET] & 255) + 
	LEA  BX, [AutoC50-2+BP]
	PUSH BX
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +255
	POP  DX
	AND  BX, DX
	PUSH BX
;				((symbptr[OFFSET+1] & 255) << 8));
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +16
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +255
	POP  DX
	AND  BX, DX
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAL  DX, CL
	MOV  BX, DX
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;
;		/**	outdec(j);	**/  /* need that many */
;			if (j) outdec(j);  /** prevent TIMES 0 db 0 **/
	LEA  BX, [AutoC50-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_58
	JMP  L_59
L_58:
	LEA  BX, [AutoC50-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outdec
	ADD  SP, +2
;			else outdec(1);
	JMP  L_60
L_59:
	MOV  BX, +1
	PUSH BX
	CALL outdec
	ADD  SP, +2
L_60:
;
;				/* issue assembler defn type... */
;			if (symbptr[IDENT] == POINTER) /* Pointer */
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_61
	JMP  L_62
L_61:
;				defstorptr();
	CALL defstorptr
;			else
	JMP  L_63
L_62:
;				{
;				if (symbptr[TYPE] == CCHAR) /* Character */
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_64
	JMP  L_65
L_64:
;					defstorchr();
	CALL defstorchr
;				if (symbptr[TYPE] == CINT)	/* Integer */
L_65:
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_66
	JMP  L_67
L_66:
;					defstorint();
	CALL defstorint
;				}
L_67:
L_63:
;			nl();
	CALL nl
;			}
;		symbptr = symbptr + SYMB_SIZE;
L_57:
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	MOV  Word [symbptr], BX
;		}
	JMP  L_53
L_55:
;	sa_cseg();		/* Put back in code segment. */
	CALL sa_cseg
;}
	ADD  SP, AutoC50
	POP  BP
	RET

AutoC50	EQU 2
;	j	VAR	INT	-2
;
;/*						*/
;/*	Dump all auto variables		*/
;/*						*/
;/** dumped as comments to each function **/
;
;dumpautos()
dumpautos:
	PUSH BP
	SUB  SP, AutoC68
	MOV  BP, SP

;{
;	int j;
;
;	if (ctext == 0) return; /** User said to skip.  **/
	MOV  BX, [Word ctext]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_69
	JMP  L_70
L_69:
	ADD  SP, AutoC68
	POP  BP
	RET
;	symbptr = startauto;	/** Start at beginning. **/
L_70:
	MOV  BX, symtab
	PUSH BX
	MOV  BX, +300
	PUSH BX
	MOV  BX, +18
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	MOV  Word [symbptr], BX
;	while (symbptr != autoptr)
L_71:
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, [Word autoptr]
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_72
	JMP  L_73
L_72:
;		{  /** autoptr is the end, ptr to the next free **/
;		sa_comment();
	CALL sa_comment
;		tab();
	CALL tab
;		asm_symb(symbptr);
	MOV  BX, [Word symbptr]
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
;				/* output name as label... */
;		tab();
	CALL tab
;				/* issue assembler defn ident... */
;		if (symbptr[IDENT] == VARIABLE)  outstr("VAR");
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_74
	JMP  L_75
L_74:
	MOV  BX, L_68+0
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		else if (symbptr[IDENT] == ARRAY)  outstr("ARRAY");
	JMP  L_76
L_75:
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_77
	JMP  L_78
L_77:
	MOV  BX, L_68+4
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		else if (symbptr[IDENT] == POINTER)  outstr("PTR");
	JMP  L_79
L_78:
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_80
	JMP  L_81
L_80:
	MOV  BX, L_68+10
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		else if (symbptr[IDENT] == FUNCTION)  outstr("FUNC");
	JMP  L_82
L_81:
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +4
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_83
	JMP  L_84
L_83:
	MOV  BX, L_68+14
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		tab();
L_84:
L_82:
L_79:
L_76:
	CALL tab
;				/* issue assembler defn type... */
;		if (symbptr[TYPE] == CCHAR)  outstr("CHAR");
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_85
	JMP  L_86
L_85:
	MOV  BX, L_68+19
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		else if (symbptr[TYPE] == CINT)  outstr("INT");
	JMP  L_87
L_86:
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_88
	JMP  L_89
L_88:
	MOV  BX, L_68+24
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		tab();
L_89:
L_87:
	CALL tab
;				/* issue OFFSET. */
;		j = ((symbptr[OFFSET] & 255)+
	LEA  BX, [AutoC68-2+BP]
	PUSH BX
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +255
	POP  DX
	AND  BX, DX
	PUSH BX
;			((symbptr[OFFSET + 1]& 255) << 8));
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +16
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +255
	POP  DX
	AND  BX, DX
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAL  DX, CL
	MOV  BX, DX
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		outdec(j);
	LEA  BX, [AutoC68-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outdec
	ADD  SP, +2
;		nl();
	CALL nl
;		symbptr = symbptr + SYMB_SIZE;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	MOV  Word [symbptr], BX
;		}
	JMP  L_71
L_73:
;}
	ADD  SP, AutoC68
	POP  BP
	RET

AutoC68	EQU 2
;	j	VAR	INT	-2

	  [SECTION .dseg]
L_68	DB "VAR",0
	DB "ARRAY",0
	DB "PTR",0
	DB "FUNC",0
	DB "CHAR",0
	DB "INT",0

	  [SECTION .cseg]
;
;/*					*/
;/*	Report errors for user	*/
;/*					*/
;
;errorsummary()
errorsummary:
	PUSH BP
	SUB  SP, AutoC90
	MOV  BP, SP

;	{
;	/* see if anything left hanging... */
;	if (ncmp) error("missing closing bracket");
	MOV  BX, [Word ncmp]
	OR   BX, BX
	JNZ  L_91
	JMP  L_92
L_91:
	MOV  BX, L_90+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		/* open compound statement ... */
;	nl();
L_92:
	CALL nl
;	outstr("There were ");
	MOV  BX, L_90+24
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	outdec(errcnt);	/* total # errors */
	MOV  BX, [Word errcnt]
	PUSH BX
	CALL outdec
	ADD  SP, +2
;	outstr(" errors in compilation.");
	MOV  BX, L_90+36
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	nl();
	CALL nl
;	}
	POP  BP
	RET

AutoC90	EQU 0

	  [SECTION .dseg]
L_90	DB "missing closing bracket",0
	DB "There were ",0
	DB " errors in compilation.",0

	  [SECTION .cseg]
;
;/** EO C86N-0.C **/
;
;/*	>>>>> start cc1 <<<<<<	*/
;
;/*					*/
;/*	Get options from user	*/
;/*					*/
;ask()
ask:
	PUSH BP
	SUB  SP, AutoC93
	MOV  BP, SP

;{
;	int k,num[1];
;
;	kill();		/* clear input line */
	CALL kill
;/**	outbyte(12);	* clear the screen *  **/
;	nl();nl();		/* print banner */
	CALL nl
	CALL nl
;	pl(BANNER);
	MOV  BX, L_93+0
	PUSH BX
	CALL pl
	ADD  SP, +2
;	nl();
	CALL nl
;	pl(AUTHOR);
	MOV  BX, L_93+28
	PUSH BX
	CALL pl
	ADD  SP, +2
;	nl();nl();
	CALL nl
	CALL nl
;/**	pl("Distributed by: The Code Works(tm)");
;	pl("                Box 550, Goleta, CA 93017");
;  -originally. ***/
;	pl("* NASM Version, 26-Mar-2010 *");
	MOV  BX, L_93+47
	PUSH BX
	CALL pl
	ADD  SP, +2
;	nl();
	CALL nl
;	pl(VERSION);
	MOV  BX, L_93+77
	PUSH BX
	CALL pl
	ADD  SP, +2
;	nl();
	CALL nl
;	nl();
	CALL nl
;
;	/* see if user wants to interleave the c-text */
;	/*	in form of comments (for clarity) */
;	pl("Do you want the c-text to appear (y,N) ? ");
	MOV  BX, L_93+111
	PUSH BX
	CALL pl
	ADD  SP, +2
;	gets(line);		/* get answer */
	MOV  BX, line
	PUSH BX
	CALL gets
	ADD  SP, +2
;	ctext = 0;		/* assume no */
	MOV  BX, +0
	MOV  Word [ctext], BX
;	if ((inspect_chr()=='Y')|(inspect_chr()=='y'))
	CALL inspect_chr
	PUSH BX
	MOV  BX, +89
	POP  DX
	CALL cceq
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +121
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_94
	JMP  L_95
L_94:
;		ctext=1;	/* user said yes */
	MOV  BX, +1
	MOV  Word [ctext], BX
;
;	/* see if the user is compiling everything at once */
;	/*	(as is usually the case) - gtf 4/9/80 */
;	pl("Are you compiling the whole program at once (Y,n) ? ");
L_95:
	MOV  BX, L_93+153
	PUSH BX
	CALL pl
	ADD  SP, +2
;	gets(line);
	MOV  BX, line
	PUSH BX
	CALL gets
	ADD  SP, +2
;	if ((inspect_chr() != 'N') & (inspect_chr() != 'n'))
	CALL inspect_chr
	PUSH BX
	MOV  BX, +78
	POP  DX
	CALL ccne
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +110
	POP  DX
	CALL ccne
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_96
	JMP  L_97
L_96:
;		{	/* single file - assume... */
;		glbflag = 1;  /* define globals */
	MOV  BX, +1
	MOV  Word [glbflag], BX
;		mainflg = 1;  /* first file to assembler */
	MOV  BX, +1
	MOV  Word [mainflg], BX
;		nxtlab  = 0;  /* start numbers at lowest possible */
	MOV  BX, +0
	MOV  Word [nxtlab], BX
;		}
;	else {		/* one of many - ask everything */
	JMP  L_98
L_97:
;	 	/* see if user wants us to allocate static */
;	 	/*  variables by name in this module	*/
;	 	/*	(pseudo external capability)	*/
;	 	pl("Do you want the globals to be defined (y,N) ? ");
	MOV  BX, L_93+206
	PUSH BX
	CALL pl
	ADD  SP, +2
;	 	gets(line);
	MOV  BX, line
	PUSH BX
	CALL gets
	ADD  SP, +2
;		glbflag = 0;
	MOV  BX, +0
	MOV  Word [glbflag], BX
;	 	if ((inspect_chr() == 'Y') | (inspect_chr() == 'y'))
	CALL inspect_chr
	PUSH BX
	MOV  BX, +89
	POP  DX
	CALL cceq
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +121
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_99
	JMP  L_100
L_99:
;	 		glbflag = 1;	/* user said yes */
	MOV  BX, +1
	MOV  Word [glbflag], BX
;
;	 	/* see if we should put out the stuff	*/
;	 	/*	needed for the first assembler	*/
;	 	/*	file. - gtf 4/9/80			*/
;		pl("Is the output file the first one the assembler will see (y,N) ? ");
L_100:
	MOV  BX, L_93+253
	PUSH BX
	CALL pl
	ADD  SP, +2
;	 	gets(line);
	MOV  BX, line
	PUSH BX
	CALL gets
	ADD  SP, +2
;	 	mainflg = 0;
	MOV  BX, +0
	MOV  Word [mainflg], BX
;		if ((inspect_chr() == 'Y') | (inspect_chr() == 'y'))
	CALL inspect_chr
	PUSH BX
	MOV  BX, +89
	POP  DX
	CALL cceq
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +121
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_101
	JMP  L_102
L_101:
;	 		mainflg = 1;	/* indeed it is */
	MOV  BX, +1
	MOV  Word [mainflg], BX
;
;	 	/* get first allowable number for compiler-generated */
;	 	/*	labels (in case user will append modules) */
;		while (1)
L_102:
L_103:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_104
	JMP  L_105
L_104:
;			{
;	 		pl("Starting number for labels (0) ? ");
	MOV  BX, L_93+318
	PUSH BX
	CALL pl
	ADD  SP, +2
;	 		gets(line);
	MOV  BX, line
	PUSH BX
	CALL gets
	ADD  SP, +2
;	 		if (inspect_chr() == 0)
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_106
	JMP  L_107
L_106:
;				{
;				num[0] = 0;
	LEA  BX, [AutoC93-4+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;				break;
	JMP  L_105
;				}
;			if (k = number(num)) break;
L_107:
	LEA  BX, [AutoC93-2+BP]
	PUSH BX
	LEA  BX, [AutoC93-4+BP]
	PUSH BX
	CALL number
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_108
	JMP  L_109
L_108:
	JMP  L_105
;	 		}
L_109:
	JMP  L_103
L_105:
;	 	nxtlab = num[0];
	LEA  BX, [AutoC93-4+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	MOV  Word [nxtlab], BX
;		}
L_98:
;
;	/* see if user wants to be sure to see all errors */
;	pl("Should I pause after an error (y,N) ? ");
	MOV  BX, L_93+352
	PUSH BX
	CALL pl
	ADD  SP, +2
;	gets(line);
	MOV  BX, line
	PUSH BX
	CALL gets
	ADD  SP, +2
;	errstop = 0;
	MOV  BX, +0
	MOV  Word [errstop], BX
;	if ((inspect_chr() == 'Y') | (inspect_chr() == 'y')) errstop = 1;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +89
	POP  DX
	CALL cceq
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +121
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_110
	JMP  L_111
L_110:
	MOV  BX, +1
	MOV  Word [errstop], BX
;
;	litlab = getlabel();	/* first label=literal pool */ 
L_111:
	CALL getlabel
	MOV  Word [litlab], BX
;	kill();			/* erase line */
	CALL kill
;}
	ADD  SP, AutoC93
	POP  BP
	RET

AutoC93	EQU 4
;	k	VAR	INT	-2
;	num	ARRAY	INT	-4

	  [SECTION .dseg]
L_93	DB "* * *  Small-C  V1.1  * * *",0
	DB "       By Ron Cain",0
	DB "* NASM Version, 26-Mar-2010 *",0
	DB "Based on Version N: July 17, 1980",0
	DB "Do you want the c-text to appear (y,N) ? ",0
	DB "Are you compiling the whole program at once (Y,n) ? ",0
	DB "Do you want the globals to be defined (y,N) ? ",0
	DB "Is the output file the first one the assembler will see (y,N) ? ",0
	DB "Starting number for labels (0) ? ",0
	DB "Should I pause after an error (y,N) ? ",0

	  [SECTION .cseg]
;
;/*					*/
;/*	Get output filename	*/
;/*					*/
;openout()
openout:
	PUSH BP
	SUB  SP, AutoC112
	MOV  BP, SP

;{
;	kill();			/* erase line */
	CALL kill
;	fp_output = 0;			/* start with none */
	MOV  BX, +0
	MOV  Word [fp_output], BX
;	pl("Output filename? "); /* ask...*/
	MOV  BX, L_112+0
	PUSH BX
	CALL pl
	ADD  SP, +2
;	gets(line);			/* get a filename */
	MOV  BX, line
	PUSH BX
	CALL gets
	ADD  SP, +2
;	if (inspect_chr() == 0) return;	/* none given... */
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_113
	JMP  L_114
L_113:
	POP  BP
	RET
;	if ((fp_output = fopen(line,"w")) == NULL) /* if given, open */
L_114:
	MOV  BX, line
	PUSH BX
	MOV  BX, L_112+18
	PUSH BX
	CALL fopen
	ADD  SP, +4
	MOV  Word [fp_output], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_115
	JMP  L_116
L_115:
;		{
;		fp_output = 0;	/* can't open */
	MOV  BX, +0
	MOV  Word [fp_output], BX
;		error("Open failure!");
	MOV  BX, L_112+20
	PUSH BX
	CALL error
	ADD  SP, +2
;		}
;  /*** TBI, else output filename to asm file, & for MAP ***/
;	kill();			/* erase line */
L_116:
	CALL kill
;}
	POP  BP
	RET

AutoC112	EQU 0

	  [SECTION .dseg]
L_112	DB "Output filename? ",0
	DB "w",0
	DB "Open failure!",0

	  [SECTION .cseg]
;
;/*					*/
;/*	Get (next) input file	*/
;/*					*/
;openin()
openin:
	PUSH BP
	SUB  SP, AutoC117
	MOV  BP, SP

;{
;	fp_input = 0;			/* none to start with */
	MOV  BX, +0
	MOV  Word [fp_input], BX
;	while (fp_input == 0){		/* any above 1 allowed */
L_118:
	MOV  BX, [Word fp_input]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_119
	JMP  L_120
L_119:
;		kill();			/* clear line */
	CALL kill
;		if (eof_flg)break;	/* if user said none */
	MOV  BX, [Word eof_flg]
	OR   BX, BX
	JNZ  L_121
	JMP  L_122
L_121:
	JMP  L_120
;		pl("Input filename? (..or just [Enter] key to finish.) >");
L_122:
	MOV  BX, L_117+0
	PUSH BX
	CALL pl
	ADD  SP, +2
;		gets(line);			/* get a name */
	MOV  BX, line
	PUSH BX
	CALL gets
	ADD  SP, +2
;		if (inspect_chr() == 0)
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_123
	JMP  L_124
L_123:
;			{
;			eof_flg = 1;
	MOV  BX, +1
	MOV  Word [eof_flg], BX
;			break;
	JMP  L_120
;			} /* none given... */
;		if ((fp_input = fopen(line,"r")) != NULL)
L_124:
	MOV  BX, line
	PUSH BX
	MOV  BX, L_117+53
	PUSH BX
	CALL fopen
	ADD  SP, +4
	MOV  Word [fp_input], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_125
	JMP  L_126
L_125:
;			newfile();		/* gtf 7/16/80 */
	CALL newfile
;		else	{
	JMP  L_127
L_126:
;			fp_input = 0;	/* can't open it */
	MOV  BX, +0
	MOV  Word [fp_input], BX
;			pl("Open failure");
	MOV  BX, L_117+55
	PUSH BX
	CALL pl
	ADD  SP, +2
;			}
L_127:
;		}
	JMP  L_118
L_120:
;	kill();	/* erase line */
	CALL kill
;}
	POP  BP
	RET

AutoC117	EQU 0

	  [SECTION .dseg]
L_117	DB "Input filename? (..or just [Enter] key to finish.) >",0
	DB "r",0
	DB "Open failure",0

	  [SECTION .cseg]
;
;/*					*/
;/*	Reset line count, etc.	*/
;/*			gtf 7/16/80	*/
;newfile()
newfile:
	PUSH BP
	SUB  SP, AutoC128
	MOV  BP, SP

;{
;	lineno  = 0;	/* no lines read */
	MOV  BX, +0
	MOV  Word [lineno], BX
;	fnstart = 0;	/* no fn. start yet. */
	MOV  BX, +0
	MOV  Word [fnstart], BX
;	currfn  = NULL;	/* because no fn. yet */
	MOV  BX, +0
	MOV  Word [currfn], BX
;	infunc  = 0;	/* therefore not in fn. */
	MOV  BX, +0
	MOV  Word [infunc], BX
;}  /* end newfile */
	POP  BP
	RET

AutoC128	EQU 0
;
;/*						*/
;/*	Open an include file		*/
;/*						*/
;/** added tmp array for filename instead of inline ptr to handle CR **/
;
;char fname_array[14];
;
;doinclude()
doinclude:
	PUSH BP
	SUB  SP, AutoC129
	MOV  BP, SP

;{
;	int i;
;	char *src;
;
;	deblank();	/* skip over to name */
	CALL deblank
;	toconsole();					/* gtf 7/16/80 */
	CALL toconsole
;	outstr("#include ");
	MOV  BX, L_129+0
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	outstr(line+lptr);
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL outstr
	ADD  SP, +2
;
;	i = 0;
	LEA  BX, [AutoC129-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	src = line+lptr;	/** copy inline filename to prep array **/
	LEA  BX, [AutoC129-4+BP]
	PUSH BX
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	while (*src != CR)
L_130:
	LEA  BX, [AutoC129-4+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +13
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_131
	JMP  L_132
L_131:
;		{
;		fname_array[i++] = *src++;
	MOV  BX, fname_array
	PUSH BX
	LEA  BX, [AutoC129-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC129-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		}
	JMP  L_130
L_132:
;	fname_array[i] = 0;		/** null terminate str **/
	MOV  BX, fname_array
	PUSH BX
	LEA  BX, [AutoC129-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;
;	nl();
	CALL nl
;	tofile();
	CALL tofile
;
;	if (fp_input2)					/* gtf 7/16/80 */
	MOV  BX, [Word fp_input2]
	OR   BX, BX
	JNZ  L_133
	JMP  L_134
L_133:
;		error("Cannot nest include files");
	MOV  BX, L_129+10
	PUSH BX
	CALL error
	ADD  SP, +2
;	else if ((fp_input2 = fopen(&fname_array[0],"r")) == NULL)
	JMP  L_135
L_134:
	MOV  BX, fname_array
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_129+36
	PUSH BX
	CALL fopen
	ADD  SP, +4
	MOV  Word [fp_input2], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_136
	JMP  L_137
L_136:
;		{
;		fp_input2 = 0;
	MOV  BX, +0
	MOV  Word [fp_input2], BX
;		error("Open failure on include file");
	MOV  BX, L_129+38
	PUSH BX
	CALL error
	ADD  SP, +2
;		}
;	else {
	JMP  L_138
L_137:
;		saveline = lineno;
	MOV  BX, [Word lineno]
	MOV  Word [saveline], BX
;		savecurr = currfn;
	MOV  BX, [Word currfn]
	MOV  Word [savecurr], BX
;		saveinfn = infunc;
	MOV  BX, [Word infunc]
	MOV  Word [saveinfn], BX
;		savestart= fnstart;
	MOV  BX, [Word fnstart]
	MOV  Word [savestart], BX
;		newfile();
	CALL newfile
;		}
L_138:
L_135:
;	kill();	/* clear rest of line */
	CALL kill
;			/* so next read will come from */
;			/* new file (if open */
;}
	ADD  SP, AutoC129
	POP  BP
	RET

AutoC129	EQU 4
;	i	VAR	INT	-2
;	src	PTR	CHAR	-4

	  [SECTION .dseg]
L_129	DB "#include ",0
	DB "Cannot nest include files",0
	DB "r",0
	DB "Open failure on include file",0

	  [SECTION .cseg]
;
;/*						*/
;/*	Close an include file		*/
;/*				gtf 7/16/80	*/
;endinclude()
endinclude:
	PUSH BP
	SUB  SP, AutoC139
	MOV  BP, SP

;{
;	toconsole();
	CALL toconsole
;	outstr("#end include"); nl();
	MOV  BX, L_139+0
	PUSH BX
	CALL outstr
	ADD  SP, +2
	CALL nl
;	tofile();
	CALL tofile
;
;	fp_input2  = 0;
	MOV  BX, +0
	MOV  Word [fp_input2], BX
;	lineno  = saveline;
	MOV  BX, [Word saveline]
	MOV  Word [lineno], BX
;	currfn  = savecurr;
	MOV  BX, [Word savecurr]
	MOV  Word [currfn], BX
;	infunc  = saveinfn;
	MOV  BX, [Word saveinfn]
	MOV  Word [infunc], BX
;	fnstart = savestart;
	MOV  BX, [Word savestart]
	MOV  Word [fnstart], BX
;}  /* end endinclude */
	POP  BP
	RET

AutoC139	EQU 0

	  [SECTION .dseg]
L_139	DB "#end include",0

	  [SECTION .cseg]
;
;/*						*/
;/*	Close the output file		*/
;/*						*/
;closeout()
closeout:
	PUSH BP
	SUB  SP, AutoC140
	MOV  BP, SP

;{
;	tofile();	/* if diverted, return to file */
	CALL tofile
;	if (fp_output) fclose(fp_output); /* if open, close it */
	MOV  BX, [Word fp_output]
	OR   BX, BX
	JNZ  L_141
	JMP  L_142
L_141:
	MOV  BX, [Word fp_output]
	PUSH BX
	CALL fclose
	ADD  SP, +2
;	fp_output = 0;		/* mark as closed */
L_142:
	MOV  BX, +0
	MOV  Word [fp_output], BX
;}
	POP  BP
	RET

AutoC140	EQU 0
;
;/*						*/
;/*	Declare a static variable	*/
;/*	  (i.e. define for use)		*/
;/*						*/
;/* makes an entry in the symbol table so subsequent */
;/*  references can call symbol by name	*/
;/** globals (statics) are found outside a function block **/
;/** this fn is called when a TYPE`int or `char is found **/
;
;declstatic(typ) int typ;	/* typ is cchar or cint */
declstatic:
	PUSH BP
	SUB  SP, AutoC143
	MOV  BP, SP

;{
;	int k,j;
;	char sname[NAMESIZE]; /** 1st mention of sname array **/
;		/** sname is an auto, on stack processing array. **/
;
;	while (1) /** loop while comma'd **/
L_144:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_145
	JMP  L_146
L_145:
;		{
;		while (1)
L_147:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_148
	JMP  L_149
L_148:
;			{  /** is_identifier() gets & validates identifier **/
;			if (endst()) return;	/* do line */
	CALL endst
	OR   BX, BX
	JNZ  L_150
	JMP  L_151
L_150:
	ADD  SP, AutoC143
	POP  BP
	RET
;			k = 1;			/* assume 1 element */
L_151:
	LEA  BX, [AutoC143-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;
;			if (match("*"))		/* pointer ? */
	MOV  BX, L_143+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_152
	JMP  L_153
L_152:
;				j = POINTER;	/* yes */
	LEA  BX, [AutoC143-4+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
;			else j = VARIABLE;	/* no */
	JMP  L_154
L_153:
	LEA  BX, [AutoC143-4+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
L_154:
;
;			if (is_identifier(sname) == 0)	/* name ok? */
	LEA  BX, [AutoC143-17+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_155
	JMP  L_156
L_155:
;				illname();		/* no... const, */
	CALL illname
;			if(findstatic(sname))	/* already there? */
L_156:
	LEA  BX, [AutoC143-17+BP]
	PUSH BX
	CALL findstatic
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_157
	JMP  L_158
L_157:
;				multidef(sname);
	LEA  BX, [AutoC143-17+BP]
	PUSH BX
	CALL multidef
	ADD  SP, +2
;			if (match("["))		/* array? */
L_158:
	MOV  BX, L_143+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_159
	JMP  L_160
L_159:
;				{
;				k = mk_subscript(); /* get size */
	LEA  BX, [AutoC143-2+BP]
	PUSH BX
	CALL mk_subscript
	POP  DI
	MOV  Word [DI], BX
;				if (k) j = ARRAY;	/* !0=array */
	LEA  BX, [AutoC143-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_161
	JMP  L_162
L_161:
	LEA  BX, [AutoC143-4+BP]
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
;				else j = POINTER; /* 0=ptr, a[] */
	JMP  L_163
L_162:
	LEA  BX, [AutoC143-4+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
L_163:
;				}
;			addstatic(sname,j,typ,k); /* add symbol */
L_160:
	LEA  BX, [AutoC143-17+BP]
	PUSH BX
	LEA  BX, [AutoC143-4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC143+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC143-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL addstatic
	ADD  SP, +8
;			break;
	JMP  L_149
;			}
	JMP  L_147
L_149:
;		if (match(",") == 0) return;	/* more? */
	MOV  BX, L_143+4
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_164
	JMP  L_165
L_164:
	ADD  SP, AutoC143
	POP  BP
	RET
;		}
L_165:
	JMP  L_144
L_146:
;}
	ADD  SP, AutoC143
	POP  BP
	RET

AutoC143	EQU 17
;	typ	VAR	INT	+4
;	k	VAR	INT	-2
;	j	VAR	INT	-4
;	sname	ARRAY	CHAR	-17

	  [SECTION .dseg]
L_143	DB "*",0
	DB "[",0
	DB ",",0

	  [SECTION .cseg]
;
;/*						*/
;/*	Declare auto variables		*/
;/*	(i.e. define for use)		*/
;/*						*/
;/* works just like "declstatic" but modifies machine stack */
;/*	and adds symbol table entry with appropriate */
;/*	stack offset to find it again			*/
;/** called when symbol is an automatic **/
;
;declauto(typ) int typ;	/* typ is cchar or cint */
declauto:
	PUSH BP
	SUB  SP, AutoC166
	MOV  BP, SP

;{
;	int k,j;
;	char sname[NAMESIZE];
;
;	while (1)
L_167:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_168
	JMP  L_169
L_168:
;		{
;		while (1)
L_170:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_171
	JMP  L_172
L_171:
;			{ /** is_identifier() gets & validates identifier **/
;			if (endst()) return;
	CALL endst
	OR   BX, BX
	JNZ  L_173
	JMP  L_174
L_173:
	ADD  SP, AutoC166
	POP  BP
	RET
;
;			if (match("*"))
L_174:
	MOV  BX, L_166+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_175
	JMP  L_176
L_175:
;				j = POINTER;
	LEA  BX, [AutoC166-4+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
;			else j = VARIABLE;
	JMP  L_177
L_176:
	LEA  BX, [AutoC166-4+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
L_177:
;
;			if (is_identifier(sname) == 0) illname(); /** const **/
	LEA  BX, [AutoC166-17+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_178
	JMP  L_179
L_178:
	CALL illname
;
;			if (findauto(sname)) multidef(sname);
L_179:
	LEA  BX, [AutoC166-17+BP]
	PUSH BX
	CALL findauto
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_180
	JMP  L_181
L_180:
	LEA  BX, [AutoC166-17+BP]
	PUSH BX
	CALL multidef
	ADD  SP, +2
;
;			if (match("["))
L_181:
	MOV  BX, L_166+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_182
	JMP  L_183
L_182:
;				{
;				k = mk_subscript();
	LEA  BX, [AutoC166-2+BP]
	PUSH BX
	CALL mk_subscript
	POP  DI
	MOV  Word [DI], BX
;				if (k)
	LEA  BX, [AutoC166-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_184
	JMP  L_185
L_184:
;					{  /** if int, double size of char **/
;					j = ARRAY;
	LEA  BX, [AutoC166-4+BP]
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
;					if (typ == CINT) k = k + k;
	LEA  BX, [AutoC166+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_186
	JMP  L_187
L_186:
	LEA  BX, [AutoC166-2+BP]
	PUSH BX
	LEA  BX, [AutoC166-2+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC166-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;					}
L_187:
;				else
	JMP  L_188
L_185:
;					{
;					j = POINTER;
	LEA  BX, [AutoC166-4+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
;					k = 2;
	LEA  BX, [AutoC166-2+BP]
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
;					}
L_188:
;				}
;			else
	JMP  L_189
L_183:
;				if ((typ == CCHAR) & (j != POINTER)) k = 1;
	LEA  BX, [AutoC166+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC166-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL ccne
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_190
	JMP  L_191
L_190:
	LEA  BX, [AutoC166-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;				else k = 2;
	JMP  L_192
L_191:
	LEA  BX, [AutoC166-2+BP]
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
L_192:
L_189:
;
;			/* change machine stack */
;			/** negative from activation frame, sp, for auto **/
;
;			Msp = Msp - k;
	MOV  BX, [Word Msp]
	PUSH BX
	LEA  BX, [AutoC166-2+BP]
	MOV  BX, [BX]
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	MOV  Word [Msp], BX
;			addauto(sname,j,typ,Msp);
	LEA  BX, [AutoC166-17+BP]
	PUSH BX
	LEA  BX, [AutoC166-4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC166+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word Msp]
	PUSH BX
	CALL addauto
	ADD  SP, +8
;			break;
	JMP  L_172
;			}
	JMP  L_170
L_172:
;		if (match(",") == 0) return;
	MOV  BX, L_166+4
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_193
	JMP  L_194
L_193:
	ADD  SP, AutoC166
	POP  BP
	RET
;		}
L_194:
	JMP  L_167
L_169:
;}
	ADD  SP, AutoC166
	POP  BP
	RET

AutoC166	EQU 17
;	typ	VAR	INT	+4
;	k	VAR	INT	-2
;	j	VAR	INT	-4
;	sname	ARRAY	CHAR	-17

	  [SECTION .dseg]
L_166	DB "*",0
	DB "[",0
	DB ",",0

	  [SECTION .cseg]
;
;/** EO C86N-1.C **/
;/*	>>>>>> start of cc2 <<<<<<<<	*/
;
;/*						*/
;/*	Get required array size		*/
;/*						*/
;
;/* invoked when declared variable is followed by "[" */
;/*	this routine makes subscript the absolute */
;/*	size of the array. */
;/** doesn't eval expression, nor multi-dimensions. **/
;
;mk_subscript()
mk_subscript:
	PUSH BP
	SUB  SP, AutoC195
	MOV  BP, SP

;{
;	int num[1];
;
;	if (match("]")) return 0;	/* null size */
	MOV  BX, L_195+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_196
	JMP  L_197
L_196:
	MOV  BX, +0
	ADD  SP, AutoC195
	POP  BP
	RET
;	if (number(num) == 0)	/* go after a number */
L_197:
	LEA  BX, [AutoC195-2+BP]
	PUSH BX
	CALL number
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_198
	JMP  L_199
L_198:
;		{
;		error("must be constant");	/* it isn't */
	MOV  BX, L_195+2
	PUSH BX
	CALL error
	ADD  SP, +2
;		num[0] = 1;		/* so force one */
	LEA  BX, [AutoC195-2+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;		}
;	if (num[0] < 0)
L_199:
	LEA  BX, [AutoC195-2+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_200
	JMP  L_201
L_200:
;		{
;		error("negative size illegal");
	MOV  BX, L_195+19
	PUSH BX
	CALL error
	ADD  SP, +2
;		num[0] = (-num[0]);
	LEA  BX, [AutoC195-2+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC195-2+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	NEG  BX
	POP  DI
	MOV  Word [DI], BX
;		}
;	needbrack("]");		/* force single dimension */
L_201:
	MOV  BX, L_195+41
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;	return num[0];		/* and return size */
	LEA  BX, [AutoC195-2+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	ADD  SP, AutoC195
	POP  BP
	RET
;}

AutoC195	EQU 2
;	num	ARRAY	INT	-2

	  [SECTION .dseg]
L_195	DB "]",0
	DB "must be constant",0
	DB "negative size illegal",0
	DB "]",0

	  [SECTION .cseg]
;
;/*					*/
;/*	Begin a function		*/
;/*					*/
;
;/* Called from "parse" this routine tries to make a function */
;/*	out of what follows.	*/
;/** is_identifier() gets & validates identifier **/ 
;
;newfunc()
newfunc:
	PUSH BP
	SUB  SP, AutoC202
	MOV  BP, SP

;{
;	char n[NAMESIZE];	/* ptr => currfn,  gtf 7/16/80 */
;	int argtop;		/* max arg stack size */
;
;	/** trap for non-function as syntax error, at this point **/
;	/** is_identifier() gets & validates identifier **/
;
;	if (is_identifier(n) == 0)  /** might be const **/
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_203
	JMP  L_204
L_203:
;		{
;		error("illegal function or declaration");
	MOV  BX, L_202+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		kill();	/* invalidate line */
	CALL kill
;		return;
	ADD  SP, AutoC202
	POP  BP
	RET
;		}
;
;	fnstart = lineno;	/* remember where fn began gtf 7/2/80 */
L_204:
	MOV  BX, [Word lineno]
	MOV  Word [fnstart], BX
;	infunc = 1;		/* note, in function now. gtf 7/16/80 */
	MOV  BX, +1
	MOV  Word [infunc], BX
;
;	if (currfn = findstatic(n))	/* already in symbol table ? */
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	CALL findstatic
	ADD  SP, +2
	MOV  Word [currfn], BX
	OR   BX, BX
	JNZ  L_205
	JMP  L_206
L_205:
;		{
;		if (currfn[IDENT] != FUNCTION) multidef(n);
	MOV  BX, [Word currfn]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +4
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_207
	JMP  L_208
L_207:
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	CALL multidef
	ADD  SP, +2
;			/* already variable by that name */
;		else if (currfn[OFFSET] == FUNCTION) multidef(n);
	JMP  L_209
L_208:
	MOV  BX, [Word currfn]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +4
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_210
	JMP  L_211
L_210:
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	CALL multidef
	ADD  SP, +2
;			/* already function by that name */
;		else currfn[OFFSET] = FUNCTION;
	JMP  L_212
L_211:
	MOV  BX, [Word currfn]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +4
	POP  DI
	MOV  Byte [DI], BL
L_212:
L_209:
;			/* otherwise we have what was earlier*/
;			/*  assumed to be a function */
;		}
;
;	/* if not in table, define as a function now */
;
;	else currfn = addstatic(n,FUNCTION,CINT,FUNCTION);
	JMP  L_213
L_206:
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	MOV  BX, +4
	PUSH BX
	MOV  BX, +2
	PUSH BX
	MOV  BX, +4
	PUSH BX
	CALL addstatic
	ADD  SP, +8
	MOV  Word [currfn], BX
L_213:
;
;	/* Indicate to console what routine that we're in. */
;
;	toconsole();					/* gtf 7/16/80 */
	CALL toconsole
;	outstr("====== ");
	MOV  BX, L_202+32
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	outstr(currfn + NAME);
	MOV  BX, [Word currfn]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	outstr("()");
	MOV  BX, L_202+40
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	nl();
	CALL nl
;	tofile();
	CALL tofile
;
;	/* we had better see open paren for args... */
;	/** formal parameter processing at the beginning
;		of a function declaration **/
;
;	if (match("(") == 0) error("missing open paren");
	MOV  BX, L_202+43
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_214
	JMP  L_215
L_214:
	MOV  BX, L_202+45
	PUSH BX
	CALL error
	ADD  SP, +2
;	asm_symb(n); colon(); nl();	/* print function name */
L_215:
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
	CALL colon
	CALL nl
;	autoptr = startauto;		/* "clear" local symbol table*/
	MOV  BX, symtab
	PUSH BX
	MOV  BX, +300
	PUSH BX
	MOV  BX, +18
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	MOV  Word [autoptr], BX
;	argstk = 0;				/* init arg count */
	MOV  BX, +0
	MOV  Word [argstk], BX
;	while (match(")") == 0)		/* then count args */
L_216:
	MOV  BX, L_202+64
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_217
	JMP  L_218
L_217:
;		{	/* any legal name bumps arg count */
;			/** is_identifier() gets & validates identifier **/
;		if (is_identifier(n))
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_219
	JMP  L_220
L_219:
;			{
;			if (findauto(n)) multidef(n);
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	CALL findauto
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_221
	JMP  L_222
L_221:
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	CALL multidef
	ADD  SP, +2
;			else	{
	JMP  L_223
L_222:
;				addauto(n,0,0,argstk);
	LEA  BX, [AutoC202-13+BP]
	PUSH BX
	MOV  BX, +0
	PUSH BX
	MOV  BX, +0
	PUSH BX
	MOV  BX, [Word argstk]
	PUSH BX
	CALL addauto
	ADD  SP, +8
;					/* Add local symbol to be later */
;					/* processed by getarg(). */
;				argstk = argstk + 2;
	MOV  BX, [Word argstk]
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	MOV  Word [argstk], BX
;				}
L_223:
;			}
;		else	{
	JMP  L_224
L_220:
;			error("illegal argument name");
	MOV  BX, L_202+66
	PUSH BX
	CALL error
	ADD  SP, +2
;			junk();
	CALL junk
;			}
L_224:
;		deblank();
	CALL deblank
;
;		/* if not closing paren, should be comma */
;		if (streq(line+lptr,")") == 0)
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_202+88
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_225
	JMP  L_226
L_225:
;			{
;			if (match(",") == 0)
	MOV  BX, L_202+90
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_227
	JMP  L_228
L_227:
;			error("expected comma");
	MOV  BX, L_202+92
	PUSH BX
	CALL error
	ADD  SP, +2
;			}
L_228:
;		if (endst()) break;
L_226:
	CALL endst
	OR   BX, BX
	JNZ  L_229
	JMP  L_230
L_229:
	JMP  L_218
;		}
L_230:
	JMP  L_216
L_218:
;
;	argtop = argstk;	/* Save max arg stack size. */
	LEA  BX, [AutoC202-15+BP]
	PUSH BX
	MOV  BX, [Word argstk]
	POP  DI
	MOV  Word [DI], BX
;	while (argstk)	/* now let user declare what types  */
L_231:
	MOV  BX, [Word argstk]
	OR   BX, BX
	JNZ  L_232
	JMP  L_233
L_232:
;		{		/* of things those arguments were */
;		if (amatch("char",4))
	MOV  BX, L_202+107
	PUSH BX
	MOV  BX, +4
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_234
	JMP  L_235
L_234:
;			{
;			getarg(CCHAR,argtop);
	MOV  BX, +1
	PUSH BX
	LEA  BX, [AutoC202-15+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL getarg
	ADD  SP, +4
;			ns();
	CALL ns
;			continue;
	JMP  L_231
;			}
;		else if (amatch("int",3))
	JMP  L_236
L_235:
	MOV  BX, L_202+112
	PUSH BX
	MOV  BX, +3
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_237
	JMP  L_238
L_237:
;			{
;			getarg(CINT,argtop);
	MOV  BX, +2
	PUSH BX
	LEA  BX, [AutoC202-15+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL getarg
	ADD  SP, +4
;			ns();
	CALL ns
;			continue;
	JMP  L_231
;			}
;		else	{
	JMP  L_239
L_238:
;			error("wrong number args");
	MOV  BX, L_202+116
	PUSH BX
	CALL error
	ADD  SP, +2
;			break;
	JMP  L_233
;			}
L_239:
L_236:
;		}
	JMP  L_231
L_233:
;
;	Msp = 00;		/* Preset local stack ptr. */
	MOV  BX, +0
	MOV  Word [Msp], BX
;	Csp = 00;		/* preset stack ptr */
	MOV  BX, +0
	MOV  Word [Csp], BX
;	FN_Prolog();	/* Do function initialization. */
	CALL FN_Prolog
;				/* AutoC size is undetermined here, not **/
;				/* till statement() is processed **/
;
;	if (statement() != ST_RETURN)	/* do all statements, but if */
	CALL statement
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_240
	JMP  L_241
L_240:
;						/* last one is a return, skip */
;		{				/* cleaning up the stack */
;		sa_rtnstk(0);
	MOV  BX, +0
	PUSH BX
	CALL sa_rtnstk
	ADD  SP, +2
;		sa_ret();
	CALL sa_ret
;		}
;
;	/* Handle function termination. */
;	FN_Epilog();		/* Do function termination. */
L_241:
	CALL FN_Epilog
;	Msp = Csp = 0;		/* reset stack ptr again */
	MOV  BX, +0
	MOV  Word [Csp], BX
	MOV  Word [Msp], BX
;	dumpautos();		/* Dump the local symbol table. */
	CALL dumpautos
;	autoptr = startauto;	/* deallocate all locals */
	MOV  BX, symtab
	PUSH BX
	MOV  BX, +300
	PUSH BX
	MOV  BX, +18
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	MOV  Word [autoptr], BX
;	dumplits();			/* Dump the literal pool for the function.*/
	CALL dumplits
;	litlab = getlabel();	/* Now re-initialize the pool. */
	CALL getlabel
	MOV  Word [litlab], BX
;	litptr = 0;
	MOV  BX, +0
	MOV  Word [litptr], BX
;	infunc = 0;		/* not in fn. any more	gtf 7/2/80 */
	MOV  BX, +0
	MOV  Word [infunc], BX
;} /** eo newfunc **/
	ADD  SP, AutoC202
	POP  BP
	RET

AutoC202	EQU 15
;	n	ARRAY	CHAR	-13
;	argtop	VAR	INT	-15

	  [SECTION .dseg]
L_202	DB "illegal function or declaration",0
	DB "====== ",0
	DB "()",0
	DB "(",0
	DB "missing open paren",0
	DB ")",0
	DB "illegal argument name",0
	DB ")",0
	DB ",",0
	DB "expected comma",0
	DB "char",0
	DB "int",0
	DB "wrong number args",0

	  [SECTION .cseg]
;
;/*						*/
;/*	Declare argument types		*/
;/*						*/
;/* called from "newfunc" this routine adds an entry in the */
;/*	local symbol table for each named argument */
;
;	/* top tells how the max arg stack size was found while
;	   scanning arguments.  From this, we can calculate the
;	   the actual stack offset and stuff it back into the
;	   local symbol table.
;	*/
;	/* t = cchar or cint, top = max arg stack */
;
;getarg(t,top) int t,top;
getarg:
	PUSH BP
	SUB  SP, AutoC242
	MOV  BP, SP

;	{
;	char n[NAMESIZE], *argptr;
;	int j, auto_addr;
;
;	while (1)
L_243:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_244
	JMP  L_245
L_244:
;		{
;		if (argstk == 0) return;	/* no more args */
	MOV  BX, [Word argstk]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_246
	JMP  L_247
L_246:
	ADD  SP, AutoC242
	POP  BP
	RET
;		if (match("*")) j = POINTER;
L_247:
	MOV  BX, L_242+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_248
	JMP  L_249
L_248:
	LEA  BX, [AutoC242-17+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
;		else j = VARIABLE;
	JMP  L_250
L_249:
	LEA  BX, [AutoC242-17+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
L_250:
;			/** is_identifier() gets & validates identifier **/
;		if (is_identifier(n))
	LEA  BX, [AutoC242-13+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_251
	JMP  L_252
L_251:
;			{
;			if (match("["))	/* pointer ? */
	MOV  BX, L_242+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_253
	JMP  L_254
L_253:
;				/* it is a pointer, so skip all */
;				/* stuff between "[]" */
;				{
;				while (scan_nxt() != ']')
L_255:
	CALL scan_nxt
	PUSH BX
	MOV  BX, +93
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_256
	JMP  L_257
L_256:
;					if (endst()) break;
	CALL endst
	OR   BX, BX
	JNZ  L_258
	JMP  L_259
L_258:
	JMP  L_257
;				j = POINTER;	/* add entry as pointer */
L_259:
	JMP  L_255
L_257:
	LEA  BX, [AutoC242-17+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
;				}
;			if (argptr = findauto(n))
L_254:
	LEA  BX, [AutoC242-15+BP]
	PUSH BX
	LEA  BX, [AutoC242-13+BP]
	PUSH BX
	CALL findauto
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_260
	JMP  L_261
L_260:
;				{
;				argptr[IDENT] = j;
	LEA  BX, [AutoC242-15+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC242-17+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;					/* save type info for arg just 
;					   found. */
;				argptr[TYPE] = t;
	LEA  BX, [AutoC242-15+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC242+6+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;				auto_addr = top - (argptr[OFFSET+1]<<8)
	LEA  BX, [AutoC242-19+BP]
	PUSH BX
	LEA  BX, [AutoC242+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC242-15+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +16
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAL  DX, CL
	MOV  BX, DX
;						- argptr[OFFSET]+2;
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	PUSH BX
	LEA  BX, [AutoC242-15+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;
;				/*Calculate offset to arg taking
;				  into account the return address
;				  and the saved BP register left
;				  on the stack. */
;
;				argptr[OFFSET] = auto_addr;
	LEA  BX, [AutoC242-15+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC242-19+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;				argptr[OFFSET+1] = auto_addr>>8;
	LEA  BX, [AutoC242-15+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +16
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC242-19+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAR  DX, CL
	MOV  BX, DX
	POP  DI
	MOV  Byte [DI], BL
;
;				/*save offset back in local symbol
;				  table entry. */
;				}
;			else
	JMP  L_262
L_261:
;				error("expecting argument name");
	MOV  BX, L_242+4
	PUSH BX
	CALL error
	ADD  SP, +2
L_262:
;			}
;		else
	JMP  L_263
L_252:
;			illname();
	CALL illname
L_263:
;		argstk = argstk - 2;	/* cnt down */
	MOV  BX, [Word argstk]
	PUSH BX
	MOV  BX, +2
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	MOV  Word [argstk], BX
;		if (endst()) return;
	CALL endst
	OR   BX, BX
	JNZ  L_264
	JMP  L_265
L_264:
	ADD  SP, AutoC242
	POP  BP
	RET
;		if (match(",") == 0) error("expected comma");
L_265:
	MOV  BX, L_242+28
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_266
	JMP  L_267
L_266:
	MOV  BX, L_242+30
	PUSH BX
	CALL error
	ADD  SP, +2
;		}
L_267:
	JMP  L_243
L_245:
;}
	ADD  SP, AutoC242
	POP  BP
	RET

AutoC242	EQU 19
;	t	VAR	INT	+6
;	top	VAR	INT	+4
;	n	ARRAY	CHAR	-13
;	argptr	PTR	CHAR	-15
;	j	VAR	INT	-17
;	auto_addr	VAR	INT	-19

	  [SECTION .dseg]
L_242	DB "*",0
	DB "[",0
	DB "expecting argument name",0
	DB ",",0
	DB "expected comma",0

	  [SECTION .cseg]
;
;/*					*/
;/*	Statement parser		*/
;/*					*/
;/* called whenever syntax requires	*/
;/*	a statement. 			 */
;/*  this routine performs that statement */
;/*  and returns a number telling which one */
;
;statement()
statement:
	PUSH BP
	SUB  SP, AutoC268
	MOV  BP, SP

;{
;	if ((inspect_chr()==0) & (eof_flg)) return;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	PUSH BX
	MOV  BX, [Word eof_flg]
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_269
	JMP  L_270
L_269:
	POP  BP
	RET
;	else if (amatch("char",4))
	JMP  L_271
L_270:
	MOV  BX, L_268+0
	PUSH BX
	MOV  BX, +4
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_272
	JMP  L_273
L_272:
;		{
;		declauto(CCHAR);
	MOV  BX, +1
	PUSH BX
	CALL declauto
	ADD  SP, +2
;		ns();
	CALL ns
;		}
;	else if (amatch("int",3))
	JMP  L_274
L_273:
	MOV  BX, L_268+5
	PUSH BX
	MOV  BX, +3
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_275
	JMP  L_276
L_275:
;		{
;		declauto(CINT);
	MOV  BX, +2
	PUSH BX
	CALL declauto
	ADD  SP, +2
;		ns();
	CALL ns
;		}
;	else if (match("{"))  compound();
	JMP  L_277
L_276:
	MOV  BX, L_268+9
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_278
	JMP  L_279
L_278:
	CALL compound
;	else if (amatch("if",2))
	JMP  L_280
L_279:
	MOV  BX, L_268+11
	PUSH BX
	MOV  BX, +2
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_281
	JMP  L_282
L_281:
;		{
;		doif();
	CALL doif
;		lastst = ST_IF;
	MOV  BX, +1
	MOV  Word [lastst], BX
;		}
;	else if (amatch("do",2))
	JMP  L_283
L_282:
	MOV  BX, L_268+14
	PUSH BX
	MOV  BX, +2
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_284
	JMP  L_285
L_284:
;		{
;		dodo();
	CALL dodo
;		lastst = ST_DO;
	MOV  BX, +8
	MOV  Word [lastst], BX
;		}
;	else if (amatch("while",5))
	JMP  L_286
L_285:
	MOV  BX, L_268+17
	PUSH BX
	MOV  BX, +5
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_287
	JMP  L_288
L_287:
;		{
;		dowhile();
	CALL dowhile
;		lastst = ST_WHILE;
	MOV  BX, +2
	MOV  Word [lastst], BX
;		}
;	else if (amatch("return",6))
	JMP  L_289
L_288:
	MOV  BX, L_268+23
	PUSH BX
	MOV  BX, +6
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_290
	JMP  L_291
L_290:
;		{
;		doreturn();
	CALL doreturn
;		ns();
	CALL ns
;		lastst = ST_RETURN;
	MOV  BX, +3
	MOV  Word [lastst], BX
;		}
;	else if (amatch("break",5))
	JMP  L_292
L_291:
	MOV  BX, L_268+30
	PUSH BX
	MOV  BX, +5
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_293
	JMP  L_294
L_293:
;		{
;		dobreak();
	CALL dobreak
;		ns();
	CALL ns
;		lastst = ST_BREAK;
	MOV  BX, +4
	MOV  Word [lastst], BX
;		}
;	else if (amatch("continue",8))
	JMP  L_295
L_294:
	MOV  BX, L_268+36
	PUSH BX
	MOV  BX, +8
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_296
	JMP  L_297
L_296:
;		{
;		docont();
	CALL docont
;		ns();
	CALL ns
;		lastst = ST_CONT;
	MOV  BX, +5
	MOV  Word [lastst], BX
;		}
;/**** -not ready for prime time-
;	else if (amatch ("for", 3))
;		{
;		dofor ();
;		lastst = STFOR;
;		}
;	else if (amatch ("switch", 6))
;		{
;		doswitch ();
;		lastst = STSWITCH;
;		}
;****/
;/***	else if (amatch("case",4))
;		{
;		docase ();
;		lastst = statement ();
;		}
;	else if (amatch("default", 7))
;		{
;		dodefault ();
;		lastst = statement();
;		}
;***/
;	else if (match(";"));
	JMP  L_298
L_297:
	MOV  BX, L_268+45
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_299
	JMP  L_300
L_299:
;	else if (match("#asm"))
	JMP  L_301
L_300:
	MOV  BX, L_268+47
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_302
	JMP  L_303
L_302:
;		{
;		doasm();
	CALL doasm
;		lastst = ST_ASM;
	MOV  BX, +6
	MOV  Word [lastst], BX
;		}
;
;	/* if nothing else, assume it's an expression */
;	else	{ /** presume comma expr possible **/
	JMP  L_304
L_303:
;		expression(YES); /** an expression ending with a  **/ 
	MOV  BX, +1
	PUSH BX
	CALL expression
	ADD  SP, +2
;		ns();		/** semicolon is a statement in C. **/
	CALL ns
;		lastst = ST_EXPR;
	MOV  BX, +7
	MOV  Word [lastst], BX
;		}
L_304:
L_301:
L_298:
L_295:
L_292:
L_289:
L_286:
L_283:
L_280:
L_277:
L_274:
L_271:
;	return lastst;
	MOV  BX, [Word lastst]
	POP  BP
	RET
;}		/** eo statement **/

AutoC268	EQU 0

	  [SECTION .dseg]
L_268	DB "char",0
	DB "int",0
	DB "{",0
	DB "if",0
	DB "do",0
	DB "while",0
	DB "return",0
	DB "break",0
	DB "continue",0
	DB ";",0
	DB "#asm",0

	  [SECTION .cseg]
;
;/*					*/
;/*	Semicolon enforcer	*/
;/*					*/
;/* called whenever syntax requires a semicolon */
;
;ns()
ns:
	PUSH BP
	SUB  SP, AutoC305
	MOV  BP, SP

;{
;	if (match(";") == 0)  error("missing semicolon");
	MOV  BX, L_305+0
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_306
	JMP  L_307
L_306:
	MOV  BX, L_305+2
	PUSH BX
	CALL error
	ADD  SP, +2
;}
L_307:
	POP  BP
	RET

AutoC305	EQU 0

	  [SECTION .dseg]
L_305	DB ";",0
	DB "missing semicolon",0

	  [SECTION .cseg]
;
;/*					*/
;/*	Compound statement	*/
;/*					*/
;/* allow any number of statements to fall between "{}" */
;
;compound()
compound:
	PUSH BP
	SUB  SP, AutoC308
	MOV  BP, SP

;{
;	++ncmp;		/* new level open */
	MOV  BX, [Word ncmp]
	INC  BX
	MOV  Word [ncmp], BX
;	while (match("}") == 0) statement(); /* do one */
L_309:
	MOV  BX, L_308+0
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_310
	JMP  L_311
L_310:
	CALL statement
	JMP  L_309
L_311:
;	--ncmp;		/* close current level */
	MOV  BX, [Word ncmp]
	DEC  BX
	MOV  Word [ncmp], BX
;}
	POP  BP
	RET

AutoC308	EQU 0

	  [SECTION .dseg]
L_308	DB "}",0

	  [SECTION .cseg]
;
;/*				*/
;/*	"if" statement	*/
;/*				*/
;
;doif()
doif:
	PUSH BP
	SUB  SP, AutoC312
	MOV  BP, SP

;{
;	int flev,fsp,flab1,flab2;
;	int t_lbl;
;
;	flev = autoptr;		/* record current local level */
	LEA  BX, [AutoC312-2+BP]
	PUSH BX
	MOV  BX, [Word autoptr]
	POP  DI
	MOV  Word [DI], BX
;	fsp = Csp;			/* record current stk ptr */
	LEA  BX, [AutoC312-4+BP]
	PUSH BX
	MOV  BX, [Word Csp]
	POP  DI
	MOV  Word [DI], BX
;
;	t_lbl = getlabel();	/** for true branch **/
	LEA  BX, [AutoC312-10+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	flab1 = getlabel();	/* get label for false branch */
	LEA  BX, [AutoC312-6+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;
;/**	logical_test(flab1);	* get expression, and branch false */
;	logic_tst(t_lbl,flab1); /** test new fn **/
	LEA  BX, [AutoC312-10+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC312-6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL logic_tst
	ADD  SP, +4
;/**	logical_tst2(flab1,FALSE);	* get expression, and branch false */
;
;	sa_mk_lbl(t_lbl);		/** codegen true branch label **/
	LEA  BX, [AutoC312-10+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;
;	statement();		/* if true, do a statement */
	CALL statement
;	Csp = sa_modstk(fsp);	/* then clean up the stack */
	LEA  BX, [AutoC312-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_modstk
	ADD  SP, +2
	MOV  Word [Csp], BX
;	autoptr = flev;		/* and deallocate any locals */
	LEA  BX, [AutoC312-2+BP]
	MOV  BX, [BX]
	MOV  Word [autoptr], BX
;	if (amatch("else",4) == 0)	/* if...else ? */
	MOV  BX, L_312+0
	PUSH BX
	MOV  BX, +4
	PUSH BX
	CALL amatch
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_313
	JMP  L_314
L_313:
;		{			/* simple "if"...print false label */
;		sa_mk_lbl(flab1);
	LEA  BX, [AutoC312-6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;		return;		/* and exit */
	ADD  SP, AutoC312
	POP  BP
	RET
;		}
;
;	/* an "if...else" statement. */
;
;	sa_jump(flab2 = getlabel());		/* jump around false code */
L_314:
	LEA  BX, [AutoC312-8+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
	PUSH BX
	CALL sa_jump
	ADD  SP, +2
;	printlabel(flab1); colon(); nl();	/* print false label */
	LEA  BX, [AutoC312-6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
	CALL colon
	CALL nl
;	statement();				/* and do "else" clause */
	CALL statement
;	Csp = sa_modstk(fsp);			/* then clean up stk ptr */
	LEA  BX, [AutoC312-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_modstk
	ADD  SP, +2
	MOV  Word [Csp], BX
;	autoptr = flev;				/* and deallocate locals */
	LEA  BX, [AutoC312-2+BP]
	MOV  BX, [BX]
	MOV  Word [autoptr], BX
;	sa_mk_lbl(flab2);				/* print true label */
	LEA  BX, [AutoC312-8+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;}		/** eo doif **/
	ADD  SP, AutoC312
	POP  BP
	RET

AutoC312	EQU 10
;	flev	VAR	INT	-2
;	fsp	VAR	INT	-4
;	flab1	VAR	INT	-6
;	flab2	VAR	INT	-8
;	t_lbl	VAR	INT	-10

	  [SECTION .dseg]
L_312	DB "else",0

	  [SECTION .cseg]
;
;/*						*/
;/*	"do" statement "while" (expr)	*/
;/*						*/
;dodo()
dodo:
	PUSH BP
	SUB  SP, AutoC315
	MOV  BP, SP

;{
;	int ws[WS_SZ];		/* allocate local stack */
;	int t_lbl;			/** auto 'True' Label **/
;
;	ws[WS_SYMS] = autoptr;	/* record local level */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, [Word autoptr]
	POP  DI
	MOV  Word [DI], BX
;	ws[WS_SP] = Csp;		/* and stk ptr */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, [Word Csp]
	POP  DI
	MOV  Word [DI], BX
;
;	ws[WS_LBL2] = getlabel();	/* do loop label */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +4
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	ws[WS_LOOP] = getlabel();	/* and looping label */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	t_lbl = getlabel();	/** make a unique label for our use **/
	LEA  BX, [AutoC315-12+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	ws[WS_LBL] = getlabel();	/* and exit label */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +3
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;
;	addwhile(ws);		/* add entry to stack */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	CALL addwhile
	ADD  SP, +2
;
;		/* (for "break" statement) */
;	sa_mk_lbl(ws[WS_LBL2]);	/* loop label */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +4
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;	statement();		/* do a statement, body of do_while */
	CALL statement
;	if (amatch("while",5) == 0)
	MOV  BX, L_315+0
	PUSH BX
	MOV  BX, +5
	PUSH BX
	CALL amatch
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_316
	JMP  L_317
L_316:
;		{
;		error("'while' expected.");
	MOV  BX, L_315+6
	PUSH BX
	CALL error
	ADD  SP, +2
;		return;		/* and exit */
	ADD  SP, AutoC315
	POP  BP
	RET
;		}
;
;	sa_mk_lbl(ws[WS_LOOP]);		/* cont label, at while(expr) */
L_317:
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;/**	logical_test(ws[WS_LBL]);	* get expression and branch false */
;
;	logic_do_tst(t_lbl,ws[WS_LBL]); /** test new fn, for DO **/
	LEA  BX, [AutoC315-12+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +3
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL logic_do_tst
	ADD  SP, +4
;/**	sa_mk_lbl(t_lbl);	** codegen true branch label **/
;
;	sa_jump(ws[WS_LBL2]);		/* continue to loop */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +4
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_jump
	ADD  SP, +2
;
;	sa_mk_lbl(ws[WS_LBL]);		/* exit label */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +3
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;
;	ns();					/* look for ending semi-colon. */
	CALL ns
;	autoptr = ws[WS_SYMS];		/* deallocate locals */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	MOV  Word [autoptr], BX
;	Csp = sa_modstk(ws[WS_SP]);	/* clean up stk ptr */
	LEA  BX, [AutoC315-10+BP]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_modstk
	ADD  SP, +2
	MOV  Word [Csp], BX
;	delwhile();				/* delete stack entry */
	CALL delwhile
;}		/** eo dodo **/
	ADD  SP, AutoC315
	POP  BP
	RET

AutoC315	EQU 12
;	ws	ARRAY	INT	-10
;	t_lbl	VAR	INT	-12

	  [SECTION .dseg]
L_315	DB "while",0
	DB "'while' expected.",0

	  [SECTION .cseg]
;
;
;/*						*/
;/*	"while" (expr) statement	*/
;/*						*/
;
;dowhile()
dowhile:
	PUSH BP
	SUB  SP, AutoC318
	MOV  BP, SP

;{
;	int ws[WS_SZ];			/* allocate local stack */
;	int t_lbl;			/** auto 'True' Label **/
;
;	ws[WS_SYMS] = autoptr;		/* record local level */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, [Word autoptr]
	POP  DI
	MOV  Word [DI], BX
;	ws[WS_SP] = Csp;			/* and stk ptr */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, [Word Csp]
	POP  DI
	MOV  Word [DI], BX
;
;	ws[WS_LOOP] = getlabel();	/* and looping label */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	t_lbl = getlabel();	/** make a unique label for our use **/
	LEA  BX, [AutoC318-12+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	ws[WS_LBL] = getlabel();		/* and exit label */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +3
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	addwhile(ws);			/* add entry to stack */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	CALL addwhile
	ADD  SP, +2
;
;		/* (for "break" statement) */
;	sa_mk_lbl(ws[WS_LOOP]);		/* loop label */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;/**	logical_test(ws[WS_LBL]);	* see if true */ 
;	logic_tst(t_lbl,ws[WS_LBL]); /** test new fn **/
	LEA  BX, [AutoC318-12+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +3
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL logic_tst
	ADD  SP, +4
;
;	sa_mk_lbl(t_lbl);		/** codegen true branch label **/
	LEA  BX, [AutoC318-12+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;
;	statement();			/* if so, do a statement */
	CALL statement
;	sa_jump(ws[WS_LOOP]);		/* loop to label */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_jump
	ADD  SP, +2
;	sa_mk_lbl(ws[WS_LBL]);		/* exit label */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +3
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;	autoptr = ws[WS_SYMS];		/* deallocate locals */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	MOV  Word [autoptr], BX
;	Csp = sa_modstk(ws[WS_SP]);	/* clean up stk ptr */
	LEA  BX, [AutoC318-10+BP]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_modstk
	ADD  SP, +2
	MOV  Word [Csp], BX
;	delwhile();				/* delete stack entry */
	CALL delwhile
;}		/** eo dowhile **/
	ADD  SP, AutoC318
	POP  BP
	RET

AutoC318	EQU 12
;	ws	ARRAY	INT	-10
;	t_lbl	VAR	INT	-12
;
;/*
; *	"for" statement
; */
;/*****
;dofor ()
;{
;	int	ws[7],
;		*pws;
;
;	ws[WSSYM] = autoptr;
;	ws[WSSP] = Csp;
;	ws[WSTYP] = WSFOR;
;	ws[WSTEST] = getlabel ();
;	ws[WSINCR] = getlabel ();
;	ws[WSBODY] = getlabel ();
;	ws[WSEXIT] = getlabel ();
;	addwhile (ws);
;	pws = readwhile ();
;	needbrack ("(");
;
;	if (match (";") == 0) {
;		expression (YES);
;		ns ();
;	}
;	gnlabel (pws[WSTEST]);
;
;	if (match (";") == 0) {
;		expression (YES);
;		testjump (pws[WSBODY], TRUE);
;		jump (pws[WSEXIT]);
;		ns ();
;	} else
;		pws[WSTEST] = pws[WSBODY];
;	gnlabel (pws[WSINCR]);
;
;	if (match (")") == 0) {
;		expression (YES);
;		needbrack (")");
;		jump (pws[WSTEST]);
;	} else
;		pws[WSINCR] = pws[WSTEST];
;	gnlabel (pws[WSBODY]);
;	statement (NO);
;	jump (pws[WSINCR]);
;	gnlabel (pws[WSEXIT]);
;	locptr = pws[WSSYM];
;	stkp = modstk (pws[WSSP]);
;	delwhile ();
;}
;*****/
;
;/*
; *	"switch" statement
; */
;/*****
;doswitch ()
;{
;	int	ws[7];
;	int	*ptr;
;
;	ws[WSSYM] = locptr;
;	ws[WSSP] = stkp;
;	ws[WSTYP] = WSSWITCH;
;	ws[WSCASEP] = swstp;
;	ws[WSTAB] = getlabel ();
;	ws[WSDEF] = ws[WSEXIT] = getlabel ();
;	addwhile (ws);
;	immed ();
;	printlabel (ws[WSTAB]);
;	nl ();
;	gpush ();
;	needbrack ("(");
;	expression (YES);
;	needbrack (")");
;	stkp = stkp + intsize(); **'?case' will adjust the stack **
;	gjcase ();
;	statement (NO);
;	ptr = readswitch ();
;	jump (ptr[WSEXIT]);
;	dumpsw (ptr);
;	gnlabel (ptr[WSEXIT]);
;	locptr = ptr[WSSYM];
;	stkp = modstk (ptr[WSSP]);
;	swstp = ptr[WSCASEP];
;	delwhile ();
;}
;*****/
;/*
; *	"case" label
; */
;/*****
;docase ()
;{
;	int	val;
;
;	val = 0;
;	if (readswitch ()) {
;	
;		if (number (&val) == 0)
;		
;			if (pstr (&val) == 0)
;				error ("bad case label");
;		addcase (val);
;	
;		if (match (":") == 0)
;			error ("missing colon");
;	} else
;		error ("no active switch");
;}
;*****/
;/*
; *	"default" label
; */
;/*****
;dodefault ()
;{
;	int	*ptr,
;		lab;
;
;	if (ptr = readswitch ()) {
;		ptr[WSDEF] = lab = getlabel ();
;		gnlabel (lab);
;	
;		if (match (":") == 0)
;			error ("missing colon");
;	} else
;		error ("no active switch");
;}
;*****/
;
;/*					*/
;/*	"return" statement	*/
;/*					*/
;doreturn()
doreturn:
	PUSH BP
	SUB  SP, AutoC319
	MOV  BP, SP

;{		/* if not end of statement, get an expression */
;	if (endst() == 0) expression(YES);
	CALL endst
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_320
	JMP  L_321
L_320:
	MOV  BX, +1
	PUSH BX
	CALL expression
	ADD  SP, +2
;	sa_rtnstk(0);			/* clean up stk */
L_321:
	MOV  BX, +0
	PUSH BX
	CALL sa_rtnstk
	ADD  SP, +2
;	sa_ret();				/* and exit function */
	CALL sa_ret
;}		/** eo doreturn **/
	POP  BP
	RET

AutoC319	EQU 0
;
;/*					*/
;/*	"break" statement		*/
;/*					*/
;dobreak()
dobreak:
	PUSH BP
	SUB  SP, AutoC322
	MOV  BP, SP

;{
;	int *ptr;
;
;	/* see if any "whiles" are open */
;
;	if ((ptr=readwhile()) == 0) return;	/* no */
	LEA  BX, [AutoC322-2+BP]
	PUSH BX
	CALL readwhile
	POP  DI
	MOV  Word [DI], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_323
	JMP  L_324
L_323:
	ADD  SP, AutoC322
	POP  BP
	RET
;	sa_modstk((ptr[WS_SP]));		/* else clean up stk ptr */
L_324:
	LEA  BX, [AutoC322-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_modstk
	ADD  SP, +2
;	sa_jump(ptr[WS_LBL]);		/* jump to exit label */
	LEA  BX, [AutoC322-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +3
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_jump
	ADD  SP, +2
;}		/** eo dobreak **/
	ADD  SP, AutoC322
	POP  BP
	RET

AutoC322	EQU 2
;	ptr	PTR	INT	-2
;
;/*					*/
;/*	"continue" statement	*/
;/*					*/
;docont()
docont:
	PUSH BP
	SUB  SP, AutoC325
	MOV  BP, SP

;{
;	int *ptr;
;
;	/* see if any "whiles" are open */
;
;	if ((ptr = readwhile()) == 0) return;	/* no */
	LEA  BX, [AutoC325-2+BP]
	PUSH BX
	CALL readwhile
	POP  DI
	MOV  Word [DI], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_326
	JMP  L_327
L_326:
	ADD  SP, AutoC325
	POP  BP
	RET
;	sa_modstk((ptr[WS_SP]));		/* else clean up stk ptr */
L_327:
	LEA  BX, [AutoC325-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_modstk
	ADD  SP, +2
;	sa_jump(ptr[WS_LOOP]);		/* jump to loop label */
	LEA  BX, [AutoC325-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_jump
	ADD  SP, +2
;}
	ADD  SP, AutoC325
	POP  BP
	RET

AutoC325	EQU 2
;	ptr	PTR	INT	-2
;
;/*					*/
;/*	"asm" pseudo-statement	*/
;/*					*/
;/* enters mode where assembly language statement are */
;/*	passed intact through parser	*/
;
;doasm()
doasm:
	PUSH BP
	SUB  SP, AutoC328
	MOV  BP, SP

;{
;	cmode = 0;		/* mark mode as "asm" */
	MOV  BX, +0
	MOV  Word [cmode], BX
;	while (1)
L_329:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_330
	JMP  L_331
L_330:
;		{
;		inline();	/* get and print lines */
	CALL inline
;		if (match("#endasm"))
	MOV  BX, L_328+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_332
	JMP  L_333
L_332:
;			{	/* until... */
;			sa_comment();
	CALL sa_comment
;			outstr(line); /** pass back endasm comment **/ 
	MOV  BX, line
	PUSH BX
	CALL outstr
	ADD  SP, +2
;			break;
	JMP  L_331
;			}
;		if (eof_flg) break;
L_333:
	MOV  BX, [Word eof_flg]
	OR   BX, BX
	JNZ  L_334
	JMP  L_335
L_334:
	JMP  L_331
;		outstr(line);
L_335:
	MOV  BX, line
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		nl();
	CALL nl
;		}
	JMP  L_329
L_331:
;/**	kill();		* invalidate line */
;	cmode = 1;		/* then back to parse level */
	MOV  BX, +1
	MOV  Word [cmode], BX
;}
	POP  BP
	RET

AutoC328	EQU 0

	  [SECTION .dseg]
L_328	DB "#endasm",0

	  [SECTION .cseg]
;
;/** EO C86N-2.C **/
;
;/*	>>>>> start of cc3 <<<<<<<<<	*/
;
;/*					*/
;/*	Perform a function call	*/
;/*					*/
;/* called from heir11, this routine will either call		*/
;/*	the named function, or if the supplied ptr is		*/
;/*	zero, will call the contents of Primary Register	*/
;
;callfunction(ptr)  char *ptr;	/* symbol table entry (or 0) */
callfunction:
	PUSH BP
	SUB  SP, AutoC336
	MOV  BP, SP

;{
;	int nargs;
;
;	nargs = 0;
	LEA  BX, [AutoC336-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	deblank();				/* already saw open paren */
	CALL deblank
;/** Primary Register has target address, push PR [1]**/
;	if (ptr == 0) sa_push();	
	LEA  BX, [AutoC336+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_337
	JMP  L_338
L_337:
	CALL sa_push
;	while (streq(line+lptr,")") == 0)
L_338:
L_339:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_336+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_340
	JMP  L_341
L_340:
;		{
;		if (endst()) break;
	CALL endst
	OR   BX, BX
	JNZ  L_342
	JMP  L_343
L_342:
	JMP  L_341
;		expression(NO);		/* get an argument */
L_343:
	MOV  BX, +0
	PUSH BX
	CALL expression
	ADD  SP, +2
;		if (ptr==0) sa_swapstk(); /* don't push addr */
	LEA  BX, [AutoC336+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_344
	JMP  L_345
L_344:
	CALL sa_swapstk
;		sa_push();			/* push argument */
L_345:
	CALL sa_push
;		nargs = nargs + 2;	/* count args*2 */
	LEA  BX, [AutoC336-2+BP]
	PUSH BX
	LEA  BX, [AutoC336-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		if (match(",") == 0) break;
	MOV  BX, L_336+2
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_346
	JMP  L_347
L_346:
	JMP  L_341
;		}
L_347:
	JMP  L_339
L_341:
;	needbrack(")");
	MOV  BX, L_336+4
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;	if (ptr) sa_call(ptr);
	LEA  BX, [AutoC336+4+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_348
	JMP  L_349
L_348:
	LEA  BX, [AutoC336+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_call
	ADD  SP, +2
;	else sa_callstk();
	JMP  L_350
L_349:
	CALL sa_callstk
L_350:
;          /** target address is on the stack already [1] **/
;	Csp = sa_modstk(Csp + nargs);	/* clean up arguments */
	MOV  BX, [Word Csp]
	PUSH BX
	LEA  BX, [AutoC336-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL sa_modstk
	ADD  SP, +2
	MOV  Word [Csp], BX
;}		/** eo callfunction **/
	ADD  SP, AutoC336
	POP  BP
	RET

AutoC336	EQU 2
;	ptr	PTR	CHAR	+4
;	nargs	VAR	INT	-2

	  [SECTION .dseg]
L_336	DB ")",0
	DB ",",0
	DB ")",0

	  [SECTION .cseg]
;
;junk()
junk:
	PUSH BP
	SUB  SP, AutoC351
	MOV  BP, SP

;{
;	if (an(scan_nxt()))
	CALL scan_nxt
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_352
	JMP  L_353
L_352:
;		while (an(inspect_chr())) g_nxtchr();
L_354:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_355
	JMP  L_356
L_355:
	CALL g_nxtchr
	JMP  L_354
L_356:
;
;	else	while (an(inspect_chr()) == 0)
	JMP  L_357
L_353:
L_358:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_359
	JMP  L_360
L_359:
;			{
;			if (inspect_chr() == 0) break;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_361
	JMP  L_362
L_361:
	JMP  L_360
;			g_nxtchr();
L_362:
	CALL g_nxtchr
;			}
	JMP  L_358
L_360:
L_357:
;	deblank();
	CALL deblank
;}
	POP  BP
	RET

AutoC351	EQU 0
;
;endst()
endst:
	PUSH BP
	SUB  SP, AutoC363
	MOV  BP, SP

;{
;	deblank();
	CALL deblank
;	return ((streq(line+lptr,";") | (inspect_chr() == 0)));
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_363+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	POP  BP
	RET
;}

AutoC363	EQU 0

	  [SECTION .dseg]
L_363	DB ";",0

	  [SECTION .cseg]
;
;illname()
illname:
	PUSH BP
	SUB  SP, AutoC364
	MOV  BP, SP

;{
;	error("illegal symbol name");
	MOV  BX, L_364+0
	PUSH BX
	CALL error
	ADD  SP, +2
;	junk();
	CALL junk
;}
	POP  BP
	RET

AutoC364	EQU 0

	  [SECTION .dseg]
L_364	DB "illegal symbol name",0

	  [SECTION .cseg]
;
;multidef(sname) char *sname;
multidef:
	PUSH BP
	SUB  SP, AutoC365
	MOV  BP, SP

;{
;	error("already defined");
	MOV  BX, L_365+0
	PUSH BX
	CALL error
	ADD  SP, +2
;	sa_comment();
	CALL sa_comment
;	outstr(sname); nl();
	LEA  BX, [AutoC365+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outstr
	ADD  SP, +2
	CALL nl
;}
	POP  BP
	RET

AutoC365	EQU 0
;	sname	PTR	CHAR	+4

	  [SECTION .dseg]
L_365	DB "already defined",0

	  [SECTION .cseg]
;
;needbrack(str) char *str;
needbrack:
	PUSH BP
	SUB  SP, AutoC366
	MOV  BP, SP

;{
;	if (match(str) == 0)
	LEA  BX, [AutoC366+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_367
	JMP  L_368
L_367:
;		{
;		error("missing bracket");
	MOV  BX, L_366+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		sa_comment();
	CALL sa_comment
;		outstr(str);
	LEA  BX, [AutoC366+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		nl();
	CALL nl
;		}
;}
L_368:
	POP  BP
	RET

AutoC366	EQU 0
;	str	PTR	CHAR	+4

	  [SECTION .dseg]
L_366	DB "missing bracket",0

	  [SECTION .cseg]
;
;needlval()
needlval:
	PUSH BP
	SUB  SP, AutoC369
	MOV  BP, SP

;{
;	error("must be lvalue");
	MOV  BX, L_369+0
	PUSH BX
	CALL error
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC369	EQU 0

	  [SECTION .dseg]
L_369	DB "must be lvalue",0

	  [SECTION .cseg]
;
;/** -= Scope =- match sname to static's, secondly **/
;
;findstatic(sname) char *sname;
findstatic:
	PUSH BP
	SUB  SP, AutoC370
	MOV  BP, SP

;{
;	char *ptr;
;
;	ptr = startstatic;
	LEA  BX, [AutoC370-2+BP]
	PUSH BX
	MOV  BX, symtab
	POP  DI
	MOV  Word [DI], BX
;	while	(ptr != staticptr)
L_371:
	LEA  BX, [AutoC370-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word staticptr]
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_372
	JMP  L_373
L_372:
;		{
;		if (astreq(sname,ptr,NAMEMAX)) return ptr;
	LEA  BX, [AutoC370+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC370-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +12
	PUSH BX
	CALL astreq
	ADD  SP, +6
	OR   BX, BX
	JNZ  L_374
	JMP  L_375
L_374:
	LEA  BX, [AutoC370-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC370
	POP  BP
	RET
;		ptr = ptr + SYMB_SIZE;
L_375:
	LEA  BX, [AutoC370-2+BP]
	PUSH BX
	LEA  BX, [AutoC370-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		}
	JMP  L_371
L_373:
;	return 0;
	MOV  BX, +0
	ADD  SP, AutoC370
	POP  BP
	RET
;}

AutoC370	EQU 2
;	sname	PTR	CHAR	+4
;	ptr	PTR	CHAR	-2
;
;/** -= Scope =- match sname to auto's, firstly **/
;/** - on match, return ptr to sname in auto's table - **/
;
;findauto(sname) char *sname;
findauto:
	PUSH BP
	SUB  SP, AutoC376
	MOV  BP, SP

;{
;	char *ptr;
;
;	ptr = startauto;
	LEA  BX, [AutoC376-2+BP]
	PUSH BX
	MOV  BX, symtab
	PUSH BX
	MOV  BX, +300
	PUSH BX
	MOV  BX, +18
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	while	(ptr != autoptr)
L_377:
	LEA  BX, [AutoC376-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word autoptr]
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_378
	JMP  L_379
L_378:
;		{
;		if (astreq(sname,ptr,NAMEMAX)) return ptr;
	LEA  BX, [AutoC376+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC376-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +12
	PUSH BX
	CALL astreq
	ADD  SP, +6
	OR   BX, BX
	JNZ  L_380
	JMP  L_381
L_380:
	LEA  BX, [AutoC376-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC376
	POP  BP
	RET
;			/** matched, return with ptr into tbl **/
;		ptr = ptr + SYMB_SIZE;  /** ptr == &sname[0]   **/
L_381:
	LEA  BX, [AutoC376-2+BP]
	PUSH BX
	LEA  BX, [AutoC376-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		}
	JMP  L_377
L_379:
;	return 0;
	MOV  BX, +0
	ADD  SP, AutoC376
	POP  BP
	RET
;}

AutoC376	EQU 2
;	sname	PTR	CHAR	+4
;	ptr	PTR	CHAR	-2
;
;/** catch previously defined symbol and return its ptr, **/
;/** symbptr, which is its address in the static symbol table **/
;
;addstatic(sname,id,typ,value) char *sname,id,typ; int value;
addstatic:
	PUSH BP
	SUB  SP, AutoC382
	MOV  BP, SP

;{
;	char *ptr;
;
;	if (symbptr = findstatic(sname)) return symbptr;
	LEA  BX, [AutoC382+10+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL findstatic
	ADD  SP, +2
	MOV  Word [symbptr], BX
	OR   BX, BX
	JNZ  L_383
	JMP  L_384
L_383:
	MOV  BX, [Word symbptr]
	ADD  SP, AutoC382
	POP  BP
	RET
;	if (staticptr >= endstatics)
L_384:
	MOV  BX, [Word staticptr]
	PUSH BX
	MOV  BX, symtab
	PUSH BX
	MOV  BX, +300
	PUSH BX
	MOV  BX, +18
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	POP  DX
	ADD  BX, DX
	POP  DX
	CALL ccuge
	OR   BX, BX
	JNZ  L_385
	JMP  L_386
L_385:
;		{
;		error("global symbol table overflow");
	MOV  BX, L_382+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC382
	POP  BP
	RET
;		}
;	symbptr = ptr = staticptr;
L_386:
	LEA  BX, [AutoC382-2+BP]
	PUSH BX
	MOV  BX, [Word staticptr]
	POP  DI
	MOV  Word [DI], BX
	MOV  Word [symbptr], BX
;	while (an(*ptr++ = *sname++));  /* copy name */
L_387:
	LEA  BX, [AutoC382-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC382+10+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_388
	JMP  L_389
L_388:
	JMP  L_387
L_389:
;	symbptr[IDENT] = id;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC382+8+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;	symbptr[TYPE] = typ;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC382+6+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;	symbptr[STORAGE] = C_STATIC;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +15
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Byte [DI], BL
;	symbptr[OFFSET] = value;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC382+4+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;	symbptr[OFFSET+1] = value >> 8;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +16
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC382+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAR  DX, CL
	MOV  BX, DX
	POP  DI
	MOV  Byte [DI], BL
;	staticptr = staticptr + SYMB_SIZE; /** update to next free position **/
	MOV  BX, [Word staticptr]
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	MOV  Word [staticptr], BX
;	return symbptr;
	MOV  BX, [Word symbptr]
	ADD  SP, AutoC382
	POP  BP
	RET
;}

AutoC382	EQU 2
;	sname	PTR	CHAR	+10
;	id	VAR	CHAR	+8
;	typ	VAR	CHAR	+6
;	value	VAR	INT	+4
;	ptr	PTR	CHAR	-2

	  [SECTION .dseg]
L_382	DB "global symbol table overflow",0

	  [SECTION .cseg]
;
;addauto(sname,id,typ,value) char *sname,id,typ; int value;
addauto:
	PUSH BP
	SUB  SP, AutoC390
	MOV  BP, SP

;{
;	char *ptr;
;
;	if (symbptr = findauto(sname)) return symbptr;
	LEA  BX, [AutoC390+10+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL findauto
	ADD  SP, +2
	MOV  Word [symbptr], BX
	OR   BX, BX
	JNZ  L_391
	JMP  L_392
L_391:
	MOV  BX, [Word symbptr]
	ADD  SP, AutoC390
	POP  BP
	RET
;	if (autoptr >= endautos)
L_392:
	MOV  BX, [Word autoptr]
	PUSH BX
	MOV  BX, symtab
	PUSH BX
	MOV  BX, +6480
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +18
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DX
	CALL ccuge
	OR   BX, BX
	JNZ  L_393
	JMP  L_394
L_393:
;		{
;		error("local symbol table overflow");
	MOV  BX, L_390+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC390
	POP  BP
	RET
;		}
;	symbptr = ptr = autoptr;
L_394:
	LEA  BX, [AutoC390-2+BP]
	PUSH BX
	MOV  BX, [Word autoptr]
	POP  DI
	MOV  Word [DI], BX
	MOV  Word [symbptr], BX
;	while (an(*ptr++ = *sname++));	/* copy name */
L_395:
	LEA  BX, [AutoC390-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC390+10+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_396
	JMP  L_397
L_396:
	JMP  L_395
L_397:
;	symbptr[IDENT] = id;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC390+8+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;	symbptr[TYPE] = typ;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC390+6+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;	symbptr[STORAGE] = C_AUTO;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +15
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Byte [DI], BL
;	symbptr[OFFSET] = value;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC390+4+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;	symbptr[OFFSET+1] = value >> 8;
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +16
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC390+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAR  DX, CL
	MOV  BX, DX
	POP  DI
	MOV  Byte [DI], BL
;	autoptr = autoptr + SYMB_SIZE;
	MOV  BX, [Word autoptr]
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	MOV  Word [autoptr], BX
;	return symbptr;
	MOV  BX, [Word symbptr]
	ADD  SP, AutoC390
	POP  BP
	RET
;}

AutoC390	EQU 2
;	sname	PTR	CHAR	+10
;	id	VAR	CHAR	+8
;	typ	VAR	CHAR	+6
;	value	VAR	INT	+4
;	ptr	PTR	CHAR	-2

	  [SECTION .dseg]
L_390	DB "local symbol table overflow",0

	  [SECTION .cseg]
;
;/* Test if next input string is legal symbol name */
;/** A legal identifier is a chr, perhaps followed by alphanumerics **/
;/** is_identifier, token input, ck lexeme in line buffer, returns T..F **/
;/** sname[k] limit?? **/
;/** ex. sname[NAMESIZE]; **/
;/** was symname() -> tok_in() -> is_identifier **/
;
;is_identifier(sname) char *sname;  
is_identifie:
	PUSH BP
	SUB  SP, AutoC398
	MOV  BP, SP

;{  /** LEX ck, 1st chr alpha, rest alpha-numeric, append null **/
;	int k;
;	char c;
;
;	deblank();
	CALL deblank
;		/** 1st check for leading chr for identifier **/
;	if (alpha(inspect_chr()) == 0) return FALSE; /** 0 **/
	CALL inspect_chr
	PUSH BX
	CALL alpha
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_399
	JMP  L_400
L_399:
	MOV  BX, +0
	ADD  SP, AutoC398
	POP  BP
	RET
;		/** flag lexeme as number ? **/
;
;	k = 0;  /** inspect next chr for alph-numeric **/ 
L_400:
	LEA  BX, [AutoC398-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;		/** retrieve identifier from stream **/
;	while (an(inspect_chr())) sname[k++] = g_nxtchr();
L_401:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_402
	JMP  L_403
L_402:
	LEA  BX, [AutoC398+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC398-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL g_nxtchr
	POP  DI
	MOV  Byte [DI], BL
	JMP  L_401
L_403:
;	sname[k] = 0;   /** append null **/
	LEA  BX, [AutoC398+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC398-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;	return TRUE;	/** 1 **/
	MOV  BX, +1
	ADD  SP, AutoC398
	POP  BP
	RET
;}

AutoC398	EQU 3
;	sname	PTR	CHAR	+4
;	k	VAR	INT	-2
;	c	VAR	CHAR	-3
;
;/* Return next avail internal label number */
;
;getlabel()
getlabel:
	PUSH BP
	SUB  SP, AutoC404
	MOV  BP, SP

;{
;	return(++nxtlab);
	MOV  BX, [Word nxtlab]
	INC  BX
	MOV  Word [nxtlab], BX
	POP  BP
	RET
;}

AutoC404	EQU 0
;
;/* 1 - Print specified number as label */
;
;printlabel(label) int label;
printlabel:
	PUSH BP
	SUB  SP, AutoC405
	MOV  BP, SP

;{	/**	outasm("cc"); **/
;	outasm("L_");
	MOV  BX, L_405+0
	PUSH BX
	CALL outasm
	ADD  SP, +2
;	outudec(label);
	LEA  BX, [AutoC405+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outudec
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC405	EQU 0
;	label	VAR	INT	+4

	  [SECTION .dseg]
L_405	DB "L_",0

	  [SECTION .cseg]
;
;/** 2 - Print specified number as label **/
;/** printlabel(flab1);colon();nl();     **/
;
;sa_mk_lbl(n) int n;
sa_mk_lbl:
	PUSH BP
	SUB  SP, AutoC406
	MOV  BP, SP

;{
;	outasm("L_");
	MOV  BX, L_406+0
	PUSH BX
	CALL outasm
	ADD  SP, +2
;	outudec(n);
	LEA  BX, [AutoC406+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outudec
	ADD  SP, +2
;	colon();
	CALL colon
;	nl();
	CALL nl
;}
	POP  BP
	RET

AutoC406	EQU 0
;	n	VAR	INT	+4

	  [SECTION .dseg]
L_406	DB "L_",0

	  [SECTION .cseg]
;
;/* Print specified number as label for stack */
;
;ostklbl()
ostklbl:
	PUSH BP
	SUB  SP, AutoC407
	MOV  BP, SP

;{	/**	outasm("cs");  **/
;	outasm("AutoC");  /** auto constant **/
	MOV  BX, L_407+0
	PUSH BX
	CALL outasm
	ADD  SP, +2
;	outudec(litlab);
	MOV  BX, [Word litlab]
	PUSH BX
	CALL outudec
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC407	EQU 0

	  [SECTION .dseg]
L_407	DB "AutoC",0

	  [SECTION .cseg]
;
;/* Test if given character is alpha */
;/** including underscore **/
;
;alpha(c) char c;
alpha:
	PUSH BP
	SUB  SP, AutoC408
	MOV  BP, SP

;{
;	c = c & 127;
	LEA  BX, [AutoC408+4+BP]
	PUSH BX
	LEA  BX, [AutoC408+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	POP  DI
	MOV  Byte [DI], BL
;	return (((c >= 'a') & (c <= 'z')) |
	LEA  BX, [AutoC408+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +97
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC408+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +122
	POP  DX
	CALL ccle
	POP  DX
	AND  BX, DX
	PUSH BX
;		((c >= 'A') & (c <= 'Z')) | (c == '_'));
	LEA  BX, [AutoC408+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +65
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC408+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +90
	POP  DX
	CALL ccle
	POP  DX
	AND  BX, DX
	POP  DX
	OR   BX, DX
	PUSH BX
	LEA  BX, [AutoC408+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +95
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	POP  BP
	RET
;}

AutoC408	EQU 0
;	c	VAR	CHAR	+4
;
;/* Test if given character is numeric */
;
;numeric(c) char c;
numeric:
	PUSH BP
	SUB  SP, AutoC409
	MOV  BP, SP

;{
;	c = c & 127;
	LEA  BX, [AutoC409+4+BP]
	PUSH BX
	LEA  BX, [AutoC409+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	POP  DI
	MOV  Byte [DI], BL
;	return((c >= '0') & (c <= '9'));
	LEA  BX, [AutoC409+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC409+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +57
	POP  DX
	CALL ccle
	POP  DX
	AND  BX, DX
	POP  BP
	RET
;}

AutoC409	EQU 0
;	c	VAR	CHAR	+4
;
;/* Test if given character is alphanumeric */
;an(c) char c;
an:
	PUSH BP
	SUB  SP, AutoC410
	MOV  BP, SP

;{
;	return((alpha(c)) | (numeric(c)));
	LEA  BX, [AutoC410+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL alpha
	ADD  SP, +2
	PUSH BX
	LEA  BX, [AutoC410+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL numeric
	ADD  SP, +2
	POP  DX
	OR   BX, DX
	POP  BP
	RET
;}

AutoC410	EQU 0
;	c	VAR	CHAR	+4
;
;/* Print a carriage return and a string only to console */
;pl(str) char *str;
pl:
	PUSH BP
	SUB  SP, AutoC411
	MOV  BP, SP

;{
;	int k;
;
;	k = 0;
	LEA  BX, [AutoC411-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	putchar(EOL);
	MOV  BX, +10
	PUSH BX
	CALL putchar
	ADD  SP, +2
;	while (str[k]) putchar(str[k++]);
L_412:
	LEA  BX, [AutoC411+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC411-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_413
	JMP  L_414
L_413:
	LEA  BX, [AutoC411+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC411-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL putchar
	ADD  SP, +2
	JMP  L_412
L_414:
;}
	ADD  SP, AutoC411
	POP  BP
	RET

AutoC411	EQU 2
;	str	PTR	CHAR	+4
;	k	VAR	INT	-2
;
;addwhile(ptr) int ptr[];
addwhile:
	PUSH BP
	SUB  SP, AutoC415
	MOV  BP, SP

;{
;	int k;
;
;	if (wsptr == WS_MAX)
	MOV  BX, [Word wsptr]
	PUSH BX
	MOV  BX, ws
	PUSH BX
	MOV  BX, +100
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +5
	SAL  BX, 1
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_416
	JMP  L_417
L_416:
;		{
;		error("too many active whiles");
	MOV  BX, L_415+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		return;
	ADD  SP, AutoC415
	POP  BP
	RET
;		}
;	k = 0;
L_417:
	LEA  BX, [AutoC415-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (k < WS_SZ)
L_418:
	LEA  BX, [AutoC415-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +5
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_419
	JMP  L_420
L_419:
;		{
;		*wsptr++ = ptr[k++];
	MOV  BX, [Word wsptr]
	INC  BX
	INC  BX
	MOV  Word [wsptr], BX
	DEC  BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC415+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC415-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		}
	JMP  L_418
L_420:
;}
	ADD  SP, AutoC415
	POP  BP
	RET

AutoC415	EQU 2
;	ptr	PTR	INT	+4
;	k	VAR	INT	-2

	  [SECTION .dseg]
L_415	DB "too many active whiles",0

	  [SECTION .cseg]
;
;delwhile()
delwhile:
	PUSH BP
	SUB  SP, AutoC421
	MOV  BP, SP

;{
;	if (readwhile()) wsptr = wsptr-WS_SZ;
	CALL readwhile
	OR   BX, BX
	JNZ  L_422
	JMP  L_423
L_422:
	MOV  BX, [Word wsptr]
	PUSH BX
	MOV  BX, +5
	SAL  BX, 1
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	MOV  Word [wsptr], BX
;}
L_423:
	POP  BP
	RET

AutoC421	EQU 0
;
;readwhile()
readwhile:
	PUSH BP
	SUB  SP, AutoC424
	MOV  BP, SP

;{
;	if (wsptr == ws)
	MOV  BX, [Word wsptr]
	PUSH BX
	MOV  BX, ws
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_425
	JMP  L_426
L_425:
;		{
;		error("no active do/for/while/switch");
	MOV  BX, L_424+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		return 0;
	MOV  BX, +0
	POP  BP
	RET
;		}
;	else	return (wsptr-WS_SZ);
	JMP  L_427
L_426:
	MOV  BX, [Word wsptr]
	PUSH BX
	MOV  BX, +5
	SAL  BX, 1
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  BP
	RET
L_427:
;}
	POP  BP
	RET

AutoC424	EQU 0

	  [SECTION .dseg]
L_424	DB "no active do/for/while/switch",0

	  [SECTION .cseg]
;
;/*** Additional Statement Support Routines ***/
;/*****
;
;findwhile ()
;{
;	int	*ptr;
;
;	for (ptr = wsptr; ptr != ws;) {
;		ptr = ptr - WSSIZ;
;		if (ptr[WSTYP] != WSSWITCH)
;			return (ptr);
;	}
;	error ("no active do/for/while");
;	return (0);
;}
;
;readswitch ()
;{
;	int	*ptr;
;
;	if (ptr = readwhile ())
;		if (ptr[WSTYP] == WSSWITCH)
;			return (ptr);
;	return (0);
;}
;
;addcase (val)
;int	val;
;{
;	int	lab;
;
;	if (swstp == SWSTSZ)
;		error ("too many case labels");
;	else {
;		swstcase[swstp] = val;
;		swstlab[swstp++] = lab = getlabel ();
;		printlabel (lab);
;		col ();
;		nl ();
;	}
;}
;*****/
;/***------***/
;
;/** Note: the line[] and lptr are statics for the following **/
;/**  tokenizing functions, inwhich line[] is for line buffered input **/
;/** was chr(), -> inspect_chr() **/
;
;inspect_chr()  /** inspect current chr, doesn't advance pointer **/
inspect_chr:
	PUSH BP
	SUB  SP, AutoC428
	MOV  BP, SP

;{
;	return (line[lptr] & 127);
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	POP  BP
	RET
;}

AutoC428	EQU 0
;
;lookahead() /** lookahead, but doesn't advance ptr **/
lookahead:
	PUSH BP
	SUB  SP, AutoC429
	MOV  BP, SP

;{
;	if (inspect_chr() == 0) return 0;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_430
	JMP  L_431
L_430:
	MOV  BX, +0
	POP  BP
	RET
;	else return (line[lptr+1] & 127);
	JMP  L_432
L_431:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	POP  BP
	RET
L_432:
;}
	POP  BP
	RET

AutoC429	EQU 0
;
; /** ret chr from linebuffer and advance ptr unless null chr **/
;g_nxtchr()
g_nxtchr:
	PUSH BP
	SUB  SP, AutoC433
	MOV  BP, SP

;{
;	if (inspect_chr() == 0) return 0;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_434
	JMP  L_435
L_434:
	MOV  BX, +0
	POP  BP
	RET
;	else return (line[lptr++] & 127);
	JMP  L_436
L_435:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	INC  BX
	MOV  Word [lptr], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	POP  BP
	RET
L_436:
;}
	POP  BP
	RET

AutoC433	EQU 0
;
; /** reindex & null terminate input line **/
;kill()
kill:
	PUSH BP
	SUB  SP, AutoC437
	MOV  BP, SP

;{
;	lptr = 0;
	MOV  BX, +0
	MOV  Word [lptr], BX
;	line[lptr] = 0;
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;}
	POP  BP
	RET

AutoC437	EQU 0
;
; /** ck chr at line[lptr], if null & !eof_flg, get next line[] fill **/
; /** bridges line breaks, & preprocess stuff **/
;scan_nxt()
scan_nxt:
	PUSH BP
	SUB  SP, AutoC438
	MOV  BP, SP

;{
;	while (inspect_chr() == 0)
L_439:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_440
	JMP  L_441
L_440:
;		{
;		if (eof_flg) return 0;
	MOV  BX, [Word eof_flg]
	OR   BX, BX
	JNZ  L_442
	JMP  L_443
L_442:
	MOV  BX, +0
	POP  BP
	RET
;		inline();
L_443:
	CALL inline
;		preprocess();
	CALL preprocess
;		}
	JMP  L_439
L_441:
;	return g_nxtchr();
	CALL g_nxtchr
	POP  BP
	RET
;}

AutoC438	EQU 0
;
; /** ck line[] for null (EOL), if so, get next line, ret chr or null **/
; /** called only by preprocess() **/
;inchar()
inchar:
	PUSH BP
	SUB  SP, AutoC444
	MOV  BP, SP

;{
;	if (inspect_chr() == 0) inline();
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_445
	JMP  L_446
L_445:
	CALL inline
;	if (eof_flg) return 0;
L_446:
	MOV  BX, [Word eof_flg]
	OR   BX, BX
	JNZ  L_447
	JMP  L_448
L_447:
	MOV  BX, +0
	POP  BP
	RET
;	return (g_nxtchr());
L_448:
	CALL g_nxtchr
	POP  BP
	RET
;}

AutoC444	EQU 0
;
; /** main input function, chrs accumulate into static line[], **/
; /** also echoes to file commentary tokens, if desired by user. **/
; /** a byte value > 7Fh (sign set) is read as eof in this function **/
; /** On return, line[] holds string of k's, where k is of the set **/
; /** of bytes {1..7Fh} with a null termination, 0. **/
;
;inline()
inline:
	PUSH BP
	SUB  SP, AutoC449
	MOV  BP, SP

;{
;	int k, unit;
;
;	while(1)
L_450:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_451
	JMP  L_452
L_451:
;		{
;		if (fp_input == 0) openin();
	MOV  BX, [Word fp_input]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_453
	JMP  L_454
L_453:
	CALL openin
;		if (eof_flg) return;
L_454:
	MOV  BX, [Word eof_flg]
	OR   BX, BX
	JNZ  L_455
	JMP  L_456
L_455:
	ADD  SP, AutoC449
	POP  BP
	RET
;		if ((unit = fp_input2) == 0) unit = fp_input;
L_456:
	LEA  BX, [AutoC449-4+BP]
	PUSH BX
	MOV  BX, [Word fp_input2]
	POP  DI
	MOV  Word [DI], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_457
	JMP  L_458
L_457:
	LEA  BX, [AutoC449-4+BP]
	PUSH BX
	MOV  BX, [Word fp_input]
	POP  DI
	MOV  Word [DI], BX
;		kill();  /** clear line index **/
L_458:
	CALL kill
;
;		while ((k = getc(unit)) > 0)  /** main fetch fn **/
L_459:
	LEA  BX, [AutoC449-2+BP]
	PUSH BX
	LEA  BX, [AutoC449-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL getc
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccgt
	OR   BX, BX
	JNZ  L_460
	JMP  L_461
L_460:
;			{
;			if ((k == EOL) | (lptr >= LINEMAX)) break; /** chg >= to > **/
	LEA  BX, [AutoC449-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +10
	POP  DX
	CALL cceq
	PUSH BX
	MOV  BX, [Word lptr]
	PUSH BX
	MOV  BX, +80
	PUSH BX
	MOV  BX, +1
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DX
	CALL ccge
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_462
	JMP  L_463
L_462:
	JMP  L_461
;			line[lptr++] = k;	/** store input in static char array **/
L_463:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	INC  BX
	MOV  Word [lptr], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC449-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;			}	/** a null in stream will abort while **/
	JMP  L_459
L_461:
;
;		line[lptr] = 0;	/* append null */
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;		lineno++;	/* read one more line	gtf 7/2/80 */
	MOV  BX, [Word lineno]
	INC  BX
	MOV  Word [lineno], BX
	DEC  BX
;
;		if (k <= 0)  /** eof is - flag **/
	LEA  BX, [AutoC449-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccle
	OR   BX, BX
	JNZ  L_464
	JMP  L_465
L_464:
;			{
;			fclose(unit);
	LEA  BX, [AutoC449-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL fclose
	ADD  SP, +2
;			if (fp_input2) endinclude();	/* gtf 7/16/80 */
	MOV  BX, [Word fp_input2]
	OR   BX, BX
	JNZ  L_466
	JMP  L_467
L_466:
	CALL endinclude
;			else fp_input = 0;
	JMP  L_468
L_467:
	MOV  BX, +0
	MOV  Word [fp_input], BX
L_468:
;			}
;		if (lptr)	/** indicates something was read to process **/
L_465:
	MOV  BX, [Word lptr]
	OR   BX, BX
	JNZ  L_469
	JMP  L_470
L_469:
;			{	/** if flgs, echo to FILE as comment **/
;			if ((ctext) & (cmode))
	MOV  BX, [Word ctext]
	PUSH BX
	MOV  BX, [Word cmode]
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_471
	JMP  L_472
L_471:
;				{
;				sa_comment();
	CALL sa_comment
;				outstr(line); /** FILE output **/
	MOV  BX, line
	PUSH BX
	CALL outstr
	ADD  SP, +2
;				nl();
	CALL nl
;				}
;			lptr = 0;	/** reindex for next time **/
L_472:
	MOV  BX, +0
	MOV  Word [lptr], BX
;			return;	/** -with line[] filled to process **/
	ADD  SP, AutoC449
	POP  BP
	RET
;			}
;		}
L_470:
	JMP  L_450
L_452:
;}
	ADD  SP, AutoC449
	POP  BP
	RET

AutoC449	EQU 4
;	k	VAR	INT	-2
;	unit	VAR	INT	-4
;
;/** EO C86N-3.C **/
;
;/*	>>>>>> start of cc4 <<<<<<<	*/
;
;/** macro line buffer used to hold temps also **/
;
;keepch(c) char c;
keepch:
	PUSH BP
	SUB  SP, AutoC473
	MOV  BP, SP

;{
;	mline[mptr] = c;
	MOV  BX, mline
	PUSH BX
	MOV  BX, [Word mptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC473+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;	if (mptr < MP_MAX) mptr++;
	MOV  BX, [Word mptr]
	PUSH BX
	MOV  BX, +80
	PUSH BX
	MOV  BX, +1
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_474
	JMP  L_475
L_474:
	MOV  BX, [Word mptr]
	INC  BX
	MOV  Word [mptr], BX
	DEC  BX
;	return c;
L_475:
	LEA  BX, [AutoC473+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  BP
	RET
;}

AutoC473	EQU 0
;	c	VAR	CHAR	+4
;
;/** space or tab chr compression **/
;/** quoted string handler **/
;/** char constant handler **/
;/** comments handler **/
;/** macro substitution **/
;
;preprocess()
preprocess:
	PUSH BP
	SUB  SP, AutoC476
	MOV  BP, SP

;{
;	int k;
;	char c, sname[NAMESIZE];
;
;	if (cmode == 0) return; /** ck preprocess flg **/
	MOV  BX, [Word cmode]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_477
	JMP  L_478
L_477:
	ADD  SP, AutoC476
	POP  BP
	RET
;	mptr = lptr = 0;        /** reset static ptrs **/
L_478:
	MOV  BX, +0
	MOV  Word [lptr], BX
	MOV  Word [mptr], BX
;	while	(inspect_chr())
L_479:
	CALL inspect_chr
	OR   BX, BX
	JNZ  L_480
	JMP  L_481
L_480:
;		{
;		if ((inspect_chr() == ' ') | (inspect_chr() == 9))
	CALL inspect_chr
	PUSH BX
	MOV  BX, +32
	POP  DX
	CALL cceq
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +9
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_482
	JMP  L_483
L_482:
;			{  /** space or tab chr compression **/
;			keepch(' '); /** keep one space, compact the rest **/
	MOV  BX, +32
	PUSH BX
	CALL keepch
	ADD  SP, +2
;			while	((inspect_chr() == ' ') | (inspect_chr() == 9))
L_484:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +32
	POP  DX
	CALL cceq
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +9
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_485
	JMP  L_486
L_485:
;				g_nxtchr(); /** rets chr or null at line[lptr] **/
	CALL g_nxtchr
	JMP  L_484
L_486:
;			}
;		else	if (inspect_chr() == '"')
	JMP  L_487
L_483:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +34
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_488
	JMP  L_489
L_488:
;			{  /** quoted string into macro buffer **/
;			keepch(inspect_chr()); /** cpy into mline **/
	CALL inspect_chr
	PUSH BX
	CALL keepch
	ADD  SP, +2
;			g_nxtchr();
	CALL g_nxtchr
;			while	(inspect_chr() != '"')
L_490:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +34
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_491
	JMP  L_492
L_491:
;				{
;				if (inspect_chr() == 0)
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_493
	JMP  L_494
L_493:
;					{
;					error("missing quote");
	MOV  BX, L_476+0
	PUSH BX
	CALL error
	ADD  SP, +2
;					break;
	JMP  L_492
;					}
;				keepch(g_nxtchr());
L_494:
	CALL g_nxtchr
	PUSH BX
	CALL keepch
	ADD  SP, +2
;				}
	JMP  L_490
L_492:
;			g_nxtchr();
	CALL g_nxtchr
;			keepch('"');  /** cpy into mline **/
	MOV  BX, +34
	PUSH BX
	CALL keepch
	ADD  SP, +2
;			}
;		else if (inspect_chr() == 39)
	JMP  L_495
L_489:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +39
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_496
	JMP  L_497
L_496:
;			{  /** 39d is single quote, apostrophe **/
;			keepch(39);
	MOV  BX, +39
	PUSH BX
	CALL keepch
	ADD  SP, +2
;			g_nxtchr();
	CALL g_nxtchr
;			while	(inspect_chr() != 39)
L_498:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +39
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_499
	JMP  L_500
L_499:
;				{
;				if (inspect_chr() == 0)
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_501
	JMP  L_502
L_501:
;					{
;					error("missing apostrophe");
	MOV  BX, L_476+14
	PUSH BX
	CALL error
	ADD  SP, +2
;					break;
	JMP  L_500
;					}
;				keepch(g_nxtchr());
L_502:
	CALL g_nxtchr
	PUSH BX
	CALL keepch
	ADD  SP, +2
;				}
	JMP  L_498
L_500:
;			g_nxtchr();
	CALL g_nxtchr
;			keepch(39);  /** cpy into mline **/
	MOV  BX, +39
	PUSH BX
	CALL keepch
	ADD  SP, +2
;			}
;		else	if ((inspect_chr() == '/') & (lookahead() == '*'))
	JMP  L_503
L_497:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +47
	POP  DX
	CALL cceq
	PUSH BX
	CALL lookahead
	PUSH BX
	MOV  BX, +42
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_504
	JMP  L_505
L_504:
;			{  /** comments, like this one **/
;			inchar(); inchar();
	CALL inchar
	CALL inchar
;			while	(((inspect_chr() == '*') & (lookahead() == '/')) == 0)
L_506:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +42
	POP  DX
	CALL cceq
	PUSH BX
	CALL lookahead
	PUSH BX
	MOV  BX, +47
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_507
	JMP  L_508
L_507:
;				{
;				if (inspect_chr() == 0) inline();
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_509
	JMP  L_510
L_509:
	CALL inline
;				else inchar();
	JMP  L_511
L_510:
	CALL inchar
L_511:
;				if (eof_flg) break;
	MOV  BX, [Word eof_flg]
	OR   BX, BX
	JNZ  L_512
	JMP  L_513
L_512:
	JMP  L_508
;				}
L_513:
	JMP  L_506
L_508:
;			inchar();inchar();
	CALL inchar
	CALL inchar
;			}
;		else	if (an(inspect_chr()))
	JMP  L_514
L_505:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_515
	JMP  L_516
L_515:
;			{  /** macro substitution by lookup is done here **/
;			k = 0;
	LEA  BX, [AutoC476-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;			while	(an(inspect_chr()))
L_517:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_518
	JMP  L_519
L_518:
;				{  /** copy token **/
;				if (k < NAMEMAX) sname[k++] = inspect_chr();
	LEA  BX, [AutoC476-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +12
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_520
	JMP  L_521
L_520:
	LEA  BX, [AutoC476-16+BP]
	PUSH BX
	LEA  BX, [AutoC476-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL inspect_chr
	POP  DI
	MOV  Byte [DI], BL
;				g_nxtchr();  /** advance thru line[] **/
L_521:
	CALL g_nxtchr
;				}
	JMP  L_517
L_519:
;			sname[k] = 0;  /** append null to extracted token **/
	LEA  BX, [AutoC476-16+BP]
	PUSH BX
	LEA  BX, [AutoC476-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			if (k = findmac(sname))  /** token is macr defined **/
	LEA  BX, [AutoC476-2+BP]
	PUSH BX
	LEA  BX, [AutoC476-16+BP]
	PUSH BX
	CALL findmac
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_522
	JMP  L_523
L_522:
;				while	(c = macq[k++]) keepch(c);  /** cpy into mline **/
L_524:
	LEA  BX, [AutoC476-3+BP]
	PUSH BX
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC476-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
	OR   BX, BX
	JNZ  L_525
	JMP  L_526
L_525:
	LEA  BX, [AutoC476-3+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL keepch
	ADD  SP, +2
	JMP  L_524
L_526:
;			else	{  /** ordinary token is copied without substitution **/
	JMP  L_527
L_523:
;				k = 0;
	LEA  BX, [AutoC476-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;				while	(c = sname[k++]) keepch(c);  /** cpy into mline **/
L_528:
	LEA  BX, [AutoC476-3+BP]
	PUSH BX
	LEA  BX, [AutoC476-16+BP]
	PUSH BX
	LEA  BX, [AutoC476-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
	OR   BX, BX
	JNZ  L_529
	JMP  L_530
L_529:
	LEA  BX, [AutoC476-3+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL keepch
	ADD  SP, +2
	JMP  L_528
L_530:
;				}
L_527:
;			}
;		else keepch(g_nxtchr());  /** cpy into mline **/
	JMP  L_531
L_516:
	CALL g_nxtchr
	PUSH BX
	CALL keepch
	ADD  SP, +2
L_531:
L_514:
L_503:
L_495:
L_487:
;		}
	JMP  L_479
L_481:
;	keepch(0);  /** null terminate token placed into mline[] **/
	MOV  BX, +0
	PUSH BX
	CALL keepch
	ADD  SP, +2
;	if (mptr >= MP_MAX) error("line too long");
	MOV  BX, [Word mptr]
	PUSH BX
	MOV  BX, +80
	PUSH BX
	MOV  BX, +1
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DX
	CALL ccge
	OR   BX, BX
	JNZ  L_532
	JMP  L_533
L_532:
	MOV  BX, L_476+33
	PUSH BX
	CALL error
	ADD  SP, +2
;	lptr = mptr = 0;
L_533:
	MOV  BX, +0
	MOV  Word [mptr], BX
	MOV  Word [lptr], BX
;	while	(line[lptr++] = mline[mptr++]);  /** do the substitution **/
L_534:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	INC  BX
	MOV  Word [lptr], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, mline
	PUSH BX
	MOV  BX, [Word mptr]
	INC  BX
	MOV  Word [mptr], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
	OR   BX, BX
	JNZ  L_535
	JMP  L_536
L_535:
	JMP  L_534
L_536:
;	lptr = 0;
	MOV  BX, +0
	MOV  Word [lptr], BX
;}
	ADD  SP, AutoC476
	POP  BP
	RET

AutoC476	EQU 16
;	k	VAR	INT	-2
;	c	VAR	CHAR	-3
;	sname	ARRAY	CHAR	-16

	  [SECTION .dseg]
L_476	DB "missing quote",0
	DB "missing apostrophe",0
	DB "line too long",0

	  [SECTION .cseg]
;
;addmac()
addmac:
	PUSH BP
	SUB  SP, AutoC537
	MOV  BP, SP

;{
;	char sname[NAMESIZE];
;	int k;
;
;	if (is_identifier(sname) == 0)
	LEA  BX, [AutoC537-13+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_538
	JMP  L_539
L_538:
;		{ /** is_identifier() gets & validates identifier **/
;		illname();
	CALL illname
;		kill();
	CALL kill
;		return;
	ADD  SP, AutoC537
	POP  BP
	RET
;		}
;	k = 0;
L_539:
	LEA  BX, [AutoC537-15+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while	(putmac(sname[k++]));
L_540:
	LEA  BX, [AutoC537-13+BP]
	PUSH BX
	LEA  BX, [AutoC537-15+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL putmac
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_541
	JMP  L_542
L_541:
	JMP  L_540
L_542:
;	while	(inspect_chr() == ' ' | inspect_chr() == 9) g_nxtchr();
L_543:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +32
	POP  DX
	CALL cceq
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +9
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_544
	JMP  L_545
L_544:
	CALL g_nxtchr
	JMP  L_543
L_545:
;	while	(putmac(g_nxtchr()));
L_546:
	CALL g_nxtchr
	PUSH BX
	CALL putmac
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_547
	JMP  L_548
L_547:
	JMP  L_546
L_548:
;	if (macptr >= MAC_MAX) error("macro table full");
	MOV  BX, [Word macptr]
	PUSH BX
	MOV  BX, +2176
	PUSH BX
	MOV  BX, +1
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DX
	CALL ccge
	OR   BX, BX
	JNZ  L_549
	JMP  L_550
L_549:
	MOV  BX, L_537+0
	PUSH BX
	CALL error
	ADD  SP, +2
;	}
L_550:
	ADD  SP, AutoC537
	POP  BP
	RET

AutoC537	EQU 15
;	sname	ARRAY	CHAR	-13
;	k	VAR	INT	-15

	  [SECTION .dseg]
L_537	DB "macro table full",0

	  [SECTION .cseg]
;
;putmac(c) char c;
putmac:
	PUSH BP
	SUB  SP, AutoC551
	MOV  BP, SP

;{
;	macq[macptr] = c;
	MOV  BX, macq
	PUSH BX
	MOV  BX, [Word macptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC551+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;	if (macptr < MAC_MAX) macptr++;
	MOV  BX, [Word macptr]
	PUSH BX
	MOV  BX, +2176
	PUSH BX
	MOV  BX, +1
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_552
	JMP  L_553
L_552:
	MOV  BX, [Word macptr]
	INC  BX
	MOV  Word [macptr], BX
	DEC  BX
;	return c;
L_553:
	LEA  BX, [AutoC551+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  BP
	RET
;}

AutoC551	EQU 0
;	c	VAR	CHAR	+4
;
;findmac(sname) char *sname;
findmac:
	PUSH BP
	SUB  SP, AutoC554
	MOV  BP, SP

;{
;	int k;
;
;	k = 0;
	LEA  BX, [AutoC554-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while	(k < macptr)
L_555:
	LEA  BX, [AutoC554-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word macptr]
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_556
	JMP  L_557
L_556:
;		{
;		if(astreq(sname,macq+k,NAMEMAX))
	LEA  BX, [AutoC554+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC554-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +12
	PUSH BX
	CALL astreq
	ADD  SP, +6
	OR   BX, BX
	JNZ  L_558
	JMP  L_559
L_558:
;			{
;			while	(macq[k++]);
L_560:
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC554-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_561
	JMP  L_562
L_561:
	JMP  L_560
L_562:
;			return k;
	LEA  BX, [AutoC554-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC554
	POP  BP
	RET
;			}
;		while	(macq[k++]);
L_559:
L_563:
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC554-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_564
	JMP  L_565
L_564:
	JMP  L_563
L_565:
;		while	(macq[k++]);
L_566:
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC554-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_567
	JMP  L_568
L_567:
	JMP  L_566
L_568:
;		}
	JMP  L_555
L_557:
;	return 0;
	MOV  BX, +0
	ADD  SP, AutoC554
	POP  BP
	RET
;}

AutoC554	EQU 2
;	sname	PTR	CHAR	+4
;	k	VAR	INT	-2
;
;/* direct output to console		gtf 7/16/80 */
;toconsole()
toconsole:
	PUSH BP
	SUB  SP, AutoC569
	MOV  BP, SP

;{
;	saveout = fp_output;
	MOV  BX, [Word fp_output]
	MOV  Word [saveout], BX
;	fp_output = 0;
	MOV  BX, +0
	MOV  Word [fp_output], BX
;}  /* end toconsole */
	POP  BP
	RET

AutoC569	EQU 0
;
;/* direct output back to file		gtf 7/16/80 */
;tofile()
tofile:
	PUSH BP
	SUB  SP, AutoC570
	MOV  BP, SP

;{
;	if(saveout) fp_output = saveout;
	MOV  BX, [Word saveout]
	OR   BX, BX
	JNZ  L_571
	JMP  L_572
L_571:
	MOV  BX, [Word saveout]
	MOV  Word [fp_output], BX
;	saveout = 0;
L_572:
	MOV  BX, +0
	MOV  Word [saveout], BX
;}  /* end tofile */
	POP  BP
	RET

AutoC570	EQU 0
;
;outbyte(c) char c;	/** FILE output **/
outbyte:
	PUSH BP
	SUB  SP, AutoC573
	MOV  BP, SP

;{
;	if (c == 0) return 0;
	LEA  BX, [AutoC573+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_574
	JMP  L_575
L_574:
	MOV  BX, +0
	POP  BP
	RET
;	if (fp_output)
L_575:
	MOV  BX, [Word fp_output]
	OR   BX, BX
	JNZ  L_576
	JMP  L_577
L_576:
;		{	/** put to file, output **/
;		if ((putc(c,fp_output)) <= 0)
	LEA  BX, [AutoC573+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, [Word fp_output]
	PUSH BX
	CALL putc
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccle
	OR   BX, BX
	JNZ  L_578
	JMP  L_579
L_578:
;			{
;			closeout();
	CALL closeout
;			error("Output file error");
	MOV  BX, L_573+0
	PUSH BX
	CALL error
	ADD  SP, +2
;			abort();		/* gtf 7/17/80 */
	CALL abort
;			}
;		}
L_579:
;	else putchar(c);
	JMP  L_580
L_577:
	LEA  BX, [AutoC573+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL putchar
	ADD  SP, +2
L_580:
;	return c;
	LEA  BX, [AutoC573+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  BP
	RET
;}

AutoC573	EQU 0
;	c	VAR	CHAR	+4

	  [SECTION .dseg]
L_573	DB "Output file error",0

	  [SECTION .cseg]
;
;outstr(ptr) char ptr[];
outstr:
	PUSH BP
	SUB  SP, AutoC581
	MOV  BP, SP

; {
;	int k;
;	k = 0;
	LEA  BX, [AutoC581-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (outbyte(ptr[k++]));
L_582:
	LEA  BX, [AutoC581+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC581-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL outbyte
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_583
	JMP  L_584
L_583:
	JMP  L_582
L_584:
; }
	ADD  SP, AutoC581
	POP  BP
	RET

AutoC581	EQU 2
;	ptr	PTR	CHAR	+4
;	k	VAR	INT	-2
;
;/* write text destined for the assembler to read */
;/* (i.e. stuff not in comments)			*/
;/*  gtf  6/26/80 */
;
;outasm(ptr) char *ptr;
outasm:
	PUSH BP
	SUB  SP, AutoC585
	MOV  BP, SP

;{
;/**	while(outbyte(toupperi(*ptr++))); **/
;	while	(outbyte(*ptr++));  /** don't UC quoted str **/
L_586:
	LEA  BX, [AutoC585+4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL outbyte
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_587
	JMP  L_588
L_587:
	JMP  L_586
L_588:
;}  /* end outasm */
	POP  BP
	RET

AutoC585	EQU 0
;	ptr	PTR	CHAR	+4
;
;nl()	{ outbyte(EOL); }
nl:
	PUSH BP
	SUB  SP, AutoC589
	MOV  BP, SP

	MOV  BX, +10
	PUSH BX
	CALL outbyte
	ADD  SP, +2
	POP  BP
	RET

AutoC589	EQU 0
;tab()	{ outbyte(9); }
tab:
	PUSH BP
	SUB  SP, AutoC590
	MOV  BP, SP

	MOV  BX, +9
	PUSH BX
	CALL outbyte
	ADD  SP, +2
	POP  BP
	RET

AutoC590	EQU 0
;colon() { outbyte(58); }
colon:
	PUSH BP
	SUB  SP, AutoC591
	MOV  BP, SP

	MOV  BX, +58
	PUSH BX
	CALL outbyte
	ADD  SP, +2
	POP  BP
	RET

AutoC591	EQU 0
;bell()  { outbyte(7); }	/* gtf 7/16/80 */
bell:
	PUSH BP
	SUB  SP, AutoC592
	MOV  BP, SP

	MOV  BX, +7
	PUSH BX
	CALL outbyte
	ADD  SP, +2
	POP  BP
	RET

AutoC592	EQU 0
;
;/** Error Notification **/
;
;error(ptr) char ptr[];
error:
	PUSH BP
	SUB  SP, AutoC593
	MOV  BP, SP

;{
;	int k;
;	char junk[81];
;
;	toconsole();
	CALL toconsole
;	bell();
	CALL bell
;	outstr("Line "); outdec(lineno); outstr(", ");
	MOV  BX, L_593+0
	PUSH BX
	CALL outstr
	ADD  SP, +2
	MOV  BX, [Word lineno]
	PUSH BX
	CALL outdec
	ADD  SP, +2
	MOV  BX, L_593+6
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	if (infunc == 0)
	MOV  BX, [Word infunc]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_594
	JMP  L_595
L_594:
;		outbyte('(');
	MOV  BX, +40
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;	if (currfn == NULL)
L_595:
	MOV  BX, [Word currfn]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_596
	JMP  L_597
L_596:
;		outstr("start of file");
	MOV  BX, L_593+9
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	else	outstr(currfn + NAME);
	JMP  L_598
L_597:
	MOV  BX, [Word currfn]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL outstr
	ADD  SP, +2
L_598:
;	if (infunc == 0)
	MOV  BX, [Word infunc]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_599
	JMP  L_600
L_599:
;		outbyte(')');
	MOV  BX, +41
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;	outdec(lineno-fnstart);
L_600:
	MOV  BX, [Word lineno]
	PUSH BX
	MOV  BX, [Word fnstart]
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	PUSH BX
	CALL outdec
	ADD  SP, +2
;	outstr(": ");  outstr(ptr);  nl();
	MOV  BX, L_593+23
	PUSH BX
	CALL outstr
	ADD  SP, +2
	LEA  BX, [AutoC593+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outstr
	ADD  SP, +2
	CALL nl
;
;	outstr(line); nl();
	MOV  BX, line
	PUSH BX
	CALL outstr
	ADD  SP, +2
	CALL nl
;
;	k = 0;	/* skip to error position */
	LEA  BX, [AutoC593-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while	(k < lptr)
L_601:
	LEA  BX, [AutoC593-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_602
	JMP  L_603
L_602:
;		{
;		if (line[k++] == 9) tab();
	MOV  BX, line
	PUSH BX
	LEA  BX, [AutoC593-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +9
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_604
	JMP  L_605
L_604:
	CALL tab
;		else	outbyte(' ');
	JMP  L_606
L_605:
	MOV  BX, +32
	PUSH BX
	CALL outbyte
	ADD  SP, +2
L_606:
;		}
	JMP  L_601
L_603:
;	outbyte('^');  nl();
	MOV  BX, +94
	PUSH BX
	CALL outbyte
	ADD  SP, +2
	CALL nl
;	++errcnt;
	MOV  BX, [Word errcnt]
	INC  BX
	MOV  Word [errcnt], BX
;
;	if (errstop)
	MOV  BX, [Word errstop]
	OR   BX, BX
	JNZ  L_607
	JMP  L_608
L_607:
;		{
;		pl("Continue (Y,n,g) ? ");
	MOV  BX, L_593+26
	PUSH BX
	CALL pl
	ADD  SP, +2
;		gets(junk);		
	LEA  BX, [AutoC593-83+BP]
	PUSH BX
	CALL gets
	ADD  SP, +2
;		k = junk[0];
	LEA  BX, [AutoC593-2+BP]
	PUSH BX
	LEA  BX, [AutoC593-83+BP]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;		if ((k == 'N') | (k == 'n')) abort();
	LEA  BX, [AutoC593-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +78
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC593-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +110
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_609
	JMP  L_610
L_609:
	CALL abort
;		if ((k == 'G') | (k == 'g')) errstop = 0;
L_610:
	LEA  BX, [AutoC593-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +71
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC593-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +103
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_611
	JMP  L_612
L_611:
	MOV  BX, +0
	MOV  Word [errstop], BX
;		}
L_612:
;	tofile();
L_608:
	CALL tofile
;}	/* end error */
	ADD  SP, AutoC593
	POP  BP
	RET

AutoC593	EQU 83
;	ptr	PTR	CHAR	+4
;	k	VAR	INT	-2
;	junk	ARRAY	CHAR	-83

	  [SECTION .dseg]
L_593	DB "Line ",0
	DB ", ",0
	DB "start of file",0
	DB ": ",0
	DB "Continue (Y,n,g) ? ",0

	  [SECTION .cseg]
;
;ol(ptr) char ptr[];
ol:
	PUSH BP
	SUB  SP, AutoC613
	MOV  BP, SP

;{
;	ot(ptr);
	LEA  BX, [AutoC613+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL ot
	ADD  SP, +2
;	nl();
	CALL nl
;}
	POP  BP
	RET

AutoC613	EQU 0
;	ptr	PTR	CHAR	+4
;
;ot(ptr) char ptr[];
ot:
	PUSH BP
	SUB  SP, AutoC614
	MOV  BP, SP

;{
;	tab();
	CALL tab
;	outasm(ptr);
	LEA  BX, [AutoC614+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outasm
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC614	EQU 0
;	ptr	PTR	CHAR	+4
;
;/** returns zero if no match, otherwise > 0 = str length. **/
;/** str2 is null terminated, which is the limit of comparing. **/
;/** in effect, str2 is contained in str1. **/
;
;streq(str1,str2) char str1[],str2[];
streq:
	PUSH BP
	SUB  SP, AutoC615
	MOV  BP, SP

; {
;	int k;
;
;	k = 0;
	LEA  BX, [AutoC615-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (str2[k])
L_616:
	LEA  BX, [AutoC615+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC615-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_617
	JMP  L_618
L_617:
;		{
;		if ((str1[k]) != (str2[k])) return 0;
	LEA  BX, [AutoC615+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC615-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	LEA  BX, [AutoC615+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC615-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_619
	JMP  L_620
L_619:
	MOV  BX, +0
	ADD  SP, AutoC615
	POP  BP
	RET
;		k++;
L_620:
	LEA  BX, [AutoC615-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		}
	JMP  L_616
L_618:
;	return k;
	LEA  BX, [AutoC615-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC615
	POP  BP
	RET
; }

AutoC615	EQU 2
;	str1	PTR	CHAR	+6
;	str2	PTR	CHAR	+4
;	k	VAR	INT	-2
;
; /** alphanumeric string match, 0 is mismatch, else len **/
;astreq(str1,str2,len) char str1[],str2[]; int len;
astreq:
	PUSH BP
	SUB  SP, AutoC621
	MOV  BP, SP

; {
;	int k;
;	k = 0;
	LEA  BX, [AutoC621-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (k < len)
L_622:
	LEA  BX, [AutoC621-2+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC621+4+BP]
	MOV  BX, [BX]
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_623
	JMP  L_624
L_623:
;		{
;		if ((str1[k]) != (str2[k])) break;
	LEA  BX, [AutoC621+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC621-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	LEA  BX, [AutoC621+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC621-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_625
	JMP  L_626
L_625:
	JMP  L_624
;		if (str1[k] == 0) break;
L_626:
	LEA  BX, [AutoC621+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC621-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_627
	JMP  L_628
L_627:
	JMP  L_624
;		if (str2[k] == 0) break;
L_628:
	LEA  BX, [AutoC621+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC621-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_629
	JMP  L_630
L_629:
	JMP  L_624
;		k++;
L_630:
	LEA  BX, [AutoC621-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		}
	JMP  L_622
L_624:
;	if (an(str1[k])) return 0; /** mismatch before eos **/
	LEA  BX, [AutoC621+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC621-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_631
	JMP  L_632
L_631:
	MOV  BX, +0
	ADD  SP, AutoC621
	POP  BP
	RET
;	if (an(str2[k])) return 0; /** mismatch before eos **/
L_632:
	LEA  BX, [AutoC621+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC621-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_633
	JMP  L_634
L_633:
	MOV  BX, +0
	ADD  SP, AutoC621
	POP  BP
	RET
;	return k;
L_634:
	LEA  BX, [AutoC621-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC621
	POP  BP
	RET
; }

AutoC621	EQU 2
;	str1	PTR	CHAR	+8
;	str2	PTR	CHAR	+6
;	len	VAR	INT	+4
;	k	VAR	INT	-2
;
;match(lit) char *lit;
match:
	PUSH BP
	SUB  SP, AutoC635
	MOV  BP, SP

;{
;	int k;
;	deblank();
	CALL deblank
;	if (k = streq(line + lptr,lit))
	LEA  BX, [AutoC635-2+BP]
	PUSH BX
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC635+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL streq
	ADD  SP, +4
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_636
	JMP  L_637
L_636:
;		{ /** lit is null terminated, eos, for compare **/
;		lptr = lptr + k;
	MOV  BX, [Word lptr]
	PUSH BX
	LEA  BX, [AutoC635-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  Word [lptr], BX
;		return 1;
	MOV  BX, +1
	ADD  SP, AutoC635
	POP  BP
	RET
;		}
; 	return 0;
L_637:
	MOV  BX, +0
	ADD  SP, AutoC635
	POP  BP
	RET
;}

AutoC635	EQU 2
;	lit	PTR	CHAR	+4
;	k	VAR	INT	-2
;
;amatch(lit,len) char *lit; int len;
amatch:
	PUSH BP
	SUB  SP, AutoC638
	MOV  BP, SP

; {
;	int k;
;	deblank();
	CALL deblank
;	if (k = astreq(line + lptr,lit,len))
	LEA  BX, [AutoC638-2+BP]
	PUSH BX
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC638+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC638+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL astreq
	ADD  SP, +6
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_639
	JMP  L_640
L_639:
;		{
;		lptr = lptr + k;
	MOV  BX, [Word lptr]
	PUSH BX
	LEA  BX, [AutoC638-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  Word [lptr], BX
;		while	(an(inspect_chr())) scan_nxt();
L_641:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_642
	JMP  L_643
L_642:
	CALL scan_nxt
	JMP  L_641
L_643:
;		return 1;
	MOV  BX, +1
	ADD  SP, AutoC638
	POP  BP
	RET
;		}
;	return 0;
L_640:
	MOV  BX, +0
	ADD  SP, AutoC638
	POP  BP
	RET
; }

AutoC638	EQU 2
;	lit	PTR	CHAR	+6
;	len	VAR	INT	+4
;	k	VAR	INT	-2
;
;/* Note: added filter of CR for filesystems where NL is CR,LF.
;** The parsing strategy is to make each \n into a null, so
;** each line is a null terminated string.  This routine scans
;** thru the line buffer removing leading space, tab, CR, and
;** requests new string if a null is inlined.
;*/
;deblank()
deblank:
	PUSH BP
	SUB  SP, AutoC644
	MOV  BP, SP

;{
;	while	(1)
L_645:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_646
	JMP  L_647
L_646:
;		{
;		while	(inspect_chr()==0)
L_648:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_649
	JMP  L_650
L_649:
;			{
;			inline();
	CALL inline
;			preprocess();  /** calls inline, so? **/
	CALL preprocess
;			if (eof_flg) break;
	MOV  BX, [Word eof_flg]
	OR   BX, BX
	JNZ  L_651
	JMP  L_652
L_651:
	JMP  L_650
;			}
L_652:
	JMP  L_648
L_650:
;		if (inspect_chr() == ' ') g_nxtchr();
	CALL inspect_chr
	PUSH BX
	MOV  BX, +32
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_653
	JMP  L_654
L_653:
	CALL g_nxtchr
;		else if (inspect_chr() == 9) g_nxtchr();
	JMP  L_655
L_654:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +9
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_656
	JMP  L_657
L_656:
	CALL g_nxtchr
;		else if (inspect_chr() == CR) g_nxtchr();
	JMP  L_658
L_657:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +13
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_659
	JMP  L_660
L_659:
	CALL g_nxtchr
;		else return;
	JMP  L_661
L_660:
	POP  BP
	RET
L_661:
L_658:
L_655:
;		}
	JMP  L_645
L_647:
;}
	POP  BP
	RET

AutoC644	EQU 0
;
;/* Output a signed number to the ASM file. */
;
;outdec(number) int number;
outdec:
	PUSH BP
	SUB  SP, AutoC662
	MOV  BP, SP

; {
;	int k, zs;
;	char c;
;
;	zs = 0;
	LEA  BX, [AutoC662-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	k = 10000;
	LEA  BX, [AutoC662-2+BP]
	PUSH BX
	MOV  BX, +10000
	POP  DI
	MOV  Word [DI], BX
;	if (number<0)
	LEA  BX, [AutoC662+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_663
	JMP  L_664
L_663:
;		{number=(-number);
	LEA  BX, [AutoC662+4+BP]
	PUSH BX
	LEA  BX, [AutoC662+4+BP]
	MOV  BX, [BX]
	NEG  BX
	POP  DI
	MOV  Word [DI], BX
;		outbyte('-');
	MOV  BX, +45
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;		}
;	else
	JMP  L_665
L_664:
;		outbyte('+');
	MOV  BX, +43
	PUSH BX
	CALL outbyte
	ADD  SP, +2
L_665:
;	while (k>=1)
L_666:
	LEA  BX, [AutoC662-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL ccge
	OR   BX, BX
	JNZ  L_667
	JMP  L_668
L_667:
;		{
;		c=number/k + '0';
	LEA  BX, [AutoC662-5+BP]
	PUSH BX
	LEA  BX, [AutoC662+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC662-2+BP]
	MOV  BX, [BX]
	POP  DX
	MOV  AX, DX
	CWD
	DIV  BX
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Byte [DI], BL
;		if ((c!='0')|(k==1)|(zs))
	LEA  BX, [AutoC662-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	CALL ccne
	PUSH BX
	LEA  BX, [AutoC662-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	PUSH BX
	LEA  BX, [AutoC662-4+BP]
	MOV  BX, [BX]
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_669
	JMP  L_670
L_669:
;			{zs=1;outbyte(c);}
	LEA  BX, [AutoC662-4+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
	LEA  BX, [AutoC662-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;		number=number%k;
L_670:
	LEA  BX, [AutoC662+4+BP]
	PUSH BX
	LEA  BX, [AutoC662+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC662-2+BP]
	MOV  BX, [BX]
	POP  DX
	MOV  AX, DX
	CWD
	DIV  BX
	MOV  BX, AX
	XCHG BX, DX
	POP  DI
	MOV  Word [DI], BX
;		k=k/10;
	LEA  BX, [AutoC662-2+BP]
	PUSH BX
	LEA  BX, [AutoC662-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +10
	POP  DX
	MOV  AX, DX
	CWD
	DIV  BX
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;		}
	JMP  L_666
L_668:
; }
	ADD  SP, AutoC662
	POP  BP
	RET

AutoC662	EQU 5
;	number	VAR	INT	+4
;	k	VAR	INT	-2
;	zs	VAR	INT	-4
;	c	VAR	CHAR	-5
;
;
;/* Output an unsigned number to ASM file. */
;
;outudec(number) int number;
outudec:
	PUSH BP
	SUB  SP, AutoC671
	MOV  BP, SP

;{
;	int k,zs;
;	char c;
;
;	zs = 0;
	LEA  BX, [AutoC671-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	k = 10000;
	LEA  BX, [AutoC671-2+BP]
	PUSH BX
	MOV  BX, +10000
	POP  DI
	MOV  Word [DI], BX
;	if (number<0)
	LEA  BX, [AutoC671+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_672
	JMP  L_673
L_672:
;		number = (-number);
	LEA  BX, [AutoC671+4+BP]
	PUSH BX
	LEA  BX, [AutoC671+4+BP]
	MOV  BX, [BX]
	NEG  BX
	POP  DI
	MOV  Word [DI], BX
;	while (k >= 1)
L_673:
L_674:
	LEA  BX, [AutoC671-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL ccge
	OR   BX, BX
	JNZ  L_675
	JMP  L_676
L_675:
;		{
;		c = number / k + '0';
	LEA  BX, [AutoC671-5+BP]
	PUSH BX
	LEA  BX, [AutoC671+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC671-2+BP]
	MOV  BX, [BX]
	POP  DX
	MOV  AX, DX
	CWD
	DIV  BX
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Byte [DI], BL
;		if ((c != '0') | (k == 1) | (zs))
	LEA  BX, [AutoC671-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	CALL ccne
	PUSH BX
	LEA  BX, [AutoC671-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	PUSH BX
	LEA  BX, [AutoC671-4+BP]
	MOV  BX, [BX]
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_677
	JMP  L_678
L_677:
;			{
;			zs = 1;
	LEA  BX, [AutoC671-4+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;			outbyte(c);
	LEA  BX, [AutoC671-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;			}
;		number = number % k;
L_678:
	LEA  BX, [AutoC671+4+BP]
	PUSH BX
	LEA  BX, [AutoC671+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC671-2+BP]
	MOV  BX, [BX]
	POP  DX
	MOV  AX, DX
	CWD
	DIV  BX
	MOV  BX, AX
	XCHG BX, DX
	POP  DI
	MOV  Word [DI], BX
;		k = k / 10;
	LEA  BX, [AutoC671-2+BP]
	PUSH BX
	LEA  BX, [AutoC671-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +10
	POP  DX
	MOV  AX, DX
	CWD
	DIV  BX
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;		}
	JMP  L_674
L_676:
;}		/** eo outudec **/
	ADD  SP, AutoC671
	POP  BP
	RET

AutoC671	EQU 5
;	number	VAR	INT	+4
;	k	VAR	INT	-2
;	zs	VAR	INT	-4
;	c	VAR	CHAR	-5
;
;
;/* return the length of a string */
;/* gtf 4/8/80 */
;
;strlen(s) char *s;
strlen:
	PUSH BP
	SUB  SP, AutoC679
	MOV  BP, SP

;{
;	char *t;
;
;	t = s;
	LEA  BX, [AutoC679-2+BP]
	PUSH BX
	LEA  BX, [AutoC679+4+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	while (*s) s++;
L_680:
	LEA  BX, [AutoC679+4+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_681
	JMP  L_682
L_681:
	LEA  BX, [AutoC679+4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	JMP  L_680
L_682:
;	return(s-t);
	LEA  BX, [AutoC679+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC679-2+BP]
	MOV  BX, [BX]
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	ADD  SP, AutoC679
	POP  BP
	RET
;}	/* end strlen */

AutoC679	EQU 2
;	s	PTR	CHAR	+4
;	t	PTR	CHAR	-2
;
;/* convert lower case to upper */
;/* gtf 6/26/80 */
;/** chgd from raise() -> toupperi() - i for internal fn **/
;
;toupperi(c) char c;
toupperi:
	PUSH BP
	SUB  SP, AutoC683
	MOV  BP, SP

;{
;	if ((c >= 'a') & (c <= 'z'))
	LEA  BX, [AutoC683+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +97
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC683+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +122
	POP  DX
	CALL ccle
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_684
	JMP  L_685
L_684:
;		c = c - 'a' + 'A';
	LEA  BX, [AutoC683+4+BP]
	PUSH BX
	LEA  BX, [AutoC683+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +97
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	PUSH BX
	MOV  BX, +65
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Byte [DI], BL
;	return(c);
L_685:
	LEA  BX, [AutoC683+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  BP
	RET
;}	/* end toupperi */

AutoC683	EQU 0
;	c	VAR	CHAR	+4
;
;/** EO C86N-4.C **/
;
;/*	>>>>>>> start of cc5 <<<<<<<	*/
;/** higher precedence operators are acted on first, **/
;/** tho the flow control enters at the lowest precedence, **/
;/** the lower precedence is acted on upon return from **/
;/** higher precedence ascent. **/
;
;	/* - 3 element evaluation array of ints -
;	** eval[0] = Symbol table address, else 0 for constant
;	** eval[1] = type indirect object to fetch, else 0 for
;        	     static object (const.)
;	** eval[2] = type pointer or array, else 0
;	*/
;
;/** expression(Y..N) loop if comma operator is allowed in expr **/
;/** comma is lowest precedence operator in C and acted on last **/
;/** comma, precedence level 15 **/
;/** vers_2 expression for comma'd expression **/
;/** caller- expr2(NO); or expr2(YES); for comma'd expr. **/
;/** identifiers with sa_ or _sa are codegen functions, i.e., **/
;/** syntactic actions to output backend code, generically **/
;/** patterned after stack machine operations. **/
;
;expression(comma) int comma;
expression:
	PUSH BP
	SUB  SP, AutoC686
	MOV  BP, SP

;{  /** precedence level 15 **/
;	int eval[3];
;
;/** was: if (heir1(eval))  rq_val_sa(eval); **/
;	do {
L_687:
;	if (heir1(eval))  rq_val_sa(eval);
	LEA  BX, [AutoC686-6+BP]
	PUSH BX
	CALL heir1
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_691
	JMP  L_692
L_691:
	LEA  BX, [AutoC686-6+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	if (comma == 0)  return;
L_692:
	LEA  BX, [AutoC686+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_693
	JMP  L_694
L_693:
	ADD  SP, AutoC686
	POP  BP
	RET
;	} while (match(","));
L_694:
L_688:
	MOV  BX, L_686+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_689
	JMP  L_690
L_689:
	JMP  L_687
L_690:
;}
	ADD  SP, AutoC686
	POP  BP
	RET

AutoC686	EQU 6
;	comma	VAR	INT	+4
;	eval	ARRAY	INT	-6

	  [SECTION .dseg]
L_686	DB ",",0

	  [SECTION .cseg]
;
;/** assignments, precedence level 14 **/
;/** {=} of {=,+=,-=,/=,*=,%=,<<=,>>=,&=,^=,|=} **/
;
;heir1(eval) int eval[];
heir1:
	PUSH BP
	SUB  SP, AutoC695
	MOV  BP, SP

;{
;	int k, eval2[3];
;
;	k = heir1a(eval); /** link to heir2->heir1a here **/
	LEA  BX, [AutoC695-2+BP]
	PUSH BX
	LEA  BX, [AutoC695+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir1a
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	if (match("="))
	MOV  BX, L_695+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_696
	JMP  L_697
L_696:
;		{
;		if (k == 0)
	LEA  BX, [AutoC695-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_698
	JMP  L_699
L_698:
;			{
;			needlval();
	CALL needlval
;			return 0;
	MOV  BX, +0
	ADD  SP, AutoC695
	POP  BP
	RET
;			}
;		if (eval[1])  sa_push();  /** syntatic action **/
L_699:
	LEA  BX, [AutoC695+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_700
	JMP  L_701
L_700:
	CALL sa_push
;		if (heir1(eval2))  rq_val_sa(eval2);
L_701:
	LEA  BX, [AutoC695-8+BP]
	PUSH BX
	CALL heir1
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_702
	JMP  L_703
L_702:
	LEA  BX, [AutoC695-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;		sa_store(eval);
L_703:
	LEA  BX, [AutoC695+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_store
	ADD  SP, +2
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC695
	POP  BP
	RET
;		}
;	else return k;
	JMP  L_704
L_697:
	LEA  BX, [AutoC695-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC695
	POP  BP
	RET
L_704:
;}
	ADD  SP, AutoC695
	POP  BP
	RET

AutoC695	EQU 8
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8

	  [SECTION .dseg]
L_695	DB "=",0

	  [SECTION .cseg]
;
;/*** install levels 13 (?:), 12 (||), 11 (&&) here ***/
;
;/** (?:), precedence level 13 **/
;/** conditional operator, ternary, takes three expressions **/
;/** cond_expr ::= expr ? expr : expr **/
;
;heir1a (eval) int	eval[];
heir1a:
	PUSH BP
	SUB  SP, AutoC705
	MOV  BP, SP

;{
;	int	k, eval2[3], T_lbl, F_lbl, X_lbl;
;
;	k = heir1b(eval);
	LEA  BX, [AutoC705-2+BP]
	PUSH BX
	LEA  BX, [AutoC705+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir1b
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;	deblank();
	CALL deblank
;
;	if (streq(line+lptr,"?") == 0) return(k);
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_705+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_706
	JMP  L_707
L_706:
	LEA  BX, [AutoC705-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC705
	POP  BP
	RET
;
;	if (k) rq_val_sa(eval);
L_707:
	LEA  BX, [AutoC705-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_708
	JMP  L_709
L_708:
	LEA  BX, [AutoC705+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;
;	while (1)
L_709:
L_710:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_711
	JMP  L_712
L_711:
;		{
;		if (match ("?"))
	MOV  BX, L_705+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_713
	JMP  L_714
L_713:
;			{
;			T_lbl = getlabel();
	LEA  BX, [AutoC705-10+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;			F_lbl = getlabel();
	LEA  BX, [AutoC705-12+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;			X_lbl = getlabel();
	LEA  BX, [AutoC705-14+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;			sa_if_tst(T_lbl,F_lbl);
	LEA  BX, [AutoC705-10+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC705-12+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_if_tst
	ADD  SP, +4
;
;			sa_mk_lbl(T_lbl);
	LEA  BX, [AutoC705-10+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;				/** expression evaluation, higher precedence **/
;			if (heir1b (eval2)) rq_val_sa(eval2);
	LEA  BX, [AutoC705-8+BP]
	PUSH BX
	CALL heir1b
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_715
	JMP  L_716
L_715:
	LEA  BX, [AutoC705-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;
;			sa_jump(X_lbl);
L_716:
	LEA  BX, [AutoC705-14+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_jump
	ADD  SP, +2
;
;			deblank();
	CALL deblank
;
;			if (match (":") == 0)
	MOV  BX, L_705+4
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_717
	JMP  L_718
L_717:
;				{
;				error ("missing colon");
	MOV  BX, L_705+6
	PUSH BX
	CALL error
	ADD  SP, +2
;				return (0);
	MOV  BX, +0
	ADD  SP, AutoC705
	POP  BP
	RET
;				}
;		/** colon matched, do expr3 **/
;			sa_mk_lbl(F_lbl);
L_718:
	LEA  BX, [AutoC705-12+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;				/** expression evaluation, higher precedence **/
;			if (heir1b (eval2)) rq_val_sa(eval2);
	LEA  BX, [AutoC705-8+BP]
	PUSH BX
	CALL heir1b
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_719
	JMP  L_720
L_719:
	LEA  BX, [AutoC705-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;
;
;			sa_mk_lbl(X_lbl);
L_720:
	LEA  BX, [AutoC705-14+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;			}
;		else	return (0);
	JMP  L_721
L_714:
	MOV  BX, +0
	ADD  SP, AutoC705
	POP  BP
	RET
L_721:
;		}
	JMP  L_710
L_712:
;}
	ADD  SP, AutoC705
	POP  BP
	RET

AutoC705	EQU 14
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8
;	T_lbl	VAR	INT	-10
;	F_lbl	VAR	INT	-12
;	X_lbl	VAR	INT	-14

	  [SECTION .dseg]
L_705	DB "?",0
	DB "?",0
	DB ":",0
	DB "missing colon",0

	  [SECTION .cseg]
;
;
;/** (||), precedence level 12 - either, both, true yields true. **/
;
;heir1b (eval) int eval[];
heir1b:
	PUSH BP
	SUB  SP, AutoC722
	MOV  BP, SP

;{
;	int k, eval2[3], t_lbl, flab1;
;
;	k = heir1c(eval);
	LEA  BX, [AutoC722-2+BP]
	PUSH BX
	LEA  BX, [AutoC722+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir1c
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if (streq(line+lptr,"||") == 0) return(k);
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_722+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_723
	JMP  L_724
L_723:
	LEA  BX, [AutoC722-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC722
	POP  BP
	RET
;
;	if (k) rq_val_sa(eval);
L_724:
	LEA  BX, [AutoC722-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_725
	JMP  L_726
L_725:
	LEA  BX, [AutoC722+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;
;	while (1)
L_726:
L_727:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_728
	JMP  L_729
L_728:
;		if (match ("||"))
	MOV  BX, L_722+3
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_730
	JMP  L_731
L_730:
;			{
;			sa_mk_bool();	/** prim reg -> bool **/
	CALL sa_mk_bool
;			sa_push();
	CALL sa_push
;				/** expression evaluation, higher precedence **/
;			if (heir1c (eval2)) rq_val_sa(eval2);
	LEA  BX, [AutoC722-8+BP]
	PUSH BX
	CALL heir1c
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_732
	JMP  L_733
L_732:
	LEA  BX, [AutoC722-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;
;			sa_mk_bool();	/** prim reg -> bool **/
L_733:
	CALL sa_mk_bool
;			sa_pop();  /* Pop into the secondary register */
	CALL sa_pop
;			sa_or();
	CALL sa_or
;			}
;		else	return (0);
	JMP  L_734
L_731:
	MOV  BX, +0
	ADD  SP, AutoC722
	POP  BP
	RET
L_734:
	JMP  L_727
L_729:
;}
	ADD  SP, AutoC722
	POP  BP
	RET

AutoC722	EQU 12
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8
;	t_lbl	VAR	INT	-10
;	flab1	VAR	INT	-12

	  [SECTION .dseg]
L_722	DB "||",0
	DB "||",0

	  [SECTION .cseg]
;
;/** (&&), precedence level 11 - both true yields true **/
;
;heir1c (eval) int eval[];
heir1c:
	PUSH BP
	SUB  SP, AutoC735
	MOV  BP, SP

;{
;	int k, eval2[3], t_lbl, flab1;
;
;	k = heir2(eval);
	LEA  BX, [AutoC735-2+BP]
	PUSH BX
	LEA  BX, [AutoC735+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir2
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if (streq(line+lptr,"&&") == 0) return(k);
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_735+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_736
	JMP  L_737
L_736:
	LEA  BX, [AutoC735-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC735
	POP  BP
	RET
;
;	if (k) rq_val_sa(eval);
L_737:
	LEA  BX, [AutoC735-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_738
	JMP  L_739
L_738:
	LEA  BX, [AutoC735+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;
;	while (1)
L_739:
L_740:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_741
	JMP  L_742
L_741:
;		if (match ("&&"))
	MOV  BX, L_735+3
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_743
	JMP  L_744
L_743:
;			{
;			sa_mk_bool();	/** prim reg -> bool **/
	CALL sa_mk_bool
;			sa_push();
	CALL sa_push
;				/** expression evaluation, higher precedence **/
;			if (heir2 (eval2)) rq_val_sa(eval2);
	LEA  BX, [AutoC735-8+BP]
	PUSH BX
	CALL heir2
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_745
	JMP  L_746
L_745:
	LEA  BX, [AutoC735-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;
;			sa_mk_bool();	/** prim reg -> bool **/
L_746:
	CALL sa_mk_bool
;			sa_pop();  /* Pop into the secondary register */
	CALL sa_pop
;			sa_and();
	CALL sa_and
;			}
;		else	return (0);
	JMP  L_747
L_744:
	MOV  BX, +0
	ADD  SP, AutoC735
	POP  BP
	RET
L_747:
	JMP  L_740
L_742:
;}
	ADD  SP, AutoC735
	POP  BP
	RET

AutoC735	EQU 12
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8
;	t_lbl	VAR	INT	-10
;	flab1	VAR	INT	-12

	  [SECTION .dseg]
L_735	DB "&&",0
	DB "&&",0

	  [SECTION .cseg]
;
;/** bitwise inclusive OR, precedence level 10 **/
;
;heir2(eval) int eval[];
heir2:
	PUSH BP
	SUB  SP, AutoC748
	MOV  BP, SP

;{
;	int k, eval2[3];
;
;	k = heir3(eval);
	LEA  BX, [AutoC748-2+BP]
	PUSH BX
	LEA  BX, [AutoC748+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir3
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if (inspect_chr() != '|') return k;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +124
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_749
	JMP  L_750
L_749:
	LEA  BX, [AutoC748-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC748
	POP  BP
	RET
;
;	/** added '||' ck for heir1b **/
;	if (streq(line+lptr,"||") != 0) return(k);
L_750:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_748+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_751
	JMP  L_752
L_751:
	LEA  BX, [AutoC748-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC748
	POP  BP
	RET
;
;	if (k)  rq_val_sa(eval);
L_752:
	LEA  BX, [AutoC748-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_753
	JMP  L_754
L_753:
	LEA  BX, [AutoC748+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while	(1)
L_754:
L_755:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_756
	JMP  L_757
L_756:
;		{
;		if (match("|"))
	MOV  BX, L_748+3
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_758
	JMP  L_759
L_758:
;			{
;			sa_push();  /** syntatic action **/
	CALL sa_push
;			if (heir3(eval2)) rq_val_sa(eval2);
	LEA  BX, [AutoC748-8+BP]
	PUSH BX
	CALL heir3
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_760
	JMP  L_761
L_760:
	LEA  BX, [AutoC748-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();   /** syntatic action **/
L_761:
	CALL sa_pop
;			sa_or();    /** syntatic action **/
	CALL sa_or
;			}
;		else return 0;
	JMP  L_762
L_759:
	MOV  BX, +0
	ADD  SP, AutoC748
	POP  BP
	RET
L_762:
;		}
	JMP  L_755
L_757:
;}
	ADD  SP, AutoC748
	POP  BP
	RET

AutoC748	EQU 8
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8

	  [SECTION .dseg]
L_748	DB "||",0
	DB "|",0

	  [SECTION .cseg]
;
;/** bitwise exclusive OR, precedence level 9 **/
;
;heir3(eval) int eval[];
heir3:
	PUSH BP
	SUB  SP, AutoC763
	MOV  BP, SP

;{
;	int k, eval2[3];
;
;	k = heir4(eval);
	LEA  BX, [AutoC763-2+BP]
	PUSH BX
	LEA  BX, [AutoC763+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir4
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if (inspect_chr() != '^') return k;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +94
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_764
	JMP  L_765
L_764:
	LEA  BX, [AutoC763-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC763
	POP  BP
	RET
;
;	if (k)  rq_val_sa(eval);
L_765:
	LEA  BX, [AutoC763-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_766
	JMP  L_767
L_766:
	LEA  BX, [AutoC763+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while	(1)
L_767:
L_768:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_769
	JMP  L_770
L_769:
;		{
;		if (match("^"))
	MOV  BX, L_763+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_771
	JMP  L_772
L_771:
;			{
;			sa_push();  /** syntatic action **/
	CALL sa_push
;			if (heir4(eval2)) rq_val_sa(eval2);
	LEA  BX, [AutoC763-8+BP]
	PUSH BX
	CALL heir4
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_773
	JMP  L_774
L_773:
	LEA  BX, [AutoC763-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();   /** syntatic action **/
L_774:
	CALL sa_pop
;			sa_xor();   /** syntatic action **/
	CALL sa_xor
;			}
;		else return 0;
	JMP  L_775
L_772:
	MOV  BX, +0
	ADD  SP, AutoC763
	POP  BP
	RET
L_775:
;		}
	JMP  L_768
L_770:
;}
	ADD  SP, AutoC763
	POP  BP
	RET

AutoC763	EQU 8
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8

	  [SECTION .dseg]
L_763	DB "^",0

	  [SECTION .cseg]
;
;/** bitwise AND, precedence level 8 **/
;
;heir4(eval) int eval[];
heir4:
	PUSH BP
	SUB  SP, AutoC776
	MOV  BP, SP

;{
;	int k, eval2[3];
;
;	k = heir5(eval);
	LEA  BX, [AutoC776-2+BP]
	PUSH BX
	LEA  BX, [AutoC776+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir5
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if (inspect_chr() != '&') return k;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +38
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_777
	JMP  L_778
L_777:
	LEA  BX, [AutoC776-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC776
	POP  BP
	RET
;
;	/** added '&&' ck for heir1c **/
;	if (streq(line+lptr,"&&") != 0) return(k);
L_778:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_776+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_779
	JMP  L_780
L_779:
	LEA  BX, [AutoC776-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC776
	POP  BP
	RET
;
;	if (k) rq_val_sa(eval);
L_780:
	LEA  BX, [AutoC776-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_781
	JMP  L_782
L_781:
	LEA  BX, [AutoC776+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1)
L_782:
L_783:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_784
	JMP  L_785
L_784:
;		{
;		if (match("&"))
	MOV  BX, L_776+3
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_786
	JMP  L_787
L_786:
;			{
;			sa_push();
	CALL sa_push
;			if (heir5(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC776-8+BP]
	PUSH BX
	CALL heir5
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_788
	JMP  L_789
L_788:
	LEA  BX, [AutoC776-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_789:
	CALL sa_pop
;			sa_and();
	CALL sa_and
;			}
;		else return 0;
	JMP  L_790
L_787:
	MOV  BX, +0
	ADD  SP, AutoC776
	POP  BP
	RET
L_790:
;		}
	JMP  L_783
L_785:
;}
	ADD  SP, AutoC776
	POP  BP
	RET

AutoC776	EQU 8
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8

	  [SECTION .dseg]
L_776	DB "&&",0
	DB "&",0

	  [SECTION .cseg]
;
;/** equality operator; (T..F) equivalence, precedence level 7.1 **/
;/** equality operator; not_equal, precedence level 7.2 **/
;
;heir5(eval) int eval[];
heir5:
	PUSH BP
	SUB  SP, AutoC791
	MOV  BP, SP

;{
;	int k, eval2[3];
;
;	k = heir6(eval);
	LEA  BX, [AutoC791-2+BP]
	PUSH BX
	LEA  BX, [AutoC791+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir6
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if ((streq(line+lptr,"==") == 0) &
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_791+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	PUSH BX
;		(streq(line+lptr,"!=") == 0))  return k;
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_791+3
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_792
	JMP  L_793
L_792:
	LEA  BX, [AutoC791-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC791
	POP  BP
	RET
;
;	if (k)  rq_val_sa(eval);
L_793:
	LEA  BX, [AutoC791-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_794
	JMP  L_795
L_794:
	LEA  BX, [AutoC791+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1)
L_795:
L_796:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_797
	JMP  L_798
L_797:
;		{
;		if (match("=="))
	MOV  BX, L_791+6
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_799
	JMP  L_800
L_799:
;			{
;			sa_push();
	CALL sa_push
;			if (heir6(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC791-8+BP]
	PUSH BX
	CALL heir6
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_801
	JMP  L_802
L_801:
	LEA  BX, [AutoC791-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_802:
	CALL sa_pop
;			sa_eq();
	CALL sa_eq
;			}
;		else if (match("!="))
	JMP  L_803
L_800:
	MOV  BX, L_791+9
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_804
	JMP  L_805
L_804:
;			{
;			sa_push();
	CALL sa_push
;			if (heir6(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC791-8+BP]
	PUSH BX
	CALL heir6
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_806
	JMP  L_807
L_806:
	LEA  BX, [AutoC791-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_807:
	CALL sa_pop
;			sa_not_equal();
	CALL sa_not_equal
;			}
;		else return 0;
	JMP  L_808
L_805:
	MOV  BX, +0
	ADD  SP, AutoC791
	POP  BP
	RET
L_808:
L_803:
;		}
	JMP  L_796
L_798:
;}
	ADD  SP, AutoC791
	POP  BP
	RET

AutoC791	EQU 8
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8

	  [SECTION .dseg]
L_791	DB "==",0
	DB "!=",0
	DB "==",0
	DB "!=",0

	  [SECTION .cseg]
;
;/** relational operator; less than, <, precedence level 6.1 **/
;/** relational operator; less than or eq, <=, precedence level 6.2 **/
;/** relational operator; greater than or eq, >=, precedence level 6.3 **/
;/** relational operator; greater than, >, precedence level 6.4 **/
;
;heir6(eval) int eval[];
heir6:
	PUSH BP
	SUB  SP, AutoC809
	MOV  BP, SP

;{
;	int k, eval2[3];
;
;	k = heir7(eval);
	LEA  BX, [AutoC809-2+BP]
	PUSH BX
	LEA  BX, [AutoC809+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir7
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if ((streq(line+lptr,"<") == 0) &
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	PUSH BX
;		(streq(line+lptr,">") == 0) &
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+2
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	PUSH BX
;		(streq(line+lptr,"<=") == 0) &
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+4
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	PUSH BX
;		(streq(line+lptr,">=") == 0))  return k;
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+7
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_810
	JMP  L_811
L_810:
	LEA  BX, [AutoC809-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC809
	POP  BP
	RET
;
;	if (streq(line+lptr,">>"))  return k;
L_811:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+10
	PUSH BX
	CALL streq
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_812
	JMP  L_813
L_812:
	LEA  BX, [AutoC809-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC809
	POP  BP
	RET
;	if (streq(line+lptr,"<<"))  return k;
L_813:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+13
	PUSH BX
	CALL streq
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_814
	JMP  L_815
L_814:
	LEA  BX, [AutoC809-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC809
	POP  BP
	RET
;
;	if (k) rq_val_sa(eval);
L_815:
	LEA  BX, [AutoC809-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_816
	JMP  L_817
L_816:
	LEA  BX, [AutoC809+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;
;	while (1)
L_817:
L_818:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_819
	JMP  L_820
L_819:
;		{
;		if (match("<="))
	MOV  BX, L_809+16
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_821
	JMP  L_822
L_821:
;			{
;			sa_push();
	CALL sa_push
;			if (heir7(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	CALL heir7
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_823
	JMP  L_824
L_823:
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_824:
	CALL sa_pop
;			if (eval[2] | eval2[2])
	LEA  BX, [AutoC809+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_825
	JMP  L_826
L_825:
;				{
;				sa_uless_oreq();
	CALL sa_uless_ore
;				continue;
	JMP  L_818
;				}
;			sa_sless_or_eq();
L_826:
	CALL sa_sless_or_
;			}
;		else if (match(">="))
	JMP  L_827
L_822:
	MOV  BX, L_809+19
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_828
	JMP  L_829
L_828:
;			{
;			sa_push();
	CALL sa_push
;			if (heir7(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	CALL heir7
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_830
	JMP  L_831
L_830:
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_831:
	CALL sa_pop
;			if (eval[2] | eval2[2])
	LEA  BX, [AutoC809+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_832
	JMP  L_833
L_832:
;				{
;				sa_uge();
	CALL sa_uge
;				continue;
	JMP  L_818
;				}
;			sa_sge();
L_833:
	CALL sa_sge
;			}
;		else if ((streq(line+lptr,"<")) &
	JMP  L_834
L_829:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+22
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
;				(streq(line+lptr,"<<") == 0))
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+24
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_835
	JMP  L_836
L_835:
;			{
;			scan_nxt();
	CALL scan_nxt
;			sa_push();
	CALL sa_push
;			if (heir7(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	CALL heir7
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_837
	JMP  L_838
L_837:
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_838:
	CALL sa_pop
;			if (eval[2] | eval2[2])
	LEA  BX, [AutoC809+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_839
	JMP  L_840
L_839:
;				{
;				sa_uless_than();
	CALL sa_uless_tha
;				continue;
	JMP  L_818
;				}
;			sa_sless_than();
L_840:
	CALL sa_sless_tha
;			}
;		else if ((streq(line+lptr,">")) &
	JMP  L_841
L_836:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+27
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
;				(streq(line+lptr,">>") == 0))
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_809+29
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_842
	JMP  L_843
L_842:
;			{
;			scan_nxt();
	CALL scan_nxt
;			sa_push();
	CALL sa_push
;			if (heir7(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	CALL heir7
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_844
	JMP  L_845
L_844:
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_845:
	CALL sa_pop
;			if (eval[2] | eval2[2])
	LEA  BX, [AutoC809+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC809-8+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_846
	JMP  L_847
L_846:
;				{
;				sa_ugt();
	CALL sa_ugt
;				continue;
	JMP  L_818
;				}
;			sa_sgreater_than();
L_847:
	CALL sa_sgreater_
;			}
;		else return 0;
	JMP  L_848
L_843:
	MOV  BX, +0
	ADD  SP, AutoC809
	POP  BP
	RET
L_848:
L_841:
L_834:
L_827:
;		}
	JMP  L_818
L_820:
;}
	ADD  SP, AutoC809
	POP  BP
	RET

AutoC809	EQU 8
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8

	  [SECTION .dseg]
L_809	DB "<",0
	DB ">",0
	DB "<=",0
	DB ">=",0
	DB ">>",0
	DB "<<",0
	DB "<=",0
	DB ">=",0
	DB "<",0
	DB "<<",0
	DB ">",0
	DB ">>",0

	  [SECTION .cseg]
;
;/** EO C86N-5.C **/
;
;/*	>>>>>> start of cc6 <<<<<<	*/
;/** shift operator; left shift, <<, precedence level 5.1 **/
;/** shift operator; right shift, >>, precedence level 5.2 **/
; /* Arithmetic left shift the secondary register by the */
; /*  count in the primary. (results in primary) */
;
;heir7(eval) int eval;
heir7:
	PUSH BP
	SUB  SP, AutoC849
	MOV  BP, SP

;{
;	int k, eval2[3];
;
;	k = heir8(eval);
	LEA  BX, [AutoC849-2+BP]
	PUSH BX
	LEA  BX, [AutoC849+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir8
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if ((streq(line+lptr,">>") == 0) &
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_849+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	PUSH BX
;		(streq(line+lptr,"<<") == 0))  return k;
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_849+3
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_850
	JMP  L_851
L_850:
	LEA  BX, [AutoC849-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC849
	POP  BP
	RET
;
;	if (k)  rq_val_sa(eval);
L_851:
	LEA  BX, [AutoC849-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_852
	JMP  L_853
L_852:
	LEA  BX, [AutoC849+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1)
L_853:
L_854:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_855
	JMP  L_856
L_855:
;		{
;		if (match(">>"))
	MOV  BX, L_849+6
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_857
	JMP  L_858
L_857:
;			{
;			sa_push();
	CALL sa_push
;			if (heir8(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC849-8+BP]
	PUSH BX
	CALL heir8
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_859
	JMP  L_860
L_859:
	LEA  BX, [AutoC849-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_860:
	CALL sa_pop
;			sa_asr();
	CALL sa_asr
;			}
;		else if (match("<<"))
	JMP  L_861
L_858:
	MOV  BX, L_849+9
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_862
	JMP  L_863
L_862:
;			{
;			sa_push();
	CALL sa_push
;			if (heir8(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC849-8+BP]
	PUSH BX
	CALL heir8
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_864
	JMP  L_865
L_864:
	LEA  BX, [AutoC849-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_865:
	CALL sa_pop
;			sa_asl();
	CALL sa_asl
;			}
;		else return 0;
	JMP  L_866
L_863:
	MOV  BX, +0
	ADD  SP, AutoC849
	POP  BP
	RET
L_866:
L_861:
;		}
	JMP  L_854
L_856:
;}
	ADD  SP, AutoC849
	POP  BP
	RET

AutoC849	EQU 8
;	eval	VAR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8

	  [SECTION .dseg]
L_849	DB ">>",0
	DB "<<",0
	DB ">>",0
	DB "<<",0

	  [SECTION .cseg]
;
;/** binary arithmetic operator; add, +, precedence level 4.1 **/
;/** binary arithmetic operator; subtract, -, precedence level 4.2 **/
;
;heir8(eval) int eval[];
heir8:
	PUSH BP
	SUB  SP, AutoC867
	MOV  BP, SP

;{
;	int k, eval2[3];
;
;	k = heir9(eval);
	LEA  BX, [AutoC867-2+BP]
	PUSH BX
	LEA  BX, [AutoC867+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir9
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if ((inspect_chr() != '+') & (inspect_chr() != '-'))  return k;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +43
	POP  DX
	CALL ccne
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +45
	POP  DX
	CALL ccne
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_868
	JMP  L_869
L_868:
	LEA  BX, [AutoC867-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC867
	POP  BP
	RET
;
;	if (k)  rq_val_sa(eval);
L_869:
	LEA  BX, [AutoC867-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_870
	JMP  L_871
L_870:
	LEA  BX, [AutoC867+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1)
L_871:
L_872:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_873
	JMP  L_874
L_873:
;		{
;		if (match("+"))
	MOV  BX, L_867+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_875
	JMP  L_876
L_875:
;			{
;			sa_push();
	CALL sa_push
;			if (heir9(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	CALL heir9
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_877
	JMP  L_878
L_877:
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			if (dbltest(eval,eval2))
L_878:
	LEA  BX, [AutoC867+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	CALL dbltest
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_879
	JMP  L_880
L_879:
;				sa_doublereg();
	CALL sa_doublereg
;			sa_pop();
L_880:
	CALL sa_pop
;			if (dbltest(eval2,eval))
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	LEA  BX, [AutoC867+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL dbltest
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_881
	JMP  L_882
L_881:
;				{
;				sa_swap();
	CALL sa_swap
;				sa_doublereg();
	CALL sa_doublereg
;				sa_swap();
	CALL sa_swap
;				}
;			sa_add();
L_882:
	CALL sa_add
;			result(eval,eval2);
	LEA  BX, [AutoC867+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	CALL result
	ADD  SP, +4
;			}
;		else if (match("-"))
	JMP  L_883
L_876:
	MOV  BX, L_867+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_884
	JMP  L_885
L_884:
;			{
;			sa_push();
	CALL sa_push
;			if (heir9(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	CALL heir9
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_886
	JMP  L_887
L_886:
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			if (dbltest(eval,eval2)) sa_doublereg();
L_887:
	LEA  BX, [AutoC867+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	CALL dbltest
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_888
	JMP  L_889
L_888:
	CALL sa_doublereg
;			sa_pop();
L_889:
	CALL sa_pop
;
;			if (dbltest(eval2,eval))
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	LEA  BX, [AutoC867+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL dbltest
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_890
	JMP  L_891
L_890:
;				{
;				sa_swap();
	CALL sa_swap
;				sa_doublereg();
	CALL sa_doublereg
;				sa_swap();
	CALL sa_swap
;				}
;			sa_sub();
L_891:
	CALL sa_sub
;			if ((eval[2] == CINT) & (eval2[2] == CINT))
	LEA  BX, [AutoC867+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_892
	JMP  L_893
L_892:
;				{
;				sa_swap();
	CALL sa_swap
;				sa_immed();
	CALL sa_immed
;				ol("1");
	MOV  BX, L_867+4
	PUSH BX
	CALL ol
	ADD  SP, +2
;				sa_asr();  /** div by 2 **/
	CALL sa_asr
;				}
;			result(eval,eval2);
L_893:
	LEA  BX, [AutoC867+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC867-8+BP]
	PUSH BX
	CALL result
	ADD  SP, +4
;			}
;		else return 0;
	JMP  L_894
L_885:
	MOV  BX, +0
	ADD  SP, AutoC867
	POP  BP
	RET
L_894:
L_883:
;		}
	JMP  L_872
L_874:
;}
	ADD  SP, AutoC867
	POP  BP
	RET

AutoC867	EQU 8
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8

	  [SECTION .dseg]
L_867	DB "+",0
	DB "-",0
	DB "1",0

	  [SECTION .cseg]
;
;/** binary arithmetic operator; multiply, *, precedence level 3.1 **/
;/** binary arithmetic operator; divide, /, precedence level 3.2 **/
;/** binary arithmetic operator; modulo, %, precedence level 3.3 **/
;
;heir9(eval) int eval[];
heir9:
	PUSH BP
	SUB  SP, AutoC895
	MOV  BP, SP

;{
;	int k, eval2[3];
;
;	k = heir10(eval);
	LEA  BX, [AutoC895-2+BP]
	PUSH BX
	LEA  BX, [AutoC895+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	deblank();
	CALL deblank
;	if ((inspect_chr() != '*') & (inspect_chr() != '/') &
	CALL inspect_chr
	PUSH BX
	MOV  BX, +42
	POP  DX
	CALL ccne
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +47
	POP  DX
	CALL ccne
	POP  DX
	AND  BX, DX
	PUSH BX
;		(inspect_chr() != '%'))  return k;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +37
	POP  DX
	CALL ccne
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_896
	JMP  L_897
L_896:
	LEA  BX, [AutoC895-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC895
	POP  BP
	RET
;
;	if (k)  rq_val_sa(eval);
L_897:
	LEA  BX, [AutoC895-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_898
	JMP  L_899
L_898:
	LEA  BX, [AutoC895+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1)
L_899:
L_900:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_901
	JMP  L_902
L_901:
;		{
;		if (match("*"))
	MOV  BX, L_895+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_903
	JMP  L_904
L_903:
;			{
;			sa_push();
	CALL sa_push
;			if (heir9(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC895-8+BP]
	PUSH BX
	CALL heir9
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_905
	JMP  L_906
L_905:
	LEA  BX, [AutoC895-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_906:
	CALL sa_pop
;			sa_mult();
	CALL sa_mult
;			}
;		else if (match("/"))
	JMP  L_907
L_904:
	MOV  BX, L_895+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_908
	JMP  L_909
L_908:
;			{
;			sa_push();
	CALL sa_push
;			if (heir10(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC895-8+BP]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_910
	JMP  L_911
L_910:
	LEA  BX, [AutoC895-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_911:
	CALL sa_pop
;			sa_div();
	CALL sa_div
;			}
;		else if (match("%"))
	JMP  L_912
L_909:
	MOV  BX, L_895+4
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_913
	JMP  L_914
L_913:
;			{
;			sa_push();
	CALL sa_push
;			if (heir10(eval2))  rq_val_sa(eval2);
	LEA  BX, [AutoC895-8+BP]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_915
	JMP  L_916
L_915:
	LEA  BX, [AutoC895-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();
L_916:
	CALL sa_pop
;			sa_modulo();
	CALL sa_modulo
;			}
;		else return 0;
	JMP  L_917
L_914:
	MOV  BX, +0
	ADD  SP, AutoC895
	POP  BP
	RET
L_917:
L_912:
L_907:
;		}
	JMP  L_900
L_902:
;}
	ADD  SP, AutoC895
	POP  BP
	RET

AutoC895	EQU 8
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	eval2	ARRAY	INT	-8

	  [SECTION .dseg]
L_895	DB "*",0
	DB "/",0
	DB "%",0

	  [SECTION .cseg]
;
;/** unary operator; increment, ++, precedence level 2.7 **/
;/** unary operator; decrement, --, precedence level 2.8 **/
;/** unary operator; minus, -, precedence level 2.3 **/
;/** unary operator; indirection, *, precedence level 2.5 **/
;/** unary operator; address of, &, precedence level 2.6 **/
;/** unary operator; logical not, !, precedence level 2.1 **/
;/** unary operator; bitwise one's complement, ~, precedence level 2.2 **/
;/** TBI, ~, sizeof, cast (typename)expr **/
;
;heir10(eval) int eval[];
heir10:
	PUSH BP
	SUB  SP, AutoC918
	MOV  BP, SP

;{
;	int k;
;	char *ptr;
;
;	if (match("++"))
	MOV  BX, L_918+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_919
	JMP  L_920
L_919:
;		{
;		if ((k = heir10(eval)) == 0)
	LEA  BX, [AutoC918-2+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_921
	JMP  L_922
L_921:
;			{
;			needlval();
	CALL needlval
;			return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;			}
;
;		if (eval[1])  sa_push();
L_922:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_923
	JMP  L_924
L_923:
	CALL sa_push
;		rq_val_sa(eval);
L_924:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;		sa_inc();
	CALL sa_inc
;		if (eval[2] == CINT)  sa_inc();
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_925
	JMP  L_926
L_925:
	CALL sa_inc
;		sa_store(eval);
L_926:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_store
	ADD  SP, +2
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;		}
;
;	else if (match("--"))
	JMP  L_927
L_920:
	MOV  BX, L_918+3
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_928
	JMP  L_929
L_928:
;		{
;		if ((k = heir10(eval)) == 0)
	LEA  BX, [AutoC918-2+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_930
	JMP  L_931
L_930:
;			{
;			needlval();
	CALL needlval
;			return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;			}
;
;		if (eval[1])  sa_push();
L_931:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_932
	JMP  L_933
L_932:
	CALL sa_push
;		rq_val_sa(eval);
L_933:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;		sa_dec();
	CALL sa_dec
;		if (eval[2] == CINT)  sa_dec();
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_934
	JMP  L_935
L_934:
	CALL sa_dec
;		sa_store(eval);
L_935:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_store
	ADD  SP, +2
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;		}
;
;	else if (match("-"))
	JMP  L_936
L_929:
	MOV  BX, L_918+6
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_937
	JMP  L_938
L_937:
;		{
;		k = heir10(eval);
	LEA  BX, [AutoC918-2+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;		if (k) rq_val_sa(eval);
	LEA  BX, [AutoC918-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_939
	JMP  L_940
L_939:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;		sa_neg();              /** two's complement **/
L_940:
	CALL sa_neg
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;		}
;
;/** bitwise complement, one's complement, bit flip **/
;	else if (match("~"))
	JMP  L_941
L_938:
	MOV  BX, L_918+8
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_942
	JMP  L_943
L_942:
;		{
;		k = heir10(eval);
	LEA  BX, [AutoC918-2+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;		if (k) rq_val_sa(eval);
	LEA  BX, [AutoC918-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_944
	JMP  L_945
L_944:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;		sa_not();
L_945:
	CALL sa_not
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;		}
;
;/** boolean logical negate, 0->1, >0->0 **/
;	else if (match("!"))
	JMP  L_946
L_943:
	MOV  BX, L_918+10
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_947
	JMP  L_948
L_947:
;		{
;		k = heir10(eval);
	LEA  BX, [AutoC918-2+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;		if (k) rq_val_sa(eval);
	LEA  BX, [AutoC918-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_949
	JMP  L_950
L_949:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;		sa_mk_nbool();	/** prim reg -> not (bool) **/
L_950:
	CALL sa_mk_nbool
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;		}
;
;	else if (match("*"))
	JMP  L_951
L_948:
	MOV  BX, L_918+12
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_952
	JMP  L_953
L_952:
;		{
;		k = heir10(eval);
	LEA  BX, [AutoC918-2+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;		if (k) rq_val_sa(eval);
	LEA  BX, [AutoC918-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_954
	JMP  L_955
L_954:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;		if (ptr = eval[0]) eval[1] = ptr[TYPE];
L_955:
	LEA  BX, [AutoC918-4+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_956
	JMP  L_957
L_956:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC918-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;		else 	eval[1] = CINT;
	JMP  L_958
L_957:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
L_958:
;		eval[2] = 0; /*flag as not ptr or array*/
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;		return 1;
	MOV  BX, +1
	ADD  SP, AutoC918
	POP  BP
	RET
;		}
;
;	else	if (match("&"))
	JMP  L_959
L_953:
	MOV  BX, L_918+14
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_960
	JMP  L_961
L_960:
;		{
;		k = heir10(eval);
	LEA  BX, [AutoC918-2+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;		if (k == 0)
	LEA  BX, [AutoC918-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_962
	JMP  L_963
L_962:
;			{
;			error("illegal address");
	MOV  BX, L_918+16
	PUSH BX
	CALL error
	ADD  SP, +2
;			return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;			}
;		ptr = eval[0];
L_963:
	LEA  BX, [AutoC918-4+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		eval[2] = ptr[TYPE];
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC918-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;		if (eval[1]) return 0;
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_964
	JMP  L_965
L_964:
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;
;		/* global & non-array */
;		sa_immedo();  /* global & non-array & function */
L_965:
	CALL sa_immedo
;		outstr(ptr);
	LEA  BX, [AutoC918-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		nl();
	CALL nl
;		eval[1] = ptr[TYPE];
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC918-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;		}
;	else 
	JMP  L_966
L_961:
;		{  /** for recursive non-match of above unary ops **/
;		k = heir11(eval);
	LEA  BX, [AutoC918-2+BP]
	PUSH BX
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir11
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;		if (match("++"))
	MOV  BX, L_918+32
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_967
	JMP  L_968
L_967:
;			{
;			if (k == 0)
	LEA  BX, [AutoC918-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_969
	JMP  L_970
L_969:
;				{
;				needlval();
	CALL needlval
;				return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;				}
;			if (eval[1])  sa_push();
L_970:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_971
	JMP  L_972
L_971:
	CALL sa_push
;			rq_val_sa(eval);
L_972:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_inc();
	CALL sa_inc
;			if (eval[2] == CINT) sa_inc();
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_973
	JMP  L_974
L_973:
	CALL sa_inc
;			sa_store(eval);
L_974:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_store
	ADD  SP, +2
;			sa_dec();
	CALL sa_dec
;			if (eval[2] == CINT) sa_dec();
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_975
	JMP  L_976
L_975:
	CALL sa_dec
;			return 0;
L_976:
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;			}
;		else	if (match("--"))
	JMP  L_977
L_968:
	MOV  BX, L_918+35
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_978
	JMP  L_979
L_978:
;			{
;			if (k == 0)
	LEA  BX, [AutoC918-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_980
	JMP  L_981
L_980:
;				{
;				needlval();
	CALL needlval
;				return 0;
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;				}
;			if (eval[1])  sa_push();
L_981:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_982
	JMP  L_983
L_982:
	CALL sa_push
;			rq_val_sa(eval);
L_983:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_dec();
	CALL sa_dec
;			if (eval[2] == CINT)  sa_dec();
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_984
	JMP  L_985
L_984:
	CALL sa_dec
;			sa_store(eval);
L_985:
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_store
	ADD  SP, +2
;			sa_inc();
	CALL sa_inc
;			if (eval[2] == CINT)  sa_inc();
	LEA  BX, [AutoC918+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_986
	JMP  L_987
L_986:
	CALL sa_inc
;			return 0;
L_987:
	MOV  BX, +0
	ADD  SP, AutoC918
	POP  BP
	RET
;			}
;		else return k;
	JMP  L_988
L_979:
	LEA  BX, [AutoC918-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC918
	POP  BP
	RET
L_988:
L_977:
;		}
L_966:
L_959:
L_951:
L_946:
L_941:
L_936:
L_927:
;}
	ADD  SP, AutoC918
	POP  BP
	RET

AutoC918	EQU 4
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	ptr	PTR	CHAR	-4

	  [SECTION .dseg]
L_918	DB "++",0
	DB "--",0
	DB "-",0
	DB "~",0
	DB "!",0
	DB "*",0
	DB "&",0
	DB "illegal address",0
	DB "++",0
	DB "--",0

	  [SECTION .cseg]
;
;/** EO C86N-6.C **/
;/*	>>>>>> start of cc7 <<<<<<	*/
;
;/** primary operator; function parenthesis, (), precedence level 1.1 **/
;/** primary op; subscripting square brakets, [], precedence level 1.2 **/
;/** primary operator; member access, ->, precedence level 1.3 **/
;/** primary operator; member access, ., precedence level 1.4 **/
;
;heir11(eval) int *eval;
heir11:
	PUSH BP
	SUB  SP, AutoC989
	MOV  BP, SP

;{
;	int k; char *ptr;
;
;	k = primary(eval);
	LEA  BX, [AutoC989-2+BP]
	PUSH BX
	LEA  BX, [AutoC989+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL primary
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;
;	ptr = eval[0];  /** address of symbol in symb_tbl **/
	LEA  BX, [AutoC989-4+BP]
	PUSH BX
	LEA  BX, [AutoC989+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	deblank();
	CALL deblank
;	if ((inspect_chr() == '[') | (inspect_chr() == '('))
	CALL inspect_chr
	PUSH BX
	MOV  BX, +91
	POP  DX
	CALL cceq
	PUSH BX
	CALL inspect_chr
	PUSH BX
	MOV  BX, +40
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_990
	JMP  L_991
L_990:
;	while (1)
L_992:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_993
	JMP  L_994
L_993:
;		{
;		if (match("["))
	MOV  BX, L_989+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_995
	JMP  L_996
L_995:
;			{
;			if (ptr == 0)
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_997
	JMP  L_998
L_997:
;				{
;				error("can't subscript");
	MOV  BX, L_989+2
	PUSH BX
	CALL error
	ADD  SP, +2
;				junk();
	CALL junk
;				needbrack("]");
	MOV  BX, L_989+18
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;				return 0;
	MOV  BX, +0
	ADD  SP, AutoC989
	POP  BP
	RET
;				}
;			else if (ptr[IDENT] == POINTER)  rq_val_sa(eval);
	JMP  L_999
L_998:
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1000
	JMP  L_1001
L_1000:
	LEA  BX, [AutoC989+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			else if (ptr[IDENT] != ARRAY)
	JMP  L_1002
L_1001:
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1003
	JMP  L_1004
L_1003:
;				{
;				error("can't subscript");
	MOV  BX, L_989+20
	PUSH BX
	CALL error
	ADD  SP, +2
;				k = 0;
	LEA  BX, [AutoC989-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;				}
;			sa_push();
L_1004:
L_1002:
L_999:
	CALL sa_push
;			expression(YES);
	MOV  BX, +1
	PUSH BX
	CALL expression
	ADD  SP, +2
;			needbrack("]");
	MOV  BX, L_989+36
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;
;			if (ptr[TYPE] == CINT)  sa_doublereg();
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1005
	JMP  L_1006
L_1005:
	CALL sa_doublereg
;			sa_pop();
L_1006:
	CALL sa_pop
;			sa_add();
	CALL sa_add
;			eval[0] = eval[2] = 0;
	LEA  BX, [AutoC989+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC989+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
	POP  DI
	MOV  Word [DI], BX
;			eval[1] = ptr[TYPE];
	LEA  BX, [AutoC989+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;			k = 1;
	LEA  BX, [AutoC989-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;			}
;		else if (match("("))
	JMP  L_1007
L_996:
	MOV  BX, L_989+38
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1008
	JMP  L_1009
L_1008:
;			{
;			if (ptr == 0)
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1010
	JMP  L_1011
L_1010:
;				{
;				callfunction(0);
	MOV  BX, +0
	PUSH BX
	CALL callfunction
	ADD  SP, +2
;				}
;			else if (ptr[IDENT] != FUNCTION)
	JMP  L_1012
L_1011:
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +4
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1013
	JMP  L_1014
L_1013:
;				{
;				rq_val_sa(eval);
	LEA  BX, [AutoC989+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;				callfunction(0);
	MOV  BX, +0
	PUSH BX
	CALL callfunction
	ADD  SP, +2
;				}
;			else callfunction(ptr);
	JMP  L_1015
L_1014:
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL callfunction
	ADD  SP, +2
L_1015:
L_1012:
;			k = eval[0] = 0;
	LEA  BX, [AutoC989-2+BP]
	PUSH BX
	LEA  BX, [AutoC989+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
	POP  DI
	MOV  Word [DI], BX
;			}
;		else return k;
	JMP  L_1016
L_1009:
	LEA  BX, [AutoC989-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC989
	POP  BP
	RET
L_1016:
L_1007:
;		}
	JMP  L_992
L_994:
;	if (ptr == 0)  return k;
L_991:
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1017
	JMP  L_1018
L_1017:
	LEA  BX, [AutoC989-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC989
	POP  BP
	RET
;	if (ptr[IDENT] == FUNCTION)
L_1018:
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +4
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1019
	JMP  L_1020
L_1019:
;		{
;		sa_immedo();  /* global & non-array & function */
	CALL sa_immedo
;		asm_symb(ptr);
	LEA  BX, [AutoC989-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
;		nl();
	CALL nl
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC989
	POP  BP
	RET
;		}
;	return k;
L_1020:
	LEA  BX, [AutoC989-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC989
	POP  BP
	RET
;}

AutoC989	EQU 4
;	eval	PTR	INT	+4
;	k	VAR	INT	-2
;	ptr	PTR	CHAR	-4

	  [SECTION .dseg]
L_989	DB "[",0
	DB "can't subscript",0
	DB "]",0
	DB "can't subscript",0
	DB "]",0
	DB "(",0

	  [SECTION .cseg]
;
;/** primary is called when an expression is expected, it is **/
;/** the highest precedence level, it is acted on first. **/
;/** **/
;
;primary(eval) int *eval;
primary:
	PUSH BP
	SUB  SP, AutoC1021
	MOV  BP, SP

;{
;	char *ptr, sname[NAMESIZE]; /** auto symb array **/
;	int num[1], k;
;
;	eval[2] = 0;	/* Clear ptr/array type. */
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	if (match("("))  /** parenthesized expression **/
	MOV  BX, L_1021+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1022
	JMP  L_1023
L_1022:
;		{
;		k = heir1(eval); /** recursive call to ck for rvalue **/
	LEA  BX, [AutoC1021-19+BP]
	PUSH BX
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir1
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;		needbrack(")");
	MOV  BX, L_1021+2
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;		return k;
	LEA  BX, [AutoC1021-19+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1021
	POP  BP
	RET
;		}
;
;		/** is_identifier() gets & validates identifier **/
;	if (is_identifier(sname))
L_1023:
	LEA  BX, [AutoC1021-15+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1024
	JMP  L_1025
L_1024:
;		{
;		if (ptr = findauto(sname))  /** srch auto tbl 1st **/
	LEA  BX, [AutoC1021-2+BP]
	PUSH BX
	LEA  BX, [AutoC1021-15+BP]
	PUSH BX
	CALL findauto
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_1026
	JMP  L_1027
L_1026:
;			{
;			sa_deref(ptr);  /** code gen fn, syntatic action **/
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_deref
	ADD  SP, +2
;					/** get stk relative addr of auto var **/
;			 /** set eval[] according to auto identifier **/
;			eval[0] = ptr;
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;			eval[1] = ptr[TYPE];
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;			if (ptr[IDENT] == POINTER)
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1028
	JMP  L_1029
L_1028:
;				{
;				eval[1] = CINT;
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
;				eval[2] = ptr[TYPE];
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;				}
;			if (ptr[IDENT] == ARRAY)
L_1029:
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1030
	JMP  L_1031
L_1030:
;				{
;				eval[2] = ptr[TYPE];
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;				return 0;
	MOV  BX, +0
	ADD  SP, AutoC1021
	POP  BP
	RET
;				}
;			else return 1; /** auto VARIABLE, or auto POINTER **/
	JMP  L_1032
L_1031:
	MOV  BX, +1
	ADD  SP, AutoC1021
	POP  BP
	RET
L_1032:
;			 /** ! auto ARRAY or FUNCTION **/
;			 /** fn()'s are external static by definition. **/
;			 /** so the IDENT is a auto; VARIABLE or POINTER **/
;			}
;
;		if (ptr = findstatic(sname))  /** srch static tbl 2nd **/
L_1027:
	LEA  BX, [AutoC1021-2+BP]
	PUSH BX
	LEA  BX, [AutoC1021-15+BP]
	PUSH BX
	CALL findstatic
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_1033
	JMP  L_1034
L_1033:
;			if (ptr[IDENT] != FUNCTION)
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +4
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1035
	JMP  L_1036
L_1035:
;				{ /** set eval[] according to static identifier **/
;				eval[0] = ptr;  /** ptr to symb in tbl **/
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;				eval[1] = 0;
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;				if (ptr[IDENT] != ARRAY)
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1037
	JMP  L_1038
L_1037:
;					{
;					if (ptr[IDENT] == POINTER)
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1039
	JMP  L_1040
L_1039:
;						eval[2] = ptr[TYPE];
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;					return 1;
L_1040:
	MOV  BX, +1
	ADD  SP, AutoC1021
	POP  BP
	RET
;					}
;				 /** .else. array & !function */
;				sa_immedo();
L_1038:
	CALL sa_immedo
;				asm_symb(ptr); nl();
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
	CALL nl
;				eval[1] = eval[2] = ptr[TYPE];
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
	POP  DI
	MOV  Word [DI], BX
;				return 0;
	MOV  BX, +0
	ADD  SP, AutoC1021
	POP  BP
	RET
;				}
;
;	/** not found in auto tbl, not in static tbl, **/
;	/** so add the unknown identifier as a static function, **/
;	/** variables are declared symbols, already (elsewhere) **/
;	/** parsed & entered into the auto or static symbol tables. **/
;	/** The defaults for undeclared functions are setup now. **/
;
;		ptr = addstatic(sname,FUNCTION,CINT,0);
L_1036:
L_1034:
	LEA  BX, [AutoC1021-2+BP]
	PUSH BX
	LEA  BX, [AutoC1021-15+BP]
	PUSH BX
	MOV  BX, +4
	PUSH BX
	MOV  BX, +2
	PUSH BX
	MOV  BX, +0
	PUSH BX
	CALL addstatic
	ADD  SP, +8
	POP  DI
	MOV  Word [DI], BX
;		eval[0] = ptr;  /** address of its entry in symb tbl **/
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		eval[1] = 0;    /** functions are static objects **/
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;		return 0;       /** FALSE, not an expression **/
	MOV  BX, +0
	ADD  SP, AutoC1021
	POP  BP
	RET
;		}	/** eo if (is_identifier(sname)) **/
;
;	if (kind_const(num))  return (eval[0] = eval[1] = 0);
L_1025:
	LEA  BX, [AutoC1021-17+BP]
	PUSH BX
	CALL kind_const
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1041
	JMP  L_1042
L_1041:
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1021+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
	POP  DI
	MOV  Word [DI], BX
	ADD  SP, AutoC1021
	POP  BP
	RET
;
;	else	{
	JMP  L_1043
L_1042:
;		error("invalid expression");
	MOV  BX, L_1021+4
	PUSH BX
	CALL error
	ADD  SP, +2
;		sa_immed(); outdec(0); nl();
	CALL sa_immed
	MOV  BX, +0
	PUSH BX
	CALL outdec
	ADD  SP, +2
	CALL nl
;		junk();
	CALL junk
;		return 0;
	MOV  BX, +0
	ADD  SP, AutoC1021
	POP  BP
	RET
;		}
L_1043:
;} /** eo primary **/
	ADD  SP, AutoC1021
	POP  BP
	RET

AutoC1021	EQU 19
;	eval	PTR	INT	+4
;	ptr	PTR	CHAR	-2
;	sname	ARRAY	CHAR	-15
;	num	ARRAY	INT	-17
;	k	VAR	INT	-19

	  [SECTION .dseg]
L_1021	DB "(",0
	DB ")",0
	DB "invalid expression",0

	  [SECTION .cseg]
;
;	/* - 3 element evaluation array of ints -
;	** eval[0] = Symbol table address, else 0 for constant
;	** eval[1] = type indirect object to fetch, else 0 for
;        	     static object (or const.)
;	** eval[2] = type pointer or array, else 0
;	*/
;
;sa_store(eval) int *eval;
sa_store:
	PUSH BP
	SUB  SP, AutoC1044
	MOV  BP, SP

;{
;	if (eval[1] == 0) sa_putmem(eval[0]); /** is const **/
	LEA  BX, [AutoC1044+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1045
	JMP  L_1046
L_1045:
	LEA  BX, [AutoC1044+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_putmem
	ADD  SP, +2
;	else sa_putstk(eval[1]);
	JMP  L_1047
L_1046:
	LEA  BX, [AutoC1044+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_putstk
	ADD  SP, +2
L_1047:
;}
	POP  BP
	RET

AutoC1044	EQU 0
;	eval	PTR	INT	+4
;
;/** eval[1] holds typeobj, char or int, 0 for const. **/
;/** This is to Retrieve Value, from auto or static **/
;/** Syntactic Action for Dereferencing Symbol Value **/
;/** Ren rvalue -> rq_val_sa                         **/
;
;rq_val_sa(eval) int *eval;
rq_val_sa:
	PUSH BP
	SUB  SP, AutoC1048
	MOV  BP, SP

;{	/** not a const & indirect obj **/
;	if ((eval[0] != 0) & (eval[1] == 0))
	LEA  BX, [AutoC1048+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccne
	PUSH BX
	LEA  BX, [AutoC1048+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_1049
	JMP  L_1050
L_1049:
;		sa_getmem(eval[0]); /** gen syntactic action **/
	LEA  BX, [AutoC1048+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_getmem
	ADD  SP, +2
;	else  /** const or static **/
	JMP  L_1051
L_1050:
;		sa_indirect(eval[1]); /** gen syntactic action **/
	LEA  BX, [AutoC1048+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL sa_indirect
	ADD  SP, +2
L_1051:
;}
	POP  BP
	RET

AutoC1048	EQU 0
;	eval	PTR	INT	+4
;
;	/*
;	** true if val1 -> int pointer or int array and
;	** val2 not ptr or array
;	*/
;
;dbltest(val1,val2) int val1[], val2[];
dbltest:
	PUSH BP
	SUB  SP, AutoC1052
	MOV  BP, SP

;{
;	if (val1[2] != CINT) return 0;
	LEA  BX, [AutoC1052+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1053
	JMP  L_1054
L_1053:
	MOV  BX, +0
	POP  BP
	RET
;	if (val2[2]) return 0;
L_1054:
	LEA  BX, [AutoC1052+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1055
	JMP  L_1056
L_1055:
	MOV  BX, +0
	POP  BP
	RET
;	return 1;
L_1056:
	MOV  BX, +1
	POP  BP
	RET
;}

AutoC1052	EQU 0
;	val1	PTR	INT	+6
;	val2	PTR	INT	+4
;	/* - 3 element evaluation array of ints -
;	** eval[0] = Symbol table address, else 0 for constant
;	** eval[1] = type indirect object to fetch, else 0 for
;	       	     static object (const.)
;	** eval[2] = type pointer or array, else 0
;	*/
;
;/*** determine type of binary operation ***/
;
;result(eval,eval2) int eval[], eval2[];
result:
	PUSH BP
	SUB  SP, AutoC1057
	MOV  BP, SP

;{
;	if (eval[2] & eval2[2])	/*both are type ptr or array.*/
	LEA  BX, [AutoC1057+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1057+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_1058
	JMP  L_1059
L_1058:
;		{
;		eval[2] = 0;
	LEA  BX, [AutoC1057+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;		}
;	else	if (eval2[2])	/*eval2 is type ptr or array. */
	JMP  L_1060
L_1059:
	LEA  BX, [AutoC1057+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1061
	JMP  L_1062
L_1061:
;		{
;		eval[0] = eval2[0];
	LEA  BX, [AutoC1057+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1057+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		eval[1] = eval2[1];
	LEA  BX, [AutoC1057+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1057+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		eval[2] = eval2[2];
	LEA  BX, [AutoC1057+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1057+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		}
;}
L_1062:
L_1060:
	POP  BP
	RET

AutoC1057	EQU 0
;	eval	PTR	INT	+6
;	eval2	PTR	INT	+4
;
;/** boolean conditional test - jmp - if (t) **/
;/** !superceded! **/
;/**** logical_test(label) int label;
;{
;	needbrack("(");
;	expression();
;	needbrack(")");
;	sa_tst_jump(label); ** gen syntactic action **
;}  ****/
;
;/** Ver_2 boolean conditional test - jmp - if (tf) **/
;/**** -- abandoned --
;logical_tst2(label,tf) int label, tf;
;{
;	needbrack("(");
;	expression();      ** ref expr2(YES); for comma'd **
;	needbrack(")");
;	sa_tst2_jmp(label,tf); ** gen syntactic action **
;}  ****/
;
;logic_tst(t_lbl,flab1) int t_lbl, flab1;
logic_tst:
	PUSH BP
	SUB  SP, AutoC1063
	MOV  BP, SP

;{
;	needbrack("(");
	MOV  BX, L_1063+0
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;	expression(YES);
	MOV  BX, +1
	PUSH BX
	CALL expression
	ADD  SP, +2
;	needbrack(")");
	MOV  BX, L_1063+2
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;	sa_if_tst(t_lbl,flab1);
	LEA  BX, [AutoC1063+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1063+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_if_tst
	ADD  SP, +4
;}
	POP  BP
	RET

AutoC1063	EQU 0
;	t_lbl	VAR	INT	+6
;	flab1	VAR	INT	+4

	  [SECTION .dseg]
L_1063	DB "(",0
	DB ")",0

	  [SECTION .cseg]
;
;/** new, for DO **/
;logic_do_tst(t_lbl,flab1) int t_lbl, flab1;
logic_do_tst:
	PUSH BP
	SUB  SP, AutoC1064
	MOV  BP, SP

;{
;	needbrack("(");
	MOV  BX, L_1064+0
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;	expression(YES);
	MOV  BX, +1
	PUSH BX
	CALL expression
	ADD  SP, +2
;	needbrack(")");
	MOV  BX, L_1064+2
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;	sa_do_tst(t_lbl,flab1); /** true label, false=exit label **/
	LEA  BX, [AutoC1064+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1064+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_do_tst
	ADD  SP, +4
;}
	POP  BP
	RET

AutoC1064	EQU 0
;	t_lbl	VAR	INT	+6
;	flab1	VAR	INT	+4

	  [SECTION .dseg]
L_1064	DB "(",0
	DB ")",0

	  [SECTION .cseg]
;
;kind_const(val) int val[];  /** parameter is a ptr, *val **/
kind_const:
	PUSH BP
	SUB  SP, AutoC1065
	MOV  BP, SP

;{
;	if (number(val))  sa_immed();
	LEA  BX, [AutoC1065+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL number
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1066
	JMP  L_1067
L_1066:
	CALL sa_immed
;	else if (chr_const(val))  sa_immed();
	JMP  L_1068
L_1067:
	LEA  BX, [AutoC1065+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL chr_const
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1069
	JMP  L_1070
L_1069:
	CALL sa_immed
;	else if (str_const(val))
	JMP  L_1071
L_1070:
	LEA  BX, [AutoC1065+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL str_const
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1072
	JMP  L_1073
L_1072:
;		{
;		sa_immedo();  /* global & non-array & function */
	CALL sa_immedo
;		printlabel(litlab);
	MOV  BX, [Word litlab]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;		}
;	else return 0;	
	JMP  L_1074
L_1073:
	MOV  BX, +0
	POP  BP
	RET
L_1074:
L_1071:
L_1068:
;	outdec(val[0]);
	LEA  BX, [AutoC1065+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	PUSH BX
	CALL outdec
	ADD  SP, +2
;	nl();
	CALL nl
;	return 1;
	MOV  BX, +1
	POP  BP
	RET
;}

AutoC1065	EQU 0
;	val	PTR	INT	+4
;
;number(val) int val[];
number:
	PUSH BP
	SUB  SP, AutoC1075
	MOV  BP, SP

;{
;	int k, minus; char c;
;
;	k = minus = 1;
	LEA  BX, [AutoC1075-2+BP]
	PUSH BX
	LEA  BX, [AutoC1075-4+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
	POP  DI
	MOV  Word [DI], BX
;	while (k)
L_1076:
	LEA  BX, [AutoC1075-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1077
	JMP  L_1078
L_1077:
;		{
;		k = 0;
	LEA  BX, [AutoC1075-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;		if (match("+")) k=1;
	MOV  BX, L_1075+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1079
	JMP  L_1080
L_1079:
	LEA  BX, [AutoC1075-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;		if (match("-"))
L_1080:
	MOV  BX, L_1075+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1081
	JMP  L_1082
L_1081:
;			{
;			minus = (-minus);
	LEA  BX, [AutoC1075-4+BP]
	PUSH BX
	LEA  BX, [AutoC1075-4+BP]
	MOV  BX, [BX]
	NEG  BX
	POP  DI
	MOV  Word [DI], BX
;			k = 1;
	LEA  BX, [AutoC1075-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;			}
;		}
L_1082:
	JMP  L_1076
L_1078:
;
;	if (numeric(inspect_chr()) == 0) return 0;
	CALL inspect_chr
	PUSH BX
	CALL numeric
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1083
	JMP  L_1084
L_1083:
	MOV  BX, +0
	ADD  SP, AutoC1075
	POP  BP
	RET
;	while (numeric(inspect_chr()))
L_1084:
L_1085:
	CALL inspect_chr
	PUSH BX
	CALL numeric
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1086
	JMP  L_1087
L_1086:
;		{
;		c = scan_nxt();
	LEA  BX, [AutoC1075-5+BP]
	PUSH BX
	CALL scan_nxt
	POP  DI
	MOV  Byte [DI], BL
;		k = k * 10 + (c - '0');
	LEA  BX, [AutoC1075-2+BP]
	PUSH BX
	LEA  BX, [AutoC1075-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +10
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	PUSH BX
	LEA  BX, [AutoC1075-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		}
	JMP  L_1085
L_1087:
;	if (minus < 0)  k =(-k);
	LEA  BX, [AutoC1075-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_1088
	JMP  L_1089
L_1088:
	LEA  BX, [AutoC1075-2+BP]
	PUSH BX
	LEA  BX, [AutoC1075-2+BP]
	MOV  BX, [BX]
	NEG  BX
	POP  DI
	MOV  Word [DI], BX
;	val[0] = k;
L_1089:
	LEA  BX, [AutoC1075+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1075-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	return 1;
	MOV  BX, +1
	ADD  SP, AutoC1075
	POP  BP
	RET
;}

AutoC1075	EQU 5
;	val	PTR	INT	+4
;	k	VAR	INT	-2
;	minus	VAR	INT	-4
;	c	VAR	CHAR	-5

	  [SECTION .dseg]
L_1075	DB "+",0
	DB "-",0

	  [SECTION .cseg]
;
;chr_const(val) int val[];
chr_const:
	PUSH BP
	SUB  SP, AutoC1090
	MOV  BP, SP

;{
;	int k; char c;
;
;	k = 0;
	LEA  BX, [AutoC1090-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	if (match("'") == 0) return 0;
	MOV  BX, L_1090+0
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1091
	JMP  L_1092
L_1091:
	MOV  BX, +0
	ADD  SP, AutoC1090
	POP  BP
	RET
;	while ((c = g_nxtchr()) != 39)  /** 39 is single quote **/
L_1092:
L_1093:
	LEA  BX, [AutoC1090-3+BP]
	PUSH BX
	CALL g_nxtchr
	POP  DI
	MOV  Byte [DI], BL
	PUSH BX
	MOV  BX, +39
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1094
	JMP  L_1095
L_1094:
;		k = (k & 255) * 256 + (c & 127);
	LEA  BX, [AutoC1090-2+BP]
	PUSH BX
	LEA  BX, [AutoC1090-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +255
	POP  DX
	AND  BX, DX
	PUSH BX
	MOV  BX, +256
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	PUSH BX
	LEA  BX, [AutoC1090-3+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
	JMP  L_1093
L_1095:
;	val[0] = k;
	LEA  BX, [AutoC1090+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1090-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	return 1;
	MOV  BX, +1
	ADD  SP, AutoC1090
	POP  BP
	RET
;}

AutoC1090	EQU 3
;	val	PTR	INT	+4
;	k	VAR	INT	-2
;	c	VAR	CHAR	-3

	  [SECTION .dseg]
L_1090	DB "'",0

	  [SECTION .cseg]
;
;str_const(val) int val[];
str_const:
	PUSH BP
	SUB  SP, AutoC1096
	MOV  BP, SP

;{  /** quoted string entered into Literal Str Table **/
;	char c;
;
;	if (match(quote) == 0) return 0;
	MOV  BX, quote
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1097
	JMP  L_1098
L_1097:
	MOV  BX, +0
	ADD  SP, AutoC1096
	POP  BP
	RET
;	val[0] = litptr;
L_1098:
	LEA  BX, [AutoC1096+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, [Word litptr]
	POP  DI
	MOV  Word [DI], BX
;	while (inspect_chr() != '"')
L_1099:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +34
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1100
	JMP  L_1101
L_1100:
;		{
;		if (inspect_chr() == 0) break;
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1102
	JMP  L_1103
L_1102:
	JMP  L_1101
;		if (litptr >= LITMAX)
L_1103:
	MOV  BX, [Word litptr]
	PUSH BX
	MOV  BX, +1000
	PUSH BX
	MOV  BX, +1
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DX
	CALL ccge
	OR   BX, BX
	JNZ  L_1104
	JMP  L_1105
L_1104:
;			{  /** cleanup literal error **/
;			error("string space exhausted");
	MOV  BX, L_1096+0
	PUSH BX
	CALL error
	ADD  SP, +2
;			while (match(quote) == 0)
L_1106:
	MOV  BX, quote
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1107
	JMP  L_1108
L_1107:
;				if (g_nxtchr() == 0) break;
	CALL g_nxtchr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1109
	JMP  L_1110
L_1109:
	JMP  L_1108
;			return 1;
L_1110:
	JMP  L_1106
L_1108:
	MOV  BX, +1
	ADD  SP, AutoC1096
	POP  BP
	RET
;			}
;		litq[litptr++] = g_nxtchr(); /** cpy to literal tbl **/
L_1105:
	MOV  BX, litq
	PUSH BX
	MOV  BX, [Word litptr]
	INC  BX
	MOV  Word [litptr], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL g_nxtchr
	POP  DI
	MOV  Byte [DI], BL
;		}
	JMP  L_1099
L_1101:
;	g_nxtchr();
	CALL g_nxtchr
;	litq[litptr++] = 0; /** null terminate str **/
	MOV  BX, litq
	PUSH BX
	MOV  BX, [Word litptr]
	INC  BX
	MOV  Word [litptr], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;	return 1;
	MOV  BX, +1
	ADD  SP, AutoC1096
	POP  BP
	RET
;}  /** quoted str entered into Literals Table **/

AutoC1096	EQU 1
;	val	PTR	INT	+4
;	c	VAR	CHAR	-1

	  [SECTION .dseg]
L_1096	DB "string space exhausted",0

	  [SECTION .cseg]
;
;/** EO C86N-7.C **/
;
;/*	>>>>>> start of cc8 <<<<<<<	*/
;
;/* Begin a comment line for the assembler */
;sa_comment()
sa_comment:
	PUSH BP
	SUB  SP, AutoC1111
	MOV  BP, SP

;{
;	outbyte(';');
	MOV  BX, +59
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1111	EQU 0
;
;/* Put out assembler info before any code is generated */
;header()
header:
	PUSH BP
	SUB  SP, AutoC1112
	MOV  BP, SP

;{
;	/** sa_comment();nl(); **/
;	if(mainflg){		/* do stuff needed for first */
	MOV  BX, [Word mainflg]
	OR   BX, BX
	JNZ  L_1113
	JMP  L_1114
L_1113:
;		ol(";; ----===*******===----");
	MOV  BX, L_1112+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;		ol("%INCLUDE 'PROLOG.NSM' "); /** NASM form **/ 
	MOV  BX, L_1112+25
	PUSH BX
	CALL ol
	ADD  SP, +2
;		outstr(";; --== NASM vers. 26-Mar-2010 ==--"); nl();
	MOV  BX, L_1112+48
	PUSH BX
	CALL outstr
	ADD  SP, +2
	CALL nl
;		ol(";; ***---- Program Body ----***");
	MOV  BX, L_1112+84
	PUSH BX
	CALL ol
	ADD  SP, +2
;		ol("  [SECTION .cseg]");
	MOV  BX, L_1112+116
	PUSH BX
	CALL ol
	ADD  SP, +2
;		}
;}
L_1114:
	POP  BP
	RET

AutoC1112	EQU 0

	  [SECTION .dseg]
L_1112	DB ";; ----===*******===----",0
	DB "%INCLUDE 'PROLOG.NSM' ",0
	DB ";; --== NASM vers. 26-Mar-2010 ==--",0
	DB ";; ***---- Program Body ----***",0
	DB "  [SECTION .cseg]",0

	  [SECTION .cseg]
;
;/* Print any assembler stuff needed after all code */
;
;trailer()
trailer:
	PUSH BP
	SUB  SP, AutoC1115
	MOV  BP, SP

;{
;	nl();	/* 6 May 80 rj errorsummary() now goes to console */
	CALL nl
;	ol("%INCLUDE 'EPILOG.NSM' "); /** NASM form **/              
	MOV  BX, L_1115+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	sa_comment();
	CALL sa_comment
;	outstr(" --- End of Compilation ---");
	MOV  BX, L_1115+23
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	nl();
	CALL nl
;}
	POP  BP
	RET

AutoC1115	EQU 0

	  [SECTION .dseg]
L_1115	DB "%INCLUDE 'EPILOG.NSM' ",0
	DB " --- End of Compilation ---",0

	  [SECTION .cseg]
;
;/* Continue code segment stuff. */
;sa_cseg()
sa_cseg:
	PUSH BP
	SUB  SP, AutoC1116
	MOV  BP, SP

;{
;	nl();
	CALL nl
;	ol("  [SECTION .cseg]"); /* Start Code Segment from last point. */            
	MOV  BX, L_1116+0
	PUSH BX
	CALL ol
	ADD  SP, +2
; 
;}
	POP  BP
	RET

AutoC1116	EQU 0

	  [SECTION .dseg]
L_1116	DB "  [SECTION .cseg]",0

	  [SECTION .cseg]
;
;/* Continue data segment stuff. */
;sa_dseg()
sa_dseg:
	PUSH BP
	SUB  SP, AutoC1117
	MOV  BP, SP

;{
;	nl();
	CALL nl
;	ol("  [SECTION .dseg]"); /* Start Data Segment from last point. */            
	MOV  BX, L_1117+0
	PUSH BX
	CALL ol
	ADD  SP, +2
; 
;}
	POP  BP
	RET

AutoC1117	EQU 0

	  [SECTION .dseg]
L_1117	DB "  [SECTION .dseg]",0

	  [SECTION .cseg]
;
;/* Function initialization. */
;FN_Prolog()
FN_Prolog:
	PUSH BP
	SUB  SP, AutoC1118
	MOV  BP, SP

;{
;	ol("PUSH BP");	/*Save old frame ptr.*/
	MOV  BX, L_1118+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("SUB  SP, ");	/*Adjust stack beyond new frame.*/
	MOV  BX, L_1118+8
	PUSH BX
	CALL ot
	ADD  SP, +2
;	ostklbl();
	CALL ostklbl
;	nl();
	CALL nl
;	ol("MOV  BP, SP");	/*Get new frame ptr.*/
	MOV  BX, L_1118+18
	PUSH BX
	CALL ol
	ADD  SP, +2
;	nl();
	CALL nl
;}
	POP  BP
	RET

AutoC1118	EQU 0

	  [SECTION .dseg]
L_1118	DB "PUSH BP",0
	DB "SUB  SP, ",0
	DB "MOV  BP, SP",0

	  [SECTION .cseg]
;
;/* Function termination. */
;FN_Epilog()
FN_Epilog:
	PUSH BP
	SUB  SP, AutoC1119
	MOV  BP, SP

;{
;	nl();
	CALL nl
;	ostklbl();		/*Generate frame size.*/
	CALL ostklbl
;	ot("EQU ");
	MOV  BX, L_1119+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;	outudec(Msp);
	MOV  BX, [Word Msp]
	PUSH BX
	CALL outudec
	ADD  SP, +2
;	nl();
	CALL nl
;}
	POP  BP
	RET

AutoC1119	EQU 0

	  [SECTION .dseg]
L_1119	DB "EQU ",0

	  [SECTION .cseg]
;
;/* Print out a name such that it won't annoy the assembler */
;/*	(by matching anything reserved, like opcodes.) */
;/*	gtf 4/7/80 */
;/** chgd outname() -> asm_symb(), removed leading "cz" **/
;/** removed toupperi, nasm is case sensitive. **/
;
;asm_symb(sname) char *sname;
asm_symb:
	PUSH BP
	SUB  SP, AutoC1120
	MOV  BP, SP

;{
;	int len, i, j;
;
;	/** outasm("cz"); **/
;	len = strlen(sname);
	LEA  BX, [AutoC1120-2+BP]
	PUSH BX
	LEA  BX, [AutoC1120+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL strlen
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;	if (len > (asmpref+asmsuff))
	LEA  BX, [AutoC1120-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +11
	PUSH BX
	MOV  BX, +3
	POP  DX
	ADD  BX, DX
	POP  DX
	CALL ccgt
	OR   BX, BX
	JNZ  L_1121
	JMP  L_1122
L_1121:
;		{
;		i = asmpref;
	LEA  BX, [AutoC1120-4+BP]
	PUSH BX
	MOV  BX, +11
	POP  DI
	MOV  Word [DI], BX
;		len = len - asmpref - asmsuff;
	LEA  BX, [AutoC1120-2+BP]
	PUSH BX
	LEA  BX, [AutoC1120-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +11
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	PUSH BX
	MOV  BX, +3
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		while (i-- > 0)  /** no case conversion version **/
L_1123:
	LEA  BX, [AutoC1120-4+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccgt
	OR   BX, BX
	JNZ  L_1124
	JMP  L_1125
L_1124:
;			outbyte(*sname++);
	LEA  BX, [AutoC1120+4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL outbyte
	ADD  SP, +2
	JMP  L_1123
L_1125:
;		while (len-- > 0)
L_1126:
	LEA  BX, [AutoC1120-2+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccgt
	OR   BX, BX
	JNZ  L_1127
	JMP  L_1128
L_1127:
;			sname++;
	LEA  BX, [AutoC1120+4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	JMP  L_1126
L_1128:
;		while (*sname)
L_1129:
	LEA  BX, [AutoC1120+4+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_1130
	JMP  L_1131
L_1130:
;			outbyte(*sname++);
	LEA  BX, [AutoC1120+4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL outbyte
	ADD  SP, +2
	JMP  L_1129
L_1131:
;
;	/****	while(i-- > 0)
;			outbyte(toupperi(*sname++));
;		while(len-- > 0)
;			sname++;
;		while(*sname)
;			outbyte(toupperi(*sname++)); ****/
;		}
;	else	outasm(sname);
	JMP  L_1132
L_1122:
	LEA  BX, [AutoC1120+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outasm
	ADD  SP, +2
L_1132:
;} /* end asm_symb */
	ADD  SP, AutoC1120
	POP  BP
	RET

AutoC1120	EQU 6
;	sname	PTR	CHAR	+4
;	len	VAR	INT	-2
;	i	VAR	INT	-4
;	j	VAR	INT	-6
;
;/* Fetch a static memory cell into the primary register */
;sa_getmem(sym) char *sym;
sa_getmem:
	PUSH BP
	SUB  SP, AutoC1133
	MOV  BP, SP

;{
;	if ((sym[IDENT] != POINTER) & (sym[TYPE] == CCHAR))
	LEA  BX, [AutoC1133+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL ccne
	PUSH BX
	LEA  BX, [AutoC1133+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_1134
	JMP  L_1135
L_1134:
;		{
;		ot("MOV  AL, [Byte ");
	MOV  BX, L_1133+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;		asm_symb(sym+NAME);
	LEA  BX, [AutoC1133+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
;	/**	ot("]"); **/
;		outasm("]");
	MOV  BX, L_1133+16
	PUSH BX
	CALL outasm
	ADD  SP, +2
;		nl();
	CALL nl
;		ol("CBW");
	MOV  BX, L_1133+18
	PUSH BX
	CALL ol
	ADD  SP, +2
;		ol("MOV  BX, AX");
	MOV  BX, L_1133+22
	PUSH BX
	CALL ol
	ADD  SP, +2
;		nl();
	CALL nl
;		}
;	else
	JMP  L_1136
L_1135:
;		{
;		ot("MOV  BX, [Word ");
	MOV  BX, L_1133+34
	PUSH BX
	CALL ot
	ADD  SP, +2
;		asm_symb(sym+NAME);
	LEA  BX, [AutoC1133+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
;	/**	ot("]"); **/
;		outasm("]");
	MOV  BX, L_1133+50
	PUSH BX
	CALL outasm
	ADD  SP, +2
;		nl();
	CALL nl
;		}
L_1136:
;}
	POP  BP
	RET

AutoC1133	EQU 0
;	sym	PTR	CHAR	+4

	  [SECTION .dseg]
L_1133	DB "MOV  AL, [Byte ",0
	DB "]",0
	DB "CBW",0
	DB "MOV  BX, AX",0
	DB "MOV  BX, [Word ",0
	DB "]",0

	  [SECTION .cseg]
;
;/* Fetch the stack relative address of the specified automatic symbol */
;/*	into the primary register */
;
;sa_deref(sym) char *sym;
sa_deref:
	PUSH BP
	SUB  SP, AutoC1137
	MOV  BP, SP

;{
;	ot("LEA  BX, [");
	MOV  BX, L_1137+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;	ostklbl();
	CALL ostklbl
;	outdec((sym[OFFSET] & 255) + ((sym[OFFSET+1] & 255) << 8));
	LEA  BX, [AutoC1137+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +255
	POP  DX
	AND  BX, DX
	PUSH BX
	LEA  BX, [AutoC1137+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +16
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +255
	POP  DX
	AND  BX, DX
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAL  DX, CL
	MOV  BX, DX
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL outdec
	ADD  SP, +2
;	outasm("+BP]");
	MOV  BX, L_1137+11
	PUSH BX
	CALL outasm
	ADD  SP, +2
;	nl();
	CALL nl
;}
	POP  BP
	RET

AutoC1137	EQU 0
;	sym	PTR	CHAR	+4

	  [SECTION .dseg]
L_1137	DB "LEA  BX, [",0
	DB "+BP]",0

	  [SECTION .cseg]
;
;/* Store the primary register into the specified */
;/* static memory cell. */
;
;sa_putmem(sym) char *sym;
sa_putmem:
	PUSH BP
	SUB  SP, AutoC1138
	MOV  BP, SP

;{
;	if ((sym[IDENT] != POINTER) & (sym[TYPE] == CCHAR))
	LEA  BX, [AutoC1138+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL ccne
	PUSH BX
	LEA  BX, [AutoC1138+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_1139
	JMP  L_1140
L_1139:
;		{
;		ot("MOV  Byte [");
	MOV  BX, L_1138+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;		asm_symb(sym+NAME);
	LEA  BX, [AutoC1138+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
;	/**	ot("], BL");  **/
;		outasm("], BL");
	MOV  BX, L_1138+12
	PUSH BX
	CALL outasm
	ADD  SP, +2
;		nl();
	CALL nl
;		}
;	else
	JMP  L_1141
L_1140:
;		{
;		ot("MOV  Word [");
	MOV  BX, L_1138+18
	PUSH BX
	CALL ot
	ADD  SP, +2
;		asm_symb(sym+NAME);
	LEA  BX, [AutoC1138+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
;	/**	ot("], BX");  **/
;		outasm("], BX");
	MOV  BX, L_1138+30
	PUSH BX
	CALL outasm
	ADD  SP, +2
;		nl();
	CALL nl
;		}
L_1141:
;}
	POP  BP
	RET

AutoC1138	EQU 0
;	sym	PTR	CHAR	+4

	  [SECTION .dseg]
L_1138	DB "MOV  Byte [",0
	DB "], BL",0
	DB "MOV  Word [",0
	DB "], BX",0

	  [SECTION .cseg]
;
;/* Store the specified object type in the primary register */
;/* at the address on the top of the stack. */
;/** presumes DS:DI is address of target **/
;
;sa_putstk(typeobj) char typeobj;
sa_putstk:
	PUSH BP
	SUB  SP, AutoC1142
	MOV  BP, SP

;{
;	ol("POP  DI");
	MOV  BX, L_1142+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	Csp = Csp + 2;
	MOV  BX, [Word Csp]
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	MOV  Word [Csp], BX
;	if (typeobj == CCHAR)
	LEA  BX, [AutoC1142+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1143
	JMP  L_1144
L_1143:
;	   ol("MOV  Byte [DI], BL");
	MOV  BX, L_1142+8
	PUSH BX
	CALL ol
	ADD  SP, +2
;	else
	JMP  L_1145
L_1144:
;	   ol("MOV  Word [DI], BX");
	MOV  BX, L_1142+27
	PUSH BX
	CALL ol
	ADD  SP, +2
L_1145:
;}
	POP  BP
	RET

AutoC1142	EQU 0
;	typeobj	VAR	CHAR	+4

	  [SECTION .dseg]
L_1142	DB "POP  DI",0
	DB "MOV  Byte [DI], BL",0
	DB "MOV  Word [DI], BX",0

	  [SECTION .cseg]
;
;/* Fetch the specified object type indirect through the */
;/*	primary register into the primary register */
;/** called as: indirect(eval[1], eval[0]);  **/
;/** these are auto class on stack **/
;/*** reverted, problem with array[0] is DS relative ***/
;
;sa_indirect(typeobj) char typeobj;
sa_indirect:
	PUSH BP
	SUB  SP, AutoC1146
	MOV  BP, SP

;{
;	if (typeobj == CCHAR)
	LEA  BX, [AutoC1146+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1147
	JMP  L_1148
L_1147:
;		{
;	/**	ol("MOV  AL, [SS:BX]"); **/
;		ol("MOV  AL, [BX]");
	MOV  BX, L_1146+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;		ol("CBW");
	MOV  BX, L_1146+14
	PUSH BX
	CALL ol
	ADD  SP, +2
;		ol("MOV  BX, AX");
	MOV  BX, L_1146+18
	PUSH BX
	CALL ol
	ADD  SP, +2
;		}
;/**	else  ol("MOV  BX, [SS:BX]"); **/
;	else  ol("MOV  BX, [BX]");
	JMP  L_1149
L_1148:
	MOV  BX, L_1146+30
	PUSH BX
	CALL ol
	ADD  SP, +2
L_1149:
;}
	POP  BP
	RET

AutoC1146	EQU 0
;	typeobj	VAR	CHAR	+4

	  [SECTION .dseg]
L_1146	DB "MOV  AL, [BX]",0
	DB "CBW",0
	DB "MOV  BX, AX",0
	DB "MOV  BX, [BX]",0

	  [SECTION .cseg]
;
;/* Swap the primary and secondary registers */
;
;sa_swap()
sa_swap:
	PUSH BP
	SUB  SP, AutoC1150
	MOV  BP, SP

;{
;	ol("XCHG BX, DX");
	MOV  BX, L_1150+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1150	EQU 0

	  [SECTION .dseg]
L_1150	DB "XCHG BX, DX",0

	  [SECTION .cseg]
;
;/* Print partial instruction to get an immediate value */
;/*	into the primary register */
;
;sa_immed()
sa_immed:
	PUSH BP
	SUB  SP, AutoC1151
	MOV  BP, SP

;{
;	ot("MOV  BX, ");
	MOV  BX, L_1151+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1151	EQU 0

	  [SECTION .dseg]
L_1151	DB "MOV  BX, ",0

	  [SECTION .cseg]
;
;/* Print partial instruction to get an immediate value */
;/*	into the primary register */
;/* global & non-array & function */
;
;sa_immedo()
sa_immedo:
	PUSH BP
	SUB  SP, AutoC1152
	MOV  BP, SP

;{
;	ot("MOV  BX, ");
	MOV  BX, L_1152+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1152	EQU 0

	  [SECTION .dseg]
L_1152	DB "MOV  BX, ",0

	  [SECTION .cseg]
;
;/* Push the primary register onto the stack */
;
;sa_push()
sa_push:
	PUSH BP
	SUB  SP, AutoC1153
	MOV  BP, SP

;{
;	ol("PUSH BX");
	MOV  BX, L_1153+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	Csp = Csp - 2;
	MOV  BX, [Word Csp]
	PUSH BX
	MOV  BX, +2
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	MOV  Word [Csp], BX
;}
	POP  BP
	RET

AutoC1153	EQU 0

	  [SECTION .dseg]
L_1153	DB "PUSH BX",0

	  [SECTION .cseg]
;
;/* Pop the top of the stack into the secondary register */
;
;sa_pop()
sa_pop:
	PUSH BP
	SUB  SP, AutoC1154
	MOV  BP, SP

;{
;	ol("POP  DX");
	MOV  BX, L_1154+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	Csp = Csp + 2;
	MOV  BX, [Word Csp]
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	MOV  Word [Csp], BX
;}
	POP  BP
	RET

AutoC1154	EQU 0

	  [SECTION .dseg]
L_1154	DB "POP  DX",0

	  [SECTION .cseg]
;
;/* Swap the primary register and the top of the stack */
;/** ck for DS dependency - note, EA can use SS: vs default DS: **/
;/*** reverted, problem with array[0] is DS relative ***/
;
;sa_swapstk()
sa_swapstk:
	PUSH BP
	SUB  SP, AutoC1155
	MOV  BP, SP

;{
;	ol("MOV  DI, SP");
	MOV  BX, L_1155+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("XCHG BX, [DI]"); /** small memory model dependent **/
	MOV  BX, L_1155+12
	PUSH BX
	CALL ol
	ADD  SP, +2
;/**	ol("XCHG BX, [SS:DI]");  ** mem model independent **/
;}
	POP  BP
	RET

AutoC1155	EQU 0

	  [SECTION .dseg]
L_1155	DB "MOV  DI, SP",0
	DB "XCHG BX, [DI]",0

	  [SECTION .cseg]
;
;/** EO C86N-8.C **/
;/*	>>>>>> start of cc9 <<<<<<<	*/
;
;/* Call the specified subroutine name */
;
;sa_call(sname) char *sname;
sa_call:
	PUSH BP
	SUB  SP, AutoC1156
	MOV  BP, SP

;{
;	ot("CALL ");
	MOV  BX, L_1156+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;	asm_symb(sname);
	LEA  BX, [AutoC1156+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
;	nl();
	CALL nl
;}
	POP  BP
	RET

AutoC1156	EQU 0
;	sname	PTR	CHAR	+4

	  [SECTION .dseg]
L_1156	DB "CALL ",0

	  [SECTION .cseg]
;
;/* Call a run-time library routine */
;
;sa_callrts(sname) char *sname;
sa_callrts:
	PUSH BP
	SUB  SP, AutoC1157
	MOV  BP, SP

;{
;	ot("CALL ");
	MOV  BX, L_1157+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;	outasm(sname);
	LEA  BX, [AutoC1157+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outasm
	ADD  SP, +2
;	nl();
	CALL nl
;}  /*end callrts*/
	POP  BP
	RET

AutoC1157	EQU 0
;	sname	PTR	CHAR	+4

	  [SECTION .dseg]
L_1157	DB "CALL ",0

	  [SECTION .cseg]
;
;/* Return from subroutine */
;
;sa_ret()
sa_ret:
	PUSH BP
	SUB  SP, AutoC1158
	MOV  BP, SP

;{
;	ol("RET");
	MOV  BX, L_1158+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1158	EQU 0

	  [SECTION .dseg]
L_1158	DB "RET",0

	  [SECTION .cseg]
;
;/* Perform subroutine call to addr on top of stack */
;/*** reverted, problem with array[0] is DS relative ***/
;
;sa_callstk()
sa_callstk:
	PUSH BP
	SUB  SP, AutoC1159
	MOV  BP, SP

;{
;	sa_immed();
	CALL sa_immed
;	outasm("( $+3+2+2+2)");
	MOV  BX, L_1159+0
	PUSH BX
	CALL outasm
	ADD  SP, +2
;	nl();
	CALL nl
;	ol("MOV  DI, SP");
	MOV  BX, L_1159+13
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("XCHG BX, [DI]"); /** small memory model dependent **/
	MOV  BX, L_1159+25
	PUSH BX
	CALL ol
	ADD  SP, +2
;/**	ol("XCHG BX, [SS:DI]"); ** mem model independent **/
;	ol("JMP  BX");
	MOV  BX, L_1159+39
	PUSH BX
	CALL ol
	ADD  SP, +2
;	Csp=Csp-2;
	MOV  BX, [Word Csp]
	PUSH BX
	MOV  BX, +2
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	MOV  Word [Csp], BX
;	}
	POP  BP
	RET

AutoC1159	EQU 0

	  [SECTION .dseg]
L_1159	DB "( $+3+2+2+2)",0
	DB "MOV  DI, SP",0
	DB "XCHG BX, [DI]",0
	DB "JMP  BX",0

	  [SECTION .cseg]
;
;/* Jump to specified internal label number */
;
;sa_jump(label) int label;
sa_jump:
	PUSH BP
	SUB  SP, AutoC1160
	MOV  BP, SP

;{
;	ot("JMP  ");
	MOV  BX, L_1160+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(label);
	LEA  BX, [AutoC1160+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	nl();
	CALL nl
;}
	POP  BP
	RET

AutoC1160	EQU 0
;	label	VAR	INT	+4

	  [SECTION .dseg]
L_1160	DB "JMP  ",0

	  [SECTION .cseg]
;
;/* Test the primary register and jump if false to label */
;/** testjump()->sa_tst_jump() **/
;/** caller - logical_test(label); - superceded **/
;/**** sa_tst_jump(label) int label;
;{
;	ol("OR   BX, BX");
;	ol("JNZ  $+5");
;	ot("JMP  ");
;	printlabel(label);
;	nl();
;}  ****/
;
;/* ver_2 - Test the primary register and jump if false to label */
;/** the supplied condition, tf, dictates which form to codegen **/
;/**** caller - logical_tst2(label,tf); !abandoned! --
;sa_tst2_jmp(label, tf) int label, tf;
;{
;	ol("OR   BX,BX");
;	if (tf)  ot("JNZ  ");
;	else     ot("JZ   ");
;	printlabel(label);
;	nl();
;}  ****/
;
;/** ver_3 **/
;sa_if_tst(t_lbl,flab1) int t_lbl, flab1;
sa_if_tst:
	PUSH BP
	SUB  SP, AutoC1161
	MOV  BP, SP

;{
;	ol("OR   BX, BX");
	MOV  BX, L_1161+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("JNZ  ");
	MOV  BX, L_1161+12
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(t_lbl);
	LEA  BX, [AutoC1161+6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	nl();
	CALL nl
;	ot("JMP  ");
	MOV  BX, L_1161+18
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(flab1);
	LEA  BX, [AutoC1161+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	nl();
	CALL nl
;}
	POP  BP
	RET

AutoC1161	EQU 0
;	t_lbl	VAR	INT	+6
;	flab1	VAR	INT	+4

	  [SECTION .dseg]
L_1161	DB "OR   BX, BX",0
	DB "JNZ  ",0
	DB "JMP  ",0

	  [SECTION .cseg]
;
;sa_do_tst(t_lbl,flab1) int t_lbl, flab1;
sa_do_tst:
	PUSH BP
	SUB  SP, AutoC1162
	MOV  BP, SP

;{  /** do .. while specific **/
;	ol("OR   BX, BX");
	MOV  BX, L_1162+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("JNZ  ");
	MOV  BX, L_1162+12
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(t_lbl);
	LEA  BX, [AutoC1162+6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	nl();
	CALL nl
;	ot("JMP  ");
	MOV  BX, L_1162+18
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(flab1);
	LEA  BX, [AutoC1162+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	nl();
	CALL nl
;	sa_mk_lbl(t_lbl);	/** codegen true branch label here **/
	LEA  BX, [AutoC1162+6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1162	EQU 0
;	t_lbl	VAR	INT	+6
;	flab1	VAR	INT	+4

	  [SECTION .dseg]
L_1162	DB "OR   BX, BX",0
	DB "JNZ  ",0
	DB "JMP  ",0

	  [SECTION .cseg]
;
;/** Added, Modified for NASM, caller dumpstatics() **/
;
;def_sizein()
def_sizein:
	PUSH BP
	SUB  SP, AutoC1163
	MOV  BP, SP

;{
;	ot("TIMES "); /**ot("DS ");**/
	MOV  BX, L_1163+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1163	EQU 0

	  [SECTION .dseg]
L_1163	DB "TIMES ",0

	  [SECTION .cseg]
;
;/*Print pseudo-op to define storage (Character). */
;/** caller dumpstatics() **/
;
;defstorchr()
defstorchr:
	PUSH BP
	SUB  SP, AutoC1164
	MOV  BP, SP

;{
;	ot("DB 0"); /** RB **/
	MOV  BX, L_1164+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1164	EQU 0

	  [SECTION .dseg]
L_1164	DB "DB 0",0

	  [SECTION .cseg]
;
;/*Print pseudo-op to define storage (Integer). */
;/** caller dumpstatics() **/
;
;defstorint()
defstorint:
	PUSH BP
	SUB  SP, AutoC1165
	MOV  BP, SP

;{
;	ot("DW 0"); /** RW **/
	MOV  BX, L_1165+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1165	EQU 0

	  [SECTION .dseg]
L_1165	DB "DW 0",0

	  [SECTION .cseg]
;
;/*Print pseudo-op to define storage (Pointer). */
;/** caller dumpstatics() **/
;
;defstorptr()
defstorptr:
	PUSH BP
	SUB  SP, AutoC1166
	MOV  BP, SP

;{
;	ot("DW 0"); /** RW **/
	MOV  BX, L_1166+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1166	EQU 0

	  [SECTION .dseg]
L_1166	DB "DW 0",0

	  [SECTION .cseg]
;
;/* Print pseudo-op to define a byte */
;
;defbyte()
defbyte:
	PUSH BP
	SUB  SP, AutoC1167
	MOV  BP, SP

;{
;	ot("DB ");
	MOV  BX, L_1167+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1167	EQU 0

	  [SECTION .dseg]
L_1167	DB "DB ",0

	  [SECTION .cseg]
;
;/* Print pseudo-op to define a word */
;
;defword()
defword:
	PUSH BP
	SUB  SP, AutoC1168
	MOV  BP, SP

;{
;	ot("DW ");
	MOV  BX, L_1168+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1168	EQU 0

	  [SECTION .dseg]
L_1168	DB "DW ",0

	  [SECTION .cseg]
;
;/* Modify the stack pointer to the new value indicated */
;
;sa_modstk(newsp) int newsp;
sa_modstk:
	PUSH BP
	SUB  SP, AutoC1169
	MOV  BP, SP

;{
;	int k;
;
;	k = newsp - Csp;
	LEA  BX, [AutoC1169-2+BP]
	PUSH BX
	LEA  BX, [AutoC1169+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word Csp]
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	if (k == 0)  return newsp;
	LEA  BX, [AutoC1169-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1170
	JMP  L_1171
L_1170:
	LEA  BX, [AutoC1169+4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1169
	POP  BP
	RET
;	ot("ADD  SP, ");
L_1171:
	MOV  BX, L_1169+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;	outdec(k);
	LEA  BX, [AutoC1169-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outdec
	ADD  SP, +2
;	nl();
	CALL nl
;	return newsp;
	LEA  BX, [AutoC1169+4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1169
	POP  BP
	RET
;}

AutoC1169	EQU 2
;	newsp	VAR	INT	+4
;	k	VAR	INT	-2

	  [SECTION .dseg]
L_1169	DB "ADD  SP, ",0

	  [SECTION .cseg]
;
;/* Modify the stack pointer to the new value indicated */
;
;sa_rtnstk(newsp) int newsp;
sa_rtnstk:
	PUSH BP
	SUB  SP, AutoC1172
	MOV  BP, SP

;{
;	if (Msp != 0)
	MOV  BX, [Word Msp]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1173
	JMP  L_1174
L_1173:
;		{
;		ot("ADD  SP, ");	/*Remove frame from stack.*/
	MOV  BX, L_1172+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;		ostklbl();
	CALL ostklbl
;		nl();
	CALL nl
;		}
;	ol("POP  BP");
L_1174:
	MOV  BX, L_1172+10
	PUSH BX
	CALL ol
	ADD  SP, +2
;	return newsp;
	LEA  BX, [AutoC1172+4+BP]
	MOV  BX, [BX]
	POP  BP
	RET
;}

AutoC1172	EQU 0
;	newsp	VAR	INT	+4

	  [SECTION .dseg]
L_1172	DB "ADD  SP, ",0
	DB "POP  BP",0

	  [SECTION .cseg]
;
;/* Double the primary register */
;
;sa_doublereg()
sa_doublereg:
	PUSH BP
	SUB  SP, AutoC1175
	MOV  BP, SP

;{
;	ol("SAL  BX, 1");
	MOV  BX, L_1175+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1175	EQU 0

	  [SECTION .dseg]
L_1175	DB "SAL  BX, 1",0

	  [SECTION .cseg]
;
;/* Add the primary and secondary registers */
;/*	(results in primary) */
;
;sa_add()
sa_add:
	PUSH BP
	SUB  SP, AutoC1176
	MOV  BP, SP

;{
;	ol("ADD  BX, DX");
	MOV  BX, L_1176+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1176	EQU 0

	  [SECTION .dseg]
L_1176	DB "ADD  BX, DX",0

	  [SECTION .cseg]
;
;/* Subtract the primary register from the secondary */
;/*	(results in primary) */
;
;sa_sub()
sa_sub:
	PUSH BP
	SUB  SP, AutoC1177
	MOV  BP, SP

;{
;	ol("SUB  DX, BX");
	MOV  BX, L_1177+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("MOV  BX, DX");
	MOV  BX, L_1177+12
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1177	EQU 0

	  [SECTION .dseg]
L_1177	DB "SUB  DX, BX",0
	DB "MOV  BX, DX",0

	  [SECTION .cseg]
;
;/* Multiply the primary and secondary registers */
;/*	(results in primary) */
;
;sa_mult()
sa_mult:
	PUSH BP
	SUB  SP, AutoC1178
	MOV  BP, SP

;{
;	ol("MOV  AX, BX");
	MOV  BX, L_1178+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("PUSH DX");
	MOV  BX, L_1178+12
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("MUL  DX");
	MOV  BX, L_1178+20
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("POP  DX");
	MOV  BX, L_1178+28
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("MOV  BX, AX");
	MOV  BX, L_1178+36
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1178	EQU 0

	  [SECTION .dseg]
L_1178	DB "MOV  AX, BX",0
	DB "PUSH DX",0
	DB "MUL  DX",0
	DB "POP  DX",0
	DB "MOV  BX, AX",0

	  [SECTION .cseg]
;
;/* Divide the secondary register by the primary */
;/*	(quotient in primary, remainder in secondary) */
;
;sa_div()
sa_div:
	PUSH BP
	SUB  SP, AutoC1179
	MOV  BP, SP

;{
;	ol("MOV  AX, DX");
	MOV  BX, L_1179+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("CWD");
	MOV  BX, L_1179+12
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("DIV  BX");
	MOV  BX, L_1179+16
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("MOV  BX, AX");
	MOV  BX, L_1179+24
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1179	EQU 0

	  [SECTION .dseg]
L_1179	DB "MOV  AX, DX",0
	DB "CWD",0
	DB "DIV  BX",0
	DB "MOV  BX, AX",0

	  [SECTION .cseg]
;
;/* Compute remainder (modulo) of secondary register */
;/*	divided by the primary */
;/*	(remainder in primary, quotient in secondary) */
;
;sa_modulo()
sa_modulo:
	PUSH BP
	SUB  SP, AutoC1180
	MOV  BP, SP

;{
;	sa_div();
	CALL sa_div
;	sa_swap();
	CALL sa_swap
;}
	POP  BP
	RET

AutoC1180	EQU 0
;
;/* Inclusive 'or' the primary and the secondary registers */
;/*	(results in primary) */
;
;sa_or()
sa_or:
	PUSH BP
	SUB  SP, AutoC1181
	MOV  BP, SP

;{
;	ol("OR   BX, DX");
	MOV  BX, L_1181+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1181	EQU 0

	  [SECTION .dseg]
L_1181	DB "OR   BX, DX",0

	  [SECTION .cseg]
;
;/* Exclusive 'or' the primary and seconday registers */
;/*	(results in primary) */
;
;sa_xor()
sa_xor:
	PUSH BP
	SUB  SP, AutoC1182
	MOV  BP, SP

;{
;	ol("XOR  BX, DX");
	MOV  BX, L_1182+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1182	EQU 0

	  [SECTION .dseg]
L_1182	DB "XOR  BX, DX",0

	  [SECTION .cseg]
;
;/* 'And' the primary and secondary registers */
;/*	(results in primary) */
;
;sa_and()
sa_and:
	PUSH BP
	SUB  SP, AutoC1183
	MOV  BP, SP

;{
;	ol("AND  BX, DX");
	MOV  BX, L_1183+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1183	EQU 0

	  [SECTION .dseg]
L_1183	DB "AND  BX, DX",0

	  [SECTION .cseg]
;
;/* Arithmetic shift right the secondary register by the */
;/*  count in the primary (results in primary) */
;
;sa_asr()
sa_asr:
	PUSH BP
	SUB  SP, AutoC1184
	MOV  BP, SP

;{
;	ol("MOV  CX, BX");
	MOV  BX, L_1184+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("SAR  DX, CL");
	MOV  BX, L_1184+12
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("MOV  BX, DX");
	MOV  BX, L_1184+24
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1184	EQU 0

	  [SECTION .dseg]
L_1184	DB "MOV  CX, BX",0
	DB "SAR  DX, CL",0
	DB "MOV  BX, DX",0

	  [SECTION .cseg]
;
;/* Arithmetic left shift the secondary register by the */
;/*  count in the primary. (results in primary) */
;
;sa_asl()
sa_asl:
	PUSH BP
	SUB  SP, AutoC1185
	MOV  BP, SP

;{
;	ol("MOV  CX, BX");
	MOV  BX, L_1185+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("SAL  DX, CL");
	MOV  BX, L_1185+12
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("MOV  BX, DX");
	MOV  BX, L_1185+24
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1185	EQU 0

	  [SECTION .dseg]
L_1185	DB "MOV  CX, BX",0
	DB "SAL  DX, CL",0
	DB "MOV  BX, DX",0

	  [SECTION .cseg]
;
;/* Form two's complement of primary register */
;
;sa_neg()
sa_neg:
	PUSH BP
	SUB  SP, AutoC1186
	MOV  BP, SP

;{
;	ol("NEG  BX");
	MOV  BX, L_1186+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1186	EQU 0

	  [SECTION .dseg]
L_1186	DB "NEG  BX",0

	  [SECTION .cseg]
;
;/* Form one's complement of primary register */
;sa_not()
sa_not:
	PUSH BP
	SUB  SP, AutoC1187
	MOV  BP, SP

;{
;	ol("NOT  BX");
	MOV  BX, L_1187+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1187	EQU 0

	  [SECTION .dseg]
L_1187	DB "NOT  BX",0

	  [SECTION .cseg]
;
;/* Increment the primary register by one */
;
;sa_inc()
sa_inc:
	PUSH BP
	SUB  SP, AutoC1188
	MOV  BP, SP

;{
;	ol("INC  BX");
	MOV  BX, L_1188+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1188	EQU 0

	  [SECTION .dseg]
L_1188	DB "INC  BX",0

	  [SECTION .cseg]
;
;/* Decrement the primary register by one */
;
;sa_dec()
sa_dec:
	PUSH BP
	SUB  SP, AutoC1189
	MOV  BP, SP

;{
;	ol("DEC  BX");
	MOV  BX, L_1189+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1189	EQU 0

	  [SECTION .dseg]
L_1189	DB "DEC  BX",0

	  [SECTION .cseg]
;
;/* Following are the conditional operators */
;/* They compare the secondary register against the primary */
;/* and put a literal 1 in the primary if the condition is */
;/* true, otherwise they clear the primary register */
;
;/* Test for equal */
;
;sa_eq()
sa_eq:
	PUSH BP
	SUB  SP, AutoC1190
	MOV  BP, SP

;{
;	sa_callrts("cceq");
	MOV  BX, L_1190+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1190	EQU 0

	  [SECTION .dseg]
L_1190	DB "cceq",0

	  [SECTION .cseg]
;
;/* Test for not equal */
;
;sa_not_equal()
sa_not_equal:
	PUSH BP
	SUB  SP, AutoC1191
	MOV  BP, SP

;{
;	sa_callrts("ccne");
	MOV  BX, L_1191+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1191	EQU 0

	  [SECTION .dseg]
L_1191	DB "ccne",0

	  [SECTION .cseg]
;
;/* Test for less than (signed) */
;
;sa_sless_than()
sa_sless_tha:
	PUSH BP
	SUB  SP, AutoC1192
	MOV  BP, SP

;{
;	sa_callrts("cclt");
	MOV  BX, L_1192+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1192	EQU 0

	  [SECTION .dseg]
L_1192	DB "cclt",0

	  [SECTION .cseg]
;
;/* Test for less than or equal to (signed) */
;
;sa_sless_or_eq()
sa_sless_or_:
	PUSH BP
	SUB  SP, AutoC1193
	MOV  BP, SP

;{
;	sa_callrts("ccle");
	MOV  BX, L_1193+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1193	EQU 0

	  [SECTION .dseg]
L_1193	DB "ccle",0

	  [SECTION .cseg]
;
;/* Test for greater than (signed) */
;
;sa_sgreater_than()
sa_sgreater_:
	PUSH BP
	SUB  SP, AutoC1194
	MOV  BP, SP

;{
;	sa_callrts("ccgt");
	MOV  BX, L_1194+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1194	EQU 0

	  [SECTION .dseg]
L_1194	DB "ccgt",0

	  [SECTION .cseg]
;
;/* Test for greater than or equal to (signed) */
;
;sa_sge()
sa_sge:
	PUSH BP
	SUB  SP, AutoC1195
	MOV  BP, SP

;{
;	sa_callrts("ccge");
	MOV  BX, L_1195+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1195	EQU 0

	  [SECTION .dseg]
L_1195	DB "ccge",0

	  [SECTION .cseg]
;
;/* Test for less than (unsigned) */
;
;sa_uless_than()
sa_uless_tha:
	PUSH BP
	SUB  SP, AutoC1196
	MOV  BP, SP

;{
;	sa_callrts("ccult");
	MOV  BX, L_1196+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1196	EQU 0

	  [SECTION .dseg]
L_1196	DB "ccult",0

	  [SECTION .cseg]
;
;/* Test for less than or equal to (unsigned) */
;
;sa_uless_oreq()
sa_uless_ore:
	PUSH BP
	SUB  SP, AutoC1197
	MOV  BP, SP

;{
;	sa_callrts("ccule");
	MOV  BX, L_1197+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1197	EQU 0

	  [SECTION .dseg]
L_1197	DB "ccule",0

	  [SECTION .cseg]
;
;/* Test for greater than (unsigned) */
;
;sa_ugt()
sa_ugt:
	PUSH BP
	SUB  SP, AutoC1198
	MOV  BP, SP

;{
;	sa_callrts("ccugt");
	MOV  BX, L_1198+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1198	EQU 0

	  [SECTION .dseg]
L_1198	DB "ccugt",0

	  [SECTION .cseg]
;
;/* Test for greater than or equal to (unsigned) */
;
;sa_uge()
sa_uge:
	PUSH BP
	SUB  SP, AutoC1199
	MOV  BP, SP

;{
;	sa_callrts("ccuge");
	MOV  BX, L_1199+0
	PUSH BX
	CALL sa_callrts
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1199	EQU 0

	  [SECTION .dseg]
L_1199	DB "ccuge",0

	  [SECTION .cseg]
;
;/** Convert primary value into logical (boolean) value, **/
;/** that is, (0 if 0, 1 otherwise) **/
;
;sa_mk_bool()
sa_mk_bool:
	PUSH BP
	SUB  SP, AutoC1200
	MOV  BP, SP

;{
;	int t_lbl;
;
;	t_lbl = getlabel();	/** make a unique label for our use **/
	LEA  BX, [AutoC1200-2+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	ol("AND  BX, 0FFFFh");
	MOV  BX, L_1200+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("JZ   ");		/** already zero. **/
	MOV  BX, L_1200+16
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(t_lbl);
	LEA  BX, [AutoC1200-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	nl();
	CALL nl
;	ol("MOV  BX, 1");		/** .else. > 0, set to one. **/
	MOV  BX, L_1200+22
	PUSH BX
	CALL ol
	ADD  SP, +2
;	sa_mk_lbl(t_lbl);	/** codegen true branch label here **/
	LEA  BX, [AutoC1200-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;}
	ADD  SP, AutoC1200
	POP  BP
	RET

AutoC1200	EQU 2
;	t_lbl	VAR	INT	-2

	  [SECTION .dseg]
L_1200	DB "AND  BX, 0FFFFh",0
	DB "JZ   ",0
	DB "MOV  BX, 1",0

	  [SECTION .cseg]
;
;/** Convert primary value into logical not (boolean) value, **/
;/** that is, (1 if 0, 0 otherwise) **/
;
;sa_mk_nbool()
sa_mk_nbool:
	PUSH BP
	SUB  SP, AutoC1201
	MOV  BP, SP

;{
;	int t_lbl, f_lbl;
;
;	t_lbl = getlabel();	/** make a unique label for our use **/
	LEA  BX, [AutoC1201-2+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	f_lbl = getlabel();
	LEA  BX, [AutoC1201-4+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;
;	ol("AND  BX, 0FFFFh");
	MOV  BX, L_1201+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("JNZ  ");		/** jz means already zero. **/
	MOV  BX, L_1201+16
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(t_lbl);
	LEA  BX, [AutoC1201-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	nl();
	CALL nl
;
;	ol("MOV  BX, 1");		/** .else. zero, invert to one. **/
	MOV  BX, L_1201+22
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("JMP  ");
	MOV  BX, L_1201+33
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(f_lbl);
	LEA  BX, [AutoC1201-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	nl();
	CALL nl
;
;	sa_mk_lbl(t_lbl);	/** codegen true branch label here **/
	LEA  BX, [AutoC1201-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;	ol("MOV  BX, 0"); /** invert to zero **/
	MOV  BX, L_1201+39
	PUSH BX
	CALL ol
	ADD  SP, +2
;	sa_mk_lbl(f_lbl);
	LEA  BX, [AutoC1201-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;}
	ADD  SP, AutoC1201
	POP  BP
	RET

AutoC1201	EQU 4
;	t_lbl	VAR	INT	-2
;	f_lbl	VAR	INT	-4

	  [SECTION .dseg]
L_1201	DB "AND  BX, 0FFFFh",0
	DB "JNZ  ",0
	DB "MOV  BX, 1",0
	DB "JMP  ",0
	DB "MOV  BX, 0",0

	  [SECTION .cseg]
;
;
;/** EO C86N-9.C **/
;/** Need #include IOLIB.C **/
;/** #include C5LIB_CZ.C **/
;
;/** #include strcpy.c **/
;#include strcmp.c
;/*-----------------------------------------------------------------------75
;** File: strcmp.c
;** Last: 15-May-11 08:44:16 AM
;** Init: 10-May-11 09:09:46 PM
;** Vers: 0r1
;** TCPL pg.101
;** Compare character strings src & dest: returns negative, zero or
;** positive according as src is lexicographically less than, equal to, or
;** greater than than dest.  The value returned is obtained by subtracting
;** the characters at the first position where src and dest disagree.
;*/
;
;/*-----------------------------------------------------------------------75
;** 10-May-11 09:09:46 PM - v.0r0, initial.
;** 15-May-11 08:44:16 AM - v.0r1, fix typo.
;*/
;
;/** return <0 if src < dest, 0 if src == dest, >0 if src > dest **/
;
;strcmp(src,dest) char src[], dest[];
strcmp:
	PUSH BP
	SUB  SP, AutoC1202
	MOV  BP, SP

;{
;	int i;
;
;	i = 0;
	LEA  BX, [AutoC1202-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (src[i] == dest[i])
L_1203:
	LEA  BX, [AutoC1202+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1202-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	LEA  BX, [AutoC1202+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1202-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1204
	JMP  L_1205
L_1204:
;		if (src[i++] == 0) return (0);
	LEA  BX, [AutoC1202+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1202-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1206
	JMP  L_1207
L_1206:
	MOV  BX, +0
	ADD  SP, AutoC1202
	POP  BP
	RET
;	return (src[i] - dest[i]);
L_1207:
	JMP  L_1203
L_1205:
	LEA  BX, [AutoC1202+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1202-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	LEA  BX, [AutoC1202+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1202-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	ADD  SP, AutoC1202
	POP  BP
	RET
;}

AutoC1202	EQU 2
;	src	PTR	CHAR	+6
;	dest	PTR	CHAR	+4
;	i	VAR	INT	-2
;/** eo strcmp **/
;#include itoa.c
;/*-----------------------------------------------------------------------75
;** File: itoa.0r1.c	By: s_dubrovich@yahoo.com
;** ?(c): COPYLEFT
;** Last: 12-May-11 06:37:41 PM
;** Prev: 12-May-11 06:37:41 PM
;** Init: 12-May-11 06:37:41 PM
;** Vers: 0r1
;** Note: This is a misc function, support to small-c.
;**  small-c doesn't handle: char *list[numb] - declare as int's.
;**-----------------------------------------------------------------------75
;** 12-May-11 01:50:46 PM - v. 0r1, edits, added ccgt()
;** 12-May-11 06:37:41 PM - added itoa(), ccge()
;*/
;
;/***-----------------------------------------------***/
;/***             S U B R O U T I N E S             ***/
;/***-----------------------------------------------***/
;
;/*-----------------------------------------------------------------------75
;** itoa(i) int i;   return -> char &str[0]
;** -convert int to ascii decimal string. return &str[0] or -1 on error.
;*/
;
;char nstr[6];	/** static array for number to decimal str conversion **/
;
;itoa(i) int i;
itoa:
	PUSH BP
	SUB  SP, AutoC1208
	MOV  BP, SP

;{
;	int number, ndx, divisor;
;	char digit;
;
;	ndx = 0;
	LEA  BX, [AutoC1208-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	divisor = 10000;	/** printable range for int is 0..65535 **/
	LEA  BX, [AutoC1208-6+BP]
	PUSH BX
	MOV  BX, +10000
	POP  DI
	MOV  Word [DI], BX
;	number = i;
	LEA  BX, [AutoC1208-2+BP]
	PUSH BX
	LEA  BX, [AutoC1208+4+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;
;	while (divisor >= 1)
L_1209:
	LEA  BX, [AutoC1208-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL ccge
	OR   BX, BX
	JNZ  L_1210
	JMP  L_1211
L_1210:
;		{
;		digit = number / divisor + '0';
	LEA  BX, [AutoC1208-7+BP]
	PUSH BX
	LEA  BX, [AutoC1208-2+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1208-6+BP]
	MOV  BX, [BX]
	POP  DX
	MOV  AX, DX
	CWD
	DIV  BX
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Byte [DI], BL
;
;		/** fill number str array **/
;		/** putchar(c); ** pass back ptr to decimal str for user **/
;
;		nstr[ndx++] = digit;
	MOV  BX, nstr
	PUSH BX
	LEA  BX, [AutoC1208-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1208-7+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		
;		number = number % divisor;
	LEA  BX, [AutoC1208-2+BP]
	PUSH BX
	LEA  BX, [AutoC1208-2+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1208-6+BP]
	MOV  BX, [BX]
	POP  DX
	MOV  AX, DX
	CWD
	DIV  BX
	MOV  BX, AX
	XCHG BX, DX
	POP  DI
	MOV  Word [DI], BX
;		divisor = divisor / 10;
	LEA  BX, [AutoC1208-6+BP]
	PUSH BX
	LEA  BX, [AutoC1208-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +10
	POP  DX
	MOV  AX, DX
	CWD
	DIV  BX
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;		}
	JMP  L_1209
L_1211:
;	nstr[ndx] = 0;
	MOV  BX, nstr
	PUSH BX
	LEA  BX, [AutoC1208-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;	return (&nstr[0]);
	MOV  BX, nstr
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	ADD  SP, AutoC1208
	POP  BP
	RET
;}				/** EO itoa **/

AutoC1208	EQU 7
;	i	VAR	INT	+4
;	number	VAR	INT	-2
;	ndx	VAR	INT	-4
;	divisor	VAR	INT	-6
;	digit	VAR	CHAR	-7
;
;/** EO ITOA.C **/
;#include RELAT.C
;/**
;;; File: relat.C  By: s_dubrovich@yahoo.com
;;; Last: 19-Dec-10 04:58:11 PM
;;; Prev: 02/08/2010
;;; Primary Register := BX, Secondary Register := DX
;**/
;
;/* Following are the conditional operators */
;/* They compare the secondary register against the primary */
;/* and put a value of 1 in the primary if the condition is */
;/* true, otherwise they clear the primary register */
;
;
;cceq()
cceq:
	PUSH BP
	SUB  SP, AutoC1212
	MOV  BP, SP

;{
;#asm
               ; /* Test for equal */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JZ   $+5
  MOV  BX, 0   ;   /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1212	EQU 0
;
;ccne()
ccne:
	PUSH BP
	SUB  SP, AutoC1213
	MOV  BP, SP

;{
;#asm
               ; /* Test for not equal */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JNZ  $+5
  MOV  BX, 0   ;   /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1213	EQU 0
;
;cclt()
cclt:
	PUSH BP
	SUB  SP, AutoC1214
	MOV  BP, SP

;{
;#asm           ; /* Test for less than (signed) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JL   $+5 
  MOV  BX, 0   ;   /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1214	EQU 0
;
;ccle()
ccle:
	PUSH BP
	SUB  SP, AutoC1215
	MOV  BP, SP

;{
;#asm           ; /* Test for less than or equal to (signed) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;  /** assume true **/
  JLE  $+5
  MOV  BX, 0   ;  /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1215	EQU 0
;
;ccgt()
ccgt:
	PUSH BP
	SUB  SP, AutoC1216
	MOV  BP, SP

;{
;#asm           ; /* Test for greater than (signed) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JG   $+5
  MOV  BX, 0   ;   /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1216	EQU 0
;
;ccge()
ccge:
	PUSH BP
	SUB  SP, AutoC1217
	MOV  BP, SP

;{
;#asm           ; /* Test for greater than or equal to (signed) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JGE  $+5
  MOV  BX, 0   ;   /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1217	EQU 0
;
;ccult()
ccult:
	PUSH BP
	SUB  SP, AutoC1218
	MOV  BP, SP

;{
;#asm           ; /* Test for less than (unsigned) */
  CMP  DX, BX  ;  /** sets flags **/  
  MOV  BX, 1   ;   /** assume true **/
  JB   $+5
  MOV  BX, 0   ;   /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1218	EQU 0
;
;ccule()
ccule:
	PUSH BP
	SUB  SP, AutoC1219
	MOV  BP, SP

;{
;#asm           ; /* Test for less than or equal to (unsigned) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JBE  $+5
  MOV  BX, 0   ;   /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1219	EQU 0
;
;ccugt()
ccugt:
	PUSH BP
	SUB  SP, AutoC1220
	MOV  BP, SP

;{
;#asm           ; /* Test for greater than (unsigned) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JA   $+5
  MOV  BX, 0   ;   /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1220	EQU 0
;
;ccuge()
ccuge:
	PUSH BP
	SUB  SP, AutoC1221
	MOV  BP, SP

;{
;#asm           ; /* Test for greater than or equal to (unsigned) */
  CMP  DX, BX  ;  /** sets flags **/
  MOV  BX, 1   ;   /** assume true **/
  JAE  $+5
  MOV  BX, 0   ;   /** is false **/
;#endasm
;}
	POP  BP
	RET

AutoC1221	EQU 0
;
;/** -= eof relat.c =- **/
;#include PCDOSLIB.C
;
;/*-----------------------------------------------------------------------75
;** File: PCDOSLIB.0rB.C  By: s_dubrovich@yahoo.com
;** ?(c): COPYLEFT
;** Last: 18-Jun-11 06:34:34 PM  	By: s_dubrovich@yahoo.com
;** Prev: 11-Jun-11 03:01:50 PM,16-Jun-11 01:02:20 PM,17-Jun-11 07:05:37 AM
;** Vers: 0r7
;** 02-Jun-11 08:50:35 AM - added DebugFlag
;** 02-Jun-11 08:50:35 AM - added fclose notification of fp#.
;** 09-Jun-11 07:23:44 PM - conv gets to using handle STDIN, added; getstr,
;**  getcstr, fgetline.
;** 10-Jun-11 01:58:35 PM - v.0r6, edits
;** 11-Jun-11 01:17:35 PM - added strcpy back in. prior was chgd to strxcpy.
;** 11-Jun-11 03:01:50 PM - fix gets
;** 16-Jun-11 01:02:20 PM - fix getc`in_port->initialize.
;** 17-Jun-11 07:05:37 AM - added putsline()
;** 18-Jun-11 06:34:34 PM - added fputc() note, fix comma instead of semicolon.
;*/
;/*-----------------------------------------------------------------------75
;** File: pcdoslib.0r8.c	By: s_dubrovich@yahoo.com
;** ?(c): COPYLEFT
;** Last: 30-May-11 11:48:34 AM
;** Prev: 21-May-11 01:55:28 PM,21-May-11 02:39:13 PM,23-May-11 07:26:13 AM
;** Init: 07-May-11 09:05:49 AM
;** Vers: 0r8
;** Note: This is a pcdos IO library, support to small-c.
;**  small-c doesn't handle: char *list[numb] - declare as int's.
;**-----------------------------------------------------------------------75
;** 07-May-11 09:05:49 AM - v.0r1, initial, puts()
;** 07-May-11 09:34:18 AM - edits.
;** 08-May-11 08:08:10 AM - explict .cseg & .dseg in #asm
;** 08-May-11 09:31:03 AM - chg stack frame to pass address to store CF val.
;** 08-May-11 10:19:02 AM - ren exit->_exit
;** 09-May-11 11:48:55 AM - edits.
;** 10-May-11 11:50:53 AM - expanded creat()
;** 10-May-11 02:19:10 PM - fix hptr[FNAME] -> &hptr[FNAME]
;** 11-May-11 02:11:03 PM - v.0r3, creat() works in v.0r2, chg method to
;**  if fopen() fails on fnf, creat() file. -added DEBUG flag for msgs.
;**  fopem() modes "R","W".
;** 12-May-11 01:06:18 PM - build out functions..
;** 13-May-11 07:53:55 AM - v.0r4, combating access denied, use fn 6Ch.
;** 13-May-11 11:32:25 AM - chg'd fopen, fclose.
;** 14-May-11 09:08:47 AM - fix str termination, save _CX_ on error.
;**  -version 0r4- chgs ABI from stack vars to static register vars.
;** 15-May-11 07:57:55 AM - v.0r4, chg ABI.
;** 15-May-11 11:08:35 AM - chg'd fseek var.
;**   - v.0r6, chg'd file mode, _IOD layout.
;** 18-May-11 08:38:17 AM - v.0r7, chg File Modes recognition. 
;** 19-May-11 09:12:54 PM - fix typo in fopen().
;** 21-May-11 08:33:39 AM - more work on getc() and fread().
;** 21-May-11 01:55:28 PM - inport -> &inport, getc()`0->eof.
;** 21-May-11 02:39:13 PM - added name exit:
;** 23-May-11 07:26:13 AM - chg use of strcpy to linecpy to strip CR in gets().
;** 30-May-11 11:48:34 AM - v.0r8, edits, getc() edited.
;** 01-Jun-11 11:03:23 PM - added fgets(), fputs(), fgetpos(), fsetpos()
;**-----------------------------------------------------------------------75
;*/
;
;/** Req'd IO Functions for Small-c              **/
;/** getc(){;} gets(){;} putc(){;}               **/
;/** putchar(){;} fopen(){;} fclose(){;}         **/
;
;#define DEBUG 1	/** set to 1 to emit runtime state messages, else 0 **/
;			/** #define NULL  0 **/
;/** -see include.h..
;#define STDIN	0
;#define STDOUT	1	
;#define STDERR	2
;**/
;
;#define MAXLENGTH 128	/** max input line length including CR,LF **/
;
;/*
;** -= Handle Files =-
;**
;** 1. Create an ASCIIZ filename string.
;** 2. OPEN or CREATE the file.
;** 3. SEEK a file pointer to a position in the file.
;** 4. READ from or WRITE to file at the SEEK position.
;** 5. CLOSE the file.
;*/
;
;/** pcDos Handle Functions **/
;#define FCREAT_FN 60	/** 3Ch **/
;#define FOPEN_FN	61	/** 3Dh **/
;#define FCLOSE_FN 62	/** 3Eh **/
;#define FREAD_FN	63	/** 3Fh **/
;#define FWRITE_FN	64	/** 40h **/
;#define FDELETE_FN 65	/** 41h **/
;#define FSEEK_FN	66	/** 42h **/
;#define EFOPEN_FN 108	/** 6Ch **/
;
;#define SEEK_BEG	0	/** base origin from beginning of file **/
;#define SEEK_CUR	1	/** base origin from current position  **/
;#define SEEK_END	2	/** base origin from end position      **/
;
;/** #if PCDOS		*****************************/
;#define EXIT         0	/* Exit to pcDOS            */
;#define CONIN        1	/* direct echoing con input */
;#define CONOUT       2	/* Direct console output    */
;#define LSTOUT       5	/* Direct list device output*/
;#define CONIO        6	/* Direct console I/O       */
;#define C_WRITESTR   9	/* Console string output    */
;#define STDIN_fn10  10	/* Read console buffer      */
;#define C_STAT      11	/* Get console status       */
;#define OPEN        15	/* OPEN a disk file         */
;#define CLOSE       16	/* Close a disk file        */
;#define SEARCHF     17	/* Search for first         */
;#define SEARCHN     18	/* Search for next          */
;#define DELETE      19	/* Delete a disk file       */
;#define SEQREAD     20	/* seq read                 */
;#define SEQWRITE    21	/* seq write                */
;#define CREATE      22	/* Create a disk file       */
;#define F_RENAME    23	/* Rename a disk file       */
;#define SETDMA      26	/* Set DMA address          */
;#define B_READ      33	/* Read Random record       */
;#define B_WRITE     34	/* Write Random record      */
;#define FILSIZ      35	/* Compute File Size        */
;/** #endif              *****************************/
;
;#define BAD	(-1)
;/* #define EOF	(-1)
;** #define CR	13
;** #define LF	10
;*/
;
;#define FBUFFSIZE	128	/** dta buffer size **/
;				/** word - File Open Mode **/
;#define MODE_RD	0	/** "r" **/
;#define MODE_WR	1	/** "w" **/
;#define MODE_RW	2	/** "+" added to "r" or "w" means RW **/
;#define MODE_APPD	8	/** means open and seek to end of file, for append **/
;#define MODE_TXT	16384	/** 4000h, is text file. **/
;#define MODE_BIN	32768	/** 8000h is binary file, flag. **/
;#define MODE_CL	-1	/** File has been closed **/
;
;/** Define File Descriptor Indexes - _IOD **/
;#define FNAMEPTR	0	/* word, PTR to caller's Path & Filename       */
;#define FMODE	2	/* word, access, 0`Read,1`Write,2`R/W, etc.    */
;#define FBUFRPTR	4	/* File DTA (io buffer for ea handle)          */
;#define LEN_IOD	6	/* 16 + 128 buffer size                        */
;
;/*-----------------------------------------------------------------------75
;**  Static Data for OSfn_ Calls/Returns
;*/
;int DebugFlag;	/** promote or suppress runtime messages **/
;int resultflg;	/** static var reflecting OSfn_ carry flag return **/
;			/** 0 = success, 1 = error. **/
;int _AX_,_BX_,_CX_,_DX_,_SI_,_DI_;	/** assign values before OSfn(); **/
;
;/*-----------------------------------------------------------------------75
;** Toggle Debug messaging state.
;*/
;
;StateDegugFlg(n) int n;
StateDegugFl:
	PUSH BP
	SUB  SP, AutoC1222
	MOV  BP, SP

;{
;	DebugFlag = n;	
	LEA  BX, [AutoC1222+4+BP]
	MOV  BX, [BX]
	MOV  Word [DebugFlag], BX
;}
	POP  BP
	RET

AutoC1222	EQU 0
;	n	VAR	INT	+4
;
;
;/*-----------------------------------------------------------------------75
;** Copy src string until null, to dest string buffer.
;** Returns: count of characters copied.
;*/
;
;strxcpy(dest,src) char *dest, *src;
strxcpy:
	PUSH BP
	SUB  SP, AutoC1223
	MOV  BP, SP

;{
;	int count;
;
;	count = 0;
	LEA  BX, [AutoC1223-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (*dest++ = *src++)
L_1224:
	LEA  BX, [AutoC1223+6+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC1223+4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
	OR   BX, BX
	JNZ  L_1225
	JMP  L_1226
L_1225:
;		{
;		count++;
	LEA  BX, [AutoC1223-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		}
	JMP  L_1224
L_1226:
;	*dest = 0;		/** null terminate string **/
	LEA  BX, [AutoC1223+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;	return (count);
	LEA  BX, [AutoC1223-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1223
	POP  BP
	RET
;}

AutoC1223	EQU 2
;	dest	PTR	CHAR	+6
;	src	PTR	CHAR	+4
;	count	VAR	INT	-2
;
;/*-----------------------------------------------------------------------75
;** -ANSI- char *strcpy(char *dest, char *src); return: dest.
;** Copy src string, null inclusive, to dest string buffer.
;*/
;
;strcpy(dest,src) char *dest, *src;
strcpy:
	PUSH BP
	SUB  SP, AutoC1227
	MOV  BP, SP

;{
;	int count,orig_dest;
;
;	count = 0;
	LEA  BX, [AutoC1227-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	orig_dest = dest;	/** save to return per ANSI **/
	LEA  BX, [AutoC1227-4+BP]
	PUSH BX
	LEA  BX, [AutoC1227+6+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	while (*dest++ = *src++)
L_1228:
	LEA  BX, [AutoC1227+6+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC1227+4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
	OR   BX, BX
	JNZ  L_1229
	JMP  L_1230
L_1229:
;		{
;		count++;
	LEA  BX, [AutoC1227-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		}
	JMP  L_1228
L_1230:
;	*dest = 0;		/** null terminate string **/
	LEA  BX, [AutoC1227+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;	return (orig_dest);
	LEA  BX, [AutoC1227-4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1227
	POP  BP
	RET
;}

AutoC1227	EQU 4
;	dest	PTR	CHAR	+6
;	src	PTR	CHAR	+4
;	count	VAR	INT	-2
;	orig_dest	VAR	INT	-4
;
;/***-------------------------------------------------------------------***/
;/** --------------------= S I M P L E   I / O =------------------------ **/
;/***-------------------------------------------------------------------***/
;
;
;/***-------------------------------------------------------------------**75
;*** codify EOL sequence... to STDOUT
;**/
;
;NLfn()
NLfn:
	PUSH BP
	SUB  SP, AutoC1231
	MOV  BP, SP

;{
;	putchar(CR); putchar(LF);
	MOV  BX, +13
	PUSH BX
	CALL putchar
	ADD  SP, +2
	MOV  BX, +10
	PUSH BX
	CALL putchar
	ADD  SP, +2
;}
	POP  BP
	RET

AutoC1231	EQU 0
;
;/*-----------------------------------------------------------------------75
;** must be null terminated, STDOUT (ok) -doesn't append '/n'.
;*/
;
;char out_bufr[MAXLENGTH];
;
;putstr(prntstr) char *prntstr;
putstr:
	PUSH BP
	SUB  SP, AutoC1232
	MOV  BP, SP

;{
;	int count, result;
;
;	count = strxcpy(out_bufr,prntstr); /** cpy until null **/
	LEA  BX, [AutoC1232-2+BP]
	PUSH BX
	MOV  BX, out_bufr
	PUSH BX
	LEA  BX, [AutoC1232+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL strxcpy
	ADD  SP, +4
	POP  DI
	MOV  Word [DI], BX
;	if (count == 0) return (-1);
	LEA  BX, [AutoC1232-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1233
	JMP  L_1234
L_1233:
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1232
	POP  BP
	RET
;
;	result = fwrite(&out_bufr[0],1,count,STDOUT);
L_1234:
	LEA  BX, [AutoC1232-4+BP]
	PUSH BX
	MOV  BX, out_bufr
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	PUSH BX
	LEA  BX, [AutoC1232-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	PUSH BX
	CALL fwrite
	ADD  SP, +8
	POP  DI
	MOV  Word [DI], BX
;		/** result is bytes written **/
;}
	ADD  SP, AutoC1232
	POP  BP
	RET

AutoC1232	EQU 4
;	prntstr	PTR	CHAR	+4
;	count	VAR	INT	-2
;	result	VAR	INT	-4
;
;
;/*-----------------------------------------------------------------------75
;** -ANSI- int puts(char *str);   string output to STDOUT, appends '\n'.
;** Ret`0`ok .else. `NZ`err
;*/
;
;char tbuff[MAXLENGTH];
;
;puts(str) char *str;
puts:
	PUSH BP
	SUB  SP, AutoC1235
	MOV  BP, SP

;{
;	int count, result;
;
;	count = strxcpy(tbuff,str);
	LEA  BX, [AutoC1235-2+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	LEA  BX, [AutoC1235+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL strxcpy
	ADD  SP, +4
	POP  DI
	MOV  Word [DI], BX
;	if (count == 0) return (-1);
	LEA  BX, [AutoC1235-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1236
	JMP  L_1237
L_1236:
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1235
	POP  BP
	RET
;
;	result = fwrite(&tbuff[0],1,count,STDOUT);
L_1237:
	LEA  BX, [AutoC1235-4+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	PUSH BX
	LEA  BX, [AutoC1235-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	PUSH BX
	CALL fwrite
	ADD  SP, +8
	POP  DI
	MOV  Word [DI], BX
;		/** result is bytes written **/
;	NLfn();
	CALL NLfn
;}
	ADD  SP, AutoC1235
	POP  BP
	RET

AutoC1235	EQU 4
;	str	PTR	CHAR	+4
;	count	VAR	INT	-2
;	result	VAR	INT	-4
;/** eo puts **/
;
;/*-----------------------------------------------------------------------75
;** -non-standard- int putsline(char *str);   string output to STDOUT, does
;** not append '\n'.
;** Ret`0`ok .else. `NZ`err
;** Requires the above: char tbuff[MAXLENGTH];
;*/
;
;putsline(str) char *str;
putsline:
	PUSH BP
	SUB  SP, AutoC1238
	MOV  BP, SP

;{
;	int count, result;
;
;	count = strxcpy(tbuff,str);
	LEA  BX, [AutoC1238-2+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	LEA  BX, [AutoC1238+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL strxcpy
	ADD  SP, +4
	POP  DI
	MOV  Word [DI], BX
;	if (count == 0) return (-1);
	LEA  BX, [AutoC1238-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1239
	JMP  L_1240
L_1239:
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1238
	POP  BP
	RET
;
;	result = fwrite(&tbuff[0],1,count,STDOUT);
L_1240:
	LEA  BX, [AutoC1238-4+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	PUSH BX
	LEA  BX, [AutoC1238-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	PUSH BX
	CALL fwrite
	ADD  SP, +8
	POP  DI
	MOV  Word [DI], BX
;		/** result is bytes written **/
;} /** eo putsline **/
	ADD  SP, AutoC1238
	POP  BP
	RET

AutoC1238	EQU 4
;	str	PTR	CHAR	+4
;	count	VAR	INT	-2
;	result	VAR	INT	-4
;
;/*-----------------------------------------------------------------------75
;** STDIN get line input..
;*/
;
;char in2_bufr[MAXLENGTH];  /** used for STDIN buffer re: getstr,getcstr. **/
;
;/*-----------------------------------------------------------------------75
;** str input thru file handle STDIN.
;** note: input stops at [enter], then CR,LF appended.
;**  -append null to CR,LF pair.
;*/
;
;getstr()
getstr:
	PUSH BP
	SUB  SP, AutoC1241
	MOV  BP, SP

;{
;	int result, ndx;
;
;	result = fread(&in2_bufr[0],1,MAXLENGTH,STDIN);
	LEA  BX, [AutoC1241-2+BP]
	PUSH BX
	MOV  BX, in2_bufr
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	PUSH BX
	MOV  BX, +128
	PUSH BX
	MOV  BX, +0
	PUSH BX
	CALL fread
	ADD  SP, +8
	POP  DI
	MOV  Word [DI], BX
;	ndx = 0;
	LEA  BX, [AutoC1241-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;
;	while (1)
L_1242:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_1243
	JMP  L_1244
L_1243:
;		{
;		if (in2_bufr[ndx] == LF)
	MOV  BX, in2_bufr
	PUSH BX
	LEA  BX, [AutoC1241-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +10
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1245
	JMP  L_1246
L_1245:
;			{
;			in2_bufr[++ndx] = 0;
	MOV  BX, in2_bufr
	PUSH BX
	LEA  BX, [AutoC1241-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			break;
	JMP  L_1244
;			}
;		if (in2_bufr[ndx] == 0) break;
L_1246:
	MOV  BX, in2_bufr
	PUSH BX
	LEA  BX, [AutoC1241-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1247
	JMP  L_1248
L_1247:
	JMP  L_1244
;
;		ndx++;
L_1248:
	LEA  BX, [AutoC1241-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		}
	JMP  L_1242
L_1244:
;}
	ADD  SP, AutoC1241
	POP  BP
	RET

AutoC1241	EQU 4
;	result	VAR	INT	-2
;	ndx	VAR	INT	-4
;
;/*-----------------------------------------------------------------------75
;** str input thru file handle STDIN. 
;** note: input stops at [enter], CR,LF appended.
;**  -replaces CR with null.
;*/
;
;getcstr()
getcstr:
	PUSH BP
	SUB  SP, AutoC1249
	MOV  BP, SP

;{
;	int result, ndx;
;
;	result = fread(&in2_bufr[0],1,MAXLENGTH,STDIN);
	LEA  BX, [AutoC1249-2+BP]
	PUSH BX
	MOV  BX, in2_bufr
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	PUSH BX
	MOV  BX, +128
	PUSH BX
	MOV  BX, +0
	PUSH BX
	CALL fread
	ADD  SP, +8
	POP  DI
	MOV  Word [DI], BX
;	ndx = 0;
	LEA  BX, [AutoC1249-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;
;	while (1)
L_1250:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_1251
	JMP  L_1252
L_1251:
;		{
;		if (in2_bufr[ndx] == CR)
	MOV  BX, in2_bufr
	PUSH BX
	LEA  BX, [AutoC1249-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +13
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1253
	JMP  L_1254
L_1253:
;			{
;			in2_bufr[ndx++] = 0;
	MOV  BX, in2_bufr
	PUSH BX
	LEA  BX, [AutoC1249-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			in2_bufr[ndx] = 0;
	MOV  BX, in2_bufr
	PUSH BX
	LEA  BX, [AutoC1249-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			break;
	JMP  L_1252
;			}
;		if (in2_bufr[ndx] == 0) break;
L_1254:
	MOV  BX, in2_bufr
	PUSH BX
	LEA  BX, [AutoC1249-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1255
	JMP  L_1256
L_1255:
	JMP  L_1252
;
;		ndx++;
L_1256:
	LEA  BX, [AutoC1249-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		}
	JMP  L_1250
L_1252:
;}
	ADD  SP, AutoC1249
	POP  BP
	RET

AutoC1249	EQU 4
;	result	VAR	INT	-2
;	ndx	VAR	INT	-4
;
;
;/*-----------------------------------------------------------------------75
;** --------------= F I L E   I / O =-------------- **
;***-----------------------------------------------***
;** NOTE: use HANDLE functions of 3Ch and up. 
;**  -see also Fn 6Ch for pcdos v.4 (not implemented)
;*/
;
;/**- These first 6 functions are required by a small-c implementation. -**/
;
;/*-----------------------------------------------------------------------75
;** (i.) define getc(){;}
;** int getc(FILE *fp); -read next unsigned chr from file, returns int.
;**  Returns: unsigned char cast to int, or -1 (EOF) on EOF or read error.
;**
;**  pcDos handle function: AH`3Fh, BX`handle#, CX`rd_cnt, DS:DX`&buffer.
;** Returns: NC`success, AX`#bytes_read .else. CF`error, AX`err_code =
;**  00h`EOF_on_attempt, 05h`access_denied, 06h`invalid_handle.
;** .if. (success) & .if. (AX < CX) a partial read before EOF.
;*/
;
;int in_port;  /** 1 chr global input buffer specific to getc() **/
;
;getc(fp) int fp;
getc:
	PUSH BP
	SUB  SP, AutoC1257
	MOV  BP, SP

;{
;	int cnt;
;
;	in_port = 0;			/** init to avoid cast garbage, -1 **/
	MOV  BX, +0
	MOV  Word [in_port], BX
;	cnt = fread(&in_port,1,1,fp);
	LEA  BX, [AutoC1257-2+BP]
	PUSH BX
	MOV  BX, in_port
	PUSH BX
	MOV  BX, +1
	PUSH BX
	MOV  BX, +1
	PUSH BX
	LEA  BX, [AutoC1257+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL fread
	ADD  SP, +8
	POP  DI
	MOV  Word [DI], BX
;
;	/** cnt should equal 1, or -1 on err **/
;
;	if (cnt == -1)  /** .then. error. **/
	LEA  BX, [AutoC1257-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1258
	JMP  L_1259
L_1258:
;		{
;		in_port = EOF;
	MOV  BX, +1
	NEG  BX
	MOV  Word [in_port], BX
;		}
;	else if (cnt == 0) /** effectively eof **/
	JMP  L_1260
L_1259:
	LEA  BX, [AutoC1257-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1261
	JMP  L_1262
L_1261:
;		{
;		in_port = EOF;
	MOV  BX, +1
	NEG  BX
	MOV  Word [in_port], BX
;		}
;	return (in_port);  /** EOF or raw byte chr cast to int **/
L_1262:
L_1260:
	MOV  BX, [Word in_port]
	ADD  SP, AutoC1257
	POP  BP
	RET
;}

AutoC1257	EQU 2
;	fp	VAR	INT	+4
;	cnt	VAR	INT	-2
;
;/*-----------------------------------------------------------------------75
;** (ii.) define gets(){;}
;** char *gets(char *buffer); -read next line of characters from STDIN to
;**  buffer.  Reads STDIN until newline or eof, discards newline and
;**  appends null to input. (A null terminated string.)
;** - pcDos AH`0Ah, DX`fn10_buffer, STDIN_fn10, No Returned Values.
;**  buffered input is terminated by 0Dh, so chg to null.
;*/
;
;char stdinbufr[258];  /** temp buffer for pcdos fn **/
;
;gets(bufr) char *bufr;
gets:
	PUSH BP
	SUB  SP, AutoC1263
	MOV  BP, SP

;{
;	int result,i,j;
;
;	stdinbufr[0] = 255;
	MOV  BX, stdinbufr
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +255
	POP  DI
	MOV  Byte [DI], BL
;	i = 255; j = 2;
	LEA  BX, [AutoC1263-4+BP]
	PUSH BX
	MOV  BX, +255
	POP  DI
	MOV  Word [DI], BX
	LEA  BX, [AutoC1263-6+BP]
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
;
;	while (i--) stdinbufr[j++] = 0;	/** zero out buffer **/
L_1264:
	LEA  BX, [AutoC1263-4+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
	OR   BX, BX
	JNZ  L_1265
	JMP  L_1266
L_1265:
	MOV  BX, stdinbufr
	PUSH BX
	LEA  BX, [AutoC1263-6+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
	JMP  L_1264
L_1266:
;
;	_AX_ = STDIN_fn10; _BX_ = 0; _CX_ = 0; _DX_ = &stdinbufr[0];
	MOV  BX, +10
	MOV  Word [_AX_], BX
	MOV  BX, +0
	MOV  Word [_BX_], BX
	MOV  BX, +0
	MOV  Word [_CX_], BX
	MOV  BX, stdinbufr
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	MOV  Word [_DX_], BX
;	_SI_ = 0; _DI_ = 0;
	MOV  BX, +0
	MOV  Word [_SI_], BX
	MOV  BX, +0
	MOV  Word [_DI_], BX
;	OSfn_();
	CALL OSfn_
;	j = 1;
	LEA  BX, [AutoC1263-6+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;	result = stdinbufr[j];
	LEA  BX, [AutoC1263-2+BP]
	PUSH BX
	MOV  BX, stdinbufr
	PUSH BX
	LEA  BX, [AutoC1263-6+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;	j = j + result;
	LEA  BX, [AutoC1263-6+BP]
	PUSH BX
	LEA  BX, [AutoC1263-6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1263-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	j++;
	LEA  BX, [AutoC1263-6+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;	stdinbufr[j] = 0;		/** null terminate input as str **/
	MOV  BX, stdinbufr
	PUSH BX
	LEA  BX, [AutoC1263-6+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;	j = 2;
	LEA  BX, [AutoC1263-6+BP]
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
;	result = strcpy(bufr,&stdinbufr[2]);
	LEA  BX, [AutoC1263-2+BP]
	PUSH BX
	LEA  BX, [AutoC1263+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, stdinbufr
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL strcpy
	ADD  SP, +4
	POP  DI
	MOV  Word [DI], BX
;		/** copy up to CR, null appended **/
;		/** result per ANSI is &bufr[0] **/
;
;	return (stdinbufr[1]); /** count of chrs read **/
	MOV  BX, stdinbufr
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	ADD  SP, AutoC1263
	POP  BP
	RET
;}

AutoC1263	EQU 6
;	bufr	PTR	CHAR	+4
;	result	VAR	INT	-2
;	i	VAR	INT	-4
;	j	VAR	INT	-6
;
;/*-----------------------------------------------------------------------75
;** (iii.) putc(){;} 
;** -ANSI- int putc(int chr,FILE *fp); ret`chr`ok .else. EOF`on_error.
;** Write chr to file fp.
;**  note: only return EOF on File Error, ret null or
;**  chr only.  (echo back chr means success)
;*/
;
;int out_port;
;
;putc(chr,fp) int chr, fp;
putc:
	PUSH BP
	SUB  SP, AutoC1267
	MOV  BP, SP

;{
;	int result;
;
;	out_port = chr;
	LEA  BX, [AutoC1267+6+BP]
	MOV  BX, [BX]
	MOV  Word [out_port], BX
;	result = fwrite(&out_port,1,1,fp);
	LEA  BX, [AutoC1267-2+BP]
	PUSH BX
	MOV  BX, out_port
	PUSH BX
	MOV  BX, +1
	PUSH BX
	MOV  BX, +1
	PUSH BX
	LEA  BX, [AutoC1267+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL fwrite
	ADD  SP, +8
	POP  DI
	MOV  Word [DI], BX
;		/** result is bytes written **/
;}
	ADD  SP, AutoC1267
	POP  BP
	RET

AutoC1267	EQU 2
;	chr	VAR	INT	+6
;	fp	VAR	INT	+4
;	result	VAR	INT	-2
;
;/*-----------------------------------------------------------------------75
;** (iv.) define putchar(){;}
;** -ANSI_ int putchar(int c);
;** Write chr to file fp STDOUT.
;**  note: only return EOF on File Error, ret null or
;**  chr only.  (echo back chr means success)
;*/
;
;int putchar_port;		/** 1 chr buffer, int_sz **/
;
;putchar(chr) int chr;	/** as a Handle Fn **/
putchar:
	PUSH BP
	SUB  SP, AutoC1268
	MOV  BP, SP

;{
;	int retval, result;
;
;	putchar_port = chr;
	LEA  BX, [AutoC1268+4+BP]
	MOV  BX, [BX]
	MOV  Word [putchar_port], BX
;	result = fwrite(&putchar_port,1,1,STDOUT);
	LEA  BX, [AutoC1268-4+BP]
	PUSH BX
	MOV  BX, putchar_port
	PUSH BX
	MOV  BX, +1
	PUSH BX
	MOV  BX, +1
	PUSH BX
	MOV  BX, +1
	PUSH BX
	CALL fwrite
	ADD  SP, +8
	POP  DI
	MOV  Word [DI], BX
;		/** result is bytes written **/
;}
	ADD  SP, AutoC1268
	POP  BP
	RET

AutoC1268	EQU 4
;	chr	VAR	INT	+4
;	retval	VAR	INT	-2
;	result	VAR	INT	-4
;
;/*-----------------------------------------------------------------------75
;** -= DOS v 4+ use AH`6Ch =- requires SI`asciiz filename.
;**  (v.) define fopen(){;}
;** FILE *fopen(char *filename, char *access); Returns fp#, or NULL error.
;**  pcDos AX`6Ch, BX`OpenModeBitMap, CX`FileAtrributesBitMap,
;**  DX`ActionFlagBitMap, DS:SI`Pointer to ASCIIZ pathname.
;** RETURNS: CF`error & AX`error_code .or. NC`success & CX`Actionflag where
;**  1 - file existed and was opened.
;**  2 - file did not exist, created.
;**  3 - file existed and was replaced.
;** -use "w" -write, "r" -read, "a", -append to eof. Suffix of "+" means
;** read and write combination, modes 0..5.
;*/
;
;fopen(fname,mode) char *fname; char *mode;
fopen:
	PUSH BP
	SUB  SP, AutoC1269
	MOV  BP, SP

;{
;	int fp,ResultAct,openmode,mode_fn,fattr,actionflg;
;	char *hptr,*nstr,*pstr;
;
;	/** 1st check & set access mode is "r","w","a","+" **/
;
;	if (mode[0] == 'r')
	LEA  BX, [AutoC1269+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +114
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1270
	JMP  L_1271
L_1270:
;		{
;		openmode = 0;
	LEA  BX, [AutoC1269-6+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;		if (mode[1] == '+') openmode = openmode + 3;
	LEA  BX, [AutoC1269+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +43
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1272
	JMP  L_1273
L_1272:
	LEA  BX, [AutoC1269-6+BP]
	PUSH BX
	LEA  BX, [AutoC1269-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +3
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		}
L_1273:
;	else if (mode[0] == 'w')
	JMP  L_1274
L_1271:
	LEA  BX, [AutoC1269+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +119
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1275
	JMP  L_1276
L_1275:
;		{
;		openmode = 1;
	LEA  BX, [AutoC1269-6+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;		if (mode[1] == '+') openmode = openmode + 3;
	LEA  BX, [AutoC1269+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +43
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1277
	JMP  L_1278
L_1277:
	LEA  BX, [AutoC1269-6+BP]
	PUSH BX
	LEA  BX, [AutoC1269-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +3
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		}
L_1278:
;	else if (mode[0] == 'a')
	JMP  L_1279
L_1276:
	LEA  BX, [AutoC1269+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +97
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1280
	JMP  L_1281
L_1280:
;		{
;		openmode = 2;
	LEA  BX, [AutoC1269-6+BP]
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
;		if (mode[1] == '+') openmode = openmode + 3;
	LEA  BX, [AutoC1269+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +43
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1282
	JMP  L_1283
L_1282:
	LEA  BX, [AutoC1269-6+BP]
	PUSH BX
	LEA  BX, [AutoC1269-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +3
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		}
L_1283:
;	else 	{
	JMP  L_1284
L_1281:
;		puts("Bad File Open Mode.");
	MOV  BX, L_1269+0
	PUSH BX
	CALL puts
	ADD  SP, +2
;		openmode = -1;
	LEA  BX, [AutoC1269-6+BP]
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DI
	MOV  Word [DI], BX
;		resultflg = 1;	/** error **/
	MOV  BX, +1
	MOV  Word [resultflg], BX
;		fp = NULL;
	LEA  BX, [AutoC1269-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;		return (fp);	/** error, exit subroutine. **/
	LEA  BX, [AutoC1269-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1269
	POP  BP
	RET
;		}
L_1284:
L_1279:
L_1274:
;
;	/** map openmode to pcDos fn | 0=R, 1..2=W, 3+ =RW **/
;
;	if (openmode < 2)	/** 0=R, 1=W **/
	LEA  BX, [AutoC1269-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_1285
	JMP  L_1286
L_1285:
;		{
;		mode_fn = 24576 + openmode;  /** 24576 is 6000h, BX **/
	LEA  BX, [AutoC1269-8+BP]
	PUSH BX
	MOV  BX, +24576
	PUSH BX
	LEA  BX, [AutoC1269-6+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		}
;	else if (openmode == 2) mode_fn = 24576 + 1; /** write only-append **/
	JMP  L_1287
L_1286:
	LEA  BX, [AutoC1269-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1288
	JMP  L_1289
L_1288:
	LEA  BX, [AutoC1269-8+BP]
	PUSH BX
	MOV  BX, +24576
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	else openmode = 24576 + 2;	/** otherwise RW for '+' **/
	JMP  L_1290
L_1289:
	LEA  BX, [AutoC1269-6+BP]
	PUSH BX
	MOV  BX, +24576
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
L_1290:
L_1287:
;
;	fattr = 0;			/** R,W,A, normal file attr, CX **/
	LEA  BX, [AutoC1269-10+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	actionflg = 17;		/** 0011h, DX, create or open **/
	LEA  BX, [AutoC1269-12+BP]
	PUSH BX
	MOV  BX, +17
	POP  DI
	MOV  Word [DI], BX
;	ResultAct = 0;		/** initialize control variable **/
	LEA  BX, [AutoC1269-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;
;	_AX_ = EFOPEN_FN; _BX_ = mode_fn; _CX_ = fattr; _DX_ = actionflg;
	MOV  BX, +108
	MOV  Word [_AX_], BX
	LEA  BX, [AutoC1269-8+BP]
	MOV  BX, [BX]
	MOV  Word [_BX_], BX
	LEA  BX, [AutoC1269-10+BP]
	MOV  BX, [BX]
	MOV  Word [_CX_], BX
	LEA  BX, [AutoC1269-12+BP]
	MOV  BX, [BX]
	MOV  Word [_DX_], BX
;	_SI_ = fname; _DI_ = 0;
	LEA  BX, [AutoC1269+6+BP]
	MOV  BX, [BX]
	MOV  Word [_SI_], BX
	MOV  BX, +0
	MOV  Word [_DI_], BX
;	fp = OSfn_();
	LEA  BX, [AutoC1269-2+BP]
	PUSH BX
	CALL OSfn_
	POP  DI
	MOV  Word [DI], BX
;
;	if (resultflg)  /** .then. error. **/
	MOV  BX, [Word resultflg]
	OR   BX, BX
	JNZ  L_1291
	JMP  L_1292
L_1291:
;		{
;		NLfn();
	CALL NLfn
;		putstr("Open file error: ");
	MOV  BX, L_1269+20
	PUSH BX
	CALL putstr
	ADD  SP, +2
;		nstr = itoa(fp);
	LEA  BX, [AutoC1269-16+BP]
	PUSH BX
	LEA  BX, [AutoC1269-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL itoa
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;		puts (nstr);
	LEA  BX, [AutoC1269-16+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL puts
	ADD  SP, +2
;		fp = NULL;
	LEA  BX, [AutoC1269-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;		return (fp);	/** error, EXIT subroutine. **/
	LEA  BX, [AutoC1269-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1269
	POP  BP
	RET
;		}
;
;	else	{			/** fopen success **/
	JMP  L_1293
L_1292:
;		NLfn();
	CALL NLfn
;		putstr("Open file success: ");
	MOV  BX, L_1269+38
	PUSH BX
	CALL putstr
	ADD  SP, +2
;		nstr = itoa(fp);
	LEA  BX, [AutoC1269-16+BP]
	PUSH BX
	LEA  BX, [AutoC1269-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL itoa
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;		puts (nstr);
	LEA  BX, [AutoC1269-16+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL puts
	ADD  SP, +2
;		ResultAct = _CX_;
	LEA  BX, [AutoC1269-4+BP]
	PUSH BX
	MOV  BX, [Word _CX_]
	POP  DI
	MOV  Word [DI], BX
;
;/*****	nstr = itoa(ResultAct);
;		puts (nstr);
;		NLfn();
;*****/
;		if (ResultAct == 1)
	LEA  BX, [AutoC1269-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1294
	JMP  L_1295
L_1294:
;			{
;			puts(" file existed and was opened.");
	MOV  BX, L_1269+58
	PUSH BX
	CALL puts
	ADD  SP, +2
;			}
;
;		else if (ResultAct == 2)
	JMP  L_1296
L_1295:
	LEA  BX, [AutoC1269-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1297
	JMP  L_1298
L_1297:
;			{
;			puts(" file non-existed, created.");
	MOV  BX, L_1269+88
	PUSH BX
	CALL puts
	ADD  SP, +2
;			}
;
;		else if (ResultAct == 3)
	JMP  L_1299
L_1298:
	LEA  BX, [AutoC1269-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +3
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1300
	JMP  L_1301
L_1300:
;			{
;			puts(" file existed and was replaced.");
	MOV  BX, L_1269+116
	PUSH BX
	CALL puts
	ADD  SP, +2
;			}
;/*******
;		else	{
;			putstr(" unknown file action taken.. ");
;			pstr = itoa(ResultAct);
;			puts (pstr);
;			}
;*******/
;		}  /** eo else **/
L_1301:
L_1299:
L_1296:
L_1293:
;
;/** with the file opened, check if 'a' append, meaning fseek to eof **/
;
;	if ((openmode == 2) | (openmode == 5)) fseek(fp, 0, 0, SEEK_END);
	LEA  BX, [AutoC1269-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC1269-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +5
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_1302
	JMP  L_1303
L_1302:
	LEA  BX, [AutoC1269-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	PUSH BX
	MOV  BX, +0
	PUSH BX
	MOV  BX, +2
	PUSH BX
	CALL fseek
	ADD  SP, +8
;
;	return (fp); 	/** pass back handle number, 0 or valid# **/
L_1303:
	LEA  BX, [AutoC1269-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1269
	POP  BP
	RET
;}				/** EO fopen() **/

AutoC1269	EQU 18
;	fname	PTR	CHAR	+6
;	mode	PTR	CHAR	+4
;	fp	VAR	INT	-2
;	ResultAct	VAR	INT	-4
;	openmode	VAR	INT	-6
;	mode_fn	VAR	INT	-8
;	fattr	VAR	INT	-10
;	actionflg	VAR	INT	-12
;	hptr	PTR	CHAR	-14
;	nstr	PTR	CHAR	-16
;	pstr	PTR	CHAR	-18

	  [SECTION .dseg]
L_1269	DB "Bad File Open Mode.",0
	DB "Open file error: ",0
	DB "Open file success: ",0
	DB " file existed and was opened.",0
	DB " file non-existed, created.",0
	DB " file existed and was replaced.",0

	  [SECTION .cseg]
;
;/*-----------------------------------------------------------------------75
;** (vi.) define fclose(){;}
;** int fclose(FILE *fp);
;**  pcDos AH`3Eh, BX`file_handle.
;** Returns: NC`success or CF`error, AX`err_code`6`invalid handle.
;** FCLOSE_FN.  Perform the necessary housekeeping to empty buffers and
;** break all connections to the file associated with fp.  A successful
;** close returns zero.  An error returns EOF.
;*/
;
;fclose(fp) int fp;
fclose:
	PUSH BP
	SUB  SP, AutoC1304
	MOV  BP, SP

;{
;	int  errcode, i, ndx, ndx2;
;	char *hptr,*nstr;
;
;	if (fp > 2)
	LEA  BX, [AutoC1304+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL ccgt
	OR   BX, BX
	JNZ  L_1305
	JMP  L_1306
L_1305:
;		{
;		_AX_ = FCLOSE_FN; _BX_ = fp; _CX_ = 0; _DX_ = 0;
	MOV  BX, +62
	MOV  Word [_AX_], BX
	LEA  BX, [AutoC1304+4+BP]
	MOV  BX, [BX]
	MOV  Word [_BX_], BX
	MOV  BX, +0
	MOV  Word [_CX_], BX
	MOV  BX, +0
	MOV  Word [_DX_], BX
;		_SI_ = 0; _DI_ = 0;
	MOV  BX, +0
	MOV  Word [_SI_], BX
	MOV  BX, +0
	MOV  Word [_DI_], BX
;		 errcode = OSfn_();
	LEA  BX, [AutoC1304-2+BP]
	PUSH BX
	CALL OSfn_
	POP  DI
	MOV  Word [DI], BX
;		}
;	else	{
	JMP  L_1307
L_1306:
;		puts(" -Invalid Handle: (0..2) for fclose. ");
	MOV  BX, L_1304+0
	PUSH BX
	CALL puts
	ADD  SP, +2
;		return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1304
	POP  BP
	RET
;		}
L_1307:
;
;	if (resultflg)  /** .then. error, ck = 6 **/
	MOV  BX, [Word resultflg]
	OR   BX, BX
	JNZ  L_1308
	JMP  L_1309
L_1308:
;		if (errcode == 6)
	LEA  BX, [AutoC1304-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +6
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1310
	JMP  L_1311
L_1310:
;			{
;			puts(" -Invalid Handle for fclose. ");
	MOV  BX, L_1304+38
	PUSH BX
	CALL puts
	ADD  SP, +2
;			nstr = itoa(fp);
	LEA  BX, [AutoC1304-12+BP]
	PUSH BX
	LEA  BX, [AutoC1304+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL itoa
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;			puts (nstr);
	LEA  BX, [AutoC1304-12+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1304
	POP  BP
	RET
;			}
;		else	{
	JMP  L_1312
L_1311:
;			puts(" -undetermined fclose error.");
	MOV  BX, L_1304+68
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1304
	POP  BP
	RET
;			}
L_1312:
;	else	{  /** fclose succeeded **/
	JMP  L_1313
L_1309:
;		NLfn();
	CALL NLfn
;		putstr("Close file success. ");
	MOV  BX, L_1304+97
	PUSH BX
	CALL putstr
	ADD  SP, +2
;		nstr = itoa(fp);
	LEA  BX, [AutoC1304-12+BP]
	PUSH BX
	LEA  BX, [AutoC1304+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL itoa
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;		puts (nstr);
	LEA  BX, [AutoC1304-12+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL puts
	ADD  SP, +2
;		return (0);
	MOV  BX, +0
	ADD  SP, AutoC1304
	POP  BP
	RET
;		}
L_1313:
;}	/** EO FCLOSE_FN **/
	ADD  SP, AutoC1304
	POP  BP
	RET

AutoC1304	EQU 12
;	fp	VAR	INT	+4
;	errcode	VAR	INT	-2
;	i	VAR	INT	-4
;	ndx	VAR	INT	-6
;	ndx2	VAR	INT	-8
;	hptr	PTR	CHAR	-10
;	nstr	PTR	CHAR	-12

	  [SECTION .dseg]
L_1304	DB " -Invalid Handle: (0..2) for fclose. ",0
	DB " -Invalid Handle for fclose. ",0
	DB " -undetermined fclose error.",0
	DB "Close file success. ",0

	  [SECTION .cseg]
;
;/***
;**** END of 6 Required Interface Functions of Small-C ***
;***/
;
;/*-----------------------------------------------------------------------75
;** -ANSI- char *fgets(char *bufr, int limit, FILE *fp);
;** Read a line of characters from file fp, store to bufr[limit].  Reads
;** (which ever occurs first); up through \n, limit -1, or to EOF, and
;** appends null termination into bufr[].
;** Returns: On success: ptr to bufr.  On error: NULL.
;** "\n" is taken as CR,LF for pcDos.
;** -non-standard- static int fgets_cnt; holds count of chrs.
;*/
;
;int fgets_cnt;
;
;fgets(fbufr, lnlimit, fp) char *fbufr; int lnlimit,*fp;
fgets:
	PUSH BP
	SUB  SP, AutoC1314
	MOV  BP, SP

;{
;	int la_chr, chr, i;
;
;	i = 0;
	LEA  BX, [AutoC1314-6+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	la_chr = getc(fp);
	LEA  BX, [AutoC1314-2+BP]
	PUSH BX
	LEA  BX, [AutoC1314+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL getc
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;	if (la_chr == EOF)		/** eof, at start **/
	LEA  BX, [AutoC1314-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1315
	JMP  L_1316
L_1315:
;		{
;		if (DebugFlag) puts("Empty File?");
	MOV  BX, [Word DebugFlag]
	OR   BX, BX
	JNZ  L_1317
	JMP  L_1318
L_1317:
	MOV  BX, L_1314+0
	PUSH BX
	CALL puts
	ADD  SP, +2
;		fgets_cnt = i;		/** zero length **/
L_1318:
	LEA  BX, [AutoC1314-6+BP]
	MOV  BX, [BX]
	MOV  Word [fgets_cnt], BX
;		return (NULL);
	MOV  BX, +0
	ADD  SP, AutoC1314
	POP  BP
	RET
;		}
;	else	fbufr[i++] = la_chr;
	JMP  L_1319
L_1316:
	LEA  BX, [AutoC1314+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1314-6+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1314-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
L_1319:
;
;	while (--lnlimit)  /** count down to zero **/
L_1320:
	LEA  BX, [AutoC1314+6+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_1321
	JMP  L_1322
L_1321:
;		{
;		chr = la_chr;
	LEA  BX, [AutoC1314-4+BP]
	PUSH BX
	LEA  BX, [AutoC1314-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		if (la_chr == CR) lnlimit = 1;  /** 1st newline chr hit **/
	LEA  BX, [AutoC1314-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1323
	JMP  L_1324
L_1323:
	LEA  BX, [AutoC1314+6+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;		la_chr = getc(fp);
L_1324:
	LEA  BX, [AutoC1314-2+BP]
	PUSH BX
	LEA  BX, [AutoC1314+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL getc
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;		if (la_chr == EOF)
	LEA  BX, [AutoC1314-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1325
	JMP  L_1326
L_1325:
;			{	/** EOF reached without "\n" **/
;			fbufr[i] = 0;
	LEA  BX, [AutoC1314+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1314-6+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			fgets_cnt = i;
	LEA  BX, [AutoC1314-6+BP]
	MOV  BX, [BX]
	MOV  Word [fgets_cnt], BX
;			return (NULL);
	MOV  BX, +0
	ADD  SP, AutoC1314
	POP  BP
	RET
;			}
;		fbufr[i++] = la_chr;
L_1326:
	LEA  BX, [AutoC1314+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1314-6+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1314-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;		}
	JMP  L_1320
L_1322:
;	fbufr[i] = 0;
	LEA  BX, [AutoC1314+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1314-6+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;	fgets_cnt = i;		/** record count of chrs in line. **/
	LEA  BX, [AutoC1314-6+BP]
	MOV  BX, [BX]
	MOV  Word [fgets_cnt], BX
;	return (&fbufr[0]);
	LEA  BX, [AutoC1314+8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	ADD  SP, AutoC1314
	POP  BP
	RET
;}

AutoC1314	EQU 6
;	fbufr	PTR	CHAR	+8
;	lnlimit	VAR	INT	+6
;	fp	PTR	INT	+4
;	la_chr	VAR	INT	-2
;	chr	VAR	INT	-4
;	i	VAR	INT	-6

	  [SECTION .dseg]
L_1314	DB "Empty File?",0

	  [SECTION .cseg]
;
;/*-----------------------------------------------------------------------75
;** -ANSI- int fputs(char *str, FILE *fp);
;**  writes a string of characters to fp, not including the null terminator.
;**  Does not append newline (\n).
;** Returns: On success: 0.  On error: non-zero.
;*/
;
;fputs(str, fp) char *str; int fp;
fputs:
	PUSH BP
	SUB  SP, AutoC1327
	MOV  BP, SP

;{
;	int i,c,n;
;
;	i = 0;
	LEA  BX, [AutoC1327-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	n = MAXLENGTH;
	LEA  BX, [AutoC1327-6+BP]
	PUSH BX
	MOV  BX, +128
	POP  DI
	MOV  Word [DI], BX
;	while (n--)
L_1328:
	LEA  BX, [AutoC1327-6+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
	OR   BX, BX
	JNZ  L_1329
	JMP  L_1330
L_1329:
;		{
;		c = str[i++];
	LEA  BX, [AutoC1327-4+BP]
	PUSH BX
	LEA  BX, [AutoC1327+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1327-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;		if (c == 0) return (0);  /** done with copy to file **/
	LEA  BX, [AutoC1327-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1331
	JMP  L_1332
L_1331:
	MOV  BX, +0
	ADD  SP, AutoC1327
	POP  BP
	RET
;		putc(c,fp);
L_1332:
	LEA  BX, [AutoC1327-4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1327+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL putc
	ADD  SP, +4
;		}
	JMP  L_1328
L_1330:
;	/** error state **/
;	return (-2);
	MOV  BX, +2
	NEG  BX
	ADD  SP, AutoC1327
	POP  BP
	RET
;}

AutoC1327	EQU 6
;	str	PTR	CHAR	+6
;	fp	VAR	INT	+4
;	i	VAR	INT	-2
;	c	VAR	INT	-4
;	n	VAR	INT	-6
;
;/*-----------------------------------------------------------------------75
;** -ANSI- int fputc(int chr, FILE *fp);
;**  writes a character to fp, not including the null terminator.
;** Returns: On success: chr.  On error: EOF.
;** -see putc(chr,fp);
;*/
;
;
;
;/*-----------------------------------------------------------------------75
;** fgetstr(bufr, MAXLENGTH, fp) !not standard! fetch up to MAXLENGTH chrs
;** from input file *fp into bufr[MAXLENGTH], strip NL replace with null.
;*/
;
;fgetline(fbufr,lnlimit,fp) char *fbufr; int lnlimit, fp;
fgetline:
	PUSH BP
	SUB  SP, AutoC1333
	MOV  BP, SP

;{
;	int result, i;
;
;	i = 0;
	LEA  BX, [AutoC1333-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	result = fgets(fbufr, lnlimit, fp); /** get next line from fp **/
	LEA  BX, [AutoC1333-2+BP]
	PUSH BX
	LEA  BX, [AutoC1333+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1333+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1333+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL fgets
	ADD  SP, +6
	POP  DI
	MOV  Word [DI], BX
;
;	if (result == EOF) return (EOF);
	LEA  BX, [AutoC1333-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1334
	JMP  L_1335
L_1334:
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1333
	POP  BP
	RET
;	while (lnlimit--)
L_1335:
L_1336:
	LEA  BX, [AutoC1333+6+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
	OR   BX, BX
	JNZ  L_1337
	JMP  L_1338
L_1337:
;		{
;		if (fbufr[i] == CR)
	LEA  BX, [AutoC1333+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1333-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +13
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1339
	JMP  L_1340
L_1339:
;			{
;			fbufr[i] = 0;	/** CR spot **/
	LEA  BX, [AutoC1333+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1333-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			fbufr[i+1] = 0;	/** LF spot **/
	LEA  BX, [AutoC1333+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1333-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			return (i);		/** return count of chrs in str **/
	LEA  BX, [AutoC1333-4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1333
	POP  BP
	RET
;			}
;		i++;
L_1340:
	LEA  BX, [AutoC1333-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		}
	JMP  L_1336
L_1338:
;}
	ADD  SP, AutoC1333
	POP  BP
	RET

AutoC1333	EQU 4
;	fbufr	PTR	CHAR	+8
;	lnlimit	VAR	INT	+6
;	fp	VAR	INT	+4
;	result	VAR	INT	-2
;	i	VAR	INT	-4
;
;/*-----------------------------------------------------------------------75
;**  define creat(){;}
;** int creat(char *fn, int mode);  -returns 0`success, >0`error.
;**  pcDos AH`3Ch, CX`attr`0, DX`ASCIIZ`filename. Returns: NC`AX`fp_handle,
;**  -or- CF`AX`err_code.  NOTE: creat() destroys existing file!!!
;** CX`file_attr=0 for normal.  mode=0`read,=1`write,=2`rd&wr, however,
;** OSfn_ call ignores mode for creat();
;*/
;
;/* this is an internal function to fopen(), and so is not supported as an
;** independant function that can be called.
;*/
;	/** eo creat() **/
;
;/*-----------------------------------------------------------------------75
;** -ANSI-
;**  size_t fwrite(void *buffer, size_t size, size_t number, FILE *fp);
;** Returns: number of size_t items written. If returned number < nuber
;** requested to be written, then there was a write error.
;**
;** (semi)-ANSI-
;** fwrite(buffer,size,number,fp) char *buffer; int size, number, fp;
;** - fwrite writes (size * number) of bytes from the buffer to the fp.
;** - returns the number of bytes written. (non-conforming behavior as item
;**   can be other than byte in size, but this returns byte count.)
;** - the position of the write is from the last write (automatic) position.
;*/
;
;fwrite(fbufr, item_sz, item_cnt, fp)
fwrite:
;char *fbufr; int item_sz, item_cnt, fp;
	PUSH BP
	SUB  SP, AutoC1341
	MOV  BP, SP

;{
;	int byte_cnt, ret_val;
;
;	byte_cnt = item_sz * item_cnt;
	LEA  BX, [AutoC1341-2+BP]
	PUSH BX
	LEA  BX, [AutoC1341+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1341+6+BP]
	MOV  BX, [BX]
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;	_AX_ = FWRITE_FN; _BX_ = fp; _CX_ = byte_cnt; _DX_ = fbufr;
	MOV  BX, +64
	MOV  Word [_AX_], BX
	LEA  BX, [AutoC1341+4+BP]
	MOV  BX, [BX]
	MOV  Word [_BX_], BX
	LEA  BX, [AutoC1341-2+BP]
	MOV  BX, [BX]
	MOV  Word [_CX_], BX
	LEA  BX, [AutoC1341+10+BP]
	MOV  BX, [BX]
	MOV  Word [_DX_], BX
;	_SI_ = 0; _DI_ = 0;
	MOV  BX, +0
	MOV  Word [_SI_], BX
	MOV  BX, +0
	MOV  Word [_DI_], BX
;	ret_val = OSfn_();
	LEA  BX, [AutoC1341-4+BP]
	PUSH BX
	CALL OSfn_
	POP  DI
	MOV  Word [DI], BX
;
;	if (resultflg)  /** .then. error, ck error code **/
	MOV  BX, [Word resultflg]
	OR   BX, BX
	JNZ  L_1342
	JMP  L_1343
L_1342:
;		{
;		if (ret_val == 5)
	LEA  BX, [AutoC1341-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +5
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1344
	JMP  L_1345
L_1344:
;			{
;			puts("-fwrite: access denied.");
	MOV  BX, L_1341+0
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1341
	POP  BP
	RET
;			}
;		if (ret_val == 6)
L_1345:
	LEA  BX, [AutoC1341-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +6
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1346
	JMP  L_1347
L_1346:
;			{
;			puts("-fwrite: Invalid Handle.");
	MOV  BX, L_1341+24
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1341
	POP  BP
	RET
;			}
;		else	{
	JMP  L_1348
L_1347:
;			puts("-undetermined fwrite error.");
	MOV  BX, L_1341+49
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1341
	POP  BP
	RET
;			}
L_1348:
;		}
; 	/** fread success, return number of bytes written **/
;	/** if (ret_val < byte_cnt) -partial record written **/
;
;	else	return(ret_val);
	JMP  L_1349
L_1343:
	LEA  BX, [AutoC1341-4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1341
	POP  BP
	RET
L_1349:
;}
	ADD  SP, AutoC1341
	POP  BP
	RET

AutoC1341	EQU 4
;	fbufr	PTR	CHAR	+10
;	item_sz	VAR	INT	+8
;	item_cnt	VAR	INT	+6
;	fp	VAR	INT	+4
;	byte_cnt	VAR	INT	-2
;	ret_val	VAR	INT	-4

	  [SECTION .dseg]
L_1341	DB "-fwrite: access denied.",0
	DB "-fwrite: Invalid Handle.",0
	DB "-undetermined fwrite error.",0

	  [SECTION .cseg]
;
;/*-----------------------------------------------------------------------75
;** -ANSI-
;** size_t fread(void *buffer, size_t size, size_t number, FILE *fp);
;**  reads data items from file fp, stores them to buffer.  size_t specifies
;**  item size in bytes.  size_t it an unsigned int data type that results
;** from using the 'sizeof' operator.
;**
;** fread(buffer,size,number,fp) char *buffer; int size, number, fp; 
;** - fread reads (size * number) of bytes from fp into buffer.
;** - returns number of bytes read. (non-conforming behavior)
;** - the position of the read is from the last seek (automatic) position.
;**
;**  pcDos handle function: AH`3Fh, BX`handle#, CX`rd_cnt, DS:DX`&buffer.
;** Returns: NC`success, AX`#bytes_read .else. CF`error, AX`err_code =
;**  00h`EOF_on_attempt, 05h`access_denied, 06h`invalid_handle.
;** .if. (success) & .if. (AX < CX) a partial read before EOF.
;*/
;
;fread(fbufr,item_sz,item_cnt,fp) char *fbufr; int item_sz,item_cnt,fp;
fread:
	PUSH BP
	SUB  SP, AutoC1350
	MOV  BP, SP

;{
;	int byte_cnt, ret_val;
;
;	byte_cnt = item_sz * item_cnt;
	LEA  BX, [AutoC1350-2+BP]
	PUSH BX
	LEA  BX, [AutoC1350+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1350+6+BP]
	MOV  BX, [BX]
	POP  DX
	MOV  AX, BX
	PUSH DX
	MUL  DX
	POP  DX
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;	_AX_ = FREAD_FN; _BX_ = fp; _CX_ = byte_cnt; _DX_ = fbufr;
	MOV  BX, +63
	MOV  Word [_AX_], BX
	LEA  BX, [AutoC1350+4+BP]
	MOV  BX, [BX]
	MOV  Word [_BX_], BX
	LEA  BX, [AutoC1350-2+BP]
	MOV  BX, [BX]
	MOV  Word [_CX_], BX
	LEA  BX, [AutoC1350+10+BP]
	MOV  BX, [BX]
	MOV  Word [_DX_], BX
;	_SI_ = 0; _DI_ = 0;
	MOV  BX, +0
	MOV  Word [_SI_], BX
	MOV  BX, +0
	MOV  Word [_DI_], BX
;	ret_val = OSfn_();  /** results passed back from INT 21h in AX **/
	LEA  BX, [AutoC1350-4+BP]
	PUSH BX
	CALL OSfn_
	POP  DI
	MOV  Word [DI], BX
;
;	if (resultflg)  /** .then. error, ck error code **/
	MOV  BX, [Word resultflg]
	OR   BX, BX
	JNZ  L_1351
	JMP  L_1352
L_1351:
;		{
;		if (ret_val == 0)
	LEA  BX, [AutoC1350-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1353
	JMP  L_1354
L_1353:
;			{
;			puts("-fread: EOF.");
	MOV  BX, L_1350+0
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1350
	POP  BP
	RET
;			}
;		if (ret_val == 5)
L_1354:
	LEA  BX, [AutoC1350-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +5
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1355
	JMP  L_1356
L_1355:
;			{
;			puts("-fread: access denied.");
	MOV  BX, L_1350+13
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1350
	POP  BP
	RET
;			}
;		if (ret_val == 6)
L_1356:
	LEA  BX, [AutoC1350-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +6
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1357
	JMP  L_1358
L_1357:
;			{
;			puts("-fread: Invalid Handle.");
	MOV  BX, L_1350+36
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1350
	POP  BP
	RET
;			}
;		else	{
	JMP  L_1359
L_1358:
;			puts("-undetermined fread error.");
	MOV  BX, L_1350+60
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1350
	POP  BP
	RET
;			}
L_1359:
;		}
;	else	{ /** fread success, return number of bytes read **/
	JMP  L_1360
L_1352:
;		return (ret_val);
	LEA  BX, [AutoC1350-4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1350
	POP  BP
	RET
;		}
L_1360:
;}
	ADD  SP, AutoC1350
	POP  BP
	RET

AutoC1350	EQU 4
;	fbufr	PTR	CHAR	+10
;	item_sz	VAR	INT	+8
;	item_cnt	VAR	INT	+6
;	fp	VAR	INT	+4
;	byte_cnt	VAR	INT	-2
;	ret_val	VAR	INT	-4

	  [SECTION .dseg]
L_1350	DB "-fread: EOF.",0
	DB "-fread: access denied.",0
	DB "-fread: Invalid Handle.",0
	DB "-undetermined fread error.",0

	  [SECTION .cseg]
;
;/*-----------------------------------------------------------------------75
;** -ANSI- int fseek(FILE *fp, long offset, int origin);
;** fseek changes the file position indicator of the file fp, where offset
;** is relative to the 'origin' mode desired; BOF, current position, or EOF.
;**
;** fseek(fp, offset_hiword, offset loword, mode);
;**  AH`42h, AL`origin index
;** Change the File Ptr Location to a position relative to; a. the start of
;** the file, or b. the current position in thefile, or c. the end of the
;** file.  Mode`HiByte`AX`a.=0,b.=1,c.=2, BX`handle, CX`high word of
;** double word offset, DX`low word of double word offset.
;** Returns: NC`success & DX:AX`new fp position.  CF`error,AX`err_code
;**  1`invalid function, or 6`invalid handle.
;*/
;
;int SeekLo, SeekHi, ThisFileHandle; /** AX, DX, returned position. **/
;
;fseek(fp, offs_hi, offs_lo, origin) int fp, offs_hi, offs_lo, origin;
fseek:
	PUSH BP
	SUB  SP, AutoC1361
	MOV  BP, SP

;{
;	int seek_mode, ret_val;
;
;	seek_mode = (origin << 8) + FSEEK_FN;
	LEA  BX, [AutoC1361-2+BP]
	PUSH BX
	LEA  BX, [AutoC1361+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAL  DX, CL
	MOV  BX, DX
	PUSH BX
	MOV  BX, +66
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	_AX_ = seek_mode; _BX_ = fp; _CX_ = offs_hi; _DX_ = offs_lo;
	LEA  BX, [AutoC1361-2+BP]
	MOV  BX, [BX]
	MOV  Word [_AX_], BX
	LEA  BX, [AutoC1361+10+BP]
	MOV  BX, [BX]
	MOV  Word [_BX_], BX
	LEA  BX, [AutoC1361+8+BP]
	MOV  BX, [BX]
	MOV  Word [_CX_], BX
	LEA  BX, [AutoC1361+6+BP]
	MOV  BX, [BX]
	MOV  Word [_DX_], BX
;	_SI_ = 0; _DI_ = 0;
	MOV  BX, +0
	MOV  Word [_SI_], BX
	MOV  BX, +0
	MOV  Word [_DI_], BX
;	ret_val = OSfn_();
	LEA  BX, [AutoC1361-4+BP]
	PUSH BX
	CALL OSfn_
	POP  DI
	MOV  Word [DI], BX
;
;	if (resultflg)  /** .then. error, ck error code **/
	MOV  BX, [Word resultflg]
	OR   BX, BX
	JNZ  L_1362
	JMP  L_1363
L_1362:
;		{
;		if (ret_val == 1)
	LEA  BX, [AutoC1361-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1364
	JMP  L_1365
L_1364:
;			{
;			puts(" -seek: invalid function (file sharing).");
	MOV  BX, L_1361+0
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1361
	POP  BP
	RET
;			}
;		if (ret_val == 6)
L_1365:
	LEA  BX, [AutoC1361-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +6
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1366
	JMP  L_1367
L_1366:
;			{
;			puts(" -seek: Invalid Handle.");
	MOV  BX, L_1361+41
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1361
	POP  BP
	RET
;			}
;		else	{
	JMP  L_1368
L_1367:
;			puts("-undetermined seek error.");
	MOV  BX, L_1361+65
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1361
	POP  BP
	RET
;			}
L_1368:
;		}
;	else	{	/** successful seek, record new position **/
	JMP  L_1369
L_1363:
;		SeekLo = _AX_;
	MOV  BX, [Word _AX_]
	MOV  Word [SeekLo], BX
;		SeekHi = _DX_;
	MOV  BX, [Word _DX_]
	MOV  Word [SeekHi], BX
;		ThisFileHandle = _BX_;
	MOV  BX, [Word _BX_]
	MOV  Word [ThisFileHand], BX
;		}
L_1369:
;}
	ADD  SP, AutoC1361
	POP  BP
	RET

AutoC1361	EQU 4
;	fp	VAR	INT	+10
;	offs_hi	VAR	INT	+8
;	offs_lo	VAR	INT	+6
;	origin	VAR	INT	+4
;	seek_mode	VAR	INT	-2
;	ret_val	VAR	INT	-4

	  [SECTION .dseg]
L_1361	DB " -seek: invalid function (file sharing).",0
	DB " -seek: Invalid Handle.",0
	DB "-undetermined seek error.",0

	  [SECTION .cseg]
;
;/**
;*** NOTE: ANSI behavior on the pair fgetpos() and fsetpos() is such that
;*** fgetpos() records the file pointer position at some point in your
;*** algorithm, and fsetpos() returns to that point by setting what was
;*** recorded by fgetpos().
;**/
;
;/*-----------------------------------------------------------------------75
;** -ANSI- int fsetpos(FILE *fp, fpos_t *pos);
;** Sets the file position indicator to the value pointed to by 'pos'.  The
;** 'pos' argument must point to a value obtained by a prior call to the
;** fgetpos() function.
;** Returns: 0 if successful, NZ on error.
;**
;** fsetpos(fp, offset);	-> AH`42h, 
;** Change the File Ptr Location to a position relative to the start of
;** the file.
;**  Method`HiByte`AX`0, BX`handle, CX`high word of
;** double word offset, DX`low word of double word offset.
;** Returns: NC`success & DX:AX`new fp position.  CF`error,AX`err_code
;**  1`invalid function, or 6`invalid handle.
;*/
;
;fsetpos(fp, pos) int fp, *pos;
fsetpos:
	PUSH BP
	SUB  SP, AutoC1370
	MOV  BP, SP

;{
;	int seek_mode, ret_val, origin;
;
;	origin = 0;	/** 0 = position from beginning of file. **/
	LEA  BX, [AutoC1370-6+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;
;	seek_mode = (origin << 8) + FSEEK_FN;
	LEA  BX, [AutoC1370-2+BP]
	PUSH BX
	LEA  BX, [AutoC1370-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAL  DX, CL
	MOV  BX, DX
	PUSH BX
	MOV  BX, +66
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;
;	_AX_ = seek_mode; _BX_ = fp; _CX_ = pos[1]; _DX_ = pos[0];
	LEA  BX, [AutoC1370-2+BP]
	MOV  BX, [BX]
	MOV  Word [_AX_], BX
	LEA  BX, [AutoC1370+6+BP]
	MOV  BX, [BX]
	MOV  Word [_BX_], BX
	LEA  BX, [AutoC1370+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	MOV  Word [_CX_], BX
	LEA  BX, [AutoC1370+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	MOV  Word [_DX_], BX
;	_SI_ = 0; _DI_ = 0;
	MOV  BX, +0
	MOV  Word [_SI_], BX
	MOV  BX, +0
	MOV  Word [_DI_], BX
;	ret_val = OSfn_();
	LEA  BX, [AutoC1370-4+BP]
	PUSH BX
	CALL OSfn_
	POP  DI
	MOV  Word [DI], BX
;
;	if (resultflg)  /** .then. error, ck error code **/
	MOV  BX, [Word resultflg]
	OR   BX, BX
	JNZ  L_1371
	JMP  L_1372
L_1371:
;		{
;		if (ret_val == 1)
	LEA  BX, [AutoC1370-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1373
	JMP  L_1374
L_1373:
;			{
;			puts(" -seek: invalid function (file sharing).");
	MOV  BX, L_1370+0
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1370
	POP  BP
	RET
;			}
;		if (ret_val == 6)
L_1374:
	LEA  BX, [AutoC1370-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +6
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1375
	JMP  L_1376
L_1375:
;			{
;			puts(" -seek: Invalid Handle.");
	MOV  BX, L_1370+41
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1370
	POP  BP
	RET
;			}
;		else	{
	JMP  L_1377
L_1376:
;			puts("-undetermined seek error.");
	MOV  BX, L_1370+65
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1370
	POP  BP
	RET
;			}
L_1377:
;		}
;	else	{	/** successful seek, record new position **/
	JMP  L_1378
L_1372:
;		SeekLo = _AX_;
	MOV  BX, [Word _AX_]
	MOV  Word [SeekLo], BX
;		SeekHi = _DX_;
	MOV  BX, [Word _DX_]
	MOV  Word [SeekHi], BX
;		ThisFileHandle = _BX_;
	MOV  BX, [Word _BX_]
	MOV  Word [ThisFileHand], BX
;		}
L_1378:
;}
	ADD  SP, AutoC1370
	POP  BP
	RET

AutoC1370	EQU 6
;	fp	VAR	INT	+6
;	pos	PTR	INT	+4
;	seek_mode	VAR	INT	-2
;	ret_val	VAR	INT	-4
;	origin	VAR	INT	-6

	  [SECTION .dseg]
L_1370	DB " -seek: invalid function (file sharing).",0
	DB " -seek: Invalid Handle.",0
	DB "-undetermined seek error.",0

	  [SECTION .cseg]
;
;/*-----------------------------------------------------------------------75
;** -ANSI- int fsetpos(FILE *fp, fpos_t *pos);
;** Stores the current value of the file position indicator for fp to 'pos'.
;** Returns: 0 if successful, NZ on error.
;**
;** fgetpos(fp, pos);	AH`42h, AL`origin index=curr position.
;** Change the File Ptr Location to a position relative (0) to the current
;** position in the file. 
;**
;** Returns: 0 if successful, sets int values in array pos, pos[0]`offset
;**  low_word, pos[1]`offset high_word, from BOF.
;*/
;
;fgetpos(fp, pos) int fp, *pos;
fgetpos:
	PUSH BP
	SUB  SP, AutoC1379
	MOV  BP, SP

;{
;	int seek_mode, ret_val, origin;
;
;	origin = 1;	/** 1 = from curr. pos. rets current position **/
	LEA  BX, [AutoC1379-6+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;
;	seek_mode = (origin << 8) + FSEEK_FN;
	LEA  BX, [AutoC1379-2+BP]
	PUSH BX
	LEA  BX, [AutoC1379-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +8
	POP  DX
	MOV  CX, BX
	SAL  DX, CL
	MOV  BX, DX
	PUSH BX
	MOV  BX, +66
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	_AX_ = seek_mode; _BX_ = fp; _CX_ = 0; _DX_ = 0;
	LEA  BX, [AutoC1379-2+BP]
	MOV  BX, [BX]
	MOV  Word [_AX_], BX
	LEA  BX, [AutoC1379+6+BP]
	MOV  BX, [BX]
	MOV  Word [_BX_], BX
	MOV  BX, +0
	MOV  Word [_CX_], BX
	MOV  BX, +0
	MOV  Word [_DX_], BX
;	_SI_ = 0; _DI_ = 0;
	MOV  BX, +0
	MOV  Word [_SI_], BX
	MOV  BX, +0
	MOV  Word [_DI_], BX
;
;	ret_val = OSfn_();	/** call to OS, passing register variables **/
	LEA  BX, [AutoC1379-4+BP]
	PUSH BX
	CALL OSfn_
	POP  DI
	MOV  Word [DI], BX
;
;	if (resultflg)  /** .then. error, ck error code **/
	MOV  BX, [Word resultflg]
	OR   BX, BX
	JNZ  L_1380
	JMP  L_1381
L_1380:
;		{
;		if (ret_val == 1)
	LEA  BX, [AutoC1379-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1382
	JMP  L_1383
L_1382:
;			{
;			puts(" -seek: invalid function (file sharing).");
	MOV  BX, L_1379+0
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1379
	POP  BP
	RET
;			}
;		if (ret_val == 6)
L_1383:
	LEA  BX, [AutoC1379-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +6
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1384
	JMP  L_1385
L_1384:
;			{
;			puts(" -seek: Invalid Handle.");
	MOV  BX, L_1379+41
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1379
	POP  BP
	RET
;			}
;		else	{
	JMP  L_1386
L_1385:
;			puts("-undetermined seek error.");
	MOV  BX, L_1379+65
	PUSH BX
	CALL puts
	ADD  SP, +2
;			return (-1);
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1379
	POP  BP
	RET
;			}
L_1386:
;		}
;	else	{	/** successful seek, record new position **/
	JMP  L_1387
L_1381:
;		pos[0] = _AX_;
	LEA  BX, [AutoC1379+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, [Word _AX_]
	POP  DI
	MOV  Word [DI], BX
;		pos[1] = _DX_;
	LEA  BX, [AutoC1379+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, [Word _DX_]
	POP  DI
	MOV  Word [DI], BX
;		return (0);
	MOV  BX, +0
	ADD  SP, AutoC1379
	POP  BP
	RET
;		}
L_1387:
;}
	ADD  SP, AutoC1379
	POP  BP
	RET

AutoC1379	EQU 6
;	fp	VAR	INT	+6
;	pos	PTR	INT	+4
;	seek_mode	VAR	INT	-2
;	ret_val	VAR	INT	-4
;	origin	VAR	INT	-6

	  [SECTION .dseg]
L_1379	DB " -seek: invalid function (file sharing).",0
	DB " -seek: Invalid Handle.",0
	DB "-undetermined seek error.",0

	  [SECTION .cseg]
;
;/*-----------------------------------------------------------------------75
;** fdelete();  -delete file, name passed in a string array.
;**
;*/
;fdelete(fname) char *fname;
fdelete:
	PUSH BP
	SUB  SP, AutoC1388
	MOV  BP, SP

;{
;	int errcode;
;	_AX_ = FDELETE_FN; _BX_ = 0; _CX_ = 0; _DX_ = fname;
	MOV  BX, +65
	MOV  Word [_AX_], BX
	MOV  BX, +0
	MOV  Word [_BX_], BX
	MOV  BX, +0
	MOV  Word [_CX_], BX
	LEA  BX, [AutoC1388+4+BP]
	MOV  BX, [BX]
	MOV  Word [_DX_], BX
;	_SI_ = 0; _DI_ = 0;
	MOV  BX, +0
	MOV  Word [_SI_], BX
	MOV  BX, +0
	MOV  Word [_DI_], BX
;	errcode = OSfn_();
	LEA  BX, [AutoC1388-2+BP]
	PUSH BX
	CALL OSfn_
	POP  DI
	MOV  Word [DI], BX
;}
	ADD  SP, AutoC1388
	POP  BP
	RET

AutoC1388	EQU 2
;	fname	PTR	CHAR	+4
;	errcode	VAR	INT	-2
;
;/*-----------------------------------------------------------------------75
;**  ReportExtErr();  pcDos AH`59h
;**  Provides additional information about errors after execution of int 21h
;**  sevices that set the carry flag.
;*/
;
;/*-----------------------------------------------------------------------75
;**  define set_dta(){;}
;**  pcDos AH`2, DL`chr
;*/
;
;/***-------------------------------------------------------------------***/
;/** --------------------= O S   I N T E R F A C E =-------------------- **/
;/***-------------------------------------------------------------------***/
;/*
;** OSfn_(); static variables hold register values to pass and return.
;**  
;*/
;
; #asm
  [SECTION .cseg]
OSfn_:
	mov	ax, [_AX_]
	mov	bx, [_BX_]
	mov	cx, [_CX_]
	mov	dx, [_DX_]
	mov	SI, [_SI_]
	mov	DI, [_DI_]
	cmp	al, 0		;; Fn# 0 is exit
	je	_exit
	xchg	ah, al	;; swap fn to AH for pcDOS int 21h
	int	21h
	mov	[_AX_], ax
	mov	[_BX_], bx
	mov	[_CX_], cx
	mov	[_DX_], dx
	mov	[_SI_], SI
	mov	[_DI_], DI
	jc	.errflg	;; Int 21h returns CF set .if. error.
	mov	[resultflg], word 0		;; no carry = success.
	MOV	BX, AX	;; for Prim`BX, Secd`DX. Caller expects primary
	RET			;; Caller cleans the stack.
.errflg:
	mov	[resultflg], word 1		;; carry = error in AX, ->BX
	MOV	BX, AX	;; for Prim`BX, Secd`DX.
	RET			;; Caller cleans the stack.
;;-----------------------------------------------------------------------75
;;** -= Exit Function =- **
;;
exit:				;; duplicate name.
_exit:			;; pause for keypress before return.
	mov  ah, 0
	int  16h		;; RomBios wait for keypress.
	mov	ax, 4C00h	;; pcDos quit executable.
	int	21h
  [SECTION .dseg]
result_flg_ptr	dw 0	;; address passed to store results_flag
  [SECTION .cseg]
; #endasm
;
;/**-- eo pcdoslib.c --**/
;
;/** EOF **/

	  [SECTION .dseg]
symtab:	TIMES +6480	DB 0
staticptr:	TIMES +1	DW 0
autoptr:	TIMES +1	DW 0
ws:	TIMES +100	DW 0
wsptr:	TIMES +1	DW 0
swstcase:	TIMES +100	DW 0
swstlab:	TIMES +100	DW 0
swstp:	TIMES +1	DW 0
litq:	TIMES +1000	DB 0
litptr:	TIMES +1	DW 0
macq:	TIMES +2176	DB 0
macptr:	TIMES +1	DW 0
line:	TIMES +80	DB 0
mline:	TIMES +80	DB 0
lptr:	TIMES +1	DW 0
mptr:	TIMES +1	DW 0
nxtlab:	TIMES +1	DW 0
litlab:	TIMES +1	DW 0
Msp:	TIMES +1	DW 0
Csp:	TIMES +1	DW 0
argstk:	TIMES +1	DW 0
ncmp:	TIMES +1	DW 0
errcnt:	TIMES +1	DW 0
errstop:	TIMES +1	DW 0
eof_flg:	TIMES +1	DW 0
fp_input:	TIMES +1	DW 0
fp_output:	TIMES +1	DW 0
fp_input2:	TIMES +1	DW 0
glbflag:	TIMES +1	DW 0
ctext:	TIMES +1	DW 0
cmode:	TIMES +1	DW 0
lastst:	TIMES +1	DW 0
mainflg:	TIMES +1	DW 0
saveout:	TIMES +1	DW 0
fnstart:	TIMES +1	DW 0
lineno:	TIMES +1	DW 0
infunc:	TIMES +1	DW 0
savestart:	TIMES +1	DW 0
saveline:	TIMES +1	DW 0
saveinfn:	TIMES +1	DW 0
currfn:	TIMES +1	DW 0
savecurr:	TIMES +1	DW 0
quote:	TIMES +2	DB 0
symbptr:	TIMES +1	DW 0
iptr:	TIMES +1	DW 0
fname_array:	TIMES +14	DB 0
nstr:	TIMES +6	DB 0
DebugFlag:	TIMES +1	DW 0
resultflg:	TIMES +1	DW 0
_AX_:	TIMES +1	DW 0
_BX_:	TIMES +1	DW 0
_CX_:	TIMES +1	DW 0
_DX_:	TIMES +1	DW 0
_SI_:	TIMES +1	DW 0
_DI_:	TIMES +1	DW 0
out_bufr:	TIMES +128	DB 0
tbuff:	TIMES +128	DB 0
in2_bufr:	TIMES +128	DB 0
in_port:	TIMES +1	DW 0
stdinbufr:	TIMES +258	DB 0
out_port:	TIMES +1	DW 0
putchar_port:	TIMES +1	DW 0
fgets_cnt:	TIMES +1	DW 0
SeekLo:	TIMES +1	DW 0
SeekHi:	TIMES +1	DW 0
ThisFileHand:	TIMES +1	DW 0

	  [SECTION .cseg]

	%INCLUDE 'EPILOG.NSM' 
; --- End of Compilation ---

8:38 PM 6/20/2011