;; ----===*******===----
	%INCLUDE 'PROLOG.NSM' 
;; --== NASM vers. 26-Mar-2010 ==--
	;; ***---- Program Body ----***
	  [SECTION .cseg]
;/** File: CCN8A.C  By: s_dubrovich@yahoo.com           **/ 
;/** - WARNING, pre-release, work-in-progress, WARNING! **/ 
;/** Use C5LIBA.C, PROLOG.NSM, EPILOG.NSM, CCN8A.MAK    **/ 
;/**----------------------------------------------------**/ 
;/** File: CCN8.C  By: s_dubrovich@yahoo.com            **/ 
;/** ?(C): COPYLEFT, spin fold or mungicate it, just re-**/ 
;/**   name it avoid confusion with this named codebase.**/ 
;/** Last: 19-Sep-10 06:12:18 PM                        **/ 
;/** Prev: 28-Mar-10 10:59:04 PM, 30-Mar-10 08:19:35 AM **/ 
;/**       01-Apr-10 09:23:04 PM.                       **/ 
;/** Base: 17-Feb-10 11:23:53 AM                        **/ 
;/** Vers: 0.0.2 r7hd 26-Mar-2010                       **/ 
;/**----------------------------------------------------**/ 
;/** 19-Sep-10 06:12:18 PM - added copyleft. this is    **/ 
;/**  BETA prelease code, testing and code is incomplete**/ 
;/**----------------------------------------------------**/ 
;/** 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					*/ 
;/*									*/ 
;/******************************************************/ 
; 
;#define BANNER  "* * *  Small-C  V1.1  * * *" 
; 
;#define VERSION "Based on Version N: July 17, 1980" 
; 
;#define AUTHOR "       By Ron Cain" 
; 
;/*	Define system dependent parameters	*/ 
; 
;/*	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	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 11 {0..10}      **/ 
;#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 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,		/* set non-zero on final input eof */ 
;	input,	/* iob # for input file */ 
;	output,	/* iob # for output file (if any) */ 
;	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=		/* not eof yet */ 
;	input=	/* no input file */ 
;	input2=	/* or include file */ 
;	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 [output], BX
	MOV  Word [input2], BX
	MOV  Word [input], BX
	MOV  Word [eof], 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();  
	CALL initfcb
;/**--------------------------------------------**/ 
;	/*				*/ 
;	/*	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 (input2) endinclude(); 
	MOV  BX, [Word input2]
	OR   BX, BX
	JNZ  L_3
	JMP  L_4
L_3:
	CALL endinclude
;	if (input)  fclose(input); 
L_4:
	MOV  BX, [Word input]
	OR   BX, BX
	JNZ  L_5
	JMP  L_6
L_5:
	MOV  BX, [Word 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 == 0)		/* do until no more input */ 
L_8:
	MOV  BX, [Word eof]
	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 **/ 
	JMP  L_8
L_10:
;	} 
	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
;	output = 0;			/* start with none */ 
	MOV  BX, +0
	MOV  Word [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 ((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 [output], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_115
	JMP  L_116
L_115:
;		{ 
;		output = 0;	/* can't open */ 
	MOV  BX, +0
	MOV  Word [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

;{ 
;	input = 0;			/* none to start with */ 
	MOV  BX, +0
	MOV  Word [input], BX
;	while (input == 0){	/* any above 1 allowed */ 
L_118:
	MOV  BX, [Word 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)break;	/* if user said none */ 
	MOV  BX, [Word eof]
	OR   BX, BX
	JNZ  L_121
	JMP  L_122
L_121:
	JMP  L_120
;		pl("Input filename? "); 
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 = 1; 
	MOV  BX, +1
	MOV  Word [eof], BX
;			break; 
	JMP  L_120
;			} /* none given... */ 
;		if ((input = fopen(line,"r")) != NULL) 
L_124:
	MOV  BX, line
	PUSH BX
	MOV  BX, L_117+17
	PUSH BX
	CALL fopen
	ADD  SP, +4
	MOV  Word [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:
;			input = 0;	/* can't open it */ 
	MOV  BX, +0
	MOV  Word [input], BX
;			pl("Open failure"); 
	MOV  BX, L_117+19
	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? ",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		*/ 
;/*						*/ 
;doinclude() 
doinclude:
	PUSH BP
	SUB  SP, AutoC129
	MOV  BP, SP

;{ 
;	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
;	nl(); 
	CALL nl
;	tofile(); 
	CALL tofile
; 
;	if (input2)					/* gtf 7/16/80 */ 
	MOV  BX, [Word input2]
	OR   BX, BX
	JNZ  L_130
	JMP  L_131
L_130:
;		error("Cannot nest include files"); 
	MOV  BX, L_129+10
	PUSH BX
	CALL error
	ADD  SP, +2
;	else if ((input2 = fopen(line+lptr,"r")) == NULL) 
	JMP  L_132
L_131:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_129+36
	PUSH BX
	CALL fopen
	ADD  SP, +4
	MOV  Word [input2], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_133
	JMP  L_134
L_133:
;		{ 
;		input2 = 0; 
	MOV  BX, +0
	MOV  Word [input2], BX
;		error("Open failure on include file"); 
	MOV  BX, L_129+38
	PUSH BX
	CALL error
	ADD  SP, +2
;		} 
;	else { 
	JMP  L_135
L_134:
;		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_135:
L_132:
;	kill();	/* clear rest of line */ 
	CALL kill
;			/* so next read will come from */ 
;			/* new file (if open */ 
;} 
	POP  BP
	RET

AutoC129	EQU 0

	  [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, AutoC136
	MOV  BP, SP

;{ 
;	toconsole(); 
	CALL toconsole
;	outstr("#end include"); nl(); 
	MOV  BX, L_136+0
	PUSH BX
	CALL outstr
	ADD  SP, +2
	CALL nl
;	tofile(); 
	CALL tofile
; 
;	input2  = 0; 
	MOV  BX, +0
	MOV  Word [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

AutoC136	EQU 0

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

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

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

AutoC137	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, AutoC140
	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_141:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_142
	JMP  L_143
L_142:
;		{ 
;		while (1) 
L_144:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_145
	JMP  L_146
L_145:
;			{  /** is_identifier() gets & validates identifier **/ 
;			if (endst()) return;	/* do line */ 
	CALL endst
	OR   BX, BX
	JNZ  L_147
	JMP  L_148
L_147:
	ADD  SP, AutoC140
	POP  BP
	RET
;			k = 1;			/* assume 1 element */ 
L_148:
	LEA  BX, [AutoC140-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
; 
;			if (match("*"))		/* pointer ? */ 
	MOV  BX, L_140+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_149
	JMP  L_150
L_149:
;				j = POINTER;	/* yes */ 
	LEA  BX, [AutoC140-4+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
;			else j = VARIABLE;	/* no */ 
	JMP  L_151
L_150:
	LEA  BX, [AutoC140-4+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
L_151:
; 
;			if (is_identifier(sname) == 0)	/* name ok? */ 
	LEA  BX, [AutoC140-17+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_152
	JMP  L_153
L_152:
;				illname();		/* no... const, */ 
	CALL illname
;			if(findstatic(sname))	/* already there? */ 
L_153:
	LEA  BX, [AutoC140-17+BP]
	PUSH BX
	CALL findstatic
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_154
	JMP  L_155
L_154:
;				multidef(sname); 
	LEA  BX, [AutoC140-17+BP]
	PUSH BX
	CALL multidef
	ADD  SP, +2
;			if (match("["))		/* array? */ 
L_155:
	MOV  BX, L_140+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_156
	JMP  L_157
L_156:
;				{ 
;				k = mk_subscript(); /* get size */ 
	LEA  BX, [AutoC140-2+BP]
	PUSH BX
	CALL mk_subscript
	POP  DI
	MOV  Word [DI], BX
;				if (k) j = ARRAY;	/* !0=array */ 
	LEA  BX, [AutoC140-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_158
	JMP  L_159
L_158:
	LEA  BX, [AutoC140-4+BP]
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Word [DI], BX
;				else j = POINTER; /* 0=ptr, a[] */ 
	JMP  L_160
L_159:
	LEA  BX, [AutoC140-4+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
L_160:
;				} 
;			addstatic(sname,j,typ,k); /* add symbol */ 
L_157:
	LEA  BX, [AutoC140-17+BP]
	PUSH BX
	LEA  BX, [AutoC140-4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC140+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC140-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL addstatic
	ADD  SP, +8
;			break; 
	JMP  L_146
;			} 
	JMP  L_144
L_146:
;		if (match(",") == 0) return;	/* more? */ 
	MOV  BX, L_140+4
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_161
	JMP  L_162
L_161:
	ADD  SP, AutoC140
	POP  BP
	RET
;		} 
L_162:
	JMP  L_141
L_143:
;} 
	ADD  SP, AutoC140
	POP  BP
	RET

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

	  [SECTION .dseg]
L_140	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, AutoC163
	MOV  BP, SP

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

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

	  [SECTION .dseg]
L_163	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, AutoC192
	MOV  BP, SP

;{ 
;	int num[1]; 
; 
;	if (match("]")) return 0;	/* null size */ 
	MOV  BX, L_192+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_193
	JMP  L_194
L_193:
	MOV  BX, +0
	ADD  SP, AutoC192
	POP  BP
	RET
;	if (number(num) == 0)	/* go after a number */ 
L_194:
	LEA  BX, [AutoC192-2+BP]
	PUSH BX
	CALL number
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_195
	JMP  L_196
L_195:
;		{ 
;		error("must be constant");	/* it isn't */ 
	MOV  BX, L_192+2
	PUSH BX
	CALL error
	ADD  SP, +2
;		num[0] = 1;		/* so force one */ 
	LEA  BX, [AutoC192-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_196:
	LEA  BX, [AutoC192-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_197
	JMP  L_198
L_197:
;		{ 
;		error("negative size illegal"); 
	MOV  BX, L_192+19
	PUSH BX
	CALL error
	ADD  SP, +2
;		num[0] = (-num[0]); 
	LEA  BX, [AutoC192-2+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC192-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_198:
	MOV  BX, L_192+41
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;	return num[0];		/* and return size */ 
	LEA  BX, [AutoC192-2+BP]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	ADD  SP, AutoC192
	POP  BP
	RET
;} 

AutoC192	EQU 2
;	num	ARRAY	INT	-2

	  [SECTION .dseg]
L_192	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, AutoC199
	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, [AutoC199-13+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_200
	JMP  L_201
L_200:
;		{ 
;		error("illegal function or declaration"); 
	MOV  BX, L_199+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		kill();	/* invalidate line */ 
	CALL kill
;		return; 
	ADD  SP, AutoC199
	POP  BP
	RET
;		} 
; 
;	fnstart = lineno;	/* remember where fn began gtf 7/2/80 */ 
L_201:
	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, [AutoC199-13+BP]
	PUSH BX
	CALL findstatic
	ADD  SP, +2
	MOV  Word [currfn], BX
	OR   BX, BX
	JNZ  L_202
	JMP  L_203
L_202:
;		{ 
;		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_204
	JMP  L_205
L_204:
	LEA  BX, [AutoC199-13+BP]
	PUSH BX
	CALL multidef
	ADD  SP, +2
;			/* already variable by that name */ 
;		else if (currfn[OFFSET] == FUNCTION) multidef(n); 
	JMP  L_206
L_205:
	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_207
	JMP  L_208
L_207:
	LEA  BX, [AutoC199-13+BP]
	PUSH BX
	CALL multidef
	ADD  SP, +2
;			/* already function by that name */ 
;		else currfn[OFFSET] = FUNCTION; 
	JMP  L_209
L_208:
	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_209:
L_206:
;			/* 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_210
L_203:
	LEA  BX, [AutoC199-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_210:
; 
;	/* Indicate to console what routine that we're in. */ 
; 
;	toconsole();					/* gtf 7/16/80 */ 
	CALL toconsole
;	outstr("====== "); 
	MOV  BX, L_199+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_199+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_199+43
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_211
	JMP  L_212
L_211:
	MOV  BX, L_199+45
	PUSH BX
	CALL error
	ADD  SP, +2
;	asm_symb(n); colon(); nl();	/* print function name */ 
L_212:
	LEA  BX, [AutoC199-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_213:
	MOV  BX, L_199+64
	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:
;		{	/* any legal name bumps arg count */ 
;			/** is_identifier() gets & validates identifier **/ 
;		if (is_identifier(n)) 
	LEA  BX, [AutoC199-13+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_216
	JMP  L_217
L_216:
;			{ 
;			if (findauto(n)) multidef(n); 
	LEA  BX, [AutoC199-13+BP]
	PUSH BX
	CALL findauto
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_218
	JMP  L_219
L_218:
	LEA  BX, [AutoC199-13+BP]
	PUSH BX
	CALL multidef
	ADD  SP, +2
;			else	{ 
	JMP  L_220
L_219:
;				addauto(n,0,0,argstk); 
	LEA  BX, [AutoC199-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_220:
;			} 
;		else	{ 
	JMP  L_221
L_217:
;			error("illegal argument name"); 
	MOV  BX, L_199+66
	PUSH BX
	CALL error
	ADD  SP, +2
;			junk(); 
	CALL junk
;			} 
L_221:
;		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_199+88
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_222
	JMP  L_223
L_222:
;			{ 
;			if (match(",") == 0) 
	MOV  BX, L_199+90
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_224
	JMP  L_225
L_224:
;			error("expected comma"); 
	MOV  BX, L_199+92
	PUSH BX
	CALL error
	ADD  SP, +2
;			} 
L_225:
;		if (endst()) break; 
L_223:
	CALL endst
	OR   BX, BX
	JNZ  L_226
	JMP  L_227
L_226:
	JMP  L_215
;		} 
L_227:
	JMP  L_213
L_215:
; 
;	argtop = argstk;	/* Save max arg stack size. */ 
	LEA  BX, [AutoC199-15+BP]
	PUSH BX
	MOV  BX, [Word argstk]
	POP  DI
	MOV  Word [DI], BX
;	while (argstk)	/* now let user declare what types  */ 
L_228:
	MOV  BX, [Word argstk]
	OR   BX, BX
	JNZ  L_229
	JMP  L_230
L_229:
;		{		/* of things those arguments were */ 
;		if (amatch("char",4)) 
	MOV  BX, L_199+107
	PUSH BX
	MOV  BX, +4
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_231
	JMP  L_232
L_231:
;			{ 
;			getarg(CCHAR,argtop); 
	MOV  BX, +1
	PUSH BX
	LEA  BX, [AutoC199-15+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL getarg
	ADD  SP, +4
;			ns(); 
	CALL ns
;			continue; 
	JMP  L_228
;			} 
;		else if (amatch("int",3)) 
	JMP  L_233
L_232:
	MOV  BX, L_199+112
	PUSH BX
	MOV  BX, +3
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_234
	JMP  L_235
L_234:
;			{ 
;			getarg(CINT,argtop); 
	MOV  BX, +2
	PUSH BX
	LEA  BX, [AutoC199-15+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL getarg
	ADD  SP, +4
;			ns(); 
	CALL ns
;			continue; 
	JMP  L_228
;			} 
;		else	{ 
	JMP  L_236
L_235:
;			error("wrong number args"); 
	MOV  BX, L_199+116
	PUSH BX
	CALL error
	ADD  SP, +2
;			break; 
	JMP  L_230
;			} 
L_236:
L_233:
;		} 
	JMP  L_228
L_230:
; 
;	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_237
	JMP  L_238
L_237:
;						/* 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_238:
	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, AutoC199
	POP  BP
	RET

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

	  [SECTION .dseg]
L_199	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, AutoC239
	MOV  BP, SP

;	{ 
;	char n[NAMESIZE], *argptr; 
;	int j, auto_addr; 
; 
;	while (1) 
L_240:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_241
	JMP  L_242
L_241:
;		{ 
;		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_243
	JMP  L_244
L_243:
	ADD  SP, AutoC239
	POP  BP
	RET
;		if (match("*")) j = POINTER; 
L_244:
	MOV  BX, L_239+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_245
	JMP  L_246
L_245:
	LEA  BX, [AutoC239-17+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
;		else j = VARIABLE; 
	JMP  L_247
L_246:
	LEA  BX, [AutoC239-17+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
L_247:
;			/** is_identifier() gets & validates identifier **/ 
;		if (is_identifier(n)) 
	LEA  BX, [AutoC239-13+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_248
	JMP  L_249
L_248:
;			{ 
;			if (match("["))	/* pointer ? */ 
	MOV  BX, L_239+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_250
	JMP  L_251
L_250:
;				/* it is a pointer, so skip all */ 
;				/* stuff between "[]" */ 
;				{ 
;				while (scan_nxt() != ']') 
L_252:
	CALL scan_nxt
	PUSH BX
	MOV  BX, +93
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_253
	JMP  L_254
L_253:
;					if (endst()) break; 
	CALL endst
	OR   BX, BX
	JNZ  L_255
	JMP  L_256
L_255:
	JMP  L_254
;				j = POINTER;	/* add entry as pointer */ 
L_256:
	JMP  L_252
L_254:
	LEA  BX, [AutoC239-17+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
;				} 
;			if (argptr = findauto(n)) 
L_251:
	LEA  BX, [AutoC239-15+BP]
	PUSH BX
	LEA  BX, [AutoC239-13+BP]
	PUSH BX
	CALL findauto
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_257
	JMP  L_258
L_257:
;				{ 
;				argptr[IDENT] = j; 
	LEA  BX, [AutoC239-15+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC239-17+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;					/* save type info for arg just  
;					   found. */ 
;				argptr[TYPE] = t; 
	LEA  BX, [AutoC239-15+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +14
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC239+6+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;				auto_addr = top - (argptr[OFFSET+1]<<8) 
	LEA  BX, [AutoC239-19+BP]
	PUSH BX
	LEA  BX, [AutoC239+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC239-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, [AutoC239-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, [AutoC239-15+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +16
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC239-19+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;				argptr[OFFSET+1] = auto_addr>>8; 
	LEA  BX, [AutoC239-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, [AutoC239-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_259
L_258:
;				error("expecting argument name"); 
	MOV  BX, L_239+4
	PUSH BX
	CALL error
	ADD  SP, +2
L_259:
;			} 
;		else 
	JMP  L_260
L_249:
;			illname(); 
	CALL illname
L_260:
;		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_261
	JMP  L_262
L_261:
	ADD  SP, AutoC239
	POP  BP
	RET
;		if (match(",") == 0) error("expected comma"); 
L_262:
	MOV  BX, L_239+28
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_263
	JMP  L_264
L_263:
	MOV  BX, L_239+30
	PUSH BX
	CALL error
	ADD  SP, +2
;		} 
L_264:
	JMP  L_240
L_242:
;} 
	ADD  SP, AutoC239
	POP  BP
	RET

AutoC239	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_239	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, AutoC265
	MOV  BP, SP

;{ 
;	if ((inspect_chr()==0) & (eof)) return; 
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	PUSH BX
	MOV  BX, [Word eof]
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_266
	JMP  L_267
L_266:
	POP  BP
	RET
;	else if (amatch("char",4)) 
	JMP  L_268
L_267:
	MOV  BX, L_265+0
	PUSH BX
	MOV  BX, +4
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_269
	JMP  L_270
L_269:
;		{ 
;		declauto(CCHAR); 
	MOV  BX, +1
	PUSH BX
	CALL declauto
	ADD  SP, +2
;		ns(); 
	CALL ns
;		} 
;	else if (amatch("int",3)) 
	JMP  L_271
L_270:
	MOV  BX, L_265+5
	PUSH BX
	MOV  BX, +3
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_272
	JMP  L_273
L_272:
;		{ 
;		declauto(CINT); 
	MOV  BX, +2
	PUSH BX
	CALL declauto
	ADD  SP, +2
;		ns(); 
	CALL ns
;		} 
;	else if (match("{"))  compound(); 
	JMP  L_274
L_273:
	MOV  BX, L_265+9
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_275
	JMP  L_276
L_275:
	CALL compound
;	else if (amatch("if",2)) 
	JMP  L_277
L_276:
	MOV  BX, L_265+11
	PUSH BX
	MOV  BX, +2
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_278
	JMP  L_279
L_278:
;		{ 
;		doif(); 
	CALL doif
;		lastst = ST_IF; 
	MOV  BX, +1
	MOV  Word [lastst], BX
;		} 
;	else if (amatch("do",2)) 
	JMP  L_280
L_279:
	MOV  BX, L_265+14
	PUSH BX
	MOV  BX, +2
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_281
	JMP  L_282
L_281:
;		{ 
;		dodo(); 
	CALL dodo
;		lastst = ST_DO; 
	MOV  BX, +8
	MOV  Word [lastst], BX
;		} 
;	else if (amatch("while",5)) 
	JMP  L_283
L_282:
	MOV  BX, L_265+17
	PUSH BX
	MOV  BX, +5
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_284
	JMP  L_285
L_284:
;		{ 
;		dowhile(); 
	CALL dowhile
;		lastst = ST_WHILE; 
	MOV  BX, +2
	MOV  Word [lastst], BX
;		} 
;	else if (amatch("return",6)) 
	JMP  L_286
L_285:
	MOV  BX, L_265+23
	PUSH BX
	MOV  BX, +6
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_287
	JMP  L_288
L_287:
;		{ 
;		doreturn(); 
	CALL doreturn
;		ns(); 
	CALL ns
;		lastst = ST_RETURN; 
	MOV  BX, +3
	MOV  Word [lastst], BX
;		} 
;	else if (amatch("break",5)) 
	JMP  L_289
L_288:
	MOV  BX, L_265+30
	PUSH BX
	MOV  BX, +5
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_290
	JMP  L_291
L_290:
;		{ 
;		dobreak(); 
	CALL dobreak
;		ns(); 
	CALL ns
;		lastst = ST_BREAK; 
	MOV  BX, +4
	MOV  Word [lastst], BX
;		} 
;	else if (amatch("continue",8)) 
	JMP  L_292
L_291:
	MOV  BX, L_265+36
	PUSH BX
	MOV  BX, +8
	PUSH BX
	CALL amatch
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_293
	JMP  L_294
L_293:
;		{ 
;		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_295
L_294:
	MOV  BX, L_265+45
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_296
	JMP  L_297
L_296:
;	else if (match("#asm")) 
	JMP  L_298
L_297:
	MOV  BX, L_265+47
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_299
	JMP  L_300
L_299:
;		{ 
;		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_301
L_300:
;		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_301:
L_298:
L_295:
L_292:
L_289:
L_286:
L_283:
L_280:
L_277:
L_274:
L_271:
L_268:
;	return lastst; 
	MOV  BX, [Word lastst]
	POP  BP
	RET
;}		/** eo statement **/ 

AutoC265	EQU 0

	  [SECTION .dseg]
L_265	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, AutoC302
	MOV  BP, SP

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

AutoC302	EQU 0

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

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

;{ 
;	++ncmp;		/* new level open */ 
	MOV  BX, [Word ncmp]
	INC  BX
	MOV  Word [ncmp], BX
;	while (match("}") == 0) statement(); /* do one */ 
L_306:
	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_307
	JMP  L_308
L_307:
	CALL statement
	JMP  L_306
L_308:
;	--ncmp;		/* close current level */ 
	MOV  BX, [Word ncmp]
	DEC  BX
	MOV  Word [ncmp], BX
;} 
	POP  BP
	RET

AutoC305	EQU 0

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

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

;{ 
;	int flev,fsp,flab1,flab2; 
;	int t_lbl; 
; 
;	flev = autoptr;		/* record current local level */ 
	LEA  BX, [AutoC309-2+BP]
	PUSH BX
	MOV  BX, [Word autoptr]
	POP  DI
	MOV  Word [DI], BX
;	fsp = Csp;			/* record current stk ptr */ 
	LEA  BX, [AutoC309-4+BP]
	PUSH BX
	MOV  BX, [Word Csp]
	POP  DI
	MOV  Word [DI], BX
; 
;	t_lbl = getlabel();	/** for true branch **/ 
	LEA  BX, [AutoC309-10+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	flab1 = getlabel();	/* get label for false branch */ 
	LEA  BX, [AutoC309-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, [AutoC309-10+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC309-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, [AutoC309-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, [AutoC309-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, [AutoC309-2+BP]
	MOV  BX, [BX]
	MOV  Word [autoptr], BX
;	if (amatch("else",4) == 0)	/* if...else ? */ 
	MOV  BX, L_309+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_310
	JMP  L_311
L_310:
;		{			/* simple "if"...print false label */ 
;		sa_mk_lbl(flab1); 
	LEA  BX, [AutoC309-6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;		return;		/* and exit */ 
	ADD  SP, AutoC309
	POP  BP
	RET
;		} 
; 
;	/* an "if...else" statement. */ 
; 
;	sa_jump(flab2 = getlabel());		/* jump around false code */ 
L_311:
	LEA  BX, [AutoC309-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, [AutoC309-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, [AutoC309-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_modstk
	ADD  SP, +2
	MOV  Word [Csp], BX
;	autoptr = flev;				/* and deallocate locals */ 
	LEA  BX, [AutoC309-2+BP]
	MOV  BX, [BX]
	MOV  Word [autoptr], BX
;	sa_mk_lbl(flab2);				/* print true label */ 
	LEA  BX, [AutoC309-8+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;}		/** eo doif **/ 
	ADD  SP, AutoC309
	POP  BP
	RET

AutoC309	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_309	DB "else",0

	  [SECTION .cseg]
; 
;/*						*/ 
;/*	"do" statement "while" (expr)	*/ 
;/*						*/ 
;dodo() 
dodo:
	PUSH BP
	SUB  SP, AutoC312
	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, [AutoC312-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, [AutoC312-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, [AutoC312-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, [AutoC312-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, [AutoC312-12+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	ws[WS_LBL] = getlabel();	/* and exit label */ 
	LEA  BX, [AutoC312-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, [AutoC312-10+BP]
	PUSH BX
	CALL addwhile
	ADD  SP, +2
; 
;		/* (for "break" statement) */ 
;	sa_mk_lbl(ws[WS_LBL2]);	/* loop label */ 
	LEA  BX, [AutoC312-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_312+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_313
	JMP  L_314
L_313:
;		{ 
;		error("'while' expected."); 
	MOV  BX, L_312+6
	PUSH BX
	CALL error
	ADD  SP, +2
;		return;		/* and exit */ 
	ADD  SP, AutoC312
	POP  BP
	RET
;		} 
; 
;	sa_mk_lbl(ws[WS_LOOP]);		/* cont label, at while(expr) */ 
L_314:
	LEA  BX, [AutoC312-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, [AutoC312-12+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC312-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, [AutoC312-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, [AutoC312-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, [AutoC312-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, [AutoC312-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, AutoC312
	POP  BP
	RET

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

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

	  [SECTION .cseg]
; 
; 
;/*						*/ 
;/*	"while" (expr) statement	*/ 
;/*						*/ 
; 
;dowhile() 
dowhile:
	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_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_LOOP]);		/* loop label */ 
	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]);	* see if true */  
;	logic_tst(t_lbl,ws[WS_LBL]); /** test new fn **/ 
	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_tst
	ADD  SP, +4
; 
;	sa_mk_lbl(t_lbl);		/** codegen true branch label **/ 
	LEA  BX, [AutoC315-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, [AutoC315-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, [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
;	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 dowhile **/ 
	ADD  SP, AutoC315
	POP  BP
	RET

AutoC315	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, AutoC316
	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_317
	JMP  L_318
L_317:
	MOV  BX, +1
	PUSH BX
	CALL expression
	ADD  SP, +2
;	sa_rtnstk(0);			/* clean up stk */ 
L_318:
	MOV  BX, +0
	PUSH BX
	CALL sa_rtnstk
	ADD  SP, +2
;	sa_ret();				/* and exit function */ 
	CALL sa_ret
;}		/** eo doreturn **/ 
	POP  BP
	RET

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

;{ 
;	int *ptr; 
; 
;	/* see if any "whiles" are open */ 
; 
;	if ((ptr=readwhile()) == 0) return;	/* no */ 
	LEA  BX, [AutoC319-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_320
	JMP  L_321
L_320:
	ADD  SP, AutoC319
	POP  BP
	RET
;	sa_modstk((ptr[WS_SP]));		/* else clean up stk ptr */ 
L_321:
	LEA  BX, [AutoC319-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, [AutoC319-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, AutoC319
	POP  BP
	RET

AutoC319	EQU 2
;	ptr	PTR	INT	-2
; 
;/*					*/ 
;/*	"continue" statement	*/ 
;/*					*/ 
;docont() 
docont:
	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_LOOP]);		/* jump to loop label */ 
	LEA  BX, [AutoC322-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, AutoC322
	POP  BP
	RET

AutoC322	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, AutoC325
	MOV  BP, SP

;{ 
;	cmode = 0;		/* mark mode as "asm" */ 
	MOV  BX, +0
	MOV  Word [cmode], BX
;	while (1) 
L_326:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_327
	JMP  L_328
L_327:
;		{ 
;		inline();	/* get and print lines */ 
	CALL inline
;		if (match("#endasm")) 
	MOV  BX, L_325+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_329
	JMP  L_330
L_329:
;			{	/* 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_328
;			} 
;		if (eof) break; 
L_330:
	MOV  BX, [Word eof]
	OR   BX, BX
	JNZ  L_331
	JMP  L_332
L_331:
	JMP  L_328
;		outstr(line); 
L_332:
	MOV  BX, line
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		nl(); 
	CALL nl
;		} 
	JMP  L_326
L_328:
;/**	kill();		* invalidate line */ 
;	cmode = 1;		/* then back to parse level */ 
	MOV  BX, +1
	MOV  Word [cmode], BX
;} 
	POP  BP
	RET

AutoC325	EQU 0

	  [SECTION .dseg]
L_325	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, AutoC333
	MOV  BP, SP

;{ 
;	int nargs; 
; 
;	nargs = 0; 
	LEA  BX, [AutoC333-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, [AutoC333+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_334
	JMP  L_335
L_334:
	CALL sa_push
;	while (streq(line+lptr,")") == 0) 
L_335:
L_336:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_333+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_337
	JMP  L_338
L_337:
;		{ 
;		if (endst()) break; 
	CALL endst
	OR   BX, BX
	JNZ  L_339
	JMP  L_340
L_339:
	JMP  L_338
;		expression(NO);		/* get an argument */ 
L_340:
	MOV  BX, +0
	PUSH BX
	CALL expression
	ADD  SP, +2
;		if (ptr==0) sa_swapstk(); /* don't push addr */ 
	LEA  BX, [AutoC333+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_341
	JMP  L_342
L_341:
	CALL sa_swapstk
;		sa_push();			/* push argument */ 
L_342:
	CALL sa_push
;		nargs = nargs + 2;	/* count args*2 */ 
	LEA  BX, [AutoC333-2+BP]
	PUSH BX
	LEA  BX, [AutoC333-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_333+2
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_343
	JMP  L_344
L_343:
	JMP  L_338
;		} 
L_344:
	JMP  L_336
L_338:
;	needbrack(")"); 
	MOV  BX, L_333+4
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;	if (ptr) sa_call(ptr); 
	LEA  BX, [AutoC333+4+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_345
	JMP  L_346
L_345:
	LEA  BX, [AutoC333+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_call
	ADD  SP, +2
;	else sa_callstk(); 
	JMP  L_347
L_346:
	CALL sa_callstk
L_347:
;          /** target address is on the stack already [1] **/ 
;	Csp = sa_modstk(Csp + nargs);	/* clean up arguments */ 
	MOV  BX, [Word Csp]
	PUSH BX
	LEA  BX, [AutoC333-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, AutoC333
	POP  BP
	RET

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

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

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

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

AutoC348	EQU 0
; 
;endst() 
endst:
	PUSH BP
	SUB  SP, AutoC360
	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_360+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
;} 

AutoC360	EQU 0

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

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

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

AutoC361	EQU 0

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

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

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

AutoC362	EQU 0
;	sname	PTR	CHAR	+4

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

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

;{ 
;	if (match(str) == 0) 
	LEA  BX, [AutoC363+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_364
	JMP  L_365
L_364:
;		{ 
;		error("missing bracket"); 
	MOV  BX, L_363+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		sa_comment(); 
	CALL sa_comment
;		outstr(str); 
	LEA  BX, [AutoC363+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outstr
	ADD  SP, +2
;		nl(); 
	CALL nl
;		} 
;} 
L_365:
	POP  BP
	RET

AutoC363	EQU 0
;	str	PTR	CHAR	+4

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

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

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

AutoC366	EQU 0

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

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

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

AutoC367	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, AutoC373
	MOV  BP, SP

;{ 
;	char *ptr; 
; 
;	ptr = startauto; 
	LEA  BX, [AutoC373-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_374:
	LEA  BX, [AutoC373-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word autoptr]
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_375
	JMP  L_376
L_375:
;		{ 
;		if (astreq(sname,ptr,NAMEMAX)) return ptr; 
	LEA  BX, [AutoC373+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC373-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +12
	PUSH BX
	CALL astreq
	ADD  SP, +6
	OR   BX, BX
	JNZ  L_377
	JMP  L_378
L_377:
	LEA  BX, [AutoC373-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC373
	POP  BP
	RET
;			/** matched, return with ptr into tbl **/ 
;		ptr = ptr + SYMB_SIZE;  /** ptr == &sname[0]   **/ 
L_378:
	LEA  BX, [AutoC373-2+BP]
	PUSH BX
	LEA  BX, [AutoC373-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +18
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		} 
	JMP  L_374
L_376:
;	return 0; 
	MOV  BX, +0
	ADD  SP, AutoC373
	POP  BP
	RET
;} 

AutoC373	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, AutoC379
	MOV  BP, SP

;{ 
;	char *ptr; 
; 
;	if (symbptr = findstatic(sname)) return symbptr; 
	LEA  BX, [AutoC379+10+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL findstatic
	ADD  SP, +2
	MOV  Word [symbptr], BX
	OR   BX, BX
	JNZ  L_380
	JMP  L_381
L_380:
	MOV  BX, [Word symbptr]
	ADD  SP, AutoC379
	POP  BP
	RET
;	if (staticptr >= endstatics) 
L_381:
	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_382
	JMP  L_383
L_382:
;		{ 
;		error("global symbol table overflow"); 
	MOV  BX, L_379+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		return 0; 
	MOV  BX, +0
	ADD  SP, AutoC379
	POP  BP
	RET
;		} 
;	symbptr = ptr = staticptr; 
L_383:
	LEA  BX, [AutoC379-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_384:
	LEA  BX, [AutoC379-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC379+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_385
	JMP  L_386
L_385:
	JMP  L_384
L_386:
;	symbptr[IDENT] = id; 
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC379+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, [AutoC379+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, [AutoC379+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, [AutoC379+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, AutoC379
	POP  BP
	RET
;} 

AutoC379	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_379	DB "global symbol table overflow",0

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

;{ 
;	char *ptr; 
; 
;	if (symbptr = findauto(sname)) return symbptr; 
	LEA  BX, [AutoC387+10+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL findauto
	ADD  SP, +2
	MOV  Word [symbptr], BX
	OR   BX, BX
	JNZ  L_388
	JMP  L_389
L_388:
	MOV  BX, [Word symbptr]
	ADD  SP, AutoC387
	POP  BP
	RET
;	if (autoptr >= endautos) 
L_389:
	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_390
	JMP  L_391
L_390:
;		{ 
;		error("local symbol table overflow"); 
	MOV  BX, L_387+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		return 0; 
	MOV  BX, +0
	ADD  SP, AutoC387
	POP  BP
	RET
;		} 
;	symbptr = ptr = autoptr; 
L_391:
	LEA  BX, [AutoC387-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_392:
	LEA  BX, [AutoC387-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC387+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_393
	JMP  L_394
L_393:
	JMP  L_392
L_394:
;	symbptr[IDENT] = id; 
	MOV  BX, [Word symbptr]
	PUSH BX
	MOV  BX, +13
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC387+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, [AutoC387+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, [AutoC387+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, [AutoC387+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, AutoC387
	POP  BP
	RET
;} 

AutoC387	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_387	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, AutoC395
	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_396
	JMP  L_397
L_396:
	MOV  BX, +0
	ADD  SP, AutoC395
	POP  BP
	RET
;		/** flag lexeme as number ? **/ 
; 
;	k = 0;  /** inspect next chr for alph-numeric **/  
L_397:
	LEA  BX, [AutoC395-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_398:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_399
	JMP  L_400
L_399:
	LEA  BX, [AutoC395+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC395-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_398
L_400:
;	sname[k] = 0;   /** append null **/ 
	LEA  BX, [AutoC395+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC395-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, AutoC395
	POP  BP
	RET
;} 

AutoC395	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, AutoC401
	MOV  BP, SP

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

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

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

AutoC402	EQU 0
;	label	VAR	INT	+4

	  [SECTION .dseg]
L_402	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, AutoC403
	MOV  BP, SP

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

AutoC403	EQU 0
;	n	VAR	INT	+4

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

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

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

AutoC404	EQU 0

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

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

;{ 
;	c = c & 127; 
	LEA  BX, [AutoC405+4+BP]
	PUSH BX
	LEA  BX, [AutoC405+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, [AutoC405+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +97
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC405+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, [AutoC405+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +65
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC405+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, [AutoC405+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
;} 

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

;{ 
;	c = c & 127; 
	LEA  BX, [AutoC406+4+BP]
	PUSH BX
	LEA  BX, [AutoC406+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, [AutoC406+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC406+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
;} 

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

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

AutoC407	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, AutoC408
	MOV  BP, SP

;{ 
;	int k; 
; 
;	k = 0; 
	LEA  BX, [AutoC408-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_409:
	LEA  BX, [AutoC408+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC408-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_410
	JMP  L_411
L_410:
	LEA  BX, [AutoC408+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC408-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_409
L_411:
;} 
	ADD  SP, AutoC408
	POP  BP
	RET

AutoC408	EQU 2
;	str	PTR	CHAR	+4
;	k	VAR	INT	-2
; 
;addwhile(ptr) int ptr[]; 
addwhile:
	PUSH BP
	SUB  SP, AutoC412
	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_413
	JMP  L_414
L_413:
;		{ 
;		error("too many active whiles"); 
	MOV  BX, L_412+0
	PUSH BX
	CALL error
	ADD  SP, +2
;		return; 
	ADD  SP, AutoC412
	POP  BP
	RET
;		} 
;	k = 0; 
L_414:
	LEA  BX, [AutoC412-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (k < WS_SZ) 
L_415:
	LEA  BX, [AutoC412-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +5
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_416
	JMP  L_417
L_416:
;		{ 
;		*wsptr++ = ptr[k++]; 
	MOV  BX, [Word wsptr]
	INC  BX
	INC  BX
	MOV  Word [wsptr], BX
	DEC  BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC412+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC412-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_415
L_417:
;} 
	ADD  SP, AutoC412
	POP  BP
	RET

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

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

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

;{ 
;	if (readwhile()) wsptr = wsptr-WS_SZ; 
	CALL readwhile
	OR   BX, BX
	JNZ  L_419
	JMP  L_420
L_419:
	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_420:
	POP  BP
	RET

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

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

AutoC421	EQU 0

	  [SECTION .dseg]
L_421	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, AutoC425
	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
;} 

AutoC425	EQU 0
; 
;lookahead() /** lookahead, but doesn't advance ptr **/ 
lookahead:
	PUSH BP
	SUB  SP, AutoC426
	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_427
	JMP  L_428
L_427:
	MOV  BX, +0
	POP  BP
	RET
;	else return (line[lptr+1] & 127); 
	JMP  L_429
L_428:
	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_429:
;} 
	POP  BP
	RET

AutoC426	EQU 0
; 
; /** ret chr from linebuffer and advance ptr unless null chr **/ 
;g_nxtchr() 
g_nxtchr:
	PUSH BP
	SUB  SP, AutoC430
	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_431
	JMP  L_432
L_431:
	MOV  BX, +0
	POP  BP
	RET
;	else return (line[lptr++] & 127); 
	JMP  L_433
L_432:
	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_433:
;} 
	POP  BP
	RET

AutoC430	EQU 0
; 
; /** reindex & null terminate input line **/ 
;kill() 
kill:
	PUSH BP
	SUB  SP, AutoC434
	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

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

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

AutoC435	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, AutoC441
	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_442
	JMP  L_443
L_442:
	CALL inline
;	if (eof) return 0; 
L_443:
	MOV  BX, [Word eof]
	OR   BX, BX
	JNZ  L_444
	JMP  L_445
L_444:
	MOV  BX, +0
	POP  BP
	RET
;	return (g_nxtchr()); 
L_445:
	CALL g_nxtchr
	POP  BP
	RET
;} 

AutoC441	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, AutoC446
	MOV  BP, SP

;{ 
;	int k, unit; 
; 
;	while(1) 
L_447:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_448
	JMP  L_449
L_448:
;		{ 
;		if (input == 0) openin(); 
	MOV  BX, [Word input]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_450
	JMP  L_451
L_450:
	CALL openin
;		if (eof) return; 
L_451:
	MOV  BX, [Word eof]
	OR   BX, BX
	JNZ  L_452
	JMP  L_453
L_452:
	ADD  SP, AutoC446
	POP  BP
	RET
;		if ((unit = input2) == 0) unit = input; 
L_453:
	LEA  BX, [AutoC446-4+BP]
	PUSH BX
	MOV  BX, [Word input2]
	POP  DI
	MOV  Word [DI], BX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_454
	JMP  L_455
L_454:
	LEA  BX, [AutoC446-4+BP]
	PUSH BX
	MOV  BX, [Word input]
	POP  DI
	MOV  Word [DI], BX
;		kill();  /** clear line index **/ 
L_455:
	CALL kill
; 
;		while ((k = getc(unit)) > 0)  /** main fetch fn **/ 
L_456:
	LEA  BX, [AutoC446-2+BP]
	PUSH BX
	LEA  BX, [AutoC446-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_457
	JMP  L_458
L_457:
;			{ 
;			if ((k == eol) | (lptr >= LINEMAX)) break; /** chg >= to > **/ 
	LEA  BX, [AutoC446-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_459
	JMP  L_460
L_459:
	JMP  L_458
;			line[lptr++] = k;	/** store input in static char array **/ 
L_460:
	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, [AutoC446-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;			}	/** a null in stream will abort while **/ 
	JMP  L_456
L_458:
; 
;		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, [AutoC446-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccle
	OR   BX, BX
	JNZ  L_461
	JMP  L_462
L_461:
;			{ 
;			fclose(unit); 
	LEA  BX, [AutoC446-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL fclose
	ADD  SP, +2
;			if (input2) endinclude();	/* gtf 7/16/80 */ 
	MOV  BX, [Word input2]
	OR   BX, BX
	JNZ  L_463
	JMP  L_464
L_463:
	CALL endinclude
;			else input = 0; 
	JMP  L_465
L_464:
	MOV  BX, +0
	MOV  Word [input], BX
L_465:
;			} 
;		if (lptr)	/** indicates something was read to process **/ 
L_462:
	MOV  BX, [Word lptr]
	OR   BX, BX
	JNZ  L_466
	JMP  L_467
L_466:
;			{	/** 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_468
	JMP  L_469
L_468:
;				{ 
;				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_469:
	MOV  BX, +0
	MOV  Word [lptr], BX
;			return;	/** -with line[] filled to process **/ 
	ADD  SP, AutoC446
	POP  BP
	RET
;			} 
;		} 
L_467:
	JMP  L_447
L_449:
;} 
	ADD  SP, AutoC446
	POP  BP
	RET

AutoC446	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, AutoC470
	MOV  BP, SP

;{ 
;	mline[mptr] = c; 
	MOV  BX, mline
	PUSH BX
	MOV  BX, [Word mptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC470+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_471
	JMP  L_472
L_471:
	MOV  BX, [Word mptr]
	INC  BX
	MOV  Word [mptr], BX
	DEC  BX
;	return c; 
L_472:
	LEA  BX, [AutoC470+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  BP
	RET
;} 

AutoC470	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, AutoC473
	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_474
	JMP  L_475
L_474:
	ADD  SP, AutoC473
	POP  BP
	RET
;	mptr = lptr = 0;        /** reset static ptrs **/ 
L_475:
	MOV  BX, +0
	MOV  Word [lptr], BX
	MOV  Word [mptr], BX
;	while	(inspect_chr()) 
L_476:
	CALL inspect_chr
	OR   BX, BX
	JNZ  L_477
	JMP  L_478
L_477:
;		{ 
;		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_479
	JMP  L_480
L_479:
;			{  /** 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_481:
	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:
;				g_nxtchr(); /** rets chr or null at line[lptr] **/ 
	CALL g_nxtchr
	JMP  L_481
L_483:
;			} 
;		else	if (inspect_chr() == '"') 
	JMP  L_484
L_480:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +34
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_485
	JMP  L_486
L_485:
;			{  /** 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_487:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +34
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_488
	JMP  L_489
L_488:
;				{ 
;				if (inspect_chr() == 0) 
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_490
	JMP  L_491
L_490:
;					{ 
;					error("missing quote"); 
	MOV  BX, L_473+0
	PUSH BX
	CALL error
	ADD  SP, +2
;					break; 
	JMP  L_489
;					} 
;				keepch(g_nxtchr()); 
L_491:
	CALL g_nxtchr
	PUSH BX
	CALL keepch
	ADD  SP, +2
;				} 
	JMP  L_487
L_489:
;			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_492
L_486:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +39
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_493
	JMP  L_494
L_493:
;			{  /** 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_495:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +39
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_496
	JMP  L_497
L_496:
;				{ 
;				if (inspect_chr() == 0) 
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_498
	JMP  L_499
L_498:
;					{ 
;					error("missing apostrophe"); 
	MOV  BX, L_473+14
	PUSH BX
	CALL error
	ADD  SP, +2
;					break; 
	JMP  L_497
;					} 
;				keepch(g_nxtchr()); 
L_499:
	CALL g_nxtchr
	PUSH BX
	CALL keepch
	ADD  SP, +2
;				} 
	JMP  L_495
L_497:
;			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_500
L_494:
	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_501
	JMP  L_502
L_501:
;			{  /** comments, like this one **/ 
;			inchar(); inchar(); 
	CALL inchar
	CALL inchar
;			while	(((inspect_chr() == '*') & (lookahead() == '/')) == 0) 
L_503:
	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_504
	JMP  L_505
L_504:
;				{ 
;				if (inspect_chr() == 0) inline(); 
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_506
	JMP  L_507
L_506:
	CALL inline
;				else inchar(); 
	JMP  L_508
L_507:
	CALL inchar
L_508:
;				if (eof) break; 
	MOV  BX, [Word eof]
	OR   BX, BX
	JNZ  L_509
	JMP  L_510
L_509:
	JMP  L_505
;				} 
L_510:
	JMP  L_503
L_505:
;			inchar();inchar(); 
	CALL inchar
	CALL inchar
;			} 
;		else	if (an(inspect_chr())) 
	JMP  L_511
L_502:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_512
	JMP  L_513
L_512:
;			{  /** macro substitution by lookup is done here **/ 
;			k = 0; 
	LEA  BX, [AutoC473-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;			while	(an(inspect_chr())) 
L_514:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_515
	JMP  L_516
L_515:
;				{  /** copy token **/ 
;				if (k < NAMEMAX) sname[k++] = inspect_chr(); 
	LEA  BX, [AutoC473-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +12
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_517
	JMP  L_518
L_517:
	LEA  BX, [AutoC473-16+BP]
	PUSH BX
	LEA  BX, [AutoC473-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_518:
	CALL g_nxtchr
;				} 
	JMP  L_514
L_516:
;			sname[k] = 0;  /** append null to extracted token **/ 
	LEA  BX, [AutoC473-16+BP]
	PUSH BX
	LEA  BX, [AutoC473-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, [AutoC473-2+BP]
	PUSH BX
	LEA  BX, [AutoC473-16+BP]
	PUSH BX
	CALL findmac
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_519
	JMP  L_520
L_519:
;				while	(c = macq[k++]) keepch(c);  /** cpy into mline **/ 
L_521:
	LEA  BX, [AutoC473-3+BP]
	PUSH BX
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC473-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_522
	JMP  L_523
L_522:
	LEA  BX, [AutoC473-3+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL keepch
	ADD  SP, +2
	JMP  L_521
L_523:
;			else	{  /** ordinary token is copied without substitution **/ 
	JMP  L_524
L_520:
;				k = 0; 
	LEA  BX, [AutoC473-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;				while	(c = sname[k++]) keepch(c);  /** cpy into mline **/ 
L_525:
	LEA  BX, [AutoC473-3+BP]
	PUSH BX
	LEA  BX, [AutoC473-16+BP]
	PUSH BX
	LEA  BX, [AutoC473-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_526
	JMP  L_527
L_526:
	LEA  BX, [AutoC473-3+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL keepch
	ADD  SP, +2
	JMP  L_525
L_527:
;				} 
L_524:
;			} 
;		else keepch(g_nxtchr());  /** cpy into mline **/ 
	JMP  L_528
L_513:
	CALL g_nxtchr
	PUSH BX
	CALL keepch
	ADD  SP, +2
L_528:
L_511:
L_500:
L_492:
L_484:
;		} 
	JMP  L_476
L_478:
;	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_529
	JMP  L_530
L_529:
	MOV  BX, L_473+33
	PUSH BX
	CALL error
	ADD  SP, +2
;	lptr = mptr = 0; 
L_530:
	MOV  BX, +0
	MOV  Word [mptr], BX
	MOV  Word [lptr], BX
;	while	(line[lptr++] = mline[mptr++]);  /** do the substitution **/ 
L_531:
	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_532
	JMP  L_533
L_532:
	JMP  L_531
L_533:
;	lptr = 0; 
	MOV  BX, +0
	MOV  Word [lptr], BX
;} 
	ADD  SP, AutoC473
	POP  BP
	RET

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

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

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

;{ 
;	char sname[NAMESIZE]; 
;	int k; 
; 
;	if (is_identifier(sname) == 0) 
	LEA  BX, [AutoC534-13+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_535
	JMP  L_536
L_535:
;		{ /** is_identifier() gets & validates identifier **/ 
;		illname(); 
	CALL illname
;		kill(); 
	CALL kill
;		return; 
	ADD  SP, AutoC534
	POP  BP
	RET
;		} 
;	k = 0; 
L_536:
	LEA  BX, [AutoC534-15+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while	(putmac(sname[k++])); 
L_537:
	LEA  BX, [AutoC534-13+BP]
	PUSH BX
	LEA  BX, [AutoC534-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_538
	JMP  L_539
L_538:
	JMP  L_537
L_539:
;	while	(inspect_chr() == ' ' | inspect_chr() == 9) g_nxtchr(); 
L_540:
	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_541
	JMP  L_542
L_541:
	CALL g_nxtchr
	JMP  L_540
L_542:
;	while	(putmac(g_nxtchr())); 
L_543:
	CALL g_nxtchr
	PUSH BX
	CALL putmac
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_544
	JMP  L_545
L_544:
	JMP  L_543
L_545:
;	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_546
	JMP  L_547
L_546:
	MOV  BX, L_534+0
	PUSH BX
	CALL error
	ADD  SP, +2
;	} 
L_547:
	ADD  SP, AutoC534
	POP  BP
	RET

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

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

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

;{ 
;	macq[macptr] = c; 
	MOV  BX, macq
	PUSH BX
	MOV  BX, [Word macptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC548+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_549
	JMP  L_550
L_549:
	MOV  BX, [Word macptr]
	INC  BX
	MOV  Word [macptr], BX
	DEC  BX
;	return c; 
L_550:
	LEA  BX, [AutoC548+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  BP
	RET
;} 

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

;{ 
;	int k; 
; 
;	k = 0; 
	LEA  BX, [AutoC551-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while	(k < macptr) 
L_552:
	LEA  BX, [AutoC551-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word macptr]
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_553
	JMP  L_554
L_553:
;		{ 
;		if(astreq(sname,macq+k,NAMEMAX)) 
	LEA  BX, [AutoC551+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC551-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_555
	JMP  L_556
L_555:
;			{ 
;			while	(macq[k++]); 
L_557:
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC551-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_558
	JMP  L_559
L_558:
	JMP  L_557
L_559:
;			return k; 
	LEA  BX, [AutoC551-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC551
	POP  BP
	RET
;			} 
;		while	(macq[k++]); 
L_556:
L_560:
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC551-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:
;		while	(macq[k++]); 
L_563:
	MOV  BX, macq
	PUSH BX
	LEA  BX, [AutoC551-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:
;		} 
	JMP  L_552
L_554:
;	return 0; 
	MOV  BX, +0
	ADD  SP, AutoC551
	POP  BP
	RET
;} 

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

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

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

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

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

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

AutoC570	EQU 0
;	c	VAR	CHAR	+4

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

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

; { 
;	int k; 
;	k = 0; 
	LEA  BX, [AutoC578-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (outbyte(ptr[k++])); 
L_579:
	LEA  BX, [AutoC578+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC578-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_580
	JMP  L_581
L_580:
	JMP  L_579
L_581:
; } 
	ADD  SP, AutoC578
	POP  BP
	RET

AutoC578	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, AutoC582
	MOV  BP, SP

;{ 
;/**	while(outbyte(toupperi(*ptr++))); **/ 
;	while	(outbyte(*ptr++));  /** don't UC quoted str **/ 
L_583:
	LEA  BX, [AutoC582+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_584
	JMP  L_585
L_584:
	JMP  L_583
L_585:
;}  /* end outasm */ 
	POP  BP
	RET

AutoC582	EQU 0
;	ptr	PTR	CHAR	+4
; 
;nl()	{ outbyte(eol); } 
nl:
	PUSH BP
	SUB  SP, AutoC586
	MOV  BP, SP

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

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

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

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

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

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

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

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

;{ 
;	int k; 
;	char junk[81]; 
; 
;	toconsole(); 
	CALL toconsole
;	bell(); 
	CALL bell
;	outstr("Line "); outdec(lineno); outstr(", "); 
	MOV  BX, L_590+0
	PUSH BX
	CALL outstr
	ADD  SP, +2
	MOV  BX, [Word lineno]
	PUSH BX
	CALL outdec
	ADD  SP, +2
	MOV  BX, L_590+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_591
	JMP  L_592
L_591:
;		outbyte('('); 
	MOV  BX, +40
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;	if (currfn == NULL) 
L_592:
	MOV  BX, [Word currfn]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_593
	JMP  L_594
L_593:
;		outstr("start of file"); 
	MOV  BX, L_590+9
	PUSH BX
	CALL outstr
	ADD  SP, +2
;	else	outstr(currfn + NAME); 
	JMP  L_595
L_594:
	MOV  BX, [Word currfn]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL outstr
	ADD  SP, +2
L_595:
;	if (infunc == 0) 
	MOV  BX, [Word infunc]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_596
	JMP  L_597
L_596:
;		outbyte(')'); 
	MOV  BX, +41
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;	outdec(lineno-fnstart); 
L_597:
	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_590+23
	PUSH BX
	CALL outstr
	ADD  SP, +2
	LEA  BX, [AutoC590+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, [AutoC590-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while	(k < lptr) 
L_598:
	LEA  BX, [AutoC590-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_599
	JMP  L_600
L_599:
;		{ 
;		if (line[k++] == 9) tab(); 
	MOV  BX, line
	PUSH BX
	LEA  BX, [AutoC590-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_601
	JMP  L_602
L_601:
	CALL tab
;		else	outbyte(' '); 
	JMP  L_603
L_602:
	MOV  BX, +32
	PUSH BX
	CALL outbyte
	ADD  SP, +2
L_603:
;		} 
	JMP  L_598
L_600:
;	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_604
	JMP  L_605
L_604:
;		{ 
;		pl("Continue (Y,n,g) ? "); 
	MOV  BX, L_590+26
	PUSH BX
	CALL pl
	ADD  SP, +2
;		gets(junk);		 
	LEA  BX, [AutoC590-83+BP]
	PUSH BX
	CALL gets
	ADD  SP, +2
;		k = junk[0]; 
	LEA  BX, [AutoC590-2+BP]
	PUSH BX
	LEA  BX, [AutoC590-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, [AutoC590-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +78
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC590-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +110
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_606
	JMP  L_607
L_606:
	CALL abort
;		if ((k == 'G') | (k == 'g')) errstop = 0; 
L_607:
	LEA  BX, [AutoC590-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +71
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC590-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +103
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_608
	JMP  L_609
L_608:
	MOV  BX, +0
	MOV  Word [errstop], BX
;		} 
L_609:
;	tofile(); 
L_605:
	CALL tofile
;}	/* end error */ 
	ADD  SP, AutoC590
	POP  BP
	RET

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

	  [SECTION .dseg]
L_590	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, AutoC610
	MOV  BP, SP

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

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

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

AutoC611	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, AutoC612
	MOV  BP, SP

; { 
;	int k; 
; 
;	k = 0; 
	LEA  BX, [AutoC612-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (str2[k]) 
L_613:
	LEA  BX, [AutoC612+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC612-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_614
	JMP  L_615
L_614:
;		{ 
;		if ((str1[k]) != (str2[k])) return 0; 
	LEA  BX, [AutoC612+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC612-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	LEA  BX, [AutoC612+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC612-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_616
	JMP  L_617
L_616:
	MOV  BX, +0
	ADD  SP, AutoC612
	POP  BP
	RET
;		k++; 
L_617:
	LEA  BX, [AutoC612-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		} 
	JMP  L_613
L_615:
;	return k; 
	LEA  BX, [AutoC612-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC612
	POP  BP
	RET
; } 

AutoC612	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, AutoC618
	MOV  BP, SP

; { 
;	int k; 
;	k = 0; 
	LEA  BX, [AutoC618-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (k < len) 
L_619:
	LEA  BX, [AutoC618-2+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC618+4+BP]
	MOV  BX, [BX]
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_620
	JMP  L_621
L_620:
;		{ 
;		if ((str1[k]) != (str2[k])) break; 
	LEA  BX, [AutoC618+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC618-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	LEA  BX, [AutoC618+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC618-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_622
	JMP  L_623
L_622:
	JMP  L_621
;		if (str1[k] == 0) break; 
L_623:
	LEA  BX, [AutoC618+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC618-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_624
	JMP  L_625
L_624:
	JMP  L_621
;		if (str2[k] == 0) break; 
L_625:
	LEA  BX, [AutoC618+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC618-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_626
	JMP  L_627
L_626:
	JMP  L_621
;		k++; 
L_627:
	LEA  BX, [AutoC618-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		} 
	JMP  L_619
L_621:
;	if (an(str1[k])) return 0; /** mismatch before eos **/ 
	LEA  BX, [AutoC618+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC618-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_628
	JMP  L_629
L_628:
	MOV  BX, +0
	ADD  SP, AutoC618
	POP  BP
	RET
;	if (an(str2[k])) return 0; /** mismatch before eos **/ 
L_629:
	LEA  BX, [AutoC618+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC618-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_630
	JMP  L_631
L_630:
	MOV  BX, +0
	ADD  SP, AutoC618
	POP  BP
	RET
;	return k; 
L_631:
	LEA  BX, [AutoC618-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC618
	POP  BP
	RET
; } 

AutoC618	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, AutoC632
	MOV  BP, SP

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

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

; { 
;	int k; 
;	deblank(); 
	CALL deblank
;	if (k = astreq(line + lptr,lit,len)) 
	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+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC635+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL astreq
	ADD  SP, +6
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_636
	JMP  L_637
L_636:
;		{ 
;		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
;		while	(an(inspect_chr())) scan_nxt(); 
L_638:
	CALL inspect_chr
	PUSH BX
	CALL an
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_639
	JMP  L_640
L_639:
	CALL scan_nxt
	JMP  L_638
L_640:
;		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	+6
;	len	VAR	INT	+4
;	k	VAR	INT	-2
; 
;deblank() 
deblank:
	PUSH BP
	SUB  SP, AutoC641
	MOV  BP, SP

;{ 
;	while	(1) 
L_642:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_643
	JMP  L_644
L_643:
;		{ 
;		while	(inspect_chr()==0) 
L_645:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_646
	JMP  L_647
L_646:
;			{ 
;			inline(); 
	CALL inline
;			preprocess(); 
	CALL preprocess
;			if (eof) break; 
	MOV  BX, [Word eof]
	OR   BX, BX
	JNZ  L_648
	JMP  L_649
L_648:
	JMP  L_647
;			} 
L_649:
	JMP  L_645
L_647:
;		if (inspect_chr() == ' ') g_nxtchr(); 
	CALL inspect_chr
	PUSH BX
	MOV  BX, +32
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_650
	JMP  L_651
L_650:
	CALL g_nxtchr
;		else if (inspect_chr() == 9) g_nxtchr(); 
	JMP  L_652
L_651:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +9
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_653
	JMP  L_654
L_653:
	CALL g_nxtchr
;		else return; 
	JMP  L_655
L_654:
	POP  BP
	RET
L_655:
L_652:
;		} 
	JMP  L_642
L_644:
;} 
	POP  BP
	RET

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

; { 
;	int k, zs; 
;	char c; 
; 
;	zs = 0; 
	LEA  BX, [AutoC656-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	k = 10000; 
	LEA  BX, [AutoC656-2+BP]
	PUSH BX
	MOV  BX, +10000
	POP  DI
	MOV  Word [DI], BX
;	if (number<0) 
	LEA  BX, [AutoC656+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_657
	JMP  L_658
L_657:
;		{number=(-number); 
	LEA  BX, [AutoC656+4+BP]
	PUSH BX
	LEA  BX, [AutoC656+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_659
L_658:
;		outbyte('+'); 
	MOV  BX, +43
	PUSH BX
	CALL outbyte
	ADD  SP, +2
L_659:
;	while (k>=1) 
L_660:
	LEA  BX, [AutoC656-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL ccge
	OR   BX, BX
	JNZ  L_661
	JMP  L_662
L_661:
;		{ 
;		c=number/k + '0'; 
	LEA  BX, [AutoC656-5+BP]
	PUSH BX
	LEA  BX, [AutoC656+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC656-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, [AutoC656-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	CALL ccne
	PUSH BX
	LEA  BX, [AutoC656-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	PUSH BX
	LEA  BX, [AutoC656-4+BP]
	MOV  BX, [BX]
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_663
	JMP  L_664
L_663:
;			{zs=1;outbyte(c);} 
	LEA  BX, [AutoC656-4+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
	LEA  BX, [AutoC656-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;		number=number%k; 
L_664:
	LEA  BX, [AutoC656+4+BP]
	PUSH BX
	LEA  BX, [AutoC656+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC656-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, [AutoC656-2+BP]
	PUSH BX
	LEA  BX, [AutoC656-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_660
L_662:
; } 
	ADD  SP, AutoC656
	POP  BP
	RET

AutoC656	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, AutoC665
	MOV  BP, SP

;{ 
;	int k,zs; 
;	char c; 
; 
;	zs = 0; 
	LEA  BX, [AutoC665-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	k = 10000; 
	LEA  BX, [AutoC665-2+BP]
	PUSH BX
	MOV  BX, +10000
	POP  DI
	MOV  Word [DI], BX
;	if (number<0) 
	LEA  BX, [AutoC665+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_666
	JMP  L_667
L_666:
;		number = (-number); 
	LEA  BX, [AutoC665+4+BP]
	PUSH BX
	LEA  BX, [AutoC665+4+BP]
	MOV  BX, [BX]
	NEG  BX
	POP  DI
	MOV  Word [DI], BX
;	while (k >= 1) 
L_667:
L_668:
	LEA  BX, [AutoC665-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL ccge
	OR   BX, BX
	JNZ  L_669
	JMP  L_670
L_669:
;		{ 
;		c = number / k + '0'; 
	LEA  BX, [AutoC665-5+BP]
	PUSH BX
	LEA  BX, [AutoC665+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC665-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, [AutoC665-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +48
	POP  DX
	CALL ccne
	PUSH BX
	LEA  BX, [AutoC665-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	PUSH BX
	LEA  BX, [AutoC665-4+BP]
	MOV  BX, [BX]
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_671
	JMP  L_672
L_671:
;			{ 
;			zs = 1; 
	LEA  BX, [AutoC665-4+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;			outbyte(c); 
	LEA  BX, [AutoC665-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL outbyte
	ADD  SP, +2
;			} 
;		number = number % k; 
L_672:
	LEA  BX, [AutoC665+4+BP]
	PUSH BX
	LEA  BX, [AutoC665+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC665-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, [AutoC665-2+BP]
	PUSH BX
	LEA  BX, [AutoC665-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_668
L_670:
;}		/** eo outudec **/ 
	ADD  SP, AutoC665
	POP  BP
	RET

AutoC665	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, AutoC673
	MOV  BP, SP

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

AutoC673	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, AutoC677
	MOV  BP, SP

;{ 
;	if ((c >= 'a') & (c <= 'z')) 
	LEA  BX, [AutoC677+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +97
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC677+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_678
	JMP  L_679
L_678:
;		c = c - 'a' + 'A'; 
	LEA  BX, [AutoC677+4+BP]
	PUSH BX
	LEA  BX, [AutoC677+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_679:
	LEA  BX, [AutoC677+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  BP
	RET
;}	/* end toupperi */ 

AutoC677	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, AutoC680
	MOV  BP, SP

;{  /** precedence level 15 **/ 
;	int eval[3]; 
; 
;/** was: if (heir1(eval))  rq_val_sa(eval); **/ 
;	do { 
L_681:
;	if (heir1(eval))  rq_val_sa(eval); 
	LEA  BX, [AutoC680-6+BP]
	PUSH BX
	CALL heir1
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_685
	JMP  L_686
L_685:
	LEA  BX, [AutoC680-6+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	if (comma == 0)  return; 
L_686:
	LEA  BX, [AutoC680+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_687
	JMP  L_688
L_687:
	ADD  SP, AutoC680
	POP  BP
	RET
;	} while (match(",")); 
L_688:
L_682:
	MOV  BX, L_680+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_683
	JMP  L_684
L_683:
	JMP  L_681
L_684:
;} 
	ADD  SP, AutoC680
	POP  BP
	RET

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

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

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

;{ 
;	int k, eval2[3]; 
; 
;	k = heir1a(eval); /** link to heir2->heir1a here **/ 
	LEA  BX, [AutoC689-2+BP]
	PUSH BX
	LEA  BX, [AutoC689+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir1a
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
; 
;	if (match("=")) 
	MOV  BX, L_689+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_690
	JMP  L_691
L_690:
;		{ 
;		if (k == 0) 
	LEA  BX, [AutoC689-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_692
	JMP  L_693
L_692:
;			{ 
;			needlval(); 
	CALL needlval
;			return 0; 
	MOV  BX, +0
	ADD  SP, AutoC689
	POP  BP
	RET
;			} 
;		if (eval[1])  sa_push();  /** syntatic action **/ 
L_693:
	LEA  BX, [AutoC689+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_694
	JMP  L_695
L_694:
	CALL sa_push
;		if (heir1(eval2))  rq_val_sa(eval2); 
L_695:
	LEA  BX, [AutoC689-8+BP]
	PUSH BX
	CALL heir1
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_696
	JMP  L_697
L_696:
	LEA  BX, [AutoC689-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;		sa_store(eval); 
L_697:
	LEA  BX, [AutoC689+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_store
	ADD  SP, +2
;		return 0; 
	MOV  BX, +0
	ADD  SP, AutoC689
	POP  BP
	RET
;		} 
;	else return k; 
	JMP  L_698
L_691:
	LEA  BX, [AutoC689-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC689
	POP  BP
	RET
L_698:
;} 
	ADD  SP, AutoC689
	POP  BP
	RET

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

	  [SECTION .dseg]
L_689	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, AutoC699
	MOV  BP, SP

;{ 
;	int	k, eval2[3], T_lbl, F_lbl, X_lbl; 
; 
;	k = heir1b(eval); 
	LEA  BX, [AutoC699-2+BP]
	PUSH BX
	LEA  BX, [AutoC699+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_699+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_700
	JMP  L_701
L_700:
	LEA  BX, [AutoC699-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC699
	POP  BP
	RET
; 
;	if (k) rq_val_sa(eval); 
L_701:
	LEA  BX, [AutoC699-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_702
	JMP  L_703
L_702:
	LEA  BX, [AutoC699+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
; 
;	while (1) 
L_703:
L_704:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_705
	JMP  L_706
L_705:
;		{ 
;		if (match ("?")) 
	MOV  BX, L_699+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_707
	JMP  L_708
L_707:
;			{ 
;			T_lbl = getlabel(); 
	LEA  BX, [AutoC699-10+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;			F_lbl = getlabel(); 
	LEA  BX, [AutoC699-12+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;			X_lbl = getlabel(); 
	LEA  BX, [AutoC699-14+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;			sa_if_tst(T_lbl,F_lbl); 
	LEA  BX, [AutoC699-10+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC699-12+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_if_tst
	ADD  SP, +4
; 
;			sa_mk_lbl(T_lbl); 
	LEA  BX, [AutoC699-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, [AutoC699-8+BP]
	PUSH BX
	CALL heir1b
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_709
	JMP  L_710
L_709:
	LEA  BX, [AutoC699-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
; 
;			sa_jump(X_lbl); 
L_710:
	LEA  BX, [AutoC699-14+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_jump
	ADD  SP, +2
; 
;			deblank(); 
	CALL deblank
; 
;			if (match (":") == 0) 
	MOV  BX, L_699+4
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_711
	JMP  L_712
L_711:
;				{ 
;				error ("missing colon"); 
	MOV  BX, L_699+6
	PUSH BX
	CALL error
	ADD  SP, +2
;				return (0); 
	MOV  BX, +0
	ADD  SP, AutoC699
	POP  BP
	RET
;				} 
;		/** colon matched, do expr3 **/ 
;			sa_mk_lbl(F_lbl); 
L_712:
	LEA  BX, [AutoC699-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, [AutoC699-8+BP]
	PUSH BX
	CALL heir1b
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_713
	JMP  L_714
L_713:
	LEA  BX, [AutoC699-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
; 
; 
;			sa_mk_lbl(X_lbl); 
L_714:
	LEA  BX, [AutoC699-14+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;			} 
;		else	return (0); 
	JMP  L_715
L_708:
	MOV  BX, +0
	ADD  SP, AutoC699
	POP  BP
	RET
L_715:
;		} 
	JMP  L_704
L_706:
;} 
	ADD  SP, AutoC699
	POP  BP
	RET

AutoC699	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_699	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, AutoC716
	MOV  BP, SP

;{ 
;	int k, eval2[3], t_lbl, flab1; 
; 
;	k = heir1c(eval); 
	LEA  BX, [AutoC716-2+BP]
	PUSH BX
	LEA  BX, [AutoC716+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_716+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_717
	JMP  L_718
L_717:
	LEA  BX, [AutoC716-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC716
	POP  BP
	RET
; 
;	if (k) rq_val_sa(eval); 
L_718:
	LEA  BX, [AutoC716-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_719
	JMP  L_720
L_719:
	LEA  BX, [AutoC716+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
; 
;	while (1) 
L_720:
L_721:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_722
	JMP  L_723
L_722:
;		if (match ("||")) 
	MOV  BX, L_716+3
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_724
	JMP  L_725
L_724:
;			{ 
;			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, [AutoC716-8+BP]
	PUSH BX
	CALL heir1c
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_726
	JMP  L_727
L_726:
	LEA  BX, [AutoC716-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
; 
;			sa_mk_bool();	/** prim reg -> bool **/ 
L_727:
	CALL sa_mk_bool
;			sa_pop();  /* Pop into the secondary register */ 
	CALL sa_pop
;			sa_or(); 
	CALL sa_or
;			} 
;		else	return (0); 
	JMP  L_728
L_725:
	MOV  BX, +0
	ADD  SP, AutoC716
	POP  BP
	RET
L_728:
	JMP  L_721
L_723:
;} 
	ADD  SP, AutoC716
	POP  BP
	RET

AutoC716	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_716	DB "||",0
	DB "||",0

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

;{ 
;	int k, eval2[3], t_lbl, flab1; 
; 
;	k = heir2(eval); 
	LEA  BX, [AutoC729-2+BP]
	PUSH BX
	LEA  BX, [AutoC729+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_729+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_730
	JMP  L_731
L_730:
	LEA  BX, [AutoC729-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC729
	POP  BP
	RET
; 
;	if (k) rq_val_sa(eval); 
L_731:
	LEA  BX, [AutoC729-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_732
	JMP  L_733
L_732:
	LEA  BX, [AutoC729+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
; 
;	while (1) 
L_733:
L_734:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_735
	JMP  L_736
L_735:
;		if (match ("&&")) 
	MOV  BX, L_729+3
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_737
	JMP  L_738
L_737:
;			{ 
;			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, [AutoC729-8+BP]
	PUSH BX
	CALL heir2
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_739
	JMP  L_740
L_739:
	LEA  BX, [AutoC729-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
; 
;			sa_mk_bool();	/** prim reg -> bool **/ 
L_740:
	CALL sa_mk_bool
;			sa_pop();  /* Pop into the secondary register */ 
	CALL sa_pop
;			sa_and(); 
	CALL sa_and
;			} 
;		else	return (0); 
	JMP  L_741
L_738:
	MOV  BX, +0
	ADD  SP, AutoC729
	POP  BP
	RET
L_741:
	JMP  L_734
L_736:
;} 
	ADD  SP, AutoC729
	POP  BP
	RET

AutoC729	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_729	DB "&&",0
	DB "&&",0

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

;{ 
;	int k, eval2[3]; 
; 
;	k = heir3(eval); 
	LEA  BX, [AutoC742-2+BP]
	PUSH BX
	LEA  BX, [AutoC742+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_743
	JMP  L_744
L_743:
	LEA  BX, [AutoC742-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC742
	POP  BP
	RET
; 
;	/** added '||' ck for heir1b **/ 
;	if (streq(line+lptr,"||") != 0) return(k); 
L_744:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_742+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_745
	JMP  L_746
L_745:
	LEA  BX, [AutoC742-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC742
	POP  BP
	RET
; 
;	if (k)  rq_val_sa(eval); 
L_746:
	LEA  BX, [AutoC742-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_747
	JMP  L_748
L_747:
	LEA  BX, [AutoC742+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while	(1) 
L_748:
L_749:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_750
	JMP  L_751
L_750:
;		{ 
;		if (match("|")) 
	MOV  BX, L_742+3
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_752
	JMP  L_753
L_752:
;			{ 
;			sa_push();  /** syntatic action **/ 
	CALL sa_push
;			if (heir3(eval2)) rq_val_sa(eval2); 
	LEA  BX, [AutoC742-8+BP]
	PUSH BX
	CALL heir3
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_754
	JMP  L_755
L_754:
	LEA  BX, [AutoC742-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();   /** syntatic action **/ 
L_755:
	CALL sa_pop
;			sa_or();    /** syntatic action **/ 
	CALL sa_or
;			} 
;		else return 0; 
	JMP  L_756
L_753:
	MOV  BX, +0
	ADD  SP, AutoC742
	POP  BP
	RET
L_756:
;		} 
	JMP  L_749
L_751:
;} 
	ADD  SP, AutoC742
	POP  BP
	RET

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

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

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

;{ 
;	int k, eval2[3]; 
; 
;	k = heir4(eval); 
	LEA  BX, [AutoC757-2+BP]
	PUSH BX
	LEA  BX, [AutoC757+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_758
	JMP  L_759
L_758:
	LEA  BX, [AutoC757-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC757
	POP  BP
	RET
; 
;	if (k)  rq_val_sa(eval); 
L_759:
	LEA  BX, [AutoC757-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_760
	JMP  L_761
L_760:
	LEA  BX, [AutoC757+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while	(1) 
L_761:
L_762:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_763
	JMP  L_764
L_763:
;		{ 
;		if (match("^")) 
	MOV  BX, L_757+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_765
	JMP  L_766
L_765:
;			{ 
;			sa_push();  /** syntatic action **/ 
	CALL sa_push
;			if (heir4(eval2)) rq_val_sa(eval2); 
	LEA  BX, [AutoC757-8+BP]
	PUSH BX
	CALL heir4
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_767
	JMP  L_768
L_767:
	LEA  BX, [AutoC757-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop();   /** syntatic action **/ 
L_768:
	CALL sa_pop
;			sa_xor();   /** syntatic action **/ 
	CALL sa_xor
;			} 
;		else return 0; 
	JMP  L_769
L_766:
	MOV  BX, +0
	ADD  SP, AutoC757
	POP  BP
	RET
L_769:
;		} 
	JMP  L_762
L_764:
;} 
	ADD  SP, AutoC757
	POP  BP
	RET

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

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

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

;{ 
;	int k, eval2[3]; 
; 
;	k = heir5(eval); 
	LEA  BX, [AutoC770-2+BP]
	PUSH BX
	LEA  BX, [AutoC770+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_771
	JMP  L_772
L_771:
	LEA  BX, [AutoC770-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC770
	POP  BP
	RET
; 
;	/** added '&&' ck for heir1c **/ 
;	if (streq(line+lptr,"&&") != 0) return(k); 
L_772:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_770+0
	PUSH BX
	CALL streq
	ADD  SP, +4
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_773
	JMP  L_774
L_773:
	LEA  BX, [AutoC770-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC770
	POP  BP
	RET
; 
;	if (k) rq_val_sa(eval); 
L_774:
	LEA  BX, [AutoC770-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_775
	JMP  L_776
L_775:
	LEA  BX, [AutoC770+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1) 
L_776:
L_777:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_778
	JMP  L_779
L_778:
;		{ 
;		if (match("&")) 
	MOV  BX, L_770+3
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_780
	JMP  L_781
L_780:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir5(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC770-8+BP]
	PUSH BX
	CALL heir5
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_782
	JMP  L_783
L_782:
	LEA  BX, [AutoC770-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_783:
	CALL sa_pop
;			sa_and(); 
	CALL sa_and
;			} 
;		else return 0; 
	JMP  L_784
L_781:
	MOV  BX, +0
	ADD  SP, AutoC770
	POP  BP
	RET
L_784:
;		} 
	JMP  L_777
L_779:
;} 
	ADD  SP, AutoC770
	POP  BP
	RET

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

	  [SECTION .dseg]
L_770	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, AutoC785
	MOV  BP, SP

;{ 
;	int k, eval2[3]; 
; 
;	k = heir6(eval); 
	LEA  BX, [AutoC785-2+BP]
	PUSH BX
	LEA  BX, [AutoC785+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_785+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_785+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_786
	JMP  L_787
L_786:
	LEA  BX, [AutoC785-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC785
	POP  BP
	RET
; 
;	if (k)  rq_val_sa(eval); 
L_787:
	LEA  BX, [AutoC785-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_788
	JMP  L_789
L_788:
	LEA  BX, [AutoC785+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1) 
L_789:
L_790:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_791
	JMP  L_792
L_791:
;		{ 
;		if (match("==")) 
	MOV  BX, L_785+6
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_793
	JMP  L_794
L_793:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir6(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC785-8+BP]
	PUSH BX
	CALL heir6
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_795
	JMP  L_796
L_795:
	LEA  BX, [AutoC785-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_796:
	CALL sa_pop
;			sa_eq(); 
	CALL sa_eq
;			} 
;		else if (match("!=")) 
	JMP  L_797
L_794:
	MOV  BX, L_785+9
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_798
	JMP  L_799
L_798:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir6(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC785-8+BP]
	PUSH BX
	CALL heir6
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_800
	JMP  L_801
L_800:
	LEA  BX, [AutoC785-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_801:
	CALL sa_pop
;			sa_not_equal(); 
	CALL sa_not_equal
;			} 
;		else return 0; 
	JMP  L_802
L_799:
	MOV  BX, +0
	ADD  SP, AutoC785
	POP  BP
	RET
L_802:
L_797:
;		} 
	JMP  L_790
L_792:
;} 
	ADD  SP, AutoC785
	POP  BP
	RET

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

	  [SECTION .dseg]
L_785	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, AutoC803
	MOV  BP, SP

;{ 
;	int k, eval2[3]; 
; 
;	k = heir7(eval); 
	LEA  BX, [AutoC803-2+BP]
	PUSH BX
	LEA  BX, [AutoC803+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_803+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_803+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_803+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_803+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_804
	JMP  L_805
L_804:
	LEA  BX, [AutoC803-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC803
	POP  BP
	RET
; 
;	if (streq(line+lptr,">>"))  return k; 
L_805:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_803+10
	PUSH BX
	CALL streq
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_806
	JMP  L_807
L_806:
	LEA  BX, [AutoC803-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC803
	POP  BP
	RET
;	if (streq(line+lptr,"<<"))  return k; 
L_807:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_803+13
	PUSH BX
	CALL streq
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_808
	JMP  L_809
L_808:
	LEA  BX, [AutoC803-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC803
	POP  BP
	RET
; 
;	if (k) rq_val_sa(eval); 
L_809:
	LEA  BX, [AutoC803-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_810
	JMP  L_811
L_810:
	LEA  BX, [AutoC803+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
; 
;	while (1) 
L_811:
L_812:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_813
	JMP  L_814
L_813:
;		{ 
;		if (match("<=")) 
	MOV  BX, L_803+16
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_815
	JMP  L_816
L_815:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir7(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC803-8+BP]
	PUSH BX
	CALL heir7
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_817
	JMP  L_818
L_817:
	LEA  BX, [AutoC803-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_818:
	CALL sa_pop
;			if (eval[2] | eval2[2]) 
	LEA  BX, [AutoC803+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, [AutoC803-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_819
	JMP  L_820
L_819:
;				{ 
;				sa_uless_oreq(); 
	CALL sa_uless_ore
;				continue; 
	JMP  L_812
;				} 
;			sa_sless_or_eq(); 
L_820:
	CALL sa_sless_or_
;			} 
;		else if (match(">=")) 
	JMP  L_821
L_816:
	MOV  BX, L_803+19
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_822
	JMP  L_823
L_822:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir7(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC803-8+BP]
	PUSH BX
	CALL heir7
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_824
	JMP  L_825
L_824:
	LEA  BX, [AutoC803-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_825:
	CALL sa_pop
;			if (eval[2] | eval2[2]) 
	LEA  BX, [AutoC803+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, [AutoC803-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_826
	JMP  L_827
L_826:
;				{ 
;				sa_uge(); 
	CALL sa_uge
;				continue; 
	JMP  L_812
;				} 
;			sa_sge(); 
L_827:
	CALL sa_sge
;			} 
;		else if ((streq(line+lptr,"<")) & 
	JMP  L_828
L_823:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_803+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_803+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_829
	JMP  L_830
L_829:
;			{ 
;			scan_nxt(); 
	CALL scan_nxt
;			sa_push(); 
	CALL sa_push
;			if (heir7(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC803-8+BP]
	PUSH BX
	CALL heir7
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_831
	JMP  L_832
L_831:
	LEA  BX, [AutoC803-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_832:
	CALL sa_pop
;			if (eval[2] | eval2[2]) 
	LEA  BX, [AutoC803+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, [AutoC803-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_833
	JMP  L_834
L_833:
;				{ 
;				sa_uless_than(); 
	CALL sa_uless_tha
;				continue; 
	JMP  L_812
;				} 
;			sa_sless_than(); 
L_834:
	CALL sa_sless_tha
;			} 
;		else if ((streq(line+lptr,">")) & 
	JMP  L_835
L_830:
	MOV  BX, line
	PUSH BX
	MOV  BX, [Word lptr]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, L_803+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_803+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_836
	JMP  L_837
L_836:
;			{ 
;			scan_nxt(); 
	CALL scan_nxt
;			sa_push(); 
	CALL sa_push
;			if (heir7(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC803-8+BP]
	PUSH BX
	CALL heir7
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_838
	JMP  L_839
L_838:
	LEA  BX, [AutoC803-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_839:
	CALL sa_pop
;			if (eval[2] | eval2[2]) 
	LEA  BX, [AutoC803+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, [AutoC803-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_840
	JMP  L_841
L_840:
;				{ 
;				sa_ugt(); 
	CALL sa_ugt
;				continue; 
	JMP  L_812
;				} 
;			sa_sgreater_than(); 
L_841:
	CALL sa_sgreater_
;			} 
;		else return 0; 
	JMP  L_842
L_837:
	MOV  BX, +0
	ADD  SP, AutoC803
	POP  BP
	RET
L_842:
L_835:
L_828:
L_821:
;		} 
	JMP  L_812
L_814:
;} 
	ADD  SP, AutoC803
	POP  BP
	RET

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

	  [SECTION .dseg]
L_803	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, AutoC843
	MOV  BP, SP

;{ 
;	int k, eval2[3]; 
; 
;	k = heir8(eval); 
	LEA  BX, [AutoC843-2+BP]
	PUSH BX
	LEA  BX, [AutoC843+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_843+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_843+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_844
	JMP  L_845
L_844:
	LEA  BX, [AutoC843-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC843
	POP  BP
	RET
; 
;	if (k)  rq_val_sa(eval); 
L_845:
	LEA  BX, [AutoC843-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_846
	JMP  L_847
L_846:
	LEA  BX, [AutoC843+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1) 
L_847:
L_848:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_849
	JMP  L_850
L_849:
;		{ 
;		if (match(">>")) 
	MOV  BX, L_843+6
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_851
	JMP  L_852
L_851:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir8(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC843-8+BP]
	PUSH BX
	CALL heir8
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_853
	JMP  L_854
L_853:
	LEA  BX, [AutoC843-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_854:
	CALL sa_pop
;			sa_asr(); 
	CALL sa_asr
;			} 
;		else if (match("<<")) 
	JMP  L_855
L_852:
	MOV  BX, L_843+9
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_856
	JMP  L_857
L_856:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir8(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC843-8+BP]
	PUSH BX
	CALL heir8
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_858
	JMP  L_859
L_858:
	LEA  BX, [AutoC843-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_859:
	CALL sa_pop
;			sa_asl(); 
	CALL sa_asl
;			} 
;		else return 0; 
	JMP  L_860
L_857:
	MOV  BX, +0
	ADD  SP, AutoC843
	POP  BP
	RET
L_860:
L_855:
;		} 
	JMP  L_848
L_850:
;} 
	ADD  SP, AutoC843
	POP  BP
	RET

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

	  [SECTION .dseg]
L_843	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, AutoC861
	MOV  BP, SP

;{ 
;	int k, eval2[3]; 
; 
;	k = heir9(eval); 
	LEA  BX, [AutoC861-2+BP]
	PUSH BX
	LEA  BX, [AutoC861+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_862
	JMP  L_863
L_862:
	LEA  BX, [AutoC861-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC861
	POP  BP
	RET
; 
;	if (k)  rq_val_sa(eval); 
L_863:
	LEA  BX, [AutoC861-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_864
	JMP  L_865
L_864:
	LEA  BX, [AutoC861+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1) 
L_865:
L_866:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_867
	JMP  L_868
L_867:
;		{ 
;		if (match("+")) 
	MOV  BX, L_861+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_869
	JMP  L_870
L_869:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir9(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	CALL heir9
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_871
	JMP  L_872
L_871:
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			if (dbltest(eval,eval2)) 
L_872:
	LEA  BX, [AutoC861+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	CALL dbltest
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_873
	JMP  L_874
L_873:
;				sa_doublereg(); 
	CALL sa_doublereg
;			sa_pop(); 
L_874:
	CALL sa_pop
;			if (dbltest(eval2,eval)) 
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	LEA  BX, [AutoC861+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL dbltest
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_875
	JMP  L_876
L_875:
;				{ 
;				sa_swap(); 
	CALL sa_swap
;				sa_doublereg(); 
	CALL sa_doublereg
;				sa_swap(); 
	CALL sa_swap
;				} 
;			sa_add(); 
L_876:
	CALL sa_add
;			result(eval,eval2); 
	LEA  BX, [AutoC861+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	CALL result
	ADD  SP, +4
;			} 
;		else if (match("-")) 
	JMP  L_877
L_870:
	MOV  BX, L_861+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_878
	JMP  L_879
L_878:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir9(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	CALL heir9
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_880
	JMP  L_881
L_880:
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			if (dbltest(eval,eval2)) sa_doublereg(); 
L_881:
	LEA  BX, [AutoC861+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	CALL dbltest
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_882
	JMP  L_883
L_882:
	CALL sa_doublereg
;			sa_pop(); 
L_883:
	CALL sa_pop
; 
;			if (dbltest(eval2,eval)) 
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	LEA  BX, [AutoC861+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL dbltest
	ADD  SP, +4
	OR   BX, BX
	JNZ  L_884
	JMP  L_885
L_884:
;				{ 
;				sa_swap(); 
	CALL sa_swap
;				sa_doublereg(); 
	CALL sa_doublereg
;				sa_swap(); 
	CALL sa_swap
;				} 
;			sa_sub(); 
L_885:
	CALL sa_sub
;			if ((eval[2] == CINT) & (eval2[2] == CINT)) 
	LEA  BX, [AutoC861+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, [AutoC861-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_886
	JMP  L_887
L_886:
;				{ 
;				sa_swap(); 
	CALL sa_swap
;				sa_immed(); 
	CALL sa_immed
;				ol("1"); 
	MOV  BX, L_861+4
	PUSH BX
	CALL ol
	ADD  SP, +2
;				sa_asr();  /** div by 2 **/ 
	CALL sa_asr
;				} 
;			result(eval,eval2); 
L_887:
	LEA  BX, [AutoC861+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC861-8+BP]
	PUSH BX
	CALL result
	ADD  SP, +4
;			} 
;		else return 0; 
	JMP  L_888
L_879:
	MOV  BX, +0
	ADD  SP, AutoC861
	POP  BP
	RET
L_888:
L_877:
;		} 
	JMP  L_866
L_868:
;} 
	ADD  SP, AutoC861
	POP  BP
	RET

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

	  [SECTION .dseg]
L_861	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, AutoC889
	MOV  BP, SP

;{ 
;	int k, eval2[3]; 
; 
;	k = heir10(eval); 
	LEA  BX, [AutoC889-2+BP]
	PUSH BX
	LEA  BX, [AutoC889+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_890
	JMP  L_891
L_890:
	LEA  BX, [AutoC889-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC889
	POP  BP
	RET
; 
;	if (k)  rq_val_sa(eval); 
L_891:
	LEA  BX, [AutoC889-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_892
	JMP  L_893
L_892:
	LEA  BX, [AutoC889+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;	while (1) 
L_893:
L_894:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_895
	JMP  L_896
L_895:
;		{ 
;		if (match("*")) 
	MOV  BX, L_889+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_897
	JMP  L_898
L_897:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir9(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC889-8+BP]
	PUSH BX
	CALL heir9
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_899
	JMP  L_900
L_899:
	LEA  BX, [AutoC889-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_900:
	CALL sa_pop
;			sa_mult(); 
	CALL sa_mult
;			} 
;		else if (match("/")) 
	JMP  L_901
L_898:
	MOV  BX, L_889+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_902
	JMP  L_903
L_902:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir10(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC889-8+BP]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_904
	JMP  L_905
L_904:
	LEA  BX, [AutoC889-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_905:
	CALL sa_pop
;			sa_div(); 
	CALL sa_div
;			} 
;		else if (match("%")) 
	JMP  L_906
L_903:
	MOV  BX, L_889+4
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_907
	JMP  L_908
L_907:
;			{ 
;			sa_push(); 
	CALL sa_push
;			if (heir10(eval2))  rq_val_sa(eval2); 
	LEA  BX, [AutoC889-8+BP]
	PUSH BX
	CALL heir10
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_909
	JMP  L_910
L_909:
	LEA  BX, [AutoC889-8+BP]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			sa_pop(); 
L_910:
	CALL sa_pop
;			sa_modulo(); 
	CALL sa_modulo
;			} 
;		else return 0; 
	JMP  L_911
L_908:
	MOV  BX, +0
	ADD  SP, AutoC889
	POP  BP
	RET
L_911:
L_906:
L_901:
;		} 
	JMP  L_894
L_896:
;} 
	ADD  SP, AutoC889
	POP  BP
	RET

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

	  [SECTION .dseg]
L_889	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, AutoC912
	MOV  BP, SP

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

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

	  [SECTION .dseg]
L_912	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 brackets, [], 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, AutoC983
	MOV  BP, SP

;{ 
;	int k; char *ptr; 
; 
;	k = primary(eval); 
	LEA  BX, [AutoC983-2+BP]
	PUSH BX
	LEA  BX, [AutoC983+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, [AutoC983-4+BP]
	PUSH BX
	LEA  BX, [AutoC983+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_984
	JMP  L_985
L_984:
;	while (1) 
L_986:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_987
	JMP  L_988
L_987:
;		{ 
;		if (match("[")) 
	MOV  BX, L_983+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_989
	JMP  L_990
L_989:
;			{ 
;			if (ptr == 0) 
	LEA  BX, [AutoC983-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_991
	JMP  L_992
L_991:
;				{ 
;				error("can't subscript"); 
	MOV  BX, L_983+2
	PUSH BX
	CALL error
	ADD  SP, +2
;				junk(); 
	CALL junk
;				needbrack("]"); 
	MOV  BX, L_983+18
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;				return 0; 
	MOV  BX, +0
	ADD  SP, AutoC983
	POP  BP
	RET
;				} 
;			else if (ptr[IDENT] == POINTER)  rq_val_sa(eval); 
	JMP  L_993
L_992:
	LEA  BX, [AutoC983-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_994
	JMP  L_995
L_994:
	LEA  BX, [AutoC983+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rq_val_sa
	ADD  SP, +2
;			else if (ptr[IDENT] != ARRAY) 
	JMP  L_996
L_995:
	LEA  BX, [AutoC983-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_997
	JMP  L_998
L_997:
;				{ 
;				error("can't subscript"); 
	MOV  BX, L_983+20
	PUSH BX
	CALL error
	ADD  SP, +2
;				k = 0; 
	LEA  BX, [AutoC983-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;				} 
;			sa_push(); 
L_998:
L_996:
L_993:
	CALL sa_push
;			expression(YES); 
	MOV  BX, +1
	PUSH BX
	CALL expression
	ADD  SP, +2
;			needbrack("]"); 
	MOV  BX, L_983+36
	PUSH BX
	CALL needbrack
	ADD  SP, +2
; 
;			if (ptr[TYPE] == CINT)  sa_doublereg(); 
	LEA  BX, [AutoC983-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_999
	JMP  L_1000
L_999:
	CALL sa_doublereg
;			sa_pop(); 
L_1000:
	CALL sa_pop
;			sa_add(); 
	CALL sa_add
;			eval[0] = eval[2] = 0; 
	LEA  BX, [AutoC983+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC983+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, [AutoC983+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC983-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, [AutoC983-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;			} 
;		else if (match("(")) 
	JMP  L_1001
L_990:
	MOV  BX, L_983+38
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1002
	JMP  L_1003
L_1002:
;			{ 
;			if (ptr == 0) 
	LEA  BX, [AutoC983-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1004
	JMP  L_1005
L_1004:
;				{ 
;				callfunction(0); 
	MOV  BX, +0
	PUSH BX
	CALL callfunction
	ADD  SP, +2
;				} 
;			else if (ptr[IDENT] != FUNCTION) 
	JMP  L_1006
L_1005:
	LEA  BX, [AutoC983-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_1007
	JMP  L_1008
L_1007:
;				{ 
;				rq_val_sa(eval); 
	LEA  BX, [AutoC983+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_1009
L_1008:
	LEA  BX, [AutoC983-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL callfunction
	ADD  SP, +2
L_1009:
L_1006:
;			k = eval[0] = 0; 
	LEA  BX, [AutoC983-2+BP]
	PUSH BX
	LEA  BX, [AutoC983+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_1010
L_1003:
	LEA  BX, [AutoC983-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC983
	POP  BP
	RET
L_1010:
L_1001:
;		} 
	JMP  L_986
L_988:
;	if (ptr == 0)  return k; 
L_985:
	LEA  BX, [AutoC983-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1011
	JMP  L_1012
L_1011:
	LEA  BX, [AutoC983-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC983
	POP  BP
	RET
;	if (ptr[IDENT] == FUNCTION) 
L_1012:
	LEA  BX, [AutoC983-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_1013
	JMP  L_1014
L_1013:
;		{ 
;		sa_immedo();  /* global & non-array & function */ 
	CALL sa_immedo
;		asm_symb(ptr); 
	LEA  BX, [AutoC983-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
;		nl(); 
	CALL nl
;		return 0; 
	MOV  BX, +0
	ADD  SP, AutoC983
	POP  BP
	RET
;		} 
;	return k; 
L_1014:
	LEA  BX, [AutoC983-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC983
	POP  BP
	RET
;} 

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

	  [SECTION .dseg]
L_983	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, AutoC1015
	MOV  BP, SP

;{ 
;	char *ptr, sname[NAMESIZE]; /** auto symb array **/ 
;	int num[1], k; 
; 
;	eval[2] = 0;	/* Clear ptr/array type. */ 
	LEA  BX, [AutoC1015+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_1015+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1016
	JMP  L_1017
L_1016:
;		{ 
;		k = heir1(eval); /** recursive call to ck for rvalue **/ 
	LEA  BX, [AutoC1015-19+BP]
	PUSH BX
	LEA  BX, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL heir1
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;		needbrack(")"); 
	MOV  BX, L_1015+2
	PUSH BX
	CALL needbrack
	ADD  SP, +2
;		return k; 
	LEA  BX, [AutoC1015-19+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1015
	POP  BP
	RET
;		} 
; 
;		/** is_identifier() gets & validates identifier **/ 
;	if (is_identifier(sname)) 
L_1017:
	LEA  BX, [AutoC1015-15+BP]
	PUSH BX
	CALL is_identifie
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1018
	JMP  L_1019
L_1018:
;		{ 
;		if (ptr = findauto(sname))  /** srch auto tbl 1st **/ 
	LEA  BX, [AutoC1015-2+BP]
	PUSH BX
	LEA  BX, [AutoC1015-15+BP]
	PUSH BX
	CALL findauto
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_1020
	JMP  L_1021
L_1020:
;			{ 
;			sa_deref(ptr);  /** code gen fn, syntatic action **/ 
	LEA  BX, [AutoC1015-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, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;			eval[1] = ptr[TYPE]; 
	LEA  BX, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015-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, [AutoC1015-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_1022
	JMP  L_1023
L_1022:
;				{ 
;				eval[1] = CINT; 
	LEA  BX, [AutoC1015+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, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015-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_1023:
	LEA  BX, [AutoC1015-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_1024
	JMP  L_1025
L_1024:
;				{ 
;				eval[2] = ptr[TYPE]; 
	LEA  BX, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015-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, AutoC1015
	POP  BP
	RET
;				} 
;			else return 1; /** auto VARIABLE, or auto POINTER **/ 
	JMP  L_1026
L_1025:
	MOV  BX, +1
	ADD  SP, AutoC1015
	POP  BP
	RET
L_1026:
;			 /** ! 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_1021:
	LEA  BX, [AutoC1015-2+BP]
	PUSH BX
	LEA  BX, [AutoC1015-15+BP]
	PUSH BX
	CALL findstatic
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
	OR   BX, BX
	JNZ  L_1027
	JMP  L_1028
L_1027:
;			if (ptr[IDENT] != FUNCTION) 
	LEA  BX, [AutoC1015-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_1029
	JMP  L_1030
L_1029:
;				{ /** set eval[] according to static identifier **/ 
;				eval[0] = ptr;  /** ptr to symb in tbl **/ 
	LEA  BX, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;				eval[1] = 0; 
	LEA  BX, [AutoC1015+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, [AutoC1015-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_1031
	JMP  L_1032
L_1031:
;					{ 
;					if (ptr[IDENT] == POINTER) 
	LEA  BX, [AutoC1015-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_1033
	JMP  L_1034
L_1033:
;						eval[2] = ptr[TYPE]; 
	LEA  BX, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015-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_1034:
	MOV  BX, +1
	ADD  SP, AutoC1015
	POP  BP
	RET
;					} 
;				 /** .else. array & !function */ 
;				sa_immedo(); 
L_1032:
	CALL sa_immedo
;				asm_symb(ptr); nl(); 
	LEA  BX, [AutoC1015-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL asm_symb
	ADD  SP, +2
	CALL nl
;				eval[1] = eval[2] = ptr[TYPE]; 
	LEA  BX, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015-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, AutoC1015
	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_1030:
L_1028:
	LEA  BX, [AutoC1015-2+BP]
	PUSH BX
	LEA  BX, [AutoC1015-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, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		eval[1] = 0;    /** functions are static objects **/ 
	LEA  BX, [AutoC1015+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, AutoC1015
	POP  BP
	RET
;		}	/** eo if (is_identifier(sname)) **/ 
; 
;	if (kind_const(num))  return (eval[0] = eval[1] = 0); 
L_1019:
	LEA  BX, [AutoC1015-17+BP]
	PUSH BX
	CALL kind_const
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1035
	JMP  L_1036
L_1035:
	LEA  BX, [AutoC1015+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1015+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, AutoC1015
	POP  BP
	RET
; 
;	else	{ 
	JMP  L_1037
L_1036:
;		error("invalid expression"); 
	MOV  BX, L_1015+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, AutoC1015
	POP  BP
	RET
;		} 
L_1037:
;} /** eo primary **/ 
	ADD  SP, AutoC1015
	POP  BP
	RET

AutoC1015	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_1015	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, AutoC1038
	MOV  BP, SP

;{ 
;	if (eval[1] == 0) sa_putmem(eval[0]); /** is const **/ 
	LEA  BX, [AutoC1038+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_1039
	JMP  L_1040
L_1039:
	LEA  BX, [AutoC1038+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_1041
L_1040:
	LEA  BX, [AutoC1038+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_1041:
;} 
	POP  BP
	RET

AutoC1038	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, AutoC1042
	MOV  BP, SP

;{	/** not a const & indirect obj **/ 
;	if ((eval[0] != 0) & (eval[1] == 0)) 
	LEA  BX, [AutoC1042+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, [AutoC1042+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_1043
	JMP  L_1044
L_1043:
;		sa_getmem(eval[0]); /** gen syntactic action **/ 
	LEA  BX, [AutoC1042+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_1045
L_1044:
;		sa_indirect(eval[1]); /** gen syntactic action **/ 
	LEA  BX, [AutoC1042+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_1045:
;} 
	POP  BP
	RET

AutoC1042	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, AutoC1046
	MOV  BP, SP

;{ 
;	if (val1[2] != CINT) return 0; 
	LEA  BX, [AutoC1046+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_1047
	JMP  L_1048
L_1047:
	MOV  BX, +0
	POP  BP
	RET
;	if (val2[2]) return 0; 
L_1048:
	LEA  BX, [AutoC1046+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_1049
	JMP  L_1050
L_1049:
	MOV  BX, +0
	POP  BP
	RET
;	return 1; 
L_1050:
	MOV  BX, +1
	POP  BP
	RET
;} 

AutoC1046	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, AutoC1051
	MOV  BP, SP

;{ 
;	if (eval[2] & eval2[2])	/*both are type ptr or array.*/ 
	LEA  BX, [AutoC1051+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, [AutoC1051+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_1052
	JMP  L_1053
L_1052:
;		{ 
;		eval[2] = 0; 
	LEA  BX, [AutoC1051+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_1054
L_1053:
	LEA  BX, [AutoC1051+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:
;		{ 
;		eval[0] = eval2[0]; 
	LEA  BX, [AutoC1051+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1051+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, [AutoC1051+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1051+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, [AutoC1051+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1051+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_1056:
L_1054:
	POP  BP
	RET

AutoC1051	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, AutoC1057
	MOV  BP, SP

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

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

	  [SECTION .dseg]
L_1057	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, AutoC1058
	MOV  BP, SP

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

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

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

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

;{ 
;	if (number(val))  sa_immed(); 
	LEA  BX, [AutoC1059+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL number
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1060
	JMP  L_1061
L_1060:
	CALL sa_immed
;	else if (chr_const(val))  sa_immed(); 
	JMP  L_1062
L_1061:
	LEA  BX, [AutoC1059+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL chr_const
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1063
	JMP  L_1064
L_1063:
	CALL sa_immed
;	else if (str_const(val)) 
	JMP  L_1065
L_1064:
	LEA  BX, [AutoC1059+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL str_const
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1066
	JMP  L_1067
L_1066:
;		{ 
;		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_1068
L_1067:
	MOV  BX, +0
	POP  BP
	RET
L_1068:
L_1065:
L_1062:
;	outdec(val[0]); 
	LEA  BX, [AutoC1059+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
;} 

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

;{ 
;	int k, minus; char c; 
; 
;	k = minus = 1; 
	LEA  BX, [AutoC1069-2+BP]
	PUSH BX
	LEA  BX, [AutoC1069-4+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
	POP  DI
	MOV  Word [DI], BX
;	while (k) 
L_1070:
	LEA  BX, [AutoC1069-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1071
	JMP  L_1072
L_1071:
;		{ 
;		k = 0; 
	LEA  BX, [AutoC1069-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;		if (match("+")) k=1; 
	MOV  BX, L_1069+0
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1073
	JMP  L_1074
L_1073:
	LEA  BX, [AutoC1069-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;		if (match("-")) 
L_1074:
	MOV  BX, L_1069+2
	PUSH BX
	CALL match
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1075
	JMP  L_1076
L_1075:
;			{ 
;			minus = (-minus); 
	LEA  BX, [AutoC1069-4+BP]
	PUSH BX
	LEA  BX, [AutoC1069-4+BP]
	MOV  BX, [BX]
	NEG  BX
	POP  DI
	MOV  Word [DI], BX
;			k = 1; 
	LEA  BX, [AutoC1069-2+BP]
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Word [DI], BX
;			} 
;		} 
L_1076:
	JMP  L_1070
L_1072:
; 
;	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_1077
	JMP  L_1078
L_1077:
	MOV  BX, +0
	ADD  SP, AutoC1069
	POP  BP
	RET
;	while (numeric(inspect_chr())) 
L_1078:
L_1079:
	CALL inspect_chr
	PUSH BX
	CALL numeric
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1080
	JMP  L_1081
L_1080:
;		{ 
;		c = scan_nxt(); 
	LEA  BX, [AutoC1069-5+BP]
	PUSH BX
	CALL scan_nxt
	POP  DI
	MOV  Byte [DI], BL
;		k = k * 10 + (c - '0'); 
	LEA  BX, [AutoC1069-2+BP]
	PUSH BX
	LEA  BX, [AutoC1069-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, [AutoC1069-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_1079
L_1081:
;	if (minus < 0)  k =(-k); 
	LEA  BX, [AutoC1069-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cclt
	OR   BX, BX
	JNZ  L_1082
	JMP  L_1083
L_1082:
	LEA  BX, [AutoC1069-2+BP]
	PUSH BX
	LEA  BX, [AutoC1069-2+BP]
	MOV  BX, [BX]
	NEG  BX
	POP  DI
	MOV  Word [DI], BX
;	val[0] = k; 
L_1083:
	LEA  BX, [AutoC1069+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1069-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	return 1; 
	MOV  BX, +1
	ADD  SP, AutoC1069
	POP  BP
	RET
;} 

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

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

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

;{ 
;	int k; char c; 
; 
;	k = 0; 
	LEA  BX, [AutoC1084-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	if (match("'") == 0) return 0; 
	MOV  BX, L_1084+0
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1085
	JMP  L_1086
L_1085:
	MOV  BX, +0
	ADD  SP, AutoC1084
	POP  BP
	RET
;	while ((c = g_nxtchr()) != 39)  /** 39 is single quote **/ 
L_1086:
L_1087:
	LEA  BX, [AutoC1084-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_1088
	JMP  L_1089
L_1088:
;		k = (k & 255) * 256 + (c & 127); 
	LEA  BX, [AutoC1084-2+BP]
	PUSH BX
	LEA  BX, [AutoC1084-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, [AutoC1084-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_1087
L_1089:
;	val[0] = k; 
	LEA  BX, [AutoC1084+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1084-2+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	return 1; 
	MOV  BX, +1
	ADD  SP, AutoC1084
	POP  BP
	RET
;} 

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

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

	  [SECTION .cseg]
; 
;str_const(val) int val[]; 
str_const:
	PUSH BP
	SUB  SP, AutoC1090
	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_1091
	JMP  L_1092
L_1091:
	MOV  BX, +0
	ADD  SP, AutoC1090
	POP  BP
	RET
;	val[0] = litptr; 
L_1092:
	LEA  BX, [AutoC1090+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_1093:
	CALL inspect_chr
	PUSH BX
	MOV  BX, +34
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1094
	JMP  L_1095
L_1094:
;		{ 
;		if (inspect_chr() == 0) break; 
	CALL inspect_chr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1096
	JMP  L_1097
L_1096:
	JMP  L_1095
;		if (litptr >= LITMAX) 
L_1097:
	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_1098
	JMP  L_1099
L_1098:
;			{  /** cleanup literal error **/ 
;			error("string space exhausted"); 
	MOV  BX, L_1090+0
	PUSH BX
	CALL error
	ADD  SP, +2
;			while (match(quote) == 0) 
L_1100:
	MOV  BX, quote
	PUSH BX
	CALL match
	ADD  SP, +2
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1101
	JMP  L_1102
L_1101:
;				if (g_nxtchr() == 0) break; 
	CALL g_nxtchr
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1103
	JMP  L_1104
L_1103:
	JMP  L_1102
;			return 1; 
L_1104:
	JMP  L_1100
L_1102:
	MOV  BX, +1
	ADD  SP, AutoC1090
	POP  BP
	RET
;			} 
;		litq[litptr++] = g_nxtchr(); /** cpy to literal tbl **/ 
L_1099:
	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_1093
L_1095:
;	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, AutoC1090
	POP  BP
	RET
;}  /** quoted str entered into Literals Table **/ 

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

	  [SECTION .dseg]
L_1090	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, AutoC1105
	MOV  BP, SP

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

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

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

AutoC1106	EQU 0

	  [SECTION .dseg]
L_1106	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, AutoC1109
	MOV  BP, SP

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

AutoC1109	EQU 0

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

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

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

AutoC1110	EQU 0

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

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

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

AutoC1111	EQU 0

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

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

;{ 
;	ol("PUSH BP");	/*Save old frame ptr.*/ 
	MOV  BX, L_1112+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("SUB  SP, ");	/*Adjust stack beyond new frame.*/ 
	MOV  BX, L_1112+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_1112+18
	PUSH BX
	CALL ol
	ADD  SP, +2
;	nl(); 
	CALL nl
;} 
	POP  BP
	RET

AutoC1112	EQU 0

	  [SECTION .dseg]
L_1112	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, AutoC1113
	MOV  BP, SP

;{ 
;	nl(); 
	CALL nl
;	ostklbl();		/*Generate frame size.*/ 
	CALL ostklbl
;	ot("EQU "); 
	MOV  BX, L_1113+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

AutoC1113	EQU 0

	  [SECTION .dseg]
L_1113	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, AutoC1114
	MOV  BP, SP

;{ 
;	int len, i, j; 
; 
;	/** outasm("cz"); **/ 
;	len = strlen(sname); 
	LEA  BX, [AutoC1114-2+BP]
	PUSH BX
	LEA  BX, [AutoC1114+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL strlen
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;	if (len > (asmpref+asmsuff)) 
	LEA  BX, [AutoC1114-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_1115
	JMP  L_1116
L_1115:
;		{ 
;		i = asmpref; 
	LEA  BX, [AutoC1114-4+BP]
	PUSH BX
	MOV  BX, +11
	POP  DI
	MOV  Word [DI], BX
;		len = len - asmpref - asmsuff; 
	LEA  BX, [AutoC1114-2+BP]
	PUSH BX
	LEA  BX, [AutoC1114-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_1117:
	LEA  BX, [AutoC1114-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_1118
	JMP  L_1119
L_1118:
;			outbyte(*sname++); 
	LEA  BX, [AutoC1114+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_1117
L_1119:
;		while (len-- > 0) 
L_1120:
	LEA  BX, [AutoC1114-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_1121
	JMP  L_1122
L_1121:
;			sname++; 
	LEA  BX, [AutoC1114+4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	JMP  L_1120
L_1122:
;		while (*sname) 
L_1123:
	LEA  BX, [AutoC1114+4+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_1124
	JMP  L_1125
L_1124:
;			outbyte(*sname++); 
	LEA  BX, [AutoC1114+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(i-- > 0) 
;			outbyte(toupperi(*sname++)); 
;		while(len-- > 0) 
;			sname++; 
;		while(*sname) 
;			outbyte(toupperi(*sname++)); ****/ 
;		} 
;	else	outasm(sname); 
	JMP  L_1126
L_1116:
	LEA  BX, [AutoC1114+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outasm
	ADD  SP, +2
L_1126:
;} /* end asm_symb */ 
	ADD  SP, AutoC1114
	POP  BP
	RET

AutoC1114	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, AutoC1127
	MOV  BP, SP

;{ 
;	if ((sym[IDENT] != POINTER) & (sym[TYPE] == CCHAR)) 
	LEA  BX, [AutoC1127+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, [AutoC1127+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_1128
	JMP  L_1129
L_1128:
;		{ 
;		ot("MOV  AL, [Byte "); 
	MOV  BX, L_1127+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;		asm_symb(sym+NAME); 
	LEA  BX, [AutoC1127+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_1127+16
	PUSH BX
	CALL outasm
	ADD  SP, +2
;		nl(); 
	CALL nl
;		ol("CBW"); 
	MOV  BX, L_1127+18
	PUSH BX
	CALL ol
	ADD  SP, +2
;		ol("MOV  BX, AX"); 
	MOV  BX, L_1127+22
	PUSH BX
	CALL ol
	ADD  SP, +2
;		nl(); 
	CALL nl
;		} 
;	else 
	JMP  L_1130
L_1129:
;		{ 
;		ot("MOV  BX, [Word "); 
	MOV  BX, L_1127+34
	PUSH BX
	CALL ot
	ADD  SP, +2
;		asm_symb(sym+NAME); 
	LEA  BX, [AutoC1127+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_1127+50
	PUSH BX
	CALL outasm
	ADD  SP, +2
;		nl(); 
	CALL nl
;		} 
L_1130:
;} 
	POP  BP
	RET

AutoC1127	EQU 0
;	sym	PTR	CHAR	+4

	  [SECTION .dseg]
L_1127	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, AutoC1131
	MOV  BP, SP

;{ 
;	ot("LEA  BX, ["); 
	MOV  BX, L_1131+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;	ostklbl(); 
	CALL ostklbl
;	outdec((sym[OFFSET] & 255) + ((sym[OFFSET+1] & 255) << 8)); 
	LEA  BX, [AutoC1131+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, [AutoC1131+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_1131+11
	PUSH BX
	CALL outasm
	ADD  SP, +2
;	nl(); 
	CALL nl
;} 
	POP  BP
	RET

AutoC1131	EQU 0
;	sym	PTR	CHAR	+4

	  [SECTION .dseg]
L_1131	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, AutoC1132
	MOV  BP, SP

;{ 
;	if ((sym[IDENT] != POINTER) & (sym[TYPE] == CCHAR)) 
	LEA  BX, [AutoC1132+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, [AutoC1132+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_1133
	JMP  L_1134
L_1133:
;		{ 
;		ot("MOV  Byte ["); 
	MOV  BX, L_1132+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;		asm_symb(sym+NAME); 
	LEA  BX, [AutoC1132+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_1132+12
	PUSH BX
	CALL outasm
	ADD  SP, +2
;		nl(); 
	CALL nl
;		} 
;	else 
	JMP  L_1135
L_1134:
;		{ 
;		ot("MOV  Word ["); 
	MOV  BX, L_1132+18
	PUSH BX
	CALL ot
	ADD  SP, +2
;		asm_symb(sym+NAME); 
	LEA  BX, [AutoC1132+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_1132+30
	PUSH BX
	CALL outasm
	ADD  SP, +2
;		nl(); 
	CALL nl
;		} 
L_1135:
;} 
	POP  BP
	RET

AutoC1132	EQU 0
;	sym	PTR	CHAR	+4

	  [SECTION .dseg]
L_1132	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, AutoC1136
	MOV  BP, SP

;{ 
;	ol("POP  DI"); 
	MOV  BX, L_1136+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, [AutoC1136+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1137
	JMP  L_1138
L_1137:
;	   ol("MOV  Byte [DI], BL"); 
	MOV  BX, L_1136+8
	PUSH BX
	CALL ol
	ADD  SP, +2
;	else 
	JMP  L_1139
L_1138:
;	   ol("MOV  Word [DI], BX"); 
	MOV  BX, L_1136+27
	PUSH BX
	CALL ol
	ADD  SP, +2
L_1139:
;} 
	POP  BP
	RET

AutoC1136	EQU 0
;	typeobj	VAR	CHAR	+4

	  [SECTION .dseg]
L_1136	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, AutoC1140
	MOV  BP, SP

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

AutoC1140	EQU 0
;	typeobj	VAR	CHAR	+4

	  [SECTION .dseg]
L_1140	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, AutoC1144
	MOV  BP, SP

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

AutoC1144	EQU 0

	  [SECTION .dseg]
L_1144	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, AutoC1145
	MOV  BP, SP

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

AutoC1145	EQU 0

	  [SECTION .dseg]
L_1145	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, AutoC1146
	MOV  BP, SP

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

AutoC1146	EQU 0

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

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

;{ 
;	ol("PUSH BX"); 
	MOV  BX, L_1147+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

AutoC1147	EQU 0

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

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

;{ 
;	ol("POP  DX"); 
	MOV  BX, L_1148+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

AutoC1148	EQU 0

	  [SECTION .dseg]
L_1148	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, AutoC1149
	MOV  BP, SP

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

AutoC1149	EQU 0

	  [SECTION .dseg]
L_1149	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, AutoC1150
	MOV  BP, SP

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

AutoC1150	EQU 0
;	sname	PTR	CHAR	+4

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

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

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

AutoC1151	EQU 0
;	sname	PTR	CHAR	+4

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

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

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

AutoC1152	EQU 0

	  [SECTION .dseg]
L_1152	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, AutoC1153
	MOV  BP, SP

;{ 
;	sa_immed(); 
	CALL sa_immed
;	outasm("( $+3+2+2+2)"); 
	MOV  BX, L_1153+0
	PUSH BX
	CALL outasm
	ADD  SP, +2
;	nl(); 
	CALL nl
;	ol("MOV  DI, SP"); 
	MOV  BX, L_1153+13
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ol("XCHG BX, [DI]"); /** small memory model dependent **/ 
	MOV  BX, L_1153+25
	PUSH BX
	CALL ol
	ADD  SP, +2
;/**	ol("XCHG BX, [SS:DI]"); ** mem model independent **/ 
;	ol("JMP  BX"); 
	MOV  BX, L_1153+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

AutoC1153	EQU 0

	  [SECTION .dseg]
L_1153	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, AutoC1154
	MOV  BP, SP

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

AutoC1154	EQU 0
;	label	VAR	INT	+4

	  [SECTION .dseg]
L_1154	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, AutoC1155
	MOV  BP, SP

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

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

	  [SECTION .dseg]
L_1155	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, AutoC1156
	MOV  BP, SP

;{  /** do .. while specific **/ 
;	ol("OR   BX, BX"); 
	MOV  BX, L_1156+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("JNZ  "); 
	MOV  BX, L_1156+12
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(t_lbl); 
	LEA  BX, [AutoC1156+6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL printlabel
	ADD  SP, +2
;	nl(); 
	CALL nl
;	ot("JMP  "); 
	MOV  BX, L_1156+18
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(flab1); 
	LEA  BX, [AutoC1156+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, [AutoC1156+6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;} 
	POP  BP
	RET

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

	  [SECTION .dseg]
L_1156	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, AutoC1157
	MOV  BP, SP

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

AutoC1157	EQU 0

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

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

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

AutoC1158	EQU 0

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

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

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

AutoC1159	EQU 0

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

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

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

AutoC1160	EQU 0

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

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

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

AutoC1161	EQU 0

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

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

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

AutoC1162	EQU 0

	  [SECTION .dseg]
L_1162	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, AutoC1163
	MOV  BP, SP

;{ 
;	int k; 
; 
;	k = newsp - Csp; 
	LEA  BX, [AutoC1163-2+BP]
	PUSH BX
	LEA  BX, [AutoC1163+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, [AutoC1163-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1164
	JMP  L_1165
L_1164:
	LEA  BX, [AutoC1163+4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1163
	POP  BP
	RET
;	ot("ADD  SP, "); 
L_1165:
	MOV  BX, L_1163+0
	PUSH BX
	CALL ot
	ADD  SP, +2
;	outdec(k); 
	LEA  BX, [AutoC1163-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outdec
	ADD  SP, +2
;	nl(); 
	CALL nl
;	return newsp; 
	LEA  BX, [AutoC1163+4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1163
	POP  BP
	RET
;} 

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

	  [SECTION .dseg]
L_1163	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, AutoC1166
	MOV  BP, SP

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

AutoC1166	EQU 0
;	newsp	VAR	INT	+4

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

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

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

AutoC1169	EQU 0

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

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

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

AutoC1170	EQU 0

	  [SECTION .dseg]
L_1170	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, AutoC1171
	MOV  BP, SP

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

AutoC1171	EQU 0

	  [SECTION .dseg]
L_1171	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, AutoC1172
	MOV  BP, SP

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

AutoC1172	EQU 0

	  [SECTION .dseg]
L_1172	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, AutoC1173
	MOV  BP, SP

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

AutoC1173	EQU 0

	  [SECTION .dseg]
L_1173	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, AutoC1174
	MOV  BP, SP

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

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

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

AutoC1175	EQU 0

	  [SECTION .dseg]
L_1175	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, AutoC1176
	MOV  BP, SP

;{ 
;	ol("XOR  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 "XOR  BX, DX",0

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

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

AutoC1177	EQU 0

	  [SECTION .dseg]
L_1177	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, AutoC1178
	MOV  BP, SP

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

AutoC1178	EQU 0

	  [SECTION .dseg]
L_1178	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, AutoC1179
	MOV  BP, SP

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

AutoC1179	EQU 0

	  [SECTION .dseg]
L_1179	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, AutoC1180
	MOV  BP, SP

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

AutoC1180	EQU 0

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

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

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

AutoC1181	EQU 0

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

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

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

AutoC1182	EQU 0

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

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

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

AutoC1183	EQU 0

	  [SECTION .dseg]
L_1183	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, AutoC1184
	MOV  BP, SP

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

AutoC1184	EQU 0

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

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

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

AutoC1185	EQU 0

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

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

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

AutoC1186	EQU 0

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

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

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

AutoC1187	EQU 0

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

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

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

AutoC1188	EQU 0

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

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

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

AutoC1189	EQU 0

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

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

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

AutoC1190	EQU 0

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

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

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

AutoC1191	EQU 0

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

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

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

AutoC1192	EQU 0

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

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

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

AutoC1193	EQU 0

	  [SECTION .dseg]
L_1193	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, AutoC1194
	MOV  BP, SP

;{ 
;	int t_lbl; 
; 
;	t_lbl = getlabel();	/** make a unique label for our use **/ 
	LEA  BX, [AutoC1194-2+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	ol("AND  BX, 0FFFFh"); 
	MOV  BX, L_1194+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("JZ   ");		/** already zero. **/ 
	MOV  BX, L_1194+16
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(t_lbl); 
	LEA  BX, [AutoC1194-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_1194+22
	PUSH BX
	CALL ol
	ADD  SP, +2
;	sa_mk_lbl(t_lbl);	/** codegen true branch label here **/ 
	LEA  BX, [AutoC1194-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;} 
	ADD  SP, AutoC1194
	POP  BP
	RET

AutoC1194	EQU 2
;	t_lbl	VAR	INT	-2

	  [SECTION .dseg]
L_1194	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, AutoC1195
	MOV  BP, SP

;{ 
;	int t_lbl, f_lbl; 
; 
;	t_lbl = getlabel();	/** make a unique label for our use **/ 
	LEA  BX, [AutoC1195-2+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
;	f_lbl = getlabel(); 
	LEA  BX, [AutoC1195-4+BP]
	PUSH BX
	CALL getlabel
	POP  DI
	MOV  Word [DI], BX
; 
;	ol("AND  BX, 0FFFFh"); 
	MOV  BX, L_1195+0
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("JNZ  ");		/** jz means already zero. **/ 
	MOV  BX, L_1195+16
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(t_lbl); 
	LEA  BX, [AutoC1195-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_1195+22
	PUSH BX
	CALL ol
	ADD  SP, +2
;	ot("JMP  "); 
	MOV  BX, L_1195+33
	PUSH BX
	CALL ot
	ADD  SP, +2
;	printlabel(f_lbl); 
	LEA  BX, [AutoC1195-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, [AutoC1195-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;	ol("MOV  BX, 0"); /** invert to zero **/ 
	MOV  BX, L_1195+39
	PUSH BX
	CALL ol
	ADD  SP, +2
;	sa_mk_lbl(f_lbl); 
	LEA  BX, [AutoC1195-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL sa_mk_lbl
	ADD  SP, +2
;} 
	ADD  SP, AutoC1195
	POP  BP
	RET

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

	  [SECTION .dseg]
L_1195	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 **/ 
; 
;#include C5LIBA.C  
;/** C5LIB_A.C for CCN8A.C **/ 
;/*********************************************************/ 
;/** Module: C5LIB.C  By: s_dubrovich@yahoo.com		**/ 
;/** Last: 8:00 AM 8/16/2008				**/ 
;/** Vers: 0.2.3						**/ 
;/**  modified puts();					**/ 
;/*********************************************************/ 
;/** Module: C5LIB.C  By: s_dubrovich@yahoo.com		**/ 
;/** Last:  10:29 PM 8/14/2008				**/ 
;/** Vers: 0.2.2						**/ 
;/**  Chg to C5LIB.C for further development.  Added in	**/ 
;/**  mainmain() for initialization of user source.	**/ 
;/**  file Was IOC5.C					**/ 
;/**  Added puts();					**/ 
;/*********************************************************/ 
;/** IOC5.C -- stripped main for small-c include		**/ 
;/** Call 5 IO Interface Library				**/ 
;/*********************************************************/ 
;/** Last: 30-Jul-08 05:08:51 PM.			**/ 
;/** Prev: 08:15:42 AM 17-Jul-08				**/ 
;/** Vers: 0.1.7	modified re_ubuff()			**/ 
;/** chg index update for ol(ptr)			**/ 
;/*********************************************************/ 
;/** Last: 07:32:44 AM 15-Jul-08				**/ 
;/** Vers: 0.1.5 -filter 0Dh -> 20h for eol problem    ****/ 
;/**  chgd getc() to filter & 127, or, ret EOF         ****/ 
;/*********************************************************/ 
;/** Last: 05:23:25 AM 07/13/2008 01:31:05 PM 07/12/2008	**/ 
;/** Init: 11:18 PM 7/5/2008				**/ 
;/*********************************************************/ 
;/** CALL5_IO.C test file & IO Functions for small-c	**/ 
;/** Last: 11:44 AM 7/5/2008 :: 11:28 AM 7/4/2008	**/ 
;/** Init: 7:24 AM 5/31/2008				**/ 
;/** Vers: 0.1.0  By: s_dubrovich@yahoo.com		**/ 
;/** Goal: minimal IO to Call_5 interface to run small-c **/ 
;/** Note: Only Character, not binary Files.		**/ 
;/** -Cloned From SINKIO01.C as IO LIB base Fn's		**/ 
;/** -includes some testing code as main()		**/ 
;/*********************************************************/ 
;/** NOTE: for cmd.exe edit NASM src for vstart=0100h,   **/ 
;/** and comment out ';;' the two SECTION .dseg align=16 **/ 
;/** directives so that the pcdos 'small' model is used. **/ 
;/*********************************************************/ 
;/** Req'd IO Functions for Small-c			**/ 
;/**getc(){;} gets(){;} putc(){;}  			**/ 
;/**putchar(){;} fopen(){;} fclose(){;}			**/ 
; 
;/* 
;** STDIO.H -- Standard Small-C Definitions --  
;*/ 
;#define stdin    0 
;#define stdout   1 
;#define stderr   2 
;#define ERR   (-2) 
;#define EOF   (-1) 
;/** #define YES      1  **/ 
;/** #define NO       0  **/ 
;/** #define NULL     0  **/ 
;#define BAD	(-1) 
;#define CR      13 
;#define LF      10 
;#define BELL     7 
;#define SPACE  ' ' 
;#define NEWLINE LF 
; 
;#define EOL 10   /** LF **/ 
;#define NL  10 
;#define TAB  9 
;#define EOL2    13 /*;end-of-line character          */ 
;                   /*  (=carriage return,CR)         */ 
;#define CTRLZ	26 /** 1Ah, Ctrl-Z, cpm textfile EOF */ 
;/**-----------------------------------------------------**/ 
;#define MAX_IOD   6 /** Max Streams, incl stdin,out,err **/ 
;#define FILE  char /** Cain's C doesn't know struc FILE **/ 
;#define VERBOSE   1 /** debugging, report runtime state **/ 
;/**-----------------------------------------------------**/ 
;/** #define PCDOS 1 * IBM PC DOS, Same as CP/M-80   */ 
;/** #if PCDOS		*****************************/ 
;#define EXIT	   0	/* Exit to BDOS		    */ 
;#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 CONBUF	   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		*****************************/ 
; 
;/***	File State  bit definitions                       ***/ 
;#define STATE_FR 0	/* Available State, FREE CCB        */ 
;#define STATE_FO 1	/* else File Opened                 */ 
;#define STATE_DT 2	/* at least 1 rec put to file, ndx0 */ 
;#define STATE_PW 4	/* Pending Write, Flush before close*/ 
;#define STATE_EF 8	/* EOF state on last read	    */ 
;#define STATE_ER BAD	/* Error State                      */ 
; 
;/***	File Mode, Character String                         */ 
;#define MODE_RD	'R'	/* Read mode parameter for open     */ 
;#define MODE_WR	'W'	/* Write mode                       */ 
;#define MODE_NU	'N'	/* Null Mode for reuse              */  
; 
;/*	CP/M FCB definition - similar to PC Dos	*/ 
;#define EOFCHR	26	/* End of file character-^Z, 0x1a   */ 
;				/****************************/ 
;#define SECSIZ		128	/* size of CP/M sectorrecord*/ 
;#define _MAXSXFR	1	/* max # sectors xferrable  */ 
;#define _MAXSHFT	12	/* shift right BDOS rtn val */ 
;				/*   to obtain nsecs on err */ 
;				/****************************/ 
;#define BYTE	char 
;#define INT	int 
;#define WORD	int 
; 
;/******************************************************************** 
; *	Channel Control Block (CCB), _iod, I/O Descriptor. 
; *									     
; * One CCB is allocated (statically) for each of the possible open   
; * files under C (including STDIN, STDOUT, STDERR).  Permanent data     
; * regarding the channel is kept here.				     
; *	-= note: initially. use 6 CCB's, adequate for small-c =- 
; ********************************************************************/ 
;  /** Define File Descriptor Indexes - _IOD **/ 
;#define DRV	0 
;#define FNAME	1 
;#define FTYP	9 
;#define FBLK	12 /* current 16k Block */ 
;#define LRS	14 /* Logical Record Size, 0080h */ 
;#define FSZ	16 /* FileSize in bytes */ 
;#define FDATE	20 /* Date */ 
;#define FTCHG	22 /* Time of Last Change */ 
;#define FDCHG	24 /* Date of Last Change */ 
;#define FCLUS	26 /* First Cluster Number for FAT Entry */ 
;#define FSIZE	28 /* File Size 28..31 */ 
;#define FCREC	32 /* Current Record in current 16k Block */ 
;#define FR0	33 /* lo byte of Random Rec Number */ 
;#define FR1	34 /* mid byte of Random Rec Number */ 
;#define FR2	35 /* hi byte of Random Rec Number */ 
;#define FR3	36 /* Overflo byte under certain circumstances */ 
;  /** -= File Operational Elements of Struct =- **/ 
;#define IOTYP   37 /* TYPES: 'S'torage(file), 'M'emory(file) **/ 
;#define FMODE	38 /* File Mode Indication Bytes [3] ex.'wb+' **/ 
;#define FSTATE	41 /* Current Operational State Byte **/ 
;#define FBUFNDX 42 /* Buffer index DW to next free position, 0..127 **/ 
;#define FBUFFER	44 /* File Transfer Buffer **/  
;#define LENFDD	172 /* Next Position after FCB Structure, */ 
;		/** Length of File Descriptor Area **/ 
;#define LEN_Y	171 /** LENFDD - 1, for addressing f_units **/ 
;/**-------------------------------------------------------------*/ 
;/*** -= DECLARATIONS =- ***/ 
;/**-------------------------------------------------------------*/ 
; 
;/** FCB STUCTURES ARRAY AREA ***** CCB's	**/ 
;/** First three are STDIN, STDOUT, STDERR	**/ 
; 
;	int  *_iod[MAX_IOD]; /** holds addrs of f_units at runtime **/ 
; 
;  /** File Descriptor Area **/ 
;	char f_unit0;	/** Location is DRV in struct **/ 
;	char fdd_01[LEN_Y];  /** one less than LENFDD **/ 
; 
;	char f_unit1; 
;	char fdd_02[LEN_Y]; 
; 
;	char f_unit2; 
;	char fdd_03[LEN_Y]; 
; 
;	char f_unit3; 
;	char fdd_04[LEN_Y]; 
; 
;	char f_unit4; 
;	char fdd_05[LEN_Y]; 
; 
;	char f_unit5; 
;	char fdd_06[LEN_Y]; 
; 
; 
;	char fdta[128]; /** default fp buff **/ 
;  /** TBUFF Area for CONIO *********************/ 
;	char tbuff[257]; 
;	char ubuff[257]; 
;	char cp[]; 
; 
;/*       1         2         3         4         5   */ 
;/*****************************************************/ 
;/* Module: OSFN.C				     */ 
;/* Last:  12:10 PM 4/12/2008                         */ 
;/* Init:  9:28 PM 12/28/2007                         */ 
;/* By:  s_dubrovich@yahoo.com                        */ 
;/* Goal: test module for small-c & nasm              */ 
;/* testb.c -  to demo "SMALLC-NASM"                  */ 
;/* -f bin -l testb.lst -o testb.com testb.nsm        */ 
;/* #asm                                              */ 
;/* ;-;	org 0100h ;; for .com locate main()	     */ 
;/* ;-; Doesn't work, for pcDos, edit SECTION .text   */ 
;/* ;-;  to vstart=0100h                              */ 
;/* #endasm                                           */ 
; 
;/***-----------------------------------------------***/ 
;/***                   M A I N                     ***/ 
;/***-----------------------------------------------***/ 
;/*** Main Block, testing File I/O Functions.  Also, **/ 
;/** provides startup initialization for FCB's for   **/ 
;/** User codes' main() -this depends on including   **/ 
;/**  #include C5LIB.C ** first in users's source    **/ 
;/**  in order for mainmain() to execute first. If   **/ 
;/**  included elsewhere in user's source then this  **/ 
;/**  mainmain() doesn't execute, but the lib fn's   **/ 
;/**  are still available and the user must explicit- */ 
;/*   ly call initfcb() first before file operations. */ 
; 
;mainmain() 
mainmain:
	PUSH BP
	SUB  SP, AutoC1196
	MOV  BP, SP

;{ 
;	initfcb(); /** in this file **/ 
	CALL initfcb
;	main();    /** call users main **/ 
	CALL main
;	exit();	/** user's main returns, handle exit */ 
	CALL exit
;} 
	POP  BP
	RET

AutoC1196	EQU 0
;/** eo main **/ 
; 
;/***-----------------------------------------------***/ 
;/***             S U B R O U T I N E S             ***/ 
;/***-----------------------------------------------***/ 
; 
;/*** codify EOL sequence...			   ***/ 
;NLfn() 
NLfn:
	PUSH BP
	SUB  SP, AutoC1197
	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

AutoC1197	EQU 0
; 
;/* Test if given character is alpha - internal FN !? */ 
;/****---- alpha(c) 
;	char c; 
;{	c=c&127; 
;	return(((c>='a')&(c<='z'))| 
;		((c>='A')&(c<='Z'))| 
;		(c=='_')); 
;} ----****/ 
; 
; 
;/***-----------------------------------------------***/ 
;/** Test for Printable Character, EOF		---***/ 
;/**  ret bool := 1 if not a printable char, else 0 ***/ 
;/**  ret`0 .if. e|{' '..'~'} .else. 1		   ***/ 
; 
;isnprint(c) char c; 
isnprint:
	PUSH BP
	SUB  SP, AutoC1198
	MOV  BP, SP

;{ 
;	if ((c>=' ')&(c<='~')) return 0; 
	LEA  BX, [AutoC1198+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +32
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC1198+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +126
	POP  DX
	CALL ccle
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_1199
	JMP  L_1200
L_1199:
	MOV  BX, +0
	POP  BP
	RET
;	else return 1; 
	JMP  L_1201
L_1200:
	MOV  BX, +1
	POP  BP
	RET
L_1201:
;} 
	POP  BP
	RET

AutoC1198	EQU 0
;	c	VAR	CHAR	+4
; 
;/***-----------------------------------------------***/ 
;toupper(c) char c; 
toupper:
	PUSH BP
	SUB  SP, AutoC1202
	MOV  BP, SP

;{ 
;	if (c) /** not null **/ 
	LEA  BX, [AutoC1202+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_1203
	JMP  L_1204
L_1203:
;		{ 
;		if ((c>='a')&(c<='z')) return (c-32); 
	LEA  BX, [AutoC1202+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +97
	POP  DX
	CALL ccge
	PUSH BX
	LEA  BX, [AutoC1202+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_1205
	JMP  L_1206
L_1205:
	LEA  BX, [AutoC1202+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +32
	POP  DX
	SUB  DX, BX
	MOV  BX, DX
	POP  BP
	RET
;		else return (c); 
	JMP  L_1207
L_1206:
	LEA  BX, [AutoC1202+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  BP
	RET
L_1207:
;		} 
;	return (c); 
L_1204:
	LEA  BX, [AutoC1202+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  BP
	RET
;} 

AutoC1202	EQU 0
;	c	VAR	CHAR	+4
; 
;/***-----------------------------------------------***/ 
;/*** put a char array of len length to conout.	---***/ 
;putchara(str,len) char str[]; int len; 
putchara:
	PUSH BP
	SUB  SP, AutoC1208
	MOV  BP, SP

;{ 
;	int cnt, ix; 
;	cnt = len; 
	LEA  BX, [AutoC1208-2+BP]
	PUSH BX
	LEA  BX, [AutoC1208+4+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	ix  = 0; 
	LEA  BX, [AutoC1208-4+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (len) 
L_1209:
	LEA  BX, [AutoC1208+4+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1210
	JMP  L_1211
L_1210:
;		{ 
;		putchar(str[ix++]); 
	LEA  BX, [AutoC1208+6+BP]
	MOV  BX, [BX]
	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
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL putchar
	ADD  SP, +2
;		len--; 
	LEA  BX, [AutoC1208+4+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
;		} 
	JMP  L_1209
L_1211:
;} 
	ADD  SP, AutoC1208
	POP  BP
	RET

AutoC1208	EQU 4
;	str	PTR	CHAR	+6
;	len	VAR	INT	+4
;	cnt	VAR	INT	-2
;	ix	VAR	INT	-4
; 
;/***-----------------------------------------------***/ 
;/*** to Upper Case conversion of string 'str$'     ***/ 
; 
;uc_str(pstr) char *pstr; 
uc_str:
	PUSH BP
	SUB  SP, AutoC1212
	MOV  BP, SP

;{ /** takes a ptr to a '$' terminated string **/ 
;	char chr, *ip; 
; 
;	while (*pstr != '$') 
L_1213:
	LEA  BX, [AutoC1212+4+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +36
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1214
	JMP  L_1215
L_1214:
;		{ 
;		chr=toupper(*pstr++); 
	LEA  BX, [AutoC1212-1+BP]
	PUSH BX
	LEA  BX, [AutoC1212+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 toupper
	ADD  SP, +2
	POP  DI
	MOV  Byte [DI], BL
;		putchar(chr); 
	LEA  BX, [AutoC1212-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL putchar
	ADD  SP, +2
;		*ip++ = chr; /** ip++; **/ 
	LEA  BX, [AutoC1212-3+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC1212-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		} /** str conversion **/ 
	JMP  L_1213
L_1215:
;} 
	ADD  SP, AutoC1212
	POP  BP
	RET

AutoC1212	EQU 3
;	pstr	PTR	CHAR	+4
;	chr	VAR	CHAR	-1
;	ip	PTR	CHAR	-3
; 
;/***-----------------------------------------------***/ 
;/*** to Upper Case conversion of string 'str\0'    ***/ 
; 
;uc_nstr(pstr) char *pstr; 
uc_nstr:
	PUSH BP
	SUB  SP, AutoC1216
	MOV  BP, SP

;{ /** takes a ptr to a null terminated string **/ 
;	char chr, *ip; 
; 
;	while (*pstr) 
L_1217:
	LEA  BX, [AutoC1216+4+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_1218
	JMP  L_1219
L_1218:
;		{ 
;		chr=toupper(*pstr++); 
	LEA  BX, [AutoC1216-1+BP]
	PUSH BX
	LEA  BX, [AutoC1216+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 toupper
	ADD  SP, +2
	POP  DI
	MOV  Byte [DI], BL
;		putchar(chr); 
	LEA  BX, [AutoC1216-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL putchar
	ADD  SP, +2
;		*ip++ = chr; /** ip++; **/ 
	LEA  BX, [AutoC1216-3+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC1216-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		} /** str conversion **/ 
	JMP  L_1217
L_1219:
;} 
	ADD  SP, AutoC1216
	POP  BP
	RET

AutoC1216	EQU 3
;	pstr	PTR	CHAR	+4
;	chr	VAR	CHAR	-1
;	ip	PTR	CHAR	-3
; 
;/***-----------------------------------------------***/ 
;/*** NOTE- limited function, copy filespec 11 chars***/ 
; 
;copystr(str1, str2) char str1[], str2[];  
copystr:
	PUSH BP
	SUB  SP, AutoC1220
	MOV  BP, SP

;{ 
;	int i,cnt; 
;	cnt = 11; 
	LEA  BX, [AutoC1220-4+BP]
	PUSH BX
	MOV  BX, +11
	POP  DI
	MOV  Word [DI], BX
;	i   = 0; 
	LEA  BX, [AutoC1220-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (cnt) 
L_1221:
	LEA  BX, [AutoC1220-4+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1222
	JMP  L_1223
L_1222:
;		{ 
;		str2[i] = str1[i]; 
	LEA  BX, [AutoC1220+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1220-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1220+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1220-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		cnt--; 
	LEA  BX, [AutoC1220-4+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
;		i++; 
	LEA  BX, [AutoC1220-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		} 
	JMP  L_1221
L_1223:
;} 
	ADD  SP, AutoC1220
	POP  BP
	RET

AutoC1220	EQU 4
;	str1	PTR	CHAR	+6
;	str2	PTR	CHAR	+4
;	i	VAR	INT	-2
;	cnt	VAR	INT	-4
; 
;/***-----------------------------------------------***/ 
;copymem(blk1, blk2, ccnt) char blk1[], blk2[]; int ccnt;  
copymem:
	PUSH BP
	SUB  SP, AutoC1224
	MOV  BP, SP

;{ 
;	int i; 
;	i   = 0; 
	LEA  BX, [AutoC1224-2+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (ccnt) 
L_1225:
	LEA  BX, [AutoC1224+4+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1226
	JMP  L_1227
L_1226:
;		{ 
;		blk2[i] = blk1[i]; 
	LEA  BX, [AutoC1224+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1224-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1224+8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1224-2+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		ccnt--; 
	LEA  BX, [AutoC1224+4+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
;		i++; 
	LEA  BX, [AutoC1224-2+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		} 
	JMP  L_1225
L_1227:
;} 
	ADD  SP, AutoC1224
	POP  BP
	RET

AutoC1224	EQU 2
;	blk1	PTR	CHAR	+8
;	blk2	PTR	CHAR	+6
;	ccnt	VAR	INT	+4
;	i	VAR	INT	-2
; 
;/***-----------------------------------------------***/ 
;/*** Div DW as DD`DX:AX -> AX`quot,DX`rem.  Word   ***/ 
;/** value is passed on the stack.                  ***/ 
;/** Use Division by Subtraction to avoid ovfl      ***/ 
;/*** Status: works ok, wordsz => 0..max`65535      ***/ 
; 
; 
;outdeci(number) int number; 
outdeci:
	PUSH BP
	SUB  SP, AutoC1228
	MOV  BP, SP

;{ 
;#asm 
;;outdeci(number)int number;{int k,zs;char c;zs = 0; 
;; k=10000;/**	if (number < 0){number=(-number); 
;; outbyte('-');}***/while (k>=1){c=number/k + '0'; 
;; if ((c!='0')|(k==1)|(zs)){zs=1;putchar(c);} 
;; number=number%k;k=k/10;} } 
	mov  dx,0 
	pop  di		;; 0[ret]2[val] 
	pop  ax 
	push ax		;; caller cleans the stack 
	push di		;; restore return address. 
	pusha		;; save entry state... 
	mov  cx,0 
	mov  bx,10000 
	call Lnnd 
	mov  cx,0 
	mov  bx,1000 
	call Lnnd 
	mov  cx,0 
	mov  bx,100 
	call Lnnd 
	mov  cx,0 
	mov  bx,10 
	call Lnnd 
	mov  cx,0 
	mov  bx,1 
	call Lnnd 
  ;; Cleanup Stack, and return.. 
	popa 
	jmp  Cont 
Lnnd: 
	cmp  ax,bx 
	jb   .Lnxt1	;; less than 10k, else count. 
	sub  ax,bx 
	inc  cx 
	jmp  Lnnd 
.Lnxt1: 
	add  cx,30h ;; make ascii number 
	pusha 
	push cx 
	call putchar 
	pop  cx 
	popa 
	RET 
Cont: 
;#endasm ;} 
	POP  BP
	RET

AutoC1228	EQU 0
;	number	VAR	INT	+4
; 
;/***-----------------------------------------------***/ 
;/** ----------= S I M P L E   I / O =-------------- **/ 
;/***-----------------------------------------------***/ 
;/** define putchar() putc(c,stdout)                 **/ 
;/** -= Simple I/O =- **/ 
;putchar(c) 
putchar:
; char c; 
	PUSH BP
	SUB  SP, AutoC1229
	MOV  BP, SP

;{ 
;	OSfn_(CONOUT,c); 
	MOV  BX, +2
	PUSH BX
	LEA  BX, [AutoC1229+4+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
;/**	if(c==CR)		**/ 
;/**	OSfn_(CONOUT,LF);	**/ 
;/**	return(c & 255);	**/ 
;} 
	POP  BP
	RET

AutoC1229	EQU 0
;	c	VAR	CHAR	+4
; 
;/***-----------------------------------------------***/ 
;/** get buffered input from stdin, CONBUF #10       **/ 
;/** 1st byte of tbuff on call holds max_len,1..255  **/ 
;/** 2nd byte is set to string length inc terminator **/ 
;/** byte CR`0Dh.  Buffer must be preset before call **/ 
;/** Users returned string begins at third byte.     **/ 
; 
;/** Call 5 interface for internal use. **/ 
;c5gets(ubuff) char *ubuff;   
c5gets:
	PUSH BP
	SUB  SP, AutoC1230
	MOV  BP, SP

;{  /** use temp buffer with copy to userbuffer **/ 
;	char *ip,*pb,chr; 
; 
;	tbuff[0]=255;  /** use default max **/ 
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +255
	POP  DI
	MOV  Byte [DI], BL
;	ip = &tbuff[1]; 
	LEA  BX, [AutoC1230-2+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	pb = &tbuff[2]; 
	LEA  BX, [AutoC1230-4+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	OSfn_(CONBUF,&tbuff[0]); /** Fn 10, DS:DX **/ 
	MOV  BX, +10
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
;  /** copy string part to users buffer **/ 
;	while (*pb != 13) 
L_1231:
	LEA  BX, [AutoC1230-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_1232
	JMP  L_1233
L_1232:
;		{ 
;		chr = *pb++; 
	LEA  BX, [AutoC1230-5+BP]
	PUSH BX
	LEA  BX, [AutoC1230-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
;		*ubuff++ = chr; 
	LEA  BX, [AutoC1230+4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC1230-5+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		} 
	JMP  L_1231
L_1233:
;  /* chgs termination from CR to '$' */ 
;	*ubuff = '$'; 
	LEA  BX, [AutoC1230+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +36
	POP  DI
	MOV  Byte [DI], BL
;	return (*ip); 
	LEA  BX, [AutoC1230-2+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	ADD  SP, AutoC1230
	POP  BP
	RET
;} 

AutoC1230	EQU 5
;	ubuff	PTR	CHAR	+4
;	ip	PTR	CHAR	-2
;	pb	PTR	CHAR	-4
;	chr	VAR	CHAR	-5
; 
;/***-----------------------------------------------***/ 
;/**** Note: gets() for C functionality, append null ****/ 
;/**** Rets- caller's buffer ptr, or NULL if eof or err */ 
; 
;gets(ubuff) char *ubuff;  /** CONIN Fn **/ 
gets:
	PUSH BP
	SUB  SP, AutoC1234
	MOV  BP, SP

;{  /** use temp buffer with copy to userbuffer **/ 
;	char *ip,*pb, *tmpp, chr; 
; 
;	tmpp = ubuff;  /** local copy **/ 
	LEA  BX, [AutoC1234-6+BP]
	PUSH BX
	LEA  BX, [AutoC1234+4+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	tbuff[0]=255;  /** use default max inbuffsz **/ 
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +255
	POP  DI
	MOV  Byte [DI], BL
;	ip = &tbuff[1]; /** fn10 sets to strlen entered **/ 
	LEA  BX, [AutoC1234-2+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	pb = &tbuff[2]; /** entered str start **/ 
	LEA  BX, [AutoC1234-4+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	OSfn_(CONBUF,&tbuff[0]); /** Fn 10, DS:DX struct **/ 
	MOV  BX, +10
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
; 
;	if (0 == *ip) return (NULL); /** empty line **/ 
	MOV  BX, +0
	PUSH BX
	LEA  BX, [AutoC1234-2+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1235
	JMP  L_1236
L_1235:
	MOV  BX, +0
	ADD  SP, AutoC1234
	POP  BP
	RET
;  /** copy string part to users buffer **/ 
;	while (*pb != 13) /** input CR terminated **/ 
L_1236:
L_1237:
	LEA  BX, [AutoC1234-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_1238
	JMP  L_1239
L_1238:
;		{ 
;		chr = *pb++; 
	LEA  BX, [AutoC1234-7+BP]
	PUSH BX
	LEA  BX, [AutoC1234-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
;		*tmpp++ = chr; 
	LEA  BX, [AutoC1234-6+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC1234-7+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		} 
	JMP  L_1237
L_1239:
;  /* chgs termination from CR to C's '0' */ 
;	*tmpp = 0; 
	LEA  BX, [AutoC1234-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;	return (ubuff); 
	LEA  BX, [AutoC1234+4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1234
	POP  BP
	RET
;} 

AutoC1234	EQU 7
;	ubuff	PTR	CHAR	+4
;	ip	PTR	CHAR	-2
;	pb	PTR	CHAR	-4
;	tmpp	PTR	CHAR	-6
;	chr	VAR	CHAR	-7
; 
;/***-----------------------------------------------***/ 
;getch() 
getch:
	PUSH BP
	SUB  SP, AutoC1240
	MOV  BP, SP

;{ /* rets AH.01,AL.CharIn, echos to console   ***/ 
;	OSfn_(CONIN,0);  
	MOV  BX, +1
	PUSH BX
	MOV  BX, +0
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
;} 
	POP  BP
	RET

AutoC1240	EQU 0
; 
;/***-----------------------------------------------***/ 
;putstr(prntstr) /** must be '$' terminated, conout  **/ 
putstr:
; int *prntstr; 
	PUSH BP
	SUB  SP, AutoC1241
	MOV  BP, SP

;{ 
;	OSfn_(C_WRITESTR,prntstr); /* Fn 9, DS:DX */ 
	MOV  BX, +9
	PUSH BX
	LEA  BX, [AutoC1241+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
;} 
	POP  BP
	RET

AutoC1241	EQU 0
;	prntstr	PTR	INT	+4
; 
;/***-----------------------------------------------***/ 
;/*** 1:46 PM 8/15/2008				---***/ 
;/*** int puts(char *string) ; rets 0`success .else.***/ 
;/***  non-zero.  C strings are null terminated.	   ***/ 
;puts(str) char str[]; 
puts:
	PUSH BP
	SUB  SP, AutoC1242
	MOV  BP, SP

;{ 
;	char pstr[],*ptb,*ip,*op,*mx,chr; 
;	int  ndx; 
; 
;	mx = &tbuff[0];  /** holds byte len of tbuff **/ 
	LEA  BX, [AutoC1242-10+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	ip = &tbuff[1];  /** returns len entered **/ 
	LEA  BX, [AutoC1242-6+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	ptb = &tbuff[2]; /** buffer data area **/ 
	LEA  BX, [AutoC1242-4+BP]
	PUSH BX
	MOV  BX, tbuff
	PUSH BX
	MOV  BX, +2
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	op = ptb;	/** save start **/ 
	LEA  BX, [AutoC1242-8+BP]
	PUSH BX
	LEA  BX, [AutoC1242-4+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	pstr = str; 
	LEA  BX, [AutoC1242-2+BP]
	PUSH BX
	LEA  BX, [AutoC1242+4+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	ndx = 0; 
	LEA  BX, [AutoC1242-13+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
; 
;	*mx = 127; /** set max length for string 0..126 **/ 
	LEA  BX, [AutoC1242-10+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +127
	POP  DI
	MOV  Byte [DI], BL
;	*ip = 0; 
	LEA  BX, [AutoC1242-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;		 
; 
;	while (1) 
L_1243:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_1244
	JMP  L_1245
L_1244:
;		{ 
;		if (ndx == 127) 
	LEA  BX, [AutoC1242-13+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +127
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1246
	JMP  L_1247
L_1246:
;			{ /** internal max str len **/ 
;			NLfn(); 
	CALL NLfn
;			putstr("-= String maxed error =-$"); 
	MOV  BX, L_1242+0
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			return (BAD); 
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1242
	POP  BP
	RET
;			} 
;		if (pstr[ndx] == 0) 
L_1247:
	LEA  BX, [AutoC1242-2+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1242-13+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_1248
	JMP  L_1249
L_1248:
;			{	/** found null **/ 
;			*ptb = '$';   /** chg termination **/ 
	LEA  BX, [AutoC1242-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +36
	POP  DI
	MOV  Byte [DI], BL
;			*ip = ndx;    /** length of str in tbuff **/ 
	LEA  BX, [AutoC1242-6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1242-13+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;			putstr(op); 
	LEA  BX, [AutoC1242-8+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			return (ndx); /** pass back numb of chrs **/ 
	LEA  BX, [AutoC1242-13+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1242
	POP  BP
	RET
;			} 
;		else	{  /** not EO string yet, copy chr **/ 
	JMP  L_1250
L_1249:
;			chr = pstr[ndx]; 
	LEA  BX, [AutoC1242-11+BP]
	PUSH BX
	LEA  BX, [AutoC1242-2+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1242-13+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;			*ptb++ = chr; 
	LEA  BX, [AutoC1242-4+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	PUSH BX
	LEA  BX, [AutoC1242-11+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;			} 
L_1250:
;		ndx++; 
	LEA  BX, [AutoC1242-13+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;		} 
	JMP  L_1243
L_1245:
;} 
	ADD  SP, AutoC1242
	POP  BP
	RET

AutoC1242	EQU 13
;	str	PTR	CHAR	+4
;	pstr	PTR	CHAR	-2
;	ptb	PTR	CHAR	-4
;	ip	PTR	CHAR	-6
;	op	PTR	CHAR	-8
;	mx	PTR	CHAR	-10
;	chr	VAR	CHAR	-11
;	ndx	VAR	INT	-13

	  [SECTION .dseg]
L_1242	DB "-= String maxed error =-$",0

	  [SECTION .cseg]
; 
;/***-----------------------------------------------***/ 
;/*** dump2cons(fp_); write DTA to console, primitive.*/ 
;dump2cons(fp_) int fp_; 
dump2cons:
	PUSH BP
	SUB  SP, AutoC1251
	MOV  BP, SP

;{	/** change index to _iod address **/ 
;	int *fptr, i, index; 
;	char fbuf[], byteval, *pccb; 
; 
;	pccb = _iod[fp_]; /** log address of CCB fcb **/ 
	LEA  BX, [AutoC1251-11+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	LEA  BX, [AutoC1251+4+BP]
	MOV  BX, [BX]
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	fbuf = &pccb[FBUFFER]; 
	LEA  BX, [AutoC1251-8+BP]
	PUSH BX
	LEA  BX, [AutoC1251-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +44
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	i = 128; 
	LEA  BX, [AutoC1251-4+BP]
	PUSH BX
	MOV  BX, +128
	POP  DI
	MOV  Word [DI], BX
;	index = 0; 
	LEA  BX, [AutoC1251-6+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
;	while (i) 
L_1252:
	LEA  BX, [AutoC1251-4+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1253
	JMP  L_1254
L_1253:
;		{ 
;		byteval = fbuf[index++]; 
	LEA  BX, [AutoC1251-9+BP]
	PUSH BX
	LEA  BX, [AutoC1251-8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1251-6+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
;		if (byteval == EOFCHR) break; 
	LEA  BX, [AutoC1251-9+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +26
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1255
	JMP  L_1256
L_1255:
	JMP  L_1254
;		if (isnprint (byteval))  
L_1256:
	LEA  BX, [AutoC1251-9+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL isnprint
	ADD  SP, +2
	OR   BX, BX
	JNZ  L_1257
	JMP  L_1258
L_1257:
;			{ /** non printable substitution **/ 
;			putchar('^'); 
	MOV  BX, +94
	PUSH BX
	CALL putchar
	ADD  SP, +2
;			continue; 
	JMP  L_1252
;			} 
;		putchar(byteval); 
L_1258:
	LEA  BX, [AutoC1251-9+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL putchar
	ADD  SP, +2
;		i--; 
	LEA  BX, [AutoC1251-4+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
;		} 
	JMP  L_1252
L_1254:
;	return (index);	 
	LEA  BX, [AutoC1251-6+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1251
	POP  BP
	RET
;} 

AutoC1251	EQU 11
;	fp_	VAR	INT	+4
;	fptr	PTR	INT	-2
;	i	VAR	INT	-4
;	index	VAR	INT	-6
;	fbuf	PTR	CHAR	-8
;	byteval	VAR	CHAR	-9
;	pccb	PTR	CHAR	-11
; 
;/***-----------------------------------------------***/ 
;/** ----------= F I L E   I / O =------------------ **/ 
;/***-----------------------------------------------***/ 
;/*** OS_ := direct OS calls which map to 'C' Fns.  ***/ 
;/***-----------------------------------------------***/ 
;/*** Program Terminate is Fn# 0, but use exit();   ***/ 
;/***-----------------------------------------------***/ 
;/** These minimal file io primitives req'd for sm-c **/ 
;/** int putc(int chr,FILE *fp); ret`chr`ok .else. EOF*/ 
;/** int getc(FILE *fp); ret`nxtchr`ok .else. EOF    **/ 
;/** fopen(name,mode) fclose(fp)			    **/ 
;/***-----------------------------------------------***/ 
;/** File Open 15 | On entry DS:DX := unopened FCB,  **/ 
;/** Ret: int fp_, index of iob structure assigned.  **/ 
;/** search thru CCB's, i.e. File Descriptors, for   **/ 
;/** free descriptor to use. Copy filename and mode  **/ 
;/** to descriptor fields.  OS Call 5 returns NULL if**/ 
;/** either open or create is successful, but fopen()**/ 
;/** returns fp#, or NULL if error opening the file. **/ 
; 
;fopen(filespec, mode) char *filespec, *mode;  
fopen:
	PUSH BP
	SUB  SP, AutoC1259
	MOV  BP, SP

;{ 
;	int result, fpi; 
;	char *ufdesc, *indx, *p_ccb, sval; 
;  /** available slot, first free _iod index is our **/ 
;  /** fp#, return this after further processing    **/ 
;	while (1)  
L_1260:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_1261
	JMP  L_1262
L_1261:
;		{ 
;		fpi = 3; 
	LEA  BX, [AutoC1259-4+BP]
	PUSH BX
	MOV  BX, +3
	POP  DI
	MOV  Word [DI], BX
;		p_ccb = _iod[fpi]; /** infile **/ 
	LEA  BX, [AutoC1259-10+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	LEA  BX, [AutoC1259-4+BP]
	MOV  BX, [BX]
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		sval = p_ccb[FSTATE]; 
	LEA  BX, [AutoC1259-11+BP]
	PUSH BX
	LEA  BX, [AutoC1259-10+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		if ( sval == STATE_FR) {break;} 
	LEA  BX, [AutoC1259-11+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1263
	JMP  L_1264
L_1263:
	JMP  L_1262
; 
;		fpi = 4; 
L_1264:
	LEA  BX, [AutoC1259-4+BP]
	PUSH BX
	MOV  BX, +4
	POP  DI
	MOV  Word [DI], BX
;		p_ccb = _iod[fpi]; /** outfile **/ 
	LEA  BX, [AutoC1259-10+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	LEA  BX, [AutoC1259-4+BP]
	MOV  BX, [BX]
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		sval = p_ccb[FSTATE]; 
	LEA  BX, [AutoC1259-11+BP]
	PUSH BX
	LEA  BX, [AutoC1259-10+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		if ( sval == STATE_FR) {break;} 
	LEA  BX, [AutoC1259-11+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1265
	JMP  L_1266
L_1265:
	JMP  L_1262
; 
;		fpi = 5; 
L_1266:
	LEA  BX, [AutoC1259-4+BP]
	PUSH BX
	MOV  BX, +5
	POP  DI
	MOV  Word [DI], BX
;		p_ccb = _iod[fpi]; /** temp **/ 
	LEA  BX, [AutoC1259-10+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	LEA  BX, [AutoC1259-4+BP]
	MOV  BX, [BX]
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;		sval = p_ccb[FSTATE]; 
	LEA  BX, [AutoC1259-11+BP]
	PUSH BX
	LEA  BX, [AutoC1259-10+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		if ( sval == STATE_FR) {break;} 
	LEA  BX, [AutoC1259-11+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1267
	JMP  L_1268
L_1267:
	JMP  L_1262
;	/** else none of the 3 CCB's are available **/ 
;		sval = STATE_ER; 
L_1268:
	LEA  BX, [AutoC1259-11+BP]
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DI
	MOV  Byte [DI], BL
;		putstr("No Available IOD$"); 
	MOV  BX, L_1259+0
	PUSH BX
	CALL putstr
	ADD  SP, +2
;		NLfn(); 
	CALL NLfn
;		break; 
	JMP  L_1262
;		} 
	JMP  L_1260
L_1262:
;  /** catch error, return null  **/ 
;	if ( sval == STATE_ER ) 
	LEA  BX, [AutoC1259-11+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1269
	JMP  L_1270
L_1269:
;		{ 
;		putstr("fopen STATE_ER error.$"); 
	MOV  BX, L_1259+18
	PUSH BX
	CALL putstr
	ADD  SP, +2
;		NLfn(); 
	CALL NLfn
;		return (NULL); 
	MOV  BX, +0
	ADD  SP, AutoC1259
	POP  BP
	RET
;		} 
;  /** else presumed free descriptor **/ 
;  /** fpi holds index in _iod, which has addr of desc **/ 
;  /** p_ccb holds that addr. Copy it as ufdesc        **/ 
;	ufdesc = p_ccb; 
L_1270:
	LEA  BX, [AutoC1259-6+BP]
	PUSH BX
	LEA  BX, [AutoC1259-10+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;  /** Set FMODE to mode **/ 
;	p_ccb[FMODE] = *mode; 
	LEA  BX, [AutoC1259-10+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1259+4+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;	p_ccb[DRV] = 0; /** current default drive **/ 
	LEA  BX, [AutoC1259-10+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;				/** chg behavior in future version **/ 
; 
;  /** Copy Filefilespec as upper case to FNAME, FTYP **/ 
;	clearfcb(ufdesc); /** overwrite with spaces to clear **/ 
	LEA  BX, [AutoC1259-6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL clearfcb
	ADD  SP, +2
;	p_ccb = &p_ccb[FNAME]; 
	LEA  BX, [AutoC1259-10+BP]
	PUSH BX
	LEA  BX, [AutoC1259-10+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	indx = filespec; 
	LEA  BX, [AutoC1259-8+BP]
	PUSH BX
	LEA  BX, [AutoC1259+6+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	while (1) 
L_1271:
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_1272
	JMP  L_1273
L_1272:
;		{ /** null terminated strings **/ 
;		if (*indx == 0) break; 
	LEA  BX, [AutoC1259-8+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1274
	JMP  L_1275
L_1274:
	JMP  L_1273
;		if (*indx == '.') 
L_1275:
	LEA  BX, [AutoC1259-8+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +46
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1276
	JMP  L_1277
L_1276:
;			{ 
;			p_ccb = &ufdesc[FTYP]; 
	LEA  BX, [AutoC1259-10+BP]
	PUSH BX
	LEA  BX, [AutoC1259-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +9
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;			indx++; 
	LEA  BX, [AutoC1259-8+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;			} 
;		if (*indx)  
L_1277:
	LEA  BX, [AutoC1259-8+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_1278
	JMP  L_1279
L_1278:
;			{ 
;			*p_ccb = toupper(*indx); 
	LEA  BX, [AutoC1259-10+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1259-8+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	CALL toupper
	ADD  SP, +2
	POP  DI
	MOV  Byte [DI], BL
;			p_ccb++; indx++; 
	LEA  BX, [AutoC1259-10+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
	LEA  BX, [AutoC1259-8+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;			} 
;		else break; 
	JMP  L_1280
L_1279:
	JMP  L_1273
L_1280:
;		} 
	JMP  L_1271
L_1273:
; 
;  /** call OS_fo, pass user file descriptor ptr -------------**/ 
;	result = OS_fo(ufdesc); 
	LEA  BX, [AutoC1259-2+BP]
	PUSH BX
	LEA  BX, [AutoC1259-6+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OS_fo
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
; 
;  /** process low level fopen result **/ 
;	if (result == NULL) 
	LEA  BX, [AutoC1259-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1281
	JMP  L_1282
L_1281:
;		{ /** successful open from lower level **/ 
;		  /** conout state information **/ 
;		if (VERBOSE) 
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_1283
	JMP  L_1284
L_1283:
;			{ 
;			putstr("CCB File Buffer assigned.$"); 
	MOV  BX, L_1259+41
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			NLfn(); 
	CALL NLfn
;			putstr ("fopen result reports not null.$"); 
	MOV  BX, L_1259+68
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			NLfn();outdeci(fpi);NLfn(); 
	CALL NLfn
	LEA  BX, [AutoC1259-4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outdeci
	ADD  SP, +2
	CALL NLfn
;			} 
;		return fpi; 
L_1284:
	LEA  BX, [AutoC1259-4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1259
	POP  BP
	RET
; 		} 
;	else 	{ /** unsuccessful open **/ 
	JMP  L_1285
L_1282:
;		if (VERBOSE) 
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_1286
	JMP  L_1287
L_1286:
;			{ 
;			putstr ("fopen result reports null.$"); 
	MOV  BX, L_1259+100
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			NLfn(); 
	CALL NLfn
;			} 
;		return (NULL); 
L_1287:
	MOV  BX, +0
	ADD  SP, AutoC1259
	POP  BP
	RET
;		} 
L_1285:
;} 
	ADD  SP, AutoC1259
	POP  BP
	RET

AutoC1259	EQU 11
;	filespec	PTR	CHAR	+6
;	mode	PTR	CHAR	+4
;	result	VAR	INT	-2
;	fpi	VAR	INT	-4
;	ufdesc	PTR	CHAR	-6
;	indx	PTR	CHAR	-8
;	p_ccb	PTR	CHAR	-10
;	sval	VAR	CHAR	-11

	  [SECTION .dseg]
L_1259	DB "No Available IOD$",0
	DB "fopen STATE_ER error.$",0
	DB "CCB File Buffer assigned.$",0
	DB "fopen result reports not null.$",0
	DB "fopen result reports null.$",0

	  [SECTION .cseg]
; 
;/***-----------------------------------------------***/ 
;/** File Open 15 | On entry DS:DX := unopened FCB,  **/ 
;/** the dir is searched searched for the named file **/ 
;/** and returns AL := FFh if not found, .else. AL:= **/ 
;/** 0, and the entry FCB is filled in, DRV:=current **/ 
;/** drv, Current Block :=0.  OS Call 5 returns NULL **/ 
;/** if either open or create is successful.         **/ 
; 
;OS_fo (ufdesc) char ufdesc[]; 
OS_fo:
	PUSH BP
	SUB  SP, AutoC1288
	MOV  BP, SP

;{ /** User File Descriptor*/ 
;	char cresult, *cbuff; 
;	int iresult, i; 
;	cresult = ufdesc[FMODE]; 
	LEA  BX, [AutoC1288-1+BP]
	PUSH BX
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
; 
;  /** if fmode := read, f must exist for std C **/ 
;	if ((cresult == 'r') | (cresult == 'R')) 
	LEA  BX, [AutoC1288-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +114
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC1288-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +82
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_1289
	JMP  L_1290
L_1289:
;		{ 
;		cresult = OSfn_(OPEN, ufdesc); 
	LEA  BX, [AutoC1288-1+BP]
	PUSH BX
	MOV  BX, +15
	PUSH BX
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
	POP  DI
	MOV  Byte [DI], BL
; 
;	  /** OS Open op searches for f, returns FFh if not found **/ 
;		if (cresult == BAD) 
	LEA  BX, [AutoC1288-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1291
	JMP  L_1292
L_1291:
;			{ 
;			putstr("File Not Found for reading, Error..$"); 
	MOV  BX, L_1288+0
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			NLfn(); 
	CALL NLfn
;			return (BAD); 
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1288
	POP  BP
	RET
;			} 
;		else	{	/** Open Successful **/ 
	JMP  L_1293
L_1292:
;			putstr("File Found and Opened for Reading.$"); 
	MOV  BX, L_1288+37
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			NLfn(); 
	CALL NLfn
;			ufdesc[FSTATE] = STATE_FO; 
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Byte [DI], BL
;		/** assign DTA _and_ seed it from file **/ 
;			cbuff = &ufdesc[FBUFFER]; 
	LEA  BX, [AutoC1288-3+BP]
	PUSH BX
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +44
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;			setdta(cbuff); 
	LEA  BX, [AutoC1288-3+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL setdta
	ADD  SP, +2
;			iresult = OS_sr(ufdesc); 
	LEA  BX, [AutoC1288-5+BP]
	PUSH BX
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OS_sr
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;			if (iresult)	/** 0`ok, 1`EOF **/ 
	LEA  BX, [AutoC1288-5+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1294
	JMP  L_1295
L_1294:
;				{  /** true if EOF, else null returned **/ 
;				ufdesc[FSTATE] = STATE_EF; 
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +8
	POP  DI
	MOV  Byte [DI], BL
;				ufdesc[FBUFNDX] = 0; 
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;				} 
;			else  { 
	JMP  L_1296
L_1295:
;				ufdesc[FBUFNDX] = 0; 
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;				ufdesc[FSTATE] = STATE_DT; 
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Byte [DI], BL
;				} 
L_1296:
;			return (cresult); 
	LEA  BX, [AutoC1288-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	ADD  SP, AutoC1288
	POP  BP
	RET
;			} 
L_1293:
;		} 
;	  /** if fmode := write, f created or f overwritten for std C **/ 
; 
;	else if ((cresult == 'w') | (cresult == 'W')) 
	JMP  L_1297
L_1290:
	LEA  BX, [AutoC1288-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +119
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC1288-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +87
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_1298
	JMP  L_1299
L_1298:
;		{ /** fcb ptr to unopened fcb, FFh ret if no file, else ret 0 **/ 
;		cresult = OSfn_(OPEN, ufdesc); 
	LEA  BX, [AutoC1288-1+BP]
	PUSH BX
	MOV  BX, +15
	PUSH BX
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
	POP  DI
	MOV  Byte [DI], BL
;	 
;		if (cresult == BAD) 
	LEA  BX, [AutoC1288-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1300
	JMP  L_1301
L_1300:
;			{  /** fille not found in current directory **/ 
;			putstr("File Not Found for writing, Creating..$"); 
	MOV  BX, L_1288+73
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			NLfn(); 
	CALL NLfn
;			cresult = creatf(ufdesc); 
	LEA  BX, [AutoC1288-1+BP]
	PUSH BX
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL creatf
	ADD  SP, +2
	POP  DI
	MOV  Byte [DI], BL
;			if (cresult == BAD) return BAD; 
	LEA  BX, [AutoC1288-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1302
	JMP  L_1303
L_1302:
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1288
	POP  BP
	RET
;			else	{  /** Successful File Create for Writing **/ 
	JMP  L_1304
L_1303:
;				putstr(" -File Created for Writing- $"); 
	MOV  BX, L_1288+113
	PUSH BX
	CALL putstr
	ADD  SP, +2
;				NLfn(); 
	CALL NLfn
;				ufdesc[FSTATE] = STATE_FO; 
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Byte [DI], BL
;				  /** assign DTA _and_ seed it with ^Z **/ 
;				cbuff = &ufdesc[FBUFFER]; 
	LEA  BX, [AutoC1288-3+BP]
	PUSH BX
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +44
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;				setdta(cbuff); 
	LEA  BX, [AutoC1288-3+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL setdta
	ADD  SP, +2
;				i=127; 
	LEA  BX, [AutoC1288-7+BP]
	PUSH BX
	MOV  BX, +127
	POP  DI
	MOV  Word [DI], BX
;				while (i) cbuff[i--] = CTRLZ; 
L_1305:
	LEA  BX, [AutoC1288-7+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1306
	JMP  L_1307
L_1306:
	LEA  BX, [AutoC1288-3+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1288-7+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +26
	POP  DI
	MOV  Byte [DI], BL
	JMP  L_1305
L_1307:
;				cbuff[i] = CTRLZ; /** position index 0 **/ 
	LEA  BX, [AutoC1288-3+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1288-7+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +26
	POP  DI
	MOV  Byte [DI], BL
;				return (NULL); 
	MOV  BX, +0
	ADD  SP, AutoC1288
	POP  BP
	RET
;				} 
L_1304:
;			} 
;		else	{  /** File Found and Successfully Opened for Writing. **/ 
	JMP  L_1308
L_1301:
;		  /** Note that file position is at the beginning of the file. **/ 
;		  /** seed buffer with ctl-z, eof marker **/ 
;			i=127; 
	LEA  BX, [AutoC1288-7+BP]
	PUSH BX
	MOV  BX, +127
	POP  DI
	MOV  Word [DI], BX
;			cbuff = &ufdesc[FBUFFER]; 
	LEA  BX, [AutoC1288-3+BP]
	PUSH BX
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +44
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;			while (i) cbuff[i--] = CTRLZ; 
L_1309:
	LEA  BX, [AutoC1288-7+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1310
	JMP  L_1311
L_1310:
	LEA  BX, [AutoC1288-3+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1288-7+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +26
	POP  DI
	MOV  Byte [DI], BL
	JMP  L_1309
L_1311:
;			cbuff[i] = CTRLZ; /** position index 0 **/ 
	LEA  BX, [AutoC1288-3+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1288-7+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +26
	POP  DI
	MOV  Byte [DI], BL
;			ufdesc[FSTATE] = STATE_FO; 
	LEA  BX, [AutoC1288+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Byte [DI], BL
;			return (cresult); 
	LEA  BX, [AutoC1288-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	ADD  SP, AutoC1288
	POP  BP
	RET
;			} 
L_1308:
;		} 
;  /** else some major error **/ 
;	putstr(" -Major FMODE error- $"); 
L_1299:
L_1297:
	MOV  BX, L_1288+143
	PUSH BX
	CALL putstr
	ADD  SP, +2
;	return BAD; 
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1288
	POP  BP
	RET
;} 

AutoC1288	EQU 7
;	ufdesc	PTR	CHAR	+4
;	cresult	VAR	CHAR	-1
;	cbuff	PTR	CHAR	-3
;	iresult	VAR	INT	-5
;	i	VAR	INT	-7

	  [SECTION .dseg]
L_1288	DB "File Not Found for reading, Error..$",0
	DB "File Found and Opened for Reading.$",0
	DB "File Not Found for writing, Creating..$",0
	DB " -File Created for Writing- $",0
	DB " -Major FMODE error- $",0

	  [SECTION .cseg]
; 
;/***-----------------------------------------------***/ 
;/** File Close 16 | Req'd to update dir info. DS:DX **/ 
;/*** fclose() ret NULL if successful, else nz err  ***/ 
;/*** Call 5 ret FFh, BAD, means err, NULL is ok    ***/ 
; 
;fclose(fp_) int fp_;  
fclose:
	PUSH BP
	SUB  SP, AutoC1312
	MOV  BP, SP

;{ 
;	int *fptr, result; 
;  /** don't close standard files **/ 
;	if ((fp_==stdin)|(fp_==stdout)|(fp_==stderr)) return NULL; 
	LEA  BX, [AutoC1312+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC1312+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	PUSH BX
	LEA  BX, [AutoC1312+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +2
	POP  DX
	CALL cceq
	POP  DX
	OR   BX, DX
	OR   BX, BX
	JNZ  L_1313
	JMP  L_1314
L_1313:
	MOV  BX, +0
	ADD  SP, AutoC1312
	POP  BP
	RET
;  /** convert fp_ index to CCB ptr, then call lower level **/ 
;	fptr = _iod[fp_]; 
L_1314:
	LEA  BX, [AutoC1312-2+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	LEA  BX, [AutoC1312+4+BP]
	MOV  BX, [BX]
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	result = OS_fc(fptr); 
	LEA  BX, [AutoC1312-4+BP]
	PUSH BX
	LEA  BX, [AutoC1312-2+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OS_fc
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;	if (VERBOSE) 
	MOV  BX, +1
	OR   BX, BX
	JNZ  L_1315
	JMP  L_1316
L_1315:
;		{ 
;		if (result == NULL) 
	LEA  BX, [AutoC1312-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1317
	JMP  L_1318
L_1317:
;			{ 
;			putstr ("fclose result reports null, success.$"); 
	MOV  BX, L_1312+0
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			NLfn(); 
	CALL NLfn
;			} 
;		else	{ 
	JMP  L_1319
L_1318:
;			putstr ("fclose result reports not null, fail.$"); 
	MOV  BX, L_1312+38
	PUSH BX
	CALL putstr
	ADD  SP, +2
;			NLfn();outdeci(fp_);NLfn(); 
	CALL NLfn
	LEA  BX, [AutoC1312+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL outdeci
	ADD  SP, +2
	CALL NLfn
;			} 
L_1319:
;		} 
;	return result; 
L_1316:
	LEA  BX, [AutoC1312-4+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1312
	POP  BP
	RET
;} 

AutoC1312	EQU 4
;	fp_	VAR	INT	+4
;	fptr	PTR	INT	-2
;	result	VAR	INT	-4

	  [SECTION .dseg]
L_1312	DB "fclose result reports null, success.$",0
	DB "fclose result reports not null, fail.$",0

	  [SECTION .cseg]
; 
;/***-----------------------------------------------***/ 
;/** File Close 16 | Req'd to update dir info. DS:DX **/ 
;/** := Close FCB, AL:=0 means ok, AL:=FFh means     **/ 
;/** error. (BAD).                                   **/ 
;/** at exit FCB must appear as unopened, clear FMODE */ 
;/**  FSTATE **/ 
; 
;OS_fc(ufdesc) char ufdesc[]; /** User File Descriptor*/ 
OS_fc:
	PUSH BP
	SUB  SP, AutoC1320
	MOV  BP, SP

;{ 
;	int result,cnt,idx; 
;	char stflg; 
; 
;  /** note default open read is STATE_FO **/ 
;  /** A Read changes FCB Block Values to current block **/ 
;  /** check for pending write before closing **/ 
;	stflg = ufdesc[FSTATE]; 
	LEA  BX, [AutoC1320-7+BP]
	PUSH BX
	LEA  BX, [AutoC1320+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
; 
;	if (stflg == STATE_PW) flushf(ufdesc); 
	LEA  BX, [AutoC1320-7+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +4
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1321
	JMP  L_1322
L_1321:
	LEA  BX, [AutoC1320+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL flushf
	ADD  SP, +2
;  /** ok, close. **/ 
;  /** successful close returns AL:=0, else FFh err  **/ 
;	result = OSfn_(CLOSE, ufdesc); 
L_1322:
	LEA  BX, [AutoC1320-2+BP]
	PUSH BX
	MOV  BX, +16
	PUSH BX
	LEA  BX, [AutoC1320+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
	POP  DI
	MOV  Word [DI], BX
;	if (result == NULL) 
	LEA  BX, [AutoC1320-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1323
	JMP  L_1324
L_1323:
;		{ 
;		putstr ("OS_fc result reports null, success.$"); 
	MOV  BX, L_1320+0
	PUSH BX
	CALL putstr
	ADD  SP, +2
;		NLfn(); 
	CALL NLfn
;		} 
;	else	{ 
	JMP  L_1325
L_1324:
;		putstr ("OS_fc result reports non-null, error.$"); 
	MOV  BX, L_1320+37
	PUSH BX
	CALL putstr
	ADD  SP, +2
;		NLfn(); 
	CALL NLfn
;		} 
L_1325:
;  /** Clear CCB, Free FMODE, FSTATE, fn **/ 
; 
;	ufdesc[FMODE] = 0; 
	LEA  BX, [AutoC1320+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;	ufdesc[FSTATE] = ufdesc[DRV] = 0; 
	LEA  BX, [AutoC1320+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1320+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
	POP  DI
	MOV  Byte [DI], BL
;/***	cnt = 171; idx = 0; while (cnt--) { ufdesc[idx++] = 0; } **/ 
;  /** Return reported result, note we clear CCB to **/ 
;  /** new, even on error. **/ 
;	if (result == BAD) return BAD; 
	LEA  BX, [AutoC1320-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1326
	JMP  L_1327
L_1326:
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1320
	POP  BP
	RET
;	else return NULL; 
	JMP  L_1328
L_1327:
	MOV  BX, +0
	ADD  SP, AutoC1320
	POP  BP
	RET
L_1328:
;} 
	ADD  SP, AutoC1320
	POP  BP
	RET

AutoC1320	EQU 7
;	ufdesc	PTR	CHAR	+4
;	result	VAR	INT	-2
;	cnt	VAR	INT	-4
;	idx	VAR	INT	-6
;	stflg	VAR	CHAR	-7

	  [SECTION .dseg]
L_1320	DB "OS_fc result reports null, success.$",0
	DB "OS_fc result reports non-null, error.$",0

	  [SECTION .cseg]
; 
;/***--- Write Record according to current blk/rec  ***/ 
;/***--- settings in fcb                            ***/ 
;wr_rec() 
wr_rec:
	PUSH BP
	SUB  SP, AutoC1329
	MOV  BP, SP

;{ 
;} 
	POP  BP
	RET

AutoC1329	EQU 0
; 
;/***-----------------------------------------------***/ 
;/** int getc(FILE *fp); ret`nxtchr`ok .else. EOF    **/ 
;/**  init is fp_ index into _iob                    **/ 
; 
;getc(unit) int unit; 
getc:
	PUSH BP
	SUB  SP, AutoC1330
	MOV  BP, SP

;{ 
;	int ichr; 
;  /** fetch ascii character from file and return it **/ 
;	ichr = rd_ubuff(unit); 
	LEA  BX, [AutoC1330-2+BP]
	PUSH BX
	LEA  BX, [AutoC1330+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL rd_ubuff
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;	if (ichr == EOF) return (EOF); 
	LEA  BX, [AutoC1330-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1331
	JMP  L_1332
L_1331:
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1330
	POP  BP
	RET
;	return (ichr & 127); 
L_1332:
	LEA  BX, [AutoC1330-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +127
	POP  DX
	AND  BX, DX
	ADD  SP, AutoC1330
	POP  BP
	RET
;} 

AutoC1330	EQU 2
;	unit	VAR	INT	+4
;	ichr	VAR	INT	-2
;/***-----------------------------------------------***/ 
;/** int puts(char *string); ret`0`ok .else. `NZ`err **/ 
;/**  takes a pointer value to target string, decom- **/ 
;/**  pose targets' characters and pass each one to  **/ 
;/**  putc() until NULL in string. CONOUT.           **/ 
; 
;/***-----------------------------------------------***/ 
;/** int fputs(char *string, FILE *fp);             ***/ 
;/**  ret`0`ok .else. `NZ`err                        **/ 
;/**  takes a pointer value to target string, decom- **/ 
;/**  pose targets' characters and pass each one to  **/ 
;/**  putc() until NULL in string.  Does not append  **/ 
;/**  the new-line character to the end of the string**/ 
;/** Target string is C string, null terminated.     **/ 
; 
;fputs(str,fp_) char str[]; int fp_; 
fputs:
	PUSH BP
	SUB  SP, AutoC1333
	MOV  BP, SP

;{ 
;	char chr; int i; 
; 
;	i=0; chr = str[0]; 
	LEA  BX, [AutoC1333-3+BP]
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Word [DI], BX
	LEA  BX, [AutoC1333-1+BP]
	PUSH BX
	LEA  BX, [AutoC1333+6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;	if (chr == 0) return BAD; 
	LEA  BX, [AutoC1333-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +0
	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 (chr) 
L_1335:
L_1336:
	LEA  BX, [AutoC1333-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_1337
	JMP  L_1338
L_1337:
;		{ 
;		putc(chr,fp_); 
	LEA  BX, [AutoC1333-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	LEA  BX, [AutoC1333+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL putc
	ADD  SP, +4
;		chr = str[++i]; /** read chr from ds:str **/ 
	LEA  BX, [AutoC1333-1+BP]
	PUSH BX
	LEA  BX, [AutoC1333+6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1333-3+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
;		} 
	JMP  L_1336
L_1338:
;} 
	ADD  SP, AutoC1333
	POP  BP
	RET

AutoC1333	EQU 3
;	str	PTR	CHAR	+6
;	fp_	VAR	INT	+4
;	chr	VAR	CHAR	-1
;	i	VAR	INT	-3
; 
;/***-----------------------------------------------***/ 
;/** int putc(int chr,FILE *fp); ret`chr`ok .else. EOF*/ 
;/** note: only retun EOF on File Error, ret null or **/ 
;/** chr only.  (echo back chr means success)	    **/ 
;/** _get ptr to CCB; //DTA is CCB[FBUFFER]; putc to **/ 
;/**  //[FBUFFER]+[FBUFNDX];                         **/ 
;/** _get FBUFNDX,				    **/ 
;/** .if. == 0, set FSTATE == STATE_PW		    **/ 
;/** .if. == 128, flush buffer to file, set FBUFNDX==0*/ 
;/**      set FSTATE == STATE_DT;		    **/ 
;/** .else. place chr to FBUFNDX and incr FBUFNDX    **/ 
;/** NOTE: small-c will close outfile if putc rets<=0**/ 
; 
;putc(chr,fp_) char chr; int fp_; 
putc:
	PUSH BP
	SUB  SP, AutoC1339
	MOV  BP, SP

;{ 
;	int *fptr, i, index; 
;	char fbuf[], byteret, *pccb; 
;  /** First off, test for printable character passed **/ 
;  /**  isnprint returns 1 if not printable           **/ 
;  /**	if (isnprint(chr)) return (BAD);	**/ 
; 
;  /** convert fp_ index to CCB ptr **/ 
;	pccb = _iod[fp_]; /** log address of CCB fcb **/ 
	LEA  BX, [AutoC1339-11+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	LEA  BX, [AutoC1339+4+BP]
	MOV  BX, [BX]
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	fbuf = &pccb[FBUFFER]; /** get buffer location **/ 
	LEA  BX, [AutoC1339-8+BP]
	PUSH BX
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +44
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	setdta(fbuf); /** indicate current DTA for write **/ 
	LEA  BX, [AutoC1339-8+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL setdta
	ADD  SP, +2
;	index = pccb[FBUFNDX]; 
	LEA  BX, [AutoC1339-6+BP]
	PUSH BX
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
; 
;  /** put char to buffer **/ 
;	fbuf = &pccb[FBUFFER]; /** get buffer location **/ 
	LEA  BX, [AutoC1339-8+BP]
	PUSH BX
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +44
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	fbuf = fbuf + index; /** base + index **/ 
	LEA  BX, [AutoC1339-8+BP]
	PUSH BX
	LEA  BX, [AutoC1339-8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1339-6+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	*fbuf = chr; /** chr placed into current buffer **/ 
	LEA  BX, [AutoC1339-8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1339+6+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Byte [DI], BL
; 
;	if (index == 0) pccb[FSTATE] = STATE_PW; 
	LEA  BX, [AutoC1339-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1340
	JMP  L_1341
L_1340:
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +4
	POP  DI
	MOV  Byte [DI], BL
; 
;  /** ck if index is maxed, if so wr buffer and reset index **/ 
;	if (index == 127) /** maxed, signed byte compare **/ 
L_1341:
	LEA  BX, [AutoC1339-6+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +127
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1342
	JMP  L_1343
L_1342:
;		{ /** flushf full buffer **/ 
;		byteret = flushf(pccb); 
	LEA  BX, [AutoC1339-9+BP]
	PUSH BX
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL flushf
	ADD  SP, +2
	POP  DI
	MOV  Byte [DI], BL
;		if (byteret)  /** 0`ok .else. err **/ 
	LEA  BX, [AutoC1339-9+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_1344
	JMP  L_1345
L_1344:
;			{ /** error state **/ 
;			pccb[FSTATE] = STATE_ER; 
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DI
	MOV  Byte [DI], BL
;			return BAD; 
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1339
	POP  BP
	RET
;			} 
;		else	{ /** flushed ok, purge buff upd index **/ 
	JMP  L_1346
L_1345:
;			fbuf = &pccb[FBUFFER]; /** reset to begin **/ 
	LEA  BX, [AutoC1339-8+BP]
	PUSH BX
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +44
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;		 /** fill buffer with CTRLZ, EOF **/ 
;			i=127; 
	LEA  BX, [AutoC1339-4+BP]
	PUSH BX
	MOV  BX, +127
	POP  DI
	MOV  Word [DI], BX
;			while (i) fbuf[i--] = CTRLZ; 
L_1347:
	LEA  BX, [AutoC1339-4+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1348
	JMP  L_1349
L_1348:
	LEA  BX, [AutoC1339-8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1339-4+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +26
	POP  DI
	MOV  Byte [DI], BL
	JMP  L_1347
L_1349:
;			fbuf[i] = CTRLZ; /** position index 0 **/ 
	LEA  BX, [AutoC1339-8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1339-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +26
	POP  DI
	MOV  Byte [DI], BL
;			pccb[FSTATE] = STATE_DT; /** Closeable State **/ 
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Byte [DI], BL
;			pccb[FBUFNDX] = 0; /** reset for next chr **/ 
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			return (chr); 
	LEA  BX, [AutoC1339+6+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	ADD  SP, AutoC1339
	POP  BP
	RET
;			} 
L_1346:
;		} /** sector written, chr or err has been returned **/ 
; 
;  /** update index return chr placed -echo- **/  
;  /**	pccb[FBUFNDX]++; ??questionable	**/ 
;	index++; 
L_1343:
	LEA  BX, [AutoC1339-6+BP]
	PUSH BX
	MOV  BX, [BX]
	INC  BX
	POP  DI
	MOV  Word [DI], BX
	DEC  BX
;	pccb[FBUFNDX] = index; 
	LEA  BX, [AutoC1339-11+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	PUSH BX
	LEA  BX, [AutoC1339-6+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Byte [DI], BL
;	return (chr); 
	LEA  BX, [AutoC1339+6+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	ADD  SP, AutoC1339
	POP  BP
	RET
;} 

AutoC1339	EQU 11
;	chr	VAR	CHAR	+6
;	fp_	VAR	INT	+4
;	fptr	PTR	INT	-2
;	i	VAR	INT	-4
;	index	VAR	INT	-6
;	fbuf	PTR	CHAR	-8
;	byteret	VAR	CHAR	-9
;	pccb	PTR	CHAR	-11
; 
;/***-----------------------------------------------***/ 
;/*** set to spaces the fcb filename,typ		---***/ 
; 
;clearfcb(fcb) char fcb[]; 
clearfcb:
	PUSH BP
	SUB  SP, AutoC1350
	MOV  BP, SP

;{ 
;	int i; 
;	i=11; 
	LEA  BX, [AutoC1350-2+BP]
	PUSH BX
	MOV  BX, +11
	POP  DI
	MOV  Word [DI], BX
;	while (i) fcb[i--] = ' '; 
L_1351:
	LEA  BX, [AutoC1350-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1352
	JMP  L_1353
L_1352:
	LEA  BX, [AutoC1350+4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1350-2+BP]
	PUSH BX
	MOV  BX, [BX]
	DEC  BX
	POP  DI
	MOV  Word [DI], BX
	INC  BX
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +32
	POP  DI
	MOV  Byte [DI], BL
	JMP  L_1351
L_1353:
;} 
	ADD  SP, AutoC1350
	POP  BP
	RET

AutoC1350	EQU 2
;	fcb	PTR	CHAR	+4
;	i	VAR	INT	-2
; 
;/***-----------------------------------------------***/ 
; 
;/***-----------------------------------------------***/ 
;/** Directory First Search 17**/ 
; 
;/***-----------------------------------------------***/ 
;/** Directory Subsequent Search 18 **/ 
; 
;/***-----------------------------------------------***/ 
;/** File Delete 19 **/ 
; 
;/***-----------------------------------------------***/ 
;/** File Sequential Read 20 | On Entry, DS:DX:=FCB **/ 
;/** The 128 byte record indicated by Current Block **/ 
;/** of 16k, and Current Record Fields, is loaded to**/ 
;/** the Disk Transfer Area, DTA, then the record   **/ 
;/** addressed by those fields is incremented. IF EOF*/ 
;/** THEN AL:=1, ELSE AL:=0.                        **/  
; 
;OS_sr(ufcb) char ufcb[]; 
OS_sr:
	PUSH BP
	SUB  SP, AutoC1354
	MOV  BP, SP

;{ 
;	int byte_result; 
; 
;	byte_result = OSfn_(SEQREAD,ufcb); 
	LEA  BX, [AutoC1354-2+BP]
	PUSH BX
	MOV  BX, +20
	PUSH BX
	LEA  BX, [AutoC1354+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
	POP  DI
	MOV  Word [DI], BX
;	if (byte_result) return (EOF); 
	LEA  BX, [AutoC1354-2+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1355
	JMP  L_1356
L_1355:
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1354
	POP  BP
	RET
;	else return (0); 
	JMP  L_1357
L_1356:
	MOV  BX, +0
	ADD  SP, AutoC1354
	POP  BP
	RET
L_1357:
;} 
	ADD  SP, AutoC1354
	POP  BP
	RET

AutoC1354	EQU 2
;	ufcb	PTR	CHAR	+4
;	byte_result	VAR	INT	-2
; 
;/***-----------------------------------------------***/ 
;/** rd_ubuff(int fp) read unit buffer, if last chr  **/ 
;/**  re index and fetch next file record.           **/ 
;/** Called by getc(fp_), so ret chr or EOF          **/ 
;/** Note: short sector files are null padded, catch **/ 
;/** partial buffer data.                            **/ 
;/** 30-Jul-08 05:08:51 PM. OS_sr returns 0 if ok,   **/ 
;/** .else. 1 if EOF. Fixed buffer clipping.         **/ 
; 
;rd_ubuff(fp_) int fp_; 
rd_ubuff:
	PUSH BP
	SUB  SP, AutoC1358
	MOV  BP, SP

;{	/** change fp_ index into _iod address **/ 
;	/** check _iod is read kind, else error **/ 
;	/** chr_ptr points to next_to_read **/ 
;	/** if chr_ptr == 0, ck STATE_EF for eof **/ 
;	/**  if EOF state return EOF **/ 
;	/** if chr_ptr == 127 retrieve chr, do seq **/ 
;	/** read to fill buffer, reindex chr_ptr =0 **/ 
;	/** if read_sq gives EOF, set state STATE_EF, **/ 
;	/** but return last chr to caller. **/ 
; 
;	int chr, index, result; 
;	char *p_ccb, *cdta, *cp; 
; 
;  /** Convert fp_ into addr of UFCB **/ 
;	p_ccb = _iod[fp_]; 
	LEA  BX, [AutoC1358-8+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	LEA  BX, [AutoC1358+4+BP]
	MOV  BX, [BX]
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
; 
;  /** Also need to manage DTA for UFCB **/ 
;	cdta = &p_ccb[FBUFFER]; 
	LEA  BX, [AutoC1358-10+BP]
	PUSH BX
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +44
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	cp = cdta; 
	LEA  BX, [AutoC1358-12+BP]
	PUSH BX
	LEA  BX, [AutoC1358-10+BP]
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	setdta(cdta); 
	LEA  BX, [AutoC1358-10+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL setdta
	ADD  SP, +2
; 
;  /** check _iod is read kind, else error **/ 
;	if (p_ccb[FMODE] != 'r') 
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +114
	POP  DX
	CALL ccne
	OR   BX, BX
	JNZ  L_1359
	JMP  L_1360
L_1359:
;		{ /** mode error **/ 
;		putstr("File Mode Error, not opened for Reading$"); 
	MOV  BX, L_1358+0
	PUSH BX
	CALL putstr
	ADD  SP, +2
;		NLfn(); return (EOF); 
	CALL NLfn
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1358
	POP  BP
	RET
;		} 
;	if ((p_ccb[FSTATE] == STATE_EF) & (p_ccb[FBUFNDX] == 127)) 
L_1360:
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +8
	POP  DX
	CALL cceq
	PUSH BX
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, +127
	POP  DX
	CALL cceq
	POP  DX
	AND  BX, DX
	OR   BX, BX
	JNZ  L_1361
	JMP  L_1362
L_1361:
;		{  /** last low level read returned eof **/ 
;		putstr("-= End of File Reached =- $"); 
	MOV  BX, L_1358+41
	PUSH BX
	CALL putstr
	ADD  SP, +2
;		NLfn(); return (EOF); 
	CALL NLfn
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1358
	POP  BP
	RET
;		} 
;  /** fetch ascii character from file buffer and hold it **/   
;	index = p_ccb[FBUFNDX]; 
L_1362:
	LEA  BX, [AutoC1358-4+BP]
	PUSH BX
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;	cp = cp + index;  /** base + index to chr in buffer **/ 
	LEA  BX, [AutoC1358-12+BP]
	PUSH BX
	LEA  BX, [AutoC1358-12+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1358-4+BP]
	MOV  BX, [BX]
	POP  DX
	ADD  BX, DX
	POP  DI
	MOV  Word [DI], BX
;	chr = *cp;		/** FBUFNDX points to next, got chr **/ 
	LEA  BX, [AutoC1358-2+BP]
	PUSH BX
	LEA  BX, [AutoC1358-12+BP]
	MOV  BX, [BX]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	POP  DI
	MOV  Word [DI], BX
;  /** change null to sp ' ' char, these are text files only. **/ 
;	if (chr == NULL) chr = ' '; 
	LEA  BX, [AutoC1358-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +0
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1363
	JMP  L_1364
L_1363:
	LEA  BX, [AutoC1358-2+BP]
	PUSH BX
	MOV  BX, +32
	POP  DI
	MOV  Word [DI], BX
;  /** !! Convert eol 0Dh,0Ah to 20h,0Ah for small-c parser. !! **/ 
;	if (chr == 13) chr = ' '; 
L_1364:
	LEA  BX, [AutoC1358-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +13
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1365
	JMP  L_1366
L_1365:
	LEA  BX, [AutoC1358-2+BP]
	PUSH BX
	MOV  BX, +32
	POP  DI
	MOV  Word [DI], BX
; 
;  /** Warning: an unprimed buffer could hold nulls, handle this **/ 
;  /** by priming buffer on fopen(fp_,'r') for reading.          **/ 
;  /** Still, should check here for ^Z, eof, marker and ret EOF. **/ 
;  /** But NO, file can be exact byte length without terminators.**/ 
; 
;  /** ck if index is maxed, if so rd buffer and reset index **/ 
;	if (index == 127)      /** maxed, signed byte compare **/ 
L_1366:
	LEA  BX, [AutoC1358-4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +127
	POP  DX
	CALL cceq
	OR   BX, BX
	JNZ  L_1367
	JMP  L_1368
L_1367:
;		{  /** eo buffer read, fetch next from seq read **/ 
;		result = OS_sr(p_ccb); 
	LEA  BX, [AutoC1358-6+BP]
	PUSH BX
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OS_sr
	ADD  SP, +2
	POP  DI
	MOV  Word [DI], BX
;		if (result) 
	LEA  BX, [AutoC1358-6+BP]
	MOV  BX, [BX]
	OR   BX, BX
	JNZ  L_1369
	JMP  L_1370
L_1369:
;			{  /** true if EOF, else null returned **/ 
;			p_ccb[FSTATE] = STATE_EF; 
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +8
	POP  DI
	MOV  Byte [DI], BL
;			p_ccb[FBUFNDX] = 0; 
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			return (chr); 
	LEA  BX, [AutoC1358-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1358
	POP  BP
	RET
;			} 
;		else  { 
	JMP  L_1371
L_1370:
;			p_ccb[FBUFNDX] = 0; 
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +0
	POP  DI
	MOV  Byte [DI], BL
;			p_ccb[FSTATE] = STATE_DT; 
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +2
	POP  DI
	MOV  Byte [DI], BL
;			return (chr); /** added to fix clipping **/ 
	LEA  BX, [AutoC1358-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1358
	POP  BP
	RET
;			} 
L_1371:
;		} 
;	p_ccb[FBUFNDX]++; /** update for next chr fetch from buffer **/ 
L_1368:
	LEA  BX, [AutoC1358-8+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +42
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	INC  BX
	POP  DI
	MOV  Byte [DI], BL
	DEC  BX
;	return (chr); 
	LEA  BX, [AutoC1358-2+BP]
	MOV  BX, [BX]
	ADD  SP, AutoC1358
	POP  BP
	RET
;} 

AutoC1358	EQU 12
;	fp_	VAR	INT	+4
;	chr	VAR	INT	-2
;	index	VAR	INT	-4
;	result	VAR	INT	-6
;	p_ccb	PTR	CHAR	-8
;	cdta	PTR	CHAR	-10
;	cp	PTR	CHAR	-12

	  [SECTION .dseg]
L_1358	DB "File Mode Error, not opened for Reading$",0
	DB "-= End of File Reached =- $",0

	  [SECTION .cseg]
; 
;/***-----------------------------------------------***/ 
;/** File Sequential Write 21 | On Entry, DS:DX:=FCB **/ 
;/** The 128 byte record indicated by Current Block  **/ 
;/** of 16k, and Current Record Fields, is written   **/ 
;/** from the Disk Transfer Area, DTA, to the file   **/ 
;/** then the record address is incremented. IF the  **/ 
;/** disk is too full, AL:=1, ELSE AL:=0.            **/ 
;/**	=	=	=	=	=	=   **/ 
;/*** write buffer, 80h long, to file sequentially. ***/ 
;/***  file fp_ must select open file. DTA must be  ***/ 
;/***  current to proper fp_.                       ***/ 
;/***  calls OSfn_ 21d Sequential Write, which rets ***/ 
;/*** al`0`ok .else. al`1`'disk full error'         ***/ 
;/***  flushf() rets`0`ok .else. `BAD`error         ***/ 
;/***-----------------------------------------------***/ 
; 
;flushf(pccb) char *pccb; 
flushf:
	PUSH BP
	SUB  SP, AutoC1372
	MOV  BP, SP

;{ 
;	char byte_result; 
;	if (pccb[FSTATE] == STATE_PW) 
	LEA  BX, [AutoC1372+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	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_1373
	JMP  L_1374
L_1373:
;		{ 
;		byte_result = OSfn_(SEQWRITE,pccb); 
	LEA  BX, [AutoC1372-1+BP]
	PUSH BX
	MOV  BX, +21
	PUSH BX
	LEA  BX, [AutoC1372+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
	POP  DI
	MOV  Byte [DI], BL
;		if (byte_result) /** indicates err **/ 
	LEA  BX, [AutoC1372-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	OR   BX, BX
	JNZ  L_1375
	JMP  L_1376
L_1375:
;			{ 
;			pccb[FSTATE] = STATE_ER; 
	LEA  BX, [AutoC1372+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	NEG  BX
	POP  DI
	MOV  Byte [DI], BL
;			return (BAD); 
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1372
	POP  BP
	RET
;			} 
;		pccb[FSTATE] = STATE_FO; /** mark as file open **/ 
L_1376:
	LEA  BX, [AutoC1372+4+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +41
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, +1
	POP  DI
	MOV  Byte [DI], BL
;		return byte_result; 
	LEA  BX, [AutoC1372-1+BP]
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	ADD  SP, AutoC1372
	POP  BP
	RET
;		} 
;	else return (BAD); /** no pending write state **/ 
	JMP  L_1377
L_1374:
	MOV  BX, +1
	NEG  BX
	ADD  SP, AutoC1372
	POP  BP
	RET
L_1377:
;} 
	ADD  SP, AutoC1372
	POP  BP
	RET

AutoC1372	EQU 1
;	pccb	PTR	CHAR	+4
;	byte_result	VAR	CHAR	-1
; 
;/***-----------------------------------------------***/ 
;/** File Create 22 Rets: FFh if no dir space else   **/ 
;/**  null == successful create                      **/ 
; 
;creatf(ufcb) char *ufcb; 
creatf:
	PUSH BP
	SUB  SP, AutoC1378
	MOV  BP, SP

;{ 
;	OSfn_(CREATE, ufcb); 
	MOV  BX, +22
	PUSH BX
	LEA  BX, [AutoC1378+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
;} 
	POP  BP
	RET

AutoC1378	EQU 0
;	ufcb	PTR	CHAR	+4
; 
;/***-----------------------------------------------***/ 
;/** ReName File 23 **/ 
;OS_rn() 
OS_rn:
	PUSH BP
	SUB  SP, AutoC1379
	MOV  BP, SP

;{ 
;} 
	POP  BP
	RET

AutoC1379	EQU 0
;/***-----------------------------------------------***/ 
;/** non-existent fn# 24 **/ 
;/***-----------------------------------------------***/ 
;/** Current Default Drive 25, 0`A,1`B,etc. **/ 
; 
;/***-----------------------------------------------***/ 
;/** Set Disk Transfer Addr 26 **/ 
;setdta(dta) int *dta; 
setdta:
	PUSH BP
	SUB  SP, AutoC1380
	MOV  BP, SP

;{  /**  !MUST! Set DTA address prior to File I/O **/ 
;	OSfn_(26,dta); /** Fn Set DTA -> DS:DX **/ 
	MOV  BX, +26
	PUSH BX
	LEA  BX, [AutoC1380+4+BP]
	MOV  BX, [BX]
	PUSH BX
	CALL OSfn_
	ADD  SP, +4
;} 
	POP  BP
	RET

AutoC1380	EQU 0
;	dta	PTR	INT	+4
;/***-----------------------------------------------***/ 
;/** Allocation Table Addr 27 ret: DS:BX, DX := # of..*/ 
;/**  alloc units, AL := # rec per Alloc Unit.       **/ 
;/***-----------------------------------------------***/ 
;/** non-existent fn# 28, 29, 30 **/ 
;/***-----------------------------------------------***/ 
;/** Get Disk Parameter Address 31 ret: DS:BX table  **/ 
;/**  of params for current default disk **/ 
;/***-----------------------------------------------***/ 
;/** non-existent fn# 32 **/ 
;/***-----------------------------------------------***/ 
;/** File Random Read 33 **/ 
;/***-----------------------------------------------***/ 
;/** File Random Write 34 **/ 
;/***-----------------------------------------------***/ 
;/** File Size 35 **/ 
;/***-----------------------------------------------***/ 
;/** File Set Random Record Field 36 **/ 
;/***-----------------------------------------------***/ 
;/** Interrupt Set Vector 37 **/ 
;/***-----------------------------------------------***/ 
;/** Alloc, Create New Program Segment 38 **/ 
;/***-----------------------------------------------***/ 
;/** File Random Block Read 39 **/ 
;/***-----------------------------------------------***/ 
;/** Random Block Write **/ 
; 
;/***-----------------------------------------------***/ 
;/** initialize the fcb structure fields at main    ***/ 
; 
;initfcb() 
initfcb:
	PUSH BP
	SUB  SP, AutoC1381
	MOV  BP, SP

;{	char *cptr, *p_stdin, *p_stdout, *p_stderr; 
;	char *p_infile, *p_outfile, *p_tempfile; 
;	int  cnt; 
; 
;	p_stdin    = "STDIN   IOB"; /** null term.. **/ 
	LEA  BX, [AutoC1381-4+BP]
	PUSH BX
	MOV  BX, L_1381+0
	POP  DI
	MOV  Word [DI], BX
;	p_stdout   = "STDOUT  IOB"; /**  in dseg    **/ 
	LEA  BX, [AutoC1381-6+BP]
	PUSH BX
	MOV  BX, L_1381+12
	POP  DI
	MOV  Word [DI], BX
;	p_stderr   = "STDERR  IOB"; 
	LEA  BX, [AutoC1381-8+BP]
	PUSH BX
	MOV  BX, L_1381+24
	POP  DI
	MOV  Word [DI], BX
;	p_infile   = "INFILE  TXT"; 
	LEA  BX, [AutoC1381-10+BP]
	PUSH BX
	MOV  BX, L_1381+36
	POP  DI
	MOV  Word [DI], BX
;	p_outfile  = "OUTFILE TXT"; 
	LEA  BX, [AutoC1381-12+BP]
	PUSH BX
	MOV  BX, L_1381+48
	POP  DI
	MOV  Word [DI], BX
;	p_tempfile = "TEMP    TXT"; 
	LEA  BX, [AutoC1381-14+BP]
	PUSH BX
	MOV  BX, L_1381+60
	POP  DI
	MOV  Word [DI], BX
;	; 
;	setdta(fdta); /** default catch basin **/ 
	MOV  BX, fdta
	PUSH BX
	CALL setdta
	ADD  SP, +2
;  /** setup _iod[] with addr of f_units **/ 
;	_iod[0] = &f_unit0; 
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, f_unit0
	POP  DI
	MOV  Word [DI], BX
;	_iod[1] = &f_unit1; 
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, f_unit1
	POP  DI
	MOV  Word [DI], BX
;	_iod[2] = &f_unit2; 
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, f_unit2
	POP  DI
	MOV  Word [DI], BX
;	_iod[3] = &f_unit3; 
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +3
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, f_unit3
	POP  DI
	MOV  Word [DI], BX
;	_iod[4] = &f_unit4; 
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +4
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, f_unit4
	POP  DI
	MOV  Word [DI], BX
;	_iod[5] = &f_unit5; 
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +5
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	PUSH BX
	MOV  BX, f_unit5
	POP  DI
	MOV  Word [DI], BX
; 
;  /** copy char const to each f_unit **/ 
;  /***  Also, **/ 
;  /** mark stdin as R, stdout, stderr as W in fmode **/ 
;  /** mark infile, outfile, temp as 'N'ull for now. **/ 
;  /**  open these 3 default files in main if desired**/ 
; 
;	cptr = _iod[0]; 
	LEA  BX, [AutoC1381-2+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +0
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	*cptr[FMODE] = "r"; 
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, L_1381+72
	POP  DI
	MOV  Word [DI], BX
;	copystr(p_stdin, cptr+1); 
	LEA  BX, [AutoC1381-4+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL copystr
	ADD  SP, +4
; 
;	cptr = _iod[1]; 
	LEA  BX, [AutoC1381-2+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +1
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	*cptr[FMODE] = "w"; 
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, L_1381+74
	POP  DI
	MOV  Word [DI], BX
;	copystr(p_stdout, cptr+1); 
	LEA  BX, [AutoC1381-6+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL copystr
	ADD  SP, +4
; 
;	cptr = _iod[2]; 
	LEA  BX, [AutoC1381-2+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +2
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	*cptr[FMODE] = "w"; 
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, L_1381+76
	POP  DI
	MOV  Word [DI], BX
;	copystr(p_stderr, cptr+1); 
	LEA  BX, [AutoC1381-8+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL copystr
	ADD  SP, +4
; 
;	cptr = _iod[3]; 
	LEA  BX, [AutoC1381-2+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +3
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	*cptr[FMODE] = "n"; 
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, L_1381+78
	POP  DI
	MOV  Word [DI], BX
;	copystr(p_infile, cptr+1); 
	LEA  BX, [AutoC1381-10+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL copystr
	ADD  SP, +4
; 
;	cptr = _iod[4]; 
	LEA  BX, [AutoC1381-2+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +4
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	*cptr[FMODE] = "n"; 
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, L_1381+80
	POP  DI
	MOV  Word [DI], BX
;	copystr(p_outfile, cptr+1); 
	LEA  BX, [AutoC1381-12+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL copystr
	ADD  SP, +4
; 
;	cptr = _iod[5]; 
	LEA  BX, [AutoC1381-2+BP]
	PUSH BX
	MOV  BX, _iod
	PUSH BX
	MOV  BX, +5
	SAL  BX, 1
	POP  DX
	ADD  BX, DX
	MOV  BX, [BX]
	POP  DI
	MOV  Word [DI], BX
;	*cptr[FMODE] = "n"; 
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +38
	POP  DX
	ADD  BX, DX
	MOV  AL, [BX]
	CBW
	MOV  BX, AX
	PUSH BX
	MOV  BX, L_1381+82
	POP  DI
	MOV  Word [DI], BX
;	copystr(p_tempfile, cptr+1); 
	LEA  BX, [AutoC1381-14+BP]
	MOV  BX, [BX]
	PUSH BX
	LEA  BX, [AutoC1381-2+BP]
	MOV  BX, [BX]
	PUSH BX
	MOV  BX, +1
	POP  DX
	ADD  BX, DX
	PUSH BX
	CALL copystr
	ADD  SP, +4
; 
;  /*** otherwise, fields are init to null by nasm ***/ 
;} 
	ADD  SP, AutoC1381
	POP  BP
	RET

AutoC1381	EQU 16
;	cptr	PTR	CHAR	-2
;	p_stdin	PTR	CHAR	-4
;	p_stdout	PTR	CHAR	-6
;	p_stderr	PTR	CHAR	-8
;	p_infile	PTR	CHAR	-10
;	p_outfile	PTR	CHAR	-12
;	p_tempfile	PTR	CHAR	-14
;	cnt	VAR	INT	-16

	  [SECTION .dseg]
L_1381	DB "STDIN   IOB",0
	DB "STDOUT  IOB",0
	DB "STDERR  IOB",0
	DB "INFILE  TXT",0
	DB "OUTFILE TXT",0
	DB "TEMP    TXT",0
	DB "r",0
	DB "w",0
	DB "w",0
	DB "n",0
	DB "n",0
	DB "n",0

	  [SECTION .cseg]
; 
; 
;/*****************************************************/ 
;/** Test OSfn_ Call 0005h Interface **/ 
;/*****************************************************/ 
;/* CP/M system call codes                            */ 
;/*     -also-                                        */ 
;/* pcDos .COM Call 5 Interface.                      */ 
; 
; #asm 
BDOS	EQU	5	;; call 5 INTERFACE as CALL BDOS. 
CTRLZ	EQU	26	;end-of-file mark for text files 
TBUFF	EQU	80H	;address of default I/O address 
;;/** OSfn_(Fn#,Value) -> tos 0[ret]2[Value]4[Fn#] **/ 
OSfn_:  ;; small-c, top of stack[ret][Val][Fn] 
	pop  bx   ;; 
	pop  dx   ;; 
	pop  cx   ;; 
	push cx   ;; [Fn#] 
	push dx   ;; [Value] 
	push bx   ;; [ret]  
	call BDOS ;; values passed in registers. 
;; Test AL`CBW returned value... 
	cbw 
	MOV	BX, AX	;; for Prim`BX, Secd`DX. 
	RET       ;; Caller cleans the stack. 
exit:  ;; pause for keypress before return. 
	mov  ah,0 
	int  16h  ;; RomBios wait for keypress. 
;;exit: 
	mov  cx, 0    ;; Call5 quit program for pcDOS, 
	call 5        ;; or CMD.EXE 
;	int  19h  ;; reboot-> enviornment gets control. 
;	ret       ;; (actually, never executed) 
; #endasm ;/***-----------------------------------------------***/ 
;/*****************************************************/ 
;/*       1         2         3         4         5   */ 
;/***-----------------------------------------------***/ 
;/** EO C5LIB.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:	TIMES +1	DW 0
input:	TIMES +1	DW 0
output:	TIMES +1	DW 0
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
_iod:	TIMES +6	DW 0
f_unit0:	TIMES +1	DB 0
fdd_01:	TIMES +171	DB 0
f_unit1:	TIMES +1	DB 0
fdd_02:	TIMES +171	DB 0
f_unit2:	TIMES +1	DB 0
fdd_03:	TIMES +171	DB 0
f_unit3:	TIMES +1	DB 0
fdd_04:	TIMES +171	DB 0
f_unit4:	TIMES +1	DB 0
fdd_05:	TIMES +171	DB 0
f_unit5:	TIMES +1	DB 0
fdd_06:	TIMES +171	DB 0
fdta:	TIMES +128	DB 0
tbuff:	TIMES +257	DB 0
ubuff:	TIMES +257	DB 0
cp:	TIMES +1	DW 0

	  [SECTION .cseg]

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

8:48 PM 4/6/2011