4.3BSD/usr/contrib/sumacc.tar

sumacc/   775      0     12           0  3671443374   5233 sumacc/cc/   775      0     12           0  3540162153   5604 sumacc/cc/as/   775      0     12           0  3540162156   6212 sumacc/cc/as/.netupd_log   444      0     12        7757  3470501535  10454 Sat Apr 28 17:55:42 1984
  created file a68.hdr[coyote], author: mann on Sat Apr  7 02:03:15 1984
Sat Apr 28 17:55:46 1984
  created file as.c[coyote], author: ds on Sat Apr  7 02:01:46 1984
Sat Apr 28 17:55:50 1984
  created file as.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:56:06 1984
  created file as68[coyote], author: ds on Sat Apr  7 02:04:52 1984
Sat Apr 28 17:56:10 1984
  created file as68.1[coyote], author: mogul on Mon Apr  9 23:00:58 1984
Sat Apr 28 17:56:14 1984
  created file cond.c[coyote], author: ds on Sat Apr  7 02:01:57 1984
Sat Apr 28 17:56:19 1984
  created file cond.o[coyote], author: mann on Sat Apr  7 02:04:38 1984
Sat Apr 28 17:56:22 1984
  created file error.c[coyote], author: ds on Sat Apr  7 02:01:59 1984
Sat Apr 28 17:56:26 1984
  created file error.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:56:32 1984
  created file eval.c[coyote], author: ds on Sat Apr  7 02:02:03 1984
Sat Apr 28 17:56:35 1984
  created file eval.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:56:39 1984
  created file init.c[coyote], author: ds on Sat Apr  7 02:02:06 1984
Sat Apr 28 17:56:44 1984
  created file init.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:56:54 1984
  created file ins.c[coyote], author: ds on Sat Apr  7 02:02:13 1984
Sat Apr 28 17:57:02 1984
  created file ins.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:57:06 1984
  created file inst.h[coyote], author: ds on Sat Apr  7 02:02:16 1984
Sat Apr 28 17:57:12 1984
  created file mac.c[coyote], author: ds on Sat Apr  7 02:02:20 1984
Sat Apr 28 17:57:17 1984
  created file mac.h[coyote], author: ds on Sat Apr  7 02:02:22 1984
Sat Apr 28 17:57:22 1984
  created file mac.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:57:24 1984
  created file makefile[coyote], author: ds on Sat Apr  7 02:02:24 1984
Sat Apr 28 17:57:29 1984
  created file mical.h[coyote], author: ds on Sat Apr  7 02:02:25 1984
Sat Apr 28 17:57:33 1984
  created file oper.c[coyote], author: ds on Sat Apr  7 02:02:26 1984
Sat Apr 28 17:57:37 1984
  created file oper.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:57:43 1984
  created file print.c[coyote], author: ds on Sat Apr  7 02:02:28 1984
Sat Apr 28 17:57:48 1984
  created file print.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:57:54 1984
  created file ps.c[coyote], author: ds on Sat Apr  7 02:02:30 1984
Sat Apr 28 17:57:58 1984
  created file ps.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:58:03 1984
  created file ps1.c[coyote], author: ds on Sat Apr  7 02:02:32 1984
Sat Apr 28 17:58:08 1984
  created file ps1.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:58:13 1984
  created file ps2.c[coyote], author: ds on Sat Apr  7 02:02:34 1984
Sat Apr 28 17:58:17 1984
  created file ps2.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:58:20 1984
  created file ps3.c[coyote], author: ds on Sat Apr  7 02:02:37 1984
Sat Apr 28 17:58:23 1984
  created file ps3.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:58:29 1984
  created file random.c[coyote], author: ds on Sat Apr  7 02:02:39 1984
Sat Apr 28 17:58:32 1984
  created file random.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:58:37 1984
  created file rel.c[coyote], author: ds on Sat Apr  7 02:02:40 1984
Sat Apr 28 17:58:42 1984
  created file rel.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:58:48 1984
  created file sdi.c[coyote], author: ds on Sat Apr  7 02:02:42 1984
Sat Apr 28 17:58:54 1984
  created file sdi.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:58:58 1984
  created file spawn.c[coyote], author: ds on Sat Apr  7 02:02:44 1984
Sat Apr 28 17:59:02 1984
  created file spawn.o[coyote], author: ds on Sat Apr  7 02:04:20 1984
Sat Apr 28 17:59:09 1984
  created file sym.c[coyote], author: ds on Sat Apr  7 02:02:48 1984
Sat Apr 28 17:59:13 1984
  created file sym.o[coyote], author: ds on Sat Apr  7 02:04:20 1984
 file oper.c[coyosumacc/cc/as/a68.hdr   444      0     12        1373  3470501535   7374 | Pre-Assembly Code

| The remainder of this file consists of statements that are 
| interpreted before every 68000 program.

| Define Register Names

.defrs	d0, 0., d1, 1., d2, 2., d3, 3.
.defrs  d4, 4., d5, 5., d6, 6., d7, 7.
.defrs	a0, 8., a1, 9., a2, 10., a3, 11.
.defrs	a4, 12., a5, 13., a6, 14., a7, 15.
.defrs	sp, 15., pc, 16., cc, 17., sr, 18., usp, 19.
| Next line is for 68010. --TPM
.defrs  sfc, 20., dfc, 21., vbr 22.

| Set Input and Output Radices

.radix	in, decimal
.radix	out, hex

| Define registers for movem
| D3 means just d3, D3+A2 means d3 and a2, A2-D3 means a1,a0,d7,...,d4,d3

D0	=	/1
D1	=	/2
D2	=	/4
D3	=	/8
D4	=	/10
D5	=	/20
D6	=	/40
D7	=	/80
A0	=	/100
A1	=	/200
A2	=	/400
A3	=	/800
A4	=	/1000
A5	=	/2000
A6	=	/4000
A7	=	/8000
ALL	=	0
hor: ds on Sat Apr  7 02:02:34 1984
Sat Apr 28 17:58:17 1984
  created file ps2.o[coyote], author: ds on Sat Apr  7 02:04:19 1984
Sat Apr 28 17:58:20 1984
  created file ps3.c[coyote], author: ds on Sat Apr  7 02:02:37 1984
Sat Apr 28 17:58:23 1984
  created fisumacc/cc/as/as.c   444      0     12        3555  3470501535   7052 #
/* 
	This is the main loop of the 68000 assembler.
	Written by Mike Patrick, Fall 76.
	Modified by C. Terman 5/79
	Hacked by J. Gula 10/79
*/

#include "mical.h"

/* when Done is nonzero, the assembler is finished. This is the normal means of exit */
int 	Done = 0;

main(argc,argv)
int argc;
char *argv[];
{
	extern struct sym_bkt *Dot_bkt;	/* ptr to symbol bucket for location counter */
	extern struct csect *Cur_csect;	/* ptr to current csect */
	extern int Errors;		/* number of assembly errors */

	if (Init(argc,argv)){		/* Init returns 1 if it is able to open all source files, read the descriptor file,
					   and generally set things up */
		while (Done == 0) {	/* Done becomes 1 when the assembler is finished, on an unexpected eof, or
					   on an assembler error */
			Read_Line();	/* Read the next line, from source files or macro expansions */

			/* Each of the functions in the following nested if statement will return TRUE if it wasn't able to 
			   process the current line entirely */
			if (Cond())	/* Cond handles all conditional pseudo-ops */
			if (Label())	/* Label picks up all label fields, as well as "=" statements */
			if (Pseudo())	/* Pseudo handles all assembler directives, (including .macro), other than .if, .iif, etc */
			if (Macro())	/* Macro recognizes macro calls, and sets up things so that Read_Line will read them */
			if (Instruction())	/* Instruction handles the normal machine instruction statements */
			ByteWord(2);		/* If all else fails, assume the line is an expression, and call the */
						/* .word pseudo-op handler to process it */
			Dot += BC;	/* increment dot by number of machine addresses */
			Cur_csect->dot_cs = Dot_bkt->value_s = Dot;
			if (Dot > Cur_csect->len_cs)	/* Update Dot bucket and Current csect length */
				Cur_csect->len_cs = Dot;

		}
	}

	exit(Errors? -1: 0);	/* if assembly errors, return -1; otherwise 0 */
}

hor: ds on Sat Apr  7 02:02:48 1984
Sat Apr 28 17:59:13 1984
  created file sym.o[coyote], author: ds on Sat Apr  7 02:04:20 1984
 file oper.c[coyosumacc/cc/as/as68.1   444      0     12        1562  3470501536   7143 .TH AS68 1 MC68000
.SU
.SH NAME
as68 \- .a68 -> .b assembler component of cc68
.SH SYNOPSIS
.B as68
[ -godspel ] filename

.SH DESCRIPTION
.I As68
is the 68000 assembler.  
The input is taken from filename.a68, if present, otherwise from filename.
The output is sent to filename.b.
More than one input file can be specified, but only a single output is
generated.
The available flags are
.TP
.B -g
Undefined symbols are automatically declared global for
later resolution by the loader.
.TP
.B -o " filename"
Direct output to filename. 
.TP
.B -d
Print info helpful for debugging the assembler
.TP
.B -s
Put symbol table in list.out (relocatable values only)
.TP
.B -p
Print listing on stdout
.TP
.B -e
External symbols only in output
.TP
.B -l
produces a listing, filename.list
.SH FILES
/usr/sun/a68  /usr/bin/as68 /usr/sun/doc/a68opcodes
.SH SEE ALSO
cc68 (1), pc68(1), ld68 (1).
functions in the following nested if statement will return TRUE if it wasn't able to 
			   process the current line entirely */
			if (Cond()sumacc/cc/as/cond.c   444      0     12       14154  3470501536   7410 #
#include "mical.h"

/*************************************************** 
 *						   *
 * Mical Assembler - conditional assembly handlers *
 *						   *
 ***************************************************/
 
 /*
  * Modified by Bill Nowicki Januray 1982 for V7 C syntax
  */


#define	IF	1
#define IFT	2
#define	IFF	3
#define IFTF	4

/* Ignore flag, set when processing an unsatisfied conditional block */
FLAG	Ignore;


/* Cond_level: level of nested conditional blocks. */
int	Cond_level = 0;

/* Condition and Subcondition block bit vectors. [Sub]Condition[Cond_level] == 
   true whenever current [sub]conditional block is satisfied.
	The outermost conditional block [initial block] is satisfied.
*/
FLAG	Condition[COND_MAX]  = true;		/* sets Condition[0] true */
FLAG 	Subcondition[COND_MAX] = true;	

/* Cond() - check for conditional pseudo-ops.

	If we are currently in an unsatisfied conditional block [Ignore == true],
  then check for the two statements ".endc" (which ends the block) and ".iff"
  (which causes a new conditional block if the current one is unsatisfied).
 */

FLAG Eval_Cond();

Cond() {
	char	S[STR_MAX];
	int	Save;

	Save = Position;			/* save our current position on the input line */
	if ( Get_Token(S)) {			/* Pick up first token */
				/* and call the appropriate routine */

	/* The following five checks should appear before the check of Ignore */
		if (seq(S,".endc")) Endc();
		else if (seq(S,".ift")) Iftf(IFT);
		else if (seq(S,".iff")) Iftf(IFF);	
		else if (seq(S,".iftf")) Iftf(IFTF);
		else if (seq(S,".if")) If();

	/* If Ignore is set, then disregard the line (just print it out); */
		else if (Ignore) {
			Print_Line(P_NONE);	/* print the line */
			return(FALSE); }	/* signifying that processing of the current line is complete */


		else if (seq(S,".iif")) 		/* immediate conditional */
			if (Eval_Cond()) {
				Non_Blank();		/* skip comma */
				if (Line[Position] == ',') Position++;
				return(TRUE); }		 /* it's true, so continue processing this line */
			else {
				Print_Line(P_NONE);	/* it's false, so just print this line, and be done with it */
				return(FALSE); }



	/* No pseudo-op was found, so restore things and continue processing on the line */
		else {	
			Position = Save;
			return(TRUE); }


	/* We found a directive and have processed it */
		return(FALSE);
	}

/* No token was found, so restore Position and continue processing the line */

	Position = Save;
	return(TRUE);
}

Endc() {
	
	if (Cond_level > 0) Cond_level--;			/* decrement condition block level */
	else Prog_Warning(E_ENDC);

	Ignore = Subcondition[Cond_level] ? false : true;	/* Ignore is the opposition of the value of the outer subconditional block */
	Print_Line(P_NONE);
}



/* Enter a new conditional block. Format of statement is:

	.IF	<LOGOP>, <expr>[,<expr>]

  If the <expr> satisfies the the logical operator <LOGOP>, then the 
conditional block is said to have a value of "true", and normal processing
continues. If <expr> does not satisfy <LOGOP>, then the block is said to
have a value of "false", and all normal statements in this block are 
ignored; (exceptions are the subconditional statements .ift, .iff, & .iftf).
	If the block itself is supposed to be ignored, (Ignore == true when
encountering the .if statement), then act as if the expression was not
satisfied.
 */

If(Which) 
int Which;
{

	if (Cond_level >= COND_MAX-1) Prog_Warning(E_LEVELS);
	else {
		Cond_level++;							/* enter a new cond block */
		Condition[Cond_level] = Subcondition[Cond_level] = 
			Ignore? false: Eval_Cond();				/* set the block value accordingly */
		Ignore = Subcondition[Cond_level] ? false : true;		/* set Ignore flag to opposite of block value */
	}
	Print_Line(P_NONE);
}


/* Enter a subconditional block. This is analogous to entering a new
conditional block given that the current conditional block is true (.IFT),
is false (.IFF) or either (.IFTF).
*/
Iftf(Which)
int Which;
{
	switch(Which) {
	case IFT:	Subcondition[Cond_level] = Condition[Cond_level]; break;
	case IFF:	Subcondition[Cond_level] = Condition[Cond_level] ? false : true; break;
	case IFTF:	Subcondition[Cond_level] = true; break;
	default:	Sys_Error("Iftf called with bad option: %d", Which);
	}
	Ignore = Subcondition[Cond_level] ? false : true;	/* set Ignore to oppositie of subconditional block level */

	Print_Line(P_NONE);
}


/* Evaluate a condition of the form

	<LOGOP>, <expr>[,<expr>]
*/

#define	ZERO		01
#define POSITIVE 	02
#define NEGATIVE	04

struct {
	char		*condition;	/* char string representing logical operator */
	char		relation;	/* status of <expr> for condition to be true */

} cond_table[] =  {
	"eq", 	ZERO,
	"z",  	ZERO,
	"ne",	POSITIVE|NEGATIVE,
	"nz",   POSITIVE|NEGATIVE,
	"gt",	POSITIVE,
	"g",	POSITIVE,
	"ge",	POSITIVE|ZERO,
	"lt",	NEGATIVE,
	"l",	NEGATIVE,
	"le",	NEGATIVE|ZERO,
	0
} ;

FLAG Eval_Cond() {

	int	i,V;
	char	S[STR_MAX];
	FLAG	df, def;
	struct sym_bkt *sbp;
	extern struct sym_bkt *Lookup();

	if (Get_Token(S) == 0) {		/* get condition code */
		Prog_Error(E_CONDITION);
		return(false); }

	Lower(S);				/* convert to lower case */
	
	Non_Blank();				/* skip comma */
	if (Line[Position] == ',') Position++;
	Non_Blank();	

	df = false;					/* true if he wants "df" condition */
	if ((df = seq(S,"df")) || seq(S,"ndf")) {	/* check for symbol-defined conditions */
		if (Get_Token(S) == 0) {		/* pick up symbol name */
			Prog_Error(E_SYMBOL);		/* complain if it isn't there */
			return(false); }
		sbp = Lookup(S);			/* get symbol bucket for it */
		def = (sbp->attr_s & S_DEF) ? true : false;	/* set def to true if symbol is defined */
		if (df) return(def);			/* return whatever sense he wants */
		else return(df? false : true);
	}

	Get_Operand(&Operand);				/* evaluate <expr> and load into Operand structure */
	
	V = Operand.value_o;			/* V get operand value */

	for (i = 0; cond_table[i].condition; i++)	/* find condition, and return appropriately */
		if (seq(S,cond_table[i].condition)) 
			if (V > 0 && cond_table[i].relation & POSITIVE) return(true);
			else if (V == 0 && cond_table[i].relation & ZERO) return(true);
			else if (V < 0 && cond_table[i].relation & NEGATIVE) return(true);
			else return(false);

	Prog_Error(E_CONDITION);
	return(false);

}

ound, so restore things and continue processing on the line */
		else {	
			Position = Save;
			return(TRUE); }


	/* We found a directive and have processed it */
		return(FALSE);
	}

/* No token was found, so restore Position and continue processing the line */

	Position = Save;
	return(TRUE);
}

Endc() {
	
	if (Cond_level > 0) Cond_level--;			/* decrement condition block level */
	else Prog_Warninsumacc/cc/as/error.c   444      0     12       12457  3470501536   7622 #include "mical.h"
char *error = "~|^`s.error.c R1.3 on 1/3/80";

/*
 *
 *  Sys_Error(), Prog_Error(), and Describe_Error() for mical assembler 
 *
 */


char *E_messages[] = {
/* 0 */		"<unused>",
/* 1 */		"Missing .end statement",
/* 2 */		"Invalid character",
/* 3 */		"Multiply defined symbol",
/* 4 */		"Symbol storage exceeded",
/* 5 */		"Offset too large",
/* 6 */		"Symbol too long",
/* 7 */		"Undefined symbol",
/* 8 */		"Invalid constant",
/* 9 */		"Invalid term",
/* 10 */	"Invalid operator",
/* 11 */	"Non-relocatable expression",
/* 12 */	"Wrong type for instruction",
/* 13 */	"Invalid operand",
/* 14 */	"Invalid symbol",
/* 15 */	"Invalid assignment",
/* 16 */	"Too many labels",
/* 17 */	"Invalid op-code",
/* 18 */	"Invalid entry point",
/* 19 */	"Invalid string",
/* 20 */	"Bad filename or too many levels",
/* 21 */	"Warning--attribute ignored",
/* 22 */	".Error statement",
/* 23 */	"Too many levels: statement ignored",
/* 24 */	"Invalid condition",
/* 25 */	"Wrong number of operands",
/* 26 */	"Line too long",
/* 27 */	"Invalid register expression",
/* 28 */	"Invalid machine address",
/* 29 */	"Unimplemented directive",
/* 30 */	"Cannot open inserted file",
/* 31 */	"Invalid string",
/* 32 */	"Too many macro arguments",
/* 33 */	"Invalid macro argument",
/* 34 */	"Invalid formal argument",
/* 35 */	"Inappropriate .endc statement; ignored",
/* 36 */	"Warning--relative address may be out of range",
/* 37 */	"Warning--invalid argument; ignored",
/* 38 */	"Invalid instruction vector index",
/* 39 */	"Invalid instruction vector",
/* 40 */	"Invalid macro name",
/* 41 */	"Unable to expand time macro",
/* 42 */	"Bad csect",
/* 43 */	"Odd address",
		0
} ;

int	Errors = 0;		/* Number of errors in this pass */
int	Warnings = 0;		/* Number of warnings on this pass */
int	Err_code = 0;		/* error code. reset each statement */
int	E_pass1;		/* error code for unignored pass 1 error */
int	Err_list[ERR_MAX];	/* list of all error codes in this pass */
int	Err_load = 0;		/* subscript to load into Err_list */
char	E_warn = ' ';		/* 'W' if warning present. reset each stmnt */
extern FILE *listout;		/* use this file for listings *//* Sys_Error is called when a System Error occurs, that is, something is wrong
   with the assembler itself. Each routine of the assembler usually checks the
   arguments passed to it for validity, and calls this routine if its
   parameters are invalid. Explanation is a string suitable for a printf
   control string which explains the error, and Number is the value of the
   offending parameter.  This routine will not return.
*/
Sys_Error(Explanation,Number)
char *Explanation;
{
	fprintf(stderr, "Assembler Error-- ");
	fprintf(stderr, Explanation,Number);
	abort();
}

/* This is called whenever the assembler recognizes an error in the current
statement. It registers the error, so that an error code will be listed with
the statement, and a description of the error will be printed at the end of
the listing */

Prog_Error(code)
register int code;
{
	register int i;

	if (Pass != 2) return;		/* no errors on pass 1 */
	if (E_warn == 'W') {		/* Override a warning */
		E_warn = ' ';		/* by turning off warning flag */
		--Warnings; }		/* decrementing warning count */
				/* but not removing the error description */
	else if (Err_code) return;	/* If there's a previous error (not warning) on this statement, ignore this one */
	Err_code = code;			/* set the current error */
	Errors++;				/* increment error count */
	for (i=0; i < Err_load; i++) if (Err_list[i] == code) return;
	Err_list[Err_load++] = code;
}

/* Prog_Warning registers a warning on a statement. A warning is like an error,
	in that something is probably amiss, but the assembler will still try 
	to generate the .rel file. 
*/

Prog_Warning(code){

	if (Pass != 2) return;
	if (Err_code) return;			/* If an error is already registered, ignore this one */
	Prog_Error(code);				/* Try to register it as an error */
		Errors--;				/* Change error to warning */
		Warnings++;
		E_warn = 'W'; 
}

/* Error_Describe is called at the end of pass 2 to describe the errors
		incurred in the program */

Error_Describe() {
	/* print the trailer info to the error output stream, and also to the
		listing file, if need be */
	extern FLAG O_list;	/* set if listing requested */

	Error_Endprint(stdout);
	if (O_list) Error_Endprint(listout);
	return;
}

/* Error_Endprint actually prints the error descriptions, but sends them
		to outfile, which should be a file descriptor */

Error_Endprint(outfile)
FILE *outfile;
{
	register int i;
	extern char O_debug;				/* debug switch, set from command line */
	if ((Errors == 0) && (Warnings == 0)) return;
	fprintf(outfile, "\n\n\t%d Error(s) and %d Warning(s)\n\t #\tDescription of Error(s)\n\n",Errors,Warnings);
	if (O_debug > 5) fprintf(outfile, "\n    Err_load=%d\n",Err_load);
	for (i=0;i<Err_load;i++)				/* Describe the errors in Err_list */
		fprintf(outfile, "\t%d\t%s\n",Err_list[i],E_messages[Err_list[i]]);
}

/* print a text line so user can see the error */
Print_Error() {
	int fsave;
	extern int Err_code, Line_no;
	extern FLAG O_list;

	if (Err_code == 0) return;	/* nothing to say */
	if (O_list) return;	/* he's going to see it anyway */
	O_list = true;		/* set O_list, so Print_Line will work */
	listout = stdout;	/* print to standard output */
	Print_Line(P_ALL);	/* print the line */
	O_list = false;		/* reset O_list */
}

/	"Inappropriate .endc statement; ignored",
/* 36 */	"Warning--relative address may be out of range",
/* 37 */	"Warning--invalid argument; ignored",
/* 38 */	"Invalid instruction vector index",
/* 39 */	"Invalsumacc/cc/as/eval.c   444      0     12       27551  3470501536   7421 #include "mical.h"
char *eval = "~|^`s.eval.c R1.8 on 1/7/80";

int	In_radix = 10;		/* Default input radix for numbers */
char Operators[] = "+-*/&!^<>%";	/* valid operator characters */

/* Prefixes for temporary radix changes */
char	Prefix_tab[] = { '/', '^', '%', 0 } ;	/* The prefixes */
int	Radix_tab[] = {	16, 8, 2, 0 } ;		/* and radices they represent*/


char 	Escape_tab[] = {	/* character escape table */
		'n', '\n',	/* newline, (linefeed) */
		't', '\t',	/* tab */
		'f', '\014',	/* form feed */
		'r', '\r',	/* return */
		'b', '\b',	/* backspace */
		 0 } ;

/* Evaluate(Arg1):
 *	This routine evaluates expressions by calling Get_Term to evaluate
 * each of the two terms for binary operations, and then performing the 
 * operation on the two terms. Get_Term itself evaluates unary operations.
 * 	Arg1 is a pointer to an oper structure, which Evaluate uses to
 * store the left hand term, and eventually to store the value of then
 * entire expression. Thus, grouping is left to right, with no operator 
 * precedence.
 *	This routine can be called recursively by Get_Term, if Get_Term 
 * encounters an expression in brackets ([]).
 *	Position is moved to the first char after the expression.
 */

Evaluate(Arg1)
register struct oper *Arg1; {
	struct oper Arg2;	/* holds value of right hand term */
	register char Op;			/* operator character */

	Non_Blank();				/* Find the operator */
	if (Op_Delim(Line[Position])) {		/* nil operand is zero */
		Arg1->sym_o = 0;
		Arg1->value_o = 0;
		return(TRUE); }
	if (Get_Term(Arg1) == FALSE) return(FALSE);	/* Pick up the first term */
	Non_Blank();
	for (;(Op_Delim(Op = Line[Position]) == FALSE) && (Op != '('); Non_Blank()) {	/* But don't go past end of operand */
		if ((Op=='>') || (Op=='<')) Op = Line[++Position];	/* so the operators ">>" and "<<" are one char */
		if (member(Op,Operators)) {	/* Did we find an operator? */
			Position++;		/* Yep, so move past it */
			if (Get_Term(&Arg2) == FALSE) return(FALSE);	/* Pick up the second term */
			switch(Op) {		/* And perform the operation */
			    case '+':
				if (Arg1->type_o==t_reg || Arg2.type_o==t_reg) break; /* no arithmetic on registers */
				if (Arg1->sym_o && Arg2.sym_o) break;	/* Both can't be relocatable */
				if (Arg2.sym_o) Arg1->sym_o = Arg2.sym_o;	/* Put the offset into Arg1 */
				Arg1->value_o += Arg2.value_o;
				Arg1->flags_o |= Arg2.flags_o&O_COMPLEX;
				continue;					/* go on to next operator */
			    case '-':
					/* A-B has the following relocatability: (abs = absolute, rel = relocatable)
					    A        B        A-B
					   abs      abs       abs  
					   abs      rel	      <error- nonrelocatable>
					   rel      abs       rel
					   rel      rel       if A and B have offsets in the same csect, then 
							      A-B is absolute, otherwise, an <error>
					*/
				if (Arg1->type_o==t_reg || Arg2.type_o==t_reg) break; /* no arithmetic on registers */
				if (Arg2.sym_o)		/* if B is relocatable, */
					if (Arg1->sym_o)	/* and A is relocatable, */
								/* then make sure both have offsets in the same csect */
					    if (Arg2.sym_o->csect_s != Arg1->sym_o->csect_s) break; /* break into error */
					    else {
						Arg1->sym_o = 0;	/* result is absolute (no offset) */
						Arg1->flags_o |= O_COMPLEX;	/* but not a simple address for sdi's */
					    }
					else break;		/* if B rel., and A is not, then break into relocation error */
				Arg1->value_o -= Arg2.value_o;
				continue;
			    case '*':
				if (Arg1->sym_o || Arg2.sym_o) break;
				Arg1->value_o *= Arg2.value_o;
				continue;
			    case '/':
				if (Arg1->sym_o || Arg2.sym_o) break;
				Arg1->value_o /= Arg2.value_o;
				continue;
			    case '&':
				if (Arg1->sym_o || Arg2.sym_o) break;
				Arg1->value_o &= Arg2.value_o;
				continue;
			    case '!':
				if (Arg1->sym_o || Arg2.sym_o) break;
				Arg1->value_o |= Arg2.value_o;
				continue;
			    case '^':
				if (Arg1->sym_o || Arg2.sym_o) break;
				Arg1->value_o %= Arg2.value_o;
				continue;
			    case '<':
				if (Arg1->sym_o || Arg2.sym_o) break;
				Arg1->value_o <<= Arg2.value_o;
				continue;
			    case '>':
				if (Arg1->sym_o || Arg2.sym_o) break;
				Arg1->value_o >>= Arg2.value_o;
				continue;
			    case '%':
				if (Arg1->sym_o || Arg2.sym_o) break;
				Arg1->value_o = Arg1->value_o<<24 | Arg2.value_o;
				continue;
			    default:
				Sys_Error("Operators[] and Evaluate() incompaitible for: %c\n",Op);
			} /* switch */
			Prog_Error(E_RELOCATE);			/* if break form switch statement, relocation error */
			return(FALSE);
		} /* if operator present */
		Prog_Error(E_OPERATOR);				/* No operator when expected */
		return(FALSE);
	} /* while not end of operand */
	return(TRUE);
}


/* Get_Term(Vp)
 *	Vp is a ptr to an operand value structure. This routine picks up one
 * "term", which is
 *	1)	A symbol, such as a label; or
 *	2)	A constant, which can be prefixed with "/", "^", or "%" for
 *	    hex, octal, or binary representations resp., or suffixed with a
 *	    ".", for decimal input. (Default radix is set in the descriptor
 *	    file); or
 *	3)	A character constant, which is a <"> followed by two non-line
 *	    terminating characters, or a <'> followed by one.
 *		In addition, Get_Term evaluates the three unary operators "+",
 *	    "-", and "~" (logical not); or
 *	5)	An expression enclosed in brackets ([]).
 *	
 */

rev(x)
  {int c, y = 0;
   for (c=0; c<16; c++)
       {y = (y<<1) | (x&1);
	x >>= 1;
       }
   return y;
  }
       

Get_Term(Vp)
register struct oper *Vp;
{
	register char 	S[STR_MAX],	/* working string */
		flag;		/* to save value of Evaluate in a recursive call to it */
	int	i,index,v_length;
	struct sym_bkt	*sbp,*Lookup();
	struct ins_bkt  *ibp,*Get_Ins_Bkt();		/* instruction  bkt ptr */
	extern char O_global;		/* if 1, undefined symbols are ext */
	extern struct csect *Cur_csect;	/* ptr to current csect */
	extern char *lastc();
	extern int	*Insv_ptrs[];	/* instruction vector pointers */
	extern char Mnemonic[];		/* name of last executable instruction assembled */

	Non_Blank();			/* Find first char of term */
	if (Line[Position] == '+') {	/* If its a unary "+" */
		Position++;		/* skip over it */
		return(Get_Term(Vp)); }	/* and just return the next term */
	if (Line[Position] == '-') {	/* If it's a unary "-" */
		Position++;		/* skip over it */
		if (Get_Term(Vp) == FALSE) return(FALSE);  /* and pick up the next term */
		if (Vp->sym_o) {	/* Make sure the negated term is relocatable */
			Prog_Error(E_RELOCATE); }
		Vp->value_o = -(Vp->value_o);	/* and finally do it */
		return(TRUE); }
	if (Line[Position] == '!') {	/* If it's a unary '!', reversal */
		Position++;		/* skip over it */
		if (Get_Term(Vp) == FALSE) return(FALSE);	/* and pick up the next term */
		if (Vp->sym_o) {	/* Make sure the final term is relocatable */
			Prog_Error(E_RELOCATE); }
		Vp->value_o = rev(Vp->value_o);	/* and reverse the term */
		return(TRUE); }
	if (Line[Position] == '~') {	/* If it's a unary '~', logical negation */
		Position++;		/* skip over it */
		if (Get_Term(Vp) == FALSE) return(FALSE);	/* and pick up the next term */
		if (Vp->sym_o) {	/* Make sure the final term is relocatable */
			Prog_Error(E_RELOCATE); }
		Vp->value_o = ~(Vp->value_o);	/* and logically negate the term */
		return(TRUE); }

	if (Get_Token(S)) {		/* Pick up a Token, which can be either */
					/* a symbol, a number with no prefix, or a decimal number (ending with '.') */
		if ((S[0] < '0') || (S[0] > '9') || (*lastc(S) == '$')) {	/* If it's a symbol */
			sbp = Lookup(S);		/* find its symbol bucket */
			if ((sbp->attr_s & S_DEC) == 0)	/* Make sure it's declared */
				if (O_global == 0) Prog_Error(E_SYMDEF);
			if (sbp->attr_s & S_DEF)	/* if it's defined, use its value */
				Vp->value_o = sbp->value_s;
			else {
				if ((sbp->attr_s & S_EXT) == 0)	/* error if not external */
					Prog_Error(E_SYMDEF);
				Vp->value_o = 0;
			}
			if (sbp->attr_s & S_REG) Vp->type_o = t_reg;
			else
			{
				 /* and offset is the symbol itself */
				Vp->sym_o = (sbp->attr_s & S_DEF) &&
				  (sbp->csect_s == 0 || (sbp->csect_s->attr_cs & R_ABS))
				    ? 0 : sbp;
				Vp->type_o = t_normal;
			}
			return(TRUE); }
		return(Num_Value(S,In_radix,Vp)); }	/* Since not a symbol, must be a number */
	for (i=0;Prefix_tab[i]; i++) 		/* Check for number prefixes */
		if (Line[Position] == Prefix_tab[i]) {	/* if  there is one */
			Position++;			/* move past it */
			if (Get_Token(S) == 0) {	/* Pick up the digits */
				Prog_Error(E_CONSTANT); return(FALSE); }
			return(Num_Value(S,Radix_tab[i],Vp)); }		/* and evaluate the digits in the proper radix */
	if (Line[Position] == '\047') return(Char_Value(1,Vp));	/* Check for character constants */
	if (Line[Position] == '\"') return(Char_Value(2,Vp));
	if (Line[Position] == '[') {				/* Check for enclosed expression */
		Position++;				/* Move past '[' */
		flag = Evaluate(Vp);			/* evaluate the expression */
		if (Line[Position] == ']') Position++;	/* Move past ']' */
		else Prog_Error(E_TERM);
		return(flag); }				/* and return with the status from evaluate */

	Prog_Error(E_TERM);
	return(FALSE);
}

/* Num_Value(S,Radix,Vp) interprets the digits in the char string 'S' in the
 * 	radix 'Radix' and stores the value into the oper_value pointed to
 *	by 'Vp'.
 */
Num_Value(S,Radix,Vp)
char *S;
struct oper *Vp; {
	long val;		/* temporary value holder */
	register char *cp;	/* current char in S */
	register int C;		
	extern char *lastc();

	val = 0;		/* start with zero */
	Lower(S);		/* to get lower case hex letters */
	if (*(cp = lastc(S)) == '.') {		/* if it ends with '.' */
		Radix = 10; *cp = 0; }	/* assume decimal radix, and remove '.' */

	if ((*S == '0') && (*(S+1) == 'x')) { 	/* allow 0x hex notation */
		Radix = 16;  S += 2;
	}

	for(cp = S; C = *cp; cp++) {		/* for each digit, */
		/* At the end of this switch statement,
			C will contain the value of the digit,
			or -1 if no valid digit */
		if (C < '0') C = -1;
		else switch (Radix) {
		    case 10:	if (C > '9') C= -1; else C = C - '0';
				break;
		    case 8:	if (C > '7') C= -1; else C = C - '0';
				break;
		    case 2:	if (C > '2') C= -1; else C = C - '0';
				break;
		    case 16:	if ((C >= 'a') && (C <= 'f')) C = C - 'a' + 10;
				else if (C <= '9') C = C - '0';
				else C = -1;
		}
		if (C == -1) {
			Prog_Error(E_CONSTANT); return(FALSE); }
		else val = val * Radix + C;
	}
	Vp->value_o = val;	/* Move value into oper_value */
	Vp->sym_o = 0;		/* and there's no offset */
	Vp->type_o = t_normal;	/* normal operand type */
	return(TRUE);
}

/* Char_Value(N,Vp) reads the next N, (1 or 2), non-newline chars from the
 *	 input Line, and places them in the oper value pointed at by Vp.
 * 	The chars are loaded low byte first.
 */
Char_Value(N,Vp)
struct oper *Vp; {
	register int val,i,C;

	Position++;
	val = 0;
	for (i = 0; (i<N) && (Line[Position] != '\n')
		&& (Line[Position] != '\014'); i++)
	{
		if ((C = Grab_Char()) != -1) val= val<<8 | (C&0177) ;
		else return(FALSE);
	}
	Vp->value_o = val;
	Vp->sym_o = 0;
	return(TRUE);
}

/* Grab_Char() is used for reading chars in character constants and in 
 * character strings. It's main function ins to recognise characters of 
 * the form \c or \nnn where c is a special character and n is an octal
 * digit.
 * 	Returns the value of the character read, or -1 on an error.
 */
Grab_Char() {
	register int i;
	register char *cp,C;

	if ((C = Line[Position]) == '\\') {	/* if escaped character, */
		C = Line[++Position];			/* move past '/' */
		for (cp=Escape_tab; *cp; cp += 2)	/* see if special escape char present */
			if (*cp == C){
			    Position++; return(*(++cp)); }
		for((i=0,C=0); i<3; i++)			/* check for '\nnn' */
		    if (Line[Position] >= '0' && Line[Position] <= '7') {
			C = C*8 + Line[Position] - '0';
			Position++; }
		    else break;
		if (i) return(C);			/* if there were any digits, return the char we calculated */
		C = Line[Position]; }			/* Otherwise, just use whats there */
	if (((C < ' ') || (C > '~')) && (C != '\t')) {	/* Check char for validity */
		Prog_Error(E_BADCHAR); return(-1); }
	Position++;
	return(C);
}

 = (sbp->attr_s & S_DEF) &&
				  (sbp->csect_s == 0 || (sbp->csect_s->attr_cs & R_ABS))
				    ? 0 : sbp;
				Vp->type_o = t_normal;
			}
			return(Tsumacc/cc/as/init.c   444      0     12       21414  3470501536   7425 #include "mical.h"
#include "inst.h"

#ifdef Stanford
#define HEADER "/lib/a68.hdr"
#define ROOT "/usr/sun"
#else Stanford
#include <bootstrap.h>
#define	HEADER	"/include/as.h"
#endif Stanford

#define TRUE	1
#define FALSE	0

char	header[64], Title[STR_MAX];

/* Command line options */
char	O_list = 0;	/* 1 if listing requested */
char	*O_listname = 0;/* name of listing file if -L option is used */
char	O_symtab = 0;	/*1 if symbol table desired */
char	O_debug = 0;	/* >0 if debugging desired */
char	O_ext_only = 0;	/* 1 if external symbols only in .rel file */
char	O_print = 0;	/* 1 if listing printed on terminal */
char	O_global = 0;	/* 1 if undefined symbols are to be made global */
char	O_outfile = 0;	/* 1 if .rel file name is specified by user */

/*
 *
The source stack. Ss_top contains the subscript of the top of
the stack, which then points to the iobuffer of the current input source file 
 *
 */

FILE *Source_stack[SSTACK_MAX+1];
int Ss_top = -1;				/* Source stack top */
int		Pass = 0;			/* initialize Pass. */
char		File_name[STR_MAX];
char		Temp_name[STR_MAX];		/* Name of temporary file to hold source between passes 1 and 2 */
FILE		*Temp_file;			/* Ptr to iobuf of that file */
char		Rel_name[STR_MAX];		/* Name of .rel file */
FILE		*Rel_file;			/* and ptr to it */
FILE		*listout;			/* file to write listings to */
struct sym_bkt	*Dot_bkt ;	/* Ptr to location counter's symbol bucket */

struct op_entry {
	char *op_name;
	int op_number;};

struct op_entry op_codes[] = {	/* List of 68000 op codes */
	"abcd",	i_abcd,
	"addb",	i_addb,
	"addw",	i_addw,
	"addl",	i_addl,
	"addqb",	i_addqb,
	"addqw",	i_addqw,
	"addql",	i_addql,
	"addxb",	i_addxb,
	"addxw",	i_addxw,
	"addxl",	i_addxl,
	"andb",	i_andb,
	"andw",	i_andw,
	"andl",	i_andl,
	"aslb",	i_aslb,
	"aslw",	i_aslw,
	"asll",	i_asll,
	"asrb",	i_asrb,
	"asrw",	i_asrw,
	"asrl",	i_asrl,
	"bcc",	i_bcc,
	"bccs",	i_bccs,
	"bchg",	i_bchg,
	"bclr",	i_bclr,
	"bcs",	i_bcs,
	"bcss",	i_bcss,
	"beq",	i_beq,
	"beqs",	i_beqs,
	"bge",	i_bge,
	"bges",	i_bges,
	"bgt",	i_bgt,
	"bgts",	i_bgts,
	"bhi",	i_bhi,
	"bhis",	i_bhis,
	"ble",	i_ble,
	"bles",	i_bles,
	"bls",	i_bls,
	"blss",	i_blss,
	"blt",	i_blt,
	"blts",	i_blts,
	"bmi",	i_bmi,
	"bmis",	i_bmis,
	"bne",	i_bne,
	"bnes",	i_bnes,
	"bpl",	i_bpl,
	"bpls",	i_bpls,
	"bra",	i_bra,
	"bras",	i_bras,
	"bset",	i_bset,
	"bsr",	i_bsr,
	"bsrs",	i_bsrs,
	"btst",	i_btst,
	"bvc",	i_bvc,
	"bvcs",	i_bvcs,
	"bvs",	i_bvs,
	"bvss",	i_bvss,
	"chk",	i_chk,
	"clrb",	i_clrb,
	"clrw",	i_clrw,
	"clrl",	i_clrl,
	"cmpb",	i_cmpb,
	"cmpw",	i_cmpw,
	"cmpl",	i_cmpl,
	"cmpmb",	i_cmpmb,
	"cmpmw",	i_cmpmw,
	"cmpml",	i_cmpml,
	"dbcc",	i_dbcc,
	"dbcs",	i_dbcs,
	"dbeq",	i_dbeq,
	"dbf",	i_dbf,
	"dbra",	i_dbra,
	"dbge",	i_dbge,
	"dbgt",	i_dbgt,
	"dbhi",	i_dbhi,
	"dble",	i_dble,
	"dbls",	i_dbls,
	"dblt",	i_dblt,
	"dbmi",	i_dbmi,
	"dbne",	i_dbne,
	"dbpl",	i_dbpl,
	"dbt",	i_dbt,
	"dbvc",	i_dbvc,
	"dbvs",	i_dbvs,
	"divs",	i_divs,
	"divu",	i_divu,
	"eorb",	i_eorb,
	"eorw",	i_eorw,
	"eorl",	i_eorl,
	"exg",	i_exg,
	"extw",	i_extw,
	"extl",	i_extl,
	"jbsr", i_jbsr,
	"jcc",	i_jcc,
	"jcs",	i_jcs,
	"jeq",	i_jeq,
	"jge",	i_jge,
	"jgt",	i_jgt,
	"jhi",	i_jhi,
	"jle",	i_jle,
	"jls",	i_jls,
	"jlt",	i_jlt,
	"jmi",	i_jmi,
	"jmp",	i_jmp,
	"jne",	i_jne,
	"jpl",	i_jpl,
	"jra",	i_jra,
	"jsr",	i_jsr,
	"jvc",	i_jvc,
	"jvs",	i_jvs,
	"lea",	i_lea,
	"link",	i_link,
	"lslb",	i_lslb,
	"lslw",	i_lslw,
	"lsll",	i_lsll,
	"lsrb",	i_lsrb,
	"lsrw",	i_lsrw,
	"lsrl",	i_lsrl,
	"movb",	i_movb,
	"movw",	i_movw,
	"movl",	i_movl,
	"movc", i_movc,			/* 68010 TPM */
	"movsb", i_movsb,		/* 68010 TPM */
	"movsw", i_movsw,		/* 68010 TPM */
	"movsl", i_movsl,		/* 68010 TPM */
	"movemw",	i_movemw,
	"moveml",	i_moveml,
	"movepw",	i_movepw,
	"movepl",	i_movepl,
	"moveq",	i_moveq,
	"muls",	i_muls,
	"mulu",	i_mulu,
	"nbcd",	i_nbcd,
	"negb",	i_negb,
	"negw",	i_negw,
	"negl",	i_negl,
	"negxb",	i_negxb,
	"negxw",	i_negxw,
	"negxl",	i_negxl,
	"nop",	i_nop,
	"notb",	i_notb,
	"notw",	i_notw,
	"notl",	i_notl,
	"orb",	i_orb,
	"orw",	i_orw,
	"orl",	i_orl,
	"pea",	i_pea,
	"reset",	i_reset,
	"rolb",	i_rolb,
	"rolw",	i_rolw,
	"roll",	i_roll,
	"rorb",	i_rorb,
	"rorw",	i_rorw,
	"rorl",	i_rorl,
	"roxlb",	i_roxlb,
	"roxlw",	i_roxlw,
	"roxll",	i_roxll,
	"roxrb",	i_roxrb,
	"roxrw",	i_roxrw,
	"roxrl",	i_roxrl,
	"rte",	i_rte,
	"rtr",	i_rtr,
	"rts",	i_rts,
	"sbcd",	i_sbcd,
	"scc",	i_scc,
	"scs",	i_scs,
	"seq",	i_seq,
	"sf",	i_sf,
	"sge",	i_sge,
	"sgt",	i_sgt,
	"shi",	i_shi,
	"sle",	i_sle,
	"sls",	i_sls,
	"slt",	i_slt,
	"smi",	i_smi,
	"sne",	i_sne,
	"spl",	i_spl,
	"st",	i_st,
	"stop",	i_stop,
	"subb",	i_subb,
	"subw",	i_subw,
	"subl",	i_subl,
	"subqb",	i_subqb,
	"subqw",	i_subqw,
	"subql",	i_subql,
	"subxb",	i_subxb,
	"subxw",	i_subxw,
	"subxl",	i_subxl,
	"svc",	i_svc,
	"svs",	i_svs,
	"swap",	i_swap,
	"tas",	i_tas,
	"trap",	i_trap,
	"trapv",	i_trapv,
	"tstb",	i_tstb,
	"tstw",	i_tstw,
	"tstl",	i_tstl,
	"unlk",	i_unlk,
	0 };

/*
 *
 Init is the primary routine of this file. It is called by the top level (main) to process the arguments of the command line.
 *
 */

int canum = 1;			/* command argument number */

Init(argc,argv)
char *argv[];
{
	register char *cp;
	register int i,j;
	FILE *src;	/* ptr to iobufs for source and descriptor files */
	struct sym_bkt *Lookup();
	extern struct csect *Cur_csect;	/* ptr to current csect */

	if (argc < 2 ) {
		printf("usage:	as68 [-godspel] sourcefilename\n"); exit(1);
	}
	Options(argv);			/* get options, leaves argv[canum] */
					/* as the first unoptioned command */
					/* argument, and presumably the source filename */

/* get source file name */

	for (i=0; Title[i]=argv[canum][i]; i++);	/* copy filename */
	Concat(File_name,argv[canum],".s");
	if ((src = fopen(File_name,"r")) == NULL)	/* open source file */
	{
	  Concat(File_name,argv[canum],".a68");
	  if ((src = fopen(File_name,"r")) == NULL)	/* try .a68 extension */
	  {
	    Concat(File_name,argv[canum],"");
	    if ((src = fopen(File_name,"r")) == NULL)	/* try without .s */
	    {
		printf("Can't open source file: %s.s\n",File_name);
		exit(1);
	    }
	  }
	} else canum++;

	Options(argv);
	Push_Source(src);		/* push the input file onto the source stack */

/* Open default header file */
	strcpy (header, ROOT);
	strcat (header, HEADER);
	if ((src = fopen(header,"r")) != NULL) Push_Source(src);
	else printf("Can't open header file %s\n", header );

/* Open temporary output file */
	Concat(Temp_name,Title,".temp");
	if ((Temp_file = fopen(Temp_name,"w")) == NULL)
	{
		printf("Can't create output file: %s\n",Temp_name);
		return(FALSE);
	}

/* Open listing file, if necessary */
	if (O_list)
	{
		char List_name[STR_MAX];
		Concat(List_name, Title, ".list");
		if ((listout = fopen(O_listname?O_listname:List_name, "w"))
		     == NULL)
		{
			printf("Can't create listing file: %s\n", List_name);
			return(FALSE);
		}
	}

/* Check to see if we can open output file */
	if(!O_outfile)
		Concat(Rel_name,Title,".b");
	if ((Rel_file = fopen(Rel_name,"w")) == NULL)
	{	printf("Can't create output file: %s\n",Rel_name);
		return(FALSE);
	}
	fclose(Rel_file);	/* Rel_Header will open properly */

/* Initialize symbols */
	Sym_Init();
	Dot_bkt = Lookup(".");		/* make bucket for location counter */
	Dot_bkt->csect_s = Cur_csect;
	Dot_bkt->attr_s = S_DEC | S_DEF | S_LABEL; 	/* "S_LABEL" so it cant be redefined as a label */
	Init_Macro();			/* initialize macro package */
	d_ins();			/* set up opcode hash table */
	return(TRUE);
}

d_ins()
{
	register struct ins_bkt *insp;
	register int i,save;

	i = 0;
	while (op_codes[i].op_name) {
		insp = (struct ins_bkt *) malloc(sizeof ins_example);	/* allocate ins_bkt */
		insp->text_i = op_codes[i].op_name;	/* pointer to asciz op code */
		insp->code_i = op_codes[i++].op_number;	/* index for dispatching */
		insp->next_i = ins_hash_tab[save = Hash(insp->text_i)];	/* ptr to ins_bkt */
		ins_hash_tab[save] = insp;
	}
	return(TRUE);
}


/* Routine to push a ptr to an iobuffer on the "source stack". The top of the
 * stack points to the buffer of the current source file. src is the io buffer ptr.
 */
Push_Source(src)
FILE *src;
{
	register int top;

	if (++Ss_top >= SSTACK_MAX) 	/* Get stack top, complain if invalid. (will exit) */
		Sys_Error("Source stack overflow: %d",top); 
	Source_stack[Ss_top] = src;
}


/* Reads options on command line. *ap is a ptr to the index of the current argument */
Options(argv)
char **argv;
{
	register char *cp;
	
	while(argv[canum][0] == '-'){
		for (cp = &argv[canum++][1];*cp;cp++) switch(*cp){
			case 'd':	O_debug = 1;
					if (*(cp+1)>='0' && *(cp+1)<='9') 
						O_debug = *(++cp) - '0';
					break;
			case 'p':	O_print = 1; break;
			case 'e':	O_ext_only = 1; break;
			case 'L':	O_listname = argv[canum++];
			case 'l':	O_list = 1;  break;
			case 's':	O_symtab= 1; break;
			case 'g':	O_global = 1; break;
			case 'o':	O_outfile = 1;
					if(argv[canum])
					  Concat(Rel_name, argv[canum++], "");
					break;
			default:	printf("Unknown option  '%c' ignored.\n",*cp);
		}
	}
}

k,
	0 };

/*
 *
 Init is the primary routine of this file. It is called by the top level (main) to process the arguments of the command line.
 *
 */

int canum = 1;			/* command argument number */

Init(argc,argv)
char *argv[];
{
	register chasumacc/cc/as/ins.c   444      0     12      101310  3470501537   7266 /* Mike Nielsen, 3 Dec 81 - bug fix to stop instruction from no operands
 * to one immediate word operand.
 * 
 * Mike Nielsen, 3 Dec 81 - bug fix to coerce clrw sr to movw #0,sr as the
 * former is an illegal instruction.
 *
 * Per Bothner, 30 Jun 82 - the postinc routine (used only by the cmpm
 * instructions) reversed the operands. Fixed it.
 *
 * Tim Mann, 6 April 1984 - Added new 68010 instructions.
 */

#include "mical.h"
#include "inst.h"
char *ins = "~|^`s.ins.c R1.2 on 6/27/80";

#define A 0	/* must be an areg */
#define D 1	/* must be a dreg */

char	Mnemonic[MNEM_MAX];	/* instruction mnemonic of current line */
char	Code_length;		/* Number of bytes in the current instruction*/
int	*WCode = (int *)Code;
struct oper operands[OPERANDS_MAX];	/* where all the operands go */
int	numops;			/* # of operands to the current instruction */


/* functions used in this module */

struct ins_bkt *Get_Ins_Bkt();

/* Instruction  -- 68000 assembler
 * This program is called from the main loop. It checks to see if the
 * operator field is a valid instruction mnemonic. If so, it calls the
 * operand evaluator and generates the machine code for the instrucion.
 * On pass 2 it prints the listing line for the current statement 
 */
Instruction()
{
	register int i;		/* gen purpose index */
	struct ins_bkt *ibp;	/* gen purpose ptr to instruction bucket */
	int save_pos;		/* temp save of Position and Errors */

	save_pos = Position;		/* save current posn on input line */

	if (Get_Token(Mnemonic) == 0)	/* pick up instruction mnemonic */
	 goto noinst;			/* if not there, try something else */
	Lower(Mnemonic);		/* Convert it to lower case */

	if ((ibp = Get_Ins_Bkt(Mnemonic)) == 0)
	 { noinst: Position = save_pos;	/* if no op code, restore Position */
		   return(TRUE);	/* and try for something else */
	 };

	if (Dot&1) Prog_Error(E_ODDADDR);
	Code_length = 2;		/* always at least 2 bytes of code */
	for(i=0;i < CODE_MAX; i++) { Code[i] = 0; }
					/* Clear buffer for generated code */
	numops = Scan_Operand_Field(operands);

	switch (ibp->code_i) {		/* dispatch to handle each inst */

/* instruction classes */
	case i_reset:	no_op(0x4E70); break;
	case i_nop:	no_op(0x4E71); break;
	case i_rte:	no_op(0x4E73); break;
	case i_trapv:	no_op(0x4E76); break;
	case i_rtr:	no_op(0x4E77); break;

	case i_negxb:	one_op(0x4000, B); break;
	case i_negxw:	one_op(0x4040, W); break;
	case i_negxl:	one_op(0x4080, L); break;
	case i_negb:	one_op(0x4400, B); break;
	case i_negw:	one_op(0x4440, W); break;
	case i_negl:	one_op(0x4480, L); break;
	case i_notb:	one_op(0x4600, B); break;
	case i_notw:	one_op(0x4640, W); break;
	case i_notl:	one_op(0x4680, L); break;
	case i_tstb:	one_op(0x4A00, B); break;
	case i_tstw:	one_op(0x4A40, W); break;
	case i_tstl:	one_op(0x4A80, L); break;
	case i_tas:	one_op(0x4AC0, B); break;
	case i_nbcd:	one_op(0x4800, B); break;

	case i_st:	one_op(0x50C0, B); break;
	case i_sf:	one_op(0x51C0, B); break;
	case i_shi:	one_op(0x52C0, B); break;
	case i_sls:	one_op(0x53C0, B); break;
	case i_scc:	one_op(0x54C0, B); break;
	case i_scs:	one_op(0x55C0, B); break;
	case i_sne:	one_op(0x56C0, B); break;
	case i_seq:	one_op(0x57C0, B); break;
	case i_svc:	one_op(0x58C0, B); break;
	case i_svs:	one_op(0x59C0, B); break;
	case i_spl:	one_op(0x5AC0, B); break;
	case i_smi:	one_op(0x5BC0, B); break;
	case i_sge:	one_op(0x5CC0, B); break;
	case i_slt:	one_op(0x5DC0, B); break;
	case i_sgt:	one_op(0x5EC0, B); break;
	case i_sle:	one_op(0x5FC0, B); break;

	case i_clrb:	clr_op(0x4200, B); break;
	case i_clrw:	clr_op(0x4240, W); break;
	case i_clrl:	clr_op(0x4280, L); break;

	case i_pea:	ctrl_op(0x4840); break;
	case i_jmp:	ctrl_op(0x4EC0); break;
	case i_jsr:	ctrl_op(0x4E80); break;

	case i_movb:	move_op(0x1000, B); break;
	case i_movw:	move_op(0x3000, W); break;
	case i_movl:	move_op(0x2000, L); break;

	case i_orb:	two_op(0x8000, 0x0000, B, 0); break;
	case i_orw:	two_op(0x8000, 0x0000, W, 0); break;
	case i_orl:	two_op(0x8000, 0x0000, L, 0); break;
	case i_subb:	two_op(0x9000, 0x0400, B, 0); break;
	case i_subw:	two_op(0x9000, 0x0400, W, 0); break;
	case i_subl:	two_op(0x9000, 0x0400, L, 0); break;
	case i_cmpb:	two_op(0xB000, 0x0C00, B, 0); break;
	case i_cmpw:	two_op(0xB000, 0x0C00, W, 0); break;
	case i_cmpl:	two_op(0xB000, 0x0C00, L, 0); break;
	case i_eorb:	two_op(0xB100, 0x0A00, B, 0); break;
	case i_eorw:	two_op(0xB100, 0x0A00, W, 0); break;
	case i_eorl:	two_op(0xB100, 0x0A00, L, 0); break;
	case i_andb:	two_op(0xC000, 0x0200, B, 0); break;
	case i_andw:	two_op(0xC000, 0x0200, W, 0); break;
	case i_andl:	two_op(0xC000, 0x0200, L, 0); break;
	case i_addb:	two_op(0xD000, 0x0600, B, 0); break;
	case i_addw:	two_op(0xD000, 0x0600, W, 0); break;
	case i_addl:	two_op(0xD000, 0x0600, L, 0); break;

	case i_addqb:	two_op(0x5000, 0x5000, B, 1); break;
	case i_addqw:	two_op(0x5000, 0x5000, W, 1); break;
	case i_addql:	two_op(0x5000, 0x5000, L, 1); break;
	case i_subqb:	two_op(0x5100, 0x5100, B, 1); break;
	case i_subqw:	two_op(0x5100, 0x5100, W, 1); break;
	case i_subql:	two_op(0x5100, 0x5100, L, 1); break;

	case i_jra:	jbrnch(0x6000,0x4EC0); break;
	case i_jhi:	cbrnch(0x6200); break;
	case i_jcc:	cbrnch(0x6400); break;
	case i_jne:	cbrnch(0x6600); break;
	case i_jvc:	cbrnch(0x6800); break;
	case i_jpl:	cbrnch(0x6A00); break;
	case i_jge:	cbrnch(0x6C00); break;
	case i_jgt:	cbrnch(0x6E00); break;
	case i_jbsr:	jbrnch(0x6100,0x4E80); break;
	case i_jls:	cbrnch(0x6300); break;
	case i_jcs:	cbrnch(0x6500); break;
	case i_jeq:	cbrnch(0x6700); break;
	case i_jvs:	cbrnch(0x6900); break;
	case i_jmi:	cbrnch(0x6B00); break;
	case i_jlt:	cbrnch(0x6D00); break;
	case i_jle:	cbrnch(0x6F00); break;

	case i_bra:	branch(0x6000); break;
	case i_bhi:	branch(0x6200); break;
	case i_bcc:	branch(0x6400); break;
	case i_bne:	branch(0x6600); break;
	case i_bvc:	branch(0x6800); break;
	case i_bpl:	branch(0x6A00); break;
	case i_bge:	branch(0x6C00); break;
	case i_bgt:	branch(0x6E00); break;
	case i_bsr:	branch(0x6100); break;
	case i_bls:	branch(0x6300); break;
	case i_bcs:	branch(0x6500); break;
	case i_beq:	branch(0x6700); break;
	case i_bvs:	branch(0x6900); break;
	case i_bmi:	branch(0x6B00); break;
	case i_blt:	branch(0x6D00); break;
	case i_ble:	branch(0x6F00); break;

	case i_bras:	brnchs(0x6000); break;
	case i_bhis:	brnchs(0x6200); break;
	case i_bccs:	brnchs(0x6400); break;
	case i_bnes:	brnchs(0x6600); break;
	case i_bvcs:	brnchs(0x6800); break;
	case i_bpls:	brnchs(0x6A00); break;
	case i_bges:	brnchs(0x6C00); break;
	case i_bgts:	brnchs(0x6E00); break;
	case i_bsrs:	brnchs(0x6100); break;
	case i_blss:	brnchs(0x6300); break;
	case i_bcss:	brnchs(0x6500); break;
	case i_beqs:	brnchs(0x6700); break;
	case i_bvss:	brnchs(0x6900); break;
	case i_bmis:	brnchs(0x6B00); break;
	case i_blts:	brnchs(0x6D00); break;
	case i_bles:	brnchs(0x6F00); break;

	case i_abcd:	regmem(0xC100); break;
	case i_sbcd:	regmem(0x8100); break;
	case i_addxb:	regmem(0xD100); break;
	case i_addxw:	regmem(0xD140);	break;
	case i_addxl:	regmem(0xD180); break;
	case i_subxb:	regmem(0x9100); break;
	case i_subxw:	regmem(0x9140); break;
	case i_subxl:	regmem(0x9180); break;

	case i_asrb:	shift_op(0xE000); break;
	case i_asrw:	shift_op(0xE040); break;
	case i_asrl:	shift_op(0xE080); break;
	case i_aslb:	shift_op(0xE100); break;
	case i_aslw:	shift_op(0xE140); break;
	case i_asll:	shift_op(0xE180); break;
	case i_lsrb:	shift_op(0xE008); break;
	case i_lsrw:	shift_op(0xE048); break;
	case i_lsrl:	shift_op(0xE088); break;
	case i_lslb:	shift_op(0xE108); break;
	case i_lslw:	shift_op(0xE148); break;
	case i_lsll:	shift_op(0xE188); break;
	case i_rorb:	shift_op(0xE018); break;
	case i_rorw:	shift_op(0xE058); break;
	case i_rorl:	shift_op(0xE098); break;
	case i_rolb:	shift_op(0xE118); break;
	case i_rolw:	shift_op(0xE158); break;
	case i_roll:	shift_op(0xE198); break;
	case i_roxrb:	shift_op(0xE010); break;
	case i_roxrw:	shift_op(0xE050); break;
	case i_roxrl:	shift_op(0xE090); break;
	case i_roxlb:	shift_op(0xE110); break;
	case i_roxlw:	shift_op(0xE150); break;
	case i_roxll:	shift_op(0xE190); break;

	case i_swap:	reg_op(0x4840, D); break;
	case i_extw:	reg_op(0x4880, D); break;
	case i_extl:	reg_op(0x48C0, D); break;
	case i_unlk:	reg_op(0x4E58, A); break;

	case i_cmpmb:	postinc(0xB108); break;
	case i_cmpmw:	postinc(0xB148); break;
	case i_cmpml:	postinc(0xB188); break;

	case i_bchg:	bit_op(0x0040); break;
	case i_bclr:	bit_op(0x0080); break;
	case i_bset:	bit_op(0x00C0); break;
	case i_btst:	bit_op(0x0000); break;

	case i_chk:	memreg(0x4180); break;
	case i_divs:	memreg(0x81C0); break;
	case i_divu:	memreg(0x80C0); break;
	case i_muls:	memreg(0xC1C0); break;
	case i_mulu:	memreg(0xC0C0); break;
/* miscellaneous classes */

	case i_dbcc:	regbrnch(0x54C8); break;
	case i_dbcs:	regbrnch(0x55C8); break;
	case i_dbeq:	regbrnch(0x57C8); break;
	case i_dbra:
	case i_dbf:	regbrnch(0x51C8); break;
	case i_dbge:	regbrnch(0x5CC8); break;
	case i_dbgt:	regbrnch(0x5EC8); break;
	case i_dbhi:	regbrnch(0x52C8); break;
	case i_dble:	regbrnch(0x5FC8); break;
	case i_dbls:	regbrnch(0x53C8); break;
	case i_dblt:	regbrnch(0x5DC8); break;
	case i_dbmi:	regbrnch(0x5BC8); break;
	case i_dbne:	regbrnch(0x56C8); break;
	case i_dbpl:	regbrnch(0x5AC8); break;
	case i_dbt:	regbrnch(0x50C8); break;
	case i_dbvc:	regbrnch(0x58C8); break;
	case i_dbvs:	regbrnch(0x59C8); break;

	case i_exg:	exg_op(0xC100); break;

	case i_lea:	addr_op(0x41C0, L); break;

	case i_link:	link_op(0x4E50); break;

	case i_movemw:	movem_op(0x4880); break;
	case i_moveml:	movem_op(0x48C0); break;

	case i_movepw:	movep_op(0x0108); break;
	case i_movepl:	movep_op(0x0148); break;

	case i_movsb:	movs_op(0x0E00, B); break;	/* 68010 TPM */
	case i_movsw:	movs_op(0x0E40, W); break;	/* 68010 TPM */
	case i_movsl:	movs_op(0x0E80, L); break;	/* 68010 TPM */

	case i_movc:	movc_op(0x4E7A); break;		/* 68010 TPM */

	case i_moveq:	moveq(0x7000); break;

	case i_stop:	stop_op(0x4E72); break;

	case i_rts:	rts_op(0x4E74);	break;		/* 68010 TPM */

	case i_trap:	trap(0x4E40); break;

	default:	Prog_Error(E_OPCODE);
	};

	Put_Words(Code,Code_length);	/* output text */

	Print_Line(P_ALL);			/* Print the line */

	BC = Code_length;			/* increment LC */
	return(FALSE);	/* and return false, since no more needs to be done */
}
/*
 * Get_Ins_Bkt(M) returns ptr to instruction bucket for instruction whose name
 *	is M; 0 if no such instruction.
 */
struct ins_bkt *Get_Ins_Bkt(M)
char *M;
{
	register struct ins_bkt *ibp;	/* returned value */

	ibp = ins_hash_tab[Hash(M)];
	while(ibp) {
		if (seq(ibp->text_i,M)) break;
		ibp = ibp->next_i;
	}
	return(ibp);
}

/* move_op - uses two effective addresses */

move_op(opr, size)
{
	register struct oper *op1, *op2;
	int r1, r2;

	op1 = operands;
	op2 = &operands[1];
	r1 = (int)op1->value_o;
	r2 = (int)op2->value_o;

	if (numops != 2) Prog_Error(E_NUMOPS);
	else if (op1->type_o == t_reg && srreg(r1) &&
			data_addr(op2) && alt_addr(op2))
	{
		WCode[0] = 0x40C0;
		eaddr(op2, W);
	}
	else if (op1->type_o == t_reg && ccreg(r1) &&		/*************/ 
			data_addr(op2) && alt_addr(op2))	/*           */
	{							/* 68010 TPM */
		WCode[0] = 0x42C0;				/*           */ 
		eaddr(op2, W);					/*************/
	}
	else if (op2->type_o == t_reg && ccreg(r2) && data_addr(op1))
	{
		WCode[0] = 0x44C0;
		eaddr(op1, W);
	}
	else if (op2->type_o == t_reg && srreg(r2) && data_addr(op1))
	{
		WCode[0] = 0x46C0;
		eaddr(op1, W);
	}
	else if (op1->type_o == t_reg && uspreg(r1))
	{
		if (op2->type_o != t_reg || !areg(r2)) Prog_Error(E_REG);
		WCode[0] = 0x4E68 | (r2 & 07);
	}
	else if (op2->type_o == t_reg && uspreg(r2))
	{
		if (op1->type_o != t_reg || !areg(r1)) Prog_Error(E_REG);
		WCode[0] = 0x4E60 | (r1 & 07);
	}
	else if (adrbyte(op1, size) && data_addr(op2) && alt_addr(op2))
	{
		char reg, mode;
		int source;
		WCode[0] = 0;
		eaddr(op1, size);		/* get source address */
		source = WCode[0];		/* save it */
		WCode[0] = 0;
		eaddr(op2, size);		/* get destination address */
		reg = WCode[0] & 07;
		mode = (WCode[0] >> 3) & 07;
		WCode[0] = opr | (reg << 9) | (mode << 6) | source;
	}
	else if (op2->type_o == t_reg && areg(r2) && size != B)
	{
		WCode[0] = 0x0040|((size==W)?0x3000:0x2000)|((r2 & 07)<<9);
		eaddr(op1, size);
	}
	else
	{
		WCode[0] = 0;
		Prog_Error(E_OPERAND);
	}
}
/* movs_op - uses one effective address and one register (68010 TPM) */

movs_op(opr, size)
{
	register struct oper *op1, *op2;
	int r1, r2;

	op1 = operands;
	op2 = &operands[1];
	r1 = (int)op1->value_o;
	r2 = (int)op2->value_o;

	if (numops != 2) Prog_Error(E_NUMOPS);
	else if (op1->type_o == t_reg && mem_addr(op2) && alt_addr(op2))
	{
	/* First case: moving from a register to memory */
		WCode[0] = opr;
		WCode[1] = (r1<<12) | (1<<11);
	        Code_length = 4;		/* so far */
		eaddr(op2, size);
	}
	else if (op2->type_o == t_reg && mem_addr(op1) && alt_addr(op1))
	{
	/* Second case: moving from memory to a register */
		WCode[0] = opr;
		WCode[1] = r2<<12;
	        Code_length = 4;		/* so far */
		eaddr(op1, size);
	}
	else
	{
		WCode[0] = 0;
		Prog_Error(E_OPERAND);
	}
}
/* movc_op - one ordinary register and one control register (68010 TPM) */

movc_op(opr)
{
	register struct oper *op1, *op2;
	int r1, r2;

	op1 = operands;
	op2 = &operands[1];
	r1 = (int)op1->value_o;
	r2 = (int)op2->value_o;

	if (numops != 2) Prog_Error(E_NUMOPS);
	else if (op1->type_o != t_reg || op2->type_o != t_reg) 
		Prog_Error(E_OPERAND);
	else if ( (areg(r1) || dreg(r1)) )
	{
		WCode[0] = opr | 1;
		WCode[1] = r1<<12;
		if      (sfcreg(r2))	WCode[1] |= 0x000;
		else if (dfcreg(r2)) 	WCode[1] |= 0x001;
		else if (uspreg(r2))	WCode[1] |= 0x800;
		else if (vbrreg(r2))	WCode[1] |= 0x801;
		else Prog_Error(E_OPERAND);
	        Code_length = 4;
	}
	else if ( (areg(r2) || dreg(r2)) )
	{
		WCode[0] = opr;
		WCode[1] = r2<<12;
		if      (sfcreg(r1))	WCode[1] |= 0x000;
		else if (dfcreg(r1)) 	WCode[1] |= 0x001;
		else if (uspreg(r1))	WCode[1] |= 0x800;
		else if (vbrreg(r1))	WCode[1] |= 0x801;
		else Prog_Error(E_OPERAND);
	        Code_length = 4;
	}
	else
	{
		WCode[0] = 0;
		Prog_Error(E_OPERAND);
	}
}
/* two_ops - these are of the forms:
	xxx Dn,<eaddr>
	xxx <eaddr>,Dn
	xxx #yyy,<eaddr>
	xxx <eaddr>,An
 */

two_op(opr, iopr, size, quick)
int opr;	/* normal operand field */
int iopr;	/* operand if immediate */
int size;	/* B, W, or L for the size of the operation */
int quick;	/* 1 => quick immediate instruction */
{
	register struct oper *op1, *op2;
	int r1, r2;
	int flag;	/* use to analyze addressing modes */
	op1 = operands;
	op2 = &operands[1];
	r1 = (int)op1->value_o;
	r2 = (int)op2->value_o;

	WCode[0] = opr | (size << 6);
	if (numops != 2) Prog_Error(E_NUMOPS);
	if (op1->type_o == t_immed)
	{
		WCode[0] = iopr | (size << 6);
		if (quick)
		{	
			if (op1->value_o > 8 || op1->value_o < 0)
				Prog_Error(E_CONSTANT);
			if (op1->value_o == 8) r1 = 0;	/* 0 represents 8 */
			WCode[0] |= (r1 & 07) << 9;
			if (alt_addr(op2)&&adrbyte(op2, size))eaddr(op2,size);
			else Prog_Error(E_OPERAND);
			return;
		}
		else
		{
			switch(opr)
			{
			case 0x0600:	/* add */
			case 0x0400:	/* sub */
			case 0x0C00:	/* cmp */
				flag = data_addr(op2) & alt_addr(op2);
				break;
			default:
				flag = (data_addr(op2) & alt_addr(op2)) |
					sr_addr(op2);
				break;
			}
			if (flag)
			{
				rel_val(op1, (size == L)? L:W); /* bytes to W*/
				eaddr(op2, size);
				return;
			}
		}
	}
	WCode[0] = opr | (size << 6);
	if (op1->type_o == t_reg && dreg((int)op1->value_o))
	{
		switch(opr)
		{
			case 0xB000:	/* cmp */
				flag = 0;	/* not allowed */
				break;
			case 0xB100:	/* eor */
				flag = data_addr(op2) & alt_addr(op2);
				break;
			default:
				flag = mem_addr(op2) & alt_addr(op2);
				break;
		}
		if (flag)
		{
			WCode[0] |= 0400|(((int)op1->value_o&07)<<9);
			eaddr(op2, size);
			return;
		}
	}
	if (op2->type_o == t_reg && dreg((int)op2->value_o))
	{
		switch(opr)
		{
			case 0xB000:	/* cmp */
			case 0xD000:	/* add */
			case 0x9000:	/* sub */
				flag = adrbyte(op1, size);
				break;
			case 0xB100:	/* eor */
				flag = 0;
				break;
			default:
				flag = data_addr(op1);
				break;
		}
		if (flag)
		{
			WCode[0] |= (((int)op2->value_o & 07) << 9);
			eaddr(op1, size);
			return;
		}
	}
	if (op2->type_o == t_reg && areg(r2) && size != B)
	{
		int op_mode;
		op_mode = (size == W)? 0300: 0700;
		switch(opr)
		{
		case 0xD000:	/* add */
		case 0x9000:	/* sub */
		case 0xB000:	/* cmp */
			WCode[0] = opr | ((r2 & 07) << 9) | op_mode;
			eaddr(op1, size);
			return;
		default:	;
		}
	}
	Prog_Error(E_OPERAND);
}
/* one_ops - install opr, check for exactly one operand and compute eaddr */

one_op(opr, size)
{
	register struct oper *op = operands;
	WCode[0] = opr;
	if (numops != 1) Prog_Error(E_NUMOPS);
	if (data_addr(op) && alt_addr(op)) eaddr(op, size);
	else Prog_Error(E_OPERAND);
}

/* clr_op - coerce clrw sr to movw #0,sr otherwise like one_op */
clr_op(opr, size)
{
	register struct oper *op = operands;
	int reg = (int)op->value_o;

	if (numops != 1) Prog_Error(E_NUMOPS);
	else if (op->type_o == t_reg && srreg(reg))
	{
		WCode[0] = 0x46FC;
		WCode[1] = 0;
		Code_length += 2;
	}
	else
	{
		WCode[0] = opr;
		if (data_addr(op) && alt_addr(op)) eaddr(op, size);
		else Prog_Error(E_OPERAND);
	}
}


/* ctrl_op - like one op but requires control addressing modes */

ctrl_op(opr)
{
	register struct oper *op = operands;
	WCode[0] = opr;
	if (numops != 1) Prog_Error(E_NUMOPS);
	if (ctrl_addr(op)) eaddr(op, W);
	else Prog_Error(E_OPERAND);
}


/* no_op(opr) -- places opr in WCode[0].  Ensures there are no operands. */

no_op(opr)
{
	WCode[0] = opr;
	if (numops != 0) Prog_Error(E_NUMOPS);
};

/* branch - process branch offsets */
branch(opr)
{
	long offs = 0;
	register struct oper *opp = operands;
	extern struct csect *Cur_csect;

	WCode[0] = opr;
	if (numops != 1) Prog_Error(E_NUMOPS);
	else if (opp->type_o == t_reg) Prog_Error(E_REG);
	else if (opp->sym_o == 0 || opp->sym_o->csect_s != Cur_csect)
		Prog_Error(E_RELOCATE);
	else
	{
		offs = opp->value_o - (Dot + 2);
		if (offs > 32767L || offs < -32768L)
			Prog_Error(E_OFFSET);
	}
	opp->value_o = (int)offs;
	opp->sym_o = 0;	/* mark as none relocateable expression */
	rel_val(opp, W);
}


brnchs(opr)
{
	long offs = 0;
	register struct oper *opp = operands;
	extern struct csect *Cur_csect;

	WCode[0] = opr;
	if (numops != 1) Prog_Error(E_NUMOPS);
	else if (opp->type_o == t_reg) Prog_Error(E_REG);
	else if (opp->sym_o == 0 || opp->sym_o->csect_s != Cur_csect)
		Prog_Error(E_RELOCATE);
	else
	{
		offs = opp->value_o - (Dot + 2);
		if (offs > 127 || offs < -128)
			Prog_Error(E_OFFSET);
	}
	if (offs != 0)
		WCode[0] |= offs&0377;
	else if (opr != 0x6100)	/* not a bsr, offset 0 => long address, so do a nop instead */
		WCode[0] = 0x4e71;
	else
		Prog_Error(E_OFFSET);
}
/*
 * generate a short or a long branch instruction as appropriate
 * note that:
 *		jra	foo
 *	foo:
 * is translated (by brnchs) to a nop.  If we attempt to
 * optimize this to generate no code, then after resolving
 * the span-dependent instructions, the value of
 * foo is the same as the address of the jra instruction.
 * Therefore, on pass 2, the jra looks like a jra .
 * Presumably, this could be fixed by keeping more information
 * after the sdi's are resolved
 */
jbrnch(opr,lopr)
{
	long offs = 0;
	register struct oper *opp = operands;
	extern struct csect *Cur_csect;

	if (numops != 1) Prog_Error(E_NUMOPS);
	else if (opp->type_o != t_normal)	/* not a direct address */
		ctrl_op(lopr);	/* jmp or jsr as appropriate */
	else {
		offs = opp->value_o - (Dot + 2);
		if (opp->flags_o & O_COMPLEX)	/* not a simple address */
			ctrl_op(lopr);		/* use the long form */
		else if (Pass == 1)
		       Code_length = makesdi(opp, 6, Dot + 2,
			  sdi_bound(2, -128L, 127L,
			    sdi_bound(4, -32768L, 32767L, 0)));
#ifndef Stanford
		else if (opp->sym_o == 0	/* absolute address */
		 || opp->sym_o->csect_s != Cur_csect  /* not in the same csect */
#else Stanford
		else if 
		 (opp->sym_o->csect_s != Cur_csect  /* not in the same csect */
#endif Stanford
		  || offs < -32768L || offs > 32767L)	/* offset too large */
			ctrl_op(lopr);		/* not in the same csect */
		else if (offs > 127 || offs < -128)
			branch(opr);
		else
			brnchs(opr);
	}
}

/*
 * generate a short or a long conditional branch instruction as appropriate
 * see the comments preceding jbrnch
 */
cbrnch(opr)
{
	long offs = 0;
	register struct oper *opp = operands;
	extern struct csect *Cur_csect;

	if (numops != 1) Prog_Error(E_NUMOPS);
	else if (opp->type_o != t_normal)	/* not a direct address */
		baround(opr);
	else {
		offs = opp->value_o - (Dot + 2);
		if (opp->flags_o & O_COMPLEX)	/* not a simple address */
			baround(opr);
		else if (Pass == 1)
			Code_length = makesdi(opp, 6, Dot + 2,
			 sdi_bound(2, -128L, 127L,
			  sdi_bound(4, -32768L, 32767L, 0)));
		else if (opp->sym_o == 0	/* absolute address */
		 || opp->sym_o->csect_s != Cur_csect /* not in the same csect */
		 || offs < -32768L || offs > 32767L)	/* offset too large */
			baround(opr);
		else if (offs > 127 || offs < -128)
			branch(opr);
		else
			brnchs(opr);
	}
}

/*
 * generate a conditional branch around a jmp
 */
baround(opr)
{
	WCode[0] = opr ^ 0X106;	/* reverse the sense of the condition */
	WCode[1] = 0x4EC0 | 072;	/* jmp xxxxxx */
	Code_length = 4;		/* so far */
	rel_val(&operands[0], L);	/* the address */
}

/* regmem - either register register or memory memory instructions */

regmem(opr)
{
	register struct oper *op1, *op2;	/* operands */
	int sr, dr;				/* registers */

	op1 = operands;
	op2 = &operands[1];
	sr = (int)op1->value_o;
	dr = (int)op2->value_o;
	WCode[0] = opr;
	if (numops != 2) Prog_Error(E_NUMOPS);
	else switch(op1->type_o)
	{
	case t_reg:
		if (op2->type_o == t_reg && dreg(sr) && dreg(dr))
			WCode[0] |= sr | (dr << 9);		
		else Prog_Error(E_OPERAND);
		break;
	case t_predec:
		if (op2->type_o == t_predec && areg(sr) && areg(dr))
			WCode[0] |= (dr & 07) | ((sr & 07) << 9) | 010;
		else Prog_Error(E_OPERAND);
		break;
	default:
		Prog_Error(E_OPERAND);
	}
}


/* addr_op - things of the form lea <eaddr>,ax */

addr_op(opr, size)
{
	register struct oper *op1, *op2;
	int ar;	/* address register */

	op1 = operands;
	op2 = &operands[1];

	WCode[0] = opr;
	if (numops != 2) Prog_Error(E_NUMOPS);
	eaddr(op1, size);		/* get source */
	ar = (int)op2->value_o;
	if (op2->type_o == t_reg && areg(ar))
		WCode[0] |= (ar & 07) << 9;
	else Prog_Error(E_OPERAND);
}

/* shift op -	shift either a register or an effective address */

shift_op(opr)
{
	register struct oper *op1, *op2;
	op1 = &operands[0];
	op2 = &operands[1];

	WCode[0] = opr;
	if (numops == 1)
	{
		WCode[0] |= 0300;	/* size field 3 for eaddr */
		if (mem_addr(op1) && alt_addr(op1)) eaddr(op1, W);
		else Prog_Error(E_OPERAND);
		return;
	}
	if (numops == 2)
	{
		int val1, val2;
		val1 = (int)op1->value_o;
		val2 = (int)op2->value_o;
		if (op1->type_o==t_immed
			&& op2->type_o == t_reg && dreg(val2))
		{
			if ((op1->value_o <= 0) || (op1->value_o > 8))
				Prog_Error(E_CONSTANT);
			if (val1 == 8) val1 = 0;
			WCode[0] |= ((val1 & 07) << 9) | (val2 & 07);
			return;
		}
		else if (op1->type_o==t_reg && dreg(val1)
			&& op2->type_o == t_reg && dreg(val2))
		{
			WCode[0] |= ((val1 & 07) << 9) | (val2 & 07) | 040;
			return;
		}
	}
	Prog_Error(E_OPERAND);
}
/* bit_op - of the form xxx Dn,<eaddr> or xxx #nnn,<eaddr> */

bit_op(opr)
{
	register struct oper *op1, *op2;
	op1 = operands;
	op2 = &operands[1];

	WCode[0] = opr;
	if (numops != 2) Prog_Error(E_NUMOPS);
	else if (op1->type_o == t_reg && dreg((int)op1->value_o) &&
		data_addr(op2) && alt_addr(op2))
	{
		/* <eaddr> is destination */
		WCode[0] |= 0400 | ((int)op1->value_o << 9);
		eaddr(op2, W);
	}
	else if (op1->type_o == t_immed && data_addr(op2) && alt_addr(op2))
	{
		WCode[0] |= 04000;
		rel_val(op1, W);
		eaddr(op2, W);
	}
	else Prog_Error(E_OPERAND);
}
/* memreg - instructions of the form xxx <eaddr>,Dn  eg. divu */

memreg(opr)
{
	register struct oper *op1, *op2;
	int dr;	/* data register */

	op1 = operands;
	op2 = &operands[1];

	WCode[0] = opr;
	dr = (int)op2->value_o;
	if (numops != 2) Prog_Error(E_NUMOPS);
	if (data_addr(op1) && op2->type_o == t_reg && dreg(dr))
	{
		WCode[0] |= (dr & 07) << 9;
		eaddr(op1, W);		/* get source */
	}
	else Prog_Error(E_OPERAND);
}


/* postinc - instructions of the form xxx Ay@+,Ax@+, i.e. cmpm */

postinc(opr)
{
	register struct oper *op1, *op2;
	int ar1, ar2;

	op1 = operands;
	op2 = &operands[1];
	ar1 = (int)op1->value_o;
	ar2 = (int)op2->value_o;

	WCode[0] = opr;
	if (numops != 2) Prog_Error(E_NUMOPS);
	else if (op1->type_o == t_postinc && areg(ar1) &&
		op2->type_o == t_postinc && areg(ar2))
		/* Swapped ar1 and ar2 below. Bothner Jun 82 */
		WCode[0] |= ((ar2 & 07) << 9) | (ar1 & 07);
	else Prog_Error(E_OPERAND);
}

/* regbrnch - instructions like DBcc Dn,<label> */

regbrnch(opr)
{
	long offs = 0;
	int dr;
	register struct oper *op1, *op2;
	op1 = operands;
	op2 = &operands[1];
	dr = (int)op1->value_o;
	WCode[0] = opr;
	if (numops != 2) Prog_Error(E_NUMOPS);
	/* we should check here for relocatable expression */
	else if (op1->type_o == t_reg && dreg(dr))
	{
		WCode[0] |= dr;
		offs = op2->value_o - (Dot + 2);
		if (((offs<<16)>>16) != offs) Prog_Error(E_OFFSET);
		WCode[1] = offs;
		Code_length = 4;
	}
}

/* exg_op - instructions like exg rx,ry */

exg_op(opr)
{
	int r1, r2;
	register struct oper *op1, *op2;
	op1 = operands;
	op2 = &operands[1];
	r1 = (int)op1->value_o;
	r2 = (int)op2->value_o;

	WCode[0] = opr;
	if (numops != 2) Prog_Error(E_NUMOPS);
	else if (op1->type_o == t_reg && op2->type_o == t_reg)
	{
		if (dreg(r1) && dreg(r2))
			WCode[0] |= 0100 | (r1 << 9) | r2;
		else if (areg(r1) && areg(r2))
			WCode[0] |= 0110 | ((r1 & 07) << 9) | (r2 & 07);
		else if (areg(r1) && dreg(r2))
			WCode[0] |= 0210 | (r2 << 9) | (r1 & 07);
		else if (dreg(r1) && areg(r2))
			WCode[0] |= 0210 | (r1 << 9) | (r2 & 07);
		else Prog_Error(E_REG);
	}
	else Prog_Error(E_OPERAND);
}		
/* reg_op - instructions of the form xxx dn, if flag == D else xxx an */

reg_op(opr, flag)
{
	register struct oper *opp = operands;
	int reg = (int)opp->value_o;
	if (numops != 1) Prog_Error(E_NUMOPS);
	if (opp->type_o != t_reg) Prog_Error(E_OPERAND);
	if ((flag == D && !dreg(reg)) || (flag == A && !areg(reg)))
		Prog_Error(E_REG);
	WCode[0] = opr | (reg & 07);
}


/* link_op - form: link An,#<disp> */

link_op(opr)
{
	int ar;
	register struct oper *op1, *op2;
	op1 = operands;
	op2 = &operands[1];
	if (numops != 2) Prog_Error(E_NUMOPS);
	if (op1->type_o != t_reg || op2->type_o != t_immed)
		Prog_Error(E_OPERAND);
	ar = (int)op1->value_o;
	if (!areg(ar)) Prog_Error(E_REG);
	WCode[0] = opr | (ar & 07);
	rel_val(op2, W);
}


/* movem_op -	of the form: movem #xxx,<eaddr> or movem <eaddr>,#xxx */

movem_op(opr)
{
	register struct oper *op1, *op2;
	op1 = operands;
	op2 = &operands[1];
	WCode[0] = opr;
	if (numops != 2) Prog_Error(E_NUMOPS);
	if (op1->type_o == t_immed && (ctrl_addr(op2)||op2->type_o==t_predec))
	{
		rel_val(op1, W);
		eaddr(op2, W);
	}
	else if(op2->type_o == t_immed &&
		(ctrl_addr(op1) || op1->type_o == t_postinc))
	{
		WCode[0] |= 02000;	/* memory to register flag */
		rel_val(op2, W);
		eaddr(op1, W);
	}
	else Prog_Error(E_OPERAND);
}


/* movep_op - of the form:  movep Dx,Ay@(d) or movep Ay@(d),Dx */

movep_op(opr)
{
	register struct oper *op1, *op2;
	int r1, r2;
	op1 = operands;
	op2 = &operands[1];
	r1 = (int)op1->value_o;
	r2 = (int)op2->value_o;
	WCode[0] = opr;
	if (numops != 2) Prog_Error(E_NUMOPS);
	if (op1->type_o == t_reg && dreg(r1))
	{
		if (op2->type_o != t_displ || !areg(op2->reg_o))
			Prog_Error(E_OPERAND);
		WCode[0] |= (r1 << 9) | 0600 | (op2->reg_o & 07);
		rel_val(op2, W);		
	}
	else if (op2->type_o == t_reg && dreg(r2))
	{
		if (op1->type_o != t_displ || !areg(op1->reg_o))
			Prog_Error(E_OPERAND);
		WCode[0] |= (r2 << 9) | 0400 | (op1->reg_o & 07);
		rel_val(op1, W);
	}
	else Prog_Error(E_OPERAND);
}	


/* moveq -  form: moveq #<data>,Dn */

moveq(opr)
{
	register struct oper *op1, *op2;
	int r2;
	op1 = operands;
	op2 = &operands[1];
	r2 = (int)op2->value_o;
	if (op1->value_o > 0177 || op1->value_o < -0200)
		Prog_Error(E_CONSTANT);
	WCode[0] = opr | ((r2 & 07) << 9) | ((short)op1->value_o & 0377);
	if (numops != 2) Prog_Error(E_NUMOPS);
	if (op1->type_o != t_immed || op2->type_o != t_reg || !dreg(r2))
		Prog_Error(E_OPERAND);
}

/* stop_op - form: stop #xxxx */

stop_op(opr)
{
	register struct oper *opp = operands;
	WCode[0] = opr;
	if (numops != 1) Prog_Error(E_NUMOPS);
	if (opp->type_o != t_immed) Prog_Error(E_OPERAND);
	rel_val(opp, W);
}

/* rts_op - form: rts OR rts #xxxx (68010 TPM) */

rts_op(opr)
{
	register struct oper *opp = operands;

	if (numops == 0) 
	  {
	    WCode[0] = opr | 1;
	    return;
	  }

	if (numops != 1) Prog_Error(E_NUMOPS);
	WCode[0] = opr;
	if (opp->type_o != t_immed) Prog_Error(E_OPERAND);
	rel_val(opp, W);
}

/* trap - form: trap #xxxx */

trap(opr)
{
	register struct oper *opp = operands;
	if (numops != 1) Prog_Error(E_NUMOPS);
	if (opp->type_o != t_immed) Prog_Error(E_OPERAND);
	WCode[0] = opr | (((char)opp->value_o) & 017);
}


/* eaddr - put in stuff for an effective address */
eaddr(opptr, size)
register struct oper *opptr;
{
	int reg = (int)opptr->value_o;
	switch(opptr->type_o)
	{
	case t_reg:
		if (areg(reg) || dreg(reg))
			WCode[0] |= (int)opptr->value_o;
		else if (srreg(reg) || ccreg(reg))
			WCode[0] |= 074;
		else Prog_Error(E_REG);
		break;
	case t_defer:
		if (areg(reg))
			WCode[0] |= (((int)opptr->value_o) & 07) | 020;
		else Prog_Error(E_REG);
		break;
	case t_postinc:
		if (areg(reg))
			WCode[0] |= (((int)opptr->value_o) & 07) | 030;
		else Prog_Error(E_REG);
		break;
	case t_predec:
		if (areg(reg))
			WCode[0] |= (reg & 07) | 040;
		else Prog_Error(E_REG);
		break;
	case t_displ:
		if (areg(opptr->reg_o))
		{
			WCode[0] |= (opptr->reg_o & 07) | 050;
			rel_val(opptr, W);	/* install displacement */
		}
		else if (pcreg(opptr->reg_o))
		{
			WCode[0] |= 072;
			rel_val(opptr, W);	/* install displacement */
		}
		else Prog_Error(E_REG);
		break;
	case t_index:
		if (areg(opptr->reg_o))
		{
			WCode[0] |= (opptr->reg_o & 07) | 060;
			index(opptr);		/* compute index word */
			rel_val(opptr, W);	/* install index word */
		}
		else if (pcreg(opptr->reg_o))
		{
			WCode[0] |= 073;
			index(opptr);		/* compute index word */
			rel_val(opptr, W);	/* install index word */
		}
		else Prog_Error(E_REG);
		break;
	case t_abss:
		WCode[0] |= 070;
		rel_val(opptr, W);	/* install short address */
		break;
	case t_normal:
	case t_absl:
		WCode[0] |= 071;
		rel_val(opptr, L);
		break;
	case t_immed:
		WCode[0] |= 074;
		rel_val(opptr, (size == L)? L:W);	/* change bytes to W */
		break;
	default:
		Sys_Error("Unrecognized address mode in line %s", Line);
	}
}
/* index -	Use data in operand structure to compute and index word
		and leave the word in the operand value
 */

index(opptr)
register struct oper *opptr;
{
	int indexval = 0;

	if (areg((int)opptr->value_o) || dreg((int)opptr->value_o))
		indexval = (int)opptr->value_o << 12;
	else Prog_Error(E_REG);
	if (opptr->flags_o == O_LINDEX) indexval |= 0x0800;	/* else word */
#ifndef Stanford
	if (opptr->disp_o < 0400) indexval |= opptr->disp_o;
#else Stanford
	if (-0200 <= opptr->disp_o && opptr->disp_o < 0200)
		indexval |= (unsigned char)opptr->disp_o;
#endif Stanford
	else Prog_Error(E_OFFSET);
	opptr->value_o = indexval;
}
/* areg -	Returns 1 if reg is an address register */

areg(reg) {	return(reg >= 8 && reg < 16); }


/* dreg -	Returns 1 if reg is a data register */

dreg(reg) {	return(reg >= 0 && reg < 8); }


/* uspreg -	Returns 1 if reg is usp */

uspreg(reg) {	return(reg == 19); }


/* pcreg -	Returns 1 if reg is pc */

pcreg(reg) {	return(reg == 16); }


/* srreg -	Returns 1 if reg is sr */

srreg(reg) {	return(reg == 18); }


/* ccreg -	Returns 1 if reg is cc */

ccreg(reg) {	return(reg == 17); }

/* sfcreg -	Returns 1 if reg is sfc (68010 TPM) */

sfcreg(reg) {	return(reg == 20); }

/* dfcreg -	Returns 1 if reg is dfc (68010 TPM) */

dfcreg(reg) {	return(reg == 21); }

/* vbrreg -	Returns 1 if reg is vbr (68010 TPM) */

vbrreg(reg) {	return(reg == 22); }

/* check for a data addressing mode */

data_addr(op)
register struct oper *op;
{
	switch(op->type_o)
	{
	case t_reg:
		if (areg((int)op->value_o)) return(0);
	default:
		return(1);
	}
}


/* check for an alterable data addressing mode */

alt_addr(op)
register struct oper *op;
{
	switch(op->type_o)
	{
	case t_displ:
	case t_index:
		if (pcreg(op->reg_o)) return(0);
	default:
		return(1);
	}
}


/* check for a memory addressing mode */

mem_addr(op)
register struct oper *op;
{
	switch(op->type_o)
	{
	case t_reg:
		return(0);
	default:
		return(1);
	}
}


/* check for a control addressing mode */

ctrl_addr(op)
register struct oper *op;
{
	switch(op->type_o)
	{
	case t_reg:
	case t_postinc:
	case t_predec:
	case t_immed:
		return(0);
	default:
		return(1);
	}
}


/* sr_addr - check to see if addressing mode is sr */

sr_addr(op)
register struct oper *op;
{
	int reg = (int)op->value_o;
	if (op->type_o == t_reg && (srreg(reg) || ccreg(reg))) return(1);
	return(0);
}


/* check to make sure that addr mode is not addr register direct if size = B */

adrbyte(op, size)
register struct oper *op;
register int size;	/* B,W or L */
{
	if (op->type_o == t_reg && size == B && areg((int)op->value_o))
		return(0);
	return(1);
}

g(reg))
			WCode[0] |= (int)opptr->value_o;
		else if (srreg(reg) || ccreg(reg))
			WCode[0] |= 074;
		else Prog_Error(E_REG);
		break;
	case t_defer:
		if (areg(reg))
			WCode[0] |= (((int)opptr->value_o) & 07) | 020;
		else Prog_Error(E_REG);
		break;
	case t_postinc:
		if (areg(reg))
			WCode[0] |= (((int)opsumacc/cc/as/inst.h   444      0     12        7463  3470501537   7435 /* dispatch numbers for 68000 instructions.  These numbers are placed in
 * the code_i component of each instruction bucket by init.c and are used
 * by ins.c for dispatching.
 */

#define i_abcd	1
#define i_addb	2
#define i_addw	3
#define i_addl	4
#define i_addqb	5
#define i_addqw	6
#define i_addql	7
#define i_addxb	8
#define i_addxw	9
#define i_addxl	10
#define i_andb	11
#define i_andw	12
#define i_andl	13
#define i_aslb	14
#define i_aslw	15
#define i_asll	16
#define i_asrb	17
#define i_asrw	18
#define i_asrl	19
#define i_bcc	20
#define i_bccs	21
#define i_bchg	22
#define i_bclr	23
#define i_bcs	24
#define i_bcss	25
#define i_beq	26
#define i_beqs	27
#define i_bge	28
#define i_bges	29
#define i_bgt	30
#define i_bgts	31
#define i_bhi	32
#define i_bhis	33
#define i_ble	34
#define i_bles	35
#define i_bls	36
#define i_blss	37
#define i_blt	38
#define i_blts	39
#define i_bmi	40
#define i_bmis	41
#define i_bne	42
#define i_bnes	43
#define i_bpl	44
#define i_bpls	45
#define i_bra	46
#define i_bras	47
#define i_bset	48
#define i_bsr	49
#define i_bsrs	50
#define i_btst	51
#define i_bvc	52
#define i_bvcs	53
#define i_bvs	54
#define i_bvss	55
#define i_chk	56
#define i_clrb	57
#define i_clrw	58
#define i_clrl	59
#define i_cmpb	60
#define i_cmpw	61
#define i_cmpl	62
#define i_cmpmb	63
#define i_cmpmw	64
#define i_cmpml	65
#define i_dbcc	66
#define i_dbcs	67
#define i_dbeq	68
#define i_dbf	69
#define i_dbra	70
#define i_dbge	71
#define i_dbgt	72
#define i_dbhi	73
#define i_dble	74
#define i_dbls	75
#define i_dblt	76
#define i_dbmi	77
#define i_dbne	78
#define i_dbpl	79
#define i_dbt	80
#define i_dbvc	81
#define i_dbvs	82
#define i_divs	83
#define i_divu	84
#define i_eorb	85
#define i_eorw	86
#define i_eorl	87
#define i_exg	88
#define i_extw	89
#define i_extl	90
#define i_jbsr	91
#define i_jcc	92
#define i_jcs	93
#define i_jeq	94
#define i_jge	95
#define i_jgt	96
#define i_jhi	97
#define i_jle	98
#define i_jls	99
#define i_jlt	100
#define i_jmi	101
#define i_jmp	102
#define i_jne	103
#define i_jpl	104
#define i_jra	105
#define i_jsr	106
#define i_jvc	107
#define i_jvs	108
#define i_lea	109
#define i_link	110
#define i_lslb	111
#define i_lslw	112
#define i_lsll	113
#define i_lsrb	114
#define i_lsrw	115
#define i_lsrl	116
#define i_movb	117
#define i_movw	118
#define i_movl	119
#define i_movemw	120
#define i_moveml	121
#define i_movepw	122
#define i_movepl	123
#define i_moveq	124
#define i_muls	125
#define i_mulu	126
#define i_nbcd	127
#define i_negb	128
#define i_negw	129
#define i_negl	130
#define i_negxb	131
#define i_negxw	132
#define i_negxl	133
#define i_nop	134
#define i_notb	135
#define i_notw	136
#define i_notl	137
#define i_orb	138
#define i_orw	139
#define i_orl	140
#define i_orib	141
#define i_oriw	142
#define i_oril	143
#define i_pea	144
#define i_reset	145
#define i_rolb	146
#define i_rolw	147
#define i_roll	148
#define i_rorb	149
#define i_rorw	150
#define i_rorl	151
#define i_roxlb	152
#define i_roxlw	153
#define i_roxll	154
#define i_roxrb	155
#define i_roxrw	156
#define i_roxrl	157
#define i_rte	158
#define i_rtr	159
#define i_rts	160
#define i_sbcd	161
#define i_scc	162
#define i_scs	163
#define i_seq	164
#define i_sf	165
#define i_sge	166
#define i_sgt	167
#define i_shi	168
#define i_sle	169
#define i_sls	170
#define i_slt	171
#define i_smi	172
#define i_sne	173
#define i_spl	174
#define i_st	175
#define i_stop	176
#define i_subb	177
#define i_subw	178
#define i_subl	179
#define i_subqb	180
#define i_subqw	181
#define i_subql	182
#define i_subxb	183
#define i_subxw	184
#define i_subxl	185
#define i_svc	186
#define i_svs	187
#define i_swap	188
#define i_tas	189
#define i_trap	190
#define i_trapv	191
#define i_tstb	192
#define i_tstw	193
#define i_tstl	194
#define i_unlk	195
#define i_movsb	196	/* 68010 TPM */
#define i_movsw	197	/* 68010 TPM */
#define i_movsl	198	/* 68010 TPM */
#define i_movc	199	/* 68010 TPM */
ine i_addxb	8
#define i_addxw	9
#define i_addxl	10
#define i_andb	11
#define i_andw	12
#define i_andl	13
#define i_aslb	14
#define i_aslw	15
#define i_asll	16
#define i_asrb	17
#define i_asrw	18
#define i_sumacc/cc/as/mac.c   444      0     12       54517  3470501537   7235 #
#include "mical.h"
#include "mac.h"
char *mac = "~|^`s.mac.c R1.2 on 12/5/79";

/* macro bucket states */
#define	DEFINING	1
#define	EXPANDING	2

/* macro token types */
#define SPACE	0
#define TIK	1
#define EOL	2
#define WORD	3
#define	ARG	4
#define NIL	5

/* arguments to Load_Macro */
#define MACRO	0
#define REPT	1



/****************************************************************************
 *									    *
 *  MICAL Assembler -- Macro Implementation				    *
 *									    *
 * 	The overall purpose of the following procedures is explained in     *
 * mac.h.								    *
 *									    *
 ****************************************************************************/


/*
 * External Variables 
 */
FLAG	Expanding = FALSE;	/* TRUE when expanding a macro, FALSE otherwise */

int	Top_of_M_stack = -1;	/* initialize macro call stack ptr */

extern char *Store_String();
extern struct sym_bkt *Lookup();

/* Define_Macro()
	This is called by Pseudo() (ps.c) when a .macro pseudo-op is recognized
on the source line. It allocates a macro bucket for the macro, and places it
on the macro table, which is organized in a hashed, chained method as is the
assembler's normal symbol table.
	Define_Macro processes the remainder of the .macro line, reading in the
formal arguments of the macro, loading pertinent information into the external
structure, M_defining.
	Finally, it puts the assembler into macro defining mode by  calling
Load_Macro.

	All of the above is done on pass 1. On pass 2, the assembler 
merely prints the text of the macro definition.

*/

/* Macro hash table, each entry is the head of a linked list of macro buckets.
   This structure is initialized by the routine Init_Macro(), which is called
   by the assembler's initialization routine Init();
*/ 

struct M_bkt	*Mac_hash_tab[HASH_MAX];
Init_Macro(){
	register int i;
	for (i=0; i<HASH_MAX; i++) Mac_hash_tab[i] = 0;
}


/* typ_mask is an array of mask bits. The name "typ_mask" is used to share
this structure with the "typ_mask" array of sym.c, where the array is defined */
int	typ_mask[16] = { 01, 02, 04, 010, 020, 040, 0100, 0200, 0400,
		 01000, 02000, 04000, 010000, 020000, 040000, 0100000 };

struct {			/* Listing flags */
	char	any_lf;		/* master switch. If 0, no listing at all is done */
	char	bin_lf;		/* binary code field of listing line */
	char	bex_lf;		/* binary extensions (e.g. from .word) */
	char	md_lf;		/* macro definitions */
	char	mc_lf;		/* macro calls */
	char	me_lf;		/* macro expansions */
	char	cnd_lf;		/* unsatisfied conditional blocks */
	char	ld_lf;		/* listing directives */
} Lflags ;

Define_Macro(){
	char		S[STR_MAX];
	register char	*cp;
	register 
	struct	M_bkt	*mdp;
	int		save;	/* index of chain in Mac_hash_tab of macro name */
	register int	load;	/* next available character in M_defining.buff[] */
	int		count;	/* number of formal arguments to the macro */

	extern int 	E_pass1;	/* error code for errors detected in pass 1 */

/* Pass2: list the current (.macro) line, and call Print_Macro to list the
   rest of the macro definition */
	if (Pass == 2) {
		if (Lflags.md_lf) {		/* if macro definitions listed, do it */
			Print_Line(P_NONE);
			Print_Macro(); }
		return; }

/* Pass1: */

/* Get the name of the macro */
	if (Get_Token(S) == 0) Prog_Error(E_pass1 = E_MACRO);
	else {

	/* Create a macro bucket for this macro, and enter it in the macro 
	   symbol table */
		mdp = (struct M_bkt *)malloc(sizeof _M_bkt);
		mdp->name_m = Store_String(S);
		mdp->next_m = Mac_hash_tab[save = Hash(S)];
		mdp->text_m = 0;
		mdp->state_m = DEFINING;
		mdp->ACS_m = 0;
		Mac_hash_tab[save] = mdp;

	/* Load the M_defining structure */
		M_defining.bkt_md = mdp;
		M_defining.nargs_md = 0;
		load = 0;
		for (count = 0; count < MARGS_MAX; count++) {	/* load formal macro arguments */
			Non_Blank();
			if (Line[Position] == ',') Position++;
			Non_Blank();
			if (Line[Position] == '?') {		/* Check for automatically created symbol */
				mdp->ACS_m |= typ_mask[count];
				Position++; }

			if (Get_Token(S) == 0) break;		/* Get the formal argument */
			M_defining.args_md[count] = & (M_defining.buff_md[load]);	/* load it into M_defining */
			for (cp = S; *cp && load < MARGCHAR_MAX-1; cp++,load++)
				M_defining.buff_md[load] = *cp;
			M_defining.buff_md[load++] = 0;

			if (load >= MARGCHAR_MAX) {
				Prog_Warning(E_MLENGTH);
				break; }
			
		}
		M_defining.nargs_md = count;		/* count of number of arguments */
		mdp->state_m = 0;

	/* macro args have been read, make sure we're at end of line */
		if (Line_Delim(Line[Position]) == false) Prog_Error(E_pass1 = E_MACARG);
	}

/* List the .macro line */
	Print_Line(P_NONE);

/* Load the rest of the macro definition */
	Load_Macro(mdp,MACRO);		/* call from Define_Macro */
	return;
}


/* MLHold is a buffer to hold a line of the macro as it is scanned for 
macro arguments */
char MLHold[LINE_MAX] = 0;


/* Load_Macro
	This is called on pass 1 to store the text of the macro currently 
being defined.
	arguments:	mdp, a ptr to the macro bucket for the macro.
			caller, a flag that is the constant MACRO if we are
				called from Define_Macro and the constant REPT
				if we're called from Rept().	
	returns:	nothing;
	Side Effects:	The text_m component of the macro's bucket becomes
			the head of a linked list of M_line's, where the Nth
			M_line points to the Nth line of the macro.
*/

Load_Macro(mdp,caller)
struct M_bkt *mdp;
int caller;
{
	char		S[STR_MAX];	/* all-purpose char string */
	struct M_line	*Cur_mline;	/* current macro line */
	int		Nested;		/* depth of .macro definitions */
	int		Last,This;	/* Macro token types */
	extern int 	E_pass1;	/* error code for errors detected in pass 1 */
	struct M_line *Load_Arg(),
		      *Load_String();

	Cur_mline = mdp->text_m = (struct M_line *)malloc(sizeof _M_line);	/* allocate initial M_line */
	Nested = 0;
	MLHold[0] = 0;			/* initialize line buffer for Load_String */

	while(1) {	/* For the duration of the macro definition, */
		Read_Line();		/* read the next source line */
		if (Get_Token(S)) 	/* does a valid token begin the line? */
			if (seq(S,".macro") ||	/* Yes, check for macro definition delimiters */
				seq(S,".rept"))
				 Nested++; 	/* if starting a nested macro definition, incr depth count */
			else if ((seq(S,".endm")|| seq(S,".endr"))	/* if ending a macro definition, */
				&& (--Nested) < 0) {			/* decrement depth count */
					Print_Line(P_NONE);		/* list the .endm statement */
					return;	}			/* and return */

	/* Process the current source line of the macro. This consists mainly
	   of identifying the arguments to the macro and replacing them with
	   a special character which indicates their argument number */

		Position = 0;			/* reset Position after the previous Get_Token() */
	/* if a .rept block is being loaded, just load the current line. If a
		macro is being loaded, then scan the line for formal args */
	/* The purpose of the next if..else do {} statement is to store the current line away, placing it on a linked list of
	   macro lines. For .rept lines, no formal arguments need to be extracted; for .macro lines, much hair is
	   involved in locating a formal argument and storing an argument code for is rather than the text itself. */

		if (caller == REPT)
			Cur_mline = Load_String(Line,Cur_mline);
		else do {			/* For the rest of the input line, */
			Last = This;		/* Save the type of the last token */
			This = Get_Mtoken(S);	/* Get the next token; Get_Mtoken returns the type of the token loaded into S */
			if (This == ARG) {	/* if it is a macro argument, */
				Cur_mline = Load_Arg(S,Cur_mline);	/* load the special character for it in place of the argument */
				continue; }

		/* Check for concatenation */
			if (Last == TIK) 	/* if the last token was a tik (') */
				Cur_mline = Load_String("'",Cur_mline);	/* load the tik, since it wasn't used for concatenation */
			if (This == TIK) {	/* if the current token is a tik, */
				if (Last = ARG)	/* and if the last token was an argument, then concatenation is being done, so */
				 This = NIL;	/* ignore the current tik mark */
				continue; }
			if (This == NIL) {	/* if Get_Mtoken failed to get a token, complain */
				Prog_Error(E_pass1 = E_MACFORMAL);
				break; }

		/* Finally, load the current macro token */
			Cur_mline = Load_String(S,Cur_mline);

		} while (This != EOL);		/* stop at the end of the source line */
		Print_Line(P_NONE);		/* list the current line */
	}					/* The macro has been defined */
	/* return; */
}



/* Print_Macro() is called on pass 2 to simply list a macro definition. Any
	errors in the definition will have been detected in pass 1 */

Print_Macro()  {
	int 	Nested;
	char	S[STR_MAX];

	Nested = 0;
	while(1) {
		Read_Line();
		Print_Line(P_NONE);
		Get_Token(S);
		if ( seq(S,".macro") || seq(S,".rept") )
			Nested++;
		else if ((seq(S,".endm") || seq(S,".endr")) && (--Nested) < 0) return;
	}

}



/* Load_String --	Loads a char string into a macro line.
	arguments:	char *S, the string to be loaded,
			struct M_line *mline, a ptr to the M_line to be modified.
	results:	returns a M_line ptr which is to be used in the 
			next Load_String operation.
	method:	    If S is not a newline character, then the string S is
			appended to the static char array MLHold, (macro
			line hold), and Load_String returns the same M_line
			that was passed to it.
		    If S is a newline, then the char string in MLHold is
			copied (via Store_String in sym.c) and a ptr to this
			copy is put into the Text component of mline. A new
			macro line is allocated, and it's address loaded into
			mline->next_ml. This ptr to the newly allocated macro
			line is returned.
*/



struct M_line *Load_String(S,mline)
	char *S;
	register struct M_line *mline;
{
	register char *cp;
	register int i;
	char	*lastc();	/* returns ptr to last char of string argument */

	cp = S;
	for (i=0; MLHold[i]; i++);		/* find end of MLHold */
	for(; *cp && i < LINE_MAX-1; (cp++,i++))	/* append S to MLHold */
		MLHold[i] = *cp;
	MLHold[i] = 0;

	if ((*lastc(S))=='\n') {			/* Is this the end of a line? */
		mline->text_ml = Store_String(MLHold);	/* yes, so copy the line, and save a ptr to it */
		MLHold[0] = 0;				/* clear MLHold */
		mline->next_ml = (struct M_line *)malloc(sizeof _M_line);	/* allocate the next M_line on the linked list of M_lines for this macro */
		(mline->next_ml)->text_ml = NULL;
		(mline->next_ml)->next_ml = NULL;	/* initialize the new M_line */
		return(mline->next_ml);			/* and return with a ptr to it */
	}

	return(mline);				/* still loading current line, so return with the same M_line */
}

	
/* Load_Arg	loads the special character code for a macro argument appearing
		in the text of the  macro.

	A macro argument appearing in the text of a macro is represented by a
single byte with value 0200 + <argument index>, where the Nth macro argument
on the .macro line has argument index N.
*/

struct M_line *Load_Arg(form_arg,mline)
	char *form_arg;
	struct M_line *mline;
{
	register char	S[2];
	int		N;

	N = Form_Arg_No(form_arg);
	if (N<1 || N > M_defining.nargs_md) Sys_Error("Invalid formal parameterpassed to Load_Arg",0);
	S[0] = 0200 + N;
	S[1] = 0;
	return(Load_String(S,mline));
}


/* Form_Arg_No	returns N if it's argument is the Nth argument of the current macro being defined.
		Otherwise it returns 0
*/

int Form_Arg_No(S)
register char *S;
{
	register int	i;
	for(i = 0; i<M_defining.nargs_md; i++)
		if (seq(S,M_defining.args_md[i])) return(i+1);
	return(0);
}



/* Get_Mtoken-- Get Macro Token

	The text of a macro is partitioned into 5 types of tokens:

	SPACE's:	a string of spaces or tabs;
	TIK's:		a single apostrophe character (');
	EOL's:		a newline or formfeed character;
	WORD's:		any sequence of characters not containing SPACE's, TIK's, or EOL's;
	ARG's:		a special kind of WORD, one which is a formal argument to the current macro being defined.

*/
int Get_Mtoken(S)
register char *S;
{
	register int 	i;
	register char	C;

	C = Line[Position];

	for (i = 0; i < STR_MAX-1; i++) 		/* check for string of spaces */
		if ((C == ' ') || C == '\t') {
			S[i] = C;
			C = Line[++Position]; }
		else break;
	if (i) {
		S[i] = 0; return(SPACE); }

	if (Get_Token(S)) 				/* attempt to read a word */
		if (Form_Arg_No(S)) return(ARG);	/* if word found, check if it's an argument */
		else return(WORD);

	if (C == '\n' || C == '\014') {			/* Check for newline char */
		Position++;
		S[0] = C;
		S[1] = 0;
		return(EOL); }

	if (C == '\'') {				/* Check for apostrophe */
		Position++;
		S[0] = C;
		S[1] = 0; 
		return(TIK); }


	if (C < ' ' || C > '~') {			/* Invalid character, just return a nil token */
		Position++;				/* skip over the bad char */
		return(NIL);
	}

	S[0] = C; S[1] = 0;				/* just return the character (operator, colon, etc.) */
	Position++;
	return(SPACE);					/* This could return SPACE or WORD */

}




/* Macro() --	handles macro calls 

	This is called by the main loop to recognize macro calls. Any labels
on the current line have already been processed, so the first token we grab
is a candidate for a macro call.
	Expansion is done on the fly during pass 1, so that on pass 2, all we
need do is list the macro call.
	On pass 1, this routine reads the actual arguments to the macro, and sets up
a macro-call (M_call) structure for the macro activation.
*/

Macro()
{
	int		Save,count,level,i,load;
	register char	S[STR_MAX],C;
	char		rdelim,ldelim;
	struct M_bkt	*mbp,*Get_Mac_Bkt();
	register 
	struct M_call	*mcp;
	struct sym_bkt	*sbp;

	Save = Position;				/* remember current position on input source line */

	if (Get_Token(S) == 0) 				/* Pick up the next token on line */
		return(true);				/* if none, we can't do anything */

							/* Search macro table for token */
	if ((mbp = Get_Mac_Bkt(S)) == 0) {
		Position = Save;			/* if not found, not a macro call */
		return (true);	}		

	if (Pass == 2) {				/* On pass 2, just list the macro call */
		if (Lflags.mc_lf) Print_Line(P_NONE);
		return(false); }			/* since we're finished with this line */

	/* Set up macro call structure */
		if (Top_of_M_stack >= MDEPTH_MAX) {
			Prog_Warning(E_LEVELS); 
			goto done; }
		mcp = M_stack[++Top_of_M_stack] = (struct M_call *)malloc(sizeof _M_call);	/* allocate M_call bucket */
		mcp->bkt_mc = mbp;			/* ptr to permanent macro bucket for the macro */
		mcp->line_mc = mbp->text_m;		/* first line of the macro */
		mcp->rc_mc = 1;				/* repeat count is zero */

/* Load macro arguments in  M_call structure */
/* Argument strings are stored sequentially in mcp->buff_mc */
	load = 0;					/* position in buff_mc to load next char */
							/* For each macro argument, */
	for (count = 0; (count < MARGS_MAX) && (load < MARGCHAR_MAX); count ++) {
		mcp->args_mc[count] = & (mcp->buff_mc[load]);	/* set the ptr to its copy in buff_mc */
		Skip_Comma();				/* find first char of argument */
		C = Line[Position];

			/* switch statement places one macro argument into the buff_mc array of the macro call structure */
		switch(C){
						/* Argument enclosed between delimiter chars */
		case '^':				/* explicitly declared delimiter character follows */
			rdelim = ldelim = Line[++Position];
			goto arg_encl;
		case '<':				/* normal delimiters */
			ldelim = '<'; rdelim = '>';
		arg_encl:				/* pick up enclosed argument */
			if (Enclosed(ldelim,rdelim,S) != 0) {	/* extract macro argument */
				Prog_Error(E_MACARG); goto done;
			}
			for(i=0; mcp->buff_mc[load++] = S[i] && load < MARGCHAR_MAX; i++);	/* copy macro arg to buffer */
			break;				/* continue for loop, reading macro arguments

					/* load a numeric argument in a symbol. The value of the symbol is converted
					   to its ASCII representation (in octal) and this representation becomes
					   the macro argument.  */

		case '\\':			/* the expression is preceded by a backslash */
			Position++;			/* move past '\' */
			if (Get_Token(S)) {		/* pick up the symbol */
			    sbp = Lookup(S);		/* get a ptr to its bucket */
			    if (sbp->attr_s & S_DEF)	/* check that it's defined */
			      octalize(sbp->value_s,S); /* move its value expressed in octal into S */
			    else Prog_Error(E_SYMDEF);	/* if it's not defined, then complain */
			    for(i=0; mcp->buff_mc[load++] = S[i] && load < MARGCHAR_MAX; i++);		/* copy S into buff_mc */
			}
			else { Prog_Error(E_SYMBOL); goto done; }	/* if invalid symbol, complain */
			break;

		default:				/* regular argument */

					/* Regular macro argument. Pick up all chars up to a legal separator
					   (blank or comma), or end-of-statement */
		    while (C != ' ' && C != ',' && C != '\t' && !Line_Delim(C) && load < MARGCHAR_MAX-1) {
			mcp->buff_mc[load++] = C;
			C = Line[++Position]; }
		    mcp->buff_mc[load++] = 0;		/* end of macro arg */
		}
	}

done:	
	if (load >= MARGCHAR_MAX)  Prog_Error(E_MLENGTH);	/* check if macro argument storage exceeded */

	Print_Line(P_NONE);				/* put the macro call into temp file (we're on pass 1) */
	return(false);					/* and return false since we're done with this line */
}




/* Automatically Created Symbol count. This is used to create unique local
symbols withing macro expansions. The count starts at 01000 to allow the
programmer to use local symbols 0$ to 0777$. */
int	ACS_count = 01000;




/* Read_Macro_Line
	This is called from Read_Line() to read the next line of the macro
currently being expanded. It returns true if it successfully read a macro
line, false otherwise (implying end of macro expansion).
*/

Read_Macro_Line() 
{
	register int		i,j,k;
	int			index,C;
	struct M_call		*mcp;
	struct M_line		*mlp;
	char			*orig_line, *arg, S[STR_MAX];


/* It is assumed that Macro() has set up the M_call stack, in which case 
M_stack[Top_of_M_stack] contains a ptr to a M_call structure for the current
macro call */

	if (Top_of_M_stack < 0) return(Expanding = false);			/* no macro being expanded */
	Expanding = true;

	mcp = M_stack[Top_of_M_stack];				/* get ptr to current macro call structure */
	mlp = mcp->line_mc;					/* ptr to current macro line structure */
	if (mlp == 0 || (mlp->next_ml == 0)) {			/* if this points to [0,0] m_line, then end of macro */
	    if ((--(mcp->rc_mc)) > 0)				/* but if its a .rept statement, and this is not the last expansion, */
		mcp->line_mc = (mcp->bkt_mc)->text_m;		/* then move current line ptr back to start of text */
	    else {						/* if we are indeed finished expanding, */
		free( M_stack[Top_of_M_stack]);			/* free the macro_expanding structure */
		Top_of_M_stack--;				/* decrement stack pointer */
		}
		return(Read_Macro_Line());			/* and try again */
	}
	orig_line = mlp->text_ml;				/* actual source line */

/* Now step through the line char by char looking for the occurrence of a macro
argument. This is represented by a single char with value 0200+N,  where N is
the index of the argument in the macro's definition. 

   Load the resulting line into Line[].
 */
	for (i = 0, j = 0; orig_line[i] && j < LINE_MAX-1; i++) {
		C = orig_line[i] & 0377;
		if (C < 0200) Line[j++] = C;			/* normal text char, just copy into Line[] */
		else {							/* argument  occurrence */
			index = C - 0200 - 1;		/* index of argument (0 => 1st, 1=> 2nd, etc) */
			arg = mcp->args_mc[index];		/* actual argument string */
								/* Create automatically created symbols */
			if (*arg == 0 && (((mcp->bkt_mc)->ACS_m) & (1 << index))) {	/* actual arg must be absent */
				octalize(ACS_count++, S);	/* put octal rep of ACS_count into string S */
				append("$",S);			/* append $ to create a name of a unique local symbol */
				arg = S;			/* and let the generated symbol be the argument */
			} 
			for (k = 0; arg[k] && j<LINE_MAX-1; k++)	/* copy it into actual line */
				Line[j++] = arg[k];
		}
	}
	Line[j] = 0;						/* end of line */

	Start_Line();						/* initialize per-line variables */

	mcp->line_mc = (mcp->line_mc)->next_ml;			/* step down list of linked macro lines */

	return(true);
}

/*
	Rept: .rept handler

[ Warning: this implementation is painfully inefficient: it keeps the text of
a .rept block in core and forgets it when the block is completed, i.e. the
memory is lost. Future implementations should either use the free storage pkg
to hold the text, or use a file. ]

	.REPT blocks are handled similarly to .macro blocks:
1. A macro_bucket is created for the block, but no name is associated with the
   	macro; furthermore, the macro bucket is not placed in the macro hash table.
2. The text of the .rept block is read into core, and each line of the text is
   	stored as a macro_line structure.
3. After the text of the macro is stored, a macro_call structure is created and
  	placed on the macro call stact, with a repeat count equal to the number
	in the operand field of the .rept statement.
4. Control is returned to the assembler. Read_Line will pick up the text of the
	.rept block via the macro call structure. When the .rept block has been
	repeated enough times, the macro call structure will be destroyed, also
	losing the pointer to the macro lines containing the text of the .rept
	block. 

*/

Rept(){
	struct	M_call 	*mcp;
	struct	M_bkt	*mdp;
	int		RC;	/* repeat count*/

	Print_Line(P_NONE);				/* list the .rept statment */
	if (Pass == 2) {				/* ignore .rept statement on pass 2 */
		Print_Macro();				/* print definition of macro */
		return; }

/* Get the repeat count */
	if ((Get_Operand() == false) ||			/* evaluate the operand field */
		(RC = Operand.value_o) < 0) {	/* assign the value to RC */
			Print_Line();			/* if the repeat count is invalid, print the .rept statement, */
			Print_Macro();			/* and the rest of the .rept block */
			return; } 

	/* Create macro bucket for this .rept block, but don't enter it into the macro hash table */
	mdp = (struct M_bkt *)malloc(sizeof _M_bkt);
	mdp->name_m = 0;
	mdp->next_m = 0;
	mdp->text_m = 0;
	mdp->state_m = DEFINING;
	mdp->ACS_m = 0;

	Load_Macro(mdp,REPT);		/* load text of macro */

	mcp = M_stack[++Top_of_M_stack] = (struct M_call *)malloc(sizeof _M_call);
	mcp->bkt_mc = mdp;
	mcp->line_mc = mdp->text_m;
	mcp->rc_mc = RC;		/* load repeat count into macro call structure */
	return;
}

/* octalize(N,S) puts the octal representation of N into string S) */

octalize(N,S)
int N;
register char *S;
{
	register char	buff[7];
	register int	i;
	long 	NN;

	NN = N & 0177777;
	i = 5;					/* put octal representation into rhs of buff */
	do {
		buff[i--] = NN % 8 + '0';
		NN = NN/8;
	} while (NN > 0);

	while (i < 5) *S++ = buff[++i];		/* copy octal rep into S */
	*S = 0;
}

/*
 * Get_Mac_Bkt(Name)  returns a ptr to the M_bkt structure for the macro named "Name".
 *			If no such macro exists, 0 is returned.
 */
struct M_bkt *Get_Mac_Bkt(Name)
char Name[];
{
	struct M_bkt *mbp;

	for (mbp=Mac_hash_tab[Hash(Name)]; mbp != 0; mbp = mbp->next_m)
		if (seq(Name,mbp->name_m)) return (mbp);
	return(0);
}



esented by a single char with value 0200+N,  where N is
the index of the argument in the macro's definition. 

   Load the resulting line into Line[].
 */
	for (i = 0, j = 0; orsumacc/cc/as/mac.h   444      0     12       11612  3470501537   7227 #

/******************************************************************************
 *									      *
 *	MICAL Assembler Macro Header					      *
 *									      *
 *	These are the structure definitions and external declarations used to *
 * implement macros in the MICAL assembler. This file also contains a des-    *
 * cription of the implementation.					      *
 *									      *
 ******************************************************************************/




/*

MACRO IMPLEMENTATION

Overview
________


	The MICAL assembler defines and expands macros during the first pass.
No preprocessor is used. 

	When a .macro instruction is encountered during the first pass, the
assembler enters a separate macro defining mode, implemented by the
"Define_Macro" procedure in "mac.c". In this mode, text is read in verbatim
from the input file and associated with the name of the macro being defined
until a .end or .endm statement is encountered. Thus, no processing of the
statements (i.e. execution of pseudo-ops) within a macro is done at the
time the macro is defined. Processing of the statements in a macro is done
only when the macro is expanded.
	Thus only one macro is being defined at any given time. One may
have the definition of macro M2 within the definition of macro M1, but
M2 will actually be defined only when M1 is being expanded.
	When a .endm pseudo-op is identified during macro definition, the
assembler returns to normal assembly mode.

	When a macro is identified in the operation field of an statement
[Macro()], a structure containing the necessary information for the
expansion of the macro is created, and placed on a stack of such macro
calls [Expand_Macro()]. The use of a stack allows nested macro calls, and
even recursive macro calls. The maximum depth of nested (recursive) macro
calls is the defined parameter, MDEPTH_MAX.
	Whenever a macro is being expanded (identified by a structure on
the M_Stack) the routine Read_Line() will read in a source line from
the current macro being expanded instead of from the input file. Since
Define_Macro() uses Read_Line to get the text of a macro definition, this
allows macro definition during macro expansion.
	When a macro is expanded, the macro call itself and the expansion
are loaded into the temporary file which holds the source text between
passes 1 and 2.

	In the second pass, when a .macro is encountered, the assembler
again goes into a special mode similar to pass 1's. Each source line
is merely printed out, until either a .end or .endm statement is encountered,
whereupon normal processing resumes. 
	When a macro call is encountered in pass 2, it is simply listed.
Presumably the code for the macro expansion already follows the macro call.



Macro Definition
----- ----------

	The major data structure for macro definition is the M_defining
structure, reproduced below:
*/


/* Number of arguments to a macro */
#define	MARGS_MAX	16

/* Number of characters in all macro arguments combined (per macro call) */
#define	MARGCHAR_MAX	80

/* Number of nested macro calls */
#define MDEPTH_MAX	16

/* Number of conditional macros */
#define COND_MACROS	16

/* Macro definition information */

	struct {
		struct M_bkt	*bkt_md;		/* bkt for defined macro */
		char		buff_md[MARGCHAR_MAX];	/* storage for macro arguments */
		char		*args_md[MARGS_MAX];	/* ptrs into buff_md. These are the actual arguments */
		int		nargs_md;		/* number of (formal) arguments */
	} M_defining ;


/* Permanent macro information. These are organized like the symbol table 
	(see sym.c) */

	struct M_bkt {
		int		state_m;	/* Defining or Expanding */
		char		*name_m;	/* name of the macro */
		struct M_bkt	*next_m;	/* ptr to next bkt on chain */
		struct M_line	*text_m;	/* head of linked list of M_lines, which contain the text of the macro */
		int		ACS_m;		/* Automatically Created Symbol flags, one per possible macro argument */
	} _M_bkt;

/* Macro Expansion information. Each bucket is allocated upon expansion of
   	a macro. They are maintained in a stack via M_Stack */

	struct M_call {
		struct	M_bkt	*bkt_mc;		/* ptr to permanent info for this macro */
		char		buff_mc[MARGCHAR_MAX];	/* storage for actual arguments of macro call */
		char		*args_mc[MARGS_MAX];	/* ptrs into buff_mc, one per actual argument. */
		struct M_line	*line_mc;		/* ptr to next M_line to expand */
		int		rc_mc;			/* repeat count, for .irpb and .irpc */
	} _M_call;


/* Text Storage. Each line of a macro is stored separately, and is linked
to the following line of the macro. */

	struct M_line {
		struct M_line	*next_ml;		/* ptr to next line of the macro */
		char		*text_ml;		/* ptr to the char string for the line */
	} _M_line;


/* Macro Expansion Stack.
	Each time a macro is expanded, a  ptr to it's M_call structure is
placed on this stack. This allows nested and recursive macros. */

	struct M_call	*M_stack[MDEPTH_MAX];
	int 		Top_of_M_stack ;

/* Conditional Macro Test list */
	int 	CM_top;
	char	*CM_tests[COND_MACROS];

til a .end or .endm statement is encountered. Thus, no processing of the
statements (i.e. execution of pseudo-ops) witsumacc/cc/as/makefile   444      0     12         666  3470501537   7765 # Description file for 68000 assembler

CFLAGS =	-c -O -I/usr/sun/include -DBOOTSTRAP -DStanford 

OFILES =	as.o cond.o error.o eval.o init.o ins.o mac.o oper.o print.o\
		ps.o ps1.o ps2.o ps3.o random.o rel.o sdi.o spawn.o sym.o
 
as68: $(OFILES)
	cc -o as68 $(OFILES)

$(OFILES): mical.h

mac.o: mical.h mac.h

init.o ins.c: mical.h inst.h

install:
	cp as68 /usr/sun/bin/as68
	cp a68.hdr /usr/sun/lib

clean:
	rm -f *CKP *BAK *.o as68
 macro. */

	struct M_line {
		struct M_line	*next_ml;		/* ptr to next linsumacc/cc/as/mical.h   444      0     12       10702  3470501540   7545 #ifdef BOOTSTRAP
#include "/usr/include/stdio.h"
#else
#include <stdio.h>
#endif

/* Assembler parameters */
#define	STR_MAX		32	/* number of chars in any single token */
#define OPERANDS_MAX	4	/* number of operands allowed per instruction */
#define MNEM_MAX	8	/* number of chars in instruction mnemonic */
#define	LINE_MAX	132	/* Number of chars in input line */
#define	FILEID_MAX	15	/* number of files open at any one time */
#define	HASH_MAX	32	/* size of symbol, command, and macro hash tables */
#define	CONT_MAX	3	/* number of chars in control field of operand */
#define CODE_MAX	12	/* number of bytes generated for 1 machine instruction */
#define SSTACK_MAX	10	/* Max number of input source files open at any time */
#define ERR_MAX		50	/* Max number of different error codes */
#define CSECT_MAX	200	/* number of control sections */
#define COND_MAX	16	/* maximum depth of nested conditional blocks */

/* Error Codes */
#define E_END		1
#define E_BADCHAR	2
#define E_MULTSYM	3
#define	E_NOSPACE	4
#define	E_OFFSET	5
#define	E_SYMLEN	6
#define	E_SYMDEF	7
#define	E_CONSTANT	8
#define	E_TERM		9
#define	E_OPERATOR	10
#define	E_RELOCATE	11
#define	E_TYPE		12
#define	E_OPERAND	13
#define	E_SYMBOL	14
#define	E_EQUALS	15
#define	E_NLABELS	16
#define	E_OPCODE	17
#define	E_ENTRY		18
#define	E_STRING	19
#define	E_INSRT		20
#define	E_ATTRIBUTE	21
#define	E_.ERROR	22
#define	E_LEVELS	23
#define	E_CONDITION	24
#define	E_NUMOPS	25
#define	E_LINELONG	26
#define E_REG		27
#define	E_IADDR		28
#define E_UNIMPL	29
#define E_FILE		30
#define E_MLENGTH	32
#define E_MACARG	33
#define	E_MACFORMAL	34
#define E_ENDC		35
#define E_RELADDR	36
#define E_ARGUMENT	37
#define E_VECINDEX	38
#define E_VECMNEM	39
#define E_MACRO		40
#define E_TMACRO	41
#define E_CSECT		42
#define E_ODDADDR	43
/* Size Codes - These should agree with Rel size codes in b.h */

#define B 0	/* byte */
#define W 1	/* word */
#define L 2	/* long */


/* Print Codes */

#define	P_ALL		0
#define P_LC		1
#define P_NONE		2


/* Symbol attributes */

#define	S_DEC	01
#define S_DEF	02
#define S_EXT	04
#define S_LABEL	010
#define S_MACRO	020
#define S_REG	040
#define S_LOCAL 0100
#define S_COMM	0200
#define S_PERM	0400

/* Rel file and Csect attributes */
#define R_EXT	01
#define R_ISPC	02
#define R_PURE	04
#define R_ABS	010
#define R_DEC	020

/* Operand flags */
#define O_WINDEX 1
#define O_LINDEX 2
#define O_COMPLEX 4

/* Abbreviations */
#define FLAG	char
#define TRUE	1
#define FALSE	0
#define true	1
#define false	0


/* operand types */

#define t_reg	1
#define t_defer	2
#define t_postinc	3
#define t_predec	4
#define t_displ	5
#define t_index	6
#define	t_abss	7
#define t_absl	8
#define t_immed 9
#define t_normal 10
/* Instruction Hash Table */

struct ins_bkt {
	struct ins_bkt	*next_i;	/* ptr to next bkt  on the list */
	char		*text_i;	/* ptr to asciz instruction mnemonic */
	int 		code_i;		/* opcode index for dispatching */
	} ins_example;			/* example of ins_bkt, used for sizeof operation */

/* The instruction hash table itself. Each entry is the head of a linearly linked list
 * of ins_bkts.
 */
	struct ins_bkt *ins_hash_tab[HASH_MAX];

/* Csect descriptor */
	struct csect {
		char	*name_cs;	/* Name, usually stored with Store_String */
		long	len_cs;		/* Length in machine addresses, i.e., highest address referenced */
		long	dot_cs;		/* current dot in this cs, in machine addresses */
		int	id_cs;		/* ID # for output file */
		int	attr_cs;	/* attributes */
	} ;



/* Symbol bucket definition */
	struct sym_bkt{
		struct sym_bkt	*next_s;	/* next bkt on linked list */
		char		*name_s;	/* symbol identifier */
		long		value_s;	/* it's value */
		int		id_s;		/* id number for .rel file */
		struct csect	*csect_s;	/* ptr to it's csect */
		int		attr_s;		/* attributes */
	} ;

/* Code[], buffer for the generated code */ 
char Code[CODE_MAX];

struct oper {
 char type_o;			/* operand type info */
 char flags_o;			/* operand flags */
 char reg_o;			/* Register subfield value */
 struct sym_bkt *sym_o;		/* symbol used for relocation */
 long value_o;			/* Value subfield */
 long disp_o;			/* displacement value for index mode */
} Operand ;



/* VIP variables */

int	Pass ;			/* Pass number */
long	Dot ;			/* Assembly location counter */
char	Line[LINE_MAX+1];	/* buffer for source statement */
int	Position ;		/* current position in Line */
int	BC;			/* Byte count of current line */
long	tsize;			/* size of the text segment, valid on pass2 */
long	dsize;			/* size of the data segment */
long	bsize;			/* size of the bss segment */


#define	MARGCHAR_MAX	80

/* Number of nested macro calls */
#sumacc/cc/as/oper.c   444      0     12        7675  3470501540   7417 #include "mical.h"
char *oper = "~|^`s.oper.c R1.2 on 12/17/79";

/* Scan_Operand_Field(operands) puts the type of each operand encountered
   in the operands array, and returns the number of operands altogether.
*/

Scan_Operand_Field(operands)
 struct oper operands[];
 {	int numops,save;

	Non_Blank();
	save = Position;
	numops = 0;
	do {	if (Line_Delim(Line[Position])) break;
		Get_Operand(operands++);
		numops++;
		Non_Blank();
	} while (numops < 4);
	Position = save;
	return(numops);
 }


/* Op_Delim 	Returns TRUE if c marks the end of an operand field
 */

Op_Delim(c)
char c;
{
	register char *cp;
	for (cp = "\n|,:()@\014]"; *cp; cp++) if (c == *cp) return(TRUE);
	return(FALSE);
}


/* Num_Operands()	returns the number of operand fields on the current 
		statement, each of them separated by commas.
 */

Num_Operands() {
	register int i,count;	/* index and num of operands */
	register char C;
	int skip;		/* number of chars to skip in scanning the field */
	int save;		

	char 	S[STR_MAX];

	Non_Blank();					/* Move Position to first non_blank char */
	if (Line_Delim(Line[Position])) return(0);	/* If no chars left, no operands */
	count = 1;					/* at least one operand is there */
	skip = 0;					/* don't skip any chars */
	save = Position;
	while(Line_Delim(C = Line[Position]) == FALSE){	/* Look at rest of line */
		if (skip) skip--;
		else if (C == '<' || C == '{') {		/* if enclosed expression */
			Enclosed(C,C+2,S);		/* skip over it; C+2 is the ascii rep of > and } resp. */
			continue; }			/* Position is already past enclosed position */
		else if (C == '\'') skip = 1;
		else if (C == '\"') skip = 2;
		else if (C == ',') count++;			/* ',' separates operands */
		Position++;
	}
	Position = save;				/* restore Position */
	return(count);
}



/*
 * Fetches operand value and register subfields and loads them into
 * the operand structure. This routine will fetch only one set of value
 * and register subfields. It will move Position past a ',', so that
 * subsequent calls to Get_Operand will get succesive operands.
 * It will return FALSE if there were any programmer errors in the 
 * operand, TRUE otherwise.
 */

Get_Operand(opnd)
struct oper *opnd;
{
	char c;
	opnd->type_o=opnd->flags_o=opnd->reg_o=opnd->value_o=opnd->disp_o = 0;
	if (Line[Position] == '#')
	{
		Position++;	/* skip # */
		if (!Evaluate(opnd)) return;
		if (opnd->type_o == t_reg) Prog_Error(E_REG);
		opnd->type_o = t_immed;
	}
	else if (!Evaluate(opnd)) return;
	Non_Blank();
	while (c = Line[Position++]) switch(c)
	{
	case '\014':
	case '|':
	case '\n':
		Position--;		/* don't scan these */
	case ',':
		return;			/* i'm done */
	case ':':
		switch(Line[Position++])
		{
		case 'W':
		case 'w':
			opnd->type_o = t_abss;
			continue;
		case 'L':
		case 'l':
			opnd->type_o = t_absl;
			continue;
		default:
			return;
		}
	case '@':
		if (opnd->type_o != t_reg) return;
		opnd->type_o = t_defer;
		continue;
	case '+':
		if (opnd->type_o != t_defer) return;
		opnd->type_o = t_postinc;
		continue;
	case '-':
		if (opnd->type_o != t_defer) return;
		opnd->type_o = t_predec;
		continue;
	case '(':
		if (!Get_Defer(opnd)) return;
		continue;
	default:
		return;	
	}
	return;
}


/* Get_Defer	Process Displacement or Index Deferred Suboperands
 */

Get_Defer(opnd)
register struct oper *opnd;
{
	if (opnd->type_o != t_defer) return(FALSE);
	opnd->reg_o = opnd->value_o;
	if (!Evaluate(opnd)) return(FALSE);
	Non_Blank();
	switch(Line[Position++])
	{
	case ')':
		opnd->type_o = t_displ;
		break;
	case ',':
		opnd->disp_o = opnd->value_o;
		if (!Evaluate(opnd)) return(FALSE);
		if (opnd->type_o != t_reg) return(FALSE);
		if (Line[Position++] != ':') return(FALSE);
		switch(Line[Position++])
		{
		case 'W':
		case 'w':
			opnd->flags_o |= O_WINDEX;
			break;
		case 'L':
		case 'l':
			opnd->flags_o |= O_LINDEX;
			break;
		default:
			return(FALSE);
		}
		Non_Blank();
		if (Line[Position++] != ')') return(FALSE);
		opnd->type_o = t_index;
		break;
	default:
		return(FALSE);
	}						
	return(TRUE);
}

ganized like the symbol table 
	(see sym.c) */

	struct M_bkt {
		isumacc/cc/as/print.c   444      0     12       20246  3470501540   7613 #include "mical.h"
char *print = "~|^`s.print.c R1.5 on 1/22/80";

extern int *WCode;
extern FILE *listout;
/*	Print_Line, Print_No ;

	Print_Line() prints the current line to the appropriate file, depending on the pass.
		Pass 0:	(Descriptor file code) Nothing is printed;
		Pass 1:	The current error code and the source line is printed into the temproary file, for subsequent
			input to pass 2;
		Pass 2:	A regular assembly listing line is generated and printed into the standard output.
	Possible 'option's are:
		P_NONE:	List only the line number, error code (if any), and the source line.
		P_LC:	Same as P_NONE, but list value of location counter also.
		P_ALL:	Same as P_LC, but list the binary code generated as well.
	On pass 2, if the command line flag 'O_list' is zero (meaning no listing requested), then the line number 
	and error code of illegal statements is printed to the standard output.
*/

/* parameters to Print_No() */
#define ZS	0
#define ZP	1


/* External listing parameters */
int	L_radix = 16;		/* Radix for numbers in listing. Default is octal */
int	L_ndigits = 2;		/* Number of digits to express one byte in L_radix */

/* Listing option flags; set by .LIST and .NLIST directives */

struct {
	char	any_lf;		/* master switch. If 0, no listing at all is done */
	char	bin_lf;		/* binary code field of listing line */
	char	bex_lf;		/* binary extensions (e.g. from .word) */
	char	md_lf;		/* macro definitions */
	char	mc_lf;		/* macro calls */
	char	me_lf;		/* macro expansions */
	char	cnd_lf;		/* unsatisfied conditional blocks */
	char	ld_lf;		/* listing directives */
} Lflags =
	{ 1,1,1,1,1,1,1,0 } ;




Print_Line(option){
	register int i;		/* gen index */
	int fsave;
	extern FLAG	Ignore,		/* True if in unsatisfied conditional block, false otherwise */
			Expanding;	/* True if expanding a macro */
	extern int	Pass,		/* Pass number, obviously */
			Line_no,	/* Line number in source file */
			Code_length,	/* Number of bytes generated on this instruction */
			E_pass1,	/* Error code for pass 1 */
			Err_code;	/* Error code generated for current statement, valid only in pass 2 */
	extern char	Rel_mark,	/* (') if relocatable address generated, (<blank>) if not */
			E_warn,		/* (W) if current error is only a warning */
			O_print,
			O_list;		/* command line option, 1 if listing requested, 0 otherwise */
	extern FILE *Temp_file;	/* iobuf for intermediate file */
	extern char *lastc();

	if (Pass == 0) {	/* If in header file (pre-assembly code) */
		if (Err_code) Print_Error();	/* if error, print a msg on error output device */
		return;				/* otherwise, don't list anything */	}


	if (Pass == 1) {	/* On pass 1, create a line in the temporary file */
		putc(E_pass1,Temp_file);	/* put out error code in binary form */
		putc(Expanding?'*':' ',Temp_file);	/* put out * if macro expansion, blank otherwise */
		fputs(Line,Temp_file);		/* and put out source line */
		return; }
	if (O_list == 0 ) {	/* if no listing wanted , give him one anyway it there's an error */
		if (Err_code) Print_Error();	
		return; }


	if (Lflags.cnd_lf == 0 && Ignore) return;	/* if unsatisfied cond blocks not listed, don't */

	/* Check listing flags if line is to be listed. If there's an error,
		block is listed regardless of the flags. */
	if (Err_code == 0) 
		if (    (Lflags.any_lf == false) ||		/* .NLIST in effect */
			(Expanding && (Lflags.me_lf == false))	/* Macro expansion */
		   ) return;

/*
 *	Print listing line for pass 2; There are six fields: Line number, Expanding Flag, Location counter, Code, Error, and Source. 
	Each field is separated with 3 blanks; within a field, individual numbers are separated by one blank, 
	except for the Source field.

	Any changes made in the listing line format should be reflected in the routine
Extend() in the file ps1.c, which does the listing for binary extension instructions (e.g. .WORD).
 *
 */

  /* Line number and expanding flag */
	fprintf(listout, "%4d%c   ",Line_no,Expanding?'*':' ');		/* Print line number for all options */


  /* Location counter */
	if (option == P_NONE) Space_(3*L_ndigits+3);
	else {
		Print_No((Dot>>24)&0177,L_radix,L_ndigits,ZP);
		Space_(1);
		Print_No(Dot&0xFFFF,L_radix,2*L_ndigits,ZP);
		Space_(2); }
  /* Code */
	if (option == P_ALL && Lflags.bin_lf) {	/* If binary code listing desired */
	    for(i=0;i<CODE_MAX/2;i++)		/* For each possible word of generated code */
		if (i >= Code_length/2) Space_(2*L_ndigits+2);	/* Skip enough space if it wasn't actually generated */
		else {						/* If it was, print it out. */
			Print_No(0XFFFFL&((long)WCode[i]),L_radix,2*L_ndigits,ZP);
/*			if (i == Rel_byte_no) putc(Rel_mark, listout);	/* If this could be the low byte of a */
									/* relocatable address, mark it */
			/* else */ Space_(2); }				/* otherwise skip a space */
	} else Space_((CODE_MAX/2)*(2*L_ndigits+2));	/* If we don't want code listed, skip enough space for it */
  /* Error */
	Space_(2);					/* separate from other fields */
	if (Err_code) Print_No((long)Err_code,10,2,ZS);	/* if any error, print it's code */
	else Space_(2);					/* otherwise skip the field */
	putc(E_warn, listout);				/* put out 'W' if its a warning */
	Space_(2);					/* separate fields */
  /* Source line */
	fputs(Line, listout);				/* Nothing hard about that */

	/* if Line ends with form-feed, supply carriage return */
	if (*lastc(Line) == '\014') putc('\015', listout);
	return;
}


/* Space_(Numspaces) just puts 'Numspaces' blanks out */
Space_(Numspaces)
register int Numspaces;
{
	register int i;
	for(i=0;i<Numspaces;i++) putc(' ',listout);
}


/* Print_No(val,radix,width,z) :
	Argument	Explanation
	value:		number to be printed;
	radix:		8,10, or 16 for octal, decimal, or hexadecimal notation respictively;
	width:		field width--number is placed right-justified with left padding of blanks or zeroes;
	zflag:		ZP for zero left padding, ZS for blank (zero-suppress) padding;
 
	It treats 'value' as a 16 bit unsigned integer 
*/
Print_No(val,radix,width,zflag)
 long val;
 {
	register char 	Buf[16];
	register int	bl,T;

	bl = 15;			/* load buffer from the end */
	val &= 0177777L;		/* mask to 16 bits */
	do {				/* do...while so that a value of zero gets printed */
		T = val % radix;		/* get value of digit */
		if (val<0) T += radix;
		Buf[bl] = (T<10) ? (T+'0') : (T+'A'-10);	/* load ascii value of digit */
 		val = val / radix;		/* set up for next digit */
		--bl; --width; }
	while (val>0 && width>0 && bl >= 0) ;	/* we've got all of the digits */
	for(; width>0 && bl>=0; (--bl, --width))	/* left pad with zeroes or blanks */
		Buf[bl] = zflag ? '0' : ' ';
	for(bl++; bl<16; bl++) putc(Buf[bl],listout);		/* and print the buffer */
}

/* NList() -- implements .list, .nlist directives.

Listing options are noted in a Listing Flag table: Lflags, defined above. Entries are 1 if option is listed, 0 if not.

These flags are checked in the various routines that call Print_Line, and in
Print_Line itself.

This routine merely processes a .list or .nlist directive, which sets/resets the various listing flags.
The argument Which is 1 for .list directives, 0 for .nlist. Nlist() is called
from Pseudo(), in ps.c.
*/


NList(Which)
FLAG Which;
{
	char	S[STR_MAX];	/* utility char string */
	FLAG	args_there;	/* set if any arguments to .list/.nlist */
	extern  Lower();	/* convert to lower case function */

	if (Pass == 1) {	/* On pass 1, just copy line to temp file */
		Print_Line(P_NONE);
		return; }

	if (Lflags.ld_lf) Print_Line(P_NONE);	/* if listing directives are listed, then do so */
	
	/* Loop through the arguments, setting the appropriate listing flags */
	/*  If no arguments, set master switch */
	args_there = false;
	while (Get_Token(S)) {	/* pickup next argument */
		Lower(S);	/* convert to lower case */
		args_there = true;
		if (seq(S,"bin")) Lflags.bin_lf = Which;
		else if (seq(S,"bex")) Lflags.bex_lf = Which;
		else if (seq(S,"md"))  Lflags.md_lf = Which;
		else if (seq(S,"mc"))  Lflags.mc_lf = Which;
		else if (seq(S,"me"))  Lflags.me_lf = Which;
		else if (seq(S,"cnd")) Lflags.cnd_lf = Which;
		else if (seq(S,"ld"))  Lflags.ld_lf = Which;
		else Prog_Warning(E_ARGUMENT);			/* invalid argument */
		Non_Blank(); if (Line[Position]==',') Position++; /* skip comma */
	}
	if (args_there == false) Lflags.any_lf = Which;		/* if no args, then master switch set */
	return;
}

 P_ALL && Lflags.bin_lf) {	/* If binary code listing desired */
	    for(i=0;i<CODE_MAX/2;i++)		/* For each possible word of generated code */
		if (i >= Code_length/2) Space_(2*L_ndigits+2);	/* Skip enough space if it wasn't actually generated */
		else {						/* If it was, print it out. */
			Print_No(0XFFFFL&((long)WCode[i]),L_radix,2*L_ndigsumacc/cc/as/ps.c   444      0     12       22344  3470501540   7102 #include "mical.h"
#ifndef Stanford
#include <a.out.h>
#else Stanford
#include "b.out.h"
#endif Stanford

struct csect *Text_csect,*Data_csect,*Bss_csect;
#ifndef Stanford
struct exec filhdr;
#else Stanford
struct bhdr filhdr;
#endif Stanford
char	Ignore;	/* if nonzero, ignore code,e.g. unsatified conditional block */

/* Pseudo() is called from the main loop to process assembler directives. If
	finds a pseudo-op, it returns FALSE, to discontinue processing
	on the current line. Otherwise, it returns TRUE.

	It also detects direct assignment statements.

	If the assembler is in Ignore mode, i.e. processing lines in an 
unsatisfied conditional block, then Pseudo will list the line. Each of the
separate directive handlers, e.g. Byte(), is responsible for listing the
line if it is called. */

Pseudo() {
	char String[MNEM_MAX+1];	/* storage for the mnemonic */
	register char *S;		/* what we'll work with */
	int 	Save;			/* temp storage for Position */
	extern char O_debug;
	char	D;

	D = O_debug;
	S = String;			/* load the register */
	Save = Position;		/* Save the current position */
	if (Get_Token(S) == FALSE)	/* Pick up next token, */
		return(TRUE);		/* if not there, return */
	Lower(S);			/* Convert token to lower case */

	if (S[0] != '.') { 		/* If not start with '.', ignore it */
		Position = Save; return(TRUE); }

	if (seq(S,".end")) End();
	else if (Ignore) Print_Line(P_NONE);
		
	else if (seq(S,".long"))
	{
		if (Dot & 1) Prog_Error(E_ODDADDR);
		ByteWord(4);
	}
	else if (seq(S,".word"))
	{
		if (Dot & 1) Prog_Error(E_ODDADDR);
		ByteWord(2);
	}
	else if (seq(S,".byte"))  ByteWord(1);
	else if (seq(S,".macro")) Define_Macro();
	else if (seq(S,".rept"))  Rept();
	else if (seq(S,".ascii")) Asciiz(0);
	else if (seq(S,".asciz")) Asciiz(1);
	else if (seq(S,".blkb"))  Blkbw(1);
	else if (seq(S,".blkw"))  Blkbw(2);
	else if (seq(S,".blkl"))  Blkbw(4);
	else if (seq(S,".list"))  NList(TRUE);
	else if (seq(S,".nlist")) NList(FALSE);
	else if (seq(S,".insrt")) Insrt();
	else if (seq(S,".text")) { New_Csect(Text_csect); Print_Line(P_NONE); }
	else if (seq(S,".data")) { New_Csect(Data_csect); Print_Line(P_NONE); }
	else if (seq(S,".bss"))  { New_Csect(Bss_csect); Print_Line(P_NONE); }
	else if (seq(S,".globl")) Globl();
	else if (seq(S,".comm")) Comm();
	else if (seq(S,".radix")) Radix();
	else if (seq(S,".typef")) EPrintf('T');
	else if (seq(S,".printf")) EPrintf('P');
	else if (seq(S,".error")) EPrintf('E');
	else if (seq(S,".page")) Page();
	else if (seq(S,".defrs")) Defrs();
	else if (seq(S,".even")) Even();
	else { Position = Save; return(TRUE); };
	return(FALSE);
}




/* End()-- .end handler

	Preconditions:	Position is just after ".end".
	Side Effects:	Temp_file is closed and switched to source file;
			Per-pass variables are initialized; Header for .rel
			file is generated. On pass two, descriptions of errors
			are printed, along with symbol table, (at end of listing)
			and Done flag is set. Entry point is determined.
*/

struct sym_bkt	Entry_point ;	/* Entry point of assembly program, optional */
char	EntryFlag = 0;		/* non-zero if entry point is specified */
char	Done ;		/* when 1, assembly complete */

End(){
	extern FILE *Source_stack[];
	extern int	Ss_top;
	extern char	O_symtab,O_debug,O_global;	/* Set in init.c */
	extern FILE *Temp_file;
	extern char	Temp_name[];
	extern struct csect Csects[];
	extern int	Csect_load;	/* next available csect in Csects[] */
	register int i;
	register struct csect *p;

	Print_Line(P_LC);			/* Whichever pass, print the line */
/* Pass 2 */
		if (O_debug >2) printf("\n   End: Position=%d, ",Position);
	if (Pass > 1) {				/* On the second pass, */
		Error_Describe();		/* Print error descriptions, */
		if (O_debug == 0) unlink(Temp_name);	/* if not debugging, remove temporary file */
		if (O_symtab) Pr_Sym_Tab();	/* Print symbol table, */
		Fix_Rel();			/* patch up object file */
		Done = 1;			/* stop assembler */
		return; }

/* Pass 1 */
	fclose(Temp_file);
	if ((Temp_file = fopen(Temp_name, "r")) == NULL)
		Sys_Error("Cannot reopen temporary file %s", Temp_name);

	for(; Ss_top>=0; Ss_top--)		/* By clearing source stack */
		fclose(Source_stack[Ss_top]);
	Push_Source(Temp_file);

/* Pick up entry point */
	if (Num_Operands() > 0 && Get_Operand(&Operand)) {
		Entry_point.value_s = Operand.value_o;
		EntryFlag = 1;
	}

	sdi_resolve();	/* resolve span dependent instructions */

	for (p = &Csects[0], i=0; i < Csect_load; i++, p++)
		p->len_cs += sdi_inc(p, p->len_cs);

/* Will need to remove following if Pratt's algorithm for locating
instructions is to work. */
	tsize = (Text_csect->len_cs + 3) & ~3;	/* make long aligned */
	dsize = (Data_csect->len_cs + 3) & ~3;
	bsize = (Bss_csect->len_cs + 3) & ~3;

	Sym_Fix();	/* relocate and globalize */
	sdi_free();	/* release sdi blocks */
	Rel_Header();	/* Initialize output stuff */
	Start_Pass();	/* Init per-pass variables */
	return;
}

/* Ehead()     handles end of header file
	The header file consists of source statements that are executed before 
	every program, and is included in the source descriptor file for the
	machine. When end_of_file is reached on this file, this program is
	called.

	Assumptions:	Pass is 0, that is, the header file.
	Side_effects:	Starts pass 1 by calling Start_Pass; Aborts if any
			assembly errors in descriptor file 
*/

Ehead(){
	extern int Errors;			/* count of errors in this pass */

	if (Errors) Sys_Error("%d errors in descriptor file\n",Errors);
	Perm();		/* make all symbols permanent */
	Start_Pass();
}


/* Initialize per-pass variables */

Start_Pass() {
	extern int Errors,Warnings,Err_load,Line_no;
	extern struct sym_bkt *Last_symbol;	/* ptr to last defined sym */
	extern struct sym_bkt *Dot_bkt;		/* ptr to sym_bkt for Dot */
	extern char O_debug;
	extern struct csect Csects[];
	extern int Csect_load;
	register int i;


	Line_no = 0;
	Errors = 0;
	Warnings = 0;
	Err_load = 0;
	Pass++;
	if (Pass != 2) for (i=0; i<Csect_load; i++) Csects[i].dot_cs = 0;
	else
	{
		Text_csect->dot_cs = 0;
		Data_csect->dot_cs = tsize;
		Bss_csect->dot_cs = tsize + dsize;
	}
	Last_symbol = Dot_bkt;	/*ONLY defined symbol at the start of a pass */
	New_Csect(&Csects[0]);	/* start in text segment */
	if (O_debug > 2) printf("\n   Start_Pass: Pass=%d\n",Pass);
}

/* Defrs(): DEFine Register Symbol.
 *	This routine is called in the header code to define those symbols 
 * that represent registers, accumulators, etc. on the machine. These
 * symbols have the S_REG flag set as an attribute, so that an error is
 * generated when their value is attempted to be changed.
 *	Syntax is:
 *	.defrs  <name>,<value>[,<name>,<value>]...
 */
Defrs() {
	char 	S[STR_MAX];	/* working string */
	register struct sym_bkt *sbp;
	struct sym_bkt *Lookup();

	while(Get_Token(S)) {		/* Pick up the name of the symbol */
		sbp = Lookup(S);	/* Make a sym_bkt for it */
		Non_Blank();		/* find the ',' */
		if (Line[Position] == ',') Position++;		/* move past it */
		if ((Get_Operand(&Operand) == 0) || Operand.sym_o ) {	/* Evaluate the expression, must be absolute */
									/* This moves Position past second ',' */
			Prog_Error(E_OPERAND);
			break; }
		sbp->value_s = Operand.value_o;			/* Load the sym_bkt */
		sbp->csect_s = 0;
		sbp->attr_s = S_DEC | S_DEF | S_REG;
	}
	Print_Line(P_NONE);
	return;
}

/* #define CMD_LCS 27 */

/* Equals() is called from Label() to evaluate the operand field of a direct
	assignment statement and then to assign this value to the symbols on
	the left side of the '='. The array Label_list is a list of ptrs to 
	the sym_bkt structures of each variable that is to be assigned. 
*/

Equals() {
	register int i,Got;	/* Got is TRUE if the operand field has been evaluated */
	register struct sym_bkt *sbp;
	extern struct sym_bkt *Label_list[];	/* ptrs to the symbols on the left side */
	extern int Label_count;		/* num of symbols on left side */
/*	extern char Cmd_buffer[];		/* buffer of commands for the current text block of .rel file */
	extern struct csect *Cur_csect;	/* ptr the the current csect */
	extern int E_pass1;		/* if nonzero on pass1, causes non-ignored error */
	extern struct sym_bkt *Dot_bkt;	/* ptr to symbol bucket for dot */

	Got = 0;			/* haven't read operand yet */
	for(i=0;i<Label_count; i++) {	/* For each symbol to be defined, */
		sbp = Label_list[i];	/* pick up the ptr to it */
		if (Label_list[i] == Dot_bkt) {	/* Treat the ". = " statement specially */
			if (Got == 0) {		/* Pick up the operand if we haven't already */
				if (Get_Operand(&Operand) == FALSE) {			/* if any error, */
					E_pass1 = E_OPERAND; break; }	/* Cause an error in pass 1 */
				Got++; }
			/* Make sure expression is in current csect, or is absolute */
			if (Operand.sym_o && Operand.sym_o->csect_s != Cur_csect) {
				E_pass1 = E_OPERAND; break; }
			Dot = Operand.value_o;			/* assign location counter */
			}
		else {		/* If it's not a .= statement, */
			if ((Got++ == 0) && (Get_Operand(&Operand) == FALSE)) break;	/* Evaluate the operand */
			sbp->value_s = Operand.value_o;	/* Load value of expression into symbol */
			sbp->csect_s = Operand.sym_o? Operand.sym_o->csect_s:0;
			if (sbp->attr_s & S_LABEL) Prog_Error(E_EQUALS);
			else sbp->attr_s = Operand.sym_o ? (Operand.sym_o->attr_s&~(S_LABEL|S_PERM)): (S_DEC|S_DEF);
		}
	}
	Print_Line(P_NONE);
	return;
}
/*
 * .even handler
 */
Even()
{
	if (Dot&1) {
		Dot++;
		Code[0] = 0;
		Put_Text(Code,1);
	}
	Print_Line(P_LC);
}

extern int Errors;			/* count of errors in this pass */

	if (Errors) Sys_Error("%d errors in descriptor file\n",Errors);
	Perm();		/* make all symbols permanent */
	Start_Pass();
}


/* Initialize per-pass variables */

Start_Pass() {
	extern int Errors,Warnings,Err_load,Line_no;
	esumacc/cc/as/ps1.c   444      0     12       15454  3470501540   7167 #include "mical.h"
char *ps1 = "~|^`s.ps1.c R1.9 on 12/18/79";

/*
 *	mical assembler-- .byte, .word, .long, .ascii, and .asciz handlers 
 *
 */


/* Print_No zero-suppress and zero-pad flags */
#define	ZS	0
#define	ZP	1

/* Extend()'s flush flag */
#define NOFLUSH	0
#define	FLUSH	1


/* initialized static variables for Extend() */
long Ext_buf[CODE_MAX];	/* the buffer for values */
char Ext_mark[CODE_MAX];	/* the buffer for corresponding Rel_mark */
int Ext_load = 0;		/* num of values in Ext_buf */
char Extension = 0;	/* 1 if first listing line printed already */
int Ext_nbytes = 0;	/* set by the calling routine, number of bytes to print for each value */

/* ByteWord(Which):	Which is 1 if a .BYTE was found by Pseudo(), and
			2 if a .WORD was found, 4 is .LONG was found
*/

struct {
	char	any_lf;		/* master switch. If 0, no listing is done */
	char	bin_lf;		/* binary code field of listing line */
	char	bex_lf;		/* binary extensions (e.g. from .word) */
	char	md_lf;		/* macro definitions */
	char	mc_lf;		/* macro calls */
	char	me_lf;		/* macro expansions */
	char	cnd_lf;		/* unsatisfied conditional blocks */
	char	ld_lf;		/* listing directives */
} Lflags ;

/* ByteWord -	Generate Constant Data */
ByteWord(Which)
register int Which;
{
	register int i;
	int Num;		/* number of bytes/words to pick up */
	
	extern char	O_list,		/* flag, 1 if listing requested */
			Code[];		/* generated code used by Put_Rel */
	extern int	Err_code;
	int *WCode = (int *)&Code[0];

	Ext_nbytes = Which==1?1:2;
	Num = Num_Operands();
	for (i = 0; i < Num; i++)		/* for each byte/word, */
	{
		Get_Operand(&Operand);
		if (Operand.type_o != t_normal) {
			Operand.sym_o = 0;
			Operand.type_o = t_normal;
			Operand.value_o = 0;
			Prog_Error(E_OPERAND);
		} else {
			if (Operand.sym_o)
				Put_Rel(&Operand, Which==1?B:Which==2?W:L, Dot+i*Which);
		}
		if (Which == 4) {
			WCode[0] = Operand.value_o >> 16;
			WCode[1] = Operand.value_o;
		} else
			WCode[0] = Operand.value_o;
		if (Which == 1)
			Put_Text(WCode, Which);
		else
			Put_Words(WCode, Which);
		if (Pass == 2 && O_list)
		{
			if (Which == 4)
			{
				Extend(Operand.value_o >> 16, NOFLUSH);
				Extend(Operand.value_o & 0xFFFF, NOFLUSH);
			}
			else Extend(Operand.value_o,NOFLUSH);
		}
	}
	if (Pass == 1) Print_Line(P_NONE);	/* copy line to temp */
	else if (O_list) Extend(0L,FLUSH);	/* list all of the values */
	else if (Err_code) Print_Error();	/* tell him about the error */
	BC = Num*Which;				/* increment byte count */
}

/*
 * Asciiz(Z):	called from Pseudo() with Z=0 for .ASCII and Z=1 for .ASCIZ 
 *
 *	Format of statement:
 *		.ASCII	"<chars>"
 *	where <chars> may include special escaped chars (see Grab_Char() )
 */

Asciiz(Z)
int Z;
{
	register int C;			/* the current character */
	register int count;		/* num of chars in string */
	register char delim;		/* string delimiter */
	extern int Code_length;		/* num of bytes of generated code */
	extern FLAG O_list;		/* listing flag */
	extern int	Err_code;	/* error code */

	Non_Blank();			/* first non-blank is delimiter */
	delim = Line[Position];
	if (Line_Delim(delim)){		/* no string, so nothing to do */
		Print_Line(P_LC);
		return; }

	Position++;			/* move up to first char */

	Code_length = Ext_nbytes = 1;	/* handling one-byte animals */
	/* changed to allow | in the middle of user strings -- JEA 5/5/81 */
	/* changed to allow \delimiter -- Per Bothner@Stanford 82/Oct/14 */
	/* changed (C=Grab_Char())>0 to >=0 -- Bothner@Stanford 83/Dec/21 */
	for(count=0;
	    ( !Line_Delim(C = Line[Position]) || C == '|')
		&& C != delim && (C = Grab_Char()) >= 0;
	    count++)
		 LoadChar(C);	/* Handle the string proper */
	if (C != delim) Prog_Error(E_STRING);
	if (Z && C>0) { LoadChar(0); count++; }	/* do final zero if needed */
	if (Pass == 1) Print_Line(P_NONE);
	else if (O_list) Extend(0L,FLUSH);	/* flush the listing line */
	else if (Err_code) Print_Error();
	BC = count;			/* and increment Dot */
	return;
}

/* routine to load a char into the .rel file and list it */
LoadChar(C)
register int C; {
	extern char O_list;		/* 1 if listing wanted */

	Code[0] = C;			/* move char into code buffer, so */
	Put_Text(Code,1);
	if (Pass == 2 && O_list) Extend ((long)C,NOFLUSH);
}

/* Extend(Value,Fflag):
 * 	lists the current line, and any extensions for binary code.
 *	A buffer is kept of values to be listed in the code portion of the
 * listing line. When this buffer is full, the current line (or extension) is
 * printed out.
 *	Fflag, the flush flag, is 1 when this buffer is to be flushed, and
 * the last listing line is to be printed. Fflag should be zero otherwise.
 */


Extend(Value,Fflag)
long Value; int Fflag;
{
	register int i;
	extern FILE *listout;		/* file id of listing file */
	extern int 	L_radix,	/* listing radix, for Print_No() */
			L_ndigits,	/* also for Print_No() */
			Line_no,	/* current line number */
			Err_code;	/* current error code */
	extern char	Rel_mark,	/* ' if operand value is relocatable */
			E_warn;		/* W if current error is warning */
	extern FLAG	Expanding;	/* macro expansion flag */

	if (Lflags.any_lf == false) return;			/* if in .nlist mode, no listing at all */
	if (Fflag || (Ext_load * Ext_nbytes) >= CODE_MAX) {	/* If we need to flush the buffer, */
		if (Extension == 0) {			/* Check if this is the first listing line, */
			fprintf(listout, "%4d%c   ",Line_no,Expanding?'*':' ');	/* and if so, give him line number and Dot */
			Print_No((Dot>>24)&0177,L_radix,L_ndigits,ZP);
			Space_(1);
			Print_No(Dot,L_radix,2*L_ndigits,ZP);
			Space_(2); }
		else Space_(3*L_ndigits+11);		/* if it's an extension, skip Line number and Dot listing fields */
		if (Extension && (Lflags.bex_lf == false)) return; /* if binary extension disabled, skip it */
		for (i=0; i < Ext_load; i++) {		/* List the binary code */
			Print_No(Ext_buf[i], L_radix, Ext_nbytes * L_ndigits, ZP);	/* as words or bytes */
			putc(Ext_mark[i], listout);
			if (Ext_nbytes == 2) putc(' ', listout);
			else if (Ext_nbytes == 4) fprintf(listout, "    ");
		}
		for(i= Ext_load*Ext_nbytes; i < CODE_MAX; i++) Space_(L_ndigits+1);	/* skip to end of code field */
		Space_(2);			/* skip to error field */
		if (Err_code) Print_No((long)Err_code,10,2,ZS); 	/* and print error code, if any */
		else Space_(2);
		putc(E_warn, listout); Space_(2);
		if (Extension == 0) {		/* if this is the first line, */
			Extension++;		/* the next one's an extension */
			fprintf(listout, "%s",Line); }	/* List the source line */
		else putc('\n', listout);		/* if it's already an extension, just end the line */
		Ext_load = 0;
		Err_code = 0;			/* since we just printed it */
	}

	if (Fflag == 0)			/* if we're not flushing, load the value into buffer */
	 {  Ext_buf[Ext_load] = Value;
	    Ext_mark[Ext_load++] = Rel_mark;
	 };
	if (Fflag) {				/* if this was our last call for the current source line, */
		Extension = 0;			/* reset the static variables */
		Ext_nbytes = 0; }
	return;
}

miter */
	extern int Code_length;		/* num of bytes of generated code */
	extern FLAG O_list;		/* listing flag */
	extern int	Err_code;	/* error code */

	Non_Blank();			/* first non-blank is delimiter */
	delim =sumacc/cc/as/ps2.c   444      0     12       15627  3470501540   7172 #include "mical.h"
char *ps2 = "~|^`s.ps2.c R1.4 on 12/13/79";
/*
 *
 *	Handlers for pseudo-ops--
 *
 *		.BLKB, .BLKW, .BLKL
 *		.CSECT, .ASECT
 *		.RADIX
 */

/* size of radix_tab */
#define RTSIZE	8


struct csect Csects[CSECT_MAX] =
{
		".text",0,0,0,R_ISPC|R_PURE,	/* text csect */
		".data",0,0,0,0,		/* data csect */
		".bss",0,0,0,0			/* uninitialized csect */
} ;
int Csect_load = 4;			/* Next available csect in Csects[] */
struct csect	*Cur_csect = &(Csects[0]);	/* ptr to current csect */
struct csect	*Text_csect = &(Csects[0]);
struct csect	*Data_csect = &(Csects[1]);
struct csect	*Bss_csect = &(Csects[2]);

extern char *Store_String();
extern struct sym_bkt *Lookup();

/* Blkbw(Which)--	.blkb, .blkw, .blkl handler
 *
 *	Which is 1 for .blkb, 2 for .blkw, 4 for .blkl
 *	Reads an operand specifying the number of bytes/words to reserve space
 *      for, and moves the location counter past this block.
 */

Blkbw(Which)
register int Which;
{
	register int 	Num;
	extern int 	E_pass1;	/* for errors in pass 1 */
	long int	fill = 0;
	register int	i;

	if (Get_Operand(&Operand) && (Operand.sym_o == 0)
	    && ((Num = Operand.value_o) >= 0))
		BC = Num * Which;	/* this many bytes */
	else Prog_Error(E_pass1 = E_CONSTANT);
	for (i=0; i<Num; i++)		/* have to output filler bytes */
		Put_Text((char *)&fill, Which);
	Print_Line(P_LC);
}

/*
 *
 *	Csect()-- .csect handler
 *
 *	Format:		.csect	[<name>] [[,<attr>],<attr>]
 *	<name> is any legal symbol name, <attr> is either EXT or ABS, for
 * external and absolute attributes.
 * 	if <name> is absent the default (unnamed) csect is entered.
 *
 */
Csect()
{
	register struct csect	*csp;
	register int		i;
	register char		S[STR_MAX];
	FLAG			Defining,	/* when csect being entered for first time */
				Warn;		/* when he uses illegal attributes */
	extern struct csect	Csects[],	/* collection of csects */
				*Cur_csect;
	extern int		Csect_load;	/* next available csect in Csects[] */
	Defining = Warn = FALSE;
	if (((i = Get_Token(S)) == 0) && (Line_Delim(Line[Position]) == false))
		Prog_Error(E_SYMBOL);
	else {
		if (i == 0)
			csp = &Csects[0];
		else {
			for (i=0; i< Csect_load; i++)
			    if (seq(Csects[i].name_cs,S)) break;
			csp = &(Csects[i]);
			if (i == Csect_load) {	/* Make a new csect */
				Defining = TRUE;
				Csect_load++;
				csp->name_cs = Store_String(S);
				csp->len_cs = csp->id_cs = csp->attr_cs = csp->dot_cs = 0; }
			Non_Blank();
			do {
				if (Line[Position] == ',') Position++;
				if (Get_Token(S) == 0) {
				    if (Line_Delim(Line[Position]) == 0) Warn = TRUE;
				    break; }
				Lower(S);
				if (seq(S,"abs"))
				    if ((Defining == FALSE) && ((csp->attr_cs & R_ABS) == 0))
					Warn = TRUE;	/* redeclared attribute */
				    else csp->attr_cs |= R_ABS;
				else if (seq(S,"ext"))
				    if ((Defining == FALSE) && (( csp->attr_cs & R_EXT) == 0))
					Warn = TRUE;
				    else csp->attr_cs |= R_EXT;
				else Warn = TRUE;
				Non_Blank();
			    } while (Line[Position] == ',');
	
			if (Warn) Prog_Warning(E_ATTRIBUTE);
		}
		New_Csect(csp);		/* move to new csect */
	    }
	Print_Line(P_NONE);
}
/* New_Csect(csp)
 *	Input:	argument csp is a ptr to csect structure
 *	Side effects:	1. "The current csect" is made to be *csp.
 *			2. A symbol with the same name as the new csect is created, with the value of zero in that csect
 *			3. The appropriate command for the .rel file is loaded on pass 2.
 *	Called From:	Csect()
 */
New_Csect(csp)
register struct csect *csp;
{
	register struct sym_bkt *sbp;	/* for defining new symbol */
	extern struct csect *Cur_csect;	/* ptr to current csect */
	extern struct sym_bkt	*Last_symbol;	/* used for local symbols */
	extern struct sym_bkt	*Dot_bkt;	/* sym_bkt for location counter */
	
	Cur_csect = csp;
	Dot = csp->dot_cs;
	Dot_bkt->csect_s = Cur_csect;	/* update dot's csect. Dot_bkt->value_s will be updated in the main loop */

	sbp = Lookup(csp->name_cs);
	sbp->attr_s |= S_DEC | S_DEF | S_LOCAL;	/* local attribute so it won't be listed in symbol table */
	sbp->csect_s = Cur_csect;
	sbp->value_s = 0;
	Last_symbol = sbp;

}
/*
 *	Radix()--	.radix handler
 *
 *	Format:		.radix	{in,out}, <radixname>
 *		"in" refers to the default radix for numbers in source statements
 *	"out" refers to the radix of the LC and Code fields on the output listing.
 *		<radixname> is one of the following strings:
 *	'2','8','10','16','binary','octal','decimal', or 'hex'.
 */

struct rt_entry {
	char	*name_r;		/* name of radix */
	int	value_r, cpb_r;	/* value and chars per byte */
} radix_tab[RTSIZE] =
       {"octal", 8, 3,
	"8", 8, 3,	
	"decimal", 10, 3,
	"10", 10, 3,
	"hex", 16, 2,
	"16", 16, 2,
	"binary", 2, 8,
	"2", 2, 8  
       };

Radix() {
	register int i;
	register char S[STR_MAX];
	register int rad;
	FLAG	Got,In,Error;
	extern int In_radix,L_ndigits,L_radix;

	if (Get_Token(S)== 0) Error++;
	else {
		Lower(S);
		Got = FALSE;
		In = FALSE;
		if (seq(S,"out")) In = FALSE;
		else  if (seq(S,"in")) In = TRUE;
		else Got = TRUE;			/* got the radix */
		Error = 0;
		Non_Blank();
		if (Line[Position] == ',') Position++;
		if (Got || Get_Token(S)) {		/* pick up radixname, if we don't have it yet); */
			for (i=0; i<RTSIZE; i++) 
			    if (seq(radix_tab[i].name_r,S)) {
				rad = radix_tab[i].value_r;
				if (In) { In_radix = rad; break; }
				else {
				    L_radix = rad;
				    L_ndigits = radix_tab[i].cpb_r;
				    break; }
			    }
			if (i>=RTSIZE) Error++;
		}
	}
	if (Error) Prog_Error(E_OPERAND);
	Print_Line(P_NONE);
	return;
}

/* Insrt()-	.insrt handler
 *	source line is:		.insrt	/<filename>/
 *
 * where / means any character and <filename> is a valid UNIX filename.
 * 	Side Effects: opens filename for reading and pushes an io-buffer for
 * it onto Source_stack. This causes input to the assembler to come from the
 * indicated file. Upon eof, input resumes from the previous input file.
 *	.insrt's can be nested to a depth of SSTACK_MAX files.
 */

Insrt() {

	register char 	C;
	extern	int E_pass1;
	char		filename[STR_MAX], delim;
	FILE	 	*iop;
	FLAG		eflag = false;
	int		i;

	if (Pass == 2) {
		Print_Line(P_NONE);
		return;
	}

					/* Pick up name of file */
	Non_Blank();			/* locate delimiter character of string containing filename */
	delim = Line[Position];
	if (Line_Delim(delim)) eflag = true;		/* no filename specified */
	else {
		Position++;				/* move past delimiter */
		for (i=0; (C=Grab_Char()) > 0 && C != delim && i < STR_MAX-1 && !Line_Delim(C); i++)
			filename[i] = C;		/* pick up string */
		if (C != delim) Prog_Error(E_pass1 = E_STRING);	/* invalid string representation */
		else {
		    filename[i] = 0;			/* end of filename */
		    Position++;				/* move past closing delimiter */
		    if ((iop = fopen(filename,"r")) !=NULL) Push_Source(iop);
		    else eflag = true;
		}
	}

	if (eflag) Prog_Error(E_pass1 = E_FILE);
	Print_Line(P_LC);
	return;
}


Page()
{
	extern int Line_no;
	extern FILE *listout;
	extern int O_list;

	Line_no--;
	if (Pass == 1) {
		Print_Line(P_NONE);
		return; }

	if (O_list) fprintf(listout, "\014\n");
}

while (Line[Position] == ',');
	
			if (Warn) Prog_Warning(E_ATTRIBUTE);
		}
		New_Csect(csp);		/* move tsumacc/cc/as/ps3.c   444      0     12       11610  3470501541   7160 #
#include "mical.h"
char *ps3 = "~|^`s.ps3.c R1.6 on 5/19/80";

extern struct sym_bkt *Lookup();

/* Globl() -- .GLOBL directive handler 

	Format of statement:	.GLOBL	<sym> [<sym>]...

This directive declares  global symbols, which are symbols that are declared
(and hence may appear in expressions) but are not defined (have a value).

*/

Globl() {
	char	S[STR_MAX];
	struct sym_bkt *sbp;

	Non_Blank();
	if (Pass ==1) do {
		if (Line[Position] == ',') Position++; Non_Blank();
		if (Get_Token(S) == 0)  {
			if (! Line_Delim(Line[Position]))
				Prog_Error(E_SYMBOL);
			break; }
		sbp = Lookup(S);		/* get symbol bucket */
		sbp->csect_s = 0;		/* don't know which */
		sbp->attr_s |= S_DEC | S_EXT;	/* declared and external */
		Non_Blank();			/* any more symbols to define*/
	   } while(! Line_Delim(Line[Position])) ;

	Print_Line(P_NONE);
	return;
}
/* Comm - .comm directive handler

	Format of statement:	.COMM   <sym>,<length>

Comm symbols are sort of like globals but have a length property.

*/

Comm()
{
	char	S[STR_MAX];
	struct oper op;
	struct sym_bkt *sbp;

	Non_Blank();
	if (Pass ==1) do
	{
		if (Line[Position] == ',') Position++; Non_Blank();
		if (Get_Token(S) == 0)
		{
			if (! Line_Delim(Line[Position])) Prog_Error(E_SYMBOL);
			break;
		}
		sbp = Lookup(S);
		sbp->csect_s = 0;	/* make it undefined */
		sbp->attr_s |= S_DEC | S_EXT | S_COMM;
		Non_Blank();
		if (Line[Position++] != ',') Prog_Error(E_OPERAND);
		Evaluate(&op);
		if (op.type_o == t_reg) Prog_Error(E_REG);
		sbp->value_s = op.value_o;
		Non_Blank();
	   } while(! Line_Delim(Line[Position])) ;

	Print_Line(P_NONE);
	return;
}



/* Print Symbol Table */

Pr_Sym_Tab() 
{
	register int		attr;
	register struct sym_bkt	*sbp;
 
	char			Name[STR_MAX];			/* <title>.sym, to temporarily hold symbol table */
	int			hash_index;
	int			Sta[3];				/* Status table for spawn routine */

	extern char		Title[];
	extern FLAG		O_symtab;
	extern int		L_ndigits,
				L_radix;
	extern struct sym_bkt	*sym_hash_tab[];
	FILE 			*symout;
	if (O_symtab == false) return;				/* O_symtab flag must be set */

/* Open a file to hold the symbol table listing */

	Concat(Name,Title,".sym");				/* make the name of the file */
	if ((symout = fopen(Name, "w")) == NULL)
	{
		printf("Can't open symbol file: %s\n",Name);
		return;
	}

	/* (output of printf will now go to the file just created) */

/* walk down symbol table, creating a line for each symbol to be listed */
	for (hash_index = 0; hash_index < HASH_MAX; hash_index++) 
	    for (sbp = sym_hash_tab[hash_index]; sbp; sbp = sbp->next_s) {

		attr = sbp->attr_s;
		if (attr & (S_REG | S_MACRO | S_LOCAL | S_PERM)) continue;	/* skip register, macro, local and permanent variables */
		fprintf(symout, "%-10s  ",sbp->name_s);				/* print symbol name */
		fprintf(symout,"%O", sbp->value_s);
		fprintf(symout," %c%c", attr&S_DEF? ' ' : 'U', 			/* print "Undefined" and "External" flags */
				attr&S_EXT? 'E' : ' ');
		fprintf(symout, "\n");
	    }


/* create a sub-process to sort the symbol table listing */
	fclose(symout);
#ifndef Stanford
	spawnl(Sta,"/bin/sort","sort",Name,"-o",Name,0);	/* spawn a process to execute a sort command */
#else Stanford
	spawnl(Sta,"/usr/bin/sort","sort",Name,"-o",Name,0);	/* spawn a process to execute a sort command */
#endif Stanford
	wait(0);
}


/* EPrintf -- hands .printf and .errorf statements 

	The single argument is a character which is 'P' for a .printf statement, and 'E' for .errorf.
*/


EPrintf(EP)
char EP; 
{
	extern FILE *listout;	/* listing file id */
	int	Arg[10];	/* numerical arguments to printf statement */
	int	i;
	char	C,		/* Current Character */
		Format_String[LINE_MAX]; /* ptr to start of format string */

	if (Pass == 1) {		/* ignore during pass1 */
		Print_Line(P_NONE); return; }

	Non_Blank();		/* Find start of format string in MICAL statement */
	if (Line[Position++] != '\"') goto Error_return;

	for (i=0; i < LINE_MAX; i++) {		/* This loop exits when
							1.   The end of the format string is encountered ("); or 
							2.   A premature end of line is encountered. */
		/* Grab_Char grabs the next char on the source line, doing escape processing ( see eval.c) */
		if (Line[Position] == '\n' || Line[Position] == '\014' || (C = Grab_Char()) == -1) 	/* get next char */
			goto Error_return; 
		if (C == '\"') {		/* proper end of string */
			Format_String[i] = 0;
			break; }
		else Format_String[i] = C;	/* otherwise load into format string */
	}

	for (i=0; i<10 && ! Line_Delim(Line[Position]); i++) {	/* pickup up to 10 numeric arguments */
		Non_Blank();
		if (Line[Position] == ',') Position++;
		Get_Operand(&Operand);
		Arg[i] = Operand.value_o;
	}
	if (EP == 'E') Prog_Error(22);		/* Cause error if .error statement */
	
	fprintf((EP == 'T')?stdout:listout, Format_String, Arg[0],Arg[1],Arg[2],Arg[3],Arg[4],Arg[5],Arg[6],Arg[7],Arg[8],Arg[9]);

	Print_Line(P_NONE);
	return;

Error_return:
	Prog_Error(31);					/* Invalid string error */
	Print_Line(P_NONE);
	return;
}

nt	value_r, cpb_r;	/* value and chars per byte */
} radix_tab[RTSIZE] =
       {"octal", 8, 3,
	"8", 8, 3,	
	"decimal", sumacc/cc/as/random.c   444      0     12       15622  3470501541   7742 #include "mical.h"
char *random = "~|^`s.random.c R1.3 on 11/8/79";

/* Various useful subroutines */


/* Get_Token(S) reads the next Token, or symbol, from the input line,
	starting at the current Position. It returns the number of chars
	in the token that was found. */

Get_Token(S)
register char S[];
{
	register char C;
	register int i;
	extern char O_debug;

	for (;((C=Line[Position]) == ' ') || (C == '\t');Position++);
	for(i=0; (( (C = Line[Position]) >='0' && C <= '9') ||
			(C >= 'a' && C <= 'z') ||
			(C >= 'A' && C <= 'Z') ||
			(C == '_') || (C == '.') || (C == '$')); (Position++,i++) ) {
		if (i >= STR_MAX) { Prog_Error(E_SYMLEN); i--; break; }
		S[i] = C;
	}
	S[i] = 0;
	return(i);
}


/*
 *
 *  Parsing Routines: Non_Blank(), Skip_Comma(), Line_Delim(), Enclosed()
 *
 */

/* Move Position to the next non-blank character in  the input Line */
Non_Blank(){
	register char C;
	for (;((C=Line[Position]) == ' ') || (C == '\t');Position++);
}

/* Move Position past any comma and to the next non-blank */
Skip_Comma() {
	Non_Blank();
	if (Line[Position] == ',') Position++;
	Non_Blank();
}


/* List of possible line delimiters */
char Line_end_tab[] = { '\n', '|', '\014', 0 } ;

/* Line_Delim(c) returns true if c marks the end of a statement */
Line_Delim(C)
register char C; {
	register char *cp;

	for(cp= Line_end_tab; *cp; cp++) if (C == *cp) return(TRUE);
	return(FALSE);
}

/*
 * Enclosed(left, right, S) 
 *		Extracts char strings enclosed (possibly nested) within delimiter characters
 *	Current line position must be at left delimiter (i.e. Line[Position] == left;) .
 * 	"left" and "right", and places result in string S.
 *		Returns number of chars in S.
 */
Enclosed(left,right,S)
char left,right,S[];
{
	register char	C;
	register int	i;
	int	level;

	if ((C=Line[Position]) != left) return(0);
	for (i=0,level=1; i<STR_MAX && ! Line_Delim(C); i++) {
		C = S[i] = Line[++Position];
		if ((C == right) && (--level) <= 0) {
			Position++;
			S[i] = 0;
			return(i); 
		}
		else if (C == left) level++;
	}
	
	return(0);
}


/* 
 * Get_Encl_String(S) -- Get Enclosed String
 *
 *   			Extract char string from current line position of the form:	
 *				<string>
 *				(string)
 *				"string"
 *				^%string%   , % any character.
 *			String is placed in S.
 *			Returns # chars in S.
 */
Get_String(S)
register char S[];
{
	register char C;
	register int i;

	Non_Blank();
	C = Line[Position];
	if (C == '(') return(Enclosed('(',')',S));
	if (C == '<') return(Enclosed('<','>',S));
	if (C == '\"') return(Enclosed(C,C,S));
	if (C == '^') {
		if (Line_Delim( C = Line[++Position])) { 
			Prog_Error(E_STRING); return(0); }
		return(Enclosed(C,C,S)); }

	/* normal, non-enclosed string. Pick up all contiguous non-blank chars */
	for (i=0; C!=' ' && C!='\t' && !Line_Delim(C) ; i++) {
		*S++ = C;			/* load char into string */
		C = Line[++Position];
	}
	*S = 0;	
	return(i);
}


/*
 * 
 * String Hacking Routines:
 *				append, Concat, Copy, seq, member, lastc, Lower
 *
 */

/* Concatenates string a and b in that order and stores result in c. Returns ptr to c */
char *Concat(c,a,b)
char *a,*c,*b;
{
	register char *cp1,*cp2;

	cp1 = c;
	for (cp2 = a; *cp1 = *cp2; cp1++,cp2++) ;
	for (cp2 = b; *cp1 = *cp2; cp1++,cp2++) ;
	return(c);
}

/* appends string S1 to string S2 */
char *append(S1,S2) 
char *S1,*S2;
{
	register int i,j;
	for (i=0; S2[i]; i++);				/* locate end of S2 */
	for (j=0; S1[j] && i < STR_MAX-1;i++,j++)	/* append S1 to S2 */
		S2[i] = S1[j];
	S2[i] = 0;
	return(S2);
}

/* returns length of string */
Length(S)
char *S;
{
	register int i;
	for (i=0; S[i]; i++);
	return(i);
}

/* Copy string S1 to S2 */
Copy(S1,S2)
char *S1,*S2;
{
	*S2 = 0;					/* empty S2 */
	append(S1,S2);					/* copy S1 to S2 */
}

/* Hashing routine for Symbol and Instruction hash tables */
Hash(S)
register char *S;
{
	register int A,i;

	for(A=0,i=0;S[i];i++)A = A + (S[i]<<(i&01?8:1));
	return(((A*A)>>10)&037);
}

/* string comparison function (String EQuals) */
seq(s1,s2)
register char *s1,*s2;
{
	while (*s1 == *s2) if (*s1 == 0) return(TRUE);
				else { s1++; s2++; }
	return(FALSE);
}

/* Converts all upper case alphabetic chars in string S to lower case. Special
 	chars are unaffected */
Lower(S)
register char *S;
{
	for(;*S;S++) 
		if (*S >= 'A' && *S <= 'Z') *S |= 040;
}

/* member(C,S) return true if character C is in string S, false otherwise */
member(C,S)
register char C,*S; {
	for (;*S;S++) if (C == *S) return(TRUE);
	return(FALSE);
}

/* lastc(S) returns ptr last char in string S */
char *lastc(S)
register char *S; {
	while (*S) S++;
	return (--S);
}
/* Read_Line() is called from the main loop to read the next source line. 
	It calls Start_Line, which
	initializes all "per_line" external variables. It returns TRUE
	if it successfully read a line,
	and aborts (via Sys_Error if it could not. */

FILE *Temp_file;	/* Temporary  to hold source between pass 1 and 2 */
int Line_no = 0;	/* Current line number */

Read_Line() {
	register int C,i;
	char D;
	FILE *In;
	extern char O_debug;
	extern FILE *Source_stack[];	/* Source stack */
	extern int Ss_top;		/* Stack ptr for above */
	extern int Top_of_M_stack;
	extern FLAG Expanding;		/* macro expansion flag */

	if ((D = O_debug)>4) printf("Entering Read_Line\n");
	Start_Line();		/* Initialize externla variables */
	if (Top_of_M_stack >= 0)		/* Check if expanding macro */
		if (Read_Macro_Line()) return(true);
	In = Source_stack[Ss_top];
	while ((C = getc(In)) == EOF)
	{
		fclose(Source_stack[Ss_top]);
		if (Pass == 0) Ehead();
		if ((--Ss_top) < 0)
		{
			Prog_Error(E_END);
			Concat(Line,".end\n",""); 
			Line_no++;
			return(true);
		}
		In = Source_stack[Ss_top];
	}
	/* In temporary file, format of every line is:
		<error byte> <'*' or ' '> <source line> */
	if (In == Temp_file)
	{
		if(C) Prog_Error(C);			/* get pass1 errors */
		C = getc(In);				/* get '*' or ' ' */
		if (C == '*') Expanding = true;
		else Expanding = false;
		C = getc(In);
	}
	/* Finally, read the line in */
	for(i=0;(((Line[i]=C) != '\n') && (C!='\014') && (i<LINE_MAX)); i++)
		if ((C=getc(In))==EOF) break;	/* stop on eof or error */
	Line[i+1] = 0;				/* make the end of string */
	if (i>=LINE_MAX)			/* If didn't get whole line, */
	{
		Line[i] = '\n';			/* put an artificial eol */
		Prog_Warning(E_LINELONG);	/* and complain */
	}
	Line_no++;
	if(D > 1) printf("%d: %s",Line_no,Line);
	return(TRUE);
}
int	Label_count;			/* Number of labels on the current line */
int	Err_code,E_pass1;		/* Error code for pass 1&2, and just for pass 1 */
char	E_warn,				/* -'W' if current error is a warning */
	Rel_mark,			/* =''' if code generated is relative */
	Rel_flag;			/* =1 iff fancy relocation required */

/* Start_Line() resets variables which change from line to line */

Start_Line(){
	register int i;
	extern int Code_length;

	Position = 0;
	Label_count = 0;
	Err_code = 0;
	E_pass1 = 0;
	E_warn = ' ';
	Rel_mark = ' ';
	Rel_flag = 0;
	BC = 0;
	Code_length = 0;
	Operand.type_o = Operand.value_o = 0;
	Operand.sym_o = NULL;
	Operand.reg_o = 0;
}

Concat, Copy, seq, member, lastc, Lower
 *
 */

/* Concatenates string a and b in that order and stores resultsumacc/cc/as/rel.c   444      0     12       14052  3470501541   7240 #include "mical.h"
#ifndef Stanford
#include <a.out.h>
#else Stanford
#include "b.out.h"
#endif Stanford

/*  Handle output file processing for b.out files */
/*  V. Pratt Dec 12 1981 incorporated jks fix to Put_Words (cc[1] fix) */

FILE *tout;		/* text portion of output file */
FILE *dout;		/* data portion of output file */
FILE *rtout;		/* text relocation commands */
FILE *rdout;		/* data relocation commands */

long rtsize;		/* size of text relocation area */
long rdsize;		/* size of data relocation area */

char rtname[STR_MAX];	/* name of file for text relocation commands */
char rdname[STR_MAX];	/* name of file for data relocation commands */

#ifndef Stanford
struct exec filhdr;	/* header for b.out files, contains sizes */
#else Stanford
struct bhdr filhdr;	/* header for b.out files, contains sizes */
#endif Stanford

extern struct csect *Bss_csect, *Data_csect, *Text_csect, *Cur_csect;
/* Initialize files for output and write out the header */

Rel_Header()
{
	long Sym_Write();
	extern char *Rel_name;
	extern char EntryFlag, Title[];
	extern struct sym_bkt Entry_point;

	if ((tout = fopen(&Rel_name, "w")) == NULL ||
		(dout = fopen(&Rel_name, "a")) == NULL)
		Sys_Error("open on output file %s failed", &Rel_name);

	Concat(rtname, Title, ".rtmpr");
	if ((rtout = fopen(rtname, "w")) == NULL)
		Sys_Error("open on output file %s failed", rtname);
	Concat(rdname, Title, ".dtmpr");
	if ((rdout = fopen(rdname, "w")) == NULL)
		Sys_Error("open on output file %s failed", rdname);
	filhdr.fmagic = FMAGIC;
	filhdr.tsize = tsize;
	filhdr.dsize = dsize;
	filhdr.bsize = bsize;
	fseek(tout, (long)(SYMPOS), 0);
	filhdr.ssize = Sym_Write(tout);
	filhdr.rtsize = rtsize;
	filhdr.rdsize = rdsize;
	filhdr.entry = EntryFlag? Entry_point.value_s: 0;

	fseek(tout, 0L, 0);
	fwrite(&filhdr, sizeof(filhdr), 1, tout);

	fseek(tout, (long)(TEXTPOS), 0);	/* seek to start of text */
	fseek(dout, (long)(DATAPOS), 0);	
	rtsize = 0;
	rdsize = 0;
}
/*
 * Fix_Rel -	Fix up the object file
 *	For .b files, we have to
 *	1)	append the relocation segments
 *	2)	fix up the rtsize and rdsize in the header
 *	3)	delete the temporary file for relocation commands
 */
Fix_Rel()
{
	long ortsize;
	long i;
	register FILE *fint, *find, *fout;
	ortsize = filhdr.rtsize;
	filhdr.rtsize = rtsize;
	filhdr.rdsize = rdsize;
	fclose(rtout);
	fclose(rdout);
	if ((fint = fopen(rtname, "r")) == NULL)
		Sys_Error("cannot reopen text relocation file %s", rtname);
	if ((find = fopen(rdname, "r")) == NULL)
		Sys_Error("cannot reopen data relocation file %s", rdname);

	fout = tout;

	/* first write text relocation commands */

	fseek(fout, (long)(RTEXTPOS), 0);
	for (i=0; i<rtsize; i++)
		putc(getc(fint), fout);

	for (i=0; i<rdsize; i++)
		putc(getc(find), fout);

	/* now re-write header */

	fseek(fout, 0, 0);
	fwrite(&filhdr, sizeof(filhdr), 1, fout);
	fclose(fint);
	unlink(rtname);
	fclose(find);
	unlink(rdname);
}
/* rel_val -	Puts value of operand into next bytes of Code
 * updating Code_length. Put_Rel is called to handle possible relocation.
 * If size=L a longword is stored, otherwise a word is stored 
 */
rel_val(opnd,size)
register struct oper *opnd;
{
	register int i;
	register struct sym_bkt *sp;
	long val;
	extern int *WCode;		/* buffer for code in ins.c */
	extern char Code_length;	/* number of bytes in WCode */
	char *CCode;			/* char version of this */

	i = Code_length>>1;	/* get index into WCode */
	if (sp = opnd->sym_o)
		Put_Rel(opnd, size, Dot + Code_length);
	val = opnd->value_o;
	switch(size)
	{
	case L:
		WCode[i++] = val>>16;
		Code_length += 2;
	case W:
		WCode[i] = val;
		Code_length += 2;
		break;
	case B:
		CCode = (char *)WCode;
		CCode[Code_length++] = val;
	}
 }
/* Version of Put_Text which puts whole words, thus enforcing the mapping
 * of bytes to words.							 */

Put_Words(code,nbytes)
register char *code;
{	register char *cc, ch;
	register int i,j;
	char tcode[100];

#ifdef BOOTSTRAP
	cc = tcode;
	for (j=i=0; i<nbytes;) 	/*skips over bogus bytes on a vax*/
	  {tcode[i++] = code[j++]; tcode[i++]=code[j++];j+=2;}
	i = nbytes>>1;
	if (nbytes & 1) Sys_Error("Put_Words given odd nbytes=%d\n",nbytes);
	while (i--) { ch = *cc; *cc = *(char*)((int)cc+1); *++cc = ch; cc++; }
	Put_Text(tcode,nbytes);
#else
	cc = tcode;
	for (j=i=0; i<nbytes;)	/*skips over bogus bytes on a 68000*/
	  {j+=2; tcode[i++] = code[j++];tcode[i++]=code[j++];}
	i = nbytes>>1;
	if (nbytes & 1) Sys_Error("Put_Words given odd nbytes=%d\n",nbytes);
	Put_Text(tcode,nbytes);
#endif
}


/* Put_Text -	Write out text to proper portion of file */

Put_Text(code,length)
 register char *code;
 {
	if (Pass != 2) return;
	if (Cur_csect == Text_csect) fwrite(code, length, 1, tout);
	else if (Cur_csect == Data_csect) fwrite(code, length, 1, dout);
	else return;	/* ignore if bss segment */
 }

/* set up relocation word for operand:
 *  opnd	pointer to operand structure
 *  size	0 = byte, 1 = word, 2 = long/address
 *  offset	offset into WCode & WReloc array
 */

Put_Rel(opnd,size,offset)
struct oper *opnd;
int size;
long offset;
{
	struct reloc r;
	if (opnd->sym_o == 0) return;	/* no relocation */
	if (Cur_csect == Text_csect)
		rtsize += rel_cmd(&r, opnd, size, offset, rtout);
	else if (Cur_csect == Data_csect)
		rdsize += rel_cmd(&r, opnd, size, offset - tsize, rdout);
	else return;	/* just ignore if bss segment */
}


/* rel_cmd -	Generate a relocation command and output */

rel_cmd(rp, opnd, size, offset, file)
register struct reloc *rp;
struct oper *opnd;
int size;
long offset;
FILE *file;
{
	int csid;			/* reloc csect identifier */
	register struct csect *csp;	/* pointer to csect of sym */
	register struct sym_bkt *sp;	/* pointer to symbol */

	sp = opnd->sym_o;
	csp = sp->csect_s;
	if (Pass == 2) {
		rp->rsymbol = 0;
		if (!(sp->attr_s & S_DEF)
		 && (sp->attr_s & S_EXT)) {
			rp->rsegment = REXT;
			rp->rsymbol = sp->id_s;
		}
		else if (csp == Text_csect) rp->rsegment = RTEXT;
		else if (csp == Data_csect) rp->rsegment = RDATA;
		else if (csp == Bss_csect) rp->rsegment = RBSS;
		else Prog_Error(E_RELOCATE);
		rp->rpos = offset;
		rp->rsize = size;
		rp->rdisp = 0;
		fwrite(rp, sizeof *rp, 1, file);
	}
	return(sizeof *rp);
}

 rdsize in the header
 *	3)	delete the temporary file for relocation commands
 */
Fix_Rel()
{
	long ortsize;
	long i;
	register FILE *fint, *find, *fout;
	ortsize = filhdr.rtsize;
	filhdr.rtsize = rtsize;
	filhdr.rdsize = rdsize;
	fclose(rtout);
	fclose(rdout);
	if ((fint = fopen(rtname, "r")) == NULL)
		Sys_Error("cannot reopen text relocation file %s", rtname);
	if ((find = fopen(rdname, "r")) == NULL)
		Sys_Error("cannot reopen data relocation file %s", rdname);
sumacc/cc/as/sdi.c   444      0     12       13174  3470501541   7241 #include "mical.h"

static char *sdi = "~|^`s.sdi.c R1.7 on 6/27/80";

/*
 * module to handle span-dependent instructions, e.g. jbr
 * see CACM Vol 21 No 4 April 1978 for a description of the
 * algorithm for resolving sdi's between the 1st and 2nd pass
 */


struct sdi {	/* information for span dependent instructions (sdi's) */
	struct sdi *sdi_next;           /* next sdi in list */
	struct csect *sdi_csect;	/* csect of the sdi */
	long int sdi_loc;		/* location of the sdi */
	struct sym_bkt *sdi_sym;	/* symbol part of the sdi address */
	long int sdi_off;		/* offset part of the sdi address */
	int sdi_gleng;			/* length of the most general form */
	int sdi_leng;			/* actual length of the sdi */
	long int sdi_span;		/* span of  the sdi */
	long int sdi_base;		/* origin of the span of the sdi */
	struct blist *sdi_bounds;	/* length & bounds info for forms of sdi */
} *sdi_list = 0;	/* linked list of sdi's descriptors */

struct blist {	/* length and bounds information for various forms of sdi's */
	struct blist *b_next;	/* next element in list */
	int b_length;		/* length of this form of the sdi */
	long int b_lbound;	/* lower and upper bound on the span */
	long int b_ubound;	/* for this form of the sdi */
};

/*
 * routine to create a sdi descriptor and insert it into the list
 */
makesdi(op, gleng, base, bounds)
struct oper *op;	/* the operand of the sdi */
int gleng;		/* the length of the most general form of the sdi */
long int base;		/* origin of the the initial span of the sdi, to be */
			/* corrected between pass1 and pass2 by subtracting */
			/* from the value of the symbol of the operand */
			/* i.e. 0 for resolving short absolute address modes */
			/* Dot[+increment] for PC relative addresses */
struct blist *bounds;	/* list of lengths & bounds for the sdi */
{
	register struct sdi *s, **p;
	extern struct csect *Cur_csect;
	extern char *malloc();

	if (op->flags_o&O_COMPLEX)	/* not a simple address */
		return;
	if ((s = (struct sdi *)malloc(sizeof *s)) == (struct sdi *)-1)
		Sys_Error("sdi storage exceeded\n");
	s->sdi_loc = Dot;
	s->sdi_csect = Cur_csect;
	s->sdi_sym = op->sym_o;
	s->sdi_off = op->value_o;
	s->sdi_gleng = gleng;
	s->sdi_base = base;
	s->sdi_span = - base;
	s->sdi_bounds = bounds;
	s->sdi_leng = bounds->b_length;	/* shortest length */
	for (p = &sdi_list; *p; p = &(*p)->sdi_next)
		if (s->sdi_loc < (*p)->sdi_loc)
			break;
	s->sdi_next = *p;
	*p = s;
	return(s->sdi_leng);	/* return the current length */
}

/*
 * insert a new blist element into a blist
 * The blist is sorted by increasing b_length
 */
struct blist *sdi_bound(leng, lbound, ubound, next)
int leng;		/* length of this form of the sdi */
long int lbound;	/* lower bound of span */
long int ubound;	/* upper bound */
struct blist *next;	/* target blist */
{
	register struct blist *b, **p;

	if ((b = (struct blist *)malloc(sizeof *b)) == (struct blist *)-1)
		Sys_Error("sdi bound list storage exceeded\n");
	b->b_length = leng;
	b->b_lbound = lbound;
	b->b_ubound = ubound;
	for (p = &next; *p; p = &(*p)->b_next)
		if (leng <= (*p)->b_length)
			break;
	b->b_next = *p;
	*p = b;
	return(*p);
}

/*
 * resolve sdi's between pass1 and pass2
 * basic algorithm is to repeatedly look for sdi that must use the
 * long form, and update the span of other sdi's.
 * When this terminates, all remaining sdi's can use the short form
 */
sdi_resolve()
{
	register struct sdi *s;
	register struct sym_bkt *p;
	register int t;
	int changed;

	for (s = sdi_list; s; s = s->sdi_next) {
		p = s->sdi_sym;
		if (s->sdi_csect == p->csect_s && (p->attr_s & S_DEF))
			s->sdi_span += s->sdi_sym->value_s;
	}

	do {
		changed = 0;
		for (s = sdi_list; s; s = s->sdi_next) {
			if ((t = sdi_len(s) - s->sdi_leng) > 0) {
				longsdi(s, t);
				changed = 1;
			} else if (t < 0)
				Sys_Error("Pathological sdi\n");
		}
	} while (changed);
}

/*
 * update sdi list assuming the specified sdi must be long
 */
longsdi(s, delta)
struct sdi *s;
register int delta;
{
	register struct sdi *t;
	long loc;

	s->sdi_leng += delta;	/* update the length of this sdi */
	/* get the real location of the sdi */
	loc = s->sdi_loc + sdi_inc(s->sdi_csect, s->sdi_loc);
	for (t = sdi_list; t; t = t->sdi_next)
		if (t != s && s->sdi_csect == t->sdi_sym->csect_s) {
			if (t->sdi_span < 0
			 && t->sdi_span+t->sdi_base <= loc
			 && loc < t->sdi_base)
				t->sdi_span -= delta;
			else if (t->sdi_span >= 0
			 && t->sdi_base <= loc
			 && loc < t->sdi_span+t->sdi_base)
				t->sdi_span += delta;
			if (t->sdi_base > loc)
				t->sdi_base += delta;
		}
}

/*
 * compute the length of the specified sdi by searching the bounds list
 */
sdi_len(s)
register struct sdi *s;
{
	register struct blist *b;
	if (!(s->sdi_sym->attr_s & S_DEF) || s->sdi_csect != s->sdi_sym->csect_s)
		return(s->sdi_gleng);
	for (b = s->sdi_bounds; b; b = b->b_next)
		if (b->b_lbound <= s->sdi_span && s->sdi_span <= b->b_ubound)
			return(b->b_length);
	return(s->sdi_gleng);
}

/*
 * return the total number of extra bytes due to long sdi's before
 * the specified offset in the specified csect
 */
sdi_inc(csect, offset)
register struct csect *csect;
long int offset;
{
	register struct sdi *s;
	register int total;

	for (s = sdi_list, total = 0; s; s = s->sdi_next) {
		if (csect == s->sdi_csect) {
			if (offset <= s->sdi_loc)
				break;
			total += s->sdi_leng - s->sdi_bounds->b_length;
		}
	}
	return(total);
}

/*
 * release all sdi descriptors
 */
sdi_free()
{
	register struct sdi *s, *t;
	for (s = sdi_list; s; s = t) {
		t = s->sdi_next;
		b_free(s->sdi_bounds);
		free(s);
	}
	sdi_list = (struct sdi *)0;
}

/*
 * release a bounds list
 */
b_free(p)
register struct blist *p;
{
	register struct blist *q;
	while(p) {
		q = p->b_next;
		free(p);
		p = q;
	}
}


a_csect) fwrite(code, length, 1, dout);
	else return;	/* ignore if bss segment */
 }

/* set up relocation word for operand:
 *  opnd	pointer to operand structure
 *  size	0 = byte, 1 = word, 2 = long/address
 *  offset	offset into WCode & WReloc array
 */

Put_Rel(opnd,size,offset)
struct oper *opnd;
int size;
long offset;
{
	struct reloc r;
	if (opnd->sym_o == 0) return;	/* no relocsumacc/cc/as/spawn.c   444      0     12        3577  3470501541   7600 /*
 * Utility Subroutines for "Simple" Creation of Processes
 *
 * Calling sequence is similar to that for "execl" and "execv",
 * with exception of extra first argument, which is a pointer
 * to an int[3] array.  On return, the array will contain the
 * process number [0], the fileID of a pipe coming from the
 * spawned process [1], and the fileID of a pipe going to the
 * spawned process [2];  A zero returned code means success, a
 * negative code means failure.  All open files are preserved
 * by this call for the parent process, although the child will
 * only have fileID's for its standard input, output, and error
 * files.
 *
 * Written by j. pershing  -  all rights reversed
 *
 * Modifications:
 *  08/11/76 j. pershing
 *	Usage of registers added.
 *  08/20/76  j. pershing
 *	Usage of registers removed due to c-compiler bug.
 *  08/18/77 T. Eliot
 *	Added access call, exit call after exec, so if bad arguments are given
 *	to us we don't bomb quite so badly.
 */

extern int errno;

spawnl(Ptr, Name, Etc) int Ptr[3]; char *Name, *Etc; {

	return(spawnv(Ptr, Name, &Etc)); }


spawnv(Ptr, Name, Vec) int Ptr[3]; char *Name, **Vec; {

register int	Status, Old0, Old1;
	int	Temp[3];

	Old0 = dup(0);  Old1 = dup(1);
	if (0 <= Old0 && Old0 <= 1) while((Old0 = dup(Old0)) <= 1);
	if (0 <= Old1 && Old1 <= 1) while((Old1 = dup(Old1)) <= 1);
	close(0);  close(1);
	if ((Status = pipe(&Temp[1])) < 0) goto Err;
	Ptr[1] = dup(Temp[1]);

	close(0);
	if ((Status = pipe(&Temp[1])) < 0) goto Err;
	Ptr[2] = Temp[2];

	if ((Status = access(Name,1))) goto Err;

	if ((Status = fork()) == -1) goto Err;

	if ((Ptr[0] = Status) == 0) {
		for (Status = 3; Status < 20; close(Status++));
		(execv(Name, Vec));
		exit(errno);		/* Performed only if execv fails */
	  }

	Status = 0;
   Err:	close(0);  close(1);
	open("/dev/null", 0);
	dup(Old1);  close(Old1);
	close(0);  dup(Old0);  close(Old0);
	return(Status); }

ter int delta;
{
	register struct sdi *t;
	long loc;

	s->sdi_leng += delta;	/* update the length of this sdi */
	/* get the realsumacc/cc/as/sym.c   444      0     12       25145  3470501541   7273 #include "mical.h"
#ifndef Stanford
#include <a.out.h>
#else Stanford
#include "b.out.h"
#endif Stanford

/* Modified by V. Pratt 7/31/81 to include symbol length in table */

#define NLABELS_MAX 10

/* Allocation increments for symbol buckets and character blocks */
#define	SYM_INCR	200
#define CBLOCK_INCR	512

struct sym_bkt	*sym_hash_tab[HASH_MAX];	/* Symbol hash table. */
struct sym_bkt	sym_heap[SYM_INCR];		/* initial heap of sym bkts */
struct sym_bkt	*sym_free;			/* head of free list */
int		Sym_heap_count = 1;		/* number heaps allocated */

char	Cblock[CBLOCK_INCR];			/* used to store texts */
char	*Ccblock = Cblock;			/* ptr to "current" cblock */
int	Cb_nextc = 0;				/* next available char */
int	Cb_count = 1;				/* number blocks allocated */

struct sym_bkt 	*Last_symbol;			/* ptr to last defined symbol*/
struct csect *Data_csect, *Text_csect, *Bss_csect;

/* 
 * Lookup(S)	
 * 	
 *	Input:		char string S
 *	Output:		returns pointer to symbol bucket whose name is S
 *	Purpose:	To place a symbol in the symbol table.
 *	Method:		The symbol table is a hash table, where each entry
 *		is a linearly linked list of symbol buckets.
 *			Local symbols are implemented by just replacing the
 *		'$' at the end of a local symbol with the name of the last
 *		defined label or csect.
 *	Side Effects:	If the symbol S is not on the symbol table, an
 *		entry is made for it.
 */

struct sym_bkt *Lookup(S)
register char *S;
{
	register struct sym_bkt	*sbp;	/* general purpose ptr */
	register int Save;		/* save subscript in sym_hash_tab */
	char	local[STR_MAX];		/* buffer for generated local strings*/
	char	*cp;
	extern char O_debug;
	char *Store_String(),*lastc();
	struct sym_bkt *get_sym_bkt();

	if (S == 0) Sys_Error("Lookup of null symbol");
	if (strcmp(S, " ") == 0) Sys_Error("Bad Symbol");
	if (O_debug >= 9) printf("\n      Lookup: S=%s, ",S);

/* Gen local symbol by replacing final '$' with name of last defined symbol */
	if (*(cp=lastc(S)) == '$') {
		*cp = 0;
		Concat(local,S,Last_symbol->name_s);
		S = local; }		/* pretend we were called with the local symbol itself */
	/* if the symbol is already in here, return a ptr to it */
	for (sbp=sym_hash_tab[Save=Hash(S)]; sbp; sbp = sbp->next_s)
		if (seq(sbp->name_s,S)){
			if (O_debug >= 9) printf("found\n");
			return(sbp); }

	/* Since it's not, make a bucket for it, and put the bucket in the symbol table */
	sbp = get_sym_bkt();			/* get the bucket */
	sbp->name_s = Store_String(S);		/* Store it's name */
	sbp->value_s = NULL;
	sbp->id_s = NULL;
	sbp->csect_s = NULL;
	sbp->attr_s = NULL;
	sbp->next_s = sym_hash_tab[Save];	/* and insert on top of list */
	return(sym_hash_tab[Save] = sbp);
}

/* get_sym_bkt():	Routine to grab a new symbol bucket off of the free list, and allocate space for a new free list if necessary */

struct sym_bkt *get_sym_bkt(){
	register struct sym_bkt	*sbp,	/* general ptr */
			*heap;	/* ptr to array of unused symbol bkts, a "heap" */
	struct sym_bkt	*sym_link();
	extern char O_debug;	/* debugging switch */

	sbp = sym_free;			/* get the first unused sym_bkt from the free list */
	while ((sym_free = sym_free->next_s) == 0) {	/* and move the freelist header down */
	/* if end of free list, allocate a new heap, and link the sym_bkts together to form a new free list */
		if ((heap = (struct sym_bkt *)malloc(sizeof sym_heap)) == 0)
			Sys_Error("Symbol storage exceeded\n",0);
		Sym_heap_count++;
		if (O_debug >=4) printf("--sym heap allocated, #%d --",Sym_heap_count);
		sym_free = sym_link(heap); }
	return(sbp);
}

/* sym_link(heap):	Routine to link the array of sym_bkts "heap" in a linear list. Returns ptr to top of list. 
		It is assumed that the array has SYM_INCR sym_bkts in it */

struct sym_bkt *(sym_link(heap))
struct sym_bkt *heap;
{
	register int i;
	register struct sym_bkt *top;	/* top of list */

	top = 0;			/* zero marks end of list */
	for(i = SYM_INCR-1; i >= 0; --i) {
		heap[i].next_s = top;
		top = &(heap[i]); }
	return(top);
}

/* Sym_Init:	Routine to initialize the first sym_heap */

Sym_Init() { 
	struct sym_bkt *sym_link();
	sym_free = sym_link(sym_heap); 
}




/* Store_String(String):	Routine to store character strings.
 *	MICAL does not have fixed length variable names. This routine allocates
 *  storage in CBLOCK_INCR size chunks, and then sub-allocates space in this 
 *  to hold character strings. S is the char string you want to store 
 *	Returns ptr to the string.
 */

char *Store_String(String)
char *String;
{
	register char  *S;	/* working char string */
	char		*Start;	/* value returned; location of allocated char string */

	Start = &(Ccblock[Cb_nextc]);	/* starting location of allocated char string */
	for(S = String;	 Cb_nextc < CBLOCK_INCR; S++) 	/* load the char string into the current cblock */
		if ((Ccblock[Cb_nextc++] = *S) == 0) return(Start);
	/* overflowed the current character block, so allocate a new one and try again */
	Ccblock = (char *)malloc(CBLOCK_INCR);
	Cb_nextc = 0;
	Cb_count++;
	return(Store_String(String));
}


/* Label()	label and direct assignment handler 
 * 	This routine picks up labels of the form <symbol>: on the source line
 * and enters them in the symbol table. It sets up Label_list, a list of 
 * symbol bucket pointers for the labels in the statement.
 *	In addition, it recognizes direct assignment statements.
 */

struct sym_bkt	*Label_list[NLABELS_MAX];	/* list of sym_bkts for labels on a line */
int		Label_count;			/* number of such symbols */

Label() {
	register struct sym_bkt	*sbp;	/* general ptr */
	int		Save;		/* save Position on Line */
	register char	S[STR_MAX];	/* string to hold symbol name */
	char		Got,		/* 1 if we've picked up a valid symbol yet, 0 otherwise */
			Which,		/* 1 if processing label, 0 if processing direct assignment (d.a.) statement */
			LS,		/* set if local symbol label */
			C;		/* temp char */
	extern int	E_pass1;	/* Error code for non-correctable pass 1 errors */
	extern struct sym_bkt *Last_sym;/* Last symbol defined */
	extern struct csect *Cur_csect;	/* Current csect */
	char *lastc();

	Save = Position;		/* Remember current position */
	Got = 0;			/* We haven't picked up a symbol yet */
	Label_count = Which = 0;
	while (Get_Token(S)){		/* Pick up the first token */
		Got++;			/* Set the flag that says so */
		LS = 0;
		Non_Blank();		/* skip to  first non_blank */
		if ((C = Line[Position]) != ':'  && (C != '=')) break;	/* if we didn't pick up a label, quit trying */
		if (Label_count == 0) {	/* If this is the first symbol we've picked up, */
			Which = (C == ':') ? 1 : 2;	/* Determine which operation we're doing. */
			Got++; }			/* So we don't do this again */
		Position++;				/* move Position past : or = */
							/* check if valid symbol */
		if ((S[0] >= '0') && (S[0] <= '9') && !(LS = (*lastc(S) == '$'))) {	
			Prog_Error(E_SYMBOL); return(TRUE); }
		sbp = Lookup(S);			/* Find the symbol bucket for this symbol */
		if ((Pass==1) && Which==1) {		/* On pass 1, initialize the label's symbol bucket */
			if (sbp->attr_s & S_LABEL)	/* If this label's already defined, complain */
				E_pass1 = E_MULTSYM;
			sbp->attr_s |= S_LABEL | S_DEC | S_DEF;	/* Symbol is a label, it's declared and defined */
			if (LS) sbp->attr_s |= S_LOCAL;	/* mark local symbols as such */
			sbp->csect_s = Cur_csect;		/* it's csect is the current one */
			sbp->value_s = Dot; }			/* it's value is the location counter */
		if (LS == false && Which == 1) Last_symbol = sbp;	/* make Last_symbol last defined label */
		if (sbp->attr_s & S_REG) Prog_Warning(E_MULTSYM);	/* Warn him if he's using a register symbol */
		if (Label_count < NLABELS_MAX)		/* if we don't have too many labels, */
			Label_list[Label_count++] = sbp;	/* put this one on the Label list */
		else Prog_Warning(E_NLABELS);		/* otherwise complain */
		Save = Position;			/* Move the last "safe" position up now */
	}

	if ((Got==0) && Line_Delim(Line[Position])) {	/* If the line had nothing left on it, */
		Print_Line(P_NONE); return(FALSE); }		/* print it, and we're through with this line */
	Position = Save;				/* Otherwise, move Position back to it's last safe value */
	if (Which == 2) {				/* If this is a d.a. statement, */
		Equals(); return(FALSE); }		/* Process it */

	return(TRUE);					/* and continue processing on this line */
}
/* Sym_Fix -	Assigns index numbers
		to the symbols.  Also performs relocation of
		the symbols assuming data segment follows text
		and bss follows the data.  If global flag,
		make all undefined symbols defined to be externals.
*/

Sym_Fix()
{
	register struct sym_bkt **sbp1, *sbp2;
	int i = 0;
	extern char O_global;
	extern struct sym_bkt *Dot_bkt;

	for (sbp1 = sym_hash_tab; sbp1 < &sym_hash_tab[HASH_MAX]; sbp1++)
		if (sbp2 = *sbp1) for(; sbp2; sbp2 = sbp2->next_s)
		{
			if (O_global && (sbp2->attr_s & (S_DEC|S_DEF)) == 0)
			{
				sbp2->attr_s |= S_EXT | S_DEC;
				sbp2->csect_s = 0;
			}
			sbp2->value_s += sdi_inc(sbp2->csect_s, sbp2->value_s);
			if (sbp2->csect_s == Data_csect)
				sbp2->value_s += tsize;
			else if (sbp2->csect_s == Bss_csect)
				sbp2->value_s += tsize + dsize;
			if (sbp2 == Dot_bkt
			 || sbp2->attr_s & (S_REG|S_MACRO|S_LOCAL|S_PERM))
				sbp2->id_s = -1;
			else
				sbp2->id_s = i++;
		}
}


/* Sym_Write -	Write out the symbols to the specified
		file in b.out format, while computing size
		of the symbol segment in output file.
 */

long Sym_Write(file)
FILE *file;
{
	long size = 0;
	register struct sym_bkt  **sbp1, *sbp2;
	register char *sp;
#ifndef Stanford
	int slength;
#endif Stanford
	struct sym s;

	for (sbp1 = sym_hash_tab; sbp1 < &sym_hash_tab[HASH_MAX]; sbp1++)
		if (sbp2 = *sbp1) for (; sbp2; sbp2 = sbp2->next_s)
		{
			if (sbp2->id_s != -1) {
				if ((sbp2->attr_s&S_DEF)== 0)s.stype = UNDEF;
				else if (sbp2->csect_s == Text_csect) s.stype = TEXT;
				else if (sbp2->csect_s == Data_csect) s.stype = DATA;
				else if (sbp2->csect_s == Bss_csect) s.stype = BSS;
				else s.stype = ABS;
				if (sbp2->attr_s & S_EXT) s.stype |= EXTERN;
				s.svalue = sbp2->value_s;
				sp = sbp2->name_s;
#ifndef Stanford
				fwrite(&s, sizeof s, 1, file);
				slength = 0;
				do	/* write out asciz string and compute length */
				{
					putc(*sp, file);
					slength++;
				} while(*sp++);
				size =+ sizeof(s) + slength;
#else Stanford
				s.slength = strlen(sp);
				fwrite(&s, sizeof s, 1, file);
				fprintf(file,"%s",sp);
				putc('\0',file);
				size += sizeof s + s.slength + 1;
#endif Stanford
			}
		}
	return(size);
}

/*
 * Perm	Flags all currently defined symbols as permanent (and therefore
 *	ineligible for redefinition.  Also prevents them from being output
 *	in the object file).
 */
Perm()
{
	register struct sym_bkt **sbp1, *sbp2;
	for (sbp1 = sym_hash_tab; sbp1 < &sym_hash_tab[HASH_MAX]; sbp1++)
		for (sbp2 = *sbp1; sbp2; sbp2 = sbp2->next_s)
			sbp2->attr_s |= S_PERM;
}


'0') && (S[0] <= '9') && !(LS = (*lastc(S) == '$'))) {	
			Prog_Error(E_SYMBOL); return(TRUE); }
		sbp = Lookup(S);			/* Find the symbol bucket for this symbol */
		if ((Pass==1) && Which==1) {		/* On pass 1, initialize the label's symbol bucket */
			if (sbp->attr_s & S_LABEL)	/* If this label's already defined, complain */
				E_pass1 = E_MULTSYM;
			sbp->attr_s |= S_LABEL | S_DEC | S_DEF;	/* Symbol is a lsumacc/cc/c2/   775      0     12           0  3540162160   6106 sumacc/cc/c2/.netupd_log   444      0     12        2030  3470501542  10326 Sat Apr 28 17:59:39 1984
  created file c268[coyote], author: ds on Mon Jan 23 03:34:52 1984
Sat Apr 28 17:59:42 1984
  created file makefile[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:46 1984
  created file makefile_b[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:49 1984
  created file makefile_o[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:53 1984
  created file makefile_t[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:59 1984
  created file o.h[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 18:00:06 1984
  created file o0.c[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 18:00:12 1984
  created file o0.o[coyote], author: ds on Mon Jan 23 03:34:08 1984
Sat Apr 28 18:00:19 1984
  created file o1.c[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 18:00:24 1984
  created file o1.o[coyote], author: ds on Mon Jan 23 03:34:48 1984
Sat Apr 28 18:00:26 1984
  created file o68.1[coyote], author: mogul on Mon Apr  9 23:01:24 1984

  created file c268[coyote], author: ds on Mon Jan 23 03:34:52 1984
Sat Apr 28 17:59:42 1984
  created file makefile[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:46 1984
  created file makefile_b[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:49 1984
  created file makefile_o[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:53 1984
  created file makefile_t[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:59 1984
sumacc/cc/c2/makefile   444      0     12         300  3470501542   7643 t:
		@make -f makefile_t

install:
		@make -f makefile_t install

help:
		@echo "usage: make {o b t clean}"

o:
		@make -f makefile_o

b:
		@make -f makefile_b

clean:
		rm -f *.o *.b c2 c268
t Apr 28 17:59:46 1984
  created file makefile_b[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:49 1984
  created file makefile_o[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:53 1984
  created file makefile_t[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 17:59:59 1984
sumacc/cc/c2/makefile_b   444      0     12        1220  3470501542  10166 #----------------------------------------------------------------------------
#  	These coded statements, instructions, and computer programs
#	contain unpublished proprietary information and are protected
#	by Federal copyright law.  They may not be disclosed to third
#	parties or copied or duplicated in any form without the prior
#	written consent of Lucasfilm Ltd.
#
#	Modifications to Unix V7 by John Seamons, Lucasfilm Ltd.
#----------------------------------------------------------------------------

.SUFFIXES:	.c .b

CFLAGS =	-c

BFILES =	o0.b o1.b

c2:	 	$(BFILES)
		cc68 -r -n -s -o ../../../bin/c2 $(BFILES)

.c.b:		o.h
		cc68 $(CFLAGS) $*.c
3 03:33:13 1984
Sat Apr 28 18:00:12 1984
  created file o0.o[coyote], author: ds on Mon Jan 23 03:34:08 1984
Sat Apr 28 18:00:19 1984
  created file o1.c[coyote], author: ds on Mon Jan 23 03:33:13 1984
Sat Apr 28 18:00:24 1984
  created file o1.o[coyote], author: ds on Mon Jan 23 03:34:48 1984
Sat Apr 28 18:00:26 1984
  created file o68.1[coyote], author: mogul on Msumacc/cc/c2/makefile_o   444      0     12        1202  3470501542  10203 #----------------------------------------------------------------------------
#  	These coded statements, instructions, and computer programs
#	contain unpublished proprietary information and are protected
#	by Federal copyright law.  They may not be disclosed to third
#	parties or copied or duplicated in any form without the prior
#	written consent of Lucasfilm Ltd.
#
#	Modifications to Unix V7 by John Seamons, Lucasfilm Ltd.
#----------------------------------------------------------------------------

.SUFFIXES:	.c .o

CFLAGS =	-c

OFILES =	o0.o o1.o

c2:		$(OFILES)
		cc -o ../../../bin/c2 $(OFILES)

.c.o:		o.h
		cc $(CFLAGS) $*.c
er programs
#	contain unpublished proprietary information and are protected
#	by Federal copyright law.  They may not be disclosed to third
#	parties or copied or duplicated in any form without the prior
#	written consent of Lucasfilm Ltd.
#
#	Modifications to Unix V7 by John Seamons, Lucasfilm Ltd.
#----------------------------------------------------------------------------

.Ssumacc/cc/c2/makefile_t   444      0     12         333  3470501543  10175 # cross version of the optimizer makefile

.SUFFIXES:	.c .o

CFLAGS =	-c -O -DBOOTSTRAP

OFILES =	o0.o o1.o

c268:		$(OFILES)
		cc -o c268 $(OFILES)

.c.o:		o.h
		cc $(CFLAGS) $*.c

install: c268
	cp c268 /usr/sun/bin

copyright law.  They may not be disclosed to third
#	parties or copied or duplicated in any form without the prior
#	written consent of Lucasfilm Ltd.
#
#	Modifications to Unix V7 by John Seamons, Lucasfilm Ltd.
#----------------------------------------------------------------------------

.Ssumacc/cc/c2/o.h   444      0     12        4714  3470501543   6610 #ifdef BOOTSTRAP
#include "/usr/include/stdio.h"
#else
#include <stdio.h>
#endif

/*
 * Header for object code improver
 * Added some comments. 1982/Jan Per Bothner
 */

#define NCHNAM	32

#define	JBR	1
#define	CBR	2
#define	JMP	3
#define	LABEL	4
#define	DLABEL	5
#define	EROU	6	/* End of subroutine */
#define	MOV	7
#define	CLR	8
#define	NOT	9
#define	ADDQ	10
#define	SUBQ	11
#define	NEG	12
#define	TST	13
#define	ASR	14
#define	ASL	15
#define LSR	16
#define LSL	17
#define	EXT	18
#define	CMP	20
#define	ADD	21
#define	SUB	22
#define	AND	23
#define	OR	24
#define	EOR	25
#define LEA	26
#define PEA	27
#define MOVEM	28
#define LINK	29
#define UNLK	30
#define	JSR	31
#define	TEXT	32
#define	DATA	33
#define	BSS	34
#define	EVEN	35
#define	END	36
#define JSW	37
#define MOVEQ	38
#define MULS	39
#define MULU	40
#define DIVS	41
#define DIVU	42
#define DBF	43	/* PB - Dec 1982 */

#define	JEQ	0
#define	JNE	1
#define	JLE	2
#define	JGE	3
#define	JLT	4
#define	JGT	5
#define	JLO	6
#define	JHI	7
#define	JLOS	8
#define	JHIS	9

#define	BYTE	100
#define WORD	101
#define LONG	102

struct node {
	char	op;
	char	subop;
	struct	node	*forw;	/* Next node */
	struct	node	*back;	/* Previous node */
	struct	node	*ref;	/* Node to jump to, if any.
				Also used to link free list */
	int	labno;	/* Label no. used in label and jump nodes */
	char	*code;	/* Sometimes points to assembler string */
	int	refc;	/* Reference count for labels */
};

struct optab {
	char	*opstring;
	int	opcode;
} optab[];

char	line[1024];
struct	node	first;		/* List head for node list */
struct	node	*freenodes;	/* Free list pointer */
char	*curlp;
int	nbrbr;
int	nsaddr;
int	redunm;
int	iaftbr;
int	njp1;
int	nrlab;
int	nxjump;
int	ncmot;
int	nrevbr;
int	loopiv;
int	nredunj;
int	nskip;
int	ncomj;
int	nsob;
int	nrtst;
int	nlit;

int	nchange;	/* Positive if changes this iteration */
int	isn;
int	debug;
char	*lasta;
char	*lastr;
char	*firstr;
char	revbr[];
char	regs[16][NCHNAM+1]; /* Contents of register: d0-d7,a0-a5,"source","dest" */
char	conloc[NCHNAM+1];	/* A memory address ... */
char	conval[NCHNAM+1];	/* ... containing this value. */
char	ccloc[NCHNAM+1];

#define	RT1	14	/* regs[RT1] is "source" register */
#define	RT2	15	/* regs[RT2] is "destination" register */
#define	NREG	14
#define	LABHS	127	/* Size of hash table for labels */
#define	OPHS	57

struct optab *ophash[OPHS];
struct { char lbyte; };

struct node *getnode();
struct node *nonlab();
struct node *insertl();
struct node *codemove();

char *findcon();
char *copy();
LSL	17
#define	EXT	18
#define	CMP	20
#define	ADD	21
sumacc/cc/c2/o0.c   444      0     12       32316  3470501543   6702 /*
 *	 C object code improver
 *
 *	Syntax: c2 [+] [-] [infile [outfile]]
 *	The plus indicates debug mode on. Minus to print out statistics.
 *	infile and outfile both default to stdin & stdout.
 *	The input and output are both 68000 assembler.
 *
 * Modified by Bill Nowicki, Stanford, June 1982
 *	- Made it compile without error messages
 * Added dbf (see o1.c for motivation) - Per Bothner, Dec 1982
 */

#include "o.h"

struct optab optab[] = {
	"bra",	JBR,
	"beq",	CBR | JEQ<<8,
	"bne",	CBR | JNE<<8,
	"ble",	CBR | JLE<<8,
	"bge",	CBR | JGE<<8,
	"blt",	CBR | JLT<<8,
	"bgt",	CBR | JGT<<8,
	"bcs",	CBR | JLO<<8,
	"bhi",	CBR | JHI<<8,
	"bls",	CBR | JLOS<<8,
	"bcc",	CBR | JHIS<<8,
	"jmp",	JMP,
	".globl",EROU,
	".long",JSW,
	"mov",	MOV,
	"clr",	CLR,
	"not",	NOT,
	"addq",	ADDQ,
	"subq",	SUBQ,
	"neg",	NEG,
	"tst",	TST,
	"asr",	ASR,
	"asl",	ASL,
	"lsr",	LSR,
	"lsl",	LSL,
	"ext",	EXT,
	"cmp",	CMP,
	"add",	ADD,
	"sub",	SUB,
	"and",	AND,
	"or",	OR,
	"eor",	EOR,
	"muls",	MULS,
	"mulu",	MULU,
	"divs",	DIVS,
	"divu",	DIVU,
	"dbf",	DBF,	/* PB - Dec 1982 */
	"jsr",	JSR,
	"lea",	LEA,
	"pea",	PEA,
	"movem",MOVEM,
	"moveq",MOVEQ,
	"link",	LINK,
	"unlk",	UNLK,
	".text",TEXT,
	".data",DATA,
	".bss",	BSS,
	".even",EVEN,
	".end",	END,
	0,	0};

char	revbr[] = { JNE, JEQ, JGT, JLT, JGE, JLE, JHIS, JLOS, JHI, JLO };
int	isn	= 20000;

FILE *infile,*outfile;

main(argc, argv)
char **argv;
{
	register int niter, maxiter, isend;
	extern end;
	int nflag;

	if (argc>1 && argv[1][0]=='+') {
		argc--;
		argv++;
		debug++;
	}
	nflag = 0;
	if (argc>1 && argv[1][0]=='-') {
		argc--;
		argv++;
		nflag++;
	}
	if (argc>1) {
		if ((infile = fopen(argv[1], "r")) == NULL) {
			fprintf(stderr,"C2: can't find %s\n", argv[1]);
			exit(1);
		}
	} else
		infile = stdin;
	if (argc>2) {
		if ((outfile = fopen(argv[2], "w")) == NULL) {
			fprintf(stderr,"C2: can't create %s\n", argv[2]);
			exit(1);
		}
	} else
		outfile = stdout;

	freenodes = 0;
	maxiter = 0;
	opsetup();
	do {
		isend = input();
		movedat();
		nchange = niter = 0;
		do {
			refcount();
			do {
				if (debug) printf("iterate\n");
				iterate();
				clearreg();
				niter++;
			} while (nchange);
			if (debug) printf("comjump\n");
			comjump();
			if (debug) printf("rmove\n");
			rmove();
		} while (nchange || jumpsw());
		output(1);
		fflush(outfile);
		if (niter > maxiter)
			maxiter = niter;
	} while (isend);
	fflush(outfile);
	if (nflag) {
		fprintf(stderr,"%d iterations\n", maxiter);
		fprintf(stderr,"%d jumps to jumps\n", nbrbr);
		fprintf(stderr,"%d inst. after jumps\n", iaftbr);
		fprintf(stderr,"%d jumps to .+2\n", njp1);
		fprintf(stderr,"%d redundant labels\n", nrlab);
		fprintf(stderr,"%d cross-jumps\n", nxjump);
		fprintf(stderr,"%d code motions\n", ncmot);
		fprintf(stderr,"%d branches reversed\n", nrevbr);
		fprintf(stderr,"%d redundant moves\n", redunm);
		fprintf(stderr,"%d simplified addresses\n", nsaddr);
		fprintf(stderr,"%d loops inverted\n", loopiv);
		fprintf(stderr,"%d redundant jumps\n", nredunj);
		fprintf(stderr,"%d common seqs before jmp's\n", ncomj);
		fprintf(stderr,"%d skips over jumps\n", nskip);
		fprintf(stderr,"%d redundant tst's\n", nrtst);
		fflush(stderr);
	}
	exit(0);
}


/* Read one subroutine */
input()
{
	register struct node *p, *lastp;
	register int op;
	int subop;

	lastp = &first;
	for (;;) {
		op = getline();
		subop = (op>>8)&0377;
		op &= 0377;
		switch (op) {
	
		case LABEL:
			p = getnode();
			if (line[0]=='.' && line[1]=='L') {
				p->labno = getnum(line+2);
				p->op = LABEL;
				p->code = 0;
			} else {
				p->op = DLABEL;
				p->labno = 0;
				p->code = copy(line);
			}
			break;
	
		case JSW:
			p = getnode();
			p->op = JSW;
			p->subop = 0;
			if (*curlp=='.' && *(curlp+1)=='L') {
			  curlp += 2;
			  p->labno = getnum(curlp);
			  while ('0' <= *curlp && *curlp <= '9') curlp++;
/*			  if (strcmp(curlp,"-0") != 0) {
 *				p->op = 0;
 *				p->labno = 0;
 *				p->code = copy(line);
 *				break;
 *			  }
 */			  break;
			}
		notjsw:	p->op = 0;
			p->labno = 0;
			p->code = copy(line);
			break;

		case JBR:
		case CBR:
		case JMP:
			p = getnode();
			p->op = op;
			p->subop = subop;
			if (*curlp=='.' && *(curlp+1)=='L') {
				p->labno = getnum(curlp+2);
				p->code = 0;
			} else if (*curlp=='p' && *(curlp+1)=='c' && *(curlp+2)=='@') {
				p->op = p->subop = p->labno = 0;
				p->code = copy(line);
			} else {
				p->labno = 0;
				p->code = copy(curlp);
			}
			break;

		default:
			p = getnode();
			p->op = op;
			p->subop = subop;
			p->labno = 0;
			p->code = copy(curlp);
			break;

		}
		p->forw = 0;
		p->back = lastp;
		lastp->forw = p;
		lastp = p;
		p->ref = 0;
		if (op==EROU)
			return(1);
		if (op==END)
			return(0);
	}
}

getline()
{
	register char *lp;
	register c;
	register ftab;

  again:
	lp = line;
	ftab = 0;
	while ((c = getc(infile)) != EOF) {
		if (!ftab && c==':') {
			*lp++ = 0;
			return(LABEL);
		}
		if (c=='\n') {
			if (lp==line) goto again;
			*lp++ = 0;
			return(oplook());
		}
		if (c=='\t') ftab++;
		*lp++ = c;
	}
	*lp++ = 0;
	return(END);
}

getnum(ap)
char *ap;
{
	register char *p;
	register n, c;

	p = ap;
	n = 0;
	while ((c = *p++) >= '0' && c <= '9')
		n = n*10 + c - '0';
	if (*--p!=0 && *p!='-')
		return(0);
	return(n);
}

/* Output node list, optionally flushing the list.
   (Not flushing it (flush==0) is intended to help debugging.)
 */
output(flush)
{
	register struct node *t;
	register struct optab *op;
	register int byte;
	struct node *temp;

	t = first.forw;
	while (t) {
	switch (t->op) {

	case END:
		return;

	case LABEL:
		fprintf(outfile,".L%d:\n", t->labno);
		break;

	case DLABEL:
		fprintf(outfile,"%s:\n", t->code);
		if (flush) cfree(t->code);
		break;

	default:
		byte = t->subop;
		if (byte==BYTE || byte==WORD || byte==LONG) t->subop = 0;
		for (op = optab; op->opstring!=0; op++) 
			if (op->opcode == (t->op | (t->subop<<8))) {
				if (t->op==CBR || t->op==JBR)
				  fprintf(outfile,"\tj%s", op->opstring+1);
				else fprintf(outfile,"\t%s", op->opstring);
				if (byte==BYTE) fprintf(outfile,"b");
				if (byte==WORD) fprintf(outfile,"w");
				if (byte==LONG) fprintf(outfile,"l");
				break;
			}
		if (t->op==JSW) {
			fprintf(outfile,"\t.L%d\n",t->labno);
		} else if (t->code) {
			fprintf(outfile,"\t%s\n", t->code);
			if (flush) cfree(t->code);
		} else if (t->op==JBR || t->op==CBR)
			fprintf(outfile,"\t.L%d\n", t->labno);
		else
			fprintf(outfile,"\n");
		break;

	case 0:
		if (t->code) {
			fprintf(outfile,"%s", t->code);
			if (flush) cfree(t->code);
		}
		fprintf(outfile,"\n");
		break;
	}
	temp = t->forw;
	if (flush) {
	    t->ref = freenodes; freenodes = t;
	};
	t = temp;
	}
}

char *copy(p)
register char *p;
{	register char *onp;
	register int n = strlen(p);

	if (n==0) return(0);
	onp = (char *) calloc(n+1,1);	
	strcpy(onp,p);
	return(onp);
}

opsetup()
{
	register struct optab *optp, **ophp;
	register char *p;

	for (optp = optab; p = optp->opstring; optp++) {
		ophp = &ophash[(((p[0]<<3)+(p[1]<<1)+p[2])&077777) % OPHS];
		while (*ophp++)
			if (ophp > &ophash[OPHS])
				ophp = ophash;
		*--ophp = optp;
	}
}

oplook()
{
	register struct optab *optp;
	register char *lp, *op;
	static char tmpop[32];
	struct optab **ophp;

	op = tmpop;
	*op = *(op+1) = *(op+2) = 0;
	lp = line;
	while (*lp=='\t' || *lp==' ') lp++;
	while (*lp && *lp!=' ' && *lp!='\t') *op++ = *lp++;
	*op++ = 0;
	while (*lp=='\t' || *lp==' ') lp++;
	curlp = lp;
	ophp = &ophash[(((tmpop[0]<<3)+(tmpop[1]<<1)+tmpop[2])&077777) % OPHS];
	while (optp = *ophp) {
		op = optp->opstring;
		lp = tmpop;
		while (*lp == *op++)
			if (*lp++ == 0)
				return(optp->opcode);
		op--;
		if (*lp=='b' && *(lp+1)==0 && *op==0)
			return(optp->opcode + (BYTE<<8));
		if (*lp=='w' && *(lp+1)==0 && *op==0)
			return(optp->opcode + (WORD<<8));
		if (*lp=='l' && *(lp+1)==0 && *op==0)
			return(optp->opcode + (LONG<<8));
		ophp++;
		if (ophp >= &ophash[OPHS])
			ophp = ophash;
	}
	curlp = line;
	return(0);
}

/* Set p->ref so jumps point directly to label node.
   Set p->refc for labels to number of jumps which refer to them.
 */
refcount()
{
	register struct node *p, *lp;
	static struct node *labhash[LABHS];
	register struct node **hp;

	for (hp = labhash; hp < &labhash[LABHS];)
		*hp++ = 0;
	for (p = first.forw; p!=0; p = p->forw)
		if (p->op==LABEL) {
			labhash[p->labno % LABHS] = p;
			p->refc = 0;
		}
	for (p = first.forw; p!=0; p = p->forw) {
		if (p->op==JBR || p->op==CBR || p->op==JSW) {
			p->ref = 0;
			lp = labhash[p->labno % LABHS];
			if (lp==0 || p->labno!=lp->labno)
			for (lp = first.forw; lp!=0; lp = lp->forw) {
				if (lp->op==LABEL && p->labno==lp->labno)
					break;
			}
			if (lp) {
			   	register struct node *hp;
				hp = nonlab(lp)->back;
				if (hp!=lp) {
					p->labno = hp->labno;
					lp = hp;
				}
				p->ref = lp;
				lp->refc++;
			}
		}
	}
	for (p = first.forw; p!=0; p = lp) {
	  lp = p->forw;
	  if (p->op==LABEL && p->refc==0 && lp && lp->op!=0 && lp->op!=JSW) decref(p);
	}
}

iterate()
{
	register struct node *p, *rp, *p1;

	nchange = 0;
	for (p = first.forw; p!=0; p = p->forw) {
		/* Remove jumps to jumps */
		if ((p->op==JBR||p->op==CBR||p->op==JSW) && p->ref) {
			rp = nonlab(p->ref);
			if (rp->op==JBR && rp->labno && p->labno!=rp->labno) {
				nbrbr++;
				p->labno = rp->labno;
				decref(p->ref);
				rp->ref->refc++;
				p->ref = rp->ref;
				nchange++;
			}
		}

		if (p->op==CBR && (p1 = p->forw)->op==JBR) {
			rp = p->ref;
			do
				rp = rp->back;
			while (rp->op==LABEL);
			if (rp==p1) {
				decref(p->ref);
				p->ref = p1->ref;
				p->labno = p1->labno;
				p1->forw->back = p;
				p->forw = p1->forw;
				p->subop = revbr[p->subop];
				p1->ref = freenodes;
				freenodes = p1;
				nchange++;
				nskip++;
			}
		}
		/* Delete dead code */
		if (p->op==JBR || p->op==JMP) {
			while (p->forw 
				&& p->forw->op!=LABEL && p->forw->op!=DLABEL
				&& p->forw->op!=EROU && p->forw->op!=END
				&& p->forw->op!=0 && p->forw->op!=DATA
				&& p->forw->op!=BSS) {
				nchange++;
				iaftbr++;
				if (p->forw->ref)
					decref(p->forw->ref);
				p1 = p->forw;
				p->forw = p->forw->forw;
				p->forw->back = p;
				p1->ref = freenodes;
				freenodes = p1;
			}
			rp = p->forw;
			while (rp && rp->op==LABEL) {
				if (p->ref == rp) {
					p->back->forw = p->forw;
					p->forw->back = p->back;
					p->ref = freenodes;
					freenodes = p;
					p = p->back;
					decref(rp);
					nchange++;
					njp1++;
					break;
				}
				rp = rp->forw;
			}

			xjump(p);
			p = codemove(p);
		}
	}
}

/* Cross-jumping */
xjump(ap)
 struct node *ap;
{
	register struct node *p1, *p2, *p3;
	int nxj;

	nxj = 0;
	p1 = ap;
	if ((p2 = p1->ref)==0)
		return(0);
	for (;;) {
		p1 = p1->back;
/* Deleted:	while ((p1 = p1->back) && p1->op==LABEL); 82/Jan PB */
		while ((p2 = p2->back) && p2->op==LABEL);
		if (!equop(p1, p2) || p1==p2)
			return(nxj);
		p3 = insertl(p2);
		p1->op = JBR;
		p1->subop = 0;
		p1->ref = p3;
		p1->labno = p3->labno;
		p1->code = 0;
		nxj++;
		nxjump++;
		nchange++;
	}
}

/* Return a label pointing at ap. */
struct node *insertl(ap)
  struct node *ap;
{
	register struct node *lp, *op;

	op = ap;
	if (op->op == LABEL) {
		op->refc++;
		return(op);
	}
	if (op->back->op == LABEL) {
		op = op->back;
		op->refc++;
		return(op);
	}
	lp = getnode();
	lp->op = LABEL;
	lp->labno = isn++;
	lp->ref = 0;
	lp->code = 0;
	lp->refc = 1;
	lp->back = op->back;
	lp->forw = op;
	op->back->forw = lp;
	op->back = lp;
	return(lp);
}

struct node *codemove(ap)
  struct node *ap;
{
	register struct node *p1, *p2, *p3;
	struct node *t, *tl;
	int n;

	p1 = ap;
	if (p1->op!=JBR || (p2 = p1->ref)==0)
		return(p1);
	while (p2->op == LABEL)
		if ((p2 = p2->back) == 0)
			return(p1);
	if (p2->op==JBR || p2->op==JMP) {
	    p2 = p2->forw;
	    p3 = p1->ref;
	    while (p3) {
		if (p3->op==JBR || p3->op==JMP) {
			if (p1==p3)
			    return(p1);
			ncmot++;
			nchange++;
			p1->back->forw = p2;
			p1->forw->back = p3;
			p2->back->forw = p3->forw;
			p3->forw->back = p2->back;
			p2->back = p1->back;
			p3->forw = p1->forw;
			decref(p1->ref);
			return(p2);
		} else
			p3 = p3->forw;
	    }
	    return(p1);
	};

	if (p1->forw->op!=LABEL)
		return(p1);
	p3 = p2 = p2->forw;
	n = 16;
	do {
		if ((p3 = p3->forw) == 0 || p3==p1 || --n==0)
			return(p1);
	} while (p3->op!=CBR || p3->labno!=p1->forw->labno);
	do 
		if ((p1 = p1->back) == 0)
			return(ap);
	while (p1!=p3);
	p1 = ap;
	tl = insertl(p1);
	p3->subop = revbr[p3->subop];
	decref(p3->ref);
	p2->back->forw = p1;
	p3->forw->back = p1;
	p1->back->forw = p2;
	p1->forw->back = p3;
	t = p1->back;
	p1->back = p2->back;
	p2->back = t;
	t = p1->forw;
	p1->forw = p3->forw;
	p3->forw = t;
	p2 = insertl(p1->forw);
	p3->labno = p2->labno;
	p3->ref = p2;
	decref(tl);
	if (tl->refc<=0)
		nrlab--;
	loopiv++;
	nchange++;
	return(p3);
}

comjump()
{
	register struct node *p1, *p2, *p3;

	for (p1 = first.forw; p1!=0; p1 = p1->forw)
		if (p1->op==JBR && (p2 = p1->ref) && p2->refc > 1)
			for (p3 = p1->forw; p3!=0; p3 = p3->forw)
				if (p3->op==JBR && p3->ref == p2)
					backjmp(p1, p3);
}

backjmp(ap1, ap2)
struct node *ap1, *ap2;
{
	register struct node *p1, *p2, *p3, *ptemp;

	p1 = ap1;
	p2 = ap2;
	for(;;) {
		while ((p1 = p1->back) && p1->op==LABEL);
		p2 = p2->back;
		if (equop(p1, p2)) {
			p3 = insertl(p1);
			p2->back->forw = p2->forw;
			p2->forw->back = p2->back;
			ptemp = p2;
			p2 = p2->forw;
			ptemp->ref = freenodes;
			freenodes = ptemp;
			decref(p2->ref);
			p2->labno = p3->labno;
			p2->ref = p3;
			nchange++;
			ncomj++;
		} else
			return;
	}
}

		rp = rp->back;
			while (rp->op==LABEL);
			if (rp==p1) {
				decref(p->ref);
				p->ref = p1->ref;
				p->labno = p1->labno;
				p1->forw->back = p;
				p->forw = p1->forw;
				p->subop = revbr[p->subop];
				p1->ref = freenodes;
				freenodes = p1;
				nchange++;
				nskip++;
			}
		}
		/* Delete deadsumacc/cc/c2/o1.c   444      0     12       33617  3470501543   6710 #
/*
 * C object code improver-- second part
 * Removed bug in equop (it thought two .TEXT's coulde be replaced by one),
 *	and added some comments. 1982/Jan Per Bothner
 * Changed so MOVEQ, ADDQ, SUBQ never try loading from reg. 82/Jan PB
 * Fixed findcon to test for null locations. 82/Jan/21 PB
 * Undid pratt's fix in decref() which made it into a no-op. 82/Mar/24 PB
 *
 * Bill Nowicki, Stanford, June 1982
 *	- Made it compile without error messages
 *
 * Per Bothner, Stanford, Dec 1982
 *	- Added a hack in rmove (case CMP) that can halve the loop overhead
 *	for loop that are done a fixed number of times.
 *	In particular, the sequence: subql #1,dreg; cmpw #-1,dreg; jne label
 *	becomes: dbf dreg,label
 *	The former sequence is generated by cc for:
 *	if (--r != -1) ... and do {...} while (--r != -1);
 *	assuming that: register short r;
 *
 * Philip Almquist, Stanford, Feb 1984
 *	- Fixed redunbr to understand the CMP instruction:  it thought
 *	that CMP <op1> <op2> set the condition codes based on the value of
 *	<op1> - <op2>, whereas it really sets the condition codes based on
 *	the value of <op2> - <op1>.  Thus:
 *
 *		CLRL D7			register i;
 *	   .L0: CMPL #10,D7	<==>	for (i=0; i<10; ...
 *		JGE .L9
 *
 *	would be incorrectly optimized into:
 *
 *		CLRL D7
 *		JRA .L9
 *	   .L0: CMPL #10,D7
 *		JGE .L9
 *
 *	Extra credit problems for another day:  this really should generate
 *	something like:
 *
 *		CLRL D7				CLRL D7
 *		JRA .L1		and then   .L1:    .
 *	   .L0: CMPL #10,D7			   .
 *		JGE .L9			   .L0: CMPL #10,D7
 *	   .L1:					JLT .L1
 *					   .L9:
 */

#include "o.h"

/* Improve register usage by using any operands which might already be in registers */
rmove()
{
	register struct node *p;
	register char *cp;
	register int r;
	int r1;
	struct node *ptemp;

	for (p=first.forw; p!=0; p = p->forw) {
	if (debug) {
		for (r=0; r<NREG; r++)
			if (regs[r][0])
				printf("%d: %s ", r, regs[r]);
		printf("-\n");
	}

	switch (p->op) {

	case MOVEQ:
	case MOV:
		if (p->subop==BYTE || p->subop==WORD)
			goto badmov;
		dualop(p);
		if (equstr(regs[RT1],regs[RT2])
		    || (r = findrand(regs[RT1])) >= 0
			&& r == isreg(regs[RT2]) 
			&& p->forw->op!=CBR) {
				p->forw->back = p->back;
				p->back->forw = p->forw;
				p->ref = freenodes;
				freenodes = p;
				redunm++;
				continue;
		}
		if (p->op != MOVEQ)
		    repladdr(p, 0, 1);
		r = isreg(regs[RT1]);
		r1 = isreg(regs[RT2]);
		dest(regs[RT2]);
		if (r >= 0)
			if (r1 >= 0)
				savereg(r1, regs[r]);
			else
				savereg(r, regs[RT2]);
		else
			if (r1 >= 0)
				savereg(r1, regs[RT1]);
			else
				setcon(regs[RT1], regs[RT2]);
		source(regs[RT1]);
/*		setcc(regs[RT2]);
*/		continue;

	case ADDQ:
	case SUBQ:
		dualop(p);
		dest(regs[RT2]);
		ccloc[0] = 0;
		continue;

	case MULS:
	case MULU:
	case DIVS:
	case DIVU:
	case ADD:
	case SUB:
	case AND:
	case OR:
	case EOR:
	badmov:
		dualop(p);
		repladdr(p, 0, 1);
		source(regs[RT1]);
		dest(regs[RT2]);
		ccloc[0] = 0;
		continue;

	case CLR:
	case NOT:
	case NEG:
	case EXT:
		singop(p);
		dest(regs[RT1]);
		if (p->op==CLR)
			if ((r = isreg(regs[RT1])) >= 0)
				savereg(r, "#0");
			else
				setcon("#0", regs[RT1]);
		ccloc[0] = 0;
		continue;

	case TST:
		singop(p);
		repladdr(p, 0, 0);
		source(regs[RT1]);
		if (regs[RT1][0] && equstr(regs[RT1], ccloc)) {
			p->back->forw = p->forw;
			p->forw->back = p->back;
			ptemp = p;
			p = p->back;
			ptemp->ref = freenodes;
			freenodes = ptemp;
			nrtst++;
			nchange++;
		}
		continue;

	case CMP:
		dualop(p);
		/* first test if we can replace (subqw;cmpw;bne) by dbf */
		/* This will speed up SOME loops - see top of file. PB. Dec 82 */
		if (p->subop==WORD && (ptemp=p->back,ptemp->op==SUBQ)
		  && p->forw->op==CBR && p->forw->subop==JNE && ptemp->subop==WORD
		  && equstr(regs[RT1], "#-1") && (r=isreg(regs[RT2]))>=0 && r<=7) {
		    dualop(ptemp);
		    if (equstr(regs[RT1], "#1") && r==isreg(regs[RT2])) {
		        char tempstr[50];
			p->ref = freenodes;
			ptemp->ref = p;
			freenodes = ptemp;
			p = p->forw; /* jne --> dbf */
			p->op = DBF;
			p->subop = 0;
			if (p->code) sprintf(tempstr, "d%d,%s", r, p->code);
			else {
			    sprintf(tempstr, "d%d,.L%d", r, p->labno);
			    p->labno = 0;
			}
			p->code = copy(tempstr);
			ptemp = ptemp->back;
			ptemp->forw = p;
			p->back = ptemp;
			nchange++;
			continue;
		    } else dualop(p);
		}
		source(regs[RT1]);
		source(regs[RT2]);
		repladdr(p, 1, 1);
		ccloc[0] = 0;
		continue;

	case CBR:
		ccloc[0] = 0;
		continue;

	case JBR:
		redunbr(p);

	default:
		clearreg();
	}
	}
}

jumpsw()
{
	register struct node *p, *p1, *temp;
	register t;
	int nj;

	t = 0;
	nj = 0;
	for (p=first.forw; p!=0; p = p->forw)
		p->refc = ++t;
	for (p=first.forw; p!=0; p = p1) {
		p1 = p->forw;
		if (p->op == CBR && p1->op==JBR && p->ref && p1->ref
		 && abs(p->refc - p->ref->refc) > abs(p1->refc - p1->ref->refc)) {
			if (p->ref==p1->ref)
				continue;
			p->subop = revbr[p->subop];
			temp = p1->ref;
			p1->ref = p->ref;
			p->ref = temp;
			t = p1->labno;
			p1->labno = p->labno;
			p->labno = t;
			nrevbr++;
			nj++;
		}
	}
	return(nj);
}

abs(x)
{
	return(x<0? -x: x);
}

/* Test if p1 and p2 are "equal". */
equop(p1, p2)
register struct node *p1, *p2;
{
	register char *cp1, *cp2;

	if (p1->op!=p2->op || p1->subop!=p2->subop)
		return(0);
	if (p1->op>0 && p1->op<MOV)
	    return(0);
	/* Added 1982/Jan -Per Bothner */
	if (p1->op>=TEXT)
	    return(0);
	cp1 = p1->code;
	cp2 = p2->code;
	if (cp1==0 && cp2==0)
		return(1);
	if (cp1==0 || cp2==0)
		return(0);
	while (*cp1 == *cp2++)
		if (*cp1++ == 0)
			return(1);
	return(0);
}

/* Decrement no. of references to label ap, and if 0 delete it */
decref(ap)
  struct node *ap;
{
	register struct node *p;

/**********  This makes switch statements fail, because word offsets are used
  instead of longs.  Sigh
	p = ap;

	if (p->op != LABEL) return;
	if (--p->refc <= 0) {
		nrlab++;
		p->back->forw = p->forw;
		p->forw->back = p->back;
		p->ref = freenodes;
		freenodes = p;
	}  ****** WIN Jul 1982 */
}

/* Return first node after ap (inclusive) which is not a label */
struct node *nonlab(ap)
struct node *ap;
{
	register struct node *p;

	p = ap;
	while (p && p->op==LABEL)
		p = p->forw;
	return(p);
}

/* Return a new node */
struct node *getnode()
  {	register struct node *p;

	if (p = freenodes) { freenodes = p->ref; p->subop = 0; return(p); }
	return ( (struct node *)calloc(1,sizeof first));
}

clearreg()
{
	register int i;

	for (i=0; i<NREG; i++)
		regs[i][0] = '\0';
	conloc[0] = 0;
	ccloc[0] = 0;
}

savereg(ai, as)
char *as;
{
	register char *p, *s, *sp;

	sp = p = regs[ai];
	s = as;
	if (source(s))
		return;
/*	if (s[0]=='a' && s[1]<'6' && s[2]=='@') {
 *		*sp = 0;
 *		return;
 *	}
 */	while (*p++ = *s) {
		if (*s++ == ',')
			break;
	}
	*--p = '\0';
}

/* look through register contents table, clearing entries
 * based on value of address register 'reg'.
 */
areg(reg)
  {	register int i;
	register char *p;

	for (i = 0; i < RT2; i++) {
	  p = regs[i];
	  if (*p++ == 'a' && *p == (reg - 8 + '0')) regs[i][0] = 0;
	}
}

/* update register contents table assuming operand passed as argument
 * was affected by instruction
 */
dest(as)
char *as;
{
	register char *s;
	register int i;

	s = as;
	source(s);

	/* if dest was a register, update registers table entry */
	if ((i = isreg(s)) >= 0) regs[i][0] = 0;

	/* if dest was an address reg, clear table entries for regs that
	 * were loaded using that address reg.
	 */
	if (i >= 8) areg(i);

	/* clear any regs that claim to have copy of dest's value */
	while ((i = findrand(s)) >= 0) regs[i][0] = 0;

	/* if there is any indirection, we don't know anything afterward */
	if (*s++=='a' && *s>='0' && *s++<='5' && *s=='@') {
		for (i=0; i<NREG; i++) {
			if (regs[i][0] != '#') regs[i][0] = 0;
			conloc[0] = 0;
		}
	}
}

/* set RT1 (source) "register" from assy. language code */
singop(ap)
struct node *ap;
{
	register char *p1, *p2;

	p1 = ap->code;
	p2 = regs[RT1];
	while (*p2++ = *p1++);
	regs[RT2][0] = 0;
}


/* set RT1 (source) and RT2 (dest) "registers" from assy. language code */
dualop(ap)
struct node *ap;
{
	register char *p1, *p2;
	register struct node *p;

	p = ap;
	p1 = p->code;
	p2 = regs[RT1];
	while (*p1 && *p1!=',')
		*p2++ = *p1++;
	*p2++ = 0;
	p2 = regs[RT2];
	*p2 = 0;
	if (*p1++ !=',')
		return;
	while (*p1==' ' || *p1=='\t')
		p1++;
	while (*p2++ = *p1++);
}

/* return register number of reg that already contains operand passed as
 * arg, -1 otherwise.
 */
findrand(as)
char *as;
{	register int i;

	if (*as) for (i = 0; i<NREG; i++) {
		if (equstr(regs[i], as))
			return(i);
	}

	return(-1);
}

/* return register number if operand corresponds to register, else -1 */
isreg(as)
char *as;
{
	register char *s;

	s = as;
	if (s[0]=='d' && s[1]>='0' && s[1]<='7' && s[2]==0)
		return(s[1]-'0');
	if (s[0]=='a' && s[1]>='0' && s[1]<='5' && s[2]==0)
		return(s[1]-'0'+8);
	return(-1);
}

check()
{
	register struct node *p, *lp;

	lp = &first;
	for (p=first.forw; p!=0; p = p->forw) {
		if (p->back != lp)
			abort();
		lp = p;
	}
}

/* look for operands of the form an@+ or an@-; if found, reset register contents
 * table for register n and for any regs based on address register n.
 */
source(ap)
char *ap;
{
	register char *p1, *p2;
	register int i;

	p1 = ap;
	p2 = p1;
	if (*p1==0)
		return(0);
	while (*p2++);
	if (*(p2-2)=='+' || *(p2-2)=='-') {
		if (*p1++=='a' && *p1>='0' && *p1<='5') {
		  regs[(i = *p1 - '0' + 8)][0] = 0;
		  areg(i);
		}
		return(1);
	}
	return(0);
}

/* Replace address fields of instruction 'p' of args already in regs.
 * If 'f', arg2 is second source instead of destination.
 * If 'g', address register may be used as replacement, else only data.
 */
repladdr(p, f, g)
struct node *p;
{
	register r;
	int r1;
	register char *p1, *p2;
	static char rt1[50], rt2[50];

	if (f)
		r1 = findrand(regs[RT2]);
	else
		r1 = -1;
	r = findrand(regs[RT1]);
	if (r>=0 || r1>=0) {
		p2 = regs[RT1];
		for (p1 = rt1; *p1++ = *p2++;);
		if (regs[RT2][0]) {
			p1 = rt2;
			*p1++ = ',';
			for (p2 = regs[RT2]; *p1++ = *p2++;);
		} else
			rt2[0] = 0;
		if (r>=0) {
			if (r>7) {
			  if (!g) return;
			  rt1[0] = 'a';
			  rt1[1] = r - 8 + '0';
			} else { rt1[0] = 'd'; rt1[1] = r + '0'; }
			rt1[2] = 0;
			nsaddr++;
		}
		if (r1>=0) {
			if (r1>7) {
			  if (!g) return;
			  rt2[1] = 'a';
			  rt2[2] = r1 - 8 + '0';
			} else { rt2[1] = 'd'; rt2[2] = r1 + '0'; }
			rt2[3] = 0;
			nsaddr++;
		}
		strcat(rt1,rt2);
		p->code = copy(rt1);
	}
}

movedat()
{
	register struct node *p1, *p2;
	struct node *p3;
	register seg;
	struct node data;
	struct node *datp;

	if (first.forw == 0)
		return;
/*	data.forw = 0;
	datp = &data;
	for (p1 = first.forw; p1!=0; p1 = p1->forw) {
		if (p1->op == DATA) {
			p2 = p1->forw;
			while (p2 && p2->op!=TEXT)
				p2 = p2->forw;
			if (p2==0)
				break;
			p3 = p1->back;
			p1->back->forw = p2->forw;
			p2->forw->back = p3;
			p2->forw = 0;
			datp->forw = p1;
			p1->back = datp;
			p1 = p3;
			datp = p2;
		}
	}
	if (data.forw) {
		datp->forw = first.forw;
		first.forw->back = datp;
		data.forw->back = &first;
		first.forw = data.forw;
	}
*/
	/* Remove redundant TEXT, DATA, and BSS nodes. */
	seg = -1;
	for (p1 = first.forw; p1!=0; p1 = p1->forw) {
		if (p1->op==TEXT||p1->op==DATA||p1->op==BSS) {
			if (p1->op == seg ||
			    (p1->forw && (p1->forw->op==TEXT||p1->forw->op==DATA||p1->forw->op==BSS))) {
				p1->back->forw = p1->forw;
				p1->forw->back = p1->back;
				p1->ref = freenodes;
				freenodes = p1;
				p1 = p1->back;
				continue;
			}
			else seg = p1->op;
		}
	}
}

redunbr(ap)
struct node *ap;
{
	register struct node *p, *p1;
	register char *ap1;
	char *ap2;

	if ((p1 = p->ref) == 0)
		return;
	p1 = nonlab(p1);
	if (p1->op==TST) {
		singop(p1);
		savereg(RT2, "#0");
		ap1 = findcon(RT1);
		ap2 = findcon(RT2);
	} else if (p1->op==CMP) {
		dualop(p1);
		/* CMP tests "backwards" (see edit log) - PDA, 2/13/84 */
		ap2 = findcon(RT1);
		ap1 = findcon(RT2);
	} else
		return;
	if (p1->forw->op!=CBR)
		return;
	p1 = p1->forw;
	if (compare(p1->subop, ap1, ap2)) {
		nredunj++;
		nchange++;
		decref(p->ref);
		p->ref = p1->ref;
		p->labno = p1->labno;
		p->ref->refc++;
	}
}

/* Return code which is equal to contents of reg. i, preferably a constant */
char *findcon(i)
{
	register char *p; register maxiter = 14;
	do  {
	    p = regs[i];
	    if (*p=='#')
		return(p);
	} while ((i = isreg(p)) >= 0 && --maxiter);
	if (*p && equstr(p, conloc))
		return(conval);
	return(p);
}

/* Test: acp1 op acp2.
 * Return 1 if test succeeds; 0 if not or can't tell. */
compare(op, acp1, acp2)
char *acp1, *acp2;
{
	register char *cp1, *cp2;
	register n1;
	int n2;
	struct { int i;};

	cp1 = acp1;
	cp2 = acp2;

	if (*cp1++ != '#' || *cp2++ != '#')
		return(0);
	n1 = 0;
	while (*cp2 >= '0' && *cp2 <= '9') {
		n1 *= 10;
		n1 += *cp2++ - '0';
	}
	n2 = n1;
	n1 = 0;
	while (*cp1 >= '0' && *cp1 <= '9') {
		n1 *= 10;
		n1 += *cp1++ - '0';
	}
	if (*cp1=='+')
		cp1++;
	if (*cp2=='+')
		cp2++;
	do {
		if (*cp1++ != *cp2)
			return(0);
	} while (*cp2++);
	cp1 = (char *)n1;
	cp2 = (char *)n2;

	switch(op) {

	case JEQ:
		return(cp1 == cp2);
	case JNE:
		return(cp1 != cp2);
	case JLE:
		return((int)cp1 <= (int)cp2);
	case JGE:
		return((int)cp1 >= (int)cp2);
	case JLT:
		return((int)cp1 < (int)cp2);
	case JGT:
		return((int)cp1 > (int)cp2);
	case JLO:
		return(cp1 < cp2);
	case JHI:
		return(cp1 > cp2);
	case JLOS:
		return(cp1 <= cp2);
	case JHIS:
		return(cp1 >= cp2);
	}
	return(0);
}

setcon(ar1, ar2)
char *ar1, *ar2;
{
	register char *cl, *cv, *p;

	cl = ar2;
	cv = ar1;
	if (*cv != '#')
		return;
	if (!natural(cl))
		return;
	p = conloc;
	while (*p++ = *cl++);
	p = conval;
	while (*p++ = *cv++);
}

equstr(ap1, ap2)
char *ap1, *ap2;
{
	char *p1, *p2;

	p1 = ap1;
	p2 = ap2;
	do {
		if (*p1++ != *p2)
			return(0);
	} while (*p2++);
	return(1);
}

setcc(ap)
char *ap;
{
	register char *p, *p1;

	p = ap;
	if (!natural(p)) {
		ccloc[0] = 0;
		return;
	}
	p1 = ccloc;
	while (*p1++ = *p++);
}

natural(ap)
char *ap;
{
	register char *p;

	p = ap;
	if (*p=='*' || *p=='(' || *p=='-'&&*(p+1)=='(')
		return(0);
	while (*p++);
	p--;
	if (*--p == '+' || *p ==')' && *--p != '5')
		return(0);
	return(1);
}

 (r>7) {
			  if (!g) return;
			  rt1[0] = 'a';
			  rt1[1] = r - 8 + '0';
			} else { rt1[0] = 'd'; rt1[1] = r sumacc/cc/c2/o68.1   444      0     12         463  3470501543   6654 .TH O68 1 MC68000
.SU
.SH NAME
o68 \- .s -> .s optimizer component of cc68
.SH SYNOPSIS
.B o68
.SH DESCRIPTION
.I O68
is a 68000 assembly language optimizer.  It takes its input from stdin and
sends its output to stdout.
.PP
.SH FILES
/usr/sun/c68/o0.c /usr/sun/c68/o1.c  /usr/bin/o68
.SH SEE ALSO
cc68 (1)
if (!natural(cl))
		return;
	p = conloc;
	while (*p++ = *cl++);
	p = conval;
	while (*p++ = *cv++);
}

equstr(ap1, ap2)
char *ap1, *ap2;
{
	char *p1, *p2;

	p1 = ap1;
	p2 = ap2;
	do {
		if (*p1++ != *p2)
	sumacc/cc/ccom/   775      0     12           0  3540162164   6527 sumacc/cc/ccom/.netupd_log   444      0     12       10346  3470501544  10776 Sat Apr 28 18:01:17 1984
  created file allo.c[coyote], author: ds on Mon Dec  5 17:16:27 1983
Sat Apr 28 18:01:21 1984
  created file allo.o[coyote], author: ds on Mon Dec  5 20:51:40 1983
Sat Apr 28 18:01:40 1984
  created file ccom68[coyote], author: ds on Mon Dec  5 20:52:43 1983
Sat Apr 28 18:01:43 1984
  created file ccom68.1[coyote], author: mogul on Mon Apr  9 23:01:16 1984
Sat Apr 28 18:01:55 1984
  created file cgram.c[coyote], author: ds on Mon Dec  5 20:40:30 1983
Sat Apr 28 18:02:03 1984
  created file cgram.o[coyote], author: ds on Mon Dec  5 20:42:08 1983
Sat Apr 28 18:02:10 1984
  created file cgram.y[coyote], author: ds on Mon Dec  5 17:16:46 1983
Sat Apr 28 18:02:14 1984
  created file code.c[coyote], author: ds on Mon Dec  5 17:16:50 1983
Sat Apr 28 18:02:20 1984
  created file code.o[coyote], author: ds on Mon Dec  5 20:47:06 1983
Sat Apr 28 18:02:22 1984
  created file comm1.c[coyote], author: ds on Mon Dec  5 17:16:51 1983
Sat Apr 28 18:02:26 1984
  created file comm1.o[coyote], author: ds on Mon Dec  5 20:52:01 1983
Sat Apr 28 18:02:32 1984
  created file common[coyote], author: ds on Mon Dec  5 17:16:54 1983
Sat Apr 28 18:02:38 1984
  created file local.c[coyote], author: ds on Mon Dec  5 17:16:59 1983
Sat Apr 28 18:02:41 1984
  created file local.o[coyote], author: ds on Mon Dec  5 20:47:29 1983
Sat Apr 28 18:02:50 1984
  created file local2.c[coyote], author: ds on Mon Dec  5 17:17:05 1983
Sat Apr 28 18:02:55 1984
  created file local2.o[coyote], author: ds on Mon Dec  5 20:49:43 1983
Sat Apr 28 18:02:59 1984
  created file mac2defs[coyote], author: ds on Mon Dec  5 17:17:06 1983
Sat Apr 28 18:03:02 1984
  created file macdefs[coyote], author: ds on Mon Dec  5 17:17:07 1983
Sat Apr 28 18:03:04 1984
  created file makefile[coyote], author: ds on Mon Dec  5 17:17:09 1983
Sat Apr 28 18:03:07 1984
  created file makefile_b[coyote], author: ds on Mon Dec  5 17:17:10 1983
Sat Apr 28 18:03:09 1984
  created file makefile_o[coyote], author: ds on Mon Dec  5 17:17:10 1983
Sat Apr 28 18:03:12 1984
  created file makefile_t[coyote], author: ds on Mon Jan 23 03:25:59 1984
Sat Apr 28 18:03:17 1984
  created file manifest[coyote], author: ds on Mon Dec  5 17:17:14 1983
Sat Apr 28 18:03:24 1984
  created file match.c[coyote], author: ds on Mon Dec  5 17:17:18 1983
Sat Apr 28 18:03:28 1984
  created file match.o[coyote], author: ds on Mon Dec  5 20:51:03 1983
Sat Apr 28 18:03:33 1984
  created file mfile1[coyote], author: ds on Mon Dec  5 17:17:19 1983
Sat Apr 28 18:03:38 1984
  created file mfile2[coyote], author: ds on Mon Dec  5 17:17:22 1983
Sat Apr 28 18:03:42 1984
  created file optim.c[coyote], author: ds on Mon Dec  5 17:17:23 1983
Sat Apr 28 18:03:45 1984
  created file optim.o[coyote], author: ds on Mon Dec  5 20:46:38 1983
Sat Apr 28 18:03:51 1984
  created file order.c[coyote], author: ds on Mon Dec  5 17:17:32 1983
Sat Apr 28 18:03:57 1984
  created file order.o[coyote], author: ds on Mon Dec  5 20:50:38 1983
Sat Apr 28 18:04:09 1984
  created file pftn.c[coyote], author: ds on Mon Dec  5 17:17:43 1983
Sat Apr 28 18:04:16 1984
  created file pftn.o[coyote], author: ds on Mon Dec  5 20:44:52 1983
Sat Apr 28 18:04:27 1984
  created file reader.c[coyote], author: ds on Mon Dec  5 17:17:48 1983
Sat Apr 28 18:04:32 1984
  created file reader.o[coyote], author: ds on Mon Dec  5 20:48:36 1983
Sat Apr 28 18:04:39 1984
  created file scan.c[coyote], author: ds on Mon Dec  5 17:17:54 1983
Sat Apr 28 18:04:44 1984
  created file scan.o[coyote], author: ds on Mon Dec  5 20:43:15 1983
Sat Apr 28 18:04:49 1984
  created file table.c[coyote], author: ds on Mon Dec  5 17:17:57 1983
Sat Apr 28 18:04:52 1984
  created file table.o[coyote], author: ds on Mon Dec  5 20:52:33 1983
Sat Apr 28 18:04:55 1984
  created file test.c[coyote], author: ds on Mon Dec  5 17:17:58 1983
Sat Apr 28 18:04:59 1984
  created file test.s[coyote], author: ds on Mon Jan 23 03:31:58 1984
Sat Apr 28 18:05:12 1984
  created file trees.c[coyote], author: ds on Mon Dec  5 17:18:06 1983
Sat Apr 28 18:05:21 1984
  created file trees.o[coyote], author: ds on Mon Dec  5 20:46:19 1983
Sat Apr 28 18:05:26 1984
  created file xdefs.c[coyote], author: ds on Mon Dec  5 17:18:08 1983
Sat Apr 28 18:05:29 1984
  created file xdefs.o[coyote], author: ds on Mon Dec  5 20:42:17 1983
 acp2.
 * Return 1 if test succeeds; 0 if not or can't tell. */
compare(op, acp1, acp2)
char *acp1, *acp2;
{
	register char *cp1, *cp2;
	register n1;
	int n2;
	struct { int i;};

	cp1 = acp1;
	cp2 = acp2;

	if (*cp1++ != '#' || *cp2++ != '#')
		return(0);
	n1 = 0;
	while (*cp2 >= 'sumacc/cc/ccom/allo.c   444      0     12       22550  3470501544   7730 # include "mfile2"

NODE resc[3];

int busy[REGSZ];

int maxa, mina, maxb, minb;

allo0(){ /* free everything */

	register i;

	maxa = maxb = -1;
	mina = minb = 0;

	REGLOOP(i){
		busy[i] = 0;
		if( rstatus[i] & STAREG ){
			if( maxa<0 ) mina = i;
			maxa = i;
			}
		if( rstatus[i] & STBREG ){
			if( maxb<0 ) minb = i;
			maxb = i;
			}
		}
	}

# define TBUSY 01000

allo( p, q ) NODE *p; struct optab *q; {

	register n, i, j;

	n = q->needs;
	i = 0;

	while( n & NACOUNT ){
		resc[i].in.op = REG;
		resc[i].tn.rval = freereg( p, n&NAMASK );
		resc[i].tn.lval = 0;
#ifdef FLEXNAMES
		resc[i].in.name = "";
#else
		resc[i].in.name[0] = '\0';
#endif
		n -= NAREG;
		++i;
		}

	while( n & NBCOUNT ){
		resc[i].in.op = REG;
		resc[i].tn.rval = freereg( p, n&NBMASK );
		resc[i].tn.lval = 0;
#ifdef FLEXNAMES
		resc[i].in.name = "";
#else
		resc[i].in.name[0] = '\0';
#endif
		n -= NBREG;
		++i;
		}

	if( n & NTMASK ){
		resc[i].in.op = OREG;
		resc[i].tn.rval = TMPREG;
		if( p->in.op == STCALL || p->in.op == STARG || p->in.op == UNARY STCALL || p->in.op == STASG ){
			resc[i].tn.lval = freetemp( (SZCHAR*p->stn.stsize + (SZINT-1))/SZINT );
			}
		else {
			resc[i].tn.lval = freetemp( (n&NTMASK)/NTEMP );
			}
#ifdef FLEXNAMES
		resc[i].in.name = "";
#else
		resc[i].in.name[0] = '\0';
#endif
		resc[i].tn.lval = BITOOR(resc[i].tn.lval);
		++i;
		}

	/* turn off "temporarily busy" bit */

	REGLOOP(j){
		busy[j] &= ~TBUSY;
		}

	for( j=0; j<i; ++j ) if( resc[j].tn.rval < 0 ) return(0);
	return(1);

	}

freetemp( k ){ /* allocate k integers worth of temp space */
	/* we also make the convention that, if the number of words is more than 1,
	/* it must be aligned for storing doubles... */

# ifndef BACKTEMP
	int t;

	if( k>1 ){
		SETOFF( tmpoff, ALDOUBLE );
		}

	t = tmpoff;
	tmpoff += k*SZINT;
	if( tmpoff > maxoff ) maxoff = tmpoff;
	if( tmpoff-baseoff > maxtemp ) maxtemp = tmpoff-baseoff;
	return(t);

# else
	tmpoff += k*SZINT;
	if( k>1 ) {
		SETOFF( tmpoff, ALDOUBLE );
		}
	if( tmpoff > maxoff ) maxoff = tmpoff;
	if( tmpoff-baseoff > maxtemp ) maxtemp = tmpoff-baseoff;
	return( -tmpoff );
# endif
	}

freereg( p, n ) NODE *p; {
	/* allocate a register of type n */
	/* p gives the type, if floating */

	register j;

	/* not general; means that only one register (the result) OK for call */
	if( callop(p->in.op) ){
		j = callreg(p);
		if( usable( p, n, j ) ) return( j );
		/* have allocated callreg first */
		}
	j = p->in.rall & ~MUSTDO;
	if( j!=NOPREF && usable(p,n,j) ){ /* needed and not allocated */
		return( j );
		}
	if( n&NAMASK ){
		for( j=mina; j<=maxa; ++j ) if( rstatus[j]&STAREG ){
			if( usable(p,n,j) ){
				return( j );
				}
			}
		}
	else if( n &NBMASK ){
		for( j=minb; j<=maxb; ++j ) if( rstatus[j]&STBREG ){
			if( usable(p,n,j) ){
				return(j);
				}
			}
		}

	return( -1 );
	}

usable( p, n, r ) NODE *p; {
	/* decide if register r is usable in tree p to satisfy need n */

	/* checks, for the moment */
	if( !istreg(r) ) cerror( "usable asked about nontemp register" );

	if( busy[r] > 1 ) return(0);
	if(((n&NAMASK) && !(rstatus[r]&SAREG)) || ((n&NBMASK) && !(rstatus[r]&SBREG)))
		return(0);
	if( (szty(p->in.type) == 2) ){ /* only do the pairing for real regs */
		if( r&01 ) return(0);
		if( !istreg(r+1) ) return( 0 );
		if( busy[r+1] > 1 ) return( 0 );
		if( busy[r] == 0 && busy[r+1] == 0  ||
		    busy[r+1] == 0 && shareit( p, r, n ) ||
		    busy[r] == 0 && shareit( p, r+1, n ) ){
			busy[r] |= TBUSY;
			busy[r+1] |= TBUSY;
			return(1);
			}
		else return(0);
		}
	if( busy[r] == 0 ) {
		busy[r] |= TBUSY;
		return(1);
		}

	/* busy[r] is 1: is there chance for sharing */
	return( shareit( p, r, n ) );

	}

shareit( p, r, n ) NODE *p; {
	/* can we make register r available by sharing from p
	   given that the need is n */
	if( (n&(NASL|NBSL)) && ushare( p, 'L', r ) ) return(1);
	if( (n&(NASR|NBSR)) && ushare( p, 'R', r ) ) return(1);
	return(0);
	}

ushare( p, f, r ) NODE *p; {
	/* can we find a register r to share on the left or right
		(as f=='L' or 'R', respectively) of p */
	p = getlr( p, f );
	if( p->in.op == UNARY MUL ) p = p->in.left;
	if( p->in.op == OREG ){
		if( R2TEST(p->tn.rval) ){
			return( r==R2UPK1(p->tn.rval) || r==R2UPK2(p->tn.rval) );
			}
		else return( r == p->tn.rval );
		}
	if( p->in.op == REG ){
		return( r == p->tn.rval || ( szty(p->in.type) == 2 && r==p->tn.rval+1 ) );
		}
	return(0);
	}

recl2( p ) register NODE *p; {
	register r = p->tn.rval;
	if( p->in.op == REG ) rfree( r, p->in.type );
	else if( p->in.op == OREG ) {
		if( R2TEST( r ) ) {
			rfree( R2UPK1( r ), PTR+INT );
			rfree( R2UPK2( r ), INT );
			}
		else {
			rfree( r, PTR+INT );
			}
		}
	}

int rdebug = 0;

rfree( r, t ) TWORD t; {
	/* mark register r free, if it is legal to do so */
	/* t is the type */

	if( rdebug ){
		printf( "rfree( %s ), size %d\n", rnames[r], szty(t) );
		}

	if( istreg(r) ){
		if( --busy[r] < 0 ) cerror( "register overfreed");
		if( szty(t) == 2 ){
			if( (r&01) ) cerror( "illegal free" );
			if( --busy[r+1] < 0 ) cerror( "register overfreed" );
			}
		}
	}

rbusy(r,t) TWORD t; {
	/* mark register r busy */
	/* t is the type */

	if( rdebug ){
		printf( "rbusy( %s ), size %d\n", rnames[r], szty(t) );
		}

	if( istreg(r) ) ++busy[r];
	if( szty(t) == 2 ){
		if( istreg(r+1) ) ++busy[r+1];
		if( (r&01) ) cerror( "illegal register pair freed" );
		}
	}

rwprint( rw ){ /* print rewriting rule */
	register i, flag;
	static char * rwnames[] = {

		"RLEFT",
		"RRIGHT",
		"RESC1",
		"RESC2",
		"RESC3",
		0,
		};

	if( rw == RNULL ){
		printf( "RNULL" );
		return;
		}

	if( rw == RNOP ){
		printf( "RNOP" );
		return;
		}

	flag = 0;
	for( i=0; rwnames[i]; ++i ){
		if( rw & (1<<i) ){
			if( flag ) printf( "|" );
			++flag;
			printf( rwnames[i] );
			}
		}
	}

reclaim( p, rw, cookie ) NODE *p; {
	register NODE **qq;
	register NODE *q;
	register i;
	NODE *recres[5];
	struct respref *r;

	/* get back stuff */

	if( rdebug ){
		printf( "reclaim( %o, ", p );
		rwprint( rw );
		printf( ", " );
		prcook( cookie );
		printf( " )\n" );
		}

	if( rw == RNOP || ( p->in.op==FREE && rw==RNULL ) ) return;  /* do nothing */

	walkf( p, recl2 );

	if( callop(p->in.op) ){
		/* check that all scratch regs are free */
		callchk(p);  /* ordinarily, this is the same as allchk() */
		}

	if( rw == RNULL || (cookie&FOREFF) ){ /* totally clobber, leaving nothing */
		tfree(p);
		return;
		}

	/* handle condition codes specially */

	if( (cookie & FORCC) && (rw&RESCC)) {
		/* result is CC register */
		tfree(p);
		p->in.op = CCODES;
		p->tn.lval = 0;
		p->tn.rval = 0;
		return;
		}

	/* locate results */

	qq = recres;

	if( rw&RLEFT) *qq++ = getlr( p, 'L' );;
	if( rw&RRIGHT ) *qq++ = getlr( p, 'R' );
	if( rw&RESC1 ) *qq++ = &resc[0];
	if( rw&RESC2 ) *qq++ = &resc[1];
	if( rw&RESC3 ) *qq++ = &resc[2];

	if( qq == recres ){
		cerror( "illegal reclaim");
		}

	*qq = NIL;

	/* now, select the best result, based on the cookie */

	for( r=respref; r->cform; ++r ){
		if( cookie & r->cform ){
			for( qq=recres; (q= *qq) != NIL; ++qq ){
				if( tshape( q, r->mform ) ) goto gotit;
				}
			}
		}

	/* we can't do it; die */
	cerror( "cannot reclaim");

	gotit:

	if( p->in.op == STARG ) p = p->in.left;  /* STARGs are still STARGS */

	q->in.type = p->in.type;  /* to make multi-register allocations work */
		/* maybe there is a better way! */
	q = tcopy(q);

	tfree(p);

	p->in.op = q->in.op;
	p->tn.lval = q->tn.lval;
	p->tn.rval = q->tn.rval;
#ifdef FLEXNAMES
	p->in.name = q->in.name;
#else
	for( i=0; i<NCHNAM; ++i )
		p->in.name[i] = q->in.name[i];
#endif

	q->in.op = FREE;

	/* if the thing is in a register, adjust the type */

	switch( p->in.op ){

	case REG:
		if( ! (p->in.rall & MUSTDO ) ) return;  /* unless necessary, ignore it */
		i = p->in.rall & ~MUSTDO;
		if( i & NOPREF ) return;
		if( i != p->tn.rval ){
			if( busy[i] || ( szty(p->in.type)==2 && busy[i+1] ) ){
				cerror( "faulty register move" );
				}
			rbusy( i, p->in.type );
			rfree( p->tn.rval, p->in.type );
			rmove( i, p->tn.rval, p->in.type );
			p->tn.rval = i;
			}

	case OREG:
		if( R2TEST(p->tn.rval) ){
			int r1, r2;
			r1 = R2UPK1(p->tn.rval);
			r2 = R2UPK2(p->tn.rval);
			if( (busy[r1]>1 && istreg(r1)) || (busy[r2]>1 && istreg(r2)) ){
				cerror( "potential register overwrite" );
				}
			}
		else if( (busy[p->tn.rval]>1) && istreg(p->tn.rval) ) cerror( "potential register overwrite");
		}

	}

ncopy( q, p ) NODE *p, *q; {
	/* copy the contents of p into q, without any feeling for
	   the contents */
	/* this code assume that copying rval and lval does the job;
	   in general, it might be necessary to special case the
	   operator types */
	register i;

	q->in.op = p->in.op;
	q->in.rall = p->in.rall;
	q->in.type = p->in.type;
	q->tn.lval = p->tn.lval;
	q->tn.rval = p->tn.rval;
#ifdef FLEXNAMES
	q->in.name = p->in.name;
#else
	for( i=0; i<NCHNAM; ++i ) q->in.name[i]  = p->in.name[i];
#endif

	}

NODE *
tcopy( p ) register NODE *p; {
	/* make a fresh copy of p */

	register NODE *q;
	register r;

	ncopy( q=talloc(), p );

	r = p->tn.rval;
	if( p->in.op == REG ) rbusy( r, p->in.type );
	else if( p->in.op == OREG ) {
		if( R2TEST(r) ){
			rbusy( R2UPK1(r), PTR+INT );
			rbusy( R2UPK2(r), INT );
			}
		else {
			rbusy( r, PTR+INT );
			}
		}

	switch( optype(q->in.op) ){

	case BITYPE:
		q->in.right = tcopy(p->in.right);
	case UTYPE:
		q->in.left = tcopy(p->in.left);
		}

	return(q);
	}

allchk(){
	/* check to ensure that all register are free */

	register i;

	REGLOOP(i){
		if( istreg(i) && busy[i] ){
			cerror( "register allocation error");
			}
		}

	}
",
		"RESC2",
		"RESC3",
		0,
		};

	if( rw == RNULL ){
		printf( "RNULL" );
		return;
		}

	if( rw == RNOP ){
		printf( "RNOP" );
		return;
		}

	flag sumacc/cc/ccom/ccom68.1   444      0     12        1116  3470501544   7771 .TH CCOM68 1 MC68000
.SU
.SH NAME
ccom68 \- .c -> .s translator component of cc68
.SH SYNOPSIS
.B ccom68
[ -lXp ]
.SH DESCRIPTION
.I Ccom68
is the UNIX C compiler modified for the MC68000.  It takes its input from stdin
and the resulting assembly code is printed on stdout.
.PP
The -l option generates line numbers in the output.  The -p option causes the
profile forming instruction "jbsr mcount" to be inserted at the entry to each
function.  The latter option must be preceded by X, which signals that it is a
pass 2 option.
.SH FILES
/usr/sun/c68  /usr/bin/ccom68
.SH SEE ALSO
cc68 (1)
al;
#ifdef FLEXNAMES
	q->in.name = p->in.name;
#else
	for( i=0; i<NCHNAM; ++i ) q->in.name[i]  = p->in.name[i];
#endif

	}

NODE *
tcopy( p ) register NODE *p; {
	/* make a fresh copy of p */

	register NODE *q;
	register r;

	ncopy( q=talloc(), p );

	r = p->tn.rval;
	if( p->in.op == REG ) rbusy( r, p->in.type );
	else if( p->in.op == OREG ) {
		if( R2TEST(r) ){
			rbusy( R2UPK1(r), PTR+INT );
			rbusy( R2UPK2(r), INT );
			}
		esumacc/cc/ccom/cgram.c   444      0     12      114361  3470501545  10115 # define NAME 2
# define STRING 3
# define ICON 4
# define FCON 5
# define PLUS 6
# define MINUS 8
# define MUL 11
# define AND 14
# define OR 17
# define ER 19
# define QUEST 21
# define COLON 22
# define ANDAND 23
# define OROR 24
# define ASOP 25
# define RELOP 26
# define EQUOP 27
# define DIVOP 28
# define SHIFTOP 29
# define INCOP 30
# define UNOP 31
# define STROP 32
# define TYPE 33
# define CLASS 34
# define STRUCT 35
# define RETURN 36
# define GOTO 37
# define IF 38
# define ELSE 39
# define SWITCH 40
# define BREAK 41
# define CONTINUE 42
# define WHILE 43
# define DO 44
# define FOR 45
# define DEFAULT 46
# define CASE 47
# define SIZEOF 48
# define ENUM 49
# define LP 50
# define RP 51
# define LC 52
# define RC 53
# define LB 54
# define RB 55
# define CM 56
# define SM 57
# define ASSIGN 58

# line 108 "cgram.y"
# include "mfile1"
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern short yyerrflag;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
YYSTYPE yylval, yyval;

# line 127 "cgram.y"
	static int fake = 0;
#ifndef FLEXNAMES
	static char fakename[NCHNAM+1];
#else
	static char fakename[24];
#endif
# define YYERRCODE 256

# line 800 "cgram.y"


NODE *
mkty( t, d, s ) unsigned t; {
	return( block( TYPE, NIL, NIL, t, d, s ) );
	}

NODE *
bdty( op, p, v ) NODE *p; {
	register NODE *q;

	q = block( op, p, NIL, INT, 0, INT );

	switch( op ){

	case UNARY MUL:
	case UNARY CALL:
		break;

	case LB:
		q->in.right = bcon(v);
		break;

	case NAME:
		q->tn.rval = v;
		break;

	default:
		cerror( "bad bdty" );
		}

	return( q );
	}

dstash( n ){ /* put n into the dimension table */
	if( curdim >= DIMTABSZ-1 ){
		cerror( "dimension table overflow");
		}
	dimtab[ curdim++ ] = n;
	}

savebc() {
	if( psavbc > & asavbc[BCSZ-4 ] ){
		cerror( "whiles, fors, etc. too deeply nested");
		}
	*psavbc++ = brklab;
	*psavbc++ = contlab;
	*psavbc++ = flostat;
	*psavbc++ = swx;
	flostat = 0;
	}

resetbc(mask){

	swx = *--psavbc;
	flostat = *--psavbc | (flostat&mask);
	contlab = *--psavbc;
	brklab = *--psavbc;

	}

addcase(p) NODE *p; { /* add case to switch */

	p = optim( p );  /* change enum to ints */
	if( p->in.op != ICON ){
		uerror( "non-constant case expression");
		return;
		}
	if( swp == swtab ){
		uerror( "case not in switch");
		return;
		}
	if( swp >= &swtab[SWITSZ] ){
		cerror( "switch table overflow");
		}
	swp->sval = p->tn.lval;
	deflab( swp->slab = getlab() );
	++swp;
	tfree(p);
	}

adddef(){ /* add default case to switch */
	if( swtab[swx].slab >= 0 ){
		uerror( "duplicate default in switch");
		return;
		}
	if( swp == swtab ){
		uerror( "default not inside switch");
		return;
		}
	deflab( swtab[swx].slab = getlab() );
	}

swstart(){
	/* begin a switch block */
	if( swp >= &swtab[SWITSZ] ){
		cerror( "switch table overflow");
		}
	swx = swp - swtab;
	swp->slab = -1;
	++swp;
	}

swend(){ /* end a switch block */

	register struct sw *swbeg, *p, *q, *r, *r1;
	CONSZ temp;
	int tempi;

	swbeg = &swtab[swx+1];

	/* sort */

	r1 = swbeg;
	r = swp-1;

	while( swbeg < r ){
		/* bubble largest to end */
		for( q=swbeg; q<r; ++q ){
			if( q->sval > (q+1)->sval ){
				/* swap */
				r1 = q+1;
				temp = q->sval;
				q->sval = r1->sval;
				r1->sval = temp;
				tempi = q->slab;
				q->slab = r1->slab;
				r1->slab = tempi;
				}
			}
		r = r1;
		r1 = swbeg;
		}

	/* it is now sorted */

	for( p = swbeg+1; p<swp; ++p ){
		if( p->sval == (p-1)->sval ){
			uerror( "duplicate case in switch, %d", tempi=p->sval );
			return;
			}
		}

	genswitch( swbeg-1, swp-swbeg );
	swp = swbeg-1;
	}
short yyexca[] ={
-1, 1,
	0, -1,
	2, 18,
	11, 18,
	50, 18,
	57, 18,
	-2, 0,
-1, 19,
	56, 76,
	57, 76,
	-2, 7,
-1, 24,
	56, 75,
	57, 75,
	-2, 73,
-1, 26,
	56, 79,
	57, 79,
	-2, 74,
-1, 32,
	52, 41,
	-2, 39,
-1, 34,
	52, 33,
	-2, 31,
	};
# define YYNPROD 178
# define YYLAST 1173
short yyact[]={

 229,  18, 263,  93, 194, 130, 145, 100,  59, 129,
 227,   6,  77,  98, 249,  89,  87,  88,  27,  27,
  80,  56,  97,  78, 102, 230,  79,  21,  21,  10,
   9,  14,  27,  95,  46,  20,  92,  51,  66, 304,
 272,  21,  82,  81, 271,  16,  36, 257, 239, 240,
 244,  75, 248, 237, 238, 245, 246, 247, 251, 250,
  83,  99,  84, 303, 108, 228,  22,  22, 110, 241,
   8, 154, 201, 225,  17, 106, 298, 131,  28, 287,
  22,  36,  35,  45, 267, 146, 150, 187,  74, 105,
 266, 138, 139, 140, 141, 142, 143, 103, 198,  91,
  53,  70,  57, 197, 154, 101,  71, 155, 281,  24,
 158, 254, 112, 153, 162, 163, 164, 166, 168, 170,
 172, 174, 175, 177, 179, 181, 182, 183, 184, 185,
 109,  40,  42, 131, 156,  48, 189, 186,  73,  49,
  38, 159, 188, 160,  39, 146,  38,  69,  48,  68,
  39, 191,  49, 219, 256, 147, 134, 219, 136,  48,
  65, 253,  57,  49, 213, 157, 204,  94, 205, 152,
 206,  33, 207, 202, 208,  31, 137, 209, 293, 210,
 135, 211, 285, 249,  89,  87,  88, 217, 131,  80,
 192,  72,  78, 214, 200,  79, 215,  64, 223, 294,
 221, 222, 196, 224, 226, 218, 278,  40, 282,  42,
 196,  82,  81, 252, 277, 147,  94, 239, 240, 244,
 276, 248, 237, 238, 245, 246, 247, 251, 250,  83,
 218,  84, 275, 108, 151, 274, 264,  98, 241,  27,
 269, 195, 259, 260, 261, 262,  97, 265,  21, 195,
 220, 279,   4, 151, 273,  10,   9,  14, 255,  52,
 284,   9, 283,  54,  10,   9,  14,  96, 242,  30,
 270,  16,  26,  26, 108, 288, 289, 264, 291, 290,
  16,  10, 280,  14,   7,  99,  26,  22,  47, 119,
 190,  60, 111,  29,  34, 300, 295,  16,  32, 264,
 116, 301, 117,  67, 243, 119, 115, 107, 121,  94,
 104, 122, 132, 123,  50, 126,  19, 124, 125, 127,
 113, 120, 115, 118, 116,  25, 117,  61,  44, 119,
 199,  90,  41,  43,  55,  58, 116, 161, 117, 203,
  63, 119,  62,  37, 121, 302, 115, 122,   3, 123,
 114, 126, 128, 124, 125, 127, 113, 120, 115, 118,
   2, 149,  85,  11,  12,   5,  23,  13,  15, 236,
 234, 235, 116, 233, 117, 231, 232, 119,   1,   0,
 121, 299,   0, 122,   0, 123, 114, 126, 128, 124,
 125, 127, 113, 120, 115, 118,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0, 116,   0,
 117,   0,   0, 119,   0,   0, 121, 297,   0, 122,
   0, 123, 114, 126, 128, 124, 125, 127, 113, 120,
 115, 118,   0, 116,   0, 117,   0, 242, 119,   0,
   0,   0,   0,   0,   0,   0, 116,   0, 117,   0,
   0, 119,   0, 296, 121, 115, 118, 122, 114, 123,
 128, 126, 292, 124, 125, 127, 113, 120, 115, 118,
 116,   0, 117,   0,   0, 119,   0,   0, 121,   0,
   0, 122,   0, 123,   0, 126,   0, 124, 125, 127,
 113, 120, 115, 118,   0, 116, 114, 117, 128,   0,
 119,   0,   0, 121,   0,   0, 122,   0, 123,   0,
 126,   0, 124, 125, 127, 113, 120, 115, 118,   0,
 114, 286, 128,   0,   0,   0,   0,   0,   0, 116,
   0, 117,   0,   0, 119,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0, 114, 258, 128, 116, 113,
 117, 115, 118, 119,   0,   0, 121,   0,   0, 122,
   0, 123,   0, 126,   0, 124, 125, 127, 113, 120,
 115, 118, 116,   0, 117,   0,   0, 119,   0,   0,
 121,   0,   0, 122,   0, 123,   0, 126, 212, 124,
 125, 127, 113, 120, 115, 118,   0, 216, 114,   0,
 128,   0,   0,   0,   0,   0,   0,   0, 116,   0,
 117,   0, 116, 119, 117,   0, 121, 119,   0, 122,
 121, 123, 114, 126, 128, 124, 125, 127, 113, 120,
 115, 118, 113, 120, 115, 118,   0,   0,   0,   0,
   0,   0,   0,   0, 116,   0, 117,   0,   0, 119,
   0,   0, 121, 193,   0, 122,   0, 123, 114, 126,
 128, 124, 125, 127, 113, 120, 115, 118, 116,   0,
 117,   0,   0, 119,   0,   0, 121,   0,   0, 122,
   0, 123,   0, 126,   0, 124, 125, 127, 113, 120,
 115, 118,   0,   0, 114,   0, 128,  86,  89,  87,
  88,   0,   0,  80,   0,   0,  78,   0,   0,  79,
  86,  89,  87,  88,   0,   0,  80,   0,   0,  78,
 128,   0,  79,   0,   0,  82,  81,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,  82,  81,
   0,   0,   0,  83,   0,  84,   0,   0,  86,  89,
  87,  88,   0, 180,  80,   0,  83,  78,  84,   0,
  79,  86,  89,  87,  88,   0, 178,  80,   0,   0,
  78,   0,   0,  79,   0,   0,  82,  81,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,   0,  82,
  81,   0,   0,   0,  83,   0,  84,   0,   0,  86,
  89,  87,  88,   0, 176,  80,   0,  83,  78,  84,
   0,  79,  86,  89,  87,  88,   0, 173,  80,   0,
   0,  78,   0,   0,  79,   0,   0,  82,  81,   0,
   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  82,  81,   0,   0,   0,  83,   0,  84,   0,   0,
  86,  89,  87,  88,   0, 171,  80,   0,  83,  78,
  84,   0,  79,  86,  89,  87,  88,   0, 169,  80,
   0,   0,  78,   0,   0,  79,   0,   0,  82,  81,
   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
   0,  82,  81,   0,   0,   0,  83,   0,  84,   0,
   0,  86,  89,  87,  88,   0, 167,  80,   0,  83,
  78,  84,   0,  79,  86,  89,  87,  88,   0, 165,
  80,   0,   0,  78,   0,   0,  79,   0,   0,  82,
  81, 116,   0, 117,   0,   0, 119,   0,   0, 121,
   0,   0,  82,  81, 123,   0,   0,  83,   0,  84,
   0, 113, 120, 115, 118,   0, 268,   0,   0,   0,
  83,   0,  84,   0, 133,  86,  89,  87,  88,   0,
   0,  80,   0,   0,  78,   0,   0,  79,  86,  89,
  87,  88,   0,   0,  80,   0,   0,  78,   0,   0,
  79,   0,   0,  82,  81,   0,  10,   0,  14,   0,
   0,   0,   0,   0,   0,   0,  82,  81,   0,   0,
   0,  83,  16,  84,   0,   0,   0,   0,  86,  89,
  87,  88,   0,   0,  83,   0,  84,   0,  76,  86,
  89,  87,  88,   0,   0,  80,   0,   0,  78,   0,
   0,  79,  86,  89,  87,  88,  82,  81,  80,   0,
   0,  78,   0,   0,  79,   0,   0,  82,  81,   0,
   0,   0,   0,   0,  83,   0,  84,   0,   0,   0,
  82,  81,   0,   0, 116,  83, 117,  84, 148, 119,
  86,  89,  87,  88,   0,   0,  80,   0,  83,  78,
  84,   0,  79,   0, 113, 120, 115, 118,   0, 116,
   0, 117,   0,   0, 119,   0,   0, 121,  82,  81,
 122,   0, 123,   0, 126,   0, 124, 125,   0, 113,
 120, 115, 118,   0,   0, 116,  83, 117, 144,   0,
 119,   0,   0, 121,   0,   0, 122,   0, 123,   0,
   0,   0, 124,   0,   0, 113, 120, 115, 118, 116,
   0, 117,   0,   0, 119,   0,   0, 121,   0,   0,
 122,   0, 123,   0,   0,   0,   0,   0,   0, 113,
 120, 115, 118 };
short yypact[]={

-1000,  -4,-1000,-1000,-1000,  17,-1000, 248, 227,-1000,
 236,-1000,-1000, 123, 296, 119, 292,-1000,  25,  90,
-1000, 237, 237,  32, 109, -21,-1000, 209,-1000, 248,
 230, 248,-1000, 289,-1000,-1000,-1000,-1000, 146, 105,
 109,  90,  98,  96,  50,-1000,-1000,-1000, 140,  83,
 976,-1000,-1000,-1000,-1000,  42,-1000,  11,  49,-1000,
 -34,  30,-1000, 222,-1000,-1000,  75,1040,-1000,-1000,
-1000, 290,-1000,-1000,  57, 662, 912, 126,1040,1040,
1040,1040,1040,1078, 963,1027, 203,-1000,-1000,-1000,
 116, 248,  48,-1000,  85,-1000,-1000, 235,-1000, 235,
 112, 289,-1000,-1000,  90,-1000,  11,-1000,-1000,-1000,
 662,-1000,-1000,1040,1040, 861, 848, 810, 797, 759,
1040, 746, 708, 695,1040,1040,1040,1040,1040,  31,
-1000, 662, 912,-1000,-1000,1040, 288,-1000, 126, 126,
 126, 126, 126, 126, 963, 139, 602, 191,-1000,  47,
 662,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
  15, 231, 427, 662,-1000,1040, 278,1040, 278,1040,
 318,1040,-1000,1040, 523,1068,1040, 925,1040, 606,
1040,1143,1119, 566, 662, 662, 111, 912,  31, 542,
-1000, 136,1040,-1000,  99, 199, 191,1040,-1000,  11,
-1000,-1000,  16,  12, 662, 662, 662, 662, 662, 662,
 662, 662,1040,-1000,-1000, 108,-1000,1016, 126,  56,
-1000, 103,  99, 662,-1000,-1000, -10,-1000,-1000, 489,
-1000, 181, 181, 181, 181,1040, 181,  33,  27, 899,
 268,-1000, -13, 181, 185, 182,-1000, 170, 164, 184,
1040, 260,1093,-1000,-1000,  53, 158,-1000,-1000, 223,
-1000,-1000, 217, 131, 638,-1000,-1000,-1000,-1000, 464,
  22,-1000,-1000,-1000,1040,1040,1040,1040,-1000, 440,
-1000,-1000, 127,-1000, 149, 181,-1000,-1000, 402, 366,
  19, 330,-1000,-1000,1040,-1000,-1000,-1000,1040,-1000,
 294,   6, -18,-1000,-1000 };
short yypgo[]={

   0, 378,  38, 376, 375, 373, 371, 370, 369, 368,
 367, 366,   0,   2,  12,  11, 365,  70, 364, 363,
   6,   4, 362,   3, 310, 109, 361, 360, 348,   1,
 343, 342, 340,  25,  36, 339,  10, 337, 284, 335,
   7,   8, 334, 331,  21, 330, 328,  35, 327, 325,
 314,   9,   5, 312, 307, 304, 303 };
short yyr1[]={

   0,   1,   1,  27,  27,  28,  28,  30,  28,  31,
  32,  32,  35,  35,  37,  37,  37,  16,  16,  15,
  15,  15,  15,  15,  38,  17,  17,  17,  17,  17,
  18,  18,   9,   9,  39,  39,  41,  41,  19,  19,
  10,  10,  42,  42,  44,  44,  34,  45,  34,  23,
  23,  23,  23,  25,  25,  25,  25,  25,  25,  24,
  24,  24,  24,  24,  24,  24,  11,  46,  46,  46,
  29,  48,  29,  49,  49,  47,  47,  47,  47,  47,
  51,  51,  52,  52,  40,  40,  43,  43,  50,  50,
  53,  33,  54,  36,  36,  36,  36,  36,  36,  36,
  36,  36,  36,  36,  36,  36,  36,  36,  36,  36,
  55,  55,  55,   7,   4,   3,   5,   6,   8,  56,
   2,  13,  13,  26,  26,  12,  12,  12,  12,  12,
  12,  12,  12,  12,  12,  12,  12,  12,  12,  12,
  12,  12,  12,  12,  12,  12,  12,  12,  12,  12,
  14,  14,  14,  14,  14,  14,  14,  14,  14,  14,
  14,  14,  14,  14,  14,  14,  14,  14,  20,  21,
  21,  21,  21,  21,  21,  21,  22,  22 };
short yyr2[]={

   0,   2,   0,   1,   1,   2,   3,   0,   4,   2,
   4,   0,   2,   0,   3,   4,   0,   1,   0,   2,
   2,   1,   1,   3,   1,   1,   2,   3,   1,   1,
   5,   2,   1,   2,   1,   3,   1,   3,   5,   2,
   1,   2,   1,   3,   2,   1,   1,   0,   4,   1,
   3,   2,   1,   2,   3,   3,   4,   1,   3,   2,
   3,   3,   4,   3,   3,   2,   2,   1,   3,   1,
   1,   0,   4,   1,   1,   1,   1,   3,   6,   1,
   1,   3,   1,   4,   0,   1,   0,   1,   0,   1,
   1,   4,   1,   2,   1,   2,   2,   2,   7,   4,
   2,   2,   2,   2,   3,   3,   1,   2,   2,   2,
   2,   3,   2,   1,   4,   3,   4,   6,   4,   0,
   2,   1,   0,   1,   3,   3,   3,   3,   3,   3,
   3,   3,   3,   3,   3,   3,   3,   3,   4,   4,
   4,   4,   4,   4,   4,   4,   5,   3,   3,   1,
   2,   2,   2,   2,   2,   2,   2,   4,   4,   4,
   2,   3,   3,   1,   1,   1,   1,   3,   2,   0,
   2,   5,   2,   3,   4,   3,   2,   2 };
short yychk[]={

-1000,  -1, -27, -28, 256, -16, -15, -38, -17,  34,
  33, -19, -18, -10,  35,  -9,  49,  57, -29, -24,
 -47,  11,  50, -11, -25, -49, 256,   2, -17, -38,
  33,  52,   2,  52,   2,  57,  56, -30,  50,  54,
 -25, -24, -25, -24, -46,  51,   2, 256,  50,  54,
 -50,  58,  50, -17,  33, -42, -44, -17, -39, -41,
   2, -48, -31, -32,  51,  55,  -2, -56,  51,  51,
  51,  56,  51,  55,  -2, -12,  52, -14,  11,  14,
   8,  31,  30,  48,  50, -22,   2,   4,   5,   3,
 -43,  57, -34, -23, -25,  22, 256,  11,   2,  50,
 -40,  56,  58, -47, -24, -33, -15, -54,  52,  55,
 -12,   2,  55,  26,  56,  28,   6,   8,  29,  11,
  27,  14,  17,  19,  23,  24,  21,  25,  58, -51,
 -52, -12, -53,  52,  30,  54,  32,  50, -14, -14,
 -14, -14, -14, -14,  50, -20, -12, -17,  51, -26,
 -12,  50,  53, -44,  56,  22,  -2,  53, -41,  -2,
 -34, -37, -12, -12, -12,  58, -12,  58, -12,  58,
 -12,  58, -12,  58, -12, -12,  58, -12,  58, -12,
  58, -12, -12, -12, -12, -12, -40,  56, -51, -12,
   2, -20,  51,  51, -21,  50,  11,  56,  51, -45,
  -2,  57, -15, -35, -12, -12, -12, -12, -12, -12,
 -12, -12,  22,  53, -52, -40,  55,  51, -14,  54,
  51, -21, -21, -12, -23,  57, -29, -36,  53, -12,
 -33,  -4,  -3,  -5,  -7,  -6,  -8,  41,  42,  36,
  37,  57, 256, -55,  38,  43,  44,  45,  40,   2,
  47,  46, -12,  53,  55,  -2,  51,  57,  57, -36,
 -36, -36, -36, -13, -12, -36,  57,  57,  57, -12,
   2,  57,  53, -36,  50,  50,  50,  50,  22, -12,
  22,  55,  50,  39,  43,  51,  57,  57, -12, -12,
 -13, -12,  22,  51,  50, -36,  51,  51,  57,  51,
 -12, -13,  51,  57,  57 };
short yydef[]={

   2,  -2,   1,   3,   4,   0,  17,  21,  22,  24,
  25,  28,  29,   0,  40,   0,  32,   5,   0,  -2,
  70,   0,   0,   0,  -2,  88,  -2,  57,  19,  20,
  26,   0,  -2,   0,  -2,   6,  71,  11,   0, 119,
  53,  59,   0,   0,   0,  65,  67,  69,   0, 119,
   0,  89,  66,  23,  27,  86,  42,  45,  84,  34,
  36,   0,   8,   0,  60,  61,   0,   0,  58,  63,
  64,   0,  54,  55,   0,  77,   0, 149,   0,   0,
   0,   0,   0,   0,   0,   0, 163, 164, 165, 166,
   0,  87,  44,  46,  49, 119,  52,   0,  57,   0,
   0,  85, 119,  72,  76,   9,   0,  16,  92,  62,
 120,  68,  56,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,   0,  84,
  80,  82,   0,  90, 150,   0,   0, 177, 151, 152,
 153, 154, 155, 156,   0,   0,   0, 169, 160,   0,
 123, 176,  38,  43,  47, 119,  51,  30,  35,  37,
   0,  13, 125, 126, 127,   0, 128,   0, 129,   0,
 130,   0, 131,   0, 132, 133,   0, 134,   0, 135,
   0, 136, 137,   0, 147, 148,   0,  85,  84,   0,
 162,   0,   0, 167, 168, 169, 169,   0, 161,   0,
  50,  10,   0,   0, 139, 140, 141, 142, 138, 143,
 144, 145,   0,  78,  81,   0, 159, 158, 157, 119,
 170,   0, 172, 124,  48,  14,   0,  12,  91,   0,
  94,   0,   0,   0,   0, 122,   0,   0,   0,   0,
   0, 106,   0,   0,   0,   0, 113,   0,   0, 163,
   0,   0, 146,  83, 173,   0, 175,  15,  93,  95,
  96,  97,   0,   0, 121, 100, 101, 102, 103,   0,
   0, 107, 108, 109,   0,   0, 122,   0, 110,   0,
 112, 174,   0, 115,   0,   0, 104, 105,   0,   0,
   0,   0, 111, 171,   0,  99, 114, 116, 122, 118,
   0,   0,   0, 117,  98 };
#ifndef lint
static char yaccpar_sccsid[] = "@(#)yaccpar	4.1	(Berkeley)	2/11/83";
#endif not lint

#
# define YYFLAG -1000
# define YYERROR goto yyerrlab
# define YYACCEPT return(0)
# define YYABORT return(1)

/*	parser for yacc output	*/

#ifdef YYDEBUG
int yydebug = 0; /* 1 for debugging */
#endif
YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
int yychar = -1; /* current input token number */
int yynerrs = 0;  /* number of errors */
short yyerrflag = 0;  /* error recovery flag */

yyparse() {

	short yys[YYMAXDEPTH];
	short yyj, yym;
	register YYSTYPE *yypvt;
	register short yystate, *yyps, yyn;
	register YYSTYPE *yypv;
	register short *yyxi;

	yystate = 0;
	yychar = -1;
	yynerrs = 0;
	yyerrflag = 0;
	yyps= &yys[-1];
	yypv= &yyv[-1];

 yystack:    /* put a state and value onto the stack */

#ifdef YYDEBUG
	if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
#endif
		if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
		*yyps = yystate;
		++yypv;
		*yypv = yyval;

 yynewstate:

	yyn = yypact[yystate];

	if( yyn<= YYFLAG ) goto yydefault; /* simple state */

	if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
	if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;

	if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
		yychar = -1;
		yyval = yylval;
		yystate = yyn;
		if( yyerrflag > 0 ) --yyerrflag;
		goto yystack;
		}

 yydefault:
	/* default state action */

	if( (yyn=yydef[yystate]) == -2 ) {
		if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
		/* look through exception table */

		for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */

		while( *(yyxi+=2) >= 0 ){
			if( *yyxi == yychar ) break;
			}
		if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
		}

	if( yyn == 0 ){ /* error */
		/* error ... attempt to resume parsing */

		switch( yyerrflag ){

		case 0:   /* brand new error */

			yyerror( "syntax error" );
		yyerrlab:
			++yynerrs;

		case 1:
		case 2: /* incompletely recovered error ... try again */

			yyerrflag = 3;

			/* find a state where "error" is a legal shift action */

			while ( yyps >= yys ) {
			   yyn = yypact[*yyps] + YYERRCODE;
			   if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
			      yystate = yyact[yyn];  /* simulate a shift of "error" */
			      goto yystack;
			      }
			   yyn = yypact[*yyps];

			   /* the current yyps has no shift onn "error", pop stack */

#ifdef YYDEBUG
			   if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
#endif
			   --yyps;
			   --yypv;
			   }

			/* there is no state on the stack with an error shift ... abort */

	yyabort:
			return(1);


		case 3:  /* no shift yet; clobber input char */

#ifdef YYDEBUG
			if( yydebug ) printf( "error recovery discards char %d\n", yychar );
#endif

			if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
			yychar = -1;
			goto yynewstate;   /* try again in the same state */

			}

		}

	/* reduction by production yyn */

#ifdef YYDEBUG
		if( yydebug ) printf("reduce %d\n",yyn);
#endif
		yyps -= yyr2[yyn];
		yypvt = yypv;
		yypv -= yyr2[yyn];
		yyval = yypv[1];
		yym=yyn;
			/* consult goto table to find next state */
		yyn = yyr1[yyn];
		yyj = yypgo[yyn] + *yyps + 1;
		if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
		switch(yym){
			
case 2:
# line 137 "cgram.y"
ftnend(); break;
case 3:
# line 140 "cgram.y"
{ curclass = SNULL;  blevel = 0; } break;
case 4:
# line 142 "cgram.y"
{ curclass = SNULL;  blevel = 0; } break;
case 5:
# line 146 "cgram.y"
{  yypvt[-1].nodep->in.op = FREE; } break;
case 6:
# line 148 "cgram.y"
{  yypvt[-2].nodep->in.op = FREE; } break;
case 7:
# line 149 "cgram.y"
{
				defid( tymerge(yypvt[-1].nodep,yypvt[-0].nodep), curclass==STATIC?STATIC:EXTDEF );
				} break;
case 8:
# line 152 "cgram.y"
{  
			    if( blevel ) cerror( "function level error" );
			    if( reached ) retstat |= NRETVAL; 
			    yypvt[-3].nodep->in.op = FREE;
			    ftnend();
			    } break;
case 10:
# line 163 "cgram.y"
{ curclass = SNULL;  yypvt[-2].nodep->in.op = FREE; } break;
case 11:
# line 164 "cgram.y"
{  blevel = 1; } break;
case 13:
# line 169 "cgram.y"
{  bccode();
			    locctr(PROG);
			    } break;
case 14:
# line 175 "cgram.y"
{  yypvt[-1].nodep->in.op = FREE; } break;
case 15:
# line 177 "cgram.y"
{  yypvt[-2].nodep->in.op = FREE; } break;
case 18:
# line 183 "cgram.y"
{  yyval.nodep = mkty(INT,0,INT);  curclass = SNULL; } break;
case 19:
# line 186 "cgram.y"
{  yyval.nodep = yypvt[-0].nodep; } break;
case 21:
# line 189 "cgram.y"
{  yyval.nodep = mkty(INT,0,INT); } break;
case 22:
# line 191 "cgram.y"
{ curclass = SNULL ; } break;
case 23:
# line 193 "cgram.y"
{  yypvt[-2].nodep->in.type = types( yypvt[-2].nodep->in.type, yypvt[-0].nodep->in.type, UNDEF );
 			    yypvt[-0].nodep->in.op = FREE;
 			    } break;
case 24:
# line 200 "cgram.y"
{  curclass = yypvt[-0].intval; } break;
case 26:
# line 205 "cgram.y"
{  yypvt[-1].nodep->in.type = types( yypvt[-1].nodep->in.type, yypvt[-0].nodep->in.type, UNDEF );
			    yypvt[-0].nodep->in.op = FREE;
			    } break;
case 27:
# line 209 "cgram.y"
{  yypvt[-2].nodep->in.type = types( yypvt[-2].nodep->in.type, yypvt[-1].nodep->in.type, yypvt[-0].nodep->in.type );
			    yypvt[-1].nodep->in.op = yypvt[-0].nodep->in.op = FREE;
			    } break;
case 30:
# line 217 "cgram.y"
{ yyval.nodep = dclstruct(yypvt[-4].intval); } break;
case 31:
# line 219 "cgram.y"
{  yyval.nodep = rstruct(yypvt[-0].intval,0);  stwart = instruct; } break;
case 32:
# line 223 "cgram.y"
{  yyval.intval = bstruct(-1,0); stwart = SEENAME; } break;
case 33:
# line 225 "cgram.y"
{  yyval.intval = bstruct(yypvt[-0].intval,0); stwart = SEENAME; } break;
case 36:
# line 233 "cgram.y"
{  moedef( yypvt[-0].intval ); } break;
case 37:
# line 235 "cgram.y"
{  strucoff = yypvt[-0].intval;  moedef( yypvt[-2].intval ); } break;
case 38:
# line 239 "cgram.y"
{ yyval.nodep = dclstruct(yypvt[-4].intval);  } break;
case 39:
# line 241 "cgram.y"
{  yyval.nodep = rstruct(yypvt[-0].intval,yypvt[-1].intval); } break;
case 40:
# line 245 "cgram.y"
{  yyval.intval = bstruct(-1,yypvt[-0].intval);  stwart=0; } break;
case 41:
# line 247 "cgram.y"
{  yyval.intval = bstruct(yypvt[-0].intval,yypvt[-1].intval);  stwart=0;  } break;
case 44:
# line 255 "cgram.y"
{ curclass = SNULL;  stwart=0; yypvt[-1].nodep->in.op = FREE; } break;
case 45:
# line 257 "cgram.y"
{  if( curclass != MOU ){
				curclass = SNULL;
				}
			    else {
				sprintf( fakename, "$%dFAKE", fake++ );
#ifdef FLEXNAMES	/* TD810306 */
				/* No need to hash this, we won't look it up */
				defid( tymerge(yypvt[-0].nodep, bdty(NAME,NIL,lookup( savestr(fakename), SMOS ))), curclass );
#else
				defid( tymerge(yypvt[-0].nodep, bdty(NAME,NIL,lookup( fakename, SMOS ))), curclass );
#endif
				werror("structure typed union member must be named");
				}
			    stwart = 0;
			    yypvt[-0].nodep->in.op = FREE;
			    } break;
case 46:
# line 277 "cgram.y"
{ defid( tymerge(yypvt[-1].nodep,yypvt[-0].nodep), curclass);  stwart = instruct; } break;
case 47:
# line 278 "cgram.y"
{yyval.nodep=yypvt[-2].nodep;} break;
case 48:
# line 279 "cgram.y"
{ defid( tymerge(yypvt[-4].nodep,yypvt[-0].nodep), curclass);  stwart = instruct; } break;
case 50:
# line 284 "cgram.y"
{  if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" );
			    if( yypvt[-0].intval<0 || yypvt[-0].intval >= FIELD ){
				uerror( "illegal field size" );
				yypvt[-0].intval = 1;
				}
			    defid( tymerge(yypvt[-3].nodep,yypvt[-2].nodep), FIELD|yypvt[-0].intval );
			    yyval.nodep = NIL;
			    } break;
case 51:
# line 294 "cgram.y"
{  if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" );
			    falloc( stab, yypvt[-0].intval, -1, yypvt[-2].nodep );  /* alignment or hole */
			    yyval.nodep = NIL;
			    } break;
case 52:
# line 299 "cgram.y"
{  yyval.nodep = NIL; } break;
case 53:
# line 304 "cgram.y"
{  umul:
				yyval.nodep = bdty( UNARY MUL, yypvt[-0].nodep, 0 ); } break;
case 54:
# line 307 "cgram.y"
{  uftn:
				yyval.nodep = bdty( UNARY CALL, yypvt[-2].nodep, 0 );  } break;
case 55:
# line 310 "cgram.y"
{  uary:
				yyval.nodep = bdty( LB, yypvt[-2].nodep, 0 );  } break;
case 56:
# line 313 "cgram.y"
{  bary:
				if( (int)yypvt[-1].intval <= 0 ) werror( "zero or negative subscript" );
				yyval.nodep = bdty( LB, yypvt[-3].nodep, yypvt[-1].intval );  } break;
case 57:
# line 317 "cgram.y"
{  yyval.nodep = bdty( NAME, NIL, yypvt[-0].intval );  } break;
case 58:
# line 319 "cgram.y"
{ yyval.nodep=yypvt[-1].nodep; } break;
case 59:
# line 322 "cgram.y"
{  goto umul; } break;
case 60:
# line 324 "cgram.y"
{  goto uftn; } break;
case 61:
# line 326 "cgram.y"
{  goto uary; } break;
case 62:
# line 328 "cgram.y"
{  goto bary; } break;
case 63:
# line 330 "cgram.y"
{ yyval.nodep = yypvt[-1].nodep; } break;
case 64:
# line 332 "cgram.y"
{
				if( blevel!=0 ) uerror("function declaration in bad context");
				yyval.nodep = bdty( UNARY CALL, bdty(NAME,NIL,yypvt[-2].intval), 0 );
				stwart = 0;
				} break;
case 65:
# line 338 "cgram.y"
{
				yyval.nodep = bdty( UNARY CALL, bdty(NAME,NIL,yypvt[-1].intval), 0 );
				stwart = 0;
				} break;
case 66:
# line 345 "cgram.y"
{
				/* turn off typedefs for argument names */
				stwart = SEENAME;
				if( stab[yypvt[-1].intval].sclass == SNULL )
				    stab[yypvt[-1].intval].stype = FTN;
				} break;
case 67:
# line 354 "cgram.y"
{ ftnarg( yypvt[-0].intval );  stwart = SEENAME; } break;
case 68:
# line 356 "cgram.y"
{ ftnarg( yypvt[-0].intval );  stwart = SEENAME; } break;
case 71:
# line 362 "cgram.y"
{yyval.nodep=yypvt[-2].nodep;} break;
case 73:
# line 366 "cgram.y"
{  defid( yypvt[-0].nodep = tymerge(yypvt[-1].nodep,yypvt[-0].nodep), curclass);
			    beginit(yypvt[-0].nodep->tn.rval);
			    } break;
case 75:
# line 373 "cgram.y"
{  nidcl( tymerge(yypvt[-1].nodep,yypvt[-0].nodep) ); } break;
case 76:
# line 375 "cgram.y"
{  defid( tymerge(yypvt[-1].nodep,yypvt[-0].nodep), uclass(curclass) );
			} break;
case 77:
# line 379 "cgram.y"
{  doinit( yypvt[-0].nodep );
			    endinit(); } break;
case 78:
# line 382 "cgram.y"
{  endinit(); } break;
case 82:
# line 392 "cgram.y"
{  doinit( yypvt[-0].nodep ); } break;
case 83:
# line 394 "cgram.y"
{  irbrace(); } break;
case 88:
# line 406 "cgram.y"
{  werror( "old-fashioned initialization: use =" ); } break;
case 90:
# line 411 "cgram.y"
{  ilbrace(); } break;
case 91:
# line 417 "cgram.y"
{  --blevel;
			    if( blevel == 1 ) blevel = 0;
			    clearst( blevel );
			    checkst( blevel );
			    autooff = *--psavbc;
			    regvar = *--psavbc;
			    } break;
case 92:
# line 427 "cgram.y"
{  if( blevel == 1 ) dclargs();
			    ++blevel;
			    if( psavbc > &asavbc[BCSZ-2] ) cerror( "nesting too deep" );
			    *psavbc++ = regvar;
			    *psavbc++ = autooff;
			    } break;
case 93:
# line 436 "cgram.y"
{ ecomp( yypvt[-1].nodep ); } break;
case 95:
# line 439 "cgram.y"
{ deflab(yypvt[-1].intval);
			   reached = 1;
			   } break;
case 96:
# line 443 "cgram.y"
{  if( yypvt[-1].intval != NOLAB ){
				deflab( yypvt[-1].intval );
				reached = 1;
				}
			    } break;
case 97:
# line 449 "cgram.y"
{  branch(  contlab );
			    deflab( brklab );
			    if( (flostat&FBRK) || !(flostat&FLOOP)) reached = 1;
			    else reached = 0;
			    resetbc(0);
			    } break;
case 98:
# line 456 "cgram.y"
{  deflab( contlab );
			    if( flostat & FCONT ) reached = 1;
			    ecomp( buildtree( CBRANCH, buildtree( NOT, yypvt[-2].nodep, NIL ), bcon( yypvt[-6].intval ) ) );
			    deflab( brklab );
			    reached = 1;
			    resetbc(0);
			    } break;
case 99:
# line 464 "cgram.y"
{  deflab( contlab );
			    if( flostat&FCONT ) reached = 1;
			    if( yypvt[-2].nodep ) ecomp( yypvt[-2].nodep );
			    branch( yypvt[-3].intval );
			    deflab( brklab );
			    if( (flostat&FBRK) || !(flostat&FLOOP) ) reached = 1;
			    else reached = 0;
			    resetbc(0);
			    } break;
case 100:
# line 474 "cgram.y"
{  if( reached ) branch( brklab );
			    deflab( yypvt[-1].intval );
			   swend();
			    deflab(brklab);
			    if( (flostat&FBRK) || !(flostat&FDEF) ) reached = 1;
			    resetbc(FCONT);
			    } break;
case 101:
# line 482 "cgram.y"
{  if( brklab == NOLAB ) uerror( "illegal break");
			    else if(reached) branch( brklab );
			    flostat |= FBRK;
			    if( brkflag ) goto rch;
			    reached = 0;
			    } break;
case 102:
# line 489 "cgram.y"
{  if( contlab == NOLAB ) uerror( "illegal continue");
			    else branch( contlab );
			    flostat |= FCONT;
			    goto rch;
			    } break;
case 103:
# line 495 "cgram.y"
{  retstat |= NRETVAL;
			    branch( retlab );
			rch:
			    if( !reached ) werror( "statement not reached");
			    reached = 0;
			    } break;
case 104:
# line 502 "cgram.y"
{  register NODE *temp;
			    idname = curftn;
			    temp = buildtree( NAME, NIL, NIL );
			    if(temp->in.type == TVOID)
				uerror("void function %s cannot return value",
					stab[idname].sname);
			    temp->in.type = DECREF( temp->in.type );
			    temp = buildtree( RETURN, temp, yypvt[-1].nodep );
			    /* now, we have the type of the RHS correct */
			    tfree(temp->in.left);
			    temp->in.op = FREE;
			    ecomp( buildtree( FORCE, temp->in.right, NIL ) );
			    retstat |= RETVAL;
			    branch( retlab );
			    reached = 0;
			    } break;
case 105:
# line 519 "cgram.y"
{  register NODE *q;
			    q = block( FREE, NIL, NIL, INT|ARY, 0, INT );
			    q->tn.rval = idname = yypvt[-1].intval;
			    defid( q, ULABEL );
			    stab[idname].suse = -lineno;
			    branch( stab[idname].offset );
			    goto rch;
			    } break;
case 110:
# line 533 "cgram.y"
{  register NODE *q;
			    q = block( FREE, NIL, NIL, INT|ARY, 0, LABEL );
			    q->tn.rval = yypvt[-1].intval;
			    defid( q, LABEL );
			    reached = 1;
			    } break;
case 111:
# line 540 "cgram.y"
{  addcase(yypvt[-1].nodep);
			    reached = 1;
			    } break;
case 112:
# line 544 "cgram.y"
{  reached = 1;
			    adddef();
			    flostat |= FDEF;
			    } break;
case 113:
# line 550 "cgram.y"
{  savebc();
			    if( !reached ) werror( "loop not entered at top");
			    brklab = getlab();
			    contlab = getlab();
			    deflab( yyval.intval = getlab() );
			    reached = 1;
			    } break;
case 114:
# line 559 "cgram.y"
{  ecomp( buildtree( CBRANCH, yypvt[-1].nodep, bcon( yyval.intval=getlab()) ) ) ;
			    reached = 1;
			    } break;
case 115:
# line 564 "cgram.y"
{  if( reached ) branch( yyval.intval = getlab() );
			    else yyval.intval = NOLAB;
			    deflab( yypvt[-2].intval );
			    reached = 1;
			    } break;
case 116:
# line 572 "cgram.y"
{  savebc();
			    if( !reached ) werror( "loop not entered at top");
			    if( yypvt[-1].nodep->in.op == ICON && yypvt[-1].nodep->tn.lval != 0 ) flostat = FLOOP;
			    deflab( contlab = getlab() );
			    reached = 1;
			    brklab = getlab();
			    if( flostat == FLOOP ) tfree( yypvt[-1].nodep );
			    else ecomp( buildtree( CBRANCH, yypvt[-1].nodep, bcon( brklab) ) );
			    } break;
case 117:
# line 583 "cgram.y"
{  if( yypvt[-3].nodep ) ecomp( yypvt[-3].nodep );
			    else if( !reached ) werror( "loop not entered at top");
			    savebc();
			    contlab = getlab();
			    brklab = getlab();
			    deflab( yyval.intval = getlab() );
			    reached = 1;
			    if( yypvt[-1].nodep ) ecomp( buildtree( CBRANCH, yypvt[-1].nodep, bcon( brklab) ) );
			    else flostat |= FLOOP;
			    } break;
case 118:
# line 595 "cgram.y"
{  savebc();
			    brklab = getlab();
			    ecomp( buildtree( FORCE, makety(yypvt[-1].nodep,INT,0,INT), NIL ) );
			    branch( yyval.intval = getlab() );
			    swstart();
			    reached = 0;
			    } break;
case 119:
# line 604 "cgram.y"
{ yyval.intval=instruct; stwart=instruct=0; } break;
case 120:
# line 606 "cgram.y"
{  yyval.intval = icons( yypvt[-0].nodep );  instruct=yypvt[-1].intval; } break;
case 122:
# line 610 "cgram.y"
{ yyval.nodep=0; } break;
case 124:
# line 615 "cgram.y"
{  goto bop; } break;
case 125:
# line 619 "cgram.y"
{
			preconf:
			    if( yychar==RELOP||yychar==EQUOP||yychar==AND||yychar==OR||yychar==ER ){
			    precplaint:
				if( hflag ) werror( "precedence confusion possible: parenthesize!" );
				}
			bop:
			    yyval.nodep = buildtree( yypvt[-1].intval, yypvt[-2].nodep, yypvt[-0].nodep );
			    } break;
case 126:
# line 629 "cgram.y"
{  yypvt[-1].intval = COMOP;
			    goto bop;
			    } break;
case 127:
# line 633 "cgram.y"
{  goto bop; } break;
case 128:
# line 635 "cgram.y"
{  if(yychar==SHIFTOP) goto precplaint; else goto bop; } break;
case 129:
# line 637 "cgram.y"
{  if(yychar==SHIFTOP ) goto precplaint; else goto bop; } break;
case 130:
# line 639 "cgram.y"
{  if(yychar==PLUS||yychar==MINUS) goto precplaint; else goto bop; } break;
case 131:
# line 641 "cgram.y"
{  goto bop; } break;
case 132:
# line 643 "cgram.y"
{  goto preconf; } break;
case 133:
# line 645 "cgram.y"
{  if( yychar==RELOP||yychar==EQUOP ) goto preconf;  else goto bop; } break;
case 134:
# line 647 "cgram.y"
{  if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; } break;
case 135:
# line 649 "cgram.y"
{  if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; } break;
case 136:
# line 651 "cgram.y"
{  goto bop; } break;
case 137:
# line 653 "cgram.y"
{  goto bop; } break;
case 138:
# line 655 "cgram.y"
{  abop:
				yyval.nodep = buildtree( ASG yypvt[-2].intval, yypvt[-3].nodep, yypvt[-0].nodep );
				} break;
case 139:
# line 659 "cgram.y"
{  goto abop; } break;
case 140:
# line 661 "cgram.y"
{  goto abop; } break;
case 141:
# line 663 "cgram.y"
{  goto abop; } break;
case 142:
# line 665 "cgram.y"
{  goto abop; } break;
case 143:
# line 667 "cgram.y"
{  goto abop; } break;
case 144:
# line 669 "cgram.y"
{  goto abop; } break;
case 145:
# line 671 "cgram.y"
{  goto abop; } break;
case 146:
# line 673 "cgram.y"
{  yyval.nodep=buildtree(QUEST, yypvt[-4].nodep, buildtree( COLON, yypvt[-2].nodep, yypvt[-0].nodep ) );
			    } break;
case 147:
# line 676 "cgram.y"
{  werror( "old-fashioned assignment operator" );  goto bop; } break;
case 148:
# line 678 "cgram.y"
{  goto bop; } break;
case 150:
# line 682 "cgram.y"
{  yyval.nodep = buildtree( yypvt[-0].intval, yypvt[-1].nodep, bcon(1) ); } break;
case 151:
# line 684 "cgram.y"
{ ubop:
			    yyval.nodep = buildtree( UNARY yypvt[-1].intval, yypvt[-0].nodep, NIL );
			    } break;
case 152:
# line 688 "cgram.y"
{  if( ISFTN(yypvt[-0].nodep->in.type) || ISARY(yypvt[-0].nodep->in.type) ){
				werror( "& before array or function: ignored" );
				yyval.nodep = yypvt[-0].nodep;
				}
			    else goto ubop;
			    } break;
case 153:
# line 695 "cgram.y"
{  goto ubop; } break;
case 154:
# line 697 "cgram.y"
{
			    yyval.nodep = buildtree( yypvt[-1].intval, yypvt[-0].nodep, NIL );
			    } break;
case 155:
# line 701 "cgram.y"
{  yyval.nodep = buildtree( yypvt[-1].intval==INCR ? ASG PLUS : ASG MINUS,
						yypvt[-0].nodep,
						bcon(1)  );
			    } break;
case 156:
# line 706 "cgram.y"
{  yyval.nodep = doszof( yypvt[-0].nodep ); } break;
case 157:
# line 708 "cgram.y"
{  yyval.nodep = buildtree( CAST, yypvt[-2].nodep, yypvt[-0].nodep );
			    yyval.nodep->in.left->in.op = FREE;
			    yyval.nodep->in.op = FREE;
			    yyval.nodep = yyval.nodep->in.right;
			    } break;
case 158:
# line 714 "cgram.y"
{  yyval.nodep = doszof( yypvt[-1].nodep ); } break;
case 159:
# line 716 "cgram.y"
{  yyval.nodep = buildtree( UNARY MUL, buildtree( PLUS, yypvt[-3].nodep, yypvt[-1].nodep ), NIL ); } break;
case 160:
# line 718 "cgram.y"
{  yyval.nodep=buildtree(UNARY CALL,yypvt[-1].nodep,NIL); } break;
case 161:
# line 720 "cgram.y"
{  yyval.nodep=buildtree(CALL,yypvt[-2].nodep,yypvt[-1].nodep); } break;
case 162:
# line 722 "cgram.y"
{  if( yypvt[-1].intval == DOT ){
				if( notlval( yypvt[-2].nodep ) )uerror("structure reference must be addressable");
				yypvt[-2].nodep = buildtree( UNARY AND, yypvt[-2].nodep, NIL );
				}
			    idname = yypvt[-0].intval;
			    yyval.nodep = buildtree( STREF, yypvt[-2].nodep, buildtree( NAME, NIL, NIL ) );
			    } break;
case 163:
# line 730 "cgram.y"
{  idname = yypvt[-0].intval;
			    /* recognize identifiers in initializations */
			    if( blevel==0 && stab[idname].stype == UNDEF ) {
				register NODE *q;
#ifndef FLEXNAMES
				werror( "undeclared initializer name %.8s", stab[idname].sname );
#else
				werror( "undeclared initializer name %s", stab[idname].sname );
#endif

				q = block( FREE, NIL, NIL, INT, 0, INT );
				q->tn.rval = idname;
				defid( q, EXTERN );
				}
			    yyval.nodep=buildtree(NAME,NIL,NIL);
			    stab[yypvt[-0].intval].suse = -lineno;
			} break;
case 164:
# line 748 "cgram.y"
{  yyval.nodep=bcon(0);
			    yyval.nodep->tn.lval = lastcon;
			    yyval.nodep->tn.rval = NONAME;
			    if( yypvt[-0].intval ) yyval.nodep->fn.csiz = yyval.nodep->in.type = ctype(LONG);
			    } break;
case 165:
# line 754 "cgram.y"
{  yyval.nodep=buildtree(FCON,NIL,NIL);
			    yyval.nodep->fpn.dval = dcon;
			    } break;
case 166:
# line 758 "cgram.y"
{  yyval.nodep = getstr(); /* get string contents */ } break;
case 167:
# line 760 "cgram.y"
{ yyval.nodep=yypvt[-1].nodep; } break;
case 168:
# line 764 "cgram.y"
{
			yyval.nodep = tymerge( yypvt[-1].nodep, yypvt[-0].nodep );
			yyval.nodep->in.op = NAME;
			yypvt[-1].nodep->in.op = FREE;
			} break;
case 169:
# line 772 "cgram.y"
{ yyval.nodep = bdty( NAME, NIL, -1 ); } break;
case 170:
# line 774 "cgram.y"
{ yyval.nodep = bdty( UNARY CALL, bdty(NAME,NIL,-1),0); } break;
case 171:
# line 776 "cgram.y"
{  yyval.nodep = bdty( UNARY CALL, yypvt[-3].nodep, 0 ); } break;
case 172:
# line 778 "cgram.y"
{  goto umul; } break;
case 173:
# line 780 "cgram.y"
{  goto uary; } break;
case 174:
# line 782 "cgram.y"
{  goto bary;  } break;
case 175:
# line 784 "cgram.y"
{ yyval.nodep = yypvt[-1].nodep; } break;
case 176:
# line 788 "cgram.y"
{  if( stab[yypvt[-1].intval].stype == UNDEF ){
				register NODE *q;
				q = block( FREE, NIL, NIL, FTN|INT, 0, INT );
				q->tn.rval = yypvt[-1].intval;
				defid( q, EXTERN );
				}
			    idname = yypvt[-1].intval;
			    yyval.nodep=buildtree(NAME,NIL,NIL);
			    stab[idname].suse = -lineno;
			} break;
		}
		goto yystack;  /* stack new state and value */

	}
ine 682 "cgram.y"
{  yyval.nodep = buildtree( yypvt[-0].intval, yypvt[-1].nodep, bcon(1) ); } break;
case 151:
# line 684 "cgram.y"
{ ubop:
			    yyval.nodep = buildtree( UNARY yypvt[-1].intval, yypvt[-0].nodep, NIL );
			    } break;
case 152:
# line 688 "cgram.y"
{  isumacc/cc/ccom/cgram.y   444      0     12       47506  3470501545  10131 %term NAME  2
%term STRING  3
%term ICON  4
%term FCON  5
%term PLUS   6
%term MINUS   8
%term MUL   11
%term AND   14
%term OR   17
%term ER   19
%term QUEST  21
%term COLON  22
%term ANDAND  23
%term OROR  24

/*	special interfaces for yacc alone */
/*	These serve as abbreviations of 2 or more ops:
	ASOP	=, = ops
	RELOP	LE,LT,GE,GT
	EQUOP	EQ,NE
	DIVOP	DIV,MOD
	SHIFTOP	LS,RS
	ICOP	ICR,DECR
	UNOP	NOT,COMPL
	STROP	DOT,STREF

	*/
%term ASOP  25
%term RELOP  26
%term EQUOP  27
%term DIVOP  28
%term SHIFTOP  29
%term INCOP  30
%term UNOP  31
%term STROP  32

/*	reserved words, etc */
%term TYPE  33
%term CLASS  34
%term STRUCT  35
%term RETURN  36
%term GOTO  37
%term IF  38
%term ELSE  39
%term SWITCH  40
%term BREAK  41
%term CONTINUE  42
%term WHILE  43
%term DO  44
%term FOR  45
%term DEFAULT  46
%term CASE  47
%term SIZEOF  48
%term ENUM 49


/*	little symbols, etc. */
/*	namely,

	LP	(
	RP	)

	LC	{
	RC	}

	LB	[
	RB	]

	CM	,
	SM	;

	*/

%term LP  50
%term RP  51
%term LC  52
%term RC  53
%term LB  54
%term RB  55
%term CM  56
%term SM  57
%term ASSIGN  58

/* at last count, there were 7 shift/reduce, 1 reduce/reduce conflicts
/* these involved:
	if/else
	recognizing functions in various contexts, including declarations
	error recovery
	*/

%left CM
%right ASOP ASSIGN
%right QUEST COLON
%left OROR
%left ANDAND
%left OR
%left ER
%left AND
%left EQUOP
%left RELOP
%left SHIFTOP
%left PLUS MINUS
%left MUL DIVOP
%right UNOP
%right INCOP SIZEOF
%left LB LP STROP
%{
# include "mfile1"
%}

	/* define types */
%start ext_def_list

%type <intval> con_e ifelprefix ifprefix whprefix forprefix doprefix switchpart
		enum_head str_head name_lp
%type <nodep> e .e term attributes oattributes type enum_dcl struct_dcl
		cast_type null_decl funct_idn declarator fdeclarator nfdeclarator
		elist

%token <intval> CLASS NAME STRUCT RELOP CM DIVOP PLUS MINUS SHIFTOP MUL AND OR ER ANDAND OROR
		ASSIGN STROP INCOP UNOP ICON
%token <nodep> TYPE

%%

%{
	static int fake = 0;
#ifndef FLEXNAMES
	static char fakename[NCHNAM+1];
#else
	static char fakename[24];
#endif
%}

ext_def_list:	   ext_def_list external_def
		|
			=ftnend();
		;
external_def:	   data_def
			={ curclass = SNULL;  blevel = 0; }
		|  error
			={ curclass = SNULL;  blevel = 0; }
		;
data_def:
		   oattributes  SM
			={  $1->in.op = FREE; }
		|  oattributes init_dcl_list  SM
			={  $1->in.op = FREE; }
		|  oattributes fdeclarator {
				defid( tymerge($1,$2), curclass==STATIC?STATIC:EXTDEF );
				}  function_body
			={  
			    if( blevel ) cerror( "function level error" );
			    if( reached ) retstat |= NRETVAL; 
			    $1->in.op = FREE;
			    ftnend();
			    }
		;

function_body:	   arg_dcl_list compoundstmt
		;
arg_dcl_list:	   arg_dcl_list attributes declarator_list SM
			={ curclass = SNULL;  $2->in.op = FREE; }
		| 	={  blevel = 1; }
		;

stmt_list:	   stmt_list statement
		|  /* empty */
			={  bccode();
			    locctr(PROG);
			    }
		;

dcl_stat_list	:  dcl_stat_list attributes SM
			={  $2->in.op = FREE; }
		|  dcl_stat_list attributes init_dcl_list SM
			={  $2->in.op = FREE; }
		|  /* empty */
		;

oattributes:	  attributes
		|  /* VOID */
			={  $$ = mkty(INT,0,INT);  curclass = SNULL; }
		;
attributes:	   class type
			={  $$ = $2; }
		|  type class
		|  class
			={  $$ = mkty(INT,0,INT); }
		|  type
			={ curclass = SNULL ; }
 		|  type class type
 			={  $1->in.type = types( $1->in.type, $3->in.type, UNDEF );
 			    $3->in.op = FREE;
 			    }
		;


class:		  CLASS
			={  curclass = $1; }
		;

type:		   TYPE
		|  TYPE TYPE
			={  $1->in.type = types( $1->in.type, $2->in.type, UNDEF );
			    $2->in.op = FREE;
			    }
		|  TYPE TYPE TYPE
			={  $1->in.type = types( $1->in.type, $2->in.type, $3->in.type );
			    $2->in.op = $3->in.op = FREE;
			    }
		|  struct_dcl
		|  enum_dcl
		;

enum_dcl:	   enum_head LC moe_list optcomma RC
			={ $$ = dclstruct($1); }
		|  ENUM NAME
			={  $$ = rstruct($2,0);  stwart = instruct; }
		;

enum_head:	   ENUM
			={  $$ = bstruct(-1,0); stwart = SEENAME; }
		|  ENUM NAME
			={  $$ = bstruct($2,0); stwart = SEENAME; }
		;

moe_list:	   moe
		|  moe_list CM moe
		;

moe:		   NAME
			={  moedef( $1 ); }
		|  NAME ASSIGN con_e
			={  strucoff = $3;  moedef( $1 ); }
		;

struct_dcl:	   str_head LC type_dcl_list optsemi RC
			={ $$ = dclstruct($1);  }
		|  STRUCT NAME
			={  $$ = rstruct($2,$1); }
		;

str_head:	   STRUCT
			={  $$ = bstruct(-1,$1);  stwart=0; }
		|  STRUCT NAME
			={  $$ = bstruct($2,$1);  stwart=0;  }
		;

type_dcl_list:	   type_declaration
		|  type_dcl_list SM type_declaration
		;

type_declaration:  type declarator_list
			={ curclass = SNULL;  stwart=0; $1->in.op = FREE; }
		|  type
			={  if( curclass != MOU ){
				curclass = SNULL;
				}
			    else {
				sprintf( fakename, "$%dFAKE", fake++ );
#ifdef FLEXNAMES	/* TD810306 */
				/* No need to hash this, we won't look it up */
				defid( tymerge($1, bdty(NAME,NIL,lookup( savestr(fakename), SMOS ))), curclass );
#else
				defid( tymerge($1, bdty(NAME,NIL,lookup( fakename, SMOS ))), curclass );
#endif
				werror("structure typed union member must be named");
				}
			    stwart = 0;
			    $1->in.op = FREE;
			    }
		;


declarator_list:   declarator
			={ defid( tymerge($<nodep>0,$1), curclass);  stwart = instruct; }
		|  declarator_list  CM {$<nodep>$=$<nodep>0;}  declarator
			={ defid( tymerge($<nodep>0,$4), curclass);  stwart = instruct; }
		;
declarator:	   nfdeclarator
		|  nfdeclarator COLON con_e
			%prec CM
			={  if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" );
			    if( $3<0 || $3 >= FIELD ){
				uerror( "illegal field size" );
				$3 = 1;
				}
			    defid( tymerge($<nodep>0,$1), FIELD|$3 );
			    $$ = NIL;
			    }
		|  COLON con_e
			%prec CM
			={  if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" );
			    falloc( stab, $2, -1, $<nodep>0 );  /* alignment or hole */
			    $$ = NIL;
			    }
		|  error
			={  $$ = NIL; }
		;

		/* int (a)();   is not a function --- sorry! */
nfdeclarator:	   MUL nfdeclarator		
			={  umul:
				$$ = bdty( UNARY MUL, $2, 0 ); }
		|  nfdeclarator  LP   RP		
			={  uftn:
				$$ = bdty( UNARY CALL, $1, 0 );  }
		|  nfdeclarator LB RB		
			={  uary:
				$$ = bdty( LB, $1, 0 );  }
		|  nfdeclarator LB con_e RB	
			={  bary:
				if( (int)$3 <= 0 ) werror( "zero or negative subscript" );
				$$ = bdty( LB, $1, $3 );  }
		|  NAME  		
			={  $$ = bdty( NAME, NIL, $1 );  }
		|   LP  nfdeclarator  RP 		
			={ $$=$2; }
		;
fdeclarator:	   MUL fdeclarator
			={  goto umul; }
		|  fdeclarator  LP   RP
			={  goto uftn; }
		|  fdeclarator LB RB
			={  goto uary; }
		|  fdeclarator LB con_e RB
			={  goto bary; }
		|   LP  fdeclarator  RP
			={ $$ = $2; }
		|  name_lp  name_list  RP
			={
				if( blevel!=0 ) uerror("function declaration in bad context");
				$$ = bdty( UNARY CALL, bdty(NAME,NIL,$1), 0 );
				stwart = 0;
				}
		|  name_lp RP
			={
				$$ = bdty( UNARY CALL, bdty(NAME,NIL,$1), 0 );
				stwart = 0;
				}
		;

name_lp:	  NAME LP
			={
				/* turn off typedefs for argument names */
				stwart = SEENAME;
				if( stab[$1].sclass == SNULL )
				    stab[$1].stype = FTN;
				}
		;

name_list:	   NAME			
			={ ftnarg( $1 );  stwart = SEENAME; }
		|  name_list  CM  NAME 
			={ ftnarg( $3 );  stwart = SEENAME; }
		| error
		;
		/* always preceeded by attributes: thus the $<nodep>0's */
init_dcl_list:	   init_declarator
			%prec CM
		|  init_dcl_list  CM {$<nodep>$=$<nodep>0;}  init_declarator
		;
		/* always preceeded by attributes */
xnfdeclarator:	   nfdeclarator
			={  defid( $1 = tymerge($<nodep>0,$1), curclass);
			    beginit($1->tn.rval);
			    }
		|  error
		;
		/* always preceeded by attributes */
init_declarator:   nfdeclarator
			={  nidcl( tymerge($<nodep>0,$1) ); }
		|  fdeclarator
			={  defid( tymerge($<nodep>0,$1), uclass(curclass) );
			}
		|  xnfdeclarator optasgn e
			%prec CM
			={  doinit( $3 );
			    endinit(); }
		|  xnfdeclarator optasgn LC init_list optcomma RC
			={  endinit(); }
		| error
		;

init_list:	   initializer
			%prec CM
		|  init_list  CM  initializer
		;
initializer:	   e
			%prec CM
			={  doinit( $1 ); }
		|  ibrace init_list optcomma RC
			={  irbrace(); }
		;

optcomma	:	/* VOID */
		|  CM
		;

optsemi		:	/* VOID */
		|  SM
		;

optasgn		:	/* VOID */
			={  werror( "old-fashioned initialization: use =" ); }
		|  ASSIGN
		;

ibrace		: LC
			={  ilbrace(); }
		;

/*	STATEMENTS	*/

compoundstmt:	   begin dcl_stat_list stmt_list RC
			={  --blevel;
			    if( blevel == 1 ) blevel = 0;
			    clearst( blevel );
			    checkst( blevel );
			    autooff = *--psavbc;
			    regvar = *--psavbc;
			    }
		;

begin:		  LC
			={  if( blevel == 1 ) dclargs();
			    ++blevel;
			    if( psavbc > &asavbc[BCSZ-2] ) cerror( "nesting too deep" );
			    *psavbc++ = regvar;
			    *psavbc++ = autooff;
			    }
		;

statement:	   e   SM
			={ ecomp( $1 ); }
		|  compoundstmt
		|  ifprefix statement
			={ deflab($1);
			   reached = 1;
			   }
		|  ifelprefix statement
			={  if( $1 != NOLAB ){
				deflab( $1 );
				reached = 1;
				}
			    }
		|  whprefix statement
			={  branch(  contlab );
			    deflab( brklab );
			    if( (flostat&FBRK) || !(flostat&FLOOP)) reached = 1;
			    else reached = 0;
			    resetbc(0);
			    }
		|  doprefix statement WHILE  LP  e  RP   SM
			={  deflab( contlab );
			    if( flostat & FCONT ) reached = 1;
			    ecomp( buildtree( CBRANCH, buildtree( NOT, $5, NIL ), bcon( $1 ) ) );
			    deflab( brklab );
			    reached = 1;
			    resetbc(0);
			    }
		|  forprefix .e RP statement
			={  deflab( contlab );
			    if( flostat&FCONT ) reached = 1;
			    if( $2 ) ecomp( $2 );
			    branch( $1 );
			    deflab( brklab );
			    if( (flostat&FBRK) || !(flostat&FLOOP) ) reached = 1;
			    else reached = 0;
			    resetbc(0);
			    }
		| switchpart statement
			={  if( reached ) branch( brklab );
			    deflab( $1 );
			   swend();
			    deflab(brklab);
			    if( (flostat&FBRK) || !(flostat&FDEF) ) reached = 1;
			    resetbc(FCONT);
			    }
		|  BREAK  SM
			={  if( brklab == NOLAB ) uerror( "illegal break");
			    else if(reached) branch( brklab );
			    flostat |= FBRK;
			    if( brkflag ) goto rch;
			    reached = 0;
			    }
		|  CONTINUE  SM
			={  if( contlab == NOLAB ) uerror( "illegal continue");
			    else branch( contlab );
			    flostat |= FCONT;
			    goto rch;
			    }
		|  RETURN  SM
			={  retstat |= NRETVAL;
			    branch( retlab );
			rch:
			    if( !reached ) werror( "statement not reached");
			    reached = 0;
			    }
		|  RETURN e  SM
			={  register NODE *temp;
			    idname = curftn;
			    temp = buildtree( NAME, NIL, NIL );
			    if(temp->in.type == TVOID)
				uerror("void function %s cannot return value",
					stab[idname].sname);
			    temp->in.type = DECREF( temp->in.type );
			    temp = buildtree( RETURN, temp, $2 );
			    /* now, we have the type of the RHS correct */
			    tfree(temp->in.left);
			    temp->in.op = FREE;
			    ecomp( buildtree( FORCE, temp->in.right, NIL ) );
			    retstat |= RETVAL;
			    branch( retlab );
			    reached = 0;
			    }
		|  GOTO NAME SM
			={  register NODE *q;
			    q = block( FREE, NIL, NIL, INT|ARY, 0, INT );
			    q->tn.rval = idname = $2;
			    defid( q, ULABEL );
			    stab[idname].suse = -lineno;
			    branch( stab[idname].offset );
			    goto rch;
			    }
		|   SM
		|  error  SM
		|  error RC
		|  label statement
		;
label:		   NAME COLON
			={  register NODE *q;
			    q = block( FREE, NIL, NIL, INT|ARY, 0, LABEL );
			    q->tn.rval = $1;
			    defid( q, LABEL );
			    reached = 1;
			    }
		|  CASE e COLON
			={  addcase($2);
			    reached = 1;
			    }
		|  DEFAULT COLON
			={  reached = 1;
			    adddef();
			    flostat |= FDEF;
			    }
		;
doprefix:	DO
			={  savebc();
			    if( !reached ) werror( "loop not entered at top");
			    brklab = getlab();
			    contlab = getlab();
			    deflab( $$ = getlab() );
			    reached = 1;
			    }
		;
ifprefix:	IF LP e RP
			={  ecomp( buildtree( CBRANCH, $3, bcon( $$=getlab()) ) ) ;
			    reached = 1;
			    }
		;
ifelprefix:	  ifprefix statement ELSE
			={  if( reached ) branch( $$ = getlab() );
			    else $$ = NOLAB;
			    deflab( $1 );
			    reached = 1;
			    }
		;

whprefix:	  WHILE  LP  e  RP
			={  savebc();
			    if( !reached ) werror( "loop not entered at top");
			    if( $3->in.op == ICON && $3->tn.lval != 0 ) flostat = FLOOP;
			    deflab( contlab = getlab() );
			    reached = 1;
			    brklab = getlab();
			    if( flostat == FLOOP ) tfree( $3 );
			    else ecomp( buildtree( CBRANCH, $3, bcon( brklab) ) );
			    }
		;
forprefix:	  FOR  LP  .e  SM .e  SM 
			={  if( $3 ) ecomp( $3 );
			    else if( !reached ) werror( "loop not entered at top");
			    savebc();
			    contlab = getlab();
			    brklab = getlab();
			    deflab( $$ = getlab() );
			    reached = 1;
			    if( $5 ) ecomp( buildtree( CBRANCH, $5, bcon( brklab) ) );
			    else flostat |= FLOOP;
			    }
		;
switchpart:	   SWITCH  LP  e  RP
			={  savebc();
			    brklab = getlab();
			    ecomp( buildtree( FORCE, makety($3,INT,0,INT), NIL ) );
			    branch( $$ = getlab() );
			    swstart();
			    reached = 0;
			    }
		;
/*	EXPRESSIONS	*/
con_e:		   { $<intval>$=instruct; stwart=instruct=0; } e
			%prec CM
			={  $$ = icons( $2 );  instruct=$<intval>1; }
		;
.e:		   e
		|
			={ $$=0; }
		;
elist:		   e
			%prec CM
		|  elist  CM  e
			={  goto bop; }
		;

e:		   e RELOP e
			={
			preconf:
			    if( yychar==RELOP||yychar==EQUOP||yychar==AND||yychar==OR||yychar==ER ){
			    precplaint:
				if( hflag ) werror( "precedence confusion possible: parenthesize!" );
				}
			bop:
			    $$ = buildtree( $2, $1, $3 );
			    }
		|  e CM e
			={  $2 = COMOP;
			    goto bop;
			    }
		|  e DIVOP e
			={  goto bop; }
		|  e PLUS e
			={  if(yychar==SHIFTOP) goto precplaint; else goto bop; }
		|  e MINUS e
			={  if(yychar==SHIFTOP ) goto precplaint; else goto bop; }
		|  e SHIFTOP e
			={  if(yychar==PLUS||yychar==MINUS) goto precplaint; else goto bop; }
		|  e MUL e
			={  goto bop; }
		|  e EQUOP  e
			={  goto preconf; }
		|  e AND e
			={  if( yychar==RELOP||yychar==EQUOP ) goto preconf;  else goto bop; }
		|  e OR e
			={  if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; }
		|  e ER e
			={  if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; }
		|  e ANDAND e
			={  goto bop; }
		|  e OROR e
			={  goto bop; }
		|  e MUL ASSIGN e
			={  abop:
				$$ = buildtree( ASG $2, $1, $4 );
				}
		|  e DIVOP ASSIGN e
			={  goto abop; }
		|  e PLUS ASSIGN e
			={  goto abop; }
		|  e MINUS ASSIGN e
			={  goto abop; }
		|  e SHIFTOP ASSIGN e
			={  goto abop; }
		|  e AND ASSIGN e
			={  goto abop; }
		|  e OR ASSIGN e
			={  goto abop; }
		|  e ER ASSIGN e
			={  goto abop; }
		|  e QUEST e COLON e
			={  $$=buildtree(QUEST, $1, buildtree( COLON, $3, $5 ) );
			    }
		|  e ASOP e
			={  werror( "old-fashioned assignment operator" );  goto bop; }
		|  e ASSIGN e
			={  goto bop; }
		|  term
		;
term:		   term INCOP
			={  $$ = buildtree( $2, $1, bcon(1) ); }
		|  MUL term
			={ ubop:
			    $$ = buildtree( UNARY $1, $2, NIL );
			    }
		|  AND term
			={  if( ISFTN($2->in.type) || ISARY($2->in.type) ){
				werror( "& before array or function: ignored" );
				$$ = $2;
				}
			    else goto ubop;
			    }
		|  MINUS term
			={  goto ubop; }
		|  UNOP term
			={
			    $$ = buildtree( $1, $2, NIL );
			    }
		|  INCOP term
			={  $$ = buildtree( $1==INCR ? ASG PLUS : ASG MINUS,
						$2,
						bcon(1)  );
			    }
		|  SIZEOF term
			={  $$ = doszof( $2 ); }
		|  LP cast_type RP term  %prec INCOP
			={  $$ = buildtree( CAST, $2, $4 );
			    $$->in.left->in.op = FREE;
			    $$->in.op = FREE;
			    $$ = $$->in.right;
			    }
		|  SIZEOF LP cast_type RP  %prec SIZEOF
			={  $$ = doszof( $3 ); }
		|  term LB e RB
			={  $$ = buildtree( UNARY MUL, buildtree( PLUS, $1, $3 ), NIL ); }
		|  funct_idn  RP
			={  $$=buildtree(UNARY CALL,$1,NIL); }
		|  funct_idn elist  RP
			={  $$=buildtree(CALL,$1,$2); }
		|  term STROP NAME
			={  if( $2 == DOT ){
				if( notlval( $1 ) )uerror("structure reference must be addressable");
				$1 = buildtree( UNARY AND, $1, NIL );
				}
			    idname = $3;
			    $$ = buildtree( STREF, $1, buildtree( NAME, NIL, NIL ) );
			    }
		|  NAME
			={  idname = $1;
			    /* recognize identifiers in initializations */
			    if( blevel==0 && stab[idname].stype == UNDEF ) {
				register NODE *q;
#ifndef FLEXNAMES
				werror( "undeclared initializer name %.8s", stab[idname].sname );
#else
				werror( "undeclared initializer name %s", stab[idname].sname );
#endif

				q = block( FREE, NIL, NIL, INT, 0, INT );
				q->tn.rval = idname;
				defid( q, EXTERN );
				}
			    $$=buildtree(NAME,NIL,NIL);
			    stab[$1].suse = -lineno;
			}
		|  ICON
			={  $$=bcon(0);
			    $$->tn.lval = lastcon;
			    $$->tn.rval = NONAME;
			    if( $1 ) $$->fn.csiz = $$->in.type = ctype(LONG);
			    }
		|  FCON
			={  $$=buildtree(FCON,NIL,NIL);
			    $$->fpn.dval = dcon;
			    }
		|  STRING
			={  $$ = getstr(); /* get string contents */ }
		|   LP  e  RP
			={ $$=$2; }
		;

cast_type:	  type null_decl
			={
			$$ = tymerge( $1, $2 );
			$$->in.op = NAME;
			$1->in.op = FREE;
			}
		;

null_decl:	   /* empty */
			={ $$ = bdty( NAME, NIL, -1 ); }
		|  LP RP
			={ $$ = bdty( UNARY CALL, bdty(NAME,NIL,-1),0); }
		|  LP null_decl RP LP RP
			={  $$ = bdty( UNARY CALL, $2, 0 ); }
		|  MUL null_decl
			={  goto umul; }
		|  null_decl LB RB
			={  goto uary; }
		|  null_decl LB con_e RB
			={  goto bary;  }
		|  LP null_decl RP
			={ $$ = $2; }
		;

funct_idn:	   NAME  LP 
			={  if( stab[$1].stype == UNDEF ){
				register NODE *q;
				q = block( FREE, NIL, NIL, FTN|INT, 0, INT );
				q->tn.rval = $1;
				defid( q, EXTERN );
				}
			    idname = $1;
			    $$=buildtree(NAME,NIL,NIL);
			    stab[idname].suse = -lineno;
			}
		|  term  LP 
		;
%%

NODE *
mkty( t, d, s ) unsigned t; {
	return( block( TYPE, NIL, NIL, t, d, s ) );
	}

NODE *
bdty( op, p, v ) NODE *p; {
	register NODE *q;

	q = block( op, p, NIL, INT, 0, INT );

	switch( op ){

	case UNARY MUL:
	case UNARY CALL:
		break;

	case LB:
		q->in.right = bcon(v);
		break;

	case NAME:
		q->tn.rval = v;
		break;

	default:
		cerror( "bad bdty" );
		}

	return( q );
	}

dstash( n ){ /* put n into the dimension table */
	if( curdim >= DIMTABSZ-1 ){
		cerror( "dimension table overflow");
		}
	dimtab[ curdim++ ] = n;
	}

savebc() {
	if( psavbc > & asavbc[BCSZ-4 ] ){
		cerror( "whiles, fors, etc. too deeply nested");
		}
	*psavbc++ = brklab;
	*psavbc++ = contlab;
	*psavbc++ = flostat;
	*psavbc++ = swx;
	flostat = 0;
	}

resetbc(mask){

	swx = *--psavbc;
	flostat = *--psavbc | (flostat&mask);
	contlab = *--psavbc;
	brklab = *--psavbc;

	}

addcase(p) NODE *p; { /* add case to switch */

	p = optim( p );  /* change enum to ints */
	if( p->in.op != ICON ){
		uerror( "non-constant case expression");
		return;
		}
	if( swp == swtab ){
		uerror( "case not in switch");
		return;
		}
	if( swp >= &swtab[SWITSZ] ){
		cerror( "switch table overflow");
		}
	swp->sval = p->tn.lval;
	deflab( swp->slab = getlab() );
	++swp;
	tfree(p);
	}

adddef(){ /* add default case to switch */
	if( swtab[swx].slab >= 0 ){
		uerror( "duplicate default in switch");
		return;
		}
	if( swp == swtab ){
		uerror( "default not inside switch");
		return;
		}
	deflab( swtab[swx].slab = getlab() );
	}

swstart(){
	/* begin a switch block */
	if( swp >= &swtab[SWITSZ] ){
		cerror( "switch table overflow");
		}
	swx = swp - swtab;
	swp->slab = -1;
	++swp;
	}

swend(){ /* end a switch block */

	register struct sw *swbeg, *p, *q, *r, *r1;
	CONSZ temp;
	int tempi;

	swbeg = &swtab[swx+1];

	/* sort */

	r1 = swbeg;
	r = swp-1;

	while( swbeg < r ){
		/* bubble largest to end */
		for( q=swbeg; q<r; ++q ){
			if( q->sval > (q+1)->sval ){
				/* swap */
				r1 = q+1;
				temp = q->sval;
				q->sval = r1->sval;
				r1->sval = temp;
				tempi = q->slab;
				q->slab = r1->slab;
				r1->slab = tempi;
				}
			}
		r = r1;
		r1 = swbeg;
		}

	/* it is now sorted */

	for( p = swbeg+1; p<swp; ++p ){
		if( p->sval == (p-1)->sval ){
			uerror( "duplicate case in switch, %d", tempi=p->sval );
			return;
			}
		}

	genswitch( swbeg-1, swp-swbeg );
	swp = swbeg-1;
	}
D, $1, NIL );
				}
			    idname = $3;
			    $$ = buildtree( STREF, $1, buildtree( NAME, NIL, NIL ) );
			    }
		|  NAME
			={  idname = $1;
			    /* recognize identifiers in initialsumacc/cc/ccom/code.c   444      0     12       20230  3470501546   7706 #ifdef BOOTSTRAP
#include "/usr/include/stdio.h"
#include "/usr/include/signal.h"
#else BOOTSTRAP
# include <stdio.h>
# include <signal.h>
#endif BOOTSTRAP

# include "mfile1"

extern int usedregs;	/* bit == 1 if reg was used in subroutine */
extern char *rnames[];
int proflag;
extern int nospflag;	/* nonzero if suppress stack probe in prolog */
int proflg = 0;
int strftn = 0;	/* is the current function one which returns a value */

FILE *tmpfile;
FILE *outfile = stdout;

branch( n ){
	/* output a branch to label n */
	/* exception is an ordinary function branching to retlab: then, return */
	if( n == retlab && !strftn ) printf( "	bra	.L%d\n", retlab );
	else printf( "	bra	.L%d\n", n );
	}

int lastloc = PROG;

defalign(n) {
	/* cause the alignment to become a multiple of n */
	n /= SZCHAR;
	if( lastloc != PROG && n > 1 ) printf( "	.even\n" );
	}

locctr( l ){
	register temp;
	/* l is PROG, ADATA, DATA, STRNG, ISTRNG, or STAB */

	if( l == lastloc ) return(l);
	temp = lastloc;
	lastloc = l;
	switch( l ){

	case PROG:
		outfile = stdout;
		printf( "	.text\n" );
		break;

	case DATA:
	case ADATA:
		outfile = stdout;
		if( temp != DATA && temp != ADATA )
			printf( "	.data\n" );
		break;

	case STRNG:
	case ISTRNG:
		outfile = tmpfile;
		break;

	case STAB:
		cerror( "locctr: STAB unused" );
		break;

	default:
		cerror( "illegal location counter" );
		}

	return( temp );
	}

deflab( n ){
	/* output something to define the current position as label n */
	fprintf( outfile, ".L%d:\n", n );
	}

int crslab = 10;

getlab(){
	/* return a number usable for a label */
	return( ++crslab );
	}

efcode(){
	/* code for the end of a function */

	if( strftn ){  /* copy output (in r0) to caller */
		register struct symtab *p;
		register int stlab;
		register int count;
		int size;

		p = &stab[curftn];

		deflab( retlab );
		retlab = getlab();

		stlab = getlab();
		printf( "	movl	d0,a0\n" );
		printf( "	movl	#.L%d,a1\n" , stlab );
		size = tsize( DECREF(p->stype), p->dimoff, p->sizoff ) / SZCHAR;
		count = size/4;
		while( count-- ) {
			printf( "	movl	a0@+,a1@+\n" );
		}
		if (size&2) {
			printf( "	movw	a0@+,a1@+\n" );
		}
		if (size&1) {
			printf( "	movb	a0@+,a1@+\n" );
		}
		printf( "	movl	#.L%d,d0\n", stlab );
		printf( "	.bss\n	.even\n.L%d:\n	.=.+%d.\n	.text\n", stlab, size );

		/* turn off strftn flag, so return sequence will be generated */
		strftn = 0;
		}
	branch( retlab );
	p2bend();
	}

bfcode( a, n ) int a[]; {
	/* code for the beginning of a function; a is an array of
		indices in stab for the arguments; n is the number */
	register i;
	register temp;
	register struct symtab *p;
	int off;
	char type;

	locctr( PROG );
	p = &stab[curftn];
	defnam( p );
	temp = p->stype;
	temp = DECREF(temp);
	strftn = (temp==STRTY) || (temp==UNIONTY);

	retlab = getlab();
	if( proflag ){
		int plab;
		plab = getlab();
		printf( "	movl	#.L%d,a0\n", plab );
		printf( "	jbsr	mcount\n" );
		printf( "	.data\n.L%d:	.long 0\n	.text\n", plab );
		}

	/* routine prolog */

	printf( "	link	a6,#-_F%d\n", ftnno );
#ifdef STACKPROBE
	if( !nospflag )
		printf( "	tstl	sp@(-_P%d)\n", ftnno );
#endif		/* of ifdef STACKPROBE */
	printf( "	moveml	#_S%d,a6@(-_F%d)\n", ftnno, ftnno );
	usedregs = 0;

	off = ARGINIT;

	for( i=0; i<n; ++i ){
		p = &stab[a[i]];
		if( p->sclass == REGISTER ){
			temp = p->offset;  /* save register number */
			p->sclass = PARAM;  /* forget that it is a register */
			p->offset = NOOFFSET;
			oalloc( p, &off );
			if (p->stype==CHAR || p->stype==UCHAR) type = 'b';
			else if (p->stype==SHORT || p->stype==USHORT) type = 'w';
			else type = 'l';
			printf( "	mov%c	a6@(%d),%s\n", type, p->offset/SZCHAR,
			  rnames[temp] );
			usedregs |= 1<<temp;
			p->offset = temp;  /* remember register number */
			p->sclass = REGISTER;   /* remember that it is a register */
			}
		else {
			if( oalloc( p, &off ) ) cerror( "bad argument" );
			}

		}
	printf("| A%d = %d\n", ftnno, off/SZCHAR);
	}

bccode(){ /* called just before the first executable statment */
		/* by now, the automatics and register variables are allocated */
	SETOFF( autooff, SZINT );
	/* set aside store area offset */
	p2bbeg( autooff, regvar );
	}

ejobcode( flag ){
	/* called just before final exit */
	/* flag is 1 if errors, 0 if none */
	}

aobeg(){
	/* called before removing automatics from stab */
	}

aocode(p) struct symtab *p; {
	/* called when automatic p removed from stab */
	}

aoend(){
	/* called after removing all automatics from stab */
	}

defnam( p ) register struct symtab *p; {
	/* define the current location as the name p->sname */

	if( p->sclass == EXTDEF ){
		printf( "	.globl	%s\n", exname( p->sname ) );
		}
	if( p->sclass == STATIC && p->slevel>1 ) deflab( p->offset );
	else printf( "%s:\n", exname( p->sname ) );

	}

bycode( t, i ){
	/* put byte i+1 in a string */

	i &= 07;
	if( t < 0 ){ /* end of the string */
		if( i != 0 ) fprintf( outfile, "\n" );
		}

	else { /* stash byte t into string */
		if( i == 0 ) fprintf( outfile, "	.byte	" );
		else fprintf( outfile, "," );
		fprintf( outfile, "%d", t );
		if( i == 07 ) fprintf( outfile, "\n" );
		}
	}

zecode( n ){
	/* n integer words of zeros */
	OFFSZ temp;
	register i;

	if( n <= 0 ) return;
	for( i=1; i<=n; i++ ) printf( "	.long	0\n" );
	temp = n;
	inoff += temp*SZINT;
	}

fldal( t ) unsigned t; { /* return the alignment of field of type t */
	uerror( "illegal field type" );
	return( ALINT );
	}

fldty( p ) struct symtab *p; { /* fix up type of field p */
	;
	}

where(c){ /* print location of error  */
	/* c is either 'u', 'c', or 'w' */
	fprintf( stderr, "%s, line %d: ", ftitle, lineno );
	}

char *tmpname = "/tmp/pcXXXXXX";

main( argc, argv ) char *argv[]; {
	int dexit();
	register int c;
	register int i;
	int r;

	for( i=1; i<argc; ++i )
		if( argv[i][0] == '-' && argv[i][1] == 'X' && argv[i][2] == 'p' ) {
			proflag = 1;
			}

	mktemp(tmpname);
	if(signal( SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, dexit);
	if(signal( SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, dexit);
	if(signal( SIGTERM, SIG_IGN) != SIG_IGN) signal(SIGTERM, dexit);
	tmpfile = fopen( tmpname, "w" );
	if(tmpfile == NULL) cerror( "Cannot open temp file" );

	r = mainp1( argc, argv );

	tmpfile = freopen( tmpname, "r", tmpfile );
	if( tmpfile != NULL )
		while((c=getc(tmpfile)) != EOF )
			putchar(c);
	else cerror( "Lost temp file" );
	unlink(tmpname);
	return( r );
	}

dexit( v ) {
	unlink(tmpname);
	exit(1);
	}

genswitch(p,n) register struct sw *p;{
	/*	p points to an array of structures, each consisting
		of a constant value and a label.
		The first is >=0 if there is a default label;
		its value is the label number
		The entries p[1] to p[n] are the nontrivial cases
		*/
	register i;
	register CONSZ j, range;
	register dlab, swlab;

	range = p[n].sval-p[1].sval;

	if( range>0 && range <= 3*n && n>=4 ){ /* implement a direct switch */

		dlab = p->slab >= 0 ? p->slab : getlab();

		if( p[1].sval ){
			printf( "	subl	#" );
			printf( CONFMT, p[1].sval );
			printf( ",d0\n" );
			}

		/* note that this is a cl; it thus checks
		   for numbers below range as well as out of range.
		   */
#ifdef BOOTSTRAP
		printf( "	cmpl	#%d,d0\n", range );
#else BOOTSTRAP
		printf( "	cmpl	#%ld,d0\n", range );
#endif BOOTSTRAP
		printf( "	bhi	.L%d\n", dlab );

		printf( "	addw	d0,d0\n" );
		printf( "	movw	pc@(6,d0:w),d0\n" );
		printf( "	jmp	pc@(2,d0:w)\n" );

		/* output table */

		printf( ".L%d = .\n", swlab=getlab() );

		for( i=1,j=p[1].sval; i<=n; ++j ){
 			printf( "	.word	.L%d-.L%d\n", ( j == p[i].sval ) ?
				p[i++].slab : dlab, swlab );
			}

		if( p->slab< 0 ) deflab( dlab );
		return;

		}

	genbinary(p,1,n,0);
}

genbinary(p,lo,hi,lab)
  register struct sw *p;
  {	register int i,lab1;

	if (lab) printf(".L%d:",lab);	/* print label, if any */

	if (hi-lo > 4) {		/* if lots more, do another level */
	  i = lo + ((hi-lo)>>1);	/* index at which we'll break this time */
	  printf( "	cmpl	#" );
	  printf( CONFMT, p[i].sval );
	  printf( ",d0\n	beq	.L%d\n", p[i].slab );
	  printf( "	bgt	.L%d\n", lab1=getlab() );
	  genbinary(p,lo,i-1,0);
	  genbinary(p,i+1,hi,lab1);
	} else {			/* simple switch code for remaining cases */
	  for( i=lo; i<=hi; ++i ) {
	    printf( "	cmpl	#" );
	    printf( CONFMT, p[i].sval );
	    printf( ",d0\n	beq	.L%d\n", p[i].slab );
	  }
	  if( p->slab>=0 ) branch( p->slab );
	}
}
ors, 0 if none */
	}

aobeg(){
	/* called before removing automatics from stab */
	}

aocode(p) struct symtab *p; {
	/* called when automatic p removed from stab */
	}

aoend(){
	/* called after removing all automatics from stab */
	}

defnam( p ) register struct symtab *p; {
	/* define the current location as the name p->sname */

	if( p->sclass == EXTDEF )sumacc/cc/ccom/comm1.c   444      0     12          50  3470501546   7726 # include "mfile1"

# include "common"


	OFFSZ temp;
	register i;

	if( n <= 0 ) return;
	for( i=1; i<=n; i++ ) printf( "	.long	0\n" );
	temp = n;
	inoff += temp*SZINT;
	}

fldal( t ) unsigned t; { /* return the alignment of field of type t */
	uerror( "illegal field type" );
	return( ALINT );
	}

fldty( p ) struct symtab *p; { /* fix up type of field p */
	;
	}

where(c){ /* print location of error  */
	/* c is either 'u', 'c', or 'w' */
	fprintf( stderr, "%s, line %d: ", ftitle, lineno );
	}

char *tmpnasumacc/cc/ccom/common   444      0     12       14077  3470501547  10060 # ifndef EXIT
# define EXIT exit
# endif

int nerrors = 0;  /* number of errors */

unsigned int offsz;

unsigned caloff(){
	register i;
	unsigned int temp;
	unsigned int off;
	temp = 1;
	i = 0;
	do {
		temp <<= 1;
		++i;
		} while( temp > 0 );
	off = 1 << (i-1);
	return (off);
	}

NODE *lastfree;  /* pointer to last free node; (for allocator) */

	/* VARARGS1 */
uerror( s, a ) char *s; { /* nonfatal error message */
	/* the routine where is different for pass 1 and pass 2;
	/*  it tells where the error took place */

	++nerrors;
	where('u');
	fprintf( stderr, s, a );
	fprintf( stderr, "\n" );
	if( nerrors > 30 ) cerror( "too many errors");
	}

	/* VARARGS1 */
cerror( s, a, b, c ) char *s; { /* compiler error: die */
	where('c');
	if( nerrors && nerrors <= 30 ){ /* give the compiler the benefit of the doubt */
		fprintf( stderr, "cannot recover from earlier errors: goodbye!\n" );
		}
	else {
		fprintf( stderr, "compiler error: " );
		fprintf( stderr, s, a, b, c );
		fprintf( stderr, "\n" );
		}
	EXIT(1);
	}

	/* VARARGS1 */
werror( s, a, b ) char *s; {  /* warning */
	where('w');
	fprintf( stderr, "warning: " );
	fprintf( stderr, s, a, b );
	fprintf( stderr, "\n" );
	}

tinit(){ /* initialize expression tree search */

	NODE *p;

	for( p=node; p<= &node[TREESZ-1]; ++p ) p->in.op = FREE;
	lastfree = node;

	}

# define TNEXT(p) (p== &node[TREESZ-1]?node:p+1)

NODE *
talloc(){
	NODE *p, *q;

	q = lastfree;
	for( p = TNEXT(q); p!=q; p= TNEXT(p))
		if( p->in.op ==FREE ) return(lastfree=p);

	cerror( "out of tree space; simplify expression");
	/* NOTREACHED */
	}

tcheck(){ /* ensure that all nodes have been freed */

	NODE *p;

	if( !nerrors )
		for( p=node; p<= &node[TREESZ-1]; ++p )
			if( p->in.op != FREE ) cerror( "wasted space: %o", p );
	tinit();
	}
tfree( p )  NODE *p; {
	/* free the tree p */
	extern tfree1();

	if( p->in.op != FREE ) walkf( p, tfree1 );

	}

tfree1(p)  NODE *p; {
	if( p == 0 ) cerror( "freeing blank tree!");
	else p->in.op = FREE;
	}

fwalk( t, f, down ) register NODE *t; int (*f)(); {

	int down1, down2;

	more:
	down1 = down2 = 0;

	(*f)( t, down, &down1, &down2 );

	switch( optype( t->in.op ) ){

	case BITYPE:
		fwalk( t->in.left, f, down1 );
		t = t->in.right;
		down = down2;
		goto more;

	case UTYPE:
		t = t->in.left;
		down = down1;
		goto more;

		}
	}

walkf( t, f ) register NODE *t;  int (*f)(); {
	register opty;

	opty = optype(t->in.op);

	if( opty != LTYPE ) walkf( t->in.left, f );
	if( opty == BITYPE ) walkf( t->in.right, f );
	(*f)( t );
	}



int dope[ DSIZE ];
char *opst[DSIZE];

struct dopest { int dopeop; char opst[8]; int dopeval; } indope[] = {

	NAME, "NAME", LTYPE,
	STRING, "STRING", LTYPE,
	REG, "REG", LTYPE,
	OREG, "OREG", LTYPE,
	ICON, "ICON", LTYPE,
	FCON, "FCON", LTYPE,
	CCODES, "CCODES", LTYPE,
	UNARY MINUS, "U-", UTYPE,
	UNARY MUL, "U*", UTYPE,
	UNARY AND, "U&", UTYPE,
	UNARY CALL, "UCALL", UTYPE|CALLFLG,
	UNARY FORTCALL, "UFCALL", UTYPE|CALLFLG,
	NOT, "!", UTYPE|LOGFLG,
	COMPL, "~", UTYPE,
	FORCE, "FORCE", UTYPE,
	INIT, "INIT", UTYPE,
	SCONV, "SCONV", UTYPE,
	PCONV, "PCONV", UTYPE,
	PLUS, "+", BITYPE|FLOFLG|SIMPFLG|COMMFLG,
	ASG PLUS, "+=", BITYPE|ASGFLG|ASGOPFLG|FLOFLG|SIMPFLG|COMMFLG,
	MINUS, "-", BITYPE|FLOFLG|SIMPFLG,
	ASG MINUS, "-=", BITYPE|FLOFLG|SIMPFLG|ASGFLG|ASGOPFLG,
	MUL, "*", BITYPE|FLOFLG|MULFLG,
	ASG MUL, "*=", BITYPE|FLOFLG|MULFLG|ASGFLG|ASGOPFLG,
	AND, "&", BITYPE|SIMPFLG|COMMFLG,
	ASG AND, "&=", BITYPE|SIMPFLG|COMMFLG|ASGFLG|ASGOPFLG,
	QUEST, "?", BITYPE,
	COLON, ":", BITYPE,
	ANDAND, "&&", BITYPE|LOGFLG,
	OROR, "||", BITYPE|LOGFLG,
	CM, ",", BITYPE,
	COMOP, ",OP", BITYPE,
	ASSIGN, "=", BITYPE|ASGFLG,
	DIV, "/", BITYPE|FLOFLG|MULFLG|DIVFLG,
	ASG DIV, "/=", BITYPE|FLOFLG|MULFLG|DIVFLG|ASGFLG|ASGOPFLG,
	MOD, "%", BITYPE|DIVFLG,
	ASG MOD, "%=", BITYPE|DIVFLG|ASGFLG|ASGOPFLG,
	LS, "<<", BITYPE|SHFFLG,
	ASG LS, "<<=", BITYPE|SHFFLG|ASGFLG|ASGOPFLG,
	RS, ">>", BITYPE|SHFFLG,
	ASG RS, ">>=", BITYPE|SHFFLG|ASGFLG|ASGOPFLG,
	OR, "|", BITYPE|COMMFLG|SIMPFLG,
	ASG OR, "|=", BITYPE|COMMFLG|SIMPFLG|ASGFLG|ASGOPFLG,
	ER, "^", BITYPE|COMMFLG,
	ASG ER, "^=", BITYPE|COMMFLG|ASGFLG|ASGOPFLG,
	INCR, "++", BITYPE|ASGFLG,
	DECR, "--", BITYPE|ASGFLG,
	STREF, "->", BITYPE,
	CALL, "CALL", BITYPE|CALLFLG,
	FORTCALL, "FCALL", BITYPE|CALLFLG,
	EQ, "==", BITYPE|LOGFLG,
	NE, "!=", BITYPE|LOGFLG,
	LE, "<=", BITYPE|LOGFLG,
	LT, "<", BITYPE|LOGFLG,
	GE, ">", BITYPE|LOGFLG,
	GT, ">", BITYPE|LOGFLG,
	UGT, "UGT", BITYPE|LOGFLG,
	UGE, "UGE", BITYPE|LOGFLG,
	ULT, "ULT", BITYPE|LOGFLG,
	ULE, "ULE", BITYPE|LOGFLG,
	ARS, "A>>", BITYPE,
	TYPE, "TYPE", LTYPE,
	LB, "[", BITYPE,
	CBRANCH, "CBRANCH", BITYPE,
	FLD, "FLD", UTYPE,
	PMCONV, "PMCONV", BITYPE,
	PVCONV, "PVCONV", BITYPE,
	RETURN, "RETURN", BITYPE|ASGFLG|ASGOPFLG,
	CAST, "CAST", BITYPE|ASGFLG|ASGOPFLG,
	GOTO, "GOTO", UTYPE,
	STASG, "STASG", BITYPE|ASGFLG,
	STARG, "STARG", UTYPE,
	STCALL, "STCALL", BITYPE|CALLFLG,
	UNARY STCALL, "USTCALL", UTYPE|CALLFLG,

-1,	0
};

mkdope(){
	register struct dopest *q;

	for( q = indope; q->dopeop >= 0; ++q ){
		dope[q->dopeop] = q->dopeval;
		opst[q->dopeop] = q->opst;
		}
	}
# ifndef BUG4
tprint( t )  TWORD t; { /* output a nice description of the type of t */

	static char * tnames[] = {
		"undef",
		"farg",
		"char",
		"short",
		"int",
		"long",
		"float",
		"double",
		"strty",
		"unionty",
		"enumty",
		"moety",
		"uchar",
		"ushort",
		"unsigned",
		"ulong",
		"?", "?"
		};

	for(;; t = DECREF(t) ){

		if( ISPTR(t) ) printf( "PTR " );
		else if( ISFTN(t) ) printf( "FTN " );
		else if( ISARY(t) ) printf( "ARY " );
		else {
			printf( "%s", tnames[t] );
			return;
			}
		}
	}
# endif

#ifdef FLEXNAMES
#define	NTSTRBUF	40
#define	TSTRSZ		2048
char	itstrbuf[TSTRSZ];
char	*tstrbuf[NTSTRBUF] = { itstrbuf };
char	**curtstr = tstrbuf;
int	tstrused;

char *
tstr(cp)
	register char *cp;
{
	register int i = strlen(cp);
	register char *dp;
	
	if (tstrused + i >= TSTRSZ) {
		if (++curtstr >= &tstrbuf[NTSTRBUF])
			cerror("out of temporary string space");
		tstrused = 0;
		if (*curtstr == 0) {
			dp = (char *)malloc(TSTRSZ);
			if (dp == 0)
				cerror("out of memory (tstr)");
			*curtstr = dp;
		}
	}
	strcpy(dp = *curtstr+tstrused, cp);
	tstrused += i + 1;
	return (dp);
}
#endif
rintf( ",d0\n	beq	.L%d\n", p[i].slab );
	  }
	  if( p->slab>=0 ) branch( p->slab );
	}
}
ors, 0 if none */
	}

aobeg(){
	/* called before removing automatics from stab */
	}

aocode(p) struct symtab *p; {
	/* called when automatic p removed from stab */
	}

aoend(){
	/* called after removing all automatics from stab */
	}

defnam( p ) register struct symtab *p; {
	/* define the current location as the name p->sname */

	if( p->sclass == EXTDEF )sumacc/cc/ccom/local.c   444      0     12       16745  3470501547  10107 # include "mfile1"


/*	this file contains code which is dependent on the target machine */
/* 	V. Pratt Dec. 12 incorporated jks fix to fincode (insert sw) */
/*	W. Nowicki July 1982 merged Stanford and LucasFilm changes */

NODE *
cast( p, t ) register NODE *p; TWORD t; {
	/* cast node p to type t */

	p = buildtree( CAST, block( NAME, NIL, NIL, t, 0, (int)t ), p );
	p->in.left->in.op = FREE;
	p->in.op = FREE;
	return( p->in.right );
	}

NODE *
clocal(p) NODE *p; {

	/* this is called to do local transformations on
	   an expression tree preparitory to its being
	   written out in intermediate code.
	*/

	/* the major essential job is rewriting the
	   automatic variables and arguments in terms of
	   REG and OREG nodes */
	/* conversion ops which are not necessary are also clobbered here */
	/* in addition, any special features (such as rewriting
	   exclusive or) are easily handled here as well */

	register struct symtab *q;
	register NODE *r;
	register o;
	register m, ml;

	switch( o = p->in.op ){

	case NAME:
		if( p->tn.rval<0 || p->tn.rval==NONAME ) { /* already processed; ignore... */
			return(p);
			}
		q = &stab[p->tn.rval];
		switch( q->sclass ){

		case AUTO:
		case PARAM:
			/* fake up a structure reference */
			r = block( REG, NIL, NIL, PTR+STRTY, 0, 0 );
			r->tn.lval = 0;
			r->tn.rval = (q->sclass==AUTO?STKREG:ARGREG);
			p = stref( block( STREF, r, p, 0, 0, 0 ) );
			break;

		case ULABEL:
		case LABEL:
		case STATIC:
			if( q->slevel == 0 ) break;
			p->tn.lval = 0;
			p->tn.rval = -q->offset;
			break;

		case REGISTER:
			p->in.op = REG;
			p->tn.lval = 0;
			p->tn.rval = q->offset;
			break;

			}
		break;
	case LT:
	case LE:
	case GT:
	case GE:
		if( ISPTR( p->in.left->in.type ) || ISPTR( p->in.right->in.type ) ){
			p->in.op += (ULT-LT);
			}
		break;

	case PCONV:
		/* do pointer conversions for char and shorts */
		ml = p->in.left->in.type;
		if( ( ml==CHAR || ml==UCHAR || ml==SHORT || ml==USHORT ) && p->in.left->in.op != ICON ) {
		  p->in.op = SCONV;
		  break;
		}

		/* pointers all have the same representation; the type is inherited */
		p->in.left->in.type = p->in.type;
		p->in.left->fn.cdim = p->fn.cdim;
		p->in.left->fn.csiz = p->fn.csiz;
		p->in.op = FREE;
		return( p->in.left );

	case SCONV:
		m = (p->in.type == FLOAT || p->in.type == DOUBLE );
		ml = (p->in.left->in.type == FLOAT || p->in.left->in.type == DOUBLE );
		if( m != ml ) break;

		/* now, look for conversions downwards */

		m = p->in.type;
		ml = p->in.left->in.type;
		if( p->in.left->in.op == ICON ){ /* simulate the conversion here */
			CONSZ val;
			val = p->in.left->tn.lval;
			switch( m ){
			case CHAR:
				p->in.left->tn.lval = (char) val;
				break;
			case UCHAR:
				p->in.left->tn.lval = val & 0XFF;
				break;
			case USHORT:
				p->in.left->tn.lval = val & 0XFFFFL;
				break;
			case SHORT:
				p->in.left->tn.lval = (short)val;
				break;
				}
			p->in.left->in.type = m;
			}
		else if( p->in.left->in.op == FCON ){ /* simulate the conversion here */
			p->in.left->in.type = m;
			}
		else break;

		/* clobber conversion */
		p->in.op = FREE;
		return( p->in.left );  /* conversion gets clobbered */

	case PVCONV:
	case PMCONV:
		if( p->in.right->in.op != ICON ) cerror( "bad conversion", 0);
		p->in.op = FREE;
		return( buildtree( o==PMCONV?MUL:DIV, p->in.left, p->in.right ) );

		}

	return(p);
	}

andable( p ) NODE *p; {
	return(1);  /* all names can have & taken on them */
	}

cendarg(){ /* at the end of the arguments of a ftn, set the automatic offset */
	autooff = AUTOINIT;
	}

cisreg( t ) TWORD t; { /* is an automatic variable of type t OK for a register variable */
	switch (t) {
	  case INT:
	  case UNSIGNED:
	  case SHORT:
	  case USHORT:
	  case CHAR:
	  case UCHAR:	return(1);

	  default:	if ( ISPTR(t) ) return(1);
			return(0);
	}
}

NODE *
offcon( off, t, d, s ) OFFSZ off; TWORD t; {

	/* return a node, for structure references, which is suitable for
	   being added to a pointer of type t, in order to be off bits offset
	   into a structure */

	register NODE *p;

	/* t, d, and s are the type, dimension offset, and sizeoffset */
	/* in general they  are necessary for offcon, but not on H'well */

	p = bcon(0);
	p->tn.lval = off/SZCHAR;
	return(p);

	}

static inwd		/* current bit offset in word */;
static long word	/* word being built from fields */;

incode( p, sz ) register NODE *p; {

	/* generate initialization code for assigning a constant c
		to a field of width sz */
	/* we assume that the proper alignment has been obtained */
	/* inoff is updated to have the proper final value */
	/* we also assume sz  < SZINT */

	if((sz+inwd) > SZINT) cerror("incode: field > int");
	word |= (p->tn.lval & ((1 << sz) -1)) << (SZINT - sz - inwd);
	inwd += sz;
	inoff += sz;
	while (inwd >= 16) {
#ifdef BOOTSTRAP
	  printf( "	.word	%d\n", (word>>16)&0xFFFFL );
#else
	  printf( "	.word	%ld\n", (word>>16)&0xFFFFL );
#endif
	  word <<= 16;
	  inwd -= 16;
	}
}

#define sw(x) ((x>>16)&0xFFFF | (x<<16) & 0xFFFF0000)

fincode( d, sz ) double d; {
	/* output code to initialize space of size sz to the value d */
	/* the proper alignment has been obtained */
	/* inoff is updated to have the proper final value */
	/* on the target machine, write it out in octal! */

	register long *mi = (int *)&d;

	if( sz==SZDOUBLE )
#ifdef BOOTSTRAP
		printf( "	.long	%d, %d\n", sw(mi[0]), sw(mi[1]) );
#else BOOTSTRAP
		printf( "	.long	0x%X, 0x%X\n", mi[0], mi[1]);
#endif BOOTSTRAP
	else
#ifdef BOOTSTRAP
		printf( "	.long	%d\n", sw(mi[0]) );
#else BOOTSTRAP
		printf("	.long	0x%X\n", mi[0]);
#endif BOOTSTRAP
	inoff += sz;
	}

cinit( p, sz ) NODE *p; {
	/* arrange for the initialization of p into a space of
	size sz */
	/* the proper alignment has been opbtained */
	/* inoff is updated to have the proper final value */
	ecode( p );
	inoff += sz;
	}

vfdzero( n ){ /* define n bits of zeros in a vfd */

	if( n <= 0 ) return;

	inwd += n;
	inoff += n;
	while (inwd >= 16) {
#ifdef BOOTSTRAP
	  printf( "	.word	%d\n", (word>>16)&0xFFFFL );
#else
	  printf( "	.word	%ld\n", (word>>16)&0xFFFFL );
#endif
	  word <<= 16;
	  inwd -= 16;
	}
}


char *
exname( p ) char *p; {
	/* make a name look like an external name in the local machine */

#ifndef FLEXNAMES
	static char text[NCHNAM+1];
#else
	static char text[BUFSIZ+1];
#endif

	register i;

#ifndef FLEXNAMES
	for( i=0; *p&&i<NCHNAM; ++i ){
#else
	for( i=0; *p; ++i){
#endif
		text[i] = *p++;
		}

	text[i] = '\0';
#ifndef FLEXNAMES
	text[NCHNAM] = '\0';  /* truncate */
#endif
	return( text );
	}

ctype( type ) TWORD type; { /* map types which are not defined on the local machine */
	switch( BTYPE(type) ){
	case LONG:
		MODTYPE(type,INT);
		break;
	case ULONG:
		MODTYPE(type,UNSIGNED);
		}
	return( type );
	}

noinit() { /* curid is a variable which is defined but
	is not initialized (and not a function );
	This routine returns the stroage class for an uninitialized declaration */

	return(EXTERN);

	}

commdec( id ){ /* make a common declaration for id, if reasonable */
	register struct symtab *q;
	OFFSZ off;

	q = &stab[id];
	printf( "	.comm	%s,", exname( q->sname ) );
	off = tsize( q->stype, q->dimoff, q->sizoff );
	printf( CONFMT, off/SZCHAR );
	printf( "\n" );
	}

isitlong( cb, ce ){ /* is lastcon to be long or short */
	/* cb is the first character of the representation, ce the last */

	if( ce == 'l' || ce == 'L' ||
		lastcon >= (1L << (SZINT-1) ) ) return (1);
	return(0);
	}


isitfloat( s ) char *s; {
	double atof();
	dcon = atof(s);
	return( FCON );
	}

ecode( p ) NODE *p; {

	/* walk the tree and write out the nodes.. */

	if( nerrors ) return;
	p2tree( p );
	p2compile( p );
	}


cisreg( t ) TWORD t; { /* sumacc/cc/ccom/local2.c   444      0     12       53510  3470501547  10160 # include "mfile2"
/* a lot of the machine dependent parts of the second pass */
/* Incorporated Terman fix to rmove - V. Pratt 2/17/82 */
/* W. Nowicki July 1982 merged Stanford and LucasFilm fixes */
/* W. Nowicki August 1982 incorporated MITs fix to multiply */

# define BITMASK(n) ((1L<<n)-1)

lineid( l, fn ) char *fn; {
	/* identify line l and file fn */
	printf( "|	line %d, file %s\n", l, fn );
	}

int usedregs;	/* flag word for registers used in current routine */
int maxtoff = 0;

cntbits(i)
  register int i;
  {	register int j,ans;

	for (ans=0, j=0; i!=0 && j<16; j++) { if (i&1) ans++; i>>= 1; }
	return(ans);
}

eobl2(){
	extern int retlab;
	OFFSZ spoff;	/* offset from stack pointer */

	spoff = maxoff;
	spoff /= SZCHAR;
	SETOFF(spoff,2);
	usedregs &= 036374;	/* only save regs used for reg vars */
	spoff += 4*cntbits(usedregs);	/* save at base of stack frame */
	printf( ".L%d:", retlab);
	if (usedregs) printf( "	moveml	a6@(-_F%d),#%d\n", ftnno, usedregs );
	printf( "	unlk	a6\n" );
	printf( "	rts\n" );
	printf( "_F%d = %d\n", ftnno, spoff );
	printf( "_S%d = %d\n", ftnno, usedregs );
#ifdef STACKPROBE
	printf( "_P%d = %d\n", ftnno, maxtoff + 8 );
#else		/* not STACKPROBE */
	printf( "| M%d = %d\n", ftnno, maxtoff );
#endif		/* of ifdef STACKPROBE */
	maxtoff = 0;
	if( fltused ) {
		fltused = 0;
		printf( "	.globl	fltused\n" );
		}
	}

struct hoptab { int opmask; char * opstring; } ioptab[]= {

	ASG PLUS, "add",
	ASG MINUS, "sub",
	ASG OR,	"or",
	ASG AND, "and",
	ASG ER,	"eor",
	ASG MUL, "mul",
	ASG DIV, "div",
	ASG MOD, "div",
	ASG LS,	"sl",
	ASG RS,	"sr",

	-1, ""    };

hopcode( f, o ){
	/* output the appropriate string from the above table */

	register struct hoptab *q;

	for( q = ioptab;  q->opmask>=0; ++q ){
		if( q->opmask == o ){
			printf( "%s", q->opstring );
			if( f == 'F' ) printf( "f" );
			return;
			}
		}
	cerror( "no hoptab for %s", opst[o] );
	}

char *
rnames[]= {  /* keyed to register number tokens */

	"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
	"a0", "a1", "a2", "a3", "a4", "a5", "a6", "sp"
	};

int rstatus[] = {
	SAREG|STAREG, SAREG|STAREG,
	SAREG|STAREG, SAREG|STAREG,
	SAREG|STAREG, SAREG|STAREG,
	SAREG|STAREG, SAREG|STAREG,

	SBREG|STBREG, SBREG|STBREG,
	SBREG|STBREG, SBREG|STBREG,
	SBREG|STBREG, SBREG|STBREG,
	SBREG,	      SBREG,
	};

NODE *brnode;
int brcase;

int toff = 0; /* number of stack locations used for args */

zzzcode( p, c ) NODE *p; {
	register m,temp;
	switch( c ){

	case 'C':
		switch (p->in.left->in.op) {
		  case ICON:	printf("\tjbsr\t");
				acon(p->in.left);
				return;

		  case REG:	printf("\tjbsr\t");
				adrput(p->in.left);
				printf("@");
				return;

		  case NAME:
		  case OREG:	printf("\tmovl\t");
				adrput(p->in.left);
				printf(",a0\n\tjbsr\ta0@");
				return;

		  default:	cerror("bad subroutine name");
		}

	case 'L':
		m = p->in.left->in.type;
		goto suffix;

	case 'R':
		m = p->in.right->in.type;
		goto suffix;

	case 'B':
		m = p->in.type;		/* fall into suffix: */

	suffix:	if( m == CHAR || m == UCHAR ) printf( "b" );
		else if( m == SHORT || m == USHORT ) printf( "w" );
		else printf( "l" );
		return;

	case 'N':  /* logical ops, turned into 0-1 */
		/* use register given by register 1 */
		cbgen( 0, m=getlab(), 'I' );
		deflab( p->bn.label );
		printf( "	clrl	%s\n", rnames[temp = getlr( p, '1' )->tn.rval] );
		usedregs |= 1<<temp;
		deflab( m );
		p->in.type = INT;
		return;

	case 'I':
		cbgen( p->in.op, p->bn.label, c );
		return;

		/* stack management macros */
	case '-':
		printf( "sp@-" );
	case 'P':
		toff += 4;
		if (toff > maxtoff) maxtoff = toff;
		return;

	case '0':
		toff = 0; return;

	case '~':
		/* complimented CR */
		p->in.right->tn.lval = ~p->in.right->tn.lval;
		conput( getlr( p, 'R' ) );
		p->in.right->tn.lval = ~p->in.right->tn.lval;
		return;

	case 'M':
		/* negated CR */
		p->in.right->tn.lval = -p->in.right->tn.lval;
	case 'O':
		conput( getlr( p, 'R' ) );
		p->in.right->tn.lval = -p->in.right->tn.lval;
		return;

	case 'T':
		/* Truncate longs for type conversions:
		    INT|UNSIGNED -> CHAR|UCHAR|SHORT|USHORT
		   increment offset to second word */

		m = p->in.type;
		p = p->in.left;
		switch( p->in.op ){
		case NAME:
		case OREG:
			if (p->in.type==SHORT || p->in.type==USHORT)
			  p->tn.lval += (m==CHAR || m==UCHAR) ? 1 : 0;
			else p->tn.lval += (m==CHAR || m==UCHAR) ? 3 : 2;
			return;
		case REG:
			return;
		default:
			cerror( "Illegal ZT type conversion" );
			return;

			}

	case 'U':
		cerror( "Illegal ZU" );
		/* NO RETURN */

	case 'W':	/* structure size */
		if( p->in.op == STASG )
			printf( "%d", p->stn.stsize);
		else	cerror( "Not a structure" );
		return;

	case 'S':  /* structure assignment */
		{
			register NODE *l, *r;
			register size, i;

			if( p->in.op == STASG ){
				l = p->in.left;
				r = p->in.right;
				}
			else if( p->in.op == STARG ){  /* store an arg onto the stack */
				r = p->in.left;
				}
			else cerror( "STASG bad" );

			if( r->in.op == ICON ) r->in.op = NAME;
			else if( r->in.op == REG ) r->in.op = OREG;
			else if( r->in.op != OREG ) cerror( "STASG-r" );

			size = p->stn.stsize;

			r->tn.lval += size;
			l->tn.lval += size;

			while( size ){ /* simple load/store loop */
				i = (size > 2) ? 4 : 2;
				r->tn.lval -= i;
				expand( r, FOREFF,(i==2)?"\tmovw\tAR,":"\tmovl\tAR," );
				l->tn.lval -= i;
				expand( l, FOREFF, "AR\n" );
				size -= i;
			}

			if( r->in.op == NAME ) r->in.op = ICON;
			else if( r->in.op == OREG ) r->in.op = REG;

			}
		break;

	default:
		cerror( "illegal zzzcode" );
		}
	}

rmove( rt, rs, t ) TWORD t; {
	if ( t == DOUBLE ) {
	  printf( "	movl	%s,%s\n", rnames[rs+1], rnames[rt+1] );
	  usedregs |= 1<<(rs+1);
	  usedregs |= 1<<(rt+1);
	}
	printf( "	movl	%s,%s\n", rnames[rs], rnames[rt] );
	usedregs |= 1<<rs;
	usedregs |= 1<<rt;
	}

struct respref
respref[] = {
	INTAREG|INTBREG,	INTAREG|INTBREG,
	INAREG|INBREG,	INAREG|INBREG|SOREG|STARREG|SNAME|STARNM|SCON,
	INTEMP,	INTEMP,
	FORARG,	FORARG,
#ifndef Stanford
	INTAREG,	SOREG|SNAME|INAREG,
#else Stanford
	INTAREG,	SOREG|SNAME,
#endif Stanford
	0,	0 };

setregs(){ /* set up temporary registers */
	register i;
	register int naregs = (maxtreg>>8)&0377;

	/* use any unused variable registers as scratch registers */
	maxtreg & = 0377;
	fregs = maxtreg>=MINRVAR ? maxtreg + 1 : MINRVAR;
	if( xdebug ){
		/* -x changes number of free regs to 2, -xx to 3, etc. */
		if( (xdebug+1) < fregs ) fregs = xdebug+1;
		}

	for( i=MINRVAR; i<=MAXRVAR; i++ )
		rstatus[i] = i<fregs ? SAREG|STAREG : SAREG;
	for( i=MINRVAR; i<=MAXRVAR; i++ )
		rstatus[i+8] = i<naregs ? SBREG|STBREG : SBREG;
	}

szty(t) TWORD t; { /* size, in words, needed to hold thing of type t */
	/* really is the number of registers to hold type t */
	return(t==DOUBLE ? 2 : 1);
	}

rewfld( p ) NODE *p; {
	return(1);
	}

callreg(p) NODE *p; {
	return( D0 );
	}

shltype( o, p ) NODE *p; {
	if( o == NAME|| o==REG || o == ICON || o == OREG ) return( 1 );
	return( o==UNARY MUL && shumul(p->in.left) );
	}

flshape( p ) register NODE *p; {
	register o = p->in.op;
	if( o==NAME || o==REG || o==ICON || o==OREG ) return( 1 );
	return( o==UNARY MUL && shumul(p->in.left)==STARNM );
	}

shtemp( p ) register NODE *p; {
	if( p->in.op == UNARY MUL ) p = p->in.left;
	if( p->in.op == REG || p->in.op == OREG ) return( !istreg( p->tn.rval ) );
	return( p->in.op == NAME || p->in.op == ICON );
	}

spsz( t, v ) TWORD t; CONSZ v; {

	/* is v the size to increment something of type t */

	if( !ISPTR(t) ) return( 0 );
	t = DECREF(t);

	if( ISPTR(t) ) return( v == 4 );

	switch( t ){

	case UCHAR:
	case CHAR:
		return( v == 1 );

	case SHORT:
	case USHORT:
		return( v == 2 );

	case INT:
	case UNSIGNED:
	case FLOAT:
		return( v == 4 );

	case DOUBLE:
		return( v == 8 );
		}

	return( 0 );
	}

indexreg( p ) register NODE *p; {
	if ( p->in.op==REG && p->tn.rval>=A0 && p->tn.rval<=SP) return(1);
	return(0);
}

shumul( p ) register NODE *p; {
	register o;

	o = p->in.op;
	if( indexreg(p) ) return( STARNM );

	if( o == INCR && indexreg(p->in.left) && p->in.right->in.op==ICON &&
	    p->in.right->in.name[0] == '\0' &&
	    spsz( p->in.left->in.type, p->in.right->tn.lval ) )
		return( STARREG );

	return( 0 );
	}

adrcon( val ) CONSZ val; {
	printf( CONFMT, val );
	}

conput( p ) register NODE *p; {
	switch( p->in.op ){

	case ICON:
		acon( p );
		return;

	case REG:
		printf( "%s", rnames[p->tn.rval] );
		usedregs |= 1<<p->tn.rval;
		return;

	default:
		cerror( "illegal conput" );
		}
	}

insput( p ) NODE *p; {
	cerror( "insput" );
	}

upput( p ) NODE *p; {
	/* output the address of the second word in the
	   pair pointed to by p (for LONGs)*/
	CONSZ save;

	if( p->in.op == FLD ){
		p = p->in.left;
		}

	save = p->tn.lval;
	switch( p->in.op ){

	case NAME:
		p->tn.lval += SZINT/SZCHAR;
		acon( p );
		break;

	case ICON:
		/* addressable value of the constant */
		p->tn.lval &= BITMASK(SZINT);
		printf( "#" );
		acon( p );
		break;

	case REG:
		printf( "%s", rnames[p->tn.rval+1] );
		usedregs |= 1<<(p->tn.rval + 1);
		break;

	case OREG:
		p->tn.lval += SZINT/SZCHAR;
		if( p->tn.rval == A6 ){  /* in the argument region */
			if( p->in.name[0] != '\0' ) werror( "bad arg temp" );
			}
		printf( "%s@", rnames[p->tn.rval] );
		usedregs |= 1<<p->tn.rval;
		if( p->tn.lval != 0 || p->in.name[0] != '\0' )
		  { printf("("); acon( p ); printf(")"); }
		break;

	default:
		cerror( "illegal upper address" );
		break;

		}
	p->tn.lval = save;

	}

adrput( p ) register NODE *p; {
	/* output an address, with offsets, from p */

	if( p->in.op == FLD ){
		p = p->in.left;
		}
	switch( p->in.op ){

	case NAME:
		acon( p );
		return;

	case ICON:
		/* addressable value of the constant */
		if( szty( p->in.type ) == 2 ) {
			/* print the high order value */
			CONSZ save;
			save = p->tn.lval;
			p->tn.lval = ( p->tn.lval >> SZINT ) & BITMASK(SZINT);
			printf( "#" );
			acon( p );
			p->tn.lval = save;
			return;
			}
		printf( "#" );
		acon( p );
		return;

	case REG:
		printf( "%s", rnames[p->tn.rval] );
		usedregs |= 1<<p->tn.rval;
		return;

	case OREG:
		if( p->tn.rval == A6 ){  /* in the argument region */
			if( p->in.name[0] != '\0' ) werror( "bad arg temp" );
			printf( "a6@(" );
			printf( CONFMT, p->tn.lval );
			printf( ")" );
			return;
			}
		printf( "%s@", rnames[p->tn.rval] );
		usedregs |= 1<<p->tn.rval;
		if( p->tn.lval != 0 || p->in.name[0] != '\0' )
		  { printf("("); acon( p ); printf(")"); }
		break;

	case UNARY MUL:
		/* STARNM or STARREG found */
		if( tshape(p, STARNM) ) {
			adrput( p->in.left);
			printf( "@" );
			}
		else {	/* STARREG - really auto inc or dec */
			/* turn into OREG so replacement node will
			   reflect the value of the expression */
			register i;
			register NODE *q, *l;

			l = p->in.left;
			q = l->in.left;
			p->in.op = OREG;
			p->in.rall = q->in.rall;
			p->tn.lval = q->tn.lval;
			p->tn.rval = q->tn.rval;
#ifndef FLEXNAMES
			for( i=0; i<NCHNAM; i++ )
				p->in.name[i] = q->in.name[i];
#else
			p->in.name = q->in.name;
#endif
			if( l->in.op == INCR ) {
				adrput( p );
				printf( "+" );
				p->tn.lval -= l->in.right->tn.lval;
				}
			else {	/* l->in.op == ASG MINUS */
				printf( "-" );
				adrput( p );
				}
			tfree( l );
		}
		return;

	default:
		cerror( "illegal address" );
		return;

		}

	}

acon( p ) register NODE *p; { /* print out a constant */

	if( p->in.name[0] == '\0' ){	/* constant only */
		printf( CONFMT, p->tn.lval);
		}
	else if( p->tn.lval == 0 ) {	/* name only */
#ifndef FLEXNAMES
		printf( "%.8s", p->in.name );
#else
		printf( "%s", p->in.name );
#endif
		}
	else {				/* name + offset */
#ifndef FLEXNAMES
		printf( "%.8s+", p->in.name );
#else
		printf( "%s+", p->in.name);
#endif
		printf( CONFMT, p->tn.lval );
		}
	}

genscall( p, cookie ) register NODE *p; {
	/* structure valued call */
	return( gencall( p, cookie ) );
	}

gencall( p, cookie ) register NODE *p; {
	/* generate the call given by p */
	register temp;
	register m;

	if( p->in.right ) temp = argsize( p->in.right );
	else temp = 0;

	if( p->in.right ){ /* generate args */
		genargs( p->in.right );
		}

	if( !shltype( p->in.left->in.op, p->in.left ) ) {
		order( p->in.left, INBREG|SOREG );
		}

	p->in.op = UNARY CALL;
	m = match( p, INTAREG|INTBREG );
	popargs( temp );
	return(m != MDONE);
	}

popargs( size ) register size; {
	/* pop arguments from stack */

	toff -= size/2;
	if( toff == 0 && size >= 2 ) size -= 2;
	switch( size ) {
	case 0:
		break;
	default:
		printf( "\t%s\t#%d,sp\n", size<=8 ? "addql":"addl", size);
		}
	}

char *
ccbranches[] = {
	"	beq	.L%d\n",
	"	bne	.L%d\n",
	"	ble	.L%d\n",
	"	blt	.L%d\n",
	"	bge	.L%d\n",
	"	bgt	.L%d\n",
	"	bls	.L%d\n",
	"	bcs	.L%d\n",		/* blo */
	"	bcc	.L%d\n",		/* bhis */
	"	bhi	.L%d\n",
	};

/*	long branch table

   This table, when indexed by a logical operator,
   selects a set of three logical conditions required
   to generate long comparisons and branches.  A zero
   entry indicates that no branch is required.
   E.G.:  The <= operator would generate:
	cmp	AL,AR
	jlt	lable	/ 1st entry LT -> lable
	jgt	1f	/ 2nd entry GT -> 1f
	cmp	UL,UR
	jlos	lable	/ 3rd entry ULE -> lable
   1:
 */

int lbranches[][3] = {
	/*EQ*/	0,	NE,	EQ,
	/*NE*/	NE,	0,	NE,
	/*LE*/	LT,	GT,	ULE,
	/*LT*/	LT,	GT,	ULT,
	/*GE*/	GT,	LT,	UGE,
	/*GT*/	GT,	LT,	UGT,
	/*ULE*/	ULT,	UGT,	ULE,
	/*ULT*/	ULT,	UGT,	ULT,
	/*UGE*/	UGT,	ULT,	UGE,
	/*UGT*/	UGT,	ULT,	UGT,
	};

/* logical relations when compared in reverse order (cmp R,L) */
extern short revrel[] ;

cbgen( o, lab, mode ) { /*   printf conditional and unconditional branches */
	register *plb;
	int lab1f;

	if( o == 0 ) printf( "	bra	.L%d\n", lab );
	else	if( o > UGT ) cerror( "bad conditional branch: %s", opst[o] );
	else {
		switch( brcase ) {

		case 'A':
		case 'C':
			plb = lbranches[ o-EQ ];
			lab1f = getlab();
			expand( brnode, FORCC, brcase=='C' ? "\tcmp\tAL,AR\n" : "\ttst\tAR\n" );
			if( *plb != 0 )
				printf( ccbranches[*plb-EQ], lab);
			if( *++plb != 0 )
				printf( ccbranches[*plb-EQ], lab1f);
			expand( brnode, FORCC, brcase=='C' ? "\tcmp\tUL,UR\n" : "\ttst\tUR\n" );
			printf( ccbranches[*++plb-EQ], lab);
			deflab( lab1f );
			reclaim( brnode, RNULL, 0 );
			break;

		default:
			if( mode=='F' ) o = revrel[ o-EQ ];
			printf( ccbranches[o-EQ], lab );
			break;
			}

		brcase = 0;
		brnode = 0;
		}
	}

nextcook( p, cookie ) NODE *p; {
	/* we have failed to match p with cookie; try another */
	if( cookie == FORREW ) return( 0 );  /* hopeless! */
	if( !(cookie&(INTAREG|INTBREG)) ) return( INTAREG|INTBREG );
	if( !(cookie&INTEMP) && asgop(p->in.op) ) return( INTEMP|INAREG|INTAREG|INTBREG|INBREG );
	return( FORREW );
	}

lastchance( p, cook ) NODE *p; {
	/* forget it! */
	return(0);
	}

struct functbl {
	int fop;
	TWORD ftype;
	char *func;
	} opfunc[] = {
	MUL,		INT,	"lmul",
	DIV,		INT,	"ldiv",
	MOD,		INT,	"lrem",
	ASG MUL,	INT,	"almul",
	ASG DIV,	INT,	"aldiv",
	ASG MOD,	INT,	"alrem",
	MUL,		UNSIGNED,	"ulmul",
	DIV,		UNSIGNED,	"uldiv",
	MOD,		UNSIGNED,	"ulrem",
	ASG MUL,	UNSIGNED,	"aulmul",
	ASG DIV,	UNSIGNED,	"auldiv",
	ASG MOD,	UNSIGNED,	"aulrem",
	PLUS,		DOUBLE,	"fadd",
	MINUS,		DOUBLE, "fsub",
	MUL,		DOUBLE, "fmul",
	DIV,		DOUBLE, "fdiv",
	UNARY MINUS,	DOUBLE, "fneg",
	UNARY MINUS,	FLOAT,	"fneg",
	ASG PLUS,	DOUBLE,	"afadd",
	ASG MINUS,	DOUBLE, "afsub",
	ASG MUL,	DOUBLE, "afmul",
	ASG DIV,	DOUBLE, "afdiv",
	ASG PLUS,	FLOAT,	"afaddf",
	ASG MINUS,	FLOAT,	"afsubf",
	ASG MUL,	FLOAT,	"afmulf",
	ASG DIV,	FLOAT,	"afdivf",
	0,	0,	0 };

hardops(p)  register NODE *p; {
	/* change hard to do operators into function calls. */
	register NODE *q;
	register struct functbl *f;
	register o;
	register TWORD t;

	o = p->in.op;
	t = (o == MUL) ? p->in.left->in.type : p->in.type;

	if (o==SCONV) { hardconv(p); return; }

	for( f=opfunc; f->fop; f++ ) {
		if( o==f->fop && t==f->ftype ) goto convert;
		}
	return;

	/* need address of left node for ASG OP */
	/* WARNING - this won't work for long in a REG */
	convert:
	if( asgop( o ) ) {
		switch( p->in.left->in.op ) {

		case UNARY MUL:	/* convert to address */
			p->in.left->in.op = FREE;
			p->in.left = p->in.left->in.left;
			break;

		case NAME:	/* convert to ICON pointer */
			p->in.left->in.op = ICON;
			p->in.left->in.type = INCREF( p->in.left->in.type );
			break;

		case OREG:	/* convert OREG to address */
			p->in.left->in.op = REG;
			p->in.left->in.type = INCREF( p->in.left->in.type );
			if( p->in.left->tn.lval != 0 ) {
				q = talloc();
				q->in.op = PLUS;
				q->in.rall = NOPREF;
				q->in.type = p->in.left->in.type;
				q->in.left = p->in.left;
				q->in.right = talloc();

				q->in.right->in.op = ICON;
				q->in.right->in.rall = NOPREF;
				q->in.right->in.type = INT;
				q->in.right->in.name[0] = '\0';
				q->in.right->tn.lval = p->in.left->tn.lval;
				q->in.right->tn.rval = 0;

				p->in.left->tn.lval = 0;
				p->in.left = q;
				}
			break;

		/* rewrite "foo <op>= bar" as "foo = foo <op> bar" for foo in a reg */
		case REG:
			q = talloc();
			q->in.op = p->in.op - 1;	/* change <op>= to <op> */
			q->in.rall = p->in.rall;
			q->in.type = p->in.type;
			q->in.left = talloc();
			q->in.right = p->in.right;
			p->in.op = ASSIGN;
			p->in.right = q;
			q = q->in.left;			/* make a copy of "foo" */
			q->in.op = p->in.left->in.op;
			q->in.rall = p->in.left->in.rall;
			q->in.type = p->in.left->in.type;
			q->tn.lval = p->in.left->tn.lval;
			q->tn.rval = p->in.left->tn.rval;
			hardops(p->in.right);
			return;

		default:
			cerror( "Bad address for hard ops" );
			/* NO RETURN */

			}
		}

	/* build comma op for args to function */
	if ( optype(p->in.op) == BITYPE ) {
	  q = talloc();
	  q->in.op = CM;
	  q->in.rall = NOPREF;
	  q->in.type = INT;
	  q->in.left = p->in.left;
	  q->in.right = p->in.right;
	} else q = p->in.left;

	p->in.op = CALL;
	p->in.right = q;

	/* put function name in left node of call */
	p->in.left = q = talloc();
	q->in.op = ICON;
	q->in.rall = NOPREF;
	q->in.type = INCREF( FTN + p->in.type );
#ifndef FLEXNAMES
	strcpy( q->in.name, f->func );
#else
	q->in.name = f->func;
#endif
	q->tn.lval = 0;
	q->tn.rval = 0;

	return;

	}

/* do fix and float conversions */
hardconv(p)
  register NODE *p;
  {	register NODE *q;
	register TWORD t,tl;
	int m,ml;

	t = p->in.type;
	tl = p->in.left->in.type;

	m = t==DOUBLE || t==FLOAT;
	ml = tl==DOUBLE || tl==FLOAT;

	if (m==ml || logop(p->in.left->in.op)) return;

	p->in.op = CALL;
	p->in.right = p->in.left;

	/* put function name in left node of call */
	p->in.left = q = talloc();
	q->in.op = ICON;
	q->in.rall = NOPREF;
	q->in.type = INCREF( FTN + p->in.type );
#ifndef FLEXNAMES
	strcpy( q->in.name, m ? "float" : "fix" );
#else
	q->in.name = m ? "float" : "fix";
#endif
	q->tn.lval = 0;
	q->tn.rval = 0;
}

/* return 1 if node is a SCONV from short to int */
shortconv( p )
  register NODE *p;
  {	if ( p->in.op==SCONV && p->in.type==INT && p->in.left->in.type==SHORT)
	  return( 1 );
	return( 0 );
  }

/* return 1 if node is a SCONV from Float to Double */
floatconv( p )
  register NODE *p;
  {	if ( p->in.op==SCONV && p->in.type==DOUBLE && p->in.left->in.type==FLOAT)
	  return( 1 );
	return( 0 );
}

/* do local tree transformations and optimizations */
optim2( p )
  register NODE *p;
  {	register NODE *q;

	/* multiply of two shorts to produce an int can be done directly
	 * in the hardware.
	 */
	if ( p->in.op==MUL && p->in.type==INT && shortconv(p->in.left) &&
	     (shortconv(p->in.right) || (p->in.right->in.op==ICON &&
	      p->in.right->in.name[0] == '\0' &&
	      p->in.right->tn.lval>=-32768L && p->in.right->tn.lval<=32767L)))
	{
	  p->in.left = (q = p->in.left)->in.left;
	  q->in.op = FREE;
	  if ( p->in.right->in.op==ICON ) p->in.right->in.type = SHORT;
	  else {
	    p->in.right = (q = p->in.right)->in.left;
	    q->in.op = FREE;
 	  }
	}

	/*
	 * The following valiant attempt at optimizing floating
	 * compares depends on the floating representation to be
	 * reasonable, which it is not, so I am undoing it except for
	 * The equality operators. Sigh.
	 * WIN 8-82
	 */
	if (logop(p->in.op) &&  (p->in.op==EQ || p->in.op==NE) &&
	    ((q = p->in.left)->in.type==FLOAT || q->in.type==DOUBLE) &&
	    ((q = p->in.right)->in.type==FLOAT || q->in.type==DOUBLE)) {
	if ( floatconv(p->in.left) && floatconv(p->in.right) )
	    {
	      p->in.left = (q = p->in.left)->in.left;
	      q->in.op = FREE;
	      p->in.right = (q = p->in.right)->in.left;
	      q->in.op = FREE;
 	    }
# ifndef Stanford
	else
	 {
	/* change <flt exp>1 <logop> <flt exp>2 to
	 * (<exp>1 - <exp>2) <logop> 0.0
	 */
	  q = talloc();
	  q->in.op = MINUS;
	  q->in.rall = NOPREF;
	  q->in.type = DOUBLE;
	  q->in.left = p->in.left;
	  q->in.right = p->in.right;
	  p->in.left = q;
	  p->in.right = q = talloc();
	  q->tn.op = ICON;
	  q->tn.type = DOUBLE;
#ifdef FLEXNAMES
	  q->tn.name = "";
#else
	  q->tn.name[0] = '\0';
#endif
	  q->tn.rval = 0;
	  q->tn.lval = 0;
	 }
# endif Stanford
	}

}

myreader(p) register NODE *p; {
	walkf( p, optim2 );
	walkf( p, hardops );	/* convert ops to function calls */
	canon( p );		/* expands r-vals for fileds */
	toff = 0;  /* stack offset swindle */
	}

special( p, shape ) register NODE *p; {
	/* special shape matching routine */

	switch( shape ) {

	case SCCON:
		if( p->in.op == ICON && p->in.name[0]=='\0' && p->tn.lval>= -128 && p->tn.lval <=127 ) return( 1 );
		break;

	case SICON:
		if( p->in.op == ICON && p->in.name[0]=='\0' && p->tn.lval>= 0 && p->tn.lval <=32767 ) return( 1 );
		break;

	case S8CON:
		if( p->in.op == ICON && p->in.name[0]=='\0' && p->tn.lval>= 1 && p->tn.lval <= 8) return( 1 );
		break;

	default:
		cerror( "bad special shape" );

		}

	return( 0 );
	}

# ifndef ONEPASS
main( argc, argv ) char *argv[]; {
	return( mainp2( argc, argv ) );
	}
# endif

# ifdef MULTILEVEL
# include "mldec.h"

struct ml_node mltree[] ={

DEFINCDEC,	INCR,	0,
	INCR,	SANY,	TANY,
		OPANY,	SAREG|STAREG,	TANY,
		OPANY,	SCON,	TANY,

DEFINCDEC,	ASG MINUS,	0,
	ASG MINUS,	SANY,	TANY,
		REG,	SANY,	TANY,
		ICON,	SANY,	TANY,

TSOREG,	1,	0,
	UNARY MUL,	SANY,	TANY,
		REG,	SANY,	TANY,

TSOREG,	2,	0,
	UNARY MUL,	SANY,	TANY,
		PLUS,	SANY,	TANY,
			REG,	SANY,	TANY,
			ICON,	SANY,	TCHAR|TUCHAR|TSHORT|TUSHORT|TINT|TUNSIGNED|TPOINT,

TSOREG,	2,	0,
	UNARY MUL,	SANY,	TANY,
		MINUS,	SANY,	TANY,
			REG,	SANY,	TANY,
			ICON,	SANY,	TCHAR|TUCHAR|TSHORT|TUSHORT|TINT|TUNSIGNED|TPOINT,
0,0,0};
# endif
e;

	m = t==DOUBLE || t==FLOAT;
	ml = tl==DOUBLE || tl==FLOAT;

	if (m==ml || logop(p->in.left->in.op)) return;

	p->in.op = CALL;
	p->in.right = p->in.left;

	/* put function name in sumacc/cc/ccom/mac2defs   444      0     12        1740  3470501547  10225 /*	68000 Registers */

	/* registers */
# define D0 0
# define D1 1
# define D2 2
# define D3 3
# define D4 4
# define D5 5
# define D6 6
# define D7 7
# define A0 8
# define A1 9
# define A2 10
# define A3 11
# define A4 12
# define A5 13
# define A6 14
# define SP 15

# define SAVEREGION 8 /* number of bytes for save area */

# define BYTEOFF(x) ((x)&01)
# define wdal(k) (BYTEOFF(k)==0)
# define BITOOR(x) ((x)>>3)  /* bit offset to oreg offset */

# define REGSZ 16

# define TMPREG A6


# define STOARG(p)     /* just evaluate the arguments, and be done with it... */
# define STOFARG(p)
# define STOSTARG(p)
# define genfcall(a,b) gencall(a,b)


	/* shape for constants between -128 and 127 */
# define SCCON (SPECIAL+100)
	/* shape for constants between 0 and 32767 */
# define SICON (SPECIAL+101)
	/* shape for constants between 1 and 8 */
# define S8CON (SPECIAL+102)

# define MYREADER(p) myreader(p)
extern int fltused;
	/* calls can be nested on the 68000 */
# define NESTCALLS
n.op == ICON && p->in.name[0]=='sumacc/cc/ccom/macdefs   444      0     12        2570  3470501550  10137 # define makecc(val,i)  lastcon = i ? (val<<8)|lastcon : val  

# define  ARGINIT 64
# define  AUTOINIT 0

# define  SZCHAR 8
# define  SZINT 32
# define  SZFLOAT 32
# define  SZDOUBLE 64
# define  SZLONG 32
# define  SZSHORT 16
# define  SZPOINT 32

# define ALCHAR 8
# define ALINT 16
# define ALFLOAT 16
# define ALDOUBLE 16
# define ALLONG 16
# define ALSHORT 16
# define ALPOINT 16
# define ALSTRUCT 16
# define ALSTACK 16

/*	size in which constants are converted */
/*	should be long if feasable */

# define CONSZ long
#ifdef BOOTSTRAP
# define CONFMT "%d"
#else
# define CONFMT "%Ld"
#endif

/*	size in which offsets are kept
/*	should be large enough to cover address space in bits
*/

# define OFFSZ long

/* 	character set macro */

# define  CCTRANS(x) x

/* register cookie for stack poINTer */

# define  STKREG 14
# define ARGREG 14

/*	maximum and minimum register variables */

# define MAXRVAR 7
# define MINRVAR 2

	/* various standard pieces of code are used */
# define STDPRTREE
# define LABFMT ".L%d"

/* definition indicates automatics and/or temporaries
   are on a negative growing stack */

# define BACKAUTO
# define BACKTEMP

# ifndef FORT
# define ONEPASS
# endif

# ifndef FORT
# define EXIT dexit
# endif

# define ENUMSIZE(high,low) INT

# ifndef Stanford
# define STACKPROBE		/* stick stack probe instructions in */
				/*  in procedure prolog. */
# endif Stanford
ON,	TANY,

DEFINCDEC,	ASG MINUS,	0,
	ASG MINUS,	SANY,	TANY,
		REG,	SANY,	TANY,
		ICON,	SANY,	TANY,

TSOREG,	1,	0,
	UNARY MUL,	SANY,	TANYsumacc/cc/ccom/makefile   444      0     12         352  3470501550  10266 # Master makefile for the 68000 compiler

t:
		@make -f makefile_t
		./ccom68 test.c >test.s

o:
		@make -f makefile_o

b:
		@make -f makefile_b

clean:
		rm -f *.s *.o *.b *BAK *CKP ccom ccom68

install:
	@make -f makefile_t install
ine  SZPOINT 32

# define ALCHAR 8
# define ALINT 16
# define ALFLOAT 16
# define ALDOUBLE 16
# define ALLONG 16
# define ALSHORT 16
# define ALPOINT 16
# define ALSTRUCT 16
# define ALSTACK 16

/*	size in which constants are converted */
/*	should be long if feasable */

# defsumacc/cc/ccom/makefile_b   444      0     12         637  3470501550  10575 # Makefile for 68000 compiler - Vax compiler making 68000 version

.SUFFIXES:	.c .b

CFLAGS =	-c -DFLEXNAMES

BFILES =	cgram.b xdefs.b scan.b pftn.b trees.b optim.b code.b local.b\
		reader.b local2.b order.b match.b allo.b comm1.b table.b

DEST	=	.
#DEST	=	../../../bin

ccom:	 	$(BFILES)
		cc68 -r -n -s -o $(DEST)/ccom $(BFILES)

.c.b:
		cc68 $(CFLAGS) $*.c

cgram.c:	cgram.y
		yacc cgram.y
		mv y.tab.c cgram.c
e ALSTACK 16

/*	size in which constants are converted */
/*	should be long if feasable */

# defsumacc/cc/ccom/makefile_o   444      0     12         546  3470501550  10611 # Native Unix version of 68000 compiler makefile

.SUFFIXES:	.c .o

CFLAGS =	-c -DFLEXNAMES

OFILES =	cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o\
		reader.o local2.o order.o match.o allo.o comm1.o table.o

ccom:		$(OFILES)
		cc -o ../../../bin/ccom $(OFILES)

.c.o:
		cc $(CFLAGS) $*.c

cgram.c:	cgram.y
		yacc cgram.y
		mv y.tab.c cgram.c
.c

cgram.c:	cgram.y
		yacc cgram.y
		mv y.tab.c cgram.c
e ALSTACK 16

/*	size in which constants are converted */
/*	should be long if feasable */

# defsumacc/cc/ccom/makefile_t   444      0     12         725  3470501550  10615 # Cross version of 68000 Compiler makefile

.SUFFIXES:	.c .o

CFLAGS =	-c -O -I/usr/sun/include -DBOOTSTRAP -DFLEXNAMES -DStanford

OFILES =	cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o\
		reader.o local2.o order.o match.o allo.o comm1.o table.o

DEST	=	.

BINDIR	= 	/usr/sun/bin

ccom68:		$(OFILES)
		cc -o $(DEST)/ccom68 $(OFILES)

.c.o:
		cc $(CFLAGS) $*.c

cgram.c:	cgram.y
		yacc cgram.y
		mv y.tab.c cgram.c

install: ccom68
		cp ccom68 $(BINDIR)
 */
/*	should be long if feasable */

# defsumacc/cc/ccom/manifest   444      0     12       15264  3470501551  10370 #ifdef BOOTSTRAP
#include "/usr/include/stdio.h"
#else
#include <stdio.h>
#endif

/*	manifest constant file for the lex/yacc interface */

# define ERROR 1
# define NAME 2
# define STRING 3
# define ICON 4
# define FCON 5
# define PLUS 6
# define MINUS 8
# define MUL 11
# define AND 14
# define OR 17
# define ER 19
# define QUEST 21
# define COLON 22
# define ANDAND 23
# define OROR 24

/*	special interfaces for yacc alone */
/*	These serve as abbreviations of 2 or more ops:
	ASOP	=, = ops
	RELOP	LE,LT,GE,GT
	EQUOP	EQ,NE
	DIVOP	DIV,MOD
	SHIFTOP	LS,RS
	ICOP	ICR,DECR
	UNOP	NOT,COMPL
	STROP	DOT,STREF

	*/
# define ASOP 25
# define RELOP 26
# define EQUOP 27
# define DIVOP 28
# define SHIFTOP 29
# define INCOP 30
# define UNOP 31
# define STROP 32

/*	reserved words, etc */
# define TYPE 33
# define CLASS 34
# define STRUCT 35
# define RETURN 36
# define GOTO 37
# define IF 38
# define ELSE 39
# define SWITCH 40
# define BREAK 41
# define CONTINUE 42
# define WHILE 43
# define DO 44
# define FOR 45
# define DEFAULT 46
# define CASE 47
# define SIZEOF 48
# define ENUM 49


/*	little symbols, etc. */
/*	namely,

	LP	(
	RP	)

	LC	{
	RC	}

	LB	[
	RB	]

	CM	,
	SM	;

	*/

# define LP 50
# define RP 51
# define LC 52
# define RC 53
# define LB 54
# define RB 55
# define CM 56
# define SM 57
# define ASSIGN 58

/*	END OF YACC */

/*	left over tree building operators */
# define COMOP 59
# define DIV 60
# define MOD 62
# define LS 64
# define RS 66
# define DOT 68
# define STREF 69
# define CALL 70
# define FORTCALL 73
# define NOT 76
# define COMPL 77
# define INCR 78
# define DECR 79
# define EQ 80
# define NE 81
# define LE 82
# define LT 83
# define GE 84
# define GT 85
# define ULE 86
# define ULT 87
# define UGE 88
# define UGT 89
# define SETBIT 90
# define TESTBIT 91
# define RESETBIT 92
# define ARS 93
# define REG 94
# define OREG 95
# define CCODES 96
# define FREE 97
# define STASG 98
# define STARG 99
# define STCALL 100

/*	some conversion operators */
# define FLD 103
# define SCONV 104
# define PCONV 105
# define PMCONV 106
# define PVCONV 107

/*	special node operators, used for special contexts */
# define FORCE 108
# define CBRANCH 109
# define INIT 110
# define CAST 111

/*	node types */
# define LTYPE 02
# define UTYPE 04
# define BITYPE 010

	/* DSIZE is the size of the dope array */
# define DSIZE CAST+1

/*	type names, used in symbol table building */
# define TNULL PTR    /* pointer to UNDEF */
# define TVOID FTN	/* function returning UNDEF (for void) */
# define UNDEF 0
# define FARG 1
# define CHAR 2
# define SHORT 3
# define INT 4
# define LONG 5
# define FLOAT 6
# define DOUBLE 7
# define STRTY 8
# define UNIONTY 9
# define ENUMTY 10
# define MOETY 11
# define UCHAR 12
# define USHORT 13
# define UNSIGNED 14
# define ULONG 15

# define ASG 1+
# define UNARY 2+
# define NOASG (-1)+
# define NOUNARY (-2)+

/*	various flags */
# define NOLAB (-1)

/* type modifiers */

# define PTR  020
# define FTN  040
# define ARY  060

/* type packing constants */

# define TMASK 060
# define TMASK1 0300
# define TMASK2  0360
# define BTMASK 017
# define BTSHIFT 4
# define TSHIFT 2

/*	macros	*/

# define MODTYPE(x,y) x = (x&(~BTMASK))|y  /* set basic type of x to y */
# define BTYPE(x)  (x&BTMASK)   /* basic type of x */
# define ISUNSIGNED(x) ((x)<=ULONG&&(x)>=UCHAR)
# define UNSIGNABLE(x) ((x)<=LONG&&(x)>=CHAR)
# define ENUNSIGN(x) ((x)+(UNSIGNED-INT))
# define DEUNSIGN(x) ((x)+(INT-UNSIGNED))
# define ISPTR(x) ((x&TMASK)==PTR)
# define ISFTN(x)  ((x&TMASK)==FTN)  /* is x a function type */
# define ISARY(x)   ((x&TMASK)==ARY)   /* is x an array type */
# define INCREF(x) (((x&~BTMASK)<<TSHIFT)|PTR|(x&BTMASK))
# define DECREF(x) (((x>>TSHIFT)&~BTMASK)|(x&BTMASK))
# define SETOFF(x,y)   if( x%y != 0 ) x = ( (x/y + 1) * y)
		/* advance x to a multiple of y */
# define NOFIT(x,y,z)   ( (x%z + y) > z )
		/* can y bits be added to x without overflowing z */
	/* pack and unpack field descriptors (size and offset) */
# define PKFIELD(s,o) ((o<<6)|s)
# define UPKFSZ(v)  (v&077)
# define UPKFOFF(v) (v>>6)

/*	operator information */

# define TYFLG 016
# define ASGFLG 01
# define LOGFLG 020

# define SIMPFLG 040
# define COMMFLG 0100
# define DIVFLG 0200
# define FLOFLG 0400
# define LTYFLG 01000
# define CALLFLG 02000
# define MULFLG 04000
# define SHFFLG 010000
# define ASGOPFLG 020000

# define SPFLG 040000

#define optype(o) (dope[o]&TYFLG)
#define asgop(o) (dope[o]&ASGFLG)
#define logop(o) (dope[o]&LOGFLG)
#define callop(o) (dope[o]&CALLFLG)

/*	table sizes	*/

# define BCSZ 100 /* size of the table to save break and continue labels */
# define SYMTSZ 1600 /* size of the symbol table (was 550) */
# define DIMTABSZ 2000 /* size of the dimension/size table (was 800) */
# define PARAMSZ 150 /* size of the parameter stack */
# ifndef FORT
# define TREESZ 350 /* space for building parse tree */
# else
# define TREESZ 1000
# endif
# define SWITSZ 250 /* size of switch table */

#ifndef FLEXNAMES
# define NCHNAM 8  /* number of characters in a name */
#else
char *hash();
char *savestr();
char *tstr();
int tstrused;
char *tstrbuf[], **curtstr;
#define	freetstr()	curtstr = tstrbuf, tstrused = 0
#endif

/*	common defined variables */

extern int nerrors;  /* number of errors seen so far */

typedef union ndu NODE;
typedef unsigned int TWORD;
# define NIL (NODE *)0
extern int dope[];  /* a vector containing operator information */
extern char *opst[];  /* a vector containing names for ops */

# ifdef ONEPASS
	/* in one-pass operation, define the tree nodes */

union ndu {

	struct {
		int op;
		int rall;
		TWORD type;
		int su;
#ifndef FLEXNAMES
		char name[NCHNAM];
#else
		char *name;
		int stalign;
#endif
		NODE *left;
		NODE *right;
		}in; /* interior node */
	
	struct {
		int op;
		int rall;
		TWORD type;
		int su;
#ifndef FLEXNAMES
		char name[NCHNAM];
#else
		char *name;
		int stalign;
#endif
		CONSZ lval;
		int rval;
		}tn; /* terminal node */
	
	struct {
		int op, rall;
		TWORD type;
		int su;
		int label;  /* for use with branching */
		}bn; /* branch node */

	struct {
		int op, rall;
		TWORD type;
		int su;
		int stsize;  /* sizes of structure objects */
		int stalign;  /* alignment of structure objects */
		}stn; /* structure node */

	struct {
		int op;
		int cdim;
		TWORD type;
		int csiz;
		}fn; /* front node */
	
	struct {
		/* this structure is used when a floating point constant
		   is being computed */
		int op;
		int cdim;
		TWORD type;
		int csiz;
		double dval;
		}fpn; /* floating point node */

	};
# endif
# ifdef BUG2
# define BUG1
# endif
# ifdef BUG3
# define BUG2
# define BUG1
# endif
# ifdef BUG4
# define BUG1
# define BUG2
# define BUG3
# endif
# ifndef ONEPASS

# ifndef EXPR
# define EXPR '.'
# endif
# ifndef BBEG
# define BBEG '['
# endif
# ifndef BEND
# define BEND ']'
# endif

# endif
ne USHORT 13
# define UNSIGNED 14
# define ULONG 15

# define ASG 1+
# define UNARY 2+
# define NOASG (-1)+
# define NOUNARY (-2)+

/*	various flags */
# define NOLAB (-1)

/* type modifiers */

# define PTR  020
# define FTN  040
# define ARY  060

/* type packing constants */

# define TMASK 060
# define TMASK1 0300
# define TMAsumacc/cc/ccom/match.c   444      0     12       32066  3470501551  10076 # include "mfile2"

/* WIN - VRP's Short field fix incorporated into LFL's version July 1982 */

extern xdebug;

int fldsz, fldshf, fldtyp, ty;

static int mamask[] = { /* masks for matching dope with shapes */
	SIMPFLG,		/* OPSIMP */
	SIMPFLG|ASGFLG,		/* ASG OPSIMP */
	COMMFLG,	/* OPCOMM */
	COMMFLG|ASGFLG,	/* ASG OPCOMM */
	MULFLG,		/* OPMUL */
	MULFLG|ASGFLG,	/* ASG OPMUL */
	DIVFLG,		/* OPDIV */
	DIVFLG|ASGFLG,	/* ASG OPDIV */
	UTYPE,		/* OPUNARY */
	TYFLG,		/* ASG OPUNARY is senseless */
	LTYPE,		/* OPLEAF */
	TYFLG,		/* ASG OPLEAF is senseless */
	0,		/* OPANY */
	ASGOPFLG|ASGFLG,	/* ASG OPANY */
	LOGFLG,		/* OPLOG */
	TYFLG,		/* ASG OPLOG is senseless */
	FLOFLG,		/* OPFLOAT */
	FLOFLG|ASGFLG,	/* ASG OPFLOAT */
	SHFFLG,		/* OPSHFT */
	SHFFLG|ASGFLG,	/* ASG OPSHIFT */
	SPFLG,		/* OPLTYPE */
	TYFLG,		/* ASG OPLTYPE is senseless */
	};

int sdebug = 0;

tshape( p, shape ) NODE *p; {
	/* return true if shape is appropriate for the node p
	   side effect for SFLD is to set up fldsz,etc */
	register o, mask;

	o = p->in.op;

	if( sdebug ){
		printf( "tshape( %o, %o), op = %d\n", p, shape, o );
		}

	if( shape & SPECIAL ){

		switch( shape ){

		case SZERO:
		case SONE:
		case SMONE:
			if( o != ICON || p->in.name[0] ) return(0);
			if( p->tn.lval == 0 && shape == SZERO ) return(1);
			else if( p->tn.lval == 1 && shape == SONE ) return(1);
			else if( p->tn.lval == -1 && shape == SMONE ) return(1);
			else return(0);

		default:
# ifdef MULTILEVEL
			if( shape & MULTILEVEL )
				return( mlmatch(p,shape,0) );
			else
# endif
			return( special( p, shape ) );
			}
		}

	if( shape & SANY ) return(1);

	if( (shape&INTEMP) && shtemp(p) ) return(1);

	if( (shape&SWADD) && (o==NAME||o==OREG) ){
		if( BYTEOFF(p->tn.lval) ) return(0);
		}

	switch( o ){

	case NAME:
		return( shape&SNAME );
	case ICON:
		mask = SCON;
		return( shape & mask );

	case FLD:
		if( shape & SFLD ){
			if( !flshape( p->in.left ) ) return(0);
			/* it is a FIELD shape; make side-effects */
			o = p->tn.rval;
			fldsz = UPKFSZ(o);
			fldshf = UPKFOFF(o);
			if (fldsz +fldshf <= 16) {
				ty = USHORT;
				fldtyp = SZSHORT;
			} else {
				ty = ULONG;
				fldtyp = SZLONG;
			}
# ifndef RTOLBYTES
			fldshf = fldtyp - fldsz - UPKFOFF(o);
# endif RTOLBYTES
			return(1);
			}
		return(0);

	case CCODES:
		return( shape&SCC );

	case REG:
		/* distinctions:
		SAREG	any scalar register
		STAREG	any temporary scalar register
		SBREG	any lvalue (index) register
		STBREG	any temporary lvalue register
		*/
		mask = isbreg( p->tn.rval ) ? SBREG : SAREG;
		if( istreg( p->tn.rval ) && busy[p->tn.rval]<=1 ) mask |= mask==SAREG ? STAREG : STBREG;
		return( shape & mask );

	case OREG:
		return( shape & SOREG );

	case UNARY MUL:
		/* return STARNM or STARREG or 0 */
		return( shumul(p->in.left) & shape );

		}

	return(0);
	}

int tdebug = 0;

ttype( t, tword ) TWORD t; {
	/* does the type t match tword */

	if( tword & TANY ) return(1);

	if( tdebug ){
		printf( "ttype( %o, %o )\n", t, tword );
		}
	if( ISPTR(t) && (tword&TPTRTO) ) {
		do {
			t = DECREF(t);
		} while ( ISARY(t) );
			/* arrays that are left are usually only
			   in structure references... */
		return( ttype( t, tword&(~TPTRTO) ) );
		}
	if( t != BTYPE(t) ) return( tword & TPOINT ); /* TPOINT means not simple! */
	if( tword & TPTRTO ) return(0);

	switch( t ){

	case CHAR:
		return( tword & TCHAR );
	case SHORT:
		return( tword & TSHORT );
	case STRTY:
	case UNIONTY:
		return( tword & TSTRUCT );
	case INT:
		return( tword & TINT );
	case UNSIGNED:
		return( tword & TUNSIGNED );
	case USHORT:
		return( tword & TUSHORT );
	case UCHAR:
		return( tword & TUCHAR );
	case ULONG:
		return( tword & TULONG );
	case LONG:
		return( tword & TLONG );
	case FLOAT:
		return( tword & TFLOAT );
	case DOUBLE:
		return( tword & TDOUBLE );
		}

	return(0);
	}

struct optab *rwtable;

struct optab *opptr[DSIZE];

setrew(){
	/* set rwtable to first value which allows rewrite */
	register struct optab *q;
	register int i;

# ifdef MULTILEVEL
	/* also initialize multi-level tree links */
	mlinit();
# endif

	for( q = table; q->op != FREE; ++q ){
		if( q->needs == REWRITE ){
			rwtable = q;
			goto more;
			}
		}
	cerror( "bad setrew" );


	more:
	for( i=0; i<DSIZE; ++i ){
		if( dope[i] ){ /* there is an op... */
			for( q=table; q->op != FREE; ++q ){
				/*  beware; things like LTYPE that match
				    multiple things in the tree must
				    not try to look at the NIL at this
				    stage of things!  Put something else
				    first in table.c  */
				/* at one point, the operator matching was 15% of the
				    total comile time; thus, the function
				    call that was here was removed...
				*/

				if( q->op < OPSIMP ){
					if( q->op==i ) break;
					}
				else {
					register opmtemp;
					if((opmtemp=mamask[q->op - OPSIMP])&SPFLG){
						if( i==NAME || i==ICON || i==OREG ) break;
						else if( shltype( i, NIL ) ) break;
						}
					else if( (dope[i]&(opmtemp|ASGFLG)) == opmtemp ) break;
					}
				}
			opptr[i] = q;
			}
		}
	}

match( p, cookie ) NODE *p; {
	/* called by: order, gencall
	   look for match in table and generate code if found unless
	   entry specified REWRITE.
	   returns MDONE, MNOPE, or rewrite specification from table */

	register struct optab *q;
	register NODE *r;

	rcount();
	if( cookie == FORREW ) q = rwtable;
	else q = opptr[p->in.op];

	for( ; q->op != FREE; ++q ){

		/* at one point the call that was here was over 15% of the total time;
		    thus the function call was expanded inline */
		if( q->op < OPSIMP ){
			if( q->op!=p->in.op ) continue;
			}
		else {
			register opmtemp;
			if((opmtemp=mamask[q->op - OPSIMP])&SPFLG){
				if( p->in.op!=NAME && p->in.op!=ICON && p->in.op!= OREG &&
					! shltype( p->in.op, p ) ) continue;
				}
			else if( (dope[p->in.op]&(opmtemp|ASGFLG)) != opmtemp ) continue;
			}

		if( !(q->visit & cookie ) ) continue;
		r = getlr( p, 'L' );			/* see if left child matches */
		if( !tshape( r, q->lshape ) ) continue;
		if( !ttype( r->in.type, q->ltype ) ) continue;
		r = getlr( p, 'R' );			/* see if right child matches */
		if( !tshape( r, q->rshape ) ) continue;
		if( !ttype( r->in.type, q->rtype ) ) continue;

			/* REWRITE means no code from this match but go ahead
			   and rewrite node to help future match */
		if( q->needs & REWRITE ) return( q->rewrite );
		if( !allo( p, q ) ) continue;			/* if can't generate code, skip entry */

		/* resources are available */

		expand( p, cookie, q->cstring );		/* generate code */
		reclaim( p, q->rewrite, cookie );

		return(MDONE);

		}

	return(MNOPE);
	}

int rtyflg = 0;

expand( p, cookie, cp ) NODE *p;  register char *cp; {
	/* generate code by interpreting table entry */

	CONSZ val;

	rtyflg = 0;

	for( ; *cp; ++cp ){
		switch( *cp ){

		default:
			PUTCHAR( *cp );
			continue;  /* this is the usual case... */

		case 'T':
			/* rewrite register type is suppressed */
			rtyflg = 1;
			continue;

		case 'Z':  /* special machine dependent operations */
			zzzcode( p, *++cp );
			continue;

		case 'F':  /* this line deleted if FOREFF is active */
			if( cookie & FOREFF ) while( *++cp != '\n' ) ; /* VOID */
			continue;

		case 'S':  /* field size */
			printf( "%d", fldsz );
			continue;

		case 'H':  /* field shift */
			printf( "%d", fldshf );
			continue;

		case 'Y':  /* field type */
			printf( "%c", ty==USHORT? 'w' : 'l');
			continue;

		case 'M':  /* field mask */
		case 'N':  /* complement of field mask */
			val = 1;
			val <<= fldsz;
			--val;
			val <<= fldshf;
			adrcon( *cp=='M' ? val : ~val );
			continue;

		case 'L':  /* output special label field */
			printf( "%d", p->bn.label );
			continue;

		case 'O':  /* opcode string */
			hopcode( *++cp, p->in.op );
			continue;

		case 'B':  /* byte offset in word */
			val = getlr(p,*++cp)->tn.lval;
			val = BYTEOFF(val);
			printf( CONFMT, val );
			continue;

		case 'C': /* for constant value only */
			conput( getlr( p, *++cp ) );
			continue;

		case 'I': /* in instruction */
			insput( getlr( p, *++cp ) );
			continue;

		case 'A': /* address of */
			adrput( getlr( p, *++cp ) );
			continue;

		case 'U': /* for upper half of address, only */
			upput( getlr( p, *++cp ) );
			continue;

			}

		}

	}

NODE *
getlr( p, c ) NODE *p; {

	/* return the pointer to the left or right side of p, or p itself,
	   depending on the optype of p */

	switch( c ) {

	case '1':
	case '2':
	case '3':
		return( &resc[c-'1'] );

	case 'L':
		return( optype( p->in.op ) == LTYPE ? p : p->in.left );

	case 'R':
		return( optype( p->in.op ) != BITYPE ? p : p->in.right );

		}
	cerror( "bad getlr: %c", c );
	/* NOTREACHED */
	}
# ifdef MULTILEVEL

union mltemplate{
	struct ml_head{
		int tag; /* identifies class of tree */
		int subtag; /* subclass of tree */
		union mltemplate * nexthead; /* linked by mlinit() */
		} mlhead;
	struct ml_node{
		int op; /* either an operator or op description */
		int nshape; /* shape of node */
		/* both op and nshape must match the node.
		 * where the work is to be done entirely by
		 * op, nshape can be SANY, visa versa, op can
		 * be OPANY.
		 */
		int ntype; /* type descriptor from mfile2 */
		} mlnode;
	};

# define MLSZ 30

extern union mltemplate mltree[];
int mlstack[MLSZ];
int *mlsp; /* pointing into mlstack */
NODE * ststack[MLSZ];
NODE **stp; /* pointing into ststack */

mlinit(){
	union mltemplate **lastlink;
	register union mltemplate *n;
	register mlop;

	lastlink = &(mltree[0].nexthead);
	n = &mltree[0];
	for( ; (n++)->mlhead.tag != 0;
		*lastlink = ++n, lastlink = &(n->mlhead.nexthead) ){
		if( xdebug )printf("mlinit: %d\n",(n-1)->mlhead.tag);
	/* wander thru a tree with a stack finding
	 * its structure so the next header can be located.
	 */
		mlsp = mlstack;

		for( ;; ++n ){
			if( (mlop = n->mlnode.op) < OPSIMP ){
				switch( optype(mlop) ){

					default:
						cerror("(1)unknown opcode: %o",mlop);
					case BITYPE:
						goto binary;
					case UTYPE:
						break;
					case LTYPE:
						goto leaf;
					}
				}
			else{
				if( mamask[mlop-OPSIMP] &
					(SIMPFLG|COMMFLG|MULFLG|DIVFLG|LOGFLG|FLOFLG|SHFFLG) ){
				binary:
					*mlsp++ = BITYPE;
					}
				else if( ! (mamask[mlop-OPSIMP] & UTYPE) ){/* includes OPANY */

				leaf:
					if( mlsp == mlstack )
						goto tree_end;
					else if ( *--mlsp != BITYPE )
						cerror("(1)bad multi-level tree descriptor around mltree[%d]",
						n-mltree);
					}
				}
			}
		tree_end: /* n points to final leaf */
		;
		}
		if( xdebug > 3 ){
			printf("mltree={\n");
			for( n= &(mltree[0]); n->mlhead.tag != 0; ++n)
				printf("%o: %d, %d, %o,\n",n,
				n->mlhead.tag,n->mlhead.subtag,n->mlhead.nexthead);
			printf("	}\n");
			}
	}

mlmatch( subtree, target, subtarget ) NODE * subtree; int target,subtarget;{
	/*
	 * does subtree match a multi-level tree with
	 * tag "target"?  Return zero on failure,
	 * non-zero subtag on success (or MDONE if
	 * there is a zero subtag field).
	 */
	union mltemplate *head; /* current template header */
	register union mltemplate *n; /* node being matched */
	NODE * st; /* subtree being matched */
	register int mlop;

	if( xdebug ) printf("mlmatch(%o,%d)\n",subtree,target);
	for( head = &(mltree[0]); head->mlhead.tag != 0;
		head=head->mlhead.nexthead){
		if( xdebug > 1 )printf("mlmatch head(%o) tag(%d)\n",
			head->mlhead.tag);
		if( head->mlhead.tag != target )continue;
		if( subtarget && head->mlhead.subtag != subtarget)continue;
		if( xdebug ) printf("mlmatch for %d\n",target);

		/* potential for match */

		n = head + 1;
		st = subtree;
		stp = ststack;
		mlsp = mlstack;
		/* compare n->op, ->nshape, ->ntype to
		 * the subtree node st
		 */
		for( ;; ++n ){ /* for each node in multi-level template */
			/* opmatch */
			if( n->op < OPSIMP ){
				if( st->op != n->op )break;
				}
			else {
				register opmtemp;
				if((opmtemp=mamask[n->op-OPSIMP])&SPFLG){
					if(st->op!=NAME && st->op!=ICON && st->op!=OREG && 
						! shltype(st->op,st)) break;
					}
				else if((dope[st->op]&(opmtemp|ASGFLG))!=opmtemp) break;
				}
			/* check shape and type */

			if( ! tshape( st, n->mlnode.nshape ) ) break;
			if( ! ttype( st->type, n->mlnode.ntype ) ) break;

			/* that node matched, let's try another */
			/* must advance both st and n and halt at right time */

			if( (mlop = n->mlnode.op) < OPSIMP ){
				switch( optype(mlop) ){

					default:
						cerror("(2)unknown opcode: %o",mlop);
					case BITYPE:
						goto binary;
					case UTYPE:
						st = st->left;
						break;
					case LTYPE:
						goto leaf;
					}
				}
			else{
				if( mamask[mlop - OPSIMP] &
					(SIMPFLG|COMMFLG|MULFLG|DIVFLG|LOGFLG|FLOFLG|SHFFLG) ){
				binary:
					*mlsp++ = BITYPE;
					*stp++ = st;
					st = st->left;
					}
				else if( ! (mamask[mlop-OPSIMP] & UTYPE) ){/* includes OPANY */

				leaf:
					if( mlsp == mlstack )
						goto matched;
					else if ( *--mlsp != BITYPE )
						cerror("(2)bad multi-level tree descriptor around mltree[%d]",
						n-mltree);
					st = (*--stp)->right;
					}
				else /* UNARY */ st = st->left;
				}
			continue;

			matched:
			/* complete multi-level match successful */
			if( xdebug ) printf("mlmatch() success\n");
			if( head->mlhead.subtag == 0 ) return( MDONE );
			else {
				if( xdebug )printf("\treturns %d\n",
					head->mlhead.subtag );
				return( head->mlhead.subtag );
				}
			}
		}
	return( 0 );
	}
# endif
nto mlstack */
NODE * ststack[MLSZ];
NODE **stp; /* pointing into ststack */

mlinit(){
	union mltemplate **lastlink;
	register union mltemplate *n;
	register mlop;

	lastlink = &(mltree[0].nexthead);
	n = &mltree[0];
	for( ; (n++)->mlhead.tag != 0;
		*lastlink = ++n, lastlink = &(n->mlhead.nexthead) ){
		if( xdebug )printf("mlinit: %d\n",(n-1)->mlhead.tag);
	/* wander thru a tree with a stack finding
	 * its structure so the next header can be located.
sumacc/cc/ccom/mfile1   444      0     12       10374  3470501551   7734 
# include "macdefs"
# include "manifest"

/*	storage classes  */
# define SNULL 0
# define AUTO 1
# define EXTERN 2
# define STATIC 3
# define REGISTER 4
# define EXTDEF 5
# define LABEL 6
# define ULABEL 7
# define MOS 8
# define PARAM 9
# define STNAME 10
# define MOU 11
# define UNAME 12
# define TYPEDEF 13
# define FORTRAN 14
# define ENAME 15
# define MOE 16
# define UFORTRAN 17
# define USTATIC 18
	/* field size is ORed in */
# define FIELD 0100
# define FLDSIZ 077
# ifndef BUG1
extern char *scnames();
# endif

/*	location counters */
# define PROG 0
# define DATA 1
# define ADATA 2
# define STRNG 3
# define ISTRNG 4
# define STAB 5


/* symbol table flags */
# define SMOS 01
# define SHIDDEN 02
# define SHIDES 04
# define SSET 010
# define SREF 020
# define SNONUNIQ 040
# define STAG 0100

# ifndef FIXDEF
# define FIXDEF(p)
#endif
# ifndef FIXARG
# define FIXARG(p)
# endif
# ifndef FIXSTRUCT
# define FIXSTRUCT(a,b)
# endif

	/* alignment of initialized quantities */
# ifndef AL_INIT
#	define	AL_INIT ALINT
# endif

struct symtab {
#ifndef FLEXNAMES
	char sname[NCHNAM];
#else
	char *sname;
#endif
	TWORD stype;  /* type word */

	char sclass;  /* storage class */
	char slevel;  /* scope level */
	char sflags;  /* flags for set, use, hidden, mos, etc. */
	int offset;  /* offset or value */
	short dimoff; /* offset into the dimension table */
	short sizoff; /* offset into the size table */
	short suse;  /* line number of last use of the variable */
	};


# ifdef ONEPASS
/* NOPREF must be defined for use in first pass tree machine */
# define NOPREF 020000  /* no preference for register assignment */
#else

union ndu {
	struct {
		int op;
		TWORD type;
		int cdim, csiz;
		}fn; /* front node */
	struct {
		int op;
		TWORD type;
		int cdim, csiz;
		NODE *left;
		NODE * right;
		}in; /* interior node */
	
	struct {
		/* this structure is the same as above,
		   but is used when a value, rather than
		   address, is kept in +left */
		int op;
		TWORD type;
		int cdim, csiz;
		CONSZ lval;
		int rval;
		}tn; /* terminal node */
	
	struct {
		/* this structure is used when a floating point constant
		   is being computed */
		int op;
		TWORD type;
		int cdim, csiz;
		double dval;
		}fpn; /* floating point node */

	};
# endif

struct sw {
	CONSZ sval;
	int slab;
	};

extern struct sw swtab[];
extern struct sw *swp;
extern int swx;

extern int ftnno;
extern int blevel;
extern int instruct, stwart;

extern int lineno, nerrors;
typedef union {
	int intval;
	NODE * nodep;
	} YYSTYPE;
extern YYSTYPE yylval;

extern CONSZ lastcon;
extern double dcon;

extern char ftitle[];
extern struct symtab stab[];
extern int curftn;
extern int curclass;
extern int curdim;
extern int dimtab[];
extern int paramstk[];
extern int paramno;
extern int autooff, argoff, strucoff;
extern int regvar;
extern int minrvar;
extern int brkflag;
extern char yytext[];

extern int strflg;

extern OFFSZ inoff;

extern int reached;

/*	tunnel to buildtree for name id's */

extern int idname;

extern NODE node[];
extern NODE *lastfree;

extern int cflag, hflag, pflag;

/* various labels */
extern int brklab;
extern int contlab;
extern int flostat;
extern int retlab;
extern int retstat;
extern int asavbc[], *psavbc;

/*	flags used in structures/unions */

# define SEENAME 01
# define INSTRUCT 02
# define INUNION 04
# define FUNNYNAME 010
# define TAGNAME 020

/*	flags used in the (elementary) flow analysis ... */

# define FBRK 02
# define FCONT 04
# define FDEF 010
# define FLOOP 020

/*	flags used for return status */

# define RETVAL 1
# define NRETVAL 2

/*	used to mark a constant with no name field */

# define NONAME 040000

	/* mark an offset which is undefined */

# define NOOFFSET (-10201)

/*	declarations of various functions */

extern NODE
	*buildtree(),
	*bdty(),
	*mkty(),
	*rstruct(),
	*dclstruct(),
	*getstr(),
	*tymerge(),
	*stref(),
	*offcon(),
	*bcon(),
	*bpsize(),
	*convert(),
	*pconvert(),
	*oconvert(),
	*ptmatch(),
	*tymatch(),
	*makety(),
	*block(),
	*doszof(),
	*talloc(),
	*optim(),
	*strargs(),
	*clocal();

OFFSZ	tsize(),
	psize();

TWORD	types();


double atof();

char *exname(), *exdcon();

# define checkst(x)

# ifndef CHARCAST
/* to make character constants into character connstants */
/* this is a macro to defend against cross-compilers, etc. */
# define CHARCAST(x) (char)(x)
# endif

rintf("mltree={\n");
			for( n= &(mltree[0]); n->mlhead.tag != 0; ++n)
				printf("%o: %d, %d, %o,\n",n,
				n->mlhead.tag,n->mlhead.subtag,n->mlhead.nexthead);
			printf("	}\n");
			}
	}

mlmatch( subtree, target, subtarget ) NODE * subtree; int target,subtarsumacc/cc/ccom/mfile2   444      0     12       12545  3470501551   7737 # include "macdefs"
# include "mac2defs"
# include "manifest"

# ifdef ONEPASS

/*	bunch of stuff for putting the passes together... */
# define crslab crs2lab
# define where where2
# define xdebug x2debug
# define tdebug t2debug
# define deflab def2lab
# define edebug e2debug
# define eprint e2print
# define getlab get2lab
# define filename ftitle
# endif

/*	cookies, used as arguments to codgen */

# define FOREFF 01 /* compute for effects only */
# define INAREG 02 /* compute into a register */
# define INTAREG 04 /* compute into a scratch register */
# define INBREG 010 /* compute into a lvalue register */
# define INTBREG 020 /* compute into a scratch lvalue register */
# define FORCC 040 /* compute for condition codes only */
# define INTEMP 010000 /* compute into a temporary location */
# define FORARG 020000 /* compute for an argument of a function */
# define FORREW 040000 /* search the table, looking for a rewrite rule */

	/* OP descriptors */
	/* the ASG operator may be used on some of these */

# define OPSIMP 010000    /* +, -, &, |, ^ */
# define OPCOMM 010002  /* +, &, |, ^ */
# define OPMUL 010004  /* *, / */
# define OPDIV 010006 /* /, % */
# define OPUNARY 010010  /* unary ops */
# define OPLEAF 010012  /* leaves */
# define OPANY 010014  /* any op... */
# define OPLOG 010016 /* logical ops */
# define OPFLOAT 010020 /* +, -, *, or / (for floats) */
# define OPSHFT 010022  /* <<, >> */
# define OPLTYPE 010024  /* leaf type nodes (e.g, NAME, ICON, etc. ) */

	/* match returns */

# define MNOPE 010000
# define MDONE 010001

	/* shapes */

# define SANY 01	/* same as FOREFF */
# define SAREG 02	/* same as INAREG */
# define STAREG 04	/* same as INTAREG */
# define SBREG 010	/* same as INBREG */
# define STBREG 020	/* same as INTBREG */
# define SCC 040	/* same as FORCC */
# define SNAME 0100
# define SCON 0200
# define SFLD 0400
# define SOREG 01000
# define STARNM 02000
# define STARREG 04000
# define SWADD 040000
# define SPECIAL 0100000
# define SZERO SPECIAL
# define SONE (SPECIAL|1)
# define SMONE (SPECIAL|2)

	/* FORARG and INTEMP are carefully not conflicting with shapes */

	/* types */

# define TCHAR 01
# define TSHORT 02
# define TINT 04
# define TLONG 010
# define TFLOAT 020
# define TDOUBLE 040
# define TPOINT 0100
# define TUCHAR 0200
# define TUSHORT 0400
# define TUNSIGNED 01000
# define TULONG 02000
# define TPTRTO 04000  /* pointer to one of the above */
# define TANY 010000  /* matches anything within reason */
# define TSTRUCT 020000   /* structure or union */

	/* reclamation cookies */

# define RNULL 0    /* clobber result */
# define RLEFT 01
# define RRIGHT 02
# define RESC1 04
# define RESC2 010
# define RESC3 020
# define RESCC 04000
# define RNOP 010000   /* DANGER: can cause loops.. */

	/* needs */

# define NAREG 01
# define NACOUNT 03
# define NAMASK 017
# define NASL 04  /* share left register */
# define NASR 010 /* share right register */
# define NBREG 020
# define NBCOUNT 060
# define NBMASK 0360
# define NBSL 0100
# define NBSR 0200
# define NTEMP 0400
# define NTMASK 07400
# define REWRITE 010000


# define MUSTDO 010000   /* force register requirements */
# define NOPREF 020000  /* no preference for register assignment */


	/* register allocation */

extern int rstatus[];
extern int busy[];

extern struct respref { int cform; int mform; } respref[];

# define isbreg(r) (rstatus[r]&SBREG)
# define istreg(r) (rstatus[r]&(STBREG|STAREG))
# define istnode(p) (p->in.op==REG && istreg(p->tn.rval))

# define TBUSY 01000
# define REGLOOP(i) for(i=0;i<REGSZ;++i)

# define SETSTO(x,y) (stotree=(x),stocook=(y))
extern int stocook;
# define DELAYS 20
extern NODE *deltrees[DELAYS];
extern int deli;   /* mmmmm */

extern NODE *stotree;
extern int callflag;

extern int fregs;

# ifndef ONEPASS
union ndu {

	struct {
		int op;
		int rall;
		TWORD type;
		int su;
#ifndef FLEXNAMES
		char name[NCHNAM];
#else
		char *name;
#endif
		NODE *left;
		NODE *right;
		}in; /* interior node */
	
	struct {
		int op;
		int rall;
		TWORD type;
		int su;
#ifndef FLEXNAMES
		char name[NCHNAM];
#else
		char *name;
#endif
		CONSZ lval;
		int rval;
		}tn; /* terminal node */
	
	struct {
		int op, rall;
		TWORD type;
		int su;
		int label;  /* for use with branching */
		}bn; /* branch node */

	struct {
		int op, rall;
		TWORD type;
		int su;
		int stsize;  /* sizes of structure objects */
		int stalign;  /* alignment of structure objects */
		}stn; /* structure node */

	};
#endif

extern NODE node[];

extern struct optab {
	int op;
	int visit;
	int lshape;
	int ltype;
	int rshape;
	int rtype;
	int needs;
	int rewrite;
	char * cstring;
	}
	table[];

extern NODE resc[];

extern OFFSZ tmpoff;
extern OFFSZ maxoff;
extern OFFSZ baseoff;
extern OFFSZ maxtemp;
extern int maxtreg;
extern int ftnno;
extern int rtyflg;

extern int nrecur;  /* flag to keep track of recursions */

# define NRECUR (10*TREESZ)

extern NODE
	*talloc(),
	*eread(),
	*tcopy(),
	*getlr();

extern CONSZ rdin();

extern int eprint();

extern char *rnames[];

extern int lineno;
extern char filename[];
extern int fldshf, fldsz;
extern int lflag, xdebug, udebug, edebug, odebug, rdebug, radebug, tdebug, sdebug;

#ifndef callchk
#define callchk(x) allchk()
#endif

#ifndef PUTCHAR
# define PUTCHAR(x) putchar(x)
#endif

	/* macros for doing double indexing */
# define R2PACK(x,y) (0200*((x)+1)+y)
# define R2UPK1(x) ((((x)>>7)&0177)-1)
# define R2UPK2(x) ((x)&0177)
# define R2TEST(x) ((x)>=0200)
01000
# define STARNM 02000
# define STARREG 04000
# define SWADD 040000
# define SPECIAL 0100000
# define SZERO SPECIAL
# define SONE (SPECIAL|1)
# definesumacc/cc/ccom/optim.c   444      0     12       10170  3470501551  10122 # include "mfile1"

# define SWAP(p,q) {sp=p; p=q; q=sp;}
# define RCON(p) (p->in.right->in.op==ICON)
# define RO(p) p->in.right->in.op
# define RV(p) p->in.right->tn.lval
# define LCON(p) (p->in.left->in.op==ICON)
# define LO(p) p->in.left->in.op
# define LV(p) p->in.left->tn.lval

int oflag = 0;

NODE *
fortarg( p ) NODE *p; {
	/* fortran function arguments */

	if( p->in.op == CM ){
		p->in.left = fortarg( p->in.left );
		p->in.right = fortarg( p->in.right );
		return(p);
		}

	while( ISPTR(p->in.type) ){
		p = buildtree( UNARY MUL, p, NIL );
		}
	return( optim(p) );
	}

	/* mapping relationals when the sides are reversed */
short revrel[] ={ EQ, NE, GE, GT, LE, LT, UGE, UGT, ULE, ULT };
NODE *
optim(p) register NODE *p; {
	/* local optimizations, most of which are probably machine independent */

	register o, ty;
	NODE *sp;
	int i;
	TWORD t;

	if( (t=BTYPE(p->in.type))==ENUMTY || t==MOETY ) econvert(p);
	if( oflag ) return(p);
	ty = optype( o=p->in.op);
	if( ty == LTYPE ) return(p);

	if( ty == BITYPE ) p->in.right = optim(p->in.right);
	p->in.left = optim(p->in.left);

	/* collect constants */

	switch(o){

	case SCONV:
	case PCONV:
		return( clocal(p) );

	case FORTCALL:
		p->in.right = fortarg( p->in.right );
		break;

	case UNARY AND:
		if( LO(p) != NAME ) cerror( "& error" );

		if( !andable(p->in.left) ) return(p);

		LO(p) = ICON;

		setuleft:
		/* paint over the type of the left hand side with the type of the top */
		p->in.left->in.type = p->in.type;
		p->in.left->fn.cdim = p->fn.cdim;
		p->in.left->fn.csiz = p->fn.csiz;
		p->in.op = FREE;
		return( p->in.left );

	case UNARY MUL:
		if( LO(p) != ICON ) break;
		LO(p) = NAME;
		goto setuleft;

	case MINUS:
		if( !nncon(p->in.right) ) break;
		RV(p) = -RV(p);
		o = p->in.op = PLUS;

	case MUL:
	case PLUS:
	case AND:
	case OR:
	case ER:
		/* commutative ops; for now, just collect constants */
		/* someday, do it right */
		if( nncon(p->in.left) || ( LCON(p) && !RCON(p) ) ) SWAP( p->in.left, p->in.right );
		/* make ops tower to the left, not the right */
		if( RO(p) == o ){
			NODE *t1, *t2, *t3;
			t1 = p->in.left;
			sp = p->in.right;
			t2 = sp->in.left;
			t3 = sp->in.right;
			/* now, put together again */
			p->in.left = sp;
			sp->in.left = t1;
			sp->in.right = t2;
			p->in.right = t3;
			}
		if(o == PLUS && LO(p) == MINUS && RCON(p) && RCON(p->in.left) &&
		  conval(p->in.right, MINUS, p->in.left->in.right)){
			zapleft:
			RO(p->in.left) = FREE;
			LO(p) = FREE;
			p->in.left = p->in.left->in.left;
		}
		if( RCON(p) && LO(p)==o && RCON(p->in.left) && conval( p->in.right, o, p->in.left->in.right ) ){
			goto zapleft;
			}
		else if( LCON(p) && RCON(p) && conval( p->in.left, o, p->in.right ) ){
			zapright:
			RO(p) = FREE;
			p->in.left = makety( p->in.left, p->in.type, p->fn.cdim, p->fn.csiz );
			p->in.op = FREE;
			return( clocal( p->in.left ) );
			}

		/* throw out addition/subtraction by 0 */

		if( o == PLUS || o == MINUS || o == OR || o == ER )
		{
		    if( nncon( p->in.right ) && RV(p) == 0 )
			goto zapright;
		}

		/* change muls to shifts */

		if( o==MUL && nncon(p->in.right) && (i=ispow2(RV(p)))>=0){
			if( i == 0 ){ /* multiplication by 1 */
				goto zapright;
				}
			o = p->in.op = LS;
			p->in.right->in.type = p->in.right->fn.csiz = INT;
			RV(p) = i;
			}

		/* change +'s of negative consts back to - */
		if( o==PLUS && nncon(p->in.right) && RV(p)<0 ){
			RV(p) = -RV(p);
			o = p->in.op = MINUS;
			}
		break;

	case DIV:
		if( nncon( p->in.right ) && p->in.right->tn.lval == 1 ) goto zapright;
		break;

	case EQ:
	case NE:
	case LT:
	case LE:
	case GT:
	case GE:
	case ULT:
	case ULE:
	case UGT:
	case UGE:
		if( !LCON(p) ) break;

		/* exchange operands */

		sp = p->in.left;
		p->in.left = p->in.right;
		p->in.right = sp;
		p->in.op = revrel[p->in.op - EQ ];
		break;

	case ASG PLUS:
	case ASG MINUS:
	case ASG OR:
	case ASG ER:
		if( nncon( p->in.right ) && RV(p) == 0 )
			goto zapright;
		break;

		}

	return(p);
	}

ispow2( c ) CONSZ c; {
	register i;
	if( c <= 0 || (c&(c-1)) ) return(-1);
	for( i=0; c>1; ++i) c >>= 1;
	return(i);
	}

nncon( p ) NODE *p; {
	/* is p a constant without a name */
	return( p->in.op == ICON && p->tn.rval == NONAME );
	}
2 010
# define RESC3 020
# define RESCC 04000
# define RNOP 010000   /* DANGER: can cause loops.. */

	/* needs */

# define NAREG 01
# define NACOUNT 03
# define NAMASK 017
# define NASL 04  /* share left register */
# define NASR 010 /* share right register */
# define NBREG 020
# define NBCOUNT 060
# define NBMASK 0360
# define NBSL 0100
# define NBSR 0200
# define NTEMP 0400
# define Nsumacc/cc/ccom/order.c   444      0     12       40207  3470501551  10111 # include "mfile2"

int fltused = 0;

stoasg( p, o ) register NODE *p; {
	/* should the assignment op p be stored,
	   given that it lies as the right operand of o
	   (or the left, if o==UNARY MUL) */
	return( shltype(p->in.left->in.op, p->in.left ) );

	}

deltest( p ) register NODE *p; {
	/* should we delay the INCR or DECR operation p */
# ifndef MULTILEVEL
	if( p->in.op == INCR && p->in.left->in.op == REG && spsz( p->in.left->in.type, p->in.right->tn.lval ) ){
		/* STARREG */
		return( 0 );
		}
# else
	if( mlmatch(p,DEFINCDEC,INCR) && spsz( p->in.left->in.type, p->in.right->tn.lval ) ){
		/* STARREG */
		return( 0 );
		}
# endif

	p = p->in.left;
	if( p->in.op == UNARY MUL ) p = p->in.left;
	return( p->in.op == NAME || p->in.op == OREG || p->in.op == REG );
	}

mkadrs(p) register NODE *p; {
	register o;

	o = p->in.op;

	if( asgop(o) ){
		if( p->in.left->in.su >= p->in.right->in.su ){
			if( p->in.left->in.op == UNARY MUL ){
				if( p->in.left->in.su > 0 )
					SETSTO( p->in.left->in.left, INTEMP );
				else {
					if( p->in.right->in.su > 0 ) SETSTO( p->in.right, INTEMP );
					else cerror( "store finds both sides trivial" );
					}
				}
			else if( p->in.left->in.op == FLD && p->in.left->in.left->in.op == UNARY MUL ){
				SETSTO( p->in.left->in.left->in.left, INTEMP );
				}
			else { /* should be only structure assignment */
				SETSTO( p->in.left, INTEMP );
				}
			}
		else SETSTO( p->in.right, INTEMP );
		}
	else {
		if( p->in.left->in.su > p->in.right->in.su ){
			SETSTO( p->in.left, INTEMP );
			}
		else {
			SETSTO( p->in.right, INTEMP );
			}
		}
	}

notoff( t, r, off, cp) TWORD t; CONSZ off; char *cp; {
	/* is it legal to make an OREG or NAME entry which has an
	/* offset of off, (from a register of r), if the
	/* resulting thing had type t */

	if ( off>=-32768 && off<=32767 && *cp=='\0' && r>=A0 && r<=SP )
	  return(0);	/* YES */
	return( 1 );  /* NO */
	}

# define max(x,y) ((x)<(y)?(y):(x))
# define min(x,y) ((x)<(y)?(x):(y))


# define ZCHAR 01
# define ZLONG 02
# define ZFLOAT 04

zum( p, zap ) register NODE *p; {
	/* zap Sethi-Ullman number for chars, longs, floats */
	/* in the case of longs, only STARNM's are zapped */
	/* ZCHAR, ZLONG, ZFLOAT are used to select the zapping */

	register su;

	su = p->in.su;

	switch( p->in.type ){

	case CHAR:
	case UCHAR:
		if( !(zap&ZCHAR) ) break;
		if( su==0 && p->in.op!=ICON ) p->in.su = su = 1;
		break;

	case LONG:
	case ULONG:
		if( !(zap&ZLONG) ) break;
		if( p->in.op == UNARY MUL && su == 0 ) p->in.su = su = 2;
		break;

	case FLOAT:
		if( !(zap&ZFLOAT) ) break;
		if( su == 0 ) p->in.su = su = 1;

		}

	return( su );
	}

sucomp( p ) register NODE *p; {

	/* set the su field in the node to the sethi-ullman
	   number, or local equivalent */

	register o, ty, sul, sur;
	register nr;

	ty = optype( o=p->in.op);
	nr = szty( p->in.type );
	p->in.su = 0;

	if( ty == LTYPE ) {
		if( p->in.type==FLOAT ) p->in.su = 1;
		return;
		}
	else if( ty == UTYPE ){
		switch( o ) {
		case UNARY CALL:
		case UNARY STCALL:
			p->in.su = fregs;  /* all regs needed */
			return;

		case UNARY MUL:
			if( shumul( p->in.left ) ) return;

		default:
			p->in.su = max( p->in.left->in.su, nr);
			return;
			}
		}


	/* If rhs needs n, lhs needs m, regular su computation */

	sul = p->in.left->in.su;
	sur = p->in.right->in.su;

	if( o == ASSIGN ){
		asop:  /* also used for +=, etc., to memory */
		if( sul==0 ){
			/* don't need to worry about the left side */
			p->in.su = max( sur, nr );
			}
		else {
			/* right, left address, op */
			if( sur == 0 ){
				/* just get the lhs address into a register, and mov */
				/* the `nr' covers the case where value is in reg afterwards */
				p->in.su = max( sul, nr );
				}
			else {
				/* right, left address, op */
				p->in.su = max( sur, nr+sul );
				}
			}
		return;
		}

	if( o == CALL || o == STCALL ){
		/* in effect, takes all free registers */
		p->in.su = fregs;
		return;
		}

	if( o == STASG ){
		/* right, then left */
		p->in.su = max( max( sul+nr, sur), fregs );
		return;
		}

	if( logop(o) ){
		/* do the harder side, then the easier side, into registers */
		/* left then right, max(sul,sur+nr) */
		/* right then left, max(sur,sul+nr) */
		/* to hold both sides in regs: nr+nr */
		nr = szty( p->in.left->in.type );
		sul = zum( p->in.left, ZLONG|ZCHAR|ZFLOAT );
		sur = zum( p->in.right, ZLONG|ZCHAR|ZFLOAT );
		p->in.su = min( max(sul,sur+nr), max(sur,sul+nr) );
		return;
		}

	if( asgop(o) ){
		/* computed by doing right, doing left address, doing left, op, and store */
		switch( o ) {
		case INCR:
		case DECR:
			/* do as binary op */
			break;

		case ASG PLUS:
		case ASG MINUS:
		case ASG AND:
		case ASG ER:
		case ASG OR:
			if( p->in.type == INT || p->in.type == UNSIGNED || ISPTR(p->in.type) ) goto asop;

		gencase:
		default:
			sur = zum( p->in.right, ZCHAR|ZLONG|ZFLOAT );
			if( sur == 0 ){ /* easy case: if addressable,
				do left value, op, store */
				if( sul == 0 ) p->in.su = nr;
				/* harder: left adr, val, op, store */
				else p->in.su = max( sul, nr+1 );
				}
			else { /* do right, left adr, left value, op, store */
				if( sul == 0 ){  /* right, left value, op, store */
					p->in.su = max( sur, nr+nr );
					}
				else {
					p->in.su = max( sur, max( sul+nr, 1+nr+nr ) );
					}
				}
			return;
			}
		}

	switch( o ){
	case ANDAND:
	case OROR:
	case QUEST:
	case COLON:
	case COMOP:
		p->in.su = max( max(sul,sur), nr);
		return;
		}

	if( ( o==DIV || o==MOD || o==MUL )
	    && p->in.type!=FLOAT && p->in.type!=DOUBLE ) nr = fregs;
	if( o==PLUS || o==MUL || o==OR || o==ER ){
		/* AND is ruined by the hardware */
		/* permute: get the harder on the left */

		register rt, lt;

		if( istnode( p->in.left ) || sul > sur ) goto noswap;  /* don't do it! */

		/* look for a funny type on the left, one on the right */


		lt = p->in.left->in.type;
		rt = p->in.right->in.type;

		if( rt == FLOAT && lt == DOUBLE ) goto swap;

		if( (rt==CHAR||rt==UCHAR) && (lt==INT||lt==UNSIGNED||ISPTR(lt)) ) goto swap;

		if( lt==LONG || lt==ULONG ){
			if( rt==LONG || rt==ULONG ){
				/* if one is a STARNM, swap */
				if( p->in.left->in.op == UNARY MUL && sul==0 ) goto noswap;
				if( p->in.right->in.op == UNARY MUL && p->in.left->in.op != UNARY MUL ) goto swap;
				goto noswap;
				}
			else if( p->in.left->in.op == UNARY MUL && sul == 0 ) goto noswap;
			else goto swap;  /* put long on right, unless STARNM */
			}

		/* we are finished with the type stuff now; if one is addressable,
			put it on the right */
		if( sul == 0 && sur != 0 ){

			NODE *s;
			int ssu;

		swap:
			ssu = sul;  sul = sur; sur = ssu;
			s = p->in.left;  p->in.left = p->in.right; p->in.right = s;
			}
		}
	noswap:

	sur = zum( p->in.right, ZCHAR|ZLONG|ZFLOAT );
	if( sur == 0 ){
		/* get left value into a register, do op */
		p->in.su = max( nr, sul );
		}
	else {
		/* do harder into a register, then easier */
		p->in.su = max( nr+nr, min( max( sul, nr+sur ), max( sur, nr+sul ) ) );
		}
	}

int radebug = 0;

mkrall( p, r ) register NODE *p; {
	/* insure that the use of p gets done with register r; in effect, */
	/* simulate offstar */

	if( p->in.op == FLD ){
		p->in.left->in.rall = p->in.rall;
		p = p->in.left;
		}

	if( p->in.op != UNARY MUL ) return;  /* no more to do */
	p = p->in.left;
	if( p->in.op == UNARY MUL ){
		p->in.rall = r;
		p = p->in.left;
		}
	if( p->in.op == PLUS && p->in.right->in.op == ICON ){
		p->in.rall = r;
		p = p->in.left;
		}
	rallo( p, r );
	}

rallo( p, down ) register NODE *p; {
	/* do register allocation */
	register o, type, down1, down2, ty;

	if( radebug ) printf( "rallo( %o, %o )\n", p, down );

	down2 = NOPREF;
	p->in.rall = down;
	down1 = ( down &= ~MUSTDO );

	ty = optype( o = p->in.op );
	type = p->in.type;


	if( type == DOUBLE || type == FLOAT ){
		if( o == FORCE ) down1 = D0|MUSTDO;
		++fltused;
		}
	else switch( o ) {
	case ASSIGN:	
		down1 = NOPREF;
		down2 = down;
		break;

	case ASG MUL:
	case ASG DIV:
	case ASG MOD:
		/* keep the addresses out of the hair of (r0,r1) */
		if(fregs == 2 ){
			/* lhs in (r0,r1), nothing else matters */
			down1 = D1|MUSTDO;
			down2 = NOPREF;
			break;
			}
		/* at least 3 regs free */
		/* compute lhs in (r0,r1), address of left in r2 */
		p->in.left->in.rall = D1|MUSTDO;
		mkrall( p->in.left, D2|MUSTDO );
		/* now, deal with right */
		if( fregs == 3 ) rallo( p->in.right, NOPREF );
		else {
			/* put address of long or value here */
			p->in.right->in.rall = D3|MUSTDO;
			mkrall( p->in.right, D3|MUSTDO );
			}
		return;

	case MUL:
	case DIV:
	case MOD:
		rallo( p->in.left, D1|MUSTDO );

		if( fregs == 2 ){
			rallo( p->in.right, NOPREF );
			return;
			}
		/* compute addresses, stay away from (r0,r1) */

		p->in.right->in.rall = (fregs==3) ? D2|MUSTDO : D3|MUSTDO ;
		mkrall( p->in.right, D2|MUSTDO );
		return;

	case CALL:
	case STASG:
	case EQ:
	case NE:
	case GT:
	case GE:
	case LT:
	case LE:
	case NOT:
	case ANDAND:
	case OROR:
		down1 = NOPREF;
		break;

	case FORCE:	
		down1 = D0|MUSTDO;
		break;

		}

	if( ty != LTYPE ) rallo( p->in.left, down1 );
	if( ty == BITYPE ) rallo( p->in.right, down2 );

	}

offstar( p ) register NODE *p; {
	/* handle indirections */

	if( p->in.op == UNARY MUL ) p = p->in.left;

	if( p->in.op == PLUS || p->in.op == MINUS ){
		if( p->in.right->in.op == ICON && p->in.right->in.name[0]=='\0' &&
		    p->in.right->tn.lval>=-32768 && p->in.right->tn.lval<=32767 ){
			order( p->in.left , INTBREG|INBREG );
			return;
			}
		}
	order( p, INTBREG|INBREG );
	}

setincr( p ) NODE *p; {
	return( 0 );	/* for the moment, don't bother */
	}

niceuty( p ) register NODE *p; {
	register TWORD t;

	return( p->in.op == UNARY MUL && (t=p->in.type)!=CHAR &&
		t!= UCHAR && t!= FLOAT &&
		shumul( p->in.left) != STARREG );
	}
setbin( p ) register NODE *p; {
	register NODE *r, *l;

	r = p->in.right;
	l = p->in.left;

	if( p->in.right->in.su == 0 ){ /* rhs is addressable */
		if( logop( p->in.op ) ){
			if( l->in.op == UNARY MUL && l->in.type != FLOAT && shumul( l->in.left ) != STARREG ) offstar( l->in.left );
			else order( l, INAREG|INTAREG|INBREG|INTBREG|INTEMP );
			return( 1 );
			}
		if( !istnode( l ) ){
			order( l, INTAREG|INTBREG );
			return( 1 );
			}
		/* rewrite */
		return( 0 );
		}
	/* now, rhs is complicated: must do both sides into registers */
	/* do the harder side first */

	if( logop( p->in.op ) ){
		/* relational: do both sides into regs if need be */

		if( r->in.su > l->in.su ){
			if( niceuty(r) ){
				offstar( r->in.left );
				return( 1 );
				}
			else if( !istnode( r ) ){
				order( r, INTAREG|INAREG|INTBREG|INBREG|INTEMP );
				return( 1 );
				}
			}
		if( niceuty(l) ){
			offstar( l->in.left );
			return( 1 );
			}
		else if( !istnode( l ) ){
			order( l, INTAREG|INAREG|INTBREG|INBREG|INTEMP );
			return( 1 );
			}
		else if( niceuty(r) ){
			offstar( r->in.left );
			return( 1 );
			}
		if( !istnode( r ) ){
			order( r, INTAREG|INAREG|INTBREG|INBREG|INTEMP );
			return( 1 );
			}
		cerror( "setbin can't deal with %s", opst[p->in.op] );
		}

	/* ordinary operator */

	if( !istnode(r) && r->in.su > l->in.su ){
		/* if there is a chance of making it addressable, try it... */
		if( niceuty(r) ){
			offstar( r->in.left );
			return( 1 );  /* hopefully, it is addressable by now */
			}
		order( r, INTAREG|INAREG|INTBREG|INBREG|INTEMP );  /* anything goes on rhs */
		return( 1 );
		}
	else {
		if( !istnode( l ) ){
			order( l, INTAREG|INTBREG );
			return( 1 );
			}
		/* rewrite */
		return( 0 );
		}
	}

setstr( p ) register NODE *p; { /* structure assignment */
	if( p->in.right->in.op != REG ){
		order( p->in.right, INTBREG );
		return(1);
		}
	p = p->in.left;
	if( p->in.op != NAME && p->in.op != OREG ){
		if( p->in.op != UNARY MUL ) cerror( "bad setstr" );
		order( p->in.left, INTBREG );
		return( 1 );
		}
	return( 0 );
	}

setasg( p ) register NODE *p; {
	/* setup for assignment operator */

	if( p->in.right->in.su != 0 && p->in.right->in.op != REG ) {
		if( p->in.right->in.op == UNARY MUL )
			offstar( p->in.right->in.left );
		else
			order( p->in.right, INAREG|INBREG|SOREG|SNAME|SCON );
		return(1);
		}
	if( p->in.left->in.op == UNARY MUL && !tshape( p->in.left, STARREG|STARNM ) ){
		offstar( p->in.left->in.left );
		return(1);
		}
	if( p->in.left->in.op == FLD && p->in.left->in.left->in.op == UNARY MUL ){
		offstar( p->in.left->in.left->in.left );
		return(1);
		}
	/* if things are really strange, get rhs into a register */
	if( p->in.right->in.op != REG ){
		order( p->in.right, INAREG|INBREG );
		return( 1 );
		}
	return(0);
	}

setasop( p ) register NODE *p; {
	/* setup for =ops */
	register sul, sur;
	register NODE *q, *p2;

	sul = p->in.left->in.su;
	sur = p->in.right->in.su;

	switch( p->in.op ){
	  case ASG PLUS:
	  case ASG MINUS:
	  case ASG OR:
	  case ASG ER:
	  case ASG AND:
		if (p->in.right->in.op != REG && sul == 0) {
		  order(p->in.right,INAREG|INTAREG);
		  return(1);
		} else break;

	  case ASG LS:
	  case ASG RS:
		if (p->in.left->in.op != REG) return(0);
		if (p->in.right->in.op == REG ||
		    (p->in.right->in.op==ICON && p->in.right->tn.lval>=1 && p->in.right->tn.lval<=8))
		  break;
		order(p->in.right,INAREG|INTAREG);
		return(1);

	  case ASG MUL:
	  case ASG DIV:
	  case ASG MOD:
		if (p->in.left->in.op != REG) return(0);
	}

	if( sur == 0 ){

	leftadr:
		/* easy case: if addressable, do left value, op, store */
		if( sul == 0 ) goto rew;  /* rewrite */

		/* harder; make aleft address, val, op, and store */

		if( p->in.left->in.op == UNARY MUL ){
			offstar( p->in.left->in.left );
			return( 1 );
			}
		if( p->in.left->in.op == FLD && p->in.left->in.left->in.op == UNARY MUL ){
			offstar( p->in.left->in.left->in.left );
			return( 1 );
			}
	rew:	/* rewrite, accounting for autoincrement and autodecrement */

		q = p->in.left;
		if( q->in.op == FLD ) q = q->in.left;
		if( q->in.op != UNARY MUL || shumul(q->in.left) != STARREG ) return(0); /* let reader.c do it */

		/* mimic code from reader.c */

		p2 = tcopy( p );
		p->in.op = ASSIGN;
		reclaim( p->in.right, RNULL, 0 );
		p->in.right = p2;

		/* now, zap INCR on right, ASG MINUS on left */

		if( q->in.left->in.op == INCR ){
			q = p2->in.left;
			if( q->in.op == FLD ) q = q->in.left;
			if( q->in.left->in.op != INCR ) cerror( "bad incr rewrite" );
			}
		else if( q->in.left->in.op != ASG MINUS )  cerror( " bad -= rewrite" );

		q->in.left->in.right->in.op = FREE;
		q->in.left->in.op = FREE;
		q->in.left = q->in.left->in.left;

		/* now, resume reader.c rewriting code */

		canon(p);
		rallo( p, p->in.rall );
		order( p2->in.left, INTBREG|INTAREG );
		order( p2, INTBREG|INTAREG );
		return( 1 );
		}

	/* harder case: do right, left address, left value, op, store */

	if( p->in.right->in.op == UNARY MUL && p->in.left->in.op==REG){
		offstar( p->in.right->in.left );
		return( 1 );
		}
	/* sur> 0, since otherwise, done above */
	if( p->in.right->in.op == REG ) goto leftadr;  /* make lhs addressable */
	order( p->in.right, INAREG|INBREG );
	return( 1 );
	}

int crslab = 10000;

getlab(){
	return( crslab++ );
	}

deflab( l ){
	printf( ".L%d:\n", l );
	}

genargs( p) register NODE *p; {
	register size,inc;

	/* generate code for the arguments */

	/*  first, do the arguments on the right (last->first) */
	while( p->in.op == CM ){
		genargs( p->in.right );
		p->in.op = FREE;
		p = p->in.left;
		}

	if( p->in.op == STARG ){ /* structure valued argument */

		size = p->stn.stsize;
		if( p->in.left->in.op == ICON ){
			/* make into a name node */
			p->in.op = FREE;
			p= p->in.left;
			p->in.op = NAME;
			}
		else {
			/* make it look beautiful... */
			p->in.op = UNARY MUL;
			canon( p );  /* turn it into an oreg */
			if( p->in.op != OREG ){
				offstar( p->in.left );
				canon( p );
				if( p->in.op != OREG ) cerror( "stuck starg" );
				}
			}

		p->tn.lval += size;  /* end of structure */
		/* put on stack backwards */
		for( ; size>0; size -= inc ){
			inc = (size>2) ? 4 : 2;
			p->tn.lval -= inc;
			expand( p, RNOP,(inc==4)?"\tmovl\tAR,Z-\n":"\tmovw\tAR,Z-\n" );
			}
		reclaim( p, RNULL, 0 );
		return;
		}

	/* ordinary case */

	order( p, FORARG );
	}

argsize( p ) register NODE *p; {
	register t;
	t = 0;
	if( p->in.op == CM ){
		t = argsize( p->in.left );
		p = p->in.right;
		}
	if( p->in.type == DOUBLE || p->in.type == FLOAT ){
		SETOFF( t, 2 );
		return( t+8 );
		}
	else if( p->in.op == STARG ){
		SETOFF( t, p->stn.stalign );  /* alignment */
		return( t + p->stn.stsize );  /* size */
		}
	else {
		SETOFF( t, 2 );
		return( t+4 );
		}
	}
s into a register */
	if( p->in.right->in.op != REG ){
		order( p->in.right, INAREG|INBREG );
		return( 1 );
		}
	return(0);
	}

setasop( p ) register NODE *p; {
	/* setup for =ops */
	register sul, sur;
	register NODE *q, *p2;

	sul = p->in.left->in.su;
	sur = p->in.right->in.su;

	switch( p->in.op ){
	  case ASG PLUS:
	  case ASG MINUS:
	  case ASG OR:
	  case ASG ER:
	  csumacc/cc/ccom/pftn.c   444      0     12      117514  3470501552   7774 # include "mfile1"

unsigned int offsz;

struct instk {
	int in_sz;   /* size of array element */
	int in_x;    /* current index for structure member in structure initializations */
	int in_n;    /* number of initializations seen */
	int in_s;    /* sizoff */
	int in_d;    /* dimoff */
	TWORD in_t;    /* type */
	int in_id;   /* stab index */
	int in_fl;   /* flag which says if this level is controlled by {} */
	OFFSZ in_off;  /* offset of the beginning of this level */
	}
instack[10],
*pstk;

	/* defines used for getting things off of the initialization stack */


struct symtab *relook();


int ddebug = 0;

struct symtab * mknonuniq();

defid( q, class )  NODE *q; {
	register struct symtab *p;
	int idp;
	TWORD type;
	TWORD stp;
	int scl;
	int dsym, ddef;
	int slev, temp;

	if( q == NIL ) return;  /* an error was detected */

	if( q < node || q >= &node[TREESZ] ) cerror( "defid call" );

	idp = q->tn.rval;

	if( idp < 0 ) cerror( "tyreduce" );
	p = &stab[idp];

# ifndef BUG1
	if( ddebug ){
#ifndef FLEXNAMES
		printf( "defid( %.8s (%d), ", p->sname, idp );
#else
		printf( "defid( %s (%d), ", p->sname, idp );
#endif
		tprint( q->in.type );
		printf( ", %s, (%d,%d) ), level %d\n", scnames(class), q->fn.cdim, q->fn.csiz, blevel );
		}
# endif

	fixtype( q, class );

	type = q->in.type;
	class = fixclass( class, type );

	stp = p->stype;
	slev = p->slevel;

# ifndef BUG1
	if( ddebug ){
		printf( "	modified to " );
		tprint( type );
		printf( ", %s\n", scnames(class) );
		printf( "	previous def'n: " );
		tprint( stp );
		printf( ", %s, (%d,%d) ), level %d\n", scnames(p->sclass), p->dimoff, p->sizoff, slev );
		}
# endif

	if( stp == FTN && p->sclass == SNULL )goto enter;
		/* name encountered as function, not yet defined */
		/* BUG here!  can't incompatibly declare func. in inner block */
	if( stp == UNDEF|| stp == FARG ){
		if( blevel==1 && stp!=FARG ) switch( class ){

		default:
#ifndef FLEXNAMES
			if(!(class&FIELD)) uerror( "declared argument %.8s is missing", p->sname );
#else
			if(!(class&FIELD)) uerror( "declared argument %s is missing", p->sname );
#endif
		case MOS:
		case STNAME:
		case MOU:
		case UNAME:
		case MOE:
		case ENAME:
		case TYPEDEF:
			;
			}
		goto enter;
		}

	if( type != stp ) goto mismatch;
	/* test (and possibly adjust) dimensions */
	dsym = p->dimoff;
	ddef = q->fn.cdim;
	for( temp=type; temp&TMASK; temp = DECREF(temp) ){
		if( ISARY(temp) ){
			if( dimtab[dsym] == 0 ) dimtab[dsym] = dimtab[ddef];
			else if( dimtab[ddef]!=0 && dimtab[dsym] != dimtab[ddef] ){
				goto mismatch;
				}
			++dsym;
			++ddef;
			}
		}

	/* check that redeclarations are to the same structure */
	if( (temp==STRTY||temp==UNIONTY||temp==ENUMTY) && p->sizoff != q->fn.csiz
		 && class!=STNAME && class!=UNAME && class!=ENAME ){
		goto mismatch;
		}

	scl = ( p->sclass );

# ifndef BUG1
	if( ddebug ){
		printf( "	previous class: %s\n", scnames(scl) );
		}
# endif

	if( class&FIELD ){
		/* redefinition */
		if( !falloc( p, class&FLDSIZ, 1, NIL ) ) {
			/* successful allocation */
			psave( idp );
			return;
			}
		/* blew it: resume at end of switch... */
		}

	else switch( class ){

	case EXTERN:
		switch( scl ){
		case STATIC:
		case USTATIC:
			if( slev==0 ) return;
			break;
		case EXTDEF:
		case EXTERN:
		case FORTRAN:
		case UFORTRAN:
			return;
			}
		break;

	case STATIC:
		if( scl==USTATIC || (scl==EXTERN && blevel==0) ){
			p->sclass = STATIC;
			if( ISFTN(type) ) curftn = idp;
			return;
			}
		break;

	case USTATIC:
		if( scl==STATIC || scl==USTATIC ) return;
		break;

	case LABEL:
		if( scl == ULABEL ){
			p->sclass = LABEL;
			deflab( p->offset );
			return;
			}
		break;

	case TYPEDEF:
		if( scl == class ) return;
		break;

	case UFORTRAN:
		if( scl == UFORTRAN || scl == FORTRAN ) return;
		break;

	case FORTRAN:
		if( scl == UFORTRAN ){
			p->sclass = FORTRAN;
			if( ISFTN(type) ) curftn = idp;
			return;
			}
		break;

	case MOU:
	case MOS:
		if( scl == class ) {
			if( oalloc( p, &strucoff ) ) break;
			if( class == MOU ) strucoff = 0;
			psave( idp );
			return;
			}
		break;

	case MOE:
		if( scl == class ){
			if( p->offset!= strucoff++ ) break;
			psave( idp );
			}
		break;

	case EXTDEF:
		if( scl == EXTERN ) {
			p->sclass = EXTDEF;
			if( ISFTN(type) ) curftn = idp;
			return;
			}
		break;

	case STNAME:
	case UNAME:
	case ENAME:
		if( scl != class ) break;
		if( dimtab[p->sizoff] == 0 ) return;  /* previous entry just a mention */
		break;

	case ULABEL:
		if( scl == LABEL || scl == ULABEL ) return;
	case PARAM:
	case AUTO:
	case REGISTER:
		;  /* mismatch.. */

		}

	mismatch:
	/* allow nonunique structure/union member names */

	if( class==MOU || class==MOS || class & FIELD ){/* make a new entry */
		int * memp;
		p->sflags |= SNONUNIQ;  /* old entry is nonunique */
		/* determine if name has occurred in this structure/union */
		for( memp = &paramstk[paramno-1];
			/* while */ *memp>=0 && stab[*memp].sclass != STNAME
				&& stab[*memp].sclass != UNAME;
			/* iterate */ --memp){ char * cname, * oname;
			if( stab[*memp].sflags & SNONUNIQ ){int k;
				cname=p->sname;
				oname=stab[*memp].sname;
#ifndef FLEXNAMES
				for(k=1; k<=NCHNAM; ++k){
					if(*cname++ != *oname)goto diff;
					if(!*oname++)break;
					}
#else
				if (cname != oname) goto diff;
#endif
				uerror("redeclaration of: %s",p->sname);
				break;
				diff: continue;
				}
			}
		p = mknonuniq( &idp ); /* update p and idp to new entry */
		goto enter;
		}
	if( blevel > slev && class != EXTERN && class != FORTRAN &&
		class != UFORTRAN && !( class == LABEL && slev >= 2 ) ){
		q->tn.rval = idp = hide( p );
		p = &stab[idp];
		goto enter;
		}
#ifndef FLEXNAMES
	uerror( "redeclaration of %.8s", p->sname );
#else
	uerror( "redeclaration of %s", p->sname );
#endif
	if( class==EXTDEF && ISFTN(type) ) curftn = idp;
	return;

	enter:  /* make a new entry */

# ifndef BUG1
	if( ddebug ) printf( "	new entry made\n" );
# endif
	if( type == UNDEF ) uerror("void type for %s",p->sname);
	p->stype = type;
	p->sclass = class;
	p->slevel = blevel;
	p->offset = NOOFFSET;
	p->suse = lineno;
	if( class == STNAME || class == UNAME || class == ENAME ) {
		p->sizoff = curdim;
		dstash( 0 );  /* size */
		dstash( -1 ); /* index to members of str or union */
		dstash( ALSTRUCT );  /* alignment */
		dstash( idp );  /* name index */
		}
	else {
		switch( BTYPE(type) ){
		case STRTY:
		case UNIONTY:
		case ENUMTY:
			p->sizoff = q->fn.csiz;
			break;
		default:
			p->sizoff = BTYPE(type);
			}
		}

	/* copy dimensions */

	p->dimoff = q->fn.cdim;

	/* allocate offsets */
	if( class&FIELD ){
		falloc( p, class&FLDSIZ, 0, NIL );  /* new entry */
		psave( idp );
		}
	else switch( class ){

	case AUTO:
		oalloc( p, &autooff );
		break;
	case STATIC:
	case EXTDEF:
		p->offset = getlab();
		if( ISFTN(type) ) curftn = idp;
		break;
	case ULABEL:
	case LABEL:
		p->offset = getlab();
		p->slevel = 2;
		if( class == LABEL ){
			locctr( PROG );
			deflab( p->offset );
			}
		break;

	case EXTERN:
	case UFORTRAN:
	case FORTRAN:
		p->offset = getlab();
		p->slevel = 0;
		break;
	case MOU:
	case MOS:
		oalloc( p, &strucoff );
		if( class == MOU ) strucoff = 0;
		psave( idp );
		break;

	case MOE:
		p->offset = strucoff++;
		psave( idp );
		break;
	case REGISTER:
		if ( ISPTR(type) ) {
		  p->offset = (regvar>>8)+8;
		  regvar -= 1<<8;
		  if ((regvar&~0377) < (minrvar&~0377))
		    { minrvar &= 0377; minrvar |= regvar&~0377; }
		} else {
		  p->offset = regvar&0377;
		  regvar = ((regvar&0377)-1) | (regvar&~0377);
		  if ((regvar&0377) < (minrvar&0377))
		    { minrvar &= ~0377; minrvar |= regvar&0377; }
		}		   
		if( blevel == 1 ) p->sflags |= SSET;
		break;
		}

	/* user-supplied routine to fix up new definitions */

	FIXDEF(p);

# ifndef BUG1
	if( ddebug ) printf( "	dimoff, sizoff, offset: %d, %d, %d\n", p->dimoff, p->sizoff, p->offset );
# endif

	}

psave( i ){
	if( paramno >= PARAMSZ ){
		cerror( "parameter stack overflow");
		}
	paramstk[ paramno++ ] = i;
	}

ftnend(){ /* end of function */
	if( retlab != NOLAB ){ /* inside a real function */
		efcode();
		}
	checkst(0);
	retstat = 0;
	tcheck();
	curclass = SNULL;
	brklab = contlab = retlab = NOLAB;
	flostat = 0;
	if( nerrors == 0 ){
		if( psavbc != & asavbc[0] ) cerror("bcsave error");
		if( paramno != 0 ) cerror("parameter reset error");
		if( swx != 0 ) cerror( "switch error");
		}
	psavbc = &asavbc[0];
	paramno = 0;
	autooff = AUTOINIT;
	minrvar = regvar = MAXRVAR | ((MAXRVAR-2)<<8);
	reached = 1;
	swx = 0;
	swp = swtab;
	locctr(DATA);
	}

dclargs(){
	register i, j;
	register struct symtab *p;
	register NODE *q;
	argoff = ARGINIT;
# ifndef BUG1
	if( ddebug > 2) printf("dclargs()\n");
# endif
	for( i=0; i<paramno; ++i ){
		if( (j = paramstk[i]) < 0 ) continue;
		p = &stab[j];
# ifndef BUG1
		if( ddebug > 2 ){
			printf("\t%s (%d) ",p->sname, j);
			tprint(p->stype);
			printf("\n");
			}
# endif
		if( p->stype == FARG ) {
			q = block(FREE,NIL,NIL,INT,0,INT);
			q->tn.rval = j;
			defid( q, PARAM );
			}
		oalloc( p, &argoff );  /* always set aside space, even for register arguments */
		FIXARG(p); /* local arg hook, eg. for sym. debugger */
		}
	cendarg();
	locctr(PROG);
	defalign(ALINT);
	++ftnno;
	bfcode( paramstk, paramno );
	paramno = 0;
	}

NODE *
rstruct( idn, soru ){ /* reference to a structure or union, with no definition */
	register struct symtab *p;
	register NODE *q;
	p = &stab[idn];
	switch( p->stype ){

	case UNDEF:
	def:
		q = block( FREE, NIL, NIL, 0, 0, 0 );
		q->tn.rval = idn;
		q->in.type = (soru&INSTRUCT) ? STRTY : ( (soru&INUNION) ? UNIONTY : ENUMTY );
		defid( q, (soru&INSTRUCT) ? STNAME : ( (soru&INUNION) ? UNAME : ENAME ) );
		break;

	case STRTY:
		if( soru & INSTRUCT ) break;
		goto def;

	case UNIONTY:
		if( soru & INUNION ) break;
		goto def;

	case ENUMTY:
		if( !(soru&(INUNION|INSTRUCT)) ) break;
		goto def;

		}
	stwart = instruct;
	return( mkty( p->stype, 0, p->sizoff ) );
	}

moedef( idn ){
	register NODE *q;

	q = block( FREE, NIL, NIL, MOETY, 0, 0 );
	q->tn.rval = idn;
	if( idn>=0 ) defid( q, MOE );
	}

bstruct( idn, soru ){ /* begining of structure or union declaration */
	register NODE *q;

	psave( instruct );
	psave( curclass );
	psave( strucoff );
	strucoff = 0;
	instruct = soru;
	q = block( FREE, NIL, NIL, 0, 0, 0 );
	q->tn.rval = idn;
	if( instruct==INSTRUCT ){
		curclass = MOS;
		q->in.type = STRTY;
		if( idn >= 0 ) defid( q, STNAME );
		}
	else if( instruct == INUNION ) {
		curclass = MOU;
		q->in.type = UNIONTY;
		if( idn >= 0 ) defid( q, UNAME );
		}
	else { /* enum */
		curclass = MOE;
		q->in.type = ENUMTY;
		if( idn >= 0 ) defid( q, ENAME );
		}
	psave( idn = q->tn.rval );
	/* the "real" definition is where the members are seen */
	if( idn >= 0 ) stab[idn].suse = lineno;
	return( paramno-4 );
	}

NODE *
dclstruct( oparam ){
	register struct symtab *p;
	register i, al, sa, j, sz, szindex;
	register TWORD temp;
	register high, low;

	/* paramstack contains:
		paramstack[ oparam ] = previous instruct
		paramstack[ oparam+1 ] = previous class
		paramstk[ oparam+2 ] = previous strucoff
		paramstk[ oparam+3 ] = structure name

		paramstk[ oparam+4, ... ]  = member stab indices

		*/


	if( (i=paramstk[oparam+3]) < 0 ){
		szindex = curdim;
		dstash( 0 );  /* size */
		dstash( -1 );  /* index to member names */
		dstash( ALSTRUCT );  /* alignment */
		dstash( -lineno );  /* name of structure */
		}
	else {
		szindex = stab[i].sizoff;
		}

# ifndef BUG1
	if( ddebug ){
#ifndef FLEXNAMES
		printf( "dclstruct( %.8s ), szindex = %d\n", (i>=0)? stab[i].sname : "??", szindex );
#else
		printf( "dclstruct( %s ), szindex = %d\n", (i>=0)? stab[i].sname : "??", szindex );
#endif
		}
# endif
	temp = (instruct&INSTRUCT)?STRTY:((instruct&INUNION)?UNIONTY:ENUMTY);
	stwart = instruct = paramstk[ oparam ];
	curclass = paramstk[ oparam+1 ];
	dimtab[ szindex+1 ] = curdim;
	al = ALSTRUCT;

	high = low = 0;

	for( i = oparam+4;  i< paramno; ++i ){
		dstash( j=paramstk[i] );
		if( j<0 || j>= SYMTSZ ) cerror( "gummy structure member" );
		p = &stab[j];
		if( temp == ENUMTY ){
			if( p->offset < low ) low = p->offset;
			if( p->offset > high ) high = p->offset;
			p->sizoff = szindex;
			continue;
			}
		sa = talign( p->stype, p->sizoff );
		if( p->sclass & FIELD ){
			sz = p->sclass&FLDSIZ;
			}
		else {
			sz = tsize( p->stype, p->dimoff, p->sizoff );
			}
		if( sz == 0 ){
#ifndef FLEXNAMES
			werror( "illegal zero sized structure member: %.8s", p->sname );
#else
			werror( "illegal zero sized structure member: %s", p->sname );
#endif
			}
		if( sz > strucoff ) strucoff = sz;  /* for use with unions */
		SETOFF( al, sa );
		/* set al, the alignment, to the lcm of the alignments of the members */
		}
	dstash( -1 );  /* endmarker */
	SETOFF( strucoff, al );

	if( temp == ENUMTY ){
		register TWORD ty;

# ifdef ENUMSIZE
		ty = ENUMSIZE(high,low);
# else
		if( (char)high == high && (char)low == low ) ty = ctype( CHAR );
		else if( (short)high == high && (short)low == low ) ty = ctype( SHORT );
		else ty = ctype(INT);
#endif
		strucoff = tsize( ty, 0, (int)ty );
		dimtab[ szindex+2 ] = al = talign( ty, (int)ty );
		}

	if( strucoff == 0 ) uerror( "zero sized structure" );
	dimtab[ szindex ] = strucoff;
	dimtab[ szindex+2 ] = al;
	dimtab[ szindex+3 ] = paramstk[ oparam+3 ];  /* name index */

	FIXSTRUCT( szindex, oparam ); /* local hook, eg. for sym debugger */
# ifndef BUG1
	if( ddebug>1 ){
		printf( "\tdimtab[%d,%d,%d,%d] = %d,%d,%d,%d\n",
			szindex,szindex+1,szindex+2,szindex+3,
			dimtab[szindex],dimtab[szindex+1],dimtab[szindex+2],
			dimtab[szindex+3] );
		for( i = dimtab[szindex+1]; dimtab[i] >= 0; ++i ){
#ifndef FLEXNAMES
			printf( "\tmember %.8s(%d)\n", stab[dimtab[i]].sname, dimtab[i] );
#else
			printf( "\tmember %s(%d)\n", stab[dimtab[i]].sname, dimtab[i] );
#endif
			}
		}
# endif

	strucoff = paramstk[ oparam+2 ];
	paramno = oparam;

	return( mkty( temp, 0, szindex ) );
	}

	/* VARARGS */
yyerror( s ) char *s; { /* error printing routine in parser */

	uerror( s );

	}

yyaccpt(){
	ftnend();
	}

ftnarg( idn ) {
	switch( stab[idn].stype ){

	case UNDEF:
		/* this parameter, entered at scan */
		break;
	case FARG:
#ifndef FLEXNAMES
		uerror("redeclaration of formal parameter, %.8s",
#else
		uerror("redeclaration of formal parameter, %s",
#endif
			stab[idn].sname);
		/* fall thru */
	case FTN:
		/* the name of this function matches parm */
		/* fall thru */
	default:
		idn = hide( &stab[idn]);
		break;
	case TNULL:
		/* unused entry, fill it */
		;
		}
	stab[idn].stype = FARG;
	stab[idn].sclass = PARAM;
	psave( idn );
	}

talign( ty, s) register unsigned ty; register s; {
	/* compute the alignment of an object with type ty, sizeoff index s */

	register i;
	if( s<0 && ty!=INT && ty!=CHAR && ty!=SHORT && ty!=UNSIGNED && ty!=UCHAR && ty!=USHORT 
#ifdef LONGFIELDS
		&& ty!=LONG && ty!=ULONG
#endif
					){
		return( fldal( ty ) );
		}

	for( i=0; i<=(SZINT-BTSHIFT-1); i+=TSHIFT ){
		switch( (ty>>i)&TMASK ){

		case FTN:
			cerror( "compiler takes alignment of function");
		case PTR:
			return( ALPOINT );
		case ARY:
			continue;
		case 0:
			break;
			}
		}

	switch( BTYPE(ty) ){

	case UNIONTY:
	case ENUMTY:
	case STRTY:
		return( (unsigned int) dimtab[ s+2 ] );
	case CHAR:
	case UCHAR:
		return( ALCHAR );
	case FLOAT:
		return( ALFLOAT );
	case DOUBLE:
		return( ALDOUBLE );
	case LONG:
	case ULONG:
		return( ALLONG );
	case SHORT:
	case USHORT:
		return( ALSHORT );
	default:
		return( ALINT );
		}
	}

OFFSZ
tsize( ty, d, s )  TWORD ty; {
	/* compute the size associated with type ty,
	    dimoff d, and sizoff s */
	/* BETTER NOT BE CALLED WHEN t, d, and s REFER TO A BIT FIELD... */

	int i;
	OFFSZ mult;

	mult = 1;

	for( i=0; i<=(SZINT-BTSHIFT-1); i+=TSHIFT ){
		switch( (ty>>i)&TMASK ){

		case FTN:
			cerror( "compiler takes size of function");
		case PTR:
			return( SZPOINT * mult );
		case ARY:
			mult *= (unsigned int) dimtab[ d++ ];
			continue;
		case 0:
			break;

			}
		}

	if( dimtab[s]==0 ) {
		uerror( "unknown size");
		return( SZINT );
		}
	return( (unsigned int) dimtab[ s ] * mult );
	}

inforce( n ) OFFSZ n; {  /* force inoff to have the value n */
	/* inoff is updated to have the value n */
	OFFSZ wb;
	register rest;
	/* rest is used to do a lot of conversion to ints... */

	if( inoff == n ) return;
	if( inoff > n ) {
		cerror( "initialization alignment error");
		}

	wb = inoff;
	SETOFF( wb, SZINT );

	/* wb now has the next higher word boundary */

	if( wb >= n ){ /* in the same word */
		rest = n - inoff;
		vfdzero( rest );
		return;
		}

	/* otherwise, extend inoff to be word aligned */

	rest = wb - inoff;
	vfdzero( rest );

	/* now, skip full words until near to n */

	rest = (n-inoff)/SZINT;
	zecode( rest );

	/* now, the remainder of the last word */

	rest = n-inoff;
	vfdzero( rest );
	if( inoff != n ) cerror( "inoff error");

	}

vfdalign( n ){ /* make inoff have the offset the next alignment of n */
	OFFSZ m;

	m = inoff;
	SETOFF( m, n );
	inforce( m );
	}


int idebug = 0;

int ibseen = 0;  /* the number of } constructions which have been filled */

int iclass;  /* storage class of thing being initialized */

int ilocctr = 0;  /* location counter for current initialization */

beginit(curid){
	/* beginning of initilization; set location ctr and set type */
	register struct symtab *p;

# ifndef BUG1
	if( idebug >= 3 ) printf( "beginit(), curid = %d\n", curid );
# endif

	p = &stab[curid];

	iclass = p->sclass;
	if( curclass == EXTERN || curclass == FORTRAN ) iclass = EXTERN;
	switch( iclass ){

	case UNAME:
	case EXTERN:
		return;
	case AUTO:
	case REGISTER:
		break;
	case EXTDEF:
	case STATIC:
		ilocctr = ISARY(p->stype)?ADATA:DATA;
		locctr( ilocctr );
		defalign( talign( p->stype, p->sizoff ) );
		defnam( p );

		}

	inoff = 0;
	ibseen = 0;

	pstk = 0;

	instk( curid, p->stype, p->dimoff, p->sizoff, inoff );

	}

instk( id, t, d, s, off ) OFFSZ off; TWORD t; {
	/* make a new entry on the parameter stack to initialize id */

	register struct symtab *p;

	for(;;){
# ifndef BUG1
		if( idebug ) printf( "instk((%d, %o,%d,%d, %d)\n", id, t, d, s, off );
# endif

		/* save information on the stack */

		if( !pstk ) pstk = instack;
		else ++pstk;

		pstk->in_fl = 0;	/* { flag */
		pstk->in_id =  id ;
		pstk->in_t =  t ;
		pstk->in_d =  d ;
		pstk->in_s =  s ;
		pstk->in_n = 0;  /* number seen */
		pstk->in_x =  t==STRTY ?dimtab[s+1] : 0 ;
		pstk->in_off =  off;   /* offset at the beginning of this element */
		/* if t is an array, DECREF(t) can't be a field */
		/* INS_sz has size of array elements, and -size for fields */
		if( ISARY(t) ){
			pstk->in_sz = tsize( DECREF(t), d+1, s );
			}
		else if( stab[id].sclass & FIELD ){
			pstk->in_sz = - ( stab[id].sclass & FLDSIZ );
			}
		else {
			pstk->in_sz = 0;
			}

		if( (iclass==AUTO || iclass == REGISTER ) &&
			(ISARY(t) || t==STRTY) ) uerror( "no automatic aggregate initialization" );

		/* now, if this is not a scalar, put on another element */

		if( ISARY(t) ){
			t = DECREF(t);
			++d;
			continue;
			}
		else if( t == STRTY ){
			id = dimtab[pstk->in_x];
			p = &stab[id];
			if( p->sclass != MOS && !(p->sclass&FIELD) ) cerror( "insane structure member list" );
			t = p->stype;
			d = p->dimoff;
			s = p->sizoff;
			off += p->offset;
			continue;
			}
		else return;
		}
	}

NODE *
getstr(){ /* decide if the string is external or an initializer, and get the contents accordingly */

	register l, temp;
	register NODE *p;

	if( (iclass==EXTDEF||iclass==STATIC) && (pstk->in_t == CHAR || pstk->in_t == UCHAR) &&
			pstk!=instack && ISARY( pstk[-1].in_t ) ){
		/* treat "abc" as { 'a', 'b', 'c', 0 } */
		strflg = 1;
		ilbrace();  /* simulate { */
		inforce( pstk->in_off );
		/* if the array is inflexible (not top level), pass in the size and
			be prepared to throw away unwanted initializers */
		lxstr((pstk-1)!=instack?dimtab[(pstk-1)->in_d]:0);  /* get the contents */
		irbrace();  /* simulate } */
		return( NIL );
		}
	else { /* make a label, and get the contents and stash them away */
		if( iclass != SNULL ){ /* initializing */
			/* fill out previous word, to permit pointer */
			vfdalign( ALPOINT );
			}
		temp = locctr( blevel==0?ISTRNG:STRNG ); /* set up location counter */
		deflab( l = getlab() );
		strflg = 0;
		lxstr(0); /* get the contents */
		locctr( blevel==0?ilocctr:temp );
		p = buildtree( STRING, NIL, NIL );
		p->tn.rval = -l;
		return(p);
		}
	}

putbyte( v ){ /* simulate byte v appearing in a list of integer values */
	register NODE *p;
	p = bcon(v);
	incode( p, SZCHAR );
	tfree( p );
	gotscal();
	}

endinit(){
	register TWORD t;
	register d, s, n, d1;

# ifndef BUG1
	if( idebug ) printf( "endinit(), inoff = %d\n", inoff );
# endif

	switch( iclass ){

	case EXTERN:
	case AUTO:
	case REGISTER:
		return;
		}

	pstk = instack;

	t = pstk->in_t;
	d = pstk->in_d;
	s = pstk->in_s;
	n = pstk->in_n;

	if( ISARY(t) ){
		d1 = dimtab[d];

		vfdalign( pstk->in_sz );  /* fill out part of the last element, if needed */
		n = inoff/pstk->in_sz;  /* real number of initializers */
		if( d1 >= n ){
			/* once again, t is an array, so no fields */
			inforce( tsize( t, d, s ) );
			n = d1;
			}
		if( d1!=0 && d1!=n ) uerror( "too many initializers");
		if( n==0 ) werror( "empty array declaration");
		dimtab[d] = n;
		}

	else if( t == STRTY || t == UNIONTY ){
		/* clearly not fields either */
		inforce( tsize( t, d, s ) );
		}
	else if( n > 1 ) uerror( "bad scalar initialization");
	/* this will never be called with a field element... */
	else inforce( tsize(t,d,s) );

	paramno = 0;
	vfdalign( AL_INIT );
	inoff = 0;
	iclass = SNULL;

	}

doinit( p ) register NODE *p; {

	/* take care of generating a value for the initializer p */
	/* inoff has the current offset (last bit written)
		in the current word being generated */

	register sz, d, s;
	register TWORD t;

	/* note: size of an individual initializer is assumed to fit into an int */

	if( iclass < 0 ) goto leave;
	if( iclass == EXTERN || iclass == UNAME ){
		uerror( "cannot initialize extern or union" );
		iclass = -1;
		goto leave;
		}

	if( iclass == AUTO || iclass == REGISTER ){
		/* do the initialization and get out, without regard 
		    for filing out the variable with zeros, etc. */
		bccode();
		idname = pstk->in_id;
		p = buildtree( ASSIGN, buildtree( NAME, NIL, NIL ), p );
		ecomp(p);
		return;
		}

	if( p == NIL ) return;  /* for throwing away strings that have been turned into lists */

	if( ibseen ){
		uerror( "} expected");
		goto leave;
		}

# ifndef BUG1
	if( idebug > 1 ) printf( "doinit(%o)\n", p );
# endif

	t = pstk->in_t;  /* type required */
	d = pstk->in_d;
	s = pstk->in_s;
	if( pstk->in_sz < 0 ){  /* bit field */
		sz = -pstk->in_sz;
		}
	else {
		sz = tsize( t, d, s );
		}

	inforce( pstk->in_off );

	p = buildtree( ASSIGN, block( NAME, NIL,NIL, t, d, s ), p );
	p->in.left->in.op = FREE;
	p->in.left = p->in.right;
	p->in.right = NIL;
	p->in.left = optim( p->in.left );
	if( p->in.left->in.op == UNARY AND ){
		p->in.left->in.op = FREE;
		p->in.left = p->in.left->in.left;
		}
	p->in.op = INIT;

	if( sz < SZINT ){ /* special case: bit fields, etc. */
		if( p->in.left->in.op != ICON ) uerror( "illegal initialization" );
		else incode( p->in.left, sz );
		}
	else if( p->in.left->in.op == FCON ){
		fincode( p->in.left->fpn.dval, sz );
		}
	else {
		cinit( optim(p), sz );
		}

	gotscal();

	leave:
	tfree(p);
	}

gotscal(){
	register t, ix;
	register n, id;
	struct symtab *p;
	OFFSZ temp;

	for( ; pstk > instack; ) {

		if( pstk->in_fl ) ++ibseen;

		--pstk;
		
		t = pstk->in_t;

		if( t == STRTY ){
			ix = ++pstk->in_x;
			if( (id=dimtab[ix]) < 0 ) continue;

			/* otherwise, put next element on the stack */

			p = &stab[id];
			instk( id, p->stype, p->dimoff, p->sizoff, p->offset+pstk->in_off );
			return;
			}
		else if( ISARY(t) ){
			n = ++pstk->in_n;
			if( n >= dimtab[pstk->in_d] && pstk > instack ) continue;

			/* put the new element onto the stack */

			temp = pstk->in_sz;
			instk( pstk->in_id, (TWORD)DECREF(pstk->in_t), pstk->in_d+1, pstk->in_s,
				pstk->in_off+n*temp );
			return;
			}

		}

	}

ilbrace(){ /* process an initializer's left brace */
	register t;
	struct instk *temp;

	temp = pstk;

	for( ; pstk > instack; --pstk ){

		t = pstk->in_t;
		if( t != STRTY && !ISARY(t) ) continue; /* not an aggregate */
		if( pstk->in_fl ){ /* already associated with a { */
			if( pstk->in_n ) uerror( "illegal {");
			continue;
			}

		/* we have one ... */
		pstk->in_fl = 1;
		break;
		}

	/* cannot find one */
	/* ignore such right braces */

	pstk = temp;
	}

irbrace(){
	/* called when a '}' is seen */

# ifndef BUG1
	if( idebug ) printf( "irbrace(): paramno = %d on entry\n", paramno );
# endif

	if( ibseen ) {
		--ibseen;
		return;
		}

	for( ; pstk > instack; --pstk ){
		if( !pstk->in_fl ) continue;

		/* we have one now */

		pstk->in_fl = 0;  /* cancel { */
		gotscal();  /* take it away... */
		return;
		}

	/* these right braces match ignored left braces: throw out */

	}

upoff( size, alignment, poff ) register alignment, *poff; {
	/* update the offset pointed to by poff; return the
	/* offset of a value of size `size', alignment `alignment',
	/* given that off is increasing */

	register off;

	off = *poff;
	SETOFF( off, alignment );
	if( (offsz-off) <=  size ){
		if( instruct!=INSTRUCT )cerror("too many local variables");
		else cerror("Structure too large");
		}
	*poff = off+size;
	return( off );
	}

oalloc( p, poff ) register struct symtab *p; register *poff; {
	/* allocate p with offset *poff, and update *poff */
	register al, off, tsz;
	int noff;

	al = talign( p->stype, p->sizoff );
	noff = off = *poff;
	tsz = tsize( p->stype, p->dimoff, p->sizoff );
#ifdef BACKAUTO
	if( p->sclass == AUTO ){
		if( (offsz-off) <= tsz ) cerror("too many local variables");
		noff = off + tsz;
		SETOFF( noff, al );
		off = -noff;
		}
	else
#endif
		if( (p->sclass==PARAM || p->sclass==REGISTER) && ( tsz < SZINT ) ){
			off = upoff( SZINT, ALINT, &noff );
# ifndef RTOLBYTES
			off = noff - tsz;
#endif
			}
		else
		{
		off = upoff( tsz, al, &noff );
		}

	if( p->sclass != REGISTER ){ /* in case we are allocating stack space for register arguments */
		if( p->offset == NOOFFSET ) p->offset = off;
		else if( off != p->offset ) return(1);
		}

	*poff = noff;
	return(0);
	}

falloc( p, w, new, pty )  register struct symtab *p; NODE *pty; {
	/* allocate a field of width w */
	/* new is 0 if new entry, 1 if redefinition, -1 if alignment */

	register al,sz,type;

	type = (new<0)? pty->in.type : p->stype;

	/* this must be fixed to use the current type in alignments */
	switch( new<0?pty->in.type:p->stype ){

	case ENUMTY:
		{
			int s;
			s = new<0 ? pty->fn.csiz : p->sizoff;
			al = dimtab[s+2];
			sz = dimtab[s];
			break;
			}

	case CHAR:
	case UCHAR:
		al = ALCHAR;
		sz = SZCHAR;
		break;

	case SHORT:
	case USHORT:
		al = ALSHORT;
		sz = SZSHORT;
		break;

	case INT:
	case UNSIGNED:
		al = ALINT;
		sz = SZINT;
		break;
#ifdef LONGFIELDS

	case LONG:
	case ULONG:
		al = ALLONG;
		sz = SZLONG;
		break;
#endif

	default:
		if( new < 0 ) {
			uerror( "illegal field type" );
			al = ALINT;
			}
		else {
			al = fldal( p->stype );
			sz =SZINT;
			}
		}

	if( w > sz ) {
		uerror( "field too big");
		w = sz;
		}

	if( w == 0 ){ /* align only */
		SETOFF( strucoff, al );
		if( new >= 0 ) uerror( "zero size field");
		return(0);
		}

	if( strucoff%al + w > sz ) SETOFF( strucoff, al );
	if( new < 0 ) {
		if( (offsz-strucoff) <= w )
			cerror("structure too large");
		strucoff += w;  /* we know it will fit */
		return(0);
		}

	/* establish the field */

	if( new == 1 ) { /* previous definition */
		if( p->offset != strucoff || p->sclass != (FIELD|w) ) return(1);
		}
	p->offset = strucoff;
	if( (offsz-strucoff) <= w ) cerror("structure too large");
	strucoff += w;
	p->stype = type;
	fldty( p );
	return(0);
	}

nidcl( p ) NODE *p; { /* handle unitialized declarations */
	/* assumed to be not functions */
	register class;
	register commflag;  /* flag for labelled common declarations */

	commflag = 0;

	/* compute class */
	if( (class=curclass) == SNULL ){
		if( blevel > 1 ) class = AUTO;
		else if( blevel != 0 || instruct ) cerror( "nidcl error" );
		else { /* blevel = 0 */
			class = noinit();
			if( class == EXTERN ) commflag = 1;
			}
		}

	defid( p, class );

	if( class==EXTDEF || class==STATIC ){
		/* simulate initialization by 0 */
		beginit(p->tn.rval);
		endinit();
		}
	if( commflag ) commdec( p->tn.rval );
	}

TWORD
types( t1, t2, t3 ) TWORD t1, t2, t3; {
	/* return a basic type from basic types t1, t2, and t3 */

	TWORD t[3], noun, adj, unsg;
	register i;

	t[0] = t1;
	t[1] = t2;
	t[2] = t3;

	unsg = INT;  /* INT or UNSIGNED */
	noun = UNDEF;  /* INT, CHAR, or FLOAT */
	adj = INT;  /* INT, LONG, or SHORT */

	for( i=0; i<3; ++i ){
		switch( t[i] ){

		default:
		bad:
			uerror( "illegal type combination" );
			return( INT );

		case UNDEF:
			continue;

		case UNSIGNED:
			if( unsg != INT ) goto bad;
			unsg = UNSIGNED;
			continue;

		case LONG:
		case SHORT:
			if( adj != INT ) goto bad;
			adj = t[i];
			continue;

		case INT:
		case CHAR:
		case FLOAT:
			if( noun != UNDEF ) goto bad;
			noun = t[i];
			continue;
			}
		}

	/* now, construct final type */
	if( noun == UNDEF ) noun = INT;
	else if( noun == FLOAT ){
		if( unsg != INT || adj == SHORT ) goto bad;
		return( adj==LONG ? DOUBLE : FLOAT );
		}
	else if( noun == CHAR && adj != INT ) goto bad;

	/* now, noun is INT or CHAR */
	if( adj != INT ) noun = adj;
	if( unsg == UNSIGNED ) return( noun + (UNSIGNED-INT) );
	else return( noun );
	}

NODE *
tymerge( typ, idp ) NODE *typ, *idp; {
	/* merge type typ with identifier idp  */

	register unsigned t;
	register i;
	extern int eprint();

	if( typ->in.op != TYPE ) cerror( "tymerge: arg 1" );
	if(idp == NIL ) return( NIL );

# ifndef BUG1
	if( ddebug > 2 ) fwalk( idp, eprint, 0 );
# endif

	idp->in.type = typ->in.type;
	idp->fn.cdim = curdim;
	tyreduce( idp );
	idp->fn.csiz = typ->fn.csiz;

	for( t=typ->in.type, i=typ->fn.cdim; t&TMASK; t = DECREF(t) ){
		if( ISARY(t) ) dstash( dimtab[i++] );
		}

	/* now idp is a single node: fix up type */

	idp->in.type = ctype( idp->in.type );

	if( (t = BTYPE(idp->in.type)) != STRTY && t != UNIONTY && t != ENUMTY ){
		idp->fn.csiz = t;  /* in case ctype has rewritten things */
		}

	return( idp );
	}

tyreduce( p ) register NODE *p; {

	/* build a type, and stash away dimensions, from a parse tree of the declaration */
	/* the type is build top down, the dimensions bottom up */
	register o, temp;
	register unsigned t;

	o = p->in.op;
	p->in.op = FREE;

	if( o == NAME ) return;

	t = INCREF( p->in.type );
	if( o == UNARY CALL ) t += (FTN-PTR);
	else if( o == LB ){
		t += (ARY-PTR);
		temp = p->in.right->tn.lval;
		p->in.right->in.op = FREE;
		}

	p->in.left->in.type = t;
	tyreduce( p->in.left );

	if( o == LB ) dstash( temp );

	p->tn.rval = p->in.left->tn.rval;
	p->in.type = p->in.left->in.type;

	}

fixtype( p, class ) register NODE *p; {
	register unsigned t, type;
	register mod1, mod2;
	/* fix up the types, and check for legality */

	if( (type = p->in.type) == UNDEF ) return;
	if( mod2 = (type&TMASK) ){
		t = DECREF(type);
		while( mod1=mod2, mod2 = (t&TMASK) ){
			if( mod1 == ARY && mod2 == FTN ){
				uerror( "array of functions is illegal" );
				type = 0;
				}
			else if( mod1 == FTN && ( mod2 == ARY || mod2 == FTN ) ){
				uerror( "function returns illegal type" );
				type = 0;
				}
			t = DECREF(t);
			}
		}

	/* detect function arguments, watching out for structure declarations */
	/* for example, beware of f(x) struct [ int a[10]; } *x; { ... } */
	/* the danger is that "a" will be converted to a pointer */

	if( class==SNULL && blevel==1 && !(instruct&(INSTRUCT|INUNION)) ) class = PARAM;
	if( class == PARAM || ( class==REGISTER && blevel==1 ) ){
		if( type == FLOAT ) type = DOUBLE;
		else if( ISARY(type) ){
			++p->fn.cdim;
			type += (PTR-ARY);
			}
		else if( ISFTN(type) ){
			werror( "a function is declared as an argument" );
			type = INCREF(type);
			}

		}

	if( instruct && ISFTN(type) ){
		uerror( "function illegal in structure or union" );
		type = INCREF(type);
		}
	p->in.type = type;
	}

uclass( class ) register class; {
	/* give undefined version of class */
	if( class == SNULL ) return( EXTERN );
	else if( class == STATIC ) return( USTATIC );
	else if( class == FORTRAN ) return( UFORTRAN );
	else return( class );
	}

fixclass( class, type ) TWORD type; {

	/* first, fix null class */

	if( class == SNULL ){
		if( instruct&INSTRUCT ) class = MOS;
		else if( instruct&INUNION ) class = MOU;
		else if( blevel == 0 ) class = EXTDEF;
		else if( blevel == 1 ) class = PARAM;
		else class = AUTO;

		}

	/* now, do general checking */

	if( ISFTN( type ) ){
		switch( class ) {
		default:
			uerror( "function has illegal storage class" );
		case AUTO:
			class = EXTERN;
		case EXTERN:
		case EXTDEF:
		case FORTRAN:
		case TYPEDEF:
		case STATIC:
		case UFORTRAN:
		case USTATIC:
			;
			}
		}

	if( class&FIELD ){
		if( !(instruct&INSTRUCT) ) uerror( "illegal use of field" );
		return( class );
		}

	switch( class ){

	case MOU:
		if( !(instruct&INUNION) ) uerror( "illegal class" );
		return( class );

	case MOS:
		if( !(instruct&INSTRUCT) ) uerror( "illegal class" );
		return( class );

	case MOE:
		if( instruct & (INSTRUCT|INUNION) ) uerror( "illegal class" );
		return( class );

	case REGISTER:
		if( blevel == 0 ) uerror( "illegal register declaration" );
		else if ( ISPTR(type) ) {
		  if( ((regvar>>8)&0377) >= MINRVAR && cisreg( type ) ) return( class );
		} else {
		  if( (regvar&0377) >= MINRVAR && cisreg( type ) ) return( class );
		}
		if( blevel == 1 ) return( PARAM );
		else return( AUTO );

	case AUTO:
	case LABEL:
	case ULABEL:
		if( blevel < 2 ) uerror( "illegal class" );
		return( class );

	case PARAM:
		if( blevel != 1 ) uerror( "illegal class" );
		return( class );

	case UFORTRAN:
	case FORTRAN:
# ifdef NOFORTRAN
			NOFORTRAN;    /* a condition which can regulate the FORTRAN usage */
# endif
		if( !ISFTN(type) ) uerror( "fortran declaration must apply to function" );
		else {
			type = DECREF(type);
			if( ISFTN(type) || ISARY(type) || ISPTR(type) ) {
				uerror( "fortran function has wrong type" );
				}
			}
	case STNAME:
	case UNAME:
	case ENAME:
	case EXTERN:
	case STATIC:
	case EXTDEF:
	case TYPEDEF:
	case USTATIC:
		return( class );

	default:
		cerror( "illegal class: %d", class );
		/* NOTREACHED */

		}
	}

struct symtab *
mknonuniq(idindex) int *idindex; {/* locate a symbol table entry for */
	/* an occurrence of a nonunique structure member name */
	/* or field */
	register i;
	register struct symtab * sp;
	char *p,*q;

	sp = & stab[ i= *idindex ]; /* position search at old entry */
	while( sp->stype != TNULL ){ /* locate unused entry */
		if( ++i >= SYMTSZ ){/* wrap around symbol table */
			i = 0;
			sp = stab;
			}
		else ++sp;
		if( i == *idindex ) cerror("Symbol table full");
		}
	sp->sflags = SNONUNIQ | SMOS;
	p = sp->sname;
	q = stab[*idindex].sname; /* old entry name */
#ifdef FLEXNAMES
	sp->sname = stab[*idindex].sname;
#endif
# ifndef BUG1
	if( ddebug ){
		printf("\tnonunique entry for %s from %d to %d\n",
			q, *idindex, i );
		}
# endif
	*idindex = i;
#ifndef FLEXNAMES
	for( i=1; i<=NCHNAM; ++i ){ /* copy name */
		if( *p++ = *q /* assign */ ) ++q;
		}
#endif
	return ( sp );
	}

lookup( name, s) char *name; { 
	/* look up name: must agree with s w.r.t. STAG, SMOS and SHIDDEN */

	register char *p, *q;
	int i, j, ii;
	register struct symtab *sp;

	/* compute initial hash index */
# ifndef BUG1
	if( ddebug > 2 ){
		printf( "lookup( %.8s, %d ), stwart=%d, instruct=%d\n", name, s, stwart, instruct );
		}
# endif

	i = 0;
#ifndef FLEXNAMES
	for( p=name, j=0; *p != '\0'; ++p ){
		i += *p;
		if( ++j >= NCHNAM ) break;
		}
#else
	i = (int)name;
#endif
	/* this will not have overflowed, since NCHNAM is small relative to
	/* the wordsize... */
	i = i%SYMTSZ;
	sp = &stab[ii=i];

	for(;;){ /* look for name */

		if( sp->stype == TNULL ){ /* empty slot */
			sp->sflags = s;  /* set STAG, SMOS if needed, turn off all others */
#ifndef FLEXNAMES
			p = sp->sname;
			for( j=0; j<NCHNAM; ++j ) if( *p++ = *name ) ++name;
#else
			sp->sname = name;
#endif
			sp->stype = UNDEF;
			sp->sclass = SNULL;
			return( i );
			}
		if( (sp->sflags & (STAG|SMOS|SHIDDEN)) != s ) goto next;
		p = sp->sname;
		q = name;
#ifndef FLEXNAMES
		for( j=0; j<NCHNAM;++j ){
			if( *p++ != *q ) goto next;
			if( !*q++ ) break;
			}
		return( i );
#else
		if (p == q)
			return ( i );
#endif
	next:
		if( ++i >= SYMTSZ ){
			i = 0;
			sp = stab;
			}
		else ++sp;
		if( i == ii ) cerror( "symbol table full" );
		}
	}

#ifndef checkst
/* if not debugging, make checkst a macro */
checkst(lev){
	register int s, i, j;
	register struct symtab *p, *q;

	for( i=0, p=stab; i<SYMTSZ; ++i, ++p ){
		if( p->stype == TNULL ) continue;
		j = lookup( p->sname, p->sflags&(SMOS|STAG) );
		if( j != i ){
			q = &stab[j];
			if( q->stype == UNDEF ||
			    q->slevel <= p->slevel ){
#ifndef FLEXNAMES
				cerror( "check error: %.8s", q->sname );
#else
				cerror( "check error: %s", q->sname );
#endif
				}
			}
#ifndef FLEXNAMES
		else if( p->slevel > lev ) cerror( "%.8s check at level %d", p->sname, lev );
#else
		else if( p->slevel > lev ) cerror( "%s check at level %d", p->sname, lev );
#endif
		}
	}
#endif

struct symtab *
relook(p) register struct symtab *p; {  /* look up p again, and see where it lies */

	register struct symtab *q;

	/* I'm not sure that this handles towers of several hidden definitions in all cases */
	q = &stab[lookup( p->sname, p->sflags&(STAG|SMOS|SHIDDEN) )];
	/* make relook always point to either p or an empty cell */
	if( q->stype == UNDEF ){
		q->stype = TNULL;
		return(q);
		}
	while( q != p ){
		if( q->stype == TNULL ) break;
		if( ++q >= &stab[SYMTSZ] ) q=stab;
		}
	return(q);
	}

clearst( lev ){ /* clear entries of internal scope  from the symbol table */
	register struct symtab *p, *q, *r;
	register int temp, rehash;

	temp = lineno;
	aobeg();

	/* first, find an empty slot to prevent newly hashed entries from
	   being slopped into... */

	for( q=stab; q< &stab[SYMTSZ]; ++q ){
		if( q->stype == TNULL )goto search;
		}

	cerror( "symbol table full");

	search:
	p = q;

	for(;;){
		if( p->stype == TNULL ) {
			rehash = 0;
			goto next;
			}
		lineno = p->suse;
		if( lineno < 0 ) lineno = - lineno;
		if( p->slevel>lev ){ /* must clobber */
			if( p->stype == UNDEF || ( p->sclass == ULABEL && lev < 2 ) ){
				lineno = temp;
#ifndef FLEXNAMES
				uerror( "%.8s undefined", p->sname );
#else
				uerror( "%s undefined", p->sname );
#endif
				}
			else aocode(p);
# ifndef BUG1
#ifndef FLEXNAMES
			if (ddebug) printf("removing %8s from stab[ %d], flags %o level %d\n",
#else
			if (ddebug) printf("removing %s from stab[ %d], flags %o level %d\n",
#endif
				p->sname,p-stab,p->sflags,p->slevel);
# endif
			if( p->sflags & SHIDES ) unhide(p);
			p->stype = TNULL;
			rehash = 1;
			goto next;
			}
		if( rehash ){
			if( (r=relook(p)) != p ){
				movestab( r, p );
				p->stype = TNULL;
				}
			}
		next:
		if( ++p >= &stab[SYMTSZ] ) p = stab;
		if( p == q ) break;
		}
	lineno = temp;
	aoend();
	}

movestab( p, q ) register struct symtab *p, *q; {
	int k;
	/* structure assignment: *p = *q; */
	p->stype = q->stype;
	p->sclass = q->sclass;
	p->slevel = q->slevel;
	p->offset = q->offset;
	p->sflags = q->sflags;
	p->dimoff = q->dimoff;
	p->sizoff = q->sizoff;
	p->suse = q->suse;
#ifndef FLEXNAMES
	for( k=0; k<NCHNAM; ++k ){
		p->sname[k] = q->sname[k];
		}
#else
	p->sname = q->sname;
#endif
	}

hide( p ) register struct symtab *p; {
	register struct symtab *q;
	for( q=p+1; ; ++q ){
		if( q >= &stab[SYMTSZ] ) q = stab;
		if( q == p ) cerror( "symbol table full" );
		if( q->stype == TNULL ) break;
		}
	movestab( q, p );
	p->sflags |= SHIDDEN;
	q->sflags = (p->sflags&(SMOS|STAG)) | SHIDES;
#ifndef FLEXNAMES
	if( hflag ) werror( "%.8s redefinition hides earlier one", p->sname );
#else
	if( hflag ) werror( "%s redefinition hides earlier one", p->sname );
#endif
# ifndef BUG1
	if( ddebug ) printf( "	%d hidden in %d\n", p-stab, q-stab );
# endif
	return( idname = q-stab );
	}

unhide( p ) register struct symtab *p; {
	register struct symtab *q;
	register s, j;

	s = p->sflags & (SMOS|STAG);
	q = p;

	for(;;){

		if( q == stab ) q = &stab[SYMTSZ-1];
		else --q;

		if( q == p ) break;

		if( (q->sflags&(SMOS|STAG)) == s ){
#ifndef FLEXNAMES
			for( j =0; j<NCHNAM; ++j ) if( p->sname[j] != q->sname[j] ) break;
			if( j == NCHNAM ){ /* found the name */
#else
			if (p->sname == q->sname) {
#endif
				q->sflags &= ~SHIDDEN;
# ifndef BUG1
				if( ddebug ) printf( "unhide uncovered %d from %d\n", q-stab,p-stab);
# endif
				return;
				}
			}

		}
	cerror( "unhide fails" );
	}
ebugging, make checkst a macro */
checkst(lev){
	register int s, i, j;
	register struct symtab *p, *q;

	for( i=0, p=stab; i<SYMTSZ; ++i, ++p ){
		if( p->stype == TNULL ) continue;sumacc/cc/ccom/reader.c   444      0     12       62037  3470501552  10246 # include "mfile2"

/*	some storage declarations */

# ifndef ONEPASS
NODE node[TREESZ];
char filename[100] = "";  /* the name of the file */
int ftnno;  /* number of current function */
int lineno;
# else
# define NOMAIN
#endif

int nrecur;
int lflag;
int nospflag;
int edebug = 0;
int xdebug = 0;
int udebug = 0;

OFFSZ tmpoff;  /* offset for first temporary, in bits for current block */
OFFSZ maxoff;  /* maximum temporary offset over all blocks in current ftn, in bits */
int maxtreg;

NODE *stotree;
int stocook;

OFFSZ baseoff = 0;
OFFSZ maxtemp = 0;

int fldtyp;

p2init( argc, argv ) char *argv[];{
	/* set the values of the pass 2 arguments */

	register int c;
	register char *cp;
	register files;

	allo0();  /* free all regs */
	files = 0;

	for( c=1; c<argc; ++c ){
		if( *(cp=argv[c]) == '-' ){
			while( *++cp ){
				switch( *cp ){

				case 'X':  /* pass1 flags */
					while( *++cp ) { /* VOID */ }
					--cp;
					break;

				case 'l':  /* linenos */
					++lflag;
					break;

				case 'e':  /* expressions */
					++edebug;
					break;

				case 'o':  /* orders */
					++odebug;
					break;

				case 'r':  /* register allocation */
					++rdebug;
					break;

				case 'a':  /* rallo */
					++radebug;
					break;

				case 't':  /* ttype calls */
					++tdebug;
					break;

				case 's':  /* suppress stack probe ? */
					if( cp[1] == 'p' )
					{
						nospflag++;
						cp++;
					}
					else	/* or shapes */
						++sdebug;
					break;

				case 'u':  /* Sethi-Ullman testing (machine dependent) */
					++udebug;
					break;

				case 'x':  /* general machine-dependent debugging flag */
					++xdebug;
					break;

				default:
					cerror( "bad option: %c", *cp );
					}
				}
			}
		else files = 1;  /* assumed to be a filename */
		}

	mkdope();
	setrew();
	return( files );

	}

# ifndef NOMAIN

mainp2( argc, argv ) char *argv[]; {
	register files;
	register temp;
	register c;
	register char *cp;
	register NODE *p;

	files = p2init( argc, argv );
	tinit();

	reread:

	if( files ){
		while( files < argc && argv[files][0] == '-' ) {
			++files;
			}
		if( files > argc ) return( nerrors );
		freopen( argv[files], "r", stdin );
		}
	while( (c=getchar()) > 0 ) switch( c ){
	case ')':
		/* copy line unchanged */
		while( (c=getchar()) > 0 ){
			PUTCHAR(c);
			if( c == '\n' ) break;
			}
		continue;

	case '[':
		/* beginning of a block */
		temp = rdin(10);  /* ftnno */
		tmpoff = baseoff = rdin(10); /* autooff for block gives max offset of autos in block */
		maxtreg = rdin(10);
		if( getchar() != '\n' ) cerror( "intermediate file format error");

		if( temp != ftnno ){ /* beginning of function */
			maxoff = baseoff;
			ftnno = temp;
			maxtemp = 0;
			}
		else {
			if( baseoff > maxoff ) maxoff = baseoff;
			/* maxoff at end of ftn is max of autos and temps
			   over all blocks in the function */
			}
		setregs();
		continue;

	case ']':  /* end of block */
		SETOFF( maxoff, ALSTACK );
		eobl2();
		while( (c=getchar()) != '\n' ){
			if( c <= 0 ) cerror( "intermediate file format eof" );
			}
		continue;

	case '.':
		/* compile code for an expression */
		lineno = rdin( 10 );
		for( cp=filename; (*cp=getchar()) != '\n'; ++cp ) ; /* VOID, reads filename */
		*cp = '\0';
		if( lflag ) lineid( lineno, filename );

		tmpoff = baseoff;  /* expression at top level reuses temps */
		p = eread();

# ifndef BUG4
		if( edebug ) fwalk( p, eprint, 0 );
# endif

# ifdef MYREADER
		MYREADER(p);  /* do your own laundering of the input */
# endif

		nrecur = 0;
		delay( p );  /* expression statement  throws out results */
		reclaim( p, RNULL, 0 );

		allchk();
		tcheck();
		continue;

	default:
		cerror( "intermediate file format error" );

		}

	/* EOF */
	if( files ) goto reread;
	return(nerrors);

	}

# endif

# ifdef ONEPASS

p2compile( p ) NODE *p; {

	if( lflag ) lineid( lineno, filename );
	tmpoff = baseoff;  /* expression at top level reuses temps */
	/* generate code for the tree p */
# ifndef BUG4
	if( edebug ) fwalk( p, eprint, 0 );
# endif

# ifdef MYREADER
	MYREADER(p);  /* do your own laundering of the input */
# endif
	nrecur = 0;
	delay( p );  /* do the code generation */
	reclaim( p, RNULL, 0 );
	allchk();
	/* can't do tcheck here; some stuff (e.g., attributes) may be around from first pass */
	/* first pass will do it... */
	}

p2bbeg( aoff, myreg ) {
	static int myftn = -1;
	tmpoff = baseoff = aoff;
	maxtreg = myreg;
	if( myftn != ftnno ){ /* beginning of function */
		maxoff = baseoff;
		myftn = ftnno;
		maxtemp = 0;
		}
	else {
		if( baseoff > maxoff ) maxoff = baseoff;
		/* maxoff at end of ftn is max of autos and temps over all blocks */
		}
	setregs();
	}

p2bend(){
	SETOFF( maxoff, ALSTACK );
	eobl2();
	}

# endif

NODE *deltrees[DELAYS];
int deli;

delay( p ) register NODE *p; {
	/* look in all legal places for COMOP's and ++ and -- ops to delay */
	/* note; don't delay ++ and -- within calls or things like
	/* getchar (in their macro forms) will start behaving strangely */
	register i;

	/* look for visible COMOPS, and rewrite repeatedly */

	while( delay1( p ) ) { /* VOID */ }

	/* look for visible, delayable ++ and -- */

	deli = 0;
	delay2( p );
	codgen( p, FOREFF );  /* do what is left */
	for( i = 0; i<deli; ++i ) codgen( deltrees[i], FOREFF );  /* do the rest */
	}

delay1( p ) register NODE *p; {  /* look for COMOPS */
	register o, ty;

	o = p->in.op;
	ty = optype( o );
	if( ty == LTYPE ) return( 0 );
	else if( ty == UTYPE ) return( delay1( p->in.left ) );

	switch( o ){

	case QUEST:
	case ANDAND:
	case OROR:
		/* don't look on RHS */
		return( delay1(p->in.left ) );

	case COMOP:  /* the meat of the routine */
		delay( p->in.left );  /* completely evaluate the LHS */
		/* rewrite the COMOP */
		{ register NODE *q;
			q = p->in.right;
			ncopy( p, p->in.right );
			q->in.op = FREE;
			}
		return( 1 );
		}

	return( delay1(p->in.left) || delay1(p->in.right ) );
	}

delay2( p ) register NODE *p; {

	/* look for delayable ++ and -- operators */

	register o, ty;
	o = p->in.op;
	ty = optype( o );

	switch( o ){

	case NOT:
	case QUEST:
	case ANDAND:
	case OROR:
	case CALL:
	case UNARY CALL:
	case STCALL:
	case UNARY STCALL:
	case FORTCALL:
	case UNARY FORTCALL:
	case COMOP:
	case CBRANCH:
		/* for the moment, don7t delay past a conditional context, or
		/* inside of a call */
		return;

	case INCR:
	case DECR:
		if( deltest( p ) ){
			if( deli < DELAYS ){
				register NODE *q;
				deltrees[deli++] = tcopy(p);
				q = p->in.left;
				p->in.right->in.op = FREE;  /* zap constant */
				ncopy( p, q );
				q->in.op = FREE;
				return;
				}
			}

		}

	if( ty == BITYPE ) delay2( p->in.right );
	if( ty != LTYPE ) delay2( p->in.left );
	}

codgen( p, cookie ) NODE *p; {

	/* generate the code for p;
	   order may call codgen recursively */
	/* cookie is used to describe the context */

	for(;;){
		canon(p);  /* creats OREG from * if possible and does sucomp */
		stotree = NIL;
# ifndef BUG4
		if( edebug ){
			printf( "store called on:\n" );
			fwalk( p, eprint, 0 );
			}
# endif
		store(p);
		if( stotree==NIL ) break;

		/* because it's minimal, can do w.o. stores */

		order( stotree, stocook );
		}

	order( p, cookie );

	}

# ifndef BUG4
char *cnames[] = {
	"SANY",
	"SAREG",
	"STAREG",
	"SBREG",
	"STBREG",
	"SCC",
	"SNAME",
	"SCON",
	"SFLD",
	"SOREG",
	"STARNM",
	"STARREG",
	"INTEMP",
	"FORARG",
	"SWADD",
	0,
	};

prcook( cookie ){

	/* print a nice-looking description of cookie */

	int i, flag;

	if( cookie & SPECIAL ){
		if( cookie == SZERO ) printf( "SZERO" );
		else if( cookie == SONE ) printf( "SONE" );
		else if( cookie == SMONE ) printf( "SMONE" );
		else printf( "SPECIAL+%d", cookie & ~SPECIAL );
		return;
		}

	flag = 0;
	for( i=0; cnames[i]; ++i ){
		if( cookie & (1<<i) ){
			if( flag ) printf( "|" );
			++flag;
			printf( cnames[i] );
			}
		}

	}
# endif

int odebug = 0;

order(p,cook) NODE *p; {

	register o, ty, m;
	int m1;
	int cookie;
	NODE *p1, *p2;

	cookie = cook;
	rcount();
	canon(p);
	rallo( p, p->in.rall );
	goto first;
	/* by this time, p should be able to be generated without stores;
	   the only question is how */

	again:

	cookie = cook;
	rcount();
	canon(p);
	rallo( p, p->in.rall );
	/* if any rewriting and canonicalization has put
	 * the tree (p) into a shape that cook is happy
	 * with (exclusive of FOREFF, FORREW, and INTEMP)
	 * then we are done.
	 * this allows us to call order with shapes in
	 * addition to cookies and stop short if possible.
	 */
	if( tshape(p, cook &(~(FOREFF|FORREW|INTEMP))) )return;

	first:
# ifndef BUG4
	if( odebug ){
		printf( "order( %o, ", p );
		prcook( cookie );
		printf( " )\n" );
		fwalk( p, eprint, 0 );
		}
# endif

	o = p->in.op;
	ty = optype(o);

	/* first of all, for most ops, see if it is in the table */

	/* look for ops */

	switch( m = p->in.op ){

	default:
		/* look for op in table */
		for(;;){
			if( (m = match( p, cookie ) ) == MDONE ) goto cleanup;
			else if( m == MNOPE ){
				if( !(cookie = nextcook( p, cookie ) ) ) goto nomat;
				continue;
				}
			else break;
			}
		break;

	case COMOP:
	case FORCE:
	case CBRANCH:
	case QUEST:
	case ANDAND:
	case OROR:
	case NOT:
	case UNARY CALL:
	case CALL:
	case UNARY STCALL:
	case STCALL:
	case UNARY FORTCALL:
	case FORTCALL:
		/* don't even go near the table... */
		;

		}
	/* get here to do rewriting if no match or
	   fall through from above for hard ops */

	p1 = p->in.left;
	if( ty == BITYPE ) p2 = p->in.right;
	else p2 = NIL;
	
# ifndef BUG4
	if( odebug ){
		printf( "order( %o, ", p );
		prcook( cook );
		printf( " ), cookie " );
		prcook( cookie );
		printf( ", rewrite %s\n", opst[m] );
		}
# endif
	switch( m ){
	default:
		nomat:
		cerror( "no table entry for op %s", opst[p->in.op] );

	case COMOP:
		codgen( p1, FOREFF );
		p2->in.rall = p->in.rall;
		codgen( p2, cookie );
		ncopy( p, p2 );
		p2->in.op = FREE;
		goto cleanup;

	case FORCE:
		/* recurse, letting the work be done by rallo */
		p = p->in.left;
		cook = INTAREG|INTBREG;
		goto again;

	case CBRANCH:
		o = p2->tn.lval;
		cbranch( p1, -1, o );
		p2->in.op = FREE;
		p->in.op = FREE;
		return;

	case QUEST:
		cbranch( p1, -1, m=getlab() );
		p2->in.left->in.rall = p->in.rall;
		codgen( p2->in.left, INTAREG|INTBREG );
		/* force right to compute result into same reg used by left */
		p2->in.right->in.rall = p2->in.left->tn.rval|MUSTDO;
		reclaim( p2->in.left, RNULL, 0 );
		cbgen( 0, m1 = getlab(), 'I' );
		deflab( m );
		codgen( p2->in.right, INTAREG|INTBREG );
		deflab( m1 );
		p->in.op = REG;  /* set up node describing result */
		p->tn.lval = 0;
		p->tn.rval = p2->in.right->tn.rval;
		p->in.type = p2->in.right->in.type;
		tfree( p2->in.right );
		p2->in.op = FREE;
		goto cleanup;

	case ANDAND:
	case OROR:
	case NOT:  /* logical operators */
		/* if here, must be a logical operator for 0-1 value */
		cbranch( p, -1, m=getlab() );
		p->in.op = CCODES;
		p->bn.label = m;
		order( p, INTAREG );
		goto cleanup;

	case FLD:	/* fields of funny type */
		if ( p1->in.op == UNARY MUL ){
			offstar( p1->in.left, cookie );
			goto again;
			}

	case UNARY MINUS:
		order( p1, INBREG|INAREG );
		goto again;

	case NAME:
		/* all leaves end up here ... */
		if( o == REG ) goto nomat;
		order( p, INTAREG|INTBREG );
		goto again;

	case INIT:
		uerror( "illegal initialization" );
		return;

	case UNARY FORTCALL:
		p->in.right = NIL;
	case FORTCALL:
		o = p->in.op = UNARY FORTCALL;
		if( genfcall( p, cookie ) ) goto nomat;
		goto cleanup;

	case UNARY CALL:
		p->in.right = NIL;
	case CALL:
		o = p->in.op = UNARY CALL;
		if( gencall( p, cookie ) ) goto nomat;
		goto cleanup;

	case UNARY STCALL:
		p->in.right = NIL;
	case STCALL:
		o = p->in.op = UNARY STCALL;
		if( genscall( p, cookie ) ) goto nomat;
		goto cleanup;

		/* if arguments are passed in register, care must be taken that reclaim
		/* not throw away the register which now has the result... */

	case UNARY MUL:
		if( cook == FOREFF ){
			/* do nothing */
			order( p->in.left, FOREFF );
			p->in.op = FREE;
			return;
			}
		offstar( p->in.left, cookie );
		goto again;

	case INCR:  /* INCR and DECR */
		if( setincr(p, cookie) ) goto again;

		/* x++ becomes (x += 1) -1; */

		if( cook & FOREFF ){  /* result not needed so inc or dec and be done with it */
			/* x++ => x += 1 */
			p->in.op = (p->in.op==INCR)?ASG PLUS:ASG MINUS;
			goto again;
			}

		p1 = tcopy(p);
		reclaim( p->in.left, RNULL, 0 );
		p->in.left = p1;
		p1->in.op = (p->in.op==INCR)?ASG PLUS:ASG MINUS;
		p->in.op = (p->in.op==INCR)?MINUS:PLUS;
		goto again;

	case STASG:
		if( setstr( p, cookie ) ) goto again;
		goto nomat;

	case ASG PLUS:  /* and other assignment ops */
		if( setasop(p, cookie) ) goto again;

		/* there are assumed to be no side effects in LHS */

		p2 = tcopy(p);
		p->in.op = ASSIGN;
		reclaim( p->in.right, RNULL, 0 );
		p->in.right = p2;
		canon(p);
		rallo( p, p->in.rall );

# ifndef BUG4
		if( odebug ) fwalk( p, eprint, 0 );
# endif

		order( p2->in.left, INTBREG|INTAREG );
		order( p2, INTBREG|INTAREG );
		goto again;

	case ASSIGN:
		if( setasg( p, cookie ) ) goto again;
		goto nomat;


	case BITYPE:
		if( setbin( p, cookie ) ) goto again;
		/* try to replace binary ops by =ops */
		switch(o){

		case PLUS:
		case MINUS:
		case MUL:
		case DIV:
		case MOD:
		case AND:
		case OR:
		case ER:
		case LS:
		case RS:
			p->in.op = ASG o;
			goto again;
			}
		goto nomat;

		}

	cleanup:

	/* if it is not yet in the right state, put it there */

	if( cook & FOREFF ){
		reclaim( p, RNULL, 0 );
		return;
		}

	if( p->in.op==FREE ) return;

	if( tshape( p, cook ) ) return;

	if( (m=match(p,cook) ) == MDONE ) return;

	/* we are in bad shape, try one last chance */
	if( lastchance( p, cook ) ) goto again;

	goto nomat;
	}

int callflag;
int fregs;

store( p ) register NODE *p; {

	/* find a subtree of p which should be stored */

	register o, ty;

	o = p->in.op;
	ty = optype(o);

	if( ty == LTYPE ) return;

	switch( o ){

	case UNARY CALL:
	case UNARY FORTCALL:
	case UNARY STCALL:
		++callflag;
		break;

	case UNARY MUL:
		if( asgop(p->in.left->in.op) ) stoasg( p->in.left, UNARY MUL );
		break;

	case CALL:
	case FORTCALL:
	case STCALL:
		store( p->in.left );
		stoarg( p->in.right, o );
		++callflag;
		return;

	case COMOP:
		markcall( p->in.right );
		if( p->in.right->in.su > fregs ) SETSTO( p, INTEMP );
		store( p->in.left );
		return;

	case ANDAND:
	case OROR:
	case QUEST:
		markcall( p->in.right );
		if( p->in.right->in.su > fregs ) SETSTO( p, INTEMP );
	case CBRANCH:   /* to prevent complicated expressions on the LHS from being stored */
	case NOT:
		constore( p->in.left );
		return;

		}

	if( ty == UTYPE ){
		store( p->in.left );
		return;
		}

	if( asgop( p->in.right->in.op ) ) stoasg( p->in.right, o );

	if( p->in.su>fregs ){ /* must store */
		mkadrs( p );  /* set up stotree and stocook to subtree
				 that must be stored */
		}

	store( p->in.right );
	store( p->in.left );
	}

constore( p ) register NODE *p; {

	/* store conditional expressions */
	/* the point is, avoid storing expressions in conditional
	   conditional context, since the evaluation order is predetermined */

	switch( p->in.op ) {

	case ANDAND:
	case OROR:
	case QUEST:
		markcall( p->in.right );
	case NOT:
		constore( p->in.left );
		return;

		}

	store( p );
	}

markcall( p ) register NODE *p; {  /* mark off calls below the current node */

	again:
	switch( p->in.op ){

	case UNARY CALL:
	case UNARY STCALL:
	case UNARY FORTCALL:
	case CALL:
	case STCALL:
	case FORTCALL:
		++callflag;
		return;

		}

	switch( optype( p->in.op ) ){

	case BITYPE:
		markcall( p->in.right );
	case UTYPE:
		p = p->in.left;
		/* eliminate recursion (aren't I clever...) */
		goto again;
	case LTYPE:
		return;
		}

	}

stoarg( p, calltype ) register NODE *p; {
	/* arrange to store the args */

	if( p->in.op == CM ){
		stoarg( p->in.left, calltype );
		p = p->in.right ;
		}
	if( calltype == CALL ){
		STOARG(p);
		}
	else if( calltype == STCALL ){
		STOSTARG(p);
		}
	else {
		STOFARG(p);
		}
	callflag = 0;
	store(p);
# ifndef NESTCALLS
	if( callflag ){ /* prevent two calls from being active at once  */
		SETSTO(p,INTEMP);
		store(p); /* do again to preserve bottom up nature....  */
		}
#endif
	}

int negrel[] = { NE, EQ, GT, GE, LT, LE, UGT, UGE, ULT, ULE } ;  /* negatives of relationals */

cbranch( p, true, false ) NODE *p; {
	/* evaluate p for truth value, and branch to true or false
	/* accordingly: label <0 means fall through */

	register o, lab, flab, tlab;

	lab = -1;

	switch( o=p->in.op ){

	case ULE:
	case ULT:
	case UGE:
	case UGT:
	case EQ:
	case NE:
	case LE:
	case LT:
	case GE:
	case GT:
		if( true < 0 ){
			o = p->in.op = negrel[ o-EQ ];
			true = false;
			false = -1;
			}
#ifndef NOOPT
		if( p->in.right->in.op == ICON && p->in.right->tn.lval == 0 && p->in.right->in.name[0] == '\0' ){
			switch( o ){

			case UGT:
			case ULE:
				o = p->in.op = (o==UGT)?NE:EQ;
			case EQ:
			case NE:
			case LE:
			case LT:
			case GE:
			case GT:
				if( logop(p->in.left->in.op) ){
					/* strange situation: e.g., (a!=0) == 0 */
					/* must prevent reference to p->in.left->lable, so get 0/1 */
					/* we could optimize, but why bother */
					codgen( p->in.left, INAREG|INBREG );
					}
				codgen( p->in.left, FORCC );
				cbgen( o, true, 'I' );
				break;

			case UGE:
				codgen(p->in.left, FORCC);
				cbgen( 0, true, 'I' );  /* unconditional branch */
				break;
			case ULT:
				codgen(p->in.left, FORCC);
				}
			}
		else
#endif
			{
			p->bn.label = true;
			codgen( p, FORCC );
			}
		if( false>=0 ) cbgen( 0, false, 'I' );
		reclaim( p, RNULL, 0 );
		return;

	case ANDAND:
		lab = false<0 ? getlab() : false ;
		cbranch( p->in.left, -1, lab );
		cbranch( p->in.right, true, false );
		if( false < 0 ) deflab( lab );
		p->in.op = FREE;
		return;

	case OROR:
		lab = true<0 ? getlab() : true;
		cbranch( p->in.left, lab, -1 );
		cbranch( p->in.right, true, false );
		if( true < 0 ) deflab( lab );
		p->in.op = FREE;
		return;

	case NOT:
		cbranch( p->in.left, false, true );
		p->in.op = FREE;
		break;

	case COMOP:
		codgen( p->in.left, FOREFF );
		p->in.op = FREE;
		cbranch( p->in.right, true, false );
		return;

	case QUEST:
		flab = false<0 ? getlab() : false;
		tlab = true<0 ? getlab() : true;
		cbranch( p->in.left, -1, lab = getlab() );
		cbranch( p->in.right->in.left, tlab, flab );
		deflab( lab );
		cbranch( p->in.right->in.right, true, false );
		if( true < 0 ) deflab( tlab);
		if( false < 0 ) deflab( flab );
		p->in.right->in.op = FREE;
		p->in.op = FREE;
		return;

	case ICON:
		if( p->in.type != FLOAT && p->in.type != DOUBLE ){

			if( p->tn.lval || p->in.name[0] ){
				/* addresses of C objects are never 0 */
				if( true>=0 ) cbgen( 0, true, 'I' );
				}
			else if( false>=0 ) cbgen( 0, false, 'I' );
			p->in.op = FREE;
			return;
			}
		/* fall through to default with other strange constants */

	default:
		/* get condition codes */
		codgen( p, FORCC );
		if( true >= 0 ) cbgen( NE, true, 'I' );
		if( false >= 0 ) cbgen( true >= 0 ? 0 : EQ, false, 'I' );
		reclaim( p, RNULL, 0 );
		return;

		}

	}

rcount(){ /* count recursions */
	if( ++nrecur > NRECUR ){
		cerror( "expression causes compiler loop: try simplifying" );
		}

	}

# ifndef BUG4
eprint( p, down, a, b ) NODE *p; int *a, *b; {

	*a = *b = down+1;
	while( down >= 2 ){
		printf( "\t" );
		down -= 2;
		}
	if( down-- ) printf( "    " );


	printf( "%o) %s", p, opst[p->in.op] );
	switch( p->in.op ) { /* special cases */

	case REG:
		printf( " %s", rnames[p->tn.rval] );
		break;

	case ICON:
	case NAME:
	case OREG:
		printf( " " );
		adrput( p );
		break;

	case STCALL:
	case UNARY STCALL:
	case STARG:
	case STASG:
		printf( " size=%d", p->stn.stsize );
		printf( " align=%d", p->stn.stalign );
		break;
		}

	printf( ", " );
	tprint( p->in.type );
	printf( ", " );
	if( p->in.rall == NOPREF ) printf( "NOPREF" );
	else {
		if( p->in.rall & MUSTDO ) printf( "MUSTDO " );
		else printf( "PREF " );
		printf( "%s", rnames[p->in.rall&~MUSTDO]);
		}
	printf( ", SU= %d\n", p->in.su );

	}
# endif

# ifndef NOMAIN
NODE *
eread(){

	/* call eread recursively to get subtrees, if any */

	register NODE *p;
	register i, c;
	register char *pc;
	register j;

	i = rdin( 10 );

	p = talloc();

	p->in.op = i;

	i = optype(i);

	if( i == LTYPE ) p->tn.lval = rdin( 10 );
	if( i != BITYPE ) p->tn.rval = rdin( 10 );

	p->in.type = rdin(8 );
	p->in.rall = NOPREF;  /* register allocation information */

	if( p->in.op == STASG || p->in.op == STARG || p->in.op == STCALL || p->in.op == UNARY STCALL ){
		p->stn.stsize = (rdin( 10 ) + (SZCHAR-1) )/SZCHAR;
		p->stn.stalign = rdin(10) / SZCHAR;
		if( getchar() != '\n' ) cerror( "illegal \n" );
		}
	else {   /* usual case */
		if( p->in.op == REG ) rbusy( p->tn.rval, p->in.type );  /* non usually, but sometimes justified */
#ifndef FLEXNAMES
		for( pc=p->in.name,j=0; ( c = getchar() ) != '\n'; ++j ){
			if( j < NCHNAM ) *pc++ = c;
			}
		if( j < NCHNAM ) *pc = '\0';
#else
		{ char buf[BUFSIZ];
		for( pc=buf,j=0; ( c = getchar() ) != '\n'; ++j ){
			if( j < BUFSIZ ) *pc++ = c;
			}
		if( j < BUFSIZ ) *pc = '\0';
		p->in.name = tstr(buf);
		}
#endif
		}

	/* now, recursively read descendents, if any */

	if( i != LTYPE ) p->in.left = eread();
	if( i == BITYPE ) p->in.right = eread();

	return( p );

	}

CONSZ
rdin( base ){
	register sign, c;
	CONSZ val;

	sign = 1;
	val = 0;

	while( (c=getchar()) > 0 ) {
		if( c == '-' ){
			if( val != 0 ) cerror( "illegal -");
			sign = -sign;
			continue;
			}
		if( c == '\t' ) break;
		if( c>='0' && c<='9' ) {
			val *= base;
			if( sign > 0 )
				val += c-'0';
			else
				val -= c-'0';
			continue;
			}
		cerror( "illegal character `%c' on intermediate file", c );
		break;
		}

	if( c <= 0 ) {
		cerror( "unexpected EOF");
		}
	return( val );
	}
# endif

#ifndef FIELDOPS
	/* do this if there is no special hardware support for fields */

ffld( p, down, down1, down2 ) NODE *p; int *down1, *down2; {
	 /* look for fields that are not in an lvalue context, and rewrite them... */
	register NODE *shp;
	register s, o, v, ty;

	*down1 =  asgop( p->in.op );
	*down2 = 0;

	if( !down && p->in.op == FLD ){ /* rewrite the node */

		if( !rewfld(p) ) return;

		v = p->tn.rval;
		s = UPKFSZ(v);
		o = UPKFOFF(v);  /* amount to shift */
		fldtyp = o+s <= SZSHORT? SZSHORT: SZLONG;
		ty = fldtyp==SZSHORT? USHORT: INT;
# ifndef RTOLBYTES
		o = fldtyp - s - o;  /* amount to shift */
#endif

		/* make & mask part */

		p->in.left->in.type = ty;

		p->in.op = AND;
		p->in.right = talloc();
		p->in.right->in.op = ICON;
		p->in.right->in.rall = NOPREF;
		p->in.right->in.type = ty;
		p->in.right->tn.lval = 1;
		p->in.right->tn.rval = 0;
#ifndef FLEXNAMES
		p->in.right->in.name[0] = '\0';
#else
		p->in.right->in.name = "";
#endif
		p->in.right->tn.lval <<= s;
		p->in.right->tn.lval--;

		/* now, if a shift is needed, do it */

		if( o != 0 ){
			shp = talloc();
			shp->in.op = RS;
			shp->in.rall = NOPREF;
			shp->in.type = ty;
			shp->in.left = p->in.left;
			shp->in.right = talloc();
			shp->in.right->in.op = ICON;
			shp->in.right->in.rall = NOPREF;
			shp->in.right->in.type = ty;
			shp->in.right->tn.rval = 0;
			shp->in.right->tn.lval = o;  /* amount to shift */
#ifndef FLEXNAMES
			shp->in.right->in.name[0] = '\0';
#else
			shp->in.right->in.name = "";
#endif
			p->in.left = shp;
			/* whew! */
			}
		}
	}
#endif

oreg2( p ) register NODE *p; {

	/* look for situations where we can turn * into OREG */

	NODE *q;
	register i;
	register r;
	register char *cp;
	register NODE *ql, *qr;
	CONSZ temp;

	if( p->in.op == UNARY MUL ){
		q = p->in.left;
		if( q->in.op == REG ){
			temp = q->tn.lval;
			r = q->tn.rval;
			cp = q->in.name;
			goto ormake;
			}

		if( q->in.op != PLUS && q->in.op != MINUS ) return;
		ql = q->in.left;
		qr = q->in.right;

#ifdef R2REGS

		/* look for doubly indexed expressions */

		if( q->in.op==PLUS && qr->in.op==REG && ql->in.op==REG &&
				(szty(ql->in.type)==1||szty(qr->in.type)==1) ) {
			temp = 0;
			cp = ql->in.name;
			if( *cp ){
				if( *qr->in.name ) return;
				}
			else {
				cp = qr->in.name;
				}
			if( szty(qr->in.type)>1) r = R2PACK(qr->tn.rval,ql->tn.rval);
			else r = R2PACK(ql->tn.rval,qr->tn.rval);
			goto ormake;
			}

		if( (q->in.op==PLUS||q->in.op==MINUS) && qr->in.op==ICON && ql->in.op==PLUS &&
				ql->in.left->in.op==REG &&
				ql->in.right->in.op==REG ){
			temp = qr->tn.lval;
			cp = qr->in.name;
			if( q->in.op == MINUS ){
				if( *cp ) return;
				temp = -temp;
				}
			if( *cp ){
				if( *ql->in.name ) return;
				}
			else {
				cp = ql->in.name;
				}
			r = R2PACK(ql->in.left->tn.rval,ql->in.right->tn.rval);
			goto ormake;
			}

#endif R2REGS

		if( (q->in.op==PLUS || q->in.op==MINUS) && qr->in.op == ICON &&
				ql->in.op==REG && szty(qr->in.type)==1) {
			temp = qr->tn.lval;
			if( q->in.op == MINUS ) temp = -temp;
			r = ql->tn.rval;
			temp += ql->tn.lval;
			cp = qr->in.name;
			if( *cp && ( q->in.op == MINUS || *ql->in.name ) ) return;
			if( !*cp ) cp = ql->in.name;

			ormake:
			if( notoff( p->in.type, r, temp, cp ) ) return;
			p->in.op = OREG;
			p->tn.rval = r;
			p->tn.lval = temp;
#ifndef FLEXNAMES
			for( i=0; i<NCHNAM; ++i )
				p->in.name[i] = *cp++;
#else
			p->in.name = cp;
#endif
			tfree(q);
			return;
			}
		}

	}

canon(p) NODE *p; {
	/* put p in canonical form */
	int oreg2(), sucomp();

#ifndef FIELDOPS
	int ffld();
	fwalk( p, ffld, 0 ); /* look for field operators */
# endif
	walkf( p, oreg2 );  /* look for and create OREG nodes */
#ifdef MYCANON
	MYCANON(p);  /* your own canonicalization routine(s) */
#endif
	walkf( p, sucomp );  /* do the Sethi-Ullman computation */

	}

l *= base;
			if( sign > 0 )
				val += c-'0';
			else
				val -= c-'0';
			continue;
			}
		cerror( "illegal character `%c' on intermediate file", c );
		break;
		}

	if( c <= 0 ) {
		cerror( "unexpected EOF");
		}
	return( val );
	}
# endif

#ifndef FIELDOPS
	/* do this if there is no special hardware support for fields */

ffld( p, down, down1, down2 ) NODE *p; int *down1, *down2; {
	 /* look for fields that are not in an lvalue context, and rewrite them... */
	register NODsumacc/cc/ccom/scan.c   444      0     12       51407  3470501553   7730 # include "mfile1"

#ifdef BOOTSTRAP
#include "/usr/include/ctype.h"
#else
# include <ctype.h>
#endif
	/* temporarily */

int asm_esc = 0; /* asm escaped used in file */
	/* lexical actions */

# define A_ERR 0		/* illegal character */
# define A_LET 1		/* saw a letter */
# define A_DIG 2		/* saw a digit */
# define A_1C 3			/* return a single character */
# define A_STR 4		/* string */
# define A_CC 5			/* character constant */
# define A_BCD 6		/* GCOS BCD constant */
# define A_SL 7			/* saw a / */
# define A_DOT 8		/* saw a . */
# define A_PL 9		/* + */
# define A_MI 10		/* - */
# define A_EQ 11		/* = */
# define A_NOT 12		/* ! */
# define A_LT 13		/* < */
# define A_GT 14		/* > */
# define A_AND 16		/* & */
# define A_OR 17		/* | */
# define A_WS 18		/* whitespace (not \n) */
# define A_NL 19		/* \n */

	/* character classes */

# define LEXLET 01
# define LEXDIG 02
# define LEXOCT 04
# define LEXHEX 010
# define LEXWS 020
# define LEXDOT 040

	/* reserved word actions */

# define AR_TY 0		/* type word */
# define AR_RW 1		/* simple reserved word */
# define AR_CL 2		/* storage class word */
# define AR_S 3		/* struct */
# define AR_U 4		/* union */
# define AR_E 5		/* enum */
# define AR_A 6		/* asm */

	/* text buffer */
#ifndef FLEXNAMES
# define LXTSZ 100
#else
#define	LXTSZ	BUFSIZ
#endif
char yytext[LXTSZ];
char * lxgcp;


unsigned caloff();
	/* ARGSUSED */
mainp1( argc, argv ) int argc; char *argv[]; {  /* control multiple files */

	register i;
	register char *cp;
	int fdef=0;
	extern int idebug, bdebug, tdebug, edebug, ddebug, xdebug;
	extern unsigned int offsz;

	offsz = caloff();
	for( i=1; i<argc; ++i ){
		if( *(cp=argv[i]) == '-' && *++cp == 'X' ){
			while( *++cp ){
				switch( *cp ){

				case 'd':
					++ddebug;
					break;
				case 'i':
					++idebug;
					break;
				case 'b':
					++bdebug;
					break;
				case 't':
					++tdebug;
					break;
				case 'e':
					++edebug;
					break;
				case 'x':
					++xdebug;
					break;
					}
				}
			}
			else
			if( *(argv[i]) != '-' ) switch( fdef++ ) {
				case 0:
				case 1:
					if( freopen(argv[i], fdef==1 ? "r" : "w", fdef==1 ? stdin : stdout) == NULL) {
						fprintf(stderr, "ccom:can't open %s\n", argv[i]);
						exit(1);
					}
					break;

				default:
					;
			}
		}

# ifdef ONEPASS
	p2init( argc, argv );
# endif

	for( i=0; i<SYMTSZ; ++i ) stab[i].stype = TNULL;

	lxinit();
	tinit();
	mkdope();

	lineno = 1;

	/* dimension table initialization */

	dimtab[NULL] = 0;
	dimtab[CHAR] = SZCHAR;
	dimtab[INT] = SZINT;
	dimtab[FLOAT] = SZFLOAT;
	dimtab[DOUBLE] = SZDOUBLE;
	dimtab[LONG] = SZLONG;
	dimtab[SHORT] = SZSHORT;
	dimtab[UCHAR] = SZCHAR;
	dimtab[USHORT] = SZSHORT;
	dimtab[UNSIGNED] = SZINT;
	dimtab[ULONG] = SZLONG;
	/* starts past any of the above */
	curdim = 16;
	reached = 1;

	yyparse();
	yyaccpt();

	ejobcode( nerrors ? 1 : 0 );
	return(nerrors?1:0);

	}

# ifdef ibm

# define CSMASK 0377
# define CSSZ 256

# else

# define CSMASK 0177
# define CSSZ 128

# endif

short lxmask[CSSZ+1];

lxenter( s, m ) register char *s; register short m; {
	/* enter a mask into lxmask */
	register c;

	while( c= *s++ ) lxmask[c+1] |= m;

	}


# define lxget(c,m) (lxgcp=yytext,lxmore(c,m))

lxmore( c, m )  register c, m; {
	register char *cp;

	*(cp = lxgcp) = c;
	while( c=getchar(), lxmask[c+1]&m ){
		if( cp < &yytext[LXTSZ-1] ){
			*++cp = c;
			}
		}
	ungetc(c,stdin);
	*(lxgcp = cp+1) = '\0';
	}

struct lxdope {
	short lxch;	/* the character */
	short lxact;	/* the action to be performed */
	short lxtok;	/* the token number to be returned */
	short lxval;	/* the value to be returned */
	} lxdope[] = {

	'$',	A_ERR,	0,	0,	/* illegal characters go here... */
	'_',	A_LET,	0,	0,	/* letters point here */
	'0',	A_DIG,	0,	0,	/* digits point here */
	' ',	A_WS,	0,	0,	/* whitespace goes here */
	'\n',	A_NL,	0,	0,
	'"',	A_STR,	0,	0,	/* character string */
	'\'',	A_CC,	0,	0,	/* character constant */
	'`',	A_BCD,	0,	0,	/* GCOS BCD constant */
	'(',	A_1C,	LP,	0,
	')',	A_1C,	RP,	0,
	'{',	A_1C,	LC,	0,
	'}',	A_1C,	RC,	0,
	'[',	A_1C,	LB,	0,
	']',	A_1C,	RB,	0,
	'*',	A_1C,	MUL,	MUL,
	'?',	A_1C,	QUEST,	0,
	':',	A_1C,	COLON,	0,
	'+',	A_PL,	PLUS,	PLUS,
	'-',	A_MI,	MINUS,	MINUS,
	'/',	A_SL,	DIVOP,	DIV,
	'%',	A_1C,	DIVOP,	MOD,
	'&',	A_AND,	AND,	AND,
	'|',	A_OR,	OR,	OR,
	'^',	A_1C,	ER,	ER,
	'!',	A_NOT,	UNOP,	NOT,
	'~',	A_1C,	UNOP,	COMPL,
	',',	A_1C,	CM,	CM,
	';',	A_1C,	SM,	0,
	'.',	A_DOT,	STROP,	DOT,
	'<',	A_LT,	RELOP,	LT,
	'>',	A_GT,	RELOP,	GT,
	'=',	A_EQ,	ASSIGN,	ASSIGN,
	-1,	A_1C,	0,	0,
	};

struct lxdope *lxcp[CSSZ+1];

lxinit(){
	register struct lxdope *p;
	register i;
	register char *cp;
	/* set up character classes */

	lxenter( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", LEXLET );
	lxenter( "0123456789", LEXDIG );
	lxenter( "0123456789abcdefABCDEF", LEXHEX );
		/* \013 should become \v someday; \013 is OK for ASCII and EBCDIC */
	lxenter( " \t\r\b\f\013", LEXWS );
	lxenter( "01234567", LEXOCT );
	lxmask['.'+1] |= LEXDOT;

	/* make lxcp point to appropriate lxdope entry for each character */

	/* initialize error entries */

	for( i= 0; i<=CSSZ; ++i ) lxcp[i] = lxdope;

	/* make unique entries */

	for( p=lxdope; ; ++p ) {
		lxcp[p->lxch+1] = p;
		if( p->lxch < 0 ) break;
		}

	/* handle letters, digits, and whitespace */
	/* by convention, first, second, and third places */

	cp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	while( *cp ) lxcp[*cp++ + 1] = &lxdope[1];
	cp = "123456789";
	while( *cp ) lxcp[*cp++ + 1] = &lxdope[2];
	cp = "\t\b\r\f\013";
	while( *cp ) lxcp[*cp++ + 1] = &lxdope[3];

	/* first line might have title */
	lxtitle();

	}

int lxmatch;  /* character to be matched in char or string constant */

lxstr(ct){
	/* match a string or character constant, up to lxmatch */

	register c;
	register val;
	register i;

	i=0;
	while( (c=getchar()) != lxmatch ){
		switch( c ) {

		case EOF:
			uerror( "unexpected EOF" );
			break;

		case '\n':
			uerror( "newline in string or char constant" );
			++lineno;
			break;

		case '\\':
			switch( c = getchar() ){

			case '\n':
				++lineno;
				continue;

			default:
				val = c;
				goto mkcc;

			case 'n':
				val = '\n';
				goto mkcc;

			case 'r':
				val = '\r';
				goto mkcc;

			case 'b':
				val = '\b';
				goto mkcc;

			case 't':
				val = '\t';
				goto mkcc;

			case 'f':
				val = '\f';
				goto mkcc;

			case 'v':
				val = '\013';
				goto mkcc;

			case '0':
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
				val = c-'0';
				c=getchar();  /* try for 2 */
				if( lxmask[c+1] & LEXOCT ){
					val = (val<<3) | (c-'0');
					c = getchar();  /* try for 3 */
					if( lxmask[c+1] & LEXOCT ){
						val = (val<<3) | (c-'0');
						}
					else ungetc( c ,stdin);
					}
				else ungetc( c ,stdin);

				goto mkcc1;

				}
		default:
			val =c;
		mkcc:
			val = CCTRANS(val);
		mkcc1:
			if( lxmatch == '\'' ){
				val = CHARCAST(val);  /* it is, after all, a "character" constant */
				makecc( val, i );
				}
			else { /* stash the byte into the string */
				if( strflg ) {
					if( ct==0 || i<ct ) putbyte( val );
					else if( i == ct ) werror( "non-null byte ignored in string initializer" );
					}
				else bycode( val & 0377, i );
				}
			++i;
			continue;
			}
		break;
		}
	/* end of string or  char constant */

	if( lxmatch == '"' ){
		if( strflg ){ /* end the string */
			if( ct==0 || i<ct ) putbyte( 0 );  /* the null at the end */
			}
		else {  /* the initializer gets a null byte */
			bycode( 0, i++ );
			bycode( -1, i );
			dimtab[curdim] = i;  /* in case of later sizeof ... */
			}
		}
	else { /* end the character constant */
		if( i == 0 ) uerror( "empty character constant" );
		if( i>(SZINT/SZCHAR) || ( (pflag||hflag)&&i>1) )
			uerror( "too many characters in character constant" );
		}
	}

lxcom(){
	register c;
	/* saw a /*: process a comment */

	for(;;){

		switch( c = getchar() ){

		case EOF:
			uerror( "unexpected EOF" );
			return;

		case '\n':
			++lineno;

		default:
			continue;

		case '*':
			if( (c = getchar()) == '/' ) return;
			else ungetc( c ,stdin);
			continue;

# ifdef LINT
		case 'V':
			lxget( c, LEXLET|LEXDIG );
			{
				extern int vaflag;
				int i;
				i = yytext[7]?yytext[7]-'0':0;
				yytext[7] = '\0';
				if( strcmp( yytext, "VARARGS" ) ) continue;
				vaflag = i;
				continue;
				}
		case 'L':
			lxget( c, LEXLET );
			if( strcmp( yytext, "LINTLIBRARY" ) ) continue;
			{
				extern int libflag;
				libflag = 1;
				}
			continue;

		case 'A':
			lxget( c, LEXLET );
			if( strcmp( yytext, "ARGSUSED" ) ) continue;
			{
				extern int argflag, vflag;
				argflag = 1;
				vflag = 0;
				}
			continue;

		case 'N':
			lxget( c, LEXLET );
			if( strcmp( yytext, "NOTREACHED" ) ) continue;
			reached = 0;
			continue;
# endif
			}
		}
	}

yylex(){
	for(;;){

		register lxchar;
		register struct lxdope *p;
		register struct symtab *sp;
		int id;

		switch( (p=lxcp[(lxchar=getchar())+1])->lxact ){

		onechar:
			ungetc( lxchar ,stdin);

		case A_1C:
			/* eat up a single character, and return an opcode */

			yylval.intval = p->lxval;
			return( p->lxtok );

		case A_ERR:
			uerror( "illegal character: %03o (octal)", lxchar );
			break;

		case A_LET:
			/* collect an identifier, check for reserved word, and return */
			lxget( lxchar, LEXLET|LEXDIG );
			if( (lxchar=lxres()) > 0 ) return( lxchar ); /* reserved word */
			if( lxchar== 0 ) continue;
#ifdef FLEXNAMES
			id = lookup( hash(yytext),
#else
			id = lookup( yytext,
#endif
				/* tag name for struct/union/enum */
				(stwart&TAGNAME)? STAG:
				/* member name for struct/union */
				(stwart&(INSTRUCT|INUNION|FUNNYNAME))?SMOS:0 );
			sp = &stab[id];
			if( sp->sclass == TYPEDEF && !stwart ){
				stwart = instruct;
				yylval.nodep = mkty( sp->stype, sp->dimoff, sp->sizoff );
				return( TYPE );
				}
			stwart = (stwart&SEENAME) ? instruct : 0;
			yylval.intval = id;
			return( NAME );

		case A_DIG:
			/* collect a digit string, then look at last one... */
			lastcon = 0;
			lxget( lxchar, LEXDIG );
			switch( lxchar=getchar() ){

			case 'x':
			case 'X':
				if( yytext[0] != '0' && !yytext[1] ) uerror( "illegal hex constant" );
				lxmore( lxchar, LEXHEX );
				/* convert the value */
				{
					register char *cp;
					for( cp = yytext+2; *cp; ++cp ){
						/* this code won't work for all wild character sets,
						   but seems ok for ascii and ebcdic */
						lastcon <<= 4;
						if( isdigit( *cp ) ) lastcon += *cp-'0';
						else if( isupper( *cp ) ) lastcon += *cp - 'A'+ 10;
						else lastcon += *cp - 'a'+ 10;
						}
					}

			hexlong:
				/* criterion for longness for hex and octal constants is that it
				   fit within 0177777 */
				if( lastcon & ~0177777L ) yylval.intval = 1;
				else yylval.intval = 0;

				goto islong;

			case '.':
				lxmore( lxchar, LEXDIG );

			getfp:
				if( (lxchar=getchar()) == 'e' || lxchar == 'E' ){ /* exponent */

			case 'e':
			case 'E':
					if( (lxchar=getchar()) == '+' || lxchar == '-' ){
						*lxgcp++ = 'e';
						}
					else {
						ungetc(lxchar,stdin);
						lxchar = 'e';
						}
					lxmore( lxchar, LEXDIG );
					/* now have the whole thing... */
					}
				else {  /* no exponent */
					ungetc( lxchar ,stdin);
					}
				return( isitfloat( yytext ) );

			default:
				ungetc( lxchar ,stdin);
				if( yytext[0] == '0' ){
					/* convert in octal */
					register char *cp;
					for( cp = yytext+1; *cp; ++cp ){
						lastcon <<= 3;
						lastcon += *cp - '0';
						}
					goto hexlong;
					}
				else {
					/* convert in decimal */
					register char *cp;
					for( cp = yytext; *cp; ++cp ){
						lastcon = lastcon * 10 + *cp - '0';
						}
					}

				/* decide if it is long or not (decimal case) */

				/* if it is positive and fits in 15 bits, or negative and
				   and fits in 15 bits plus an extended sign, it is int; otherwise long */
				/* if there is an l or L following, all bets are off... */

				{	CONSZ v;
					v = lastcon & ~077777L;
					if( v == 0 || v == ~077777L ) yylval.intval = 0;
					else yylval.intval = 1;
					}

			islong:
				/* finally, look for trailing L or l */
				if( (lxchar = getchar()) == 'L' || lxchar == 'l' ) yylval.intval = 1;
				else ungetc( lxchar ,stdin);
				return( ICON );
				}

		case A_DOT:
			/* look for a dot: if followed by a digit, floating point */
			lxchar = getchar();
			if( lxmask[lxchar+1] & LEXDIG ){
				ungetc(lxchar,stdin);
				lxget( '.', LEXDIG );
				goto getfp;
				}
			stwart = FUNNYNAME;
			goto onechar;

		case A_STR:
			/* string constant */
			lxmatch = '"';
			return( STRING );

		case A_CC:
			/* character constant */
			lxmatch = '\'';
			lastcon = 0;
			lxstr(0);
			yylval.intval = 0;
			return( ICON );

		case A_BCD:
			{
				register i;
				int j;
				for( i=0; i<LXTSZ; ++i ){
					if( ( j = getchar() ) == '`' ) break;
					if( j == '\n' ){
						uerror( "newline in BCD constant" );
						break;
						}
					yytext[i] = j;
					}
				yytext[i] = '\0';
				if( i>6 ) uerror( "BCD constant exceeds 6 characters" );
# ifdef gcos
				else strtob( yytext, &lastcon, i );
				lastcon >>= 6*(6-i);
# else
				uerror( "gcos BCD constant illegal" );
# endif
				yylval.intval = 0;  /* not long */
				return( ICON );
				}

		case A_SL:
			/* / */
			if( (lxchar=getchar()) != '*' ) goto onechar;
			lxcom();
		case A_WS:
			continue;

		case A_NL:
			++lineno;
			lxtitle();
			continue;

		case A_NOT:
			/* ! */
			if( (lxchar=getchar()) != '=' ) goto onechar;
			yylval.intval = NE;
			return( EQUOP );

		case A_MI:
			/* - */
			if( (lxchar=getchar()) == '-' ){
				yylval.intval = DECR;
				return( INCOP );
				}
			if( lxchar != '>' ) goto onechar;
			stwart = FUNNYNAME;
			yylval.intval=STREF;
			return( STROP );

		case A_PL:
			/* + */
			if( (lxchar=getchar()) != '+' ) goto onechar;
			yylval.intval = INCR;
			return( INCOP );

		case A_AND:
			/* & */
			if( (lxchar=getchar()) != '&' ) goto onechar;
			return( yylval.intval = ANDAND );

		case A_OR:
			/* | */
			if( (lxchar=getchar()) != '|' ) goto onechar;
			return( yylval.intval = OROR );

		case A_LT:
			/* < */
			if( (lxchar=getchar()) == '<' ){
				yylval.intval = LS;
				return( SHIFTOP );
				}
			if( lxchar != '=' ) goto onechar;
			yylval.intval = LE;
			return( RELOP );

		case A_GT:
			/* > */
			if( (lxchar=getchar()) == '>' ){
				yylval.intval = RS;
				return(SHIFTOP );
				}
			if( lxchar != '=' ) goto onechar;
			yylval.intval = GE;
			return( RELOP );

		case A_EQ:
			/* = */
			switch( lxchar = getchar() ){

			case '=':
				yylval.intval = EQ;
				return( EQUOP );

			case '+':
				yylval.intval = ASG PLUS;
				break;

			case '-':
				yylval.intval = ASG MINUS;

			warn:
				if( lxmask[ (lxchar=getchar())+1] & (LEXLET|LEXDIG|LEXDOT) ){
					werror( "ambiguous assignment: assignment op taken" );
					}
				ungetc( lxchar ,stdin);
				break;

			case '*':
				yylval.intval = ASG MUL;
				goto warn;

			case '/':
				yylval.intval = ASG DIV;
				break;

			case '%':
				yylval.intval = ASG MOD;
				break;

			case '&':
				yylval.intval = ASG AND;
				break;

			case '|':
				yylval.intval = ASG OR;
				break;

			case '^':
				yylval.intval = ASG ER;
				break;

			case '<':
				if( (lxchar=getchar()) != '<' ){
					uerror( "=<%c illegal", lxchar );
					}
				yylval.intval = ASG LS;
				break;

			case '>':
				if( (lxchar=getchar()) != '>' ){
					uerror( "=>%c illegal", lxchar );
					}
				yylval.intval = ASG RS;
				break;

			default:
				goto onechar;

				}

			return( ASOP );

		default:
			cerror( "yylex error, character %03o (octal)", lxchar );

			}

		/* ordinarily, repeat here... */
		cerror( "out of switch in yylex" );

		}

	}

struct lxrdope {
	/* dope for reserved, in alphabetical order */

	char *lxrch;	/* name of reserved word */
	short lxract;	/* reserved word action */
	short lxrval;	/* value to be returned */
	} lxrdope[] = {

	"asm",		AR_A,	0,
	"auto",		AR_CL,	AUTO,
	"break",	AR_RW,	BREAK,
	"char",		AR_TY,	CHAR,
	"case",		AR_RW,	CASE,
	"continue",	AR_RW,	CONTINUE,
	"double",	AR_TY,	DOUBLE,
	"default",	AR_RW,	DEFAULT,
	"do",		AR_RW,	DO,
	"extern",	AR_CL,	EXTERN,
	"else",		AR_RW,	ELSE,
	"enum",		AR_E,	ENUM,
	"for",		AR_RW,	FOR,
	"float",	AR_TY,	FLOAT,
	"fortran",	AR_CL,	FORTRAN,
	"goto",		AR_RW,	GOTO,
	"if",		AR_RW,	IF,
	"int",		AR_TY,	INT,
	"long",		AR_TY,	LONG,
	"return",	AR_RW,	RETURN,
	"register",	AR_CL,	REGISTER,
	"switch",	AR_RW,	SWITCH,
	"struct",	AR_S,	0,
	"sizeof",	AR_RW,	SIZEOF,
	"short",	AR_TY,	SHORT,
	"static",	AR_CL,	STATIC,
	"typedef",	AR_CL,	TYPEDEF,
	"unsigned",	AR_TY,	UNSIGNED,
	"union",	AR_U,	0,
	"void",		AR_TY,	UNDEF, /* tymerge adds FTN */
	"while",	AR_RW,	WHILE,
	"",		0,	0,	/* to stop the search */
	};

lxres() {
	/* check to see of yytext is reserved; if so,
	/* do the appropriate action and return */
	/* otherwise, return -1 */

	register c, ch;
	register struct lxrdope *p;

	ch = yytext[0];

	if( !islower(ch) ) return( -1 );

	switch( ch ){

	case 'a':
		c=0; break;
	case 'b':
		c=2; break;
	case 'c':
		c=3; break;
	case 'd':
		c=6; break;
	case 'e':
		c=9; break;
	case 'f':
		c=12; break;
	case 'g':
		c=15; break;
	case 'i':
		c=16; break;
	case 'l':
		c=18; break;
	case 'r':
		c=19; break;
	case 's':
		c=21; break;
	case 't':
		c=26; break;
	case 'u':
		c=27; break;
	case 'v':
		c=29; break;
	case 'w':
		c=30; break;

	default:
		return( -1 );
		}

	for( p= lxrdope+c; p->lxrch[0] == ch; ++p ){
		if( !strcmp( yytext, p->lxrch ) ){ /* match */
			switch( p->lxract ){

			case AR_TY:
				/* type word */
				stwart = instruct;
				yylval.nodep = mkty( (TWORD)p->lxrval, 0, p->lxrval );
				return( TYPE );

			case AR_RW:
				/* ordinary reserved word */
				return( yylval.intval = p->lxrval );

			case AR_CL:
				/* class word */
				yylval.intval = p->lxrval;
				return( CLASS );

			case AR_S:
				/* struct */
				stwart = INSTRUCT|SEENAME|TAGNAME;
				yylval.intval = INSTRUCT;
				return( STRUCT );

			case AR_U:
				/* union */
				stwart = INUNION|SEENAME|TAGNAME;
				yylval.intval = INUNION;
				return( STRUCT );

			case AR_E:
				/* enums */
				stwart = SEENAME|TAGNAME;
				return( yylval.intval = ENUM );

			case AR_A:
				/* asm */
				asm_esc = 1; /* warn the world! */
				lxget( ' ', LEXWS );
				if( getchar() != '(' ) goto badasm;
				lxget( ' ', LEXWS );
				if( getchar() != '"' ) goto badasm;
# ifndef ONEPASS
# ifndef LINT
				putchar(')');
# endif
# endif
				while( (c=getchar()) != '"' ){
					if( c=='\n' || c==EOF ) goto badasm;
# ifndef LINT
					putchar(c);
# endif
					}
				lxget( ' ', LEXWS );
				if( getchar() != ')' ) goto badasm;
# ifndef LINT
				putchar('\n');
# endif
				return( 0 );

			badasm:
				uerror( "bad asm construction" );
				return( 0 );

			default:
				cerror( "bad AR_?? action" );
				}
			}
		}
	return( -1 );
	}

lxtitle(){
	/* called after a newline; set linenumber and file name */

	register c, val;
	register char *cp;

	for(;;){  /* might be several such lines in a row */
		if( (c=getchar()) != '#' ){
			if( c != EOF ) ungetc(c,stdin);
			return;
			}

		lxget( ' ', LEXWS );
		val = 0;
		for( c=getchar(); isdigit(c); c=getchar() ){
			val = val*10+ c - '0';
			}
		ungetc( c, stdin );
		lineno = val;
		lxget( ' ', LEXWS );
		if( (c=getchar()) != '\n' ){
			for( cp=ftitle; c!='\n'; c=getchar(),++cp ){
				*cp = c;
				}
			*cp = '\0';
			}
		}
	}
#ifdef FLEXNAMES
#define	NSAVETAB	4096
char	*savetab;
int	saveleft;

char *
savestr(cp)
	register char *cp;
{
	register int len;

	len = strlen(cp) + 1;
	if (len > saveleft) {
		saveleft = NSAVETAB;
		if (len > saveleft)
			saveleft = len;
		savetab = (char *)malloc(saveleft);
		if (savetab == 0)
			cerror("Ran out of memory (savestr)");
	}
	strncpy(savetab, cp, len);
	cp = savetab;
	savetab += len;
	saveleft -= len;
	return (cp);
}

/*
 * The definition for the segmented hash tables.
 */
#define	MAXHASH	20
#define	HASHINC	1013
struct ht {
	char	**ht_low;
	char	**ht_high;
	int	ht_used;
} htab[MAXHASH];

char *
hash(s)
	char *s;
{
	register char **h;
	register i;
	register char *cp;
	struct ht *htp;
	int sh;

	/*
	 * The hash function is a modular hash of
	 * the sum of the characters with the sum
	 * doubled before each successive character
	 * is added.
	 */
	cp = s;
	i = 0;
	while (*cp)
		i = i*2 + *cp++;
	sh = (i&077777) % HASHINC;
	cp = s;
	/*
	 * There are as many as MAXHASH active
	 * hash tables at any given point in time.
	 * The search starts with the first table
	 * and continues through the active tables
	 * as necessary.
	 */
	for (htp = htab; htp < &htab[MAXHASH]; htp++) {
		if (htp->ht_low == 0) {
			register char **hp =
			    (char **) calloc(sizeof (char **), HASHINC);
			if (hp == 0)
				cerror("ran out of memory (hash)");
			htp->ht_low = hp;
			htp->ht_high = htp->ht_low + HASHINC;
		}
		h = htp->ht_low + sh;
		/*
		 * quadratic rehash increment
		 * starts at 1 and incremented
		 * by two each rehash.
		 */
		i = 1;
		do {
			if (*h == 0) {
				if (htp->ht_used > (HASHINC * 3)/4)
					break;
				htp->ht_used++;
				*h = savestr(cp);
				return (*h);
			}
			if (**h == *cp && strcmp(*h, cp) == 0)
				return (*h);
			h += i;
			i += 2;
			if (h >= htp->ht_high)
				h -= HASHINC;
		} while (i < HASHINC);
	}
	cerror("ran out of hash tables");
}
#endif
k;
	case 'l':
		c=18; break;
	case 'r':
		c=19; break;
	case 's':
		c=21; break;
	case 't':
		c=26; break;
	case 'u':
		c=27; break;
	case 'v':
		c=29; break;
	case 'w':
		c=30; break;

	default:
		return( -1 );
		}

	for( p= lxrdope+c; p->lxrch[0] sumacc/cc/ccom/table.c   444      0     12       31406  3470501553  10070 /*
 * missing \n fixed by Bill Nowicki December 1981
 *
 * Merged Stanford and LFL versions July 1982
 */

# include "mfile2"

# define TSCALAR TCHAR|TUCHAR|TSHORT|TUSHORT|TINT|TUNSIGNED|TPOINT
# define EA SNAME|SOREG|SCON|STARREG|SAREG|SBREG
# define EAA SNAME|SOREG|SCON|STARREG|SAREG
# define EB SBREG

struct optab  table[] = {

ASSIGN,	INAREG|FOREFF|FORCC,
	EAA,	TSCALAR|TFLOAT,
	SZERO,	TANY,
		0,	RLEFT|RRIGHT|RESCC,
		"	clrZB	AL\n",

ASSIGN,	INAREG|FOREFF|FORCC,
	EAA,	TDOUBLE,
	SZERO,	TANY,
		0,	RLEFT|RRIGHT|RESCC,
		"	clrl	AL\n	clrl	UL\n",

ASSIGN,	INAREG|FOREFF|FORCC,
	SAREG|STAREG,	TSCALAR,
	SCCON,	TSCALAR,
		0,	RLEFT|RRIGHT|RESCC,
		"	moveq	AR,AL\n",

ASSIGN,	INAREG|FOREFF|FORCC,
	EAA,	TSCALAR|TFLOAT,
	EA,	TSCALAR|TFLOAT,
		0,	RLEFT|RRIGHT|RESCC,
		"	movZB	AR,AL\n",

ASSIGN,	INAREG|FOREFF,
	EAA,	TDOUBLE,
	EA,	TDOUBLE,
		0,	RLEFT|RRIGHT,
		"	movl	AR,AL\n	movl	UR,UL\n",

ASSIGN,	INAREG|FOREFF,
	EAA,	TFLOAT,
	EA,	TDOUBLE,
		0,	RLEFT|RRIGHT,
		"	movl	AR,AL\n",

ASSIGN,	INBREG|FOREFF,
	EB,	TSCALAR,
	EA,	TSCALAR,
		0,	RLEFT|RRIGHT|RESCC,
		"	movZB	AR,AL\n",

ASSIGN, INAREG|FOREFF,
	SFLD,	TANY,
	SZERO,	TANY,
		0,	RRIGHT,
		"	andY	#N,AL\n",

ASSIGN, INTAREG|INAREG|FOREFF,
	SFLD,	TANY,
	STAREG,	TANY,
		NAREG,	RRIGHT,
		"F\tmovl\tAR,sp@-\n\tmovl\t#H,A1\n\tlslY\tA1,AR\n\tandY\t#M,AR\n\tandY\t#N,AL\n\torY\tAR,AL\nF\tmovl\tsp@+,AR\n",

ASSIGN, INAREG|FOREFF,
	SFLD,	TANY,
	EA,	TANY,
		2*NAREG,	RRIGHT,
		"\tmovZB\tAR,A1\n\tmovl\t#H,A2\n\tlslY\tA2,A1\n\tandY\t#M,A1\n\tandY\t#N,AL\n\torY\tA1,AL\n",

/* put this here so UNARY MUL nodes match OPLTYPE when appropriate */
UNARY MUL,	INTAREG|INAREG|FORCC,
	SBREG,	TSCALAR,
	SANY,	TANY,
		NAREG|NASR,	RESC1|RESCC,
		"	movZB	AL@,A1\n",

OPLTYPE,	FOREFF,
	SANY,	TANY,
	EA,	TANY,
		0,	RRIGHT,
		"",   /* this entry throws away computations which don't do anything */

OPLTYPE,	FORCC,
	SANY,	TANY,
#ifndef Stanford
	EAA,	TSCALAR|TFLOAT|TDOUBLE,
#else Stanford
	  /*
	   * You really need to compare all 64 bits for doubles.
	   * But if you don't have this, the code in local2.c does not
	   * work.
	   */
	EAA,	TSCALAR|TFLOAT,
#endif Stanford
		0,	RESCC,
		"	tstZB	AR\n",

OPLTYPE,	FORCC,
	SANY,	TANY,
	EB,	TSCALAR,
		0,	RESCC,
		"	cmpZB	#0,AR\n",

OPLTYPE,	INTAREG|INAREG|FORCC,
	SANY,	TANY,
	SZERO,	TSCALAR,
		NAREG|NASR,	RESC1|RESCC,
		"	clrZB	A1\n",

OPLTYPE,	INTAREG|INAREG|FORCC,
	SANY,	TANY,
	SCCON,	TSCALAR,
		NAREG|NASR,	RESC1|RESCC,
		"	moveq	AR,A1\n",

OPLTYPE,	INTAREG|INAREG|FORCC,
	SANY,	TANY,
	EA,	TSCALAR,
		NAREG|NASR,	RESC1|RESCC,
		"	movZB	AR,A1\n",

OPLTYPE,	INTAREG|INAREG,
	SANY,	TANY,
	EA,	TDOUBLE,
		NAREG|NASR,	RESC1,
		"	movl	AR,A1\n	movl	UR,U1\n",

OPLTYPE,	INTAREG|INAREG,
	SANY,	TANY,
	EA,	TFLOAT,
		NAREG|NASR,	RESC1,
		"	movl	AR,A1\n",

OPLTYPE,	INTBREG|INBREG|FORCC,
	SANY,	TANY,
	EA,	TSCALAR,
		NBREG|NBSR,	RESC1|RESCC,
		"	movZB	AR,A1\n",

/* Old template */
/*
 * LFL commented this out, but then it seems to create a bug in which
 * a movl is used instead of a movw.
 * If you comment it out, the cmpZL's must be changed to cmpZB's
 */
OPLTYPE,	INTEMP|FORCC,
	SANY,	TANY,
	EA,	TSCALAR,
		NTEMP,	RESC1|RESCC,
		"	movZB	AR,A1\n",

# ifndef Stanford
/* New templates */
OPLTYPE,	INTEMP|FORCC,
	SANY,	TANY,
	EA,	TINT|TUNSIGNED|TPOINT,
		NTEMP,	RESC1|RESCC,
		"	movl	AR,A1\n",
# endif Stanford

/*
 * Bill Nowicki August 1982
 * This has to make sure AR is a d register!
 */
OPLTYPE,	INTEMP|FORCC,
	SANY,	TANY,
	SCON|STARREG|SAREG|SBREG,	TSHORT,
		NTEMP,	RESC1|RESCC,
		"	extl	AR\n	movl	AR,A1\n",

OPLTYPE,	INTEMP,
	SANY,	TANY,
	EA,	TFLOAT,
		NTEMP,	RESC1,
		"	movl	AR,A1\n",

OPLTYPE,	INTEMP,
	SANY,	TANY,
	EA,	TDOUBLE,
		NTEMP,	RESC1,
		"	movl	AR,A1\n	movl	UR,U1\n",

OPLTYPE,	FORARG,
	SANY,	TANY,
	SBREG,	TINT|TUNSIGNED|TPOINT,
		0,	RNULL,
		"	pea	AR@\nZP",

OPLTYPE,	FORARG,
	SANY,	TANY,
	EA,	TINT|TUNSIGNED|TPOINT,
		0,	RNULL,
		"	movl	AR,Z-\n",

OPLTYPE,	FORARG,
	SANY,	TANY,
	EA,	TSHORT,
		NBREG|NBSR,	RNULL,
		"	movw	AR,A1\n	movl	A1,Z-\n",

OPLTYPE,	FORARG,
	SANY,	TANY,
	EA,	TUSHORT,
		NAREG|NASR,	RNULL,
		"	clrl	A1\n	movw	AR,A1\n	movl	A1,Z-\n",

OPLTYPE,	FORARG,
	SANY,	TANY,
	EA,	TCHAR,
		NAREG|NASR,	RNULL,
		"	movb	AR,A1\n	extw	A1\n	extl	A1\n	movl	A1,Z-\n",

OPLTYPE,	FORARG,
	SANY,	TANY,
	EA,	TUCHAR,
		NAREG|NASR,	RNULL,
		"	clrl	A1\n	movb	AR,A1\n	movl	A1,Z-\n",

OPLTYPE,	FORARG,
	SANY,	TANY,
	EA,	TFLOAT,
		0,	RNULL,
		"	clrl	Z-\n	movl	AR,Z-\n",

OPLTYPE,	FORARG,
	SANY,	TANY,
	EA,	TDOUBLE,
		0,	RNULL,
		"	movl	UR,Z-\n	movl	AR,Z-\n",

OPLOG,	FORCC,
	SAREG|STAREG|SBREG|STBREG,	TSCALAR,
	EA,	TSCALAR,
		0,	RESCC,
		"	cmpZL	AR,AL\nZI",

/*
 * Added by Bill Nowicki August 1982
 * and next template also fixed to not compare two constants.
 */
OPLOG,	FORCC,
	SAREG|STAREG|SBREG|STBREG,	TFLOAT,
	EA,	TFLOAT,
		0,	RESCC,
		"	cmpZL	AR,AL\nZI",

OPLOG,	FORCC,
	SNAME|SOREG|STARREG|SAREG,	TSCALAR,
	SCON,	TSCALAR,
		0,	RESCC,
		"	cmpZL	AR,AL\nZI",

#ifdef Stanford
OPLOG,	FORCC,
	EA,	TDOUBLE,
	EA,	TDOUBLE,
		0,	RESCC,
		"\tmovl\tUR,Z-\n\tmovl\tAR,Z-\n\tmovl\tUL,Z-\n\tmovl\tAL,Z-\n\tjbsr\tfcmp\n\taddl\t#16,sp\n\ttstl\td0\nZ0ZI",

#endif Stanford
CCODES,	INTAREG|INAREG,
	SANY,	TANY,
	SANY,	TANY,
		NAREG,	RESC1,
		"	moveq	#1,A1\nZN",

UNARY MINUS,	INTAREG|INAREG,
	STAREG,	TSCALAR,
	SANY,	TANY,
		0,	RLEFT,
		"	negZB	AL\n",

COMPL,	INTAREG|INAREG,
	STAREG,	TSCALAR,
	SANY,	TANY,
		0,	RLEFT,
		"	notZB	AL\n",

INCR,	INTAREG|INAREG|FOREFF,
	EAA,	TSCALAR,
	S8CON,	TSCALAR,
		NAREG,	RESC1,
		"F	movZB	AL,A1\n	addqZB	AR,AL\n",

DECR,	INTAREG|INAREG|FOREFF,
	EAA,	TSCALAR,
	S8CON,	TSCALAR,
		NAREG,	RESC1,
		"F	movZB	AL,A1\n	subqZB	AR,AL\n",

INCR,	INTAREG|INAREG|FOREFF,
	EAA,	TSCALAR,
	SCON,	TSCALAR,
		NAREG,	RESC1,
		"F	movZB	AL,A1\n	addZB	AR,AL\n",

DECR,	INTAREG|INAREG|FOREFF,
	EAA,	TSCALAR,
	SCON,	TSCALAR,
		NAREG,	RESC1,
		"F	movZB	AL,A1\n	subZB	AR,AL\n",

INCR,	INTBREG|INBREG|FOREFF,
	EB,	TSCALAR,
	S8CON,	TSCALAR,
		NBREG,	RESC1,
		"F	movZB	AL,A1\n	addqZB	AR,AL\n",

DECR,	INTBREG|INBREG|FOREFF,
	EB,	TSCALAR,
	S8CON,	TSCALAR,
		NBREG,	RESC1,
		"F	movZB	AL,A1\n	subqZB	AR,AL\n",

INCR,	INTBREG|INBREG|FOREFF,
	EB,	TSCALAR,
	SCON,	TSCALAR,
		NBREG,	RESC1,
		"F	movZB	AL,A1\n	addZB	AR,AL\n",

DECR,	INTBREG|INBREG|FOREFF,
	EB,	TSCALAR,
	SCON,	TSCALAR,
		NBREG,	RESC1,
		"F	movZB	AL,A1\n	subZB	AR,AL\n",

PLUS,		INBREG|INTBREG,
	SBREG,	TPOINT,
	SICON,	TANY,
		NBREG|NBSL,	RESC1,
		"	lea	AL@(ZO),A1\n",

PLUS,		FORARG,
	SBREG,	TPOINT,
	SICON,	TANY,
		0,	RNULL,
		"	pea	AL@(ZO)\nZP",

MINUS,		INBREG|INTBREG,
	SBREG,	TPOINT,
	SICON,	TANY,
		NBREG|NBSL,	RESC1,
		"	lea	AL@(ZM),A1\n",

MINUS,		FORARG,
	SBREG,	TPOINT,
	SICON,	TANY,
		0,	RNULL,
		"	pea	AL@(ZM)\nZP",

ASG PLUS,	INAREG|FORCC,
	EAA,	TSCALAR,
	S8CON,	TSCALAR,
		0,	RLEFT|RESCC,
		"	addqZB	AR,AL\n",

ASG PLUS,	INBREG|FORCC,
	EB,	TSCALAR,
	S8CON,	TSCALAR,
		0,	RLEFT|RESCC,
		"	addqZB	AR,AL\n",

ASG PLUS,	INAREG|FORCC,
	SAREG|STAREG,	TSCALAR,
	EA,	TSCALAR,
		0,	RLEFT|RESCC,
		"	addZB	AR,AL\n",

ASG PLUS,	INBREG,
	SBREG|STBREG,	TSCALAR,
	EA,	TSCALAR,
		0,	RLEFT,
		"	addZB	AR,AL\n",

ASG PLUS,	INAREG|FORCC,
	EAA,	TSCALAR,
	SAREG|STAREG,	TSCALAR,
		0,	RLEFT|RESCC,
		"	addZB	AR,AL\n",

ASG MINUS,	INAREG|FORCC,
	EAA,	TSCALAR,
	S8CON,	TSCALAR,
		0,	RLEFT|RESCC,
		"	subqZB	AR,AL\n",

ASG MINUS,	INBREG|FORCC,
	EB,	TSCALAR,
	S8CON,	TSCALAR,
		0,	RLEFT|RESCC,
		"	subqZB	AR,AL\n",

ASG MINUS,	INAREG|FORCC,
	SAREG|STAREG,	TSCALAR,
	EA,	TSCALAR,
		0,	RLEFT|RESCC,
		"	subZB	AR,AL\n",

ASG MINUS,	INBREG,
	SBREG|STBREG,	TSCALAR,
	EA,	TSCALAR,
		0,	RLEFT,
		"	subZB	AR,AL\n",

ASG MINUS,	INAREG|FORCC,
	EAA,	TSCALAR,
	SAREG|STAREG,	TSCALAR,
		0,	RLEFT|RESCC,
		"	subZB	AR,AL\n",

ASG ER, 	INAREG|FORCC,
	EAA,	TSCALAR,
	SCON,	TSCALAR,
		0,	RLEFT|RESCC,
		"	eorZB	AR,AL\n",

ASG ER, 	INAREG|FORCC,
	EAA,	TSCALAR,
	SAREG|STAREG,	TSCALAR,
		0,	RLEFT|RESCC,
		"	eorZB	AR,AL\n",

ASG OPSIMP, 	INAREG|FORCC,
	SAREG|STAREG,	TSCALAR,
	EAA,	TSCALAR,
		0,	RLEFT|RESCC,
		"	OIZB	AR,AL\n",

ASG OPSIMP, 	INAREG|FORCC,
	EAA,	TSCALAR,
	SCON,	TSCALAR,
		0,	RLEFT|RESCC,
		"	OIZB	AR,AL\n",

ASG OPSIMP, 	INAREG|FORCC,
	EAA,	TSCALAR,
	SAREG|STAREG,	TSCALAR,
		0,	RLEFT|RESCC,
		"	OIZB	AR,AL\n",

ASG MUL,	INAREG|FORCC,
	SAREG|STAREG,	TSHORT,
	EAA,	TSHORT,
		0,	RLEFT|RESCC,
		"	muls	AR,AL\n",

ASG MUL,	INAREG|FORCC,
	SAREG|STAREG,	TUSHORT,
	EAA,	TUSHORT|TSHORT,
		0,	RLEFT|RESCC,
		"	mulu	AR,AL\n",

ASG MUL,	INAREG|FORCC,
	SAREG|STAREG,	TSHORT,
	EAA,	TUSHORT,
		0,	RLEFT|RESCC,
		"	mulu	AR,AL\n",

ASG MUL,	INAREG,
	SAREG|STAREG,	TCHAR,
	EAA,	TCHAR,
		NAREG,	RLEFT,
		"\textw	AL\n\tmovb	AR,A1\n\textw	A1\n\tmuls	A1,AL\n",

ASG MUL,	INAREG,
	SAREG|STAREG,	TUCHAR,
	EAA,	TUCHAR|TCHAR,
		NAREG,	RLEFT,
		"\tandw	#255,AL\n\tclrw	A1\n\tmovb	AR,A1\n\tmuls	A1,AL\n",

ASG DIV,	INAREG|FORCC,
	SAREG|STAREG,	TSHORT,
	EAA,	TSHORT,
		0,	RLEFT|RESCC,
		"	extl	AL\n	divs	AR,AL\n",

ASG DIV,	INAREG|FORCC,
	SAREG|STAREG,	TUSHORT,
	EAA,	TUSHORT|TSHORT,
		0,	RLEFT|RESCC,
		"	andl	#65535,AL\n	divu	AR,AL\n",

ASG DIV,	INAREG|FORCC,
	SAREG|STAREG,	TSHORT,
	EAA,	TUSHORT,
		0,	RLEFT|RESCC,
		"	andl	#65535,AL\n	divu	AR,AL\n",

ASG DIV,	INAREG,
	SAREG|STAREG,	TCHAR,
	EAA,	TCHAR,
		NAREG,	RLEFT,
		"\textw	AL\n\tmovb	AR,A1\n\textw	A1\n\tdivs	A1,AL\n",

ASG DIV,	INAREG,
	SAREG|STAREG,	TUCHAR,
	EAA,	TUCHAR|TCHAR,
		NAREG,	RLEFT,
		"\tandw	#255,AL\n\tclrw	A1\n\tmovb	AR,A1\n\tdivs	A1,AL\n",

ASG MOD,	INAREG,
	SAREG|STAREG,	TSHORT,
	EAA,	TSHORT,
		0,	RLEFT,
		"	extl	AL\n	divs	AR,AL\n	swap	AL\n",

ASG MOD,	INAREG,
	SAREG|STAREG,	TUSHORT,
	EAA,	TUSHORT|TSHORT,
		0,	RLEFT,
		"	andl	#65535,AL\n	divu	AR,AL\n	swap	AL\n",

ASG MOD,	INAREG,
	SAREG|STAREG,	TSHORT,
	EAA,	TUSHORT,
		0,	RLEFT,
		"	andl	#65535,AL\n	divu	AR,AL\n	swap	AL\n",

ASG MOD,	INAREG,
	SAREG|STAREG,	TCHAR,
	EAA,	TCHAR,
		NAREG,	RLEFT,
		"\textw	AL\n\tmovb	AR,A1\n\textw	A1\n\tdivs	A1,AL\n	swap	AL\n",

ASG MOD,	INAREG,
	SAREG|STAREG,	TUCHAR,
	EAA,	TUCHAR|TCHAR,
		NAREG,	RLEFT,
		"\tandw	#255,AL\n\tclrw	A1\n\tmovb	AR,A1\n\tdivs	A1,AL\n	swap	AL\n",

ASG OPSHFT, 	INAREG|FORCC,
	SAREG,	TINT|TSHORT|TCHAR,
	S8CON,	TSCALAR,
		0,	RLEFT|RESCC,
		"	aOIZB	AR,AL\n",

ASG OPSHFT, 	INAREG|FORCC,
	SNAME|SOREG,	TSHORT,
	SONE,	TSCALAR,
		0,	RLEFT|RESCC,
		"	aOIw	AL\n",

ASG OPSHFT, 	INAREG|FORCC,
	SAREG,	TINT|TSHORT|TCHAR,
	SAREG,	TSCALAR,
		0,	RLEFT|RESCC,
		"	aOIZB	AR,AL\n",

ASG OPSHFT, 	INAREG|FORCC,
	SAREG,	TUNSIGNED|TUSHORT|TUCHAR,
	S8CON,	TSCALAR,
		0,	RLEFT|RESCC,
		"	lOIZB	AR,AL\n",

ASG OPSHFT, 	INAREG|FORCC|RESCC,
	EA,	TUSHORT,
	SONE,	TSCALAR,
		0,	RLEFT,
		"	lOIw	AL\n",

ASG OPSHFT, 	INAREG|FORCC,
	SAREG,	TUNSIGNED|TUSHORT|TUCHAR,
	SAREG,	TSCALAR,
		0,	RLEFT|RESCC,
		"	lOIZB	AR,AL\n",

UNARY CALL,	INTAREG,
	SBREG|SNAME|SOREG|SCON,	TANY,
	SANY,	TANY,
		NAREG|NASL,	RESC1, /* should be register 0 */
		"ZC\n",

SCONV,	INTAREG,
	STAREG,	TINT|TUNSIGNED|TPOINT,
	SANY,	TINT|TUNSIGNED|TPOINT,
		0,	RLEFT,
		"",

SCONV,	INTAREG,
	STAREG,	TSCALAR,
	SANY,	TUCHAR,
		0,	RLEFT,
		"	andl	#255,AL\n",

SCONV,	INTAREG,
	STAREG,	TINT|TUNSIGNED|TPOINT,
	SANY,	TUSHORT,
		0,	RLEFT,
		"	andl	#65535,AL\n",

SCONV,	INTAREG,
	STAREG,	TINT|TUNSIGNED|TPOINT,
	SANY,	TSHORT|TCHAR,
		0,	RLEFT,
		"",

SCONV,	INTAREG,
	STAREG,	TCHAR,
	SANY,	TSHORT|TUSHORT,
		0,	RLEFT,
		"	extw	AL\n",

SCONV,	INTAREG,
	STAREG,	TCHAR,
	SANY,	TINT|TUNSIGNED|TPOINT,
		0,	RLEFT,
		"	extw	AL\n	extl	AL\n",

SCONV,	INTAREG,
	STAREG,	TSHORT,
	SANY,	TINT|TUNSIGNED|TPOINT,
		0,	RLEFT,
		"	extl	AL\n",

SCONV,	INTAREG,
	STAREG,	TUCHAR,
	SANY,	TSCALAR,
		0,	RLEFT,
		"	andl	#255,AL\n",

SCONV,	INTAREG,
	STAREG,	TUSHORT,
	SANY,	TINT|TUNSIGNED|TPOINT,
		0,	RLEFT,
		"	andl	#65535,AL\n",

SCONV,	INAREG|INTAREG,
#ifndef Stanford
	  /*
	   * SU adds in STAREG and SBREG; which is correct???
	   */
	SNAME|SOREG|SCON|SAREG,	TINT|TUNSIGNED|TPOINT|TSHORT|TUSHORT,
#else Stanford
	EA,	TINT|TUNSIGNED|TPOINT|TSHORT|TUSHORT,
#endif Stanford
	SANY,	TSHORT|TUSHORT|TCHAR|TUCHAR,
		0,	RLEFT,
		"ZT",

SCONV,	INAREG|INTAREG,
	EA,	TDOUBLE,
	SANY,	TFLOAT,
		0,	RLEFT,
		"",

SCONV,	INAREG|INTAREG,
	EA,	TFLOAT,
	SANY,	TDOUBLE,
		NAREG|NASR,	RESC1,
		"	movl	AL,A1\n	clrl	U1\n",

SCONV,  FORARG,
	EA,	TFLOAT,
	SANY,	TDOUBLE,
		0,	RNULL,
		"	clrl	Z-\n	movl	AL,Z-\n",

STASG,	FOREFF,
	SNAME|SOREG,	TANY,
#ifndef Stanford
	SCON|SBREG,	TANY,
#else Stanford
	SCON|SOREG|SBREG,	TANY,
#endif Stanford
		0,	RNOP,
		"ZS",

STASG,	INTBREG|INBREG,
	SNAME|SOREG,	TANY,
	STBREG,	TANY,
		0,	RRIGHT,
		"ZS",

STASG, INBREG|INTBREG,
	SNAME|SOREG,	TANY,
	SCON|SBREG,	TANY,
		NBREG,	RESC1,
		"ZS	movl	AR,A1\n",

INIT,	FOREFF,
	SCON,	TANY,
	SANY,	TINT|TUNSIGNED|TPOINT,
		0,	RNOP,
		"	.long	CL\n",

INIT,	FOREFF,
	SCON,	TANY,
	SANY,	TSHORT|TUSHORT,
		0,	RNOP,
		"	.word	CL\n",

INIT,	FOREFF,
	SCON,	TANY,
	SANY,	TCHAR|TUCHAR,
		0,	RNOP,
		"	.byte	CL\n",

	/* Default actions for hard trees ... */

# define DF(x) FORREW,SANY,TANY,SANY,TANY,REWRITE,x,""

UNARY MUL, DF( UNARY MUL ),

INCR, DF(INCR),

DECR, DF(INCR),

ASSIGN, DF(ASSIGN),

STASG, DF(STASG),

OPLEAF, DF(NAME),

OPLOG,	FORCC,
	SANY,	TANY,
	SANY,	TANY,
		REWRITE,	BITYPE,
		"",

OPLOG,	DF(NOT),

COMOP, DF(COMOP),

INIT, DF(INIT),

OPUNARY, DF(UNARY MINUS),


ASG OPANY, DF(ASG PLUS),

OPANY, DF(BITYPE),

FREE,	FREE,	FREE,	FREE,	FREE,	FREE,	FREE,	FREE,	"help; I'm in trouble\n" };
REG,
	SAREG|STAREG,	TCHAR,
	EAA,	TCHAR,
		NAREG,	RLEFT,
		"\textw	AL\n\tmovb	AR,A1\n\textw	A1\n\tdivs	A1,AL\n",

ASG DIV,	INAREG,
	SAREG|STAREG,	TUCHAR,
	EAA,	TUCHAR|TCHAR,
		NAREG,	RLEFT,
		"\tandw	#255,AL\n\tclrw	A1\n\tmovb	AR,A1\n\tdivs	A1,AL\n",
sumacc/cc/ccom/test.c   444      0     12         273  3470501553   7716 test()
 { 
   short test2();
   return( test2(1) >= test2(2) );
 }

struct s { short a, b; } *p;

short test2(a, b, c)
 short a,b,c;
  {
    if ( p->b == b)
    return( a*b + a*c );
  }

0,	RNULL,
		"	clrl	Z-\n	movl	AL,Z-\n",

STASG,	FOREFF,
	SNAME|SOREG,	TANY,
#ifndef Stanford
	SCON|SBREG,	TANY,
#else Stanford
	SCON|SOREG|SBREG,	TANY,
#endif Stanford
		0,	RNOP,
		"ZS",

STASG,	INTBREG|INBREG,
	SNAME|SOREG,	TANY,
	STBREG,	TANY,
		0,	RRIGHT,
		"ZS",

STASG, INBREG|INTBREG,
	SNAME|SOREG,	TANY,
	SCON|SBREG,	TAsumacc/cc/ccom/trees.c   444      0     12      100002  3470501553  10130 # include "mfile1"

	    /* corrections when in violation of lint */

/*	some special actions, used in finding the type of nodes */
# define NCVT 01
# define PUN 02
# define TYPL 04
# define TYPR 010
# define TYMATCH 040
# define LVAL 0100
# define CVTO 0200
# define CVTL 0400
# define CVTR 01000
# define PTMATCH 02000
# define OTHER 04000
# define NCVTR 010000
# define RINT 020000
# define LINT 040000

/* node conventions:

	NAME:	rval>0 is stab index for external
		rval<0 is -inlabel number
		lval is offset in bits
	ICON:	lval has the value
		rval has the STAB index, or - label number,
			if a name whose address is in the constant
		rval = NONAME means no name
	REG:	rval is reg. identification cookie

	*/

int bdebug = 0;
extern ddebug;

NODE *
buildtree( o, l, r ) register NODE *l, *r; {
	register NODE *p, *q;
	register actions;
	register opty;
	register struct symtab *sp;
	register NODE *lr, *ll;
	int i;
	extern int eprint();

# ifndef BUG1
	if( bdebug ) printf( "buildtree( %s, %o, %o )\n", opst[o], l, r );
# endif
	opty = optype(o);

	/* check for constants */

	if( opty == UTYPE && l->in.op == ICON ){

		switch( o ){

		case NOT:
			if( hflag ) werror( "constant argument to NOT" );
		case UNARY MINUS:
		case COMPL:
			if( conval( l, o, l ) ) return(l);
			break;

			}
		}

	else if( o==UNARY MINUS && l->in.op==FCON ){
		l->fpn.dval = -l->fpn.dval;
		return(l);
		}

	else if( o==QUEST && l->in.op==ICON ) {
		l->in.op = FREE;
		r->in.op = FREE;
		if( l->tn.lval ){
			tfree( r->in.right );
			return( r->in.left );
			}
		else {
			tfree( r->in.left );
			return( r->in.right );
			}
		}

	else if( (o==ANDAND || o==OROR) && (l->in.op==ICON||r->in.op==ICON) ) goto ccwarn;

	else if( opty == BITYPE && l->in.op == ICON && r->in.op == ICON ){

		switch( o ){

		case ULT:
		case UGT:
		case ULE:
		case UGE:
		case LT:
		case GT:
		case LE:
		case GE:
		case EQ:
		case NE:
		case ANDAND:
		case OROR:
		case CBRANCH:

		ccwarn:
			if( hflag ) werror( "constant in conditional context" );

		case PLUS:
		case MINUS:
		case MUL:
		case DIV:
		case MOD:
		case AND:
		case OR:
		case ER:
		case LS:
		case RS:
			if( conval( l, o, r ) ) {
				r->in.op = FREE;
				return(l);
				}
			break;
			}
		}

	else if( opty == BITYPE && (l->in.op==FCON||l->in.op==ICON) &&
		(r->in.op==FCON||r->in.op==ICON) ){
		switch(o){
		case PLUS:
		case MINUS:
		case MUL:
		case DIV:
			if( l->in.op == ICON ){
				l->fpn.dval = l->tn.lval;
				}
			if( r->in.op == ICON ){
				r->fpn.dval = r->tn.lval;
				}
			l->in.op = FCON;
			l->in.type = l->fn.csiz = DOUBLE;
			r->in.op = FREE;
			switch(o){
			case PLUS:
				l->fpn.dval += r->fpn.dval;
				return(l);
			case MINUS:
				l->fpn.dval -= r->fpn.dval;
				return(l);
			case MUL:
				l->fpn.dval *= r->fpn.dval;
				return(l);
			case DIV:
				if( r->fpn.dval == 0 ) uerror( "division by 0." );
				else l->fpn.dval /= r->fpn.dval;
				return(l);
				}
			}
		}

	/* its real; we must make a new node */

	p = block( o, l, r, INT, 0, INT );

	actions = opact(p);

	if( actions&LVAL ){ /* check left descendent */
		if( notlval(p->in.left) ) {
			uerror( "illegal lhs of assignment operator" );
			}
		}

	if( actions & NCVTR ){
		p->in.left = pconvert( p->in.left );
		}
	else if( !(actions & NCVT ) ){
		switch( opty ){

		case BITYPE:
			p->in.right = pconvert( p->in.right );
		case UTYPE:
			p->in.left = pconvert( p->in.left );

			}
		}

	if( (actions&PUN) && (o!=CAST||cflag) ){
		chkpun(p);
		}

	if (actions & RINT) p->in.right = makety( p->in.right, INT, 0, INT );
	if (actions & LINT) p->in.left = makety( p->in.left, INT, 0, INT );

	if( actions & (TYPL|TYPR) ){

		q = (actions&TYPL) ? p->in.left : p->in.right;

		p->in.type = q->in.type;
		p->fn.cdim = q->fn.cdim;
		p->fn.csiz = q->fn.csiz;
		}

	if( actions & CVTL ) p = convert( p, CVTL );
	if( actions & CVTR ) p = convert( p, CVTR );
	if( actions & TYMATCH ) p = tymatch(p);
	if( actions & PTMATCH ) p = ptmatch(p);

	if( actions & OTHER ){
		l = p->in.left;
		r = p->in.right;

		switch(o){

		case NAME:
			sp = &stab[idname];
			if( sp->stype == UNDEF ){
#ifndef FLEXNAMES
				uerror( "%.8s undefined", sp->sname );
#else
				uerror( "%s undefined", sp->sname );
#endif
				/* make p look reasonable */
				p->in.type = p->fn.cdim = p->fn.csiz = INT;
				p->tn.rval = idname;
				p->tn.lval = 0;
				defid( p, SNULL );
				break;
				}
			p->in.type = sp->stype;
			p->fn.cdim = sp->dimoff;
			p->fn.csiz = sp->sizoff;
			p->tn.lval = 0;
			p->tn.rval = idname;
			/* special case: MOETY is really an ICON... */
			if( p->in.type == MOETY ){
				p->tn.rval = NONAME;
				p->tn.lval = sp->offset;
				p->fn.cdim = 0;
				p->in.type = ENUMTY;
				p->in.op = ICON;
				}
			break;

		case ICON:
			p->fn.cdim = 0;
			p->fn.csiz = INT;
			break;

		case STRING:
			p->in.op = NAME;
			p->in.type = CHAR+ARY;
			p->tn.lval = 0;
			p->tn.rval = NOLAB;
			p->fn.cdim = curdim;
			p->fn.csiz = CHAR;
			break;

		case FCON:
			p->tn.lval = 0;
			p->tn.rval = 0;
			p->in.type = DOUBLE;
			p->fn.cdim = 0;
			p->fn.csiz = DOUBLE;
			break;

		case STREF:
			/* p->x turned into *(p+offset) */
			/* rhs must be a name; check correctness */

			i = r->tn.rval;
			if( i<0 || ((sp= &stab[i])->sclass != MOS && sp->sclass != MOU && !(sp->sclass&FIELD)) ){
				uerror( "member of structure or union required" );
				}else
			/* if this name is non-unique, find right one */
			if( stab[i].sflags & SNONUNIQ &&
				(l->in.type==PTR+STRTY || l->in.type == PTR+UNIONTY) &&
				(l->fn.csiz +1) >= 0 ){
				/* nonunique name && structure defined */
				char * memnam, * tabnam;
				register k;
				int j;
				int memi;
				j=dimtab[l->fn.csiz+1];
				for( ; (memi=dimtab[j]) >= 0; ++j ){
					tabnam = stab[memi].sname;
					memnam = stab[i].sname;
# ifndef BUG1
					if( ddebug>1 ){
#ifndef FLEXNAMES
						printf("member %.8s==%.8s?\n",
#else
						printf("member %s==%s?\n",
#endif
							memnam, tabnam);
						}
# endif
					if( stab[memi].sflags & SNONUNIQ ){
#ifndef FLEXNAMES
						for( k=0; k<NCHNAM; ++k ){
							if(*memnam++!=*tabnam)
								goto next;
							if(!*tabnam++) break;
							}
#else
						if (memnam != tabnam)
							goto next;
#endif
						r->tn.rval = i = memi;
						break;
						}
					next: continue;
					}
				if( memi < 0 )
#ifndef FLEXNAMES
					uerror("illegal member use: %.8s",
#else
					uerror("illegal member use: %s",
#endif
						stab[i].sname);
				}
			else {
				register j;
				if( l->in.type != PTR+STRTY && l->in.type != PTR+UNIONTY ){
					if( stab[i].sflags & SNONUNIQ ){
						uerror( "nonunique name demands struct/union or struct/union pointer" );
						}
					else werror( "struct/union or struct/union pointer required" );
					}
				else if( (j=l->fn.csiz+1)<0 ) cerror( "undefined structure or union" );
				else if( !chkstr( i, dimtab[j], DECREF(l->in.type) ) ){
#ifndef FLEXNAMES
					werror( "illegal member use: %.8s", stab[i].sname );
#else
					werror( "illegal member use: %s", stab[i].sname );
#endif
					}
				}

			p = stref( p );
			break;

		case UNARY MUL:
			if( l->in.op == UNARY AND ){
				p->in.op = l->in.op = FREE;
				p = l->in.left;
				}
			if( !ISPTR(l->in.type))uerror("illegal indirection");
			p->in.type = DECREF(l->in.type);
			p->fn.cdim = l->fn.cdim;
			p->fn.csiz = l->fn.csiz;
			break;

		case UNARY AND:
			switch( l->in.op ){

			case UNARY MUL:
				p->in.op = l->in.op = FREE;
				p = l->in.left;
			case NAME:
				p->in.type = INCREF( l->in.type );
				p->fn.cdim = l->fn.cdim;
				p->fn.csiz = l->fn.csiz;
				break;

			case COMOP:
				lr = buildtree( UNARY AND, l->in.right, NIL );
				p->in.op = l->in.op = FREE;
				p = buildtree( COMOP, l->in.left, lr );
				break;

			case QUEST:
				lr = buildtree( UNARY AND, l->in.right->in.right, NIL );
				ll = buildtree( UNARY AND, l->in.right->in.left, NIL );
				p->in.op = l->in.op = l->in.right->in.op = FREE;
				p = buildtree( QUEST, l->in.left, buildtree( COLON, ll, lr ) );
				break;

# ifdef ADDROREG
			case OREG:
				/* OREG was built in clocal()
				 * for an auto or formal parameter
				 * now its address is being taken
				 * local code must unwind it
				 * back to PLUS/MINUS REG ICON
				 * according to local conventions
				 */
				{
				extern NODE * addroreg();
				p->in.op = FREE;
				p = addroreg( l );
				}
				break;

# endif
			default:
				uerror( "unacceptable operand of &" );
				break;
				}
			break;

		case LS:
		case RS:
		case ASG LS:
		case ASG RS:
			if(tsize(p->in.right->in.type, p->in.right->fn.cdim, p->in.right->fn.csiz) > SZINT)
				p->in.right = makety(p->in.right, INT, 0, INT );
			break;

		case RETURN:
		case ASSIGN:
		case CAST:
			/* structure assignment */
			/* take the addresses of the two sides; then make an
			/* operator using STASG and
			/* the addresses of left and right */

			{
				register TWORD t;
				register d, s;

				if( l->fn.csiz != r->fn.csiz ) uerror( "assignment of different structures" );

				r = buildtree( UNARY AND, r, NIL );
				t = r->in.type;
				d = r->fn.cdim;
				s = r->fn.csiz;

				l = block( STASG, l, r, t, d, s );

				if( o == RETURN ){
					p->in.op = FREE;
					p = l;
					break;
					}

				p->in.op = UNARY MUL;
				p->in.left = l;
				p->in.right = NIL;
				break;
				}
		case COLON:
			/* structure colon */

			if( l->fn.csiz != r->fn.csiz ) uerror( "type clash in conditional" );
			break;

		case CALL:
			p->in.right = r = strargs( p->in.right );
		case UNARY CALL:
			if( !ISPTR(l->in.type)) uerror("illegal function");
			p->in.type = DECREF(l->in.type);
			if( !ISFTN(p->in.type)) uerror("illegal function");
			p->in.type = DECREF( p->in.type );
			p->fn.cdim = l->fn.cdim;
			p->fn.csiz = l->fn.csiz;
			if( l->in.op == UNARY AND && l->in.left->in.op == NAME &&
				l->in.left->tn.rval >= 0 && l->in.left->tn.rval != NONAME &&
				( (i=stab[l->in.left->tn.rval].sclass) == FORTRAN || i==UFORTRAN ) ){
				p->in.op += (FORTCALL-CALL);
				}
			if( p->in.type == STRTY || p->in.type == UNIONTY ){
				/* function returning structure */
				/*  make function really return ptr to str., with * */

				p->in.op += STCALL-CALL;
				p->in.type = INCREF( p->in.type );
				p = buildtree( UNARY MUL, p, NIL );

				}
			break;

		default:
			cerror( "other code %d", o );
			}

		}

	if( actions & CVTO ) p = oconvert(p);
	p = clocal(p);

# ifndef BUG1
	if( bdebug ) fwalk( p, eprint, 0 );
# endif

	return(p);

	}

NODE *
strargs( p ) register NODE *p;  { /* rewrite structure flavored arguments */

	if( p->in.op == CM ){
		p->in.left = strargs( p->in.left );
		p->in.right = strargs( p->in.right );
		return( p );
		}

	if( p->in.type == STRTY || p->in.type == UNIONTY ){
		p = block( STARG, p, NIL, p->in.type, p->fn.cdim, p->fn.csiz );
		p->in.left = buildtree( UNARY AND, p->in.left, NIL );
		p = clocal(p);
		}
	else if (p->in.type==CHAR || p->in.type==UCHAR || p->in.type==SHORT || p->in.type==USHORT)
		p = makety(p, INT, 0, INT);

	return( p );
	}

chkstr( i, j, type ) TWORD type; {
	/* is the MOS or MOU at stab[i] OK for strict reference by a ptr */
	/* i has been checked to contain a MOS or MOU */
	/* j is the index in dimtab of the members... */
	int k, kk;

	extern int ddebug;

# ifndef BUG1
#ifndef FLEXNAMES
	if( ddebug > 1 ) printf( "chkstr( %.8s(%d), %d )\n", stab[i].sname, i, j );
#else
	if( ddebug > 1 ) printf( "chkstr( %s(%d), %d )\n", stab[i].sname, i, j );
#endif
# endif
	if( (k = j) < 0 ) uerror( "undefined structure or union" );
	else {
		for( ; (kk = dimtab[k] ) >= 0; ++k ){
			if( kk >= SYMTSZ ){
				cerror( "gummy structure" );
				return(1);
				}
			if( kk == i ) return( 1 );
			switch( stab[kk].stype ){

			case STRTY:
			case UNIONTY:
				if( type == STRTY ) continue;  /* no recursive looking for strs */
				if( hflag && chkstr( i, dimtab[stab[kk].sizoff+1], stab[kk].stype ) ){
					if( stab[kk].sname[0] == '$' ) return(0);  /* $FAKE */
					werror(
#ifndef FLEXNAMES
					"illegal member use: perhaps %.8s.%.8s?",
#else
					"illegal member use: perhaps %s.%s?",
#endif
					stab[kk].sname, stab[i].sname );
					return(1);
					}
				}
			}
		}
	return( 0 );
	}

conval( p, o, q ) register NODE *p, *q; {
	/* apply the op o to the lval part of p; if binary, rhs is val */
	int i, u;
	CONSZ val;

	val = q->tn.lval;
	u = ISUNSIGNED(p->in.type) || ISUNSIGNED(q->in.type);
	if( u && (o==LE||o==LT||o==GE||o==GT)) o += (UGE-GE);

	if( p->tn.rval != NONAME && q->tn.rval != NONAME ) return(0);
	if( q->tn.rval != NONAME && o!=PLUS ) return(0);
	if( p->tn.rval != NONAME && o!=PLUS && o!=MINUS ) return(0);

	switch( o ){

	case PLUS:
		p->tn.lval += val;
		if( p->tn.rval == NONAME ){
			p->tn.rval = q->tn.rval;
			p->in.type = q->in.type;
			}
		break;
	case MINUS:
		p->tn.lval -= val;
		break;
	case MUL:
		p->tn.lval *= val;
		break;
	case DIV:
		if( val == 0 ) uerror( "division by 0" );
		else p->tn.lval /= val;
		break;
	case MOD:
		if( val == 0 ) uerror( "division by 0" );
		else p->tn.lval %= val;
		break;
	case AND:
		p->tn.lval &= val;
		break;
	case OR:
		p->tn.lval |= val;
		break;
	case ER:
		p->tn.lval ^=  val;
		break;
	case LS:
		i = val;
		p->tn.lval = p->tn.lval << i;
		break;
	case RS:
		i = val;
		p->tn.lval = p->tn.lval >> i;
		break;

	case UNARY MINUS:
		p->tn.lval = - p->tn.lval;
		break;
	case COMPL:
		p->tn.lval = ~p->tn.lval;
		break;
	case NOT:
		p->tn.lval = !p->tn.lval;
		break;
	case LT:
		p->tn.lval = p->tn.lval < val;
		break;
	case LE:
		p->tn.lval = p->tn.lval <= val;
		break;
	case GT:
		p->tn.lval = p->tn.lval > val;
		break;
	case GE:
		p->tn.lval = p->tn.lval >= val;
		break;
	case ULT:
		p->tn.lval = (p->tn.lval-val)<0;
		break;
	case ULE:
		p->tn.lval = (p->tn.lval-val)<=0;
		break;
	case UGE:
		p->tn.lval = (p->tn.lval-val)>=0;
		break;
	case UGT:
		p->tn.lval = (p->tn.lval-val)>0;
		break;
	case EQ:
		p->tn.lval = p->tn.lval == val;
		break;
	case NE:
		p->tn.lval = p->tn.lval != val;
		break;
	default:
		return(0);
		}
	return(1);
	}

chkpun(p) register NODE *p; {

	/* checks p for the existance of a pun */

	/* this is called when the op of p is ASSIGN, RETURN, CAST, COLON, or relational */

	/* one case is when enumerations are used: this applies only to lint */
	/* in the other case, one operand is a pointer, the other integer type */
	/* we check that this integer is in fact a constant zero... */

	/* in the case of ASSIGN, any assignment of pointer to integer is illegal */
	/* this falls out, because the LHS is never 0 */

	register NODE *q;
	register t1, t2;
	register d1, d2;

	t1 = p->in.left->in.type;
	t2 = p->in.right->in.type;

	if( t1==ENUMTY || t2==ENUMTY ) { /* check for enumerations */
		if( logop( p->in.op ) && p->in.op != EQ && p->in.op != NE ) {
			uerror( "illegal comparison of enums" );
			return;
			}
		if( t1==ENUMTY && t2==ENUMTY && p->in.left->fn.csiz==p->in.right->fn.csiz ) return;
		if( t2==ENUMTY && logop(p->in.right->in.op) ) return;	/* cjt */
		werror( "enumeration type clash, operator %s", opst[p->in.op] );
		return;
		}

	if( ISPTR(t1) || ISARY(t1) ) q = p->in.right;
	else q = p->in.left;

	if( !ISPTR(q->in.type) && !ISARY(q->in.type) ){
		if( q->in.op != ICON || q->tn.lval != 0 ){
			combo( "pointer/integer", p );
			}
		}
	else {
		d1 = p->in.left->fn.cdim;
		d2 = p->in.right->fn.cdim;
		for( ;; ){
			if( t1 == t2 ) {;
				if(p->in.left->fn.csiz!=p->in.right->fn.csiz) {
					combo( "structure pointer", p );
					}
				return;
				}
			if( ISARY(t1) || ISPTR(t1) ){
				if( !ISARY(t2) && !ISPTR(t2) ) break;
				if( ISARY(t1) && ISARY(t2) &&
					dimtab[d1] != dimtab[d2] ){
					combo( "array size", p );
					return;
					}
				if( ISARY(t1) ) ++d1;
				if( ISARY(t2) ) ++d2;
				}
			else break;
			t1 = DECREF(t1);
			t2 = DECREF(t2);
			}
		combo( "pointer", p );
		}

	}

combo( s, p ) char *s; register NODE *p; {
	char buf[100];
	sprintf( buf, "illegal %s combination, op %s", s, opst[p->tn.op] );
	werror( buf );
	}

NODE *
stref( p ) register NODE *p; {

	TWORD t;
	int d, s, dsc, align;
	OFFSZ off;
	register struct symtab *q;

	/* make p->x */
	/* this is also used to reference automatic variables */

	q = &stab[p->in.right->tn.rval];
	p->in.right->in.op = FREE;
	p->in.op = FREE;
	p = pconvert( p->in.left );

	/* make p look like ptr to x */

	if( !ISPTR(p->in.type)){
		p->in.type = PTR+UNIONTY;
		}

	t = INCREF( q->stype );
	d = q->dimoff;
	s = q->sizoff;

	p = makety( p, t, d, s );

	/* compute the offset to be added */

	off = q->offset;
	dsc = q->sclass;

	if( dsc & FIELD ) {  /* normalize offset */
		switch(q->stype) {

		case CHAR:
		case UCHAR:
			align = ALCHAR;
			s = CHAR;
			break;

		case SHORT:
		case USHORT:
			align = ALSHORT;
			s = SHORT;
			break;

		case INT:
		case UNSIGNED:
			align = ALINT;
			s = INT;
			break;

# ifdef LONGFIELDS
		case LONG:
		case ULONG:
			align = ALLONG;
			s = LONG;
			break;
# endif

		default:
			cerror( "undefined bit field type" );
			}
		off = (off/align)*align;
		}
	if( off != 0 )
	   p = clocal( block( PLUS, p, makety(offcon( off, t, d, s ),INT,0,INT), t, d, s ) );

	p = buildtree( UNARY MUL, p, NIL );

	/* if field, build field info */

	if( dsc & FIELD ){
		p = block( FLD, p, NIL, q->stype, 0, q->sizoff );
		p->tn.rval = PKFIELD( dsc&FLDSIZ, q->offset%align );
		}

	return( clocal(p) );
	}

notlval(p) register NODE *p; {

	/* return 0 if p an lvalue, 1 otherwise */

	again:

	switch( p->in.op ){

	case FLD:
		p = p->in.left;
		goto again;

	case UNARY MUL:
		/* fix the &(a=b) bug, given that a and b are structures */
		if( p->in.left->in.op == STASG ) return( 1 );
		/* and the f().a bug, given that f returns a structure */
		if( p->in.left->in.op == UNARY STCALL ||
		    p->in.left->in.op == STCALL ) return( 1 );
	case NAME:
	case OREG:
		if( ISARY(p->in.type) || ISFTN(p->in.type) ) return(1);
	case REG:
		return(0);

	default:
		return(1);

		}

	}

NODE *
bcon( i ){ /* make a constant node with value i */
	register NODE *p;

	p = block( ICON, NIL, NIL, INT, 0, INT );
	if (p->tn.lval>=-128 && p->tn.lval<=127) p->tn.type = CHAR;
	else if (p->tn.lval>=-32768 && p->tn.lval<=32767) p->tn.type = SHORT;
	else p->tn.type = INT;
	p->tn.lval = i;
	p->tn.rval = NONAME;
	return( clocal(p) );
	}

NODE *
bpsize(p) register NODE *p; {
	return( offcon( psize(p), p->in.type, p->fn.cdim, p->fn.csiz ) );
	}

OFFSZ
psize( p ) NODE *p; {
	/* p is a node of type pointer; psize returns the
	   size of the thing pointed to */

	if( !ISPTR(p->in.type) ){
		uerror( "pointer required");
		return( SZINT );
		}
	/* note: no pointers to fields */
	return( tsize( DECREF(p->in.type), p->fn.cdim, p->fn.csiz ) );
	}

NODE *
convert( p, f )  register NODE *p; {
	/*  convert an operand of p
	    f is either CVTL or CVTR
	    operand has type int, and is converted by the size of the other side
	    */

	register NODE *q, *r;

	q = (f==CVTL)?p->in.left:p->in.right;

	r = block( PMCONV,
		q, bpsize(f==CVTL?p->in.right:p->in.left), INT, 0, INT );
	r = clocal(r);
	if( f == CVTL )
		p->in.left = r;
	else
		p->in.right = r;
	return(p);

	}

econvert( p ) register NODE *p; {

	/* change enums to ints, or appropriate types */

	register TWORD ty;

	if( (ty=BTYPE(p->in.type)) == ENUMTY || ty == MOETY ) {
		if( dimtab[ p->fn.csiz ] == SZCHAR ) ty = CHAR;
		else if( dimtab[ p->fn.csiz ] == SZINT ) ty = INT;
		else if( dimtab[ p->fn.csiz ] == SZSHORT ) ty = SHORT;
		else ty = LONG;
		ty = ctype( ty );
		p->fn.csiz = ty;
		MODTYPE(p->in.type,ty);
		if( p->in.op == ICON && ty != LONG ) p->in.type = p->fn.csiz = INT;
		}
	}

NODE *
pconvert( p ) register NODE *p; {

	/* if p should be changed into a pointer, do so */

	if( ISARY( p->in.type) ){
		p->in.type = DECREF( p->in.type );
		++p->fn.cdim;
		return( buildtree( UNARY AND, p, NIL ) );
		}
	if( ISFTN( p->in.type) )
		return( buildtree( UNARY AND, p, NIL ) );

	return( p );
	}

NODE *
oconvert(p) register NODE *p; {
	/* convert the result itself: used for pointer and unsigned */

	switch(p->in.op) {

	case LE:
	case LT:
	case GE:
	case GT:
		if( ISUNSIGNED(p->in.left->in.type) || ISUNSIGNED(p->in.right->in.type) )  p->in.op += (ULE-LE);
	case EQ:
	case NE:
		return( p );

	case MINUS:
		return(  clocal( block( PVCONV,
			p, bpsize(p->in.left), INT, 0, INT ) ) );
		}

	cerror( "illegal oconvert: %d", p->in.op );

	return(p);
	}

NODE *
ptmatch(p)  register NODE *p; {

	/* makes the operands of p agree; they are
	   either pointers or integers, by this time */
	/* with MINUS, the sizes must be the same */
	/* with COLON, the types must be the same */

	TWORD t1, t2, t;
	int o, d2, d, s2, s;

	o = p->in.op;
	t = t1 = p->in.left->in.type;
	t2 = p->in.right->in.type;
	d = p->in.left->fn.cdim;
	d2 = p->in.right->fn.cdim;
	s = p->in.left->fn.csiz;
	s2 = p->in.right->fn.csiz;

	switch( o ){

	case ASSIGN:
	case RETURN:
	case CAST:
		{  break; }

	case MINUS:
		{  if( psize(p->in.left) != psize(p->in.right) ){
			uerror( "illegal pointer subtraction");
			}
		   break;
		   }
	case COLON:
		{  if( t1 != t2 ) uerror( "illegal types in :");
		   break;
		   }
	default:  /* must work harder: relationals or comparisons */

		if( !ISPTR(t1) ){
			t = t2;
			d = d2;
			s = s2;
			break;
			}
		if( !ISPTR(t2) ){
			break;
			}

		/* both are pointers */
		if( talign(t2,s2) < talign(t,s) ){
			t = t2;
			s = s2;
			}
		break;
		}

	p->in.left = makety( p->in.left, t, d, s );
	p->in.right = makety( p->in.right, t, d, s );
	if( o!=MINUS ){

		p->in.type = t;
		p->fn.cdim = d;
		p->fn.csiz = s;
		}

	return(clocal(p));
	}

int tdebug = 0;

NODE *
tymatch(p)  register NODE *p; {

	/* satisfy the types of various arithmetic binary ops */

	/* rules are:
		if assignment, op, type of LHS
		if any float or doubles, make double
		if any longs, make long
		otherwise, make int
		if either operand is unsigned, the result is...
	*/

	register TWORD t1, t2, t, tu;
	register o, u;

	o = p->in.op;

	t1 = p->in.left->in.type;
	t2 = p->in.right->in.type;
	if( (t1==UNDEF || t2==UNDEF) && o!=CAST )
		uerror("void type illegal in expression");

	u = 0;
	if( ISUNSIGNED(t1) ){
		u = 1;
		t1 = DEUNSIGN(t1);
		}
	if( ISUNSIGNED(t2) ){
		u = 1;
		t2 = DEUNSIGN(t2);
		}

	if ( logop(o) ) switch (t1) {
	  case FLOAT:
	  case DOUBLE:	t = DOUBLE;
			break;

	  case INT:	t = INT;
			break;

	  case SHORT:	t = t2==INT ? INT : SHORT;
			break;

	  case CHAR:	t = t2;
			break;
	} else if (t1==DOUBLE || t1==FLOAT || t2==DOUBLE || t2==FLOAT ) t = DOUBLE;
	else t = INT;

	if( asgop(o) ){
		tu = p->in.left->in.type;
		t = t1;
		}
	else {
		tu = (u && UNSIGNABLE(t))?ENUNSIGN(t):t;
		}

	/* because expressions have values that are at least as wide
	   as INT or UNSIGNED, the only conversions needed
	   are those involving FLOAT/DOUBLE, and those
	   from LONG to INT and ULONG to UNSIGNED */

	if( t != t1 ) p->in.left = makety( p->in.left, tu, 0, (int)tu );

	if( t != t2 || o==CAST ) p->in.right = makety( p->in.right, tu, 0, (int)tu );

	if( asgop(o) ){
		p->in.type = p->in.left->in.type;
		p->fn.cdim = p->in.left->fn.cdim;
		p->fn.csiz = p->in.left->fn.csiz;
		}
	else {	if ( logop(o) ) p->in.type = INT;
		else p->in.type = tu;
		p->fn.cdim = 0;
		p->fn.csiz = t;
		}

# ifndef BUG1
	if( tdebug ) printf( "tymatch(%o): %o %s %o => %o\n",p,t1,opst[o],t2,tu );
# endif

	return(p);
	}

NODE *
makety( p, t, d, s ) register NODE *p; TWORD t; {
	/* make p into type t by inserting a conversion */

	if( p->in.type == ENUMTY && p->in.op == ICON ) econvert(p);
	if( t == p->in.type ){
		p->fn.cdim = d;
		p->fn.csiz = s;
		return( p );
		}

	if( t & TMASK ){
		/* non-simple type */
		return( block( PCONV, p, NIL, t, d, s ) );
		}

	if( p->in.op == ICON ){
		if( t==DOUBLE||t==FLOAT ){
			p->in.op = FCON;
			if( ISUNSIGNED(p->in.type) ){
				p->fpn.dval = /* (unsigned CONSZ) */ p->tn.lval;
				}
			else {
				p->fpn.dval = p->tn.lval;
				}

			p->in.type = p->fn.csiz = t;
			return( clocal(p) );
			}
		}

	return( block( SCONV, p, NIL, t, d, s ) );

	}

NODE *
block( o, l, r, t, d, s ) register NODE *l, *r; TWORD t; {

	register NODE *p;

	p = talloc();
	p->in.op = o;
	p->in.left = l;
	p->in.right = r;
	p->in.type = t;
	p->fn.cdim = d;
	p->fn.csiz = s;
	return(p);
	}

icons(p) register NODE *p; {
	/* if p is an integer constant, return its value */
	int val;

	if( p->in.op != ICON ){
		uerror( "constant expected");
		val = 1;
		}
	else {
		val = p->tn.lval;
		if( val != p->tn.lval ) uerror( "constant too big for cross-compiler" );
		}
	tfree( p );
	return(val);
	}

/* 	the intent of this table is to examine the
	operators, and to check them for
	correctness.

	The table is searched for the op and the
	modified type (where this is one of the
	types INT (includes char and short), LONG,
	DOUBLE (includes FLOAT), and POINTER

	The default action is to make the node type integer

	The actions taken include:
		PUN	  check for puns
		CVTL	  convert the left operand
		CVTR	  convert the right operand
		TYPL	  the type is determined by the left operand
		TYPR	  the type is determined by the right operand
		TYMATCH	  force type of left and right to match, by inserting conversions
		PTMATCH	  like TYMATCH, but for pointers
		LVAL	  left operand must be lval
		CVTO	  convert the op
		NCVT	  do not convert the operands
		OTHER	  handled by code
		NCVTR	  convert the left operand, not the right...

	*/

# define MINT 01  /* integer */
# define MDBI 02   /* integer or double */
# define MSTR 04  /* structure */
# define MPTR 010  /* pointer */
# define MPTI 020  /* pointer or integer */
# define MENU 040 /* enumeration variable or member */

opact( p )  NODE *p; {

	register mt12, mt1, mt2, o;

	mt12 = 0;

	switch( optype(o=p->in.op) ){

	case BITYPE:
		mt12=mt2 = moditype( p->in.right->in.type );
	case UTYPE:
		mt12 &= (mt1 = moditype( p->in.left->in.type ));

		}

	switch( o ){

	case NAME :
	case STRING :
	case ICON :
	case FCON :
	case CALL :
	case UNARY CALL:
	case UNARY MUL:
		{  return( OTHER ); }
	case UNARY MINUS:
		if( mt1 & MDBI ) return( TYPL );
		break;

	case COMPL:
		if( mt1 & MINT ) return( TYPL );
		break;

	case UNARY AND:
		{  return( NCVT+OTHER ); }
	case INIT:
	case CM:
	case NOT:
	case CBRANCH:
	case ANDAND:
	case OROR:
		return( 0 );

	case MUL:
	case DIV:
		if( mt12 & MDBI ) return( TYMATCH );
		break;

	case MOD:
	case AND:
	case OR:
	case ER:
		if( mt12 & MINT ) return( TYMATCH );
		break;

	case LS:
	case RS:
		if( mt12 & MINT ) return( TYMATCH+OTHER );
		break;

	case EQ:
	case NE:
	case LT:
	case LE:
	case GT:
	case GE:
		if( (mt1&MENU)||(mt2&MENU) ) return( PTMATCH+PUN+NCVT );
		if( mt12 & MDBI ) return( TYMATCH+CVTO );
		else if( mt12 & MPTR ) return( PTMATCH+PUN );
		else if( mt12 & MPTI ) return( PTMATCH+PUN );
		else if ( (mt1&MPTR) && (p->in.right->in.op==ICON)) return ( PTMATCH+PUN+RINT );
		else if ( (mt2&MPTR) && (p->in.left->in.op==ICON)) return ( PTMATCH+PUN+LINT );
		else break;

	case QUEST:
	case COMOP:
		if( mt2&MENU ) return( TYPR+NCVTR );
		return( TYPR );

	case STREF:
		return( NCVTR+OTHER );

	case FORCE:
		return( TYPL );

	case COLON:
		if( mt12 & MENU ) return( NCVT+PUN+PTMATCH );
		else if( mt12 & MDBI ) return( TYMATCH );
		else if( mt12 & MPTR ) return( TYPL+PTMATCH+PUN );
		else if( (mt1&MINT) && (mt2&MPTR) ) return( TYPR+PUN+LINT );
		else if( (mt1&MPTR) && (mt2&MINT) ) return( TYPL+PUN+RINT );
		else if( mt12 & MSTR ) return( NCVT+TYPL+OTHER );
		break;

	case ASSIGN:
	case RETURN:
		if( mt12 & MSTR ) return( LVAL+NCVT+TYPL+OTHER );
	case CAST:
		if(o==CAST && mt1==0)return(TYPL+TYMATCH);
		if( mt12 & MDBI ) return( TYPL+LVAL+TYMATCH );
		else if( (mt1&MENU)||(mt2&MENU) ) return( LVAL+NCVT+TYPL+PTMATCH+PUN );
		else if( mt12 == 0 ) break;
		else if( mt1 & MPTR ) return( LVAL+PTMATCH+PUN );
		else if( mt12 & MPTI ) return( TYPL+LVAL+TYMATCH+PUN );
		break;

	case ASG LS:
	case ASG RS:
		if( mt12 & MINT ) return( TYPL+LVAL+OTHER );
		break;

	case ASG MUL:
	case ASG DIV:
		if( mt12 & MDBI ) return( LVAL+TYMATCH );
		break;

	case ASG MOD:
	case ASG AND:
	case ASG OR:
	case ASG ER:
		if( mt12 & MINT ) return( LVAL+TYMATCH );
		break;

	case ASG PLUS:
	case ASG MINUS:
	case INCR:
	case DECR:
		if( mt12 & MDBI ) return( TYMATCH+LVAL );
		else if( (mt1&MPTR) && (mt2&MINT) ) return( TYPL+LVAL+CVTR+RINT );
		break;

	case MINUS:
		if( mt12 & MPTR ) return( CVTO+PTMATCH+PUN );
		if( mt2 & MPTR ) break;
	case PLUS:
		if( mt12 & MDBI ) return( TYMATCH );
		else if( (mt1&MPTR) && (mt2&MINT) ) return( TYPL+CVTR+RINT );
		else if( (mt1&MINT) && (mt2&MPTR) ) return( TYPR+CVTL+LINT );

		}
	uerror( "operands of %s have incompatible types", opst[o] );
	return( NCVT );
	}

moditype( ty ) TWORD ty; {

	switch( ty ){

	case TVOID:
	case UNDEF:
		return(0); /* type is void */
	case ENUMTY:
	case MOETY:
		return( MENU );

	case STRTY:
	case UNIONTY:
		return( MSTR );

	case CHAR:
	case SHORT:
	case UCHAR:
	case USHORT:
		return( MINT|MPTI|MDBI );
	case UNSIGNED:
	case ULONG:
	case INT:
	case LONG:
		return( MINT|MDBI|MPTI );
	case FLOAT:
	case DOUBLE:
		return( MDBI );
	default:
		return( MPTR|MPTI );

		}
	}

NODE *
doszof( p )  register NODE *p; {
	/* do sizeof p */
	int i;

	/* whatever is the meaning of this if it is a bitfield? */
	i = tsize( p->in.type, p->fn.cdim, p->fn.csiz )/SZCHAR;

	tfree(p);
	if( i <= 0 ) werror( "sizeof returns 0" );
	return( bcon( i ) );
	}

# ifndef BUG2
eprint( p, down, a, b ) register NODE *p; int *a, *b; {
	register ty;

	*a = *b = down+1;
	while( down > 1 ){
		printf( "\t" );
		down -= 2;
		}
	if( down ) printf( "    " );

	ty = optype( p->in.op );

	printf("%o) %s, ", p, opst[p->in.op] );
	if( ty == LTYPE ){
		printf( CONFMT, p->tn.lval );
		printf( ", %d, ", p->tn.rval );
		}
	tprint( p->in.type );
	printf( ", %d, %d\n", p->fn.cdim, p->fn.csiz );
	fflush( stdout );
	}
# endif

prtdcon( p ) register NODE *p; {
	int i;

	if( p->in.op == FCON ){
		locctr( DATA );
		defalign( ALDOUBLE );
		deflab( i = getlab() );
		fincode( p->fpn.dval, SZDOUBLE );
		p->tn.lval = 0;
		p->tn.rval = -i;
		p->in.type = DOUBLE;
		p->in.op = NAME;
		}
	}


int edebug = 0;
ecomp( p ) register NODE *p; {
# ifndef BUG2
	if( edebug ) fwalk( p, eprint, 0 );
# endif
	if( !reached ){
		werror( "statement not reached" );
		reached = 1;
		}
	p = optim(p);
	walkf( p, prtdcon );
	locctr( PROG );
	ecode( p );
	tfree(p);
	}

# ifdef STDPRTREE
# ifndef ONEPASS

prtree(p) register NODE *p; {

	register struct symtab *q;
	register ty;

# ifdef MYPRTREE
	MYPRTREE(p);  /* local action can be taken here; then return... */
#endif

	ty = optype(p->in.op);

	printf( "%d\t", p->in.op );

	if( ty == LTYPE ) {
		printf( CONFMT, p->tn.lval );
		printf( "\t" );
		}
	if( ty != BITYPE ) {
		if( p->in.op == NAME || p->in.op == ICON ) printf( "0\t" );
		else printf( "%d\t", p->tn.rval );
		}

	printf( "%o\t", p->in.type );

	/* handle special cases */

	switch( p->in.op ){

	case NAME:
	case ICON:
		/* print external name */
		if( p->tn.rval == NONAME ) printf( "\n" );
		else if( p->tn.rval >= 0 ){
			q = &stab[p->tn.rval];
			printf(  "%s\n", exname(q->sname) );
			}
		else { /* label */
			printf( LABFMT, -p->tn.rval );
			}
		break;

	case STARG:
	case STASG:
	case STCALL:
	case UNARY STCALL:
		/* print out size */
		/* use lhs size, in order to avoid hassles with the structure `.' operator */

		/* note: p->in.left not a field... */
		printf( CONFMT, (CONSZ) tsize( STRTY, p->in.left->fn.cdim, p->in.left->fn.csiz ) );
		printf( "\t%d\t\n", talign( STRTY, p->in.left->fn.csiz ) );
		break;

	default:
		printf(  "\n" );
		}

	if( ty != LTYPE ) prtree( p->in.left );
	if( ty == BITYPE ) prtree( p->in.right );

	}

# else

p2tree(p) register NODE *p; {
	register ty;

# ifdef MYP2TREE
	MYP2TREE(p);  /* local action can be taken here; then return... */
# endif

	ty = optype(p->in.op);

	switch( p->in.op ){

	case NAME:
	case ICON:
#ifndef FLEXNAMES
		if( p->tn.rval == NONAME ) p->in.name[0] = '\0';
#else
		if( p->tn.rval == NONAME ) p->in.name = "";
#endif

		else if( p->tn.rval >= 0 ){ /* copy name from exname */
			register char *cp;
			register i;
			cp = exname( stab[p->tn.rval].sname );
#ifndef FLEXNAMES
			for( i=0; i<NCHNAM; ++i ) p->in.name[i] = *cp++;
#else
			p->in.name = tstr(cp);
#endif
			}
#ifndef FLEXNAMES
		else sprintf( p->in.name, LABFMT, -p->tn.rval );
#else
		else {
			char temp[32];
			sprintf( temp, LABFMT, -p->tn.rval );
			p->in.name = tstr(temp);
		}
#endif
		break;

	case STARG:
	case STASG:
	case STCALL:
	case UNARY STCALL:
		/* set up size parameters */
		p->stn.stsize = (tsize(STRTY,p->in.left->fn.cdim,p->in.left->fn.csiz)+SZCHAR-1)/SZCHAR;
		p->stn.stalign = talign(STRTY,p->in.left->fn.csiz)/SZCHAR;
		break;

	case REG:
		rbusy( p->tn.rval, p->in.type );
	default:
#ifndef FLEXNAMES
		p->in.name[0] = '\0';
#else
		p->in.name = "";
#endif
		}

	p->in.rall = NOPREF;

	if( ty != LTYPE ) p2tree( p->in.left );
	if( ty == BITYPE ) p2tree( p->in.right );
	}

# endif
# endif
n( MSTR );

	case CHAR:
	case SHORT:
	case UCHAR:
	case USHORT:
		return( MINT|MPTI|MDBI );
	case UNSIGNED:
	case ULONG:
	case INT:
	case LONG:
		return( MINT|MDBI|MPTI );
	case FLOAT:
	case DOUBLE:
		return( MDBI );
	default:
		return( MPTR|MPTI );

		}
	}

NODE *
doszof( p )  register NODE *p; {
	/* do sizeof p */
	int i;

	/* whatever is the meaning of this if it is a bitfield? */
	i = tsize( p->in.type, p->fn.cdim, p->fn.csiz )/SZCHAR;

	tfree(p);
	if( i <= 0 ) werror( "sizeof returns 0" );
	return( bsumacc/cc/ccom/xdefs.c   444      0     12        5066  3470501553  10075 # include "mfile1"

/*	communication between lexical routines	*/

char	ftitle[100] = "";   	/* title of the file */
int	lineno;		/* line number of the input file */

CONSZ lastcon;  /* the last constant read by the lexical analyzer */
double dcon;   /* the last double read by the lexical analyzer */


/*	symbol table maintainence */

struct symtab stab[SYMTSZ+1];  /* one extra slot for scratch */

int	curftn;  /* "current" function */
int	ftnno;  /* "current" function number */

int	curclass,	  /* current storage class */
	instruct,	/* "in structure" flag */
	stwart,		/* for accessing names which are structure members or names */
	blevel,		/* block level: 0 for extern, 1 for ftn args, >=2 inside function */
	curdim;		/* current offset into the dimension table */
	
int	dimtab[ DIMTABSZ ];

int	paramstk[ PARAMSZ ];  /* used in the definition of function parameters */
int	paramno;	  /* the number of parameters */
int	autooff,	/* the next unused automatic offset */
	argoff,	/* the next unused argument offset */
	strucoff;	/*  the next structure offset position */
int	regvar;		/* the next free register for register variables */
int	minrvar;	/* the smallest that regvar gets witing a function */
OFFSZ	inoff;		/* offset of external element being initialized */
int	brkflag = 0;	/* complain about break statements not reached */

struct sw swtab[SWITSZ];  /* table for cases within a switch */
struct sw *swp;  /* pointer to next free entry in swtab */
int swx;  /* index of beginning of cases for current switch */

/* debugging flag */
int xdebug = 0;

int strflg;  /* if on, strings are to be treated as lists */

int reached;	/* true if statement can be reached... */

int idname;	/* tunnel to buildtree for name id's */


NODE node[TREESZ];

int cflag = 0;  /* do we check for funny casts */
int hflag = 0;  /* do we check for various heuristics which may indicate errors */
int pflag = 0;  /* do we check for portable constructions */

int brklab;
int contlab;
int flostat;
int retlab = NOLAB;
int retstat;

/* save array for break, continue labels, and flostat */

int asavbc[BCSZ];
int *psavbc = asavbc ;

# ifndef BUG1
static char *
ccnames[] = { /* names of storage classes */
	"SNULL",
	"AUTO",
	"EXTERN",
	"STATIC",
	"REGISTER",
	"EXTDEF",
	"LABEL",
	"ULABEL",
	"MOS",
	"PARAM",
	"STNAME",
	"MOU",
	"UNAME",
	"TYPEDEF",
	"FORTRAN",
	"ENAME",
	"MOE",
	"UFORTRAN",
	"USTATIC",
	};

char * scnames( c ) register c; {
	/* return the name for storage class c */
	static char buf[12];
	if( c&FIELD ){
		sprintf( buf, "FIELD[%d]", c&FLDSIZ );
		return( buf );
		}
	return( ccnames[c] );
	}
# endif
CALL:
		/* set up size parameters */
		p->stn.stsize = (tsize(STRTY,p->in.left->fn.cdim,p->in.left->fn.csiz)+SZCHAR-1)/SZCHAR;
		p->stn.stalign = talign(STRTY,p->in.left->fn.csiz)/SZCHAR;
		break;

	case REG:
		rbusy( p->tn.rval, p->in.type );
	default:
#ifndef FLEXNAMES
		p->in.name[0] = '\0';
#else
		p->in.name = "";
#endif
		}

	p->in.rall = NOPREF;

	if( ty != LTYPE ) p2tree( p->in.left );
	if( ty == BITYPE ) p2tree( p->in.right );
	}

# endif
# endisumacc/cc/ddt68/   775      0     12           0  3470501557   6544 sumacc/cc/ddt68/.netupd_log   444      0     12        2775  3470501554  10776 Sat Apr 28 18:05:59 1984
  created file Makefile[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:04 1984
  created file bpt.s[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:09 1984
  created file dasmsub.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:16 1984
  created file ddt.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:23 1984
  created file ddt.h[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:27 1984
  created file ddt68.1[coyote], author: mogul on Mon Apr  9 23:01:34 1984
Sat Apr 28 18:06:30 1984
  created file ea68[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:33 1984
  created file ea68.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:37 1984
  created file fddt68.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:42 1984
  created file ins.f[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:46 1984
  created file inscom.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:49 1984
  created file ops68[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:53 1984
  created file ops68.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:57 1984
  created file vea68.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:07:03 1984
  created file vinscom.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:07:07 1984
  created file vops68.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
bugsumacc/cc/ddt68/Makefile   444      0     12        2110  3470501554  10254 # Makefile for ddt68
# Documented by Bill Nowicki January 1982

S = /usr/sun
M = bpt.b ddt.b dasmsub.b
OBJVAX = ddt.o dasmsub.o
CC = cc -g
.SUFFIXES: .b .s .a68 .dl

.c.b .s.b .a68.b:
	cc68 -c $<

#all:	fddt68 ddt68 ddt68.dl DDT68.dl

#install:
#	cp ddt68 $S/bootfile

$S/lib/libddt.a:	$M
	ar ruv $S/lib/libddt.a $M


ddt68:	$M
	cc68 $M -r -o ddt68

ddt68.dl: $M
	cc68 -s -d -T 1a000 $M -o ddt68.dl

fddt68:	$(OBJVAX)
	$(CC) $(OBJVAX) -o fddt68

DDT68.dl: bpt.b ddt.b dmdasmsub.b
	cc68 -s -vm -d -T 5000 bpt.b ddt.b dmdasmsub.b -o DDT68.dl

ddt.b:	ddt.h ddt.c

ddt.o:	ddt.h ddt.c

dasmsub.b:	ddt.h dasmsub.c ea68.c ops68.c

dmdasmsub.b:	ddt.h dasmsub.c ea68.c ops68.c
	cc68 -DDM -c dasmsub.c -o dmdasmsub.b

dasmsub.o: ddt.h dasmsub.c vea68.c vops68.c

ea68.c:	ea68 inscom
	inscom < ea68 > ea68.c

ops68.c: ops68 inscom
	inscom < ops68 > ops68.c

vea68.c: ea68 vinscom
	vinscom < ea68 > vea68.c

vops68.c: ops68 vinscom
	vinscom < ops68 > vops68.c

inscom:	inscom.c
	cc inscom.c -o inscom

vinscom: vinscom.c
	cc vinscom.c -o vinscom

clean:
	rm -f *.b *.o *.out *.dl ddt68 inscom fddt68 vinscom
8[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:53 1984
  created file ops68.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:06:57 1984
  created file vea68.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:07:03 1984
  created file vinscom.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
Sat Apr 28 18:07:07 1984
  created file vops68.c[coyote], author: ds on Thu Feb  5 22:28:16 1970
bugsumacc/cc/ddt68/bpt.s   444      0     12        3152  3470501554   7574 | This file is the low level interface to ddt. It saves registers and passes
| control to ddt.
	.text
	.globl ddtinit			|initial entry point
	.globl ddtbpt			|trap #14 vector
	.globl ddtbrk			|C-level trap routine
	.globl ddttrct			|trace vector
	.globl ddttrace			|C-level trace routine
	.globl ddtosr			|old status register
	.globl ddtopc			|old program counter
	.globl ddtsvregs		|saved gp regs

| Here from a ddtinit() call, normally from crtsun.s
| Must already be in system state

ddtinit:
	addql	#2,sp@			|anticipate following subql #2,sp@
	movw	sr,sp@-			|push status register on stack

| here on a breakpoint trap

ddtbpt:
	movw	#0x2600,sr		| mask off interrupts < 7
	movw	sp@+,ddtosr		|old status register
	subql	#2.,sp@			|point back to bp instruction
	movl	sp@+,ddtopc		|old program counter
	moveml	#/FFFF,ddtsvregs	|save registers
	btst	#5,ddtosr		|see if user state
	bne	callddt			|no
	movl	usp,a0			|yes, get user's sp
	movl	a0,ddtsvregs+60		|and save it
callddt:
	jsr	ddtbrk			|call ddt
traprt:	btst	#5,ddtosr		|again see if user state
	bne	restor
	movl	ddtsvregs+60,a0		|get user sp
	movl	a0,usp			|and restore it to usp
restor:	moveml	ddtsvregs,#/FFFF	|restore registers
	movl	ddtopc,sp@-		|push pc on the stack
	movw	ddtosr,sp@-		|push sr on the stack
	rte				|execute broken instruction
ddttrct:
	movw	#0x2600,sr		| mask off interrupts < 7
	movw	sp@+,ddtosr		|save status register
	movl	sp@+,ddtopc		|save pc
	moveml	#/FFFF,ddtsvregs	|save registers
	btst	#5,ddtosr		|see if user state
	bne	calltr			|no
	movl	usp,a0			|yes, get user's sp
	movl	a0,ddtsvregs+60		|and save it
calltr:	jsr	ddttrace		|call tracer
	bra	traprt
* true if statement can be reached... */

int idname;	/* tunnel to buildtree for name id's */


NODE node[TREESZ];

int cflag = 0;  /* do we check for funny casts */
int hflag = 0;  /* do we check for various heuristics which may indicate errors */
int pflag = 0;  /* do we check for portable constructions */

int brklab;
int contlab;
int flostat;
int retlab = NOLAB;
int retstat;

/* save array for breaksumacc/cc/ddt68/dasmsub.c   444      0     12       27111  3470501554  10446 /* 			68000 Disassembler
 *    			    V.R. Pratt
 *    			    Jan., 1981
 */

#include "ddt.h"

#define NOARGS 6		/* maximum number of opcode arguments */
#define NEARGS 3		/* maximum number of eff.adr. arguments */

/* Symbols external to dasmsub 
 */

char legal;					/* keeps track of *'s */

/* Symbols global to dasmsub but not external.
 */

static long opargs[NOARGS], 			/* where to put opcode args */
     eargs[NEARGS]; 				/* where to put ea args */
static int  argno;				/* global pointer into args */
static int nwords;				/* words in instruction */
static unsigned short *mpc, 			/* main program counter */
      	       *spc;				/* start pc */

static char longflag;				/* 1 -> long */
static char sym;				/* 1 -> symbolic addresses */
static char sizmod;				/* 1 -> one-bit size field */

/* Some general routines.
 *
 * We don't actually talk to the outside world directly. Output is dumped
 * dumped into one of two global buffers and we leave it up to the caller
 * to decide what is to be done with it.
 */

struct cbuffr bfr1, bfr2;		/* the two buffers */
struct cbuffr *cbfp;			/* pointer to active one */

/* As characters are placed in the output buffer, we keep track of the
 * column position and watch out for the special character '*'. This is
 * indication that we have just attempted to disassemble an illegal
 * instruction and the global flag "legal" is cleared.
 */

dasmput(c)
register char c;
{
register int lcol = cbfp->col;

    if ( c != '\t' ) lcol++;
    else lcol = ( ( lcol + 8 ) / 8 ) * 8;
    if ((cbfp->buf[cbfp->pnt++] = c) == '*') legal = 0;
    cbfp->col = lcol;
}

/* The usual routines for numeric conversion.
 *
 * First, an external routine to output a number in some radix.
 */

extern void numout();			/* type a number in current radix */

/* Convert a long to it's ascii hex representation regardless of the
 * "current radix".
 */

static
hex(n)
register unsigned long n;
{
    if ( n > 15 ) hex( n >> 4 );
    n &= 15;
    dasmput((char)( n + ( n>9 ? '7': '0')));
}

/* Convert an integer to it's ascii hex representation in exactly four
 * digits. Insert leading zeroes if required.
 */

static
whex(n)
register unsigned int n;
{
register int i;
register char c;

    for( i = 12; i >= 0; i -= 4)
    {
	c = n>>i & 15;
	dasmput( c + ( c>9? '7': '0'));
    }
}

/* This is a compact disassembler intended for use in the 68000 design
 * module.
 *
 * Principles of Operation
 * 
 * The disassembler has the following components.
 * 
 * 1.  A list of instruction patterns and their assembler forms,
 * each serving as the head of a function definition.
 * 
 * 2.  A list of effective addresses and their assembler forms, each serving
 * as the body of a function definition.
 * 
 * 3.  A function to locate the first entry in the appropriate list matching 
 * a given instruction or effective address, serving as the
 * function-identification component of an eval.
 * 
 * 4.  A function to bind the actual parameters in the instruction or
 * effective address to the formal parameters in the function head.
 * 
 * 5.  A function to substitute the formal parameters into the function body.
 * 
 * 
 * Lists
 * 
 * The two lists are machine readable forms of those given in /usr/pratt/ins68
 * (see /usr/pratt/ins.f for the format of this file).  In the machine
 * readable form each entry has the following structure.
 */

typedef struct Entry
       {char length;
	char modifier;
	unsigned short mask;
	unsigned short pattern;
       } *entry;

/* Following each entry is a character string, considered part of the entry.
 * The entries are concatenated to form a table.  The entry boundaries are
 * determined only by the length member, the tables being intended to be
 * searched forwards linearly.  Entries are aligned on word boundaries.
 * 
 * The length of an entry is the number of bytes in the entry, which may be
 * odd in which case the following entry is one byte further along than
 * indicated by length.
 * 
 * Fparams is an array of 6 formal parameters, each an unsigned nybble (4-bit
 * integer) encoding the type of that parameter.
 *
 * The mask and the pattern together are used to tell whether an item such
 * as an opcode matches entry e, by the test:
 */

#define match(item,ent) ((item ^ ent->pattern) & ent->mask) == 0

/* Match is used by the locate routine, which locates the first entry in the
 * given table matching the given code.
 */

static entry
locate(code,tab) register code; register entry tab;
{
    while (1)				/* guaranteed to find something */
    {
	if (match(code,tab)) break;
	tab = (entry)((long)tab + tab->length + 1 & -2);/* go to next entry */
    }
    return(tab);
}

/* The mask and pattern are also used to extract the arguments from an item 
 * such as an opcode or an effective address.  These are extracted 
 * right-to-left from the item by the function bind and stored in 
 * in successive locations of the area args supplied to bind.
 */

#define shft	{item >>= 1; pattern >>= 1; mask >>= 1;}

static
bind(item,pattern,mask,args)
register short unsigned item, pattern, mask;
long args[];
{
    while (1)					/* loop per argument */
    {
	while (mask&1) shft;			/* skip masked part */
	if (!pattern) break;			/* stopping cond. */
	args[argno++] = (long)(char)(item&(pattern ^ pattern-1)); /* bind */
	while (!(pattern&1)) shft;  shft;	/* skip field */
    }
}

static
bindmod(m,args) register char m;		/* bind modifier */
		register long args[];		/* bind arg */
{
/*n*/	if (m&1 && (!(m&2) || !longflag)) args[argno++] = (short) getwpc((short*)mpc++);
/*i*/	if (m&2 && (!(m&1) || longflag)) {args[argno++] = getlpc((long*)mpc++); mpc++;}
/*g*/   if (m&8) {
		args[argno++] = (unsigned)getwpc(mpc)>>8;
		args[argno++] = getbpc((char *)mpc++ + 1);
	}
/*l*/	if (m&16) longflag = 1;
/*p*/	if (m&32) sym = 1;
/*t*/	if (m&64) sizmod = 1;
/*u*/	if (m&128) args[argno++] = getwpc(mpc++);
}

/* Symbols are dealt with as follows:
 *
 * Output a symbol's name.
 */

static
putsymbol(c) register char *c; 
{
register int i=MAXSYMLEN;

    while (*c != ' ' && *c != '\0' && i--) dasmput(*c++);
}

/* Given a long value "n", and pointer to a symbol table definition,
 * find the symbol entry whose value is 'closest' to "n".
 */
struct sym *
dasmsymbol(n, table)
register long n;
symtabdef *table;
{
register struct sym *current, *best;
register long bestvalue = 0;

#ifdef DM
    for (current = table->start; current < table->limit; current++)
#else
    for (current = table->start; 
	 current < table->limit; 
	 current = (struct sym *)((int)(current+1) + current->slength + ADJ))
#endif DM
	if (bestvalue < current->svalue  &&  current->svalue <= n)
	{
	    best = current;
	    bestvalue = current->svalue;
	}
    return(bestvalue && n - bestvalue < 1000? best: 0);
}

/* Given a value "v", look for a symbol whose value is 'closest' to "v".
 * If one is found, output the name of that symbol, otherwise, output the
 * numeric value of "v" in the current radix.
 */
struct sym *dasmsymbolic(v, table)
register long v;
symtabdef *table;
{
register struct sym *e = dasmsymbol(v, table);
    if (e)
    {
	putsymbol(e+1); 
	if (e->svalue < v) 
	{
	    dasmput('+');
	    numout(v - e->svalue);
	}
    }
    else numout(v);
    return( e );
 }

/* Given a long "y", return it's bit reversal.
 */
static long
rev(y)
long y;
{
register long z=0;
register n=16;
    while (n--)
    {
	z = z<<1|(y&1);
	y>>=1;
    }
    return(z);
}


/* The tables of opcodes and eacodes (for effective addresses) are kept on
 * separate files ops68.c and ea68.c.
 */

static unsigned char
optab[] = {
#ifdef MC68000
#include "ops68.c"
#else ndef MC68000
#include "vops68.c"
#endif MC68000
};

static unsigned char
eatab[] = {
#ifdef MC68000
#include "ea68.c"
#else ndef MC68000
#include "vea68.c"
#endif MC68000
};

/* The heart of this file is instr(), which returns the assembler form
 * of the instruction presently pointed to by mpc.  As a side effect it 
 * advances mpc to the word following the instruction.
 */

static
instr()						/* process next instruction */
{
    sizmod = 0;					/* assume two-bit size field */
    longflag = 0;				/* assume short data */
    legal = 1;					/* innocent till proved g'ty */
    sym = 0;					/* assume nonsymbolic data */
    spc = mpc;					/* remember mpc */
    if( getwpc(mpc) )				/* if word at pc isn't 0 */
	translate( getwpc(mpc++),optab,opargs);	/* translate opcode */
    else
	legal = 0;				/* assume data */
    if (!legal) {
	mpc = spc+1;				/* assume one word */
}
 }

/* The function translate(item,tab,args) translates item, which is either
 * an opcode or an effective address, using the appropriate table tab, either
 * optab or eatab, using args as the base address of the stack of
 * arguments extracted from the item in the course of translation, by the
 * binding mechanisms.
 */

static
translate(item,tab,args)
unsigned short item;
char *tab;
long args[];
{
    entry ent = locate(item,tab);		/* locate entry for opcode */
    argno = 0;					/* where to store args */
    bind(item,ent->pattern,ent->mask,args);	/* bind item arguments */
    bindmod(ent->modifier,args);		/* bind modifier arguments */
    subst((long)ent+6,(long)ent+ent->length,args);	/* substitute args */
}

/* The function subst takes a pair of pointers pointing to the two ends of
 * a string whose free variables are to be instantiated, and a pointer to
 * a stack of arguments to be bound to those variables.
 */

static
subst(cod,lim,args)
char *cod, *lim;
long args[];
{
    while (cod<lim)				/* substitute up to lim */
    if (*cod >= 0) dasmput(*cod++);		/* copy the char directly */
    else					/* execute the command *cod */
    {
	register long v = args[(*cod >> 4) & 7];/* get value v */
	char *siz = "bwl*";
	char *cc  = "rasrhilscccsneeqvcvsplmigeltgtle";/* condition codes */
	char r = 'a';
	switch (*cod++ & 15)
/*k*/	{case 0:  if (v<128) r += 3;
		  dasmput(r);
		  dasmput('0'+((v>>4)&7));
		  dasmput(':');
		  dasmput(v&8? 'l': 'w');
		  break;
/*d*/	 case 1:  r += 3;		/* do a->d conversion */
/*a*/	 case 2:  dasmput(r);
		  dasmput('0'+(v&7));
		  break;
/*E*/	 case 3:  v = ((v&7)<<3)|(v>>3);
/*e*/	 case 4:  translate((short)v,eatab,eargs); 
		  break;
/*s*/	 case 5:  v+=sizmod; dasmput(siz[v]); 
		  if (v==2) longflag = 1;
		  break;
/*v*/	 case 6:  if (v == 0) v = 8;
/*n*/	 case 7:  if (v<0) {
			dasmput('-'); 
		  	numout((long)-v);
		  	break;
		  }
/*u*/	 case 8:  dasmsymbolic((long)v, USRSYMS); 
		  break;
/*y*/	 case 9:  v = rev((long)v);
/*x*/	 case 10: hex((long)(v&0xffff)); break;
/*m*/	 case 11: if (v) cod += *cod; else cod++; break;
/*f*/	 case 12: while (v--) while (*cod++ != ',');
		  while (*cod != ',' && *cod != ')') dasmput(*cod++); 
		  while (*cod++ != ')'); break;
/*c*/	 case 13: dasmput(cc[v*2]); dasmput(cc[v*2+1]); break;
/*r*/	 case 14: dasmsymbolic((long)spc+2+v, USRSYMS); break;
	}
    }
}

/* Finally, the main entry point to this collection of routines.
 * Given a word address, we interpret the word(s) at that address
 * as a 68000 instruction and disassemble them putting the disassembled
 * "source" text in one output buffer, and the hex ascii representation
 * in another. The number of words disassembled is returned.
 */
int dasm(address)
unsigned short *address;
{
     mpc = address;
     bfr1.pnt = bfr2.pnt = 0;
     bfr1.col = bfr2.col = 1;
     cbfp = &bfr1;			/* start off in first buffer */
     dasmsymbolic((long)mpc, USRSYMS);
     if (cbfp->col <= 8) dasmput('\t'); dasmput('\t');
     instr();				/* dis-assemble the instruction */
     dasmput('\0');
     cbfp = &bfr2;			/* switch to second for hex */
     hex((long)spc);			/* address in hex */
     dasmput('\t');
     do {
	whex( getwpc(spc++) );
	dasmput(' ');
	} while (spc < mpc);
     while (cbfp->col < 32) dasmput('\t');
     dasmput('\0');
     return((int) (mpc - address) );
}
68000
#include "vea68.c"
#endif MC68000
};

/* The heart of this file is instr(), which returns the assembler form
 * of the instruction presently pointed to by mpc.  As a side effect it 
 * advances mpc to the word following the instruction.
 */

static
instr()						/* process next instruction */
{
    sizmod = 0;					/* assume two-bit size field */
    longflag = 0;				/* assume short data */
    legal = 1;					/* innocent till provesumacc/cc/ddt68/ddt.c   444      0     12      104503  3470501555   7605 /* 68000 DDT
 * Jim Lawson and Vaughan Pratt -  1981
 * Added 's' command to print stack. Per Bothner 1982/June NOT FINISHED!!!
 *
 */ 

#ifdef MC68000
#define NULL 0				/* from stdio.h */
#define BPTADR *(int(**)())0xb8		/* trap 14 address */
#define TRCADR *(int(**)())0x24		/* trace address */

extern char emt_getchar();

#else ifndef MC68000
#include <stdio.h>
#endif MC68000

#include "ddt.h"

extern struct cbuffr bfr1, bfr2;
extern struct cbuffr *cbfp;

extern short dasm();
extern ddtbpt(), ddttrct();

extern char legal;		/* if last instruction disassembled was */

extern struct sym *dasmsymbol();	/* lookup symbol given value */
extern struct sym *dasmsymbolic();	/* output symbol given value */

static struct bpstr
bp[BPMAX + 1] = { 0 };	/* breakpoint structures */

#define SSBP		0	/* plus one for single stepping */
				/*  over subroutine calls. */

#define BSRINST		0x6100	/* one flavour of subroutine call */
#define JSRINST		0x4E80	/* another flavour */
#define TRAPINST	0x4e40	/* a third flavour */

#define oddpc ((int)pc&1)

static struct bpstr *
cbptr = bp; 			/* current breakpoint or NULL */

static char ssflag = 0;		/* flag set non-zero if single stepping */
static char single = 0;		/* says to set trace bit on exit */
static long sscount = 1;	/* how many single steps */
static short bpno;		/* current bpt if any, else -1 */
short *ddtopc;			/* pc at breakpoint */
short ddtosr;			/* status register at breakpoint */
long ddtsvregs[16] = {0};	/* registers at time of breakpoint */
static short *quitpc;		/* exit pc */
static short quitsr;		/* exit status reg */
static long quitsp;		/* exit stack pointer */
static long smask;		/* string mask - masks chars read */
static long tmask;		/* temporary mask used in search */

static short iradix = DEFRADIX;	/* input radix */
static short oradix = DEFRADIX;	/* output radix */
static long mask = ~0;		/* search mask */
static char *lowlimit, *hilimit;/* search limits */

static char gotarg;		/* true if argument supplied on command */
static long comarg;		/* value of argument */
static char compfx;		/* command prefix */

static int dspbyte();
static int dspword();
static int dsplong();
static int dspsymb();
static int dspstrg();

static int (*dspdata[])() = {	/* array of pointers to int functions */
	dsplong,		/* default */
	dspbyte,
	dspbyte,
	dspword,
	dsplong,
	dspsymb,
	dspstrg	};

static int putbyte();
static int putword();
static int putlong();
static int putstrg();

static int (*depdata[])() = {
	putlong,		/* default deposit */
	putbyte,
	putbyte,
	putword,
	putlong,
	putword,
	putstrg		};

static long lgetbpc();
static long lgetwpc();
static long lgetlpc();
static long lgetspc();

static long (*getldata[])() = {
	lgetlpc,		/* default search mode */
	lgetbpc,
	lgetbpc,
	lgetwpc,
	lgetlpc,
	lgetwpc,
	lgetspc		};

symtabdef ddtusrsyms = {0, 0};		/* start,limit of user symbols */
static char symtype; 			/* type of last symbol found */

static char tomode = 0, tmptomode = 0, dtype = 0;	/* type-out mode */

static short escno;			/* number of escape chars typed */

static char *dot = (char *) 0x1000;	/* last location examined */
static char das = 'u';			/* address space */

static char *symterms = "+- |\r\n/=\\<>?";/* characters which delimit symbols */
static char *argterms = "\r\n*/=\\<>?";	/* ditto for arguments */
#define COMCHRS		"/qgpsxbr=*t\\<>?m\n\r"

/*
 * fetch various flavours of data from memory, returning a long.
 */
static long
lgetbpc(pc) 
char *pc;
{

	return( getbpc(pc) ); 
}

static long
lgetwpc(pc)
char *pc;
{

	return getwpc(pc) ;
}

static long
lgetlpc(pc)
char *pc;
{

	return getlpc(pc) ;
}

static long
lgetspc(pc)
char *pc;
{

      switch ( smask) {
	case 0:
	case 0x7f7f7f7f:return oddpc?(getlpc(pc-1)<<8)|getbpc(pc+3):getlpc(pc);
	case 0x7f:	return getbpc(pc);
	case 0x7f7f:	return oddpc?(getbpc(pc)<<8) | getbpc(pc+1):getwpc(pc);
	case 0x7f7f7f:	return (oddpc? getlpc(pc-1): getlpc(pc)>>8) & 0xffffff;
      }
}

symtabdef ddtsymdef;

/* Special ddt symbols */
struct {struct sym a; char name[4];} ddtsyms[] = {
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[0]}, { '$','d','0',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[1]}, { '$','d','1',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[2]}, { '$','d','2',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[3]}, { '$','d','3',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[4]}, { '$','d','4',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[5]}, { '$','d','5',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[6]}, { '$','d','6',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[7]}, { '$','d','7',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[8]}, { '$','a','0',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[9]}, { '$','a','1',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[10]}, { '$','a','2',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[11]}, { '$','a','3',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[12]}, { '$','a','4',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[13]}, { '$','a','5',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[14]}, { '$','f','p',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[14]}, { '$','a','6',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[15]}, { '$','s','p',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtsvregs[15]}, { '$','a','7',0 } },
{ { LONGTYPE|DDTSYM, 3, (long) &ddtopc}, { '$','p','c',0 } },
{ { WORDTYPE|DDTSYM, 3, (long) &ddtosr}, { '$','s','r',0 } },
{ { POINTERTYPE|DDTSYM, 3, (long) &dot}, {'.',0,0,0 } },
{ { 0, 0, 0}, {0,0,0,0} }
};

/*
 * Output a string.
 */
static
putstring( sp )
register char *sp;
{
    while( *sp ) emt_putchar( *sp++ );
}

/*
 * Force a character to upper case.
 */
static char
forceupper(c)
char c;
{
    if( (c) >= 'a' && (c) <= 'z') c = c - 'a' + 'A';
    return(c);
}

/*
 * Convert a character to a format suitable for symbols.
 */
static char
macify(c)
char c;
{
#ifdef DM
    return( forceupper(c) );
#else
    return( c );
#endif
}

/*
 * Validate candidate for new radix.
 */
static short
setradix(value)
long value;
{
    if( value > 0 && value < 26L )	/* possible radix ? */
	return((short) value);
    else
	return(DEFRADIX);		/* return default */
}

/*
 * Convert a number to its ascii representation in the current output radix.
 */
void
numout(number)
unsigned long number;
{
register unsigned short c;

    c = number % oradix;
    if( number /= oradix ) numout( number );
    c &= 0xFF;
    c += (c > 9) ? ( 'A' - 10 ) : '0';
    dasmput(c);
}

/*
 * Print a number in the current output radix.
 */
static void
printnum(number)
long number;
{
    bfr1.pnt= 0;
    bfr1.col= 1;
    cbfp = &bfr1;
    numout( number );		/* output value of arg */
    dasmput('\0');
    putstring(bfr1.buf);
}

/*
 * Print address at pc in a suitable format.
 */
static void
printadrs( pc )
long pc;
{
symtabdef *table;
register struct sym *sp;

    if( das == 'd' )			/* in ddt's address space ? */
	table = &ddtsymdef;
    else
	table = USRSYMS;
    bfr1.pnt= 0;
    bfr1.col= 1;
    cbfp = &bfr1;
    dasmsymbolic( pc, table );
    dasmput('\0');
    putstring(bfr1.buf);
}

/*
 * Test character set membership.
 */
static short
oneof(c,string)
register char c, *string;
{
register char m;

    while(( m = *string++ ))
	if( c == m ) return(1);
    return(0);
}

/*
 * Check a character to see if it's a valid digit in the current radix.
 */
static short
isdig(c, d)
register char c;
short *d;
{
register short valid;

    *d = 0;
    c = forceupper(c);

    if( c < '0' ) valid = 0;	/* not a digit no how */
    else if( iradix <= 10 )
	if( c > ( '0' + iradix - 1 ) ) valid = 0;
	else 
	{
	    valid = 1;
	    *d = c - '0';
	}
    else if( c <= '9' )
	{
	    valid = 1;
	    *d = c - '0';
	}
	else if( c > ( 'A' + iradix -10 -1 ) ) valid = 0;
	    else
	    {
		valid = 1;
		*d = c - 'A' + 10;
	    }
    return(valid);
}

/*
 * Build a number and return the character that delimited it.
 */
static char
getnum(string, value)
char *string;
long *value;
{
char c;
short d;
register long n = 0;

    while( isdig((c = *string++), &d))	/* while we're eating digits...*/
    {
	n = n * iradix + d;
    }
    *value = n;
    return(c);
}

/*
 * Look up a string in the symbol table. Return a pointer to entry if found,
 * NULL if not.
 */
static struct sym*
findsym(string, table)
char *string;
symtabdef *table;
{
register struct sym *current;
    for( current = table->start; current < table->limit;
    	current = (struct sym *)((int)(current+1) + current->slength + ADJ))
    { register char *sym = string;
      register char *name = (char *)(current+1);
      register short i;

	for( i = MAXSYMLEN; i; i-- )
	{
	    if( *sym == '\0' )
		if( *name == ' ' || *name == '\0' )
		    return(current);	/* found it */
	    if( *sym++ != *name++) break;
	}
	if( i == 0 ) return( current );
    }
    return((struct sym *) NULL);
}

/*
 * Add a symbol to the symbol table. Returns a pointer to the new
 * symbol entry if successful, NULL otherwise.
 */
static struct sym*
addsym( string, value, table )
register char *string;
long value;
symtabdef *table;
{
register struct sym *sp = table->limit++;
register char *name = (char *)(sp+1);
register short i;

    for( i = MAXSYMLEN; i; i-- )
    {
	if( *string != '\0' )		/* end of string ? */
	    *name++ = *string++;		/* if not, copy characters */
	else
	    *name++ = '\0';		/* otherwise, spaces */
    }
    sp->svalue = value; 			/* set the value of the symbol */
    return( sp );
}

/*
 * Scan characters into a symbol, set the value of the symbol,
 * and return the character that delimited the symbol. Set gotarg to 1
 * if a symbol was successfully scanned.
 */
static char
getsym(symvalue)
register long *symvalue;
{
char c, symbol[40];
register char *sptr = symbol;
register struct sym *symadr;

/* insert characters into symbol until we hit an argument terminator */

    smask = 0;
    *symvalue = 0;
    while( !oneof( ( c = emt_getchar()), symterms))
	if (c == 127) {
		if (sptr > symbol) {
			sptr--;
			putstring("\b \b");
		}
	}
	else *sptr++ = macify(c);

    *sptr = '\0';

	if(( sptr - symbol ) == 0 ) return c; /* case of reading nothing */
	das = 'u';			/* assume user's address space */
	gotarg = 1;			/* we have an argument */

/* if starts with '"' it must be a string - get last 4 chars */
	if ( symbol[0] == '"') {
		char *sptr = symbol+1;
		*symvalue = 0;
		while ( sptr[0] && (sptr[0] != '"' || sptr[1] == '"' )) {
			*symvalue = (*symvalue<<8) | sptr[0];
			smask = (smask<<8) | 0x7f;
			if (sptr[0] == '"') sptr++;
			sptr++;
		}
		return c;
	}

/* assume what we have is a symbol and look for it in ddt's symbol table */

	if((symadr = findsym(symbol, &ddtsymdef)))
		das = 'd';		/* ddt's address space */

/* if we don't find it there, look for it in the user's symbol table */

	else symadr = findsym( symbol, USRSYMS );

	if( symadr ) {	      /* if either returned an address, we found it. */
	    symtype = symadr->stype;	/* remember symbol type */
	    if(( symtype & DDTSYM ) && ( symtype & POINTERTYPE ))
	    {
		*symvalue = *(long *) symadr->svalue;
		das = 'u';		/* really user address space */
	    }
	    else *symvalue = symadr->svalue;	/* return its value */
	}
	else {				/* assume it's a numeric constant */
	    symtype = 0;		/* type is unknown */
	    if( getnum(symbol, symvalue) != '\0') {
		c = BADARG;
		gotarg = 0;
		*symvalue = 0;
	    }
	}

    return c;
}

/*
 * Ascertain the correct type-out mode for the current display.
 * If the user has specified a type-out mode (or symbol type) use
 * that, else, if the symbol type is known, use that, otherwise,
 * carry on using the current mode.
 */
static
settomode( pc )
char *pc;
{
symtabdef *table;
register struct sym *sp;

    if( das == 'd' )			/* ddt symbol ? */
	table = &ddtsymdef;
    else
	table = USRSYMS;
    sp = dasmsymbol( pc, table );	/* find nearest symbol */
    symtype = sp? sp->stype: 0;
    if( tmptomode )			/* over-riding default mode ? */
	dtype = tmptomode;
    else if( tomode )			/* user-specified type ? */
	dtype = tomode;			/* use that */
    else
	dtype = symtype;
    dtype &= TYPEFIELDMASK;
}

/*
 * Convert single character type specification into appropriate type-out
 * mode.
 */
static short
gettomode( c )
char c;
{
short totype;
    switch( c )
    {
	case 'c':   totype = CHARTYPE;
		    break;

	case 'h':   totype = BYTETYPE;
		    break;

	case 'w':   totype = WORDTYPE;
		    break;

	case 'l':   totype = LONGTYPE;
		    break;

	case 'i':   totype = INSTTYPE;
		    break;

	case 's':   totype = STRTYPE;
		    break;

	default:    totype = 0;
		    break;
    }
    return( totype );
}

/*
 * Make sure pc contains a valid word address
 */
static char *
wordadr( pc )
register long pc;
{
    return ((char *) ( pc & ~1 ));	/* better be even */
}

/*
 * Here to display data
 */
static int
display( type, adrs )
char *adrs;
short type;
{
    return( (*dspdata[type])(adrs) );
}

/*
 * Here to deposit data
 */
static int
deposit( type, adrs, data )
short type;
char *adrs;
long data;
{
    return( (*depdata[type])(adrs, data) );
}

/*
 * Here to increment pc.
 */
static char *
inc_pc( pc, inc )
register char *pc;
register int inc;
{
    return( (char *) pc + inc );
}

/*
 * Function to decrement pc. Returns pc - inc.
 */
static char *
dec_pc( pc, dec )
register char *pc;
register int dec;
{
register int nwords = 0, i;
register short *pos = (short *) wordadr( pc ) - 6;

    if( dtype == INSTTYPE )
    {
	for( i = 5; i > 0; i--)
	{
	    if (getbpc(++pos) != -1) {
		nwords = dasm(pos);	/* attempt to disassemble */
	    	if( legal && ( nwords == i ) ) return( (char *) pos );
	    }
	}
	if (getbpc(wordadr(pc)) == -1) return wordadr(pos);
	else return wordadr(pos)-1;
    }
    if (dtype == STRTYPE)
    {
	while (getbpc(--pc) == 0);
	while (getbpc(--pc) > 0);
	if (getbpc(pc) == -1) pc++;
	return pc;
    }
    return((char *) pc - dec );
}

/*
 * Here to get data from memory for search comparision
 */
static long
getsearchval( type, pc )
char *pc;
short type;
{
    return( (*getldata[type])( pc ) );
}

/* Commands consist of an argument terminated by one or more argument
 * terminators, followed by a single character command.  Arguments may be
 * numeric constants, symbols or register specifications.
 */
static char
getarg()
{
long symvalue;
char c, nxdel;

    gotarg  = 0;
    comarg = 0;

    c = getsym(&comarg);		/* eat a symbol */
    while(!oneof(c, argterms))
    {
	nxdel = getsym(&symvalue);	/* eat another symbol */
	switch(c)
	{
	    case '|':	comarg |= symvalue; break;
	    case '+':	comarg += symvalue; break;
	    case '-':	comarg -= symvalue; break;
	    default:	comarg = symvalue; break;
	}
	c = nxdel;
    }
    return(c);
}

static char
getcom()
{
char c;

    escno = 0;
    c = getarg();		/* get argument */
    while( c == ESCCHR )
    {
	escno++;		/* count escapes */
	emt_putchar(0);		/* render escape harmless to tty */
	emt_putchar('$');	/* and echo dollar */
	c = emt_getchar();
    }
    return(c);
}

/*
 * Interpret the command argument (if there is one) as a pc. 
 */
static short
setpc(pcptr)
char **pcptr;
{
    if( gotarg )			/* was an argument supplied ? */
    {
	if( !comarg || ( comarg & 1 ) )	/* better be non-zero and even */
	{
	    return(0);			/* otherwise, don't do anything */
	}
	*pcptr = (char *) comarg;	/* set pc */
    }
    return(1);
}

/*
 * Function to display data at pc in symbolic format. Returns number
 * of bytes displayed.
 */
static int
dspsymb(pc)
char *pc;
{
int nbytes;

    pc = wordadr( pc );			/* legal word address */
    nbytes = dasm( pc ) * 2;		/* disassemble and return size */
    putstring(bfr2.buf);		/* print hex pc and contents */
    putstring(bfr1.buf);		/* print symbolic " */
    return( nbytes );
}

/*
 * Function to display pc and contents as a single byte. Returns number
 * of bytes displayed (i.e. 1)
 */
static int
dspbyte(pc)
char *pc;
{
    printadrs( pc );		/* type out pc value */
    emt_putchar(' ');
    if( dtype == CHARTYPE) {
	emt_putchar('\'');
	if (getbpc(pc) == '\'') emt_putchar('\\');
	nicechar( getbpc( pc ) );
	emt_putchar('\'');
    }
    else printnum( (long) ( getbpc( pc ) & 0xFF ) );
    return( 1 );
}

/*
 * Function to deposit byte of data at pc.
 */
static int
putbyte( pc, longdata)
char *pc;
long longdata;
{
    putbpc(pc, longdata);
    return( 1 );
}

/* Function to display pc and contents as a single word. Returns number of
 * bytes displayed (i.e. 2).
 */
static int
dspword(pc)
char *pc;
{
    pc = wordadr( pc );			/* valid word address */
    printadrs(pc);			/* print pc in hex */
    emt_putchar(' ');
    printnum( (long) ( getwpc(pc) & 0xFFFF ) );	/* print word contents */
    return( 2 );			/* always display 2 bytes */
}

/*
 * Function to deposit word of data at pc.
 */
static int
putword( pc, longdata)
char *pc;
long longdata;
{
    putwpc(pc, longdata);
    return( 2 );
}

/*
 * Function to display pc and contents as a long. Returns number of bytes
 * displayed (i.e. 4)
 */
static int
dsplong( pc )
char *pc;
{
    pc = wordadr( pc ); 		/* legal word address */
    printadrs( pc );
    emt_putchar(' ');
    printnum( getlpc( pc ) );
    return( 4 );			/* always display 4 bytes */
}

/*
 * Function to deposit long at pc.
 */
static int
putlong( pc, longdata)
long *pc;
long longdata;
{
    putlpc(pc, longdata);
    return ( 4 );
}

static
nicechar(c)
char c;
{
	if (' ' <= c && c < 127) emt_putchar(c);
	else switch(c) {
		case '\b': putstring("\\b"); break;
		case '\t': putstring("\\t"); break;
		case '\r': putstring("\\r"); break;
		case '\n': putstring("\\n"); break;
		case '\\': putstring("\\\\"); break;
		case 127:  putstring("^?"); break;
		default:   if (0 <= c && c < ' ') {
				emt_putchar('^');
				emt_putchar(c+64);
			   }
			   else {
				   emt_putchar('\\'); 
				   emt_putchar('0'+((c>>6)&3));
				   emt_putchar('0'+((c>>3)&7));
				   emt_putchar('0'+(c&7)); break;
			   }
		}
}

/*
 * display string pointed to by pc
 */
static int
dspstrg( pc )
char *pc;
{
   int c, len=0;
   printadrs( pc );
   putstring(" \"");
   while ((c = getbpc(pc++)) > 0) {
	if (c == '"') emt_putchar('\\');
	nicechar(c);
	len++;
   }
   emt_putchar('"');
   return len+1;
}

/*
 * deposit string starting at pc
 */
static int
putstrg(pc, s)
char *pc, *s;
{
   int len = 0;
   while (*s) {
	putbpc(pc++, *s++);
	len++;
   }
   putbpc(pc++, '\0');
   return len;
}

#ifdef MC68000
/* Breakpoint routines.
 *
 * Breakpoint 0 is reserved for single stepping over subroutine calls.
 */

#define ALLBPLOOP(i, p)		for( i = 0, p = &bp[0]; i <= BPMAX; i++, p++ )
#define USERBPLOOP( i, p)	for( i = 1, p = &bp[1]; i <= BPMAX; i++, p++ )

/* Here to remove breakpoints, i.e. stick original instructions back
 * in the calling program. In addition, it returns the one-origin index
 * breakpoint id.
 */
static short
rmovebps()
{
register struct bpstr *bpptr;
register short i, bpno = -1;

    ALLBPLOOP( i, bpptr )
    {
	if( bpptr->pc != NULL )		/* this breakpoint in use ? */
	{
	    if( *bpptr->pc == BPINST )	/* was it actually set ? */
	    {
		if( ddtopc == bpptr->pc )	/* find the breakpoint ? */
		    bpno = i;		/* save breakpoint index */
		*bpptr->pc = bpptr->oldinst;/* replace original instruction */
	    }
	}
    }
    return( bpno );			/* indicate which breakpoint it was */
}

/* Here to plant breakpoints. Returns the number of breakpoints set.
 */
static short
plantbps()
{
register struct bpstr *bpptr;
register short i, nbp = 0;

    ALLBPLOOP( i, bpptr )
    {
	if( bpptr->pc != NULL )		/* if breakpoint pc is non-zero, */
	{
	    nbp++;			/* one more bp set. */
	    if( *bpptr->pc != BPINST )	/* forget this if already there */
	    {
		bpptr->oldinst = *bpptr->pc;/* save old instruction */
		*bpptr->pc = BPINST;	/* set breakpoint instruction */
	    }
	}
    }
    return( nbp );
}

/* Here to clear breakpoints, just set breakpoint pc to 0. By this time
 * the original instructions should already be back in the calling program.
 */
static void
clearbps()
{
register struct bpstr *bpptr;
register short i;

    ALLBPLOOP( i, bpptr )
	bpptr->pc = NULL;		/* no longer in use */
}

/* Set a breakpoint. */
static
setabp( adrs, bpno )
register short *adrs;
register char bpno;
{
register short i;
register struct bpstr *bpptr, *fbp = NULL;

    USERBPLOOP( i, bpptr )		/* go through the breakpoint array, */
    {					/* removing any breakpoints already */
	if( bpptr->pc == adrs ) bpptr->pc = NULL; /* set at this location, */
	if( ( fbp == NULL ) && ( bpptr->pc == NULL ) )   /* and */
	    fbp = bpptr;		/* remember likely candidates for */
    }					/* new breakpoint. */
    if( bpno )				/* if user supplied specific bp no. */
	fbp = &bp[bpno];		/* use it. */
    if( fbp == NULL ) 			/* do we know where to put this bp ?*/
	putstring( "no bp\n" );		/* complain if not...*/
    else
	fbp->pc = adrs;
}

/* Clear a breakpoint.
 */
static
clearabp( bpno )
register char bpno;
{
    if( bpno )				/* specific bp to clear ? */
	bp[bpno].pc = NULL;
    else
	clearbps();			/* remove all breakpoints */
}

/* Print breakpoints.
 */
static
printbps()
{
register struct bpstr *bpptr;
register short i;
char *bppos = "B0 @ ";

    emt_putchar('\n');
    USERBPLOOP( i, bpptr )
    {
	if( bpptr->pc )
	{
	    bppos[1] = i + '0';
	    putstring(bppos);
	    printadrs( bpptr->pc );
	    emt_putchar('\n');
	}
    }
}

/* Print out stack, upto depth abs(depth).
 * If depth > 0, also print arguments to procedure.
 */
static
printstack(depth)
int depth;
{
register int dep = (depth > 0 ? depth : depth < 0 ? -depth : 9999),
	i, jumpfrom,
	*fp = ddtsvregs[14];
short inst;

    while (dep--) {
	putstring("At about ");
	jumpfrom = fp[1];
	numparams = 0;
	inst = *(short *)jumpfrom;
	if ((inst & 0xF1FF) == 0x508F)	/* addql #n,sp */
	    {numparams = (inst&0x0E00) >> 8; if (!numparams) numparams = 8;}
	else if (inst == 0xDEFC)	/* addaw #n,sp */
	    numparams = ((word *)jumpfrom)[1];
	else if (inst == 0xDFFC)	/* addal #n,sp */
	    numparams = ((int *)jumpfrom)[1];
	if (numparams & 3) numparams = 0 else numparams >>= 2;
	jumpfrom -= 2;
	if ((*(short *)jumpfrom & 0xFF00) = 0x6100)
	    jumpfrom = jumpfrom + (signed char)(*(short *)jumpfrom & 0xFF);
	/* ... */
	printadrs (jumpfrom);
	putstring(" call of ");
	/* printadrs (...); */
	if (depth >= 0) {	/* print parameters to call */
	    i = 1;
	    putstring(" (");
	    while (i < numparam) {numout (fp[(i++)+1]); emt_putchar(',');}
	    if (numparam > 0) numout(fp[i+1]);
	    emt_putchar (")");
	}
	emt_putchar ('\n');
        if (*fp && *fp < fp) fp = *fp
	else return;
    }
}

#endif MC68000

/* Major command loop. Process commands until we get a "go" or "continue".
 */
static
comloop()
{
char c, go = 0, lopen = 0;
short nbytes, inc;
char *adrs;
long temp;
long test, searchvalue;
char searchmode;

    emt_putchar('\n');
    if ((ssflag && sscount>0 && (!cbptr || cbptr->count>0)) ||
	(!ssflag && cbptr && cbptr->count>0))
		return;
    ssflag = 0;				/* out of single step mode */
    while (!go)
    {
	if( !lopen ) putstring(".");
	compfx = 0;			/* no command prefix */
	c = getcom();			/* get argument and command */
	if( !oneof( c, COMCHRS ) )	/* if this isn't a command, */
	{
	    compfx = c;			/* assume it's a prefix and */
	    c = emt_getchar();		/* get another character. */
	}
	switch(c)			/* dispatch on delimiter */
	{
	    badcom:
	    default:
	    case BADARG:
			putstring("?");
			break;

	    case '/':
	    case '\\':	if( lopen )
			{
			    if( gotarg ) nbytes = deposit( dtype, dot, comarg );
			    dot = ( c == '/' ) ? inc_pc( dot, nbytes )
					       : dec_pc( dot, nbytes );
			}
			else
			{
			    if( gotarg ) dot = (char *) comarg;
			}
			settomode( dot );
			if (dtype == STRTYPE)
				while (!getbpc(dot)) dot++;
			emt_putchar('\n');
			nbytes = display( dtype, dot );
			emt_putchar(' ');
			lopen = 1;	/* location is open */
			break;
			
	    case '\r':
	    case '\n':	if( lopen )
			{
			    if( gotarg ) deposit( dtype, dot, comarg );
			    lopen = 0;
			}
			tmptomode = 0;		/* clear default type-out */
			break;

	    case 'm':	if( gotarg ) mask = comarg;
			break;

	    case '<':	if( gotarg ) lowlimit = (char *) comarg;
			c = getarg();		/* get next argument */
			if( c == '>' )
			{
			/* no break */
		
	    case '>':	if( gotarg ) hilimit = (char *) comarg;
			c = getarg();	/* get next argument */
			}
			if( c != '?' )
			    goto badcom;
			/* no break */

	    case '?':	if( gotarg ) searchvalue = comarg;
			settomode( dot );
			searchmode = smask? STRTYPE: dtype;
			tmask = smask? smask: mask;
			inc = ( searchmode == CHARTYPE || 
				searchmode == BYTETYPE ||
				searchmode == STRTYPE)?    1: 2;
			for( adrs = lowlimit; adrs < hilimit; adrs += inc)
			{
			    test = getsearchval( searchmode, adrs);
			    if( ( test & tmask ) == ( searchvalue & tmask ) ) {
				emt_putchar('\n');
				display( searchmode, adrs );
			    }
			}
			break;
#ifdef MC68000
	    case 'g':	if( setpc( &ddtopc) ) 	/* valid pc ? */
			    go = 1;
			else
			    goto badcom;
			break;

	    case 'p':	if( cbptr) 		/* inside a break point ? */
			    cbptr->count = gotarg? (short) comarg : 1;
			go = 1;
			break;

	    case 's':   /* Print call stack. Per Bothner June 82 */
			printstack (gotarg ? comarg : 0);
			break;

	    case 'x':	sscount = 1;
			if (gotarg) sscount = comarg;
			ssflag = escno;	/* do single step */
			go = 1;
			break;

	    case 'b':	if( gotarg )		/* get any argument ? */
			{

/* if we got a prefix, this is a specific breakpoint specification */

			    if( compfx )
			    {
				compfx -= '0';
				if( compfx <= 0 || compfx > BPMAX )
				    goto badcom;
			    }
			    if( comarg )	/* non-zero ? */
			    {
				if( !setpc( &comarg ) ) /* legal pc address */
				    goto badcom;
				setabp( comarg, compfx );
				if ( comarg == (long)ddtopc ) bpno = 1; /* > 0 */
			    }
			    else {
				clearabp( compfx );
				if ( !compfx || compfx == bpno) 
					bpno = -1;
			    }
			}
			else
			    printbps();
			break;

#endif MC68000
	    case 'r':	temp = setradix( comarg );
			if( compfx == 'i' ) iradix = temp;
			else if( compfx == 'o' ) oradix = temp;
			else goto badcom;
			break;

	    case '=':	printnum( comarg );
			break;

	    case 't':	if( escno > 1 ) {
			    	tomode = gettomode( compfx );
			    	tmptomode = 0;
			}
			else tmptomode = gettomode( compfx );
			break;

	    case '':
			break;
#ifndef MC68000
	    case 'q':	ddtopc = quitpc;		/* reset pc */
			ddtosr = quitsr;		/* status register */
			ddtsvregs[15] = quitsp;	/* and stack */
			go = 1;
			break;
#endif
	}
	if (!lopen) emt_putchar('\n');
    }
}

#ifdef MC68000
/* Here on a trace trap.
 */
ddttrace()
{
    if( ssflag == 1 )			/* are we single stepping */
    {					/*  everything ? */
	ddtbrk();
    }
    else				/* this is breakpoint cleanup */
	plantbps();			/* or subroutine single step */
}

#endif MC68000
	
/*
 * Onceonly code to be executed on initial startup.
 */
char ddtfirst = 1;

#ifdef MC68000
extern struct {short skip; struct sym *symstart;} _start; /* crtsun structure*/
#endif

/* Initialize slength member of symbol table entry */
static setlen(sp)
struct sym *sp;
{

	return ( sp->slength = strlen(sp+1) );
}

static void 
onceonly(x)
{
register struct sym *sp;

    if( ddtfirst )
    {
	ddtfirst = 0;
	ddtsymdef.start = (struct sym *)ddtsyms;
	for( sp = (struct sym *)ddtsyms; 
	     *(char*)(sp+1) != '\0';
	     sp = (struct sym *)((int)(sp+1) + setlen(sp) + ADJ));
	ddtsymdef.limit = sp;
	if (!(USRSYMS->start)) {
		USRSYMS->start = _start.symstart;
		USRSYMS->limit = (struct sym *)((int)(_start.symstart)
					     + ((int*)(_start.symstart))[-1]
					     - 18);
	}
	for (sp = USRSYMS->start; 
	     sp < USRSYMS->limit;
	     sp = (struct sym *)((int)(sp+1) + setlen(sp) + ADJ))
		switch (sp->stype & 7) {
			case TEXT:	sp->stype = INSTTYPE; break;
			case BSS:
			case DATA:	sp->stype = LONGTYPE; break;
			default:	sp->stype = 0; break;
		}

/* memorize initial entry conditions */

	quitpc = ddtopc;			/* save original pc */
	quitsr = ddtosr;			/* save status reg */
	quitsp = ddtsvregs[15];			/* save stack */

#ifdef MC68000
	BPTADR = ddtbpt;			/* set trap vector */
	TRCADR = ddttrct;			/* set trace vector */
#endif
    }
}

/* Here from the breakpoint trap instruction. Figure out which breakpoint
   it is and print the appropriate message.
 */
ddtbrk()
{

char *bpstring = "B0>  ";
	onceonly();			/* do once only code */
#ifdef MC68000
	ddtosr &= 0x7fff;			/* clear trace bit in sr */
    	bpno = rmovebps();		/* remove breakpoints */
	if( bpno == SSBP )		/* if this was the subroutine ss, */
	    bp[SSBP].pc = NULL;		/* its gone now. */
	bpstring[1] = bpno + '0';	/* indicate which bp or ss */
        putstring(bpstring);		/* output breakpoint header */
	while (!dasm(ddtopc)) ddtopc--;	/* back up to legal instruction */
	putstring(bfr2.buf);		/* and display it */
	putstring(bfr1.buf);
	if (ssflag) sscount--;		/* count down single step */
	if( bpno > SSBP ) {		/* if breakpoint, */
	    cbptr = &bp[bpno];		/* remember appropriate pointer */
	    cbptr->count--;		/* count down the breakpoint counter */
	}
	else
	    cbptr = NULL;
	dot = (char *) ddtopc;		/* dot defaults to here */
#endif MC68000
	comloop();			/* process commands */

/* we are about to return to the calling program. set breakpoints or
 * turn on tracing.
 */

#ifdef MC68000

    if(ssflag) {
	if (escno > 1 )		/* should we worry about subroutines? */
	    if( ( ( *ddtopc & 0xFF00 ) == BSRINST ) ||
		( ( *ddtopc & 0xFFC0 ) == JSRINST ) ||
		( ( *ddtopc & 0xFFF0 ) == TRAPINST ) ) {
			bp[SSBP].pc = ddtopc + dasm( ddtopc );/* set bp at return */
	    		ssflag = escno;
            }
        else ssflag = 1;		/* same as ordinary single step */
    }

    if( ssflag || bpno > 0 )		/* if single-stepping, */
    {					/*   or it's time for bp cleanup, */
	ddtosr |= 0x8000;			/* turn on the trace bit */
    }
    else				/* otherwise, */
    {
	plantbps();			/*   plant breakpoints */
    }
#endif MC68000
}

#ifndef MC68000

#include <signal.h>
#include <sgtty.h>

#define R	0		/* read-only mode */
#define RW	2		/* open for read/write */
#define FBLK	512		/* 512 byte reads */
#define MAXSYMLEN	10	/* must agree with ddt and dl68 */

struct sgttyb ttystate, *ttystatep = &ttystate;
short oflags;			/* place to remember the original tty flags */
int cleanup();
int (*cleanupptr)() = cleanup;	/* pointer to cleanup function */

struct bhdr filhdr;

unsigned char fbfr[FBLK] = { 0 };
int ifile;
unsigned char *bfrendpc, *bfrbegpc;
char bfrchnge;

unsigned char *origin = (unsigned char *)0x1000;

extern int open();
extern int read();

/* fetch a buffer that contains the byte pointed to by pc */
int getbfr( pc )
unsigned char *pc;
{
int nchars;
long fpc;

    if (pc < origin) {
	putstring("pc too small");
	return -1;
    }
    fpc = pc - origin + sizeof(filhdr);
    lseek( ifile, fpc, 0);	/* position the file */
    bfrendpc = bfrbegpc = pc;
    nchars = read( ifile, fbfr, FBLK);
    if( nchars > 0 )
	bfrendpc += nchars;
    else
    {
	putstring("pc too large");
	return -1;
    }
    return( nchars );
}

/* see if location desired is in the buffer */
int inbfr( pc )
unsigned char *pc;
{
    if( bfrbegpc <= pc && pc <= bfrendpc ) return(1);
    else return(0);
}

/* fetch the byte at pc */
getbpc(pc)
unsigned char *pc;
{
    if( das == 'd' )		/* fetch from ddt's address space ? */
    {
	return( (int)*pc );
    }
    if( !inbfr( pc ) )
	if (getbfr( pc ) == -1) return -1;
    return( (int)fbfr[pc - bfrbegpc] );
}

/*
 * Write the byte at pc.
 */
void putbpc(pc, data )
unsigned char data;
unsigned char *pc;
{
    if( das == 'd' )
    {
	*pc = data;

    }
    else
    {
	if( !inbfr( pc ) )
	    getbfr( pc );
	fbfr[pc - bfrbegpc] = data;
	bfrchnge = 1;
    }
}
/* fetch the word at pc */
short getwpc(pc)
char *pc;
{
short word;
    if( das == 'd' )			/* fetch from ddt's address space ? */
    {
	word = *(short *) pc;
    }
    else
    {
	word = getbpc(pc) << 8;		/* get byte */
	word |= getbpc(pc+1) & 0xFF;
    }
    return( word );
}

/*
 * Write the word at pc
 */
void putwpc( pc, data )
char *pc;
short data;
{
    if( das == 'd' )
    {
	*(short *)pc = data;
    }
    else
    {
	putbpc( pc, (char) ( data >> 8 ) );
	putbpc( pc + 1, (char) ( data & 0xFF ) );
    }
}

/* fetch a long at pc */
long getlpc(pc)
char *pc;
{
long lword;
    if( das == 'd' )
    {
	lword = *(long *)pc;
    }
    else
    {
	lword = getwpc(pc) << 16;
	lword |= getwpc(pc+2) & 0xFFFF;
    }
    return( lword );
}

/*
 * Write the long at pc.
 */
void putlpc( pc, data )
char *pc;
long data;
{
    if( das == 'd' )
    {
	*(long *)pc = data;
    }
    else
    {
	putwpc( pc, (short) ( data >> 16 ) );
	putwpc( pc + 2, (short) ( data &0xFFFF ) );
    }
}

reverse(lwrd) unsigned lwrd;
 {return((lwrd>>24)	     |
	 (lwrd>>8 & 0xff00)  |
	 (lwrd<<8 & 0xff0000)|
	 (lwrd<<24)
	);
 }

readsyms(filename)
char *filename;
{
FILE *sfile;
struct sym s;
int symno, chrno;
char c;
struct sym *sp;

    if( ( sfile = fopen(filename, "r", sfile)) == NULL )
    {
	fprintf( stderr, "Can't open symbol file %s\n", filename);
	exit(2);
    }

    fseek(sfile, SYMPOS, 0);

    sp = ddtusrsyms.start = (struct sym *) malloc(filhdr.ssize);
    ddtusrsyms.limit = (struct sym *)((int)sp + filhdr.ssize);
    fread(sp,filhdr.ssize,1,sfile);		/* Get symbol table */
    fclose( sfile );				/* close the symbol file */
}

/*
 * reset the tty state to what it was originally.
 */
void resettty()
{
    ttystate.sg_flags = oflags;	/* restore original flags */
    stty( 0, ttystatep);	/* restore original tty state */
}

/* Here on a signal interrupt. reset the tty state and exit */
int cleanup(signo)
int signo;
{
    resettty();
    exit(4);
}

main(argc, argv)
int argc;
char *argv[];
{
int nchrs;

    if( argc != 2 )
    {
	fprintf( stderr, "usage: %s filename\n", argv[0]);
	cleanup();
    }
    if( ( ifile = open(argv[1], R ) ) == -1 )
    {
	fprintf( stderr, "Can't open %s\n", argv[1]);
	cleanup();
    }
    nchrs = read( ifile, &filhdr, sizeof(filhdr));
    if( nchrs <= 0 )
    {
	fprintf( stderr, "Unexpected eof or error on %s\n", argv[1]);
	cleanup();
    }
    if( filhdr.fmagic != FMAGIC )
    {
	fprintf( stderr, "%s doesn't look like a .out file \n", argv[1] );
	cleanup();
    }
    printf("text size: %ld\n", filhdr.tsize);
    printf("data size: %ld\n", filhdr.dsize);
    printf("bss size: %ld\n", filhdr.bsize);
    printf("symbol table size: %ld\n", filhdr.ssize);
    printf("text relocation size: %ld\n", filhdr.rtsize);
    printf("data relocation size: %ld\n", filhdr.rdsize);
    printf("entry point: 0x%lx\n", filhdr.entry);
    origin = (unsigned char *)filhdr.entry;
    if(filhdr.ssize > 0 )
	readsyms(argv[1]);
    else
	ddtusrsyms.start = ddtusrsyms.limit = 0;

/* now prepare for cbreak'ing */

    if( isatty(0) )			/* if we are connected to a tty */
    {
    int sig;

	gtty( 0, ttystatep);		/* get current tty state */
	oflags = ttystate.sg_flags;	/* save old flags */
	for( sig = 1; sig <= NSIG; sig++)
	    signal(sig, cleanup);	/* arrange to clean-up before exit */
	ttystate.sg_flags |= CBREAK;	/* turn on CBREAK */
	stty( 0, ttystatep);
    }
    ddt();
    resettty();
    putstring( "\n" );
}

#endif
d is in the buffer */
int inbfr( pc )
unsigned char *pc;
{
    if( bfrbegpc <= pc && pc <= bfrendpc ) return(1);
    else return(0);
}

/* fetch the byte at pc */
getbpc(pc)
unsigned char *sumacc/cc/ddt68/ddt.h   444      0     12        4072  3470501555   7552 /* ddt.h 
 */

#include "b.out.h"

#define LITSYMS			/* this must agree with dl68 */
#define BPMAX		8	/* number of breakpoints allowed */
#define BADARG		'*'	/* bad command */
#define ESCCHR		''	/* argument delimiter */
#define BPINST		0x4E4E	/* trap #14 instruction */
#define TRACEBIT	0x8000	/* trace bit in status register */
#define DEFRADIX	16	/* default radix */
#define MAXSYMLEN	10	/* maximum length of symbol */
				/*** must agree with dl68 ***/

/* type-out structure for the disassembler */
struct cbuffr {
	char buf[40];		/* the output buffer */
	int pnt;		/* pointer into output buffer */
	int col;		/* output column # */
	};

/* Type field definitions */
#define CHARTYPE	0x01	/* character type */
#define BYTETYPE	0x02	/* byte */
#define WORDTYPE	0x03	/* word */
#define LONGTYPE	0x04	/* long */
#define INSTTYPE	0x05	/* instruction */
#define STRTYPE		0x06	/* string */
#define TYPEFIELDMASK	0x07	/* mask for type field */

#define SIGNEDTYPE	0x08	/* basic signed type */
#define POINTERTYPE	0x10	/* pointer to something */
#define USERTYPE	0x20	/* user-defined type */
#define DDTSYM		0x80	/* symbol is an internal ddt symbol */
#define DEFTOMODE	INSTTYPE

/*
 * structure of a symbol table definition
 */
typedef struct Symtabdef {
	struct sym *start;
	struct sym *limit;
	} symtabdef;

#ifdef DM
#define USRSYMS		(symtabdef *) 0x570 /* pointer to start of symbols */
#else
extern symtabdef ddtusrsyms;
#define USRSYMS		(&ddtusrsyms)
#endif DM

#ifdef MC68000
#define ADJ 2 & -2
#define getbpc(pc)	*(char *)(pc)
#define putbpc(pc, byte) *(char *)(pc) = (char) (byte)
#define getwpc(pc)	*(short *) (pc)
#define putwpc(pc, word) *(short *)(pc) = (short) (word)
#define getlpc(pc)	*(long *) (pc)
#define putlpc(pc, llong) *(long *)(pc) = (long) (llong)

#else ndef MC68000
#define ADJ 1
extern getbpc();
extern void putbpc();
extern short getwpc();
extern void putwpc();
extern long getlpc();
extern void putlpc();
#endif MC68000

/* breakpoint mechanism */
struct bpstr {
	short *pc;		/* pc at breakpoint */
	short oldinst;		/* old instruction */
	short count;		/* proceed counter */
	};
is must agree with dl68 */
#define BPMAX		8	/* number of breakpoints allowed */
#define BADARG		'*'	/* bad command */
#define ESCCHR		''	/* argument delimiter */
#define BPINST		0x4E4E	/* trap #14 instruction */
#define TRACEBIT	0x8000	/* trace bit in status register */
#define DEFRADIX	16	/* default radix */
#define MAXSYMLEN	10	/* maximum length of symbol */
				/*** must agree with dl68 ***/

/* type-out structure for the disassembler */
struct csumacc/cc/ddt68/ddt68.1   444      0     12       13513  3470501555   7661 .TH DDT68 1 MC68000
.SU
.SH NAME
ddt68, fddt68 \- symbolic debugger for 68000
.SH SYNOPSIS
.B fddt68
b.out
.br
.B cc68 ... -lddt (Sun)

.SH DESCRIPTION
.I fddt68
is a symbolic disassembler for b.out files created by the 68000 linker
(ld68). Its main purpose is to allow testing of ddt logic in a
more hospitable environment than the 68000.  It also gives a way of inspecting
the assembly language form of a program without having to produce a .s file.
In addition it gives a check on the operation of as68 and ld68.  It is called
by typing:
.sp
fddt68 
.I filename
.sp
on the Vax.
.PP
.I ddt68
is a symbolic debugger for the 68000.  It is loaded at link edit time with
the cc68 flag -lddt.  On starting a program with ddt loaded the user will be
at the ddt command level.  Breakpoints may be set, and the program started,
using the commands described below.
.SH COMMANDS
.I ddt68
recognizes the following commands (\fI$\fP is used for \fI<esc>\fP):
.TP
.IB expression /
.TP
.IB expression \e
open the location at \fIexpression\fP and display the contents in the
current typeout mode.  The user may then optionally type an expression, whose
value replaces the contents of the open location.  Finally the location is
\fIclosed\fP by typing one of \fIreturn\fP (to return to \fIddt\fP's main
command loop), \fI/\fP (to open the next location), or \fI\\\fP (to open the
previous location).
.TP
.IB expression $g
go - plant any breakpoints set with the \fI$b\fP command, load the registers,
and start execution at \fIexpression\fP. If \fIexpression\fP is unspecified
or zero, execution resumes starting from the current value of \fI$pc\fP
(normally the point where the program was last interrupted).
.TP
.IB expression $x
execute the next \fIexpression\fP instructions, starting from the current
value of \fI$pc\fP and printing out all executed instructions.  If
\fIexpression\fP is omitted, 1 is assumed.
.TP
.IB expression $$x
same as above except execute subroutine calls and traps as single instructions,
i.e. do not descend into the called subroutine.
.TP
.IB expression $p
proceed - like \fIgo\fP with no argument, except that if we are presently at
a breakpoint then \fIexpression\fP counts the number of times to pass this
breakpoint before breaking.  \fI1$p\fP is synonymous with \fI$g\fP.
.TP
.IB expression $ bno b
set breakpoint \fIbno\fP (in the range 1-9) at \fIexpression\fP.  If \fIbno\fP
is omitted the first unused breakpoint number is assigned (the commonest
usage).  If \fIexpression\fP is 0 the named breakpoint is cleared, or if there
is no named breakpoint (\fIbno\fP is omitted) all breakpoints are cleared.
If \fIexpression\fP is omitted all breakpoints are printed, whether or not
\fIbno\fP is present.
.TP
.BI $ rspec /
.TP
.BI $ rspec \e
examine register \fIrspec\fP where \fIrspec\fP is one of:
.RS
.TP
.B d0-d7
data registers 0-7
.TP
.B a0-a7
address registers 0-7
.TP
.B fp
frame pointer (synonym for \fIa6\fP)
.TP
.B sp
stack pointer (synonym for \fIa7\fP)
.TP
.B pc
program counter
.TP
.B sr
status register
.RE
.TP
.IB expression $=
type out \fIexpression\fP in current output radix.
.TP
.IB lowlimit < highlimit > pattern ?
search for \fIpattern\fP in the range \fIlowlimit\fP (inclusive) to
\fIhighlimit\fP (exclusive).
The pattern is interpreted as an object of the type in force as
the current typeout mode, with instructions and strings being treated as
2-byte words.  Objects are assumed to be aligned on word (2-byte)
boundaries except for 1-byte types and strings which are aligned on byte
boundaries.  A mask (set with the following command) determines how much of
the pattern is
significant in the search, except that if the pattern is a string constant a
separate mask matched to the length of the string is used.
The three arguments to the search command are
sticky; thus if \fIlowlimit<\fP (resp. \fIhighlimit\fP>) is omitted, the
most recent lowlimit (resp. highlimit) applies.  While \fIpattern\fP may be
omitted, the final ? may not be omitted.
.TP
.IB expression $m
set the search mask to \fIexpression\fP.  \fI-1$m\fP forces a complete match,
\fIf$m\fP checks only the low order 4 bits, \fI0$m\fP will make the search
pattern match anything.
.TP
.IB base $ir
set input radix to \fIbase\fP. (Note \fI10$i\fP can never change the radix.)
If \fIbase\fP is omitted hexadecimal is assumed.
.TP
.IB base $or
set output radix to \fIbase\fP.
If \fIbase\fP is omitted hexadecimal is assumed.
.TP
.BI $ type t
temporarily set typeout mode to \fItype\fP where \fItype\fP is one of:
.RS
.TP
.B <space>
deduce type from type of nearest symbol
.TP
.B c
type out bytes as ascii characters.
.TP
.B h
type out bytes in current output radix.
.TP
.B w
type out words in current radix.
.TP
.B l
type out longs in current radix.
.TP
.B s
type out strings in current radix.  (In this mode new values cannot be
entered.)
.TP
.B i
type out as 68000 symbolic instructions.  (In this mode only the first
two bytes of the opened location may be changed; the new value is typed in as
a numeric expression rather than as a symbolic instruction.)
.RE
The new typeout mode stays in effect until a \fIreturn\fP is typed.
.TP
.BI $$ type t
permanently set typeout mode to \fItype\fP.
.PP
An \fIexpression\fP is composed of symbols, numeric constants, string
constants, and the operators \fI+\fP,
\fI-\fP, and \fI|\fP representing 2's complement addition,
subtraction, and inclusive bitwise or.
Symbols are delimited by operators or \fI<esc>\fP.  A string constant has from
1 to 4 characters which are packed right justified into one long to form a
numeric constant; thus "did"=646A64.  String constants are particularly
useful in conjunction witht the search command for searching for a string.
The single character \fI.\fP (dot) as a symbol on its own represents
the address of the currently open memory location.
All operations are carried out using 32 bit arithmetic and evaluated
strictly left to right.
.SH AUTHORS
Jim Lawson and Vaughan Pratt
TP
.B fp
frame pointer (synonym for \fIa6\fP)
.TP
.B sp
stack pointer (synonym for \fIa7\fP)
.TP
.B pc
program counter
.TP
.B sr
status register
.RE
.TP
.IB expression $=
type out \sumacc/cc/ddt68/ea68   444      0     12         460  3470501556   7272 
..........000ddd		d
..........001aaa		a
..........010aaa		a@
..........011aaa		a@+
..........100aaa		a@-
..........101aaa,n		a@(n)
..........110aaa,g		a@(n,k)
..........111000,n		n
..........111001,i		i
..........111010,n		pc@(n)
..........111011,g		pc@(n,k)
..........111100,j		#j
..........nnnnnn		*

 treated as
2-byte words.  Objects are assumed to be aligned on word (2-byte)
boundaries except for 1-byte types and strings which are aligned on byte
boundaries.  A mask (set with the following command) detesumacc/cc/ddt68/ea68.c   444      0     12         560  3470501556   7514 7,0,0,56,0,4,129,32,
7,0,0,56,0,12,130,32,
8,0,0,56,0,20,130,64,
9,0,0,56,0,28,130,64,43,32,
9,0,0,56,0,36,130,64,45,32,
11,1,0,56,0,44,130,64,40,151,41,32,
13,8,0,56,0,52,130,64,40,167,44,144,41,32,
7,1,0,63,0,56,135,32,
7,2,0,63,0,57,135,32,
12,1,0,63,0,58,112,99,64,40,135,41,
14,8,0,63,0,59,112,99,64,40,151,44,128,41,
8,3,0,63,0,60,35,135,
7,0,0,0,0,32,42,32,
0 
word (2-byte)
boundaries except for 1-byte types and strings which are aligned on byte
boundaries.  A mask (set with the following command) detesumacc/cc/ddt68/fddt68.c   444      0     12       12246  3470501556  10114 #include "ddt.h"
#include <stdio.h>
#include <signal.h>
#include <sgtty.h>

#define R	0		/* read-only mode */
#define RW	2		/* open for read/write */
#define FBLK	512		/* 512 byte reads */
#define MAXSYMLEN	10	/* must agree with ddt and dl68 */

struct sgttyb ttystate, *ttystatep = &ttystate;
short oflags;			/* place to remember the original tty flags */
int cleanup();
int (*cleanupptr)() = cleanup;	/* pointer to cleanup function */

extern char das;		/* address space 'u' = user, 'd' = ddt */

struct bhdr filhdr;

unsigned char fbfr[FBLK] = { 0 };
int ifile;
unsigned char *bfrendpc, *bfrbegpc;
char bfrchnge;

unsigned char *origin = (unsigned char *)0x1000;

extern int open();
extern int read();

/* fetch a buffer that contains the byte pointed to by pc */
int getbfr( pc )
unsigned char *pc;
{
int nchars;
long fpc;

    if (pc < origin) {
	putstring("pc too small");
	return -1;
    }
    fpc = pc - origin + sizeof(filhdr);
    lseek( ifile, fpc, 0);	/* position the file */
    bfrendpc = bfrbegpc = pc;
    nchars = read( ifile, fbfr, FBLK);
    if( nchars > 0 )
	bfrendpc += nchars;
    else
    {
	putstring("pc too large");
	return -1;
    }
    return( nchars );
}

/* see if location desired is in the buffer */
int inbfr( pc )
unsigned char *pc;
{
    if( bfrbegpc <= pc && pc <= bfrendpc ) return(1);
    else return(0);
}

/* fetch the byte at pc */
getbpc(pc)
unsigned char *pc;
{
    if( das == 'd' )		/* fetch from ddt's address space ? */
    {
	return( (int)*pc );
    }
    if( !inbfr( pc ) )
	if (getbfr( pc ) == -1) return -1;
    return( (int)fbfr[pc - bfrbegpc] );
}

/*
 * Write the byte at pc.
 */
void putbpc(pc, data )
unsigned char data;
unsigned char *pc;
{
    if( das == 'd' )
    {
	*pc = data;

    }
    else
    {
	if( !inbfr( pc ) )
	    getbfr( pc );
	fbfr[pc - bfrbegpc] = data;
	bfrchnge = 1;
    }
}
/* fetch the word at pc */
short getwpc(pc)
char *pc;
{
short word;
    if( das == 'd' )			/* fetch from ddt's address space ? */
    {
	word = *(short *) pc;
    }
    else
    {
	word = getbpc(pc) << 8;		/* get byte */
	word |= getbpc(pc+1) & 0xFF;
    }
    return( word );
}

/*
 * Write the word at pc
 */
void putwpc( pc, data )
char *pc;
short data;
{
    if( das == 'd' )
    {
	*(short *)pc = data;
    }
    else
    {
	putbpc( pc, (char) ( data >> 8 ) );
	putbpc( pc + 1, (char) ( data & 0xFF ) );
    }
}

/* fetch a long at pc */
long getlpc(pc)
char *pc;
{
long lword;
    if( das == 'd' )
    {
	lword = *(long *)pc;
    }
    else
    {
	lword = getwpc(pc) << 16;
	lword |= getwpc(pc+2) & 0xFFFF;
    }
    return( lword );
}

/*
 * Write the long at pc.
 */
void putlpc( pc, data )
char *pc;
long data;
{
    if( das == 'd' )
    {
	*(long *)pc = data;
    }
    else
    {
	putwpc( pc, (short) ( data >> 16 ) );
	putwpc( pc + 2, (short) ( data &0xFFFF ) );
    }
}

reverse(lwrd) unsigned lwrd;
 {return((lwrd>>24)	     |
	 (lwrd>>8 & 0xff00)  |
	 (lwrd<<8 & 0xff0000)|
	 (lwrd<<24)
	);
 }

readsyms(filename)
char *filename;
{
FILE *sfile;
struct sym s;
int symno, chrno;
char c;
struct sym *sp;

    if( ( sfile = fopen(filename, "r", sfile)) == NULL )
    {
	fprintf( stderr, "Can't open symbol file %s\n", filename);
	exit(2);
    }

    fseek(sfile, SYMPOS, 0);

    sp = usrsyms.start = (struct sym *) malloc(filhdr.ssize);
    usrsyms.limit = (struct sym *)((int)sp + filhdr.ssize);
    fread(sp,filhdr.ssize,1,sfile);		/* Get symbol table */
    fclose( sfile );				/* close the symbol file */
}

/*
 * reset the tty state to what it was originally.
 */
void resettty()
{
    ttystate.sg_flags = oflags;	/* restore original flags */
    stty( 0, ttystatep);	/* restore original tty state */
}

/* Here on a signal interrupt. reset the tty state and exit */
int cleanup(signo)
int signo;
{
    resettty();
    exit(4);
}

main(argc, argv)
int argc;
char *argv[];
{
int nchrs;

    if( argc != 2 )
    {
	fprintf( stderr, "usage: %s filename\n", argv[0]);
	cleanup();
    }
    if( ( ifile = open(argv[1], R ) ) == -1 )
    {
	fprintf( stderr, "Can't open %s\n", argv[1]);
	cleanup();
    }
    nchrs = read( ifile, &filhdr, sizeof(filhdr));
    if( nchrs <= 0 )
    {
	fprintf( stderr, "Unexpected eof or error on %s\n", argv[1]);
	cleanup();
    }
    if( filhdr.fmagic != FMAGIC )
    {
	fprintf( stderr, "%s doesn't look like a .out file \n", argv[1] );
	cleanup();
    }
    printf("text size: %ld\n", filhdr.tsize);
    printf("data size: %ld\n", filhdr.dsize);
    printf("bss size: %ld\n", filhdr.bsize);
    printf("symbol table size: %ld\n", filhdr.ssize);
    printf("text relocation size: %ld\n", filhdr.rtsize);
    printf("data relocation size: %ld\n", filhdr.rdsize);
    printf("entry point: 0x%lx\n", filhdr.entry);
    origin = (unsigned char *)filhdr.entry;
    if(filhdr.ssize > 0 )
	readsyms(argv[1]);
    else
	usrsyms.start = usrsyms.limit = 0;

/* now prepare for cbreak'ing */

    if( isatty(0) )			/* if we are connected to a tty */
    {
    int sig;

	gtty( 0, ttystatep);		/* get current tty state */
	oflags = ttystate.sg_flags;	/* save old flags */
	for( sig = 1; sig <= NSIG; sig++)
	    signal(sig, cleanup);	/* arrange to clean-up before exit */
	ttystate.sg_flags |= CBREAK;	/* turn on CBREAK */
	stty( 0, ttystatep);
    }
    ddt();
    resettty();
    putstring( "\n" );
}
urrently open memory location.
All operations are carried out using 32 bit arithmetic and evaluated
strictly left to right.
.SH AUTHORS
Jim Lawson and Vaughan Pratt
TP
.B fp
frame pointer (synonym for \fIa6\fP)
.TP
.B sp
stack pointer (synonym for \fIa7\fP)
.TP
.B pc
program counter
.TP
.B sr
status register
.RE
.TP
.IB expression $=
type out \sumacc/cc/ddt68/ins.f   444      0     12       13044  3470501556   7606 			Format of the file ins68

			       V.R. Pratt
			       Jan., 1981

The file ins68 contains a compacted list of all the instructions of the 68000,
together with the assembler form of each instruction.  It also contains the
format of the effective address field.

Instruction List Format

The format of the instruction list is as follows.  Each entry is terminated 
with \n.  An entry consists of a bit form and an assembler form; the two forms
are separated by at least one tab.  

The bit form is a list of words separated by commas.  Each word is either one 
character or 16 characters.  A one character word such as n is considered 
merely an abbreviation for the 16-character word nnnnnnnnnnnnnnnn.  

Here is a simple entry.

0100111001110110	trapv

This says that the instruction with hex opcode 4E76 has the assembler form
trapv.  Not all instructions consist merely of 0's and 1's; consider

0100100001000ddd	swap d

This says that the instruction 4840 is swap d0, 4841 is swap d1, etc., up to 
4847.  The block of d's in the word defines a field.  The interpretation of
the field depends on the letter used for the field.  The following letters have
special interpretations.

d	data register
a	address register
e	effective address
s	size: 0 = w, 1 = l, 00 = b, 01 = w, 10 = l, 11 = * (illegal)
n	signed short integer, decimal in assembler form
b	like n, but bivalent: length agrees with most recent value of s
x	unsigned short integer, hex in assembler form
y	like x but bit-reversed in assembler form
m	m = 1 -> reverse arguments in assembler form
f	function defined locally (as in f(div,mul) meaning 0 = div, 1 = mul)
c	condition code (for branch, decrement-and-branch, and conditional set)
r	relative program point; an address to be printed symbolically if 
	possible, otherwise in hex if pc is known, otherwise in hex but
	relative to the pc

When two separate fields require the same letter, the two fields are
distinguished by case, e.g. d versus D.  The field E is treated specially; 
its register and mode fields are interchanged relative to e, for which a
handy informal mnemonic is E = RRRMMM, e = mmmrrr.  The bits within the
register and mode fields are not themselves reversed in either case.

Here are further examples.

00ffEEEEEEeeeeee	mov.f(,b,l,w) e,E

This is the move instruction.  Since the size field is nonstandard we define
it locally as 01 = b, 10 = l, 11 = w.  There are two effective addresses, e
and E, respectively source and destination.  The . is a delimiter that
is removed, thus 0010111000000011 becomes   movl d3,d7.

Here are the instructions to logically combine n with either the condition code
register (a byte operation) or the status register (a word operation).  

0000fff00F111100,n	f(or,and,*,*,*,eor,*,*) #n,F(ccr,sr)

For example 0000101000111100,0000000000100101 would be eor #37,ccr.  
(Remember that n is merely an abbreviation for nnnnnnnnnnnnnnnn.)  There are
two locally defined functions, hence f and F.  When * appears in the 
assembler form this denotes an illegal instruction.

It is permissible for a bit pattern to match more than one form.  For example
0100000011000000 matches both of the following two patterns; the intended 
match is always the earlier in such a case.

0100000011eeeeee	move sr,e
01000000sseeeeee	negx.s e

The one place where bit-reversal is used is in

01001m001seeeeee,y	movem.s y,e

This prints the bits of y to correspond to the register sequence
d0 d1 ... d7 a0 a1 ... a7.  All movem's print in this order, regardless of
the order actually used in saving and restoring registers.  It is almost
never needed to know the physical order of saving, only the set saved.
(Incidentally note the one-bit s; 0 = w, 1 = l.)

The following illustrates condition codes and relative program points.

0101cccc11001ddd,r	db.c d,r

Thus 0101011111001101,1111111111110010 would be   dbeq d5,.-14. assuming no
symbol was available for this address.

Here is an example of the signed integer n appearing as a field in the
move-quick instruction.

0111ddd0nnnnnnnn	moveq #n,d

Here is an example of the use of b (both word and long constant possible).

0000fff0sseeeeee,b	f(or,and,sub,add,,eor,cmp,).s #b,e

Both 0000000000000000,0000000000000000 and 0000000001000000,0000000000000000 
match this pattern; 0000000010000000,0000000000000000,0000000000000000 also
matches because s = 10 = l.

Effective Address Format

In addition to the instructions, the file ins68 gives the format of the
effective address, using the same conventions.  The following examples should
be self-explanatory.

000ddd			d
001aaa			a
101aaa,n		a@(n)
110aaa,00000dddnnnnnnnn	a@(n,d)	(note how the second word cannot be abbrev'd.)
110aaa,00001aaannnnnnnn	a@(n,a)	(note how d and a are dealt with in the ext'n)
11100s,b		b	(here s is used only to control the size of b)
111100,b		#b	(the size of b depends on s defined outside e)


Note the ambiguity resulting from both the instruction proper and the
effective address wanting arguments.  The rule is that arguments for the
instruction proper come first in the instruction being matched to a pattern.

Caveat

Any word list no initial segment of which matches a pattern in the instruction
list does not start out with a legal instruction.  The converse is not true;
some illegal instructions match some pattern.  Most of these have assembler
forms containing an asterisk, but in the present table there exist exceptions.
We would be grateful if someone would make the necessary additions to the
table to eliminate those exceptions; this is done by putting the exceptions
in the table ahead of the patterns they match and supplying them with an
assembler form of *.

 defined locally (as in f(div,mul) meaning 0 = div, 1 = mul)
c	condition code (for branch, decrement-and-branch, and conditional set)
r	relative program point; an address to be printed symbolically if 
	possible, otherwise in hex if pc is known, otherwise in hex but
	relative to the pc

When two separate fields require the same letter, the two fields are
distinguished by case, e.g. d versus D.  The field E is treated specially; 
its register and mode fields are interchangsumacc/cc/ddt68/inscom.c   444      0     12        7473  3470501556  10273 /* 			Compiler for ins68
 *			    V.R. Pratt
 *			    Jan., 1981
 */

#include <stdio.h>
#define TABSIZ 128
#define WORDSIZ 16

int line=0, argno, mask, pattern, i, pnt, comma, postc, space;
char modif, length, string[64], 
       prev=0, current=0, next=0,
       sizmod, revargs, more = 1, 
       table[TABSIZ];
/* Translation tables */
  char *mcod = "nijuxyrglpt";			/* modifiers */
  char *trm  = "01D77703456";			/* modifier formats */
  char *pcod = "dDaAeEsnuvmfFcrijxyrk";		/* permissible parameters */
  char *pfmt = "ddaaeEsnuvmffcrnnxyrk";		/* parameter formats */
  char *fcod = "kdaEesvnuyxmfcr";		/* case order for formats */

main()
 {get(); get();
  while (more)
	{i=TABSIZ; while (i) table[--i] = -1;
	 while (more && current != '\n') get();	/* skip to end of line */
	 while (more && next == '\n') get();	/* skip nl's */
	 if (next == EOF) break;
	 line++;
	 modif = argno = sizmod = revargs = mask = pattern = 0;
	 for (i=WORDSIZ;i--;)			/* process 16-bit word */
	   {mask <<= 1; pattern <<= 1;
	    if	    ((get()&-2) == '0')
	       	    {mask++; pattern += current&1;}
	    else if (table[current] < 0) 	/* new argument */
		   {if (current != '.')		/* . is dummy arg */
		       {table[current] = argno++;
		        pattern++;		/* leading 1 delimits field */
		        if (current == 'm') revargs = 1;
		        if (current == 's') sizmod = 1;
		       }
		   }
	    else if (current == prev)
		    {if (current == 's') sizmod = 0;}
	    else fprintf(stderr,"Repeat arg on line %d\n",line);
	   }
	 for (i=TABSIZ;i--;) if (table[i]>=0) table[i] = argno-table[i]-1;
	 if (get() == ',') 
	   while (more && get() != '\t')
	    {i = pos(current,mcod);
	     modif |= trm[i]=='D'? 3: 1<<(trm[i]-'0');
	     if (current == 'g')		/* g is 0000kkkknnnnnnnn */
		{table['k'] = argno++;		/* d/a index register */
		 table['n'] = argno++;		/* 8-bit signed displacement */
		}
	     else if (i<8)			/* nijuxyrg denote an arg */
		     table[current] = argno++;
	    }
	 if (sizmod) modif |= 64;
	 while (next == '\t') get();		/* skip tabs */
	 pnt = 0;				/* initialize output buffer */
	 while (more && get() != '\n') compchar();/* compile string */
	 if (revargs) {string[pnt++] = (char)(0213|(table['m']<<4));
		       string[space] = postc+1-space;
		       string[comma] = pnt+1-comma;
		       string[postc] = space+1-postc;
		       string[pnt]   = comma+1-pnt;
		       pnt++;
		      }
	 length = 6+pnt;
	 pnt = 0;
	 out(length);
	 out(modif);
	 out(mask>>8); out(mask&255);
	 out(pattern>>8); out(pattern&255);
	 while (pnt<length-6) out(string[pnt++]);
	 if (length&1) out(' ');
	 putchar('\n');
	}
  printf("0 \n");
 }

char
norm(x) char x; {return('A' <= x && x <= 'Z'? x+32: x);}

compchar()
 {if (current < 'A' || prev > '@' || next > '@' || table[current] < 0)
   {if (current != '.')			/* . is dummy */
     {string[pnt++] = current; 
      if (revargs)
	 {if (current == ',') {string[pnt++] = 0213|(table['m']<<4);
			       postc = pnt++;
			      }
	  if (current == ' ') {string[pnt++] = 0213|(table['m']<<4);
			       space = pnt++;
			      }
	 }
     }
   }
  else {string[pnt++] = 0200|				  /* identifying bit */
	   	   	(table[current] << 4)|		  /* arg no */
	      		pos(pfmt[pos(current,pcod)],fcod);/* format */
	if (norm(current) == 'f') 
	   {get();					     /* erase ( */
	    do {string[pnt++] = get();} 
	       while (current != ')'); 			     /* skip commas */
	   }
       }
  if (revargs && next == ',')
       {string[pnt++] = 0213|(table['m']<<4);
	comma = pnt++;
       }
 }

get()
 {prev = current; current = next; if (next != EOF) next = getchar(); 
  if (current == EOF) more = 0;
  return (current);}

pos(c,s) char c, *s;
 {int i=0; 
  while (s[i] && s[i] != c) i++;
  if (s[i]) return(i);
  else fprintf(stderr,
    "Unexpected char %o on line %d in %c%c%c\n",c,line,prev,current,next);
 }

out(c) unsigned char c;
 {printf("%d,",c);}

+;		/* 8-bit signed displacement */
		}
	     else if (i<8)			/* nijuxyrg denote an arg */
		     table[current] = argno++;
	    }
	 if (sizmod) modif |= 64;
	 while (next == '\t') get();		/* skip sumacc/cc/ddt68/ops68   444      0     12        3424  3470501556   7531 
0000fff00F111100,x	f(or,and,*,*,*,eor,*,*) #/x,F(ccr,sr)
00001000ffeeeeee,u	f(btst,bchg,bclr,bset) #u,e
0000fff010eeeeee,i	f(or,and,sub,add,,eor,cmp,)l #i,e
0000fff0sseeeeee,n	f(or,and,sub,add,,eor,cmp,).s #n,e
0000ddd1ms001aaa,n	movep.s a@(n),d
0000ddd1ffeeeeee	f(btst,bchg,bclr,bset) d,e
0010EEEEEEeeeeee,l	movl e,E
00ffEEEEEEeeeeee	mov.f(,b,,w) e,E
0100000011eeeeee	move sr,e
01000000sseeeeee	negx.s e
01000010sseeeeee	clr.s e
01000100sseeeeee	neg.s e
0100010011eeeeee	move e,ccr
0100011011eeeeee	move e,sr
01000110sseeeeee	not.s e
0100100000eeeeee	nbcd e
0100100001000ddd	swap d
0100100001eeeeee,p	pea e
010010001s000ddd	ext.s d
010010001s100aaa,x	movem.s /x,a@-
01001m001seeeeee,y	movem.s /y,e
0100101011eeeeee	tas e
01001010sseeeeee	tst.s e
010011100100uuuu	trap #u
0100111001010aaa,n	link a,#n
0100111001011aaa	unlk a
010011100110maaa	move a,usp
0100111001110010,x	stop #/x
0100111001110fff	f(reset,nop,,rte,*,rts,trapv,rtr)
010011101feeeeee,p	f(jsr,jmp) e
0100ddd110eeeeee	chk e,d
0100aaa111eeeeee,p	lea e,a
0101cccc11001ddd,r	db.c d,r
0101cccc11eeeeee	s.c e
0101vvvfsseeeeee	f(addq,subq).s #v,e
0110cccc00000000,r	b.c r
0110ccccrrrrrrrr	b.c r
0111ddd0nnnnnnnn	moveq #n,d
1f00DDD100000ddd	f(sbcd,abcd) d,D
1f00AAA100001aaa	f(sbcd,abcd) a@-,A@-
1f00dddF11eeeeee	f(div,mul).F(u,s) e,d
1f00dddmsseeeeee	f(or,and).s e,d
1f01aaas11eeeeee	f(sub,add).s e,a
1f01DDD1ss000ddd	f(subx,addx).s d,D
1f01AAA1ss001aaa	f(subx,addx).s a@-,A@-
1f01dddmsseeeeee	f(sub,add).s e,d
1011aaas11eeeeee	cmp.s e,a
1011ddd0sseeeeee	cmp.s e,d
1011AAA1ss001aaa	cmp.s a@+,A@+
1011ddd1sseeeeee	eor.s d,e
1100DDD101000ddd	exg d,D
1100AAA101001aaa	exg a,A
1100ddd110001aaa	exg a,d
11100ffF11eeeeee	f(as,ls,rox,ro).F(r,l)w e
1110vvvFss0ffddd	f(as,ls,rox,ro).F(r,l).s #v,d
1110DDDFss1ffddd	f(as,ls,rox,ro).F(r,l).s D,d
nnnnnnnnnnnnnnnn	*

bclr,bset) d,e
0010EEEEEEeeeeee,l	movl e,E
00ffEEEEEEeeeeee	mov.f(,b,,w) e,E
0100000011eeeeee	move sr,e
01000000sseeeeee	negx.s e
01000010sseeeeee	clr.s e
01000100sseeeeee	neg.s e
0100010011eeeeee	move e,ccr
0100011011eeeeee	move e,sr
0sumacc/cc/ddt68/ops68.c   444      0     12        7467  3470501557   7766 41,128,241,191,8,124,156,111,114,44,97,110,100,44,42,44,42,44,42,44,101,111,114,44,42,44,42,41,32,35,47,170,44,140,99,99,114,44,115,114,41,32,
32,128,255,0,8,160,156,98,116,115,116,44,98,99,104,103,44,98,99,108,114,44,98,115,101,116,41,32,35,168,44,132,
38,2,241,192,8,160,156,111,114,44,97,110,100,44,115,117,98,44,97,100,100,44,44,101,111,114,44,99,109,112,44,41,108,32,35,167,44,132,
38,1,241,0,8,160,172,111,114,44,97,110,100,44,115,117,98,44,97,100,100,44,44,101,111,114,44,99,109,112,44,41,149,32,35,183,44,132,
28,65,241,56,9,204,109,111,118,101,112,149,32,171,11,130,64,40,199,41,171,7,44,171,247,177,171,251,
31,0,241,0,9,160,156,98,116,115,116,44,98,99,104,103,44,98,99,108,114,44,98,115,101,116,41,32,161,44,132,32,
14,16,240,0,40,32,109,111,118,108,32,132,44,147,
20,0,192,0,40,32,109,111,118,172,44,98,44,44,119,41,32,132,44,147,
15,0,255,192,64,224,109,111,118,101,32,115,114,44,132,32,
13,0,255,0,64,160,110,101,103,120,149,32,132,32,
12,0,255,0,66,160,99,108,114,149,32,132,
12,0,255,0,68,160,110,101,103,149,32,132,
16,0,255,192,68,224,109,111,118,101,32,132,44,99,99,114,
15,0,255,192,70,224,109,111,118,101,32,132,44,115,114,32,
12,0,255,0,70,160,110,111,116,149,32,132,
12,0,255,192,72,32,110,98,99,100,32,132,
12,0,255,248,72,68,115,119,97,112,32,129,
11,32,255,192,72,96,112,101,97,32,132,32,
12,64,255,184,72,196,101,120,116,149,32,129,
19,192,255,184,72,228,109,111,118,101,109,149,32,47,170,44,130,64,45,32,
25,192,251,128,76,224,109,111,118,101,109,149,32,171,8,47,185,171,7,44,171,250,132,171,251,32,
11,0,255,192,74,224,116,97,115,32,132,32,
12,0,255,0,74,160,116,115,116,149,32,132,
13,0,255,240,78,72,116,114,97,112,32,35,136,32,
15,1,255,248,78,84,108,105,110,107,32,130,44,35,151,32,
12,0,255,248,78,92,117,110,108,107,32,130,
24,0,255,240,78,108,109,111,118,101,32,155,7,130,155,9,44,155,251,117,115,112,155,249,
14,128,255,255,78,114,115,116,111,112,32,35,47,138,
38,0,255,248,78,116,140,114,101,115,101,116,44,110,111,112,44,44,114,116,101,44,42,44,114,116,115,44,116,114,97,112,118,44,114,116,114,41,
17,32,255,128,78,224,156,106,115,114,44,106,109,112,41,32,132,32,
13,0,241,192,73,160,99,104,107,32,132,44,145,32,
13,32,241,192,73,224,108,101,97,32,132,44,146,32,
13,1,240,248,88,204,100,98,157,32,129,44,174,32,
10,0,240,192,88,224,115,157,32,132,
23,0,240,0,89,160,172,97,100,100,113,44,115,117,98,113,41,149,32,35,182,44,132,32,
10,1,240,255,104,0,98,141,32,158,
10,0,240,0,104,128,98,157,32,142,
16,0,241,0,120,128,109,111,118,101,113,32,35,135,44,145,
21,0,177,248,201,4,172,115,98,99,100,44,97,98,99,100,41,32,129,44,145,32,
25,0,177,248,201,12,172,115,98,99,100,44,97,98,99,100,41,32,130,64,45,44,146,64,45,32,
24,0,176,192,201,224,188,100,105,118,44,109,117,108,41,156,117,44,115,41,32,132,44,161,
27,0,176,0,201,160,204,111,114,44,97,110,100,41,149,32,171,7,132,171,7,44,171,251,177,171,251,32,
20,64,176,192,217,224,188,115,117,98,44,97,100,100,41,149,32,132,44,162,
22,0,177,56,217,132,188,115,117,98,120,44,97,100,100,120,41,149,32,129,44,161,
26,0,177,56,217,140,188,115,117,98,120,44,97,100,100,120,41,149,32,130,64,45,44,162,64,45,
28,0,176,0,217,160,204,115,117,98,44,97,100,100,41,149,32,171,7,132,171,7,44,171,251,177,171,251,
14,64,240,192,185,224,99,109,112,149,32,132,44,162,
14,0,241,0,184,160,99,109,112,149,32,132,44,161,
18,0,241,56,185,140,99,109,112,149,32,130,64,43,44,162,64,43,
14,0,241,0,185,160,101,111,114,149,32,161,44,132,
13,0,241,248,201,68,101,120,103,32,129,44,145,32,
13,0,241,248,201,76,101,120,103,32,130,44,146,32,
13,0,241,248,201,140,101,120,103,32,130,44,145,32,
28,0,248,192,229,224,172,97,115,44,108,115,44,114,111,120,44,114,111,41,156,114,44,108,41,119,32,132,
31,0,240,32,233,148,156,97,115,44,108,115,44,114,111,120,44,114,111,41,188,114,44,108,41,165,32,35,198,44,129,32,
30,0,240,32,233,180,156,97,115,44,108,115,44,114,111,120,44,114,111,41,188,114,44,108,41,165,32,193,44,129,
7,0,0,0,128,0,42,32,
0 
9,41,32,132,44,147,
15,0,255,192,64,224,109,111,118,101,32,115,114,44,132,32,
13,0,255,0,64,160,110,101,103,120,149,32,132,32,
12,0,255,0,66,160,99,108,114,149,32,132,
12,0,255,0,68,160,110,101,103,149sumacc/cc/ddt68/vea68.c   444      0     12         560  3470501557   7703 7,0,56,0,4,0,129,32,
7,0,56,0,12,0,130,32,
8,0,56,0,20,0,130,64,
9,0,56,0,28,0,130,64,43,32,
9,0,56,0,36,0,130,64,45,32,
11,1,56,0,44,0,130,64,40,151,41,32,
13,8,56,0,52,0,130,64,40,167,44,144,41,32,
7,1,63,0,56,0,135,32,
7,2,63,0,57,0,135,32,
12,1,63,0,58,0,112,99,64,40,135,41,
14,8,63,0,59,0,112,99,64,40,151,44,128,41,
8,3,63,0,60,0,35,135,
7,0,0,0,32,0,42,32,
0 
5,32,
13,0,241,248,201,76,101,120,103,32,130,44,146,32,
13,0,241,248,201,140,101,120,103,32,130,44,145,32,
28,0,248,192,229,224,172,97,115,44,10sumacc/cc/ddt68/vinscom.c   444      0     12        7745  3470501557  10464 /* 			Compiler for ins68
 *			    V.R. Pratt
 *			    Jan., 1981
 * modified jun 81 by jrl @ Lucasfilm for dissassembler to run on the vax
 */

#include <stdio.h>
#define TABSIZ 128
#define WORDSIZ 16

int line=0, argno, mask, pattern, i, pnt, comma, postc, space;
char modif, length, string[64], 
       prev=0, current=0, next=0,
       sizmod, revargs, more = 1, 
       table[TABSIZ];
/* Translation tables */
  char *mcod = "nijuxyrglpt";			/* modifiers */
  char *trm  = "01D77703456";			/* modifier formats */
  char *pcod = "dDaAeEsnuvmfFcrijxyrk";		/* permissible parameters */
  char *pfmt = "ddaaeEsnuvmffcrnnxyrk";		/* parameter formats */
  char *fcod = "kdaEesvnuyxmfcr";		/* case order for formats */

main()
 {get(); get();
  while (more)
	{i=TABSIZ; while (i) table[--i] = -1;
	 while (more && current != '\n') get();	/* skip to end of line */
	 while (more && next == '\n') get();	/* skip nl's */
	 if (next == EOF) break;
	 line++;
	 modif = argno = sizmod = revargs = mask = pattern = 0;
	 for (i=WORDSIZ;i--;)			/* process 16-bit word */
	   {mask <<= 1; pattern <<= 1;
	    if	    ((get()&-2) == '0')
	       	    {mask++; pattern += current&1;}
	    else if (table[current] < 0) 	/* new argument */
		   {if (current != '.')		/* . is dummy arg */
		       {table[current] = argno++;
		        pattern++;		/* leading 1 delimits field */
		        if (current == 'm') revargs = 1;
		        if (current == 's') sizmod = 1;
		       }
		   }
	    else if (current == prev)
		    {if (current == 's') sizmod = 0;}
	    else fprintf(stderr,"Repeat arg on line %d\n",line);
	   }
	 for (i=TABSIZ;i--;) if (table[i]>=0) table[i] = argno-table[i]-1;
	 if (get() == ',') 
	   while (more && get() != '\t')
	    {i = pos(current,mcod);
	     modif |= trm[i]=='D'? 3: 1<<(trm[i]-'0');
	     if (current == 'g')		/* g is 0000kkkknnnnnnnn */
		{table['k'] = argno++;		/* d/a index register */
		 table['n'] = argno++;		/* 8-bit signed displacement */
		}
	     else if (i<8)			/* nijuxyrg denote an arg */
		     table[current] = argno++;
	    }
	 if (sizmod) modif |= 64;
	 while (next == '\t') get();		/* skip tabs */
	 pnt = 0;				/* initialize output buffer */
	 while (more && get() != '\n') compchar();/* compile string */
	 if (revargs) {string[pnt++] = (char)(0213|(table['m']<<4));
		       string[space] = postc+1-space;
		       string[comma] = pnt+1-comma;
		       string[postc] = space+1-postc;
		       string[pnt]   = comma+1-pnt;
		       pnt++;
		      }
	 length = 6+pnt;
	 pnt = 0;
	 out(length);
	 out(modif);
/* invert this for Vax
	 out(mask>>8); out(mask&255);
	 out(pattern>>8); out(pattern&255);
 */
	 out(mask&255); out(mask>>8);
	 out(pattern&255); out(pattern>>8);

	 while (pnt<length-6) out(string[pnt++]);
	 if (length&1) out(' ');
	 putchar('\n');
	}
  printf("0 \n");
 }

char
norm(x) char x; {return('A' <= x && x <= 'Z'? x+32: x);}

compchar()
 {if (current < 'A' || prev > '@' || next > '@' || table[current] < 0)
   {if (current != '.')			/* . is dummy */
     {string[pnt++] = current; 
      if (revargs)
	 {if (current == ',') {string[pnt++] = 0213|(table['m']<<4);
			       postc = pnt++;
			      }
	  if (current == ' ') {string[pnt++] = 0213|(table['m']<<4);
			       space = pnt++;
			      }
	 }
     }
   }
  else {string[pnt++] = 0200|				  /* identifying bit */
	   	   	(table[current] << 4)|		  /* arg no */
	      		pos(pfmt[pos(current,pcod)],fcod);/* format */
	if (norm(current) == 'f') 
	   {get();					     /* erase ( */
	    do {string[pnt++] = get();} 
	       while (current != ')'); 			     /* skip commas */
	   }
       }
  if (revargs && next == ',')
       {string[pnt++] = 0213|(table['m']<<4);
	comma = pnt++;
       }
 }

get()
 {prev = current; current = next; if (next != EOF) next = getchar(); 
  if (current == EOF) more = 0;
  return (current);}

pos(c,s) char c, *s;
 {int i=0; 
  while (s[i] && s[i] != c) i++;
  if (s[i]) return(i);
  else fprintf(stderr,
    "Unexpected char %o on line %d in %c%c%c\n",c,line,prev,current,next);
 }

out(c) unsigned char c;
 {printf("%d,",c);}

4,97,98,99,100,41,32,129,44sumacc/cc/ddt68/vops68.c   444      0     12        7467  3470501557  10154 41,128,191,241,124,8,156,111,114,44,97,110,100,44,42,44,42,44,42,44,101,111,114,44,42,44,42,41,32,35,47,170,44,140,99,99,114,44,115,114,41,32,
32,128,0,255,160,8,156,98,116,115,116,44,98,99,104,103,44,98,99,108,114,44,98,115,101,116,41,32,35,168,44,132,
38,2,192,241,160,8,156,111,114,44,97,110,100,44,115,117,98,44,97,100,100,44,44,101,111,114,44,99,109,112,44,41,108,32,35,167,44,132,
38,1,0,241,160,8,172,111,114,44,97,110,100,44,115,117,98,44,97,100,100,44,44,101,111,114,44,99,109,112,44,41,149,32,35,183,44,132,
28,65,56,241,204,9,109,111,118,101,112,149,32,171,11,130,64,40,199,41,171,7,44,171,247,177,171,251,
31,0,0,241,160,9,156,98,116,115,116,44,98,99,104,103,44,98,99,108,114,44,98,115,101,116,41,32,161,44,132,32,
14,16,0,240,32,40,109,111,118,108,32,132,44,147,
20,0,0,192,32,40,109,111,118,172,44,98,44,44,119,41,32,132,44,147,
15,0,192,255,224,64,109,111,118,101,32,115,114,44,132,32,
13,0,0,255,160,64,110,101,103,120,149,32,132,32,
12,0,0,255,160,66,99,108,114,149,32,132,
12,0,0,255,160,68,110,101,103,149,32,132,
16,0,192,255,224,68,109,111,118,101,32,132,44,99,99,114,
15,0,192,255,224,70,109,111,118,101,32,132,44,115,114,32,
12,0,0,255,160,70,110,111,116,149,32,132,
12,0,192,255,32,72,110,98,99,100,32,132,
12,0,248,255,68,72,115,119,97,112,32,129,
11,32,192,255,96,72,112,101,97,32,132,32,
12,64,184,255,196,72,101,120,116,149,32,129,
19,192,184,255,228,72,109,111,118,101,109,149,32,47,170,44,130,64,45,32,
25,192,128,251,224,76,109,111,118,101,109,149,32,171,8,47,185,171,7,44,171,250,132,171,251,32,
11,0,192,255,224,74,116,97,115,32,132,32,
12,0,0,255,160,74,116,115,116,149,32,132,
13,0,240,255,72,78,116,114,97,112,32,35,136,32,
15,1,248,255,84,78,108,105,110,107,32,130,44,35,151,32,
12,0,248,255,92,78,117,110,108,107,32,130,
24,0,240,255,108,78,109,111,118,101,32,155,7,130,155,9,44,155,251,117,115,112,155,249,
14,128,255,255,114,78,115,116,111,112,32,35,47,138,
38,0,248,255,116,78,140,114,101,115,101,116,44,110,111,112,44,44,114,116,101,44,42,44,114,116,115,44,116,114,97,112,118,44,114,116,114,41,
17,32,128,255,224,78,156,106,115,114,44,106,109,112,41,32,132,32,
13,0,192,241,160,73,99,104,107,32,132,44,145,32,
13,32,192,241,224,73,108,101,97,32,132,44,146,32,
13,1,248,240,204,88,100,98,157,32,129,44,174,32,
10,0,192,240,224,88,115,157,32,132,
23,0,0,240,160,89,172,97,100,100,113,44,115,117,98,113,41,149,32,35,182,44,132,32,
10,1,255,240,0,104,98,141,32,158,
10,0,0,240,128,104,98,157,32,142,
16,0,0,241,128,120,109,111,118,101,113,32,35,135,44,145,
21,0,248,177,4,201,172,115,98,99,100,44,97,98,99,100,41,32,129,44,145,32,
25,0,248,177,12,201,172,115,98,99,100,44,97,98,99,100,41,32,130,64,45,44,146,64,45,32,
24,0,192,176,224,201,188,100,105,118,44,109,117,108,41,156,117,44,115,41,32,132,44,161,
27,0,0,176,160,201,204,111,114,44,97,110,100,41,149,32,171,7,132,171,7,44,171,251,177,171,251,32,
20,64,192,176,224,217,188,115,117,98,44,97,100,100,41,149,32,132,44,162,
22,0,56,177,132,217,188,115,117,98,120,44,97,100,100,120,41,149,32,129,44,161,
26,0,56,177,140,217,188,115,117,98,120,44,97,100,100,120,41,149,32,130,64,45,44,162,64,45,
28,0,0,176,160,217,204,115,117,98,44,97,100,100,41,149,32,171,7,132,171,7,44,171,251,177,171,251,
14,64,192,240,224,185,99,109,112,149,32,132,44,162,
14,0,0,241,160,184,99,109,112,149,32,132,44,161,
18,0,56,241,140,185,99,109,112,149,32,130,64,43,44,162,64,43,
14,0,0,241,160,185,101,111,114,149,32,161,44,132,
13,0,248,241,68,201,101,120,103,32,129,44,145,32,
13,0,248,241,76,201,101,120,103,32,130,44,146,32,
13,0,248,241,140,201,101,120,103,32,130,44,145,32,
28,0,192,248,224,229,172,97,115,44,108,115,44,114,111,120,44,114,111,41,156,114,44,108,41,119,32,132,
31,0,32,240,148,233,156,97,115,44,108,115,44,114,111,120,44,114,111,41,188,114,44,108,41,165,32,35,198,44,129,32,
30,0,32,240,180,233,156,97,115,44,108,115,44,114,111,120,44,114,111,41,188,114,44,108,41,165,32,193,44,129,
7,0,0,0,0,128,42,32,
0 
,117,98,44,97,100,100,41,149,32,132,44,162,
22,0,177,56,217,132,188,115,117,98,120,44,97,100,100,120,41,149,32,129,44,161,
26,0,177,56,217,140,188,115,117,98,120,44,97,100,100,120,41,149,32,130,64,45,4sumacc/cc/ld/   775      0     12           0  3540162171   6203 sumacc/cc/ld/Makefile   444      0     12        2357  3470501557   7742 #Description file for .b file linker and utilities
#Say 'make' to bring all command files in ld up to date.  Say 'make install'
#to copy any new command files to BIN.

BIN = /usr/sun/bin
INCLUDE = /usr/sun/include

all:		ld68 nm68 rl68 size68 pr68 rev68 dl68 ranlib68

ld68:		ld.c
		cc -o ld68 -O -DStanford -DBOOTSTRAP -I$(INCLUDE) ld.c

nm68:		nm68.c
		cc -o nm68 -O -I$(INCLUDE) nm68.c 

rl68:		rl68.c
		cc -o rl68 -O -I$(INCLUDE) rl68.c

size68:		size68.c
		cc -o size68 -O -I$(INCLUDE) size68.c

pr68:		pr68.c
		cc -o pr68 -O -I$(INCLUDE) pr68.c

rev68:		rev68.c
		cc -o rev68 -O -I$(INCLUDE) rev68.c

dl68:		dl68.c
		cc -o dl68 -O -I$(INCLUDE) dl68.c

ranlib68:	ranlib68.c
		cc -o ranlib68 -O -I/usr/include -I$(INCLUDE) ranlib68.c

install:	$(BIN)/ld68 $(BIN)/nm68 $(BIN)/rl68 $(BIN)/size68 $(BIN)/pr68 $(BIN)/rev68 $(BIN)/dl68 $(BIN)/lorder68

$(BIN)/ld68:	ld68
		cp ld68 $(BIN)

$(BIN)/nm68:	nm68
		cp nm68 $(BIN)

$(BIN)/rl68:	rl68
		cp rl68 $(BIN)

$(BIN)/size68:	size68
		cp size68 $(BIN)

$(BIN)/pr68:	pr68
		cp pr68 $(BIN)

$(BIN)/rev68:	rev68
		cp rev68 $(BIN)

$(BIN)/dl68:	dl68
		cp dl68 $(BIN)

$(BIN)/lorder68:
		cp lorder68.sh $(BIN)/lorder68
clean:
	rm -f *.o dl68 ld68 nm68 pr68 rev68 rl68 size68 ranlib68
	rm -f *.BAK *.CKP .emacs* .netup*
23,0,0,240,160,89,172,97,100,100,113,44,115,117,98,113,41,149,32,35,182,44,132,32,
10,1,255,240,0,104,98,141,32,158,
10,0,0,240,128,104,98,157,32,142,
16,0,0,241,128,120,109,111,118,101,113,32,35,135,44,145,
21,0,248,177,4,201,172,115,98,99,100,44,97,98,99,100,41,32,129,44sumacc/cc/ld/dl68.1   444      0     12        2055  3470501560   7126 .TH DL68 1 MC68000
.SU
.SH NAME
dl68 \- b.out -> .dl downloader component of cc68
.SH SYNOPSIS
.B dl68
[ -T -v -o -s ] filename
.SH DESCRIPTION
.I Dl68
is a downloader for the Motorola 68000 Design Module.  It takes its input, a
b.out format file, from filename and in the absence of the -o option sends its
output to stdout.
.PP
If there are any symbols these are loaded, starting at 0x6BA on vm (the Design
Module) or 0x1F000 on v1 (the Sun1 prototype).  The start and end of the symbol
table are stored at 0x570 and 0x574 respectively on either board.
.PP
The options are:
.TP
.BI \-T " textorigin "
specifies where the text (code) is to be loaded.
.TP
.BI \-v n
specifies the board version.  Default is v1 (Sun1 prototype).  vm denotes the
Motorola Design Module.
.TP
.BI \-o " filename "
specifies the output file.  Defaults to stdout.
.TP
.BI \-s DE
specifies the 
.I data/end
record types to generate.  The default is s28,
24 bit addresses.  The s19 format, 16 bit addresses, is used by the Data I/O
programmers.
.PP
.SH FILES
/usr/sun/ld68/down.c /usr/bin/dl68
$(BIN)

$(BIN)/dl68:	dl68
		cp dl68 $(BIN)

$(BIN)/lorder68:
		cp lorder68.sh $(BIN)/lorder68
clean:
	rm -f *.o dl68 ld68 nm68 pr68 rev68 rl68 size68 ranlib68
	rm -f *.BAK *.CKP .emacs* .netup*
23,0,0,240,160,89,172,97,100,100,113,44,115,117,98,113,41,149,32,35,182,44,132,32,
10,1,255,240,0,104,98,141,32,158,
10,0,0,240,128,104,98,157,32,142,
16,0,0,241,128,120,109,111,118,101,113,32,35,135,44,145,
21,0,248,177,4,201,172,115,98,99,100,44,97,98,99,100,41,32,129,44sumacc/cc/ld/dl68.c   444      0     12       17222  3470501560   7232 /* Downloader for MACSBUG.  
   Author Anonymous.
   Modified to store symbols: V. Pratt, Jan. 1981.
   Assumed to run on a machine with VAX-type byte order in a word,
   namely first text byte is least significant byte.  Modify the function
   reverse(lwrd) appropriately to run on another machine.
   Jan. 1982 - V. Pratt - Modified to load symbol table where the Sun
   	bootloader puts it
 */

#include "b.out.h"
#include <stdio.h>

#define STARTADDR 0x1000	/* Default start address */
#define RCDSIZE 32		/* Size of Motorola S-type records */
#define MACSSYMTAB 0x6BA	/* Symbol table starts here - MACSBUG */
#define SUNSYMTAB  0x1f000	/* Symbol table starts here - SUN */
#define SYMTAB (vflag=='m'?MACSSYMTAB:SUNSYMTAB)
#define SYMTABADDR 0x570	/* Boundaries of symbol table here */
#define MAXSYMS (vflag=='m'?((0x1000-0x6BA)/12):(0x1000/12))
#define MAXSYMST (0x1000/12)	/* Max size of symbol table for either
					SUN or MACSBUG */

#define hex(c) c>9 ? c+0X37 : c+0X30  /* macro for hex convert */

struct bhdr filhdr;

struct sym68 {			/* fake sym for 68000 */
	short dummy1;		/* ignored */
	char stype;		/* type */
	char slength;		/* length */
	long svalue;
};

char	Sdata=2;    	    	/* Default to S2/S8 records (24 bit addr) */
char	Send=8;
char	vflag=0;		/* 1 -> Design Module */
FILE *infile, *outfile;
char infilename[30], outfilename[30] = {0};
int syms = 0;

puthex(b)			/* print byte as two hex chars */
char b;
{
register char c1,c2;

    c1=(b>>4) & 0XF; c2=b & 0XF;
    c1=hex(c1); c2=hex(c2);
    fprintf(outfile,"%c%c",c1,c2);
}

typedef struct Msymtab 		/* structure of the MACSBUG symbol space */
    {char name[8];
     int value;
    } msymtab;

reverse(lwrd) unsigned lwrd;
 {return((lwrd>>24)	     |
	 (lwrd>>8 & 0xff00)  |
	 (lwrd<<8 & 0xff0000)|
	 (lwrd<<24)
	);
 }

int checksum;

checkout(c) char c; {checksum += c; puthex(c);}

/* Procedure to print out one ExorMacs record of given type */
print_exormacs_record(type,buffer,Dcount,addr) char *buffer; int Dcount, addr;
	{fprintf(outfile,"S%d",type); checksum = 0;
    	 if (type == 2 || type == 8)
    	    	{checkout((char) Dcount+4);
	    	 checkout((char) (addr>>16));
    	    	}
    	 else
    	    	checkout((char) Dcount+3);
	 checkout((char) (addr>>8));
	 checkout((char) addr);
	 while (Dcount--) checkout(*buffer++);
	 puthex(~(checksum & 0XFF)); 
	 fprintf(outfile,"\n");
	}

/* Procedure that puts out records from a buffer */
outbuf(buffer,addr,size)
char *buffer;
int addr, size;
{
int count,			/* counts total number of bytes processed*/
    Dcount;			/* number of bytes in current record */

    for(count=0; count<size; count += RCDSIZE) 
	{Dcount= (size-count<RCDSIZE) ? size-count : RCDSIZE;
	 print_exormacs_record(Sdata,buffer,Dcount,addr);
	 buffer += Dcount;
	 addr += Dcount;
	}
}

/* Procedure that puts out records  from a file */
outbin(file,addr,size)
FILE *file;
int addr, size;
{
int count,			/* counts total number of bytes processed*/
    Dcount;			/* number of bytes in current record */
char buffer[RCDSIZE];		/* buffer for data */

    for(count=0; count<size; count += RCDSIZE) 
	{Dcount= (size-count<RCDSIZE) ? size-count : RCDSIZE;
	 if(fread(buffer,Dcount,1,file) != 1)
	     {fprintf(stderr,"Read error\n"); exit(1);}
	 print_exormacs_record(Sdata,buffer,Dcount,addr);
	 addr += Dcount;
	}
}

#define lower(c) 'a' <= c && c <= 'z'
#define upper(c) 'A' <= c && c <= 'Z'
#define digit(c) '0' <= c && c <= '9'

macify(c) char c;	/* convert c to a form acceptable to MACSBUG */
 {return
   	(lower(c)?	c-32:
    	 upper(c)?	c:
    	 digit(c)?	c:
    	 c == '_'?	'.':
    	 /*default*/	'$'				/* rags to riches */
   	);
 }

/* Procedure to convert symbol table to .r format */
rbuild(table,source,size) struct sym68 *table; FILE *source; int *size;
   {struct sym s; int symno, chrno; char c; 
    struct sym68 *s68 = table;
    int pos;
    for (pos=0; pos < filhdr.ssize; )
       {if (!fread(&s,sizeof s,1,source)) break;/* Get symbol descriptor */
	pos += sizeof s;
	s68 = (struct sym68 *)((int)s68 -2);	/* kludge */
	s68->stype = s.stype;
	s68->slength = s.slength;
	s68->svalue = reverse(s.svalue);
	s68++;
	while (*(char *)s68 = getc(source)) {
		s68 = (struct sym68 *)((int)s68 + 1);
		pos++;
	}
	s68 = (struct sym68 *)((int)s68 + strlen(s68)+1);
	if ((int)s68 & 1) {
		*((char *)s68) = 0;		/* clear extra byte */
		s68 = (struct sym68 *)((int)s68 + 1);	/* word align */
	}
       }
    *size = (int)s68 - (int)table;
   }

/* Procedure to convert symbol table to MACSBUG format */
build(table,source,size) msymtab table[]; FILE *source; int *size;
   {struct sym s; int symno, chrno; char c;
    for (symno=0; symno<MAXSYMS; symno++)	/* Keep count of symbols */
       {if (!fread(&s,sizeof s,1,source)) break;/* Get symbol descriptor */
	chrno = 0;
	while ((c = getc(source)) && chrno<8)
	    table[symno].name[chrno++] = macify(c);/* Write chars of sym.*/
	while (chrno<8)				/* Pad rest with spaces */
	    table[symno].name[chrno++] = ' ';
	while (c) c = getc(source);		/* discard symbol tail */
	table[symno].value = reverse(s.svalue);	/* Supply symbol value */
       }
    *size = symno * 12;				/* return size of table */
    return((int)table);				/* return address of table */
   }

main(argc,argv)
int argc;
char *argv[];
{
int Sa, Daddr=STARTADDR, i;
msymtab table[MAXSYMST];

    if(argc<2)
	{fprintf(stderr,"Usage: dl68 infile [ > outfile ]\n");
	 exit(1);
	}
    for (i=1; i<argc; i++)				/* get options */
	if (argv[i][0] == '-')
	switch (argv[i][1]) {
		case 'T': if (i++ < argc)
			    sscanf(argv[i],"%x",&Daddr); 
			    break;
		case 'v':
			vflag = argv[i][2];
			break;
		case 'o':
			if (i++ < argc)
				strcpy(outfilename,argv[i]);
			break;
    	    	case 's':
    	    	    	Sdata = argv[i][2] - '0';
    	    	    	Send = argv[i][3] - '0';
    	    	    	break;
	}
	else strcpy(infilename,argv[i]);
    if((infile=fopen(infilename,"r"))==NULL)	 /* open infile */
       {strcat(infilename,".68");     			 /* try .68 form */
	if ((infile=fopen(infilename,"r"))==NULL) 
           {fprintf(stderr,"dl68: Can't open %s\n",infilename);
	    exit(1);
	   }
       }
    if (*outfilename) {
	if ((outfile = fopen(outfilename,"w")) == NULL) {
		fprintf(stderr,"dl68: Can't open %s\n",outfilename);
		exit(1);
	}
    }
    else outfile = stdout;
    if(fread(&filhdr, sizeof(struct bhdr),1,infile) != 1)/* get header info */
	{fprintf(stderr,"dl68: %s wrong format\n",infilename);
	 exit(1);
	}
    if(filhdr.fmagic != FMAGIC) {		/* check magic number */
	 fprintf(stderr,"dl68: %s not proper b.out file\n",infilename); 
	 exit(1);
    }

    Sa = Daddr;

/* Output records for TEXT portion */
    outbin(infile,Daddr,filhdr.tsize);
    Daddr += filhdr.tsize;    /* adjust output address */

    fseek(infile,DATAPOS,0);       /* seek to DATA portion */
/* Output records for DATA segment */
    outbin(infile,Daddr,filhdr.dsize);
    Daddr += filhdr.dsize;    /* adjust output address */

    fseek(infile,SYMPOS,0);	/* seek to SYM portion */
    if (filhdr.ssize) {
	int sz;
	if (vflag != 'm') {
		/* Output symbol table in boot loader format */
		int ssize68;
		static char stable[8192];	/* enough? */
		(char*)rbuild(stable,infile,&sz);
		ssize68 = reverse(sz);
		Daddr += filhdr.bsize;	/* skip bss (should be 0 really) */
		print_exormacs_record(Sdata,&ssize68,4,Daddr);
		Daddr += 4;
		outbuf(stable,Daddr,sz);
	}

	else {
		int tabpnt[2]; msymtab table[MAXSYMST]; char *bbuf;
		bbuf = (char*)build(table,infile,&sz);
		outbuf(bbuf,SYMTAB,sz);
		tabpnt[0] = reverse(SYMTAB);		/* Lower limit */
		tabpnt[1] = reverse(SYMTAB+sz);		/* Upper limit */
		outbuf(tabpnt,SYMTABADDR,sizeof tabpnt);/* Output pointers */
	}
    }
/* Output entry point: as in file header, else default to start address */
    print_exormacs_record(Send,0,0,filhdr.entry? filhdr.entry: Sa);
}


uct sym68 *table; FILE *source; int *size;
   {struct sym s; int symno, chrno; char c; 
    struct sym68 *s68 = table;
    int pos;
    for (pos=0; pos < filhdr.ssize; )
       {if (!fread(&s,sizeof s,1,source)) break;/* Get symbol descriptor */
	pos += sizeof s;
	s68 = (struct sym68 *)((int)s68 -2);	/* kludge */
	s68->stype = s.stype;
	s68->slength = s.slength;
	sumacc/cc/ld/ld.c   444      0     12      102477  3470501560   7103 /*
 * ld.c - 68000 Linking Loader
 *
 * July 1982 Bill Nowicki Stanford
 *	- merged LucasFilms and Stanford versions
 *	- made symbol table larger
 *
 * 1 Aug 82 - Mike Nielsen @ Stanford
 *  	- added qflag
 *  	- quicksort symbols in b.out by numerical value if qflag in finishout
 *
 * 1 Oct 82 - Per Bothner @ Stanford
 *	- added -f flag: fold case, making upper and lower case letters equal
 *
 * May 83 - Per Bothner, Stanford
 *	- ld68 now ignores __.SYMDEF files as produced by ranlib68
 *	[Really should use __.SYMDEF to speed up loading at some point]
 */

#ifdef BOOTSTRAP
#include "/usr/include/stdio.h"
#else
#include <stdio.h>
#endif

#ifndef Stanford
				/* Unix -specific stuff */
#include <sys/autoconf.h>	/* to get U_VA */
#include <a.out.h>
#include <ar.h>			/* V7 archive header */
#include <ar.bky.h>		/* UC Berkeley archive header */
#include <bootstrap.h>

#else Stanford

#include <b.out.h>
#include <ar.h>		/* UC Berkeley archive header */
#define ROOT "/usr/sun"

#endif Stanford

/*
 *  link editor
 */

#define TRUE 1
#define FALSE 0

/*  Warning!  segsize is assumed to be <= the largest segment size 
 *  in any hardware implmentation.  segsize determines where the
 *  data/bss segment is placed in mode 410 files (seperate R/O text segment).
 *  It MUST agree with a similar definition in the kernel (machdep.c).
 */

#define	segsize	64*1024		/* text/data segment seperate size */

struct archdir				/* Don't use this on UCB Unix */
{
	char	aname[14];
	long	atime;
	char	auid, agid;
	short	amode;
	long	asize;
};

#define NOVLY	16
#define	NROUT	256
#define TABSZ	700

#ifndef Stanford
#define	NSYM	4507		/* symbol table size */
				/* LucasFlim had 4000, MIT had 1503 */
#define	NSYMPR	1200
#define ORG	U_VA		/* default text origin */
#else Stanford
#define	NSYM	8191		/* symbol table size */
#define	NSYMPR	8000		
#define ORG	0x1000
#endif Stanford

#ifdef BOOTSTRAP
#define	DOTOUT	"b.out"
#define	BIN	'b'
#else
#define	DOTOUT	"a.out"
#define	BIN	'o'
#endif

typedef struct symbol *symp;
struct symbol
{
	struct sym s;			/* type and value */
	char *sname;			/* pointer to asciz name */
	int snlength;			/* length of name in bytes */
	symp *shash;			/* hash table index */
	unsigned sindex;		/* id of symbol in symtab */
};

typedef struct arg_link *arg;
struct arg_link
{
	char *arg_name;			/* the acutal argument string */
	arg arg_next;			/* next one in linked list */
};

typedef struct arc_entry *arce;
struct arc_entry
{
	long	arc_offs;		/* offset in the file of this entry */
	arce	arc_e_next;		/* next entry, NULL if none */
};

typedef struct arc_link *arcp;
struct arc_link
{
	arce arc_e_list;		/* list of archive entries */
	arcp arc_next;			/* next archive */
};
/* global variables */

arg arglist;				/* linked list of arguments */
#ifndef Stanford
struct ar_hdr v7_archdr;		/* directory part of v7 archive */
struct bky_ar_hdr bky_archdr;		/* directory part of bky archive */
#else Stanford
struct ar_hdr archdr;			/* directory part of archive */
#endif Stanford
arcp arclist = NULL;			/* list of archives */
arcp arclast = NULL;			/* last archive on arclist */
arce arcelast = NULL;			/* last entry in this entry list */
#ifndef Stanford
struct exec filhdr;			/* header file for current file */
#else Stanford
struct bhdr filhdr;			/* header file for current file */
#endif Stanford
struct symbol cursym;			/* current symbol */
char csymbuf[SYMLENGTH];		/* buffer for current symbol name */
struct symbol symtab[NSYM];		/* actual symbols */
symp lastsym;				/* last symbol entered */
int symindex;				/* next available symbol table entry */
symp hshtab[NSYM+2];			/* hash table for symbols */
symp local[NSYMPR];			/* symbols in current file */
int nloc;				/* number of local symbols per file */
int nund = 0;				/* number of undefined syms in pass 2*/
symp entrypt = 0;			/* pointer to entry point symbol */
int argnum;				/* current argument number */
char *ofilename = DOTOUT;		/* output file, default init */

FILE *text;				/* file descriptor for input file */
FILE *rtext;				/* used to access relocation */
char *filename;				/* name of current input file */
char *mfilename;			/* name of Macsbug input file */

char tfilename[100];			/* copy of filename */
char xfilename[100];			/* copy of filename */

FILE *tout;				/* text portion */
FILE *dout;				/* data portion */
FILE *trout;				/* text relocation commands */
FILE *drout;				/* data relocation commands */
FILE *Lout;				/* list symbols */


/* flags */
int	xflag;		/* discard local symbols */
int	Xflag;		/* discard locals starting with '.L' */
int	Sflag;		/* discard all except locals and globals*/
int	rflag;		/* preserve relocation bits, don't define common */
int	sflag;		/* discard all symbols */
int	vflag=1;	/* what version? presently default to 1 */
int	dflag;		/* define common even with rflag */
int	Lflag;		/* list symbols on list.out */
int	nflag = 0;	/* create a 410 file */
int	Bflag;		/* set origin of common/bss segment */
int 	qflag;	    	/* quick sorts symbols by numerical value */

/* used after pass 1 */
long torigin;		/* origin of text segment in final output */
long dorigin;		/* origin of data segment in final output */
long doffset;		/* current position in output data segment */
long borigin;		/* origin of bss segment in final output */
long corigin;		/* origin of common area */

/* cumulative sizes set in pass 1 */
long	tsize;		/* size of text data */
long	dsize;		/* size of data segment */
long	bsize;		/* size of bss segment */
long	csize;		/* size of common area */
long	rtsize;		/* size of text relocation area */
long	rdsize;		/* size of data relocation area */
long	ssize = 0;	/* size of symbol area */

/* symbol relocation; both passes */
long	ctrel;
long	cdrel;
long	cbrel;

/* error messages */

char *e1 = "missing argument following command option -%c";
char *e2 = "unrecognized option: -%c";
char *e3 = "premature end of file %s";
char *e4 = "read error on file %s";
char *e5 = "unknown type of file %s";
char *e5a = "unknown type of file %s in readhdr";
char *e6 = "multiply defined symbol %s in file %s";
char *e7 = "entry point not in text";
char *e8 = "cannot create file %s";
char *e9 = "cannot reopen output file";
char *e10 = "local symbol overflow";
char *e11 = "internal error - undefined symbol %s in file %s";
char *e12 = "format error in file %s, bad relocation size";
char *e13 = "format error in file %s, relocation outside of segment";
char *e14 = "error writing file %s";
char *e15 = "file %s not found";
char *e16 = "hash table overflow";
char *e17 = "symbol table overflow";
char *e18 = "format error in file %s, null symbol name";
char *e19 = "format error in file %s, invalid symbol id in relocation command";
char *e20 = "%s references %s";
char *e21 = "format error in file %s, bad address in relocation command";
char *e22 = "bad header in archive %s, ARFMAG is 0x%x 0x%x";
char *e23 = "unknown archive magic, 0x%x 0x%x 0x%x 0x%x";

/* functions */

long getsym();
symp lookup();
symp slookup();
symp *hash();
long relext();
long relcmd();
long atox();
long foldstrcmp();
long strcmp();
long (*mystrcmp)() = strcmp;	/* points to either strcmp or foldstrcmp
				   depending on the '-f' flag */

/* main -	The link editor works in two passes.  In pass 1, symbols
		are defined.  In pass 2, the actual text and data will
		be output along with any relocation commands and symbols
*/

main(argc, argv)
int argc;
char **argv;
{
	arg argp;	/* current argument */
	
	torigin = ORG;	/* set with -T flag */
	procargs(argc, argv);
	for (argp = arglist; argp; argp = argp->arg_next)
		load1arg(filename = argp->arg_name);
	middle();
	setupout();
	for (argp = arglist; argp; argp = argp->arg_next)
		load2arg(filename = argp->arg_name);
	finishout();
	exit(0);
}

/* progargs -	Process command arguments
 */

procargs(argc, argv)
int argc;
char **argv;
{
	for (argnum = 1; argnum < argc; argnum++)	/* for each arg */
	{
		if (argv[argnum][0] == '-') procflags(argc, argv);
		else newarg(argv[argnum]);	/* build linked list */
	}
}


/* newarg -	Create a new member of linked list of arguments
 */
newarg(name)
char *name;
{
	arg a1, a2;
	a1 = (arg)calloc(1, sizeof(*a1));
	a1->arg_name = name;
	a1->arg_next = NULL;
	if (arglist == NULL) arglist = a1;
	else	/* link new one on end */
	{
		for (a2 = arglist; a2->arg_next; a2 = a2->arg_next);
		a2->arg_next = a1;
	}
}
/* procflags -	Process flag arguments.
 */

procflags(argc, argv)
int argc;
char **argv;
{
	char *flagp = &argv[argnum][1];
	char c;

	while(c = *flagp++) switch(c)
	{
	case 'o':
		if (++argnum >= argc) error(e1, c);
		else ofilename = argv[argnum];
		break;
	case 'u':
		if (++argnum >= argc) error(e1, c);
		else enter(slookup(argv[argnum]));
		break;
	case 'e':
		if (++argnum >= argc) error(e1, c);
		else enter(slookup(argv[argnum]));
		entrypt = lastsym;
		break;
	case 'D':
		if (++argnum >= argc) error(e1, c);
		else dsize = atol(argv[argnum]);
		break;
	case 'T':
		if (++argnum >= argc) error(e1, c);
		else torigin = atox(argv[argnum]);
		break;
	case 'B':
		if (++argnum >= argc) error(e1, c);
		else borigin = atox(argv[argnum]);
		Bflag++;
		break;

	case 'l': newarg(argv[argnum]); while (*++flagp); break;
	case 'x': xflag++; break;
	case 'X': Xflag++; break;
	case 'S': Sflag++; break;
	case 'r': rflag++; break;
	case 's': sflag++; xflag++; break;
	case 'v': vflag = *flagp++; break;
	case 'd': dflag++; break;
	case 'n': nflag++; break;
	case 'L': Lflag++; break;
	case 'M': Lflag++; break;
    	case 'q': qflag++; break;
	case 'f': mystrcmp = foldstrcmp; break;
	default:	error(e2, c);
	}
}

/* Like strcmp, but insensitive to cases of letters */
foldstrcmp(s1, s2)
register char *s1, *s2;
{ register char c1, c2;
    do {
	c1 = *s1++; c2 = *s2++;
	if (c1 >= 'A' && c1 <= 'Z') c1 += 'a' - 'A';
	if (c2 >= 'A' && c2 <= 'Z') c2 += 'a' - 'A';
	if (c1 -= c2) return(c1);
    } while (c2 != '\0');
    return (0);
}

long atox(s)
char *s;
{
	long result = 0;
	for (; *s != 0; *s++)
	  if (*s >= '0' && *s <= '9') result = (result<<4) + *s-'0'; else
	  if (*s >= 'a' && *s <= 'f') result = (result<<4) + *s-'a'+10; else
	  if (*s >= 'A' && *s <= 'F') result = (result<<4) + *s-'A'+10; else
	  error("atox: illegal hex argument (%c)",*s);
	return(result);
}
/* scan file to find defined symbols */
load1arg(cp)
register char *cp;
{
	long position = 0, n;
	arcp ap;		/* pointer to new archive list element */

	switch (getfile(cp))	/* open file and read first word */
	{
	case FMAGIC:
		fseek(text, 0L, 0);	/* back to start of file */
		load1(0L, 0);		/* pass1 on regular file */
		break;

#ifndef Stanford
	/* V7 archive */
	case ARMAG:
#else Stanford
	/* regular archive */
	case ARCMAGIC:
#endif Stanford
		ap = (arcp)calloc(1, sizeof(*ap));
		ap->arc_next = NULL;
		ap->arc_e_list = NULL;
		if (arclist)
		{
			arclast->arc_next = ap;
			arclast = ap;
		}
		else arclast = arclist = ap;
#ifndef Stanford
		position = 2;
		fseek(text, 2L, 0);		/* skip magic */
		while (fread(&v7_archdr, sizeof v7_archdr, 1, text) &&
		      !feof(text))
		{
			position += sizeof(v7_archdr);
#else Stanford
		position = SARMAG;
		fseek(text, SARMAG, 0);		/* skip magic */
		while (fread(&archdr, sizeof archdr, 1, text) && !feof(text))
		{
			position += sizeof(archdr);
			if (strncmp(archdr.ar_name, "__.SYMDEF       ", 16))
#endif Stanford
			if (load1(position, 1))		/* arc pass1 */
			{
				arce ae = (arce)calloc(1, sizeof(*ae));
				ae->arc_e_next = NULL;
				ae->arc_offs = position;
				if (arclast->arc_e_list)
				{
					arcelast->arc_e_next = ae;
					arcelast = ae;
				}
				else arclast->arc_e_list = arcelast = ae;
			}
#ifndef Stanford
			position += (v7_archdr.ar_size+1)&~1;
			fseek(text, position, 0);
		}
		break;

	/* Berkeley archive */
	case BKYARCHIVE:
		ap = (arcp)calloc(1, sizeof(*ap));
		ap->arc_next = NULL;
		ap->arc_e_list = NULL;
		if (arclist)
		{
			arclast->arc_next = ap;
			arclast = ap;
		}
		else arclast = arclist = ap;
		position = BKYSARMAG;
		fseek(text, BKYSARMAG, 0);		/* skip magic */
		while (fread(&bky_archdr, sizeof bky_archdr, 1, text) &&
		      !feof(text)) {
			if (strcmpn(bky_archdr.bky_fmag, BKYARFMAG,
			    sizeof BKYARFMAG) != 0)
				fatal (e22, filename, bky_archdr.bky_fmag[0],
					bky_archdr.bky_fmag[1]);
			position += sizeof(bky_archdr);
			if (load1(position, 1))		/* arc pass1 */
			{
				arce ae = (arce)calloc(1, sizeof(*ae));
				ae->arc_e_next = NULL;
				ae->arc_offs = position;
				if (arclast->arc_e_list)
				{
					arcelast->arc_e_next = ae;
					arcelast = ae;
				}
				else arclast->arc_e_list = arcelast = ae;
			}
			sscanf(bky_archdr.bky_size,"%d",&n);
#else Stanford
			sscanf(archdr.ar_size,"%d",&n);
#endif Stanford
			position += (n+1)&~1;
			fseek(text, position, 0);
		}
		break;

	default:
		fatal(e5, filename);
	}
	fclose(text);
	fclose(rtext);
}
/* load1 -	Accumulate file sizes and symbols for single file
		or archive member.  Relocate each symbol as it is
		processed to its relative position in it csect.
		If libflg == 1, then file is an archive hence
		throw it away unless it defines some symbols.
		Here we also accumulate .comm symbol values.
*/

load1(sloc, libflg)
long sloc;	/* location of first byte of this file */
int libflg;	/* 1 => loading a library, 0 else */
{
	long loc = sloc;/* current position in file */
	long endpos;	/* position after symbol table */
	int savindex;	/* symbol table index on entry */
	int ndef;	/* number of symbols defined */

	readhdr(sloc);

	ctrel = tsize;
	cdrel += dsize;
	cbrel += bsize;
	ndef = 0;
	nloc = 0;
	savindex = symindex;
	loc += SYMPOS;
	fseek(text,loc, 0);	/* skip to symbols */
	endpos = loc + filhdr.ssize;
	while (loc < endpos)
	{
		loc += getsym();
		ndef += sym1();	/* process one symbol */
	}
	if (libflg==0 || ndef) {
		tsize += filhdr.tsize;
		dsize += filhdr.dsize;
		bsize += filhdr.bsize;
		ssize += nloc;			/* count local symbols */
		rtsize += filhdr.rtsize;
		rdsize += filhdr.rdsize;
		return(1);
	}
	/*
	 * No symbols defined by this library member.
	 * Rip out the hash table entries and reset the symbol table.
	 */

	while (symindex>savindex) *symtab[--symindex].shash = 0;
	return(0);
}
/* sym1 -	Process pass1 symbol definitions.  This involves flushing
		un-needed symbols, and entering the rest in the symbol table.
		Returns 1 if a symbol was defined and 0 else.
 */
sym1()
{
	register symp sp;
	int type = cursym.s.stype;	/* type of the current symbol */
#ifdef Stanford
	int len = cursym.s.slength;	/* length of the current symbol */
#endif Stanford

	if (Sflag) switch(type& 037)
	{
	case TEXT:
	case BSS:
	case DATA:
		break;
	default:
		return(0);
	}
	if ((type&EXTERN) == 0)
	{
		if (xflag || (Xflag && (cursym.sname[0] == '.')
			&& (cursym.sname[1] == 'L')));
		else nloc += sizeof(cursym.s) + cursym.snlength + 1;
		return(0);
	}
	symreloc(); 			/* relocate symbol in file */
	if (enter(lookup())) return(0);	/* install symbol in table */

	/* If we get here, then symbol was already present.
	   If symbol is already defined then return, multiple
	   definitions are caught later.   If current symbol is
	   not EXTERN eg it is local, let the new one override */

	if ((sp = lastsym)->s.stype & EXTERN)
	{
		if ((sp->s.stype & 037) != UNDEF) return(0);
	}
	else if (!(cursym.s.stype & EXTERN)) return(0);
	if (cursym.s.stype == EXTERN+UNDEF)
	{
		/* check for .comm symbols */
		if (cursym.s.svalue>sp->s.svalue) sp->s.svalue=cursym.s.svalue;
		return(0);
	}
	if (sp->s.svalue!=0 && cursym.s.stype == EXTERN+TEXT) return(0);
	sp->s.stype = cursym.s.stype;	/* define something new */
#ifdef Stanford
	sp->s.slength = cursym.snlength;
#endif Stanford
	sp->s.svalue = cursym.s.svalue;
	return(1);
}
/* middle -	Finalize the symbol table by adding the origins of
		each csect to symbols.  Also define the end stuff,
		adjusting the boundries of the csect depending on
		options.
 */

middle()
{
	register symp sp;
	int col=1, Lokay=TRUE;

	enter(slookup("_etext"));
	enter(slookup("_edata"));
	enter(slookup("_end"));
	/*
	 * Assign common locations.
	 */
	csize = 0;
	if (dflag || rflag==0)
	{
		ldrsym(slookup("_etext"), tsize, EXTERN+TEXT); /* set value */
		ldrsym(slookup("_edata"), dsize, EXTERN+DATA);
		ldrsym(slookup("_end"), bsize, EXTERN+BSS);
		common();
	}
	/*
	 * Now set symbols to their final value
	 */
#ifndef Stanford
	tsize = (tsize + 1) & ~01;		/* move to word boundary */

	/* move data/bss segment up to segment boundary for mode 410 files */

	if (nflag) dorigin = torigin + ((tsize + (segsize-1)) & ~(segsize-1));

#else Stanford
	tsize += tsize&1;			/* move to word boundry */
	if (nflag) {				/* -n -> move to seg bdy */
		torigin = torigin + (SEGSIZE - 1) & -SEGSIZE;
		dorigin = torigin+(tsize+(SEGSIZE - 1)) & -SEGSIZE;
	}
#endif Stanford
	else dorigin = torigin + tsize;
#ifndef Stanford
	dsize = (dsize + 1) & ~01;		/* move to word boundary */
	if (Bflag) {
		corigin = borigin;		/* put comm/bss elsewhere */
		borigin += csize;
	} else {
#else Stanford
	dsize += dsize&1;			/* move to word boundry */
#endif Stanford
		corigin = dorigin + dsize;	/* common after data */
		borigin = corigin + csize;	/* bss after common area */
#ifndef Stanford
	}
#endif Stanford
	nund = 0;				/* no undefined initially */
/*	ssize = size of local symbols to be entered in load2		*/
	doffset = 0;				/* beginning of data seg */
	Lokay = TRUE;
	if (Lflag)
	   if ((Lout = fopen("sym.out", "w")) == NULL)
	      {error(e8, "list.out");
	       Lokay = FALSE;
	      }
	for (sp = symtab; sp < &symtab[symindex]; sp++)  
	    {sym2(sp);
	     if (Lokay && Lflag)
		fprintf(Lout, col++%4?"%s %x\t":"%s %x\n",
			sp->sname, sp->s.svalue);
	    }
	bsize += csize;
}
/* common -	Set up the common area.
 */

common()
{
	register symp sp;
	long val;

	csize = 0;
	for (sp = symtab; sp < &symtab[symindex]; sp++)
		if (sp->s.stype == EXTERN+UNDEF && ((val = sp->s.svalue) != 0))
		{
			val = (val + 1) & ~01;	/* word boundry */
			sp->s.svalue = csize;
			sp->s.stype = EXTERN+COMM;
			csize += val;
		}
}
/* sym2 -	Assign external symbols their final value and compute ssize */
sym2(sp)
register symp sp;
{
	ssize += sizeof(sp->s) + sp->snlength + 1;
	switch (sp->s.stype)
	{
	case EXTERN+UNDEF:
		if ((rflag == 0 || dflag) && sp->s.svalue == 0)
		{
			if (nund==0)
				printf("Undefined:\n");
			nund++;
			printf("%s\n", sp->sname);
		}
		break;

	case EXTERN+ABS:
	default:
		break;

	case EXTERN+TEXT:
		sp->s.svalue += torigin;
		break;

	case EXTERN+DATA:
		sp->s.svalue += dorigin;
		break;

	case EXTERN+BSS:
		sp->s.svalue += borigin;
		break;

	case EXTERN+COMM:
		sp->s.stype = EXTERN+BSS;
		sp->s.svalue += corigin;
		break;
	}
}
/* ldrsym -	Force the definition of a symbol */
ldrsym(asp, val, type)
symp asp;
long val;			/* value of the symbol */
char type;			/* its type */
{
	register symp sp;

	if ((sp = asp) == 0)
		return;
	if (sp->s.stype != EXTERN+UNDEF || sp->s.svalue)
	{
		error(e6, sp->sname, filename);
		return;
	}
	sp->s.stype = type;
	sp->s.svalue = val;
}

/* setupout -	Set up for output.  Create output file and a temporary
		files for the data area and relocation commands if
		necessary.  Write the header on the output file.
 */

setupout()
{
	if (nflag) filhdr.fmagic = NMAGIC;
	else filhdr.fmagic = FMAGIC;
	filhdr.tsize = tsize;
	filhdr.dsize = dsize;
	filhdr.bsize = bsize;
	filhdr.rtsize = rflag? rtsize: 0;
	filhdr.rdsize = rflag? rdsize: 0;
	filhdr.ssize = sflag? 0:ssize;
	if (!entrypt && slookup("_start") != NULL)
	     entrypt = slookup("_start");
	if (entrypt)
	{
		if (entrypt->s.stype!=EXTERN+TEXT) error(e7);
		else filhdr.entry = entrypt->s.svalue;
	}
	else filhdr.entry = torigin;
	if ((tout = fopen(ofilename, "w")) == NULL) fatal(e8, ofilename);
	if ((dout = fopen(ofilename, "a")) == NULL) fatal(e9);
	fseek(dout, (long)(DATAPOS), 0);
	if (rflag)
	{
		if ((trout = fopen(ofilename, "a")) == NULL) fatal(e9);
		fseek(trout, (long)RTEXTPOS, 0); /* start of text relocation */
		if ((drout = fopen(ofilename, "a")) == NULL) fatal(e9);
		fseek(drout, (long)RDATAPOS, 0);	/* to data reloc */
	}
	fwrite(&filhdr, sizeof(filhdr), 1, tout);
}
/* load2arg -	Load a named file or an archive */

load2arg(cp)
char *cp;
{
	long position = 0;	/* position in input file */
	arce entry;		/* pointer to current entry */
	switch (getfile(cp))
	{
	case FMAGIC:			/* normal file */
		
		dread(&filhdr, sizeof filhdr, 1, text);
		load2(0L);
		break;
#ifndef Stanford
	case ARMAG:			/* V7 archive */
#else Stanford
	case ARCMAGIC:			/* archive */
#endif Stanford
		for(entry=arclist->arc_e_list; entry; entry=entry->arc_e_next)
		{
			position = entry->arc_offs;
			fseek(text, position, 0);
			dread(&filhdr, sizeof filhdr, 1, text);
			load2(position);		/* load the file */
		}
		arclist = arclist->arc_next;
		break;
#ifndef Stanford

	case BKYARCHIVE:			/* Berkeley archive */
		for(entry=arclist->arc_e_list; entry; entry=entry->arc_e_next)
		{
			position = entry->arc_offs;
			fseek(text, position, 0);
			dread(&filhdr, sizeof filhdr, 1, text);
			load2(position);		/* load the file */
		}
		arclist = arclist->arc_next;
		break;

#endif Stanford
	default:	bletch("bad file type on second pass");
	}
	fclose(text);
	fclose(rtext);
}

/* load2 -	Actually output the text, performing relocation as necessary.
 */
load2(sloc)
long sloc;	/* position of filhdr in current input file */
{
	register symp sp;
	long loc=sloc;	/* current position in file */
	long endpos;	/* end of symbol segment */
	int symno = 0;
	int type;

	readhdr(sloc);
	ctrel = torigin;
	cdrel += dorigin;
	cbrel += borigin;

	/*
	 * Reread the symbol table, recording the numbering
	 * of symbols for fixing external references.
	 */
	loc += SYMPOS;
	fseek(text, loc, 0);
	endpos = loc + filhdr.ssize;
	while(loc < endpos)
	{
		loc += getsym();
		symno++;
		if (symno >= NSYMPR) fatal(e10);
		symreloc();
		type = cursym.s.stype;
		if (Sflag)
		{
			switch(type&037)
			{
			case TEXT:
			case BSS:
			case DATA:
				break;
			default:
				continue;		
			}
		}
		if ((type&EXTERN) == 0)		/* enter local symbols now */
		{
			if (xflag || (Xflag && (cursym.sname[0] == '.')
				&& (cursym.sname[1] == 'L')));
			else enter(lookup());
			continue;
		}
		if ((sp = lookup()) == NULL) fatal(e11,cursym.sname,filename);
		local[symno - 1] = sp;
		if (cursym.s.stype != EXTERN+UNDEF
		 && (cursym.s.stype != sp->s.stype
		  || cursym.s.svalue != sp->s.svalue))
			error(e6, cursym.sname, filename);
	}
	fseek(text, sloc+TEXTPOS, 0);
	fseek(rtext, sloc+RTEXTPOS, 0);
	load2td(tout, trout, torigin, filhdr.tsize, filhdr.rtsize);
	fseek(text, sloc+DATAPOS, 0);
	fseek(rtext, sloc+RDATAPOS, 0);
	load2td(dout, drout, doffset, filhdr.dsize, filhdr.rdsize);
	torigin += filhdr.tsize;
	dorigin += filhdr.dsize;
	doffset += filhdr.dsize;
	borigin += filhdr.bsize;
}
/* load the text or data section of a file performing relocation */
load2td(outf, outrf, txtstart, txtsize, rsize)
FILE *outf;		/* text or data portion of output file */
FILE *outrf;		/* text or data relocation part of output file */
long txtstart;		/* initial offset of text or data segment */
long txtsize;		/* number of bytes in segment */
long rsize;		/* size of appropriate relocation data */
{
	struct reloc rel;		/* the current relocation command */
	int size;			/* number of bytes to relocate */
	long offs;			/* value of offset to use */
	long rcount;			/* number of relocation commands */
	long pos = 0;			/* current input position */

	rcount = rsize/sizeof rel;
	while(rcount--)			/* for each relocation command */
	{
		if (pos >= txtsize) bletch("relocation after end of segment");
		dread(&rel, sizeof rel, 1, rtext);
		switch(rel.rsegment)
		{
		case REXT:
			offs = relext(&rel);
			break;
		case RTEXT:
			offs = torigin;
			break;
		case RDATA:
			offs = dorigin - filhdr.tsize;
			break;
		case RBSS:
			offs = borigin - (filhdr.tsize + filhdr.dsize);
			break;
		}
		if (rel.rdisp)
			offs -= rel.rpos + txtstart;
		switch(rel.rsize)
		{
		case RBYTE:
			size = 1; break;
		case RWORD:
			size = 2; break;
		case RLONG:
			size = 4; break;
		default:
			fatal(e12, filename);
		}
		if (rel.rpos > txtsize) fatal(e13, filename);
		else pos = relcmd(pos, rel.rpos, size, offs, outf);
		if (rflag && rel.rdisp==0)	/* write out relocation commands */
		{
			rel.rpos +=  txtstart;
			rel.rsymbol = (rel.rsegment == REXT)?
				local[rel.rsymbol]->sindex: 0;
			fwrite(&rel, sizeof rel, 1, outrf);
		}
	}
	dcopy(text, outf, txtsize - pos);
}
/* relext -	Find the offset of an REXT command and fix up the rel cmd.
 */

long relext(r)
register struct reloc *r;
{
	register symp sp;		/* pointer to symbol for EXT's */
	long offs;			/* return value */

	if ((r->rsymbol < 0 || r->rsymbol >= NSYMPR) ||
		((sp = local[r->rsymbol]) == NULL))
	{
		error(e19, filename);
		offs = 0;
	}
	else
	{
		offs = sp->s.svalue;
		switch(sp->s.stype & 037)
		{
		case TEXT: r->rsegment = RTEXT; break;
		case DATA: r->rsegment = RDATA; break;
		case BSS: r->rsegment = RBSS; break;
		case UNDEF:
			if (rflag && (sp->s.stype & EXTERN)) {
				r->rsegment = REXT;
				break;
			}
		default: error(e20, filename, sp->sname);
		}
	}
	return(offs);
}

/* relcmd -	Seek to <position> in file by copying from text to
		outf, then Add an offset to the next <size>
		bytes in the text and write out to outf.
 */

long relcmd(current, position, size, offs, outf)
long current;		/* current position in file */
long position;		/* where in file to perform relocation */
int size;		/* number of bytes to fix up */
long offs;		/* the number to fix up by */
FILE *outf;		/* where to write to */
{
	register int i, c;
	long buf = 0;
	if (position < current)
	{
		error(e21, filename);
		return(current);
	}
	dcopy(text, outf, position - current);
	for (i = 0; i < size; i++)
	{
		if ((c = getc(text)) == EOF) fatal(e3, filename);
		buf = (buf << 8) | (c & 0377);
	}
	buf += offs;
	for (i = size - 1; i >= 0; i--)
	{
		c = (buf >> (i * 8)) & 0377;
		putc(c, outf);
	}
	return(position + size);
}
/* sym_sort - Quick sort of symbols by numerical value for debugger */

sym_sort(l,r,tabs)
int l,r;
int tabs;
{
    register i,j;
    register value;
    struct symbol temp;

    i = l;
    j = r;
    value = symtab[(l+r)/2].s.svalue;
    do
    {
    	while (symtab[i].s.svalue < value)
    	    i++;
    	while (value < symtab[j].s.svalue)
    	    j--;

    	if ((i < j) && (symtab[i].s.svalue != symtab[j].s.svalue))
    	{
    	    temp = symtab[i];
    	    symtab[i] = symtab[j];
    	    symtab[j] = temp;
    	}
   	if (i <= j)  
    	{
    	    i++;
    	    j--;
    	}
    } while (i <= j);
    if (l < j)
    	sym_sort(l,j,tabs+1);
    if (i < r)
    	sym_sort(i,r,tabs+1);
}

/* finishout 	Finish off the output file by writing out symbol table */

finishout()
{
	register symp sp;

	fseek(tout, sizeof filhdr + tsize + dsize, 0);
    	if (qflag)
    	    sym_sort(0,symindex-1,0);
	if (sflag == 0) for (sp = symtab; sp < &symtab[symindex]; sp++)
	{
		register int i;
		register char *cp;

		fwrite(&sp->s, sizeof sp->s, 1, tout);
		if ((i = sp->snlength) == 0) bletch("zero length symbol");
		cp = sp->sname;
		while (i--)
		{
			if (*cp <= ' ')
				bletch("bad character in symbol %s",sp->sname);
			putc(*cp++, tout);
		}
		putc('\0', tout);
		if (ferror(tout)) fatal(e14, ofilename);
	}
	fclose(tout);
	fclose(dout);
	if (rflag)
	{
		fclose(trout);
		fclose(drout);
	}
#ifndef Stanford
	if(nund==0)
		chmod(ofilename, 0777);
#endif Stanford
}
/* getfile -	Open an input file as text.  Returns the first word of
		file but leaves the file pointer at zero */
getfile(cp)
register char *cp;	/* name of the file to open */
{
	register int c;
	long magic;
#ifndef Stanford
	char smagic[BKYSARMAG];
#endif Stanford

#ifndef Stanford
	v7_archdr.ar_name[0] = '\0';
	bky_archdr.bky_name[0] = '\0';
#else Stanford
	archdr.ar_name[0] = '\0';
#endif Stanford
	filename = cp;
	text = NULL;
	if (cp[0]=='-' && cp[1]=='l') {
		if(cp[2] == '\0') cp = "-la";

		strcpy(xfilename, ROOT);
		strcat(xfilename,"/lib/lib");
		filename = xfilename;
		strcpy(filename+strlen(xfilename),cp+2);
		strcat(filename,".a");
		if (vflag=='m') {
			mfilename = "/usr/sun/dm/lib/libxxxxxxxxxxxxxxx";
			strcpy(mfilename+19,cp+2);
			strcat(mfilename,".a");
			if ((rtext=fopen(mfilename)) != NULL) {
				fclose(rtext);
				strcpy(filename,mfilename);
			}
		}
		if (vflag=='x') { /* one good kludge deserves another */
			mfilename = "/usr/sun/xlib/libxxxxxxxxxxxxxxx";
			strcpy(mfilename+17,cp+2);
			strcat(mfilename,".a");
			if ((rtext=fopen(mfilename)) != NULL) {
				fclose(rtext);
				strcpy(filename,mfilename);
			}
		}
	}
	strcpy(tfilename,filename);
	{int len = strlen(tfilename);
	 if (len < 3 
	     || tfilename[len-1] != BIN && tfilename[len-1] != 'a'
	     || tfilename[len-2] != '.') {
	    strcat(tfilename,".");
	    strcat(tfilename,BIN);
	  }
	}

	if (text == NULL && (text = fopen(tfilename, "r")) == NULL)
		fatal(e15, filename);
	if ((rtext = fopen(tfilename, "r")) == NULL)
		fatal(e15, filename);
	dread(&magic, sizeof magic, 1, text);
#ifndef Stanford
	fseek(text, 0L, 0);
	if ((magic == FMAGIC) || ((magic>>16) == ARMAG))
		return (magic);
	dread(smagic, sizeof smagic, 1, text);
	if (strcmpn(smagic, BKYARMAG, sizeof smagic) == 0)
		return (BKYARCHIVE);
	fatal(e23, smagic[0], smagic[1], smagic[2], smagic[3]);
#else Stanford
	fseek(text, 0L, 0);	/* reset file pointer */
	return magic == FMAGIC || magic == ARCMAGIC? magic: 0;
#endif Stanford
}

/* lookup -	Returns the pointer into symtab of a symbol with the
		same name cursym.sname or NULL if none.
 */

symp lookup()
{
	return(*hash(cursym.sname));
}

/* hash -	Return a pointer to where in the hash table
		a symbol should go.
*/

symp *hash(s)
char *s;
{
	register int i = 0, cmpv;
	register int initial;
	register char *cp;

	/* Note that assuming the character set is ascii,
	 * the hashing algorithm is case-insentive because of the 0xDF.
	 */
	i = 0;
	for (cp = s; *cp;) i = (i<<1) + ((*cp++) & 0xDF);
	
	initial = i =(i&077777)%NSYM+2;
	while(hshtab[i])
	{
		cmpv = (*mystrcmp)(hshtab[i]->sname, cursym.sname);
		if ((cmpv != 0) || ((hshtab[i]->s.stype & EXTERN) == 0))
		{
			if (++i  == NSYM+2) i = 0;
		}
		else break;
		if (i == initial) fatal(e16);
	}
	return(&hshtab[i]);
}

/* slookup -	Like lookup but with an arbitrary string argument */

symp slookup(s)
char *s;
{
	cursym.sname = s;
	cursym.snlength = strlen(s);
	cursym.s.stype = EXTERN+UNDEF;
	cursym.s.svalue = 0;
	return(lookup());
}

/* enter -	Make sure that cursym is installed in symbol table.
		Called with a pointer to a symbol with the same name
		or NULL if lookup failed.  Returns 1 if the symbol
		was new, or 0 if it was already present.
*/

enter(sp)
register symp sp;
{
	symp *hp;		/* pointer to place in hash table */
	if (sp == NULL)
	{
		hp = hash(cursym.sname);
		if (symindex>=NSYM) fatal(e17);
		lastsym = sp = &symtab[symindex];
		if (*hp) bletch("hash table conflict");
		*hp = sp;
		if((sp->sname = (char *)calloc(1, cursym.snlength+1)) == NULL)
		  fatal(e17);
		strcpy(sp->sname, cursym.sname);
		if (*(sp->sname) == 0) bletch("null symbol entered");
#ifndef Stanford
		sp->snlength = cursym.snlength;
#else Stanford
		sp->s.slength = sp->snlength = cursym.snlength;
#endif Stanford
		sp->s.stype = cursym.s.stype;
		sp->s.svalue = cursym.s.svalue;
		sp->shash = hp;
		sp->sindex = symindex++;
		return(1);
	}
	else 
	{
		lastsym = sp;
		return(0);
	}
}

/* symrel -	Perform partial relocation of symbol.  Each symbol is
		relocated twice.  The first time, it is adjusted to
		is relative position within its segment.  The second
		time, it is adjusted by the start of the final segment
		to which that symbol refers.  This routine only
		performs the first relocation.
 */

symreloc()
{
	switch (cursym.s.stype) {

	case TEXT:
	case EXTERN+TEXT:
		cursym.s.svalue += ctrel;
		return;

	case DATA:
	case EXTERN+DATA:
		cursym.s.svalue += cdrel;
		return;

	case BSS:
	case EXTERN+BSS:
		cursym.s.svalue += cbrel;
		return;

	case EXTERN+UNDEF:
		return;
	}
	if (cursym.s.stype&EXTERN)
		cursym.s.stype = EXTERN+ABS;
}
/* readhdr -	Read in an a.out header, adjusting relocation offsets */
readhdr(pos)
long pos;
{
	register long st, sd;
	fseek(text, pos, 0);
	dread(&filhdr, sizeof filhdr, 1, text);
	if (filhdr.fmagic != FMAGIC)
		fatal(e5a, filename);
	st = (filhdr.tsize+1) & ~1;
	filhdr.tsize = st;
	cdrel = -st;
	sd = (filhdr.dsize+1) & ~1;
	cbrel = - (st + sd);
	filhdr.bsize = (filhdr.bsize+1) & ~1;
}	
/* getsym -	Read in a symbol from txt, leaving data in cursym.  Return
		length of stuff read in. */

long getsym()
{
	register int c;
	register int i;

	/* read upto name */
	fread(&cursym.s, sizeof cursym.s, 1, text);
	if (feof(text)) fatal(e3, filename);
	for (i = 0; i < SYMLENGTH; i++)
	{
		if ((c = getc(text)) == EOF) fatal(e3, filename);
		else if ((csymbuf[i] = c) == 0)
		{
			if ((cursym.snlength = i) == 0) error(e18, filename);
			cursym.sname = csymbuf;
			return(sizeof(cursym.s) + i + 1);
		}
	}
	csymbuf[SYMLENGTH] = '\0';	/* make sure asciz */
	return(sizeof(cursym.s) + i);
}

/* error -	Print out error messages and give up if they are severe. */

/*VARARGS1*/
error(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
	printf("ld68: ");
	printf(fmt, a1, a2, a3, a4, a5);
	printf("\n");
}


/* fatal -	Print error message and exit */

/*VARARGS1*/
fatal(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
	error(fmt, a1, a2, a3, a4, a5);
	exit(1);
}


/* bletch -	Print out a message and abort.  Used for internal errors. */

/*VARARGS1*/
bletch(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
	error(fmt, a1, a2, a3, a4, a5);
	abort();
}
/* dread -	Like fread but checks for errors and eof */

dread(pos, size, count, file)
char *pos;
int size;
int count;
FILE *file;
{
	if (fread(pos, size, count, file) == size * count) return;
	if (feof(file)) fatal(e3, filename);
	if (ferror(file)) fatal(e4, filename);
}


/* dcopy -	Copy input to output, checking for errors */

dcopy(in, out, count)
FILE *in, *out;
long count;
{
	register int c;
	long n = count;
	if (n < 0) bletch("bad count to dcopy");
	while(n--)
	{
		if ((c = getc(in)) == EOF)
		{
			if (feof(in)) fatal(e3, filename);
			if (ferror(out)) fatal(e4, filename);
		}
		putc(c, out);
	}
}

]->s.stype & EXTERN) == 0))
		{
			if (++i  == NSYM+2) i = 0;
		}
		else break;
		if (i == initial) fatal(e16);
	}
	return(&hshtab[i]);
}

/* slookup -	Like lookup but with an arbitrary stringsumacc/cc/ld/ld68.1   444      0     12       12126  3470501561   7147 .TH LD68 1
.SU
.SH NAME
ld68 \- .b -> b.out linker for the MC68000
.SH SYNOPSIS
.B ld68
[ option ] ... file ...
.SH DESCRIPTION
.I Ld68
combines several
object programs into one, resolves external
references, and searches libraries.
In the simplest case several object
.I files
are given, and
.I ld68
combines them, producing
an object module which can be either executed or
become the input for a further
.I ld68
run.
(In the latter case, the
.B \-r
option must be given
to preserve the relocation bits.)\ 
The output of
.I ld68
is left on
.BR b.out .
This file is made executable
only if no errors occurred during the load.
.PP
The argument routines are concatenated in the order
specified.
.PP
The entry point of the output is determined by the first applicable item of the
following list: the \fB\-e\fP option if given, the value of the symbol _start
if defined, or the text origin (first instruction).
.PP
If any argument is a library, it is searched exactly once
at the point it is encountered in the argument list.
Only those routines defining an unresolved external
reference are loaded.
If a routine from a library
references another routine in the library,
the referenced routine must appear after the
referencing routine in the library.
Thus the order of programs within libraries
may be important.
.PP
The symbols `\_etext', `\_edata' and `\_end'
(`etext', `edata' and `end' in C)
are reserved, and if referred to,
are set to the first location above the program,
the first location above initialized data,
and the first location above all data respectively.
It is erroneous to define these symbols.
.PP
.I Ld68
understands several options.
Except for
.BR \-l ,
they should appear before the file names.
.TP
.B \-D
Take the next argument as a decimal number and pad the data segment
with zero bytes to the indicated length.
.TP 
.B  \-d
Force definition of common storage
even if the
.B \-r
flag is present.
.TP
.B \-e
The following argument is taken to be the
name of the entry point of the loaded
program; location 0x1000 is the default.
.TP
.B \-f
Fold case on identifiers.
That is, upper and lower case letters are not distinguished.
Used to link with Pascal routines, for example.
.TP 
.BI \-l x
This
option is an abbreviation for the library name
.RI `/usr/sun/lib/lib x .a',
where
.I x
is a string.
A library is searched when its name is encountered,
so the placement of a
.B  \-l
is significant.
.TP
.BI  \-v x
This denotes board version
.I x
which may at present only be 'm' for Motorola Design Module.  The default board
version is the Sun1 prototype, v1.
.TP
.B  \-M
Create a human-readable list of symbols in ``sym.out''.
.TP
.B  \-n
Arrange (by giving the output file a 0410 "magic number") that
when the output file is executed,
the text portion will be read-only and shared
among all users executing the file.
This involves moving the data areas up to the first
possible 64K byte boundary following the
end of the text 
(not really useful yet).
.TP 
.B  \-o
The
.I name
argument after
.B \-o
is used as the name of the
.I ld68
output file, instead of
.BR b.out .
.TP 
.B \-q
Quicksort symbols in 
.BR b.out 
in ascending numerical order.
.TP
.B  \-r
Generate relocation bits in the output file
so that it can be the subject of another
.I ld68
run.
This flag also prevents final definitions from being
given to common symbols,
and suppresses the `undefined symbol' diagnostics.
.TP
.B \-S
`Strip' the output by removing all symbols except locals and globals.
.TP 
.B  \-s
`Strip' the output, that is, remove the symbol table
and relocation bits to save space (but impair the
usefulness of the debuggers).
This information can also be removed by
.IR  strip (1).
.TP
.B \-T
The next argument is a hexadecimal number which sets the text segment origin.
The default origin is 0x1000.
If you intend to use the output as input to another run of
ld68, you must specify -T 0.
.TP
.B \-B
The next argument is a hexadecimal number which sets the common/bss segment
origin.  The default origin is immediately after the data segment.
.TP 
.B  \-u
Take the following argument as a symbol and enter
it as undefined in the symbol table.  This is useful
for loading wholly from a library, since initially the symbol
table is empty and an unresolved reference is needed
to force the loading of the first routine.
.TP 
.B  \-X
Save local symbols
except for those whose names begin with `L'.
This option is used by
.IR cc (1)
to discard internally-generated labels while
retaining symbols local to routines.
.TP 
.B  \-x
Do not preserve local
(non-.globl) symbols in the output symbol table; only enter
external symbols.
This option saves some space in the output file.
.SH FILES
.ta \w'/usr/local/lib/lib*.a\ \ 'u
/usr/sun/lib/lib*.a	libraries
.br
b.out	output file
.SH "SEE ALSO"
ar(1), cc68(1), a68(1)
.SH BUGS
The b.out format header does not contain any indication of the
text segment origin, so if you specify something other than
the default origin -T 1000, you will have to remember this
value and specify it again to dl68 when you download. The
standard Sun monitor cannot netload files with origins other
than 1000, so you must either use dl68 or write a special
loader for such programs.

	case EXTERN+BSS:
		cursym.s.svalue += cbrel;
		return;

	case EXTERN+UNDEF:
		return;
	}
	if (cursym.s.stype&EXTERN)
		cursym.s.stype = EXTERN+ABS;
}
/* readhdr -	Read in an a.out header, adjusting relocation offsets */
readhdr(pos)
long pos;
{
	register long st, sd;
	fseek(text, pos, 0);
	dread(&filhdr, sizeof filhdr, 1, text);
	if (filhdr.fmagic != FMAGIC)
		fatal(e5a, filename);
	st = (filhdr.tsize+1) & ~1;
	filhdr.tsumacc/cc/ld/lorder68.1   444      0     12        1500  3470501561  10011 .TH LORDER68 1 
.UC 4
.SH NAME
lorder68 \- find ordering relation for an MC68000 object library
.SH SYNOPSIS
.B lorder68
file ...
.SH DESCRIPTION
The input
is one or more object
.I files.
The standard output
is a list of pairs of object file names,
meaning that the first file of the pair refers to
external identifiers defined in the second.
The output may be processed by
.IR  tsort (1)
to find an ordering of
a library suitable for one-pass access by
.IR  ld68 (1).
.PP
This brash one-liner intends to build a new library
from existing `.b' files.
.IP
ar cr library \`\|lorder68 *.b | tsort\`
.SH FILES
*symref, *symdef
.br
nm(1), sed(1), sort(1), join(1)
.SH "SEE ALSO"
tsort(1),
ld68(1),
.SH BUGS
The names of object files, in and out of libraries, must end with `.b';
nonsense results otherwise.
.PP
Doesn't handle libraries.
,
so the placement of a
.B  \-l
is significant.
.TP
.BI  \-v x
This denotes board version
.I x
which may at present only be 'm' for Motorola Design Module.  The default board
version is the Susumacc/cc/ld/lorder68.sh   555      0     12         643  3470501561  10255 #! /bin/sh
trap "rm -f $$sym?ef; exit" 0 1 2 13 15
case $# in
0)	echo usage: lorder68 file ...
	exit ;;
1)	case $1 in
	*.b)	set $1 $1
	esac
esac
nm68 -g -f  $* | sed '
	/^$/d
	/:$/{
		/\.b:/!d
		s/://
		h
		s/.*/& &/
		p
		d
	}
	/[TD] /{
		s/.* //
		G
		s/\n/ /
		w '$$symdef'
		d
	}
	s/.* //
	G
	s/\n/ /
	w '$$symref'
	d
'
sort $$symdef -o $$symdef
sort $$symref -o $$symref
join $$symref $$symdef | sed 's/[^ ]* *//'
ry suitable for one-pass access by
.IR  ld68 (1).
.PP
This brash one-liner intends to build asumacc/cc/ld/nm68.1   444      0     12        2634  3470501561   7145 .TH NM68 1 
.SU
.SH NAME
nm68 \- print name list of MC68000 object files
.SH SYNOPSIS
.B nm68
[
.B \-cgnfopruh
]
[ file ... ]
.SH DESCRIPTION
.I Nm68
prints the name list (symbol table) of each object
.I file
in the argument list.
If an argument
is an archive, a listing for each object
file in the archive will be produced.
.PP
Each symbol name is preceded by its value in hex
and one of the letters
.SM
.B U
(undefined),
.SM
.B A
(absolute),
.SM
.B  T
(text segment symbol),
.SM
.B D
(data segment symbol),
.SM
.B B
(bss segment symbol),
If the symbol is local (non-external) the type letter is in
lower case.
The output is sorted alphabetically.
.PP
Options are:
.TP
.B  \-g
Print only global (external) symbols.
.TP
.B \-n
Sort numerically rather than alphabetically.
.TP
.B \-o
Prepend file or archive element name to each
output line rather than only once.
.TP
.B  \-p
Don't sort; print in symbol-table order.
.TP
.B  \-r
Sort in reverse order.
.TP
.B  \-d
Print only defined symbols.
.TP
.B  \-u
Print only undefined symbols.
.TP
.B \-h
Print values in hex rather than in octal.  (
.B \-x
is a synonym for
.B \-h
\.)
.TP
.B \-c
Print only C-style symbols (those beginning with `~' or `_'.)
.TP
.B \-f
Give the name of each object file as it is processed.  This
implies a
.B \-p
flag.  (If the
.B \-p
flag is not present, nm68 sorts symbols
without regard to which object file they came from.)
.SH SEE ALSO
ar(1), ar(5), b.out(5)
ndefined),
.SM
.B A
(absolute),
.SM
.B  T
(text segment symbol),
.SM
.B D
(data segment symbol),
.SMsumacc/cc/ld/nm68.c   444      0     12       21364  3470501561   7250 #include <stdio.h>
#include "b.out.h"
#include "ar.h"

/*
	nm68	Print symbol table

	Modified: Jeffrey Mogul		10 March 1981
		  added -f flag; prints filenames if
			given multiple files, like nm.c
	Modified: Vaughan Pratt		10 March 1981
		  added archive capability
		  added -o flag analogous to nm's oflag
		  added -d flag
 */


/* type and structure definitions */

typedef struct name_seg *nlink;

struct name_seg
{
	char *nname;	/* pointer to name */
	nlink nnext;	/* next name in list */
};


/* global variables */

int argnum;		/* number of current argument being processed */
nlink namelist = NULL;	/* list of filenames to process */
char *filename;		/* input file name */
FILE *infile;		/* id of input file */
struct bhdr filhdr;	/* header of input file */
char cflag = 0;		/* list only C-style symbols: those beginning with _ */
char gflag = 0;		/* print only external (global) symbols */
char nflag = 0;		/* sort by value instead of name */
char fflag = 0;		/* print filenames if more than one */
char oflag = 0;		/* print filename per symbol */
char pflag = 0;		/* don't sort */
char rflag = 0;		/* sort in reverse order */
char uflag = 0;		/* print only undefined symbols */
char dflag = 0;		/* print only defined symbols */
char hflag = 0;		/* print in hex rather than octal */
long offset = 0;	/* -o option: add offset to value of each symbol */
char *sortname = "/usr/bin/sort";	/* name of command used to sort */

/* Internal functions */

char *nextname();


/* Error Messages */

char *e1 = "filename required following -%c option";
char *e2 = "unrecognized option: %c";
char *e3 = "file %s not found";
char *e4 = "unrecognized magic number %O";
char *e5 = "unrecognized type %o on symbol %s";
char *e6 = "could not reopen pipe as stdout";
char *e7 = "could not reopen pipe as stdin";
char *e8 = "could not exec %s";
char *e9 = "file %s format error, unexpected eof";
char *e10 = "pipe failed";
char *e11 = "dup failed or returned wrong value";
char *e12 = "fork failed";
/*************************************************************************
	main -	process arguments, call major loop and go away
 *************************************************************************/

main(argc, argv)
int argc;
char *argv[];
{
	procargs(argc, argv);
	startup();
	while((filename = nextname()) != NULL) nm();
	cleanup();
	exit(0);
}



/*************************************************************************
	procargs - process command arguments
 *************************************************************************/

procargs(argc, argv)
int argc;
char *argv[];
{
	for (argnum = 1; argnum < argc; argnum++) {
		if (argv[argnum][0] == '-' )
			procflags(&argv[argnum][1], argc, argv);
		else newname(argv[argnum]);
	}
}


/*************************************************************************
	procflags - process flags
 *************************************************************************/

procflags(flagptr, argc, argv)
char *flagptr;
int argc;
char *argv[];
{
	char c;
	while (c = *flagptr++) switch(c)
	{
	case 'c':	cflag++; break;
	case 'd':	dflag++; break;	
	case 'f':	fflag++; pflag++; break;
			/* fflag is useless without pflag */
	case 'g':	gflag++; break;
	case 'n':	nflag++; break;
	case 'o':	oflag++; pflag++; break;
	case 'p':	pflag++; break;
	case 'r':	rflag++; break;
	case 'u':	uflag++; break;	
	case 'x':
	case 'h':	hflag++; break;
	case 'O':	offset = atoi(flagptr); return;
	default:	error(e2, c);
	}
}

/*************************************************************************
	error - type a message on error stream
 *************************************************************************/

/*VARARGS1*/
error(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
	fprintf(stderr, "nm68: ");
	fprintf(stderr, fmt, a1, a2, a3, a4, a5);
	fprintf(stderr, "\n");
}


/*************************************************************************
	fatal - type an error message and abort
 *************************************************************************/

/*VARARGS1*/
fatal(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
	error(fmt, a1, a2, a3, a4, a5);
	exit(1);
}
/*************************************************************************
  startup -	Fork off a trailing process to sort symbols.
 *************************************************************************/

startup()
{
	if (pflag == 0)
	{
		char *option1, *option2;	/* options to sort */
		option1 = (nflag)? "+0": "+2";	/* value or id sort ? */
		option2 = (rflag)? "-r": 0;	/* reverse order? */
		pipeline(sortname, sortname, "-t ", option1, option2, 0);
	}
}



/*************************************************************************
	cleanup	- 
 *************************************************************************/

cleanup()
{
}


/*************************************************************************
  newname -	Attach a new name to the list of names in name list.
 *************************************************************************/

newname(name)
char *name;
{	nlink np1, np2;
	np1 = (nlink)malloc(sizeof(*np1));
	np1->nname = name;
	np1->nnext = NULL;
	if (namelist == NULL) namelist = np1;
	else
	{	np2 = namelist;
		while(np2->nnext != NULL) np2 = np2->nnext;
		np2->nnext = np1;
	}
}


/*************************************************************************
  nextname - 	Return the next name from the list of names being processed.
 *************************************************************************/

char *nextname()
{
	nlink np;
	if (namelist == NULL) return(NULL);
	np = namelist;
	namelist = np->nnext;
	return(np->nname);
}
/*************************************************************************
  pipeline -	Connect a child process stdout via a pipe.
 *************************************************************************/

/* VARARGS */
pipeline(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
{
	int child;			/* proc id of child process */
	int fildes[2];
	
	if (pipe(fildes) < 0) fatal(e10);
	if ((child = fork()) != 0)	/* i am parent */
	{
		if (child < 0) fatal(e12);
		close(0);
		if (dup(fildes[0]) != 0) fatal(e11);
		close(fildes[0]);
		close(fildes[1]);
		execl(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
		fatal(e8);
	}
	else		/* i am child */
	{
		close(1);
		if (dup(fildes[1]) != 1) fatal(e11);
		close(fildes[0]);
		close(fildes[1]);
	}
}
/*************************************************************************
  nm -	Print symbols
 *************************************************************************/

copytospace(a,b) char *a, *b;
{	while (*a != ' ') *b++ = *a++;
	*b++ = 0;
}

nm()
{struct ar_hdr archdr;			/* directory part of archive */
 long position, n;
	if (fflag) {	/* print names of files as they are seen */
	    printf("\n%s:\n",filename);
	    }

	if ((infile = fopen(filename, "r")) == NULL)
	{
		error(e3, filename);
		return;
	}
	fread(&filhdr, sizeof filhdr, 1, infile);
	switch((int)filhdr.fmagic)
	{
	case OMAGIC:
	case FMAGIC:
	case NMAGIC:
	case IMAGIC:
		nmf(SYMPOS,0);
		break;
	case ARCMAGIC:
		position = SARMAG;
		fseek(infile, SARMAG, 0);	/* skip magic */
		while (fread(&archdr, sizeof archdr, 1, infile) &&
			!feof(infile))
		{char arname[50];
			copytospace(archdr.ar_name,arname);
			fread(&filhdr, sizeof filhdr, 1, infile);
/* 			if (fflag)
			   printf("\narchive file %s\n",arname); */
			position += sizeof(archdr);
			nmf(position + SYMPOS,arname);
			sscanf(archdr.ar_size,"%d",&n);
			position += (n+1)&~1;
			fseek(infile, position, 0);
		}
		break;
	default:
		error(e4, filhdr.fmagic);
		return;
	}
	fclose(infile);
}

nmf(sympos,arname) char *arname;
{
	struct sym s;
	char type;
	long pos;
	char symbuf[SYMLENGTH];
	register char *sp;
	register int c;

	fseek(infile, sympos, 0);
        for(pos = 0; pos < filhdr.ssize; pos += sizeof s + strlen(symbuf) + 1)
	{
		fread(&s, sizeof s, 1, infile);
		if (feof(infile)) error(e9, filename);
		for(sp = symbuf; sp < &symbuf[SYMLENGTH - 1]; sp++)
		{
			if ((c = getc(infile)) == EOF)
			{
				error(e9, filename);
				return;
			}
			if (c == 0) break;
			*sp = c;
		}
		*sp = 0;	/* make asciz */
		if (cflag)
		   if (symbuf[0] == '~' || symbuf[0] == '_')
			{
				register char *cp1 = &symbuf[0];
				register char *cp2 = &symbuf[1];
				while (*cp1++ = *cp2++);
				*--cp1 = ' ';
			}
		   else continue;
		if (gflag && (s.stype & EXTERN) == 0) continue;
		if (uflag && (s.stype & 037) != UNDEF) continue;
		if (dflag && (s.stype & 037) == UNDEF) continue;
		switch(s.stype & 037)
		{
		case UNDEF:	type = 'U'; break;
		case ABS:	type = 'A'; break;
		case TEXT:	type = 'T'; break;
		case DATA:	type = 'D'; break;
		case BSS:	type = 'B'; break;
		default:	error(e5, s.stype, symbuf);
		}
		s.svalue += offset;
		if (oflag) 
		   {printf("%s:",filename);
		    if (arname) printf("%s:",arname);
		   }
		if ((s.stype & EXTERN) == 0) type |= 040;
		if (hflag) printf("%06X %c %s\n",(long)s.svalue,type,symbuf);
		else printf("%08O %c %s\n", (long)s.svalue, type, symbuf);
	}
}
name to the list of names in name list.
 *************************************************************************/

newname(name)
char *name;
{	nlink np1, np2;
	np1 = (nlink)malloc(sizeof(*np1));
	np1->nname = name;
	np1->nnext = NULL;
	if (namelist == NULL) namelistsumacc/cc/ld/pagsiz.h   444      0     12         274  3470501561   7717 #define	NBPG	512
#define	PGOFSET	511
#define	CLSIZE	2
#define	CLOFSET	1023
#define	BSIZE	1024
#define	BMASK	1023
#define	BSHIFT	10
#define	PAGSIZ	(NBPG*CLSIZE)
#define	PAGRND	((PAGSIZ)-1)
OS,arname);
			sscanf(archdr.ar_size,"%d",&n);
			position += (n+1)&~1;
			fseek(infile, position, 0);
		}
		break;
	default:
		error(e4, filhdr.fmagic);
		return;
	}
	fclose(infile);
}

nmf(sympos,arname) char *arname;
{
	struct sym s;
	char type;
	long pos;
	char symbuf[SYMLENGTH];
	register char *sp;
	register int c;

	sumacc/cc/ld/pr68.1   444      0     12         453  3470501561   7131 .TH PR68 1 
.SU
.SH NAME
pr68 \- print extended statistics on .b file
.SH SYNOPSIS
.B pr68 file
.SH DESCRIPTION
.I Pr68
prints the header information, symbol table, and relocation commands of a .b
or .68 file.  Verifies that the text and data segments are multiples of 4.
.PP
.SH AUTHOR
C.J. Terman
eak;
	default:
		error(e4, filhdr.fmagic);
		return;
	}
	fclose(infile);
}

nmf(sympos,arname) char *arname;
{
	struct sym s;
	char type;
	long pos;
	char symbuf[SYMLENGTH];
	register char *sp;
	register int c;

	sumacc/cc/ld/pr68.c   444      0     12        5546  3470501562   7244 #include <stdio.h>
#include "b.out.h"

FILE *in;
struct bhdr bhdr;

main(argc,argv) int argc; char *argv[];
  {	if (argc != 2) error('f',"Usage: pr68 filename");
	in = fopen(argv[1],"r");
	if (in == NULL) error('f',"Couldn't open %s for input",argv[1]);
	header();
	text();
	data();
	symbols();
	rtext();
	rdata();
  }

header()
  {	if (fread(&bhdr,sizeof bhdr,1,in) != 1)
	  error('w',"error reading header");
	printf("Magic Number: %ld\n",bhdr.fmagic);
	printf("Text Size: %ld bytes\n",bhdr.tsize);
	printf("Data Size: %ld bytes\n",bhdr.dsize);
	printf("BSS Size: %ld bytes\n",bhdr.bsize);
	printf("Symbol Table Size: %ld bytes\n",bhdr.ssize);
	printf("Text Relocation Size: %ld bytes\n",bhdr.rtsize);
	printf("Data Relocation Size: %ld bytes\n",bhdr.rdsize);
	printf("Entry Location: %ld\n",bhdr.entry);
  }

text()
  {	long i;
	char l[4];
	printf("\nText Segment\n");
	if (bhdr.tsize%4 != 0) error('w',"text size not multiple of 4");
	for (i=0; i<bhdr.tsize; i+=4)
	  {	if (fread(l,sizeof l,1,in) != 1)
			error('w',"read error in text section");
/*		printf("%ld: %3d %3d %3d %3d\n",i,l[0],l[1],l[2],l[3]); */
	  }
  }

data()
  {	long i;
	char l[4];
	printf("\nData Segment\n");
	if (bhdr.tsize%4 != 0) error('w',"data size not multiple of 4");
	for (i=0; i<bhdr.dsize; i+=4)
	  {	if (fread(l,sizeof l,1,in) != 1)
			error('w',"read error in text section");
/*		printf("%ld: %3d %3d %3d %3d\n",i,l[0],l[1],l[2],l[3]); */
	  }
  }

symbols()
  {	short count = 0;
	long i;
	struct sym sym;
	char s[SYMLENGTH],*sp;
	printf("\nSymbol Table\n");
	for (i=0; i < bhdr.ssize; i+=sizeof sym)
	  {	if (fread(&sym,sizeof sym,1,in) != 1)
			error('w',"read error in symbol table section");
		for (sp=s; *sp = getc(in); sp++) i++;
		i++;
		printf("%d: %c%c %ld %s\n",count++,
		  " E??????"[sym.stype/040],
		  "UATDBCR?????????????????????????"[sym.stype&037],
		  sym.svalue,s);
	  }
  }

rtext()
  {	long i;
	struct reloc reloc;
	printf("\nText Relocation Commands\n");
	for (i=0; i<bhdr.rtsize; i+=sizeof reloc)
	  {	if (fread(&reloc,sizeof reloc,1,in) != 1)
			error('w',"error reading text relocation commands");
		printf("%c %c %c %d %ld\n","TDBE"[reloc.rsegment],
		  "BWL?"[reloc.rsize]," D"[reloc.rdisp],reloc.rsymbol,
		  reloc.rpos);
	  }
  }

rdata()
  {	long i;
	struct reloc reloc;
	printf("\nData Relocation Commands\n");
	for (i=0; i<bhdr.rdsize; i+=sizeof reloc)
	  {	if (fread(&reloc,sizeof reloc,1,in) != 1)
			error('w',"error reading data relocation commands");
		printf("%c %c %c %d %ld\n","TDBE"[reloc.rsegment],
		  "BWL?"[reloc.rsize]," D"[reloc.rdisp],reloc.rsymbol,
		  reloc.rpos);
	  }
  }

/* VARAGRS 2 */
error(t,s,a,b,c,d,e,f,g,h,i,j) char t; char *s;
  {	fprintf(stderr,"pr68: ");
	fprintf(stderr,s,a,b,c,d,e,f,g,h,i,j);
	fprintf(stderr,"\n");
	switch (t)
	  { case 'w':	return;
	    case 'f':	exit(1);
	    case 'a':	abort();
	    default:	error('w',"Illegal error type: '%c'",t);
	  }
  }

arent */
	{
		if (child < 0) fatal(e12);
		close(0);
		if (dup(fildes[0]) != 0) fatal(e11);
		close(fildes[0]);
		close(fildes[1]);
		execl(a0, a1, a2, a3sumacc/cc/ld/ranlib68.c   444      0     12       13170  3470501562  10102 /*
 * ranlib - create table of contents for archive; string table version
 * Version hacked up to handle 68000 .b files
 * Per Bothner. May 1983.
 */
#include <sys/types.h>
#include <ar.h>
#include <ranlib.h>
#include "pagsiz.h"
#include <b.out.h>
#undef OMAGIC
#undef NMAGIC
#undef FMAGIC
#undef IMAGIC
#include <a.out.h>
/* Note that OMAGIC in a.out.h is 0407 and in b.out.h is 0405 ! */
#include <stdio.h>

struct	ar_hdr	archdr;
#define	OARMAG 0177545
long	arsize;
struct	exec	exp;
FILE	*fi, *fo;
long	off, oldoff;
long	atol(), ftell();
#define TABSZ	5000
struct	ranlib tab[TABSZ];
int	tnum;
#define	STRTABSZ	75000
char	tstrtab[STRTABSZ];
int	tssiz;
char	*strtab;
int	ssiz;
int	new;
char	tempnm[] = "__.SYMDEF";
char	firstname[17];

main(argc, argv)
char **argv;
{
	char cmdbuf[BUFSIZ];
	char magbuf[SARMAG+1];

	--argc;
	while(argc--) {
		fi = fopen(*++argv,"r");
		if (fi == NULL) {
			fprintf(stderr, "ranlib: cannot open %s\n", *argv);
			continue;
		}
		off = SARMAG;
		fread(magbuf, 1, SARMAG, fi);
		if (strncmp(magbuf, ARMAG, SARMAG)) {
			if (*(int *)magbuf == OARMAG)
				fprintf(stderr, "old format ");
			else
				fprintf(stderr, "not an ");
			fprintf(stderr, "archive: %s\n", *argv);
			continue;
		}
		fseek(fi, 0L, 0);
		new = tnum = 0;
		if (nextel(fi) == 0) {
			fclose(fi);
			continue;
		}
		do { /* for each component ... */
			long o;

			fread((char *)&exp, 1, sizeof(struct exec), fi);
			if (N_BADMAG(exp))
				continue;
			if (exp.a_syms == 0) {
				fprintf(stderr, "ranlib: warning: %s(%s): no symbol table\n", *argv, archdr.ar_name);
				continue;
			}
			o = N_STROFF(exp) - sizeof (struct exec);
			if (strcmp(archdr.ar_name+strlen(archdr.ar_name)-2,
			           ".o"))
				 parse_b_out_syms();
			else if (ftell(fi)+o+sizeof(ssiz) >= off) {
				fprintf(stderr, "ranlib: %s(%s): old format .o file\n", *argv, archdr.ar_name);
				exit(1);
			}
			else { fseek(fi, o, 1); parse_a_out_syms(); }
		} while(nextel(fi));
		new = fixsize();
		fclose(fi);
		fo = fopen(tempnm, "w");
		if(fo == NULL) {
			fprintf(stderr, "can't create temporary\n");
			exit(1);
		}
		tnum *= sizeof (struct ranlib);
		fwrite(&tnum, 1, sizeof (tnum), fo);
		tnum /= sizeof (struct ranlib);
		fwrite((char *)tab, tnum, sizeof(struct ranlib), fo);
		fwrite(&tssiz, 1, sizeof (tssiz), fo);
		fwrite(tstrtab, tssiz, 1, fo);
		fclose(fo);
		if(new)
			sprintf(cmdbuf, "ar rlb %s %s %s\n", firstname, *argv, tempnm);
		else
			sprintf(cmdbuf, "ar rl %s %s\n", *argv, tempnm);
		if(system(cmdbuf))
			fprintf(stderr, "ranlib: ``%s'' failed\n", cmdbuf);
		else
			fixdate(*argv);
		unlink(tempnm);
	}
	exit(0);
}

parse_a_out_syms()
  {
    register n;
    struct nlist sym;
	fread((char *)&ssiz, 1, sizeof (ssiz), fi);
	strtab = (char *)calloc(1, ssiz);
	if (strtab == 0) {
		fprintf(stderr, "ranlib: ran out of memory\n");
		exit(1);
	}
	fread(strtab+sizeof(ssiz), ssiz - sizeof(ssiz), 1, fi);
	fseek(fi, -(exp.a_syms+ssiz), 1);
	n = exp.a_syms / sizeof(struct nlist);
	while (--n >= 0) {
		fread((char *)&sym, 1, sizeof(sym), fi);
		if (sym.n_un.n_strx == 0)
			continue;
		sym.n_un.n_name = strtab + sym.n_un.n_strx;
		if ((sym.n_type&N_EXT)==0)
			continue;
		if (sym.n_type&N_TYPE != N_UNDF || sym.n_value!=0)
		    stash(sym.n_un.n_name);
		}
 }

parse_b_out_syms()
  {
    struct sym bsym;
#define filhdr (*(struct bhdr *)&exp)
    fseek(fi, SYMPOS - TEXTPOS, 1);
    while (exp.a_syms > 0)
      {
	fread(&bsym, sizeof(bsym), 1, fi); exp.a_syms -= sizeof(bsym);
	if (tssiz + bsym.slength >= STRTABSZ)
	  {
	    fprintf(stderr, "ranlib: string table overflow\n");
	    exit(1);
	  }
	fread(tstrtab + tssiz, bsym.slength, 1, fi);
	exp.a_syms -= bsym.slength;
	getc(fi); exp.a_syms--; /* skip null byte */
	if (bsym.stype & EXTERN && (bsym.stype & 0xF || bsym.svalue))
	  {
	    if (tnum >= TABSZ) 
	      {
		    fprintf(stderr, "ranlib: symbol table overflow\n");
		    exit(1);
	      }
	    tab[tnum].ran_un.ran_strx = tssiz;
	    tab[tnum].ran_off = oldoff;
	    tnum++;
	    tssiz += bsym.slength;
	    tstrtab[tssiz++] = 0;
	  }
      }
  }

nextel(af)
FILE *af;
{
    register r;
    register char *cp;
    oldoff = off;
    fseek(af, off, 0);
    r = fread((char *)&archdr, 1, sizeof(struct ar_hdr), af);
    if (r != sizeof(struct ar_hdr))
	return(0);
    for (cp=archdr.ar_name; cp < & archdr.ar_name[sizeof(archdr.ar_name)]; cp++)
	if (*cp == ' ')
	    *cp = '\0';
    archdr.ar_name[sizeof(archdr.ar_name)] = 0;
    arsize = atol(archdr.ar_size);
    if (arsize & 1)
	arsize++;
    off = ftell(af) + arsize;
    return(1);
}

stash(s)
    register char *s;
{
	int i;

	if(tnum >= TABSZ) {
		fprintf(stderr, "ranlib: symbol table overflow\n");
		exit(1);
	}
	tab[tnum].ran_un.ran_strx = tssiz;
	tab[tnum].ran_off = oldoff;
	while (tstrtab[tssiz++] = *s++)
		if (tssiz > STRTABSZ) {
			fprintf(stderr, "ranlib: string table overflow\n");
			exit(1);
		}
	tnum++;
}

fixsize()
{
    int i;
    off_t offdelta;

    if (tssiz&1)
	tssiz++;
    offdelta = sizeof(archdr) + sizeof (tnum) + tnum * sizeof(struct ranlib) +
	sizeof (tssiz) + tssiz;
    off = SARMAG;
    nextel(fi);
    if(strncmp(archdr.ar_name, tempnm, sizeof (archdr.ar_name)) == 0) {
	new = 0;
	offdelta -= sizeof(archdr) + arsize;
    } else {
	new = 1;
	strncpy(firstname, archdr.ar_name, sizeof(archdr.ar_name));
    }
    for(i=0; i<tnum; i++)
	tab[i].ran_off += offdelta;
    return(new);
}

/* patch time */
fixdate(s)
	char *s;
{
	long time();
	char buf[24];
	int fd;

	fd = open(s, 1);
	if(fd < 0) {
		fprintf(stderr, "ranlib: can't reopen %s\n", s);
		return;
	}
	sprintf(buf, "%-*ld", sizeof(archdr.ar_date), time((long *)NULL)+5);
	lseek(fd, (long)SARMAG + ((char *)archdr.ar_date-(char *)&archdr), 0);
	write(fd, buf, sizeof(archdr.ar_date));
	close(fd);
}
e+strlen(archdr.ar_name)-2,
			           ".o"))
				 parse_b_out_syms();
			else if (ftell(fi)+o+sizeof(ssiz) >= off) {
				fprintf(stderr, "ranlib: %s(%s): old format .o file\n", *argv, archdr.ar_name);
				exit(1);
			}
			else { fseek(fi, o, 1); parse_a_out_syms(); }
		} while(nextel(fi));
		new = fixsize();
		fclose(fi);
		fo = fopen(tempnm, "w");
		if(fo == NULL) {
			fprintf(stderr,sumacc/cc/ld/rev68.1   444      0     12        2360  3470501562   7324 .TH REV68 1 
.SU
.SH NAME
rev68 \- reverse byte order in 68000 .b and .68 (b.out) files
.SH SYNOPSIS
.B rev68 infile [ outfile ... ]
.SH DESCRIPTION
.I Rev68
translates .b and .68 (b.out) files into a form readable by the 68000.  This
entails reversing the byte order within short and long words, and rearranging
structs to agree with the c68 interpretation of structs.
.PP
The transformations that take place are:  the 8 longs in the header (including
the magic number) are each byte reversed; the text and data segments are
unchanged; the symbol segment is modified so that the struct defining the type
and value of the symbol fits in 6 bytes instead of 8 (to agree with the c68
interpretation of struct sym in /usr/sun/ld68/b.out.h); each symbol is
padded with an extra 0 if necessary to force word alignment; and the relocation
commands are repacked to agree with the c68 interpretation of struct reloc in
/usr/sun/ld68/b.out.h.
.PP
The output is written to outfile, which if not specified defaults to r.out.
The output will be smaller than the input unless there are no symbols or
relocation commands.
.PP
The intent is that r.out files not be the input to any Unix program, but that
they be sent directly to the 68000 as a byte stream.
.SH AUTHOR
V.R. Pratt
    return(new);
}

/* patch time */
fixdate(s)
	char *s;
{
	long time();
	char buf[24];
	int fd;

	fd = open(s, 1);
	if(fd < 0) {
		fprintf(stderr, "ranlib: can't reopen %s\n", s);
		return;
	}
	sprintf(buf, "%-*ld", sizeof(archdr.ar_date), time((long *)NULL)+5);
	lseek(sumacc/cc/ld/rev68.c   544      0     12        7505  3470501562   7415 /* Reformat b.out file so that longs are byte-reversed to permit convenient
reading by the 68000.  Relocation commands are fixed to agree with the c68
convention for packing fields, to permit reuse of struct reloc.

   Author: V.R. Pratt
   Date:   March, 1981
*/

#include "b.out.h"
#include <stdio.h>

struct sym68 {			/* fake sym for 68000 */
	short dummy1;		/* ignored */
	char stype;		/* type */
	char slength;		/* length */
	long svalue;
};

struct reloc68 {		/* fake reloc for 68000 */
	unsigned dummy1:3;		/* to complete the byte */
	unsigned rdisp:1;		/* 1 => a displacement */
	unsigned rsize:2;		/* RBYTE, RWORD, or RLONG */
	unsigned rsegment:2;	/* RTEXT, RDATA, RBSS, or REXTERN */
	char dummy2;		/* needs to be zero */
	short rsymbol;		/* id of the symbol of external relocations */
	long rpos;		/* position of relocation in segment */
};

reverse(lwrd) unsigned lwrd;
 {return((lwrd>>24)	     |
	 (lwrd>>8 & 0xff00)  |
	 (lwrd<<8 & 0xff0000)|
	 (lwrd<<24)
	);
 }

sreverse(wrd) unsigned wrd;
 {return((wrd>>8 & 0xff)    |
	 (wrd<<8 & 0xff00)
	);
 }

#define RCDSIZE 256

outbin(file,size,ofile)
FILE *file, *ofile;
{
int count,			/* counts total number of bytes processed*/
    Dcount;			/* number of bytes in current record */
char buffer[RCDSIZE];		/* buffer for data */
    for(count=0; count<size; count += RCDSIZE) 
	{Dcount= (size-count<RCDSIZE) ? size-count : RCDSIZE;
	 if(fread(buffer,Dcount,1,file) != 1)
	     {printf("Read error\n"); exit(1);}
	 fwrite(buffer,Dcount,1,ofile);
	}
}

struct reloc relcom; 
struct reloc68 orelcom;

main(argc,argv)
int argc;
char *argv[];
{
struct bhdr filhdr, nfilhdr;
FILE *infile, *outfile;
char filename[30], ofilename[30];
int i;
struct sym s; struct sym68 s68; char c; int pos, poso=0;

    if(argc<2)
	{printf("Usage: rev68 filename [ outfile ]\n"); /* Default: r.out */
	 exit(1);
	}
    strcpy(filename,argv[1]);   			/* extract file name */
    if((infile=fopen(filename,"r"))==NULL)		 /* open object file*/
       {strcat(filename,".68");     			 /* try .68 form */
	if ((infile=fopen(filename,"r"))==NULL) 
           {printf("rev68: Can't open %s\n",filename);
	    exit(1);
	   }
       }
    if(fread(&filhdr, sizeof(struct bhdr),1,infile) != 1)
	{printf("rev68: %s wrong format\n",filename);/*get header information*/
	 exit(1);
	}
    if(filhdr.fmagic != FMAGIC && filhdr.fmagic != NMAGIC) /* check magic number */
	{printf("rev68: %s not proper .68 file\n",filename); exit(1);}
    if (argc >= 3) strcpy(ofilename, argv[2]);
    else strcpy(ofilename, "r.out");
    if ((outfile = fopen(ofilename,"w")) == NULL)
       {printf("rev68: Can't write %s\n", ofilename);
	exit(1);
       }
    {int n, *hdr = (int*)&filhdr, *nhdr = (int*)&nfilhdr;
     for (n=0; n<8; n++) *nhdr++ = reverse(*hdr++); /* even reverse magic */
    }
    fwrite(&nfilhdr, sizeof(struct bhdr), 1, outfile);
    outbin(infile, filhdr.tsize + filhdr.dsize, outfile);
     for (pos=0; pos < filhdr.ssize; )
       {if (!fread(&s,sizeof s,1,infile)) break;/* Get symbol descriptor */
	pos += sizeof s;
	s68.stype = s.stype;
	s68.slength = s.slength;
	s68.svalue = reverse(s.svalue);
	fwrite((int)&s68+2,6,1,outfile);
	poso += 6;
	while (c = getc(infile)) 
	      {putc(c, outfile);
	       pos++; poso++;
	      }
	putc(0, outfile);
	pos++; poso++;
	if (poso&1) 
	   {putc(0, outfile);		/* word align for 68000 */
	    poso++;
	   }
       }
     while (fread(&relcom, sizeof relcom,1,infile))
	  {orelcom.rdisp = relcom.rdisp;
	   orelcom.rsize = relcom.rsize;
	   orelcom.rsegment = relcom.rsegment;
	   orelcom.rsymbol = sreverse(relcom.rsymbol);
	   orelcom.rpos = reverse(relcom.rpos);
	   orelcom.dummy1 = 0;
	   orelcom.dummy2 = 0;
	   fwrite(&orelcom, sizeof orelcom, 1, outfile);
	  }
    poso = reverse(poso);
    fseek(outfile, 16, 0);
    fwrite(&poso, sizeof poso, 1, outfile);	/* adjust filhdr.ssize */
    fclose(infile);
    fclose(outfile);
}



ake sym for 68000 */
	short dummy1;		/* ignored */
	char stype;		/* type */
	char slength;		/* length */
	long svalue;
};

struct reloc68 {		/* fake reloc for 68000 */
	unsigned dummy1:3;sumacc/cc/ld/rl68.1   444      0     12        2124  3470501562   7143 .TH RL68 1 
.SU
.SH NAME
rl68 \- print relocation commands in a .b file for the 68000
.SH SYNOPSIS
.B rl68 infile
.SH DESCRIPTION
.I Rl68
prints the relocation commands in a 68000 .b file.  The format for each command
is:
.PP
AREA SEGMENT SIZE   Displacement  Symbol
.PP
The AREA is one of T or D according to whether the command acts on Text or
Data.  The SEGMENT is one of T, D, B, or E, according to whether the object
linked to is in Text, Data, or Bss, or is External.  The SIZE is one of B, W,
or L, according to whether the object linked to is of size Byte, Word, or Long.
The Displacement indicates where in the AREA the command is to be applied.  The
Symbol is the symbolic name of the object linked to if any.
.PP
The correspondence with struct reloc (defined in /usr/sun/ld68/b.out.h) is as
follows.  SEGMENT is rsegment and SIZE is rsize.  Displacement is rdisp.
Symbol is determined from rsymbol, a short which is the symbol id.  AREA is
determined by the area in which the relocation command is found, there being
two such areas.
.SH RELATED
nm68, size68, pr68, lorder68
.SH AUTHOR
C.J. Terman
)
FILE *file, *ofile;
{
int count,			/* counts total number of bytes processed*/
    Dcount;			/* number of bytes in current record */
char buffer[RCDSIZE];		/* buffer for data */
    for(count=0; count<size; count += RCDSIZE) 
	{Dcount= (size-count<RCDSIZE) ? size-count : RCDSIZE;
	 if(fread(buffer,Dcount,1,file) != 1)
	     {printf("Read error\n"); exit(1);}
	 fwrite(buffer,Dcount,1,ofile);
	}
}

struct reloc relcom; 
strusumacc/cc/ld/rl68.c   444      0     12       17312  3470501562   7252 #include <stdio.h>
#include "b.out.h"

/*
	rl68 -	Print relocation commands
 */

#define NSYM	1000	/* number of symbols */


/* type and structure definitions */

struct symbol
{
	struct sym s;
	char *sname;
	int snlength;
};

typedef struct symbol *symp;

typedef struct name_seg *nlink;

struct name_seg
{
	char *nname;	/* pointer to name */
	nlink nnext;	/* next name in list */
};


/* global variables */

struct symbol symtab[NSYM];
int nextsym = 0;	/* next free slot in symbol table */
int argnum;		/* number of current argument being processed */
nlink namelist = NULL;	/* list of filenames to process */
char *filename;		/* input file name */
FILE *infile;		/* id of input file */
struct bhdr filhdr;	/* header of input file */
char cflag = 0;		/* list only C-style symbols: those beginning with _ */
char gflag = 0;		/* print only external (global) symbols */
char nflag = 0;		/* sort by value instead of name */
char pflag = 0;		/* don't sort */
char rflag = 0;		/* sort in reverse order */
char uflag = 0;		/* print only undefined symbols */
char *sortname = "/bin/sort";	/* name of command used to sort */

/* Internal functions */

char *nextname();


/* Error Messages */

char *e1 = "filename required following -%c option";
char *e2 = "unrecognized option: %c";
char *e3 = "file %s not found";
char *e4 = "unrecognized magic number %O";
char *e5 = "unrecognized type %o on symbol %s";
char *e6 = "could not reopen pipe as stdout";
char *e7 = "could not reopen pipe as stdin";
char *e8 = "could not exec %s";
char *e9 = "file %s format error, unexpected eof";
char *e10 = "pipe failed";
char *e11 = "dup failed or returned wrong value";
char *e12 = "fork failed";
char *e13 = "symbol table overflow";
/*************************************************************************
	main -	process arguments, call major loop and go away
 *************************************************************************/

main(argc, argv)
int argc;
char *argv[];
{
	procargs(argc, argv);
	startup();
	while((filename = nextname()) != NULL)
	{
		if ((infile = fopen(filename, "r")) == NULL)
		{
			error(e3, filename);
			continue;
		}
		fread(&filhdr, sizeof filhdr, 1, infile);
		switch((int)filhdr.fmagic)
		{
		case FMAGIC:
		case NMAGIC:
			break;
		default:
			error(e4, filhdr.fmagic);
			continue;
		}
		getsyms();
		printcmds();
		fclose(infile);
	}
	cleanup();
	exit(0);
}



/*************************************************************************
	procargs - process command arguments
 *************************************************************************/

procargs(argc, argv)
int argc;
char *argv[];
{
	for (argnum = 1; argnum < argc; argnum++) {
		if (argv[argnum][0] == '-' )
			procflags(&argv[argnum][1], argc, argv);
		else newname(argv[argnum]);
	}
}


/*************************************************************************
	procflags - process flags
 *************************************************************************/

procflags(flagptr, argc, argv)
char *flagptr;
int argc;
char *argv[];
{
	char c;
	while (c = *flagptr++) switch(c)
	{
	default:	error(e2, c);
	}
}

/*************************************************************************
	error - type a message on error stream
 *************************************************************************/

/*VARARGS1*/
error(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
	fprintf(stderr, "rl68: ");
	fprintf(stderr, fmt, a1, a2, a3, a4, a5);
	fprintf(stderr, "\n");
}


/*************************************************************************
	fatal - type an error message and abort
 *************************************************************************/

/*VARARGS1*/
fatal(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
	error(fmt, a1, a2, a3, a4, a5);
	exit(1);
}
/*************************************************************************
  startup -	Fork off a trailing process to sort symbols.
 *************************************************************************/

startup()
{
}



/*************************************************************************
	cleanup	- 
 *************************************************************************/

cleanup()
{
}


/*************************************************************************
  newname -	Attach a new name to the list of names in name list.
 *************************************************************************/

newname(name)
char *name;
{	nlink np1, np2;
	np1 = (nlink)malloc(sizeof(*np1));
	np1->nname = name;
	np1->nnext = NULL;
	if (namelist == NULL) namelist = np1;
	else
	{	np2 = namelist;
		while(np2->nnext != NULL) np2 = np2->nnext;
		np2->nnext = np1;
	}
}


/*************************************************************************
  nextname - 	Return the next name from the list of names being processed.
 *************************************************************************/

char *nextname()
{
	nlink np;
	if (namelist == NULL) return(NULL);
	np = namelist;
	namelist = np->nnext;
	return(np->nname);
}
/*************************************************************************
  pipeline -	Connect a child process stdout via a pipe.
 *************************************************************************/

/* VARARGS */
pipeline(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
{
	int child;			/* proc id of child process */
	int fildes[2];
	
	if (pipe(fildes) < 0) fatal(e10);
	if ((child = fork()) != 0)	/* i am parent */
	{
		if (child < 0) fatal(e12);
		close(0);
		if (dup(fildes[0]) != 0) fatal(e11);
		close(fildes[0]);
		close(fildes[1]);
		execl(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
		fatal(e8);
	}
	else		/* i am child */
	{
		close(1);
		if (dup(fildes[1]) != 1) fatal(e11);
		close(fildes[0]);
		close(fildes[1]);
	}
}
/*************************************************************************
	getsyms -	Read in the symbol table.
 *************************************************************************/

getsyms()
{
	struct sym s;
	char type;
	long pos;
	char symbuf[SYMLENGTH];
	struct symbol *sp;
	register char *scp;
	register int c;
	int slength;

	fseek(infile, (long)(SYMPOS), 0);
	for(pos = 0; pos < filhdr.ssize; pos += sizeof(sp->s) + slength + 1)
	{
		if (nextsym >= NSYM) error(e13);
		sp = &symtab[nextsym++];
		fread(&sp->s, sizeof sp->s, 1, infile);
		if (feof(infile)) error(e9, filename);
		slength = 0;
		for(scp = symbuf; scp < &symbuf[SYMLENGTH - 1]; scp++)
		{
			if ((c = getc(infile)) == EOF)
			{
				error(e9, filename);
				return;
			}
			if (c == 0) break;
			*scp = c;
			slength++;
		}
		*scp = 0;	/* make asciz */
		sp->snlength = slength;
		sp->sname = (char*)calloc(1, slength+1);
		strcat(sp->sname, symbuf);
	}
}
/*************************************************************************
  printcmds -	Print relocation commands.
 *************************************************************************/

printcmds()
{
	long size;
	struct reloc rcmd;

	fseek(infile, RTEXTPOS, 0);
	for (size = 0; size < filhdr.rtsize; size += sizeof(rcmd)) cmd('T');
	fseek(infile, RDATAPOS, 0);
	for (size = 0; size < filhdr.rdsize; size += sizeof(rcmd)) cmd('D');
}


/*************************************************************************
  cmd -		Read and print one command.
 *************************************************************************/

cmd(area)
int area;
{
	struct reloc rcmd;
	char seg, size;
	char *sym;
	char idbuf[100];

	fread(&rcmd, sizeof(rcmd), 1, infile);
	if (feof(infile)) error(e9, filename);
	if (ferror(infile)) error(e9, filename);
	seg = "TDBE"[rcmd.rsegment];
	size = "BWL?"[rcmd.rsize];
	if (seg == 'E')
	{
		if (rcmd.rsymbol >= 0 && rcmd.rsymbol < nextsym)
			sym = symtab[rcmd.rsymbol].sname;
		else
		{
			sprintf(idbuf,"??????? bad symbol id %d",rcmd.rsymbol);
			sym = idbuf;
		}
		printf("%c %c %c %011O %s\n",area,seg,size,rcmd.rpos,sym);
	}
	else printf("%c %c %c %011O\n", area, seg, size, rcmd.rpos);
}

*******************************************
  startup -	Fork off a trailing process to sort symbols.
 *************************************************************************/

startup()
{
}



/*************************************************************************
	cleanup	- 
 ***************************sumacc/cc/ld/size68.1   444      0     12        1136  3470501563   7503 .TH SIZE68 1 
.SU
.SH NAME
size68 \- prints sizes of segments in a .b or .68 file
.SH SYNOPSIS
.B size68 [ -hl ] file
.SH DESCRIPTION
.I Size68
prints the sizes of the text, data, and bss segments of a .b or .68 file, in
decimal; the total size is also given in both decimal and octal.  The -h
flag causes the sizes to be given in hexadecimal.  The -l flag causes a
complete printout in decimal (hex if -h is given) of the values of the 8
header words, namely the magic number, the sizes of the three segments, the
size of the symbol table, and the sizes of the relocation commands.
.SH AUTHOR
C.J. Terman

.B size68 [ -hl ] file
.SH DESCRIPTION
.I Size68
prints the sizes of the text, data, and bss segments of a .b or .68 file, in
decimal; the total size is also given in both decimal and octal.  The -h
flag causes the sizes to be given in hexadecimal.  The -l flag causes a
complete printout in decimal (hex if -h is given) of the values of the 8
header words, namely the magic number, the sizes of the three segments, tsumacc/cc/ld/size68.c   444      0     12       14574  3470501563   7617 #include <stdio.h>
#include "b.out.h"

/*
	sizer68	[-hl]	<file1> ... <filen>	Print sizes of segments.
	-h	print in hex format
	-l	print long format
 */


/* type and structure definitions */

typedef struct name_seg *nlink;

struct name_seg
{
	char *nname;	/* pointer to name */
	nlink nnext;	/* next name in list */
};


/* global variables */

int argnum;		/* number of current argument being processed */
nlink namelist = NULL;	/* list of filenames to process */
char *filename;		/* input file name */
FILE *infile;		/* id of input file */
char hflag = 0;		/* print in hex */
char lflag = 0;		/* print long form */
char nflag = 0;		/* print names of files */
char rflag = 0;		/* .r file */
struct bhdr filhdr;	/* header of input file */

/* Internal functions */

char *nextname();


/* Error Messages */

char *e1 = "filename required following -%c option";
char *e2 = "unrecognized option: %c";
char *e3 = "file %s not found";
char *e4 = "unrecognized magic number %O";
char *e5 = "unrecognized type %o on symbol %s";
char *e6 = "could not reopen pipe as stdout";
char *e7 = "could not reopen pipe as stdin";
char *e8 = "could not exec %s";
char *e9 = "file %s format error, unexpected eof";
char *e10 = "pipe failed";
char *e11 = "dup failed or returned wrong value";
char *e12 = "fork failed";
/*************************************************************************
	main -	process arguments, call major loop and go away
 *************************************************************************/

main(argc, argv)
int argc;
char *argv[];
{
	procargs(argc, argv);
	startup();
	while((filename = nextname()) != NULL) size();
	cleanup();
	exit(0);
}



/*************************************************************************
	procargs - process command arguments
 *************************************************************************/

procargs(argc, argv)
int argc;
char *argv[];
{
	if (argc > 2)
		nflag = 1;
	for (argnum = 1; argnum < argc; argnum++) {
		if (argv[argnum][0] == '-' )
			procflags(&argv[argnum][1], argc, argv);
		else newname(argv[argnum]);
	}
}


/*************************************************************************
	procflags - process flags
 *************************************************************************/

procflags(flagptr, argc, argv)
char *flagptr;
int argc;
char *argv[];
{
	char c;
	while (c = *flagptr++) switch(c)
	{
	case 'h':	hflag = 1; break;
	case 'l':	lflag = 1; break;
	case 'n':	nflag = 1; break;
	default:	error(e2, c);
	}
}

/*************************************************************************
	error - type a message on error stream
 *************************************************************************/

/*VARARGS1*/
error(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
	fprintf(stderr, "size68: ");
	fprintf(stderr, fmt, a1, a2, a3, a4, a5);
	fprintf(stderr, "\n");
}


/*************************************************************************
	fatal - type an error message and abort
 *************************************************************************/

/*VARARGS1*/
fatal(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
	error(fmt, a1, a2, a3, a4, a5);
	exit(1);
}
/*************************************************************************
  startup -	Fork off a trailing process to sort symbols.
 *************************************************************************/

startup()
{
}



/*************************************************************************
	cleanup	- 
 *************************************************************************/

cleanup()
{
}


/*************************************************************************
  newname -	Attach a new name to the list of names in name list.
 *************************************************************************/

newname(name)
char *name;
{	nlink np1, np2;
	np1 = (nlink)malloc(sizeof(*np1));
	np1->nname = name;
	np1->nnext = NULL;
	if (namelist == NULL) namelist = np1;
	else
	{	np2 = namelist;
		while(np2->nnext != NULL) np2 = np2->nnext;
		np2->nnext = np1;
	}
}


/*************************************************************************
  nextname - 	Return the next name from the list of names being processed.
 *************************************************************************/

char *nextname()
{
	nlink np;
	if (namelist == NULL) return(NULL);
	np = namelist;
	namelist = np->nnext;
	return(np->nname);
}
/*************************************************************************
  size -	Print segment sizes
 *************************************************************************/

size()
{
	long t;

	if ((infile = fopen(filename, "r")) == NULL)
	{
		error(e3, filename);
		return;
	}
	fread(&filhdr, sizeof filhdr, 1, infile);
	switch(filhdr.fmagic) {
		default:
			rflag++;
			switch(reverse(filhdr.fmagic)) {
				case OMAGIC:
				case FMAGIC:
				case NMAGIC:
				case IMAGIC:
						break;
				default:

						error(e4, filhdr.fmagic);
						fclose(infile);
						return;
			}
		case OMAGIC:
		case FMAGIC:
		case NMAGIC:
		case IMAGIC:
				break;
	}

	t = 	  reverse(filhdr.tsize) 
		+ reverse(filhdr.dsize) 
		+ reverse(filhdr.bsize);
	if (nflag)
	{
		printf("%s: ", filename);
		if (lflag)
			printf("\n");
	}
	if (hflag)
	{
		if (lflag)
		{
			printf("fmagic:\t0%O\n", filhdr.fmagic);
			printf("tsize:\t0x%X\n", reverse(filhdr.tsize));
			printf("dsize:\t0x%X\n", reverse(filhdr.dsize));
			printf("bsize:\t0x%X\n", reverse(filhdr.bsize));
			printf("ssize:\t0x%X\n", reverse(filhdr.ssize));
			printf("rtsize:\t0x%X\n", reverse(filhdr.rtsize));
			printf("rdsize:\t0x%X\n", reverse(filhdr.rdsize));
			printf("entry:\t0x%X\n", reverse(filhdr.entry));
		}
		else printf("0x%X+0x%X+0x%X = %D = 0x%X\n",
			reverse(filhdr.tsize), 
			reverse(filhdr.dsize), 
			reverse(filhdr.bsize),
			t,
			t);
	}
	else
	{
		if (lflag)
		{
			printf("fmagic:\t0%O\n", filhdr.fmagic);
			printf("tsize:\t%D\n", reverse(filhdr.tsize));
			printf("dsize:\t%D\n", reverse(filhdr.dsize));
			printf("bsize:\t%D\n", reverse(filhdr.bsize));
			printf("ssize:\t%D\n", reverse(filhdr.ssize));
			printf("rtsize:\t%D\n", reverse(filhdr.rtsize));
			printf("rdsize:\t%D\n", reverse(filhdr.rdsize));
			printf("entry:\t0%O\n", reverse(filhdr.entry));
		}
		else printf("%D+%D+%D = %D = 0%O\n",
			reverse(filhdr.tsize),
			reverse(filhdr.dsize),
			reverse(filhdr.bsize),
			t,
			t);
	}
	fclose(infile);
}

reverse(lwrd) unsigned lwrd; {
	if (rflag) return
		(lwrd>>24)	    |
		(lwrd>>8 & 0xff00)  |
		(lwrd<<8 & 0xff0000)|
		(lwrd<<24);
	else return lwrd;
}

e;
	np1->nnext = NULL;
	if (namelist == NULL) namelist = np1;
	else
	{	np2 = namelist;
		while(np2->nnext != NULL) np2 = np2->nnext;sumacc/cc/lorder68.sh   444      0     12         643  3470501563   7655 #! /bin/sh
trap "rm -f $$sym?ef; exit" 0 1 2 13 15
case $# in
0)	echo usage: lorder68 file ...
	exit ;;
1)	case $1 in
	*.b)	set $1 $1
	esac
esac
nm68 -g -f  $* | sed '
	/^$/d
	/:$/{
		/\.b:/!d
		s/://
		h
		s/.*/& &/
		p
		d
	}
	/[TD] /{
		s/.* //
		G
		s/\n/ /
		w '$$symdef'
		d
	}
	s/.* //
	G
	s/\n/ /
	w '$$symref'
	d
'
sort $$symdef -o $$symdef
sort $$symref -o $$symref
join $$symref $$symdef | sed 's/[^ ]* *//'
******************************************/

cleanup()
{
}


/******************************sumacc/cc/makefile   444      0     12        1356  3470503024   7370 # sun command makefile
# Bill Nowicki December 1981
# merged a bunch of uncommented files
# March 15, 1982 (win) changed /usr/bin to /usr/sun/bin

DESTDIR= /usr/sun/bin

all : cc68 compiler assembler loader install

cc68: cc68.c
	cc -o cc68 cc68.c
compiler:
	cd ccom; make

assembler:
	cd as; make

loader:
	cd ld; make


install: install-cc68 \
 install-compiler install-assembler install-loader $(DESTDIR)/lorder68

install-cc68:
	cp cc68 $(DESTDIR)/cc68

install-compiler:
	cd c2; make install
	cd ccom; make install

install-assembler:
	cd as; make install

install-loader:
	cd ld; make install

clean:
	rm -f dll cc68 dlx *.b *.o *BAK *CKP
	-cd as; make clean
	-cd c2; make clean
	-cd ccom; make clean
	-cd ddt68; make clean
	-cd ld; make clean
nlink)malloc(sizeof(*np1));
	np1->nname = name;
	np1->nnext = NULL;
	if (namelist == NULL) namelist = np1;
	else
	{	np2 = namelist;
		while(np2->nnext != NULL) np2 = np2->nnext;
		np2->nnext = np1;
	}
}


/********************************************************************sumacc/cc/cc68.c   444      0     12       36516  3470501563   6633 /*
 * cc68 - front end for MC68000 C compiler
 *
 * Jeffrey Mogul @ Stanford	February 10 1981
 * 	- hacked up from cc.c
 *
 * V. Pratt March 1981
 * 	-v (version), -d (dl68), -r (rev68) options
 *
 * Bill Nowicki February 1982
 *	- Changed exec's with full pathnames to use search path
 *	- "-ifilename" option added to substitute file for crt0.b
 *	- Merged Pratt's "single module" check of Januray 1982
 *	- Merged in Mogul's undocumented .ls hack
 *	- Merged in Pratt's "-u" hack
 *
 * March 1982 (jcm, vrp, win)
 *	- Fixed bug regarding linking a single .b file
 *	- Removed Jeff's ANNOYING #ifdef
 *	- Added -vL for LucasFilms "temporary" kludge
 *	- files with no suffix assumed to be b.out format
 *	- Changed back to absolute path names (sigh)
 *
 * November 1982 (win)
 *	- Added -V option for V environment: -T 10000, -iteamroot.b, -lV
 *	- Added /usr/local/include to include path
 *
 * June 1983 (Per Bothner)
 *	- -V option now also does -DVsystem
 *
 * July 1983 (win)
 *	- Added -vx option to use experimental versions
 *
 * January 21 1984 (Marvin M. Theimer)
 *	- Changed DIRSIZ to MAXNAMLEN for 4.2 directory names.
 *	- Changed /usr/local to /usr/stanford (WIN)
 *
 * May 1984 (croft)
 *	- added "-m" switch for Macintosh environment
 */

#define	BSD42	1

#include <sys/types.h>
#include <stdio.h>
#include <ctype.h>
#include <signal.h>

#ifdef BSD42
#include <sys/dir.h>
#else
#include <dir.h>
#define	MAXNAMLEN DIRSIZ
#endif


# define LucasKludge "/mnt/lunix/bin/"
# define BinDirectory "/usr/sun/bin/"

char	*cpp = "/lib/cpp";	/* C preprocessor */
char	*ccom = "ccom68";	/* Johnson's portable C compiler */
char	*c2 = "c268";		/* Terman's .s->.s optimizer */
char	*as = "as68";		/* Patrick's 68k assembler */
char	*ld = "ld68";		/* 68k link editor */
char	*dl = "dl68";		/* MACSBUG downloader */
char	*rev = "rev68";		/* Pratt's .b 68k reformatter */
				/* run-time start-up */
char	*crt0 = "/usr/sun/lib/crtsun.b";
char	*macroot = "/usr/sun/lib/crtmac.b";
char	*teamroot = "/usr/sun/lib/teamroot.b";
char	*xteamroot = "/usr/sun/xlib/teamroot.b";
char	*sunincludes = "-I/usr/sun/include";
char	*sunxincludes = "-I/usr/sun/xinclude";
char	*localincludes = "-I/usr/stanford/include";
char	*dmincludes = "-I/usr/sun/dm/include";
char	*defines = "-DMC68000";	/* tell cpp this is a 68000 */

char	tmp0[30];		/* big enough for /tmp/ctm%05.5d */
char	*tmp1, *tmp2, *tmp3, *tmp4, *tmp5;
char	*infile=0, *outfile=0;
char	*savestr(), *strspl(), *setsuf(), *setlongsuf();
char	*type;
int	idexit();
char	**av, **clist, **llist, **flist, **ulist, **plist;
int	cflag=0, 	/* skip link editing, result is filename.b */
	dflag=0,	/* 1 -> apply dl68 to yield filename.d */
	eflag=0, 	/* error flag; records errors */
	gflag=0, 	/* 1 -> ccom68 generates info for sdb68 (nonexistent)*/
	lflag=0,	/* 1 -> as68 generates listing */
	oflag=0, 	/* optimization flag; 1 -> invoke o68 */
	pflag=0,	/* 1 -> don't delete temporary files */
	rflag=0,	/* 1 -> apply rev68 to yield filename.r */
	Rflag=0,	/* 1 -> ld68 preserves relocation bits */
	sflag=0,  	/* 1 -> skip assembly, result is filename.s */
	wflag=0,  	/* -w flag passed to ccom68 */
	zflag=0,	/* print exec() trace */
	exflag=0, 	/* 1 -> only apply cpp, result to stdout */
	noxflag=0,	/* 1 -> -x flag off -> output local symbols */
	Vflag=0,	/* 1 -> V kernel environment */
	mflag=0,	/* 1 -> Macintosh environment */
	proflag=0;	/* profile flag: generate jbsr mcount for each fctn */
int	
	exfail;
char	*chpass=0,
	*version=0,	/* version: -vm, -v1, -v2, ... */
	*Torg=0,	/* Text origin */
	*entrypt=0,	/* entry point */
	*npassname=0;

int	nc=0, 	/* no of programs for ccom */
	nl=0, 	/* no of .b inputs for ld (including libraries) */
	nm=0,	/* no of modules (excluding libraries) */
	nf=0,	/* no of flags for ld68 */
	nu=0,	/* no of files of unknown type */
	np=0, 	/* no of args for cpp */
	na=0;	/* no of args to each callsys */

#define	cunlink(s)	if (s&&!zflag) unlink(s)

main(argc, argv)
	char **argv;
{
	char *t;
	char *assource;
	int i, j, c;

	/* ld currently adds upto 5 args; 20 is room to spare */
	/* [Does this apply to ld68?  - pratt] */
	av = (char **)calloc(argc+20, sizeof (char **));
	clist = (char **)calloc(argc, sizeof (char **));
	llist = (char **)calloc(argc, sizeof (char **));
	flist = (char **)calloc(argc, sizeof (char **));
	ulist = (char **)calloc(argc, sizeof (char **));
	plist = (char **)calloc(argc, sizeof (char **));
	for (i = 1; i < argc; i++) {
		if (*argv[i] == '-') switch (argv[i][1]) {

		case '-':	/* negate some default */
			switch(argv[i][2]) 
			  {
				case 'x':
					noxflag++;
					break;
		    	  }
			break;

		case 'S':
			sflag++;
			cflag++;
			break;

		case 'e':
			if (++i < argc)
				entrypt = argv[i];
			break;
		case 'o':
			if (++i < argc) {
				outfile = argv[i];
				switch (getsuf(outfile)) {

				case 'c':
					error("-o would overwrite %s",
					    outfile);
					exit(8);
				}
			}
			break;
		case 'T':
			if (++i < argc) 
				Torg = argv[i];
			break;
		case 'u':
			if (++i < argc) {
				llist[nl++] = "-u";
				llist[nl++] = argv[i];
			}
			break;
		case 'O':
			oflag++;
			break;
		case 'p':
			proflag++;
			break;
		case 'g':
			gflag++;
			break;
		case 'L':			/* WIN */
			lflag++;
			break;
		case 'w':
			wflag++;
			break;
		case 'E':
			exflag++;
		case 'P':
			pflag++;
			if (argv[i][1]=='P')
				fprintf(stderr,
	"cc68: warning: -P option obsolete; you should use -E instead\n");
			plist[np++] = argv[i];
			break;
		case 'c':
			cflag++;
			break;
		case 'd':
			dflag++;
			break;
		case 'r':
			rflag++;
			break;
		case 'R':
			Rflag++;
			break;
		case 'D':
		case 'I':
		case 'U':
		case 'C':
			plist[np++] = argv[i];
			break;
		case 't':
			if (chpass)
				error("-t overwrites earlier option", 0);
			chpass = argv[i]+2;
			if (chpass[0]==0)
				chpass = "012p";
			break;
		case 'B':
			if (npassname)
				error("-B overwrites earlier option", 0);
			npassname = argv[i]+2;
			if (npassname[0]==0)
				npassname = "/usr/c/o";
			break;
		case 'l':
			llist[nl++] = argv[i];/* NOT flist, order matters! */
			break;
		case 'v':
			version = argv[i];
			break;
		case 'i':
			crt0 = argv[i]+2;
			break;
		case 'z':	/* trace exec() calls */
			zflag++;
			break;
		case 'V':	/* V environment */
			crt0 = (version && version[2]=='x') ? 
				xteamroot : teamroot;
			Torg = "10000";
			Vflag++;
			break;
		case 'm':	/* Macintosh environment */
			crt0 = macroot;
			Torg = "0";
			entrypt = "_start";
			mflag++;
			Rflag++;
			break;
		default:
			flist[nf++] = argv[i];
			break;
		}
		else {			/* not a flag */
			t = argv[i];
			c = getsuf(t);
			if (c=='c' || c=='s' || exflag) {
				clist[nc++] = t;
				t = setsuf(t, 'b');
				c = 'b';
			}
			if (c=='a' || c=='b') 
			  {
				if (nodup(llist, t))
				  {
					llist[nl++] = t;
					nm++;	/* count programs */
				  }
			  }
			else if (!strcmp(t,"b.out") || !index(t,'.') )
				infile = t;
			else {
				ulist[nu++] = t; /* Unrecognized suffix */
				nm++;
			}
		}
	}	/* End of loop to process arguments */
	for (i=0; i<nu; i++) {
		if (exflag||sflag||cflag) {
			clist[nc++] = ulist[i];
			type = "C code (type .c)";
		}
		else if (dflag||rflag) {
			infile = ulist[i];
			type = "b.out format";
		} 
		else {
			llist[nl++] = ulist[i];
		       	type = "relocatable binary (type .b)";
		}

		fprintf(stderr,
		       "cc68: warning: %s has unrecognized suffix, taken to be %s\n",
		       infile,type);
	}
	if (version && version[2]=='m') crt0 = "/usr/sun/lib/crt0.b";
	if (version && version[2]=='x') crt0 = xteamroot;
	if (!nl && !infile) {
		fprintf(stderr,"cc68: no input specified\n");
		exit(8);
	}
	if ((eflag||sflag||cflag) && (dflag || rflag)) {
		fprintf(stderr,"cc68: warning: -E,-S,-c disable -d,-r\n");
		dflag = 0;
		rflag = 0;
	}
	if (gflag) {
		if (oflag)
			fprintf(stderr, "cc68: warning: -g disables -O\n");
		oflag = 0;
	}
	if (npassname && chpass ==0)
		chpass = "012p";
	if (chpass && npassname==0)
		npassname = "/usr/new";
	if (chpass)
	for (t=chpass; *t; t++) {
		switch (*t) {

		case '0':
			ccom = strspl(npassname, "ccom");
			continue;
		case '2':
			c2 = strspl(npassname, "c2");
			continue;
		case 'p':
			cpp = strspl(npassname, "cpp");
			continue;
		}
	}
	if (proflag)
		crt0 = "/usr/sun/lib/mcrt0.b";
	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
		signal(SIGINT, idexit);
	if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
		signal(SIGTERM, idexit);
	if (pflag==0)
		sprintf(tmp0, "/tmp/ctm%05.5d", getpid());
	tmp1 = strspl(tmp0, "1");
	if (nc==0)
		goto nocom;
	tmp2 = strspl(tmp0, "2");
	tmp3 = strspl(tmp0, "3");
	if (pflag==0)
		tmp4 = strspl(tmp0, "4");
	if (oflag)
		tmp5 = strspl(tmp0, "5");
	for (i=0; i<nc; i++) {
		if (nc > 1) {
			printf("%s:\n", clist[i]);
			fflush(stdout);
		}
		if (getsuf(clist[i]) == 's') {
			assource = clist[i];
			goto assemble;		/* thereby skipping ccom68 */
		} else
			assource = tmp3;
		if (pflag)
			tmp4 = setsuf(clist[i], 'i');
		av[0] = "cpp"; av[1] = clist[i]; av[2] = exflag ? "-" : tmp4;
		na = 3;
		for (j = 0; j < np; j++)
			av[na++] = plist[j];
		if (version)
			if (strcmp(version,"-vx") == 0)
				av[na++] = sunxincludes;
		if (version)
			if (strcmp(version,"-vm") == 0)
				av[na++] = dmincludes;
		av[na++]=sunincludes;
		av[na++]=localincludes;
		av[na++]=defines;
		if (Vflag)
			av[na++] = "-DVsystem";
		av[na++] = 0;
		if (callsys(cpp, av)) {
			exfail++;
			eflag++;
		}
		if (pflag || exfail) {
			cflag++;
			continue;
		}
		if (sflag)
			assource = tmp3 = setsuf(clist[i], 's');
		av[0] = "ccom"; av[1] = tmp4; av[2] = oflag?tmp5:tmp3; na = 3;
		if (proflag)
			av[na++] = "-XP";
		if (gflag)
			av[na++] = "-Xg";
		if (wflag)
			av[na++] = "-w";
		av[na] = 0;
/*		if (callsys(ccom, av)) {
			cflag++;
			eflag++;
			continue;
		} */
		{ /* this is a hack.  */
		char command[100];
		sprintf(command,"%s <%s >%s",ccom,av[1],av[2]);
		if (zflag) printf( "\t%s\n", command );
		if(system(command)) {
		    eflag++;
		    continue;
		    }
		}
		if (oflag) {
			av[0] = "c2"; av[1] = tmp5; av[2] = tmp3; av[3] = 0;
			if (callsys(c2, av)) {
				unlink(tmp3);
				tmp3 = assource = tmp5;
			} else
				unlink(tmp5);
		}
		if (sflag)
			continue;
	assemble:
		cunlink(tmp1); cunlink(tmp2); cunlink(tmp4);
		na = 0;
		av[na++] = "as68"; 
		av[na++] = "-o"; 
		if (cflag && nc == 1 && outfile)
			av[na++] = outfile;
		else av[na++] = setsuf(clist[i], 'b');
		av[na++] = "-g";	/* permits undefined symbols in as68 */
		if (lflag) {
			av[na++] = "-L";
			av[na++] = setlongsuf(clist[i], "ls");
		}
		av[na++] = assource;
		av[na] = 0;
		if (callsys(as, av) > 1) {
			cflag++;
			eflag++;
			continue;
		}
	}		/* End of loop to produce .b files */

nocom:			/* link edit files in llist[0:nl-1] */
	if (cflag==0 && nl!=0) {
		na = 0;
		av[na++] = "ld";
		av[na++] = "-X";
		if (Rflag)
			av[na++] = "-r";
		if (mflag)
			av[na++] = "-d";
		if (version)
			av[na++] = version;
		if (entrypt) {
			av[na++] = "-e";
			av[na++] = entrypt;
		}
		if (Torg) {
			av[na++] = "-T";
			av[na++] = Torg;
		}
		av[na++] = crt0;	/* startup */
		if (dflag || rflag) {	/* if dl or rev then just output to */
			av[na++] = "-o";/* temporary file */
			av[na++] = infile = tmp1;
		}
		else if (outfile) {	/* else if outfile exists then */
			av[na++] = "-o";/* output to it.  Default is b.out */
			av[na++] = outfile;
		}
		for (i=0; i<nf; i++)	/* supply all flags */
			av[na++] = flist[i];
		for (i=0; i<nl; i++)	/* supply all .b arguments */
			av[na++] = llist[i];
		if (gflag)
			av[na++] = "-lg";
		if (mflag)
			av[na++] = "-lmac";
		if (Vflag)
			av[na++] = "-lV";
		else
			av[na++] = "-lc";	/* libc.a only if not V */
		if (!noxflag)	       /* add -x by default unless --x given */
			av[na++] = "-x";
		av[na++] = 0;			/* argument delimiter */
		eflag |= callsys(ld, av);	/* invoke ld68 */

		if (nc==1 && nm==1 && eflag==0)
		    /*
		     * If we have only one module AND it was compiled
		     * (as opposed to just linked) then remove the .b file.
		     */
			unlink(setsuf(clist[0], 'b'));
	}

dnload:
	if (dflag && eflag==0) {
		na = 0;
		av[na++] = "dl";
		av[na++] = infile;
		if (version)
			av[na++] = version;
		if (Torg) {
			av[na++] = "-T";
			av[na++] = Torg;
		}
		av[na++] = "-o";
		av[na++] = outfile?	outfile:
			   nl?		strspl(setsuf(llist[0],'d'),"l"):
			   		"d.out";
		av[na++] = 0;
		eflag |= callsys(dl, av);	/* invoke dl68 */
	}

reverse:

	if (rflag && eflag==0) {
		na = 0;
		av[na++] = "rev";
		av[na++] = infile;
		av[na++] = outfile && !dflag?	outfile:
			   nl?			setsuf(llist[0],'r'):
			   			"r.out";
		av[na++] = 0;
		eflag |= callsys(rev, av);
	}

	dexit();
}

idexit()
{

	eflag = 100;
	dexit();
}

dexit()
{

	if (!pflag) {
		cunlink(tmp1);
		cunlink(tmp2);
		if (sflag==0)
			cunlink(tmp3);
		cunlink(tmp4);
		cunlink(tmp5);
	}
	exit(eflag);
}

error(s, x)
	char *s, *x;
{
	FILE *diag = exflag ? stderr : stdout;

	fprintf(diag, "cc68: ");
	fprintf(diag, s, x);
	putc('\n', diag);
	exfail++;
	cflag++;
	eflag++;
}

getsuf(as)
char as[];
{
	register int c;
	register char *s;
	register int t;

	s = as;
	c = 0;
	while (t = *s++)
		if (t=='/')
			c = 0;
		else
			c++;
	s -= 3;
	if (c <= MAXNAMLEN && c > 2 && *s++ == '.')
		return (*s);
	return (0);
}

char *
setsuf(as, ch)
	char *as;
{
	register char *s, *s1;

	s = s1 = savestr(as);
	while (*s)
		if (*s++ == '/')
			s1 = s;
	s[-1] = ch;
	return (s1);
}

char *
setlongsuf(as, suff)
char *as;
char *suff;
{
	register char *s, *s1;
	register int suflen = strlen(suff);

	s = s1 = savestr(as);
	while (*s)
		if (*s++ == '/')
			s1 = s;
	s[-1] = 0;
	if (strlen(s1) > (MAXNAMLEN - suflen)) {
		s[-suflen] = 0;
		s[-(suflen-1)] = '.';
	}
	return(strspl(s1,suff));
}


callsys(f, v)
	char *f, **v;
{
	int t, status;
	char cmd[256];
	
	if (version && version[2]=='L' && *f!='/')
	  {
	  	/*
		 * We substitute the LucasFilms versions of the loader,
		 * compiler, assembler, etc. if the -vL option was set,
		 * and we have an unqualified pathname.
		 */
	    strcpy( cmd, LucasKludge);
	    strcat( cmd, f);
	  }
	 else if (*f!='/')
	   {
	       /*
	        * add the binary directory at the begining if not
		* already specified, so you can have other versions
		* in your path without screwing up.
		*/
	    strcpy( cmd, BinDirectory);
	    strcat( cmd, f);
	   }
	 else strcpy( cmd, f);

	if (zflag) 
	  {
	  	/*
		 * print out a trace of all commands executed
		 */
	    char **arg = v+1;
	    printf( "\t%s ", cmd);
	    while (*arg) printf( "%s ", *arg++);
	    printf("\n");
	  }
	t = vfork();
	if (t == -1) {
		printf("No more processes\n");
		return (100);
	}
	if (t == 0) {
		execvp( cmd, v);
		printf("Can't find %s\n", cmd);
		fflush(stdout);
		_exit(100);
	}
	while (t != wait(&status))
		;
	if ((t=(status&0377)) != 0 && t!=14) {
		if (t!=2) {
			printf("Fatal error in %s\n", cmd);
			eflag = 8;
		}
		dexit();
	}
	return ((status>>8) & 0377);
}

nodup(l, os)
	char **l, *os;
{
	register char *t, *s;
	register int c;

	s = os;
	if (getsuf(s) != 'b')
		return (1);
	while (t = *l++) {
		while (c = *s++)
			if (c != *t++)
				break;
		if (*t==0 && c==0)
			return (0);
		s = os;
	}
	return (1);
}

#define	NSAVETAB	1024
char	*savetab;
int	saveleft;

char *
savestr(cp)
	register char *cp;
{
	register int len;

	len = strlen(cp) + 1;
	if (len > saveleft) {
		saveleft = NSAVETAB;
		if (len > saveleft)
			saveleft = len;
		savetab = (char *)malloc(saveleft);
		if (savetab == 0) {
			fprintf(stderr, "ran out of memory (savestr)\n");
			exit(1);
		}
	}
	strncpy(savetab, cp, len);
	cp = savetab;
	savetab += len;
	saveleft -= len;
	return (cp);
}

char *
strspl(left, right)
	char *left, *right;
{
	char buf[BUFSIZ];

	strcpy(buf, left);
	strcat(buf, right);
	return (savestr(buf));
}

ibc.a only if not V */
		if (!noxflag)	       /* add -x by default unless --x given */
			av[na++] = "-x";
		av[na++] = 0;			/* argument delimiter */
		eflag |= callsys(ld, av);	sumacc/cc42/   775      0     12           0  3540162151   5750 sumacc/cc42/cc68.c   444      0     12       36523  3470501266   6777 /*
 * cc68 - front end for MC68000 C compiler
 *
 * Jeffrey Mogul @ Stanford	February 10 1981
 * 	- hacked up from cc.c
 *
 * V. Pratt March 1981
 * 	-v (version), -d (dl68), -r (rev68) options
 *
 * Bill Nowicki February 1982
 *	- Changed exec's with full pathnames to use search path
 *	- "-ifilename" option added to substitute file for crt0.b
 *	- Merged Pratt's "single module" check of Januray 1982
 *	- Merged in Mogul's undocumented .ls hack
 *	- Merged in Pratt's "-u" hack
 *
 * March 1982 (jcm, vrp, win)
 *	- Fixed bug regarding linking a single .b file
 *	- Removed Jeff's ANNOYING #ifdef
 *	- Added -vL for LucasFilms "temporary" kludge
 *	- files with no suffix assumed to be b.out format
 *	- Changed back to absolute path names (sigh)
 *
 * November 1982 (win)
 *	- Added -V option for V environment: -T 10000, -iteamroot.b, -lV
 *	- Added /usr/local/include to include path
 *
 * June 1983 (Per Bothner)
 *	- -V option now also does -DVsystem
 *
 * July 1983 (win)
 *	- Added -vx option to use experimental versions
 *
 * January 21 1984 (Marvin M. Theimer)
 *	- Changed DIRSIZ to MAXNAMLEN for 4.2 directory names.
 *	- Changed /usr/local to /usr/stanford (WIN)
 *
 * May 1984 (croft)
 *	- added "-m" switch for Macintosh environment
 */

#define	BSD42	1

#include <sys/types.h>
#include <stdio.h>
#include <ctype.h>
#include <signal.h>

#ifdef BSD42
#include <sys/dir.h>
#else
#include <dir.h>
#define	MAXNAMLEN DIRSIZ
#endif


# define LucasKludge "/mnt/lunix/bin/"
# define BinDirectory "/usr/stanford/bin/"

char	*cpp = "/lib/cpp";	/* C preprocessor */
char	*ccom = "ccom68";	/* Johnson's portable C compiler */
char	*c2 = "c268";		/* Terman's .s->.s optimizer */
char	*as = "as68";		/* Patrick's 68k assembler */
char	*ld = "ld68";		/* 68k link editor */
char	*dl = "dl68";		/* MACSBUG downloader */
char	*rev = "rev68";		/* Pratt's .b 68k reformatter */
				/* run-time start-up */
char	*crt0 = "/usr/sun/lib/crtsun.b";
char	*macroot = "/usr/sun/lib/crtmac.b";
char	*teamroot = "/usr/sun/lib/teamroot.b";
char	*xteamroot = "/usr/sun/xlib/teamroot.b";
char	*sunincludes = "-I/usr/sun/include";
char	*sunxincludes = "-I/usr/sun/xinclude";
char	*localincludes = "-I/usr/stanford/include";
char	*dmincludes = "-I/usr/sun/dm/include";
char	*defines = "-DMC68000";	/* tell cpp this is a 68000 */

char	tmp0[30];		/* big enough for /tmp/ctm%05.5d */
char	*tmp1, *tmp2, *tmp3, *tmp4, *tmp5;
char	*infile=0, *outfile=0;
char	*savestr(), *strspl(), *setsuf(), *setlongsuf();
char	*type;
int	idexit();
char	**av, **clist, **llist, **flist, **ulist, **plist;
int	cflag=0, 	/* skip link editing, result is filename.b */
	dflag=0,	/* 1 -> apply dl68 to yield filename.d */
	eflag=0, 	/* error flag; records errors */
	gflag=0, 	/* 1 -> ccom68 generates info for sdb68 (nonexistent)*/
	lflag=0,	/* 1 -> as68 generates listing */
	oflag=0, 	/* optimization flag; 1 -> invoke o68 */
	pflag=0,	/* 1 -> don't delete temporary files */
	rflag=0,	/* 1 -> apply rev68 to yield filename.r */
	Rflag=0,	/* 1 -> ld68 preserves relocation bits */
	sflag=0,  	/* 1 -> skip assembly, result is filename.s */
	wflag=0,  	/* -w flag passed to ccom68 */
	zflag=0,	/* print exec() trace */
	exflag=0, 	/* 1 -> only apply cpp, result to stdout */
	noxflag=0,	/* 1 -> -x flag off -> output local symbols */
	Vflag=0,	/* 1 -> V kernel environment */
	mflag=0,	/* 1 -> Macintosh environment */
	proflag=0;	/* profile flag: generate jbsr mcount for each fctn */
int	
	exfail;
char	*chpass=0,
	*version=0,	/* version: -vm, -v1, -v2, ... */
	*Torg=0,	/* Text origin */
	*entrypt=0,	/* entry point */
	*npassname=0;

int	nc=0, 	/* no of programs for ccom */
	nl=0, 	/* no of .b inputs for ld (including libraries) */
	nm=0,	/* no of modules (excluding libraries) */
	nf=0,	/* no of flags for ld68 */
	nu=0,	/* no of files of unknown type */
	np=0, 	/* no of args for cpp */
	na=0;	/* no of args to each callsys */

#define	cunlink(s)	if (s&&!zflag) unlink(s)

main(argc, argv)
	char **argv;
{
	char *t;
	char *assource;
	int i, j, c;

	/* ld currently adds upto 5 args; 20 is room to spare */
	/* [Does this apply to ld68?  - pratt] */
	av = (char **)calloc(argc+20, sizeof (char **));
	clist = (char **)calloc(argc, sizeof (char **));
	llist = (char **)calloc(argc, sizeof (char **));
	flist = (char **)calloc(argc, sizeof (char **));
	ulist = (char **)calloc(argc, sizeof (char **));
	plist = (char **)calloc(argc, sizeof (char **));
	for (i = 1; i < argc; i++) {
		if (*argv[i] == '-') switch (argv[i][1]) {

		case '-':	/* negate some default */
			switch(argv[i][2]) 
			  {
				case 'x':
					noxflag++;
					break;
		    	  }
			break;

		case 'S':
			sflag++;
			cflag++;
			break;

		case 'e':
			if (++i < argc)
				entrypt = argv[i];
			break;
		case 'o':
			if (++i < argc) {
				outfile = argv[i];
				switch (getsuf(outfile)) {

				case 'c':
					error("-o would overwrite %s",
					    outfile);
					exit(8);
				}
			}
			break;
		case 'T':
			if (++i < argc) 
				Torg = argv[i];
			break;
		case 'u':
			if (++i < argc) {
				llist[nl++] = "-u";
				llist[nl++] = argv[i];
			}
			break;
		case 'O':
			oflag++;
			break;
		case 'p':
			proflag++;
			break;
		case 'g':
			gflag++;
			break;
		case 'L':			/* WIN */
			lflag++;
			break;
		case 'w':
			wflag++;
			break;
		case 'E':
			exflag++;
		case 'P':
			pflag++;
			if (argv[i][1]=='P')
				fprintf(stderr,
	"cc68: warning: -P option obsolete; you should use -E instead\n");
			plist[np++] = argv[i];
			break;
		case 'c':
			cflag++;
			break;
		case 'd':
			dflag++;
			break;
		case 'r':
			rflag++;
			break;
		case 'R':
			Rflag++;
			break;
		case 'D':
		case 'I':
		case 'U':
		case 'C':
			plist[np++] = argv[i];
			break;
		case 't':
			if (chpass)
				error("-t overwrites earlier option", 0);
			chpass = argv[i]+2;
			if (chpass[0]==0)
				chpass = "012p";
			break;
		case 'B':
			if (npassname)
				error("-B overwrites earlier option", 0);
			npassname = argv[i]+2;
			if (npassname[0]==0)
				npassname = "/usr/c/o";
			break;
		case 'l':
			llist[nl++] = argv[i];/* NOT flist, order matters! */
			break;
		case 'v':
			version = argv[i];
			break;
		case 'i':
			crt0 = argv[i]+2;
			break;
		case 'z':	/* trace exec() calls */
			zflag++;
			break;
		case 'V':	/* V environment */
			crt0 = (version && version[2]=='x') ? 
				xteamroot : teamroot;
			Torg = "10000";
			Vflag++;
			break;
		case 'm':	/* Macintosh environment */
			crt0 = macroot;
			Torg = "0";
			entrypt = "_start";
			mflag++;
			Rflag++;
			break;
		default:
			flist[nf++] = argv[i];
			break;
		}
		else {			/* not a flag */
			t = argv[i];
			c = getsuf(t);
			if (c=='c' || c=='s' || exflag) {
				clist[nc++] = t;
				t = setsuf(t, 'b');
				c = 'b';
			}
			if (c=='a' || c=='b') 
			  {
				if (nodup(llist, t))
				  {
					llist[nl++] = t;
					nm++;	/* count programs */
				  }
			  }
			else if (!strcmp(t,"b.out") || !index(t,'.') )
				infile = t;
			else {
				ulist[nu++] = t; /* Unrecognized suffix */
				nm++;
			}
		}
	}	/* End of loop to process arguments */
	for (i=0; i<nu; i++) {
		if (exflag||sflag||cflag) {
			clist[nc++] = ulist[i];
			type = "C code (type .c)";
		}
		else if (dflag||rflag) {
			infile = ulist[i];
			type = "b.out format";
		} 
		else {
			llist[nl++] = ulist[i];
		       	type = "relocatable binary (type .b)";
		}

		fprintf(stderr,
		       "cc68: warning: %s has unrecognized suffix, taken to be %s\n",
		       infile,type);
	}
	if (version && version[2]=='m') crt0 = "/usr/sun/lib/crt0.b";
	if (version && version[2]=='x') crt0 = xteamroot;
	if (!nl && !infile) {
		fprintf(stderr,"cc68: no input specified\n");
		exit(8);
	}
	if ((eflag||sflag||cflag) && (dflag || rflag)) {
		fprintf(stderr,"cc68: warning: -E,-S,-c disable -d,-r\n");
		dflag = 0;
		rflag = 0;
	}
	if (gflag) {
		if (oflag)
			fprintf(stderr, "cc68: warning: -g disables -O\n");
		oflag = 0;
	}
	if (npassname && chpass ==0)
		chpass = "012p";
	if (chpass && npassname==0)
		npassname = "/usr/new";
	if (chpass)
	for (t=chpass; *t; t++) {
		switch (*t) {

		case '0':
			ccom = strspl(npassname, "ccom");
			continue;
		case '2':
			c2 = strspl(npassname, "c2");
			continue;
		case 'p':
			cpp = strspl(npassname, "cpp");
			continue;
		}
	}
	if (proflag)
		crt0 = "/usr/sun/lib/mcrt0.b";
	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
		signal(SIGINT, idexit);
	if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
		signal(SIGTERM, idexit);
	if (pflag==0)
		sprintf(tmp0, "/tmp/ctm%05.5d", getpid());
	tmp1 = strspl(tmp0, "1");
	if (nc==0)
		goto nocom;
	tmp2 = strspl(tmp0, "2");
	tmp3 = strspl(tmp0, "3");
	if (pflag==0)
		tmp4 = strspl(tmp0, "4");
	if (oflag)
		tmp5 = strspl(tmp0, "5");
	for (i=0; i<nc; i++) {
		if (nc > 1) {
			printf("%s:\n", clist[i]);
			fflush(stdout);
		}
		if (getsuf(clist[i]) == 's') {
			assource = clist[i];
			goto assemble;		/* thereby skipping ccom68 */
		} else
			assource = tmp3;
		if (pflag)
			tmp4 = setsuf(clist[i], 'i');
		av[0] = "cpp"; av[1] = clist[i]; av[2] = exflag ? "-" : tmp4;
		na = 3;
		for (j = 0; j < np; j++)
			av[na++] = plist[j];
		if (version)
			if (strcmp(version,"-vx") == 0)
				av[na++] = sunxincludes;
		if (version)
			if (strcmp(version,"-vm") == 0)
				av[na++] = dmincludes;
		av[na++]=sunincludes;
		av[na++]=localincludes;
		av[na++]=defines;
		if (Vflag)
			av[na++] = "-DVsystem";
		av[na++] = 0;
		if (callsys(cpp, av)) {
			exfail++;
			eflag++;
		}
		if (pflag || exfail) {
			cflag++;
			continue;
		}
		if (sflag)
			assource = tmp3 = setsuf(clist[i], 's');
		av[0] = "ccom"; av[1] = tmp4; av[2] = oflag?tmp5:tmp3; na = 3;
		if (proflag)
			av[na++] = "-XP";
		if (gflag)
			av[na++] = "-Xg";
		if (wflag)
			av[na++] = "-w";
		av[na] = 0;
/*		if (callsys(ccom, av)) {
			cflag++;
			eflag++;
			continue;
		} */
		{ /* this is a hack.  */
		char command[100];
		sprintf(command,"%s <%s >%s",ccom,av[1],av[2]);
		if (zflag) printf( "\t%s\n", command );
		if(system(command)) {
		    eflag++;
		    continue;
		    }
		}
		if (oflag) {
			av[0] = "c2"; av[1] = tmp5; av[2] = tmp3; av[3] = 0;
			if (callsys(c2, av)) {
				unlink(tmp3);
				tmp3 = assource = tmp5;
			} else
				unlink(tmp5);
		}
		if (sflag)
			continue;
	assemble:
		cunlink(tmp1); cunlink(tmp2); cunlink(tmp4);
		na = 0;
		av[na++] = "as68"; 
		av[na++] = "-o"; 
		if (cflag && nc == 1 && outfile)
			av[na++] = outfile;
		else av[na++] = setsuf(clist[i], 'b');
		av[na++] = "-g";	/* permits undefined symbols in as68 */
		if (lflag) {
			av[na++] = "-L";
			av[na++] = setlongsuf(clist[i], "ls");
		}
		av[na++] = assource;
		av[na] = 0;
		if (callsys(as, av) > 1) {
			cflag++;
			eflag++;
			continue;
		}
	}		/* End of loop to produce .b files */

nocom:			/* link edit files in llist[0:nl-1] */
	if (cflag==0 && nl!=0) {
		na = 0;
		av[na++] = "ld";
		av[na++] = "-X";
		if (Rflag)
			av[na++] = "-r";
		if (mflag)
			av[na++] = "-d";
		if (version)
			av[na++] = version;
		if (entrypt) {
			av[na++] = "-e";
			av[na++] = entrypt;
		}
		if (Torg) {
			av[na++] = "-T";
			av[na++] = Torg;
		}
		av[na++] = crt0;	/* startup */
		if (dflag || rflag) {	/* if dl or rev then just output to */
			av[na++] = "-o";/* temporary file */
			av[na++] = infile = tmp1;
		}
		else if (outfile) {	/* else if outfile exists then */
			av[na++] = "-o";/* output to it.  Default is b.out */
			av[na++] = outfile;
		}
		for (i=0; i<nf; i++)	/* supply all flags */
			av[na++] = flist[i];
		for (i=0; i<nl; i++)	/* supply all .b arguments */
			av[na++] = llist[i];
		if (gflag)
			av[na++] = "-lg";
		if (mflag)
			av[na++] = "-lmac";
		if (Vflag)
			av[na++] = "-lV";
		else
			av[na++] = "-lc";	/* libc.a only if not V */
		if (!noxflag)	       /* add -x by default unless --x given */
			av[na++] = "-x";
		av[na++] = 0;			/* argument delimiter */
		eflag |= callsys(ld, av);	/* invoke ld68 */

		if (nc==1 && nm==1 && eflag==0)
		    /*
		     * If we have only one module AND it was compiled
		     * (as opposed to just linked) then remove the .b file.
		     */
			unlink(setsuf(clist[0], 'b'));
	}

dnload:
	if (dflag && eflag==0) {
		na = 0;
		av[na++] = "dl";
		av[na++] = infile;
		if (version)
			av[na++] = version;
		if (Torg) {
			av[na++] = "-T";
			av[na++] = Torg;
		}
		av[na++] = "-o";
		av[na++] = outfile?	outfile:
			   nl?		strspl(setsuf(llist[0],'d'),"l"):
			   		"d.out";
		av[na++] = 0;
		eflag |= callsys(dl, av);	/* invoke dl68 */
	}

reverse:

	if (rflag && eflag==0) {
		na = 0;
		av[na++] = "rev";
		av[na++] = infile;
		av[na++] = outfile && !dflag?	outfile:
			   nl?			setsuf(llist[0],'r'):
			   			"r.out";
		av[na++] = 0;
		eflag |= callsys(rev, av);
	}

	dexit();
}

idexit()
{

	eflag = 100;
	dexit();
}

dexit()
{

	if (!pflag) {
		cunlink(tmp1);
		cunlink(tmp2);
		if (sflag==0)
			cunlink(tmp3);
		cunlink(tmp4);
		cunlink(tmp5);
	}
	exit(eflag);
}

error(s, x)
	char *s, *x;
{
	FILE *diag = exflag ? stderr : stdout;

	fprintf(diag, "cc68: ");
	fprintf(diag, s, x);
	putc('\n', diag);
	exfail++;
	cflag++;
	eflag++;
}

getsuf(as)
char as[];
{
	register int c;
	register char *s;
	register int t;

	s = as;
	c = 0;
	while (t = *s++)
		if (t=='/')
			c = 0;
		else
			c++;
	s -= 3;
	if (c <= MAXNAMLEN && c > 2 && *s++ == '.')
		return (*s);
	return (0);
}

char *
setsuf(as, ch)
	char *as;
{
	register char *s, *s1;

	s = s1 = savestr(as);
	while (*s)
		if (*s++ == '/')
			s1 = s;
	s[-1] = ch;
	return (s1);
}

char *
setlongsuf(as, suff)
char *as;
char *suff;
{
	register char *s, *s1;
	register int suflen = strlen(suff);

	s = s1 = savestr(as);
	while (*s)
		if (*s++ == '/')
			s1 = s;
	s[-1] = 0;
	if (strlen(s1) > (MAXNAMLEN - suflen)) {
		s[-suflen] = 0;
		s[-(suflen-1)] = '.';
	}
	return(strspl(s1,suff));
}


callsys(f, v)
	char *f, **v;
{
	int t, status;
	char cmd[256];
	
	if (version && version[2]=='L' && *f!='/')
	  {
	  	/*
		 * We substitute the LucasFilms versions of the loader,
		 * compiler, assembler, etc. if the -vL option was set,
		 * and we have an unqualified pathname.
		 */
	    strcpy( cmd, LucasKludge);
	    strcat( cmd, f);
	  }
	 else if (*f!='/')
	   {
	       /*
	        * add the binary directory at the begining if not
		* already specified, so you can have other versions
		* in your path without screwing up.
		*/
	    strcpy( cmd, BinDirectory);
	    strcat( cmd, f);
	   }
	 else strcpy( cmd, f);

	if (zflag) 
	  {
	  	/*
		 * print out a trace of all commands executed
		 */
	    char **arg = v+1;
	    printf( "\t%s ", cmd);
	    while (*arg) printf( "%s ", *arg++);
	    printf("\n");
	  }
	t = vfork();
	if (t == -1) {
		printf("No more processes\n");
		return (100);
	}
	if (t == 0) {
		execvp( cmd, v);
		printf("Can't find %s\n", cmd);
		fflush(stdout);
		_exit(100);
	}
	while (t != wait(&status))
		;
	if ((t=(status&0377)) != 0 && t!=14) {
		if (t!=2) {
			printf("Fatal error in %s\n", cmd);
			eflag = 8;
		}
		dexit();
	}
	return ((status>>8) & 0377);
}

nodup(l, os)
	char **l, *os;
{
	register char *t, *s;
	register int c;

	s = os;
	if (getsuf(s) != 'b')
		return (1);
	while (t = *l++) {
		while (c = *s++)
			if (c != *t++)
				break;
		if (*t==0 && c==0)
			return (0);
		s = os;
	}
	return (1);
}

#define	NSAVETAB	1024
char	*savetab;
int	saveleft;

char *
savestr(cp)
	register char *cp;
{
	register int len;

	len = strlen(cp) + 1;
	if (len > saveleft) {
		saveleft = NSAVETAB;
		if (len > saveleft)
			saveleft = len;
		savetab = (char *)malloc(saveleft);
		if (savetab == 0) {
			fprintf(stderr, "ran out of memory (savestr)\n");
			exit(1);
		}
	}
	strncpy(savetab, cp, len);
	cp = savetab;
	savetab += len;
	saveleft -= len;
	return (cp);
}

char *
strspl(left, right)
	char *left, *right;
{
	char buf[BUFSIZ];

	strcpy(buf, left);
	strcat(buf, right);
	return (savestr(buf));
}

ibc.a only if not V */
		if (!noxflag)	       /* add -x by default unless --x given */
			av[na++] = "-x";
		av[na++] = 0;			/* argument delimiter */
		eflag |= callsys(ld, sumacc/cc42/Makefile   444      0     12         331  3472475542   7465 DP=/usr/sun/bin
DL=/usr/sun/lib
PRGS=cc68 as68 c268 ccom68 ld68 lorder68 nm68 pr68 rl68 size68
LIBS=a68.hdr

install: cc68
	cp $(LIBS) $(DL)
#	cp $(PRGS) $(DP)

cc68:	cc68.o
	cc -o cc68 cc68.o

clean:
	rm -f cc68 *.o
s1 = s;
	s[-1] = 0;
	if (strlen(s1) > (MAXNAMLEN - suflen)) {
		s[-suflen] = 0;
		s[-(suflen-1)] = '.';
	}
	return(strspl(s1,suff));
}


callsys(f, v)
	char *f, **v;
{
	int t, status;
	char cmd[256];
	
	if (version && version[2]=='L' && *f!='/')
	  {
	  	/*
		 * We substitute the LucasFilms versumacc/cc42/lorder68   555      0     12         643  3470501274   7414 #! /bin/sh
trap "rm -f $$sym?ef; exit" 0 1 2 13 15
case $# in
0)	echo usage: lorder68 file ...
	exit ;;
1)	case $1 in
	*.b)	set $1 $1
	esac
esac
nm68 -g -f  $* | sed '
	/^$/d
	/:$/{
		/\.b:/!d
		s/://
		h
		s/.*/& &/
		p
		d
	}
	/[TD] /{
		s/.* //
		G
		s/\n/ /
		w '$$symdef'
		d
	}
	s/.* //
	G
	s/\n/ /
	w '$$symref'
	d
'
sort $$symdef -o $$symdef
sort $$symref -o $$symref
join $$symref $$symdef | sed 's/[^ ]* *//'
	if (version && version[2]=='L' && *f!='/')
	  {
	  	/*
		 * We substitute the LucasFilms versumacc/cc42/a68.hdr   444      0     12        1373  3470501301   7126 | Pre-Assembly Code

| The remainder of this file consists of statements that are 
| interpreted before every 68000 program.

| Define Register Names

.defrs	d0, 0., d1, 1., d2, 2., d3, 3.
.defrs  d4, 4., d5, 5., d6, 6., d7, 7.
.defrs	a0, 8., a1, 9., a2, 10., a3, 11.
.defrs	a4, 12., a5, 13., a6, 14., a7, 15.
.defrs	sp, 15., pc, 16., cc, 17., sr, 18., usp, 19.
| Next line is for 68010. --TPM
.defrs  sfc, 20., dfc, 21., vbr 22.

| Set Input and Output Radices

.radix	in, decimal
.radix	out, hex

| Define registers for movem
| D3 means just d3, D3+A2 means d3 and a2, A2-D3 means a1,a0,d7,...,d4,d3

D0	=	/1
D1	=	/2
D2	=	/4
D3	=	/8
D4	=	/10
D5	=	/20
D6	=	/40
D7	=	/80
A0	=	/100
A1	=	/200
A2	=	/400
A3	=	/800
A4	=	/1000
A5	=	/2000
A6	=	/4000
A7	=	/8000
ALL	=	0
rectory at the begining if not
		* already specified, so you can have other versions
		* in your path without screwing up.
		*/
	    strcpy( cmd, BinDirectory);
	    strcat( cmd, f);
	   }
	 else strcpy( cmd, f);

	if (zflag) 
	  {
	  	/*
		 * print out a tracesumacc/cc42/libc.a   444      0     12      253672  3470501304   7162 !<arch>
clrerr.b        406162685   11    21    100664  118       `
 6NVÿüHî ÿü*nmÿÏLî ÿüN^Nu _S1_F1"clearerr.L18fgetc.b         406162738   11    21    100664  203       `
@cNVHî nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹XN^Nu _filbuf_S10.L10000<.L10001_F1"fgetc<.L186
fgets.b         406162742   11    21    100664  299       `
l—NVÿôHî0€ÿô*n(nS®o4S•m -R­ @H€HÀ€ÿ`
HUN¹X.m
Ç‡
fÆJ‡l¹îfB€``¶B .Lî0€ÿôN^Nub.L17 _filbuf€0_S14.L10000Z.L21\.L22L.L20>.L10001_F1"fgets.L198
fprintf.b       406162760   11    21    100664  205       `
@eNVHî/.Hn/.N¹ßü n0(HÀ€ gpÿ`B€N^Nu_S18.L10000"fprintf _doprnt:.L10001_F1:.L18
fputc.b         406162764   11    21    100664  211       `
HcNVHî nSm . nR¨"(S A€H€HÀ`/. ./N¹PN^Nu_S10.L10000"fputc _flsbufB.L10001_F1B.L18<
fputs.b         406162768   11    21    100664  281       `
TNVÿðHî0Àÿð*n(n`*S”m ",R¬ A€H€HÀ`HT /N¹P.H€HÀ,fÌ Lî0ÀÿðN^NuÀ0_S1..L10000H.L20 _flsbuf"fputs>.L20000<.L10001_F1.L20001>.L19J.L186
gets.b          406162777   11    21    100664  334       `
p–(NVÿøHî €ÿø*nS¹m 9R¹ @H€HÀ€ÿ`/<N¹X.€
gJ‡mÇ`¼J‡l
»îfB€`B .Lî €ÿøN^Nu _filbuf€ _S12.L10000"gets`.L22R.L21.L20@.L10001_F1f.L18 _iob+½
‹°
+½
‹°
4:getw.b          406162781   11    21    100664  315       `
|NVÿøHî €ÿø*nS•m -R­ @H€HÀ€ÿ`
HUN¹X.0-HÀ€gpÿ`*S•m -R­ @H€HÀ€ÿ`
HUN¹Xက‡Lî €ÿøN^Nu _filbuf€ _S1*.L10000H.L20n.L10003"getw4.L10001_F1d.L10002r.L18.h
puts.b          406162785   11    21    100664  473       `
ÙPNVÿøHî €ÿø*n`4 "9R¹ A€H€HÀ`S¹lÞ/< /N¹PH€HÀ.fÜS¹m 9R¹ @¼
H€HÀ`/</<
N¹PLî €ÿøN^Nu€ _S12.L10000N.L20 _flsbuf„.L10003*.L20002"putsD.L20000D.L10001_F1p.L10002.L20001D.L19„.L18 _iob‹°K½K½,‹°4>K½P‹°XK½^‹°r~
putw.b          406162789   11    21    100664  290       `
p‚NVÿøHî €ÿø..*nS•m "-R­ A€H€HÀ`HU /N¹PS•m à€"-R­ A€H€HÀ`HU à€/N¹PLî €ÿøN^Nu€ _S1,.L10000 _flsbuff.L10003:.L10001_F1"putwV.L10002f.L184`scanf.b         406162793   11    21    100664  462       `
œò NVHîHn/./<N¹ßüN^NuNVHîHn/./.N¹ßüN^NuNVÿìHî ÿì*n=|Aÿü-Mÿø-MÿôB®ÿð`R®ÿðJføHn/.HnÿðN¹ßüLî ÿìN^Nu_S1"Nsscanf.L23x.L25t.L24J.L21 _doscan _S3"(fscanft.L20000_F1_S2_F2"scanfp.L20001_F3$.L18 _iob‹°@†doscan.b        406162735   11    21    100664  5060      `
t€ø	¸NVÿÜHî0€ÿÜ*n(nB®ÿüB®ÿìH€HÀ.€g0€	g”€
gŠ€ g€€%g* nSmÎ nR¨ (S€ @H€HÀ€ÿ`ºH€HÀ.€%gÆB®ÿð‡*g
 LXŒ-Hÿð`H€HÀ.B®ÿø-|ÿè`.‡9n./<
/.ÿøN¹PЇ€0-@ÿøH€HÀ.‡0lÊJ®ÿøf-|u0ÿø‡lfH€HÀ.-|ÿè`(‡hfB®ÿèH€HÀ.`‡[f
HUa¤X*@ € @H€HÀ€g € .-|ÿèJ‡fpÿ`øHnÿì/./.ÿè/.ÿø//.ÿðaèßüJ€g
J®ÿðgR®ÿüJ®ÿìgþtJ®ÿüf¬pÿ`´`þb/.N¹X`$ nSmê nR¨ (S€ @H€HÀ€ÿ-@ÿô€ gÐ€	gÈ€
gÀ®ÿÿÿÿÿôgþ/./.ÿôN¹P`ýô/.N¹X-@ÿô°‡gýÞ€ÿÿÿÿfpÿ`/./.ÿôN¹P .ÿü``ý¸`ý´Lî0€ÿÜN^NuNVÿœHî Àÿœ®cg®sg
®[f0/./././.J®g n `B€/a¶ßü`¢B®ÿ¨B®ÿ¬B®ÿ¸®eg
®ff-|ÿ¸|
®of|`®xf|AîÿÀ*HB®ÿ¼B®ÿ´ nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹X.€ gÄ‡	g¼‡
f`²‡-fBR®ÿ´Ç nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹X.S®`î‡+fäS® nSl¸/.N¹X`Ä‡am‡fo‡AmÎ‡FnÄR®ÿ¬†f .ÿ¨ç€`†
f .ÿ¨å€Ð®ÿ¨ã€` .ÿ¨é€-@ÿ¨-Gÿ°‡0m‡9n‡0`‡am‡fn‡W`‡7ß®ÿ¨..ÿ°Ç nSm, nR¨ (S€ @H€HÀ€ÿ.S®m2‡0m
‡9oÿJ†gÿ‡.fH†
fJ®ÿ¸f2J®ÿ´g
 .ÿ¨D€-@ÿ¨‡ÿÿÿÿgÌ/./N¹P nB`¾R®ÿ¬`ÿf‡eg‡Ef¶J®ÿ¼f°†
f¨J®ÿ¸g¢J®ÿ¬f`šR®ÿ¼Ç nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹X.‡+gþö‡-gþì‡0mÿD‡9oþØ`ÿ6`þÐ`ÿ./.N¹X`þä n ¼J®gAîÿÀ»ÈfB€`’B .ÿ¸é€€®€b0Ð@0;NûZff&&&&&&&&&&&&&**@p`HHnÿÀN¹X n P €`æHnÿÀN¹X n P €!A`Ì n P0®ÿª`À n P ®ÿ¨`´Lî ÀÿœN^NuNVÿìHî8€ÿì*n(n nB&M®cf®u0f-|B®ÿü®sf-|ÿüS”m ,R¬ @H€HÀ€ÿ`
HTN¹X.€t @H€HÀÀ®ÿüg‡ÿÿÿÿf¼-|ÿü®cfB®ÿü`d`¢®[fX-|ÿü`N €t @H€HÀÀ®ÿüf@»ügÇS®o0S”m ,R¬ @H€HÀ€ÿ`
HTN¹X.‡ÿÿÿÿfª‡ÿÿÿÿgJ®oHT/N¹P nB`
 n ¼»üg»Ëg®cgBp`B€Lî8€ÿìN^NuNVÿôHî Àÿô*nB†^fR†RB‡‡€l>J†g €t @ÿý` €t @R‡`Ò €t @ÿýR‡J‡fS`*H€HÀ.€€]gJ†gÎ €t @`Ì 
Lî ÀÿôN^Nu6.L130æ.L10032è.L88n.L79.L10020"t_instr$.L52R.L30>.L131~.L10034€.L111˜.L20006ê.L10010š.L10007 _filbufr.L42¢.L31€0_S1€.L110.L106 fltusedæ.L93
.L83Â.L73°.L10000ª.L32.L63æ.L332.L20018¸.L10019h.L23d.L22d.L25h.L21î.L34Œ.L29|.L28Z.L27".L26.L24À.L105^.L98 .L44ü.L35#t_sctab_F4¼.L89ž.L20004.L36(.L10005R.L54b.L20016.L74ž.L10017.L64¶.L45>.L37À.L104¨.L84,.L38"_doscan€8_S3 atof".L94’.L20009`.L55È.L46>.L39&.L129‚.L20014ª.L10015h.L128>.L127ª.L103.L65ì.L20002È.L47º.L10003".L126^.L99¸.L100294.L75J.L56 _ctype_.L125 .L10027Æ.L90Š.L20012N.L10013È.L48ø.L124Ò.L102j.L10025>.L85–.L20007¸.L10008>.L123".L10023j.L66j.L57".L122Ü.L10031".L95.L20010h.L80ì.L10021h.L10011².L10001æ.L20000j.L120ö.L121t.L10033ø.L101*.L76$_F14.L20019Ì.L119.L100v.L70Ü.L20005´.L674.L10006Ð.L118Ú.L91¤.L86"Ü_getccl´.L117€.L20017.L10018Ê.L59À _S2n.L814.L77¢.L1168.L96 .L68d.L20015Ø.L710.L20003Ì.L10016d_F2ì.L10004ª.L115 ungetc€.L109v.L87È.L50X.L114.L92 .L69†.L20013P.L78ž.L10014ò.L61.L82”.L20008¬.L10028º.L10009À _S4R.L113.L108v.L10026 .L72.L51È.L10002"r_innum>.L40¸.L20001R.L97<.L10024Ž.L20011B.L10012 lmulˆ.L112.L107_F3Ô.L10030Ø.L10022.L62h.L41¬ÌSBÀ.TH¤Òúp²>(>>à	ê	6xœ			*	\filbuf.b        406162750   11    21    100664  1661      `
H0upNVÿüHî ÿü*n0-HÀ€fpÿ`¢0-HÀ€@g.pÿ`Žm` 0-HÀ€gê-H€HÀ€H+@J­gÚ+m0-HÀ€gp` <//-aBP*€S•l•ÿÿÿÿfm`m B•pÿ` mH€HÀ€ÿR­Lî ÿüN^NuNVÿèHî0ðÿè*n..(MB…B„`JN¹€
f|
/N¹XÆ
g*H€HÀ€gvnò€g€g
`úpÿ`/< N¹XSŒS…gÞS…SŒ	f(|HU/<\N¹P`º/<`N¹X`¨(MB…/<d`èBSŒS…HU/<j`ÆUŒS…B„J…gJ„g g	fRŒ`l	f,	g fBSŒ S…J€fèHU/<nN¹P`¸`Ô gR„SŒS…/<rN¹X`š`€gÿn€g€€gÿ R…°‡mþ° Lî0ðÿèN^Nu
%s  XXX

%s
%s ¬.L520.L30„.L20006x.L42:.L31 _S1"_filbuf|.L10000.L63À.L53.L33"Ìx_read<.L29¨.L28¢.L27®.L26d.L23^.L216.L24^.L22".L20\.L44.L35Ä.L54r.L200044.L36†.L45.L64.L378.L38 emt_putcharÄ.L55`.L46>.L390.L20002Ö.L10003Š.L47ö.L56 emt_getchard.L48~.L20007Ê.L57–.L49‚.L10001^.L20000_F1â.L58l.L20005ô.L59ð0_S2n.L60è.L20003_F2j.L50þ.L61À.L10002¦.L51L.L40>.L20001H.L19r.L62 printfT.L41Â.L18	V&êF‰°h=n‰°z=€‰°‰° ‰°æ=쉰=

setbuf.b        406162797   11    21    100664  232       `
XhNVÿüHî ÿü*nJ­g0-HÀ€g/-N¹Xmÿó+nfm`+mB•Lî ÿüN^Nu _S1J.L22D.L21"setbuf_F1 free..L19L.L18(sprintf.b       406162801   11    21    100664  273       `
luNVÿðHîÿð=|Bÿü-nÿô-|ÿÿðHnÿðHn/.N¹ßüS®ÿðm .ÿôR®ÿô @BH€HÀ`Hnÿð/<N¹P .N^Nu_S1P.L10000 _flsbuf _doprntb.L10001_F1"sprintff.L18,\
ungetc.b        406162810   11    21    100664  252       `
dxNVÿüHî ÿü*n®ÿÿÿÿfpÿ`>0-HÀ€g
 -°­b -°­fJ•fR­R•S­ m®B€`pÿLî ÿüN^Nu _S14.L10000F.L22X.L21F.L20_F1"ungetc.L19Z.L18abs.b           406162815   11    21    100664  130       `
$>NVHîJ®l
 .D€-@ .N^Nu_S1.L13.L12_F1"absatof.b          406162830   11    21    100664  1894      `
àXðNVÿÔHî àÿÔ*nB†B…-yÿø-yÿü-y ÿð-y$ÿô-|ÿè-|ÿäH€HÀ.€ gð‡-f
-|ÿÿÿÿÿè`z‡+grS`n/9ä/9à/.ÿü/.ÿøN¹lP €0/N¹X///.ÿü/.ÿø/9,/9(N¹ßü//N¹ßü-@ÿø-Aÿü`R†H€HÀ. € @H€HÀ€fÿr‡.f’H€HÀ. € @H€HÀ€gp/9ä/9à/.ÿü/.ÿøN¹lÄ €0/N¹X///.ÿü/.ÿø/94/90N¹ßü//N¹ßü-@ÿø-AÿüS†`ÿr‡Eg‡efpH€HÀ.€+g2‡-f
-|ÿÿÿÿÿä` S`/<
/N¹P"0Ð*H€HÀ. € @H€HÀ€fÄJ®ÿäl D€*Ü…-FÿìJ†l D€,B‡`4 €g" 瀀è @/(/HnÿðN¹ßüâ†J†g
R‡‡mÄJ®ÿìl/.ÿô/.ÿðHnÿøN¹`/.ÿô/.ÿðHnÿøN¹ßü/.ÿì/.ÿü/.ÿøN¹ßü-@ÿø-AÿüJ®ÿèl//N¹P` .ÿø".ÿüLî àÿÔN^Nu\€A BÈE@I¾¼ SÉ¿enSü²ï`@€B B š.L30.L17.L42
.L31à _S1 fltusedÖ.L15ª.L10000š.L32#èexp5#àtwoe56(.L43–.L330.L34.L26Þ.L22Þ.L24Þ.L29(.L28Ü.L27l.L23Þ.L25d.L21R.L20^.L44.L35,.L20004º.L36 fnegh.L45ì.L37Ì.L38`.L46ì.L39"atofX.L47Ð.L20002 _ctype_^.L48 ldexp‚.L49p.L20000 fadd,_F1”.L20005 fcmp afdiv`.L20003š.L50 floatÎ.L51ì.L20001ì.L40 lmul fmulB.L19 afmul.L41 .L18‰°‰°‰°$‰°,‰°r‰°x-†1˜‰°¬‰°²6¸*È%ê%‰°,‰°2-@1R‰°f‰°l6r*‚5Ú%ø	<8N.|8'¨Æatoi.b          406162820   11    21    100664  458       `
„NVÿôHî Àÿô*nB‡B†`RH€HÀ€	gð€ gè€+g
€-f,R†R`&9n&/<
/N¹PHHÁЀ0.0lÔJ†g D€` Lî ÀÿôN^Nu.L17h.L16À _S1x.L10000.L15h.L14n.L23h.L22<.L20>.L21.L13z.L12B.L20002z.L10001.L20000_F1"atoih.L20001 lmul.L19.L18Ratol.b          406162835   11    21    100664  470       `
NVÿôHî €ÿô*nB®ÿüB‡`RH€HÀ€	gð€ gè€+g
€-f0R‡R`*9n*/<
/.ÿüN¹PHHÁЀ0-@ÿü0lÐJ‡g .ÿüD€` .ÿüLî €ÿôN^Nu.L17n.L16€ _S1€.L10000.L15n.L14t.L23n.L22>.L20@.L21.L13„.L12"atolD.L20002„.L10001.L20000_F1n.L20001 lmul.L19.L18Vblt.b           406162837   11    21    100664  216       `
¬ o"o €"	²€g
"/`r"/J€gD€T€°l^’€S€ÙS€lÿú €ÿÿÿügF’€ä€€m.Hç>LÙ|þHÐ|þÑü0€€lÿäLß|þJ€gS€ ÙS€lÿúJgSÙSlÿú /Nu"bltclear.b         406162839   11    21    100664  240       `
¬"/ /glÒ€ AgB S€gZ"ÿÿÿg4àHçÿ~/"|xLÑ|ÿ"@Hàÿ~Hàÿ~Hàÿ~Hàÿ~HàÿS—nè"Lß~ÿ"ÿÿÿügB YnúJ€gB S€núNuxzeros"clearˆ°2crypt.b         406162865   11    21    100664  6536      `
Ø´lpNVÿìHîàÿìB‡`J €X @H€HÀS€Ð® @ €Ð"@ €t @H€HÀS€Ð® @ €ì"@R‡‡m®B‡‡l$B…`v9ÐH€HÀ-@ÿüB†` €Ñ @ €Ð"@R††màîÿÿë9ìH€HÀ-@ÿüB†` €í @ €ì"@R††màîÿÿR… € @H€HÀº€mÿvB††l‚/<0/N¹P€І-@ÿø €  @H€HÀ€Ï @"nÿø/<0/N¹P€І€-@ÿø €¸ @H€HÀ€Ï @"nÿøR†`ÿxR‡`þÖLîàÿìN^NuNVÿèHîäÿèB†`& €Ø @H€HÀS€Ð® @ €
ˆ"@R††@mÒB®ÿø`J®gp®ÿø-@ÿü`-nÿøÿüB†` €
¨ @ €
È"@R†† màB†`P/<0/.ÿüN¹P€І @H€HÀ" AHHÁ
§ AHHÁ± € @R††0m¨B†`/</N¹P. € @H€HÀë€"	 AHHÁçÐ"
 AHHÁåÐ" AHHÁãÐ" AHHÁB‚å¡Ð"íhÒ€ €
 @H€HÀé€Ò€ AH€HÀ* å€. 怀"
è A€ 䀀"
é A€  "
ê A€ Bâ €"
ë A€R††mþöB†`> €
ˆ @H€HÀ"
h AHHÁ
ç AHHÁ³€"
¨ A€R†† mºB†† l €
È @ €
ˆ"@R†`ÞR®ÿø®ÿømýÚB†`6 €
ˆ @H€HÀ. €
¨ @ €
ˆ"@ €
¨ @‡R†† mÂB††@l& € @H€HÀ€
‡ @ .І"@R†`ÒLîäÿèN^NuNVÿìHîàÿìB‡` €8 @BR‡‡BmêB‡`8‡@l>B†`p†"à¡ €8 @R†R‡†mÚR‡R® nH€HÀ*fº/<8aû
XB‡` €8 @BR‡‡BmêB‡` €8 @ €"@R‡‡0màB‡`Ü nH€HÀ*R® €z @……Zo]……9o_…….B††l˜ ì €g„/</N¹PІ€ @H€HÀ-@ÿü/</N¹PІ€-@ÿø/</N¹PІ€  @"nÿø/</N¹PІ€ -@ÿø @®ÿÿR†`ÿbR‡‡mÿB‡`/</<8aûdPR‡‡mäB‡`\B…B†`&ã…/</N¹PІ€8 @H€HÀŠ€R††mÒ….…9o^……Zo\… €| @…R‡‡mœ €| @BJ9{f
ùz{ <zLîàÿìN^Nu:2*"
<4,$>6.&@80( 91)!	;3+#=5-%
?7/'(08@ '/7?&.6>%-
5=$,4<#+3;"*
2:!)	1991)!	:2*"
;3+#<4,$?7/'>6.&=5-%


)4%/7(3-!0,1'8"5.*2$  		


 

	

	
	
	

	



	

	

	
	

	

	


	
	


	
	


	

	

	

	
	

	

	
	

	


	

	


	

	

	

		



	
 	
.L20031Ü.L88v.L79Ê.L52ü.L30:.L111>.L20033æ.L20006æ.L31à_S1 PC2_CtPC1_DB.L110&.L20035.L106Ò.L938.L83ô.L73˜.L32L.L20037j.L63Ô.L53¢.L33F.L20039ø.L20018Ž.L27ˆ.L26ä.L29š.L34Ž.L22b.L28`.L24V.L23X.L25ØIP.L1058.L98Ò.L35¸PC2_Dî.L89Ì.L54Ü.L36Ô.L20004KSÒ.L74È.L20016t.L648eÔ.L37n.L104z.L84è
f‚.L38
.L94à_S3ô.L55¦.L20009ˆ.L39shifts|.L20014d.L103l.L65š.L200020.L99.L20028<.L75.L56à.L20026à.L90l.L20012.L102Ò.L20024š.L85p.L20007œ.L20022z.L66ø.L570.L20030.L95H.L80>.L20020.L20010X.L20000È.L120".L101.L20032F.L76_F1ÐC”.L119:.L20034î.L58Ü.L20019È
tempLEìDr.L20036.L100Ð.L70†.L67¼.L20005FP¢.L20038Š.L118Î.L91¤.L86r.L117Š.L20017ô.L59ä_S2>.L77ˆ
Lz.L116.L96|.L68.L60È.L71z.L20015_F2‚.L20003p.L115"€crypt"˜encrypth
P8.L109œ.L87preS¨
RhS"setkey¢.L114þ.L20029Ú.L92r.L78Æ.L69.L20013.L61Î.L82¨.L20027Ì.L20008ª.L113.L108´.L20025v.L51ð.L72þ.L40.L20001..L97Ž.L20023ø.L20011 lmulXPC1_C .L112v.L107_F3.L20021.L62		*	6	N‰°r	†	‰°¦‰°¬	À	ʉ°à	ê–		(	6–L	T	h	v	ª	Â	ü	–(	0	B	P	b–„		¢	¶	Ê	Þ	ö		.	D	Z	r	Ž	ž	¬	¾	Þ	è			(	4	T	b	’	Ɖ°ð			&	R–˜	¢–¼	Æ–Ø	â–ø	‰°.–X	b	˜	®©f¸‰°À‰°Ä‰°Êctype_.b        406162869   11    21    100664  180       `
„                            #_ctype_index.b         406162882   11    21    100664  179       `
,gNVÿøHî €ÿø*n.°f 
`JfòB€Lî €ÿøN^Nu.L16€ _S1.L15.L14 .L13".L12_F1"index
qsort.b         406162891   11    21    100664  1345      `
,PNVHî#î,#î0/./.N¹PЮ//.aPN^NuNVÿàHî0€ÿà.90 .®-@ÿì°‡cT ã€//.ÿìN¹P//N¹P-@ÿìЮ-@ÿø-@ÿô*n .‡(@`Ÿ®ÿø/.ÿøHUaP»îÿødˆ/.ÿøHU y,NP-@ÿðgÒJ®ÿðm\`h»îÿøfHHTß®ÿô/.ÿôHUaßüß®ÿø*nÿø`BHT/.ÿô y,NP-@ÿðf$HTß®ÿô/.ÿôa¢P`HTHUa–P™ÇÛÇ`ÿ|J®ÿðnš™Ç¹îÿôb¸»îÿøfL .ÿø®".’®ÿô°m/. .ÿôЇ/aþÖP-nÿø`þÚ/.ÿø/.aþ¾P .ÿôЇ-@`þ¾HUŸ®ÿø/.ÿøHTaLßüŸ®ÿô(nÿô`þüLî0€ÿàN^NuNVÿðHî0€ÿð-y0ÿü*n(nÔÇS®ÿüfôLî0€ÿðN^NuNVÿìHî8ÿì-y0ÿø*n(n&nH€HÀ-@ÿüÓÔîÿÿS®ÿøfèLî8ÿìN^Nu.L30L.L17.L42Ð.L20006°.L16 ulmul_S1.L32t.L338.L14°.L20Œ.L34>.L278.L228.L256.L290.L28È.L238.L26ª.L21à.L35_F4à.L36*.L20004Ú.L37"qsortÔ.L38 .L39€0_S3êqstexc8.L20002<qs1ª.L20000ºqsexc uldiv_F1*.L20005€0_S20qsesö.L20003 _F2,qscmp .L408_S4š.L20001¬.L19 lmul.L41_F3^.L18‰°‰°$‰°H"j.v‰°º‰°þ‰°Æ‰°ö
rand.b          406162895   11    21    100664  276       `
P€ NVHî#îPN^NuNVHî/<AÆNm/9PN¹P€09#ÀPrâ €ÿN^Nu_S1J.L15"rand.L13Prandx_F1_S2_F2"srand lmul‰°‰°(	.‰°<rindex.b        406162898   11    21    100664  184       `
0hNVÿôHî0€ÿô*n.(|°f(MJfô Lî0€ÿôN^Nu .L16€0_S1.L15 .L14$.L13&.L12_F1"rindexsetjmp.b        406162900   11    21    100664  99        `
$ o —HèüüB€Nu o /Lèüü.Nu"longjmp"setjmp
strcat.b        406162903   11    21    100664  180       `
,hNVÿôHî8ÿô*n(n&MJfüSÜfü Lî8ÿôN^Nu.L168_S1"strcat.L15.L14.L13 .L12_F1strcatn.b       406162907   11    21    100664  210       `
<vNVÿðHî8€ÿð*n(n..&MJfüSÜgS‡løSB ``îLî8€ÿðN^Nu..L17*.L16€8_S1.L15"strcatn.L14.L130.L12_F1strcmp.b        406162911   11    21    100664  199       `
<kNVÿøHî0ÿø*n(n`JfB€`°gòH€HÀSŒHHÁLî0ÿøN^Nu0_S1.L15".L14.L132.L12.L20000_F1"strcmp
strcmpn.b       406162914   11    21    100664  276       `
H¬NVÿôHî0€ÿô*n(n..`B€`"°fJgòS‡lòJ‡mêH€HÀSŒHHÁLî0€ÿôN^Nu€0_S1..L10000&.L15*.L14&.L13>.L12&.L20002>.L10001.L20000"strcmpn_F1.L20001strcpy.b        406162917   11    21    100664  146       `
$NNVÿôHî8ÿô*n(n&MÜfü Lî8ÿôN^Nu8_S1.L14.L13.L12_F1"strcpystrcpyn.b       406162921   11    21    100664  291       `
@ÃNVÿðHî8€ÿð*n(n&MB‡`Üg`BR‡¾®mö`R‡¾®mæ Lî8€ÿðN^Nu .L17*.L16€8_S1,.L152.L14*.L134.L12"strcpyn,.L20002 .L20000_F1.L20003.L20001(.L18
strncat.b       406162927   11    21    100664  210       `
<vNVÿðHî8€ÿð*n(n..&MJfüSÜgS‡løSB ``îLî8€ÿðN^Nu..L17*.L16€8_S1.L15.L14.L130.L12_F1"strncatstrncmp.b       406162931   11    21    100664  276       `
H¬NVÿôHî0€ÿô*n(n..`B€`"°fJgòS‡lòJ‡mêH€HÀSŒHHÁLî0€ÿôN^Nu€0_S1..L10000&.L15*.L14&.L13>.L12&.L20002>.L10001.L20000_F1"strncmp.L20001strncpy.b       406162937   11    21    100664  291       `
@ÃNVÿðHî8€ÿð*n(n&MB‡`Üg`BR‡¾®mö`R‡¾®mæ Lî8€ÿðN^Nu .L17*.L16€8_S1,.L152.L14*.L134.L12"strncpy,.L20002 .L20000_F1.L20003.L20001(.L18
swab.b          406162941   11    21    100664  209       `
PYNVÿôHî0€ÿô*n(n../</N¹P.S‡m0HÀá€2HÁàÿÐ8ÀT`âLî0€ÿôN^Nu€0_S1F.L14"swab(.L13F.L12_F1 ldiv 
abort.b         406162943   11    21    100664  54        `
NAB€Nu"abortaldiv.b         406162944   11    21    100664  208       `
ŒNVHç<*< n lD€D…&".lDD…(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚ J…lD€ €Lß<N^Nu ulmul"aldiv+²lalmul.b         406162946   11    21    100664  130       `
TNVHç8(< n$lD‚D„&.lDƒD„B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐJ„lD€ €LßN^Nu"almulalrem.b         406162948   11    21    100664  212       `
NVHç8(< n lD€D„$".lDlB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€J„lD€ €LßN^Nu ulmul"alrem+²nauldiv.b        406162950   11    21    100664  185       `
tNVHç8 n &".(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚  €LßN^Nu ulmul"auldiv+²Z
aulmul.b        406162952   11    21    100664  99        `
4NVHç0 n$&.B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐ €LßN^Nu"aulmul
aulrem.b        406162953   11    21    100664  185       `
tNVHç0 n $".lB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€ €LßN^Nu ulmul"aulrem+²Z
chrtab.b        406163071   11    21    100664  1583      `
$$~$$~$$>A@>A>ab#C8DH00IFF9         I**I~ @$BBBBBB$8D @@|~D8$D~|@@XdB$<B@XdBBB$~   "A">AAAA>"AAA#   @ @  @$B<BAMSQQQI&"AAAAAA~AAA~AAAA~>A@@@@@@A>~AAAAAAAA~~@@@x@@@@@@@|@@@@@>A@@OAAAA>AAAA~AAAAADD8ABDHPpHDBA@@@@@@@@@AcUIAAAAAAAaQIECAAAA>AAAAAAAA>~AAA~@@@@@>AAAAAAYE>~AAA~DBAAA>A@@>A>AAAAAAAAA>AAAAAAA"AAAAIIUcAAAA""AAAA" @@@ 88"ÿ <>BB>@@@@|BBBB|<B@@B<>BBBB><B|@B<~>BBBB>B>@@@@|BBBBB(@@@@FHPpHFvIIIII@|BBBBB<BBBB<|BBBB|@@@@>BBBB>\b@@@@>@<B<~BBBBB=AAA"IIIII6B$$BBBB" @~ ~ *~~~~~~~~~~#chrtab
ddtinit.b       406163117   11    21    100664  101       `
5NVHîN^Nu_S1
.L12_F1"ddtinit
exit.b          406163074   11    21    100664  110       `
2NVÿüHî€ÿü..NNLî€ÿüN^Nu€_S1.L12"exit_F1getenv.b        406163109   11    21    100664  804       `
ŒD NVÿüHîÿü-|Œÿü`0 nÿü//.a0PJ€f/.N¹X nÿü"Ò€R `X®ÿüJ®ÿüfÊB€N^NuNVHî`  .R® @".R® A°gp`
 nJfØB€N^NuTk{„PATH=/usr/sun/bootfileHOME=/mnt/guestTERM=sunUSER=guestL.L17_S1„.L15{.L14„.L26|.L27†.L24|.L25@.L22D.L20k.L13T.L12#Œenvp"getenv"Pstrpref\.L20002D.L20000_F1_S2 strlen_F2.L20001J.L19@.L18‰°,iîiîiîiîstrlen.b        406162924   11    21    100664  178       `
$nNVÿøHî €ÿø*nB‡`R‡Jfú Lî €ÿøN^Nu€ _S1.L14.L13.L12.L20000_F1"strlen.L20001signal.b        406163115   11    21    100664  436       `
T@NVHîN^NuNVHîN^NuNVHîN^NuNVHîN^NuNVHîN^NuNVHîN^Nu&.L16_S1.L14P.L22B.L20_S6
.L12_F4"sighold_S3_F5"	*sigignore_S5_F1_F6"signal_S2"8sigrelse_F2"Fsigpause_S4"sigset4.L18_F3stubs.b         408926823   121   21    100644  515       `
h<(NVHî/./<hN¹PN^NuNVHî/<ŽaÎXN^NuNVHî/<“a¶XN^NuNVHî/<™ažXN^NuThe routine %s is not implemented!!!
timeftimelocaltimeŽ.L174.L16_S1h.L14d.L22™.L23“.L20.L12_F4"8ftime_S3_F1"
noSuchProc" time_S2_F2_S4"	PlocaltimeL.L19_F3 printf‰°‰°,‰°D‰°\
printf.b        406163081   11    21    100664  233       `
@qNVHî/<Hn/.N¹ßü09HÀ€ gpÿ`B€N^Nu_S18.L10000 _doprnt:.L10001_F1:.L18 _iob"printf‹°‹°&
doprnt.b        406162709   11    21    100664  3119      `
ô«hNVÿ4Hî<üÿ4*n(n&nAîÿt$H`œÇ`–%fôAîÿtµÈg(HS/<Aîÿt 
ˆ/HnÿtN¹ßüAîÿt$HB.ÿhB„| ÿi-fR.ÿhR0f|0ÿiR*g2B…H€HÀ€0,m2†	n*/<
/N¹PІ*`Ò`RH€HÀ€0,*B.ÿg†0†.fR*g<B„` †	n(R.ÿg/<
/N¹PІ(H€HÀ€0,lІ0`RH€HÀ,R.ÿg( €egFnP€Ogön€%gd€Dgê€Lgx€Ug˜€XgÊ€cg€dgº€og¦n€fgT€ggâ€lg(€rg0€sgö€ug4€xgh`ÞH€HÀ€dgZ€ogH€ug
€xg>S$v
J‚fJ„fü0Aîÿj-HÿüJ‚gZ//N¹P,†
l&p0`$v$`Èv`øv
J”lü- D€$`²`¬$`¬pWІ nÿü€R®ÿü//N¹P$`¢Aîÿj .ÿü°ˆc¸S®ÿü nÿüÐ`æ LXŒ-HÿüB††l˜ .ÿüR®ÿü @ÐfSŠR†`â-\ÿüf-|ôÿü,f,<ÿ$nÿüJgjS†mdRŠ`ð`\(T*\`ÆJ.ÿgfxHnÿøHnÿô//,/N¹ßü-@ÿüPŒJ®ÿøgü-,.ÿônü0` nÿüÐR®ÿüS†nò,gü. .ÿôD€-@ÿôoS†m
ü0S®ÿônòJ†oÖS†mÐ nÿüÐR®ÿü`î`ØJ.ÿgfx`R„HnÿøHnÿô//,/N¹ßü-@ÿüPŒJ®ÿøgü- nÿü0fR®ÿô nÿüÐR®ÿüü.,`
 nÿüÐR®ÿüS†nòüeS®ÿôJ®ÿômü+`ü- .ÿôD€-@ÿô/<
 .ÿô/N¹P€0À/<
 .ÿô/N¹P€0ÀAîÿt-Hÿü 
®ÿü"’€,lB†J.ÿhf D€,.ÿiH€HÀ/HS/ 
®ÿü//.ÿüN¹ßü`ûŠJ.ÿgfxHR//,/N¹ßüPŒJfüSŠ`Šü%fûhAîÿtµÈg"HS/<Aîÿt 
ˆ/HnÿtN¹ßüLî<üÿ4N^Nu(null)X.L79.L52î.L88Š.L30æ.L111 fcvt<.L42¸.L31&.L20006ü<_S1 fltusedØ.L110Š.L106D.L93ô.L83^.L10000–.L73Ì.L32\.L63ä.L43.L530.L33À.L22Ú.L24 .L34º.L29‚.L28t.L27\.L25,.L23º.L21f.L98<.L44€.L105.L35â.L20004<.L54ö.L89.L36º.L74.L64<.L450.L37@.L104 ecvtÖ.L84Ú.L38D.L94B.L46>.L20009<.L552.L39 _stroutl.L103.L65B.L47.L20002@.L75X.L99
.L56þ.L90F.L48ê.L124@.L102æ.L85.L20007"_doprntB.L57.L66¶.L123F.L49º.L20000d.L80@.L95`.L10001f.L122~.L101 .L76 uldiv¶.L120Ž.L121Ì_F1².L119B.L58º.L20005f.L100l.L67|.L70®.L118*.L91ê.L86F.L59º.L77¾.L81–.L1166.L96|.L68F.L60 ulrem@.L71è.L20003 gcvtŽ.L115Æ.L109Ú.L87X.L50.L1146.L92H.L78H.L61.L69Ì.L82.L20008ú.L113¸.L108@.L72.L51Þ.L40 .L20001L.L97 lmulê.L18â.L112Œ.L107Z.L62Þ.L414Lx¬xþb(Nr‰°Æ,žNb24€e¢4à
gcvt.b          406162773   11    21    100664  972       `
`4NVÿìHî0€ÿìHnÿüHnÿø/././.N¹ßü*@(nJ®ÿügü- .S€.` 
Ї @0f
S®S‡J‡nêJ®ÿøm .ÿø®€nJ®ÿølv®ÿÿÿýÿøllS®ÿøÝü.~`ÝR‡¾®möüeJ®ÿøl .ÿøD€-@ÿøü-`ü+/<
/.ÿøN¹P€0À/<
/.ÿøN¹P€0À`ZJ®ÿøn0gü.J®ÿøl
R®ÿøü0`ð~`ݾ®ÿøfü.R‡¾®oì .°®ÿøm`ü0 .R®°®ÿømîü.,.ÿÿfSŒB .Lî0€ÿìN^Nu$.L30V.L174.L20006.L31Z.L16€0_S1 fltused.L32€.L10000T.L15F.L33:.L14V.L134.L34.L29.L28ü.L26ü.L27.L25F.L24¶.L23².L22˜.L20’.L21B.L35P.L36.L20004 ecvt’.L200020.L20007p.L10001V.L20000_F1.L20005 ldivŽ.L20003 lrem"gcvtD.L20001.L19ì.L18 "Â$Üstrout.b        406162807   11    21    100664  616       `
  NVÿôHî0€ÿô*n..(nJ®lˆ-f<®0f2S”mH€HÀ",R¬ A€H€HÀ`HTH€HÀ/N¹PS‡S”m .",R¬ A€H€HÀ`HT ./N¹PR®`„HTH€HÀ/N¹PS‡m2S”mæH€HÀ",R¬ A€H€HÀ`ÞHT ./N¹PS®J®gS”mâ .",R¬ A€H€HÀ`ÚLî0€ÿôN^NuÖ.L10007€0_S1L.L10000ü.L26Ú.L24Ú.L25¤.L20 _flsbuf`.L21¤.L23¤.L10005"_stroutŒ.L10003^.L10001_F1Æ.L10006’.L10004|.L10002.L19ü.L18X†žÐflsbuf.b        406162757   11    21    100664  1036      `
´0NVÿäHî8àÿä*n0-HÀ€f pÿ`˜(m¹üf>»üNqm0-HÀ€gØnÿÿ|..ÿÿH€HÀ/N¹XB•`<`Ê -Œ.,o +LB…&Lº‡lH€HÀ/N¹XR…`è*¼ÿî+L¼‡g
m pÿ` .Lî8àÿäN^NuNVÿôHî0€ÿô*n0-HÀ€€f8(m¹üg, -Œ.o"+L*¼ S‡J€g LRŒHPN¹X`èB€Lî0€ÿôN^NuNVÿüHî ÿü*|»ùdHUaXÛü`êLî ÿüN^NuNVÿøHî €ÿø*n~ÿ0-HÀ€g*0-HÀ€@fHUaÿ:X.0-HÀ€gB­mÿ€B• Lî €ÿøN^Nu _lastbuf€.L308.L42´.L31à8_S1.L33.L34˜.L29”.L28˜.L27j.L26¦.L24<.L20l.L25".L22<.L21"_flsbufª.L44.L35_F4.L36 .L45N.L38 .L46 _S3"Âfflush"(_cleanup"Xfclose6.L20000_F1€0_S2 putchar_F2€ _S4F.L40N.L41_F3 _iob¸.L18Kº%0`Ž‹°%4Kº:data.b          406162690   11    21    100664  440       `
D<@#@_lastbuf _sobuf _sibuf#_iobkîkîiî@ecvt.b          406162879   11    21    100664  2179      `
4 ˆNVHî/</././././.a:ßüN^NuNVHî/</././././.a
ßüN^NuNVÿäHî0€ÿäJ®lB®®Om-|NB‡ nB*|4/9ˆ/9„/./.N¹l" n ¼/./.N¹P-@-AHnÿø/./.N¹ßü-@-A(|„/9/9Œ/.ÿü/.ÿøN¹gò(|„/9˜/9”/.ÿü/.ÿøN¹g–Hnÿø/9 /9œ/.ÿü/.ÿøN¹ßü//N¹ßü-@ÿð-Aÿô/9°/9¬/9¨/9¤/.ÿô/.ÿðN¹ßü//N¹ßü//N¹P€0SŒ€R‡`ÿP¹ü„dÜ`ô .€4(@J®fÙÇ n ‡¹ü4dxB94` /9¸/9´/./.N¹o¸/9À/9¼/./.N¹ßü-@ÿð-Aÿô/9È/9Ä//N¹lÿx-nÿð-nÿôS‡`®»Ìb^»ü„dV/9Ð/9ÌHnN¹ßüHnÿð/./.N¹ßü-@-A/.ÿô/.ÿðN¹P€0À`ž¹ü„eB9ƒ`>*LZ`0SŒR`*¼0¹ü4bî¼1 nRJ®f»ü4c¼0R9nÐB <4Lî0€ÿäN^NuB =õÂ\(õÃB B @€B ¬.L304.L17*.L16t.L42Î.L31"0fcvt_S1Ú.L32\.L15 fltusedÖ.L43Ú.L33Ú.L34Î.L26¤.L29œ.L28”.L27.L25.L23Œ.L24Ò.L21„.L22†.L20,.L13Ì.L44´.L35".L36æ.L45Ú.L37 fneg¼.L38"ecvt.L46Ä.L39€0_S3".L47ò.L20002þ.L48 fdiv fix`cvt.L49 modf.L20000 fadd_F1_S2 fcmp$.L20003_F2.L50.L51ì.L20001î.L40 fmult.L19 afmult.L41_F3‰°‰°–‰°œ/ªÄ*à‰°ô‰°ú‰°/‰°‰°‰°$/2‰°@‰°F&T*d‰°x‰°~‰°„‰°Š,˜6¨'¸IºÐ	àIºö‰îþ‰°‰°/‰°$‰°*68‰°L‰°R/\Iºz‰°‚‰°ˆ8’*ª'ÆIºØ‰îàIºøIº‰°&
lmul.b          406162968   11    21    100664  125       `
P
NVHç8(<$.lD‚D„&.lDƒD„B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐJ„lD€LßN^Nu"lmul
uldiv.b         406162973   11    21    100664  184       `
tNVHç8 .&".(lH@€ÿÿ€Á40€ÁH@0H@`6â€â€ÿÿÿÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚ LßN^Nu ulmul"uldiv+²\ulrem.b         406162976   11    21    100664  180       `
pNVHç0 .$".lB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€LßN^Nu ulmul"ulrem+²Xtermbas.b       406163096   11    21    100664  1677      `
Ì€IÀNVHî nJg R® @H€HÀ/N¹X`ÞN^NuNVHî`"€cgF€hgD€vgF/<:a¤X/<÷ašXB¹ÌN¹€€?fº/<`ÐR¹ÌR¹Ì``ÄN^NuNVHî/<N¹XN^NuNVHî 9Ì€g€g
€g`Ha¸ 9̀Р@H€HÀ/N¹X .€ /N¹X .€ /N¹XN^NuNVHîaÿb 9Ìå€€Ô @ Ю @H€HÀ/N¹XN^NuNVHîaÿ( 9Ì€à @H€HÀ/N¹XN^NuNVHîaþø 9Ì€ä @H€HÀ/N¹XN^NuÿÿÿÿYYaèíòJJKKABCDABCD;<=>
Supply terminal type (hit ? for help)
 v=vt52, h=h-19, c=concept Unknown type."	ºcursorpos˜.L30"jclearscreen,.L42z.L31_S1ò.L16‚.L32í.L15Æ.L53â.L43.L33è.L14#Ðcursmoš.L27÷.L28š.L25Š.L34^.L26,.L22,.L20
.L21_S6Ê.L44.L35_F4–.L36 getcharä.L45T.L37#Ôcursdi:.L38ä.L46_S3ä.L47\.L20002_F5#äcleolf.L49^.L20000_S5_F1#Ìtermtype_F6"žesc_char_S2"	0queryterm putchar"	šclearlineZ.L20003_F2_S7_F7"
0cursorstep#àcleos–.L51_S4¶.L40<.L20001"putstr_F3/$‰°V‰°`	îjp‰°„鼌鼒/°‰°Æ‰°è	î/þ//&‰°@	H/`‰°z	€/‰°ª	°/Àiîiîiî
getchar.b       406163077   11    21    100664  133       `
INVHîN¹N^Nu_S1.L12"getchar emt_getchar_F1
putchar.b       406163085   11    21    100664  153       `
(INVÿüHî€ÿü.H€HÀ/N¹XLî€ÿüN^Nu€_S1.L12 emt_putchar_F1"putchar
emtgetchar.b    406162986   11    21    100664  142       `
JNVHî/<N¹XN^Nu_S1.L12 emt_call"emt_getchar_F1emtputchar.b    406162991   11    21    100664  154       `
(JNVHî.H€HÀ//<N¹PN^Nu_S1".L12 emt_call"emt_putchar_F1fbmode.b        406163033   11    21    100664  141       `
 ENVHî/./<N¹PN^Nu_S1.L12 emt_call_F1"fbmode
getconfig.b     406163029   11    21    100664  144       `
LNVHî/<N¹XN^Nu_S1.L12 emt_call_F1"
emt_getconfiggetcontext.b    406162995   11    21    100664  145       `
MNVHî/<ÿÿÿýN¹XN^Nu_S1.L12 emt_call"emt_getcontext_F1
getmemsize.b    406162999   11    21    100664  145       `
MNVHî/<N¹XN^Nu_S1.L12 emt_call_F1"emt_getmemsize
getsegmap.b     406163003   11    21    100664  156       `
(LNVHî/././<ÿÿÿþN¹ßüN^Nu_S1$.L12 emt_call"
emt_getsegmap_F1mayget.b        406163050   11    21    100664  275       `
T‡NVHîySu@f/<N¹X`*/<N¹XJ€fpÿ`/<N¹X€N^Nu:.L16_S1$.L13N.L12 emt_call linereadyrx_F1"
emt_mayget lineget,B
mayput.b        406163055   11    21    100664  291       `
d‡NVHîySu@f.H€HÀ//<	N¹P`0/<N¹XJ€fpÿ`.H€HÀ//<N¹PB€N^NuD.L16_S1 lineput linereadytx..L13^.L12 emt_call"
emt_mayput_F1&6V
ttyio.b         406163105   11    21    100664  1402      `
NVHî#îtN^NuNVÿüHî ÿü*| Jg .倀` @`êLî ÿüN^NuNVHî .倀` @¼(N^NuNVHî .倀` @H€HÀN^NuNVHî .倀` @®N^NuNVHî .倀` @H€HÀ€N^NuNVHî .倀` @H€HÀ€N^NuNVÿøHî0ÿø . Ю*@ .倀`(@®.•Lî0ÿøN^NuNVÿøHî0ÿø . Ю*@ .倀`(@®.FÁ•Lî0ÿøN^NuNVHî/</</.aÿbßüN^NuNVHî/</</.aÿzßüN^NuNVHî/</</.aÿßüN^NuNVHî/</</.aÿ*ßüN^NuDáê..L30&.L17_F13_S12_F11_S10<.L16_S1p.L320_S9_F8"Ðlinereadytx"ˆlineput"	Êlinearmtxž.L34"	zlinearmrxô.L28Ì.L26¤.L24„.L22b.L20.L13_S6Æ.L36"ølineset_F4"¨linereadyrxî.L38_S3_F9"¢linedisarmrx"	8lineclear_F50_S8# NECinit"òlinedisarmtx_S13_F12_S11_F10_S5_F1_F6 _S2"flineget_F2_S7"Flineresettxint_F7.L40_S4"lineservice"	linereset_F3<.L18#wreg1‰°"	
	Jsetcontext.b    406163007   11    21    100664  149       `
 MNVHî/./<ÿÿÿüN¹PN^Nu_S1.L12 emt_call_F1"emt_setcontext
setecho.b       406163011   11    21    100664  142       `
 FNVHî/./<N¹PN^Nu_S1.L12 emt_call_F1"setechosetsegmap.b     406163015   11    21    100664  160       `
,LNVHî/./././<ÿÿÿÿN¹ßüN^Nu_S1"
emt_setsegmap(.L12 emt_call_F1ticks.b         406163019   11    21    100664  140       `
HNVHî/<N¹XN^Nu_S1.L12 emt_call"	emt_ticks_F1version.b       406163024   11    21    100664  142       `
JNVHî/<N¹XN^Nu_S1"emt_version.L12 emt_call_F1emtcall.b       406162981   11    21    100664  122       `
$6NVHî/./././.NOPN^Nu_S1.L12"emt_call_F1asin.b          406163126   11    21    100664  1502      `
4XÚXNVÿðHîÿð-y<ÿø-y@ÿü/9H/9D/./.N¹l(/./.N¹P-@-A-yLÿø-yPÿü/9X/9T/./.N¹o#ü! 9\"9``ü/./././.N¹ßü///9h/9dN¹ßü//N¹P-@ÿð-Aÿô/9p/9l/./.N¹oF/././.ÿô/.ÿðN¹ßü//N¹P///98/94N¹ßü`(/.ÿô/.ÿð/./.N¹ßü//N¹P-@ÿð-Aÿô/.ÿô/.ÿð/.ÿü/.ÿøN¹ßüN^NuNVHî/9x/9t/./.N¹l/./.N¹P-@-A/9€/9|/./.N¹o#ü! 9„"9ˆ`*/./.aýòP///98/94N¹ßüN^Nu@ÉÚ¢!hÂ@€À€@€@€@3333333@€Ð.L30<.L17t.L31Ž.L16_S1.L32 fltused|.L33..L29„.L34r.L27B.L25l.L26d.L24\.L23”.L21T.L22L.L20 sqrt fneg4pio2"’acos"asin fdivn.L20000_F1 fsub_S2 fcmp atan_F2j.L20001 fmulD.L19^.L18 errno‰°‰°‰°‰°"0@‰°P‰°X‰°`‰°ft‹°#€‰°†‰°Œ ¦‰°¶‰°¼ÂÒ‰°â‰°èö‰°*‰°06Td „‰°ž‰°¤²Â‰°Ò‰°Øæ‹°#ò‰°ø‰°þ‰°‰°$atan.b          406163138   11    21    100664  3277      `
 °HNVHî/9/9/./.N¹o/./.a2`$/./.N¹P//aP//N¹PN^NuNVHî/./././.N¹ßü/././/N¹f</9/9/./.N¹m 9°"9´`œ/9´/9°`„/9$/9 /./.N¹lò/9,/9(/./.N¹mn/./././.N¹P//N¹ßü//a&P///9´/9°/9´/9°N¹ßü//N¹ßü`ä/./././.N¹ßü//aÄP///9´/9°/9´/9°N¹P//N¹ßü//N¹`/94/90/./.N¹o$/./././.N¹ßü//aB`:/./././.N¹P//N¹ßü//aP//N¹PN^NuNVHî/9¬/9¨/./.N¹l/./.aâP`Ø/9¤/9 /./.N¹oB/././9</98N¹ßü//a˜P///9´/9°N¹`r/9L/9H/./.N¹ßü///9D/9@/./.N¹ßü//N¹ßü//a"P///9¼/9¸N¹ßüN^NuNVÿðHîÿð/./././.N¹ßü-@ÿø-Aÿü/9ä/9à///9Ü/9Ø///9Ô/9Ð///9Ì/9È///9Ä/9ÀN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿð-Aÿô/9/9/.ÿü/.ÿø/9/9/.ÿü/.ÿø/9ü/9ø/.ÿü/.ÿø/9ô/9ð/.ÿü/.ÿø/9ì/9è/.ÿü/.ÿøN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü///.ÿô/.ÿðN¹ßü-@ÿð-Aÿô/././/N¹ßüN^NuA‚y™üï2?ÔÌÏçy’@ÉÚ¢!hÂ@IÚ¢!hÂB:¨Iùv‚D†6v1T÷‡E ðr¤O
EÞ‹R
E`2Mf·CkÓð´KEûã\QÂEÐYòW…Fõ\*~E`2Mf·@€@€@€^.L31_S1Ô.L32 fltusedš.L43Ä.L33Øatanp1.L34Z.L264.L28.L29ø.L44â.L35¸pio4_F4j.L20004 .L36atanq0¨sq2m18.L45"txatan|.L37 fnegÈatanp3°pio2(.L38 sq2p1@.L46_S3".L39H.L47V.L20002øatanq2š.L48 fdiv"^atan2X.L20000"bsatan fadd_F1àatanp0 fsubèatanq4_S2Ðatanp2 fcmp"atanr.L20003_F2atanq1Àatanp4_S4\.L200010.L40 fmulp.L41_F3ðatanq3‰°‰°- >T&z-’‰°š‰° -®‰°¶‰°¼‰°Æ‰°Ì‰°Ö‰°Ü-ꉰô‰°ú- ",‰°F‰°L‰°R‰°X&^)n"Ž‰°¨‰°®‰°´‰°ºÀ)Ì&܉°ä‰°ê-ø"4"@X‰°n‰°t-‚‰°œ‰°¢-°‰°À‰°Æ"̉°æ‰°ì)ò‰°ú‰°&‰°‰°$)2"B‰°Z‰°`&f6‰°¤‰°ª‰°´‰°º‰°Ä‰°Ê‰°Ô‰°Ú‰°ä‰°ê6ð&6& 60&@6P&`‰°t‰°z‰°ˆ‰°Ž‰°œ‰°¢‰°°‰°¶‰°Ä‰°Ê&Ø6è&ø6&6(&86H&X"p6
fabs.b          406163203   11    21    100664  266       `
Lv NVHî/9P/9L/./.N¹l/./.N¹P-@-A .".N^Nu_S1 fltusedL.L14>.L13F.L12 fneg_F1 fcmp"fabs‰°‰° 0hypot.b         406163144   11    21    100664  929       `
x(9¨NVÿøHîÿø/9|/9x/./.N¹l/./.N¹P-@-A/9„/9€/./.N¹l/./.N¹P-@-A/./././.N¹o$-nÿø-nÿü-n-n-nÿø-nÿü/9Œ/9ˆ/./.N¹f 9"9”`t/./.HnN¹ßü/./././.N¹ßü///9œ/9˜N¹ßü//N¹P///./.N¹ßüN^NuNVHî/./././.aþ”ßüN^Nu@€€.L17r.L16_S1 fltusedx.L15>.L14t.L24˜.L22L.L13.L21ˆ.L20 sqrt fneg"hypot fadd_F1_S2 fcmp_F2 afdiv"Pcabs fmulØ.L19®.L18‰°‰° 0‰°@‰°FTd„‰°°‰°¶ĉ°Ì‰°Ò扰‰°.B
jn.b            406163158   11    21    100664  3024      `
dXìNVÿÔHîÿÔJ®l" .D€-@/./.N¹P-@-AJ®f$/./.N¹`/./.N¹P`N®gâ/9h/9d/./.N¹f 9l"9p`/./.N¹P".²€nê/./.N¹P-@ÿô-Aÿø/./.N¹P-@ÿì-Aÿð-|ÿü`–-nÿìÿä-nÿðÿè/.ÿø/.ÿô/.ÿð/.ÿì/././.ÿüN¹X///9x/9tN¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿì-Aÿð-nÿäÿô-nÿèÿøR®ÿü .ÿü°®mÿb .ÿì".ÿð`/./././.N¹ßü-@ÿÜ-Aÿà-y|ÿÔ-y€ÿØ .€-@ÿü`d/.ÿØ/.ÿÔ/.ÿüN¹X///9ˆ/9„N¹ßü//N¹ßü///.ÿà/.ÿÜN¹ßü-@ÿÔ-AÿØS®ÿü .ÿü°®n’/.ÿØ/.ÿÔ/.N¹X///9/9ŒN¹ßü//N¹ßü///./.N¹ßü-@ÿÔ-AÿØ-@ÿô-Aÿø-y”ÿì-y˜ÿð .S€-@ÿü`–-nÿìÿä-nÿðÿè/.ÿø/.ÿô/.ÿð/.ÿì/././.ÿüN¹X///9 /9œN¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿì-Aÿð-nÿäÿô-nÿèÿøS®ÿüJ®ÿünÿf/.ÿð/.ÿì/./.N¹P///.ÿØ/.ÿÔN¹ßü//N¹ßüN^NuNVÿàHîÿà/9¨/9¤/./.N¹n#ü! 9¬"9°`v-|ÿøJ®l* .D€-@/</N¹P€f-|ÿÿÿÿÿøJ®f/./.N¹P`$®f/./.N¹P//`æ/./.N¹P-@ÿð-Aÿô/./.N¹P-@ÿè-Aÿì-|ÿü`–-nÿèÿà-nÿìÿä/.ÿô/.ÿð/.ÿì/.ÿè/././.ÿüN¹X///9¸/9´N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿè-Aÿì-nÿàÿð-nÿäÿôR®ÿü .ÿü°®mÿb/.ÿì/.ÿè/.ÿøN¹X//N¹ßüN^NuAAA@€AÿÿÿþÿÿÿþAˆ.L52¨.L42V.L20006_S1 y1`.L73 fltusedh.L63|.L532.L43\.L44`.L20004t.L54H.L20016,.L74`.L64f.L45 fneg0.L20009 y0|.L55’.L46P.L20014œ.L65<.L20002d.L47 j0<.L758.L56T.L20012 fdivl.L48 fixV.L20007`.L66F.L57¬.L49œ.L20010|.L200000.L76,_F1<.L58 fsub$.L70ì.L67Ì.L20005D.L20017_S2„.L59 j1´.L77 fcmp¤.L68"¬ynŒ.L60"jnN.L20015$.L71 _F2Ø.L20003 lrem”.L50R.L20013¬.L69”.L61 floatH.L20008>.L72x.L51è.L20001Z.L20011 fmul\.L62 errno$B1R‰°h‰°n3|‰°„‰°Š œ¶1ÎA‰°‰°$G*:GJ*ZG¦‰°º‰°ÂA扰ò‰°øGþ*&AT‰°`‰°fGl*|”‰°°‰°¸Aö‰°‰°GG.*>zGŽž‰°¸‰°¾3Ì‹°I؉°Þ‰°ä<4Rj‚AƉ°Ò‰°ØGÞîGþ*AJGVj0.b            406163175   11    21    100664  4501      `
Tˆ˜NVÿäHîÿä/9	h/9	d/./.N¹l/./.N¹P-@-A/9	p/9	l/./.N¹oÞ/./.aŒP/9`/9\/./.N¹ßü-@ÿð-Aÿô//N¹P///9/9N¹ßü///.ÿô/.ÿðN¹P///9/9N¹ßü//N¹ßü///././9X/9TN¹ßü//N¹P//N¹`/./././.N¹ßü-@ÿø-Aÿü-y	tÿð-y	xÿô-y	|ÿè-y	€ÿì-|ÿä`– .ÿä瀀d @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀¬ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßüN^NuNVÿäHîÿäB¹/9	ˆ/9	„/./.N¹n#ü! 9	Œ"9	`f/9	˜/9	”/./.N¹oÞ/./.a@P/9`/9\/./.N¹ßü-@ÿð-Aÿô//N¹P///9/9N¹ßü///.ÿô/.ÿðN¹P///9/9N¹ßü//N¹ßü///././9X/9TN¹ßü//N¹P//N¹`f/./././.N¹ßü-@ÿø-Aÿü-y	œÿð-y	 ÿô-y	¤ÿè-y	¨ÿì-|ÿä`– .ÿäç€€Ô @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀	 @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/./.N¹P///./.aûrP///9X/9TN¹ßü//N¹ßü///.ÿì/.ÿè/.ÿô/.ÿðN¹ßü//N¹ßüN^NuNVÿäHîÿä/./././.N¹ßü///9	°/9	¬N¹ßü-@ÿø-Aÿü-y	´ÿð-y	¸ÿô-y	¼ÿè-y	Àÿì-|ÿä`– .ÿä瀀ô @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀, @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü#À#Á-y	Äÿð-y	Èÿô-y	Ìÿè-y	Ðÿì-|ÿä`– .ÿä瀀d @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀œ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü///././9	Ø/9	ÔN¹ßü//N¹ßü#À#ÁN^Nu@"ùƒnND@IÚ¢!hÂbÕø
Ä%0áÌ3îbþ_±#BPp)ªÜòð,Z«µyY£9#ÕëO™1´¹gQºÌ?ÐëÍ_Í‚Îíù#õGÑÓ¼µ.KàbÕø
Ä%0_–®ÉlÑ[ÖéÍ&-âÆWÍ#Cøê×´S‘m“9Œ>O½z½1a Jˆ`ɦö0Eªb	p›çÆ@€K¤˜š*ðï^L<-`ħ5L_qtà}UJö:C¯µ·I_©Ï
lFTYÒ-®+K¤˜š*ðï^L<D†:U>õL“ÑöJ÷3Viš8IXn’‰Þ2F#{67êá³@€Æy	à²[–¯Ç"5ªþÄeǼC箯ÛÆßLy»‘ÄbCX,ËFHÁœcïüÅiåIy	à²[–¯J"Ç–ÈlçJ2µÐ“CI]T…ÒÇ)Guc‘R4Ä-DÌb¿q–ëë@€à¾ÖçÐâadŒ„›{ß‘¢¤±ÏT\ô\&À+*äÙ»l¾ƒt¸/V;¡WÿÒÊ.\¥~Ma¥Áª
#×È!šZßìë|b¡œX£ý_h¹ÔZ»/§[ªIûïìuW¦¨räµSs\Wª@n¸O
*Ÿ GÁ4JtŽjB¸'ûE N}µ¹Õ@€BÿÿÿþÿÿÿþBC€BÔ	.L88¼	.L79ü.L20006_S1Ôj0p4Ä	.L83d.L73 fltused$.L63 sqrt\pio4Ô.L20004@.L54p.L74.L64 fneg	j0q4dj0p3Ì	.L84X.L20009_S3"Dy0>.L55 log pzeroî.L65:.L20002"j0h.L75d	.L56œj0q3 fdivôj0p2è.L85h.L20007 sinTtpiŠ.L668.L57ø.L80.L20000P.L76 faddòasympt_F1,j0q2 fsubl	.L58è.L20005”	.L70„	.L67dj0p1ô.L86_S2.L81¬	.L77 fcmp¬j0q1Œ	.L68t	.L60h.L20003œ	.L71_F2 qzeroì.L87´	.L78„.L69|	.L61ì.L20008ü.L82 cos¤	.L72ˆ.L20001 fmul_F3.L62 errno‰°‰°8 0‰°@‰°F8T‰°l‰°r.€#˜‹°?¤‹°?ªI°FÈ‹°Ô‹°ÚIà.ð‰°‰°	$I0IJ‰°^‰°f‰°n‰°v	I®*¾	ØIö*6‹îLP‰°V‰°\8j‹°Lv‰°|‰°‚‰°Œ‰°’8 ‰°¸‰°¾.ÌFä‹°?ð‹°?öIü#‹° ‹°&I,*<‰°T‰°Z`	pI|I–‰°ª‰°²‰°º‰°Â	ÜIú*
	$IB*Rz‰°˜‰°žI¤I´Ô*äI‰°‰°$*‰°>‰°F‰°N‰°V	pIŽ*ž	¸IÖ*æ‹°"‹°(‰°.‰°6‰°>‰°F	`I~*Ž	¨IÆ*Ö‰°‰°$*I:‹°?F‹°?L
j1.b            406163193   11    21    100664  4982      `
TÈ"NVÿÜHîÿÜ-nÿà-nÿä/9
ˆ/9
„/.ÿä/.ÿàN¹l/.ÿä/.ÿàN¹P-@ÿà-Aÿä/9
/9
Œ/.ÿä/.ÿàN¹oD/.ÿä/.ÿàa~P/9p/9l/9
˜/9
”N¹ßü///.ÿä/.ÿàN¹ßü-@ÿð-Aÿô//N¹P///9`/9\N¹ßü///.ÿô/.ÿðN¹P///9X/9TN¹ßü//N¹ßü///.ÿä/.ÿà/9h/9dN¹ßü//N¹P//N¹ßü-@ÿð-Aÿô/9
 /9
œ/./.N¹l/.ÿô/.ÿðN¹P-@ÿð-Aÿô .ÿð".ÿô`"/.ÿä/.ÿà/.ÿä/.ÿàN¹ßü-@ÿø-Aÿü-y
¤ÿð-y
¨ÿô-y
¬ÿè-y
°ÿì-|ÿÜ`– .ÿÜ瀀t @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿÜ瀀¼ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿÜJ®ÿÜlÿf/.ÿì/.ÿè/.ÿô/.ÿð/./.N¹ßü//N¹ßüN^NuNVÿÜHîÿÜB¹-nÿà-nÿä/9
¸/9
´/.ÿä/.ÿàN¹n#ü! 9
¼"9
À`Î/9
È/9
Ä/.ÿä/.ÿàN¹oú/.ÿä/.ÿàa¨P/9p/9l/9
Ð/9
ÌN¹ßü///.ÿä/.ÿàN¹ßü-@ÿð-Aÿô//N¹P///9`/9\N¹ßü///.ÿô/.ÿðN¹P///9X/9TN¹ßü//N¹ßü///.ÿä/.ÿà/9h/9dN¹ßü//N¹P//N¹`²/.ÿä/.ÿà/.ÿä/.ÿàN¹ßü-@ÿø-Aÿü-y
Ôÿð-y
Øÿô-y
Üÿè-y
àÿì-|	ÿÜ`– .ÿÜ瀀	ä @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿÜ瀀
4 @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿÜJ®ÿÜlÿf/.ÿä/.ÿà/9
è/9
äN¹ßü///.ÿä/.ÿàN¹P///.ÿä/.ÿàaúœP//N¹ßü//N¹ßü///9h/9dN¹ßü///.ÿì/.ÿè/.ÿô/.ÿð/.ÿä/.ÿàN¹ßü//N¹ßü//N¹ßüN^NuNVÿäHîÿä/./././.N¹ßü///9
ð/9
ìN¹ßü-@ÿø-Aÿü-y
ôÿð-y
øÿô-y
üÿè-yÿì-|ÿä`– .ÿä瀀	 @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀	< @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü#ÀT#ÁX-yÿð-yÿô-yÿè-yÿì-|ÿä`– .ÿä瀀	t @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀	¬ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü///././9/9N¹ßü//N¹ßü#À\#Á`N^Nu@"ùƒnND@IÚ¢!hÂbü)Aëág|5ïlÌÊ_–€F=çNÛÿ6]	X„FÕk׺ÅÔšúî0PKqÒM<?ËM“°pRF(ÑöŸ²VFc|)Aë`$	Ís©\XnùÄRϱX=SsÃH¼Sô-åÂQ‡ªOq¹QioH<J·SÂŽžOEÈÝÏs0™ó@€Ë‡^[¢2×Ì´æLįËÉ„Ú)°vʹúJÏ8`ÈÖ€{ÅÉs»Œàîݡ^[¢2×Ì•,cÒÀÅËÈ÷öõžC´Ê¸Œ
–6ÈÑîFŵàMUƒ®_@€HÄéÕ:xžH¦L”‘hHAkWWG|†—Q·EÕLƒ¸Å_C
?Au/J-Mö)JÞV„WJ­F%[Y2IÃtÍòBb.H:ОrEWõÀóØô@€æ¨ÊävžRCe³ñ Á{»ãƒp7>X`˜-i‡Æ‚ÌÝ.›CYY˜SOØZÕ7'nÌœÜPXî0$¾™Ë¶¾)¨Vg×;â‚9;9d“S
ÃE¸`Í![…’Q\À?h[]aX‡\{ÖTˆoE¾‡O†ŒÉêVÁJ¾Ô–
Ê”EÉ‹ŽóU@€BA@ÿÿÿþÿÿÿþBA@@€C€B.L88.L79f.L20006_S1t	p3tp1.L93ô
.L83Ä
.L73"Îy1 fltused¤
.L63<	q2 sqrt4
q4lpio4.L89æ.L20004Ê.L54Ì
.L74¬
.L64 fnegü
.L84_S3J.L55 logTpzero.L20002Š.L65Ô
.L75„
.L56æ.L90 fdivê.L20007ö.L85 sindtpi–.L66ª.L57ä
.L80Ž.L20000Ü
.L76 faddðasympt$_F1ä	p4	p2 fsubŒ
.L58¼q1ú.L20005´
.L70Ž.L67ò.L91.L86¬	q3_S2"j1N.L81.L77 fcmpì.L68”
.L60†.L20003¼
.L71$_F2\qzeroú.L87ê.L92".L78 .L69ž.L61V.L20008ì
.L82 cos6.L72ú.L20001 fmul_F3œ
.L62 errno‰°‰°<,<‰°L‰°R<`‰°x‰°~‰°„‰°ŠM/¨#À‰°Ì‰°ÒMØJð‰°ü‰°M/‰°0‰°6 <
LMX‰°l‰°r<€M¼‰°Ð‰°Ø‰°à‰°è	M *0	JMh*xM° À‹îPÚ‰°ì‰°ò<‹°P‰°‰°‰°"‰°(<6‰°N‰°T‰°Z‰°`Mf/~J–‰°¢‰°¨M®#Ɖ°Ò‰°ØMÞ*‰° 
"M.MH‰°\‰°d‰°l‰°t	ŽM¬*¼	ÖMô*‰°,‰°2 8PMn/~‰°Ž‰°”MšM Ò*âM‰°‰°" (‰°<‰°D‰°L‰°T	nMŒ*œ	¶MÔ*ä ‰° ‰°&‰°,‰°4‰°<‰°D	^M|*Œ	¦MÄ*Ô ‰°‰°" (M8‰°D‰°Jpow.b           406163199   11    21    100664  917       `
d()ÀNVÿôHîÿô/9h/9d/./.N¹nî/9p/9l/./.N¹f./9x/9t/./.N¹oê 9|"9€`ð/./.N¹P-@ÿô/./.N¹P".ÿô²€f¬/./.N¹P//N¹P///./.N¹ßü//N¹P-@ÿø-Aÿü .ÿô€g//.ÿøN¹P-@ÿø-Aÿü .ÿø".ÿü`L/./.N¹P///./.N¹ßü//N¹P`#ü! 9„"9ˆN^Nud.L17.L16_S1 fltused`.L15„.L26
.L25 .L24|.L23b.L20J.L22t.L21 fneg exp log fix_F1 fcmp"pow fmull.L19r.L18 errno‰°‰° ‰°*‰°0>‰°F‰°LZ‰°d‰°j|ª¶Ê
Úü2
B‹°P‰°V‰°\
log.b           406163213   11    21    100664  2113      `
xNVÿÜHîÿÜ/9Ì/9È/./.N¹n#ü! 9Ð"9Ô`üHnÿÜ/./.N¹ßü-@ÿø-Aÿü`2/9Ü/9Ø/.ÿü/.ÿøN¹ßü-@ÿø-Aÿü .ÿÜS€-@ÿÜ/9ä/9à/.ÿü/.ÿøN¹m²/9Œ/9ˆ/.ÿü/.ÿøN¹l2/.ÿü/.ÿø/9ì/9èN¹ßü-@ÿø-Aÿü .ÿÜS€-@ÿÜ/9ü/9ø/.ÿü/.ÿøN¹ßü///9ô/9ð/.ÿü/.ÿøN¹ßü//N¹ßü-@ÿð-Aÿô////N¹ßü-@ÿè-Aÿì/9”/9///9œ/9˜///9¤/9 ///9¬/9¨N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿà-Aÿä/9´/9°/.ÿì/.ÿè/9¼/9¸/.ÿì/.ÿè/9Ä/9À/.ÿì/.ÿè/9/9N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü///.ÿä/.ÿàN¹ßü-@ÿà-Aÿä/9|/9x/.ÿÜN¹X//N¹ßü///.ÿô/.ÿð/.ÿä/.ÿàN¹ßü//N¹ßü-@ÿà-AÿäN^NuNVHî/9„/9€/./.aü¢P//N¹ßüN^Nu@1r÷ÑÏzA]ݪ¨¬@5ó3ùÞeÂÀlŽB÷¨‰#‰™"Â3ûh’@±?טÃG˜eÂ@lŽB›Ù½,$l“çdr!ÿÿÿþÿÿÿþA@A@€@€@€:.L52xlog2_S1°q0¨p3˜p1 fltusedø.L63@.L53Àq2">log10È.L54€ln10.L64Ð.L55"logr.L65”.L56 fdiv°.L57ˆsqrto2”.L20000 fadd frexp$_F1 p2p0 fsubà.L58¸q1_S2Ø.L59 fcmpþ.L60_F2 floatè.L61b.L20001 fmulð.L62 errno‰°‰°  ‹°(,‰°2‰°8N‰°d‰°j&x‰°–‰°œ ª‰°²‰°¸ Ɖ°Ö‰°Ü&≰‰°‰°$‰°*8H&d‰°x‰°~‰°ˆ‰°Ž‰°˜‰°ž‰°¨‰°®&´Ä&Ôä&ô‰°‰°‰°,‰°2‰°@‰°F‰°T‰°Z&`p&€& °È‰°Ü‰°â#ì&ø&(‰°J‰°Ph
sin.b           406163223   11    21    100664  2416      `
p€8(NVHî/9Ä/9À/./.N¹l/./.N¹P-@-A/</./.a.ßüN^NuNVHî/</./.a
ßüN^NuNVÿÄHîÿÄ-nÿà-nÿä/9Ì/9È/.ÿä/.ÿàN¹l"/.ÿä/.ÿàN¹P-@ÿà-Aÿä .T€-@/9t/9p/.ÿä/.ÿàN¹ßü-@ÿà-Aÿä/9Ô/9Ð/.ÿä/.ÿàN¹oÈHnÿø/.ÿä/.ÿàN¹ßü-@ÿØ-AÿÜ/.N¹X///.ÿü/.ÿøN¹ßü-@ÿø-AÿüHnÿð/.ÿü/.ÿø/9Ü/9ØN¹ßü//N¹ßü/.ÿô/.ÿð/9ä/9àN¹ßü///.ÿü/.ÿøN¹ßü//N¹P`L/.ÿä/.ÿàN¹P-@ÿÔ/N¹X///.ÿä/.ÿàN¹ßü-@ÿØ-AÿÜ .ЮÿÔ€-@ .€g(/.ÿÜ/.ÿØ/9ì/9èN¹ßü-@ÿØ-AÿÜ®o/.ÿÜ/.ÿØN¹P-@ÿØ-AÿÜ/.ÿÜ/.ÿØ/.ÿÜ/.ÿØN¹ßü-@ÿè-Aÿì/.ÿÜ/.ÿØ/9|/9x///9„/9€///9Œ/9ˆ///9”/9///9œ/9˜N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿÌ-AÿÐ/9¤/9 /.ÿì/.ÿè/9¬/9¨/.ÿì/.ÿè/9´/9°/.ÿì/.ÿè/9¼/9¸/.ÿì/.ÿèN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿÄ-AÿÈ///.ÿÐ/.ÿÌN¹ßüN^Nu@"ùƒnNDLO2Xúê»Ë–Øx3©‰ŸIÖäᶔTÂÇX]
1ªDøñ!û†LçΧ%îdIÇNg5 &GÜbhqÌD§K-Ÿá?Gÿø?€A€@€Ð.L30È.L31_S1 q0p3€p1Ü.L32 fltusedÐ.L33°q2j.L28Ø.L34x.L27T.L22>.L24À.L25à.L35,.L36`.L37 fnegè.L38‚.L39_S3 fdiv fix"Xsin modf(.L20000 fadd_F1˜p4ˆp2xp0 fsub¨q1¸q3_S2 fcmp_F2 float"|sinus"cosptwoopi fmul<_F3‰°‰°% 0‰°”‰°š%¨¸‰°Ò‰°Ø+扰ú‰°%$'<P‰°p‰°v+|Œ‰° ‰°¦+¬!ÄÔæ'ô!‰°B‰°H!Nt+”‰°°‰°¶‰°À‰°Æ‰°Ð‰°Ö‰°à‰°æ‰°ð‰°ö+ü+,+<L+\l+|‰°‰°–‰°¤‰°ª‰°¸‰°¾‰°Ì‰°Òà+ð+ +0@`sqrt.b          406163231   11    21    100664  1686      `
pX^PNVÿèHîÿè/9t/9p/./.N¹n6/9|/9x/./.N¹l
#ü! 9€"9„`Hnÿì/./.N¹ßü-@ÿø-Aÿü` /9Œ/9ˆHnÿøN¹ßüS®ÿì/9”/9/.ÿü/.ÿøN¹mÄ .ÿì€g /9œ/9˜HnÿøN¹ßüS®ÿì/.ÿü/.ÿø/9¬/9¨N¹ßü///9¤/9 N¹ßü-@ÿð-Aÿô®<ÿìo&/9´/9°HnÿðN¹ßü®<ÿì`Ð®ÿÿÿÄÿìl&/9¼/9¸HnÿðN¹ßü®<ÿì`ÐJ®ÿìm0/</.ÿìN¹Prá¡/N¹X//HnÿðN¹`2/< .ÿìD€/N¹Prá¡/N¹X//HnÿðN¹ßüB®ÿè`\/.ÿô/.ÿð/./.N¹ßü///.ÿô/.ÿðN¹ßü///9Ä/9ÀN¹ßü-@ÿð-AÿôR®ÿè®ÿèoš .ÿð".ÿôN^NuA@A@@€O€O€@°.L30L.L17Z.L31p.L16_S1 fltusedŠ.L32\.L15¸.L33l.L14À.L34Z.L29*.L28¨.L27 .L26˜.L25æ.L24º.L21.L22ˆ.L23ž.L20ø.L35"sqrtV.L36þ.L20004d.L37Z.L38À.L39ò.L20002 fdivž.L20000 fadd frexp_F1 ldiv fcmpZ.L20003 afdiv float~.L20001 fmul€.L19 afmulx.L18 errno‰°‰°# ‰°(‰°.#<‹°,H‰°N‰°T j‰°€‰°†*‰° ‰°¦#´‰°È‰°Î*؉°ð‰°öü‰°‰°(‰°6‰°<*F‰°f‰°l%v"œ&ª*º"Ð&Þ%î(‰°8‰°>(Dldiv.b          406162967   11    21    100664  203       `
ˆNVHç<*< .lD€D…&".lDD…(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿ€ÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚ J…lD€Lß<N^Nu ulmul"ldiv+²j
tan.b           406163241   11    21    100664  2412      `
 d@NVÿÐHîÿÐB®ÿÔ-yPÿø-yTÿü/9\/9X/./.N¹l(/./.N¹P-@-A-y`ÿø-ydÿü/9/9/./.N¹ßü-@-AHnÿè/./.N¹ßü-@ÿà-Aÿä/.ÿì/.ÿèN¹P-@ÿÐ/</N¹P€bÐ@0;NûÌ:nˆ/.ÿä/.ÿà/.ÿä/.ÿàN¹ßü-@ÿØ-AÿÜ/.ÿä/.ÿà/9/9///9/9///9$/9 ///9,/9(///94/90N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿð-Aÿô/9</98/.ÿÜ/.ÿØ/9D/9@/.ÿÜ/.ÿØ/9L/9H/.ÿÜ/.ÿØ/9l/9hN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü///.ÿô/.ÿðN¹ßü-@ÿð-Aÿô®ÿÔf$/9t/9p/.ÿô/.ÿðN¹fÞ#ü"/9|/9x/.ÿü/.ÿøN¹o¨ 9€"9„`ê/.ÿä/.ÿà/9Œ/9ˆN¹ßü-@ÿà-Aÿä-|ÿÔ`ýœ/.ÿü/.ÿøN¹P-@ÿø-Aÿü`Ú/.ÿä/.ÿà/9”/9N¹ßü-@ÿà-Aÿä/.ÿü/.ÿøN¹P-@ÿø-Aÿü`ý>`ý: 9˜"9œ`D/.ÿô/.ÿð/9¤/9 N¹ßü-@ÿð-Aÿô/.ÿô/.ÿð/.ÿü/.ÿøN¹ßüN^Nu@¢ùƒnNDÇL0Ï‚ÖÁ‚Eƒÿ y+VÂx™
ì=>0yêÂe9Áj¯ú6Çý矗¿¢F”îÊÌÄ€ÙX(ç@€À€@€ÿÿþÿÿÿþ@€@€ÿÿÿþÿÿÿþ@€_S18q0(p3p1 fltused€.L73.L63P.L53Hq2b.L54˜.L74¬.L64 fnegX.L55"tanè.L65 .L75`.L56 fdiv fixà.L66è.L57 modfB.L20000 fadd0_F10p4 p2p0 fsubÎ.L58@q1p.L70h.L67invpi.L59 fcmpˆ.L60æ.L68°.L71 lrem¾.L69N.L61.L51x.L72 fmulh.L62 errno‰°‰°‰° ‰°&$4D‰°T‰°\‰°d‰°j-x˜´(È-ú‰°‰°‰°&‰°,‰°6‰°<‰°F‰°L‰°V‰°\-br-‚’-¢²-ÂÒ-≰ö‰°ü‰°
‰°‰°‰°$‰°2‰°8->N-^n-~Ž¦‰°Æ‰°Ì$Ú‹°/艰ô$‰°‰°‰°$‰°*0X‰°r‰°x~š‰°²‰°¸‰°È‰°ÎÔ-ølrem.b          406162971   11    21    100664  207       `
ŒNVHç8(< .lD€D„$".lDlB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€J„lD€LßN^Nu ulmul"lrem+²l
ulmul.b         406162975   11    21    100664  94        `
0NVHç0$.&.B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐLßN^Nu"ulmultanh.b          406163245   11    21    100664  618       `
Ô ÞxNVÿøHîÿø-yÔÿø-yØÿü/9à/9Ü/./.N¹l(/./.N¹P-@-A-yäÿø-yèÿü/9ð/9ì/./.N¹o
 .ÿø".ÿü`L/./.N¹P///./.N¹P///.ÿü/.ÿøN¹ßü//N¹ßüN^Nu@€À€B¨Ü.L17^.L16_S1 fltusedÔ.L15Ð.L14ì.L20 fneg cosh fdiv_F1 sinh fcmp"tanh fmul„.L19ä.L18‰°‰°‰°‰°"0@‰°P‰°X‰°`‰°ftŽ¢¶	Æsinh.b          406163253   11    21    100664  2274      `
À€J8NVÿìHî€ÿì~/9ü/9ø/./.N¹l/./.N¹P-@-A~ÿ/9/9/./.N¹oP/9/9/./.N¹P//N¹ßü-@ÿø-AÿüJ‡o`D/.ÿü/.ÿøN¹P`0/9/9/./.N¹ox/9/9/./.N¹P//N¹P///./.N¹P//N¹ßü///N¹X//N¹ßü//N¹`–/./././.N¹ßü-@ÿð-Aÿô/././9Ä/9À///9Ì/9È///9Ô/9Ð///9Ü/9ØN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿø-Aÿü/9ä/9à/.ÿô/.ÿð/9ì/9è/.ÿô/.ÿð/9ô/9ð/.ÿô/.ÿðN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//HnÿøN¹ßü/.ÿü/.ÿø/N¹X//N¹ßüLî€ÿìN^NuNVHî/9$/9 /./.N¹l/./.N¹P-@-A/9,/9(/./.N¹o/94/90/./.N¹P`L/9</98/./.N¹P//N¹P///./.N¹P//N¹ßü//N¹ßüN^NuÊþõÓ%Úyȯœ\0.‘kÆ4ãa¶ÑoØÂÒqïB ;ÈÊþõÓ%ÚyGm¼±õt
Ä-­Ïæ€ØB¨A@AB¨AAº.L31€_S1àq0Øp3Èp1$.L32 fltused .L33ðq2^.L34.L29B.L27.L28Ü.L20š.L26.L25®.L23.L24B.L21ø.L22(.L35ª.L200040.L368.L37 fneg exp®.L20002"æcosh fdivÖ.L20000 fadd_F1Ðp2Àp0 fsubèq1_S2 fcmp"sinh¬.L20003_F2 afdiv float´.L20001 fmul‰°‰°%"2‰°D‰°J%X‰°`‰°ft€¤‰°°‰°¶%ĉ°Ì‰°Òàì"*,*:,T‰°p‰°v‰°€‰°†‰°‰°–‰° ‰°¦,¬¼,ÌÜ,ìü,‰° ‰°&‰°4‰°:‰°H‰°N\,l|,Œœ)°*Æ,Ò‰°ò‰°ø%‰°&‰°,%:‰°B‰°HV‰°`‰°ft€” °exp.b           406163261   11    21    100664  1855      `
ôxÓàNVÿÜHîÿÜ/9@/9</./.N¹f 9D"9H`¼/98/94N¹P///./.N¹l 9L"9P`„/98/94/./.N¹o#ü" 9T"9X`N/9(/9$HnN¹ßü/./.N¹P//N¹P-@ÿÜ/9`/9\/.ÿÜN¹X///./.N¹ßü//N¹ßü-@ÿø-Aÿü////N¹ßü-@ÿà-Aÿä/.ÿü/.ÿø/9ø/9ô///9/9ü///9/9N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿð-Aÿô/9/9/.ÿä/.ÿà/9/9/.ÿä/.ÿà/9 /9/.ÿä/.ÿà/9h/9dN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿè-Aÿì/.ÿÜ/.ÿô/.ÿð//N¹ßü///.ÿô/.ÿð/.ÿì/.ÿèN¹ßü///90/9,N¹ßü//N¹ßü//N¹ßüN^NuJýôÆÙúGìñ‚S¯ïCruœ‡Ø%K·0@¸q9iI ¤ÛàEÚ©4¿ÁÅ»@¸ª;)\ñ@µó3ùÞeG@@€ÿÿþÿÿÿþ@@€6.L52_S1 fltusedexpq1<.L53,sqrt2D.L54expp2 fnegn.L55"expL.L56 fdivexpq2 ldexp fix¤.L574maxf fadd$_F1 fsubT.L58ôexpp0$log2e\.L59 fcmpd.L60expq0 floatüexpp1ð.L51 fmul floor afmul errno‰°‰° ‰°(‰°.‰°8‰°>DX‰°`‰°f‰°p‰°v„‹°"‰°–‰°œ‰°¦‰°¬!¶ ÊÖ‰°â‰°èò2‰°N‰°T‰°^‰°d‰°n‰°tzŠšªº‰°Î‰°Ô‰°â‰°è‰°ö‰°ü‰°
‰°&6FVfŠª‰°º‰°ÀÆÖæ
floor.b         406163266   11    21    100664  692       `
øxNVÿøHîÿø/9/9/./.N¹lŒ/./.N¹P-@-AHn/./.N¹ßü-@ÿø-Aÿü/9/9/.ÿü/.ÿøN¹g/9 /9HnN¹ßü/./.N¹P-@-A`Hn/./.N¹ßü .".N^NuNVHî/./.N¹P//aÿ
P//N¹PN^Nu@€.L17˜.L16_S1 fltused.L15².L14.L21Ò.L13 fneg afadd"Öceil modf_F1_S2 fcmp_F2Ê.L19"floor.L18‰°‰° 2N‰°b‰°hv‰°~‰°„	Ž¢Àêfloat.b         406162965   11    21    100664  2994      `
T$ú BPJ€l0¼!A"ÿÿ€!AH@î€@ÿfBB¨B¨Nu@€1@NuB€0(@€fBNuJPg@H@ï€"(fB€Nuÿÿ€"(NuN¹ÑhN¹¶Nup"(f"(fB@Nu@ S@ãdÿúP@NuB$(&(2kfNuâ‚â“SAfÿø‚ÿÿÿ`ãƒã’RAfÿø!B!CNu"|`J@f( .". IN¹ .". |TN¹Nu .". IN¹ n " |TN¹NuNuNV |T ."."nN¹0(HÀ"€BhN¹DN^NuNV |T .".N¹ .ÑhN¹DN^NuNVHç8 .". |TN¹"|`28(n3|ÿ€ I`j3DBhD8m#h#h1|ÿ€ I`BpøN¹¶B€ãƒã’ã‘ãSDfÿô!C!B#A#@N¹~Qh IN¹N¹¶"nN¹D"À" |TN¹DLßN^NuNVHç0 .". |TN¹JhnB€`$pøN¹¶2(B€ãƒã’ãSAfÿöJPgD€LßN^NuNVHç0 |TB¨BP .kj1|ÿ€` 0¼D€!@N¹N¹¶@81@N¹DLßN^NuNVB@N¹ôN¹æN^NuNVB@N¹ô
QN¹æN^NuNVB@N¹ô
QN¹æJ€N^NuNVpN¹ôN¹æ n À N^NuNVpN¹ô
QN¹æ n À N^NuNVpN¹ôB¨N¹æ n €N^NuNVpN¹ôB¨
QN¹æ n €N^NuHç00(2)Ak IN¹¶"|TÑh`D@N¹¶ÑhJPgDƒ@‚ )")JQgD@€ÖÕ€J‚lDƒ@‚P`P!B!CN¹~N¹DLßNuNV". .k€€`€ÿÿÿN^NuNVB@N¹ôN¹ÞN^NuNVpN¹ôN¹Þ n À N^NuNVpN¹ôN¹Þ n €N^NuHç< 0±X0ÑXB‚BƒB…xP‰$|l02!ÂÀÖÕ…SDfÿò$Ä$Â$ƒB‚BƒxUˆTŠ0 2ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒB‚BƒxU‰TŠ02!ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒUˆTŠ0 2ÂÀÓ¢RŠÚÚÚÚÚÚÚÚQˆYˆN¹~N¹DLß<NuNVB€N¹ôN¹àN^NuNVpN¹ôN¹à n À N^NuNVpN¹ôN¹à n €N^NuHç>0±X0‘X f‚À"$&B„B…|:`SFg0Düã•ã”ã“ã’–•€lÿèSFgã…ã”ã“ã’ÖÕ€lÿÒ`ÿèYˆ Ä …QˆN¹~N¹DLß|Nu"LfltusedTafloatàdivPadde¸fixehb_manl8diveJmodfellsumXa_manh"jfnegfloate@l3dsúl1ds"€afsubêshifteVa_exptæadd"fdiv"Âafsubf"bafadd`bfloat"lfix"€ldexpDitoe`b_sign"ªmodfôgetargsdb_manhMANH"¢afaddf"fadd"Nfrexp",fsubEXPTSIGNoffsetetoiôokTa_sign"Ffcmpbb_expt\a_manl"¦afdivÞmulthmultel2ds¶shift"Äafdivf~normal"Âafmulf"ÀfloatMANL"Žfmul"¤afmul(²€(²Š‰°ö(²‰°(² (²2‰°@(²F‰°T(²f(²x‰°†(²”(²¢‰°¼(²Â‰°È(²(²4(²@(²F(²P‰°Z(²`‰°~(²„(²š‰°Ê(²ö(²ü(²
(²(²$(²4(²>(²N(²X(²j(²p(²ˆ(²’(²ª(²´(²Ê(²Ø(²ü‰°(²(²Z(²`(²–(²œ(²¬(²²(²Ê(²Ð‰°ö(²€(²†(²˜(²ž(²®(²´(²Ì(²Ò(²B(²Hò2‰°N‰°T‰°^‰°d‰°nsumacc/cmd/   775      0     12           0  3540162176   5767 sumacc/cmd/mwdvi/   775      0     12           0  3470501340   7105 sumacc/cmd/mwdvi/Makefile   444      0     12        2356  3470501334  10637 
#
##
#	mwdvi  <->  macwrite to dvi translation program.
#
#	10/11/84  douglas orr


#
#   Installation Options:
#
###
#   version can be  BSD_41
#		or  BSD_42
VERSION=BSD_42

###
#   directory where TeX tfm information can be found
#
TFM_PATH=/usr/lib/font/imagen/tfm


###
#    directory and group for installation of binaries
#
BINDIR	=/usr/local/bin
BINGRP	=bin
BINMODE	=711

INSTALL=install
INSOPTS=-g $(BINGRP) -m $(BINMODE) -s

#
#
CFLAGS= -O

SOURCES	= main.c dvi.c fonts.c md.c
INCLUDES= gen.h option.h md.h dvi.h fonts.h
OBJECTS	= main.o dvi.o fonts.o md.o

mwdvi:	$(OBJECTS)
	cc -o mwdvi $(OBJECTS)

site.h: Makefile
	echo "#define $(VERSION)=1" > site.new.h
	echo "#define TFM_PATH=\"$(TFM_PATH)\"" >> site.new.h
	-if( cmp -s site.h site.new.h );  \
	then \
		$(RM) -f site.new.h; \
	else \
		$(RM) -f site.h; \
		mv site.new.h site.h; \
	fi
		


main.o:		gen.h site.h option.h md.h
md.o:		gen.h site.h option.h md.h dvi.h
dvi.o:		gen.h site.h option.h md.h dvi.h fonts.h
fonts.o:	gen.h site.h option.h md.h dvi.h fonts.h


#
#	administrative stuff
#
install:
	$(INSTALL) $(INSOPTS) mwdvi $(BINDIR)



clean:
	rm $(OBJECTS)

clobber:
	rm -f $(SOURCES) $(INCLUDES) site.h

sources:
	@echo $(SOURCES) $(INCLUDES)

mdump:	mdump.o
	cc -o mdump mdump.o


 modf_F1_S2 fcmp_F2Ê.L19"floor.L18‰°‰° 2N‰°b‰°hv‰°~‰°„	Ž¢Àêfloat.b         406162965   11    21    100664  2994sumacc/cmd/mwdvi/main.c   444      0     12        6777  3470501334  10302 #include	<stdio.h>
#include	<signal.h>

#include	"site.h"
#include	"gen.h"
#include	"option.h"
#include	"md.h"

LOCAL	char	* program;
LOCAL	char	* outfile	= NULL;
LOCAL	char	tmpfile[] = "/tmp/mwXXXXXX";
LOCAL	bool	temp = FALSE;

#ifdef	BSD_42
LOCAL	char	pr_opts[BUFSIZ]	= "";
#endif	BSD_42
LOCAL	void	sig();


/*
 *	global variables
 */
FILE	* infd;
FILE	* outfd = NULL;



/*
 *	options
 */
bool	verbose	= FALSE;
bool	spool = FALSE;
bool	debflg	= FALSE;
char	* font_sub_file	= NULL;


extern	char	* getenv();


main( argc, argv )
int	argc;
char	* argv[];
	{

	bool	first_time = TRUE;

	program = argv[0];

	/*
	 *	signals, signals, signals!
	 */
	signal( SIGINT, sig );
	signal( SIGQUIT, sig );
	signal( SIGHUP, sig );

	/*
	 *	take a shot at some environment variables
	 */
	font_sub_file = getenv( "MACFONTS" );


	/*
	 *	process command line options
	 */
	while( (++argv, --argc) && (*argv)[0] == '-' )
	switch( (*argv)[1] )
		{

		/*	be noisy	*/
		case 'v':
			verbose = TRUE;
			break;

		/*	spool resultant output	*/
		case 'p':
			spool = TRUE;
			break;
		
#ifdef	BSD_42
		case 'P':
			strcat( pr_opts, " " );
			strcat( pr_opts, *argv );
			spool = TRUE;
			break;
#endif	BSD_42
		

		/*	debug output	*/
		case 'D':
			debflg = TRUE;
			break;

		/*	font substitution file	*/
		case 's':
			if( --argc == 0 )
				fatal( "must specify output file" );

			font_sub_file = *(++argv);
			break;
			

		/*	put mah output here	*/
		case 'o':
			if( --argc == 0 )
				fatal( "must specify output file" );

			outfile = *(++argv);
			break;
		
		default:
			fatal( "unknown option %c", (*argv)[1] );

		}
	

	/*
	 *	do it
	 */
	if( argc == 0 )
		fatal( "no input file" );
	

	/*	all output goes to a file 	*/
	if( outfile == NULL )
		{
		if( !spool )
			fatal( "no output file" );
		else
			{
			mktemp( tmpfile );
			temp = TRUE;
			outfile = tmpfile;
			}
		}
	

	if( (outfd = fopen( outfile, "w" )) == NULL )
		fatal( "couldn't open %s", outfile );


	

	while( argc-- )
		{

		if( (infd = fopen( *(argv++), "r" )) == NULL )
			fatal( "couldn't open macwrite file %s", *argv );
		
		if( verbose && argc > 0 )
			fprintf( stderr, "%s:\n", *argv );

		if( first_time )
			{
			init();
			first_time = FALSE;
			}

		read_globals();
		body();

		fclose( infd );

		}
	
	finish();

	fclose( outfd );
	if( verbose )
		fprintf( stderr, "%d page(s) produced\n", page_cnt );

	if( spool )
		spool_file();

	Exit( 0 );

	}


Exit( rc )
int	rc;
	{

	if( temp && outfd )
		unlink( tmpfile );
	
	exit( rc );

	}



/*
 *	SYSTEM DEPENDENT!
 */


/*	write dvi output directly to imagen	*/
spool_file()
	{
	char	buf[300];
	bool	temp = FALSE;

	if( verbose )
		fprintf( stderr, "spooling dvi output\n" );

	/*
	 *	must use less precise -a setting because of common bug in
	 *  dviimp  ->  fixptrsuconv calculated using 2E20 fix/pt, 
	 *  not 2^20 fix/pt
	 */

#ifdef	BSD_41
	sprintf( buf, "dviimp -a %s | ipr -Limpress", outfile );
#endif	BSD_41

#ifdef	BSD_42
	sprintf( buf, "TERMCAP=/etc/printcap; export TERMCAP; dviimp -a -p %s %s", pr_opts, outfile );
#endif	BSD_42

	if( system( buf ) != 0 )
		fatal( "error in spooling" );


	}


LOCAL	void
sig()
	{
	fprintf( stderr, "%s aborted\n", program );
	Exit( 1 );
	}


fatal( fmt, a1, a2, a3, a4 )
char	* fmt;
int	a1, a2, a3, a4;
	{

	fprintf( stderr, "%s: fatal - ", program );
	fprintf( stderr, fmt, a1, a2, a3, a4 );
	putc( '\n', stderr );

	Exit( 1 );

	}

warning( fmt, a1, a2, a3, a4 )
char	* fmt;
int	a1, a2, a3, a4;
	{

	fprintf( stderr, "%s: warning - ", program );
	fprintf( stderr, fmt, a1, a2, a3, a4 );
	putc( '\n', stderr );

	}

sumacc/cmd/mwdvi/dvi.c   444      0     12       31326  3470501335  10145 #include	<stdio.h>
#include	<ctype.h>

#include	"gen.h"
#include	"option.h"
#include	"md.h"
#include	"dvi.h"
#include	"fonts.h"


LOCAL	SP	indent		= min_to_sp(   500 );
LOCAL	SP	lmargin_h	= min_to_sp(   500 );
LOCAL	SP	lmargin_v	= min_to_sp(  1000 );
LOCAL	SP	rmargin_v	= min_to_sp( 10500 );
LOCAL	SP	rmargin_h	= min_to_sp(  6500 );
LOCAL	SP	tabs[TABMAX]	= { 0, };
LOCAL	int	tabcnt		= 0;
LOCAL	double	spacing	= 1.0;
LOCAL	int	adjust = JST_LEFT;


LOCAL	int	cur_font;
LOCAL	int	pushmax		= 0;
LOCAL	POS	stack[20];
LOCAL	POS	* cur;

LOCAL	FILEPTR	last_page = -1;


LOCAL	bool	silent = FALSE;


init()
	{
	int	i;

	for( i=0; i<MAX_FONTS; i++ )
		{
		fonts[i].f_active = FALSE;
		fonts[i].f_number = -1;
		}
	

	preamble();

	page_no = 0;
	page();

	}

finish()
	{
	outcmd( EOP );
	postamble();
	}

preamble()
	{
	outcmd( TEX_ID );		/* tek version 2 */
	out4( scale_num );		/* num */
	out4( scale_denom );		/* denom  */
	out4( 1000 );			/* mag */
	out1( 0 );
	}

postamble()
	{
	long	postptr;
	int	i;


	postptr = ftell( outfd );
	outcmd( POST );
	out4( last_page );
	out4( scale_num );		/* num */
	out4( scale_denom );		/* denom  */
	out4( 1000 );			/* mag */
	out4( min_to_sp( 11000 ) );	/* max height (fix this) */
	out4( min_to_sp( 8500 ) );	/* max width (fix this) */
	out2( pushmax );		/* max stack depth  */
	out2( page_no );

	/*	font definitions	*/
	for( i=0; i<MAX_FONTS; i++ )
		{
		if( fonts[i].f_number == -1 )
			break;
		else
			def_font( i );
		}
	
	outcmd( POSTPOST );
	out4( postptr );
	out1( TEX_ID );

	/* output a signature	*/
	for( i=0; i<4; i++ )
		out1( 223 );
	
	postptr = ftell(outfd);
	
	for( i=0; i< (postptr % 4); i++ )
		out1( 223 );

	}



/*
 *	do a page eject
 */
LOCAL	in_page = FALSE;
LOCAL	in_footer = FALSE;

page()
	{

	SP	bottom_margin;

	if( in_page )
		{

		if( in_footer )
			{
			warning( "footer extends off the bottom of the page" );
			return;
			}

		bottom_margin = rmargin_v;

		cur->p_v = rmargin_v;
		rmargin_v = min_to_sp( 11500 );
		in_footer = TRUE;

		footer();

		in_footer = FALSE;
		rmargin_v = bottom_margin;

		outcmd( EOP );

		}

	bop( ++page_no );
	in_page = TRUE;

	/*	potentially, don't print header on title page  */
	if( page_cnt++ || !title_page )
		header();

	}



bop( page )
int	page;
	{
	long	lastp;
	int	i;

	lastp = ftell(outfd);

	outcmd( BOP );
	out4( page );
	for( i=0; i<9; i++ )
		out4( 0 );
	out4( last_page );

	last_page = lastp;

	cur = stack;
	cur->p_v = cur->p_h = cur->p_w = 
	cur->p_x = cur->p_y = cur->p_z = 0;
	cur_font = -1;

	/*	start us out someplace reasonable	*/
	out_pos( 0L, lmargin_v );

	}


push()
	{
	if( cur - stack >= 19 )
		fatal( "botch: stack overflow" );
	
	outcmd( PUSH );

	*(cur+1) = *cur;
	++cur;

	pushmax = max( pushmax, cur - stack );
	}

pop()
	{
	if( cur <= stack )
		fatal( "botch: stack underflow" );
	
	outcmd( POP );

	--cur;
	}



/*
 *	format another line, dvi style
 */

out_line( len, line )
int	len;
Char	* line;
	{
	WORD	words[MAX_WORDS];

	int	wordpos;
	int	cpos;

	int	i;
	int	j;

	int	cur_font;
	int	this_font;

	SP	line_length;
	SP	line_height;
	SP	word_length;
	SP	word_space;
	SP	ss_space;
	SP	margin;

	/*
	 *	initial indent
	 */
	margin = indent;

	/*
	 *	break this paragraph into words
	 */
	for( cpos=0; cpos < len; ) {

	/*
	 *	skip leading spaces
	 */
	for( ; cpos < len; cpos++ )
		if( line[cpos].c_char != ' ' )
			break;

	cur_font = this_font = fontno( &line[cpos] );
	word_space = font_ws( cur_font );
	ss_space = font_ss( cur_font );
	line_height = font_height( cur_font );

	wordpos = 0;
	line_length = 0;

	/* leave yourself an initial null space */
	words[wordpos].wd_length = 0;
	words[wordpos++].wd_flags = 0;

	while( cpos < len && line_length < (rmargin_h - margin) )
		{

		if( wordpos >= MAX_WORDS )
			fatal( "(botch) too many words in this paragraph" );

		if( !isspace( line[cpos].c_char ) )
			{
			/*
			 *	non space characters
			 */
			words[wordpos].wd_flags = WD_WORD;
			words[wordpos].wd_pos = cpos;

			
			word_length = 0;
			while( cpos < len 
			&&     !isspace( line[cpos].c_char ) )
				{
				word_length += ch_wid( &line[cpos] );

				this_font = fontno( &line[cpos] );
				line_height = max( line_height,
					font_height( this_font ) );

				cpos++;
				}
			
			/*
			 *	this_font is guaranteed to be set
			 */
			if( this_font != cur_font )
				{
				cur_font = this_font;
				word_space = font_ws( cur_font );
				ss_space = font_ss( cur_font );
				}
			
			words[wordpos].wd_length = word_length;
			words[wordpos++].wd_end = cpos;

			Debug {
			fprintf( stderr, "line_out: -" );
			for( i=words[wordpos-1].wd_pos; i<cpos; i++ )
				fprintf( stderr, "%c", line[i].c_char );
			fprintf( stderr, "- (%2.2f)\n", sp_to_in(word_length),
				sp_to_in(line_length) );
			}

			/*
			 *	will this word overflow the line? 
			 */
			if(line_length + word_length > (rmargin_h - margin))
				{
				cpos = words[--wordpos].wd_pos;
				break;
				}
			}
		else
			{

			SP	space;

			/*
			 *	process the word gap
			 */
			words[wordpos].wd_flags = 0;
			words[wordpos].wd_tabcnt = 0;
			word_length = words[wordpos].wd_length = 0;


			/* 
			 *	is this an inter-word or inter-sentence gap?
			 */
			if( wordpos > 0 
			&&  (words[wordpos-1].wd_flags & WD_WORD)
			&&  ispunct(line[words[wordpos-1].wd_end-1].c_char ) )
				space = ss_space;
			else
				space = word_space;
				

			/* 
			 *	eat up those spaces.  count those tabs
			 */
			while( cpos < len 
			&&     isspace( line[cpos].c_char ) )
				{
				if( line[cpos].c_char == '\t' )
					{
					words[wordpos].wd_flags |= WD_TAB;
					words[wordpos].wd_length = word_space;
					words[wordpos].wd_tabcnt++;
					}
				else
				if( line[cpos].c_char == ' ')
					{
					word_length = 
					words[wordpos].wd_length = space;
					}
				
				if( line[cpos].c_style & ST_UL )
					words[wordpos].wd_flags |= WD_UL;

				cpos++;
				}
				
			wordpos++;
				
			}
		
		line_length += word_length;

		}

	/*

	 *	print out the words in this line
	 */


	/* 	move to the next line */

	down( (SP)((line_height * 1.4) * spacing) );


	push();		/* save the margin coordinates */

	if( cur->p_v > rmargin_v )
		{
		page();	/* you get an implicit pop when you page */
		push();
		}
	right( margin );

	
	/*
	 *	remove trailing white space
	 */
	while( wordpos > 0 )
		{
		if( words[wordpos-1].wd_flags & WD_WORD )
			break;
		else
			wordpos--;
		}

	/*
	 *	center, justify, or whatever
	 */
	justify( words, &wordpos, &cpos, margin, (cpos >= len) );


	/*
	 *	print that suckah
	 */
	for( i=0; i < wordpos; i++ )
		{
		if( words[i].wd_flags & WD_WORD )
			{
			for( j=words[i].wd_pos; j < words[i].wd_end; j++)
				set_ch( &line[j] );
			}
		else
			right( words[i].wd_length );
		}
	
	Debug {
	fprintf( stderr, "line %2.2f, %2.2f\n", sp_to_in(cur->p_h ),
		sp_to_in(cur->p_v) );
	}

	pop();		/* restore the margin coordinates */


	/*	do any underlining that might be appropriate	*/
	underline( words, wordpos, line, margin );
	

	margin = lmargin_h;	/* undo the indent */

	}

	}


/*
 *	justify the line.  add some tabs
 */
justify( words, word_count, cur_pos, margin, last_line )
WORD	* words;
int	* word_count;
int	* cur_pos;
SP	margin;
int	last_line;
	{

	SP	spacelen;
	SP	extra_space;
	SP	line_len;
	SP	line_wid;
	REG	WORD	* cw;
	REG	double	ratio;
	REG	int	i;
	int	lasttab;
	int	wdcnt;

	wdcnt	= *word_count;

	/*
	 *	take care of tabs
	 */
	lasttab = 0;

	if( adjust == JST_LEFT || adjust == JST_ADJ )
		{
		REG	SP cpos = margin;
		int	tb;

		/*  modify tab width to justify next word */
		for( cw=words; cw < &words[wdcnt]; cw++ )
			{
			if( cw->wd_flags & WD_TAB )
				{
				lasttab = (cw-words) + 1;

				for( tb=0; tb < cw->wd_tabcnt; tb++ )
					{

					for( i=0; i<tabcnt; i++ )
						if( cpos < tabs[i] )
							break;

					if( i < tabcnt )
						cw->wd_length = tabs[i] - cpos;

					}
				
				}
			
			/*  is the line now too large to fit? */
			if( cpos + cw->wd_length > rmargin_h )
				break;
				
			cpos += cw->wd_length;

			}
		
		/*	shorten this line.  tabs expanded it too much */
		if( cw != &words[wdcnt] )
			{
			*cur_pos = cw->wd_pos;
			wdcnt = *word_count = cw - words;
			}
		
		/*	don't justify words before a tab stop	*/
		for( cw=words; cw < &words[lasttab]; cw++ )
			margin += cw->wd_length;

		}
	
	/* figure out the current length of this line */
	for  ( line_len = 0, cw = &words[lasttab]; cw < &words[wdcnt]; cw++ )
		line_len += cw->wd_length;
	
	line_wid = rmargin_h - margin;


	switch( adjust )
		{
		case JST_LEFT:
			break;

		case JST_ADJ:
			
			if( last_line || line_len <= 0 )
				break;

			spacelen = 0;

			for( cw = &words[lasttab]; cw < &words[wdcnt]; cw++ )
				{
				if( !(cw->wd_flags & WD_WORD) )
					spacelen += cw->wd_length;
				}
				
			extra_space = (line_wid-line_len) + spacelen;
			ratio = ((double)extra_space) / spacelen;


			for( cw = &words[lasttab]; cw < &words[wdcnt]; cw++ )
				if( !(cw->wd_flags & WD_WORD) )
					cw->wd_length = cw->wd_length * ratio; 
			break;


		case JST_RIGHT:
			words[0].wd_length = line_wid - line_len;
			break;

		case JST_CENTER:
			words[0].wd_length = (line_wid - line_len) / 2;
			break;
		}
	}


underline( words, length, line, margin )
WORD	* words;
int	length;
Char	* line;
SP	margin;
	{

	SP	cpos;
	SP	ul_start;
	REG	int	chpos;
	REG	WORD	* wd;

	bool	ul	= FALSE;

	if( silent )
		return;

	for( cpos = 0, wd = words; wd < &words[length]; wd++  )
		{

		if( wd->wd_flags & WD_WORD )
			{

			for( chpos = wd->wd_pos; chpos < wd->wd_end; chpos++ )
				{
				if( line[chpos].c_style & ST_UL && !ul )
					{
					ul_start = cpos;
					ul = TRUE;
					}
				else
				if( !(line[chpos].c_style & ST_UL) && ul )
					{
					ul = FALSE;

					t_rule( margin+ul_start, mpt_to_sp(250),
						cpos-ul_start );
					}
				
				cpos += ch_wid( &line[chpos] );
				}
			}
		else
			{

			if( (wd->wd_flags & WD_UL) &&  !ul )
				{
				ul = TRUE;
				ul_start = cpos;
				}
			else
			if( !(wd->wd_flags & WD_UL) &&  ul )
				{
				ul = FALSE;

				t_rule( margin+ul_start, mpt_to_sp(250), 
					cpos-ul_start );
				}

			cpos += wd->wd_length;
			}
		
		}
	if( ul )
		t_rule( margin+ul_start, mpt_to_sp(250), cpos-ul_start );

	}


/*
 *	gimme a transparent rule (assume you are at left margin to start)
 */
t_rule( start, h, w )
SP	start;
SP	h;
SP	w;
	{

	push();

	right( start );

	down( (SP)(h + mpt_to_sp(400)) );

	outcmd( PUTRULE );
	out4( h );
	out4( w );

	pop();

	}


/*
 *	put a character at the current position and advance
 */
set_ch( lptr )
Char	* lptr;
	{
	int	font;

	if( silent )
		return;

	if( (font = fontno(lptr)) != cur_font )
		{

		cur_font = font;
		if( !fonts[font].f_active )
			def_font( font );

		outcmd( FONT0 + font );

		}

	outcmd( SET0 + lptr->c_char );

	cur->p_h += ch_wid( lptr );

	}



/*
 *	measure the size of the footer
 */
init_footer()
	{

	SP	top;

	push();
	silent = TRUE;

	top = cur->p_v = min_to_sp( 500 );

	footer();

	rmargin_v = min_to_sp( 10500 ) - (cur->p_v - top);

	if( verbose )
		fprintf( stderr, "footer length %3.2f in.\n", 
			sp_to_in( cur->p_v - top ) );

	silent = FALSE;
	pop();

	}
	

set_ruler( lmargin, rmargin, indnt, space, just )
PIX	lmargin;
PIX	rmargin;
PIX	indnt;
int	space;
int	just;
	{

	lmargin_h = pix_to_sp( lmargin ) + min_to_sp( 1000 );;
	rmargin_h = pix_to_sp( rmargin ) + min_to_sp( 1000 );;
	indent = pix_to_sp( indnt ) + min_to_sp( 1000 );
	adjust = just;

	switch( space )
		{
		case S_SINGLE:
			spacing = 1.0;
			break;

		case S_ONEANDHALF:
			spacing = 1.5;
			break;

		case S_DOUBLE:
			spacing = 2.0;
			break;

		default:
			warning( "unknown line spacing" );
			spacing = 1.0;
			break;
		}

	}


/*	single level save	*/
LOCAL	SP	o_rmargin_h;
LOCAL	SP	o_lmargin_h;
LOCAL	SP	o_indent;
LOCAL	double	o_spacing;
LOCAL	int	o_adjust;
LOCAL	SP	o_tabs[TABMAX];
LOCAL	int	o_tabcnt;

save_ruler()
	{
	int	i;

	o_rmargin_h = rmargin_h;
	o_lmargin_h = lmargin_h;
	o_indent = indent;
	o_spacing = spacing;
	o_adjust = adjust;

	for( o_tabcnt = tabcnt, i=0; i<o_tabcnt; i++ )
		o_tabs[i] = tabs[i];

	}

restore_ruler()
	{
	int	i;

	rmargin_h = o_rmargin_h;
	lmargin_h = o_lmargin_h;
	indent = o_indent;
	spacing = o_spacing;
	adjust = o_adjust;

	for( tabcnt = o_tabcnt, i=0; i<tabcnt; i++ )
		tabs[i] = o_tabs[i];

	}




clr_tabs()
	{
	tabcnt = 0;
	}

set_tab( tab )
PIX	tab;
	{
	tabs[tabcnt++] = pix_to_sp( tab ) + min_to_sp( 1000 );
	}


cr()
	{
	out_pos( lmargin_h, cur->p_v );
	}


right( h )
SP	h;
	{

	if( h == 0 )
		return;

	outcmd( RIGHT4 );
	out4( h );

	cur->p_h += h;

	}

down( v )
SP	v;
	{

	outcmd( DOWN4 );
	out4( v );

	cur->p_v += v;

	}


/*
 *	go to the indicated position
 */
out_pos( h, v)
long	h;
long	v;
	{

	if( h != cur->p_h )
		{
		outcmd( X4 );
		out4( h - cur->p_h );
		}
	if( v != cur->p_v )
		{
		outcmd( Y4 );
		out4( v - cur->p_v );
		}

	cur->p_h = h;
	cur->p_v = v;

	}

out( outfd, length, value )
FILE	* outfd;
int	length;
long	value;
	{
	REG	int	i;
	int	v;

	for( i=0; i<length; i++ )
		{
		v = value >> (((length-1) - i) * 8);
		putc( v & 0xff, outfd );
		}
	
	}
->wd_length = cw->wd_length * ratio; 
			break;


		case JST_RIGHT:
			words[0].wd_length = line_wid - line_len;
			break;

		case JST_CENTER:
			words[0].wd_length = (line_wid - line_len) / 2;
			break;
		}
	}


underline( words, length, line, margin )
WORD	* words;
int	length;
Char	* line;
SP	masumacc/cmd/mwdvi/fonts.c   444      0     12       17671  3470501335  10523 #include	<stdio.h>
#include	<ctype.h>

#include	"site.h"
#include	"gen.h"
#include	"option.h"
#include	"md.h"
#include	"dvi.h"
#include	"fonts.h"

LOCAL	char	* get_tok();
LOCAL	char	* mac_font();

/*
 *	translate apple font numbers into something more reasonable
 */
fontno( lptr )
Char	* lptr;
	{
	REG	int	i;
	REG	int	j;
	REG	FONT	* fnt;

	char	buf[200];
	char	obuf[200];
	FILE	* fd;
	int	bc, ec;
	int	hlength;
	int	wlength;
	int	dlength;
	int	extra_length;
	int	hdlength;

	int	at_size;
	double	ratio;


	for( i=0; i<MAX_FONTS; i++ )
		{
		if( fonts[i].f_number == -1 )
			break;
		else
		if( fonts[i].f_number == lptr->c_font
		&&  fonts[i].f_size == lptr->c_size
		&&  ( (fonts[i].f_style & ~(ST_UL|ST_SHADOW)) == 
		      (lptr->c_style & ~(ST_UL|ST_SHADOW)) )  )
			return( i );
		}
	
	if( i == MAX_FONTS )
		fatal( "too many fonts" );

	fnt = &fonts[i];
	

	/*
	 *	no such font - load one up
	 */

	at_size = lptr->c_size;

	/*	default font is a scaled 10pt font	*/
	sprintf( buf, "cm%s10", Style(lptr->c_style) );
	substitute_font( buf, lptr, &at_size );

	if( verbose )
		fprintf( stderr, "using font %s at %dpt for MAC font %s\n", 
			buf, at_size, mac_font(lptr) );

	strcat( buf, ".tfm" );

	fnt->f_number = lptr->c_font;
	fnt->f_size = lptr->c_size;
	fnt->f_style = lptr->c_style;

	sprintf( obuf, "%s/%s", TFM_PATH, buf );

	buf[strlen(buf)-4] = '\0';
	fnt->f_name = (char *)(strcpy( (char *)malloc(strlen(buf)+1),buf));


	/*
	 *	read in the tfm file
	 */
	if( (fd = fopen(obuf, "r")) == NULL )
		fatal( "couldn't open font tfm file %s", obuf );
	
	get_int(fd);			/* lf */
	hdlength = get_int(fd);		/* header data */
	bc = get_int(fd);		/* first character */
	ec = get_int(fd);		/* last character */
	wlength = get_int(fd);		/* lengths of sections */
	hlength = get_int(fd);
	dlength = get_int(fd);

	extra_length = get_int(fd) + get_int(fd) +
		get_int(fd) + get_int(fd);	/* length of the rest */

	fnt->f_info = (CH_INFO *)malloc( (ec-bc+1) * sizeof(CH_INFO) );
	fnt->f_width = (long *)malloc( wlength * 4 );
	fnt->f_height = (long *)malloc( hlength * 4 );
	fnt->f_depth = (long *)malloc( dlength * 4 );

	set( fd, 6 * sizeof(long) );

	fnt->f_csum = get_long(fd);
	fnt->f_dsize = fix_to_sp(get_long(fd));
	fnt->f_at_size = pt_to_sp(at_size);

	set( fd, (6 + hdlength) * 4 );

	for( j=0; j<(ec-bc+1); j++ )
		{
		fnt->f_info[j].ch_windex = get_byte(fd);
		fnt->f_info[j].ch_hindex = get_byte(fd);
		fnt->f_info[j].ch_itindex = get_byte(fd);
		fnt->f_info[j].ch_remainder = get_byte(fd);
		}
	
	for( j=0; j<wlength; j++ )
		fnt->f_width[j] = fix_to_sp(get_long(fd) * at_size);

	for( j=0; j<hlength; j++ )
		fnt->f_height[j] = fix_to_sp(get_long(fd) * at_size);

	for( j=0; j<dlength; j++ )
		fnt->f_depth[j] = fix_to_sp(get_long(fd) * at_size);
	
	/*
	 *	(fix this right) - grab a big character to set the pace
	 */
	fnt->f_maxheight = 
		fnt->f_height[(fnt->f_info['['].ch_hindex>>4) & 0xf];

	skip( fd, extra_length * 4 );

	/*	parameter words	*/
	(void)get_long(fd);					/* slant */
	fnt->f_ws = fix_to_sp(get_long(fd) * at_size);		/* space */
	fnt->f_stretch = fix_to_sp(get_long(fd) * at_size);	/* stretch */
	fnt->f_shrink = fix_to_sp(get_long(fd) * at_size);	/* shrink */
	fnt->f_accent = fix_to_sp(get_long(fd) * at_size);	/* accent */
	(void)get_long(fd);					/* quad */
	fnt->f_ss = fnt->f_ws + fix_to_sp(get_long(fd) * at_size); /*sentence*/
	
	fclose(fd);

	return( i );

	}

/*
 *	perform font substitutions from a file with the format:
 *
 *	font pointsize style  -> newfont atsize
 */

LOCAL	char	*
get_tok( ptr )
REG	char	* * ptr;
	{

	char	* pstart = *ptr;

	while( **ptr && !isspace( **ptr ) )
		(*ptr)++;
	
	if( **ptr )
		*((*ptr)++) = '\0';
	
	return( pstart );

	}


LOCAL
skip_blank( ptr )
REG	char	* * ptr;
	{

	while( **ptr && isspace( **ptr ) )
		(*ptr)++;
	
	return( **ptr != '\0' );

	}



substitute_font( buf, cptr, at_size )
char	* buf;
Char	* cptr;
int	* at_size;
	{
	FILE	* fd;
	char	tbuf[200];
	char	* font;
	char	* ptr;
	REG	char	* tok;
	char	*	rc;
	int	fno;
	int	style;
	int	pt;
	int	st;
	int	line_no;

	if( !font_sub_file )
		return;

	if( (fd = fopen( font_sub_file, "r" )) == NULL )
		{
		warning( "couldn't open substitution file %s", font_sub_file );
		return;
		}
	
	/*	substitute only the rational fonts	*/
	style = cptr->c_style & (ST_PLAIN|ST_BOLD|ST_ITALIC);
	
	for( line_no=1; (rc = fgets( tbuf, 200, fd )) != NULL; line_no++ )
		{

		if( *tbuf == '#' )
			continue;

		st = pt = -1;
		ptr = tbuf;


		/*
		 *	font name or number
		 */
		if( !skip_blank( &ptr ) )
			break;
		
		font = get_tok( &ptr );
		if( isdigit( *font ) )
			fno = atoi( font );
		else
			{
			if( (fno = f_ord( font )) < 0 )
				break;
			}

		/*
		 *	style or pt size or ->
		 */
		if( !skip_blank( &ptr ) )
			break;

		tok =  get_tok( &ptr );

		/*	could have default style, pt, or both at this point */
		if( strcmp( "->", tok ) != 0 && !isdigit( *tok ) )
			{
			if( (st = st_ord( tok )) < 0 )
				break;
			

			if( !skip_blank( &ptr ) )
				break;
			
			tok =  get_tok( &ptr );
			}
		
		if( isdigit( *tok ) )
			{
			pt = atoi( tok );


			if( !skip_blank( &ptr ) )
				break;

			tok = get_tok( &ptr );
			}

		/*	gots to have that arrow	*/
		if( strcmp( "->", tok ) != 0 )
			break;
		

		if( fno == cptr->c_font
		&&  (st == -1 || st == style)
		&&  (pt == -1 || pt == cptr->c_size) )
			{
			/*	match!		*/

			if( !skip_blank( &ptr ) )
				break;
			
			strcpy( buf, get_tok( &ptr ) );

			if( skip_blank( &ptr ) )
				*at_size = atoi( get_tok( &ptr ) );

			return;

			}
		

		}
	
	if( rc != NULL )
		warning( "syntax error in font substitution file at line %d",
			line_no );
	
	fclose( fd );

	}

/*	macintosh predefined fonts */
LOCAL	
char	* macfonts[] =
	{
	"system",
	"application",
	"new_york",
	"geneva",
	"monaco",
	"venice",
	"london",
	"athens",
	"san_fran",
	"toronto",
	};

f_ord( font )
char	* font;
	{

	char	* * fptr;

	for( 
	     fptr = macfonts;
	     fptr < &macfonts[sizeof(macfonts)/sizeof(char *)];
	     fptr++
	   )
		if( strcmp( font, *fptr ) == 0 )
			return( fptr - macfonts );
	
	return( -1 );
	
	}

st_ord( style )
char	* style;
	{

	if( strcmp( "plain", style ) == 0 )
		return( ST_PLAIN );
	
	else
	if( strcmp( "bold", style ) == 0 )
		return( ST_BOLD );
	else
	if( strcmp( "italics", style ) == 0 )
		return( ST_ITALIC );
	else
	if( strcmp( "bold_italics", style ) == 0 )
		return( ST_BOLD | ST_ITALIC );
	
	return( -1 );

	}


/*	print out the name of the macintosh font indicated	*/
LOCAL	char *
mac_font( cptr )
Char	* cptr;
	{
	LOCAL	char	buf[40];

	if( cptr->c_font >= 0 
	&&  cptr->c_font < (sizeof(macfonts)/sizeof(char *)) )
		strcpy( buf, macfonts[ cptr->c_font ] );
	else
		sprintf( buf, "#%d", cptr->c_font );
	
	if( cptr->c_style & ST_BOLD )
		strcat( buf, " bold" );
	
	if( cptr->c_style & ST_ITALIC )
		strcat( buf, " italic" );
	
	return( buf );
	
	}


		

/*
 *	put a definition of the indicated font into the dvi file
 */
	
def_font( fno )
int	fno;
	{
	REG	int	i;

	if( fno < 0 || fno > MAX_FONTS ||
	    fonts[fno].f_number < 0 )
		fatal( "unknown font: %d\n", fno );


	outcmd( DFONT1 );
	out1( fno );
	out4( fonts[fno].f_csum );		/* checksum */
	out4( fonts[fno].f_at_size  );		/* num */
	out4( fonts[fno].f_dsize );		/* denom */
	out1( 0 );				/* use the system fonts */
	out1( strlen( fonts[fno].f_name ) );
	for( i=0; i<strlen(fonts[fno].f_name ); i++ )
		out1( fonts[fno].f_name[i] );

	fonts[fno].f_active = TRUE;
	
	}


SP
font_height( fontno )
int	fontno;
	{

	return( fonts[fontno].f_maxheight );

	}

SP
font_ws( fontno )
int	fontno;
	{

	return( fonts[fontno].f_ws );

	}

SP
font_ss( fontno )
	{

	return( fonts[fontno].f_ss );

	}


SP
ch_wid( cptr )
Char	* cptr;
	{
	REG	FONT	* fno;

	fno = &fonts[fontno(cptr)];

	return(fno->f_width [ (fno->f_info[cptr->c_char]).ch_windex ]);

	}

SP
ch_height( cptr )
Char	* cptr;
	{
	REG	FONT	* fno;

	fno = &fonts[fontno(cptr)];

	return( fno->f_height[(fno->f_info[cptr->c_char].ch_hindex>>4) & 0xf] );

	}

SP
ch_depth( cptr )
Char	* cptr;
	{
	REG	FONT	* fno;

	fno = &fonts[fontno(cptr)];

	return( fno->f_depth[fno->f_info[cptr->c_char].ch_hindex & 0xf] );

	}
t	pt;
	int	st;
	int	line_no;

	if( !font_sub_file )
		return;

	if( (fdsumacc/cmd/mwdvi/md.c   444      0     12       12565  3470501335   7767 #include	<stdio.h>
#include	<ctype.h>

#include	"gen.h"
#include	"option.h"
#include	"md.h"

LOCAL	FILEPTR	p_offset	= -1;
LOCAL	FILEPTR	h_offset	= -1;
LOCAL	FILEPTR	f_offset	= -1;

LOCAL	bool	display_header	= TRUE;
LOCAL	bool	display_footer	= TRUE;

LOCAL	int	document_count;
LOCAL	int	header_count;
LOCAL	int	footer_count;

int	page_cnt		= 0;
int	page_no			= 0;
bool	title_page		= FALSE;

read_globals()
	{

	int	version;
	REG	int	i;
	int	length;

	if( (version = get_int(infd)) != MW_ID )
		warning( "Unknown Macwrite version %d", version );

	p_offset = get_int(infd);
	document_count = get_int(infd);
	header_count = get_int(infd);
	footer_count = get_int(infd);

	title_page = get_byte(infd);
	(void)get_byte(infd);			/* display scrap */
	display_footer =  get_byte(infd);
	display_header =  get_byte(infd);
	(void)get_byte(infd);			/* rulers showing */
	(void)get_byte(infd);			/* spare byte (?) */
	(void)get_byte(infd);			/* active document */
	page_no = get_int(infd) - 1;

	/*  get the seek locations of the header and footer info  */
	set( infd, p_offset );
	for( i=0; i<document_count; i++ )
		{
		(void)get_int(infd);	/* paragraph type */
		length = get_int(infd);	/* paragraph length */

		skip( infd, length );
		}
	
	h_offset = pos(infd);


	for( i=0; i<header_count; i++ )
		{
		(void)get_int(infd);	/* paragraph type */
		length = get_int(infd);	/* paragraph length */

		skip( infd, length );
		}
	
	/*	set the bottom margin, based on the footer length */
	f_offset = pos(infd);
	init_footer();

	if( verbose )
		{
		fprintf( stderr, "Macwrite(%d) %d header, %d body, %d footer paragraghs\n", 
		version, header_count, document_count,  footer_count );
		fprintf( stderr, "footers %s headers %s\n", 
			display_footer ? "displayed" : "hidden",
			display_footer ? "displayed" : "hidden" );
		}
	}


read_paragraphs( off, count )
FILEPTR	off;
int	count;
	{
	int	i;

	set(infd, off);

	for( i=0; i<count; i++ )
		paragraph();
	
	}

body()
	{
	read_paragraphs( p_offset, document_count );
	}

header()
	{
	FILEPTR	save_pos;

	if( !display_header )
		return;

	save_pos = pos(infd);
	save_ruler();

	read_paragraphs( h_offset, header_count );

	restore_ruler();
	set( infd, save_pos );
	}


footer()
	{
	FILEPTR	save_pos;

	if( !display_footer )
		return;

	save_pos = pos(infd);
	save_ruler();

	read_paragraphs( f_offset, footer_count );

	restore_ruler();
	set( infd, save_pos );
	}


paragraph()
	{
	int	type;
	int	length;
	int	line_length;
	int	flength;
	FILEPTR	paragraph_end;
	REG	int	i;

	byte	cur_style;
	byte	cur_size;
	short	cur_font;

	Char	buf[200];
	bool	freeline = FALSE;
	Char	* line = buf;

	int	chpos;
	int	end_pos;


	if( (type = get_int(infd)) != RULER 
	&&  type != TEXT
	&&  type != PICTURE )
		fatal( "botch - invalid paragraph type %d in macwrite file",
			type );
	
	length = get_int(infd);
	paragraph_end = pos(infd) + length;

	if( type == TEXT )
		{

		line_length = get_int(infd);
		if( line_length > 200 )
			{
			line = (Char *)malloc( sizeof(Char) * line_length );
			if( line == NULL )
				fatal( "fatal - out of space\n" );
			freeline = TRUE;
			}


		for( i=0; i<line_length; i++ )
			line[i].c_char = get_byte(infd);

		if( line_length % 2 )
			skip(infd,1);

		/*	get font info	*/
		if( (flength = get_int(infd)) % 6 != 0 )
			{
			fatal( "invalid font length (%d) in macwrite file\n",
			flength );
			}

		for( chpos = get_int(infd); flength; chpos = end_pos )
			{
			cur_size = get_byte(infd);
			cur_style = get_byte(infd);
			cur_font = get_int(infd);

			flength -= 6;
			if( flength )
				end_pos = get_int(infd);
			else
				end_pos = line_length;

			
			for( i=chpos; i<end_pos; i++ )
				{
				line[i].c_size = cur_size;
				line[i].c_style = cur_style;
				line[i].c_font = cur_font;
				}
			}
		
		/*
		 *	mystery bytes 
		 */
		set( infd, paragraph_end );

		out_line( line_length, line );

		if( freeline )
			free( line );
		}
	else
	if( type == PICTURE )
		{

		/*	page breaks are pictures	*/
		if( (length = get_int(infd)) == 0 )
			page();
		else
			warning( "pictures not yet supported" );
		set( infd, paragraph_end );

		}
	else
	if( type == RULER )
		{
		PIX	lmargin;
		PIX	rmargin;
		PIX	indent;
		PIX	tab;
		int	tablen;
		int	spacing;
		int	justify;

		lmargin = get_int(infd);
		rmargin = get_int(infd);

		justify = get_byte(infd);
		
		tablen = get_byte(infd);
		get_byte(infd);		/* ??? mystery byte */

		spacing = get_byte(infd);
		indent = get_int(infd);

		set_ruler( lmargin, rmargin, indent, spacing, justify );

		/*
		 *	pick up the tab stops
		 */
		clr_tabs();

		for( i=0; i<tablen; i++ )
			{
			set_tab( get_int(infd) );
			}
		
		for( i=0; i < 10-flength; i++ )
			get_int(infd);
		
		/*
		 *	more mystery bytes
		 */
		get_int(infd);
		get_int(infd);

		set( infd, paragraph_end );

		}

	}


get_int(fd)
FILE	* fd;
	{
	int	ch;

	ch = get_byte(fd);
	ch = ch << 8 | get_byte(fd);

	return( ch );
	}

long
get_long(fd)
FILE	* fd;
	{
	long	val;
	int	i;

	for( val=0, i=0; i<4; i++ )
		{
		val <<= 8;
		val |= get_byte(fd);
		}
	
	return( val );
	}

int
get_byte(fd)
FILE	* fd;
	{
	int	ch;

	if( (ch = getc(fd)) == EOF )
		fatal( "unexpected EOF" );

	return( ch & 0xff );
	}


char	* 
Style( style_no )
byte	style_no;
	{

	style_no &= (ST_PLAIN|ST_BOLD|ST_ITALIC);

	switch( style_no )
		{
		case ST_PLAIN:
			return( "r" );

		case ST_BOLD:
			return( "b" );

		case ST_ITALIC:
			return( "ti" );

		default:
			fprintf( stderr, "unknown style %d\n", style_no );
			break;
		}
	return( "??" );

	}
 font, *fptr ) == 0 )
			return( fptr - macfonts );
	
	return( -1 );
	
	}

st_ord( style )
char	* style;
	{

	if( strcmp( "plain", style ) sumacc/cmd/mwdvi/gen.h   444      0     12        1626  3470501336  10122 

#define	FALSE	(0)
#define	TRUE	(!FALSE)

#define	L_SET	0
#define	L_CURR	1
#define	L_EOF	2

#define	REG	register
#define	LOCAL	static


#define	Debug		if( debflg )
#define	skip(fd,count)	(fseek(fd, (FILEPTR)(count), L_CURR))
#define	set(fd,pos)	(fseek(fd, (FILEPTR)(pos), L_SET))
#define	pos(fd)		(ftell(fd))
#define	align(fd)	if( pos(fd) % 2 ) Skip( 1 )

#define	Skip(count)	(skip(stdin,count))
#define	Set(pos)	set(stdin,pos)
#define	Get_int()	get_int(stdin)
#define	Get_byte()	get_byte(stdin)
#define	Pos()		(pos(stdin))
#define	Align()		align(stdin)

#define	max(a,b)	( (a) > (b) ? (a) : (b) )


typedef	unsigned char	byte;
typedef	byte	bool;

typedef	long	RSU, FIX, SP;		/* tex units */
typedef	long	FILEPTR;

typedef	struct
	{
	short	c_char;
	short	c_font;
	byte	c_size;
	byte	c_style;
	} Char;


extern	long	get_long();
extern	int	get_int();
extern	int	get_byte();

extern	char	* Style();

extern	bool	debflg;
Char *)malloc( sizeof(Char) * line_length );
			if( line == NULL )
				fatal( "fatal - out of space\n" );
sumacc/cmd/mwdvi/option.h   444      0     12         170  3470501336  10632 /*
 *	program options
 */

extern	bool	verbose;

extern	FILE	* outfd;
extern	FILE	* infd;

extern	char	* font_sub_file;
e	LOCAL	static


#define	Debug		if( debflg )
#define	skip(fd,count)	(fseek(fd, (FILEPTR)(count), L_CURR))
#define	set(fd,pos)	(fseek(fd, (FILEPTR)(pos), L_SET))
#define	pos(fd)		(ftell(fd))
#define	align(fd)	if( pos(fd) % 2 ) Skip( 1 )

#define	Skip(count)	(skip(stdin,count))
#define	Set(pos)	set(stdin,pos)
#define	Get_int()	get_int(stdin)
#define	Get_byte()	get_byte(stdin)
#define	Pos()		sumacc/cmd/mwdvi/md.h   444      0     12        1144  3470501336   7744 
#define	MW_ID	3		/* macwrite version */

#define	RULER	0		/* paragraph type */
#define	TEXT	1
#define	PICTURE	2

#define	ST_PLAIN (0)		/* style */
#define	ST_BOLD	(0x1)
#define	ST_ITALIC (0x2)
#define	ST_UL (0x4)
#define	ST_SHADOW (0x8)

#define	JST_LEFT (0)		/* line justification	*/
#define	JST_CENTER (1)
#define	JST_RIGHT (2)
#define	JST_ADJ (3)

#define	S_SINGLE (0)		/* line spacing */
#define	S_ONEANDHALF (1)
#define	S_DOUBLE (2)


typedef	long	PIX;


extern	int	page_no;	/* current page number */
extern	int	page_cnt;	/* how many pages we got? */
extern	bool	title_page;	/* first page is title page */
igned char	byte;
typedef	byte	bool;

typedef	long	RSU, FIX, SP;		/* tex units */
typedef	long	FILEPTR;

typedef	struct
	{
	short	c_char;
	short	c_font;
	byte	c_size;
	byte	c_style;
	} Char;


extern	long	get_long();
extern	int	get_int();
extern	int	get_byte();

extern	char	* Style();

extern	bool	debflg;
Char *)malloc( sizeof(Char) * line_length );
			if( line == NULL )
				fatal( "fatal - out of space\n" );
sumacc/cmd/mwdvi/dvi.h   444      0     12        3644  3470501337  10136 #define	MAX_WORDS	(200)		/* 200 words per paragraph */

/*
 *	dvi specific definitions
 */
#define	pt_per_in	(72)
#define	sp_per_pt	(1<<16)

#define	scale_num	(25400000)	/* scaling factor - sp to 10e-7 m. */
#define	scale_denom	(473628672)

#define	TEX_ID		(2)		/* TeX version 2 */


#define	WD_WORD	(0x01)
#define	WD_TAB	(0x02)
#define	WD_DTAB (0x04)
#define	WD_UL	(0x08)

#define	TABMAX	10			/* can you believe this? */



#define	SET0	0
#define	PUT1	133
#define	PUTRULE	137
#define	NOP	138
#define	BOP	139
#define	EOP	140
#define	PUSH	141
#define	POP	142
#define	RIGHT1	143
#define	RIGHT2	144
#define	RIGHT3	145
#define	RIGHT4	146
#define	W0	147
#define	W1	148
#define	X0	152
#define	X1	153
#define	X2	154
#define	X3	155
#define	X4	156
#define	DOWN1	157
#define	DOWN2	158
#define	DOWN3	159
#define	DOWN4	160
#define	Y0	161
#define	Y1	162
#define	Y2	163
#define	Y3	164
#define	Y4	165
#define	Z0	166
#define	Z1	167
#define	FONT0	171
#define	FONT1	235
#define	XXX1	239
#define	DFONT1	243
#define	PRE	247
#define	POST	248
#define	POSTPOST 249


#define	pt_to_sp(x)	((x) * sp_per_pt)
#define	mpt_to_sp(x)	(pt_to_sp(x)/1000)
#define	min_to_sp(x)	(pt_to_sp( (((x) * pt_per_in) / 1000) ))
#define	fix_to_sp(x)	(((x>>3)+1)>>1)
#define	pix_to_sp(x)	pt_to_sp((((double)x) / 80) * pt_per_in)

#define	sp_to_in(x)	((((double)x) / sp_per_pt) / pt_per_in )

#define	out4(v)		(out( outfd, 4, (long)(v) ))
#define	out3(v)		(out( outfd, 3, (long)(v) ))
#define	out2(v)		(out( outfd, 2, (long)(v) ))
#define	out1(v)		(out( outfd, 1, (long)(v) ))

#define	outcmd(c)	(out1(c))

/*
 *	type defininitions
 */

typedef	struct
	{
	short	wd_flags;
	SP	wd_length;
	int	wd_pos;		
	int	wd_end;	
	} WORD;
#define	wd_tabcnt	wd_pos

typedef struct
	{
	SP	p_h;		/* current horizontal position */
	SP	p_v;		/* current vertical position */
	SP	p_w;		/* delta */
	SP	p_x;		/* delta */
	SP	p_y;		/* delta */
	SP	p_z;		/* delta */
	} POS;

/*
 *	external variables
 */

extern	FILE	* outfd;
	page();
		else
			warning( "pictures not yet supported" );
		set( infd, paragraph_end );

	sumacc/cmd/mwdvi/fonts.h   444      0     12        1607  3470501337  10502 #define	MAX_FONTS	64


/*	macintosh predefined font numbers */
#define	F_SYSTEM (0)
#define	F_APPL	(1)
#define	F_NEWYORK (2)
#define	F_GENEVA (3)
#define	F_MONACO (4)
#define	F_VENICE (5)
#define	F_LONDON (6)
#define	F_ATHENS (7)
#define	F_SANFRAN (8)
#define	F_TORONTO (9)


typedef	struct
	{
	byte	ch_windex;
	byte	ch_hindex;
	byte	ch_itindex;
	byte	ch_remainder;
	} CH_INFO;
	
typedef	struct
	{
	int	f_number;		/* mac font number */
	byte	f_size;
	byte	f_style;		/* bold, italic, etc. */
	bool	f_active;		/* does the driver know about me? */
	char	* f_name;		/* font name (cmr, etc.) */
	long	f_csum;	
	CH_INFO	* f_info;		/* tfm info */
	SP	* f_width;
	SP	* f_height;
	SP	f_maxheight;
	SP	* f_depth;
	SP	f_dsize;
	SP	f_at_size;
	SP	f_slant;
	SP	f_stretch;
	SP	f_shrink;
	SP	f_accent;
	SP	f_ss;
	SP	f_ws;
	} FONT;

FONT	fonts[MAX_FONTS];

SP	ch_wid();
SP	font_ws();
SP	font_depth();
SP	font_height();
efine	Z1	167
#define	FONT0	171
#define	FONT1	235
#define	XXX1	239
#define	DFONT1	243
#define	PRE	247
#define	POST	248
#desumacc/cmd/mwdvi/mwdvi.1   444      0     12        6163  3470501337  10412 
.TH MWDVI 1 LOCAL
.SH NAME
mwdvi \- convert Macwrite files to dvi format
.SH SYNOPSIS
.B mwdvi
[ options ] file1 [file2 ...]
.SH DESCRIPTION
.I mwdvi
converts
.IR file s,
which should be in Macwrite format (version 3),
to TeX dvi format.  There are a several popular programs (such as
IMAGEN's 
.I dviimp(1)
program) that can be used to print files in this
format on a high quality electronic printer. 
.sp
In order to use mwdvi, the macwrite document must be saved with its
rulers and font information intact (not as TEXT ONLY) then transferred to
the host system (see macget(1)).
.sp
.I Mwdvi
will convert the macwrite document into dvi format and optionally submit
the resultant file to
.I dviimp(1) 
for printing on an electronic printer.
.sp
Mwdvi assumes that the file is to be printed using the TeX
cmr fonts and substitutes Computer Modern Roman for all plain
Macintosh fonts, Computer Modern Bold for all bold Macintosh fonts
and Computer Modern Italic for all italic Macintosh fonts, at the
appropriate point sizes.  Since the fonts used to print the
document are different from those used when viewing the 
document in macwrite, the spacing may come out somewhat differently.
The spacing will be proportional, but probably not quite the same.
.sp
If a different mapping is desired, a font
substitution file can be constructed using the following format:
.sp
.nf
	macfontname [style] [pt size] -> texfontname [targ pt]
.fi
.sp
Where
.I macfontname
can be any of \fBsystem, application, geneva, new_york, toronto, monaco, 
venice, london, athens, or san_fran,\fP or a decimal number indicating
the Macintosh internal number of the font to be substituted, 
.I style
can be any of \fBplain, bold, or italic,\fP
.I pt size
is the size to be replaced, 
.I texfontname
is the TeX font with which this font should be replaced,
and 
.I "targ pt"
is the point size at which the new font should be used.
.sp
For example:
.sp
.nf
	london bold 12 -> cmb10 12
.fi
.sp
The name of the substitution file can be specified 
in the environment variable "MACFONTS" or with a command line
option (that overrides any environment variable setting).
.sp
The options are:
.TP
.B \-p
Causes the output to be submitted to dviimp and spooled for printing
on an IMAGEN printer.
If no target printer is specified, the value of the PRINTER
environment variable is assumed to be the target printer.
.TP
.B \-Pprinter
Causes the indicated printer to be used for spooling of mwdvi output.
.TP
.B \-o
Causes the dvi file output by mwdvi to be put into the file named as
the next argument.
.TP
.B \-s
Causes the file named by the next argument to be used as the name of the file
that is to direct font substitutions.
.TP
.B \-v
Causes 
.I mwdvi
to operate in a verbose fashion, producing lots of interesting output.
.sp
If spooling is requested and no target file is indicated, 
.I mwdvi
will use a temporary file for the duration of the program.
.SH FILES
/usr/lib/font/imagen/tfm/*  -- description of host resident fonts.
.SH SEE ALSO
macget(1), dviimp(1), lpr(1)
.SH BUGS
Pictures, decimal tabs, and header/footer icons are not currently supported.
.SH AUTHOR
Douglas Orr - University of Michigan EECS dept.
AIN|ST_BOLD|ST_ITALIC);

	switch( style_no )
		{
		case ST_PLAIN:
			return( "r" );

		case ST_BOLD:
			return( "b" );

		case ST_ITALIC:
			return( "ti" );

		default:
			fprintf( stderr, "unknown style %d\n", style_no );
			break;
		}
	return( "??" );

	}
 font, *fptr ) == 0 )
			return( fptr - macfonts );
	
	return( -1 );
	
	}

st_ord( style )
char	* style;
	{

	if( strcmp( "plain", style ) sumacc/cmd/mwdvi/README   444      0     12        2216  3470501337  10055 From: ihnp4!umich!doug@uw-beaver.arpa (Doug Orr)
To: uofm-cv!ihnp4!uw-beaver!info-mac
Subject: macwrite to dvi conversion program
Cc: doug

The following is a program that converts from macwrite format to TeX dvi
format.  This allows you to print (typeset?!) macwrite documents on a
variety of electronic printers that support printing of TeX output.

It currently doesn't handle pictures (other than to ignore them),
page number, date, or time icons, special characters or accent marks.
Macwrite printing options are ignored.

I am planning to add these features, but I thought that people would
find this much useful in the mean time.

Support for interfacing to IMAGEN software on 4.1 and 4.2 is provided.
This can just be commented out if not applicable.

Thanks to the gentleman that posted the description of macwrite internal
format.  

If anyone knows anything about the legalities of using Mac fonts on
an imagen or has access to higher density versions of the mac fonts,
I would just love to talk to you.  Currently this program substitutes
TeX fonts for mac fonts.

	-Doug Orr
	ihnp4!uovm-cv!umich!doug

[Ed. File is on [SUMEX]<INFO-MAC>MWDVI.C]
-------

somewhat differently.
The spacing will be proportional, but probably not quite the same.
.sp
If a different mapping is desired, a font
substitution file can be constructed using the following format:
.sp
.nf
	macfontname [style] [pt size] -> texfontname [targ pt]
.fi
.sp
Where
.I macfontname
can be any of \fBsystem, application, geneva, new_york, toronto, monaco, 
vensumacc/cmd/mwdvi/macwrite.format   444      0     12        7765  3470501340  12232 24-Jul-84 16:57:23-PDT,4168;000000000001
Mail-From: PATTERMANN created at 24-Jul-84 16:57:01
Return-Path: <winkler@harvard.ARPA>
Received: from harvard.ARPA by SUMEX-AIM.ARPA with TCP; Tue 24 Jul 84 09:19:57-PDT
Received: by harvard.ARPA (4.12/4.27)
	id AA14325; Tue, 24 Jul 84 12:22:12 edt
Date: Tue, 24 Jul 84 12:22:12 edt
From: winkler@harvard.ARPA (Dan Winkler)
Message-Id: <8407241622.AA14325@harvard.ARPA>
To: patterman@sumex
Subject: MacWrite Document Format
Cc: info-mac@sumex
ReSent-date: Tue 24 Jul 84 16:57:01-PDT
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;

		MacWrite Disk File Format

A MacWrite file starts off with global data concerning the state of the 
program when the file is saved.  After this comes information about each
window, i.e. the main document, header, and footer.  Then follows the
actual paragraph data for each of the windows.

Global Variables - 20 bytes total
---------------------------------

Version Number - A word containing the version number of the file
	format.  (Should be 3)

Paragraph Offset - A word containing the file position of the start of
	paragraph data in the file.

Main Document Paragraph Count - A word.

Header Paragraph Count - A word.

Footer Paragraph Count - A word.

Title Page Flag - 1 byte set true if the first page header is not to be
	drawn.

Scrap Show Flag - 1 byte set true if the scrap is to be displayed.

Footer Displayed Flag - 1 byte true if the footer is displayed.

Header Displayed Flag - 1 byte true if the header is displayed.

Rulers Showing Flag - 1 byte true if rulers are hidden.

Spare Byte.

Active Document Number - A word telling which window was activated at
	the time of the save (0=main, 1=header, 2=footer).

Starting Page Number - A word containing the page number of the first
	page.


Printing Variables - 120 bytes
------------------------------


Document Variables - 34 bytes for each document
-----------------------------------------------

Start of Selection - 2 words, 1 for paragraph number and 1 for character
	position.

End of Selection - 2 words same as above.

Vertical Offset - A word for the position of the top of the page at the
	time of the save.  Always negative or 0.

Need to Redraw - A word telling which paragraph to redraw the document
	from when loaded.

Page Number Position - 2 words for the position of the top left point of
	the page number icon. (Vertical, Horizontal)

Date Position - 2 words for the position of the top left point of the
	date icon.

Time Position - 2 words for the position of the top left point of the
	time icon rectangle.

Time Coordinates - 2 words for the position the time string was actually
	drawn.

Icon Redraw - 1 byte true if the icons have to be redrawn.

Icon Flag - 1 byte true if the rulers were showing when the icons were
	last updated.

Active Font Number - A word for the font that was active at the time of
	the save.

Active Style Number - A word for the face that was active.

The main document variables are stored first, followed by the header and
	then the footer.

Info Arrays
-----------

One array for each document, with 8 bytes per paragraph in the document.
Each array element contains a word for the height of the paragraph, a
word for the position, 1 byte for the pagenumber (zero based), and 3
unused bytes.  The arrays are stored main document first, then header
and footer.

Paragraph Data
--------------

The main document paragraphs are stored first, then those of the header
and footer.  Each paragraph starts with a word for the type (0=ruler,
1=text, 2=picture) and a word for the length of the actual data.  Then
follows the data for the paragraph.  Each text paragraph starts with a
word for the text length.  Then the ASCII data follows.  On the even
word boundary following the text there is a word for the format run
length.  Each format consists of six bytes: the first word is the
character position that this format change starts on.  Next comes one
byte for the point size, on byte for the style, an unused byte, and then
a word for the font number.


 for characsumacc/cmd/mwdvi/v3   444      0     12        6544  3470501340   7452 (Message inbox:436)
Return-Path: <CROFT@SUMEX-AIM.ARPA>
Received: from SUMEX-AIM.ARPA by safe with TCP; Mon, 12 Nov 84 09:55:51 pst
Date: Mon 12 Nov 84 09:55:16-PST
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [ihnp4!umich!doug@uw-beaver.arpa (Doug Orr): my address]
To: croft@SUMEX-AIM.ARPA

Mail-From: PATTERMANN created at 10-Nov-84 22:37:26
Return-Path: <ihnp4!uofm-cv!umich!doug@uw-beaver.arpa>
Received: from uw-beaver.arpa by SUMEX-AIM.ARPA with TCP; Sat 10 Nov 84 04:15:55-PST
Received: by uw-beaver.arpa (4.12/2.2)
	id AA09160; Sat, 10 Nov 84 04:14:47 pst
Return-Path: <ihnp4!uofm-cv!umich!doug@uw-beaver.arpa>
Received: by ihnp4.ATT.UUCP; id AA02169; 10 Nov 84 06:02:27 CST (Sat)
Date: Wed, 7 Nov 84 10:49:17 est
From: ihnp4!umich!doug@uw-beaver.arpa (Doug Orr)
Received: by umich.UMICH; Wed, 7 Nov 84 10:49:17 est (4.12/5.20)
Message-Id: <8411071549.AA08322@umich.UMICH>
To: uofm-cv!ihnp4!uw-beaver!info-mac
Subject: my address
ReSent-date: Sat 10 Nov 84 22:37:26-PST
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;


In case I gave the wrong address when I sent out my macwrite -> dvi
program,  I am at

	ihnp4!uofm-cv!umich!doug

I have one or two small clarifications to offer for the macwrite internal 
document.

	1)  "word"  refers to a two byte integer
	2)  most dimensions are in pixels (80ths of an inch)
	3)  at one point, I believe that it says something to the effect that
	after a text run, an even word alignment is made.  What is meant is
	that the text length is made even, not the text byte address in the
	file (if you have read an odd number of bytes, skip one).
	4)  ruler information is 

	left margin		int
	right margin		int
	justify			byte	0->left  1->both  2->right 3->center
	tab count		byte
	unused (?)		byte
	spacing			byte	0->ss  1->1 1/2 sp  2->double sp
	paragraph indent	int
	tabs			10 int  (tab count are valid)
	unused(?)		4 bytes


All of this applies to the old version of macwrite.  I am not sure what
changes have been made in the new version.

	-Doug

-------

(Message inbox:437)
Return-Path: <CROFT@SUMEX-AIM.ARPA>
Received: from SUMEX-AIM.ARPA by safe with TCP; Mon, 12 Nov 84 09:56:05 pst
Date: Mon 12 Nov 84 09:55:30-PST
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [ihnp4!umich!doug@uw-beaver.arpa (Doug Orr): Macwrite version]
To: croft@SUMEX-AIM.ARPA

Mail-From: PATTERMANN created at 10-Nov-84 22:37:30
Return-Path: <ihnp4!uofm-cv!umich!doug@uw-beaver.arpa>
Received: from uw-beaver.arpa by SUMEX-AIM.ARPA with TCP; Sat 10 Nov 84 04:16:20-PST
Received: by uw-beaver.arpa (4.12/2.2)
	id AA09189; Sat, 10 Nov 84 04:15:26 pst
Return-Path: <ihnp4!uofm-cv!umich!doug@uw-beaver.arpa>
Received: by ihnp4.ATT.UUCP; id AA02193; 10 Nov 84 06:02:36 CST (Sat)
Date: Thu, 8 Nov 84 09:13:39 est
From: ihnp4!umich!doug@uw-beaver.arpa (Doug Orr)
Received: by umich.UMICH; Thu, 8 Nov 84 09:13:39 est (4.12/5.20)
Message-Id: <8411081413.AA15551@umich.UMICH>
To: uofm-cv!ihnp4!uw-beaver!info-mac
Subject: Macwrite version
ReSent-date: Sat 10 Nov 84 22:37:30-PST
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;


	The macwrite -> dvi  program works with what appears to be
macwrite version 3.  I am not sure what that means.  The macwrite
description posted on the net matched what my macwrite generates
fine.  Assuming that the version number is where it is supposed to be,
That claims to be version 3.

	-Doug

-------

 format change starts on.  Next comes one
byte for the point size, on byte for the style, an unused byte, and then
a word for the font number.


 for characsumacc/cmd/z   444      0     12          76  3470501323   6200 cc -o kermit kermit.o
cc -O -c rmaker.c
cc -o rmaker rmaker.o
 number of bytes, skip one).
	4)  ruler information is 

	left margin		int
	right margin		int
	justify			byte	0->left  1->both  2->right 3->center
	tab count		byte
	unused (?)		byte
	spacing			byte	0->ss  1->1 1/2 sp  2->double sp
	paragraph indent	int
	tabs			10 int  (tab count are valid)
	unused(?)		4 bytes


All of this applies to the old version of macwrite.  I am not sure what
changes have been made in the new version.

	-Doug

-------

(Messumacc/cmd/tohex.c   444      0     12        2125  3470501323   7334 
#include <stdio.h>

char hex[] = "@ABCDEFGHIJKLMNO";
int bytes,sum;
unsigned long htonl();

main(argc,argv)
	char **argv;
{
	register i,len;
	register char *cp;

	len = 0;
	while ((i = getchar()) != EOF) {
		bytes++;
		sum += i;
		putchar(hex[i>>4]);
		putchar(hex[i&0xF]);
		if (++len > 32) {
			putchar('\n');
			len = 0;
		}
	}
	fprintf(stderr, "bytes %d, sum %d\n", bytes, sum);
	putchar('|');
	sum += bytes;
	sum = htonl(sum);
	cp = (char *)&sum;
	for (len = 0 ; len < 4 ; len++) {
		i = (*cp++ & 0xff);
		putchar(hex[i>>4]);
		putchar(hex[i&0xF]);
	}
	putchar('\n');
	exit(0);
}

#define nohtonl
#ifdef nohtonl	/* if not in library */
/*
 * "Host" to "net" byte order swappers.
 */
unsigned short htons(a)
	unsigned short a;
{
	unsigned short result;
	register char *sp = (char *)&a;
	register char *dp = (char *)&result;

	dp[1] = *sp++;
	dp[0] = *sp;
	return (result);
}


unsigned long htonl(a)
	unsigned long a;
{
	unsigned long result;
	register char *sp = (char *)&a;
	register char *dp = (char *)&result;

	dp[3] = *sp++;
	dp[2] = *sp++;
	dp[1] = *sp++;
	dp[0] = *sp;
	return (result);
}
#endif
safe with TCP; Mon, 12 Nov 84 09:56:05 pst
Date: Mon 12 Nov 84 09:55:30-PST
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [ihnp4!umich!doug@uw-beaver.arpa (Doug Orr): Macwrite version]
To: croft@SUMEX-AIM.ARPA

Mail-From: PATTERMANN created at 10-Nov-84 22:37:30
Return-Path: <ihnp4!uofm-cv!umich!doug@uw-beaver.arpa>
Received: from uw-beaver.arpa by SUMEX-AIM.ARPA with TCP; Sat 10 Nov 84 04:16:20-PST
Received: by uw-beavesumacc/cmd/fromhex.c   444      0     12        1027  3470501324   7656 /* fromhex.c, UNIX version */

#include <stdio.h>

int bytes,sum;

main()
{
	register i,v;
	register n;

	n = 0;
	v = 0;
	while ((i = getchar()) != EOF) {
		i &= 0177;
		if (i == '|') 
			break;
		if (i < 0100 || i > 0117)
			continue;
		v = (v << 4) | (i & 0xF);
		if ((++n & 1) == 0) {
			putchar(v);
			sum += v;
			v = 0;
			bytes++;
		}
	}
	n = 0;
	for (i = 0 ; i < 8 ; i++)
		n = (n << 4) | (getchar() & 0xF);
	if (n != (bytes + sum))
		fprintf(stderr, "bad checksum\n");
	else
		fprintf(stderr, "checksum good!\n");
	exit(0);
}
p++;
	dp[1] = *sp++;
	dp[0] = *sp;
	return (result);
}
#endif
safe with TCP; Mon, 12 Nov 84 09:56:05 pst
Date: Mon 12 Nov 84 09:55:30-PST
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [ihnp4!umich!doug@uw-beaver.arpa (Doug Orr): Macwrite version]
To: croft@SUMEX-AIM.ARPA

Mail-From: PATTERMANN created at 10-Nov-84 22:37:30
Return-Path: <ihnp4!uofm-cv!umich!doug@uw-beaver.arpa>
Received: from uw-beaver.arpa by SUMEX-AIM.ARPA with TCP; Sat 10 Nov 84 04:16:20-PST
Received: by uw-beavesumacc/cmd/macsbugmap.c   444      0     12        2324  3470501324  10326 /*
 * macsbugmap - generate map for use with macsbug
 *
 * usage:  macsbugmap MACSEGMENTORIGIN		(typically macsbugmap 4e48)
 *
 * Reads b.out and produces b.map file which is used with macsbug.
 * [This should be written in AWK, but there's no hex/octal input!]
 *
 * history
 * 10/19/84	Geyer/Nodine@BBN	Created.
 * 10/22/84	Croft	Hacked into single C program; renamed.
 */

#include <stdio.h>
#include <sys/file.h>

char	*argv0;

main (argc, argv)
char **argv;
{
	int offset;
	int addr;
	char type;
	char buffer[100];
	char name[100];
	FILE *fin, *fout, *popen();

	argv0 = argv[0];
	if (argc != 2)
		err("usage: %s MACSEGMENTORIGIN", argv0);
	unlink("b.map");
	if (access("b.out", 04) != 0)
		err("can't open b.out");
	if ((fin = popen("nm68 -nh b.out", "r")) == NULL)
		err("can't run nm68");
	if ((fout = fopen("b.map", "w")) == NULL)
		err("can't open output file, b.map");

	sscanf (argv[1], "%x", &offset);

	for (;;) {
		fgets (buffer, 100, fin);
		if (feof (fin))
			break;
		sscanf (buffer, "%x %c %s", &addr, &type, name);
		fprintf (fout, "%06x %c %s\n", addr+offset, type, name);
	}
	fclose(fout);
	exit(0);
}

err(s,a,b,c)
{
	fprintf(stderr, "%s: ", argv0);
	fprintf(stderr, s, a, b, c);
	putc('\n', stderr);
	exit(1);
}
 written in AWK, but there's no hex/octal input!]
 *
 * history
 * 10/19/84	Geyer/Nodine@BBN	Created.
 * 10/22/84	Croft	Hacked into single C program; renamed.
 */

#include <stdio.h>
#include <sys/file.h>

char	*argv0;

main (argc, argv)
char **argv;
{
	int offset;
	int addr;
	char type;
	char buffesumacc/cmd/macdbmap   555      0     12         304  3470501324   7511 #!/bin/sh
#	macdbmap - create b.map from b.out for use by "MacDB, vers 8/3/84"
#
nm68 -nh b.out | sed -e '
s/ _\(.*\)$/ \1_/
s/^\([^ ]*\) \([^ ]*\) \([^ ]*\)$/	\3=1:\1/
s/:0*/:/
s/:$/:0/' > b.map
r);
	exit(1);
}
 written in AWK, but there's no hex/octal input!]
 *
 * history
 * 10/19/84	Geyer/Nodine@BBN	Created.
 * 10/22/84	Croft	Hacked into single C program; renamed.
 */

#include <stdio.h>
#include <sys/file.h>

char	*argv0;

main (argc, argv)
char **argv;
{
	int offset;
	int addr;
	char type;
	char buffesumacc/cmd/rmakerx.c   444      0     12       31243  3470501324   7702 #define DEBUG 1
/*
 * Resource decompiler.
 */

/*
 * Copyright (C) 1984, Ben Hyde.  [intmet@bbna]
 * All rights reserved by Ben Hyde, but full data rights
 * transfered to SUMEX project 
 * May be used but not sold without permission.
 */

/*
 * history
 * 08/20/84	Hyde	Created, derived, loosely, from rmaker.c
 *	The main goal of this beasty is to allow dialog templates
 *	created on the Mac to be brought under configuration control
 *	on the mainframe.  It also works on icons, it shouldn't be hard
 *	to add any other things you have the documentation for.  Read about
 *	the format of resouce files in Inside Mac, it will make your brain hurt.
 *	Think about what byteswapper is doing down below.  Useful stuff is
 *	left in globals by the main iteration over the resources.
 *
 */

#include <stdio.h>
#include <mac/res.h>
#include <mac/b.out.h>
#include <mac/quickdraw.h>
#include <mac/toolintf.h>

#define bh      filhdr

struct  bhdr    bh;             /* b.out header */
char    *malloc();
char    *index();
char    *rindex();
unsigned short  htons();        /* host to "net" byte order, short. */
unsigned long   htonl();

struct  resfile rf;             /* resource file header */
#define MAPMAX 4000
char	resmap_data[MAPMAX];	/* we bring the resource map into core */
struct  resmap  *rm_base;	/* resource map header in resmap_data */
struct  restype *rt_base;	/* resource type list in resmap_data */
numtypes_t rt_size;		/* the number of entries following rt_base */
struct  resid  *ri_base;	/* resource type list in resmap_data */
short	ri_size;		/* the number of entries following ri_base */
char 	*rn_base;		/* name list in resmap_data */
#define RESDATAMAX 2000		/* maximum size of a resource be page in */
char	res_data[RESDATAMAX];	/* we bring some resources into this core */
char	*rd_base= &res_data[0];	/* Pointer to the base of the resource's data */
long	rd_size;

/* Some global pointers that the handlers use to get context */
struct restype *rtp;
struct resid   *rip;
char		*rdp;

char    debugtype[8];           /* debug type switch */
FILE    *fout;                  /* file for output */
FILE    *fin;                   /* file for commands */
char    *fin_name;		/* name of the input file */

# define NoAlias ""

/* type format handlers */
/*****
extern  handstr(), handhexa(), handcode(), handdrvr();
extern  handdlog(), handalrt(), handditl();
extern  handwind(), handmenu(), handcntl();
*****/
extern handditl(),handicnN();

struct  typehand {              /* type string to handler table */
        char    th_type[8];     /* e.g. "CODE" */
        int     (*th_handler)(); /* format handler function */
} typehand[] = {
        "DITL", handditl,
        "ICN#", handicnN,
/*****
        "STR ", handstr,
        "HEXA", handhexa,
        "DRVR", handdrvr,
        "ALRT", handalrt,
        "DLOG", handdlog,
        "WIND", handwind,
        "MENU", handmenu,
        "CNTL", handcntl,
        "ICON", handhexa,
        "CURS", handhexa,
        "PAT ", handhexa,
*****/
        0,      0
};

main(argc, argv)
        char **argv;
{

        if (argc != 3)
                abort("usage: rmakerx input.rsrc output.rc");
	fin_name = argv[1];
        if ((fin = fopen(argv[1], "r")) == NULL)
                abort("can't open resource file");
        if((fout = fopen(argv[2],"w")) == NULL)
	    abort("can't open out output file, i.e. the rmaker input file.");
	razerf();	/* raze the resource file given */
        rmakerx();	/* print the result from in core data structures */
        exit(0);
}

/*
 * Bring the maps in the resource file into core.
 */
razerf()
{
			/* Read in the file header */
    fread(&rf, sizeof rf, 1, fin);		/* read in the file header */
    byteswapper("llll",&rf);
# ifdef DEBUG
    printf(
    "file header: offsets data %lu, map %lu; lenght data  %lu, map len%lu\n",
					rf.rf_offdata, rf.rf_offmap,
					rf.rf_lendata, rf.rf_lenmap);
# endif

			/* Read in the Resource Map */
    if(rf.rf_lenmap>MAPMAX) abort("Resource map too large for rmakerx.");
    fseek(fin,rf.rf_offmap,0);
    fread(&resmap_data[0], sizeof(char), rf.rf_lenmap, fin);

			/* Set up our base pointers into that data */
				/* The map header is easy, it appears first */
    rm_base = (struct resmap *) &resmap_data[0];
    byteswapper("lllllssss",rm_base);
# ifdef DEBUG
    printf("map header: types:%lu, name:%lu\n",
		rm_base->rm_offtype, rm_base->rm_offname);
# endif

				/* Type list is an offset at an the header */
    rt_base = (struct restype *)    ((char *)rm_base 	/* offset is in bytes */
				  + (rm_base->rm_offtype)
				  + (sizeof(short))	/* skip # of entries */
				 );
    rt_size = *( (short *) (				/* get the size */
			      ((char *)rt_base)
			    - (sizeof(short))));	/* what is this lisp? */
    rt_size = htons(rt_size)+1;				/* its off by one. */
    {    					/* clean up byte orderings */
         struct restype *p = rt_base;
	 ri_size = 0;				/* also count # of resources */
	 for(;p<rt_base+rt_size;p++){
	     byteswapper("bbbbss",p);
# ifdef DEBUG
	     printf("type '%4.4s' %d, offids:%lu\n"
		,p->rt_type,1+p->rt_numids,p->rt_offids);
	     ri_size += 1 + p->rt_numids;	
# endif
	 }
    }

				/* The reference list */
    ri_base = (struct resid *) (rt_base + rt_size);
    {						/* clean up byte order */
	struct resid * p = ri_base;
	for(; p < (ri_base + ri_size); p++){
		byteswapper("ssbbsss",p);
# ifdef DEBUG
		printf("ri id:%d, nameoff: %d, att:0%2.2x\n",
			p->ri_id, p->ri_offname, p->ri_att);
# endif
	}
    }

				/* The name list */
    rn_base = (char *) rm_base + (rm_base->rm_offname) ; 
    {				/* Convert Pascal names to C names */
	struct resid * p = ri_base;
	for(; p < (ri_base + ri_size); p++){
	    if(p->ri_offname >= 0)
		my_p2cstr(&rn_base[p->ri_offname]);
	}
    }

# ifdef DEBUG
    {   struct resid * p = ri_base;
	for(; p < (ri_base + ri_size);p++)
	    if(p->ri_offname >= 0)
		printf("'%s'\n",&rn_base[p->ri_offname]);
	    else
		printf("%s\n","NoName");
    }
# endif

}

rmakerx()
{
    register struct rescomp *rcpp;
    register struct typehand *thp;

    /* write some comments to tell who did this evil thing. */
    fprintf(fout,"* Generated from %s by rmakerx.\n",fin_name);
    /* write the usual first line */
    fprintf(fout,"* Output file name:\n%s\n",fin_name);

    /*
     * For each resource, use type id to select handler, and use it.
     */
    for(rtp=rt_base; rtp<(rt_base+rt_size); rtp++){ /* sweep over types */
	for(thp= &typehand[0]; ;thp++ ){
	    if (thp->th_handler == 0){
		fprintf(fout,"*\n");
		fprintf(fout,
		    "* rmakerx can not handle the type %4.4s\n", rtp->rt_type);
		fprintf(fout,"*\n");
		break;
	    }
	    if (b4cmp(thp->th_type, rtp->rt_type)){
		{   register struct resid *ids =	/* list pntr */
			(struct resid *)
			   (((char *)rt_base)		/* from rt_base */
			    -(sizeof(short))		/* from rt count */
			    +(rtp->rt_offids));		/* offset to ids */
		    register int i;			/* #-1 of this type */
		    for(i=rtp->rt_numids; i>=0; i--){
			rip = ids + i;
			(*thp->th_handler)();
		    }
		}
		break;
	    }
	}
    }
    fprintf(fout,"* rmakerx finished\n");
}

/*
 * Abort with message.
 */
abort(s,a)
        char *s;
{
        fprintf(stderr, "rmakerx: ");
        fprintf(stderr, s, 0);
        fprintf(stderr, "\n");
        exit(1);
}


/*
 * Convert a Pascal string into a C string, inplace.
 */
my_p2cstr(ps)
 char *ps;
{    register char *cs = ps;
     char *debug = ps;
     register int cnt = *ps++;
     while(cnt-->0) *cs++ = *ps++;
     *cs = '\00';
}

/*
 * Compare four bytes, see if they are equal
 */
b4cmp(b1,b2)
   char *b1,*b2;
{
	return
		*b1++ == *b2++ &&
		*b1++ == *b2++ &&
		*b1++ == *b2++ &&
		*b1++ == *b2++ ;
}
/*
 *  Byte swappers.
 */
unsigned short htons(a)
        unsigned short a;
{
        unsigned short result;
        register char *sp = (char *)&a;
        register char *dp = (char *)&result;

        dp[1] = *sp++;
        dp[0] = *sp;
        return (result);
}

unsigned long htonl(a)
        unsigned long a;
{
        unsigned long result;
        register char *sp = (char *)&a;
        register char *dp = (char *)&result;

        dp[3] = *sp++;
        dp[2] = *sp++;
        dp[1] = *sp++;
        dp[0] = *sp;
        return (result);
}

/*
 * Walk thru a struct doing the byte swapping on each field.
 * l   is a string it gives the field layout of
 *     the data structure.  For example "bbsl" describes a four field
 *     data structure consisting of a two byte fields, followed by one
 *     short (2byte) field, and one long (4 byte) field.
 * a   is the the data structure, it is swapped in place.
 */
byteswapper(l,a)
  char *l;
  char *a;
{
	register char *lp = l;	/* for sweeping over layout string */
	register char *ap = a;  /* for sweeping over the data structure */

	for(;*lp!='\00';lp++){	/* sweep over layouts */
	    switch(*lp){
	    case 'b':
		ap += 1;
		break;
	    case 's':
		*((unsigned short *)ap) = htons(*(unsigned short *)ap);
		ap += 2;
		break;
	    case 'l':
		*((unsigned long  *)ap) = htonl(*(unsigned long  *)ap);
		ap += 4;
		break;
	    otherwise: abort("evil layout passed to byteswapper.");
	    }
	}
}

/*
 * Misc utilities use by the type handlers.
 */
 doheader(alias)
     char *alias;
 {
    fprintf(fout,"\nType %4.4s%s\n",rtp->rt_type,alias);
     if(    rip->ri_offname>=0
        && '\00'!=*(rn_base+rip->ri_offname))	/* Desk ornaments are funny */
	fprintf(fout,"     |%s,%d(%d)\n"
			,rn_base+rip->ri_offname
			,rip->ri_id
			,rip->ri_att);
     else
	fprintf(fout,"     ,%d(%d)\n",rip->ri_id,rip->ri_att);
}

resread()
{
	register long offset = (rip->ri_offdatahi<<16) + rip->ri_offdata;
	fseek(fin,rf.rf_offdata+offset,0);
	fread(&rd_size,sizeof(long),1,fin);
	rd_size=htonl(rd_size);
	if(rd_size>RESDATAMAX) abort("Resource's data is too large.");
	fread(rd_base,1,rd_size,fin);
}

/*
 * Emit the stuff for various fields found in a data part of a resource
 */

emitstr()
{
	my_p2cstr(rdp);
	fprintf(fout,"%s\n",rdp);
}

emitresid() /* resource id */
{
    register int len;
    len = rdp[0];
    if(len!=2)
	abort(" expected resource id number, but length was wrong");
    /* len = htons(*(short *)&rdp[1]);
    fprintf(fout,"  %d\n",len);
    */
}


/*
 * Type Handler
 */

/*
 * Dialog item list
 */
 struct aDitlHandler {
	char val;	/* of this value */
	char *name;	/* emit this name */
	ProcPtr handler;	/* call this handler if nonzero */
	} ditlhandlers[] = {
	{ctrlItem+btnCtrl,	"BtnItem",	emitstr },
	{ctrlItem+chkCtrl,	"ChkItem",	emitstr },
	{ctrlItem+radCtrl,	"RadioItem",	emitstr },
	{ctrlItem+resCtrl,	"ResItem",	emitresid },
	{	 statText,	"StatText",	emitstr },
	{	 editText,	"EditText",	emitstr },
	{	 iconItem,	"IconItem",	emitresid },
	{	  picItem,	"PicItem",	emitresid },
	{	 userItem,	"UserItem",	0 },
	{ 0,0,0 }};

handditl()
{
    short items;
    Rect * rect;
    char type;
    int itemlen;
    struct aDitlHandler *dhp;

    doheader(NoAlias);
    resread();
    rdp = rd_base;
    items = htons(*((short *)rdp)); rdp += 2;
    fprintf(fout,"  * number of items in dialog item list\n  %d\n",items+1);
    for(;items>=0;items--){
	dhp = 0;
	rdp += 4;		/* skip over place holder for handle */
	rect = (Rect *)rdp;	/* save bound rectangle for later */
	rdp += 8;		/* skip over it */
	type = *rdp++;
	itemlen = *rdp;		/* level pointer on size */

	{	/* print the name of the control */
	    register struct aDitlHandler *i;
	    fprintf(fout,"   ");
	    for(i= &ditlhandlers[0]; i->name!=0; i++){
		if( ( 0177 & type) == i->val){	
		    fprintf(fout, " %s", i->name);
		    if(i->handler!=0)
			dhp = i;
		}
	    }
	    if((itemDisable&type) == itemDisable)
		fprintf(fout," Disabled\n");
	    else
		fprintf(fout," Enabled\n");
	}

	/* Now do the bounding rectangle */
	byteswapper("ssss",rect);
	fprintf(fout,"    * Bounding Rectangle i.e. tlbr\n");
	fprintf(fout,"    %d %d %d %d\n",
	    rect->top,rect->left,rect->bottom,rect->right);

	/* Call the handler for the item list member */
	if(dhp==0)
	    fprintf(fout," No handler\n");
        else
	    (* dhp->handler)();

	rdp += itemlen+1;
	fprintf(fout,"\n");	/* leave blank line at base of item or items */
    }


}

/*
 * ICN# item handler
 */
handicnN()
{
    register char * rdp;
    register int size;
    register long row;
    register int i,beat;
    char line[33];
    doheader(" = HEXA");
    resread();
    /*  emit the icon and mask */
    for( size = rd_size, rdp = rd_base, beat = 7;
	 size>0;
	 size -=4, rdp +=4, beat--){
	row = htonl(*(long *)rdp);
        fprintf(fout," %8.8x ",row);
	if(beat <= 0){
	    beat = 8;
	    fprintf(fout,"\n");
	}
    }

    /* emit a picture of the icon */
    for( size = rd_size, rdp = rd_base;
	 size>0;
	 size -=4, rdp +=4){
	row = htonl(*(long *)rdp);
	/* shift bits out of row, and build line of text backward :-) */
	for(i=31;i >= 0;i--,row>>=1)
	    line[i] = ( ( (01 & row)!=0) ? '@' : '_');
	line[32]='\00';
	fprintf(fout,"* %s\n",&line[0]);
    }
}
){
	    case 'b':
		ap += 1;
		break;
	    case 's':
		*((unsigned short *)ap) = htons(*(unsigned short *)ap);
		ap += 2;
		break;
	    case 'l':
		*((unsigned long  *)ap) = htonl(*(unsigned long  *)ap);
		ap += 4;
		break;
	    otherwise: abort("evil layout passed to byteswapper.");
	    }
	}
}

/*
 * Misc utilities use by the type handlers.
 */
sumacc/cmd/rmaker.c   444      0     12       57333  3470501325   7523 /*	rmaker.c	1.0	04/11/84	*/

/*
 * Resource compiler.
 */

/* 
 * Copyright (C) 1984, Stanford Univ. SUMEX project.  
 * May be used but not sold without permission.
 */

/*
 * history
 * 04/11/84	Croft	Created.
 * 04/16/84	Croft	Reloc info now imbedded in long addresses.
 * 06/18/84	Schilit Added DITL and ALRT.
 * 07/06/84	Croft	Added DLOG WIND MENU CNTL ICON CURS PAT.
 * 07/21/84	Croft	Added DRVR; multiple code segs (jks).
 * 07/26/84	Schuster Added resource names.
 * 09/18/84	Croft	Fixed fwrite bug for resource names.
 * 11/06/84	Croft	Added INIT and PACK.
 * 11/11/84   	Maio/Schilit no NULL in DRVR name if device driver.
 */

#include <stdio.h>
#include <res.h>
#include <mac/b.out.h>
#include <mac/quickdraw.h>
#include <toolintf.h>

#define	bh	filhdr

struct	bhdr	bh;		/* b.out header */
char 	*malloc();
char	*index();
char	*rindex();
unsigned short	htons();	/* host to "net" byte order, short. */
unsigned long	htonl();

char	seg0[sizeof(struct jumphead) + sizeof(struct jumptab)] = {
	0,0,0,0x28,  0,0,2,0,  0,0,0,8,  0,0,0,0x20,
	0,0,  0x3F,0x3C,  0,1,  0xA9,0xF0
};				/* "standard" segment 0 jump header/table */
char	seg1[sizeof(struct codehead)] = { 0,0,  0,1 };

#define	CRTMAGIC 0x602C		/* jump at beginning of crtmac.s */
#define	CRTLEN	10		/* length of relocation table in crtmac.s */

#define	NRESCOMP 50		/* max number of resources per compile */

struct	rescomp {		/* resource being compiled */
	char	rc_type[8];	/* resource type (e.g. "CODE") */
 	char	*rc_name;	/* resource name */
	int	rc_id;		/* resource id number */
	int	rc_att;		/* attributes */
	int	rc_length;	/* length in resource file */
	char	*rc_data;	/* pointer to data */
	int	rc_datalen;	/* length of data */
	FILE	*rc_file;	/* file to read data from */
	int	rc_filelen;	/* length of data in file */
	int	rc_bss;		/* number of zero pad bytes */
} rescomp[NRESCOMP], *rcp;

struct	resfile	rf;		/* compiled resource file header */
struct	resmap	rm;		/* compiled resource map header */
struct	restype	rt[NRESCOMP];	/* compiled resource type list */
struct	resid	ri[NRESCOMP];	/* compiled resource id list */

#define NAMELEN 1024
char 	rn[NAMELEN];		/* compiled resource name list */

char	debugtype[8];		/* debug type switch */
FILE	*fout;			/* file for compiler output */
FILE	*fin;			/* file for compiler commands */
char	fineof;			/* true after all commands read */
char	line[256];		/* line buffer */
char	*lp;			/* current position in line */
int	linenum;		/* line number in command file */

char	*relpnt;		/* current position in longrun area */
int	rellen;			/* length of longrun area */
int	reloff;			/* current relocation offset */

char	token[128];		/* current token being parsed */
char	data[8*1024];		/* area to build simple resource data */
char	*datap;			/* pointer to data area */

/* type format handlers */
extern	handstr(), handhexa(), handcode(), handdrvr();
extern	handdlog(), handalrt(), handditl();
extern	handwind(), handmenu(), handcntl(), handinit();

struct	typehand {		/* type string to handler table */
	char	th_type[8];	/* e.g. "CODE" */
	int	(*th_handler)(); /* format handler function */
} typehand[] = {
	"STR ",	handstr,
	"HEXA",	handhexa,
	"CODE",	handcode,
	"DRVR",	handdrvr,
	"INIT",	handinit,
	"PACK",	handinit,
	"ALRT", handalrt,
	"DITL", handditl, 
	"DLOG", handdlog,
	"WIND", handwind,
	"MENU", handmenu,
	"CNTL", handcntl,
	"ICON", handhexa,
	"CURS", handhexa,
	"PAT ", handhexa,
	0,	0
};


main(argc, argv)
	char **argv;
{
	for (argc--,argv++ ; argc > 0 ; argc--,argv++) {
		if (argv[0][0] != '-')
			break;
		switch (argv[0][1]) {
		case 'd':
			argc--,argv++;
			if (argc < 1) abort("syntax: -d TYPE");
			strcpy(debugtype,argv[0]);
			break;
		}
	}
	if (argc != 1)
		abort("usage: rmaker commandfilename");
	if ((fin = fopen(argv[0], "r")) == NULL)
		abort("can't open commandfile");
	rmaker();
	buildrf();	/* build resource file from rescomp */
	exit(0);
}


rmaker()
{
	register i;
 	char infile[32], *ip;
	struct typehand *thp;
	int haveoutfile = 0;
	int items, id, att;
	char littype[32], type[32], format[32];

	rcp = &rescomp[0];
	while (fineof == 0) {
		if (getline() == 0)
			continue;	/* skip blank lines */
		if (haveoutfile == 0) {	/* if output file not yet open */
			if ((fout = fopen(lp, "w")) == NULL)
				abort("can't open output file %s", lp);
			haveoutfile++;
			continue;
		}
		littype[0] = type[0] = 0;
		items = sscanf(lp, "%s %s = %s", littype, type, format);
		if (items < 2 || strcmp(littype, "Type") != 0)
			abort("bad Type line");
		checktype(type);
		strcpy(rcp->rc_type, type);
		if (items == 3) {
			checktype(format);
			strcpy(type, format);
		}
		if (getline() == 0)
			abort("bad id");
		if (skipsp() == 0)
			abort("bad id");
		for (i=0 ; *lp != ',' && *lp != 0 ; lp++,i++)
			infile[i] = *lp;
		infile[i] = 0;
		if (*lp != ',')
			abort("bad id");
		lp++;
		id = att = 0;
		items = sscanf(lp, " %d(%d) ", &id, &att);
 		ip = index(infile, '|');
 		if (ip) {
 			*ip++ = 0;
 			if ((rcp->rc_name = malloc(strlen(ip) + 1)) == 0)
 				abort("name malloc");
 			strcpy(rcp->rc_name, ip);
 		} else
 			rcp->rc_name = 0;
		if (items < 1)
			abort("bad id");
		if (strlen(infile)) {
			if ((rcp->rc_file = fopen(infile, "r")) == NULL)
				abort("can't open input file %s", infile);
		} else {
			rcp->rc_file = 0;
		}
		rcp->rc_id = id;
		rcp->rc_att = att;
		/* search for type handler */
		for (thp = &typehand[0] ; ; thp++) {
			if (thp->th_handler == 0)
				abort("type %s not implemented", type);
			if (strcmp(thp->th_type, type) == 0)
				break;
		}
		datap = data;
		(*thp->th_handler)();
		if (datap != data) {
			int len = datap - data;
			if (len & 1) {
				len++;
				*datap++ = 0;
			}
			if ((rcp->rc_data = malloc(len)) == 0)
				abort("data malloc");
			bcopy(data, rcp->rc_data, len);
			rcp->rc_datalen = rcp->rc_length = len;
		}
		if (strcmp(type, debugtype) == 0)
			printrcp();
		rcp++;
		if ((rcp - &rescomp[0]) > NRESCOMP - 3)
			abort("too many resources");
	}
	if (rcp == &rescomp[0] || fout == 0)
		abort("nothing to do");
}


/*
 * Build resource file output from incore rescomp structure.
 */
buildrf()
{
	register struct rescomp *rcpp;
	register struct resid *rip;
	register struct restype *rtp;
 	register char *rnp;
	struct restype *rtpp;
	int offdata, roundtomap, sizetypes, sizemap;
	register i;
	register char *cp;
	numtypes_t numtypes;
	lendata_t lendata;

	/* XXX TODO: before scanning, sort rescomp by type/id */
	rtp = &rt[0];
	rip = &ri[0];
 	rnp = rn;
	rcpp = &rescomp[0];
	offdata = 0;
	/*
	 * Scan through the resources making type and id lists.  In this
	 * 1st pass, the rt_offids field is set to the offset from the
	 * start of the id's list.  Below, the 2nd pass adds the size
	 * of the type list to this field.
	 */
	bcopy(rcpp->rc_type, rtp->rt_type, 4);	/* preset 1st type */
	for ( ; rcpp < rcp ; rcpp++) {
		if (strncmp(rcpp->rc_type, rtp->rt_type, 4) != 0) {
			rtp++;		/* we've found a new type */
			bcopy(rcpp->rc_type, rtp->rt_type, 4);
			rtp->rt_offids = (rip - &ri[0]) * sizeof *rip;
		}
		rtp->rt_numids++;
		rip->ri_id = htons(rcpp->rc_id); /* ensure final byte order */
 		if (rcpp->rc_name) {
 			rip->ri_offname = htons(rnp - rn);
 			i = strlen(rcpp->rc_name);
 			if (((rnp - rn) + i + 2) > NAMELEN)
 				abort("namemap exhausted");
			/*
			 * desk accessories start with null, device
			 * drivers start with '.'.
			 */
 			if (strncmp(rcpp->rc_type, "DRVR", 4) == 0
			    && rcpp->rc_name[0] != '.') {
 				*rnp++ = (char)(i + 1);
 				*rnp++ = 0;
			} else {
				*rnp++ = (char) i;
			}
 			bcopy(rcpp->rc_name, rnp, i);
 			rnp += i;
 		}
 		else
 			rip->ri_offname = htons(-1);
		rip->ri_att = rcpp->rc_att;
		rip->ri_offdata = htons(offdata & 0xFFFF);
		rip->ri_offdatahi = ((offdata >> 16) & 0xFF);
		rip++;
		offdata += (rcpp->rc_length + sizeof lendata);
	}
	rtp++;
	/*
	 * Write the file header and pad it out.
	 */
	rf.rf_offdata = htonl(OFFDATA);
	offdata += OFFDATA;
	roundtomap = (offdata & (ROUNDMAP-1));
	if (roundtomap)
		roundtomap = ROUNDMAP - roundtomap;  /* # of pad bytes */
	rf.rf_offmap = offdata + roundtomap;
	rf.rf_lendata = htonl(rf.rf_offmap - OFFDATA);
	rf.rf_offmap = htonl(rf.rf_offmap);
	sizetypes = ((numtypes = rtp - &rt[0]) * sizeof *rtp);
 	if ((rnp - rn) & 1)		/* to be conservative */
 		*rnp++ = 0;
	sizemap = sizeof rm + sizetypes + sizeof numtypes
 	    + ((rip - &ri[0]) * sizeof *rip) + (rnp - rn);
	rf.rf_lenmap = htonl(sizemap);
	fwrite(&rf, sizeof rf, 1, fout);
	i = OFFDATA - sizeof rf;
	do { putc(0, fout); } while (--i);
	/*
	 * correct type list.
	 */
	for (rtpp = &rt[0] ; rtpp < rtp ; rtpp++) {
		rtpp->rt_offids = htons(rtpp->rt_offids 
		    + sizetypes + sizeof numtypes);
		rtpp->rt_numids = htons(rtpp->rt_numids - 1);
	}
	/*
	 * For each resource, write data, file, and bss.
	 */
	for (rcpp = &rescomp[0] ; rcpp < rcp ; rcpp++) {
		lendata = htonl(rcpp->rc_length);
		fwrite(&lendata, sizeof lendata, 1, fout);
		if ((cp = rcpp->rc_data))
			for (i = rcpp->rc_datalen ; i > 0 ; i--)
				putc(*cp++, fout);
		if (rcpp->rc_file)
			for (i = rcpp->rc_filelen ; i > 0 ; i--)
				putc(getc(rcpp->rc_file), fout);
		for (i = rcpp->rc_bss ; i > 0 ; i--)
			putc(0, fout);
	}
	for (i = roundtomap ; i > 0 ; i--)
		putc(0, fout);
	/*
	 * Write the resource map.
	 */
	rm.rm_offtype = htons(sizeof rm);
 	rm.rm_offname = htons(sizemap - (rnp - rn));
	fwrite(&rm, sizeof rm, 1, fout);
	numtypes--;
	numtypes = htons(numtypes);
	fwrite(&numtypes,sizeof numtypes, 1, fout);
	fwrite(&rt[0], sizeof *rtp, rtp - &rt[0], fout);
	fwrite(&ri[0], sizeof *rip, rip - &ri[0], fout);
	if (rnp - rn)
		fwrite(rn, rnp - rn, 1, fout);
}


/*
 * Get next command line.
 * Returns 0 if end of block, 1 if normal line.
 */
getline()
{
	register i;

again:
	if ((fgets(line, sizeof line, fin)) == NULL) {
		fineof++;
		return (0);
	}
	linenum++;
	if ((i = strlen(line)) <= 0)
		return (0);
	if (line[i-1] == '\n')
		line[i-1] = 0;
	lp = line;
	if (*lp == 0)
		return (0);
	if (*lp == '*')
		goto again;
	return (1);
}


/*
 * Abort with message.
 */
abort(s,a,b)
	char *s;
{
	fprintf(stderr, "rmaker: ");
	fprintf(stderr, s, a, b);
	if (linenum)
		fprintf(stderr, "; line number %d", linenum);
	fprintf(stderr, "\n");
	exit(1);
}


/*
 * Check for legal length type.  Fix "STR ".
 */
checktype(s)
	char *s;
{
	register len;

	len = strlen(s);
	if (len < 3 || len > 4)
		abort("bad type");
	if (len == 3) {
		s[3] = ' ';
		s[4] = 0;
	}
}


/*
 * Copy bytes.
 */
bcopy(a, b, n)
	register n;
	register char *a, *b;
{
	if (n <= 0)
		return;
	do { *b++ = *a++; } while (--n);
}


/*
 * Store a short into the data area.
 */
datashort(i)
{
	*(unsigned short *)datap = htons(i);
	datap += sizeof (short);
}


/*
 * Store a long into the data area.
 */
datalong(i)
{
	*(unsigned long *)datap = htonl(i);
	datap += sizeof (long);
}


/*
 * Store string into data area.  If "round" is set, round up length.
 * Returns length of data.
 */
datastring(sp,round)
	char *sp;
{
	char *cp = datap;	/* remember old value to store length */
	int len;

	for (datap++, len = 0 ; *sp ; len++)
		*datap++ = *sp++;
	*cp = len;
	len++;
	if (round && (len & 1)) {
		len++;
		*datap++ = 0;
	}
	return (len);
}


/*
 * Scan next number from line and return it.
 */
scanfn(fmt)
	char *fmt;
{
	int val;

	if (skipsp() == 0 || sscanf(lp,fmt,&val) != 1)
		abort("no number found");
	do {
		lp++;
	} while (*lp != ' ' && *lp != '/0'); /* skip to next number */
	return (val);
}


/*
 * Scan next string from "line" into "token";  return 0 if none left.
 */
scanft()
{
	char *cp;

	if (skipsp() == 0)
		return (0);
	cp = token;
	while (*lp != ' ' && *lp != 0)
		*cp++ = *lp++;
	*cp = 0;
	return (1);
}


/*
 * Skip spaces.  Return 0 if end of line.
 */
skipsp() 
{
	while (*lp == ' ' && *lp != 0) 
  		lp++;
	return(*lp);
}


/*
 * Print the data portion of the current rcp record.
 */
printrcp()
{
 	char *cp;
	int i;
	unsigned int j;

	printf("Type %s, ID %d, length %d, datalen %d\n",
		rcp->rc_type, rcp->rc_id, rcp->rc_length, rcp->rc_datalen);
	cp = rcp->rc_data;		/* pick up the data pointer */
	for (i=0 ; i < rcp->rc_datalen ; i++) {
		j = *cp++ & 0xFF;
		if ((i % 16) == 15) 
			printf("%02X\n",j);
		else 
			printf("%02X ",j);
	}
	printf("\n");
}


#define VAX
#define nohtonl
#ifdef nohtonl	/* if not in library */
#ifdef	VAX
/*
 * "Host" to "net" byte order swappers.
 */
unsigned short htons(a)
	unsigned short a;
{
	unsigned short result;
	register char *sp = (char *)&a;
	register char *dp = (char *)&result;

	dp[1] = *sp++;
	dp[0] = *sp;
	return (result);
}

unsigned long htonl(a)
	unsigned long a;
{
	unsigned long result;
	register char *sp = (char *)&a;
	register char *dp = (char *)&result;

	dp[3] = *sp++;
	dp[2] = *sp++;
	dp[1] = *sp++;
	dp[0] = *sp;
	return (result);
}

#else	/* if running on a native 68K, don't need byte swapping */

unsigned short htons(a)
	unsigned short a;
{
	return (a);
}

unsigned long htonl(a)
	unsigned long a;
{
	return (a);
}

#endif	VAX

#endif	nohtonl



/*
 *	T Y P E   H A N D L E R S
 */


/*
 * Handle string format data.
 */
handstr()
{
	if (getline() == 0)
		abort("missing string");
	datastring(lp,1);
}
	

/*
 * Handle hexadecimal format data.
 */
handhexa()
{
	char hex[4];
	int val, items, len;

	hex[2] = 0;
	while (getline() != 0) {
		for (len = strlen(lp) ; len > 0 ; ) {
			if (*lp == ' ') {
				lp++;  len--;
				continue;
			}
			strncpy(hex, lp, 2);
			items = sscanf(hex, "%x", &val);
			if (items != 1)
				abort("bad digits");
			*datap++ = val;
			lp += 2;  len -= 2;
			if ((datap - data) >= sizeof data)
				abort("too much data");
		}
	}
	len = datap - data;
	if (len & 1) {
		len++;
		*datap++ = 0;
	}
}


/*
 * Handle program (code) data.
 */
handcode()
{
	register i;
	struct reloc rl;

	/*
	 * setup CODE, id=0 (jumptable)
	 */
	if (rcp->rc_id == 0) {
		rcp[1] = rcp[0];	/* duplicate rescomp entry */
		rcp->rc_att = ATT_PURGEABLE;
		rcp->rc_datalen = rcp->rc_length = sizeof seg0;
		rcp->rc_data = seg0;
		rcp->rc_file = (FILE *)0;
		rcp->rc_bss = 0;
		rcp++;
	}
	/*
	 * setup CODE, id=1 (text/data)
	 */
	if (fread(&bh, sizeof bh, 1, rcp->rc_file) != 1
	    || bh.fmagic != FMAGIC)
		abort("bad b.out header");
	if ((rcp->rc_data = malloc(rcp->rc_datalen = bh.tsize
	    + bh.dsize + sizeof seg1)) == 0)
		abort("code malloc");
	rcp->rc_id++;		/* normally id is now 1 */
	seg1[3] = rcp->rc_id;	/* put id in jump table */
	bcopy(seg1, rcp->rc_data, sizeof seg1);
	rcp->rc_data += sizeof seg1;
	if (fread(rcp->rc_data, rcp->rc_datalen - sizeof seg1,
	    1, rcp->rc_file) != 1)
		abort("code readerror");
	rcp->rc_bss = bh.bsize;
	rcp->rc_length = rcp->rc_datalen + rcp->rc_bss;
	if (!rcp->rc_att)	/* set default attributes if none supplied */
		rcp->rc_att = ATT_PURGEABLE | ATT_LOCKED | ATT_PRELOAD;
	if ((bh.rtsize + bh.rdsize) <= 0)
		abort("b.out must have reloc info");
	fseek(rcp->rc_file, RTEXTPOS, 0);
	if (*(short *)rcp->rc_data != htons(CRTMAGIC))
		abort("no crtmac.s prefix");
	relpnt = rcp->rc_data + 2;		/* start of longrun table */
	rellen = CRTLEN;			/* length of longrun table */
	reloff = 0;
	readrel(0, bh.rtsize/sizeof rl);	/* reloc text */
	readrel(bh.tsize, bh.rdsize/sizeof rl);	/* reloc data */
	*(rcp->rc_data+reloff) = 0377;		/* signals end of reloc data */
	rcp->rc_data -= sizeof seg1;
	fclose(rcp->rc_file);
	rcp->rc_file = 0;
	fprintf(stderr, " text %d, data %d, bss %d, longruns %d\n",
		bh.tsize, bh.dsize, bh.bsize, CRTLEN - rellen);
}


/*
 * Read relocation data and run length encode it.
 */
readrel(off, nrel)
{
	struct reloc rl;
	register char *cp;
	int run, newoff;

	for ( ; nrel > 0 ; nrel--) {
		if (fread(&rl, sizeof rl, 1, rcp->rc_file) != 1)
			abort("error reading reloc");
		if (rl.rsize != RLONG || (rl.rpos & 1)
		    || rl.rsymbol || rl.rsegment == REXT)
			abort("impossible relocation");
		newoff = (rl.rpos + off);
		run = (newoff - reloff) >> 1;
		if (reloff == 0 || run >= 0377) {
			*(long *)relpnt = htonl(newoff);
			relpnt += sizeof (long);
			if (--rellen <= 0)
				abort("too many longruns");
		} else {
			*(rcp->rc_data+reloff) = run;
		}
		reloff = newoff;
	}
}


/*
 * Handle device driver (or desk accessory.).
 */

#define	DRVROFF	50	/* offset of longruns in DRVR resource */

handdrvr()
{
	relocate(DRVROFF);
}


/*
 * Handle PACK or INIT resources.
 */
handinit()
{
	relocate(0);
}


/*
 * Relocate a resource.
 */
relocate(off)
{
	register i;
	struct reloc rl;

	if (fread(&bh, sizeof bh, 1, rcp->rc_file) != 1
	    || bh.fmagic != FMAGIC)
		abort("bad b.out header");
	if ((rcp->rc_data = malloc(rcp->rc_datalen = bh.tsize
	    + bh.dsize)) == 0)
		abort("text malloc");
	if (fread(rcp->rc_data, rcp->rc_datalen, 1, rcp->rc_file) != 1)
		abort("text readerror");
	rcp->rc_bss = bh.bsize;
	rcp->rc_length = rcp->rc_datalen + rcp->rc_bss;
	if ((bh.rtsize + bh.rdsize) <= 0)
		abort("b.out must have reloc info");
	fseek(rcp->rc_file, RTEXTPOS, 0);
	if (*(short *)(rcp->rc_data+off) != htons(CRTMAGIC))
		abort("no crtxxx.s prefix");
	relpnt = rcp->rc_data + off + 2;	/* start of longrun table */
	rellen = CRTLEN;			/* length of longrun table */
	reloff = 0;
	readrel(0, bh.rtsize/sizeof rl);	/* reloc text */
	readrel(bh.tsize, bh.rdsize/sizeof rl);	/* reloc data */
	*(rcp->rc_data+reloff) = 0377;		/* signals end of reloc data */
	fclose(rcp->rc_file);
	rcp->rc_file = 0;
	fprintf(stderr, " %s text %d, data %d, bss %d, longruns %d\n",
		rcp->rc_type, bh.tsize, bh.dsize, bh.bsize, CRTLEN - rellen);
}


/*
 * Handle dialog template (DLOG).
 */

/*
 * This structure is defined in toolintf.h, but to avoid byte swap
 * and alignment problems, we fill it "by hand".
 *
 *	typedef	struct	{
 *		Rect	boundsRect;
 *		short	procID;
 *		char	visible;
 *		char	filler1;
 *		char	goAwayFlag;
 *		char	filler2;
 *		long	refCon;
 *		short	itemsID;
 *		Str255	title;
 *	} DialogTemplate;
 */

handdlog()
{
	int vis,go,pid,ref;
	register i;

	if (getline() == 0) 
		abort("no dlog rectangle");
	for (i=0 ; i<4 ; i++) 		/* parse 4 ints - rectangle */
		datashort(scanfn("%d"));
	if (getline() == 0) 
		abort("no dlog vis/proc");
	scanft();
	vis = (token[0] == 'V' ? 1 : 0);
	pid = scanfn("%d");
	scanft();
	go = (token[0] == 'G' ? 1 : 0);
	ref = scanfn("%d");
	datashort(pid);
	*datap++ = vis;  *datap++ = 0;
	*datap++ = go;   *datap++ = 0;
	datalong(ref);
	if (getline() == 0)
		abort("missing Item list ID");
	datashort(scanfn("%d"));
	if (getline() != 0)
		datastring(lp,1);
	else
		datashort(0);
}


/*
 * Handle alert template.
 */

/*
 * This structure is defined in toolintf.h, but to avoid byte swap
 * and alignment problems, we fill it "by hand".
 *
 *	typedef	struct {
 *		Rect	boundsRect;
 *		short	itemsID;
 *		short	stages;
 *	} AlertTemplate;
 */

handalrt() 
{
	int i;

	getline();
	for (i=0 ; i<4 ; i++) 		/* parse 4 ints - rectangle */
		datashort(scanfn("%d"));
	getline();
	datashort(scanfn("%d"));
	getline();
	datashort(scanfn("%x"));
}


/* 
 * Handle Dialog and Alert Item Lists (Type DITL)
 *
 */

/*
 * Structure of an item list.
 *
 *	struct {
 *		long	zero;		placeholder for handle 
 *		Rect	itemrect;
 *		char	itemtype;
 *		char	itemlength;
 *		...  			followed by variable length data
 *	}
 */

struct ditlkeys {
	char *ditl_name;
	int ditl_value;
} ditlkeys[] = {
	"CtrlItem",ctrlItem,		/*  used in conjunction with: */
	"BtnCtrl",btnCtrl,		/*   a button control */
	"ChkCtrl",chkCtrl,		/*   checkbox  */
	"RadCtrl",radCtrl,		/*   etc... */
	"ResCtrl",resCtrl,
 	"RadioItem",radCtrl+ctrlItem,
 	"ChkItem",chkCtrl+ctrlItem,
	"StatText",statText,
	"EditText",editText,
	"IconItem",iconItem,
	"PicItem",picItem,
	"UserItem",userItem,
	"ItemDisable",itemDisable,
	"BtnItem",btnCtrl+ctrlItem,	/* abbreviation */
	"Enabled",0,
	"Disabled",itemDisable,		/* synonym */
	"Disable",itemDisable,		/* synonym */
	"ItemDisabled",itemDisable,	/* synonym */
	0,0
};


handditl()
{
	char *lenp;
	int i,len;
	int val,types;
	register struct ditlkeys *dk;

	/* first line is item count, drop in count-1 */
	if (getline() == 0 || (val = scanfn("%d")) < 1)
		abort("bad DITL item count");
	datashort(val-1);

	/* for each item */
	for ( ; val > 0 ; val--) {
		datalong(0);
 		if (getline() == 0)		/* line with item types */
			abort("Missing DITL item type");
		types = 0;
		while (scanft()) {
			for (dk = &ditlkeys[0] ; dk->ditl_name ; dk++)
				if (strcmp(dk->ditl_name,token) == 0)
					goto found;
			abort("bad DITL item type %s",token);
		found:
			types += dk->ditl_value;
		}
 		if (getline() == 0)
			abort("Missing DITL rectangle");		
		for ( i=0 ; i < 4 ; i++)
			datashort(scanfn("%d"));
		*datap++ = types;
 		if ((getline() == 0) && (types&(~itemDisable) != editText))
			abort("Missing DITL data");
		skipsp();

		lenp = datap++;		/* remember spot for length */
		types &= ~itemDisable;		/* don't care about this bit */

		switch (types) {	

		case iconItem:		/* 2 byte resource ID */
		case picItem:
		case ctrlItem+resCtrl: 
			datashort(scanfn("%d"));
			*lenp = sizeof (short);
			break;	
		
		case userItem:
			*lenp = 0;		/* is nothing */
			break;

		case ctrlItem+btnCtrl:
		case ctrlItem+chkCtrl:
		case ctrlItem+radCtrl:
		case statText:	
		case editText:
			len = strlen(lp);
			strcpy(datap,lp);
			datap += len;
			if (len & 1) {
				len++;
				*datap++ = 0;
			}
			*lenp = len;
			break;
		} 
		if (getline() != 0)
			abort("Expected blank line in DITL");
	}
}


/*
 * Handle window template (WIND).
 */

/*
 *	typedef	struct	{
 *		Rect	boundsRect;
 *		short	procID;
 *		char	visible;
 *		char	filler1;
 *		char	goAwayFlag;
 *		char	filler2;
 *		long	refCon;
 *		Str255	title;
 *	} WindowTemplate;
 */

handwind()
{
	int vis,go,pid,ref;
	char title[128];
	register i;

	getline();
	skipsp();
	strcpy(title,lp);
	getline();
	for (i=0 ; i<4 ; i++) 		/* parse 4 ints - rectangle */
		datashort(scanfn("%d"));
	getline();
	scanft();
	vis = (token[0] == 'V' ? 1 : 0);
	scanft();
	go = (token[0] == 'G' ? 1 : 0);
	getline();
	pid = scanfn("%d");
	getline();
	ref = scanfn("%d");
	datashort(pid);
	*datap++ = vis;  *datap++ = 0;
	*datap++ = go;   *datap++ = 0;
	datalong(ref);
	datastring(title,1);
}


/*
 * Handle control template (CNTL).
 */

/*
 *	typedef	struct	{
 *		Rect	boundsRect;
 *		short	value;
 *		char	visible;
 *		char	filler1;
 *		short	max;
 *		short	min;
 *		short	procID;
 *		long	refCon;
 *		Str255	title;
 *	} ControlTemplate;
 */

handcntl()
{
	int vis,min,max,pid,ref;
	char title[128];
	register i;

	getline();
	skipsp();
	strcpy(title,lp);
	getline();
	for (i=0 ; i<4 ; i++) 		/* parse 4 ints - rectangle */
		datashort(scanfn("%d"));
	getline();
	scanft();
	vis = (token[0] == 'V' ? 1 : 0);
	getline();
	pid = scanfn("%d");
	getline();
	ref = scanfn("%d");
	getline();
	datashort(scanfn("%d"));
	*datap++ = vis;  *datap++ = 0;
	min = scanfn("%d");
	max = scanfn("%d");
	datashort(max);
	datashort(min);
	datashort(pid);
	datalong(ref);
	datastring(title,1);
}


/*
 * Handle menu template (MENU).
 */

/*
 *	typedef	struct	{
 *		short	menuID;
 *		long	fill1,fill2;	placeholder
 *		long	enableFlags;
 *		Str255	title;
 *	  for each menu item:
 *		Str255	text;
 *		char	icon#;
 *		char	keyboardequiv;
 *		char	mark;
 *		char	textstyle;
 *	  finally:
 *		char	zero;		end of items.
 *	}
 */

handmenu()
{
	int iconid, styleid, cmdid, markid;
	int *flagsp, flags, item;
	register char *cp,*dp,*sp;
	char itext[128];
	static char styles[] = "BIUOS";

	datashort(rcp->rc_id);
	datalong(0);
	datalong(0);
	flagsp = (long *)datap;	/* remember where the flags were */
	flags = -1;		/* enable all items */
	datalong(-1);	/* placeholder */
	getline();
	scanft();
	datastring(token,0);
	for (item = 1 ; getline() && item < 32 ; item++) {
		skipsp();
		iconid = styleid = cmdid = markid = 0;
		for (cp = lp, dp = itext ; *cp ; cp++) {
			switch (*cp) {
			default:
				*dp++ = *cp;
				break;

			case '(':
				flags &= ~(1<<item);
				break;

			case '^':
				cp++;
				iconid = *cp;
				break;
			
			case '/':
				cp++;
				cmdid = *cp;
				break;

			case '!':
				cp++;
				markid = *cp;
				break;

			case '<':
				cp++;
				sp = index(styles, *cp);
				if (sp == 0)
					abort("BIUOS expected after <");
				styleid |= (1 << (sp-styles));
				break;
			}
		}
		*dp++ = 0;
		datastring(itext,0);
		*datap++ = iconid;
		*datap++ = cmdid;
		*datap++ = markid;
		*datap++ = styleid;
	}
	/* end of items */
	*datap++ = 0;
	*flagsp = htonl(flags);
}

			for (dk = &ditlkeys[0] ; dk->ditl_name ; dk++)
				if (strcmp(dk->ditl_name,token) == 0)
					goto found;
			abort("bad DITL item type %s",token);
		found:
			types += dk->ditl_value;
		}
 		if (getline() == 0)
			abort("Missing DITL rectangle");		
		for ( i=0 ; i < 4 ; i++)
			datashort(sumacc/cmd/unlisa.c   444      0     12         572  3470501325   7466 #include <stdio.h>
/* Lisa format to normal format converter */
main ()
{
	int c;

	while ( (c=getchar()) != EOF) {
		if (c >= 040 && c < 0177) {
			putchar(c);
			continue;
		}
		if (c >= 0177)
			continue;
		switch (c) {
		case 16:
			for (c=getchar(); c>32; c--) 
				putchar(' ');
			break;

		case '\n':
		case '\t':
			putchar(c);
			break;

		default:
			break;
		}
	}
}
ct;
 *		short	procID;
 *		char	visible;
 *		char	filler1;
 *		char	goAwayFlag;
 *		char	filler2;
 *		long	refCon;
 *		Str255	title;
 *sumacc/cmd/paintimp.c   444      0     12       21552  3470501325  10055 From ddj@csnet-relay.csnet Mon Jul 30 03:15:30 1984
Received: from csnet-relay by safe with TCP; Mon, 30 Jul 84 03:15:18 pdt
Received: From brown.csnet by csnet-relay;  30 Jul 84 5:46 EDT
Message-Id: <8407300942.AA03636@nancy.Brown.CSNet>
Date:     30 Jul 84 (Mon) 05:42:49 EDT
From: Dave Johnson <ddj%brown.csnet@csnet-relay.arpa>
To: croft%su-safe@csnet-relay.arpa, pattermann%sumex-aim@csnet-relay.arpa,
        winkler%harvard@csnet-relay.arpa
Subject:  paintimp.c
Status: RO

This is a program I hacked up last night to print macpaint images
on the imagen.  It will print nearly full-scale images on both 240
and 480 printers, and should do fine on a 300 as well, but we don't
have one to test it with.  It also supports 2-up format with about 
66% reduction, which could be useful.  

Since some versions of impress don't support magnification, and in
any case the ones that do only magnify in powers of two, if you want
to send bitmaps and get roughly 8 X 10 images, you must do the factor
of 3 (or 6) magnification yourself.  This would generate a quarter
meg file for the 10/240, and a whole meg spool file for the 5/480.  

This program takes a different approach, and achieves roughly fixed
spool file size by defining 255 glyphs of the proper size for the
printer and format desired, and sending the file as 8 bit characters.
One hangup is that impress only allows 128 members per family, so
you have to switch between families, but I got a lot out of using
the @SP@ instruction, which works as a blank glyph in both families.

The idea for using a glyph for each possible 8-bit pattern was worked
out and used by some of the Computer Center staff here to print on
the Xerox 9700 printer, and I have seen one page printed over there
so far . . .  I could try to get them to submit their program if anyone
is interested in a VM/370 implementation, but don't know what their
policies are at the CC.

Try it out, and if you think I should post this, let me know.
It's about half an hour old now, but it works on 2 pictures,
with/without 2-up mode, and on both the 240 and 480, so it should
be pretty close.  (Dan: I even linted it this time)

Known problem -- I haven't looked up the proper @document(...) stuff.
I've been using it with the berkeley spooler as in:

	paintimp foo.data | lpr -Pip -v

where the -v option specifies "raster" mode, and generates a decent 
header -- mainly defines "language impress".  
	
	Dave Johnson
----------
paintimp.c
----------
#ifndef lint
static	char sccsid[] = "@(#)paintimp.c 0.9 84/07/29 (Brown)";
#endif

/*
 * paintimp -- read macpaint document and output impress document 
 *
 * Dave Johnson, Brown University Computer Science
 *
 * (c) 1984 Brown University 
 * may be used but not sold without permission
 *
 * created ddj 5/06/84 for sun's rasterfile.h format (macfilter.c)
 * revised ddj 7/29/84 -- generate Impress format glyphs and data
 */

#include <stdio.h>

#define MACPAINT_HDRSIZE	512

#define	MACPAINT_BITWIDTH	576
#define	MACPAINT_BITHEIGHT	720

struct macpaint_hdr {
	char macp_data[MACPAINT_HDRSIZE];
};

typedef struct _point {
	int x;
	int y;
} point;

#define RES_240 0
#define RES_300 1
#define RES_480 2

#define DEF_RES 240

int twoup = 0;
int res = DEF_RES;
int res_ind;
int scale;
int imageno = 0;

char usage[] = "usage: \"paintimp [-2] [-r res] files\"\n";

main(ac, av)
char **av;
{
	char *name;

	ac--; av++;
	while (ac && av[0][0] == '-' && av[0][1]) {
		switch (av[0][1]) {
		case '2':
			twoup++;
			break;

		case 'r':
			if (ac < 2)
				goto bad_usage;
			ac--; av++;
			res = atoi(av[0]);
			break;
			
		default:
			goto bad_usage;
		}
		ac--; av++;
	}
	switch (res) {
	case 240:
		res_ind = RES_240;
		break;
	case 300:
		res_ind = RES_300;
		break;
	case 480:
		res_ind = RES_480;
		break;
	default:
		fprintf(stderr, "illegal resolution %d;", res);
		fprintf(stderr, " use -r {240,300,480}\n");
		goto bad_usage;
	}
	if (ac == 0) 
		goto bad_usage;
	init_images(MACPAINT_BITWIDTH, MACPAINT_BITHEIGHT);
	write_imphdr();
	write_glyphs();
	while (ac) {
		name = av[0];
		filter(name);
		ac--; av++;
	}
	exit(0);
bad_usage:
	fprintf(stderr, usage);
	exit(1);
}

filter(name)
char *name;
{
	register int x, y;
	FILE *fp;
	int c;

	if (name[0] == '-')
		fp = stdin;
	else
		fp = fopen(name, "r");
	if (fp == NULL) {
		perror(name);
		return;
	}

	x = 0;
	y = 0;
	imageno++;
	read_painthdr(fp);
	begin_image();
	while ((c = getbits(fp)) != EOF) {
		putbits(c);
		x += 8;
		if (x >= MACPAINT_BITWIDTH) {
			putcrlf();
			x = 0;
			y++;
			if (y >= MACPAINT_BITHEIGHT) {
				end_image();
				fclose(fp);
				return;
			}
		}
	}
}


/* macpaint input routines */

read_painthdr(fp)
FILE *fp;
{
	fseek(fp, (long)MACPAINT_HDRSIZE, 0);
}

getbits(fp)
FILE *fp;
{
	static int count, rep, chr;
	int c;

	if (rep) {
		rep--;
		return chr;
	}
	if (count) {
		count--;
		return getc(fp);
	}
	c = getc(fp);
	if (c & 0x80) {			/* repeated character count */
		rep = 0x100 - c;	/* byte length 2's comp + 1 */
					/* 	allow for this call */
		chr = getc(fp);		/* character to repeat */
		return chr;
	}
	else {
		count = c;		/* already counted this char */
		return getc(fp);
	}
}

/* impress output routines */

#define FAMILY_MASK 0x80
#define MEMBER_MASK 0x7f
#define BYTE_MASK 0xff

putbits(c)
int c;
{
	static int fam = 0;

	if (c == 0) {
		putspace();
		return;
	}
	if ((c & FAMILY_MASK) && fam == 0) {
		fam = 1;
		putfam(fam);
	}
	else if (!(c & FAMILY_MASK) && fam == 1) {
		fam = 0;
		putfam(fam);
	}
	putchar(c & MEMBER_MASK);
}

#define IMP_SP		128
#define IMP_CRLF	197
#define IMP_SET_FAMILY	207

putcrlf()
{
	putchar(IMP_CRLF);
}

putspace()
{
	putchar(IMP_SP);
}

putfam(f)
int f;
{
	putchar(IMP_SET_FAMILY);
	putchar(f & BYTE_MASK);
}


/* really grungy stuff */

struct imp_scale {
	int normal_scale;
	int rotate_scale;
} is[] = {	/* tuned only for macpaint sized bitmaps */
	{ 3, 2 },	/* RES_240 */
	{ 4, 2 },	/* RES_300 */
	{ 6, 4 },	/* RES_480 */
};

#define ORG_CURRENT 3

#define AXES_NOP 0

#define ORIENT_NORMAL 4
#define ORIENT_ROTATE 5

static point origin;
static point image_space;

static int hv_system;
	
/* determine scale and origin points for output images */

init_images(width, height)
int width, height;
{
	if (twoup) {
	    /*
		+------------+
		| ^org       |
	       ^|            |
	       x|            |
		+------------+
		 y->
	     */
		scale = is[res_ind].rotate_scale;
		image_space.x = (17 * res) / 2;	/* 8.5 inches */
		image_space.y = (11 * res) / 2;	/* 5.5 inches */

		/* set new origin (in old coordinates) */
		origin.x = (image_space.x + height * scale) / 2;
		origin.y = (image_space.y - width * scale) / 2;

		hv_system = (ORG_CURRENT<<5) | (AXES_NOP<<3) | ORIENT_ROTATE;
	}
	else {
		scale = is[res_ind].normal_scale;
		image_space.x = (17 * res) / 2;	/* 8.5 inches */
		image_space.y = 11 * res;	/* 11 inches */

		origin.x = (image_space.x - width * scale) / 2;
		origin.y = (image_space.y - height * scale) / 2;

		hv_system = (ORG_CURRENT<<5) | (AXES_NOP<<3) | ORIENT_NORMAL;
	}
}

#define IMP_SET_ABS_H	135
#define IMP_SET_ABS_V	137
#define IMP_SET_HV_SYSTEM 205
#define IMP_ENDPAGE	219
#define IMP_SET_IL	208
#define IMP_SET_BOL	209
#define IMP_SET_SP	210
#define IMP_BGLY	199

begin_image()
{
	point o;

	o.y = 0;
	if ((imageno & 1) || !twoup)
		o.x = 0;
	else
		o.x = image_space.y + origin.y;
	putchar(IMP_SET_BOL);
	putshort(o.x);
	set_abs_pos(o);
}

end_image()
{
	if (twoup && (imageno & 1))
		return;
	putchar(IMP_ENDPAGE);
}

write_imphdr()
{
	/* SET_SP (8*scale), SET_IL (scale), SET_BOL (0); all shorts */
	putchar(IMP_SET_IL);
	putshort(scale);
	putchar(IMP_SET_SP);
	putshort(scale*8);
	set_abs_pos(origin);
	putchar(IMP_SET_HV_SYSTEM);
	putchar(hv_system);
}

write_glyphs()
{
	register int glyph;

	for (glyph = 1; glyph <= 255; glyph++) {
		write_glyph(glyph);
	}
}

char bits[8];		/* code assumes scale <= 8 */

write_glyph(g)
register int g;
{
	register int i, j;
	register int b, xpos;
	int bit;

	if (twoup) {
		putchar(IMP_BGLY);
		g |= (1 << 14);		/* rotate 90 degrees clockwise */
		putshort(g);
		putshort(scale*8);
		putshort(scale);
		putshort(0);
		putshort(scale*8);
		putshort(0);
		for (b = 0x80; b; b >>= 1) {
			bits[0] = 0;
			bit = g & b;
			for (i = 0; i < scale; i++)
				if (bit) setbit(i);
			for (i = 0; i < scale; i++)
				putchar(bits[0] & BYTE_MASK);
		}
	}
	else {
		putchar(IMP_BGLY);
		putshort(g);
		putshort(scale*8);
		putshort(scale*8);
		putshort(0);
		putshort(scale);
		putshort(0);
		xpos = 0;
		for (i = 0; i < scale; i++)
			bits[i] = 0;
		for (b = 0x80; b; b >>= 1) {
			bit = g & b;
			for (i = 0; i < scale; i++, xpos++)
				if (bit) setbit(xpos);
		}
		for (j = 0; j < scale; j++) {
			for (i = 0; i < scale; i++)
				putchar(bits[i] & BYTE_MASK);
		}
	}
}

setbit(x)
int x;
{
	int bitno;
	char *bitp;
	
	bitno = 7 - (x % 8);
	bitp = &bits[x / 8];
	*bitp |= (1 << bitno);
}

set_abs_pos(pt)
point pt;
{
	putchar(IMP_SET_ABS_H);
	putshort(pt.x);
	putchar(IMP_SET_ABS_V);
	putshort(pt.y);
}

putshort(s)
int s;
{
	putchar((s >> 8) & BYTE_MASK);
	putchar(s & BYTE_MASK);
}

omp + 1 */
					/* 	allow for this call */
		chr = getc(fp);		/* character to repeat */
		return chr;
	}
	else {
		count = c;		/* already counted thissumacc/cmd/paintbits.c   444      0     12       10520  3470501326  10223 From CROFT@SUMEX-AIM.ARPA Thu Aug  2 19:22:19 1984
Received: from SUMEX-AIM.ARPA by safe with TCP; Thu, 2 Aug 84 19:22:10 pdt
Date: Thu 2 Aug 84 19:19:27-PDT
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [Peterr%toronto.csnet@csnet-relay.arpa: MacPaint -> bitmap filter, in C]
To: croft@SUMEX-AIM.ARPA
Status: R

Mail-From: PATTERMANN created at  2-Aug-84 14:14:03
Return-Path: <Peterr%toronto.csnet@csnet-relay.arpa>
Received: from csnet-relay by SUMEX-AIM.ARPA with TCP; Tue 31 Jul 84 23:41:00-PDT
Received: From toronto.csnet by csnet-relay;  1 Aug 84 2:20 EDT
Date:     31 Jul 84 22:56:49-EDT (Tue)
From:     Peterr%toronto.csnet@csnet-relay.arpa
To:       info-mac@sumex-aim.arpa
cc:       furuta@washington.arpa
Subject:  MacPaint -> bitmap filter, in C
ReSent-date: Thu 2 Aug 84 14:14:03-PDT
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;

The following program allows printing of MacPaint documents on devices which
accept raw bitmaps as input.  It provides for simple scaling-up of the
images to accomodate the typical 200-300dpi resolutions of electrostatic
plotters and laser printers.  It requires a machine with a 32 bit integer,
but should be very portable otherwise.

------------------------
/*  MacPaint format -> bitmap filter
    P. Rowley, U. Toronto, July 30, 1984.
    peterr%toronto@CSNET-RELAY

    This program reads a standard MacPaint document on the standard input
    and produces a bitmap file on the standard output.  The bitmap is
    some magnification of the MacPaint 576 (horiz) x 720 (vertical) encoded
    image, possibly with horizontal 0 padding.

    The specific bitmap format is determined at compile time,
    for the sake of efficiency.
*/
#include <stdio.h>
/* The manifests define the output bitmap format as follows:
     The bitmap is OUT_HORIZ_SIZE bytes wide and 720*OUT_VERT_MUL tall,
     with each Mac pixel translated into a OUT_HORIZ_MUL x OUT_VERT_MUL
     rectangle.  There are OUT_HORIZ_PAD bytes of left margin on every
     output scan line.

   The following restrictions apply to the manifests:
	OUT_HORIZ_SIZE >= OUT_HORIZ_PAD + 72 * OUT_HORIZ_MUL
	OUT_HORIZ_PAD  >= 0
	OUT_HORIZ_MUL  = 1, 2, 3, or 4
        OUT_VERT_MUL   >= 1
   Sample values (for a Versatec plotter): 264, 24, 3, 3
*/
#define OUT_HORIZ_SIZE			264
#define OUT_HORIZ_PAD			24
#define OUT_HORIZ_MUL			3
#define OUT_VERT_MUL			3

char in_line[72], out_line[OUT_HORIZ_SIZE];
int  xlat[256];
main() {
	int i, j;

	/* initialize tables and buffers */
	init();

	/* read and discard 512 byte header */
	for (i=0; i<512; i++)
		getchar();

	/* read and process each of the 720 scan lines */
	for (i=0; i<720; i++) {
		read_scan();
		write_scan();
	}
}

read_scan() {
	int in_pos, count, data_byte;

	in_pos = 0;
	while (in_pos < 72) {
		count = getchar();
		if (count > 127) count -= 256;

		if (count >= 0) {		/* run of raw bytes */
			count++;		/* # of bytes to read */
			while (count--)
				in_line[in_pos++] = getchar();
		}
		else {				/* run of repeated byte */
			count = -count+1;	/* repetition factor */
			data_byte = getchar();  /* byte to repeat */

			while (count--)
				in_line[in_pos++] = data_byte;
		}
	}
}

write_scan() {
	int i, j, outword;

	/* prepare output scan line:
		OUT_HORIZ_PAD 0's,
		72 * OUT_HORIZ_MUL data bytes,
		enough 0's for a total of OUT_HORIZ_SIZE bytes
	*/

	/*  leading and trailing 0's are in out_line by default */

	j = OUT_HORIZ_PAD;
	for( i=0; i<72; i++ ) {
		outword = xlat[in_line[i] & 255];
#if (OUT_HORIZ_MUL == 4)
		out_line[j++] = (outword >> 24) & 255;
#endif
#if (OUT_HORIZ_MUL >= 3)
		out_line[j++] = (outword >> 16) & 255;
#endif
#if (OUT_HORIZ_MUL >= 2)
		out_line[j++] = (outword >>  8) & 255;
#endif
		out_line[j++] = (outword      ) & 255;

	}

	/* output the scan line, OUT_VERT_MUL times */
	for( i=0; i<OUT_VERT_MUL; i++ )
		for( j=0; j<OUT_HORIZ_SIZE; j++ )
			putchar( out_line[j] );
}

init() {
	int bits[8], i, j;

	/* initialize translation table */
	j = (1<<OUT_HORIZ_MUL) - 1;
	for( i=0; i<8; i++ ) {
		bits[i] = j;
		j *= (1 << OUT_HORIZ_MUL);
	}

	for( i=0; i<256; i++ ) {
		if( i &	  1 )	xlat[i] = bits[0];
		else		xlat[i] = 0;

		if( i &   2 )	xlat[i] += bits[1];
		if( i &   4 )	xlat[i] += bits[2];
		if( i &   8 )   xlat[i] += bits[3];
		if( i &  16 )	xlat[i] += bits[4];
		if( i &  32 )	xlat[i] += bits[5];
		if( i &  64 )	xlat[i] += bits[6];
		if( i & 128 )	xlat[i] += bits[7];
	}
}
-------

#define AXES_NOP 0

#define ORIENT_NORMAL 4
#define ORIENT_ROTATE 5

static point origin;
static point image_space;

static int hv_system;
	
/* determine scale and origin pointsumacc/cmd/macimp.c   444      0     12       11717  3470501326   7505 From CROFT@SUMEX-AIM.ARPA Tue Jul 31 17:03:37 1984
Received: from SUMEX-AIM.ARPA by safe with TCP; Tue, 31 Jul 84 17:03:27 pdt
Date: Tue 31 Jul 84 17:02:41-PDT
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>: C version of MACIMP (* source code *)]
To: croft@SUMEX-AIM.ARPA
Status: R

Mail-From: PATTERMANN created at 28-Jul-84 14:29:42
Mail-From: PATTERMANN created at 27-Jul-84 15:27:55
Date: Fri 27 Jul 84 15:27:55-PDT
From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
Subject: C version of MACIMP (* source code *)
To: info-mac@SUMEX-AIM.ARPA
ReSent-date: Sat 28 Jul 84 14:29:42-PDT
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;

Here is the UNIX/C version of MACIMP (also on {SUMEX-AIM}<INFO-MAC>MACIMP.C).
Thanks to Dan Winkler of Harvard for this version.

---------

/*
     This filter converts MacPaint files into Impress files
     for printing on an Imagen laser printer.  Based on MACimp
     for Tops-20 by Ed Pattermann, Stanford.

     Usage:  macimp < macdoc.mp | ipr

     Send enhancements and bug reports to winkler@harvard.

     History:      
	
	25 July 1984  Winkler created. 

	27 July 1984  Burgess (sumex-aim): modified write_imp_init()
		      code to reflect appropriate owner and spooldate.

*/

#include <stdio.h>
#include <strings.h>

#define     MAG_POWER           1      /* can be 0, 1, or 2 */
#define     DOTS_PER_INCH       240

#define     OPAQUE              3
#define     OPERATION_TYPE      OPAQUE
#define     HSIZE               18
#define     VSIZE               23

#define     MAC_HEADER_LENGTH   512
#define     PAD_BYTES           1152

#define     LOBYTE(number) ((char)(number & 0x00FF))
#define     HIBYTE(number16) ((char)((number16 >> 8) & 0x00FF))

#define     PATCH_SIZE          32
#define     PATCH_BYTES         4

typedef char patch[ PATCH_SIZE ][ PATCH_BYTES ] ;

main()
{
     write_imp_init() ;
     throw_away_mac_header() ;
     process_data() ;
     write_imp_end() ;
     fflush(stdout) ; 
}

process_data()
{
     int data_byte ; short repeat_count, byte_num ;

     while ( (data_byte = getchar()) != EOF )
     {
          if ( data_byte > 127 )
          {
               repeat_count = 256 - data_byte + 1 ;
               data_byte = getchar() ;
               for (byte_num = 0 ; byte_num < repeat_count ; byte_num ++ )
                    add_byte ( (char) data_byte ) ;     
               
          }
          else 
          {
               repeat_count = data_byte + 1 ;
               for ( byte_num = 0 ; byte_num < repeat_count ; byte_num ++ )
                    add_byte ( (char) getchar() ) ;
          }
     }
     
     for ( byte_num = 0 ; byte_num < PAD_BYTES ; byte_num ++ )
          add_byte ( (char) 0 ) ;
}

add_byte( one_byte )
     char one_byte ;
{
     static patch patches[ HSIZE ] ; 
     static short patch_num = 0 ; 
     static short patch_row = 0 ; static short patch_col = 0 ;

     patches[ patch_num ][ patch_row ][ patch_col ] = one_byte ;

     if ( ++ patch_col >= PATCH_BYTES )
     {
          patch_col = 0 ;
          if ( ++ patch_num >= HSIZE )
          {
               patch_num = 0 ; 
               if ( ++ patch_row >= PATCH_SIZE )
               {
                    patch_row = 0 ;
                    write_patches ( patches ) ;
               }
          }
     }
}

write_patches ( patches )
     patch * patches ;
{
     short patchnum, patchrow, patchcol ;
     
     for ( patchnum = 0 ; patchnum < HSIZE ; patchnum ++ )
          for ( patchrow = 0 ; patchrow < PATCH_SIZE ; patchrow ++ )
               for ( patchcol = 0 ; patchcol < PATCH_BYTES ; patchcol ++ )
                    putchar( patches[ patchnum ][ patchrow ][ patchcol ] ) ;
}

throw_away_mac_header()
{
     short bytenum ;

     for ( bytenum = 0 ; bytenum < MAC_HEADER_LENGTH ; bytenum ++ ) 
          ( void ) getchar() ;
}

write_imp_init()
{
     char *getenv();
     char *ctime(), cimptime[26];
     long time(), imptime;

     imptime = time(0);			/* get time in internal form */
     strcpy (cimptime, ctime(&imptime));/* put time in string form */
     cimptime[24] = '\0';		/* nullify \n in time string */

     printf("@DOCUMENT(LANGUAGE IMPRESS, NAME \"MacPaint Document\"") ;
     printf(", OWNER \"%s\"",getenv("USER"));
     printf(", SPOOLDATE \"%s\")",cimptime);
     /* SET_ABS_H */
          putchar( (char) 135 ) ; 
          putchar( HIBYTE( (short) DOTS_PER_INCH )) ;
          putchar( LOBYTE( (short) DOTS_PER_INCH )) ;

     /* SET_ABS_V */
          putchar( (char) 137 ) ; 
          putchar( HIBYTE( (short) DOTS_PER_INCH )) ;
          putchar( LOBYTE( (short) DOTS_PER_INCH )) ;

     /* SET_MAGNIFICATION */
          putchar( (char) 236 ) ; putchar( (char) MAG_POWER ) ;

     /* BITMAP */
          putchar( (char) 235 ) ; putchar( (char) OPERATION_TYPE ) ;
          putchar( (char) HSIZE ) ; putchar( (char) VSIZE ) ;
}

write_imp_end()
{
     /* ENDPAGE */ 
        putchar( (char) 219 ) ;

     /* EOF */ 
        putchar( (char) 255 ) ;
}

-------
-------

    for Tops-20 by Ed Pattermann, Stanford.

    sumacc/cmd/macget.c   444      0     12       16643  3470501326   7502 #include <stdio.h>
#include <signal.h>
#include <setjmp.h>
#include <sgtty.h>

#ifdef NO_RENAME
#define rename(old, new)	link(old, new); unlink(old)
#endif

/* Mac time of 00:00:00 GMT, Jan 1, 1970 */
#define TIMEDIFF 0x7c25b080

#define RECORDBYTES 132
#define DATABYTES 128
#define NAMEBYTES 63

#define RETRIES 10
#define SOHTIMO 10
#define LINTIMO 20
#define CHRTIMO 2

#define MAXRECNO 0xff
#define BYTEMASK 0xff

#define TMO -1
#define DUP '\000'
#define SOH '\001'
#define EOT '\004'
#define ACK '\006'
#define NAK '\025'
#define CAN '\030'
#define EEF '\032'
#define ESC '\033'

#define H_NLENOFF 1
#define H_NAMEOFF 2
/* 65 <-> 80 is the FInfo structure */
#define H_TYPEOFF 65
#define H_AUTHOFF 69

#define H_LOCKOFF 81
#define H_DLENOFF 83
#define H_RLENOFF 87
#define H_CTIMOFF 91
#define H_MTIMOFF 95

#define H_OLD_DLENOFF 81
#define H_OLD_RLENOFF 85

#define TEXT 0
#define DATA 1
#define RSRC 2
#define FULL 3

int mode, txtmode;
int pre_beta;	/* -o flag; for compatibility with MacTerminal Version -0.15X */

struct macheader {
	char m_name[NAMEBYTES+1];
	char m_type[4];
	char m_author[4];
	long m_datalen;
	long m_rsrclen;
	long m_createtime;
	long m_modifytime;
} mh;

struct filenames {
	char f_info[256];
	char f_data[256];
	char f_rsrc[256];
} files;

char tmpname[16];

int lastack;
char buf[DATABYTES];

/*
 * macget -- receive file from macintosh using xmodem protocol
 * Dave Johnson, Brown University Computer Science
 *
 * (c) 1984 Brown University 
 * may be used but not sold without permission
 *
 * created ddj 5/22/84 
 * revised ddj 6/29/84 -- added [-rdu] options
 * revised ddj 7/16/84 -- protocol changes for MacTerminal Beta Version 0.5X
 * revised ddj 7/31/84 -- pre-4.2 signal bugs fixed in timedout()
 */
char usage[] = "usage: \"macget [-o] [-rdu] [filename]\"\n";

main(ac, av)
char **av;
{
	char *name;

	mode = FULL;
	name = "";
	ac--; av++;
	while (ac) {
		if (av[0][0] == '-') {
			switch (av[0][1]) {
			case 'r':
				mode = RSRC;
				break;
			case 'd':
				mode = DATA;
				break;
			case 'u':
				mode = TEXT;
				break;
			case 'o':
				pre_beta++;
				break;
			default:
				fprintf(stderr, usage);
				exit(1);
			}
		}
		else {
			name = av[0];
		}
		ac--; av++;
	}

	setup_tty();
	if (send_sync() == ACK) {
		txtmode = 0;
		recv_hdr(name);
		if (mode == TEXT) txtmode++;
		recv_file(files.f_data, mh.m_datalen, 1);
		txtmode = 0;
		recv_file(files.f_rsrc, mh.m_rsrclen, 0);
	}
	reset_tty();
}

recv_hdr(name)
char *name;
{
	long get4();
	int n;
	FILE *fp;
	char *np;

	strcpy(tmpname, "#machdrXXXXXX");
	mktemp(tmpname);
	recv_file(tmpname, (long)DATABYTES, 1);

	fp = fopen(tmpname, "r");
	if (fp == NULL) {
		perror("temp file");
		cleanup(-1);
	}
	fread(buf, 1, DATABYTES, fp);
	fclose(fp);

	if (name && *name) {
		n = strlen(name);
		if (n > NAMEBYTES) n = NAMEBYTES;
		strncpy(mh.m_name, name, n);
		mh.m_name[n] = '\0';
	}
	else {
		n = buf[H_NLENOFF] & BYTEMASK;
		if (n > NAMEBYTES) n = NAMEBYTES;
		strncpy(mh.m_name, buf + H_NAMEOFF, n);
		mh.m_name[n] = '\0';
	}
	for (np = mh.m_name; *np; np++)
		if (*np == ' ') *np = '_';

	if (mode == FULL) {
		sprintf(files.f_info, "%s.info", mh.m_name);
		rename(tmpname, files.f_info);
		tmpname[0] = '\0';
		sprintf(files.f_data, "%s.data", mh.m_name);
		sprintf(files.f_rsrc, "%s.rsrc", mh.m_name);
	}
	else {
		unlink(tmpname);
		tmpname[0] = '\0';
		switch (mode) {
		case RSRC:
			sprintf(files.f_data, "/dev/null");
			sprintf(files.f_rsrc, "%s.rsrc", mh.m_name);
			break;

		case DATA:
			sprintf(files.f_data, "%s.data", mh.m_name);
			sprintf(files.f_rsrc, "/dev/null");
			break;

		case TEXT:
			sprintf(files.f_data, "%s.text", mh.m_name);
			sprintf(files.f_rsrc, "/dev/null");
			break;
		}
	}

	strncpy(mh.m_type, buf + H_TYPEOFF, 4);
	strncpy(mh.m_author, buf + H_AUTHOFF, 4);
	if (pre_beta) {
		mh.m_datalen = get4(buf + H_OLD_DLENOFF);
		mh.m_rsrclen = get4(buf + H_OLD_RLENOFF);
	}
	else {
		mh.m_datalen = get4(buf + H_DLENOFF);
		mh.m_rsrclen = get4(buf + H_RLENOFF);
		mh.m_createtime = get4(buf + H_CTIMOFF);
		mh.m_modifytime = get4(buf + H_MTIMOFF);
	}
}

recv_file(fname, bytes, more)
char *fname;
long bytes;
int more;
{
	register int status, n;
	FILE *outf;
	int naks = 0;

	lastack = 0;
	outf = fopen(fname, "w");
	if (outf == NULL) {
		perror(fname);
		cleanup(-1);
	}
	for (;;) {
		status = rec_read(buf, DATABYTES);
		switch (status) {
		case EOT:
			if (!pre_beta)
				tputc(ACK);
			if (more)
				tputc(NAK);
			fclose(outf);
			return;
		case ACK:
			tputc(ACK);
			naks = 0;
			n = (bytes > DATABYTES) ? DATABYTES : bytes;
			bytes -= n;
			fwrite(buf, n, 1, outf);
			break;
		case DUP:
			tputc(ACK);
			naks = 0;
			break;
		case NAK:
			purge(CHRTIMO);
			if (naks++ < RETRIES) {
				tputc(NAK);
				break;
			}
			/* fall through */
		case CAN:
			tputc(CAN);
			fclose(outf);
			/* unlink fname? */
			cleanup(-1);
			/* NOTREACHED */
		}
	}
}

send_sync()
{
	int c;

	for (;;) {
		c = tgetc(60);
		switch (c) {
		case ESC:
			break;
		case CAN:
		case EOT:
		case TMO:
			return c;
		default:
			continue;
		}
		c = tgetc(1);
		if (c != 'a')
			continue;
		tputc(ACK);
		return ACK;
	}
}

rec_read(buf, recsize)
char buf[];
int recsize;
{
	int c, rec, rec_bar, cksum;

	c = tgetc(SOHTIMO);
	switch (c) {
	case TMO:
	default:
		return NAK;
	case EOT:
		return EOT;
	case CAN:
		return CAN;
	case SOH:
		/* read header */
		rec = tgetc(CHRTIMO);
		if (rec == TMO)
			return NAK;
		rec_bar = tgetc(CHRTIMO);
		if (rec_bar == TMO)
			return NAK;

		/* check header */
		if (rec != MAXRECNO - rec_bar) return NAK;

		/* fill buffer */
		cksum = tgetrec(buf, recsize, LINTIMO);
		if (cksum == TMO)
			return NAK;

		/* get checksum */
		c = tgetc(CHRTIMO);
		if (c == TMO)
			return NAK;
		if (c != (cksum & BYTEMASK))
			return NAK;

		/* check record number */
		if (rec == lastack)
			return DUP;
		if (rec != ((lastack + 1) & MAXRECNO))
			return CAN;
		else {
			lastack = rec;
			return ACK;
		}
	}
	/* NOTREACHED */
}

purge(timeout)
int timeout;
{
	int c;

	do {
		c = tgetc(timeout);
	} while (c != TMO);
}

static int ttyfd;
static FILE *ttyf;
jmp_buf timobuf;

tgetrec(buf, count, timeout)
char *buf;
int count, timeout;
{
	char *bp;
	int i, cksum;

	if (setjmp(timobuf))
		return TMO;
	
	alarm(timeout);
	i = fread(buf, 1, count, ttyf);
	alarm(0);
	if (i != count)
		return TMO;
	
	cksum = 0;
	bp = buf;
	for (i = 0; i < count; bp++, i++) {
		cksum += *bp;
		if (txtmode && *bp == '\r')
			*bp = '\n';
	}
	return cksum;
}

tgetc(timeout)
int timeout;
{
	int c;

	if (setjmp(timobuf))
		return TMO;

	alarm(timeout);
	c = getc(ttyf);
	alarm(0);

	if (c == -1)	/* probably hung up or logged off */
		return EOT;
	else
		return c & BYTEMASK;
}

tputc(c)
char c;
{
	write(ttyfd, &c, 1);
}

timedout()
{
	signal(SIGALRM, timedout);	/* for pre-4.2 systems */
	longjmp(timobuf, 1);
}

static struct sgttyb otty, ntty;
/* should turn messages off */

setup_tty()
{
	int cleanup();
	int timedout();

	ttyf = stdin;
	ttyfd = fileno(stdin);
	ioctl(ttyfd, TIOCGETP, &otty);
	signal(SIGHUP, cleanup);
	signal(SIGINT, cleanup);
	signal(SIGQUIT, cleanup);
	signal(SIGTERM, cleanup);
	signal(SIGALRM, timedout);
	ntty = otty;
	ntty.sg_flags = RAW|ANYP;
	ioctl(ttyfd, TIOCSETP, &ntty);
}

reset_tty()
{
	sleep(2);	/* should wait for output to drain */
	ioctl(ttyfd, TIOCSETP, &otty);
}

cleanup(sig)
int sig;
{
	if (tmpname[0] != '\0')
		unlink(tmpname);
	reset_tty();
	exit(sig);
}

long
get4(bp)
char *bp;
{
	register int i;
	long value = 0;

	for (i = 0; i < 4; i++) {
		value <<= 8;
		value |= (*bp & BYTEMASK);
		bp++;
	}
	return value;
}
		case DATA:
			sprintf(files.f_data, "%s.data", mh.m_name);
			sprintf(files.f_rsrc, "/dev/nsumacc/cmd/macput.c   444      0     12       20643  3470501327   7527 /*

Here is the source for the current incarnation of macput . . . .
It is now compatible with the 0.5 Beta version of MacTerminal, and
in case you still need to use the -0.15X version, there's the "-o"
option to provide compatibility.  Some minor bug fixes have been
made, as well as a couple of changes for portability to non-4.2 
systems.  Please pass any improvements/bug fixes on to me, and
if you know of any good protocols for use on a flow-controlled
line, let me know.

	Dave Johnson
	ddj%brown@csnet-relay.arpa
	Brown University Computer Science

*/
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>
#include <sgtty.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/timeb.h>

/* Mac time of 00:00:00 GMT, Jan 1, 1970 */
#define TIMEDIFF 0x7c25b080

#define RECORDBYTES 132
#define DATABYTES 128
#define NAMEBYTES 63

#define RETRIES 10
#define ACKTIMO 10

#define MAXRECNO 0xff
#define BYTEMASK 0xff

#define TMO -1
#define DUP '\000'
#define SOH '\001'
#define EOT '\004'
#define ACK '\006'
#define NAK '\025'
#define CAN '\030'
#define EEF '\032'
#define ESC '\033'

#define H_NLENOFF 1
#define H_NAMEOFF 2
/* 65 <-> 80 is the FInfo structure */
#define H_TYPEOFF 65
#define H_AUTHOFF 69

#define H_LOCKOFF 81
#define H_DLENOFF 83
#define H_RLENOFF 87
#define H_CTIMOFF 91
#define H_MTIMOFF 95

#define H_OLD_DLENOFF 81
#define H_OLD_RLENOFF 85

#define TEXT 0
#define DATA 1
#define RSRC 2
#define FULL 3

int mode, txtmode;
int pre_beta;	/* -o flag; for compatibility with MacTerminal Version -0.15X */

struct macheader {
	char m_name[NAMEBYTES+1];
	char m_type[4];
	char m_author[4];
	long m_datalen;
	long m_rsrclen;
	long m_createtime;
	long m_modifytime;
} mh;

struct filenames {
	char f_info[256];
	char f_data[256];
	char f_rsrc[256];
} files;

int recno;
char buf[DATABYTES];

/*
 * macput -- send file to macintosh using xmodem protocol
 * Dave Johnson, Brown University Computer Science
 *
 * (c) 1984 Brown University 
 * may be used but not sold without permission
 *
 * created ddj 6/17/84 
 * revised ddj 7/16/84 -- protocol changes for MacTerminal Beta Version 0.5X
 * revised ddj 7/31/84 -- pre-4.2 signal bugs fixed in timedout()
 * revised ddj 7/31/84 -- fixed timeout problem in initial handshake
 */
char usage[] =
    "usage: \"macput [-o] [-rdu] [-t type] [-a author] [-n name] filename\"\n";

main(ac, av)
char **av;
{
	int n;
	char *filename;

	if (ac == 1) {
		fprintf(stderr, usage);
		exit(1);
	}

	mode = FULL;
	ac--; av++;
	while (ac) {
		if (av[0][0] == '-') {
			switch (av[0][1]) {
			case 'r':
				mode = RSRC;
				strncpy(mh.m_type, "APPL", 4);
				strncpy(mh.m_author, "CCOM", 4);
				break;
			case 'u':
				mode = TEXT;
				strncpy(mh.m_type, "TEXT", 4);
				strncpy(mh.m_author, "MACA", 4);
				break;
			case 'd':
				mode = DATA;
				strncpy(mh.m_type, "TEXT", 4);
				strncpy(mh.m_author, "????", 4);
				break;
			case 'n':
				if (ac > 1) {
					ac--; av++;
					n = strlen(av[0]);
					if (n > NAMEBYTES) n = NAMEBYTES;
					strncpy(mh.m_name, av[0], n);
					mh.m_name[n] = '\0';
					break;
				}
				else goto bad_usage;
			case 't':
				if (ac > 1) {
					ac--; av++;
					strncpy(mh.m_type, av[0], 4);
					break;
				}
				else goto bad_usage;
			case 'a':
				if (ac > 1) {
					ac--; av++;
					strncpy(mh.m_author, av[0], 4);
					break;
				}
				else goto bad_usage;
			case 'o':
				pre_beta++;
				break;
			default:
bad_usage:
				fprintf(stderr, usage);
				exit(1);
			}
		}
		else {
			filename = av[0];
		}
		ac--; av++;
	}

	setup_tty();
	find_files(filename, mode);
	if (mode != FULL)
		forge_info();

	if (send_sync() == ACK) {
		txtmode = 0;
		sleep(1);
		send_file(files.f_info, 1);

		if (mode != FULL)
			unlink(files.f_info);

		if (mode == TEXT) txtmode++;
		send_file(files.f_data, 1);

		txtmode = 0;
		send_file(files.f_rsrc, 0);
	}
	reset_tty();
}

find_files(filename, mode)
char *filename;
{
	int n, tdiff;
	struct tm *tp;
	struct timeb tbuf;
	struct stat stbuf;

	sprintf(files.f_data, "%s.data", filename);
	sprintf(files.f_rsrc, "%s.rsrc", filename);

	if (mode == FULL) {
		sprintf(files.f_info, "%s.info", filename);
		if (stat(files.f_info, &stbuf) != 0) {
			perror(files.f_info);
			cleanup(-1);
		}
		return;
	}
	else {
		strcpy(files.f_info, "#machdrXXXXXX");
		mktemp(files.f_info);
	}

	if (mode == RSRC) {
		strcpy(files.f_data, "/dev/null");
		if (stat(files.f_rsrc, &stbuf) != 0) {
			strcpy(files.f_rsrc, filename);
			if (stat(files.f_rsrc, &stbuf) != 0) {
				perror(files.f_rsrc);
				cleanup(-1);
			}
		}
		mh.m_datalen = 0;
		mh.m_rsrclen = stbuf.st_size;
	}
	else {
		strcpy(files.f_rsrc, "/dev/null");
		if (stat(files.f_data, &stbuf) != 0) {
			sprintf(files.f_data, "%s.text", filename);
			if (stat(files.f_data, &stbuf) != 0) {
				strcpy(files.f_data, filename);
				if (stat(files.f_data, &stbuf) != 0) {
					perror(files.f_data);
					cleanup(-1);
				}
			}
		}
		mh.m_datalen = stbuf.st_size;
		mh.m_rsrclen = 0;
	}

	if (!pre_beta) {
		ftime(&tbuf);
		tp = localtime(&tbuf.time);
		tdiff = TIMEDIFF - tbuf.timezone * 60;
		if (tp->tm_isdst)
			tdiff += 60 * 60;
		mh.m_createtime = stbuf.st_mtime + tdiff;
		mh.m_modifytime = stbuf.st_mtime + tdiff;
	}

	if (mh.m_name[0] == '\0') {
		n = strlen(filename);
		if (n > NAMEBYTES) n = NAMEBYTES;
		strncpy(mh.m_name, filename, n);
		mh.m_name[n] = '\0';
	}
}

forge_info()
{
	int n;
	char *np;
	FILE *fp;

	for (np = mh.m_name; *np; np++)
		if (*np == '_') *np = ' ';

	buf[H_NLENOFF] = n = np - mh.m_name;
	strncpy(buf + H_NAMEOFF, mh.m_name, n);
	strncpy(buf + H_TYPEOFF, mh.m_type, 4);
	strncpy(buf + H_AUTHOFF, mh.m_author, 4);
	if (pre_beta) {
		put4(buf + H_OLD_DLENOFF, mh.m_datalen);
		put4(buf + H_OLD_RLENOFF, mh.m_rsrclen);
	}
	else {
		put4(buf + H_DLENOFF, mh.m_datalen);
		put4(buf + H_RLENOFF, mh.m_rsrclen);
		put4(buf + H_CTIMOFF, mh.m_createtime);
		put4(buf + H_MTIMOFF, mh.m_modifytime);
	}
	fp = fopen(files.f_info, "w");
	if (fp == NULL) {
		perror("temp file");
		cleanup(-1);
	}
	fwrite(buf, 1, DATABYTES, fp);
	fclose(fp);
}

send_sync()
{
	int c, i;

	for (i = 0; i < 3; i++) {
		tputc(ESC);
		tputc('a');
		while ((c = tgetc(ACKTIMO)) != TMO) {
			switch (c) {
			case CAN:
			case EOT:
			case ACK:
				return c;
			default:
				continue;
			}
		}
		fprintf(stderr, "starting handshake timeout\r\n");
	}
	fprintf(stderr, "giving up\r\n");
	return CAN;
}

send_file(fname, more)
char *fname;
int more;
{
	register int status, i, n;
	FILE *inf;

	inf = fopen(fname, "r");
	if (inf == NULL) {
		perror(fname);
		cleanup(-1);
	}
	recno = 1;
	for (;;) {
		n = fread(buf, 1, DATABYTES, inf);
		if (n > 0) {
			for (i = 0; i < RETRIES; i++) {
				send_rec(buf, DATABYTES);
				status = tgetc(ACKTIMO);
				if (status != NAK)
					break;
			} 
			if (status == NAK || status == CAN) {
				fclose(inf);
				cleanup(-1);
				/* NOTREACHED */
			}
		}
		if (n < DATABYTES) {
			tputc(EOT);
			if (!pre_beta) {
				status = tgetc(ACKTIMO);
			}
			if (more) {
				status = tgetc(ACKTIMO);
			}
			return;
		}
		recno++;
		recno &= MAXRECNO;
	}
}

send_rec(buf, recsize)
char buf[];
int recsize;
{
	int i, cksum;
	char *bp;

	cksum = 0;
	bp = buf;
	for (i = 0; i < recsize; i++, bp++) {
		if (txtmode && *bp == '\n')
			*bp = '\r';
		cksum += *bp;
	}

	tputc(SOH);
	tputc((char)recno);
	tputc((char)(MAXRECNO - recno));
	tputrec(buf, recsize);
	tputc((char)cksum);
}

static int ttyfd;
static FILE *ttyf;
static jmp_buf timobuf;

tgetc(timeout)
int timeout;
{
	int c;

	if (setjmp(timobuf))
		return TMO;

	alarm(timeout);
	c = getc(ttyf);
	alarm(0);

	if (c == -1)	/* probably hung up or logged off */
		return EOT;
	else
		return c & BYTEMASK;
}

tputrec(buf, count)
char *buf;
int count;
{
	write(ttyfd, buf, count);
}

tputc(c)
char c;
{
	write(ttyfd, &c, 1);
}

timedout()
{
	signal(SIGALRM, timedout);	/* for pre-4.2 systems */
	longjmp(timobuf, 1);
}

static struct sgttyb otty, ntty;
/* should turn messages off */

setup_tty()
{
	int cleanup();
	int timedout();

	ttyf = stdin;
	ttyfd = fileno(stdin);
	ioctl(ttyfd, TIOCGETP, &otty);
	signal(SIGHUP, cleanup);
	signal(SIGINT, cleanup);
	signal(SIGQUIT, cleanup);
	signal(SIGTERM, cleanup);
	signal(SIGALRM, timedout);
	ntty = otty;
	ntty.sg_flags = RAW|ANYP;
	ioctl(ttyfd, TIOCSETP, &ntty);
}

reset_tty()
{
	if (ttyf != NULL) {
		sleep(2);	/* should wait for output to drain */
		ioctl(ttyfd, TIOCSETP, &otty);
	}
}

cleanup(sig)
int sig;
{
	reset_tty();
	exit(sig);
}

put4(bp, value)
char *bp;
long value;
{
	register int i, c;

	for (i = 0; i < 4; i++) {
		c = (value >> 24) & BYTEMASK;
		value <<= 8;
		*bp++ = c;
	}
}
(files.f_rsrc);
				cleanup(-1);
			}
		}
		mh.m_datalen = 0;
		mh.m_rsrclen = stbuf.st_size;sumacc/cmd/macput.doc   444      0     12       37563  3470501331  10056 Date:     22 Jun 84 (Fri) 18:32:17 EDT
From:     Dave Johnson <ddj%brown.csnet@csnet-relay.arpa>
To:       info-mac@sumex-aim.arpa
Subject:  downloading files using macterminal/modem7

This program emulates the Mac's modified modem7 protocol on
a unix system so that files can be easily downloaded through
MacTerminal.  It can be used for both binary and mundane text
files, and avoids the need to convert binaries to and from 
printable-hex format.  The source and the manual page follow
immediately, with everything shifted over one tab stop to avoid
problems with mailers eating lines which start with '.'.

Macput has been tested under 4.2 on both vaxes and suns, but
since I didn't use any 4.2 specific features, it should work
under 4.1 without any hassles.  Let me know if you have any
problems or improvements; I will post updates when/if MacTerminal
changes out from under macput.

	Dave Johnson
	Brown University
	ddj%brown@csnet-relay

Date:     18 Jun 84 (Mon) 01:26:06 EDT
From: Dave Johnson <ddj%brown.csnet@csnet-relay.arpa>
To: croft@su-safe.arpa
Subject:  macput summary
Status: R

In MacTerm you should check off no flow control and modem7 protocol.
Mac vs Other Computer doesn't seem to affect anything.  You don't
need to pull down "Receive File..." -- the <esc>a seems to do the
trick all by itself.

For downloading a resource file to the Mac, the proper usage would
be (assuming the file is called macscrawl.rsrc or just macscrawl):
	macput -r macscrawl

The -d and -u options are for data only, where -u converts unix-style
newlines into carriage returns.  The code looks for extensions of 
 .data, .text, and then nothing. The -r, -d, and -u options are intended
to be mutually exclusive, and the last one on the line will be honored.

Default values for name, filetype, and author are given in the code,
and may be overridden by the -n name, -t type, and -a author options.

If no options are given, then full mode is assumed, and all three
segments must exist in the current directory; extensions are .info,
 .data, and .rsrc .   This is intended for restoring files from the
unix machine, where macget was used to back them up.

From ddj@csnet-relay.csnet Sun Jun 17 22:58:47 1984
Received: from csnet-relay by safe with TCP; Sun, 17 Jun 84 22:58:42 pdt
Received: From brown.csnet by csnet-relay;  18 Jun 84 1:31 EDT
Message-Id: <8406180504.AA02067@nancy.Brown.CSNet>
Date:     18 Jun 84 (Mon) 01:04:55 EDT
From: Dave Johnson <ddj%brown.csnet@csnet-relay.arpa>
To: croft@su-safe.arpa
Subject:  MacTerminal file transfer
Status: R

Sorry for the delay in getting this to you, but I was at
Usenix all last week.  I will send you an amended version
of the modem7 documentation that I found in net.sources 
back in April, with my notes as appendices explaining what
MacTerminal does.  Following that is my "macput" program,
(Unix -> MacTerm), which seems to be quite reliable, even at
9600 baud.  In a day or so I will send "macget" and maybe
even some manual pages. 

I also found the umodem36a program on net.sources, but
couldn't wade through all the options, so ignored it!
It would have probably been more work to hack in yet
another protocol anyway.

We have the -0.15X version (Almost Alpha MacTerminal) of 
April 18, 1984; the problems I noted in the spec might be
what Haeberli was alluding to when he said it wasn't fully
working.  All the problems were seen when the Mac was sending
(so far; am keeping fingers crossed).

I hope there aren't any major changes when the real release
comes out, but as soon as I get it, I will beat on it heavily.
I'd be a little hesitant to send macput out to info-mac, as the
MacTerminal program is still pre-release, but it should be ok
to make it available with your ftp distribution, if you want.  

I agree with your comments in the distribution cover letter 
regarding other protocols -- we have problems with modem7 in
that it will not survive over a flow-controlled serial line
(we use Sytek System/20 equipment heavily here).  Something 
that can escape the XON/XOFF characters, or stick to printable
characters (ala uuencode/uudecode) might be preferable.  I'm
not familiar with kermit to know if it would work over the
Sytek connections, but I should look into it.  Do you have
a spec for it?   

An idea that we had here would be to write a desk accessory
which would provide a simple window for the user to log into
the host and send the command to initiate the transfer, and
then handle the transfer protocol.  This would likely be small,
and it would be convenient not to exit the application to do
the transfer.  I may start here with a small application
implementing a glass tty with file transfer but I would like
to make it into a driver someday (that part of the OS manual
was missing from my copy of Inside Mac).

If I finish off this letter here, I might even get the manual
pages written.  Keep me posted, and I'll continue to send you
anything useful we get working here.
	Dave Johnson

From ddj@csnet-relay.csnet Sun Jun 17 22:59:00 1984
Received: from csnet-relay by safe with TCP; Sun, 17 Jun 84 22:58:52 pdt
Received: From brown.csnet by csnet-relay;  18 Jun 84 1:32 EDT
Message-Id: <8406180506.AA02081@nancy.Brown.CSNet>
Date:     18 Jun 84 (Mon) 01:06:21 EDT
From: Dave Johnson <ddj%brown.csnet@csnet-relay.arpa>
To: croft@su-safe.arpa
Subject:  modem7 spec for MacTerminal
Status: R

From: jph@whuxle.UUCP Sun Apr 29 17:55:05 1984
(whuxle.330)net.micro.pc : Re: XMODEM protocol query - (nf)
Organization: Bell Labs, Whippany


MODEM PROTOCOL OVERVIEW  178 lines, 7.5K

1/1/82 by Ward Christensen.  I will maintain a master copy of
this.  Please pass on changes or suggestions via CBBS/Chicago
at (312) 545-8086, or by voice at (312) 849-6279.

NOTE this does not include things which I am not familiar with,
such as the CRC option implemented by John Mahr.

Last Rev: (none)

At the request of Rick Mallinak on behalf of the guys at
Standard Oil with IBM P.C.s, as well as several previous
requests, I finally decided to put my modem protocol into
writing.  It had been previously formally published only in the
AMRAD newsletter.

	Table of Contents
1. DEFINITIONS
2. TRANSMISSION MEDIUM LEVEL PROTOCOL
3. MESSAGE BLOCK LEVEL PROTOCOL
4. FILE LEVEL PROTOCOL
5. DATA FLOW EXAMPLE INCLUDING ERROR RECOVERY
6. PROGRAMMING TIPS.

-------- 1. DEFINITIONS.
<soh>	01H
<eot>	04H
<ack>	06H
<nak>	15H
<can>   18H

-------- 2. TRANSMISSION MEDIUM LEVEL PROTOCOL
Asynchronous, 8 data bits, no parity, one stop bit.

    The protocol imposes no restrictions on the contents of the
data being transmitted.  No control characters are looked for
in the 128-byte data messages.  Absolutely any kind of data may
be sent - binary, ASCII, etc.  The protocol has not formally
been adopted to a 7-bit environment for the transmission of
ASCII-only (or unpacked-hex) data , although it could be simply
by having both ends agree to AND the protocol-dependent data
with 7F hex before validating it.  I specifically am referring
to the checksum, and the block numbers and their ones-
complement.
    Those wishing to maintain compatibility of the CP/M file
structure, i.e. to allow modemming ASCII files to or from CP/M
systems should follow this data format:
  * ASCII tabs used (09H); tabs set every 8.
  * Lines terminated by CR/LF (0DH 0AH)
  * End-of-file indicated by ^Z, 1AH.  (one or more)
  * Data is variable length, i.e. should be considered a
    continuous stream of data bytes, broken into 128-byte
    chunks purely for the purpose of transmission.
  * A CP/M "peculiarity": If the data ends exactly on a
    128-byte boundary, i.e. CR in 127, and LF in 128, a
    subsequent sector containing the ^Z EOF character(s)
    is optional, but is preferred.  Some utilities or
    user programs still do not handle EOF without ^Zs.
  * The last block sent is no different from others, i.e.
    there is no "short block".

-------- 3. MESSAGE BLOCK LEVEL PROTOCOL
 Each block of the transfer looks like:
<SOH><blk #><255-blk #><--128 data bytes--><cksum>
    in which:
<SOH>       = 01 hex
<blk #>     = binary number, starts at 01 increments by 1, and
              wraps 0FFH to 00H (not to 01)
<255-blk #> = blk # after going thru 8080 "CMA" instr, i.e.
              each bit complemented in the 8-bit block number.
              Formally, this is the "ones complement".
<cksum>     = the sum of the data bytes only.  Toss any carry.

-------- 4. FILE LEVEL PROTOCOL

---- 4A. COMMON TO BOTH SENDER AND RECEIVER:

    All errors are retried 10 times.  For versions running with
an operator (i.e. NOT with XMODEM), a message is typed after 10
errors asking the operator whether to "retry or quit".
    Some versions of the protocol use <can>, ASCII ^X, to
cancel transmission.  This was never adopted as a standard, as
having a single "abort" character makes the transmission
susceptible to false termination due to an <ack> <nak> or <soh>
being corrupted into a <can> and canceling transmission.
    The protocol may be considered "receiver driven", that is,
the sender need not automatically re-transmit, although it does
in the current implementations.

---- 4B. RECEIVE PROGRAM CONSIDERATIONS:
    The receiver has a 10-second timeout.  It sends a <nak>
every time it times out.  The receiver's first timeout, which
sends a <nak>, signals the transmitter to start.  Optionally,
the receiver could send a <nak> immediately, in case the sender
was ready.  This would save the initial 10 second timeout.
However, the receiver MUST continue to timeout every 10 seconds
in case the sender wasn't ready.
    Once into a receiving a block, the receiver goes into a
one-second timeout for each character and the checksum.  If the
receiver wishes to <nak> a block for any reason (invalid
header, timeout receiving data), it must wait for the line to
clear.  See "programming tips" for ideas
    Synchronizing:  If a valid block number is received, it
will be: 1) the expected one, in which case everything is fine;
or 2) a repeat of the previously received block.  This should
be considered OK, and only indicates that the receivers <ack>
got glitched, and the sender re-transmitted; 3) any other block
number indicates a fatal loss of synchronization, such as the
rare case of the sender getting a line-glitch that looked like
an <ack>.  Abort the transmission, sending a <can>

---- 4C. SENDING PROGRAM CONSIDERATIONS.

    While waiting for transmission to begin, the sender has
only a single very long timeout, say one minute.  In the
current protocol, the sender has a 10 second timeout before
retrying.  I suggest NOT doing this, and letting the protocol
be completely receiver-driven.  This will be compatible with
existing programs.
    When the sender has no more data, it sends an <eot>, and
awaits an <ack>, resending the <eot> if it doesn't get one.
Again, the protocol could be receiver-driven, with the sender
only having the high-level 1-minute timeout to abort.

-------- 5. DATA FLOW EXAMPLE INCLUDING ERROR RECOVERY

Here is a sample of the data flow, sending a 3-block message.
It includes the two most common line hits - a garbaged block,
and an <ack> reply getting garbaged.  <xx> represents the
checksum byte.

SENDER					RECEIVER
				times out after 10 seconds,
			<---		<nak>
<soh> 01 FE -data- <xx>	--->
			<---		<ack>
<soh> 02 FD -data- xx	--->	(data gets line hit)
			<---		<nak>
<soh> 02 FD -data- xx	--->
			<---		<ack>
<soh> 03 FC -data- xx	--->
   (ack gets garbaged)	<---		<ack>
<soh> 03 FC -data- xx	--->		<ack>
<eot>			--->
			<---		<ack>

-------- 6. PROGRAMMING TIPS.

* The character-receive subroutine should be called with a
parameter specifying the number of seconds to wait.  The
receiver should first call it with a time of 10, then <nak> and
try again, 10 times.
  After receiving the <soh>, the receiver should call the
character receive subroutine with a 1-second timeout, for the
remainder of the message and the <cksum>.  Since they are sent
as a continuous stream, timing out of this implies a serious
like glitch that caused, say, 127 characters to be seen instead
of 128.

* When the receiver wishes to <nak>, it should call a "PURGE"
subroutine, to wait for the line to clear.  Recall the sender
tosses any characters in its UART buffer immediately upon
completing sending a block, to ensure no glitches were mis-
interpreted.
  The most common technique is for "PURGE" to call the
character receive subroutine, specifying a 1-second timeout,
and looping back to PURGE until a timeout occurs.  The <nak> is
then sent, ensuring the other end will see it.

* You may wish to add code recommended by Jonh Mahr to your
character receive routine - to set an error flag if the UART
shows framing error, or overrun.  This will help catch a few
more glitches - the most common of which is a hit in the high
bits of the byte in two consecutive bytes.  The <cksum> comes
out OK since counting in 1-byte produces the same result of
adding 80H + 80H as with adding 00H + 00H.

6/18/84
Notes by Dave Johnson, Brown University:

-------- Appendix A. Modifications for MacTerm file transfer

  File transfer between Macintoshes running MacTerm is almost
fully working in version -0.15X (Almost Alpha MacTerminal (tm))
of April 18, 1984.  I have a file which causes the sender to hang
after the first record, but most files can be sent without any
problems.

  The additional protocol to handle Macintosh files, described
below, was determined by plugging two Macs into separate serial
ports and writing a "data analyzer" program which watches both
ports, logging the traffic and passing characters from each port
to the other.  There may be more features in this protocol which
have not been observed, but a working emulation which runs on both
Sun and Vax machines has been written based on these observations.
(The above-mentioned file can be sent from the Unix systems to the
Mac without hanging, but can't be sent from the Mac to anything,
including another Mac through a null modem).

  With this caveat out of the way, I'll describe the protocol as
used by MacTerm.  When modem7 is selected as the protocol, the
Macintosh file is sent as three segments: a directory record or 
header, the data fork of the file, and the resource fork of the
file.  Each of these chunks is sent using the record formatting
and acknowledgement described above, with three minor differences.

* The sender notifies the reciever that a file transfer is about
to begin by transmitting "ESC a".  The receiver replies with an ACK.
MacTerm seems to try this only once, which is probably sufficient.

* The receiver should NAK the EOTs sent after the directory record
and data fork, but nothing is sent in response to the EOT following
the resource fork.

* An empty data fork or resource fork is indicated by simply sending
the EOT character.  (Slightly amusing note: if the Mac sends an empty
data fork, it gets confused by the NAK reply to its EOT, and ends up
sending the first record of the resource fork twice, but it all works
out ok in any case).

  Diagramatically, the exchange looks like this:

	Sender				Receiver
	------				--------
{ INITIAL HANDSHAKE }
<esc> 'a'		--->
			<---		<ack>

{ DIRECTORY INFORMATION }
<soh> 01 FE -header- xx	--->
			<---		<ack>
<eot>			--->
			<---		<nak>

{ DATA FORK }
<soh> 01 FE -data- xx	--->
			<---		<ack>
	.				  .
	.				  .
	.				  .
<soh> nn uu -data- xx	--->
			<---		<ack>
<eot>			--->
			<---		<nak>

{ RESOURCE FORK }
<soh> 01 FE -data- xx	--->
			<---		<ack>
	.				  .
	.				  .
	.				  .
<soh> mm ww -data- xx	--->
			<---		<ack>
<eot>			--->
{ THATS ALL FOLKS }

-------- Appendix B. Header Record Format

  The 128 byte record sent as the first segment of the file
transfer contains the file name, file type, author, and the
data and resource segment byte counts.  I think the creation
date should be kept somewhere in this record, but haven't been
able to find or decode it.  The offsets (zero based) of these
fields are summarized here:

	Field		Offset		Size
	-----		------		----
	Name Length	   1		  1
	Name		   2		 63
	Type		  65		  4
	Author		  69		  4
	Data Length	  81		  4
	Resource Length	  85		  4

(the Name Length might be offset zero and 2 bytes long, but who cares).

ould call a "PURGE"
subroutine, to wait for the line to clear.  Recall the sender
tosses any characters in its UART buffer immediately upon
csumacc/cmd/kermit.c   444      0     12      107112  3470501333   7543 /*
 *  K e r m i t	 File Transfer Utility
 *
 *  UNIX Kermit, Columbia University, 1981, 1982, 1983
 *	Bill Catchings, Bob Cattani, Chris Maio, Frank da Cruz, Alan Crosswell
 *
 *  Also:   Jim Guyton, Rand Corporation
 *	    Walter Underwood, Ford Aerospace
 *
 *  usage:  kermit c [lbe line baud escapechar]		to connect
 *	    kermit s [d..iflb line baud] file ...	to send files
 *	    kermit r [d..iflb line baud]		to receive files
 *
 *  where   c=connect, s=send, r=receive,
 *	    d=debug, i=image mode, f=no filename conversion, l=tty line,
 *	    b=baud rate, e=escape char.
 *
 *  For remote Kermit, format is either:
 *	    kermit r					to receive files
 *  or	    kermit s file ...				to send files
 *
 */

/*
 *  Modification History:
 *
 *  Oct. 17 Included fixes from Alan Crosswell (CUCCA) for IBM_UTS:
 *	    - Changed MYEOL character from \n to \r.
 *	    - Change char to int in bufill so getc would return -1 on
 *	      EOF instead of 255 (-1 truncated to 8 bits)
 *	    - Added read() in rpack to eat the EOL character
 *	    - Added fflush() call in printmsg to force the output
 *	    NOTE: The last three changes are not conditionally compiled
 *		  since they should work equally well on any system.
 *
 *	    Changed Berkeley 4.x conditional compilation flag from
 *		UNIX4X to UCB4X.
 *	    Added support for error packets and cleaned up the printing
 *		routines.
 */

#include <stdio.h>	    /* Standard UNIX definitions */

/* Conditional compilation for different machines/operating systems */
/* One and only one of the following lines should be 1 */

#define UCB4X	    1	    /* Berkeley 4.x UNIX */
#define TOPS_20	    0	    /* TOPS-20 */
#define IBM_UTS	    0	    /* Amdahl UTS on IBM systems */
#define VAX_VMS	    0	    /* VAX/VMS (not yet implemented) */

/* Conditional compilation for the different Unix variants */
/* 0 means don't compile it, nonzero means do */

#if UCB4X
#define V6_LIBS	    0	    /* Dont't use retrofit libraries */
#define NO_FIONREAD 0	    /* We have ioctl(FIONREAD,...) for flushinput() */
#define NO_TANDEM   0	    /* We have TANDEM line discipline (xon/xoff) */
#endif

#if IBM_UTS
#define V6_LIBS	    0	    /* Don't use retrofit libraries */
#define NO_FIONREAD 1	    /* No ioctl(FIONREAD,...) for flushinput() */
#define NO_TANDEM   1	    /* No TANDEM line discipline (xon/xoff) */
#endif

#if V6_LIBS
#include <retrofit/sgtty.h>
#include <retrofit/signal.h>
#include <retrofit/setjmp.h>
#else
#include <sgtty.h>
#include <signal.h>
#include <setjmp.h>
#endif

#if NO_TANDEM
#define TANDEM	    0	    /* define it to be nothing if it's unsupported */
#endif


/* Symbol Definitions */

#define MAXPACKSIZ  94	    /* Maximum packet size */
#define SOH	    1	    /* Start of header */
#define CR	    13	    /* ASCII Carriage Return */
#define SP	    32	    /* ASCII space */
#define DEL	    127	    /* Delete (rubout) */
#define ESCCHR	    '^'	    /* Default escape character for CONNECT */

#define MAXTRY	    10	    /* Times to retry a packet */
#define MYQUOTE	    '#'	    /* Quote character I will use */
#define MYPAD	    0	    /* Number of padding characters I will need */
#define MYPCHAR	    0	    /* Padding character I need (NULL) */

#if IBM_UTS
#define MYEOL	    '\r'    /* End-Of-Line character for UTS systems */
#else
#define MYEOL	    '\n'    /* End-Of-Line character I need */
#endif

#define MYTIME	    10	    /* Seconds after which I should be timed out */
#define MAXTIM	    60	    /* Maximum timeout interval */
#define MINTIM	    2	    /* Minumum timeout interval */

#define TRUE	    -1	    /* Boolean constants */
#define FALSE	    0


/* Macro Definitions */

/*
 * tochar: converts a control character to a printable one by adding a space.
 *
 * unchar: undoes tochar.
 *
 * ctl:	   converts between control characters and printable characters by
 *	   toggling the control bit (ie. ^A becomes A and A becomes ^A).
 */
#define tochar(ch)  ((ch) + ' ')
#define unchar(ch)  ((ch) - ' ')
#define ctl(ch)	    ((ch) ^ 64 )


/* Global Variables */

int	size,		    /* Size of present data */
	rpsiz,		    /* Maximum receive packet size */
	spsiz,		    /* Maximum send packet size */
	pad,		    /* How much padding to send */
	timint,		    /* Timeout for foreign host on sends */
	n,		    /* Packet number */
	numtry,		    /* Times this packet retried */
	oldtry,		    /* Times previous packet retried */
	ttyfd,		    /* File descriptor of tty for I/O, 0 if remote */
	remote,		    /* -1 means we're a remote kermit */
	image,		    /* -1 means 8-bit mode */
	debug,		    /* indicates level of debugging output (0=none) */
	filnamcnv,	    /* -1 means do file name case conversions */
	filecount;	    /* Number of files left to send */

char	state,		    /* Present state of the automaton */
	padchar,	    /* Padding character to send */
	eol,		    /* End-Of-Line character to send */
	escchr,		    /* Connect command escape character */
	quote,		    /* Quote character in incoming data */
	**filelist,	    /* List of files to be sent */
	*filnam,	    /* Current file name */
	recpkt[MAXPACKSIZ], /* Receive packet buffer */
	packet[MAXPACKSIZ]; /* Packet buffer */

FILE	*fp,		    /* File pointer for current disk file */
	*log;		    /* File pointer for Logfile */

jmp_buf env;		    /* Environment ptr for timeout longjump */


/*
 *  m a i n
 *
 *  Main routine - parse command and options, set up the
 *  tty lines, and dispatch to the appropriate routine.
 */

main(argc,argv)
int argc;			    /* Character pointers to and count of */
char **argv;				/* command line arguments */
{
    char *ttyname,			/* tty name for LINE argument */
	*cp;				/* char pointer */
    int speed,				/* speed of assigned tty, */
	cflg, rflg, sflg;		/* flags for CONNECT, RECEIVE, SEND */

    struct sgttyb
	rawmode,			/* Controlling tty raw mode */
	cookedmode,			/* Controlling tty cooked mode */
	ttymode;			/* mode of tty line in LINE option */

    if (argc < 2) usage();		/* Make sure there's a command line */

    cp = *++argv; argv++; argc -= 2;	/* Set up pointers to args */

/*  Initialize these values and hope the first packet will get across OK */

    eol = CR;				/* EOL for outgoing packets */
    quote = '#';			/* Standard control-quote char "#" */
    pad = 0;				/* No padding */
    padchar = NULL;			/* Use null if any padding wanted */

    speed = cflg = sflg = rflg = 0;	/* Turn off all parse flags */
    ttyname = 0;			/* Default is remote mode */

#if UCB4X				/* Default to 7-bit masking, CRLF */
    image = FALSE;			/* translation and filename case */
    filnamcnv = TRUE;			/* conversion for UNIX systems */
#else
    image = TRUE;			/* Default to no processing for */
    filnamcnv = FALSE;			/* non-UNIX systems */
#endif

    escchr = ESCCHR;			/* Default escape character */
 
    while ((*cp) != NULL)		/* Parse characters in first arg. */
	switch (*cp++)
	{
	    case 'c': cflg++; break;	/* C = Connect command */
	    case 's': sflg++; break;	/* S = Send command */
	    case 'r': rflg++; break;	/* R = Receive command */

	    case 'd':			/* D = Increment debug mode count */
		debug++; break;
		
	    case 'f':
		filnamcnv = FALSE;	/* F = don't do case conversion */
		break;			/*     on filenames */

	    case 'i':			/* I = Image (8-bit) mode */
		image = TRUE; break;	/* (this is default for non-UNIX) */

	    case 'l':			/* L = specify tty line to use */
		if (argc--) ttyname = *argv++;
		else usage(); 
		if (debug) printf("Line to remote host is %s\n",ttyname); 
		break;
		
	    case 'e':			/* E = specify escape char */
		if (argc--) escchr = **argv++;
		else usage();
		if (debug) printf("Escape char is \"%c\"\n",escchr);
		break;
		
	    case 'b':			/* B = specify baud rate */
#if UCB4X
		if (argc--) speed = atoi(*argv++);
		else usage();
		if (debug) printf("Line speed to remote host is %d\n",speed);
		break;
#else
		printmsg("Speed setting implemented for Unix only.");
		exit(1);
#endif
	}

/* Done parsing */

    if ((cflg+sflg+rflg) != 1)		/* Only one command allowed */
	usage();


    if (ttyname)			/* If LINE was specified, we */
    {					/* operate in local mode */
	ttyfd = open(ttyname,2);	/* Open the tty line */
	if (ttyfd < 0)
	{
	    printmsg("Cannot open %s",ttyname);
	    exit(1);
	}
	remote = FALSE;			/* Indicate we're in local mode */
    }
    else				/* No LINE specified so we operate */
    {					/* in remote mode (ie. controlling */
	ttyfd = 0;			/* tty is the communications line) */
	remote = TRUE;
    }
    

/* Put the proper tty into the correct mode */

    if (remote)				/* If remote, use controlling tty */
    {
	gtty(0,&cookedmode);		/* Save current mode so we can */
	gtty(0,&rawmode);		/* restore it later */
	rawmode.sg_flags |= (RAW|TANDEM);
	rawmode.sg_flags &= ~(ECHO|CRMOD);
	stty(0,&rawmode);		/* Put tty in raw mode */
    }
    else				/* Local, use assigned line */
    {
	gtty(ttyfd,&ttymode);
	ttymode.sg_flags |= (RAW|TANDEM);
	ttymode.sg_flags &= ~(ECHO|CRMOD);

#if UCB4X				/* Speed changing for UNIX only */
	if (speed)			/* User specified a speed? */
	{
	    switch(speed)		/* Get internal system code */
	    {
		case 110: speed = B110; break;
		case 150: speed = B150; break;
		case 300: speed = B300; break;
		case 1200: speed = B1200; break;
		case 2400: speed = B2400; break;
		case 4800: speed = B4800; break;
		case 9600: speed = B9600; break; 

		default:
		    printmsg("Bad line speed.");
		    exit(1);
	    }
	    ttymode.sg_ispeed = speed;
	    ttymode.sg_ospeed = speed;
	}
#endif /* UCB4X */

	stty(ttyfd,&ttymode);		/* Put asg'd tty in raw mode */
    }	


/* All set up, now execute the command that was given. */

    if (debug)
    {
	printf("Debugging level = %d\n\n",debug);

	if (cflg) printf("Connect command\n\n");
	if (sflg) printf("Send command\n\n");
	if (rflg) printf("Receive command\n\n");
    }
  
    if (cflg) connect();		/* Connect command */

    if (sflg)				/* Send command */ 
    {
	if (argc--) filnam = *argv++;	/* Get file to send */
	else
	{   if (remote)
		stty(0,&cookedmode);	/* Restore controlling tty's modes */
	    usage();			/* and give error */
	}
	fp = NULL;			/* Indicate no file open yet */
	filelist = argv;		/* Set up the rest of the file list */
	filecount = argc;		/* Number of files left to send */
	if (sendsw() == FALSE)		/* Send the file(s) */
	    printmsg("Send failed.");	/* Report failure */
	else				/*  or */
	    printmsg("done.");		/* success */
    }

    if (rflg)				/* Receive command */
    {
	if (recsw() == FALSE)		/* Receive the file(s) */
	    printmsg("Receive failed.");
	else				/* Report failure */
	    printmsg("done.");		/* or success */
    }

    if (remote) stty(0,&cookedmode);	/* Restore controlling tty's modes */
}


/*
 *  s e n d s w
 *
 *  Sendsw is the state table switcher for sending files.  It loops until
 *  either it finishes, or an error is encountered.  The routines called
 *  by sendsw are responsible for changing the state.
 *
 */

sendsw()
{
    char sinit(), sfile(), sdata(), seof(), sbreak();

    state = 'S';			/* Send initiate is the start state */
    n = 0;				/* Initialize message number */
    numtry = 0;				/* Say no tries yet */
    while(TRUE)				/* Do this as long as necessary */
    {
	if (debug) printf("sendsw state: %c\n",state);
	switch(state)
	{
	    case 'S':	state = sinit();  break; /* Send-Init */
	    case 'F':	state = sfile();  break; /* Send-File */
	    case 'D':	state = sdata();  break; /* Send-Data */
	    case 'Z':	state = seof();	  break; /* Send-End-of-File */
	    case 'B':	state = sbreak(); break; /* Send-Break */
	    case 'C':	return (TRUE);		 /* Complete */
	    case 'A':	return (FALSE);		 /* "Abort" */
	    default:	return (FALSE);		 /* Unknown, fail */
	}
    }
}


/*
 *  s i n i t
 *
 *  Send Initiate: send this host's parameters and get other side's back.
 */

char sinit()
{
    int num, len;			/* Packet number, length */

    if (numtry++ > MAXTRY) return('A'); /* If too many tries, give up */
    spar(packet);			/* Fill up init info packet */

    flushinput();			/* Flush pending input */

    spack('S',n,6,packet);		/* Send an S packet */
    switch(rpack(&len,&num,recpkt))	/* What was the reply? */
    {
	case 'N':  return(state);	/* NAK, try it again */

	case 'Y':			/* ACK */
	    if (n != num)		/* If wrong ACK, stay in S state */
		return(state);		/* and try again */
	    rpar(recpkt);		/* Get other side's init info */

	    if (eol == 0) eol = '\n';	/* Check and set defaults */
	    if (quote == 0) quote = '#';

	    numtry = 0;			/* Reset try counter */
	    n = (n+1)%64;		/* Bump packet count */
	    return('F');		/* OK, switch state to F */

	case 'E':			/* Error packet received */
	    prerrpkt(recpkt);		/* Print it out and */
	    return('A');		/* abort */

	case FALSE: return(state);	/* Receive failure, try again */

	default: return('A');		/* Anything else, just "abort" */
   }
 }


/*
 *  s f i l e
 *
 *  Send File Header.
 */

char sfile()
{
    int num, len;			/* Packet number, length */
    char filnam1[50],			/* Converted file name */
	*newfilnam,			/* Pointer to file name to send */
	*cp;				/* char pointer */

    if (numtry++ > MAXTRY) return('A'); /* If too many tries, give up */
    
    if (fp == NULL)			/* If not already open, */
    {	if (debug) printf("   Opening %s for sending.\n",filnam);
	fp = fopen(filnam,"r");		/* open the file to be sent */
	if (fp == NULL)			/* If bad file pointer, give up */
	{
	    error("Cannot open file %s",filnam);
	    return('A');
	}
    }

    strcpy(filnam1, filnam);		/* Copy file name */
    newfilnam = cp = filnam1;
    while (*cp != '\0')			/* Strip off all leading directory */
	if (*cp++ == '/')		/* names (ie. up to the last /). */
	    newfilnam = cp;

    if (filnamcnv)			/* Convert lower case to upper	*/
	for (cp = newfilnam; *cp != '\0'; cp++)
	    if (*cp >= 'a' && *cp <= 'z')
		*cp ^= 040;

    len = cp - newfilnam;		/* Compute length of new filename */

    printmsg("Sending %s as %s",filnam,newfilnam);

    spack('F',n,len,newfilnam);		/* Send an F packet */
    switch(rpack(&len,&num,recpkt))	/* What was the reply? */
    {			
	case 'N':			/* NAK, just stay in this state, */
	    num = (--num<0 ? 63:num);	/* unless it's NAK for next packet */
	    if (n != num)		/* which is just like an ACK for */ 
		return(state);		/* this packet so fall thru to... */

	case 'Y':			/* ACK */
	    if (n != num) return(state); /* If wrong ACK, stay in F state */
	    numtry = 0;			/* Reset try counter */
	    n = (n+1)%64;		/* Bump packet count */
	    size = bufill(packet);	/* Get first data from file */
	    return('D');		/* Switch state to D */

	case 'E':			/* Error packet received */
	    prerrpkt(recpkt);		/* Print it out and */
	    return('A');		/* abort */

	case FALSE: return(state);	/* Receive failure, stay in F state */

	default:    return('A');	/* Something else, just "abort" */
    }
}


/*
 *  s d a t a
 *
 *  Send File Data
 */

char sdata()
{
    int num, len;			/* Packet number, length */

    if (numtry++ > MAXTRY) return('A'); /* If too many tries, give up */

    spack('D',n,size,packet);		/* Send a D packet */
    switch(rpack(&len,&num,recpkt))	/* What was the reply? */
    {		    
	case 'N':			/* NAK, just stay in this state, */
	    num = (--num<0 ? 63:num);	/* unless it's NAK for next packet */
	    if (n != num)		/* which is just like an ACK for */
		return(state);		/* this packet so fall thru to... */
		
	case 'Y':			/* ACK */
	    if (n != num) return(state); /* If wrong ACK, fail */
	    numtry = 0;			/* Reset try counter */
	    n = (n+1)%64;		/* Bump packet count */
	    if ((size = bufill(packet)) == EOF) /* Get data from file */
		return('Z');		/* If EOF set state to that */
	    return('D');		/* Got data, stay in state D */

	case 'E':			/* Error packet received */
	    prerrpkt(recpkt);		/* Print it out and */
	    return('A');		/* abort */

	case FALSE: return(state);	/* Receive failure, stay in D */

	default:    return('A');	/* Anything else, "abort" */
    }
}


/*
 *  s e o f
 *
 *  Send End-Of-File.
 */

char seof()
{
    int num, len;			/* Packet number, length */
    if (numtry++ > MAXTRY) return('A'); /* If too many tries, "abort" */

    spack('Z',n,0,packet);		/* Send a 'Z' packet */
    switch(rpack(&len,&num,recpkt))	/* What was the reply? */
    {
	case 'N':			/* NAK, just stay in this state, */
	    num = (--num<0 ? 63:num);	/* unless it's NAK for next packet, */
	    if (n != num)		/* which is just like an ACK for */
		return(state);		/* this packet so fall thru to... */

	case 'Y':			/* ACK */
	    if (n != num) return(state); /* If wrong ACK, hold out */
	    numtry = 0;			/* Reset try counter */
	    n = (n+1)%64;		/* and bump packet count */
	    if (debug) printf("	  Closing input file %s, ",filnam);
	    fclose(fp);			/* Close the input file */
	    fp = NULL;			/* Set flag indicating no file open */ 

	    if (debug) printf("looking for next file...\n");
	    if (gnxtfl() == FALSE)	/* No more files go? */
		return('B');		/* if not, break, EOT, all done */
	    if (debug) printf("	  New file is %s\n",filnam);
	    return('F');		/* More files, switch state to F */

	case 'E':			/* Error packet received */
	    prerrpkt(recpkt);		/* Print it out and */
	    return('A');		/* abort */

	case FALSE: return(state);	/* Receive failure, stay in Z */

	default:    return('A');	/* Something else, "abort" */
    }
}


/*
 *  s b r e a k
 *
 *  Send Break (EOT)
 */

char sbreak()
{
    int num, len;			/* Packet number, length */
    if (numtry++ > MAXTRY) return('A'); /* If too many tries "abort" */

    spack('B',n,0,packet);		/* Send a B packet */
    switch (rpack(&len,&num,recpkt))	/* What was the reply? */
    {
	case 'N':			/* NAK, just stay in this state, */
	    num = (--num<0 ? 63:num);	/* unless NAK for previous packet, */
	    if (n != num)		/* which is just like an ACK for */
		return(state);		/* this packet so fall thru to... */

	case 'Y':			/* ACK */
	    if (n != num) return(state); /* If wrong ACK, fail */
	    numtry = 0;			/* Reset try counter */
	    n = (n+1)%64;		/* and bump packet count */
	    return('C');		/* Switch state to Complete */

	case 'E':			/* Error packet received */
	    prerrpkt(recpkt);		/* Print it out and */
	    return('A');		/* abort */

	case FALSE: return(state);	/* Receive failure, stay in B */

	default:    return ('A');	/* Other, "abort" */
   }
}


/*
 *  r e c s w
 *
 *  This is the state table switcher for receiving files.
 */

recsw()
{
    char rinit(), rfile(), rdata();	/* Use these procedures */

    state = 'R';			/* Receive-Init is the start state */
    n = 0;				/* Initialize message number */
    numtry = 0;				/* Say no tries yet */

    while(TRUE)
    {
	if (debug) printf(" recsw state: %c\n",state);
	switch(state)			/* Do until done */
	{
	    case 'R':	state = rinit(); break; /* Receive-Init */
	    case 'F':	state = rfile(); break; /* Receive-File */
	    case 'D':	state = rdata(); break; /* Receive-Data */
	    case 'C':	return(TRUE);		/* Complete state */
	    case 'A':	return(FALSE);		/* "Abort" state */
	}
    }
}

    
/*
 *  r i n i t
 *
 *  Receive Initialization
 */
  
char rinit()
{
    int len, num;			/* Packet length, number */

    if (numtry++ > MAXTRY) return('A'); /* If too many tries, "abort" */

    switch(rpack(&len,&num,packet))	/* Get a packet */
    {
	case 'S':			/* Send-Init */
	    rpar(packet);		/* Get the other side's init data */
	    spar(packet);		/* Fill up packet with my init info */
	    spack('Y',n,6,packet);	/* ACK with my parameters */
	    oldtry = numtry;		/* Save old try count */
	    numtry = 0;			/* Start a new counter */
	    n = (n+1)%64;		/* Bump packet number, mod 64 */
	    return('F');		/* Enter File-Receive state */

	case 'E':			/* Error packet received */
	    prerrpkt(recpkt);		/* Print it out and */
	    return('A');		/* abort */

	case FALSE:			/* Didn't get packet */
	    spack('N',n,0,0);		/* Return a NAK */
	    return(state);		/* Keep trying */

	default:     return('A');	/* Some other packet type, "abort" */
    }
}


/*
 *  r f i l e
 *
 *  Receive File Header
 */

char rfile()
{
    int num, len;			/* Packet number, length */
    char filnam1[50];			/* Holds the converted file name */

    if (numtry++ > MAXTRY) return('A'); /* "abort" if too many tries */

    switch(rpack(&len,&num,packet))	/* Get a packet */
    {
	case 'S':			/* Send-Init, maybe our ACK lost */
	    if (oldtry++ > MAXTRY) return('A'); /* If too many tries "abort" */
	    if (num == ((n==0) ? 63:n-1)) /* Previous packet, mod 64? */
	    {				/* Yes, ACK it again with  */
		spar(packet);		/* our Send-Init parameters */
		spack('Y',num,6,packet);
		numtry = 0;		/* Reset try counter */
		return(state);		/* Stay in this state */
	    }
	    else return('A');		/* Not previous packet, "abort" */

	case 'Z':			/* End-Of-File */
	    if (oldtry++ > MAXTRY) return('A');
	    if (num == ((n==0) ? 63:n-1)) /* Previous packet, mod 64? */
	    {				/* Yes, ACK it again. */
		spack('Y',num,0,0);
		numtry = 0;
		return(state);		/* Stay in this state */
	    }
	    else return('A');		/* Not previous packet, "abort" */

	case 'F':			/* File Header (just what we want) */
	    if (num != n) return('A');	/* The packet number must be right */
	    strcpy(filnam1, packet);	/* Copy the file name */

	    if (filnamcnv)		/* Convert upper case to lower */
		for (filnam=filnam1; *filnam != '\0'; filnam++)
		    if (*filnam >= 'A' && *filnam <= 'Z')
			*filnam |= 040;

	    if ((fp=fopen(filnam1,"w"))==NULL) /* Try to open a new file */
	    {
		error("Cannot create %s",filnam1); /* Give up if can't */
		return('A');
	    }
	    else			/* OK, give message */
		printmsg("Receiving %s as %s",packet,filnam1);

	    spack('Y',n,0,0);		/* Acknowledge the file header */
	    oldtry = numtry;		/* Reset try counters */
	    numtry = 0;			/* ... */
	    n = (n+1)%64;		/* Bump packet number, mod 64 */
	    return('D');		/* Switch to Data state */

	case 'B':			/* Break transmission (EOT) */
	    if (num != n) return ('A'); /* Need right packet number here */
	    spack('Y',n,0,0);		/* Say OK */
	    return('C');		/* Go to complete state */

	case 'E':			/* Error packet received */
	    prerrpkt(recpkt);		/* Print it out and */
	    return('A');		/* abort */

	case FALSE:			/* Didn't get packet */
	    spack('N',n,0,0);		/* Return a NAK */
	    return(state);		/* Keep trying */

	default:    return ('A');	/* Some other packet, "abort" */
    }
}


/*
 *  r d a t a
 *
 *  Receive Data
 */

char rdata()
{
    int num, len;			/* Packet number, length */
    if (numtry++ > MAXTRY) return('A'); /* "abort" if too many tries */

    switch(rpack(&len,&num,packet))	/* Get packet */
    {
	case 'D':			/* Got Data packet */
	    if (num != n)		/* Right packet? */
	    {				/* No */
		if (oldtry++ > MAXTRY)
		    return('A');	/* If too many tries, abort */
		if (num == ((n==0) ? 63:n-1)) /* Else check packet number */
		{			/* Previous packet again? */
		    spack('Y',num,6,packet); /* Yes, re-ACK it */
		    numtry = 0;		/* Reset try counter */
		    return(state);	/* Don't write out data! */
		}
		else return('A');	/* sorry, wrong number */
	    }
	    /* Got data with right packet number */
	    bufemp(packet,len);		/* Write the data to the file */
	    spack('Y',n,0,0);		/* Acknowledge the packet */
	    oldtry = numtry;		/* Reset the try counters */
	    numtry = 0;			/* ... */
	    n = (n+1)%64;		/* Bump packet number, mod 64 */
	    return('D');		/* Remain in data state */

	case 'F':			/* Got a File Header */
	    if (oldtry++ > MAXTRY)
		return('A');		/* If too many tries, "abort" */
	    if (num == ((n==0) ? 63:n-1)) /* Else check packet number */
	    {				/* It was the previous one */
		spack('Y',num,0,0);	/* ACK it again */
		numtry = 0;		/* Reset try counter */
		return(state);		/* Stay in Data state */
	    }
	    else return('A');		/* Not previous packet, "abort" */

	case 'Z':			/* End-Of-File */
	    if (num != n) return('A');	/* Must have right packet number */
	    spack('Y',n,0,0);		/* OK, ACK it. */
	    fclose(fp);			/* Close the file */
	    n = (n+1)%64;		/* Bump packet number */
	    return('F');		/* Go back to Receive File state */

	case 'E':			/* Error packet received */
	    prerrpkt(recpkt);		/* Print it out and */
	    return('A');		/* abort */

	case FALSE:			/* Didn't get packet */
	    spack('N',n,0,0);		/* Return a NAK */
	    return(state);		/* Keep trying */

	default:     return('A');	/* Some other packet, "abort" */
    }
}

/*
 *  c o n n e c t
 *
 *  Establish a virtual terminal connection with the remote host, over an
 *  assigned tty line. 
 */

connect()
{
    int pid,				/* Holds process id of child */
	connected;			/* Boolean connect flag */
    char bel = '\07',
	c;

    struct sgttyb
	rawmode,			/* Controlling tty raw mode */
	cookedmode;			/* Controlling tty cooked mode */

    if (remote)				/* Nothing to connect to in remote */
    {					/* mode, so just return */
	printmsg("No line specified for connection.");
	return;
    }

    gtty(0,&cookedmode);		/* Save current mode so we can */
    gtty(0,&rawmode);			/* restore it later */
    rawmode.sg_flags |= (RAW|TANDEM);
    rawmode.sg_flags &= ~(ECHO|CRMOD);
    stty(0,&rawmode);			/* Put tty in raw mode */

    pid = fork();	    /* Start fork to get typeout from remote host */

    if (pid)			    /* Parent: send type-in to remote host */
    {
	printmsg("connected...\r");
	connected = TRUE;		/* Put us in "connect mode" */
	while (connected)
	{
	    read(0,&c,1);		/* Get a character */
	    if ((c&0177) == escchr)	/* Check for escape character */
	    {
		read(0,&c,1);
		if ((c&0177) == escchr)
		    write(ttyfd,&c,1);
		else
		switch (c&0177)
		{
		    case 'c':
		    case 'C':
			connected = FALSE;
			write(0,"\r\n",2);
			break;

		    case 'h':
		    case 'H':
			write(0,"\r\nYes, I'm still here...\r\n",26);
			break;

		    default:
			write(0,&bel,1);
			break;
		}
	    }
	    else
	    {				/* If not escape charater, */
		write(ttyfd,&c,1);	/* write it out */
		c = NULL;		/* Nullify it (why?) */
	    }
	}
	kill(pid,9);			/* Done, kill the child */
	wait(0);			/* and bury him */
	stty(0,&cookedmode);		/* Restore tty mode */
	printmsg("disconnected.");
	return;				/* Done */
    }
    else		  /* Child does the reading from the remote host */
    {
	while(1)			/* Do this forever */
	{
	    read(ttyfd,&c,1);
	    write(1,&c,1);
	}
    }
}

/*
 *	KERMIT utilities.
 */

clkint()				/* Timer interrupt handler */
{
    longjmp(env,TRUE);			/* Tell rpack to give up */
}


/*
 *  s p a c k
 *
 *  Send a Packet
 */

spack(type,num,len,data)
char type, *data;
int num, len;
{
    int i;				/* Character loop counter */
    char chksum, buffer[100];		/* Checksum, packet buffer */
    register char *bufp;		/* Buffer pointer */

    if (debug>1)			/* Display outgoing packet */
    {
	if (data != NULL)
	    data[len] = '\0';		/* Null-terminate data to print it */
	printf("  spack type: %c\n",type);
	printf("	 num:  %d\n",num);
	printf("	 len:  %d\n",len);
	if (data != NULL)
	    printf("	    data: \"%s\"\n",data);
    }
  
    bufp = buffer;			/* Set up buffer pointer */
    for (i=1; i<=pad; i++) write(ttyfd,&padchar,1); /* Issue any padding */

    *bufp++ = SOH;			/* Packet marker, ASCII 1 (SOH) */
    *bufp++ = tochar(len+3);		/* Send the character count */
    chksum  = tochar(len+3);		/* Initialize the checksum */
    *bufp++ = tochar(num);		/* Packet number */
    chksum += tochar(num);		/* Update checksum */
    *bufp++ = type;			/* Packet type */
    chksum += type;			/* Update checksum */

    for (i=0; i<len; i++)		/* Loop for all data characters */
    {
	*bufp++ = data[i];		/* Get a character */
	chksum += data[i];		/* Update checksum */
    }
    chksum = (((chksum&0300) >> 6)+chksum)&077; /* Compute final checksum */
    *bufp++ = tochar(chksum);		/* Put it in the packet */
    *bufp = eol;			/* Extra-packet line terminator */
    write(ttyfd, buffer,bufp-buffer+1); /* Send the packet */
}

/*
 *  r p a c k
 *
 *  Read a Packet
 */

rpack(len,num,data)
int *len, *num;				/* Packet length, number */
char *data;				/* Packet data */
{
    int i, done;			/* Data character number, loop exit */
    char t,				/* Current input character */
	type,				/* Packet type */
	cchksum,			/* Our (computed) checksum */
	rchksum;			/* Checksum received from other host */

#if UCB4X				/* TOPS-20 can't handle timeouts... */
    if (setjmp(env)) return FALSE;	/* Timed out, fail */
    signal(SIGALRM,clkint);		/* Setup the timeout */
    if ((timint > MAXTIM) || (timint < MINTIM)) timint = MYTIME;
    alarm(timint);
#endif /* UCB4X */

    while (t != SOH)			/* Wait for packet header */
    {
	read(ttyfd,&t,1);
	t &= 0177;			/* Handle parity */
    }

    done = FALSE;			/* Got SOH, init loop */
    while (!done)			/* Loop to get a packet */
    {
	read(ttyfd,&t,1);		/* Get character */
	if (!image) t &= 0177;		/* Handle parity */
	if (t == SOH) continue;		/* Resynchronize if SOH */
	cchksum = t;			/* Start the checksum */
	*len = unchar(t)-3;		/* Character count */

	read(ttyfd,&t,1);		/* Get character */
	if (!image) t &= 0177;		/* Handle parity */
	if (t == SOH) continue;		/* Resynchronize if SOH */
	cchksum = cchksum + t;		/* Update checksum */
	*num = unchar(t);		/* Packet number */

	read(ttyfd,&t,1);		/* Get character */
	if (!image) t &= 0177;		/* Handle parity */
	if (t == SOH) continue;		/* Resynchronize if SOH */
	cchksum = cchksum + t;		/* Update checksum */
	type = t;			/* Packet type */

	for (i=0; i<*len; i++)		/* The data itself, if any */
	{				/* Loop for character count */
	    read(ttyfd,&t,1);		/* Get character */
	    if (!image) t &= 0177;	/* Handle parity */
	    if (t == SOH) continue;	/* Resynch if SOH */
	    cchksum = cchksum + t;	/* Update checksum */
	    data[i] = t;		/* Put it in the data buffer */
	}
	data[*len] = 0;			/* Mark the end of the data */

	read(ttyfd,&t,1);		/* Get last character (checksum) */
	rchksum = unchar(t);		/* Convert to numeric */
	read(ttyfd,&t,1);		/* get EOL character and toss it */
	if (!image) t &= 0177;		/* Handle parity */
	if (t == SOH) continue;		/* Resynchronize if SOH */
	done = TRUE;			/* Got checksum, done */
    }

#if UCB4X
    alarm(0);				/* Disable the timer interrupt */
#endif

    if (debug>1)			/* Display incoming packet */
    {
	if (data != NULL)
	    data[*len] = '\0';		/* Null-terminate data to print it */
	printf("  rpack type: %c\n",type);
	printf("	 num:  %d\n",*num);
	printf("	 len:  %d\n",*len);
	if (data != NULL)
	    printf("	    data: \"%s\"\n",data);
    }
					/* Fold in bits 7,8 to compute */
    cchksum = (((cchksum&0300) >> 6)+cchksum)&077; /* final checksum */

    if (cchksum != rchksum) return(FALSE);

    return(type);			/* All OK, return packet type */
}


/*
 *  b u f i l l
 *
 *  Get a bufferful of data from the file that's being sent.
 *  Only control-quoting is done; 8-bit & repeat count prefixes are
 *  not handled.
 */

bufill(buffer)
char buffer[];				/* Buffer */
{
    int i,				/* Loop index */
	t;				/* Char read from file */
    char t7;				/* 7-bit version of above */

    i = 0;				/* Init data buffer pointer */
    while((t = getc(fp)) != EOF)	/* Get the next character */
    {
	t7 = t & 0177;			/* Get low order 7 bits */

	if (t7 < SP || t7==DEL || t7==quote) /* Does this char require */
	{				    /* special handling? */
	    if (t=='\n' && !image)
	    {				/* Do LF->CRLF mapping if !image */
		buffer[i++] = quote;
		buffer[i++] = ctl('\r');
	    }
	    buffer[i++] = quote;	/* Quote the character */
	    if (t7 != quote)
	    {
		t = ctl(t);		/* and uncontrolify */
		t7 = ctl(t7);
	    }
	}
	if (image)
	    buffer[i++] = t;		/* Deposit the character itself */
	else
	    buffer[i++] = t7;

	if (i >= spsiz-8) return(i);	/* Check length */
    }
    if (i==0) return(EOF);		/* Wind up here only on EOF */
    return(i);				/* Handle partial buffer */
}


/*
 *	b u f e m p
 *
 *  Put data from an incoming packet into a file.
 */

bufemp(buffer,len)
char  buffer[];				/* Buffer */
int   len;				/* Length */
{
    int i;				/* Counter */
    char t;				/* Character holder */

    for (i=0; i<len; i++)		/* Loop thru the data field */
    {
	t = buffer[i];			/* Get character */
	if (t == MYQUOTE)		/* Control quote? */
	{				/* Yes */
	    t = buffer[++i];		/* Get the quoted character */
	    if ((t & 0177) != MYQUOTE)	/* Low order bits match quote char? */
		t = ctl(t);		/* No, uncontrollify it */
	}
	if (t==CR && !image)		/* Don't pass CR if in image mode */
	    continue;

	putc(t,fp);
    }
}


/*
 *  g n x t f l
 *
 *  Get next file in a file group
 */

gnxtfl()
{
    if (debug) printf("	  gnxtfl: filelist = \"%s\"\n",*filelist);
    filnam = *(filelist++);
    if (filecount-- == 0) return FALSE; /* If no more, fail */
    else return TRUE;			/* else succeed */
}


/*
 *  s p a r
 *
 *  Fill the data array with my send-init parameters
 *
 */

spar(data)
char data[];
{
    data[0] = tochar(MAXPACKSIZ);	   /* Biggest packet I can receive */
    data[1] = tochar(MYTIME);		/* When I want to be timed out */
    data[2] = tochar(MYPAD);		/* How much padding I need */
    data[3] = ctl(MYPCHAR);		/* Padding character I want */
    data[4] = tochar(MYEOL);		/* End-Of-Line character I want */
    data[5] = MYQUOTE;			/* Control-Quote character I send */
}


/*  r p a r
 *
 *  Get the other host's send-init parameters
 *
 */

rpar(data)
char data[];
{
    spsiz = unchar(data[0]);		/* Maximum send packet size */
    timint = unchar(data[1]);		/* When I should time out */
    pad = unchar(data[2]);		/* Number of pads to send */
    padchar = ctl(data[3]);		/* Padding character to send */
    eol = unchar(data[4]);		/* EOL character I must send */
    quote = data[5];			/* Incoming data quote character */
}
 

/*
 *  f l u s h i n p u t
 *
 *  Dump all pending input to clear stacked up NACK's.
 *  (Implemented only for Berkeley Unix at this time).
 */

#if UCB4X&(~NO_FIONREAD)
flushinput()
{
    long int count;			/* Number of bytes ready to read */
    long int i;				/* Number of bytes to read in loop */

    ioctl(ttyfd, FIONREAD, &count);	/* See how many bytes pending read */
    if (!count) return;			/* If zero, then no input to flush */

    while (count)			/* Loop till all are flushed */
    {
	i = (count<sizeof(recpkt)) ?	/* Read min of count and size of */
	    count : sizeof(recpkt);	/*  the read buffer */
	read(ttyfd, recpkt, i);		/* Read a bunch */
	count -= i;			/* Subtract from amount to read */
    }
}
#else
flushinput()		/* Null version for non-Berkeley Unix */
{}
#endif /* UCB4X&(~FIONREAD) */


/*
 *  Kermit printing routines:
 *
 *  usage - print command line options showing proper syntax
 *  printmsg -	like printf with "Kermit: " prepended
 *  error - like printmsg if local kermit; sends a error packet if remote
 *  prerrpkt - print contents of error packet received from remote host
 */

/*
 *  u s a g e 
 *
 *  Print summary of usage info and quit
 */

usage()
{
#if UCB4X
    printf("Usage: kermit c[lbe line baud esc.char]	 (connect mode)\n");
    printf("or:	   kermit s[diflb line baud] file ...	 (send mode)\n");
    printf("or:	   kermit r[diflb line baud]		 (receive mode)\n");
#else
    printf("Usage: kermit c[le line esc.char]		 (connect mode)\n");
    printf("or:	   kermit s[difl line] file ...		 (send mode)\n");
    printf("or:	   kermit r[difl line]			 (receive mode)\n");
#endif
    exit(1);
}

/*
 *  p r i n t m s g
 *
 *  Print message on standard output if not remote.
 */

/*VARARGS1*/
printmsg(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
    if (!remote)
    {
	printf("Kermit: ");
	printf(fmt,a1,a2,a3,a4,a5);
	printf("\n");
	fflush(stdout);			/* force output (UTS needs it) */
    }
}

/*
 *  e r r o r
 *
 *  Print error message.
 *
 *  If local, print error message with printmsg.
 *  If remote, send an error packet with the message.
 */

/*VARARGS1*/
error(fmt, a1, a2, a3, a4, a5)
char *fmt;
{
    char msg[80];
    int len;

    if (remote)
    {
	sprintf(msg,fmt,a1,a2,a3,a4,a5); /* Make it a string */
	len = strlen(msg);
	spack('E',n,len,msg);		/* Send the error packet */
    }
    else
	printmsg(fmt, a1, a2, a3, a4, a5);

    return;
}

/*
 *  p r e r r p k t
 *
 *  Print contents of error packet received from remote host.
 */
prerrpkt(msg)
char *msg;
{
    printf("Kermit aborting with following error from remote host:\n%s\n",msg);
    return;
}
fer[++i];		/* Get the quoted character */
	    if ((t & 0177) != MYQUOTE)	/* Low order bits match quote char? */
		t = ctl(t);		/* No, uncontrollify it */
	}
	if (t==CR && !image)		/* Don't pass CR if in image mode */
	    continue;

	putc(t,fp);
    }
}


/*
 *  g n x t f l
 *
 *  Get next file in a file group
 */

gnxtfl()
{
    if (debug) printf("	  gnxtfl: filelist = \"%s\"\n",*filelist);
    filnam = *(filelist++);
    if (filecosumacc/cmd/README   444      0     12        1160  3470501333   6720 Makefile	makefile
README		this file
fromhex.c	converts hex '*.dl' files into '*.rsrc' files
kermit.c	UNIX side of Kermit
macdbmap	shell file to generate b.map file for MacDB debugger
macget.c	xmodem file transfer, Mac -> UNIX
macimp.c	macpaint to impress converter
macput.c	xmodem file transfer, UNIX -> Mac
macput.doc	xmodem protocol description
macsbugmap.c	generates b.map file for manual use with macsbug
paintbits.c	more macpaint to hardcopy
paintimp.c	another macpaint to hardcopy
rmaker.c	resource compiler/maker
tohex.c		converts binary '*.rsrc' file to '*.dl' hex file
unlisa.c	strips junk from Lisa '*.text' files
*/

/*
 *  u s a g e 
 *
 *  Print summary of usage info and quit
 */

usage()
{
#if UCB4X
    printf("Usage: kermit c[lbe line baud esc.char]	 (connect mode)\n");
    printf("or:	   kermit s[diflb line baud] file ...	 (send mode)\n");
    printf("or:	   kermit r[diflb line baud]		 (receive mode)\n");
#else
    printf("Usage: kermit c[le line esc.char]		 (connect mode)\n");
    printf("or:	   kermsumacc/cmd/Makefile   444      0     12        1132  3470504521   7501 DP=/usr/sun/bin
PRGS=fromhex kermit macget macput macsbugmap rmaker tohex unlisa rmakerx
SHELLS=macdbmap
CFLAGS= -O -I../h

all:	$(PRGS)

fromhex:	fromhex.o
	cc -o fromhex fromhex.o

kermit:	kermit.o
	cc -o kermit kermit.o

macget:	macget.o
	cc -o macget macget.o

macput:	macput.o
	cc -o macput macput.o

macsbugmap:	macsbugmap.o
	cc -o macsbugmap macsbugmap.o

rmaker:	rmaker.o
	cc -o rmaker rmaker.o

tohex:	tohex.o
	cc -o tohex tohex.o

unlisa:	unlisa.o
	cc -o unlisa unlisa.o

rmakerx:	rmakerx.o
	cc -o rmakerx rmakerx.o

clean:
	rm -f *.o $(PRGS)

install: 
	cp $(PRGS) $(DP)
	cp $(SHELLS) $(DP)
m Lisa '*.text' files
*/

/*
 *  u s a g e 
 *
 *  Print summary of usage info and quit
 */

usage()
{
#if UCB4X
    printf("Usage: kermit c[lbe line baud esc.char]	 (connect mode)\n");
    printf("or:	   kermit s[diflb line baud] file ...	 (send mode)\n");
    printf("or:	   kermit r[diflb line baud]		 (receive mode)\n");
#else
    printf("Usage: kermit c[le line esc.char]		 (connect mode)\n");
    printf("or:	   kermsumacc/etc/   775      0     12           0  3472706432   6002 sumacc/etc/download.doc   444      0     12       15665  3470501342  10405 DOWNLOADING .RSRC AND .DL FILES TO A MACINTOSH


MACINTOSH FILES HAVE TWO 'FORKS'

Each file on your Mac consists of two parts:  a data 'fork' and a
resource fork.  Each fork is actually a complete, individual file.  In
practice it turns out that most Mac files have information in only one
of the forks, the other fork is typically empty.  (Sounds kind of
silly, huh)?  Thus if a Mac file is called a 'resource file', it
generally has a resource fork but no data fork.  Vice versa for a 'data
file'.

Examples of resource files are executable programs and fonts.  Data
files would be ascii text files, pictures, etc.  Resource files have an
additional characteristic:  they have an internal structure consisting
of an index and one or more 'resource's, each with an 'id'.  For
example, a font file has a separate id for each font type and size;
an executable program has an id for each overlay segment.


'*.RSRC' FILES

A Macintosh executable binary file (as generated by the Apple workshop
or by SUMacC or other compilers) is a resource file.  On the
'development' host (Lisa, UNIX, [TOPS20 too]) the file will have the
filename suffix '.RSRC'.  This is to distinguish which Mac fork the
file belongs in.  These files are not printable, they contain only
8-bit binary data.  

Sometimes you may see the file suffix '.DATA', this would represent
the contents of the data fork (data file).


'*.DL' FILES

8-bit binary data can't go thru the mail.  8-bit data also isn't very
user friendly on such systems as TOPS20;  TOPS20 packs character
data by default in 7-bit bytes, which looses information in this case.
[SUMEX is a TOPS20 system].

For this reason, a simple format was invented, called 'fromhex' or
'.dl' (download) format.  Each 8-bit binary byte in the .rsrc file is 
represented as two printable ascii characters (hex nibbles) in the
.dl file.  At the end of the .dl file is a checksum to guard against errors.

To translate between 8-bit binary and hex format there are two programs:
'fromhex' reads a hex file and writes a binary file;
'tohex' reads a binary file and writes a hex file.  These programs are
FTPable from the [SUMEX]<info-mac> directory:

  fromhexu.c		UNIX C version (or Mac C with stdio)
  fromhex.c		Mac C version (SUMacC)
  fromhex.p		Mac compiled Pascal (Apple workshop compiler)
  fromhex.rsrc		executable version of fromhex.p
  fromhex.dl		.dl version of fromhex.rsrc
  tohex.c		UNIX C version

The fromhex programs assume that any mail headers have been removed
from the file.  The UNIX version is a 'filter' [fromhex <x.dl >x.rsrc];
it reports whether the checksum was good or bad.  The Mac version
reads a data file called 'C' and writes an executable resource file 
called 'C prog';  it beeps if there was a checksum error.


FILES ARCHIVED ON SUMEX <INFO-MAC>

Since SUMEX is a TOPS20 (36-bit word) system, it has different file formats
for 7-bit ascii (printable) versus 8-bit (binary) files.  .RSRC files
(and .DATA files) are stored in 8-bit mode.  .DL files (and most other 
files) are stored in the default 7-bit mode.  This is important to know
if you are FTPing a file from SUMEX to a UNIX or most other systems.

When retrieving a file from SUMEX to a UNIX, check the suffix.  If it
is .RSRC or .DATA, you must use the FTP command 'tenex' or 'type l 8'
before the transfer to get all 8 bits transfered correctly.  If the
file has any other suffix, it is an ordinary text file and can be FTPed
with the default 'ascii' mode.

Whether a program is stored on SUMEX in .RSRC or .DL mode seems to
be a random function.  Currently if you need the other format, you should
FTP it to your local site (usually a UNIX) and convert it there using
the fromhex/tohex programs listed above.


UNIX DOWNLOADING

First get the file into .rsrc form.  This may require running fromhex.
Assume the resulting file is called handson.rsrc.  

Run MacTerminal (version 1.1 is recommended).  Ensure that the
MacTerminal configuration contains: 8 bits per char, parity none,
handshake none, xmodem transfer method, remote system macterminal, no
delays.  The hardwire or modem connection to your UNIX must be capable
of passing all 8 bits transparently.  If a terminal switcher, network
or 'smart modem' intercepts something, your transfer could freeze
midway.

Log into your UNIX and type 'macput -r handson'.  This should start the
transfer automatically and show you a 'thermometer' indicating the
percentage of the transfer complete.  After the transfer is complete
you can quit and double-click your new program to start it.

Macput / macget were written by Dave Johnson of Brown University and
are available for FTP from [SUMEX]<info-mac> {macget,macput}.{c,1}.


DOWNLOADING FROM OTHER HOSTS (E.G. TOPS20) WITHOUT MACPUT

Macput understands the same XMODEM protocol that MacTerminal uses.  Macput
also knows a special Mac-only protocol used between two consenting
MacTerminals.  The Mac-only protocol allows an entire Mac file, consisting
of data and resource forks, to be transfered.

There are other programs which speak XMODEM, for example the MODEM
program on TOPS20.  However MODEM does not currently have a switch
to turn on the Mac-specific protocol.  Consequently, MODEM can only
transfer a data fork to or from the Mac.  There is no way, either on 
MacTerminal or MODEM, to specify a resource fork transfer.
[We have heard rumors that BILLW@SRI is working on fixing MODEM.]

There is another possibility:  KERMIT.  If you have kermit running on
your host, and a Mac disk containing the kermit program, you should
be able to transfer resource and data files.  Since the Mac kermit is
just stabilizing and is not yet in wide availability, we havent tried
this yet.  Perhaps your hardest task will be to get the binary kermit
program onto your Mac disk.  Sounds like a bootstrap problem...

For folks without macput, kermit, or anything, read on about .DL downloading.


DOWNLOADING .DL FILES

You need a Mac disk with the 'fromhex' program discussed above.  This was
originally sent out with the early SUMacC distribution (before macput).
If you don't have it you might:  (1) find a UNIX friend who can macput
it to your disk.  (2) download (via lisaterminal 'receive to file') 
fromhex.p to your Lisa and compile it.  (3) download (via MacTerminal
'save lines off top') fromhex.c to your Mac and use a C compiler to
compile it.  (4) translate fromhex to your favorite language; 
mikes@cit-vax has a Forth version, does someone have a Basic version?

After you have fromhex and MacTerminal on your disk, login to your
host and ensure that the .dl file has no garbage or headers on the front
of it.  Then using MODEM (on TOPS20) or 'save lines off top', transfer
the printable .dl file to your Mac disk as a file named 'C'.  When
the transfer is complete, quit MacTerminal and run fromhex.  This will
read 'C' and produce 'C prog'.  Fromhex will beep if there was a checksum
error.  After you have the finder again, rename 'C prog' to whatever
and double click it;  your program should start.


Bill Croft and Ed Pattermann
SUMEX Computer Project
-------

 files (and most other 
files) are stored in the default 7-bit mode.  This sumacc/etc/fromhex.c   444      0     12        3613  3470501343   7672 #include "quickdraw.h"
#include "osintf.h"
#include "toolintf.h"

#define bufsize 512
#define InName "C"
#define OutName "C prog"

int rout, rin, io, i;
int l, val, bytes, sum, getsum;
char bin[bufsize], bout[bufsize];
int count, szin, bini, bouti;
FInfo fInfo;

putflush()
   {
   if (bouti)
      {
      count = bouti;
      io = FSWrite(rout, &count, bout); 
      bouti = 0;
      }
   }

putchar(ch)
   int ch;
   {
   bout[bouti++] = (char) ch;
   if (bouti == bufsize)
      putflush();
   }

int getchar()
   {
   if (bini == bufsize)
      {
      bini = 0;
      count = bufsize;
      io = FSRead(rin, &count, bin);
      }
   return ((int) bin[bini++]);
   }

badnews()
   {
   int j;

   io = FSClose(rin);
   io = FSClose(rout);
   SysBeep(1);
   for (j = 0; j <= 20000; j++) 
      l = 0;
   SysBeep(1);
   ExitToShell();
   }

main()
   {
   bouti = 0;
   bini = bufsize;

   io = FSDelete(OutName, 0);
   io = Create(OutName, 0, "CCOM", "APPL");
   io = GetFInfo(OutName, 0, &fInfo);
   fInfo.fdFlags |= fHasBundle << 8;
   io = SetFInfo(OutName, 0, &fInfo);
   io = OpenRF(OutName, 0, &rout);
   if (io)
      badnews();

   io = FSOpen(InName, 0, &rin);
   if (io)
      badnews();
   io = GetEOF(rin, &szin);
   count = szin >> 1;
   io = Allocate(rout, &count);
   if (io)
      badnews();
   val = 0;
   bytes = 0;
   sum = 0;
   getsum = 0;

   while (szin && !getsum)
      {
      l = getchar() & 127;
      szin--;
      if ((l >= 64) && (l < 80))
         {
	 bytes++;
         val = (val << 4) | (l - 64);
	 if (!(bytes & 1))
	    {
	    putchar(val);
	    sum += val;
	    val = 0;
 	    }
	 }
      if (l == 124)
         getsum = 1;
      }
   putflush();
   io = FSClose(rout);
   if (!getsum)
      badnews();

   sum += bytes >> 1;
   val = 0;
   for (i = 1; i <= 8; i++)
      val = (val << 4) | (getchar() & 15);
   io = FSClose(rin);
   if (val != sum)
      badnews();
   ExitToShell();
   }
 mode.

Whether a program is stored on SUMEX in .RSRC or .DL mode seems to
be a random function.  Currently if you nesumacc/etc/fromhex.doc   444      0     12        7151  3470501343  10216 Old Way of Downloading (using fromhex/tohex).

Back in the dark ages before macget/macput, resource files were
downloaded in 'hex' form, and then converted to binary.  To obtain
the printable hex form of a program, 'tohex' was used in the
compilation cycle:  'tohex <grow.rsrc >grow.dl'.  Then on the
Mac, 'fromhex' converted the printable scroll-off output of 
MacTerminal, to binary.

For historians, or those who are just curious, these were the
steps:

After obtaining a download file (e.g. grow.dl) from the
compilation cycle, you download it as follows:

[1] Launch MacTerminal.  When it comes up, type cat grow.dl.
    The file will scroll by on the screen and at the same
    time MacTerminal will be saving the 'lines off the top'
    into a file.  If you were previously using MacTerminal
    before the downloading step, then you will want to
    select the clear lines off top menu command before cat-
    ting the file.  Alternately you could turn on the File
    Transfer / Remember Lines off Top mode just before the
    cat.  Personally, I use another terminal for my VAX work
    and I throw an RS232 switch just before I invoke MacTer-
    minal and cat the file.

[2] With early versions of MacTerminal, the output file is
    called TermCache.  The latest version of MacTerminal
    places this output into the data fork of your MacTermi-
    nal configuration file.  For example if my configuration
    file is called 'C', the baud rate settings and so forth
    are held in the resource fork of C, while the 'scroll-
    off' is placed in the data fork of C.

[3] After the cat is complete, hit a few more CRs, to ensure
    that the lines are 'scrolled off the top' and thus
    saved.  (There's a shell file in test/mcat to do this if
    you're lazy).  Then exit MacTerminal.

[4] The fromhex program takes its input from a file called
    'C' and places the output on 'C prog'.  If the output
    from MacTerminal is not already named 'C', select it
    with the mouse and type 'c'.  This will change the name
    (case is not important).  Now launch 'fromhex'.  If all
    works correctly it will read 'C' and create an execut-
    able 'C prog'.  If the checksum fails (very rare), it
    will beep at you, which tells you to try the transfer
    over again with MacTerminal.

[5] Finally (phew!) you can launch 'C prog' and it will exe-
    cute.  Rename 'C prog' to something else if you want to
    keep it around and run fromhex some more.  If your pro-
    gram uses a special icon (as do the samples provided), a
    strange feature of the 'finder' requires that the 'bun-
    dle' bit be set at least once on one of these binaries.
    You can use the 'Set File' program for this.  After
    finder caches the icon in it's 'DeskTop', further bundle
    bits are not needed.

Although macput is now a much better way of downloading your
files, you will occasionally see a 'fromhex' format binary program
posted to a bboard or somesuch.  It is a handy way to send a program
binary thru the mail.

In decoding such programs, you can either use the steps above
(a Mac C version of fromhex is in the 'cmd' directory), or you
can simply convert the hex to binary on your UNIX and download
as normal with macput.  This cuts the size of the file transfered
to your Mac in half (of course).  The UNIX version of fromhex
is called 'fromhexu' in the 'cmd' directory.

	[at sending side]
	% tohex <grow.rsrc >grow.dl
	% mail john@china
	John, here's the grow program:
	~r grow.dl
	^D

	[at the receiving site, china]
	% ed mailfile
	1,12d			[delete the mail header (e.g. 1st 12 lines)]
	w grow.dl
	q
	% fromhexu <grow.dl >grow.rsrc
	checksum good!
	% macput -r grow
 were
downloaded in 'hex' form, and then converted to binary.  To obtain
the printable hex form of a program, 'tohex' was used in the
compilation cycle:  'tohex <grow.rsrc >grow.dl'.  Then on the
Mac, 'fromhex' converted the printable scroll-off output of 
MacTerminal, to binary.

For historians, or those who are just curious, these were the
steps:

After obtaining a download file (e.g. grow.dl) from thesumacc/etc/fromhex.p   444      0     12        4763  3470501343   7716 PROGRAM Fromhex;

{$U-}
{$X-}
{$D+}
{$R-}
{$L-}

USES {$U Obj/Quickdraw } Quickdraw,
     {$U Obj/OSIntf    } OSIntf,
     {$U Obj/ToolIntf  } ToolIntf;

{$L+}
{$ASM+}

CONST bufsize = 512;
      mask = 127;

VAR rout, rin, io, i: INTEGER;
    szin, l, val, bytes, count, sum, getsum: LongInt;
    nout, nin: OsStr255;
    bin, bout: ARRAY [1..bufsize] OF -128..127;
    bini, bouti: INTEGER;
    {debugger: text;}

PROCEDURE putflush;
BEGIN
  if bouti <> 1 then
  BEGIN
    count := bouti - 1;
    io := FSWrite(rout, count, @bout);
    bouti := 1;
  END;
END;

PROCEDURE putchar (ch:LongInt);
BEGIN
  bout[bouti] := ch;
  bouti := bouti + 1;
  if bouti > bufsize then putflush;
END;

FUNCTION getchar : LongInt;
VAR t: LongInt;
BEGIN
  if bini > bufsize then
  BEGIN
    bini := 1;
    count := bufsize;
    io := FSRead(rin, count, @bin);
  END;
  t := ord4(bin[bini]);
  bini := bini + 1;
  {write(debugger, 'getc ', t:4, '  ');}
  getchar := t;
END;

PROCEDURE badnews;              {if I was smart, I'd use a dialog box...}
VAR j: INTEGER;
BEGIN
  io := FSClose(rin);
  io := FSClose(rout);
  sysbeep(1);
  for j := 1 to 20000 do l:=0;
  sysbeep(1);
  exittoshell;
END;

BEGIN                   {main program}
  nout := 'C prog';
  nin := 'C';
  bouti := 1;
  bini := bufsize + 1;
  {Rewrite (debugger, '.BOUT'); the serial port not used for downloading from Lisa}

  io := FSDelete(nout, 0);
  io := Create(nout, 0, 'CCOM', 'APPL');
  io := OpenRF(nout, 0, rout);
  if io <> 0 then badnews;
  io := FSOpen(nin, 0, rin);
  if io <> 0 then badnews;
  io := GetEOF(rin, szin);
  val := 0;
  bytes := 0;
  sum := 0;
  getsum := 0;

  WHILE ((szin > 0) AND (getsum = 0)) DO
  BEGIN
    l := getchar;
    szin := szin - 1;
    l := BitAnd(l, ord4(mask));
    if (l >= 64) and (l < 80) then
    BEGIN
      bytes := bytes + 1;
      l := l - 64;
      val := BitShift(val, 4);
      val := BitOr(val, l);
      {write(debugger, 'val ', val:4, '  ');}
      if BitAnd(bytes, ord4(1)) = 0 then
      BEGIN
        putchar(val);
        sum := sum + val;
        val := 0;
      END;
    END;
    if (l = 124) then getsum := 1;  { we found "|" }
  END;
  putflush;
  io := FSClose(rout);
  {writeln(debugger, 'bytes', bytes, 'sum', sum);}
  if getsum = 0 then badnews;
  sum := sum + BitShift(bytes, -1);
  val := 0;
  for i := 1 to 8 do
  BEGIN
    l := getchar;
    l := BitAnd(l, ord4(15));
    val := BitShift(val, 4);
    val := BitOr(val, l);
  END;
  io := FSClose(rin);
  if val <> sum then badnews;
  exittoshell;          {it worked!}
END.
    strange fsumacc/etc/port.sun   444      0     12       16260  3470501344   7614 (Message inbox:64)
Return-Path: <ddj%brown.csnet@csnet-relay.arpa>
Received: from csnet-relay by safe with TCP; Wed, 14 Nov 84 15:55:01 pst
Received: from brown by csnet-relay.csnet id aa05981; 14 Nov 84 18:43 EST
Message-Id: <8411142336.AA23729@nancy.CS.Brown.CSNet>
Date:     14 Nov 84 (Wed) 18:36:07 EST
From: Dave Johnson <ddj%brown.csnet@csnet-relay.arpa>
To: croft@su-safe.ARPA, jkf%ucbmike@csnet-relay.arpa
Subject:  last minute fixes to sumacc for the sun

I can't remember if I sent a report of the "last" bug I found
in the assembler source (cmd/as/ps1.c).

What happened is everything but quoted strings worked -- .byte
instructions were broken such that they always generated nulls
(the char was written into the low byte, but the high byte was
being read out of the code generating shorts array).

Just to be sure, here's my log of the changes I made again.

I am planning to port the loader to the apollos (AUX environment)
someday soon; the rest of the sun changes applied directly to the
apollos, but their ar format is different (sys III).  might be
easier just to port the 4.2 ar to the apollos, though.  Let me
know if you need any clarification.
	
	Dave Johnson

========
CHANGES:
all:	(in makefile_t, makefile, or Makefile)
    /usr/sun/include -> /usr/include/mac, /usr/stanford/bin -> /usr/local/bin
	
include/mac: b.out.h
--------------------
*** b.out.h	Wed Jul 18 06:43:28 1984
--- b.out.h.orig	Tue Jun 26 01:45:48 1984
***************
*** 30,38
  /* types of files */
- #ifndef sun
  #define	ARCMAGIC 016230236041
- #else
- #define	ARCMAGIC 0x213C6172
- #endif
  #define OMAGIC	0405
  #define	FMAGIC	0407
  #define	NMAGIC	0410

--- 29,34 -----
  
  /* types of files */
  #define	ARCMAGIC 016230236041
  #define OMAGIC	0405
  #define	FMAGIC	0407
  #define	NMAGIC	0410
--------------------

lib: libmake.c -- different bitfield order in struct breloc, undef nohtonl
--------------------------
*** lib/libmake.c	Wed Jul 18 22:34:36 1984
--- lib/libmake.c.orig	Thu Jun  7 02:29:33 1984
***************
*** 67,75
  };
  
  struct breloc brtrap = {
- #ifdef sun
- 	RLONG<<12 | REXT<<14, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
- #else
  	RLONG<<2 | REXT, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
- #endif
  };

--- 67,72 -----
  };
  
  struct breloc brtrap = {
  	RLONG<<2 | REXT, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
  };
  struct breloc brext = {
***************
*** 74,82
  #endif
  };
  struct breloc brext = {
- #ifdef sun
- 	RLONG<<12 | REXT<<14, 2, 10	/* relocate stubaddr, sym 2, offset 10 */
- #else
  	RLONG<<2 | REXT, 2, 10	/* relocate stubaddr, sym 2, offset 10 */
- #endif
  };

--- 70,75 -----
  	RLONG<<2 | REXT, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
  };
  struct breloc brext = {
  	RLONG<<2 | REXT, 2, 10	/* relocate stubaddr, sym 2, offset 10 */
  };
  
***************
*** 232,235
! /* #define nohtonl */
  #ifdef nohtonl	/* if not in library */
  /*
   * "Host" to "net" byte order swappers.

--- 221,227 -----
! #define nohtonl 
  #ifdef nohtonl	/* if not in library */
  /*
   * "Host" to "net" byte order swappers.
--------------------------
cmd: rmaker.c -- undef VAX, undef nohtonl;
	this kind of stuff belongs 
	in the makefile, not in the g-dd--n source!!!;
	besides, cpp defines vax, sun, whathaveyou...
--------------------------
*** cmd/rmaker.c	Wed Jul 18 22:45:54 1984
--- cmd/rmaker.c.orig	Thu Jul 19 03:06:33 1984
***************
*** 490,497
  	printf("\n");
  }
  
! /*#define VAX*/
! /*#define nohtonl*/
  #ifdef nohtonl	/* if not in library */
  #ifdef	VAX
  /*

--- 490,498 -----
  	printf("\n");
  }
  
! 
! #define VAX
! #define nohtonl
  #ifdef nohtonl	/* if not in library */
  #ifdef	VAX
  /*

--------------------------
cc/cmd:
	ld: rl68.c -- bitfields don't work as array indices on sun.
	    when stanford/lucas versions were merged, the good ideas
	    from lucasfilm were commented out, with #ifdef STANFORD around
	    the old crufty code.  Checking for ar headers !<arch> should
	    be done as a string compare rather than as an integer.
	as: changes below required for the sun, should be done on the vax
		as well; I have no idea how it manages to work on the vax as
		it is.  The code uses twice as much space as is allocated in
		the Code array, but bug only gets exercised on 8 or 10 byte
		instructions, which are not too common.
	as: ins.c, print.c, ps1.c, rel.c -- WCode changed from int * to short *
	as: ps1.c -- ByteWord fixed for Which == 1, to fix quoted strings
	as: rel.c -- byte swapping code in PutWords changed to work
		with shorts instead of longs;
		#ifdef BOOTSTRAP changed to #ifndef sun, as we want BOOTSTRAP
		to mean create .b and b.out files rather than .o and a.out;
		this code should be replaced by htons().
--------------------------
diff -r cmd.orig/makefile cc/cmd/makefile
6c6
< DESTDIR= /usr/stanford/bin
---
> DESTDIR= /usr/local/bin
8c8
< sun-commands: dll dlx cc68 compiler assembler loader 
---
> sun-commands: compiler assembler loader # dll dlx cc68 
13,14c13,14
< install: $(DESTDIR)/dll $(DESTDIR)/dlx $(DESTDIR)/cc68 \
<  install-compiler install-assembler install-loader $(DESTDIR)/lorder68
---
> install: install-compiler install-assembler install-loader $(DESTDIR)/lorder68 \
> # $(DESTDIR)/dll $(DESTDIR)/dlx $(DESTDIR)/cc68 
diff -r cmd.orig/as/ins.c cc/cmd/as/ins.c
22c22
< int	*WCode = (int *)Code;
---
> short	*WCode = (short *)Code;
diff -r cmd.orig/as/makefile cc/cmd/as/makefile
15c15
< init.o ins.c: mical.h inst.h
---
> init.o ins.o: mical.h inst.h
18c18
< 	cp as68 /usr/stanford/bin/as68
---
> 	cp as68 /usr/local/bin/as68
diff -r cmd.orig/as/print.c cc/cmd/as/print.c
4c4
< extern int *WCode;
---
> extern short *WCode;
diff -r cmd.orig/as/ps1.c cc/cmd/as/ps1.c
51c51
< 	short *WCode = (short *)&Code[0];
---
> 	int *WCode = (int *)&Code[0];
70c70
< 		} else if (Which == 2) {
---
> 		} else
72,74d71
< 		} else {
< 			Code[0] = Operand.value_o;
< 		}
76c73
< 			Put_Text(Code, Which);
---
> 			Put_Text(WCode, Which);
diff -r cmd.orig/as/rel.c cc/cmd/as/rel.c
118c118
< 	extern int *WCode;		/* buffer for code in ins.c */
---
> 	extern short *WCode;		/* buffer for code in ins.c */
149c149
< #ifdef BOOTSTRAP
---
> #ifndef sun
152c152
< 	  {tcode[i++] = code[j++]; tcode[i++]=code[j++];j+=2;}
---
> 	  {tcode[i++] = code[j++]; tcode[i++]=code[j++];}
160c160
< 	  {j+=2; tcode[i++] = code[j++];tcode[i++]=code[j++];}
---
> 	  {tcode[i++] = code[j++];tcode[i++]=code[j++];}
diff -r cmd.orig/c2/makefile_t cc/cmd/c2/makefile_t
16c16
< 	cp c268 /usr/stanford/bin
---
> 	cp c268 /usr/local/bin
diff -r cmd.orig/ccom/makefile_t cc/cmd/ccom/makefile_t
12c12
< BINDIR	= 	/usr/stanford/bin
---
> BINDIR	= 	/usr/local/bin
diff -r cmd.orig/ld/Makefile cc/cmd/ld/Makefile
5,6c5,6
< BIN = /usr/stanford/bin
< INCLUDE = /usr/sun/include
---
> BIN = /usr/local/bin
> INCLUDE = /usr/include/mac
diff -r cmd.orig/ld/rl68.c cc/cmd/ld/rl68.c
307a308
> 	int n;
312,313c313,316
< 	seg = "TDBE"[rcmd.rsegment];
< 	size = "BWL?"[rcmd.rsize];
---
> 	n = rcmd.rsegment;
> 	seg = "TDBE"[n];
> 	n = rcmd.rsize;
> 	size = "BWL?"[n];
--------------------------
cc/libc: changed makefile and sunstuff/makefile to avoid missing include files
	in emt and sunstuff.
	(sunemt.h in emt/*; nec7201.h, timer.h & vectors.h in sunstuff/ttyio.c)
	This makes it impossible to use sprintf, etc; undefined globals.
========

pp defines vax, sun, whathaveyou...
--------------------------
*** cmd/rmaker.c	Wed Jul 18 22:45:54 1984
--- cmd/rmaker.c.orig	Thu Jul 19 03:06:33 1984
***************
*** 490,497
  	printf("\n");
  }
  
! /*#define VAX*/
! /*#define nohtonl*/
  #ifdef nohtonl	/* if not in library */
  #ifdef	VAX
  /*

--- 490,498 -----
  	printf("\n"sumacc/etc/port   444      0     12       37175  3470501344   7020 From ddj@csnet-relay.csnet Mon Jul 30 01:51:45 1984
Received: from csnet-relay by safe with TCP; Mon, 30 Jul 84 01:51:34 pdt
Received: From brown.csnet by csnet-relay;  29 Jul 84 18:23 EDT
Message-Id: <8407292216.AA29989@nancy.Brown.CSNet>
Date:     29 Jul 84 (Sun) 18:16:10 EDT
From: Dave Johnson <ddj%brown.csnet@csnet-relay.arpa>
To: croft@su-safe.arpa
Subject:  porting cc68 to 4.2 sun
Status: RO

I got most of the c environment running on the suns (about 10 hours
chasing down byte-swapping and bitfield problems).  I'm missing one
include file that seems necessary for using sprintf, etc, and a couple
more that don't look quite as useful for the mac.  Could you send me:

	sunemt.h -- needed for emt_putchar, etc in libc/emt directory

	nec7201.h \
	timer.h    > -- needed to compile the libc/sunstuff directory
	vectors.h /

The assembler was the hardest to debug; as far as I can tell, the
code is just plain wrong:  it allocates an array of shorts, then 
uses an int pointer to step through it.  Later there is some hacked
up code that "skips over garbage bytes" when the code is emitted,
which reduces to byte-swapping when the array is declared as short
instead.

libmake.c had some problems with bitfields.  Might it not be better
to just use the b.out.h declarations, rather than try to second guess
how the compiler will allocate the bits?

Anyhow, here are the notes and diffs . . . I'm also sending these
to Alan Crosswell at Columbia, as I believe he's trying a port to
the 370 (or amdahl).

all:	(in makefile_t, makefile, or Makefile)
    /usr/sun/include -> /usr/include/mac, /usr/stanford/bin -> /usr/local/bin
	
lib: libmake.c -- different bitfield order in struct breloc, undef nohtonl
--------------------------
*** lib/libmake.c	Wed Jul 18 22:34:36 1984
--- lib/libmake.c.orig	Thu Jun  7 02:29:33 1984
***************
*** 67,75
  };
  
  struct breloc brtrap = {
- #ifdef sun
- 	RLONG<<12 | REXT<<14, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
- #else
  	RLONG<<2 | REXT, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
- #endif
  };

--- 67,72 -----
  };
  
  struct breloc brtrap = {
  	RLONG<<2 | REXT, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
  };
  struct breloc brext = {
***************
*** 74,82
  #endif
  };
  struct breloc brext = {
- #ifdef sun
- 	RLONG<<12 | REXT<<14, 2, 10	/* relocate stubaddr, sym 2, offset 10 */
- #else
  	RLONG<<2 | REXT, 2, 10	/* relocate stubaddr, sym 2, offset 10 */
- #endif
  };

--- 70,75 -----
  	RLONG<<2 | REXT, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
  };
  struct breloc brext = {
  	RLONG<<2 | REXT, 2, 10	/* relocate stubaddr, sym 2, offset 10 */
  };
  
***************
*** 232,235
! /* #define nohtonl */
  #ifdef nohtonl	/* if not in library */
  /*
   * "Host" to "net" byte order swappers.

--- 221,227 -----
! #define nohtonl 
  #ifdef nohtonl	/* if not in library */
  /*
   * "Host" to "net" byte order swappers.
--------------------------
cmd: rmaker.c -- undef VAX, undef nohtonl;
	this kind of stuff belongs 
	in the makefile, not in the g-dd--n source!!!;
	besides, cpp defines vax, sun, whathaveyou...
--------------------------
*** cmd/rmaker.c	Wed Jul 18 22:45:54 1984
--- cmd/rmaker.c.orig	Thu Jul 19 03:06:33 1984
***************
*** 490,497
  	printf("\n");
  }
  
! /*#define VAX*/
! /*#define nohtonl*/
  #ifdef nohtonl	/* if not in library */
  #ifdef	VAX
  /*

--- 490,498 -----
  	printf("\n");
  }
  
! 
! #define VAX
! #define nohtonl
  #ifdef nohtonl	/* if not in library */
  #ifdef	VAX
  /*

--------------------------
cc/cmd:
	makefile: cc68 source is elsewhere, dll and dlx not useful.
	ld: rl68.c -- bitfields don't work as array indices on sun.
	as: changes below required for the sun, should be done on the vax
		as well; I have no idea how it manages to work on the vax as
		it is.  The code uses twice as much space as is allocated in
		the Code array, but bug only gets exercised on 8 or 10 byte
		instructions, which are not too common.
	as: ins.c, print.c, ps1.c, rel.c -- WCode changed from int * to short *
	as: rel.c -- byte swapping code in PutWords changed to work
		with shorts instead of longs;
		#ifdef BOOTSTRAP changed to #ifndef sun, as we want BOOTSTRAP
		to mean create .b and b.out files rather than .o and a.out;
		this code should be replaced by htons().
--------------------------
diff -r cmd.orig/makefile cc/cmd/makefile
6c6
< DESTDIR= /usr/stanford/bin
---
> DESTDIR= /usr/local/bin
8c8
< sun-commands: dll dlx cc68 compiler assembler loader 
---
> sun-commands: compiler assembler loader # dll dlx cc68 -- source elsewhere
13,14c13,14
< install: $(DESTDIR)/dll $(DESTDIR)/dlx $(DESTDIR)/cc68 \
<  install-compiler install-assembler install-loader $(DESTDIR)/lorder68
---
> install: install-compiler install-assembler install-loader $(DESTDIR)/lorder68 \
> # $(DESTDIR)/dll $(DESTDIR)/dlx $(DESTDIR)/cc68 
diff -r cmd.orig/as/ins.c cc/cmd/as/ins.c
22c22
< int	*WCode = (int *)Code;
---
> short	*WCode = (short *)Code;
diff -r cmd.orig/as/makefile cc/cmd/as/makefile
15c15
< init.o ins.c: mical.h inst.h
---
> init.o ins.o: mical.h inst.h
18c18
< 	cp as68 /usr/stanford/bin/as68
---
> 	cp as68 /usr/local/bin/as68
diff -r cmd.orig/as/print.c cc/cmd/as/print.c
4c4
< extern int *WCode;
---
> extern short *WCode;
diff -r cmd.orig/as/ps1.c cc/cmd/as/ps1.c
51c51
< 	int *WCode = (int *)&Code[0];
---
> 	short *WCode = (short *)&Code[0];
diff -r cmd.orig/as/rel.c cc/cmd/as/rel.c
118c118
< 	extern int *WCode;		/* buffer for code in ins.c */
---
> 	extern short *WCode;		/* buffer for code in ins.c */
149c149
< #ifdef BOOTSTRAP
---
> #ifndef sun
152c152
< 	  {tcode[i++] = code[j++]; tcode[i++]=code[j++];j+=2;}
---
> 	  {tcode[i++] = code[j++]; tcode[i++]=code[j++];}
160c160
< 	  {j+=2; tcode[i++] = code[j++];tcode[i++]=code[j++];}
---
> 	  {tcode[i++] = code[j++];tcode[i++]=code[j++];}
diff -r cmd.orig/c2/makefile_t cc/cmd/c2/makefile_t
16c16
< 	cp c268 /usr/stanford/bin
---
> 	cp c268 /usr/local/bin
diff -r cmd.orig/ccom/makefile_t cc/cmd/ccom/makefile_t
12c12
< BINDIR	= 	/usr/stanford/bin
---
> BINDIR	= 	/usr/local/bin
diff -r cmd.orig/ld/Makefile cc/cmd/ld/Makefile
5,6c5,6
< BIN = /usr/stanford/bin
< INCLUDE = /usr/sun/include
---
> BIN = /usr/local/bin
> INCLUDE = /usr/include/mac
diff -r cmd.orig/ld/rl68.c cc/cmd/ld/rl68.c
307a308
> 	int n;
312,313c313,316
< 	seg = "TDBE"[rcmd.rsegment];
< 	size = "BWL?"[rcmd.rsize];
---
> 	n = rcmd.rsegment;
> 	seg = "TDBE"[n];
> 	n = rcmd.rsize;
> 	size = "BWL?"[n];
--------------------------
cc/libc: changed makefile and sunstuff/makefile to avoid missing include files
	in emt and sunstuff.
	(sunemt.h in emt/*; nec7201.h, timer.h & vectors.h in sunstuff/ttyio.c)
	sunemt.h is needed for some of the standard io stuff (sprintf, etc).

:w cc.bugs

From MIKES@CIT-20 Wed Jul 25 10:09:35 1984
Received: from CIT-20.ARPA by safe with TCP; Wed, 25 Jul 84 10:09:29 pdt
Date: 25 Jul 1984 1007-PDT
Subject: SUMACC on Methus' 68k
From: Mike Schuster <MIKES@CIT-20.ARPA>
To: croft@SU-SAFE.ARPA
Status: RO

Bill,
  Here are the changes I made to get SUMACC running on our Methus 68k 
workstation.  The first fixes machine dependent code in as68 associated with
the ".byte" command.  The second fixes machine dependent initializations
in lib/libmake.c.  You may want to delete the printf's.  I've been using
them to get list of trapcodes (after filtering with sort).  Thanks.

Mike

diff cc/cmd/as/ps1.c- cc/cmd/as/ps1.c
--------
72a73
> #ifdef	BOOTSTRAP
73a75,77
> #else
> 			Put_Text(((char *)WCode) + 3, Which);
> #endif
--------

diff lib/libmake.c- lib/libmake.c
--------
69,74c69,70
< struct breloc brtrap = {
< 	RLONG<<2 | REXT, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
< };
< struct breloc brext = {
< 	RLONG<<2 | REXT, 2, 10	/* relocate stubaddr, sym 2, offset 10 */
< };
---
> struct reloc brtrap;
> struct reloc brext;
95a92,103
> 
> 	brtrap.rsegment = REXT;		/* _mactrap is an external symbol */
> 	brtrap.rsize = RLONG;		/* long field */
> 	brtrap.rdisp = 0;		/* not a displacement */
> 	brtrap.rsymbol = 0;		/* _mactrap is symbol 0 */
> 	brtrap.rpos = 2;		/* offset 2 in text segment */
> 	brext.rsegment = REXT;		/* stub is an external symbol */
> 	brext.rsize = RLONG;		/* long field */
> 	brext.rdisp = 0;		/* not a displacement */
> 	brext.rsymbol = 2;		/* stub is symbol 2 */
> 	brext.rpos = 10;		/* offset 10 in text segment */
> 
137a146
> 		printf("%4x %s\n", (atoi(trap)>>16)&0xFFFF, label);
142a152
> 		printf("%s %s\n", trap, label);
224a235
> /* #define VAX */
231a243
> #ifdef	VAX
238a251,253
> #else
> 	return (a);
> #endif
244a260
> #ifdef	VAX
253a270,272
> #else
> 	return (a);
> #endif
--------
-------

(Message inbox:11)
Return-Path: <@SUMEX-AIM.ARPA:bob%basser.OZ@decwrl>
Received: from SUMEX-AIM.ARPA by safe with TCP; Mon, 6 Aug 84 04:26:06 pdt
Received: from decwrl.ARPA by SUMEX-AIM.ARPA with TCP; Mon 6 Aug 84 04:25:44-PDT
Received: by decwrl.ARPA (4.22.01/4.7.33)
	id AA16327; Mon, 6 Aug 84 04:25:10 pdt
From: bob%basser.OZ@decwrl.ARPA
Return-Path: <decvax!mulga!bob@basser.OZ>
Received: by decvax.UUCP (4.12/1.0)
	id AA20060; Mon, 6 Aug 84 07:13:23 edt
Message-Id: <8408061113.AA20060@decvax.UUCP>
Received: by mulga.OZ (4.3)
	id AA11365; Sun, 5 Aug 84 23:40:41 EST
Date: Sun, 5 Aug 84 21:40:25 EST
To: croft%sumex.stanford%mulga.OZ@decwrl.ARPA,
        croft%sumex.arpa%mulga.OZ@decwrl.ARPA
Subject: SUMAC stuff
Status: RO


Glenn Trewitt suggested I let you know what we have done with the sumacc
distribution that you gave him for us.

We (University of Sydney, CS Dept) are running our own version of UNIX
on a pair of VAX780's. It developed originally from 32V and later from
System III, it is VERY different from BSD4.x.
We are closer to System V than BSD4.2.

I had two problems getting the Sumacc software running - one minor, one
major. The minor one was that some library include files were not in the
expecte directories, this was trivial to fix. The other problem was that
the loader and assembler assumed that the "a" mode of opening a file
positioned the file at the end at open time BUT if the file was
repositioned before being written on, the write would not necessarily
occur at the end of the file. Unfortunately, in our system opening a
file "a" means that EVERY write puts the data at the end of the file,
regardless of any lseeks done in the mean time.

The second problem took me considerable time to find!!

Both the loader and assembler are affected. The fix is trivial. The "a"
opens occur immediately after opening the same file "w", thus truncating
the file anyway. The "a"'s were changed to "w"'s and the problem was
fixed!

My only remaining, minor problem is that I can't get rid of the "little
picture of the sea" icon for C programs on the Mac. I put my own icon
bit pattern in the resource file, set the bundle bit on the file when it
got to the Mac but the "sea" still appears! This is not helped by the
non-arrival of my copy of "Inside Macintosh". Please don't expend any
thought on this problem - the answer probably lies in IM and I'll fix it
eventually.

I would be willing to act as a redistributor of Sumacc for Australia if
you want. I have had several requests (including one from Wollongong).

Glenn has also asked that we be put on the info-mac mailing list. I will
relay messages to others interested in Macs in Australia.

Regards,
Bob Kummerfeld
Computer Science Dept,
University of Sydney
Australia

(Message mcu:5)
Return-Path: <unisoft!normac!stephen@Berkeley>
Received: from UCB-VAX.ARPA by safe with TCP; Thu, 23 Aug 84 19:09:39 pdt
Received: by UCB-VAX.ARPA (4.24/4.33)
	id AA07719; Thu, 23 Aug 84 19:07:53 pdt
Date: Thu, 23 Aug 84 19:07:53 pdt
From: unisoft!normac!stephen@Berkeley
Message-Id: <8408240207.AA07719@UCB-VAX.ARPA>
To: CROFT@SAFE.ARPA
Subject: Sumacc on Unisoft
Cc: stephen@Berkeley

Mail received - thanks.  Help much appreciated. 
I read "fa.info-mac" on USENET (not ARPA) but any other info is welcome.
I'm prepared to assist anyone with a Unisoft system III or V
and have access to 4.1 VAX, 4.2 Suns, Lisa-2 also.
Stephen Lewis.
("ucbvax!unisoft!normac!stephen@BERKELEY")




Sorry for the delay, I've been busy.

  This is not meant to be criticism - just for reference. I refer to a
  target environment of a 68000 running Unisoft System 3 as "mine" and
  the original as "yours".
  First my system does not have symbol table entries as long as yours
  hence name conflicts. These derive from Lisa Pascal which allows 8.
  Solution a bunch of "foomung.h" files in the "foo.h's".

You'd be better off putting flexnames in your compiler system.  You'll
certainly have to warn users about this one.

  Second my "cc -S" syntax differs from yours. Hence "sed" script doesn't
  work. Specific difficulty mine defaults to hex for parms yours to
  decimal. 
  Third my "as" knows not ".macro", ".blockb", ".insrt". Also uses "0x1234" not
  "/1234". Hence need to run through "sed" and use "m4" instead thus
  preserving usefulness of include files and macros but making more
  general. My "as" uses ".comm" and lets the loader resolve addresses.
  Fourth since I wanted to use standard local ".o's" and archives
  I had to change "libmake" considerably to use "a.out.h" and "ar.h"
  which differ from yours. Also had to read hex values from
  library fragments. You did a good job of "htons" byte swapping but
  there is a problem in libmake (the bit fields in the reloc data
  does this work on your 68000 ? - you changed them but its still not
  right on my 68000 compiler It depends how compiler allocates bits).

Have I mailed you the notes from some other port-er's?  I'll send
it in the next letter.

  Fifth my "ld" has different flags.
  Sixth I had to write a local version of "mklint" since lint passes
  and lint libraries are all in different places.
  I am happy to say that "rmaker" works as is. Though I had to add some
  debug code to find out what "impossible relocation" meant.
  Well thats all that comes to mind right now - if you get any
  System 3 or 5 questions feel free to give them my name. Now to my
  questions:
  1/ Please tell me what name you get from "nm68 test.o" if
  you a/ compile b/ assemble the following:
  /* test.c */
  foo()
  {
  };
  /* end */
  | test.s
  	.globl	bar
  bar:
  | end
  On my system I get "_foo" from "cc" and "bar" from "as" I suspect
  that you get "foo" from "cc68" and "_bar" from "as68". This has given
  me some confusion. And difficulty getting names to resolve themselves
  in the library.

Nope.  I get "foo" and "bar", no leading underscores are automatically
prefixed.  Perhaps youre confused by the underscore convention I chose
myself for the stub files.

  2/ My "as" is pretty dumb it only knows what "cc" feeds it. It could
  assemble several things in your sources e.g.
  "moveml	#D0+D1+A0+A1,sp@" - I fixed this with equates
  for "D0" etc does yours "know" this construct?

They are just equates in this assembler also.

  "movq	#[ioqelsize/2]-1,d0" - mine knows "+, -, *" but, alas
  not "/" for operand arithmetic. I did this one at run time.
  Here is the problem:
  	btst	d0,sp@(0,d1)	
  	bclr	d0,sp@(0,d1)
  	bset	d0,sp@(0,d1)

1044    00 02F4  0101                                     btst    d0,sp@(0,d1)
1111    00 0360  0181                                     bclr    d0,sp@(0,d1)
1114    00 0364  01C1                                     bset    d0,sp@(0,d1)

  I am not sure of this addressing mode *please* assemble these
  three instructions for me and give me the code from your "as68".
  3/ Right now there is only "sane.s" that I have not got
  assembled - here is the problem:
  	fbne
  	fbo
  	fbgt
  	fbu

These are defined as macros in ../h/sanemacs.h

  all appear as opcodes - these are not known to my "as" and not in
  my Motorola book either (at least not these names). What are they?
  Are they "fast" branches? Or "far" branches? Hope they are not
  "floating" branches. Please feed them to your "as68" and send
  me the output.

I did receive this twice, sorry again for the delay...

 welcome.
I'm prepared to assist anyone with a Unisoft system III or V
and have access to 4.1 VAX, 4.2 Suns, Lisa-2 also.
Stephen Lewis.
("ucbvax!unisoft!normac!stephen@BERKELEY")




Sorry for the delay, I've been busy.

  This is not meant to be criticism - just for reference. I refer to a
  target environment of a 68000 running Unisoft System 3 as "mine" and
  the original as "yoursumacc/fix/   775      0     12           0  3470501346   6010 sumacc/fix/14   444      0     12        4162  3470501345   6242 Return-Path: <@seismo.ARPA:rlgvax!guy@seismo>
Received: from seismo.ARPA by safe with TCP; Wed, 17 Oct 84 10:21:34 pdt
Return-Path: <rlgvax!guy>
Received: from rlgvax.UUCP by seismo.ARPA with UUCP; Tue, 16 Oct 84 13:59:22 EDT
Received: by rlgvax.UUCP; Tue, 16 Oct 84 13:45:11 EDT
Date: Tue, 16 Oct 84 13:45:11 EDT
From: Guy Harris <rlgvax!guy@seismo.ARPA>
Message-Id: <8410161745.AA04336@rlgvax.UUCP>
To: seismo!croft@safe
Subject: Re:  MIT C compiler bug fix

Here's the article (not posted by me), which had the code fragment in
question:

	Recent articles have noted that some 68000 C compilers produce bogus
	"Invalid Operand" messages when compiling a program like:

		#define MAXLLEN 80

		struct line {
			char    len;
			char    flags;
			char    l[MAXLLEN];
		};

		_fixlines() {
			register struct line *	lp;
			register char *		p;

			lp->len = p + 1 - lp->l;
		}

The symptom is that it produces a byte move into an address register;
"move.b	<something>,aN" or whatever the MIT assembler equivalent is.
Here's the fix; we use a modified MIT assembler which accepts Motorola
assembler syntax, so your compiler should have a different syntax for the
generated code if you use the vanilla MIT assembler:

In "table.c", before the table entry that reads something like

	ASSIGN,	INAREG|FOREFF|FORCC,
		EAA,	TSCALAR|TFLOAT,
		EA,	TSCALAR|TFLOAT,
			0,	RLEFT|RRIGHT|RESCC,
			"	moveZB	AR,AL\nT",

put an entry that reads like

	ASSIGN,	INAREG|FOREFF|FORCC,
		EAA,	TCHAR,
		SBREG|STBREG,	TCHAR,
			NAREG|NASR,	RLEFT|RRIGHT|RESCC,
			"	move.l	AR,A1\n	moveZB	A1,AL\nT",

(your mileage and exact entries may differ).  This entry forces a move of
a "char" into a "B register" (which is an address register) to proceed
first by moving the character into a scratch "A register" (data register)
and then move the data register into the address register.

This fix is thanks to somebody at MIT named, I believe, Jonathan something-
or-other, and was posted in response to an article from Steve Kramer mentioning
the bug.  (Apologies to Jonathan X, but I don't have the article any more
and don't remember his name.)

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy

he library.

Nope.  I get "foo" and "bar", no leading underscores are automatically
prefixed.  Perhaps youre confused by the underscore convention I chose
myself for the stub files.

  2/ My "as" is pretty dumb it only knows what "cc" feeds it. It could
  assemble several things in your sources e.g.
  "moveml	#D0+D1+A0+A1,sp@" - I fixed this with equates
  for "D0" etc does yours "know" this consumacc/fix/3   444      0     12        4233  3470501345   6157 Return-Path: <sdcsvax!dcdwest!ed@Nosc>
Received: from nosc.ARPA by safe with TCP; Tue, 24 Jul 84 23:38:10 pdt
Received: from cod.ARPA by nosc.ARPA (4.12/4.7)
	id AA05870; Tue, 24 Jul 84 23:35:44 pdt
Received: by cod.ARPA (4.12/4.7)
	id AA15158; Tue, 24 Jul 84 23:36:19 pdt
Received: by sdcsvax.UCSD; Tue, 24 Jul 84 22:56:24 pdt
Date: Tue, 24 Jul 84 20:50:46 pdt
Message-Id: <8407250350.AA22231@dcdwest.ITT>
Received: from dcdwest2.ITT (dcdwest2.ARPA) by dcdwest.ITT; Tue, 24 Jul 84 20:50:47 pdt
To: croft@safe
Subject: An interesting inconsistence in the MIT C compiler
Status: RO

I just spent 4 hours chasing a problem that turn out
to be if not a bug at least an inconsistency in the MIT
C compiler.  I had code that I had compiled and run on a
SUN workstation using the SUN version of the C compiler (based
on the MIT C compiler).  Today I tried to compile it on the
vax using the MIT C compiler.  The following shows the
problem.

     1	main()
     2	{
     3		register char *pnt;
     4		char *cpnt;
     5		*pnt++;
     6		pnt++;
     7		*cpnt++;
     8		cpnt++;
     9	}


I admit that lines 5 and 7 are somewhat stange, but I believe
they are legal C expressions.
The MIT C compiler generated the following code:

	.data
	.text
	.globl	main
main:
	link	a6,#-_F1
	moveml	#_S1,a6@(-_F1)
| A1 = 8
|	line 5, file 
|	line 6, file 
	addql	#1,a5
|	line 7, file 
	addql	#1,a6@(-4)
|	line 8, file 
	addql	#1,a6@(-4)
	bra	.L12
.L12:	moveml	a6@(-_F1),#8192
	unlk	a6
	rts
_F1 = 8
_S1 = 8192
| M1 = 0
	.data

Note that it does not generate any code for line 5 in the
C program.  I assume that somehow it desides that since we are
dealing with a destination with no source, that it can ignore
the expression.  However it only does it if the pointer is a
register. When the pointer is on the stack, it increments it.

Just for comparison, here is the code generated on by the SUN
compiler.  Note that it increments the pointer for all cases.

LL0:
	.data
	.text
|#PROC# 04
	.globl	_main
_main:
	link	a6,#0
	addl	#-LF12,sp
	moveml	#LS12,sp@
	addql	#1, a5
	addql	#1,a5
	addql	#1,a6@(-4)
	addql	#1,a6@(-4)
	jra	LE12
LE12:
	moveml	sp@,#LS12
	unlk	a6
	rts
   LF12 = 8
	LS12 = 0x2000
	LT12 = 0x4
	LP12 =	8
	.data

, no leading underscores are automatically
prefixed.  Perhaps youre confused by the underscore convention I chose
myself for the stub files.

  2/ My "as" is pretty dumb it only knows what "cc" feeds it. It could
  assemble several things in your sources e.g.
  "moveml	#D0+D1+A0+A1,sp@" - I fixed this with equates
  for "D0" etc does yours "know" this consumacc/fix/symtsz   444      0     12         607  3470501345   7347 Return-Path: <croft>
Date: Tue, 6 Nov 84 09:24:50 pst
From: Bill Croft <croft@safe>
Subject: SUMacC C Compiler (ccom) symbol table fix:
To: cal@star, croft@safe

in file ccom/manifest,  change the #define for SYMTSZ from
800 to 1600.  Then recompile.
Only files that reference this symbol are pftn, scan, trees, xdefs,
if you want to save some CPU cycles instead of recompiling everything.

31@dcdwest.ITT>
Received: from dcdwest2.ITT (dcdwest2.ARPA) by dcdwest.ITT; Tue, 24 Jul 84 20:50:47 pdt
To: croft@safe
Susumacc/fix/cur   444      0     12           3  3470501345   6515 13
urn-Path: <croft>
Date: Tue, 6 Nov 84 09:24:50 pst
From: Bill Croft <croft@safe>
Subject: SUMacC C Compiler (ccom) symbol table fix:
To: cal@star, croft@safe

in file ccom/manifest,  change the #define for SYMTSZ from
800 to 1600.  Then recompile.
Only files that reference this symbol are pftn, scan, trees, xdefs,
if you want to save some CPU cycles instead of recompiling everything.

31@dcdwest.ITT>
Received: from dcdwest2.ITT (dcdwest2.ARPA) by dcdwest.ITT; Tue, 24 Jul 84 20:50:47 pdt
To: croft@safe
Susumacc/fix/10   444      0     12        3376  3470501346   6245 Return-Path: <CROFT@SUMEX-AIM.ARPA>
Received: from SUMEX-AIM.ARPA by safe with TCP; Tue, 14 Aug 84 17:56:22 pdt
Date: Tue 14 Aug 84 17:55:10-PDT
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [utcsrgv!dciem!mmt: bug fix for macget]
To: croft@SUMEX-AIM.ARPA

Mail-From: PATTERMANN created at 14-Aug-84 16:32:52
Return-Path: <utcsrgv!dciem!mmt@uw-beaver>
Received: from uw-beaver by SUMEX-AIM.ARPA with TCP; Mon 13 Aug 84 22:48:40-PDT
Date: 13 Aug 84 22:47:36 PDT (Mon)
From: utcsrgv!dciem!mmt
Received: by uw-beaver.arpa (3.346/1.9)
	id AA14008; 13 Aug 84 22:47:36 PDT (Mon)
Return-Path: <utcsrgv!dciem!mmt>
Message-Id: <8408140547.AA14008@uw-beaver.arpa>
To: utcsrgv!uw-beaver!info-mac
Subject: bug fix for macget
ReSent-date: Tue 14 Aug 84 16:32:52-PDT
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;

I complained about difficulty using macget with V7 a little while ago.
It turns out that the problem is an insufficient character timeout.
The symptom was that part of a file would be transferred, and then the
program (macget) would abort, and a packet would go to the parent process,
which might cause a logout.  After a while, the Mac would report an I/O
error 1.

The correction is to set the define CHRTIMO to 2 instead of 1. (3 might be
safer, but I have had good success with 2, whereas at 1 I almost never
could pass more than 3-6K of a file.

There is another potential bug in macget, but I don't know whether it is
a real one.  In the recv_file routine, case ACK, tputc(ACK) should be
just before the break (ie after fwrite(buf,n,1,outf).

The version of macget intended to be portable and to work with Beta releases
of MacTerminal works well on 4.2 and V7 systems with the changed CHRTIMO.
It worked on neither with CHRTIMO set to 1.


-------

ck, it increments it.

Just for comparison, here is the code generated on by the SUN
compiler.  Note that it increments the pointer for all cases.

LL0:
	.data
	.text
|#PROC# 04
	.globl	_main
_main:
	link	a6,#0
	addl	#-LF12,sp
	moveml	#LS12,sp@
	addql	#1, a5sumacc/fix/13   444      0     12        3014  3470501346   6235 Return-Path: <ron%vogon%udel-cc-relay.delaware@udel-relay.ARPA>
Received: from udel-relay by safe with TCP; Sun, 30 Sep 84 16:21:53 pdt
Received: From udel-dewey.ARPA by udel-relay.ARPA id a021999
          ;30 Sep 84 19:24 EDT
Received: From vogon.DELAWARE by udel-dewey.DELAWARE id a008677
          ;30 Sep 84 19:24 EDT
Received: by vogon.cc.delaware.arpa (4.12/4.7)
	id AA08732; Sun, 30 Sep 84 19:21:01 edt
Date: Sun, 30 Sep 84 19:21:01 edt
From: Ron Reisor <ron%vogon%vogon%udel-cc-relay.delaware@udel-relay.ARPA>
Message-Id: <8409302321.AA08732@vogon.cc.delaware.arpa>
To: croft@su-safe.ARPA

Hi Bill,

     Have you seen a problem with the cc68 compiler generating bad code
when you take the difference of two pointers, which should yield an int,
and then try to store this int in a char?  It seems that the cc68 compiler
generates the differenct in an a register, then tries to 'movb' from the
a reg into wherever the char is.  The 68k can't do this and as68 knows it.
It seems to me if you ever to a 'pointer minus pointer' then the result
should be in a d register because it's now data and not an address.  I
added a couple of lines to ccom/table.c to handle this special case:

344a345,350
> MINUS,		INAREG|INTAREG,
> 	SBREG,	TPOINT,
> 	EA,	TPOINT,
> 		NAREG|NASL,	RESC1,
> 		"\tsubl\tAR,AL\n\tmovl\tAL,A1 | new pointer-pointer is d\n",
> 

	 Now, this seems to make MY program compile ok, but I do have a feeling
that I don't quite know what I'm doing.  Do you, by any chance, know of
a better fix?

Ron Reisor
ron%udel-cc-relay@udel

then the
program (macget) would abort, and a packet would go to the parent process,
which might cause a logout.  After a while, the Mac would report an I/O
error 1.

The correction is to set the define CHRTIMO to 2 instead of 1. (3 might be
safer, but I have had good success with 2, whereas at 1 I almost never
could pass more than 3-6K of a file.

There is another potential bug in macget, but I don't know whether it is
a real one.  In the recv_file routine, case ACK, tputc(ACK) should be
just besumacc/h/   775      0     12           0  3470501353   5447 sumacc/h/b.out.h   444      0     12        4007  3470501347   6734 /*	This file must be maintained in:
 *
 *		/trix/include/b.out.h
 *		/include/b.out.h
 *
 *	Layout of b.out file :
 *
 *	header of 8 longs	magic number 405, 407, 410, 411
 *				text size		)
 *				data size		) in bytes
 *				bss size		)
 *				symbol table size	)
 *				text relocation size	)
 *				data relocation size	)
 *				entry point
 *
 *
 *	header:			0
 *	text:			32
 *	data:			32+textsize
 *	symbol table:		32+textsize+datasize
 *	text relocation:	32+textsize+datasize+symsize
 *	data relocation:	32+textsize+datasize+symsize+rtextsize
 *
 */
/* various parameters */
#define SYMLENGTH	50		/* maximum length of a symbol */
#define SEGSIZE		32768		/* relocation boundry for 410 files */

/* types of files */
#define	ARCMAGIC 016230236041
#define OMAGIC	0405
#define	FMAGIC	0407
#define	NMAGIC	0410
#define	IMAGIC	0411
#define	RMAGIC	0700200000

/* symbol types */
#define	EXTERN	040
#define	UNDEF	00
#define	ABS	01
#define	TEXT	02
#define	DATA	03
#define	BSS	04
#define	COMM	05	/* internal use only */
#define REG	06

/* relocation regions */
#define	RTEXT	00
#define	RDATA	01
#define	RBSS	02
#define	REXT	03

/* relocation sizes */
#define RBYTE	00
#define RWORD	01
#define RLONG	02

/* macros which define various positions in file based on a bhdr, filhdr */
#define TEXTPOS		sizeof(filhdr)
#define DATAPOS 	TEXTPOS + filhdr.tsize
#define SYMPOS		DATAPOS + filhdr.dsize
#define RTEXTPOS	SYMPOS + filhdr.ssize
#define RDATAPOS	RTEXTPOS + filhdr.rtsize
#define ENDPOS		RDATAPOS + filhdr.rdsize
/* header of b.out files */
struct bhdr {
	long	fmagic;
	long	tsize;
	long	dsize;
	long	bsize;
	long	ssize;
	long	rtsize;
	long	rdsize;
	long	entry;
};

/* symbol management */
struct sym {
	char	stype;
	char	slength;
	long	svalue;
};

/* relocation commands */
struct reloc {
	unsigned rsegment:2;	/* RTEXT, RDATA, RBSS, or REXTERN */
	unsigned rsize:2;		/* RBYTE, RWORD, or RLONG */
	unsigned rdisp:1;		/* 1 => a displacement */
	short rsymbol;		/* id of the symbol of external relocations */
	long rpos;		/* position of relocation in segment */
};

asize+symsize+rtextsize
 *
 */
/* various parameters */
#define SYMLENGTH	50		/* maximum length of a symbol */
#define SEGSIZE		32768		/* relocation boundry for 410 files */

/* types of files */
#define	ARCMAGIC 016230236041
#define OMAGIC	0405
#define	FMAGIC	0407
#define	NMAGIC	0410
#define	IMAGIC	0411
#define	RMAGIC	0700200000

/* symbol types */
#define	EXTERN	040
#define	UNDEF	00
#define	ABS	01
#define	TEXT	02
#define	DATA	03
#define	BSS	04
#define	COMM	05	/* internal use only */
#define REG	06sumacc/h/osintf.h   444      0     12       44704  3470501347   7237 /*	osintf.h	1.0	05/06/84	*/

/*
 * OS interface.
 *
 * Copyright 1983 by Apple Computer, Inc.  All Rights Reserved.
 *
 * C language version Copyright 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 *
 * history
 * 11/23/83	Sebok	Merge of heapzone.text and osmisc
 * 05/06/84	Croft	C language version.
 * 09/29/84	Croft	merged July/Oct supplement changes.
 */


/*for Event Manager*/

#define	everyEvent  	-1
#define	nullEvent   	0
#define	mouseDown   	1
#define	mouseUp     	2
#define	keyDown     	3
#define	keyUp       	4
#define	autoKey     	5
#define	updateEvt   	6
#define	diskEvt     	7
#define	activateEvt 	8
#define	abortEvt    	9
#define	networkEvt  	10
#define	driverEvt   	11
#define	app1Evt     	12
#define	app2Evt     	13
#define	app3Evt     	14
#define	app4Evt     	15

#define	DoubleTime	(*(long *)0x2f0)
#define	CaretTime	(*(long *)0x2f4)

/* event mask equates */
#define	nullMask      	1
#define	mDownMask     	2
#define	mUpMask       	4
#define	keyDownMask   	8
#define	keyUpMask     	16
#define	autoKeyMask   	32
#define	updateMask    	64
#define	diskMask      	128
#define	activMask     	256
#define	abortMask     	512
#define	networkMask   	1024
#define	driverMask    	2048
#define	app1Mask      	4096
#define	app2Mask      	8192
#define	app3Mask      	16384
#define	app4Mask      	0x8000

/* to decipher event message for keyDown events */
#define	charCodeMask	0xFF
#define	keyCodeMask	0xFF00

/* modifiers */
#define	optionKey	2048	/* Bit 3 of high byte */
#define	alphaLock	1024	/* Bit 2 */
#define	shiftKey	512	/* Bit 1 */
#define	cmdKey		256	/* Bit 0 */
#define	btnState	128	/* Bit 7 of low byte is mouse button state */

#define	activeFlag	1	/* bit 0 of modifiers for activate event */
#define	changeFlag	2	/* bit 1 of modifiers for activate event */

/* for PostEvent */

#define	evtNotEnb	1

/* for Memory Manager */

#define	memFullErr   -108  /* Not enough room in heap zone */
#define	nilHandleErr -109  /* Master Pointer was NIL in HandleZone or other   */
#define	memWZErr     -111  /* WhichZone failed (applied to free block)        */
#define	memPurErr    -112  /* trying to purge a locked or non-purgeable block */
#define	noErr        0     /* All is well */

/* file system error codes */

#define	dirFulErr  -33     /* Directory full*/
#define	dskFulErr  -34     /* disk full*/
#define	nsvErr     -35     /* no such volume*/
#define	ioErr      -36     /* I/O error (bummers)*/
#define	bdNamErr   -37     /* there may be no bad names in the final system!*/
#define	fNOpnErr   -38     /* File not open*/
#define	eofErr     -39     /* End of file*/
#define	posErr     -40     /* tried to position to before start of file (r/w)*/
#define	mFulErr    -41     /* memory full(open) or file won't fit (load)*/
#define	tmfoErr    -42     /* too many files open*/
#define	fnfErr     -43     /* File not found*/

#define	wPrErr     -44     /* diskette is write protected*/
#define	fLckdErr   -45     /* file is locked*/
#define	vLckdErr   -46     /* volume is locked*/
#define	fBsyErr    -47     /* File is busy (delete)*/
#define	dupFNErr   -48     /* duplicate filename (rename)*/
#define	opWrErr    -49     /* file already open with with write permission*/
#define	paramErr   -50     /* error in user parameter list*/
#define	refNumErr  -51     /* refnum error*/
#define	gfpErr     -52     /* get file position error*/
#define	volOffLinErr -53   /* volume not on line error (was Ejected)*/
#define	permErr    -54     /* permissions error (on file open)*/
#define	volOnLinErr -55    /* drive volume already on-line at MountVol*/
#define	nsDrvErr   -56     /* no such drive (tried to mount a bad drive num)*/
#define	noMacDskErr -57    /* not a mac diskette (sig bytes are wrong)*/
#define	extFSErr   -58     /* volume in question belongs to an external fs*/
#define	fsRnErr    -59     /* file system rename error:*/
                           /*  during rename the old entry was deleted */
                           /*  but could not be restored . . .*/
#define	badMDBErr  -60     /* bad master directory block*/
#define	wrPermErr  -61     /* write permissions error*/
#define	firstDskErr -84    /*first of the range of low-level disk errors*/
#define	lastDskErr -64     /*last of the range of low-level disk errors*/


#define	maxSize  0x800000  /* Max data block size is 512K bytes  */

/* finder constants */

#define	fHasBundle 8192		/* was 32 */
#define	fInvisible 16384	/* was 64 */
#define	fTrash     -3
#define	fDesktop   -2
#define	fDisk      0

/* io constants */

/* ioPosMode values */
#define fsAtMark	0
#define fsFromStart	1
#define fsFromLEOF	2
#define fsFromMark	3

/* ioPermission values */
#define fsCurPerm	0
#define fsRdPerm	1
#define fsWrPerm	2
#define fsRdWrPerm	3

/* refNums for the serial ports */
#define aInRefNum	-6       /* serial port A input */
#define aOutRefNum	-7       /* serial port A output */
#define bInRefNum	-8       /* serial port B input */
#define bOutRefNum	-9       /* serial port B output */

/* baud rate constants */
#define baud300		380
#define baud600		189
#define baud1200	94
#define baud1800	62
#define baud2400	46
#define baud3600	30
#define baud4800	22
#define baud7200	14
#define baud9600	10
#define baud19200	4
#define baud57600	0

/* SCC channel configuration word */
/* driver reset information masks */
#define stop10		16384
#define stop15		-32768
#define stop20		-16384
#define noParity	8192
#define oddParity	4096
#define evenParity	12288
#define data5		0
#define data6		2048
#define data7		1024
#define data8		3072


/* serial driver error masks */
#define swOverrunErr	0
#define parityErr	16
#define hwOverrunErr	32
#define framingErr	64

/* serial driver message constant */
#define xOffWasSent	0x80

/* for application parameter */
/* constants for message returned by the finder on launch */
#define appOpen		0
#define appPrint	1

/* for sound driver */
#define swMode	-1
#define ftMode	1
#define ffMode	0

/* for disk driver */
#define	currPos	0
#define	absPos	1
#define	relPos	3
#define	rdVerify 64


/* Event Manager */

typedef	struct {		/* EventRecord */
	short	what;
	long	message;
	long	when;
	Point	where;
	short	modifiers;
} EventRecord;


typedef struct {		/* Zone */
	Ptr	bkLim;
	Ptr	purgePtr;
	Ptr	hFstFree;
	long	zCBFree;
	ProcPtr	gZProc;
	short	moreMast;
	short	flags;
	short	cntRel;
	short	maxRel;
	short	cntNRel;
	short	maxNRel;
	short	cntEmpty;
	short	cntHandles;
	long	minCBFree;
	ProcPtr	purgeProc;
	Ptr	sparePtr;
	Ptr	allocPtr;
	short	heapData;
} Zone;

typedef	Zone * THz;


/* general queue data structure */

struct QElem {			/* QElem */
	struct QElem *qLink;
	short	qType;
	char	qData[1];
};
/* qType values */
#define	vType	1		/* VBL queue */
#define	ioQType	2		/* IO queue */
#define	drvType	3		/* driver queue */
#define	evType	4		/* event queue */
#define	fsQType	5		/* file system queue */

typedef struct QElem QElem;
	
typedef struct {		/* QHdr */
	short	qFlags;
	QElem	*qHead;
	QElem	*qTail;
} QHdr;
/* qFlags values */
#define	qInUse	0x80


/* Vertical Blanking Control Block Queue Element */

struct VBLTask {		/* VBLTask */
	struct	VBLTask *qLink;
	short	qType;
	ProcPtr	vblAddr;	/* service routine */
	short	vblCount;	/* for timeout */
	short	vblPhase;	/* phase for synchronization */
};

typedef struct VBLTask VBLTask;
#define	VBLQHdr	((QHdr *) 0x160)


/* Event queue element */

struct EvQEl {
	struct	EvQEl *qLink;
	short	qType;
	short	evtQWhat;	/* remainder identical to EventRecord */
	long	evtQMessage;
	long	evtQWhen;
	Point	evtQWhere;
	short	evtQModifiers;
};

typedef	struct	EvQEl EvQEl;
#define	EvQHdr	((QHdr *) 0x14a)


/* Driver queue element */

struct DrvQEl {
	struct	DrvQEl *qLink;
	short	qType;
	short	dQDrive;
	short	dQRefNum;	/* ref num of drvr to handle this drive */
	short	dQFSID;		/* file system id */
	short	dQDrvSize;	/* size of drive in 512 blocks (but not 1&2) */
};

typedef	struct	DrvQEl DrvQEl;
#define	DrvQHdr	((QHdr *) 0x308)
#define	FSQHdr	((QHdr *) 0x360)
#define	VCBQHdr	((QHdr *) 0x356)


/* IO queue elements */

typedef	struct {		/* ResType / OsType */
	char	s[4];
} ResType;

typedef ResType OsType;

typedef struct {		/* FInfo, finder info */
	OsType	fdType;		/* type of the file */
	OsType	fdCreator;
	short	fdFlags;	/* has bundle,invisible,locked, etc. */
	Point	fdLocation;
	short	fdFldr;		/* folder */
} FInfo;

struct	IOParam {		/* general IO parameter block */
	struct IOParam	*qLink;
	short	qType;		/* = IOQType */
	short	ioTrap;		/* trap code */
	Ptr	ioCmdAddr;	/* address to dispatch to */
	ProcPtr	ioCompletion;	/* completion routine */
	short	ioResult;
	char	*ioNamePtr;	/* vol:filename string */
	short	ioVRefNum;	/* volume refnum (or drvnum) */

	short	ioRefNum;	/* refnum for IO operation */
	char	ioVersNum;	/* version */
	char	ioPermssn;	/* permissions */
	Ptr	ioMisc;		/* misc parameter */
				/* Rename: new name */
                                /* GetEOF,SetEOF: logical end of file*/
                                /* Open: optional ptr to buffer*/
                                /* SetFileType: new type*/
	Ptr	ioBuffer;	/* data buffer */
	long	ioReqCount;	/* requested byte count */
	long	ioActCount;	/* actual byte count on completion */
	short	ioPosMode;	/* initial file positioning */
	long	ioPosOffset;	/* file position offset */
};

typedef struct IOParam IOParam;

struct	FileParam {		/* get/set fileinfo parameter block */
	struct FileParam *qLink;
	short	qType;		/* = IOQType */
	short	ioTrap;		/* trap code */
	Ptr	ioCmdAddr;	/* address to dispatch to */
	ProcPtr	ioCompletion;	/* completion routine */
	short	ioResult;
	char	*ioNamePtr;	/* vol:filename string */
	short	ioVRefNum;	/* volume refnum (or drvnum) */

	short	ioFRefNum;	/* refnum */
	char	ioFVersNum;
	char	filler1;
	short	ioFDirIndex;	/* GetFileInfo directory index */
	char	ioFlAttrib;	/* in-use bin=7 lock bit=0 */
	char	ioFlVersNum;	/* file version number */
	FInfo	ioFlFndrInfo;	/* finder info */
	long	ioFlNum;	/* file number */
	short	ioFlStBlk;	/* start block */
	long	ioFlLgLen;	/* logical length */
	long	ioFlPyLen;	/* physical length */
	short	ioFlRStBlk;	/* resource start block */
	long	ioFlRLgLen;	/* logical length */
	long	ioFlRPyLen;	/* physical length */
	long	ioFlCrDat;	/* creation date/time */
	long	ioFlMdDat;	/* modified date/time */
};

typedef struct FileParam FileParam;

struct	VolumeParam {		/* get/set volumeinfo parameter block */
	struct VolumeParam *qLink;
	short	qType;		/* = IOQType */
	short	ioTrap;		/* trap code */
	Ptr	ioCmdAddr;	/* address to dispatch to */
	ProcPtr	ioCompletion;	/* completion routine */
	short	ioResult;
	char	*ioNamePtr;	/* vol:filename string */
	short	ioVRefNum;	/* volume refnum (or drvnum) */

	long	filler2;
	short	ioVolIndex;	/* volume index number */
	long	ioVCrDate;	/* creation date/time */
	long	ioVLsBkUp;	/* last backup date/time */
	short	ioVAtrb;	/* volume attribute */
	short	ioVNmFls;	/* number of files */
	short	ioVDirSt;	/* start block of directory */
	short	ioVBlLn;	/* length of dir in blocks */
	short	ioVNmAlBlks;	/* number of blocks of alloc size */
	long	ioVAlBLkSiz;	/* alloc blk byte size */
	long	ioVClpSiz;	/* bytes to allocate at a time */
	short	ioAlBlSt;	/* start block (512-byte) in block map */
	long	ioVNxtFNum;	/* next free file number */
	short	ioVFrBlk;	/* # free alloc blocks on this volume */
};

typedef struct VolumeParam VolumeParam;

/* parameters for control (CC) and status (SC) calls*/
/* maximum variant size is 22 bytes*/

typedef union {			/* CSParam */
	/* maximum variant size */
	char	csChar[22];

	/* arbitrary parameter sizes */
	short	csShort;
	long	csLong;

	/*for sound generator*/
	short	sndVal;

	/*for serial driver*/
	short	serConfig;		/* CC=8, stopbits, etc.  */
	struct {			/* CC=9 */
		Ptr	serBPtr;	/* new input buffer */
		short	serBLen;	/* buffer length */
	} serInBuff;
	struct SerShk {			/* CC=10 */
		char	fXOn;		/* XON flow ctl enabled */
		char	fCTS;		/* CTS flow ctl enabled */
		char	xOn;		/* xon char */
		char	xOff;		/* xoff char */
		char	errs;		/* errors mask */
		char	evts;		/* event mask */
		char	fInX;		/* input xon enabled */
		char	null;	
	} serShk;
	long	serNBytes;		/* SC=2, # buffered bytes */
	struct SerStaRec {		/* SC=8, status info */
		char	cumErrs;	/* cum errors */
		char	xOffSent;	/* xoff has been sent */
		char	rdPend;		/* read pending */
		char	wrPend;		/* write pending */
		char	ctsHold;	/* CTS flow hold */
		char	xOffHold;	/* Xoff flow hold */
	} serStaRec;

	/*for printer driver */
	struct {			/* CC=4, printing bitmap */
		long	param1;		/* pnts to quickdraw bitmap */
		long	param2;		/* pnts to rect within bitmap */
		long	param3;		/* 0 for screen printing */
	} printer;
					/* CC=5 writing raw to printer*/
					/* pointer to a byte string*/
					/* count of bytes*/
					/* pointer to an idle proc (or NIL)*/
					/* CC=6 special BitMap cases*/
					/* screen or top folder code*/
	/* for font manager */
	struct {			/* CC=8, tail hook */
		Ptr	fontRecPtr;	/* font mgr input record */
		short	fontCurDev;	/* current device */
	} fontMgr;

	/*for Sony Disk Driver*/
	Ptr	dskBuff;		/* CC=8, set tag buffer */
	struct DrvSts {			/* SC=8, drive status */
		short	track;		/* current track */
		char	writeProt;	/* 0x80 if locked */
		char	diskInPlace;
		char	installed;
		char	sides;		/* 0x80 for 2 sides */
		DrvQEl	drvQEl;		/* drive queue elem */
		short	diskErrs;	/* soft err count */
	} drvSts;

	/* for io driver/desk accessory */
	Ptr	event;			/* pointer to EventRecord */
} CSParam;			/* end union of control status params */

typedef	struct SerShk SerShk;
typedef	struct SerStaRec SerStaRec;
typedef	struct DrvSts DrvSts;

struct	CntrlParam {		/* control and status parameter block */
	struct CntrlParam *qLink;
	short	qType;		/* = IOQType */
	short	ioTrap;		/* trap code */
	Ptr	ioCmdAddr;	/* address to dispatch to */
	ProcPtr	ioCompletion;	/* completion routine */
	short	ioResult;
	char	*ioNamePtr;	/* vol:filename string */
	short	ioVRefNum;	/* volume refnum (or drvnum) */

	short	ioRefNum;	/* refnum for IO operation */
	short	csCode;		/* control and status code */
	CSParam csParam;	/* control and status parameters */
};

typedef struct CntrlParam CntrlParam;


/* 20 bytes of system parameter area */

typedef struct {		/* SysParmType */
	long	valid;		/* hi byte, validation field (0xa7) */
				/* lo 3 bytes, odometer */
	short	portA;		/* port A config */
	short	portB;	
	long	alarm;		/* alarm time */
	short	font;		/* default font id */
	short	kbdPrint;	/* hi byte, kbd repeat */
                                /* high nibble = thresh in 4/60ths*/
                                /* low nibble = rates in 2/60ths*/
                                /* low byte = print stuff*/
	short	volClik;	/* low 3 bits of high byte = volume control*/
                                /* hi nib of low byte = double time in 4/60ths*/
                                /* lo nib of low byte = caret blink in 4/60ths*/
	short	misc;		/* EEEC EEEE PSKB FFHH*/
                                /* E = extra*/
                                /* P = paranoia level*/
                                /* S = mouse scaling*/
                                /* K = key click*/
                                /* B = boot disk*/
                                /* F = menu flash*/
                                /* H = help level*/
} SysParmType;

#define	SysPPtr	((SysParmType *) 0x1f8)


/* master directory block */

struct Direct {
	short	drSigWord;		/* always 0xd2d7 */
	long	drCrDate;		/* date/time of initialization */
	long	drLsBkUp;		/* date/time of last backup */
	short	drAtrb;			/* volume attributes */
#define	DR_INCONSISTENT	0x0007
#define	DR_BUSY		0x0040
#define	DR_HARDLOCK	0x0080
#define	DR_SOFTLOCK	0x8000
	short	drNmFls;		/* # of files in directory */
	short	drDirSt;		/* first logical blk of directory */
	short	drBlLn;			/* # of blocks in directory */
	short	drNmAlBlks;		/* # of allocation blks on volume */
	long	drAlBlkSiz;		/* size of allocation blocks */
	long	drClpSiz;		/* # of bytes to allocate */
	short	drAlBlSt;		/* first logical blk of alloc blk */
	long	drNxtFNum;		/* next unused file number */
	short	drFreeBlks;		/* # of unused alloc blocks */
	char	drVN;			/* length of volume name */
	char	drVName[27];		/* volume name */
};

typedef struct Direct Direct;


/* volume control block per-volume information (incore) */

struct VCB {
	struct	VCB *qLink;
	short	qType;
	short	vcbFlags;
#define	vcbDirty	0x8000
	Direct	vcbD;			/* volume info from master dir blk */
	short	vcbDrvNum;		/* drive num of mounted volume */
	short	vcbDRefNum;		/* driver ref num of mounted vol */
	short	vcbFSID;		/* != 0 => external file system */
	short	vcbVRefNum;		/* volume reference number */
	Ptr	vcbMAdr;		/* ptr to volume block map */
	Ptr	vcbBufAdr;		/* ptr to volume buffer */
	short	vcbMLen;		/* length of volume block map */
	short	vcbDirIndex;
	short	vcbDirBlk;
};

typedef struct VCB VCB;

#define	DefVCBPtr	(*(VCB**) 0x352)	/* default volume */


/* Device control entry */

typedef struct {		/* DCtlEntry */
	Ptr	dCtlDriver;	/* pointer/handle to driver */
	short	dCtlFlags;
	QHdr	dCtlQHdr;	/* driver's IO queue */
	long	dCtlPosition;	/* offset used by R/W calls */
	Handle	dCtlStorage;	/* private storage */
	short	dCtlRefNum;	/* driver's refnum */
	long	dCtlCurTicks;	/* current tick count (kept by Device Mgr) */
	Ptr	dCtlWindow;	/* window record (if any) */
	short	dCtlDelay;	/* ticks between actions */
	short	dCtlEMask;	/* event mask (desk acc) */
	short	dCtlMenu;	/* menu ID */
} DCtlEntry;


/* for Sound Driver */
/* for 4-tone sound generation */

typedef struct {
	char	s[256];
} Wave;

typedef struct {		/* FTSoundRec */
	short	duration;
	long	sound1Rate;
	long	sound1Phase;
	long	sound2Rate;
	long	sound2Phase;
	long	sound3Rate;
	long	sound3Phase;
	long	sound4Rate;
	long	sound4Phase;
	Wave	*sound1Wave;
	Wave	*sound2Wave;
	Wave	*sound3Wave;
	Wave	*sound4Wave;
} FTSoundRec;

typedef struct {		/* FTSynthRec */
	short	mode;
	FTSoundRec *sndRec;
} FTSynthRec;

typedef struct {		/* Tone */
	short	count;
	short	amplitude;
	short	duration;
} Tone;

typedef struct {		/* SWSynthRec */
	short	mode;
	Tone	triplets[5000];
} SWSynthRec;

typedef struct {		/* FFSynthRec */
	short	mode;
	long	count;
	char	waveBytes[30000];
} FFSynthRec;


/* for date and time */
/* date index */

typedef struct {		/* DateTimeRec */
	short	year;		/* (0 is) 1904,1905,... */
	short	month;		/* 1..12 */
	short	day;		/* 1..31 */
	short	hour;		/* 0..23 */
	short	minute;		/* 0..59 */
	short	second;		/* 0..59 */
	short	dayOfWeek;	/* 1..7 (sun..sat) */
} DateTimeRec;


/* application parameters */

typedef struct {		/* AppFile */
	short	vRefNum;
	OsType	fType;
	short	versNum;
	char	fName[1];
} AppFile;


/* Functions returning other than integer */

THz	GetZone(),ApplicZone(),SystemZone(),PtrZone(),HandleZone();
Ptr	TopMem(),NewPtr();
Handle	NewHandle(),RecoverHandle(),GZSaveHnd(),GetDCtlEntry();
= double time in 4/60ths*/
                                /sumacc/h/packintf.h   444      0     12        7430  3470501347   7507 /*	packintf.h	1.0	05/25/84	*/

/*
 * Package definitions.
 *
 * Copyright (C) 1984 Apple Computer Inc.,  Rony Sebok.
 *
 * C language version (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 01/28/84	Sebok	Created.
 * 04/23/84	Croft	Created C version.
 * 10/10/84	Croft	Merged mods from JTC and Rose.
 */


/*constants for Standard File package*/

#define	putDlgID  -3999     /*SFPutFile dialog template ID*/

#define	putSave  1          /*save button*/
#define	putCancel  2        /*cancel button*/
#define	putEject  5         /*eject button*/
#define	putDrive  6         /*drive button*/
#define	putName  7          /*editTExt item for file name*/

#define	getDlgID  -4000     /*SFGetFile dialog template ID*/

#define	getOpen  1          /*open button*/
#define	getCancel  3        /*cancel button*/
#define	getEject  5         /*eject button*/
#define	getDrive  6         /*drive button*/
#define	getNmList  7        /*userItem for file name list*/
#define	getScroll  8        /*userItem for scroll bar*/


/* constants for manipulation of international resources */
/* masks used for setting and testing currency format flags */

#define	currLeadingZ  128   /*set if leading zero*/
#define	currTrailingZ  64   /*set if trailing zero*/
#define	currNegSym  32      /*set if minus sign, reset if brackets for neg num*/
#define	currSymTrail  16    /*set if currency symbol trails, reset if leads*/

/* constants specifying absolute value of short date form */

#define	DMY  1              /*day,month,year*/
#define	YMD  2              /*year,month,day*/
#define	MDY  0              /*month,day,year*/

/* masks used for date element format flags */

#define	mntLdingZ  64       /*set if leading 0 for month*/
#define	dayLdingZ  32       /*set if leading zero for day*/
#define	century    128      /*set if century, reset if no century*/

/* masks used for time element format flags */

#define	hrLeadingZ  128     /*set if leading zero for hours*/
#define	minLeadingZ  64     /*set if leading zero for minutes*/
#define	secLeadingZ  32     /*set if leading zero for seconds*/

/* country codes for version numbers */

#define	verUS		0
#define	verFrance	1
#define	verBritain	2
#define	verGermany	3
#define	verItaly	4
#define	verNetherlands	5
#define	verBelgiumLux	6
#define	verSweden	7
#define	verSpain	8
#define	verDenmark	9
#define	verPortugal	10
#define	verFinland	11
#define	verNorway	12
#define	verIsrael	13
#define	verJapan	14
#define	verAustralia	15
#define	verArabia	16
#define	verFrCanada	17
#define	verSwissFr	18
#define	verSwissGr	19
#define	verGreece	20
#define	verIceland	21
#define	verMalta	22
#define	verCyprus	23
#define	verTurkey	24
#define	verYugoslavia	25

/*Standard File*/

typedef struct {
	char	good;		/* ignore if false */
	char	copy;
	OsType	ftype;		/* file type */
	short	vRefNum;	/* volume refnum */
	short	version;	/* version number */
	char	fName[64];	/* filename, pascal string */
} SFReply;

typedef struct {
	OsType	ftype[4];
	short	junk;
} SFTypeList;


/*interface for international resources*/

typedef struct {
	char	decimalPt;
	char	thousSep;
	char	listSep;
	char	currSym1;
	char	currSym2;
	char	currSym3;
	char	currFmt;
	char	dateOrder;	/* DMY, YMD, or MDY */
	char	shrtDateFmt;	/* date format */
	char	dateSep;
	char	timeCycle;
	char	timeFmt;
	char	mornStr[4];
	char	eveStr[4];
	char	timeSep;
	char	timeSuff[8];
	char	metricSys;
	short	intl0Vers;
} intl0Rec;

/* date formats */
#define	shortDate	0
#define	longDate	1
#define	abbrevDate	2

typedef struct {
	char	days[7][16];		/* pascal strings for Sun - Sat */
	char	months[12][16];
	char	suppressDay;
	char	lngDateFmt;
	char	dayLeading0;
	char	abbrLen;
	char	st[5][4];
	short	intl1Vers;
	short	localRtn;	/* local magnitude compare routine
				   starts here (0x4e75 for rts) */
} intl1Rec;

Handle	IUGetIntl();
4/23/84	Croft	Created C version.
 * 10/10/84	Croft	Merged mods from JTC and Rose.
 */


/*constants for Standard File package*/

#define	putDlgID  -3999     /*SFPutFile dialog template ID*/

#define	putSave  1          /*save buttonsumacc/h/quickdraw.h   444      0     12       13361  3470501347   7722 /*	quickdraw.h	1.0	04/23/84	*/

/*
 * Quickdraw definitions.
 *
 * Copyright (C) 1983 Apple Computer Inc.
 *
 * C language version (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*  Written by Bill Atkinson   */

/*
 * history
 * 04/23/84	Croft	Created C version.
 */

#define	srcCopy      0  /* the 16 transfer modes */
#define	srcOr        1
#define	srcXor       2
#define	srcBic       3
#define	notSrcCopy   4
#define	notSrcOr     5
#define	notSrcXor    6
#define	notSrcBic    7
#define	patCopy      8
#define	patOr        9
#define	patXor       10
#define	patBic       11
#define	notPatCopy   12
#define	notPatOr     13
#define	notPatXor    14
#define	notPatBic    15

/* QuickDraw color separation constants */

#define	normalBit    0       /* normal screen mapping   */
#define	inverseBit   1       /* inverse screen mapping  */
#define	redBit       4       /* RGB additive mapping */
#define	greenBit     3
#define	blueBit      2
#define	cyanBit      8       /* CMYBk subtractive mapping */
#define	magentaBit   7
#define	yellowBit    6
#define	blackBit     5

#define	blackColor   33      /* colors expressed in these mappings */
#define	whiteColor   30
#define	redColor     205
#define	greenColor   341
#define	blueColor    409
#define	cyanColor    273
#define	magentaColor 137
#define	yellowColor  69

#define	picLParen    0       /* standard picture comments */
#define	picRParen    1


typedef	char *	Ptr;		/* blind pointer */
typedef	char **	Handle;		/* blind handle */

typedef	int	(*ProcPtr)();	/* pointer to a procedure */

typedef struct {
	char	s[256];
} Str255;

typedef struct {
	char	s[8];
} Pattern;

typedef struct {
	short	s[16];
} Bits16;

typedef	short	GrafVerb;

#define	frameMode	0
#define	paintMode	1
#define	eraseMode	2
#define	invertMode	3
#define	fillMode	4

typedef	short	Style;

#define	boldStyle	1
#define	italicStyle	2
#define	underlineStyle	4
#define	outlineStyle	8
#define	shadowStyle	16
#define	condenseStyle	32
#define	extendStyle	64

typedef struct {
	short	ascent;
	short	descent;
	short	widMax;
	short	leading;
} FontInfo;

typedef	int	VHSelect;

#define	V	0
#define	H	1

typedef union {
	struct {
		short	P0v;
		short	P0h;
	} P0;
	short	vh[2];
} Point;

#define	v	P0.P0v
#define	h	P0.P0h

typedef union {
	struct {
		short	R0top;
		short	R0left;
		short	R0bottom;
		short	R0right;
	} R0;
	struct {
		Point	R1topLeft;
		Point	R1botRight;
	} R1;
} Rect;

#define	top	R0.R0top
#define	left	R0.R0left
#define	bottom	R0.R0bottom
#define	right	R0.R0right
#define	topLeft	R1.R1topLeft
#define	botRight R1.R1botRight

typedef struct {
	Ptr	baseAddr;
	short	rowBytes;
	Rect	bounds;
} BitMap;

typedef struct {
	Bits16	data;
	Bits16	mask;
	Point	hotSpot;
} Cursor;

typedef struct {
	Point	pnLoc;
	Point	pnSize;
	short	pnMode;
	Pattern	pnPat;
} PenState;

typedef struct {
	short	polySize;
	Rect	polyBBox;
	Point	polyPoints[1];
} Polygon;

typedef	Polygon * PolyPtr;
typedef	PolyPtr * PolyHandle;

typedef struct {
	short	rgnSize;	/* = 10 for rectangular */
	Rect	rgnBBox;
				/* plus more data if not rectangular */
} Region;

typedef	Region * RgnPtr;
typedef	RgnPtr * RgnHandle;

typedef struct {
	short	picSize;
	Rect	picFrame;
				/* plus byte codes for picture content */
} Picture;

typedef Picture * PicPtr;
typedef PicPtr * PicHandle;

typedef struct {
	int	(*textProc)();
	int	(*lineProc)();
	int	(*rectProc)();
	int	(*rRectProc)();
	int	(*ovalProc)();
	int	(*arcProc)();
	int	(*polyProc)();
	int	(*rgnProc)();
	int	(*bitsProc)();
	int	(*commentProc)();
	int	(*txMeasProc)();
	int	(*getPicProc)();
	int	(*putPicProc)();
} QDProcs;

typedef QDProcs * QDProcsPtr;

typedef struct {
	short	device;
	BitMap	portBits;
	Rect	portRect;
	RgnHandle visRgn;
	RgnHandle clipRgn;
	Pattern	bkPat;
	Pattern	fillPat;
	Point	pnLoc;
	Point	pnSize;
	short	pnMode;
	Pattern	pnPat;
	short	pnVis;
	short	txFont;
	Style	txFace;
	short	txMode;
	short	txSize;
	long	spExtra;
	long	fgColor;
	long	bkColor;
	short	colrBit;
	short	patStretch;
	Handle	picSave;
	Handle	rgnSave;
	Handle	polySave;
	QDProcsPtr grafProcs;
} GrafPort;

typedef GrafPort * GrafPtr;

typedef struct {
	short	errNum;
	Handle	fontHandle;
	char	bold;
	char	italic;
	char	ulOffset;
	char	ulShadow;
	char	ulThick;
	char	shadow;
	char	extra;
	char	ascent;
	char	descent;
	char	widMax;
	char	leading;
	char	unused;
	Point	numer;
	Point	denom;
} FMOutRec;

typedef FMOutRec * FMOutPtr;

struct QDVar {
	FMOutRec fontData;	/* font manager output record */
	FMOutPtr fontPtr;	/* last font used; used by DrawText */
	long	fontAdj;	/* fixed point to adjust for font subst */
	Point	patAlign;	/* to align pattern during DrawPicture */
	short	polyMax;	/* max bytes allocated so far to thePoly */
	PolyHandle thePoly;	/* the current polygon being defined */
	short	playIndex;	/* used by StdGetPic */
	PicHandle playPic;
	short	rgnMax;		/* max bytes allocated so far to rgnBuf */
	short	rgnIndex;	/* current bytes used in rgnBuf */
	Handle	rgnBuf;		/* buffer for OpenRgn */
	Region	wideData;	/* a dummy rectangular region, readonly */
	RgnPtr	wideMaster;
	RgnHandle wideOpen;
	long	randSeed;	/* random number generator seed */
	BitMap	screenBits;	/* mac screen */
	Cursor	arrow;		/* pointing arrow cursor */
	Pattern	dkGray;		/* standard grey patterns */
	Pattern	ltGray;
	Pattern	gray;
	Pattern	black;
	Pattern	white;
	GrafPtr	QDthePort;	/* current pointer to grafPort */
};

struct QDVar *QD;		/* master global area pointer */
#define	thePort	(QD->QDthePort)	/* shorthand, use "QD->mumble" for others */


/* C to Pascal string conversion utilities. */

char	*c2pstr();		/* convert C string to Pascal string */
char	*p2cstr();		/* convert Pascal string into C string */
char	*isapstr();		/* "declares" argument is a pascal string */


/* Functions returning other than integer */

PolyHandle OpenPoly();
RgnHandle NewRgn();
PicHandle OpenPicture();
Mode;
	Pattern	pnPat;
} PenState;

typedef struct {
	short	polySize;
	Rect	polyBBox;
	Point	polyPoints[1];
} Polygon;

typedef	Polygon * PolyPtr;
typedef	PolyPtr * PolyHandle;

typedef struct {
	short	rgnSize;	/* = 10 for rectangular */
	Rect	rgnBBox;
				/* plus more dasumacc/h/res.h   444      0     12        5526  3470501347   6505 /*	res.h	1.0	04/11/84	*/

/*
 * Resource and segment manager definitions.
 */

/* 
 * Copyright (C) 1984, Stanford Univ. SUMEX project.  
 * May be used but not sold without permission.
 */

/*
 * history
 * 04/11/84	Croft	Created.
 */

/*
 * Resource file format.
 */

struct resfile {		/* resource file header */
	long	rf_offdata;	/* offset to data */
	long	rf_offmap;	/* offset to map */
	long	rf_lendata;	/* length of data */
	long	rf_lenmap;	/* length of map */
};

#define	OFFDATA	256		/* normal offset to data */
#define	ROUNDMAP 256		/* offmap rounded to multiple */
#define	lendata_t long		/* length field preceding each data */


struct resmap {			/* resource map header */
	struct resfile rm_file;	/* (0) copy of file header */
	long	rm_handle;	/* (0) incore handle */
	short	rm_refnum;	/* (0) incore file reference number */
	short	rm_fileatt;	/* file attributes */
	short	rm_offtype;	/* offset from rf_offmap to type list */
	short	rm_offname;	/* offset from rf_offmap to name list */
};

#define	numtypes_t short	/* number of types (-1) preceding type list */


struct restype {		/* resource type list */
	char	rt_type[4];	/* 4 byte upper-case type name */
	short	rt_numids;	/* number of id's of this type */
	short	rt_offids;	/* offset from type list to id list */
};


struct resid {			/* resource id list */
	short	ri_id;		/* resource id */
	short	ri_offname;	/* offset from rm_offname to our name */
	char	ri_att;		/* resource attributes */
	char	ri_offdatahi;	/* hi byte of offset to data */
	short	ri_offdata;	/* offset from rf_offdata to our data */
	short	ri_sysid;	/* id, if system reference */
	short	ri_sysoffname;	/* offset to name, if sys reference */
};

/* resource attributes */

#define	ATT_SYSREF	0200	/* system reference */
#define ATT_SYSHEAP	0100	/* if read into system heap */
#define ATT_PURGEABLE	040	/* purgeable */
#define ATT_LOCKED	020	/* locked */
#define ATT_PROTECTED	010	/* protected */
#define	ATT_PRELOAD	4	/* if to be preloaded */
#define ATT_CHANGED	2	/* (incore) set to rewrite changes */
#define ATT_USER	1	/* (not used) avail for user program */


/*
 * Segment loader formats.
 */

struct jumphead {		/* jump table header */
	long	jh_above;	/* (0x28) size above A5 (sizeof jumphead
				+ size of entire jump table */
	long	jh_below;	/* (0x200) size below A5 (pascal globals)*/
	long	jh_length;	/* (0x8) size of jump table proper */
	long	jh_offset;	/* (0x20) offset of jump table from A5 */
};


struct jumptab {		/* jump table entry */
	short	jt_offset;	/* (0x0) offset from segment beginning */
	short	jt_move;	/* (0x3f3c) op code to move seg id to stack */
	short	jt_id;		/* (0x1) segment id of this entry */
	short	jt_trap;	/* (0xA9F0) trap that executes LoadSeg */
};


struct codehead {		/* header of code segments */
	short	ch_offset;	/* (0x0) offset of our jump table entries */
	short	ch_entries;	/* (0x1) number of our entry points */
};
Port	(QD->QDthePort)	/* shorthand, use "QD->mumble" for others */


/* C to Pascal string conversion utilities. */

char	*c2pstr();		/* convert C string to Pascal string sumacc/h/sane.h   444      0     12        3623  3470501350   6630 /*	sane.h	1.0	05/25/84	*/

/*
 * Sane definitions.
 *
 * Copyright Apple Computer, 1982.
 *
 * C language version (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 05/25/84	Croft	Created C version.
 */

#define	SIGDIGLEN  20     /* Maximum length of SigDig. */
#define	DECSTRLEN  82     /* Maximum length of DecStr. */

/* Numeric types. */

typedef	long	Single;

typedef struct {
	short	s[4];
} Double;

typedef	struct {
	short	s[4];
} Comp;

typedef	struct {
	short	s[5];
} Extended;


/*
 * Decimal string type and intermediate decimal type,
 * representing the value:
 *      (-1)^sgn * 10^exp * dig
 */
typedef	struct {
	char	sgn;	/* Sign (0 for pos, 1 for neg). */
	char	dummy;
	short	exp;	/* Exponent. */
	char	sig[SIGDIGLEN+2]; /* Pascalstring of significant digits. */
} Decimal;


/*
 * Modes, flags, and selections.
 * NOTE: the values of the style element of the DecForm record
 * have different names from the PCS version to avoid name
 * conflicts.
 */
typedef	short	Environ;

/* RoundDir  = (TONEAREST, UPWARD, DOWNWARD, TOWARDZERO); */
#define	TONEAREST	0
#define	UPWARD		1
#define	DOWNWARD	2
#define	TOWARDZERO	3

/* RelOp     = (GT, LT, GL, EQ, GE, LE, GEL, UNORD);
	         >   <  <>  =   >=  <=  <=> */
#define	GT	0
#define	LT	1
#define	GL	2
#define	EQ	3
#define	GE	4
#define	LE	5
#define	GEL	6
#define	UNORD	7

/* Exception = (INVALID, UNDERFLOW, OVERFLOW, DIVBYZERO, INEXACT); */
#define	INVALID		0
#define	UNDERFLOW	1
#define	OVERFLOW	2
#define	DIVBYZERO	3
#define	INEXACT		4

/* NumClass  = (SNAN, QNAN, INFINITE, ZERO, NORMAL, DENORMAL); */
#define	SNAN		0
#define	QNAN		1
#define	INFINITE	2
#define	ZERO		3
#define	NORMAL		4
#define	DENORMAL	5

/* Decimal to binary conversion is governed by the DecForm struct */
typedef	struct {
	char	style;
	char	dummy;
	short	digits;
} DecForm;
/* values for style */
#define	FloatDecimal	0
#define	FixedDecimal	1
tyle element of the DecForm record
 * have different names from the PCS version to avoid name
 * conflicts.
 sumacc/h/toolintf.h   444      0     12       23564  3470501350   7566 /*	toolintf.h	1.0	05/03/84	*/

/*
 * Toolbox interface.
 *
 * Copyright 1982, 1983, 1984 by Apple Computer, Inc.  All Rights Reserved.
 *
 * C language version Copyright 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 *
 * history
 * 11/23/83	Sebok	Merge of mac*mgr, textedit and grafutil.
 * 02/10/84	Martin	Inline traps.
 * 03/20/84	Knaster	Fixed trap numbers.
 * 05/03/84	Croft	C language version.
 * 10/10/84	Croft	Merged in JTC mods; July/Oct supplements.
 */


/* for Font Manager */

#define	systemFont	0
#define	applFont	1
#define	newYork		2
#define	geneva		3
#define	monaco		4
#define	venice		5
#define	london		6
#define	athens		7
#define	sanFran		8
#define	toronto		9

#define	propFont	0x9000
#define	fixedFont	0xB000
#define	fontWid		0xACB0


/*for Window Manager*/

/*window messages*/
#define	wDraw		0
#define	wHit		1
#define	wCalcRgns	2
#define	wNew		3
#define	wDispose	4
#define	wGrow		5
#define	wDrawGIcon	6

/*types of windows*/
#define	dialogKind 	2
#define	userKind   	8

/*window definition procedure IDs*/
#define	documentProc	0
#define	dBoxProc    	1
#define	plainDBox	2
#define	altDBoxProc	3
#define	noGrowDocProc	4
#define	rDocProc    	16

/*FindWindow Result Codes*/
#define	inDesk      	0
#define	inMenuBar   	1
#define	inSysWindow 	2
#define	inContent   	3
#define	inDrag      	4
#define	inGrow      	5
#define	inGoAway    	6

/*defProc hit test codes*/
#define	wNoHit      	0
#define	wInContent  	1
#define	wInDrag     	2
#define	wInGrow     	3
#define	wInGoAway   	4

/* axis constraints for DragGrayRgn */
#define	bothAxes	0
#define	hAxisOnly	1
#define	vAxisOnly	2


/*for TextEdit*/

#define	teJustLeft	0
#define	teJustRight	-1
#define	teJustCenter	1


/*for Resource Manager*/

/*Resource attribute byte*/
#define	resSysRef       128             /* Reference to system resource? */
#define	resSysHeap      64              /* System or application heap?   */
#define	resPurgeable    32              /* Purgeable resource?           */
#define	resLocked       16              /* Load it in locked?            */
#define	resProtected    8               /* Protected?                    */
#define	resPreload      4               /* Load in on OpenResFile?       */
#define	resChanged      2               /* Resource changed?             */

#define	mapReadOnly     128             /* Resource file read-only       */
#define	mapCompact      64              /* Compact resource file         */
#define	mapChanged      32              /* Write map out at update       */

#define	resNotFound     -192            /* Resource not found            */
#define	resFNotFound    -193            /* Resource file not found       */
#define	addResFailed    -194            /* AddResource failed            */
#define	addRefFailed    -195            /* AddReference failed           */
#define	rmvResFailed    -196            /* RmveResource failed           */
#define	rmvRefFailed    -197            /* RmveReference failed          */

/* ID's for resources in sysResDef */
/* cursors */
#define	iBeamCursor	1
#define	crossCursor	2
#define	plusCursor	3
#define	watchCursor	4

/* icons */
#define	stopIcon	0
#define	noteIcon	1
#define	cautionIcon	2

/* patterns */
#define	patternList	0	/* ID of PAT# containing 38 patterns */


/*for Control Manager*/

/*control messages*/
#define	drawCntl	0 
#define	testCntl	1 
#define	calcCRgns	2 
#define	initCntl	3 
#define	dispCntl	4 
#define	posCntl		5 
#define	thumbCntl	6 
#define	dragCntl	7 
#define	autoTrack	8 


/*FindControl Result Codes*/
#define	inButton       10 
#define	inCheckbox     11 
#define	inUpButton     20 
#define	inDownButton   21 
#define	inPageUp       22 
#define	inPageDown     23 
#define	inThumb        129 

/*control definition proc ID's*/
#define	pushButProc     0 
#define	checkBoxProc    1 
#define	radioButProc    2 
#define	scrollBarProc   16 

#define	useWFont        8 

/*for Dialog Manager*/

#define	userItem      0 
#define	ctrlItem      4 
#define	btnCtrl     0               /* Low two bits: what kind of control */
#define	chkCtrl     1 
#define	radCtrl     2 
#define	resCtrl     3 

#define	statText      8               /* Static text    */
#define	editText      16              /* Editable text  */
#define	iconItem      32              /* Icon item      */
#define	picItem       64              /* Picture item   */
#define	itemDisable   128             /* Disable item if set */

#define	OK            1               /* OK button is first by convention */
#define	okButton	OK
#define	Cancel        2               /* Cancel button is 2nd by convention */
#define	cancelButton	Cancel
#define	DlgFont	(*(short *)0xafa)


/*for Desk Manager*/

#define	undoCmd      0 
#define	cutCmd       2 
#define	copyCmd      3 
#define	pasteCmd     4 
#define	clearCmd     5 


/*for Menu Manager*/

#define	noMark		0	/* mark symbols for MarkItem */
#define	commandMark	0x11
#define	checkMark	0x12
#define	diamondMark	0x13
#define	appleMark	0x14
#define	textMenuProc	0

/* menu defProc messages */
#define	mDrawMsg      0 
#define	mChooseMsg    1 
#define	mSizeMsg      2 


/*for Scrap Manager*/

#define	noTypeErr   -102 

/*package manager*/
#define	dskInit   2           /*Disk Initializaton*/
#define	stdFile   3           /*Standard File*/
#define	flPoint   4           /*Floating-Point Arithmetic*/
#define	trFunc    5           /*Transcendental Functions*/
#define	intUtil   6           /*International Utilities*/
#define	bdConv    7           /*Binary/Decimal Conversion*/


/*General Utilities*/

typedef	long	Fixed;
typedef	struct {
	long	hiLong;
	long	loLong;
} Int64Bit;

typedef	Cursor * CursPtr;
typedef	CursPtr * CursHandle;

typedef	Pattern * PatPtr;
typedef	PatPtr * PatHandle;


/*for Font Manager*/

typedef	struct {
	short	family;
	short	size;
	char	face;
	char	needBits;
	short	device;
	Point	numer;
	Point	denom;
} FMInput;

typedef FMOutRec FMOutPut;	/* already defined in quickdraw */

typedef	struct {
	short	fontType;
	short	firstChar;
	short	lastChar;
	short	widMax;
	short	kernMax;
	short	nDescent;
	short	fRectMax;
	short	chHeight;
	short	owTLoc;
	short	ascent;
	short	descent;
	short	leading;
	short	rowWords;
/*	short	bitImage[rowWords,chHeight];
	short	locTable[];
	short	owTable[]; */
} FontRec;


/*for Event Manager*/

typedef	struct {
	long	kmap[4];	/* 4*32 = 128 bits */
} KeyMap;


/*for Window Manager*/

struct WindowRecord {
	GrafPort port;
	short	windowKind;
	char	visible;
	char	hilited;
	char	goAwayFlag;
	char	spareFlag;
	RgnHandle strucRgn;
	RgnHandle contRgn;
	RgnHandle updateRgn;
	Handle	windowDefProc;
	Handle	dataHandle;
	Handle	titleHandle;
	short	titleWidth;
	Handle	controlList;
	struct WindowRecord *nextWindow;
	PicHandle windowPic;
	long	refCon;
};

typedef struct WindowRecord WindowRecord;
typedef GrafPtr WindowPtr;
typedef	WindowRecord *WindowPeek;


/*for TextEdit*/

typedef	struct {
	Rect	destRect;
	Rect	viewRect;
	Rect	selRect;		/* select rectangle */
	short	lineHeight;		/* current font lineheight */
	short	fontAscent;		/* current font ascent */
	Point	selPoint;		/* selection point (mouseLoc) */
	short	selStart;
	short	selEnd;
	short	active;			/* nonzero if active */
	ProcPtr	wordBreak;		/* wordbreak routine */
	ProcPtr	clikLoop;		/* clickloop routine */
	long	clickTime;		/* time of 1st click */
	short	clickLoc;		/* char location of click */
	long	caretTime;		/* time for next caret blink */
	short	caretState;
	short	just;			/* fill style */
	short	teLength;		/* length of text below */
	Handle	hText;			/* handle to actual text */
	short	recalBack;		/* nonzero if recal in backround */
	short	recalLines;		/* line being recaled */
	short	clikStuff;		/* internal clickstuff */
	short	crOnly;			/* -1 if CR line breaks only */
	short	txFont;
	Style	txFace;
	short	txMode;
	short	txSize;
	GrafPtr	inPort;			/* the grafport */
	ProcPtr	highHook;		/* highlighting hook */
	ProcPtr	caretHook;
	short	nLines;
	short	lineStarts[1];		/* actual linestarts */
} TERec;

typedef	TERec * TEPtr;
typedef TEPtr * TEHandle;
#define	TEScrapHandle	(*(Handle *)0xab4)
#define	TEScrapLen	(*(short *)0xab0)


/*for Control Manager*/

typedef	struct {
	Handle	nextControl;
	WindowPtr contrlOwner;
	Rect	contrlRect;
	char	contrlVis;
	char	contrlHilite;
	short	contrlValue;
	short	contrlMin;
	short	contrlMax;
	Handle	contrlDefProc;
	Handle	contrlData;
	int	(*contrlAction)();
	long	contrlRfCon;
	Str255	contrlTitle;
} ControlRecord;

typedef ControlRecord * ControlPtr;
typedef ControlPtr * ControlHandle;


/*for Dialog Manager*/

typedef	struct	{
	WindowRecord window;
	Handle	items;
	TEHandle textH;
	short	editField;
	short	editOpen;
	short	aDefItem;
} DialogRecord;

typedef WindowPtr DialogPtr;

typedef	struct	{
	Rect	boundsRect;
	short	procID;
	char	visible;
	char	filler1;
	char	goAwayFlag;
	char	filler2;
	long	refCon;
	short	itemsID;
	Str255	title;
} DialogTemplate;

typedef DialogTemplate * DialogTPtr;
typedef DialogTPtr * DialogTHndl;

typedef	struct {
	Rect	boundsRect;
	short	itemsID;
	long	stages;
} AlertTemplate;

#define	boldItem	8
#define	boxDrawn	4
#define	stageShift	4

typedef AlertTemplate * AlertTPtr;
typedef AlertTPtr * AlertTHndl;
#define	AlertStage	(*(short *)0xa9a)


/*for Menu Manager*/

typedef struct {
	short	menuId;
	short	menuWidth;
	short	menuHeight;
	Handle	menuProc;
	long	enableFlags;
	Str255	menuData;
} MenuInfo;

typedef MenuInfo * MenuPtr;
typedef MenuPtr * MenuHandle;


/*for Scrap Manager*/

typedef struct {
	long	scrapSize;
	Handle	scrapHandle;
	short	scrapCount;
	short	scrapState;
	char	*scrapName;
} ScrapStuff;


/* Functions returning other then integer */

ControlHandle	GetNewControl(),NewControl();
CursHandle GetCursor();
DialogPtr GetNewDialog(),NewDialog();
FMOutPtr FMSwapFont();
Handle	GetIcon(),GetIndResource(),GetMenuBar(),GetNamedResource();
Handle	GetNewMBar(),GetResource(),GetString(),NewString(),TEGetText();
MenuHandle GetMHandle(),GetMenu(),NewMenu();
PatHandle GetPattern();
PicHandle GetPicture(),GetWindowPic();
ProcPtr	GetCtlAction();
ScrapStuff *InfoScrap();
TEHandle TENew();
WindowPtr FrontWindow(),GetNewWindow(),NewWindow();
rt	lastChar;
	short	widMax;
	short	kernMax;
	short	nDescent;
	short	fRectMax;
	short	chHeight;
	short	owTLoc;
	short	ascent;
	short	descent;sumacc/h/libmac.h   444      0     12        7013  3470501350   7126 /*	libmac.h	1.0	84/05/01	*/

/*
 * C library linkage for Macintosh.
 *
 * Copyright (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 05/01/84	Croft	Created.
 * 05/12/84	Croft	traps/calls now packed in 3bit nibbles.
 * 05/31/84	Croft	added VS/VPS
 */


#define	N	0	/* null */
#define	S	1	/* short */
#define	L	2	/* long */
#define	PS	3	/* pascal string */
#define	SS	4	/* short structure (e.g. Point) */
#define	TS	4	/* 4 byte type string (resource,creator,filetype) */
#define	B	5	/* boolean */
#define	VS	6	/* VAR short */
#define	VPS	7	/* VAR pascal string */

#define	RN	;	/* return null */
#define	RI	return(0); /* return integer */
#define	R(v)	return(v); /* return value */

#ifdef	CODE	/* defined if compiling code library */

#define	_sh(r,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
	(a9<<27 | a8<<24 | a7<<21 | a6<<18 | a5<<15 \
	| a4<<12 | a3<<9 | a2<<6 | a1<<3 | r)

#define	_mact1(lr,t,r,a1) _mactrap((t<<16) | 0x4e71, \
	_sh(r,a1,0,0,0,0,0,0,0,0));
#define	_mact2(lr,t,r,a1,a2) _mactrap((t<<16) | 0x4e71, \
	_sh(r,a1,a2,0,0,0,0,0,0,0));
#define	_mact3(lr,t,r,a1,a2,a3) _mactrap((t<<16) | 0x4e71, \
	_sh(r,a1,a2,a3,0,0,0,0,0,0));
#define	_mact4(lr,t,r,a1,a2,a3,a4) _mactrap((t<<16) | 0x4e71, \
	_sh(r,a1,a2,a3,a4,0,0,0,0,0));
#define	_mact5(lr,t,r,a1,a2,a3,a4,a5) _mactrap((t<<16) | 0x4e71, \
	_sh(r,a1,a2,a3,a4,a5,0,0,0,0));
#define	_mact6(lr,t,r,a1,a2,a3,a4,a5,a6) _mactrap((t<<16) | 0x4e71, \
	_sh(r,a1,a2,a3,a4,a5,a6,0,0,0));
#define	_mact7(lr,t,r,a1,a2,a3,a4,a5,a6,a7) _mactrap((t<<16) | 0x4e71, \
	_sh(r,a1,a2,a3,a4,a5,a6,a7,0,0));
#define	_mact8(lr,t,r,a1,a2,a3,a4,a5,a6,a7,a8) _mactrap((t<<16) | 0x4e71, \
	_sh(r,a1,a2,a3,a4,a5,a6,a7,a8,0));
#define	_mact9(lr,t,r,a1,a2,a3,a4,a5,a6,a7,a8,a9) _mactrap((t<<16) | 0x4e71, \
	_sh(r,a1,a2,a3,a4,a5,a6,a7,a8,a9));
#define	_macc1(lr,t,r,a1) extern t(); _mactrap(t, \
	_sh(r,a1,0,0,0,0,0,0,0,0));
#define	_macc2(lr,t,r,a1,a2) extern t(); _mactrap(t, \
	_sh(r,a1,a2,0,0,0,0,0,0,0));
#define	_macc3(lr,t,r,a1,a2,a3) extern t(); _mactrap(t, \
	_sh(r,a1,a2,a3,0,0,0,0,0,0));
#define	_macc4(lr,t,r,a1,a2,a3,a4) extern t(); _mactrap(t, \
	_sh(r,a1,a2,a3,a4,0,0,0,0,0));
#define	_macc5(lr,t,r,a1,a2,a3,a4,a5) extern t(); _mactrap(t, \
	_sh(r,a1,a2,a3,a4,a5,0,0,0,0));
#define	_macc6(lr,t,r,a1,a2,a3,a4,a5,a6) extern t(); _mactrap(t, \
	_sh(r,a1,a2,a3,a4,a5,a6,0,0,0));
#define	_macc7(lr,t,r,a1,a2,a3,a4,a5,a6,a7) extern t(); _mactrap(t, \
	_sh(r,a1,a2,a3,a4,a5,a6,a7,0,0));
#define	_macc8(lr,t,r,a1,a2,a3,a4,a5,a6,a7,a8) extern t(); _mactrap(t, \
	_sh(r,a1,a2,a3,a4,a5,a6,a7,a8,0));
#define	_macc9(lr,t,r,a1,a2,a3,a4,a5,a6,a7,a8,a9) extern t(); _mactrap(t, \
	_sh(r,a1,a2,a3,a4,a5,a6,a7,a8,a9));
#define	_macs(lr)

#else		/* else compiling lint library */

#define	_mact1(lr,t,r,a1) lr
#define	_mact2(lr,t,r,a1,a2) lr
#define	_mact3(lr,t,r,a1,a2,a3) lr
#define	_mact4(lr,t,r,a1,a2,a3,a4) lr
#define	_mact5(lr,t,r,a1,a2,a3,a4,a5) lr
#define	_mact6(lr,t,r,a1,a2,a3,a4,a5,a6) lr
#define	_mact7(lr,t,r,a1,a2,a3,a4,a5,a6,a7) lr
#define	_mact8(lr,t,r,a1,a2,a3,a4,a5,a6,a7,a8) lr
#define	_mact9(lr,t,r,a1,a2,a3,a4,a5,a6,a7,a8,a9) lr
#define	_macc1(lr,t,r,a1) lr
#define	_macc2(lr,t,r,a1,a2) lr
#define	_macc3(lr,t,r,a1,a2,a3) lr
#define	_macc4(lr,t,r,a1,a2,a3,a4) lr
#define	_macc5(lr,t,r,a1,a2,a3,a4,a5) lr
#define	_macc6(lr,t,r,a1,a2,a3,a4,a5,a6) lr
#define	_macc7(lr,t,r,a1,a2,a3,a4,a5,a6,a7) lr
#define	_macc8(lr,t,r,a1,a2,a3,a4,a5,a6,a7,a8) lr
#define	_macc9(lr,t,r,a1,a2,a3,a4,a5,a6,a7,a8,a9) lr
#define	_macs(lr) lr

#endif	CODE

#define	void	int		/* otherwise we would pull in everything */
ding;
	short	rowWords;
/*	short	bitImage[rowWords,chHeight];
	short	locTable[];
	short	owTable[]; */
} FontRec;


/*for Event Manager*/

typedef	struct {
	long	kmap[4];	/* 4*32 = 128 bits */
} KeyMap;


/*for Window Manager*/

struct WindowRecord {
	GrafPort port;
	short	windowKind;
	char	visible;
	char	hilited;
	char	goAwayFlag;
	char	spareFlag;
	RgnHandle strucRgn;
	RgnHandle contRgn;
	RgnHandle updateRgn;
	Handle	windowDefProc;
	Handle	dataHandle;
	Handle	titleHandle;
	short	titleWidth;
	Handlsumacc/h/sanemacs.h   444      0     12       37434  3470501351   7524 |-----------------------------------------------------------
|
|  these macros give assembly language access to the mac
|  floating-point arithmetic routines.  the arithmetic has
|  just one entry point.  it is typically accessed through
|  the tooltrap _fp68k, although a custom version of the
|  package may be linked as an object file, in which case
|  the entry point is the label %fp68k.
|
|  all calls to the arithmetic take the form:
|       pea     <source address>
|       pea     <destination address>
|       movw    <opcode>,sp@-
|       .word	_fp68k
|
|  all operands are passed by address.  the <opcode> word
|  specifies the instruction analogously to a 68000 machine
|  instruction.  depending on the instruction, there may be
|  from one to three operand addresses passed.
|
|  this definition file specifies details of the <opcode>
|  word and the floating point state word, and defines
|  some handy macros.
|
|  modification history:
|       29aug82: written by jerome coonen
|       13oct82: fbword	____ constrants added (jtc)
|       28dec82: logb, scalb added, inf modes out (jtc).
|       29apr83: abs, neg, cpysgn, class added (jtc).
|       03may83: next, setxcp added (jtc).
|       28may83: elementary functions added (jtc).
|       04jul83: short branches, trig and rand added (jtc).
|       01nov83: precision control made a mode (jtc).
|
|-----------------------------------------------------------



|-----------------------------------------------------------
| operation masks: bits /001f of the operation word
| determine the operation.  there are two rough classes of
| operations:  even numbered opcodes are the usual
| arithmetic operations and odd numbered opcodes are non-
| arithmetic or utility operations.
|-----------------------------------------------------------
foadd           =       /0000
fosub           =       /0002
fomul           =       /0004
fodiv           =       /0006
focmp           =       /0008
focpx           =       /000a
forem           =       /000c
foz2x           =       /000e
fox2z           =       /0010
fosqrt          =       /0012
forti           =       /0014
fotti           =       /0016
foscalb         =       /0018
fologb          =       /001a
foclass         =       /001c
| undefined     =       /001e

fosetenv        =       /0001
fogetenv        =       /0003
fosettv         =       /0005
fogettv         =       /0007
fod2b           =       /0009
fob2d           =       /000b
foneg           =       /000d
foabs           =       /000f
focpysgnx       =       /0011
fonext          =       /0013
fosetxcp        =       /0015
foprocentry     =       /0017
foprocexit      =       /0019
fotestxcp       =       /001b
| undefined     =       /001d
| undefined     =       /001f


|-----------------------------------------------------------
| operand format masks: bits /3800 determine the format of
| any non-extended operand.
|-----------------------------------------------------------
ffext           =       /0000   | extended -- 80-bit float
ffdbl           =       /0800   | double   -- 64-bit float
ffsgl           =       /1000   | single   -- 32-bit float
ffint           =       /2000   | integer  -- 16-bit integer
fflng           =       /2800   | long int -- 32-bit integer
ffcomp          =       /3000   | accounting -- 64-bit int


|-----------------------------------------------------------
| bit indexes for error and halt bits and rounding modes in
| the state word.  the word is broken down as:
|
|       /8000 -- unused
|
|       /6000 -- rounding modes
|                /0000 -- to nearest
|                /2000 -- toward +infinity
|                /4000 -- toward -infinity
|                /6000 -- toward zero
|
|       /1f00 -- error flags
|                /1000 -- inexact
|                /0800 -- division by zero
|                /0400 -- overflow
|                /0200 -- underflow
|                /0100 -- invalid operation
|
|       /0080 -- result of last rounding
|                /0000 -- rounded down in magnitude
|                /0080 -- rounded up in magnitude
|
|       /0060 -- precision control
|                /0000 -- extended
|                /0020 -- double
|                /0040 -- single
|                /0060 -- illegal
|
|       /001f -- halt enables, corresponding to error flags
|
| the bit indexes are based on the byte halves of the state
| word.
|-----------------------------------------------------------
fbinvalid       =       0       | invalid operation
fbuflow         =       1       | underflow
fboflow         =       2       | overflow
fbdivzer        =       3       | division by zero
fbinexact       =       4       | inexact
fbrndlo         =       5       | low bit of rounding mode
fbrndhi         =       6       | high bit of rounding mode
fblstrnd        =       7       | last round result bit
fbdbl           =       5       | double precision control
fbsgl           =       6       | single precision control


|-----------------------------------------------------------
| floating conditional branches: floating point comparisons
| set the cpu condition code register (the ccr) as follows:
|       relation        x n z v c
|       -------------------------
|         equal         0 0 1 0 0
|       less than       1 1 0 0 1
|       greater than    0 0 0 0 0
|        unordered      0 0 0 1 0
| the macros below define a set of so-called floating
| branches to spare the programmer repeated refernces to the
| the table above.
|-----------------------------------------------------------
        .macro  fbeq,l1
        beq     l1
        .endm

        .macro  fblt,l1
        bcs     l1
        .endm

        .macro  fble,l1
        bls     l1
        .endm

        .macro  fbgt,l1
        bgt     l1
        .endm

        .macro  fbge,l1
        bge     l1
        .endm

        .macro  fbult,l1
        blt     l1
        .endm

        .macro  fbule,l1
        ble     l1
        .endm

        .macro  fbugt,l1
        bhi     l1
        .endm

        .macro  fbuge,l1
        bcc     l1
        .endm

        .macro  fbu,l1
        bvs     l1
        .endm

        .macro  fbo,l1
        bvc     l1
        .endm

        .macro  fbne,l1
        bne     l1
        .endm

        .macro  fbue,l1
        beq     l1
        bvs     l1
        .endm

        .macro  fblg,l1
        bne     l1
        bvc     l1
        .endm

|-----------------------------------------------------------
| operation macros: (changed to defines for UNIX package).
|       these macros require that the operands' addresses
|       first be pushed on the stack.  the macros cannot
|       themselves push the addresses since the addresses
|       may be sp-relative, in which case they require
|       programmer care.
| operation macros: operand addresses should already be on
| the stack, with the destination address on top.  the
| suffix x, d, s, or c determines the format of the source
| operand -- extended, double, single, or computational
| respectively; the destination operand is always extended.
|-----------------------------------------------------------


|-----------------------------------------------------------
| addition.
|-----------------------------------------------------------
faddx = ffext+foadd

faddd = ffdbl+foadd

fadds = ffsgl+foadd

faddc = ffcomp+foadd


|-----------------------------------------------------------
| subtraction.
|-----------------------------------------------------------
fsubx = ffext+fosub

fsubd = ffdbl+fosub

fsubs = ffsgl+fosub

fsubc = ffcomp+fosub


|-----------------------------------------------------------
| multiplication.
|-----------------------------------------------------------
fmulx = ffext+fomul

fmuld = ffdbl+fomul

fmuls = ffsgl+fomul

fmulc = ffcomp+fomul


|-----------------------------------------------------------
| division.
|-----------------------------------------------------------
fdivx = ffext+fodiv

fdivd = ffdbl+fodiv

fdivs = ffsgl+fodiv

fdivc = ffcomp+fodiv


|-----------------------------------------------------------
| compare, signaling no exceptions.
|-----------------------------------------------------------
fcmpx = ffext+focmp

fcmpd = ffdbl+focmp

fcmps = ffsgl+focmp

fcmpc = ffcomp+focmp


|-----------------------------------------------------------
| compare, signaling invalid operation if the two operands
| are unordered.
|-----------------------------------------------------------
fcpxx = ffext+focpx

fcpxd = ffdbl+focpx

fcpxs = ffsgl+focpx

fcpxc = ffcomp+focpx


|-----------------------------------------------------------
| remainder.  the remainder is placed in the destination,
| and the low bits of the integer quotient are placed in
| the low word of register d0.
|-----------------------------------------------------------
fremx = ffext+forem

fremd = ffdbl+forem

frems = ffsgl+forem

fremc = ffcomp+forem


|-----------------------------------------------------------
| compare the source operand to the extended format and
| place in the destination.
|-----------------------------------------------------------
fx2x = ffext+foz2x

fd2x = ffdbl+foz2x

fs2x = ffsgl+foz2x

fi2x = ffint+foz2x

fl2x = fflng+foz2x

fc2x = ffcomp+foz2x


|-----------------------------------------------------------
| convert the extended source operand to the specified
| format and place in the destination.
|-----------------------------------------------------------
fx2d = ffdbl+fox2z

fx2s = ffsgl+fox2z

fx2i = ffint+fox2z

fx2l = fflng+fox2z

fx2c = ffcomp+fox2z


|-----------------------------------------------------------
| miscellaneous operations applying only to extended
| operands.  the input operand is overwritten with the
| computed result.
|-----------------------------------------------------------

| square root.
fsqrtx = fosqrt

| round to integer, according to the current rounding mode.
frintx = forti

| round to integer, forcing rounding toward zero.
ftintx = fotti

| set the destination to the product:
|  (destination) * 2^(source)
| where the source operand is a 16-bit integer.
fscalbx = ffint+foscalb

| replace the destination with its exponent, converted to
| the extended format.
flogbx = fologb


|-----------------------------------------------------------
| non-arithmetic sign operations on extended operands.
|-----------------------------------------------------------

| negate.
fnegx = foneg

| absolute value.
fabsx = foabs

| copy the sign of the destination operand onto the sign of
| the source operand.  note that the source operand is
| modified.
fcpysgnx = focpysgnx


|-----------------------------------------------------------
| the nextafter operation replaces the source operand with
| its nearest representable neighbor in the direction of the
| destination operand.  note that both operands are of the
| the same format, as specified by the usual suffix.
|-----------------------------------------------------------
fnexts = ffsgl+fonext

fnextd = ffdbl+fonext

fnextx = ffext+fonext


|-----------------------------------------------------------
| the classify operation places an integer in the
| destination.  the sign of the integer is the sign of the
| source.  the magnitude is determined by the value of the
| source, as indicated by the equates.
|-----------------------------------------------------------
fcsnan           =      1       | signaling nan
fcqnan           =      2       | quiet nan
fcinf            =      3       | infinity
fczero           =      4       | zero
fcnorm           =      5       | normal number
fcdenorm         =      6       | denormal number

fclasss = ffsgl+foclass

fclassd = ffdbl+foclass

fclassx = ffext+foclass

fclassc = ffcomp+foclass


|-----------------------------------------------------------
| these four operations give access to the floating point
| state (or environment) word and the halt vector address.
| the sole input operand is a pointer to the word or address
| to be placed into the arithmetic state area or read from
| it.
|-----------------------------------------------------------
fgetenv = fogetenv

fsetenv = fosetenv

fgettv = fogettv

fsettv = fosettv

|-----------------------------------------------------------
| both fprocentry and fprocexit have one operand -- a
| pointer to a word.  the entry procedure saves the current
| floating point state in that word and resets the state
| to 0, that is all modes to default, flags and halts to
| off.  the exit procedure performs the sequence:
|       1. save current error flags in a temporary.
|       2. restore the state saved at the address given by
|               the parameter.
|       3. signal the exceptions flagged in the temporary,
|               halting if so specified by the newly
|               restored state word.
| these routines serve to handle the state word dynamically
| across subroutine calls.
|-----------------------------------------------------------
fprocentry = foprocentry

fprocexit = foprocexit


|-----------------------------------------------------------
| fsetxcp is a null arithmetic operation which stimulates
| the indicated exception.  it may be used by library
| routines intended to behave like elementary operations.
| the operand is a pointer to an integer taking any value
| between fbinvalid and fbinexact.
| ftestxcp tests the flag indicated by the integer pointed
| to by the input address.  the integer is replaced by a
| pascal boolean (word /0000=false, $0100=true)
|-----------------------------------------------------------
fsetxcp = fosetxcp

ftestxcp = fotestxcp


|-----------------------------------------------------------
| warning: pascal enumerated types, like those of the
| decimal record, are stored in the high-order byte of the
| allocated word, if possible.  thus the sign has the
| integer value 0 for plus and 256 (rather than 1)
| for minus.
| binary-decimal conversion:  the next routines convert
| between a canonical decimal format and the binary format
| specified.  the decimal format is defined in pascal as
|
|   const
|       sigdiglen = 20;
|
|   type
|       sigdig  = string [sigdiglen];
|       decimal = record
|                     sgn : 0..1;
|                     exp : integer;
|                     sig : sigdig
|                 end;
|
| note that lisa pascal stores the sgn in the high-order
| byte of the allotted word, so the two legal word values
| of sgn are 0 and 256.
|-----------------------------------------------------------


|-----------------------------------------------------------
| decimal to binary conversion is governed by a format
| record defined in pascal as:
|
|   type
|       decform = record
|                     style  : (floatdecimal, fixeddecimal);
|                     digits : integer
|                 end;
|
| note again that the style field is stored in the high-
| order byte of the allotted word.
|
| these are the only operations with three operands.  the
| pointer to the format record is deepest in the stack,
| then the source pointer, and finally the destination
| pointer.
|-----------------------------------------------------------
fdec2x = ffext+fod2b

fdec2d = ffdbl+fod2b

fdec2s = ffsgl+fod2b

fdec2c = ffcomp+fod2b


|-----------------------------------------------------------
| binary to decimal conversion.
|-----------------------------------------------------------
fx2dec = ffext+fob2d

fd2dec = ffdbl+fob2d

fs2dec = ffsgl+fob2d

fc2dec = ffcomp+fob2d


|-----------------------------------------------------------
| equates and macros for elementary functions.
|-----------------------------------------------------------
flnx            =      /0000
flog2x          =      /0002
fln1x           =      /0004
flog21x         =      /0006

fexpx           =      /0008
fexp2x          =      /000a
fexp1x          =      /000c
fexp21x         =      /000e

fxpwri          =      /8010
fxpwry          =      /8012
fcompoundx      =      /c014
fannuityx       =      /c016

fsinx           =      /0018
fcosx           =      /001a
ftanx           =      /001c
fatanx          =      /001e
frandomx        =      /0020

------------------------------------------------
fgetenv = fogetenv

fsetenv = fosetenv

fgettv = fogettv

fsettv = fosettv

|-----------------------------------------------------------
| both fprocentry and fprocexit have one osumacc/h/sysequ.h   444      0     12      121277  3470501351   7302 | file sysequ.text - macintosh system equates file.
|________________________________________________________________________
|
|
| written by:  bud tribble        6-may-81
|
| all system routines include this equate file.
|
|   modification history:
|
|      integrate lisagraf                              --  alo 23-dec-81
|      configured for alpha release (one heap)         --  alo  5-feb-82
|      moved lisagraf variables up to allow more room  --  alo 10-feb-82
|      added system base date & time variables         --  alo 13-feb-82
|      allowed 20 bytes for system parameter ram area  --  alo  1-mar-82
|      added ptr for sysoutfib,sysinfib,sysrefnum(macpaslib)
|                                                      --  alo 1-apr-82
|      added scc hardware addresses| removed 6551 stuff|
|      pulled mbstate and mbticks from kbd driver vars --  lak 10-may-82
|      added scc write reg 5 globals| clock-keyboard
|      synchronization flags . . .                     --  lak 27-may-82
|      got rid of vbl queue element "mode" word        --  lak 04-jun-82
|      changed keyrepcount to keyreptime| added
|      procedural interface variables for key mapping  --  lak 07-jun-82
|      updated for 512-dots                            --  lak 26-aug-82
|      changed via addresses for timing problem        --  lak 17-sep-82
|      changed iwm addresses for better margin         --  lak 23-sep-82
|      updated to 384 current version (0.5d)           --  lak 10-oct-82
|      added fsinitdbg for filler1 (sysinit, debug)    --  lak 19-oct-82
|      added tagdata field for twiggy driver           --  lak 01-nov-82
|      added drvinstalled field for twiggy driver|
|       changed warmcold to twiggyvars                 --  lak 02-nov-82
|      removed drvinstalled field| removed fib pointers,
|       and changed start of system heap| changed loader
|       variable area                                  --  lak 18 nov 82
|      added a compare string jump vector              --  lak 10 dec 82
|      changed driver definitons, etc.                 --  lak 17 dec 82
|      added via equates                               --  lak 03 jan 83
|      added new i/o param blk equates for new fs      --  lak 17 jan 83
|      added storage manager error codes               --  lak 04 feb 83
|      addw disk cal switch error code                  --  lak 05 feb 83
|      added keyboard task vector in /124 (kybdtask)|
|       broke error codes out into syserr.text
|       added loadtrap lomem var                       --  lak 16 feb 83
|      put dispatch table where macsbug globals used
|       to be and moved down toolbox vars.             --  lak 18 feb 83
|      added dsalerttab pointer                        --  ajh 29 mar 83
|      added bootdrive field                           --  ajh 04 apr 83
|      added pollstack, pollproc, dskerr, dskrtnadr    --  lak 11 apr 83
|      added sonyvars,pwmbuf2                          --  lak 17 apr 83
|      changed screen, pwm address for 512k proto      --  ajh 01 may 83
|      added resource def                              --  bjh 09 may 83
|      added pwmvalue                                  --  lak 09 may 83
|      added heap check hooks                          --  mph 10 may 83
|      changed scc addresses (high bits on)            --  lak 25 may 83
|      added dqfsid,
|       stretched keypadmap to 8 bytes                 --  lak 01 jun 83
|      added mask constant, changed heap check hooks   --  mph 02 jun 83
|      added equates for minstack, defltstack for memory
|       manager| moved unitentries equate to startinit|
|       added unitntrycnt lomem var instead.           --  lak 16 jun 83
|      added "noqueue" bit definition                  --  ajh 23 jun 83
|      added "curiotrap" (replacing "filler3" )        --  ajh 26 jun 83
|      added "fortwiggy" conditional assembly switch   --  ajh 27 jun 83
|      cleaned up: changed unused vars to fillerx equates|
|       changed ardcmd,awrcmd,actlcmd,astscmd to match
|       trap numbers . . .                             --  lak 15 jul 83
|      added mminok for memory manager checking.       --  lak 24 jul 83
|      added mmdefflags for memory manager zone init.  --  lak 31 jul 83
|      added dskverify for disk driver verify/read flag
|        in place of dskdump                           --  lak 06 aug 83
|      removed dneedsstorage equate (no longer used)   --  lak 08 aug 83
|      added loader global definitions, no more spbot  --  ajh 11 aug 83
|      added iwm lomem variable . . .                  --  lak 15 aug 83
|      added evtbufcnt, jcrsrtask, moved findername    --  lak 17 aug 83
|      moved jcrsrtask to grafequ.                     --  lak 18 aug 83
|      added scrap vars to /960  .                     --  sc  18 aug 83
|      added stklowpt var for useful measurements.     --  lak 19 aug 83
|      added doubletime and carettime                  --  sc  19 aug 83
|      added spclikcaret to parameter ram              --  sc  19 aug 83
|      folded spkbd stuff in parameter ram             --  sc  19 aug 83
|      corrected rom size counts (rombsize, romwsize)  --  ajh 22 aug 83
|      added keyclick bit in parameter ram             --  ajh 11 sep 83
|      added growzone handle/pointer warnings          --  sc  12 sep 83
|      added resource manager equates                  --  blh 22 sep 83
|      added 16 bytes of printing globals              --  ajh 30 sep 83
|      added desk ornament message equates,changed events  ajh 08 oct 83
|      added dqdrvsize                                 --  lak 02 nov 83
|      added equates for jgnefilter, scrdmpenb, scrdmptype lak 09 nov 83
|      added screenrow                              -- ajh/wda 10 nov 83
|      added equates for dsalertrect, dsdrawproc,
|        ejectnotify, coreeditvars, qdexist,
|        wwexist and jshell                            --  lak 16 nov 83
|      added equate for alarmstate                     --  lak 22 nov 83
|      added equate for initapplzone notify proc       --  lak 06 dec 83
|      added equates for screen vertical, horiz res    --  lak 19 dec 83
|      added needsgoodbye                              --  ajh 03 jan 84
|      added sysversion                                --  ajh 06 jan 84
|      added dswndupdate, sevtenb flags                --  lak 11 jan 84
|      added fontflag for font manager bug fix         --  ajh 12 jan 84
|_______________________________________________________________________

|________________________________________________________________________
|
|                   system low memory layout
|
|        0000-00ff     exception vectors defined by the hardware
|        0100-0340     system communications area
|        0340-03ff     file system globals (172 bytes used)
|        0400-07ff     system core routine/lisagraf/toolbox dispatch table
|        0800-08ff     mouse/cursor low-memory globals
|        0900-097f     more os stuff
|        0980-0aff     toolbox variables
|        0b00-xxxx     start of system heap
|
|    some other important system data structures are allocated on the heap
|
|________________________________________________________________________

| conditional assembly switch to select twiggy or sony

fortwiggy   =       0

|________________________________________________________________________
|
| system constants
|________________________________________________________________________

| device equates

|   note -- all screen and sound addresses are for the 512k mac,
|   which will also work for the 128k machine since the address
|   space wraps

screenlow       =       /0007a700           | top of screen screen address
soundlow        =       /0007fd00           | low sound buffer address
pwmbuffer       =       /0007fd01           | pwm bytes are low bytes
sndbufwlen      =       /0172               | sound/disk buffer word length
ovlyram         =       /00600000           | low ram address when overlay is on
ovlyscreen      =       /0067a700           | top of screen with overlay

romstart        =       /00400000           | starting address of rom code
romwsize        =       /00008000           | 32768 words in present rom
rombsize        =       /00010000           | 65536 bytes in present rom
memlsize        =       /00008000           | memory contains 32k long words
memwsize        =       /00010000           | 64k words
membsize        =       /00020000           | and 128k bytes
linelen         =       /40                 | horizontal screen line has 64 bytes

| via (6522)
| absolute addresses

vbase           =       /efe1fe             | base address
avbufb          =       vbase               | buffer b
avbufa          =       /effffe             | buffer a
avbufm          =       avbufb              | buffer with mouse button bit
avifr           =       /effbfe             | interrupt flag register
avier           =       /effdfe             | interrupt enable register

| offsets

vbufb           =       512*0               | buffer b
vbufah          =       512*1               | buffer a (with handshake) [ dont use! ]
vdirb           =       512*2               | direction b
vdira           =       512*3               | direction a
vt1c            =       512*4               | timer 1 counter (l.o.)
vt1ch           =       512*5               | timer 1 counter (high order)
vt1l            =       512*6               | timer 1 latch (l.o.)
vt1lh           =       512*7               | timer 1 latch (high order)
vt2c            =       512*8               | timer 2 latch (l.o.)
vt2ch           =       512*9               | timer 2 counter (high order)
vsr             =       512*10              | shift register
vacr            =       512*11              | aux. control reg.
vpcr            =       512*12              | periph. control reg.
vifr            =       512*13              | int. flag reg.
vier            =       512*14              | int. enable reg.
vbufa           =       512*15              | buffer a

vbufd           =       vbufa               | disk head select buffer

| buffer a:

vaout           =       /7f                 | vbufa output bits
vainit          =       /7b                 | vbufa initial values med. volume
vsound          =       /07                 | sound volume bits
vsndpg2         =       3                   | select sound page 2 if 0
voverlay        =       4                   | overlay bit (overlay when 1)
vheadsel        =       5
vpage2          =       6                   | select video page 2 if 0
vsccwrreq       =       7                   | scc write/request line

| buffer b:

vbout           =       /87                 | vbufb output bits
vbinit          =       /07                 | vbufb initial values
rtcdata         =       0
rtcclk          =       1
rtcenb          =       2                   | enabled when 0
vsw             =       3                   | mouse switch (0 when down)
vx2             =       4                   | mouse x level
vy2             =       5                   | mouse y level
vh4             =       6                   | horizontal sync
vsndenb         =       7                   | /sound enable (reset when 1)

| note: ca1 = vsync
|       ca2 = 1 sec clock
|       cb1,cb2 are keyboard interface.

|________________________________________________________________________
|
| scc serial chip addresses

sccrbase        =       /9ffff8             | scc base read address
sccwbase        =       /bffff9             | scc base write address

adata           =       6                   | offset for a channel data
actl            =       2                   | offset for a channel control
bdata           =       4                   | offset for b channel data
bctl            =       0                   | offset for b channel control

sccdata         =       4                   | general offset for data from control
sccwrite        =       /200001             | general offset for write from read

rxbf            =       0                   | scc receive buffer full
txbe            =       2                   | scc transmit buffer empty

|________________________________________________________________________
|
| disk address

dbase           =       /dfe1ff             | disk address base
dph0l           =       dbase               | phase 0 low
dph0h           =       /dfe3ff             | phase 0 high
dmtroff         =       /dff1ff             | iwm motor off
dmtron          =       /dff3ff             | iwm motor on
diskq6l         =       /dff9ff             | shift register
diskq6h         =       /dffbff
diskq7l         =       /dffdff
diskq7h         =       /dfffff

ph0l            =       512*0               | disk address offsets from base
ph0h            =       512*1
ph1l            =       512*2
ph1h            =       512*3
ph2l            =       512*4
ph2h            =       512*5
ph3l            =       512*6
ph3h            =       512*7

mtroff          =       512*8
mtron           =       512*9
intdrive        =       512*10              | enable internal drive address
extdrive        =       512*11              | enable external drive address
q6l             =       512*12
q6h             =       512*13
q7l             =       512*14
q7h             =       512*15

|________________________________________________________________________
|
|  interrupt auto-vector and exception definitions
|________________________________________________________________________

line1010        =       /28                 | 1010 emulator trap (system routines)
line1111        =       /2c                 | 1111 emulator trap (reserved)
autoint1        =       /64                 | level 1 auto-vector
autoint2        =       /68                 | level 2 auto-vector
autoint3        =       /6c                 | level 3 auto-vector
autoint4        =       /70                 | level 4 auto-vector
autoint5        =       /74                 | level 5 auto-vector
autoint6        =       /78                 | level 6 auto-vector
autoint7        =       /7c                 | level 7 auto-vector

|________________________________________________________________________
|
| syscom equates (system communication area)
|________________________________________________________________________

syscom          =       /100            | start of system communication area

| system locations

monkeylives     =       /100            | monkey lives if >= 0
scrvres         =       /102            | screen vertical resolution (dots/inch)
scrhres         =       /104            | screen horizontal resolution (dots/inch)
screenrow       =       /106            | rowbytes of mac screen
memtop          =       /108            | ptr to top of memory
bufptr          =       /10c            | ptr to bottom of code buffer
stklowpt        =       /110            | lowest stack as measured in vbl task
heapend         =       /114            | ptr to end of heap
thezone         =       /118            | ptr to current heap zone
utablebase      =       /11c            | ptr to unit i/o table
macjmp          =       /120            | ptr to macsbug jumptable

dskrtnadr       =       /124            | temp for disk driver
twiggyvars      =       /128            | ptr to twiggy driver locals
dskverify       =       /12c            | used by sony driver for read/verify
loadtrap        =       /12d            | set to non-zero to trap before pgm strt
mminok          =       /12e            | non-zero when initial mem mngr cks ok
dskwr11         =       /12f            | try 1-1 disk writes when non-zero
appllimit       =       /130            |

sonyvars        =       appllimit+4     | pointer to 3-1/2 disk driver vars
pwmvalue        =       sonyvars+4      | current pwm value
pollstack       =       pwmvalue+2      | scc poll data start stack location
pollproc        =       pollstack+4     | proc which handles scc poll data
dskerr          =       pollproc+4      | disk routine result code

sysevtmask      =       dskerr+2        | system event mask
sysevtbuf       =       sysevtmask+2    | ptr to system event queue element buffer
eventqueue      =       sysevtbuf+4     | 5 words, event queue header
evtbufcnt       =       eventqueue+10   | max number of events in sysevtbuf - 1

rndseed         =       evtbufcnt+2
sysversion      =       rndseed+4       | version # of ram-based system
sevtenb         =       sysversion+2    | 1 byte: 0 disables sysevent calls from gne
dswndupdate     =       sevtenb+1       | 1 byte: 0 flags gne to paintbehind ds alertrect
fontflag        =       dswndupdate+1   | boolean for font manager bug
filler3         =       fontflag+1      | 1 byte of filler

vblqueue        =       filler3+1       | 5 words, vbl queue header
ticks           =       vblqueue+10     | tick count, time since boot in 1/60 increments
mbticks         =       ticks+4         | tick count when mouse button last changed
mbstate         =       mbticks+4       | current mouse button state
tocks           =       mbstate+1       | lisa sub-tick count

keymap          =       mbstate+2       | 2 longs, a bitmap of the keyboard
keypadmap       =       keymap+8        | 1 long, a bitmap for numeric pad-18bits
keylast         =       keypadmap+8     | lo byte: ascii for last valid keycode
                                        | hi byte: last valid keycode
                                        | these are 0 when no key is down
keytime         =       keylast+2       | long tickcount when keylast was rec'd
keyreptime      =       keytime+4       | long tickcount when key was last repeated
keythresh       =       keyreptime+4    | word containing threshold for repeat
keyrepthresh    =       keythresh+2     | word containing repeat speed

lvl1dt          =       keyrepthresh+2  | interrupt level 1 dispatch table
lvl2dt          =       lvl1dt+32       | interrupt level 2 dispatch table

unitntrycnt     =       lvl2dt+32       | count of entries in unit table
via             =       unitntrycnt+2   | via base address (use low memory addresses)
sccrd           =       via+4           | scc base read address (to save code space)
sccwr           =       sccrd+4         | scc base write address
iwm             =       sccwr+4         | iwm base address

getparam        =       iwm+4           | parameter blk for reading sys parameter area

sysparam        =       getparam+20     | 20 bytes of system parameter area
spvalid         =       sysparam        | byte 1  = validation field (/a7)
spodometer      =       spvalid+1       |    2-4  = odometer
spporta         =       spodometer+3    |    5-6  = scc port a configuration
spportb         =       spporta+2       |    7-8  = scc port b configuration
spalarm         =       spportb+2       |    9-12 = alarm time
spfont          =       spalarm+4       |   13-14 = default font id
spkbd           =       spfont+2        |      15 = kbd repeat thresh in 4/60ths(4)
                                        |           kbd repeat rates in 2/60ths(4)
spprint         =       spkbd+1         |      16 = print stuff
spvolctl        =       spprint+1       |      17 = volume control (low 3 bits)
spclikcaret     =       spvolctl+1      |      18 = double time in 4/60ths(4)
                                        |           caret blink time in 4/60ths(4)
spmisc1         =       spclikcaret+1   |      19 = english/metric (1),
                                        |           extra (2),
                                        |           country code (5)
spmisc2         =       spmisc1+1       |      20 = paranoia level (1), mouse
                                        |           scaling(1), keyclick (1), boot
                                        |           disk (1), menu flash (2), help
                                        |           level (2)
time            =       sysparam+20     | clock time when last read (extrapolated)
bootdrive       =       time+4          | drive number of boot drive

jshell          =       time+6          | used by journaling shell . . .
filler3a        =       jshell+2        | used by standard file

kbdvars         =       filler3a+2      | keyboard manager variables (4 bytes)
jkybdtask       =       kbdvars+4       | keyboard vbl task hook
kbdtype         =       jkybdtask+4     | high byte holds keyboard model number
alarmstate      =       kbdtype+1       | bit7=parity, bit6=beeped, bit0=1=enabled

curiotrap       =       kbdtype+2       | trap the caused current io transaction

diskvars        =       curiotrap+2     | disk driver variables (62 bytes)

sdvolume        =       diskvars+62     | global volume control (1 byte)
sdenable        =       sdvolume+1      | byte to enable 4 voice engine
soundvars       =       sdenable+1      | sound driver variables (really only 20 bytes)

soundptr        =       soundvars       |pointer to 4ve sound definition table
soundbase       =       soundptr+4      |base address of sound bitmap
soundvbl        =       soundbase+4     |vertical retrace control element
sounddce        =       soundvbl+16     |pointer to sound driver dce
soundactive     =       sounddce+4      |boolean specifying if sound is enabled
soundlevel      =       soundactive+1   |byte specifying current level in buffer
curpitch        =       soundlevel+1    |word holding current pitch value

soundlast       =       curpitch+2      |address past last sound variable

screenvars      =       soundvars+48    | screen driver variables

jgnefilter      =       screenvars+8    | getnextevent filter proc

key1trans       =       jgnefilter+4    | pointer to procedure handling keyboard
                                        |  key translation
key2trans       =       key1trans+4     | pointer to procedure handling numeric
                                        |  keypad key translation
syszone         =       key2trans+4     | pointer to system heap zone
applzone        =       syszone+4       | pointer to application heap zone
rombase         =       applzone+4      | start of rom addresses (jump table?)
rambase         =       rombase+4       | start of ram addresses
basicglob       =       rambase+4       | pointer to basic globals
dsalerttab      =       basicglob+4     | pointer to deep shit alerts
extstsdt        =       dsalerttab+4    | scc ext/sts secondary dispatch table
sccasts         =       extstsdt+16     | scc read reg 0 last ext/sts rupt - a
sccbsts         =       sccasts+1       | scc read reg 0 last ext/sts rupt - b
serialvars      =       sccbsts+1       | async driver variables
findername      =       serialvars+16   | 16 byte name of finder
doubletime      =       findername+16   | double click time(set up by boot blocks)
carettime       =       doubletime+4    | caret blink time
scrdmpenb       =       carettime+4     | screen dump enabled when non-zero
scrdmptype      =       scrdmpenb+1     | ff dumps screen, fe dumps front window
tagdata         =       scrdmptype+1    | sector tag info for twiggy drivers
drvqhdr         =       tagdata+14      | queue header of drive numbers in system
pwmbuf2         =       drvqhdr+10      | pointer to pwm buffer 1 (or 2 if sound
                                        |  buffer 2 is being used)
hpchk           =       pwmbuf2+4       | points to heap check ram code
maskbc          =       hpchk+4         | memory manager byte count mask
maskhandle      =       maskbc          | memory manager handle mask
maskptr         =       maskbc          | memory manager pointer mask
minstack        =       maskbc+4        | min stack size (1024) used in initapplzone
defltstack      =       minstack+4      | default size of stack (for growing azone)
mmdefflags      =       defltstack+4    | default zone flags
gzroothnd       =       mmdefflags+2    | root handle for growzone
gzrootptr       =       gzroothnd+4     | root pointer for growzone
gzmovehnd       =       gzrootptr+4     | moving handle for growzone
dsdrawproc      =       gzmovehnd+4     | alternate deepshit box draw proc
ejectnotify     =       dsdrawproc+4    | proc to call and notify upon ejects
iaznotify       =       ejectnotify+4   | proc to call and notify upon world swaps
endofvars       =       iaznotify+4     | end of final defined vars

|________________________________________________________________________
|
| the file system local variables are kept from /340 to /3ff
|________________________________________________________________________

filevars    =       /340                |
dsalertrect =       /3f8                | rectangle for disk-switch alert

|________________________________________________________________________
|
|   system core routine dispatch table resides from /400-/7ff.  the user
|   can intercept any core routine by changing these pointers.
|________________________________________________________________________

dispatchtab     =       /400

|________________________________________________________________________
|
|    the cursor jump table interface and cursor state variables start at /800
|    for their definitions, see the file "grafequ.text". starting at /8fc and
|    working down we have addresses of os routines which are not accessed
|    through traps.
|________________________________________________________________________

wwexist         =       /8f2            | zero when window manager is initialized
qdexist         =       /8f3            | zero when quickdraw is initialized
jfetch          =       /8f4            | fetch a byte routine for i/o drivers
jstash          =       /8f8            | stash a byte routine for i/o drivers
jiodone         =       /8fc            | iodone entry location


loadvars        =       /900            | loader variables

| low-memory loader globals

curaprefnum    =         loadvars            | refnum of current resfile
launchflag     =         curaprefnum+2       | boolean to distinguish launch/chain
currenta5      =         launchflag+2        | current value of a5
curstackbase   =         currenta5+4         | current stack base
loadfiller     =         curstackbase+4      | empty for now...
curapname      =         loadfiller+4        | place to save name of application
saveseghandle  =         curapname+32        | place to save seg 0 handle
curjtoffset    =         saveseghandle+4     | word for current jump table offset
curpageoption  =         curjtoffset+2       | current page 2 configuration word
loaderpblock   =         curpageoption+4     | param block for internal exittoshell
lastlglobal    =         loaderpblock+10     | address past last loader global

printvars      =         lastlglobal         | 16 bytes for owen
lastpglobal    =         printvars+16        | address of last global
coreeditvars   =         lastpglobal         | 12 bytes for core edit

| low memory vars for the scrap manager

scrapvars   =           /960

scrapinfo   =           scrapvars               | scrap info
scraphandle =           scrapinfo+4             | handle to memory scrap
scrapcount  =           scraphandle+4           | validation byte
scrapstate  =           scrapcount+2            | state of scrap defined below
scrapname   =           scrapstate+2            | pointer to scrap name
scraptag    =           scrapname+4             | actual name goes here
scrapend    =           scraptag+16             | end of scrap vars


toolvars        =       /980            | toolbox variables

|________________________________________________________________________
|
| finally, we have the start of the heap.  note that some important system
| tables are kept on the heap.
|
|________________________________________________________________________

heapstart       =       /0b00           | start of the heap

|________________________________________________________________________
|
| system data structures
|
|________________________________________________________________________

lock            =       7           | lock bit in a master pointer
purge           =       6           | bit for purgeable/unpurgeable
resource        =       5           | bit to flag a resource handle

| queue header definition

qheadsize       =       10          | a queue header is 10 bytes long

qflags          =       0           | misc. flags
qhead           =       2           | 32-bit ptr to first element
qtail           =       6           | 32-bit ptr to last element
qinuse          =       7           | queue-in-use flag bit

| queue element type definitions

vtype           =       1           | vbl queue element is type 1
ioqtype         =       2           | i/o queue element is type 2
timertype       =       3           | timer queue element is type 3
evtype          =       4           | event queue element is type 4
fsqtype         =       5           | file system vcb element

| general purpose queue element definition

qlink           =       0           | link to next queue element
qtype           =       4           | queue element type

| drive queue element offsets

dqellnth    =       12              | drive queue element length including hdr
|change to 14 except for sony driver!
dqdrive     =       6               | drive number
dqrefnum    =       8               | driver refnum
dqfsid      =       10              | file system handling this drive
dqdrvsize   =       12              | number of blocks this drive

| unit table definition -- there is one entry in the unit table for each
| logical driver.  the number of entries is hardwired to 16.  each entry consists
| of one 32-bit memory handle| the first entry corresponds to refnum -1, the
| last to refnum -32.  the unit table is made during sysinit time and is
| allocated from permanent system memory| lo-memory location utablebase points
| to the table. unitntrycnt is initialized to unitentries by startinit: all
| other code should use this low mem variable.

| device control entry definition: for each unit table entry, one driver may be
| installed.  if the driver is installed, the corresponding memory handle in the
| unit table will be the handle of a device control entry.

dctlentrysize   =       40          | each entry is 40 bytes long

dctldriver      =       0           | offset of pointer to driver
dctlflags       =       4           | offset of flags word
dctlqueue       =       6           | offset of queue header
dctlqhead       =       8           | offset of queue first-element pointer
dctlqtail       =       12          | offset of queue last-element pointer
dctlposition    =       16          | offset of longword position pointer
dctlstorage     =       20          | handle of driver's private storage
dctlrefnum      =       24          | refnum of this driver
dctlcurticks    =       26          | long counter for timing systemtask calls
dctlwindow      =       30          | pointer to driver's window (if any)
dctldelay       =       34          | word for number of ticks between systask calls
dctlemask       =       36          | word for desk ornament event mask
dctlmenu        =       38          | word for menu associated with driver

| vertical blanking control block queue element

vblink          =       0           | link to next element
vbltype         =       4           | unique id for validity check
vbladdr         =       6           | address of service routine
vblcount        =       10          | count field for timeout
vblphase        =       12          | phase to allow synchronization
|
invbl           =       6           | bit index for "in vbl" flag


| driver format definitions

drvrflags       =        0          | various flags and permissions
drvrdelay       =        2          | word indicating # of ticks between systask calls
drvremask       =        4          | word indicating what events to accept
drvrmenu        =        6          | word indicating driver menu id
drvropen        =        8          | word offset to open routine
drvrprime       =       10          | word offset to prime routine
drvrctl         =       12          | word offset to control routine
drvrstatus      =       14          | word offset to status routine
drvrclose       =       16          | word offset to warmstart reset routine
drvrname        =       18          | length byte and name of driver

| driver flags word bit field definitions

dreadenable     =       0           | driver enabled for read operations
dwritenable     =       1           | driver enabled for writing
dctlenable      =       2           | driver enabled for control operations
dstatenable     =       3           | driver enabled for status operations
dneedgoodbye    =       4           | driver needs a "goodbye kiss"
dneedtime       =       5           | driver needs "main thread" time
dneedlock       =       6           | driver needs to be accessed at interrupt level

| run-time flags (in dctlflags+1)

dopened         =       5           | flag to mark driver 'open'
drambased       =       6           | 1=ram-based driver, 0=rom-based
drvractive      =       7           | flag to mark the driver active

| desk ornament message definitions

accevent        =       64          | feedevent message
accrun          =       65          | systemtask "run" message
acccursor       =       66          | cursor message for topmost window
accmenu         =       67          | menu message
acccut          =       68          | cut message from system edit
acccopy         =       69          | copy message from system edit
accpaste        =       70          | paste message from system edit
accundo         =       71          | undo message from system edit
accclear        =       72          | clear message from system edit


|  general system equates:

ioqelsize   =       50          | length of i/o parameter block

iolink      =       0           | queue link in header
iotype      =       4           | type byte for safety check
iotrap      =       6           | fs: the trap
iocmdaddr   =       8           | fs: address to dispatch to

iocompletion =      12          | long pointer to completion routine
ioresult    =       16          | io result code (=d0 if sync call)

iofilename  =       18          | file name pointer
iovrefnum   =       22          | volume refnum
iodrvnum    =       iovrefnum   | (used for eject and mountvol)
iorefnum    =       24          | reference number for i/o operation

iofiletype  =       26          | specified along with filename (byte)
iopermssn   =       27          | open: permissions (byte)

ionewname   =       28          | rename: new name pointer (4)
ioleof      =       28          | geteof,seteof: logical end-of-file (4)
ioownbuf    =       28          | open: optional ptr to locked 522-byte buffer
ionewtype   =       28          | setfiletype: new type byte (1)

iobuffer    =       32          | data buffer pointer
iobytecount =       36          | requested byte count
ioreqcount  =       36          | (equate used by file system allocate)
ionumdone   =       40          | actual byte count completed
ioactcount  =       40          | (equate used by file system allocate)

ioposmode   =       44          | initial file positioning mode, eol char
ioposoffset =       46          | file position offset (long word)

noqueuebit  =       9           | tells i/o system not to queue the request
asyntrpbit  =       10          | bit in high byte of trap specifying async

| equates specific to  getfileinfo,setfileinfo

iofqelsize  =       80          | file command parameter block byte length
                                | 1st 28 bytes are the same as the general block
iofdirindex =       28          | getfileinfo - directory index
ioflattrib  =       30          | getfileinfo - in-use bit=7, lock bit=0
ioffltype   =       31          |  file type
ioflusrwds  =       32          | get, setfileinfo - user info (16 bytes)
iofflnum    =       48          | getfileinfo - file number

ioflstblk   =       52          | getfileinfo - start file block (0000 if none)
iofllglen   =       54          |  file logical length (eof)
ioflpylen   =       58          |  file physical length in bytes.
ioflrstblk  =       62          |  start file block, resource fork (0000 if none)
ioflrlglen  =       64          |  file logical length (eof), resource fork
ioflrpylen  =       68          |  file physical length, resource fork

ioflcrdat   =       72          |  file creation date & time (32 bits in seconds)
ioflmddat   =       76          |  last modification date & time (32 bits in seconds)

| equates specific to getvolinfo,getvolume,setvolume,mountvol,unmountvol,eject

iovqelsize  =       64          | volume command parameter block byte length
iovdrvnum   =       iovrefnum   | 1st 28 bytes are the same as the general block
iovnptr     =       iofilename
iovolindex  =       28          | getvol: volume index number

iovcrdate   =       30          | getvolinfo: creation date & time
iovlsbkup   =       34          | getvolinfo: last backup date & time
iovatrb     =       38          | getvolinfo: volume attributes
iovnmfls    =       40          | getvolinfo: # files in directory
iovdirst    =       42          | getvolinfo: start block of file dir
iovblln     =       44          | getvolinfo: length of dir in blocks
iovnmalblks =       46          | getvolinfo: num blks (of alloc size) this dev
iovalblksiz =       48          | getvolinfo: alloc blk byte size
iovclpsiz   =       52          | getvolinfo: bytes to try to allocate at a time
ioalblst    =       56          | starting diskette (512-byte) block in block map
iovnxtfnum  =       58          | getvolinfo: next free file number
iovfrblk    =       62          | getvolinfo: word of # free alloc blks for this vol

| i/o command equates for i/o queue elements (match trap numbers)

ardcmd      =       2           | read command
awrcmd      =       3           | write command
actlcmd     =       4           | control command
astscmd     =       5           | status command

| special offsets for the control and status core routines

cscode      =      26           | a word for the control/status code
csparam     =      28           | operation-defined parameters (20-bytes max)

| system event definitions

nullevt         =       0           | event 0 is the null event
mbutdwnevt      =       1           | mouse button down is event 1
mbutupevt       =       2           | mouse button up is event 2
keydwnevt       =       3           | key down is event 3
keyupevt        =       4           | key up is event 4
autokeyevt      =       5           | auto-repeated key is event 5
updatevt        =       6           | update event
diskinsertevt   =       7           | disk-inserted event
activateevt     =       8           | activate/deactive event
abortevt        =       9           | abort?
networkevt      =       10          | network event
reserveevt      =       10          | reserved for system use
iodrvrevt       =       11          | driver-defined event

app1evt         =       12          | application defined events
app2evt         =       13
app3evt         =       14
app4evt         =       15

| event record definition

evtmax          =       30          | maximum number of events in buffer
evtblksize      =       16          | size in bytes of the event record
evtqblksize     =       evtblksize+6| size of event record counting queue info

evtnum          =       0           | word containing id number of event
evtmessage      =       2           | longword containing event-defined msg
evtticks        =       6           | longword holding ticks when event occured
evtmouse        =       10          | longword holding mouse pos when event occured
evtmeta         =       14          | byte containing meta key flags
evtmbut         =       15          | byte indicating state of mouse button

| system device constants

dskrfn      =       /fffb   | disk's reference number

| control call codes

ejectcode   =       7       | control call eject code
killcode    =       1       | killio code

| status call codes

drvstscode  =       8       | status call code for drive status

| resource manager equates

| high bits of the locn long-word--the resource attributes:
| (code optimization used frequently is a tstb a2@(rattr) instead
| of btst #ressysref, a2@(rattr).  this saves a lot of bytes
| in rmgr)

ressysref       =       7               | reference to system/local reference
ressysheap      =       6               | in system/in application heap
respurgeable    =       5               | purgeable/not purgeable
reslocked       =       4               | locked/not locked
resprotected    =       3               | protected/not protected
respreload      =       2               | read in on openresource?
reschanged      =       1               | existing resource changed since last update
resuser         =       0               | user defined resource attribute.

| when reading/writing, clear reschanged bit.

rcbmask         =       /fd             | reschanged, byte mask and.

| mattr map attributes and masks

mapreadonly     =       7               | is this file read-only?
mapcompact      =       6               | is a compact necessary?
mapchanged      =       5               | is it necessary to write map?

mccmask         =       /60             | mapcompact + mapchanged
mchmask         =       /20             | mapchanged
mcomask         =       /40             | mapcompact



      | getvolinfo: alloc blk byte size
iovclpsiz   =       52          | getvolinfo: bytes to try to allocate at a time
ioalblst    =       56          | starting diskette (512-byte) block in block map
iovnxtfnum  =       58          | getvolinfo: next free file number
iovfrblk    =       62          | getvolinfo: wordsumacc/h/syserr.h   444      0     12       23020  3470501351   7243 | file syserr.text - macintosh system error equates file.
|__________________________________________________________________
|
|
| all system routines reporting errors include this equate file.
|
| modification history:
| 16 feb 83  lak  broke out from sysequ.text
| 22 feb 83  lak  added equates from sysutil and events.
| 10 may 83  mph  added new memory manager error codes.
| 07 jun 83  lak  adjusted error codes for file system
| 15 jun 83  ajh  added deep shit error definitions
| 23 jun 83  lak  added initiwmerr for sony driver.
| 18 jul 83  lak  added more memory manager deep shit errors.
| 11 aug 83  lak  added more disk driver error codes.
| 17 aug 83  lak  added file system deep shit error code.
| 18 aug 83  sc   added scrap manager error codes.
| 19 aug 83  lak  added stackinheap deep shit code.
| 21 aug 83  lak  added spdadjerr, seekerr, and sectnferr for disk driver.
|                 removed badnyberr| moved clock/pram error codes up by 4.
| 23 aug 83  lak  added notopenerr for drivers.
| 27 aug 83  ajh  added memfull deep shit alert
| 06 sep 83  ajh  added dsbadlaunch
| 22 sep 83  blh  added resource mgr errors
| 10 oct 83  lak  added noerr equate
| 13 oct 83  lak  added noerr, dsreinsert equates, dsnotthe1
|__________________________________________________________________

| general system errors (vbl mgr, queueing, etc.)

noerr       =        0      | success is absence of errors
qerr        =       -1      | queue element not found during deletion
vtyperr     =       -2      | invalid queue element
corerr      =       -3      | core routine number out of range
unimperr    =       -4      | unimplemented core routine

| i/o system errors

controlerr  =       -17
statuserr   =       -18
readerr     =       -19
writerr     =       -20
baduniterr  =       -21
unitemptyerr =      -22
openerr     =       -23
closerr     =       -24
dremoverr   =       -25     | tried to remove an open driver
dinsterr    =       -26     | drvrinstall couldn't find driver in resources
aborterr    =       -27     | io call aborted by killio
notopenerr  =       -28     | couldn't rd/wr/ctl/sts cause driver not opened

|  file system error codes:

dirfulerr   =       -33     | directory full
dskfulerr   =       -34     | disk full
nsverr      =       -35     | no such volume
ioerr       =       -36     | i/o error (bummers)
bdnamerr    =       -37     | there may be no bad names in the final system!
fnopnerr    =       -38     | file not open
eoferr      =       -39     | end of file
poserr      =       -40     | tried to position to before start of file (r/w)
mfulerr     =       -41     | memory full(open) or file won't fit (load)
tmfoerr     =       -42     | too many files open
fnferr      =       -43     | file not found

wprerr      =       -44     | diskette is write protected
flckderr    =       -45     | file is locked
vlckderr    =       -46     | volume is locked
fbsyerr     =       -47     | file is busy (delete)
dupfnerr    =       -48     | duplicate filename (rename)
opwrerr     =       -49     | file already open with with write permission
paramerr    =       -50     | error in user parameter list
rfnumerr    =       -51     | refnum error
gfperr      =       -52     | get file position error
volofflinerr =      -53     | volume not on line error (was ejected)
permerr     =       -54     | permissions error (on file open)
volonlinerr =       -55     | drive volume already on-line at mountvol
nsdrverr    =       -56     | no such drive (tried to mount a bad drive num)
nomacdskerr =       -57     | not a mac diskette (sig bytes are wrong)
extfserr    =       -58     | volume in question belongs to an external fs
fsdserr     =       -59     | file system deep s--t error:
                            |  during rename the old entry was deleted but could
                            |   not be restored . . .
badmdberr   =       -60     | bad master directory block
wrpermerr   =       -61     | write permissions error

| disk, serial ports, clock specific errors

nodriveerr  =       -64     | drive not installed
offlinerr   =       -65     | r/w requested for an off-line drive

nonyberr    =       -66     | couldn't find 5 nybbles in 200 tries
noadrmkerr  =       -67     | couldn't find valid addr mark
datavererr  =       -68     | read verify compare failed
badcksmerr  =       -69     | addr mark checksum didn't check
badbtslperr =       -70     | bad addr mark bit slip nibbles
nodtamkerr  =       -71     | couldn't find a data mark header
baddcksum   =       -72     | bad data mark checksum
baddbtslp   =       -73     | bad data mark bit slip nibbles
wrunderrun  =       -74     | write underrun occurred

cantsteperr =       -75     | step handshake failed
tk0baderr   =       -76     | track 0 detect doesn't change
initiwmerr  =       -77     | unable to initialize iwm
twosideerr  =       -78     | tried to read 2nd side on a 1-sided drive
spdadjerr   =       -79     | unable to correctly adjust disk speed
seekerr     =       -80     | track number wrong on address mark
sectnferr   =       -81     | sector number never found on a track

clkrderr    =       -85     | unable to read same clock value twice
clkwrerr    =       -86     | time written did not verify
prwrerr     =       -87     | parameter ram written didn't read-verify
priniterr   =       -88     | initutil found the parameter ram uninitialized

rcvrerr     =       -89     | scc receiver error (framing, parity, or)
breakrecd   =       -90     | break received (scc)

| storage allocator error codes

memfullerr  =       -108    | not enough room in heap zone
nilhandleerr =      -109    | handle was nil in handlezone or other|
memwzerr    =       -111    | whichzone failed (applied to free block)|
mempurerr   =       -112    | trying to purge a locked or non-purgable block|

memadrerr   =       -110    | address was odd, or out of range|
memazerr    =       -113    | address in zone check failed|
mempcerr    =       -114    | pointer check failed|
membcerr    =       -115    | block check failed|
memscerr    =       -116    | size check failed|

| resource manager error codes (other than i/o errors)

resnotfound     =       -192            | resource not found
resfnotfound    =       -193            | resource file not found
addresfailed    =       -194            | addresource failed
addreffailed    =       -195            | addreference failed
rmvresfailed    =       -196            | rmveresource failed
rmvreffailed    =       -197            | rmvereference failed

| scrap manager error codes

noscraperr  =       -100    | no scrap exists error
notypeerr   =       -102    | no object of that type in scrap


| application error codes
|
|  errors -1024 to -4095 are reserved for use by the current application


|  deep shit alert id definitions

dssyserr     =      32767   | general system error
dsbuserror   =      1       | bus error
dsaddresserr =      2       | address error
dsillinsterr =      3       | illegal instruction error
dszerodiverr =      4       | zero divide error
dschkerr     =      5       | check trap error
dsovflowerr  =      6       | overflow trap error
dspriverr    =      7       | privelege violation error
dstraceerr   =      8       | trace mode error
dslineaerr   =      9       | line 1010 trap error
dslineferr   =     10       | line 1111 trap error
dsmiscerr    =     11       | miscellaneous hardware exception error
dscoreerr    =     12       | unimplemented core routine error
dsirqerr     =     13       | uninstalled interrupt error

dsiocoreerr  =     14       | io core error
dsloaderr    =     15       | segment loader error
dsfperr      =     16       | floating point error

dsnopackerr  =     17       | package 0 not present
dsnopk1      =     18       | package 1 not present
dsnopk2      =     19       | package 2 not present
dsnopk3      =     20       | package 3 not present
dsnopk4      =     21       | package 4 not present
dsnopk5      =     22       | package 5 not present
dsnopk6      =     23       | package 6 not present
dsnopk7      =     24       | package 7 not present

dsmemfullerr =     25       | out of memory!
dsbadlaunch  =     26       | can't launch file

dsstknheap   =     28       | stack has moved into application heap
dsfserr      =     27       | file system map has been trashed
dsreinsert   =     30       | request user to reinsert off-line volume
dsnotthe1    =     31       | not the disk i wanted

| storage allocator trouble codes (deep shit ids)

memtrbbase  =       32              | memory manager trouble code base.
mtsetlog    =       memtrbbase      | set logical size error.
mtadjfre    =       memtrbbase+1    | adjust free error.
mtadjcnt    =       memtrbbase+2    | adjust counters error.
mtmkebkf    =       memtrbbase+3    | make block free error.
mtsetsiz    =       memtrbbase+4    | set size error.
mtinitmem   =       memtrbbase+5    | initialize memory manager error.
mtbcerr     =       memtrbbase+6    |
mtczerr     =       memtrbbase+7    |
mtcz1err    =       memtrbbase+8    |
mtcz2err    =       memtrbbase+9    |
mtcz3err    =       memtrbbase+10   |
mteqcerr    =       memtrbbase+11   |
mtevcerr    =       memtrbbase+12   |
mthcerr     =       memtrbbase+13   |
mtpcerr     =       memtrbbase+14   |
mtscerr     =       memtrbbase+15   |
mtrc1err    =       memtrbbase+16   |
mtrc2err    =       memtrbbase+17   |
mtsaberr    =       memtrbbase+18   |
mtacerr     =       memtrbbase+19   |
mtizcerr    =       memtrbbase+20   |
mtprcerr    =       memtrbbase+21   |

| some miscellaneous result codes

evtnotenb   =         1     | event not enabled at postevent
noevtavail  =        -1     | no event available (getosevent,oseventavail)

handle was nil in handlezone or other|
memwzerr    =       -111    | whichzone failed (applied to free block)|
mempurerr   =       -112    | trying to purge a locked or non-purgable block|

memadrerr   =       -110    | address was odd, or out of range|
memazerr    =       -113    | address in zone check failed|
mempcerr    =       -114    | pointer check failed|
membcerr    =       -115    | block check failed|
memscerr    =       -116    | size check failed|

| resource manager error codessumacc/h/toolequ.h   444      0     12       65610  3470501352   7420 |file toolequ.text
|--------------------------------------------------------------------------------
|
|  user interface toolbox equate file
|
|     this file contains global variable and data structure
|  definitions for the macintosh user interface toolbox.
|  it is included with all toolbox source files and
|  possibly with some application programs.
|
|  written by andy hertzfeld    may 5, 1982
|
|  modification history:
|
|     ajh  23-may-82    added window stuff
|     ajh  22-jun-82    added icon stuff
|     ajh  27-jun-82    added menu stuff
|     ajh  31-jul-82    added control stuff| changed menu data structures
|     ajh  10-aug-82    got rid of scrapwindow
|     ajh  29-aug-82    added dragpattern,ishapehook to globals, dragmsg to controls
|     ajh  06-sep-82    added growwindow message
|     ajh  12-sep-82    got rid of alert and dialog window| added oneone, minusone
|     ajh  14-sep-82    changed for new font manager
|     ajh  20-sep-82    added "goaway" boolean to windows| added symbolptr globals
|     blh  24-sep-82    added alert, dialog globals and data structures
|     ajh  05-oct-82    added contrlaction field to control data structure
|     blh   7-oct-82    added indirect globals--took main globals out of low mem
|     ajh  12-oct-82    switched over to new font manager globals| grafport now 64 bytes
|     ajh  16-nov-82    added tasklock for desk manager
|     ajh  21-nov-82    lglobals,gportsize change for rom 1.8
|     blh  17-dec-82    changed dialog, resource constants and globals
|     blh  19-dec-82    changed names for resource upheaval
|     ajh  19-dec-82    added curactive,curdeactive,deskhook globals
|     ajh  24-dec-82    made defprocs defhandles, other data structure changes
|     ajh  28-dec-82    broke off resource type and id defs into separate file
|     ajh  05-jan-83    moved global base to /e80| put dialog stuff at end
|     ajh  24-jan-83    replaced miconlist with mbarenable
|     blh   5-feb-83    removed alertwindow, dialogwindow globals.  changed
|                       dialog data structure defs.
|     ajh   5-feb-83    added microsoft bytes, other changes
|     ajh   6-feb-83    globals for scaling font manager
|     ajh  12-feb-83    got rid of checkflag, made curdragaction 4 bytes long
|     ajh   6-mar-83    added gotstrike field for fontmgr (used byte from defsize)
|     ajh   7-mar-83    added scaledisable
|     ajh   5-apr-83    added ghostwindow field in microsoft globals
|     blh  20-apr-83    changed alert and dialog templates. removed alertkind.
|     sc   20-apr-83    added journal stuff at end
|     sc   09-may-83    added text edit defs, changed dialogs
|     ajh  10-may-83    added closeornhook, fpaddress
|     ajh  25-may-83    added apppacks table
|     ajh  31-may-83    changed size of grafport for new quickdraw, added sysresname
|     ajh  02-jun-83    changed picscrap to thescrap
|     ajh  08-jun-83    added appparmhandle
|     ajh  14-jun-83    added dserrcode
|     sc   23-jun-83    removed systemkind (it's now any negative number)
|     ajh  05-jul-83    made it match the documentation
|     sc   05-aug-83    new te record
|     ajh  05-aug-83    added wgiconmsg to window defproc messages
|     blh  06-aug-83    added reserrproc at end of tool globals.  made lastmap
|                       a temporary filler.
|     sc   15-aug-83    dropped scrapinfo, thescrap
|     ajh  28-aug-83    changed applemark, checkmark to final values
|     ajh  29-aug-83    added "trackctl" message
|     blh   6-sep-83    added resreadonly global, replacing rfiller.
|     sc    9-sep-83    added tewdbreak for european stuff.
|     ajh  12-sep-83    added curdekind
|
|-----------------------------------------------------------------------------------

|
| important constants
|
screenwidth     =       512
screenheight    =       342
screenradius    =       /00100010       |rounded corners for desk area
gportsize       =       108             |a grafport is 108 bytes
|

|------------------------------------------------------------
|
| toolbox global variables (kept in low memory)
|
|   this section contains global variables for the font manager,
| the window manager and the menu manager
|
|------------------------------------------------------------

toolgbase       =          /980  |toolvars     |base address of toolbox globals
lglobals        =          0            |quickdraw globals accessed a5@(0)

|----------------------------
|
| font manager globals
|
|----------------------------
|
romfont0       =         toolgbase      |handle to rom-based system font
apfontid       =         romfont0+4     |family id of standard application font
gotstrike      =         apfontid+2     |boolean indicating if we've got the strike
fmdefaultsize  =         gotstrike+1    |byte holding default size

curfminput     =         fmdefaultsize+1 |quickdraw fminput record
curfmfamily    =         curfminput     |current font family
curfmsize      =         curfmfamily+2  |current font size
curfmface      =         curfmsize+2    |current font face
curfmneedbits  =         curfmface+1    |boolean specifying whether it needs strike
curfmdevice    =         curfmneedbits+1 |current font device
curfmnumer     =         curfmdevice+2  |current numerator of scale factor
curfmdenom     =         curfmnumer+4   |current denominator of scale factor

fmgroutrec     =         curfmdenom+4   |quickdraw fontoutput record
fouterror      =         fmgroutrec     |error code
foutfonthandle =         fouterror+2    |handle to font bits
foutbold       =         foutfonthandle+4 |bolding factor
foutitalic     =         foutbold+1     |italic factor
foutuloffset   =         foutitalic+1   |underline offset
foutulshadow   =         foutuloffset+1 |underline halo
foutulthick    =         foutulshadow+1 |underline thickness
foutshadow     =         foutulthick+1  |shadow factor
foutextra      =         foutshadow+1   |extra horizontal width
foutascent     =         foutextra+1    |height above baseline
foutdescent    =         foutascent+1   |height below baseline
foutwidmax     =         foutdescent+1  |maximum width of character
foutleading    =         foutwidmax+1   |space between lines
foutunused     =         foutleading+1  |unused byte (must have even number)
foutnumer      =         foutunused+1   |point for numerators of scale factor
foutdenom      =         foutnumer+4    |point for denominators of scale factor

fmdotsperinch  =         foutdenom+4     |h,v dotsperinch of current device
fmstyletab     =         fmdotsperinch+4 |style heuristic table supplied by device
toolscratch    =         fmstyletab+24   |8 byte scratch area

|----------------------------
|
| window manager globals
|
|----------------------------
|
windowlist      =       toolscratch+8   |z-ordered list of windows (nearest first)
saveupdate      =       windowlist+4    |boolean enabling update accumulation
paintwhite      =       saveupdate+2    |boolean enabling erasing newly drawn windows
wmgrport        =       paintwhite+2    |grafport used by window manager
deskport        =       wmgrport+4      |wide open port for use by applications
|
oldstructure    =       deskport+4      |handle to saved structure region
oldcontent      =       oldstructure+4  |handle to saved content region
grayrgn         =       oldcontent+4    |handle of rounded gray desk region
savevisrgn      =       grayrgn+4       |handle of temporarily saved vis region
draghook        =       savevisrgn+4    |proc ptr to allow user control during dragging
temprect        =       draghook+4      |rectangle used as scratch by toolbox
oneone          =       temprect+8      |long constant /00010001
minusone        =       oneone+4        |long constant /ffffffff

|-----------------------------------------------
|
| general purpose bitmap for plotting bitmaps
|
|-----------------------------------------------

iconbitmap      =       minusone+8      |bitmap used for plotting things

|----------------------------
|
| menu manager globals
|
|----------------------------

menulist        =       iconbitmap+14   |pointer to current menubar list structure
mbarenable      =       menulist+4      |word for enabling menubar for deskorns
curdekind       =       mbarenable+2    |kind of deactivated window
menuflash       =       curdekind+2     |integer holding flash feedback count
themenu         =       menuflash+2     |integer holding id of hilited menu
savedhandle     =       themenu+2       |handle of saved menubits
mrmachook       =       savedhandle+4   |hook for mr. macintosh
menuhook        =       mrmachook+4     |hook for user control during menuselect

|  control manager globals

dragpattern     =       menuhook+4      |pattern dragthergn uses
deskpattern     =       dragpattern+8   |pattern to paint the desk with
dragflag        =       deskpattern+8   |implicit parameter to dragcontrol, 1 word
curdragaction   =       dragflag+2      |implicit actionproc parameter

|  floating point package globals

fpstate         =       curdragaction+4  |6 bytes of floating point state


|-----------------------------
|
| resource manager globals
|
|-----------------------------

topmaphndl      =       fpstate+6       |handle to topmost map of list
sysmaphndl      =       topmaphndl+4    |handle to system map
sysmap          =       sysmaphndl+4    |reference number of system map
curmap          =       sysmap+2        |reference number of current map
resreadonly     =       curmap+2        |readonly flag
resload         =       resreadonly+2   |auto-load feature
reserr          =       resload+2       |resource error code


|-------------------------------
|
|  misc toolbox globals
|
|-------------------------------

tasklock        =       reserr+2        |flag to prevent re-entering systemtask
fscaledisable   =       tasklock+1      |flag to disable font scaling
curactivate     =       fscaledisable+1 |window to receive activate event
curdeactive     =       curactivate+4   |window to receive deactivate event
deskhook        =       curdeactive+4   |hook for painting the desk

tedotext        =       deskhook+4      |text edit private hook
terecal         =       tedotext+4      | ""

microsoft       =       terecal+4       |12 bytes for our friends in seattle
ghostwindow     =       microsoft+12    |window that frontwindow ignores
closeornhook    =       ghostwindow+4   |hook for closing desk ornaments

|--------------------------------------------------------------
|
|    alert/dialog manager globals
|
|--------------------------------------------------------------

restproc        =       closeornhook+4  |address of restart failsafe procedure
saveproc        =       restproc+4      |address of save failsafe procedure
savesp          =       saveproc+4      |safe sp for restart or save
anumber         =       savesp+4        |which alert is active?
acount          =       anumber+2       |how many times this alert called?
dabeeper        =       acount+2        |beep routine
dastrings       =       dabeeper+4      |string parameters for substutution


|--------------------------------------------------------------
|
|    textedit globals
|
|--------------------------------------------------------------

tescrplength    =       dastrings+16
tescrphandle    =       tescrplength+4

| application package dispatch table -- 8 longwords

apppacks        =       tescrphandle+4  |handle to math code

| misc stuff (last minute additions)

sysresname      =       apppacks+32     |name of system.rsrc
appparmhandle   =       sysresname+20   |handle to hold application parameters
dserrcode       =       appparmhandle+4 |last deep shit alert id
reserrproc      =       dserrcode+2     |resource error proc.
tewdbreak       =       reserrproc+4    |default word break routine
dlgfont         =       tewdbreak+4     |default dialog font
lasttglobal     =       dlgfont+2       |address of last global

|---------------------------------------------------
|
| toolbox data structure definitions
|
|   this section contains data structure definitions
| for the font manager, the window manager
| and the menu manager.
|
|---------------------------------------------------

|---------------------------------------
|
|   font manager data structures
|
|---------------------------------------

sysfont         =       0               |system font is font id 0
applfont        =       1               |application font is font id 1

| font manager input record offsets

fminfamily     =         0              |offset to family
fminsize       =         2              |offset to size
fminface       =         4              |offset to face
fminneedbits   =         5              |offset to needbits boolean
fmindevice     =         6              |offset to device number
fminnumer      =         8              |offset to numerator of scale
fmindenom      =         12             |offset to denominator of scale

|
| kerned strike font header data structure
|
fformat         =       0               |format of font
fminchar        =       2               |lowest character in font
fmaxchar        =       4               |highest character in font
fmaxwd          =       6               |maximum width of characters
fbbox           =       8               |left side of bounding box
fbboy           =       10              |top of bounding box
fbbdx           =       12              |width of bounding box
fbbdy           =       14              |height of bounding box
flength         =       16              |length of font
fascent         =       18              |ascent above baseline
fdescent        =       20              |descent below baseline
fleading        =       22              |space between lines
fraster         =       24              |offset to actual bits?
|
| definitions for font style bits (in standard style byte, bits 0-6)
|
boldbit         =       0
italicbit       =       1
ulinebit        =       2
outlinebit      =       3
shadowbit       =       4
condensebit     =       5
extendbit       =       6

| font manager defined control/status codes

fmgrctl1       =         8              |printer drivers support ctl/status 8

|---------------------------------------
|
|   window manager data structures
|
|---------------------------------------
|
| window kind constants
|
|                                       |system windows are negative include desk ornaments, etc.
dialogkind      =       2               |dialog windows
userkind        =       8               |this and above numbers are for user

|
| window definition procedure messages
|
wdrawmsg        =       0               |draw yourself
whitmsg         =       1               |hit test
wcalcrgnmsg     =       2               |recalculate your regions
winitmsg        =       3               |initialize yourself
wdisposemsg     =       4               |dispose any private data
wgrowmsg        =       5               |drag out grow outline
wgiconmsg       =       6               |draw the grow icon
|
| window hit-test codes
|
wnohit          =       0               |not in window at all
wincontent      =       1               |in content area of window
windrag         =       2               |in drag area of window
wingrow         =       3               |in grow area of window
wingoaway       =       4               |in go away area of window
|
| window data structure definition
|
windowport      =       0               |grafport data structure
windowkind      =       gportsize       |integer -- logical type of window
wvisible        =       windowkind+2    |boolean (1 byte) -- visible flag
whilited        =       wvisible+1      |boolean (1 byte) -- select (hilite) flag
wgoaway         =       whilited+1      |boolean (1 byte) -- has go away button
wspare          =       wgoaway+1       |spare byte reserved for future expansion
structrgn       =       wspare+1        |handle to structure region of window
contrgn         =       structrgn+4     |handle to content region of window
updatergn       =       contrgn+4       |handle to update region of window
windowdef       =       updatergn+4     |handle to window definition procedure
wdatahandle     =       windowdef+4     |handle  to window proc-defined data
wtitlehandle    =       wdatahandle+4   |handle to title string
wtitlewidth     =       wtitlehandle+4  |width in pixels of title string (integer)
wcontrollist    =       wtitlewidth+2   |handle to list of controls of this window
nextwindow      =       wcontrollist+4  |pointer to next window in z-ordered list
windowpic       =       nextwindow+4    |picture handle for updates
wrefcon         =       windowpic+4     |long integer defined by application
|
windowsize      =       wrefcon+4       |size of window data structure

|--------------------------------------------------
|
|  menu manager data structure definitions
|
|--------------------------------------------------

maxmenu         =       96              |a maximum of 16*6 menus in menubar
mlistsize       =       102             |a menu list is 102 bytes long
|
| menu definition procedure messages
|
mdrawmsg        =       0               |draw yourself
mchoosemsg      =       1               |select an item
msizemsg        =       2               |calculate your size
|
|  character definitions for menumarks and other special characters
|
nomark          =       0
applemark       =       17
checkmark       =       18

|
| menulist data structure definition -- one per menubar
|
lastmenu        =       0               |number of menus in this menulist
lastright       =       2               |coordinate of 1st free point in menubar
menuoh          =       0               |menu handle
menuleft        =       4               |coordinate of left edge of menu
|
| menuinfoblk data structure -- one per menu
|
menuid          =       0               |16 bit integer unique for each menubar
menuwidth       =       2               |16 bit integer indicating menu width
menuheigth      =       4               |16 bit integer indicating menu height
menudefhandle   =       6               |handle to menu definition proc
menuenable      =       10              |longword of enable flags, one bit/item
menudata        =       14              |menu item string
|
menublksize     =       14              |size of a menu block is 14 bytes plus
                                        |the datastring
|
| menustring data structure -- one per item
|
itemicon        =       0               |offset to icon byte
itemcmd         =       1               |offset to apple (command key) byte
itemmark        =       2               |offset to checkmark character byte
itemstyle       =       3               |offset to style byte

|------------------------------------------------------------------
|
|  control manager (button and dial) manager data structures
|
|------------------------------------------------------------------

|
| control definition procedure messages
|
drawctlmsg      =       0               |draw message
hitctlmsg       =       1               |hit test message
calcctlmsg      =       2               |calc region message
newctlmsg       =       3               |init message
dispctlmsg      =       4               |dispose any private data message
posctlmsg       =       5               |adjust indicator position message
thumbctlmsg     =       6               |calculate rectangles for thumb dragging
dragctlmsg      =       7               |custom drag message
trackctlmsg     =       8               |track yourself message
|
|  findwindow classification codes
|
indesk          =       0               |not in any window
inmenubar       =       1               |in the menu bar
insyswindow     =       2               |in a system window
incontent       =       3               |in content area of user window
indrag          =       4               |in drag area of user window
ingrow          =       5               |in grow area of user window
ingoaway        =       6               |in go away area of user window
|
inbutton        =      10               |in a push button
incheckbox      =      11               |in a checkbox button
|
inupbutton      =      20               |in up button area of a dial
indownbutton    =      21               |in down button area of a dial
inpageup        =      22               |in page up (gray) area of a dial
inpagedown      =      23               |in page down (gray) area of a dial
|
inthumb         =      129              |in thumb area of a dial
|

nextcontrol     =       0               |handle to next control in the list
contrlowner     =       nextcontrol+4    |windowptr to owning window
contrlrect      =       contrlowner+4   |bounding rectangle of control
contrlvis       =       contrlrect+8    |one byte boolean indicating visible state
contrlhilite    =       contrlvis+1     |one byte field indicating hilite state
contrlvalue     =       contrlhilite+1  |integer holding current value of control
contrlmin       =       contrlvalue+2   |integer holding minimum value of control
contrlmax       =       contrlmin+2     |integer holding maximum value of control
contrldefhandle =       contrlmax+2     |handle to control definition procedure
contrldata      =       contrldefhandle+4 |pointer to data handle for definition proc
contrlaction    =       contrldata+4    |pointer to local actionproc
contrlrfcon     =       contrlaction+4  |longword refcon defined by application
contrltitle     =       contrlrfcon+4   |handle to title string (or string itself)

contrlsize      =       contrltitle     |size of control data structure - title


|------------------------------------------------
|
| alert box manager data structure definitions
|
|------------------------------------------------

|dialog record

dbounds         =       0               |dialog bounds rectangle
dvisible        =       dbounds+8       |visible flag
dwindproc       =       dvisible+2      |window proc id
dgoaway         =       dwindproc+2     |go away flag
drefcon         =       dgoaway+2       |reference constant
ditems          =       drefcon+4       |item list id and handle
dtitle          =       ditems+2        |dialog window title

|alert record

abounds         =       0               |alert box height and width
aitems          =       abounds+8       |item list id
astages         =       aitems+2        |stages word

|window subclass dialogwindow

items           =       windowsize      |item list
tehandle        =       items+4         |handle to textedit object
editfield       =       tehandle+4      |current field being edited
editopen        =       editfield+2     |is editting open?
adefitem        =       editopen+2      |default item for alerts
dwindlen        =       adefitem+2      |dialog window length

|stage definition--packed 2 to a byte, 4 stages in a word

volbits         =       3               |low 2 bits are volume (0..3)
albit           =       4               |alert bit (put up box this time?)
okdismissal     =       8               |bit for ok/cancel default in each stage
                                        |(not necessarily different for each
                                        | stage, but saves a byte)

|------------------------------------------------
|
| dialoglist data structure definitions
|
|------------------------------------------------

dlgmaxindex     =       0               |maximum index (=items-1) stored here

|in each item

itmhndl         =       0               |handle to the item
itmrect         =       itmhndl+4       |bounding rect of item
itmtype         =       itmrect+8       |item type
itmdata         =       itmtype+1       |item string, must be even length


|------------------------------------------------------------------
|
| toolbox error codes (passed through graferror)
|
|------------------------------------------------------------------

fontdecerror    =       -64             |error during font declaration
fontnotdeclared =       -65             |font not declared
fontsuberr      =       -66             |font substitution occured
|

|------------------------------------------------------------------
|
|    equates for journal interface control call
|
|------------------------------------------------------------------

jplayctl        =       16                      | playback call
jrecordctl      =       17                      | record call
jrefnum         =       -2                      | refnum of journal
jctickcount     =       0                       | journal code for tickcount
jcgetmouse      =       1                       | journal code for getmouse
jcbutton        =       2                       | journal code for button
jcgetkeys       =       3                       | journal code for getkeys
jcevent         =       4                       | journal code for getnextevent(avail)

|------------------------------------------------------------------
|
| record for text edit object
|
|------------------------------------------------------------------

tedestrect  =           0                       | 0 destination rectangle (keep together)
teviewrect  =           tedestrect+8            | 8 view rectangle rectangle

teselrect   =           teviewrect+8            | 10 select rectangle
telinehite  =           teselrect+8             | 18 current font lineheight
teascent    =           telinehite+2            | 1a current font ascent
teselpoint  =           teascent+2              | 1c selection point(mouseloc)

teselstart  =           teselpoint+4            | 20 selection start (keep together)
teselend    =           teselstart+2            | 22 selection end

teactive    =           teselend+2              | 24 st if active

tewordbreak =           teactive+2              | 26 word break routine
teclikproc  =           tewordbreak+4           | 2a click loop routine

tecliktime  =           teclikproc+4            | 2e time of last click
teclikloc   =           tecliktime+4            | 32 location of double click

tecartime   =           teclikloc+2             | 33 time for next caret toggle
tecaron     =           tecartime+4             | 38 is caret on?
tecaract    =           tecaron+1               | 39 is caret active?
testyle     =           tecaract+1              | 3a fill style

telength    =           testyle+2               | 3c length of text below {must stay together}
tetexth     =           telength+2              | 40 text handle goes here

terecback   =           tetexth+4               | 42 set true if backgnd recal
terecline   =           terecback+2             | 44 current recal line
telftclick  =           terecline+2             | 46 st if click was to left
telftcaret  =           telftclick+1            | 47 st if caret was to left

tecronly    =           telftcaret+1            | 48 st if cr only for line breaks

tefontstuff =           tecronly+2              | 50 space for font specifier
tegrafport  =           tefontstuff+8           | 52 grafport for editting

tehihook    =           tegrafport+4            | 56 hook for hilite routine
tecarhook   =           tehihook+4              | 5a hook for hilite routine

tenlines    =           tecarhook+4             | 5e number of lines (must keep together)
telines     =           tenlines+2              | 62 line starts(array of words)

terecsize   =           telines+8               | 6a base size of a record



-------------------------------

dlgmaxindex     =       0               |maximum index (=items-1) stored here

|in eachsumacc/h/toolmacs.h   444      0     12       30344  3470501352   7545 |file toolmacs.text
|-----------------------------------------------------
|
|  user interface toolbox assembly language interface
|
|    these macros expand into toolbox traps allowing
|  a convenient, symbolic toolbox interface for the
|  assembly lanaguage programmer.
|
|  version for rom 2.0 --     februrary 10, 1983
|  regenerated for rom 4.0 -- june 3, 1983
|  changed alertsound to errorsound
|  added insertresmenu, opendeskacc -- june 13, 1983
|  added uniqueid, closedeskacc,systemedit,lbin2dec,ldec2bin
|        secs2date,date2secs| removed sound traps -- july 2, 1983
|  added tegettext, tesetjust and teinsert - august 4
|  added sysbeep, drawgrow - august 6
|  added handandhand, ptrandhand - august 6
|  removed endsubresource.  changed beginsubresource to homeresfile.
|  added getfinderinfo and setfinderinfo - august 6
|  added draggrayrgn - august 11
|  removed getfinderinfo and setfinderinfo (august 18?)
|  added scrap macros
|  added resource set/getresfileattr
|  added enqueue, dequeue (19-dec-83, lak)
|  added coulddialog, freedialog, sizersrc (12-jan-84, lak)
|
|-----------------------------------------------------


__initfont = /a8fe

__getfname = /a8ff

__getfnum = /a900

__fmswapfo = /a901

__realfont = /a902

__setfontl = /a903

__drawgrow = /a904

__draggrayrgn = /a905

__newstrin = /a906

__setstrin = /a907

__showhide = /a908

__calcvis = /a909

__calcvbehind = /a90a

__clipabov = /a90b

__paintone = /a90c

__paintbeh = /a90d

__saveold = /a90e

__drawnew = /a90f

__getwmgrp = /a910

__checkupd = /a911

__initwind = /a912

__newwindo = /a913

__disposwindow = /a914

__showwind = /a915

__hidewind = /a916

__getwrefc = /a917

__setwrefc = /a918

__getwtitl = /a919

__setwtitl = /a91a

__movewind = /a91b

__hilitewi = /a91c

__sizewind = /a91d

__trackgoa = /a91e

__selectwi = /a91f

__bringtof = /a920

__sendbehi = /a921

__beginupd = /a922

__endupdat = /a923

__frontwin = /a924

__dragwind = /a925

__dragther = /a926

__invalrgn = /a927

__invalrec = /a928

__validrgn = /a929

__validrec = /a92a

__growwind = /a92b

__findwind = /a92c

__closewin = /a92d

__setwindo = /a92e

__getwindo = /a92f

__initmenu = /a930

__newmenu = /a931

__disposmenu = /a932

__appendme = /a933

__clearmen = /a934

__insertme = /a935

__deleteme = /a936

__drawmenu = /a937

__hiliteme = /a938

__enableit = /a939

__disablei = /a93a

__getmenub = /a93b

__setmenub = /a93c

__menusele = /a93d

__menukey = /a93e

__getitmicon = /a93f

__setitmicon = /a940

__getitmstyle = /a941

__setitmstyle = /a942

__getitmmark = /a943

__setitmmark = /a944

__checkite = /a945

__getitem = /a946

__setitem = /a947

__calcmenu = /a948

__getmhand = /a949

__setmflash = /a94a

__ploticon = /a94b

__flashmen = /a94c

__addresme = /a94d

__countmit = /a950

__insertresmenu = /a951

__pinrect = /a94e

__deltapoi = /a94f

__newcontr = /a954

__disposcontrol = /a955

__killcont = /a956

__showcont = /a957

__hidecont = /a958

__movecont = /a959

__getcrefc = /a95a

__setcrefc = /a95b

__sizecont = /a95c

__hiliteco = /a95d

__getctitl = /a95e

__setctitl = /a95f

__getctlva = /a960

__getminctl = /a961

__getmaxctl = /a962

__setctlva = /a963

__setminctl = /a964

__setmaxctl = /a965

__testcont = /a966

__dragcont = /a967

__trackcon = /a968

__drawcont = /a969

__getctlac = /a96a

__setctlac = /a96b

__findcont = /a96c

__dequeue = /a96e

__enqueue = /a96f

__getnexte = /a970

__eventava = /a971

__getmouse = /a972

__stilldow = /a973

__button = /a974

__tickcoun = /a975

__getkeys = /a976

__waitmous = /a977

__coulddialog = /a979

__freedialog = /a97a

__initdial = /a97b

__getnewdi = /a97c

__newdialo = /a97d

__selitext = /a97e

__isdialog = /a97f

__dialogse = /a980

__drawdial = /a981

__closedia = /a982

__disposdi = /a983

__alert = /a985

__stopaler = /a986

__notealer = /a987

__cautiona = /a988

__couldale = /a989

__freealer = /a98a

__paramtex = /a98b

__errorsou = /a98c

__getditem = /a98d

__setditem = /a98e

__setitext = /a98f

__getitext = /a990

__modaldia = /a991

__detachre = /a992

__setrespu = /a993

__curresfi = /a994

__initreso = /a995

__rsrczone = /a996

__openresf = /a997

__useresfi = /a998

__updatere = /a999

__closeres = /a99a

__setreslo = /a99b

__countres = /a99c

__getindre = /a99d

__counttyp = /a99e

__getindty = /a99f

__getresou = /a9a0

__getnamed = /a9a1

__loadreso = /a9a2

__releaser = /a9a3

__homeresf = /a9a4

__sizersrc = /a9a5

__getresat = /a9a6

__setresat = /a9a7

__getresin = /a9a8

__setresin = /a9a9

__changedr = /a9aa

__addresou = /a9ab

__addrefer = /a9ac

__rmvereso = /a9ad

__rmverefe = /a9ae

__reserror = /a9af

__writeres = /a9b0

__createre = /a9b1

__systemev = /a9b2

__systemcl = /a9b3

__systemta = /a9b4

__systemme = /a9b5

__opendeskacc = /a9b6

__closedeskacc = /a9b7

__getpatte = /a9b8

__getcurso = /a9b9

__getstrin = /a9ba

__geticon = /a9bb

__getpictu = /a9bc

__getnewwi = /a9bd

__getnewco = /a9be

__getrmenu = /a9bf

__getnewmb = /a9c0

__uniqueid = /a9c1

__sysedit = /a9c2

__lbin2dec = /a9c4

__ldec2bin = /a9c5

__secs2date = /a9c6

__date2secs = /a9c7

__sysbeep = /a9c8

__syserror = /a9c9

__puticon = /a9ca

__tegettext = /a9cb

__teinit = /a9cc

__tedispos = /a9cd

__textbox = /a9ce

__tesettext = /a9cf

__tecaltex = /a9d0

__tesetsel = /a9d1

__tenew = /a9d2

__teupdate = /a9d3

__teclick = /a9d4

__tecopy = /a9d5

__tecut = /a9d6

__tedelete = /a9d7

__teactiva = /a9d8

__tedeacti = /a9d9

__teidle = /a9da

__tepaste = /a9db

__tekey = /a9dc

__tescroll = /a9dd

__teinsert = /a9de

__tesetjust = /a9df

__munger = /a9e0

__handtoha = /a9e1

__ptrtoxha = /a9e2

__ptrtohan = /a9e3

__handandh = /a9e4

__initpack = /a9e5

__initmath = /a9e6

__pack0 = /a9e7

__pack1 = /a9e8

__pack2 = /a9e9

__pack3 = /a9ea

__fp68k = /a9eb

__pack4 = /a9eb

__pack5 = /a9ec

__pack6 = /a9ed

__pack7 = /a9ee

__ptrandha = /a9ef

__loadseg = /a9f0

__unloadse = /a9f1

__launch = /a9f2

__chain = /a9f3

__exittosh = /a9f4

__getapppa = /a9f5


__getresfil = /a9f6

__setresfil = /a9f7

__infoscra = /a9f9

__unlodesc = /a9fa

__lodescra = /a9fb

__zeroscra = /a9fc

__getscrap = /a9fd

__putscrap = /a9fe


|_______________________________________________________________________
|
| core routine system macros
|
|_______________________________________________________________________


| first we have the i/o core routine macros.  these are also used by
| the file system.

__open = /a000 + 0

__close = /a000 + 1

__read = /a000 + 2

__write = /a000 + 3

__control = /a000 + 4

__status = /a000 + 5

__killio = /a000 + 6


| other file system calls go here

__getvolinfo = /a000 + 7

__create = /a000 + 8

__delete = /a000 + 9

__openrf = /a000 + 10

__rename = /a000 + 11

__getfileinfo = /a000 + 12

__setfileinfo = /a000 + 13

__unmountvol = /a000 + 14

__mountvol = /a000 + 15

__allocate = /a000 + 16

__geteof = /a000 + 17

__seteof = /a000 + 18

__flushvol = /a000 + 19

__getvol = /a000 + 20

__setvol = /a000 + 21

__initqueue = /a000 + 22

__eject = /a000 + 23

__getfpos = /a000 + 24

| here are the storage manager core routine macros

__initzone = /a000 + 25

__getzone = /a000 + 26 + /100

__setzone = /a000 + 27

__freemem = /a000 + 28

__maxmem = /a000 + 29 + /100

__newptr = /a000 + 30 + /100

__disposptr = /a000 + 31

__setptrsize = /a000 + 32

__getptrsize = /a000 + 33

__newhandle = /a000 + 34 + /100

__disposhandle = /a000 + 35

__sethandlesize = /a000 + 36

__gethandlesize = /a000 + 37

__handlezone = /a000 + 38 + /100

__reallochandle = /a000 + 39

__recoverhandle = /a000 + 40 + /100

__hlock = /a000 + 41

__hunlock = /a000 + 42

__emptyhandle = /a000 + 43

__initapplzone = /a000 + 44

__setappllimit = /a000 + 45

__blockmove = /a000 + 46

| here are the event manager macros

__postevent = /a000 + 47

__oseventavail = /a000 + 48

__getosevent = /a000 + 49

__flushevents = /a000 + 50

| here are the utility core routine macros

__vinstall = /a000 + 51

__vremove = /a000 + 52

__offline = /a000 + 53

__moremasters = /a000 + 54

__readparam = /a000 + 55

__writeparam = /a000 + 56

__readdatetime = /a000 + 57

__setdatetime = /a000 + 58

__delay = /a000 + 59

__cmpstring = /a000 + 60

__drvrinstall = /a000 + 61

__drvrremove = /a000 + 62

__initutil = /a000 + 63

__resrvmem = /a000 + 64

__setfillock = /a000 + 65

__rstfillock = /a000 + 66

__setfiltype = /a000 + 67

__setfpos = /a000 + 68

__flushfil = /a000 + 69

__gettrapaddress = /a000 + 70 + /100

__settrapaddress = /a000 + 71

__ptrzone = /a000 + 72 + /100

__hpurge = /a000 + 73

__hnopurge = /a000 + 74

__setgrowzone = /a000 + 75

__compactmem = /a000 + 76

__purgemem = /a000 + 77

__adddrive = /a000 + 78

__rdrvrinstall = /a000 + 79

__uprstring = /a000 + 84

__setappbase = /a000 + 87

_regs_ = /100
_async_ = /400
_sys_ = /400
_immed_ = /200
_clear_ = /200
_marks_ = /200
_case_ = /400
|file quickmacs.text
|------------------------------------------------
|
|  quickdraw assembly language interface
|
|    these macros expand into toolbox traps allowing
|  a convenient, symbolic quickdraw interface for the
|  assembly language programmer.
|
|  version for rom 2.0 --      februrary 10, 1983
|  updated for rom 2.4 --      mar 16, 1983
|  regenerated for rom 4.0 --  june 3, 1983
|
|------------------------------------------------


__initcurs = /a850

__setcurso = /a851

__hidecurs = /a852

__showcurs = /a853

__shieldcu = /a855

__obscurec = /a856

__bitand = /a858

__bitxor = /a859

__bitnot = /a85a

__bitor = /a85b

__bitshift = /a85c

__bittst = /a85d

__bitset = /a85e

__bitclr = /a85f

__random = /a861

__forecolo = /a862

__backcolo = /a863

__colorbit = /a864

__getpixel = /a865

__stuffhex = /a866

__longmul = /a867

__fixmul = /a868

__fixratio = /a869

__hiword = /a86a

__loword = /a86b

__fixround = /a86c

__initport = /a86d

__initgraf = /a86e

__openport = /a86f

__localtog = /a870

__globalto = /a871

__grafdevi = /a872

__setport = /a873

__getport = /a874

__setpbits = /a875

__portsize = /a876

__moveport = /a877

__setorigi = /a878

__setclip = /a879

__getclip = /a87a

__cliprect = /a87b

__backpat = /a87c

__closepor = /a87d

__addpt = /a87e

__subpt = /a87f

__setpt = /a880

__equalpt = /a881

__stdtext = /a882

__drawchar = /a883

__drawstri = /a884

__drawtext = /a885

__textwidt = /a886

__textfont = /a887

__textface = /a888

__textmode = /a889

__textsize = /a88a

__getfonti = /a88b

__stringwi = /a88c

__charwidt = /a88d

__spaceext = /a88e

__stdline = /a890

__lineto = /a891

__line = /a892

__moveto = /a893

__move = /a894

__moov = /a894

__hidepen = /a896

__showpen = /a897

__getpenst = /a898

__setpenst = /a899

__getpen = /a89a

__pensize = /a89b

__penmode = /a89c

__penpat = /a89d

__pennorma = /a89e

__stdrect = /a8a0

__framerec = /a8a1

__paintrec = /a8a2

__eraserec = /a8a3

__inverre = /a8a4

__fillrect = /a8a5

__equalrec = /a8a6

__setrect = /a8a7

__offsetre = /a8a8

__insetrec = /a8a9

__sectrect = /a8aa

__unionrec = /a8ab

__pt2rect = /a8ac

__ptinrect = /a8ad

__emptyrec = /a8ae

__stdrrect = /a8af

__framerou = /a8b0

__paintrou = /a8b1

__eraserou = /a8b2

__inverro = /a8b3

__fillroun = /a8b4

__stdoval = /a8b6

__frameova = /a8b7

__paintova = /a8b8

__eraseova = /a8b9

__invertov = /a8ba

__filloval = /a8bb

__slopefromangle = /a8bc

__stdarc = /a8bd

__framearc = /a8be

__paintarc = /a8bf

__erasearc = /a8c0

__invertar = /a8c1

__fillarc = /a8c2

__pttoangl = /a8c3

__anglefromslope = /a8c4

__stdpoly = /a8c5

__framepol = /a8c6

__paintpol = /a8c7

__erasepol = /a8c8

__invertpo = /a8c9

__fillpoly = /a8ca

__openpoly = /a8cb

__closepgon = /a8cc

__killpoly = /a8cd

__offsetpo = /a8ce

__packbits = /a8cf

__unpackbi = /a8d0

__stdrgn = /a8d1

__framergn = /a8d2

__paintrgn = /a8d3

__erasergn = /a8d4

__inverrgn = /a8d5

__fillrgn = /a8d6

__newrgn = /a8d8

__disposrgn = /a8d9

__openrgn = /a8da

__closergn = /a8db

__copyrgn = /a8dc

__setempty = /a8dd

__setrecrgn = /a8de

__rectrgn = /a8df

__ofsetrgn = /a8e0

__insetrgn = /a8e1

__emptyrgn = /a8e2

__equalrgn = /a8e3

__sectrgn = /a8e4

__unionrgn = /a8e5

__diffrgn = /a8e6

__xorrgn = /a8e7

__ptinrgn = /a8e8

__rectinrg = /a8e9

__stdbits = /a8eb

__copybits = /a8ec

__scrollre = /a8ef

__setstdpr = /a8ea

__stdtxmea = /a8ed

__stdgetpi = /a8ee

__stdputpi = /a8f0

__stdcomme = /a8f1

__piccomme = /a8f2

__openpict = /a8f3

__closepic = /a8f4

__killpict = /a8f5

__drawpict = /a8f6

__scalept = /a8f8

__mappt = /a8f9

__maprect = /a8fa

__maprgn = /a8fb

__mappoly = /a8fc

paddress = /a000 + 70 + /100

__settrapaddress = /a000 + 71

__ptrzone = /a000 + 72 + /100

__hpurge = /a000 + 73

__hnopurge = /a000 + 74

__setgrowzone = /a000 + 75

__compactmem = /a000 + 76

__purgemem = /a000 + 77

__adddrive = /a000 + 78

__rdrvrinstall = /a000 + 79

__uprstrinsumacc/h/device.h   444      0     12        4116  3470501352   7141 /*	device.h	1.0	07/21/84	*/

/*
 * Device driver definitions.
 */

/* 
 * Copyright (C) 1984, Stanford Univ. SUMEX project.  
 * May be used but not sold without permission.
 */

/*
 * history
 * 07/21/84	Croft	Created.
 * 07/27/84	Schuster Added accessory status codes.
 */

/*
 * Driver structure.  
 */
struct drvr {
	short	drvrFlags;	/* flags */
	short	drvrDelay;	/* ticks between actions */
	short	drvrEMask;	/* desk accessory event mask */
	short	drvrMenu;	/* menu ID */
	short	drvrOpen;	/* offset to open routine */
	short	drvrPrime;	/* ..		prime */
	short	drvrCtl;	/* ..		control */
	short	drvrStatus;	/* ..		status */
	short	drvrClose;	/* ..		close */
	char	drvrName[32];	/* driver name (pascal string) */
};

struct drvr drvr;		/* global instance of my drvr struct */

/* flags in drvrFlags */
#define	dReadEnable	0x100
#define	dWritEnable	0x200
#define	dCtlEnable	0x400
#define	dStatEnable	0x800
#define	dNeedGoodBye	0x1000
#define	dNeedTime	0x2000
#define	dNeedLock	0x4000
#define	dOpened		0x20
#define	dRAMBased	0x40
#define	drvrActive	0x80

/*
 * Commands in (low byte of) ioTrap.
 */
#define	aRdCmd	2
#define	aWrCmd	3
#define	aCtlCmd	4
#define	aStsCmd	5

/*
 * Special return codes from driver entry points.
 *
 * A zero or negative return from the driver routines causes an ioDone,
 * with the return status in D0.  The return values below (large 
 * positive numbers) cause the indicated action.
 */
#define	ioRTS 0x40000000
#define	ioKill	ioRTS
#define	ioDone	0

/*
 * Control and status codes.
 */
#define	killCode	1
#define	ejectCode	7
#define	drvStsCode	8

/*
 * IO System Errors (should be in osintf.h)
 */
#define	controlErr	-17
#define	statusErr	-18
#define	readErr		-19
#define	writErr		-20
#define	badUnitErr	-21
#define	unitEmptyErr	-22
#define	openErr		-23
#define	closErr		-24
#define	dRemovErr	-25
#define	dInstErr	-26
#define	abortErr	-27
#define	notOpenErr	-28


/*
 * Control and Status codes for desk accessories.
 */
#define accEvent 64
#define accRun 65
#define accCursor 66
#define accMenu 67
#define accUndo 68
#define accCut 70
#define accCopy 71
#define accPaste 72
#define accClear 73
 /a86d

__initgraf = /a86e

__openport = /a86f

__localtog = /a870

__globalto = /a871

__grafdevi = /a872

__setport = /a873

__getport = /a874

__setpbits = /a875

__portsize = /a876

__moveport = /a877

__setorigi = /a878

__setclip = /a879

__getclip = /a87a

__cliprect = /a87b

__backpat = /a87c

__closepor = /a87d

__addpt = /a87e

__subpt = /a87f

__setpt = /a880

__equalpt = /a881

__stdtext = /a882

__drawchar = /a883

__sumacc/h/prequ.h   444      0     12       27746  3470501352   7074 |-------------------------------------------------------------------------------
|       these are the definitions for the print code
|-------------------------------------------------------------------------------
fprdbgok        =       1               |debug enable
iprdeapshit     =       29              |printcode deapshit
iprabort        =       128             |abort
iprrelease      =       2               |current version number of the code.
__getresource	= /a9a0			| this belongs somewhere else!
__closeresfile	= /a99a			| this belongs somewhere else!
__openresfile	= /a997			| this belongs somewhere else!

|-------------------------------------------------------------------------------
| the private print globals; 16 bytes located at [sysequ] printvars
|-------------------------------------------------------------------------------
iprerr          =       0               |current print error.  set to iprabort to abort printing.
bdocloop        =       iprerr+2        |the doc style: draft, spool, .., and ..
                                        |currently use low 2 bits; the upper 6 are for flags.
buser1          =       bdocloop+1
luser1          =       buser1+1
luser2          =       luser1+4
luser3          =       luser2+4
iprvarsize      =       luser3+4        |the prvar's size.[16]

bdraftloop      =       0               |the docloop types
bspoolloop      =       1
buser1loop      =       2
buser2loop      =       3
|-------------------------------------------------------------------------------
| these are the prdrvr constants.
|-------------------------------------------------------------------------------
iprdrvrid       =               2               |driver's resid
iprdrvrref      =               /fffd           |driver's refnum = not resid
iprdrvrdev      =               /fd00           |driver's qd dev num = refnum in hi byte, variant in lo
iprbitsctl      =               4               |the bitmap print proc's ctl number
lscreenbits     =               /00000000       |the bitmap print proc's screen bitmap param
lpaintbits      =               /00000001       |the bitmap print proc's paint [sq pix] param
iprioctl        =               5               |the raw byte io proc's ctl number
iprevtctl       =               6               |the prevent proc's ctl number
lprevtall       =               /00fffffd       |the prevent proc's cparam for the entire screen
lprevttop       =               /00fefffd       |the prevent proc's cparam for the top folder
iprdevctl       =               7               |the prdevctl proc's ctl number
iprreset        =               1               |the prdevctl proc's cparam for reset
iprpageend      =               2               |the prdevctl proc's cparam for end page
ifmgrctl        =               8               |the fmgr's tail-hook ctl call
ifmgrstat       =               8               |the fmgr's pre-hook status call

|-------------------------------------------------------------------------------
| various resource types & id's
|-------------------------------------------------------------------------------
lpstrtype       =      /53545220        |"str ": res type for the pr rsrc file name
ipstrrfil       =      /e000            |str -8192 is in sysres & names the current printer

lprinttype      =      /50524543        |"prec": res type for the hprint records
iprintdef       =      0                |default hprint
iprintlst       =      1                |last used hprint
iprintdrvr      =      2                |.print's parameter record; not a print rec

lpftype         =      /5046494c        |"pfil"
lpfsig          =      /50535953        |"psys"
ipficon         =      140              |

lprtype         =      /4150504c        |"appl"
lprsig          =      /50535953        |"psys"
ipricon         =      138              |

|-------------------------------------------------------------------------------
| the printing data structures
|-------------------------------------------------------------------------------
|print info record: the parameters needed for page composition.
|-------------------------------------------------------------------------------
idev            =       0         |font mgr/quickdraw device code
ivres           =       idev+2    |resolution of device, in device coordinates.
ihres           =       ivres+2   |   ..note: v before h => compatable with point.
rpage           =       ihres+2   |the page (printable) rectangle in device coordinates.
iprinfosize     =       rpage+8   |the prinfo size.[14]

|-------------------------------------------------------------------------------
|printer style: the printer configuration and usage information.
|-------------------------------------------------------------------------------
wdev            =       0         |the drvr number.  hi byte=refnum, lo byte=variant.
ipagev          =       wdev+2    |paper size in units of 1/iprpgfract
ipageh          =       ipagev+2  |   ..note: v before h => compatable with point.
bport           =       ipageh+2  |the io port number.
feed            =       bport+1   |paper feeder type.
iprstlsize      =       feed+1    |the prstl size.[8]

|-------------------------------------------------------------------------------
|print extra info: the print time extra information.
|-------------------------------------------------------------------------------
irowbytes       =       0               |the band's rowbytes.
ibandv          =       irowbytes+2     |size of band, in device coordinates
ibandh          =       ibandv+2        |   ..note: v before h => compatable with point.
idevbytes       =       ibandh+2        |size for allocation.  may be more than rbounds size!
ibands          =       idevbytes+2     |number of bands per page.
bpatscale       =       ibands+2        |pattern scaling
bulthick        =       bpatscale+1     |3 underscoring parameters
buloffset       =       bulthick+1
bulshadow       =       buloffset+1
scan            =       bulshadow+1     |band scan direction
bxinfox         =       scan+1          |an extra byte.
iprxinfosize    =       bxinfox+1       |the prxinfo size.[16]

|-------------------------------------------------------------------------------
|print job: print "form" for a single print request.
|-------------------------------------------------------------------------------
ifstpage        =       0               |page range.
ilstpage        =       ifstpage+2
icopies         =       ilstpage+2      |no. copies.
bjdocloop       =       icopies+2       |draft quality print flag
ffromapp        =       bjdocloop+1     |printing from an app (not prapp) flag
pidleproc       =       ffromapp+1      |the proc called while waiting on io etc.
pfilename       =       pidleproc+4     |spool file name: nil for default.
ifilevol        =       pfilename+4     |spool file vol, set to 0 initially.
bfilevers       =       ifilevol+2      |spool file version, set to 0 initially.
bjobx           =       bfilevers+1     |an extra byte.
iprjobsize      =       bjobx+1         |the prjob size.[20]

|-------------------------------------------------------------------------------
|the universal 120 byte printing record
|-------------------------------------------------------------------------------
iprversion      =       0                       |printing software version
prinfo          =       iprversion+2            |the prinfo data associated with the current style.
rpaper          =       prinfo  + iprinfosize   |the paper rectangle [offset from rpage].
prstl           =       rpaper  + 8             |this print request's style.
prinfopt        =       prstl   + iprstlsize    |print time imaging metrics
prxinfo         =       prinfopt+ iprinfosize   |print-time (expanded) print info record.
prjob           =       prxinfo + iprxinfosize  |the print job request
iprintsize      =       120                     |the print record size.[120]

|-------------------------------------------------------------------------------
|print port: a graf port, its procs, plus some extra.
|-------------------------------------------------------------------------------
gport           =       0               |the printer's graf port.
gprocs          =       108             |..and its procs
lgparam1        =       gprocs+13*4     |some params: our relocatable stuff etc.
lgparam2        =       lgparam1+4
lgparam3        =       lgparam2+4
lgparam4        =       lgparam3+4

fourptr         =       lgparam4+4      |whether the prport allocation was done by us.
fourbits        =       fourptr+1       |whether the bitmap allocation was done by us.
iprportsize     =       fourbits+1      |the prport size.[178]

|-------------------------------------------------------------------------------
|print status: runtime status for prpicfile & prpic procs.
|-------------------------------------------------------------------------------
itotpages       =       0               |total pages in print file.
icurpage        =       itotpages+2     |current page number
itotcopies      =       icurpage+2      |total copies requested
icurcopy        =       itotcopies+2    |current copy number
itotbands       =       icurcopy+2      |total bands per page.
icurband        =       itotbands+2     |current band number
fpgdirty        =       icurband+2      |true if current page has been written to.
fimaging        =       fpgdirty+1      |set while in band's drawpic call.
hprint          =       fimaging+1      |handle to the active printer record
pprport         =       hprint+4        |ptr to the active prport
hpic            =       pprport+4       |handle to the active picture
iprstatsize     =       hpic+4          |the prstatus size.[26]

|-------------------------------------------------------------------------------
| these are the constants for using resources to swap in the non-driver
| print code.  three numbers are needed:
|       restype
|       resid
|       offset into the seg's jump table
|
| the offset is really a formatted long that contains three fields:
|       frame size; unlock flag; offset into the seg's jump table
| we could use the topmost byte for further stuff: a stack adjust for
| storing the registers needed by the link code so that it would be re-entrant.
|-------------------------------------------------------------------------------

lpdeftype        =      /50444546       |pr resource type: "pdef"

iprdraftid       =      0               |pr draft resource id
iprspoolid       =      1               |pr spool resource id
ipruser1id       =      2               |pr spare1 resource id
ipruser2id       =      3               |pr spare2 resource id
lopendoc         =      /000c0000           |propendoc jumptable offset
lclosedoc        =      /00048004           |prclosedoc jumptable offset
lopenpage        =      /00080008           |propenpage jumptable offset
lclosepage       =      /0004000c           |prclosepage jumptable offset

iprdlgsid        =      4               |pr dialogs resource id
ldefault         =      /00048000           |printdefault jumptable offset
lstldialog       =      /00048004           |prstldialog jumptable offset
ljobdialog       =      /00048008           |prjobdialog jumptable offset
lstlinit         =      /0004000c           |prstlinit jumptable offset
ljobinit         =      /00040010           |prjobinit jumptable offset
ldlgmain         =      /00088014           |prdlgmain jumptable offset
lprvalidate      =      /00048018           |printvalidate jumptable offset
lprjobmerge      =      /0008801c           |printvalidate jumptable offset

iprpicid         =      5               |pic printing resource id
lprpicfile       =      /00148000           |prpicfile jumptable offset
lprpic           =      /00148004           |prpic jumptable offset

icfgdlgid        =      6               |configuration proc resource id
lcfgdialog       =      /00008000           |prcfgdialog jumptable offset

iprhackid        =      7               |the "oops, i forgot" resource id
lprhack          =      /000c8000           |prhack jumptable offset

|-------------------------------------------------------------------------------
--------------------------sumacc/h/heapdefs.h   444      0     12       11020  3470501353   7472 |----------------------------------------------------------------------
| heapdefs	- definitions for macintosh assembly language memory manager.
|
| supports multiple heap zones with mixed relocatable andw non-relocatable
| storage blocks.
|
| reorganized from code designed andw written by bud tribble, 27-nov-81,
|	andw maintained and modified by angeline lo, larry kenyon,
|	andw andy hertzfeld.
|
| modification history:
| 17 feb 83	lak	added dfltstacksize for defltappllimit.
| 20 mar 83	mph	changed memory size constants to support 512 k byte
|	machine; added ptrmask andw handlemask to allow garbage
|	in high byte of ptrs orw handles passed to memory manager;
|	removed "checking" conditional from chkzone macro.
| 29 mar 83	mph	added purgeproc andw moverelproc entries to zone object.
| 10 jun 83	mph	removed definition of nil, use nil from graftypes.
| 17 jun 83	mph	removed moverelproc from heap object, inserted spare.
| 21 jun 83	mph	put freelist code under assembly switch: flist.
| 18 jul 83	lak	removed freelist stuff completely; removed tlock, tpurge;
|	removed trap macro andw check hook offsets.
| 30 jul 83	lak	added equates for purgeptr andw allocptr.	also added equates
|	for flags byte: fnselcompct,fnorvralloc,fnselpurge,frelatend.
| 12 aug 83	lak	added clearbit equate.
|----------------------------------------------------------------------


| these constants control conditional assembly.
checking	=	0	|check arguments andw data structures
statistics	=	0	|gather statistics on usage
robust	=	0	|enables super-robust internal checks
countmps	=	0	|enables counting of master pointers

dfltflags	=	0	|checking is on when zone is init'd


|
| constants:
|
minfree	=	12	|12 byte minimum block size
tagmask	=	0xc0000000	|mask for the 2-bit tag field
bcoffmask	=	0x0f000000	|mask for the 4 bit byte count offset
bcmask	=	0x00ffffff	|mask for the 24 bit byte count
ptrmask	=	0x00ffffff	|mask pointer to low 24 bits
handlemask	=	0x00ffffff	|mask handle to low 24 bits
freetag	=	0x0	|tag for free block
nreltag	=	0x40000000	|tag for non-relocatable block
reltag	=	0x80000000	|tag for relocatable block
maxsize	=	0x800000	|max data block size is 512k bytes
minaddr	=	0x0	|min legal address
maxaddr	=	0x800000	|max legal address for 512k machine
maxmasters	=	0x1000	|ridiculously large allocation chunk size
dfltmasters	=	32	|default to 32 master pointers
dfltstacksize	=	0x00002000	|8k size for stack
mnstacksize	=	0x00000400	|1k minimum size for stack
|
|	block types
|
tybkmask	=	3	|mask for block type
tybkfree	=	0	|free block
tybknrel	=	1	|non-relocatable
tybkrel	=	2	|relocatable
|
| heap zone offsets:
|
bklim	=	0	|long, last block in zone
purgeptr	=	4	|long, roving purge pointer.
hfstfree	=	8	|long, first free handle
zcbfree	=	12	|long, # of free bytes in zone
gzproc	=	16	|long, pointer to grow zone procedure
malloccnt	=	20	|word, # of master to allocate
flags	=	22	|word, flags
foncheck	=	0	|turn on checking
fchecking	=	1	|checking on
fgzalways	=	2	|set to 1 to force user gz calls in noncrit cases
fngzresrv	=	3	|set to 1 to prevent gz reservmem calls
fnselcompct	=	4	|use non-selective compact algorithm when 1.
fnorvralloc	=	5	|don't use rover allocation scheme when 1.
fnselpurge	=	6	|use non-selective purge algorithm when 1.
frelatend	=	7	|makebk packs rels at end of free bk when 1.

cntrel	=	24	|word, # of allocated relocatable blocks
maxrel	=	26	|word, max # of allocated rel. blocks.
cntnrel	=	28	|word, # of allocated non-rel. blocks.
maxnrel	=	30	|word, max # of allocated non-rel. blocks.
cntempty	=	32	|word, # of empty handles
cnthandles	=	34	|word, # of total handles
mincbfree	=	36	|long, min # of bytes free.
purgeproc	=	40	|long, pointer to purge warning procedure
spare1	=	44	|long, unused spare.
allocptr	=	48	|long, roving allocation pointer.
heapdata	=	52	|start of heap zone data


minzone	=	heapdata+[4*minfree]+[8*dfltmasters]
|	;minimum size for applic. zone


|
| block offsets
|
tagbc	=	0	|long, tag andw byte count field
handle	=	4	|long, handle to current data block
blkdata	=	8	|all block data starts here


|
| heap zone default sizes
|

syszonesize	=	0x4000	|16 k byte static syszone size
appzonesize	=	0x1800	|6 k byte static appzone size


|
| structure of initzone argument table.
|

startptr	=	0	|start address for zone.
limitptr	=	4	|limit address for zone.
cmoremasters	=	8	|number of masters to allocate at time.
pgrowzone	=	10	|points to the growzone procedure.

|
| bit offset for system trap special functions
|
tsysorcurzone	=	10	| bit set implies system zone
	|	bit clear implies current zone
clearbit	=	9	| bit set means clear allocated memory.

 checks
countmps	=	0	|enables counting of master pointers

dfltflags	=	0	|checking is on when zone is init'd


|
| constants:
|
minfree	=	12	|12 byte minimum block size
tagmask	=	0xc0000000	|mask for the 2-bit tag field
bcoffmask	=	0x0f000000	|mask for the 4 bit byte count offset
bcmask	=	0x00ffffff	|mask for the 24 bit byte count
ptrmask	=	0x00ffffff	|mask pointer to low 24 bits
handlemask	=	0x00ffffff	|mask handle to low 24 bits
freetag	=	0x0	|tag for free block
nreltag	=	0x40000000	|tag fsumacc/h/macprint.h   444      0     12        7260  3470501353   7523 /*	macprint.h	1.0	84/06/28	*/

/*
 * Print interface.
 */

/*
 * history
 * 06/28/84	Schuster	Created.
 */

#define iPrRelease 2		/* code version */
#define iPrPgFract 120		/* page scale factor */

#define iPrPgFst 1		/* page range constants */
#define iPrPgMax 9999

/* spare integers in print record */
#define iPrintX 19

typedef struct {
	short iDev;		/* font manager device code */
	short iVRes;		/* v resolution of device */
	short iHRes;		/* h resolution of device */
	Rect rPage;		/* the printable page rectangle */
} TPrInfo;

typedef TPrInfo * TPPrInfo;

typedef struct {
	short wDev;		/* the device driver number */
	short iPageV;		/* page size in units of 1/iPrPgFract */
	short iPageH;		
	char bPort;		/* io port number */
	char feed;		/* paper feeder types */
} TPrStl;

typedef TPrStl * TPPrStl;

typedef struct {
	short iRowBytes;	/* band's rowbytes */
	short iBandV;		/* size of band, in device coords */
	short iBandH;
	short iDevBytes;	/* size for allocation */
	short iBands;		/* number of bands per page */
	char bPatScale;		/* pattern scaling */
	char bULThick;		/* 3 underscoring params */
	char bULOffset;
	char bULShadow;
	char scan;		/* band scan direction */
	char bXInfoX;		/* extra byte */
} TPrXInfo;

typedef TPrXInfo * TPPrXInfo;

/* band scan direction */
#define scanTB 0
#define scanBT 1
#define scanLR 2
#define scanRL 3

typedef struct {
	short iFstPage;		/* page range */
	short iLstPage;	
	short iCopies;		/* number of copies */
	char bJDocLoop;		/* doc style: draft, spool, ... */
	char fFromUsr;		/* printing from application */
	ProcPtr pIdleProc;	/* call while io waiting */
	char *pFileName;	/* spool file name */
	short iFileVol;		/* spool file volumn */
	char bFileVers;		/* spool file version */
	char bJobX;		/* and extra byte */
} TPrJob;

typedef TPrJob * TPPrJob;

/* document styles */
#define bDraftLoop 0
#define bSpoolLoop 1
#define bUser1Loop 2
#define bUser2Loop 3

/* paper feeder types */
#define feedCut 0
#define feedFanFold 1
#define feedMechCut 2
#define feedOther 3

typedef struct {
	short iPrVersion;	/* printing software version */
	TPrInfo PrInfo;		/* print info data */
	Rect rPaper;		/* the paper rectangle */
	TPrStl PrStl;		/* print request's style */
	TPrInfo PrInfoPT;	/* print time imaging metrics */
	TPrXInfo PrXInfo;	/* print time print info record */
	TPrJob PrJob;		/* print job request */
	char PrintX[iPrintX * 2];	/* filler to 120 bytes */
} TPrint;

typedef TPrint * TPPrint;
typedef TPPrint * THPrint;

typedef struct {
	GrafPort GPort;			/* printer graph port */
	QDProcs GProcs;			/* and procs */
	long lGParam1;			/* some parameters */
	long lGParam2;
	long lGParam3;
	long lGParam4;
	char fOurPtr;
	char fOurBits;
} TPrPort ;

typedef TPrPort * TPPrPort;

typedef struct {
	short iTotPages;		/* total pages */
	short iCurPage;			/* current page number */
	short iTotCopies;		/* total copies requested */
	short iCurCopy;			/* current copy number */
	short iTotBands;		/* total bands per page */
	short iCurBand;			/* current band number */
	char fPgDirty;			/* true if current page written */
	char fImaging;			/* set while in drawpic call */
	THPrint hPrint;			/* handle to active print record */
	TPPrPort pPrPort;		/* pointer to active PrPort */
	PicHandle hPic;			/* handle to active Picture */
} TPrStatus;

typedef TPrStatus * TPPrStatus;

typedef struct {
	DialogRecord Dlg;		/* dialog window */
	ProcPtr pFltrProc;		/* filter proc */
	ProcPtr pItemProc;		/* item evaluating proc */
	THPrint hPrintUsr;		/* user's print record */
	char fDoIt;			
	char fDone;
	long lUser1;			/* global data */
	long lUser2;
	long lUser3;
	long lUser4;
	/* and some more stuff */
} TPrDlg;

typedef TPrDlg * TPPrDlg;

TPPrDlg PrStlInit();
TPPrDlg PrJobInit();
TPPrPort PrOpenDoc();
0	|max legal address for 512k machine
maxmasters	=	0x1000	|ridiculously large allocation chunk size
dfltmasters	=	32	|default to 32 master pointers
dfltstacksize	=	0x00002000	|8k size for stack
mnstacksize	=	0x00000400	|1k minimum size for stack
|
|	block types
|
tybkmask	=	3	|mask for block type
tybkfree	=	0	|free block
tybknrel	=	1	sumacc/lib/   775      0     12           0  3472710566   6000 sumacc/lib/io/   775      0     12           0  3472710572   6404 sumacc/lib/io/eject.s   444      0     12         705  3470501373   7720 	.insrt	"h.h"

|
|function eject(volname: osstrptr| vrefnum: integer): oserr|
|

		.text
		.globl	_eject
_eject:

	link	a6,#-iovqelsize	| get space for control p-block
	lea	a6@(-iovqelsize),a0	| point a0 at the block
	movw	a6@(8),a0@(iovrefnum)	| drive to be unmounted
	movl	a6@(10),a0@(iovnptr)	| volume name pointer
	.word	__eject
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
define feedMechCut 2
#define feedOther 3

typedef struct {
sumacc/lib/io/pb.s   444      0     12        4515  3470501374   7253 	.insrt	"h.h"

| interface routines expecting a parameter block ptr as argument
| hence the prefix pb

	.macro	oscall,tnum
	movl	#[tnum<<16] + 0x4e75,d1	| trap, rts
	bra	_ostrap
	.endm

	.globl	_pbopen
_pbopen:
	oscall	__open

	.globl	_pbclose
_pbclose:
	oscall	__close

	.globl	_pbread
_pbread:
	oscall	__read

	.globl	_pbwrite
_pbwrite:
	oscall	__write

	.globl	_pbcontro
_pbcontro:
	oscall	__control

	.globl	_pbstatus
_pbstatus:
	oscall	__status

	.globl	_pbkillio
_pbkillio:
	oscall	__killio

	.globl	_pbgetvin
_pbgetvin:
	oscall	__getvolinfo

	.globl	_pbgetvol
_pbgetvol:
	oscall	__getvol

	.globl	_pbsetvol
_pbsetvol:
	oscall	__setvol

	.globl	_pbeject
_pbeject:
	oscall	__eject

	.globl	_pbofflin
_pbofflin:
	oscall	__offline

	.globl	_pbflushv
_pbflushv:
	oscall	__flushvol

	.globl	_pbcreate
_pbcreate:
	oscall	__create

	.globl	_pbdelete
_pbdelete:
	oscall	__delete

	.globl	_pbopenrf
_pbopenrf:
	oscall	__openrf

	.globl	_pbrename
_pbrename:
	oscall	__rename

	.globl	_pbgetfin
_pbgetfin:
	oscall	__getfileinfo

	.globl	_pbsetfin
_pbsetfin:
	oscall	__setfileinfo

	.globl	_pbsetflo
_pbsetflo:
	oscall	__setfillock

	.globl	_pbrstflo
_pbrstflo:
	oscall	__rstfillock

	.globl	_pbsetfve
_pbsetfve:
	oscall	__setfiltype

	.globl	_pballoca
_pballoca:
	oscall	__allocate

	.globl	_pbgeteof
_pbgeteof:
	oscall	__geteof

	.globl	_pbseteof
_pbseteof:
	oscall	__seteof

	.globl	_pbgetfpo
_pbgetfpo:
	oscall	__getfpos

	.globl	_pbsetfpo
_pbsetfpo:
	oscall	__setfpos

	.globl	_pbflushf
_pbflushf:
	oscall	__flushfil



_ostrap:
	movl	sp@+,a1		| save return addr
	movb	sp@+,d0		| async flag
	movl	sp@+,a0		| PB ptr
	beq	.L1		| if not async
	orl	#_async_<<16,d1
.L1:
	movl	d1,sp@-		| for reentrancy, push trap/rts on stk
	jsr	sp@		| call trap 
	addql	#4,sp
	movw	d0,sp@		| save result
	jmp	a1@



| mountvolume and unmountvolume calls can only be made synchronously
| function pbmountvol(paramblock: parmblkptr): oserr|
| function pbunmountvol(paramblock: parmblkptr): oserr|

	.globl	_pbmountv
_pbmountv:
	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get param pointer.
	.word	__mountvol	|tell os to do it synchronously
	movw	d0,sp@	|_save result
	jmp	a1@	|return to caller

	.globl	_pbunmoun
_pbunmoun:
	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get param pointer.
	.word	__unmountvol	|tell os to do it synchronously
	movw	d0,sp@	|_save result
	jmp	a1@	|return to caller

size	=	0x00002000	|8k size for stack
mnstacksize	=	0x00000400	|1k minimum size for stack
|
|	block types
|
tybkmask	=	3	|mask for block type
tybkfree	=	0	|free block
tybknrel	=	1	sumacc/lib/io/adddrive.s   444      0     12         653  3470501375  10414 	.insrt	"h.h"

| interface for file system and io procedures and functions which do not require
| a parameter block
|
| procedure adddrive(drvrrefnum: integer| drvnum: integer| qel: drvqelptr)|

	.text
	.globl	_adddrive
_adddrive:
	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|ptr to memory for queue element
	movw	sp@+,d0	|drive number
	swap	d0	|put it in high word
	movw	sp@+,d0	|driver ref num
	.word	__adddrive
	jmp	a1@
atus:
	oscall	__status

	.globl	_pbkillio
_pbkillio:
	oscall	__killio

	.globl	_pbgetsumacc/lib/io/fsopen.s   444      0     12        1375  3470501375  10146 	.insrt	"h.h"

|simple interface to io routines which does not require caller to set up the
|parameter block
|
|function fsopen(filename: osstr255| versnum: signedbyte| vrefnum: integer|
|	var refnum: integer): oserr|
|
	.text
	.globl	_fsopen
_fsopen:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movl	a6@(14),a0@(iofilename)	| set ptr to filename
	movw	a6@(12),a0@(iodrvnum)	| drive number
	clrb	a0@(iofiletype)	| file type
	clrb	a0@(iopermssn)	| open for read/write
	clrl	a0@(ioownbuf)	| use system buffer

	.word	__open

	movl	a6@(8),a1	| return the refnum
	movw	a0@(iorefnum),a1@
	movw	d0,a6@(18)	| return the result code

	unlk	a6
	movl	sp@+,a0	| return address
	addl	#10,sp	| fix up stack
	jmp	a0@
oscall	__flushvol

	.globl	_pbcreate
_pbcreate:
	oscall	__create

	.globl	_pbdelete
_pbdelete:
	oscall	__delete

	.globl	_pbopenrf
_pbopenrf:
	oscall	__openrf

	.globl	_pbrename
_pbrename:
	oscall	__rename

	.globl	_pbgetfin
_pbgetfin:
	oscall	__getfileinfo

sumacc/lib/io/fsclose.s   444      0     12         601  3470501375  10261 	.insrt	"h.h"

|
|function fsclose(refnum: integer): oserr|
|

	.text
	.globl	_fsclose
_fsclose:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block
	movw	a6@(8),a0@(iorefnum)	| get the refnum param
	.word	__close
	movw	d0,a6@(10)	| return the result code
	unlk	a6
	movl	sp@+,a0	| return address
	addql	#2,sp	| fix up stack
	jmp	a0@
)	| set ptr to filename
	movw	a6@(12),a0@(iodrvnum)	| drive number
	clrb	a0@(iofiletype)	| file type
	clrb	a0@(iopermssn)	| opesumacc/lib/io/fsread.s   444      0     12        1665  3470501376  10123 	.insrt	"h.h"

|
|function fsread(refnum: integer| var count: longint| buffptr: ptr): oserr|
|
|function fswrite(refnum: integer| var count: longint| buffptr: ptr): oserr|
|
|

		.text
		.globl	_fsread
_fsread:
	.globl	_fswrite

	clrl	d1	| set up read
	bra	doblk

_fswrite:
	moveq	#1,d1	| set up write

doblk:
	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movl	a6@(8),a0@(iobuffer)	| buffer address
	movw	a6@(16),a0@(iorefnum)	| refnum
	movl	a6@(12),a1	| address of the count
	movl	a1@,a0@(iobytecount)	| read count
	clrw	a0@(ioposmode)	| no special mode
	clrl	a0@(ioposoffset)	| clear offset

	tstb	d1	| look for read or write
	bne	.L3
	.word	__read
	bra	.L4
.L3:	.word	__write
.L4:
	movw	d0,a6@(18)	| return the result code

	movl	a6@(12),a1	| address of the count
	movl	a0@(ionumdone),a1@	| return count read

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
er)	| buffer address
	movw	a6@(16),a0@(iorefnum)	| refnum
	movl	a6@(12),a1	sumacc/lib/io/control.s   444      0     12        1505  3470501376  10330 	.insrt	"h.h"

|function control(refnum: integer| cscode: integer|
|	var csparam: ptr): oserr|

	.text
	.globl	_control
_control:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(14),a0@(iorefnum)	| refnum
	movw	a6@(12),a0@(cscode)	| the control operation to be performed
	tstl	a6@(8)	| see if there is a parameter block
	beq	.L5	| if not, don't bother copying one
	lea	a0@(csparam),a1	| dest address of op specific params
	movl	a6@(8),a0	| src address of op specific params
	moveq	#22,d0	| max number of bytes to be moved
	.word	__blockmove	| copy the op specific params
	lea	a6@(-ioqelsize),a0	| put cmd block addr back into a0

.L5:	.word	__control
	movw	d0,a6@(16)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#8,sp	| fix up stack
	jmp	a1@
l	_pbdelete
_pbdelete:
	oscall	__delete

	.globl	_pbopenrf
_pbopenrf:
	oscall	__openrf

	.globl	_pbrename
_pbrename:
	oscall	__rename

	.globl	_pbgetfin
_pbgetfin:
	oscall	__getfileinfo

sumacc/lib/io/status.s   444      0     12        1251  3470501377  10172 	.insrt	"h.h"

|
|function status(refnum: integer| cscode: integer|
|	csparam: ptr): oserr|

	.text
	.globl	_status
_status:
	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(14),a0@(iorefnum)	| refnum
	movw	a6@(12),a0@(cscode)	| the control operation to be performed
	.word	__status
	movw	d0,a6@(16)	| return the result code
	lea	a6@(csparam-ioqelsize),a0 |ptr to the status information
	movl	a6@(8),a1	| ptr to where to put this information
	moveq	#22,d0	| max number of bytes to be moved
	.word	__blockmove	| copy the op specific params

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#8,sp	| fix up stack
	jmp	a1@
r back into a0

.L5:	.word	__control
	movw	d0,a6@(16)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#8,sp	| fix up stack
	jmp	a1@
l	_pbdelete
_pbdelete:
	oscall	__delete

	.globl	_pbopenrf
_pbopenrf:
	oscall	__openrf

	.globl	_pbrename
_pbrename:
	oscall	__rename

	.globl	_pbgetfin
_pbgetfin:
	oscall	__getfileinfo

sumacc/lib/io/killio.s   444      0     12         570  3470501377  10115 	.insrt	"h.h"

|
|function killio(refnum: integer): oserr|
|
		.text
		.globl	_killio
_killio:

	link	a6,#-32	|get space for control p-block
	lea	a6@(-32),a0	|point a0 at the block
	movw	a6@(8),a0@(iorefnum)	| refnum
	.word	__killio	| make the control call
	movw	d0,a6@(10)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#2,sp	| fix up stack
	jmp	a1@
e result code
	lea	a6@(csparam-ioqelsize),a0 |ptr to the status information
	movl	a6@(8),a1	| ptr to where to put this information
	movesumacc/lib/io/getvinfo.s   444      0     12        2452  3470501377  10474 	.insrt	"h.h"

|
|functon getvinfo(drvnum: integer| volname: osstrptr| var vrefnum: integer|
|	var freebytes: longint): oserr|
|

		.text
		.globl	_getvinfo
_getvinfo:

	link	a6,#-iovqelsize	| get space for control p-block
	lea	a6@(-iovqelsize),a0	| point a0 at the block
	movl	a6@(16),a0@(iovnptr)	| volume name pointer
	movw	a6@(20),a0@(iovdrvnum)	| drive number
	clrw	a0@(iovolindex)	| no volume queue index
	.word	__getvolinfo	| make the control call
	movw	d0,a6@(22)	| return the result code
	movl	a6@(12),a1	| pointer to vrefnum
	movw	a0@(iovrefnum),a1@	| return volume ref num

	|now calculate the number of free bytes on the volume by multiplying
	|allocation block size * free allocation blocks
	|would ideally like to multiply long * integer but since mulu only
	|multiplies two ints, to allow for a larger than 16 bit allocation
	|block size we shift it right by 9 (since we know it to be a multiple
	|of 512 and then shift the result back.
	movl	a0@(iovalblksiz),d0	|num bytes in an allocation block
	asrl	#8,d0	|shift over by 8
	asrl	#1,d0	|and one more
	mulu	a0@(iovfrblk),d0	|multiply by number of free blocks
	asll	#1,d0	|shift back to the left
	asll	#8,d0
	movl	a6@(8),a1	|pointer to free bytes
	movl	d0,a1@	|return the value


	unlk	a6
	movl	sp@+,a1	| return address
	addl	#14,sp	| fix up stack
	jmp	a1@
f

	.globl	_pbseteof
_pbseteof:
	oscall	__seteof

	.globl	_pbgetfpo
_pbgetfpo:
	oscall	__getfpos

	.globl	_pbsetfpo
_pbsetfpo:
	oscall	__setfpos

	.globl	_pbflushf
_pbflushf:
	oscall	__flushfil



_ostrap:
	movl	spsumacc/lib/io/getfinfo.s   444      0     12        1467  3470501400  10444 	.insrt	"h.h"

|
|function getfinfo(filename: osstr255| versnum: signedbyte| vrefnum: integer|
|	var fndrinfo: finfo):oserr|
|
		.text
		.globl	_getfinfo
_getfinfo:


	link	a6,#-iofqelsize	| make room on stack for cmd block
	lea	a6@(-iofqelsize),a0	| address of cmd block

	movl	a6@(14),a0@(iofilename)	| set ptr to filename
	movw	a6@(12),a0@(iovrefnum)	| set volume ref num
	clrb	a0@(iofiletype)	| (version field)
	clrw	a0@(iofdirindex)	|clear directory index

	.word	__getfileinfo	|get the info
	movw	d0,a6@(18)	| return the result code

	|transfer the user defined finder info words (16 bytes) into result
	lea	a0@(ioflusrwds),a0	|where to copy from
	movl	a6@(8),a1	|where to copy to
	movw	#16,d0	| 16 bytes of information
	.word	__blockmove

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
6 bit allocation
	|block size we shift it right by 9 (since we know it to be a multiple
	|of 512 and then shift the result back.
	movl	a0@(iovalblksiz),d0	|num bytes in an allocation block
	asrl	#8,d0	sumacc/lib/io/getvol.s   444      0     12        1770  3470501400  10140 	.insrt	"h.h"

|
|function getvol(volname: osstrptr| var vrefnum: integer):oserr|
|
|
		.text
		.globl	_getvol
_getvol:

	link	a6,#-iovqelsize	| get space for control p-block
	lea	a6@(-iovqelsize),a0	| point a0 at the block
	movl	a6@(12),a0@(iovnptr)	| pointer to volume name pointer
	.word	__getvol	| make the control call
	movw	d0,a6@(16)	| return the result code
	movl	a6@(8),a1	| pointer to drive number
	movw	a0@(iovrefnum),a1@	| return drive number

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#8,sp	| fix up stack
	jmp	a1@

|
|function setvolume(volname: osstrptr| vrefnum: integer): oserr|
|

		.text
		.globl	_setvol
_setvol:

	link	a6,#-iovqelsize	|get space for control p-block
	lea	a6@(-iovqelsize),a0	| point a0 at the block
	movl	a6@(10),a0@(iovnptr)	| ptr to desired volume name
	movw	a6@(8),a0@(iovrefnum)	| desired default drive number
	.word	__setvol	| make the control call
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/mountvol.s   444      0     12        1714  3470501401  10522 	.insrt	"h.h"

|
|function mountvol(drvnum: integer| var vrefnum):oserr|
|
|
|		.text
|		.globl	_mountvo
|_mountvo:
|
|	link	a6,#-iovqelsize	|get space for control p-block
|	lea	a6@(-iovqelsize),a0	| point a0 at the block
|	movw	a6@(12),a0@(iovdrvnum)	| drive to be mounted
|	.word	__mountvol	| make the control call
|	movw	d0,a6@(14)	| return the result code
|	movl	a6@(8),a1
|	movw	a0@(iovrefnum),a1@	| return volume reference number
|
|	unlk	a6
|	movl	sp@+,a1	| return address
|	addql	#6,sp	| fix up stack
|	jmp	a1@

|
|function unmountvol(volname: osstrptr| vrefnum: integer):oserr|
|

		.text
		.globl	_unmountv
_unmountv:

	link	a6,#-iovqelsize	|get space for control p-block
	lea	a6@(-iovqelsize),a0	| point a0 at the block
	movw	a6@(8),a0@(iovrefnum)	| drive to be unmounted
	movl	a6@(10),a0@(iovnptr)	| volume name pointer
	.word	__unmountvol
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
ddress
	addql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/offline.s   444      0     12         735  3470501401  10243 	.insrt	"h.h"

|
|function offline(volname: osstrptr| vrefnum: integer): oserr|
| removed 12 apr 84

	.text
	.globl	_offline
_offline:

	link	a6,#-iovqelsize	| get space for control p-block
	lea	a6@(-iovqelsize),a0	| point a0 at the block
	movw	a6@(8),a0@(iovrefnum)	| drive to be unmounted
	movl	a6@(10),a0@(iovnptr)	| volume name pointer
	.word	__offline
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
ss
|	addql	#6,sp	| fix up stack
|	jsumacc/lib/io/flushvol.s   444      0     12         721  3470501401  10456 	.insrt	"h.h"

|
|function flushvolume(volname: osstrptr| vrefnum: integer):oserr|
|

	.text
	.globl	_flushvol
_flushvol:

	link	a6,#-iovqelsize	| get space for control p-block
	lea	a6@(-iovqelsize),a0	| point a0 at the block
	movw	a6@(8),a0@(iovrefnum)	| drive to be unmounted
	movl	a6@(10),a0@(iovnptr)	| volume name pointer
	.word	__flushvol
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
ck
	jmp	a1@
ss
|	addql	#6,sp	| fix up stack
|	jsumacc/lib/io/create.s   444      0     12        1727  3470501401  10106 	.insrt	"h.h"

|
|function create(filename: osstr255| vrefnum: integer| creator: ostype|
|	filetype: ostype):oserr|

	.text
	.globl	_create
_create:


	link	a6,#-iofqelsize	| make room on stack for cmd block
	lea	a6@(-iofqelsize),a0	| address of cmd block

	movl	a6@(18),a0@(iofilename)	| set ptr to filename
	movw	a6@(16),a0@(iovrefnum)	| set volume ref num
	clrb	a0@(iofiletype)	| clear type, permissions (version field)

	.word	__create
	tstw	d0	|error?
	bne	crdone	|yes, don't bother setting type

	clrw	a0@(iofdirindex)	|clear directory index
	.word	__getfileinfo	|get the previous info

	|transfer the user defined finder info words (16 bytes)
	movl	a0,d0	|_save ptr to param block
	lea	a0@(ioflusrwds),a1	|where to copy user words
	movl	a6@(8),a1@+	|enter in the new file type
	movl	a6@(12),a1@	|enter in the new file creator
	.word	__setfileinfo

crdone:
	movw	d0,a6@(22)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#14,sp	| fix up stack
	jmp	a1@
ql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/fsdelete.s   444      0     12        1017  3470501402  10427 	.insrt	"h.h"

|
|function fsdelete(filename: osstr255| vrefnum: integer):oserr|
|

	.text
	.globl	_fsdelete
_fsdelete:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movl	a6@(10),a0@(iofilename)	| set ptr to filename
	movw	a6@(8),a0@(iovrefnum)	| set volume ref num
	clrb	a0@(iofiletype)	| clear type, permissions (version field)

	.word	__delete
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
lear directory index
	.word	__getfileinfo	|get the previous info

	|transfer the user defined finder info words (16 bytes)
	movl	a0,d0	|_save ptr to param block
	lea	a0@(ioflusrwds),a1	|where to copy user words
	movl	a6@(8),a1@+	|enter in the new file type
	movl	a6@(12),a1@	|enter in the new file creator
	.word	__setfileinfo

crdone:
	movw	d0,a6@(22)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#14,sp	| fix up stack
	jmp	a1@
ql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/openrf.s   444      0     12        1325  3470501402  10127 	.insrt	"h.h"

|
|function openrf(filename: osstr255| vrefnum: integer|var refnum: integer): oserr|
|
|

	.text
	.globl	_openrf
_openrf:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movl	a6@(14),a0@(iofilename)	| set ptr to filename
	movw	a6@(12),a0@(iovrefnum)	| set volume ref num
	clrb	a0@(iofiletype)	| clear type, permissions (version field)

	clrb	a0@(iopermssn)	| open for read/write
	clrl	a0@(ioownbuf)	| use system buffer
	.word	__openrf		| open resource fork
	movw	d0,a6@(18)	| return the result code
	movl	a6@(8),a1	|ptr to refnum
	movw	a0@(iorefnum),a1@	| return the refnum

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
y user words
	movl	a6@(8),a1@+	|enter in the new file type
	movl	a6@(12),a1@	|enter in the new file creator
	.word	__setfileinfo

crdone:
	movw	d0,a6@(22)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#14,sp	| fix up stack
	jmp	a1@
ql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/rename.s   444      0     12        1125  3470501402  10103 	.insrt	"h.h"

|
|function rename(oldname: osstr255| vrefnum: integer|
|	newname: osstr255):oserr|
|
		.text
		.globl	_rename
_rename:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movl	a6@(14),a0@(iofilename)	| set ptr to filename
	movw	a6@(12),a0@(iovrefnum)	| set volume ref num
	clrb	a0@(iofiletype)	| clear type, permissions (version field)
	movl	a6@(8),a0@(ionewname)	|new name to give to file

	.word	__rename
	movw	d0,a6@(18)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
efnum
	movw	a0@(iorefnum),a1@	| return the refnum

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
y user words
	movl	a6@(8),a1@+	|enter in the new file type
	movl	a6@(12),a1@	|enter in the new file creator
	.word	__setfileinfo

crdone:
	movw	d0,a6@(22)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#14,sp	| fix up stack
	jmp	a1@
ql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/setfinfo.s   444      0     12        1545  3470501402  10457 	.insrt	"h.h"

|
|function setfinfo(filename: osstr255| vrefnum| integer|
|	fndrinfo: finfo):oserr|
|
	.text
	.globl	_setfinfo
_setfinfo:

	link	a6,#-iofqelsize	| make room on stack for cmd block
	lea	a6@(-iofqelsize),a0	| address of cmd block

	movl	a6@(14),a0@(iofilename)	| set ptr to filename
	movw	a6@(12),a0@(iovrefnum)	| set volume ref num
	clrb	a0@(iofiletype)	| (version field)
	clrw	a0@(iofdirindex)	|clear directory index

	.word	__getfileinfo	|get the previous info

	|transfer the user defined finder info words (16 bytes)
	lea	a0@(ioflusrwds),a1	|where to copy user words
	movl	a6@(8),a0	|where the user words are now
	movw	#16,d0	| 16 bytes of information
	.word	__blockmove
	lea	a6@(-iofqelsize),a0	|restore a0

	.word	__setfileinfo
	movw	d0,a6@(18)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
iofiletype)	| (version field)
	clrw	a0@(iofdirindex)	|clear directory index

	.word	__getfileinfo	|get the previous info

	|transfer the user defined findesumacc/lib/io/setflock.s   444      0     12        1026  3470501402  10446 	.insrt	"h.h"

|
|function setflock(filename: osstr255| vrefnum: integer):oserr|
|
|
		.text
		.globl	_setflock
_setflock:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movl	a6@(10),a0@(iofilename)	| set ptr to filename
	movw	a6@(8),a0@(iovrefnum)	| set volume ref num
	clrb	a0@(iofiletype)	| clear type, permissions (version field)

	.word	__setfillock
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
efnum
	movw	a0@(iorefnum),a1@	| return the refnum

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
y user words
	movl	a6@(8),a1@+	|enter in the new file type
	movl	a6@(12),a1@	|enter in the new file creator
	.word	__setfileinfo

crdone:
	movw	d0,a6@(22)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#14,sp	| fix up stack
	jmp	a1@
ql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/rstflock.s   444      0     12        1024  3470501402  10461 	.insrt	"h.h"

|
|function rstflock(filename: osstr255|	vrefnum: integer):oserr|
|
|
	.text
	.globl	_rstflock
_rstflock:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movl	a6@(10),a0@(iofilename)	| set ptr to filename
	movw	a6@(8),a0@(iovrefnum)	| set volume ref num
	clrb	a0@(iofiletype)	| clear type, permissions (version field)

	.word	__rstfillock
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
@
	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
efnum
	movw	a0@(iorefnum),a1@	| return the refnum

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
y user words
	movl	a6@(8),a1@+	|enter in the new file type
	movl	a6@(12),a1@	|enter in the new file creator
	.word	__setfileinfo

crdone:
	movw	d0,a6@(22)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#14,sp	| fix up stack
	jmp	a1@
ql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/setftype.s   444      0     12        1201  3470501403  10473 	.insrt	"h.h"

|
|function setftype(filename: osstr255| oldvers: signedbyte| vrefnum: integer|
|	newvers: signedbyte):oserr|
|
	.text
	.globl	_setftype
_setftype:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movl	a6@(16),a0@(iofilename)	| set ptr to filename
	movw	a6@(10),a0@(iovrefnum)	| set volume ref num
	movb	a6@(12),a0@(iofiletype)	| clear type, permissions (version field)
	movb	a6@(8),a0@(ionewtype)	|the new type (version field)

	.word	__setfiltype
	movw	d0,a6@(16)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#12,sp	| fix up stack
	jmp	a1@
efnum

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
y user words
	movl	a6@(8),a1@+	|enter in the new file type
	movl	a6@(12),a1@	|enter in the new file creator
	.word	__setfileinfo

crdone:
	movw	d0,a6@(22)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#14,sp	| fix up stack
	jmp	a1@
ql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/allocate.s   444      0     12        1022  3470501403  10415 	.insrt	"h.h"

|
|function allocate(refnum: integer| var count: longint):oserr|
|

	.text
	.globl	_allocate
_allocate:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movl	a6@(8),a1	|ptr to requested byte count
	movl	a1@,a0@(ioreqcount)	|
	movw	a6@(12),a0@(iorefnum)	| set refnum

	.word	__allocate
	movw	d0,a6@(14)	| return the result code
	movl	a0@(ioactcount),a1@	| return actual byte count

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
a6@(16)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#12,sp	| fix up stack
	jmp	a1@
efnum

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#10,sp	| fix up stack
	jmp	a1@
y user words
	movl	a6@(8),a1@+	|enter in the new file type
	movl	a6@(12),a1@	|enter in the new file creator
	.word	__setfileinfo

crdone:
	movw	d0,a6@(22)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addl	#14,sp	| fix up stack
	jmp	a1@
ql	#6,sp	| fix up stack
	jmp	a1@
l	#8,d0	sumacc/lib/io/drvr.s   444      0     12        7714  3470501403   7624 	.insrt	"h.h"

|
| from macmisc.text
|	miscellanous macintosh interface routines
|	this version for traps based system
|	it also includes stortraps
|
|
|	written by andy hertzfeld	16-oct-82
|
|	modification history
|
|	25-jan-83	ajh	modified for new file/io system
|	12-jun-83	ajh	added opendeskacc
|
|------------------------------------------------


|
|function vinstall(vblblockptr: vblcbptr): oserr;
|

		.text
		.globl	_vinstall
_vinstall:

	movl	sp@+,a1	|get the return address
	movl	sp@+,a0	|addr of vertical retrace control blk
	movl	a1,sp@-	|restore return address

	.word	__vinstall
	movw	d0,sp@(4)	|return error

	rts

|
|function vremove(vblblockptr: vblcbptr): oserr;
|

		.text
		.globl	_vremove
_vremove:

	movl	sp@+,a1	|get the return address
	movl	sp@+,a0	|addr of vertical retrace control blk
	movl	a1,sp@-	|restore return address

	.word	__vremove
	movw	d0,sp@(4)	|return error

	rts

|
|function drvrinstall(name: osstr255;	drvrrefnum: integer): oserr;
| installdriver installs a driver of the specified name, into the specified
| unit.
|
		.text
		.globl	_drvrinst
_drvrinst:

	movw	sp@(4),d0	|get unit number
	movl	sp@(6),a0	|get the filename ptr
	.word	__drvrinstall	|install it

	movl	sp@+,a0	|get return address
	addqw	#6,sp	|strip parameters
	movw	d0,sp@	|return error
	jmp	a0@	|return to caller

|
|function drvrremove(drvrrefnum: integer): oserr;
|

		.text
		.globl	_drvrremo
_drvrremo:

	movw	sp@(4),d0	|get driver refnum
	.word	__drvrremove	|remove it

	movl	sp@+,a0	|get return address
	addqw	#2,sp	|strip parameters
	movw	d0,sp@	|return error
	jmp	a0@	|return to caller

|
| function opendriver(drivername: osstr255): integer;
|
|	opendriver opens the driver of a given name, returning its refnum
|
		.text
		.globl	_opendriv
_opendriv:

	movl	sp@(4),a0	|get a pointer to the name
	moveq	#[ioqelsize/2]-1,d0
.L1:	clrw	sp@-
	dbra	d0,.L1

	movl	a0,sp@(iofilename)	|set up name
	clrb	sp@(iopermssn)	| open for read/write
	movl	sp,a0	|point to it
	.word	__open	|open the driver
	bnes	badopen	|if an error, don't return refnum

	movw	sp@(iorefnum),d0	|get the refnum
doneopen:
	addw	#ioqelsize,sp	|pop off command buffer
	movw	d0,sp@(8)	|return the refnum

	movl	sp@+,sp@	|strip return address
	rts
badopen:
	moveq	#0,d0
	bras	doneopen
|
| procedure closedriver(refnum: integer);
|
|	closedriver closes the driver with the specified refnum
|
		.text
		.globl	_closedri
_closedri:

	movw	sp@(4),d0	|get the refnum
	subw	#30,sp	|get space for param block
	movw	d0,sp@(iorefnum)	|set up refnum
	movl	sp,a0
	.word	__close	|close it!
	addw	#30,sp	|pop off param block

	movl	sp@+,a0
	addqw	#2,sp
	jmp	a0@

|
|function initutil: oserr;
|

		.text
		.globl	_initutil
_initutil:

	.word	__initutil
	movw	d0,sp@(4)	|return error

	rts

|queue routines
|
| procedure initqueue(qheader: qhdrptr);
|

		.text
		.globl	_initqueu
_initqueu:

	movl	sp@+,a0	|return address
	movl	sp@+,a1	|queue header ptr
	.word	__initqueue
	jmp	a0@	|return

|
|procedure enqueue(qelement: qelemptr; qheader: qhdrptr);
|
|adds qelement a0@ to queue with qheader a1@

		.text
		.globl	_enqueue
_enqueue:

	movl	sp@(4),a1	|ptr to qheader
	movl	sp@(8),a0	|ptr ot qelem to be added
	.word	__enqueue
	movl	sp@+,a0	|return address
	addqw	#8,sp	|pop off params
	jmp	a0@	|return

|function dequeue(qelement: qelemptr; qheader: qhdrptr): oserr;
|
		.text
		.globl	_dequeue
_dequeue:

	movl	sp@(4),a1	|ptr to qheader
	movl	sp@(8),a0	|ptr ot qelem to be added
	.word	__dequeue
	movw	d0,sp@(12)	|return error
	movl	sp@+,a0	|return address
	addqw	#8,sp	|pop off params
	jmp	a0@	|return



|function getdctlentry(refnum: integer): dctlhandle;
| does status 1 call to get the dcehandle

		.text
		.globl	_getdctle
_getdctle:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(8),a0@(iorefnum)	| drive number
	movw	#1,a0@(cscode)	|code to get dce handle
	.word	__status
	movl	a0@(csparam),a6@(10)	|return the dce handle

	unlk	a6
	movl	sp@+,a0	| return address
	addqw	#2,sp	| fix up stack
	jmp	a0@

it cases
fngzresrv	=	3	|set to 1 to prevent gz resersumacc/lib/io/geteof.s   444      0     12        1634  3470501403  10113 	.insrt	"h.h"

|
|function geteof(refnum: integer| var logeof: longint):oserr|
|
	.text
	.globl	_geteof
_geteof:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(12),a0@(iorefnum)	| set refnum

	.word	__geteof
	movw	d0,a6@(14)	| return the result code
	movl	a6@(8),a1	|ptr to logical length variable
	movl	a0@(ioleof),a1@	|return logical end of file

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@


|
|function seteof(refnum: integer| logeof: longint):oserr|
|
	.text
	.globl	_seteof
_seteof:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(12),a0@(iorefnum)	| set refnum
	movl	a6@(8),a0@(ioleof)	| the desired end of file

	.word	__seteof
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@
ile

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@


|
|function setesumacc/lib/io/getfpos.s   444      0     12        1762  3470501403  10313 	.insrt	"h.h"

|
|function getfpos(refnum: integer| var filepos: longint):oserr|
|
	.text
	.globl	_getfpos
_getfpos:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(12),a0@(iorefnum)	| set refnum

	.word	__getfpos
	movw	d0,a6@(14)	| return the result code
	movl	a6@(8),a1	|ptr to logical length variable
	movl	a0@(ioposoffset),a1@	|return logical end of file

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@


|
|function setfpos(refnum: integer| posmode: integer| posoff: longint):oserr|
|
	.text
	.globl	_setfpos
_setfpos:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(14),a0@(iorefnum)	| set refnum
	movw	a6@(12),a0@(ioposmode)	| positioning information
	movl	a6@(8),a0@(ioposoffset)	| new file position

	.word	__setfpos
	movw	d0,a6@(16)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#8,sp	| fix up stack
	jmp	a1@
, don't returnsumacc/lib/io/flushfile.s   444      0     12         600  3470501403  10573 	.insrt	"h.h"

|
|function flushfile(refnum: integer):oserr|
|

	.text
	.globl	_flushfil
_flushfil:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(8),a0@(iorefnum)	| set refnum

	.word	__flushfil
	movw	d0,a6@(10)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#2,sp	| fix up stack
	jmp	a1@
osoffset),a1@	|return logical end of file

	unlk	a6
	movl	sp@+,a1	| return address
	addql	#6,sp	| fix up stack
	jmp	a1@


|
|funsumacc/lib/io/appfiles.s   444      0     12        5434  3470501404  10450 	.insrt	"h.h"

|
|procedure countappfiles(var message: integer; var count: integer);
|

		.text
		.globl	_countapp
_countapp:

	movl	sp@(4),a1
	clrw	a1@	|set default count to 0
	appparmhandle=0xaec
	movl	appparmhandle,a0	|the app parm handle
	.word	__gethandlesize	|are we real
	bles	countend
	movl	a0@,a0	|deref appparm handle
	movl	sp@(8),a1	|ptr to message
	movw	a0@+,a1@	|return the message
	movl	sp@(4),a1
	movw	a0@,a1@	|return the count

countend:
	movl	sp@+,a0	|return addr
	addqw	#8,sp
	jmp	a0@


|
|procedure getappfiles(index: integer; var thefile: appfile);
|
| ftype is set to all 0's if no next file was found orw there is no file list

|appfile = record
|	vrefnum: integer;
|	ftype: ostype;
|	versnum: integer;	{versnum in high byte}
|	fname: str255;
|	end; {appfile}


|appparm has format:	
|	message (0/1) for load orw print	(2 bytes)
|	# of entries	(2 bytes)
|	for each entry:	volume refnum	(2 bytes)
|	type	(4 bytes)
|	version	(2 bytes)
|	name- padded to even

		.text
		.globl	_getappfi
_getappfi:

	|moveml	a2-a3,sp@-
	moveml	#0x0030,sp@-
	movl	sp@(4+8),a1	|ptr to filelistelem
	clrl	a1@(2)	|assume failure
	movl	appparmhandle,a0	|get the application parameter handle
	.word	__gethandlesize	|are we real?
	bles	getend
	movl	a0@,a2	|deref appparm handle
	addqw	#2,a2	|skip the msg
	movw	sp@(8+8),d1	|which entry to go to
	cmpw	a2@+,d1	|see if index within limit
	bgts	getend
	subqw	#1,d1	|make index zero based

getloop:	blts	getend	|are we done?
	movl	a2,a0	|where to copy from
	moveq	#2,d0
	addb	a0@(8),d0	|length of string
	andw	#0xfffe,d0	|evenize it
	addw	#8,d0	|also movw refnum,type,versnum
	addw	d0,a2	|move to next
	.word	__blockmove
	subqw	#1,d1
	bras	getloop

getend:	
	|moveml	sp@+,a2-a3	|save regs
	moveml	sp@+,#0x0c00	|save regs
	movl	sp@+,a0
	addqw	#6,sp	|pop args
	jmp	a0@

|
|procedure clrappfiles(index: integer);
|

		.text
		.globl	_clrappfi
_clrappfi:

	movl	appparmhandle,a0	|get the application parameter handle
	.word	__gethandlesize	|are we real?
	bles	clrend
	movl	a0@,a0	|deref appparm handle
	addqw	#2,a0	|skip the msg

	movw	sp@(4),d1	|which entry to go to
	cmpw	a0@+,d1	|see if index within limit
	bgts	clrend
	subqw	#1,d1	|make index zero based

clrloop:	blts	clrend	|are we done?
	beqs	clrtype
	moveq	#2,d0
	addb	a0@(8),d0	|length of string
	andw	#0xfffe,d0	|evenize it
	addw	#8,d0	|also movw refnum,type,versnum
	addw	d0,a0	|move to next
	subqw	#1,d1
	bras	clrloop

clrtype:	clrl	a0@(2)
clrend:
	movl	sp@+,a0
	addqw	#2,sp	|pop args
	jmp	a0@


|implementation for system error handler	(ie. deep shit manager)
|

| procedure syserror(errorcode: integer);
|
|	invoke the deep shit manager with the specified error code
|

		.text
		.globl	_syserror
_syserror:


	movl	sp@+,a0	|get return address
	movw	sp@+,d0	|get error code
	.word	__syserror	|invoke deeep shit
	.word	0xa9ff	|don't come back!
ueue
_dequeue:

	movl	sp@(4),a1	|ptr to qheader
	movl	sp@(8),a0	|ptr ot qelem to be added
	.word	__dequeue
	movw	d0,sp@(12)	|return error
	movl	sp@+,a0	|return address
	addqw	#8,sp	|pop off params
	jmp	a0@	|return



|function gsumacc/lib/io/disk.s   444      0     12        3236  3470501404   7575 	.insrt	"h.h"

|function diskeject(drvnum: integer): oserr;
|

		.text
		.globl	_diskejec
_diskejec:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	#dskrfn,a0@(iorefnum)	| refnum of the sony disk
	movw	#ejectcode,a0@(cscode)	| code for eject
	movw	a6@(8),a0@(iodrvnum)	|the drvnum of drv to be eject

	.word	__control
	movw	d0,a6@(10)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#2,sp	| fix up stack
	jmp	a1@

|function settagbuffer(buffptr: ptr): oserr;
|

		.text
		.globl	_settagbu
_settagbu:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	#dskrfn,a0@(iorefnum)	| refnum of the sony disk
	tgbuffcode=8
	movw	#tgbuffcode,a0@(cscode)	| code for settagbuffer
	movl	a6@(8),a0@(csparam)	|csparam is the buffptr

	.word	__control
	movw	d0,a6@(12)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#4,sp	| fix up stack
	jmp	a1@

|function drivestatus(drvnum: integer; var status: drvsts): oserr;
|

		.text
		.globl	_drivesta
_drivesta:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	#dskrfn,a0@(iorefnum)	| refnum of the sony disk
	movw	#drvstscode,a0@(cscode)	| code for settagbuffer
	movw	a6@(12),a0@(iodrvnum)	|the drvnum of drv to be ejected

	.word	__status
	movw	d0,a6@(14)	| return the result code
	movl	a6@(8),a1	| ptr to where to put the status bytes
	lea	a0@(csparam),a0	|ptr from where to get status bytes
	movl	#22,d0	|number of bytes to move
	.word	__blockmove

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#6,sp	| fix up stack
	jmp	a1@

| address of cmd block

	movw	#dskrfn,a0@(iorefnum)	| refnum of the sony disk
	tgbuffcode=8
	movw	#tgbuffcode,a0@(cscode)	| code for settagbuffer
	movl	a6@(8),a0@(csparam)	|csparam is the buffptr

	.word	__control
	movw	d0,a6@(12)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#4,sp	| fix up stack
	jmp	a1@

|function drivestatsumacc/lib/io/sound.s   444      0     12       17650  3470501404  10020 	.insrt	"h.h"

| sound manager interface implementation
|
| procedure setsoundvol(level: integer);
|
		.text
		.globl	_setsound
_setsound:

| the following is how you would ideally like to do this (ie with an immediate
| control call) but since there is a problem with immediate control calls, i have
| just taken the sound driver volume routine andw put it here
|	movl	sp@+,a0	;get return address
|	movw	sp@+,d0	;get the volume
|	movl	a0,sp@-	;replace return address
|
|	link	a6,#-32	;get some space for the control p-block
|	lea	a6@(-32),a0	;point a0 at the block
|	movw	#-4,a0@(iorefnum)	;set up the sound driver refnum
|	movw	#2,a0@(cscode)	;set up the control "opcode"
|	movw	d0,a0@(csparam)	;set up event ptr as parameter
|	.word	__control	,immed	;make the control call
|
|	unlk	a6	;de-allocate parameter block
|	rts

|this is from the sound driver:
	movl	sp@+,a0	|get the return address
	movw	sp@+,d0	|get the volume level
	movl	a0,sp@-	|put return addr back on
	cmpb	#0xff,0x400009	|are we running on a lisa?
	beqs	lisasound

	|this is for the mac
	movw	sr,sp@-	|save current status
	orw	#0x0300,sr	|only debug interrupts allowed
	movb	avbufa,d1	|get via port byte
	andw	#0x00f8,d1	|clear low 3 bits
	andw	#7,d0	|only use low 3 bits
	movb	d0,sdvolume	|update low memory variable
	orw	d0,d1	|combine them
	movb	d1,avbufa	|store it back
	rte	|restore interrupts andw return

	|this is for the lisa
lisasound:	andw	#7,d0	|low 3 bits specify sound
	movb	d0,sdvolume	|update low memory variable
	lslw	#1,d0	|shift into position
	movb	0xfcdd81,d1	|read from port b (via2+portb2)
	andb	#0xf1,d1	|clear out bits 1 to 3
	orb	d0,d1
	movb	d1,0xfcdd81
	rts


|
| procedure getsoundvol(var level: integer);
| actually, sound is a byte.
|
		.text
		.globl	_getsound
_getsound:

	movl	sp@+,a0	|get return address
	movl	sp@+,a1	|ptr to result
	clrb	a1@+	|clear high byte
	movb	sdvolume,a1@	|return volume level in low byte
	jmp	a0@

|
|procedure startsound(synthrec: ptr; numbytes: longint; completionrtn: procptr);
|
|
		.text
		.globl	_startsou
_startsou:
	.globl	mypblock
	.globl	sndqueue
	.globl	mycompletion

|set up the parameter block if it is free, otherwise queue up the request
|note that synchronous calls do notw get queued up.	we just loop around
|until all pending calls are done andw then make the call.	this is because
|you cannot start up a syncronous call in a vbl task
	lea	mypblock,a0	|
	tstw	a0@(ioresult)	|ioresult is 0 if blk is free
	beqs	blkfree

	|parameter block is notw free, queue this request up if it is
	|asynchronous. if it is syncronous, loop until everything
	|else is done andw then start it up
	movl	sp@(4),d1	|the completion rtn
	btst	#0,d1	|-1 for asynch otherwise synch
	bnes	sndwait	|it is synchronous

	movl	sndqueue,d0	|is there a handle?
	bnes	isq	|yes, just addw on another entry
	.word	__newhandle	|no, make a zero length handle
	lea	sndqueue,a1	|ptr to soundqueue handle location
	movl	a0,a1@	|save hndl in sndqueue
	beqs	ssdone	|not enough memory, just quit

isq:	movl	sndqueue,a0	|get the handle
	.word	__gethandlesize	|find out it's size
	movl	d0,d1	|save the size
	addw	#12,d0	|make room for the next entry
	.word	__sethandlesize	|make it bigger
	tstw	d0
	bnes	ssdone	|quit if couldn't do it
	movl	a0@,a1	|ptr to the queue
	addl	d1,a1	|add in offset to end of prev data
	lea	sp@(4),a0	|ptr to the args
	moveq	#12,d0	|number of bytes to copy
	.word	__blockmove
	bras	ssdone	|done queueing up, exit

sndwait:	movw	a0@(ioresult),d0	|see if sound is done yet
	bgts	sndwait	|nope, loop on.

blkfree:
	movl	sp@(8),a0@(iobytecount)	|numbytes
	movl	sp@(12),a0@(iobuffer)	|the synthesizer rec
	movw	#-4,a0@(iorefnum)	|sound driver refnum
	clrl	a0@(iocompletion)	|
	movl	sp@(4),d1	|the completion rtn
	btst	#0,d1	|-1 for asynch otherwise synch
	beqs	doasync
	.word	__write	|synchronous write
	bras	ssdone

doasync:	movl	d1,a0@(ioownbuf)	|save their compl rtn in ownbuff
	lea	mycompletion,a1	|my completion routine
	movl	a1,a0@(iocompletion)
	.word	__write+_async_	|asynchronous write

ssdone:	movl	sp@+,a1
	addw	#12,sp
	jmp	a1@


|the completion routine that gets called when an asynchronous call is through
|note: only asynchronous calls are queued up
mycompletion:
	moveml #0xe0e0,sp@-	|preserve the regs
	lea	mypblock,a0	|the parameter block
	movl	a0@(ioownbuf),d1	|address of their completion rtn
	beqs	nocompl	|nil completion routine
	movl	d1,a1	|the completion routine
	jsr	a1@	|go to it

nocompl:	lea	sndqueue,a1	|ptr to sndqueue handle
	tstl	a1@	|is there a pending sound call?
	beqs	mycdone	|no queue, just return

	|there is a pending call, copy the parameters into the parm blk
	lea	mypblock,a2	|the parameter block
	movl	sndqueue,a0	|sndqueue handle
	.word	__gethandlesize	|put the size of the handle in d0
	movl	a0@,a0	|deref it
	movl	a0,a1	|make a copy of it
	movl	a0@+,a2@(ioownbuf)	|their completion routine
	movl	a0@+,a2@(iobytecount) |numbytes
	movl	a0@+,a2@(iobuffer)	|the synthesizer rec
	movw	#-4,a2@(iorefnum)	|sound driver refnum

	|now remove the parameters from the queue
	subw	#12,d0	|was the handle only 12 bytes?
	beqs	dspq	|yes, just dispose of the handle
	movl	d0,d1	|save the new size
	.word	__blockmove	|shift the bytes up in the queue
	movl	sndqueue,a0	|get the handle again
	movl	d1,d0	|get back the new size
	.word	__sethandlesize	|shrink the handle
	bras	complss	|now start the sound

dspq:	movl	sndqueue,a0	|get the handle
	.word	__disposhandle	|dispose it
	lea	sndqueue,a0
	clrl	a0@	|clear out the queue handle

|set up my completion routine andw make the write call
complss:	lea	mypblock,a0	|get ptr to param block
	lea	mycompletion,a1	|this completion routine
	movl	a1,a0@(iocompletion) |stuff it
	.word	__write+_async_	|start asyncronous write andw return


mycdone:	moveml sp@+,#0x0707	|restore regs
	rts

|global parameter block set up for the user. this allows for general
|async sound driver calls without the user worrying about memory allocation.
|if more than one sound driver call is pending at one time, a handle is created
|which contains a queue of the outstanding calls.	these are posted as soon
|as the current calls is completed.
		.data
mypblock:	.blkb	50	|50 bytes total, init ioresult to be nil

sndqueue:	.long	0	|queue of all pending sound calls beyond the
	|two queued in the 2 parameter blocks above.

|
|function sounddone: boolean;
|
|
		.text
		.globl	_sounddon
_sounddon:
	.globl	mypblock

	lea	mypblock,a0	|get current paramter block
	clrw	sp@(4)	|assume false
	tstw	a0@(ioresult)	|see if io is done
	bnes	sdend
	addb	#1,sp@(4)	|yes it's done
sdend:	rts


|
| procedure stopsound;
|
		.text
		.globl	_stopsoun
_stopsoun:
	.globl	sndqueue
	.globl	mypblock

	link	a6,#-32	|get some space for the control p-block
	lea	a6@(-32),a0	|point a0 at the block
	movw	#-4,a0@(iorefnum)	|set up the sound driver refnum
|	movw	#1,a0@(cscode)	;set up the control "opcode"
	.word	__killio+_immed_	|make the control call
	lea	mypblock,a0	|get my parmeter block
	clrw	a0@(ioresult)	|clear the abort error

	|now dispose of any pending write calls
	|note: i do notw call the completion routines of these
	|calls as the normal killio would i just dequeue them
	movl	sndqueue,d0	|the snd queue handle
	beqs	killdone
	movl	d0,a0	|get the handle
	.word	__disposhandle	|dispose it
	lea	sndqueue,a0
	clrl	a0@	|clear out the queue handle
|
killdone:	unlk	a6	|de-allocate parameter block
	rts

|
| procedure swsetlevel(ampl: integer);
| useful if you want to set the level during an asynchronous square wave
| the problem is that the completion routine of the write is executed when
| this setlevel call is done as opposed to when the write is done.	hence,
| it turns out notw to be very useful.	people should use setsoundvol instead
|
|swsetle:
|
|	link	a6,#-50	;get some space for the control p-block
|	lea	a6@(-50),a0	;point a0 at the block
|	movw	#-4,a0@(iorefnum)	;set up the sound driver refnum
|	movw	#3,a0@(cscode)	;set up the control "opcode"
|	movw	a6@(8),a0@(csparam)	;set up the amplitude
|	.word	__control	,immed	;make the control call
|
|	unlk	a6	;de-allocate parameter block
|	movl	sp@+,a0
|	addqw	#2,sp
|	jmp	a0@


us write

ssdone:	movl	sp@+,a1
	addw	#12,sp
	jmp	a1@


|the completion routine that getssumacc/lib/io/ser.s   444      0     12       27773  3470501404   7470 	.insrt	"h.h"
|
|function	serreset(refnum: integer; serconfig: integer): oserr;
|

		.text
		.globl	_serreset
_serreset:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(10),a0@(iorefnum)	| refnum
	movw	#8,a0@(cscode)	| code for reset
	movw	a6@(8),a0@(csparam)	|the configuration

	.word	__control
	movw	d0,a6@(12)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#4,sp	| fix up stack
	jmp	a1@

|
|function	sersetbuf(refnum: integer; serbptr: ptr; serblen: integer): oserr;
|
		.text
		.globl	_sersetbu
_sersetbu:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(14),a0@(iorefnum)	| refnum
	movw	#9,a0@(cscode)	| code for set buffer
	movl	a6@(10),a0@(csparam)	|the ptr to the buffer
	movw	a6@(8),a0@(csparam+4)	|the buffer length

	.word	__control
	movw	d0,a6@(16)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#8,sp	| fix up stack
	jmp	a1@


|
|function	serhshake(refnum: integer; flags: sershk): oserr;
|
		.text
		.globl	_serhshak
_serhshak:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(12),a0@(iorefnum)	| refnum
	movw	#10,a0@(cscode)	| code for setting handshake options
	movl	a6@(8),a1	|ptr to flags record
	movl	a1@+,a0@(csparam)	|copy the first 4 bytes
	movl	a1@,a0@(csparam+4)	|copy the second 4 bytes

	.word	__control
	movw	d0,a6@(14)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#6,sp	| fix up stack
	jmp	a1@


|
|function	sersetbrk(refnum: integer): oserr;
|
		.text
		.globl	_sersetbr
_sersetbr:
	.globl	setclr

	movw	#12,d0

setclr:
	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(8),a0@(iorefnum)	| refnum
	movw	d0,a0@(cscode)	| code for setting break

	.word	__control
	movw	d0,a6@(10)	| return the result code

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#2,sp	| fix up stack
	jmp	a1@


|
|function	serclrbrk(refnum: integer): oserr;
|
		.text
		.globl	_serclrbr
_serclrbr:
	.globl	setclr

	movw	#11,d0	|cscode for clearing break
	jmp	setclr	|got to common set/clr break code


|
|function	sergetbuf(refnum: integer; var count: longint): oserr;
|
		.text
		.globl	_sergetbu
_sergetbu:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(12),a0@(iorefnum)	| refnum
	movw	#2,a0@(cscode)	| cscode for get buf
	.word	__status
	movw	d0,a6@(14)	| return the result code
	movl	a6@(8),a1	| ptr to where to put count
	movl	a0@(csparam),a1@	|return the count

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#6,sp	| fix up stack
	jmp	a1@


|
|function	serstatus(refnum: integer; var sersta: serstarec): oserr;
|

		.text
		.globl	_serstatu
_serstatu:

	link	a6,#-ioqelsize	| make room on stack for cmd block
	lea	a6@(-ioqelsize),a0	| address of cmd block

	movw	a6@(12),a0@(iorefnum)	| refnum
	movw	#8,a0@(cscode)	| cscode for get buf
	.word	__status
	movw	d0,a6@(14)	| return the result code
	movl	a6@(8),a1	| ptr to where to put the status bytes
	movl	a0@(csparam),a1@+	|return the first 4 bytes
	movw	a0@(csparam+4),a1@	|return the next 2 bytes

	unlk	a6
	movl	sp@+,a1	| return address
	addqw	#6,sp	| fix up stack
	jmp	a1@

|
|function	ramsdopen(whichport: sportsel; rsrctype: ostype; rsrcid: integer): oserr;
|procedure	ramsdclose(whichport: sportsel);
|
|ramsdopen - loads andw installs the ram serial driver
| the serial driver is in the application's resource file with type rsrctype
| andw id rsrcid
|whichport is either sporta orw sport
|

		.text
		.globl	_ramsdope
_ramsdope:
	.globl ramsdclose

	link	a6,#-ioqelsize	|make room for command block
	|moveml	d2-d7/a2-a4,sp@-	|save regs
	moveml	#0x3f38,sp@-	|save regs
	clrw	a6@(16)	|assume no error

	|get the handle/ptr to the driver andw lock it
	|don't bother if it is already loaded
	movl	rsdhndl,d4	|drvr orw 0 if notw loaded
	bnes	haved	|it's already in
	subqw	#4,sp	|save space for handle
	movl	a6@(10),sp@-	|push type
	movw	a6@(8),sp@-	|push id number
	.word	__getresou
	movl	sp@,d3	|did it get the handle?
	beq	badramsd	|no, error
	.word	__detachre	|make it my handle
	movl	d3,a3	|handle to the ram driver
	bset	#lock,a3@	|lock it
	lea	rsdhndl,a0	|ptr to where i save the handle
	movl	a3,a0@	|save the handle for later disposal

haved:	movl	rsdhndl,a3	|get the handle to the driver
	movl	a3@,a3	|ptr to the driver

	|now close the appropriate rom driver	(both the in andw the out
	|drivers should be closed)
	lea	a6@(-ioqelsize),a0	|get back the ptr to the param blk
	movb	a6@(14),d1	|the value of whichport
	bsr	clsports

	|now install the ram drivers into the unit table
	|and preserve the interrupt vectors
	|don't do this, however, if they are already installed for this port
	|first save away the old interrupt vectors
	bsr	initiruptptrs	|sets cc non-zero if already installed
	bnes	nowop	|don't reinstall, go to open
	movl	a2@+,a1@+	|save away the ext/stat vector
	moveq	#16,d0	|copy over 16 bytes of the lvl2dt
	.word	__blockmove

	|now save the old drivers (both in andw out)
	|and install the new ones (both in andw out)
	tstb	d1	|which port is it, a orw b?
	beqs	sdra
	lea	drvbin,a2	|ptr to where to save the drv to
	movw	drvbnums,d0	|refnum used for offset into utable
	movl	#48,d1	|offset within driver of the code
	bras	dosdr

sdra:	lea	drvain,a2	|ptr to where to save the drv to
	movw	drvanums,d0	|refnum used for offset into utable
	clrl	d1	|0 offset into drvr

dosdr:	addqw	#1,d0	|get the offset into the unit table
	negw	d0
	aslw	#2,d0	|multiply by 4 to get offset
	movl	utablebase,a0	|ptr to the unit table
	moveq	#1,d3	|do the following twice
instloop:	
|		movl	0(a0,d0),a1	|handle to device control entry
		movl	a0@(0,d0:w),a1
	movl	a1@,a1	|ptr to dce
	movl	a1@(dctldriver),a2@+ |save away the driver ptr
	movl	a3,d2	|ptr to the new driver
	addl	d1,d2	|add in the offset to the approp dev
	andl	#0x00ffffff,d2	|get rid of protect bits
	movl	d2,a1@(dctldriver)	|stuff in the new driver
	addqw	#4,d0	|go onto the next (ie to output port)
	addl	#24,d1	|jump offset in driver
	dbra	d3,instloop	|install the out port, then quit.

	|now open both drivers andw we are done!
nowop:	moveq	#1,d2	|want to do this twice
	lea	a6@(-ioqelsize),a0	|ptr to param blk
	tstb	a6@(14)	|which port?
	beqs	aname	|port a
	lea	drvbnames,a1	|ptr to names: bin andw bout
	bras	donames

aname:	lea	drvanames,a1	|ptr to names for porta in andw out
donames:	movl	a1,a0@(iofilename)	|stuff ptr to name
	clrw	a0@(iodrvnum)
	clrb	a0@(iopermssn)	| open for read/write
	.word	__open
	bnes	badramsd
	clrw	d1
	movb	a1@+,d1	|the length of this string
	addw	d1,a1	|skip to next name
	dbra	d2,donames

okramsd:	
		moveml	sp@+,#0x1cfc	| restore those regs
		|moveml	sp@+,d2-d7/a2-a4	| restore those regs
	unlk	a6

	movl	sp@+,a0	| get rts
	addqw	#8,sp
	jmp	a0@

	openerr=-23
badramsd:	movw	#openerr,a6@(16)
	bra	okramsd


|procedure	ramsdclose(whichport: sportsel);
|ramsdclose - closes the drivers (both in andw out) for the port indicated by
|	whichport.	it disposes of the ram serial driver if it is no
|	longer needed (ie the other port is notw open)
ramsdclose:
	link	a6,#-ioqelsize	|space for the parm block
	|moveml	d2-d7/a2-a4,sp@-	|save regs
	moveml	#0x3f38,sp@-	|save regs

	|first close the in andw out drivers for this port
	lea	a6@(-ioqelsize),a0	|get back the ptr to the param blk
	movb	a6@(8),d1	|the value of whichport
	bsr	clsports

	|now uninstall the ram driver andw restore interrupts of the old driver
	|obviously don't uninstall if it is already uninstalled
	|stuff the old driver back into the unit table
	tstb	d1	|see which port it is
	beqs	rsta
	movb	instb,d0	|see if it is currently installed
	beqs	cldone	|if not, just quit
	lea	drvbin,a0	|where to retrieve drvr from
	movw	drvbnums,d0	|the drvr refnum
	bras	rsteither

rsta:	movb	insta,d0	|see if porta driver is installed
	beqs	cldone	|not, so just quit
	lea	drvain,a0	|where to retrieve drvr from
	movw	drvanums,d0	|the drvr refnum

rsteither:	movl	utablebase,a1	|ptr to the unit table
	moveq	#1,d3	|loop around twice
	addqw	#1,d0	|get the offset into the unit table
	negw	d0
	aslw	#2,d0	|offset for longs
rstloop:
|	movl	0(a1,d0),a2	|dce handle
		movl	a1@(0,d0:w),a2
	movl	a2@,a2	|dce ptr
	movl	a0@+,a2@(dctldriver) |put the saved drvr back
	addqw	#4,d0	|move on to next entry
	dbra	d3,rstloop

	|now restore the interrupt vectors
	bsr	initiruptptrs	|sets cc non-zero if already installed
	movl	a1@+,a2@	|restore extstsdt vector
	exg	a0,a1	|from saved to dt
	moveq	#16,d0	|number of bytes to copy
	.word	__blockmove

	|now indicate the driver is no longer installed and
	|dispose of it if it is notw needed for the other port
	lea	insta,a0
	lea	instb,a1
	tstb	d1	|see which port
	beqs	itsa	|it is port a
	exg	a0,a1	|its b, switch the flags

itsa:	clrb	a0@	|indicate it is no longer installed
	|for this port
	tstb	a1@	|see if installed for the other
	bnes	cldone	|yes, so all done
	movl	rsdhndl,a0	|the handle to the driver
	.word	__disposhandle	|dispose of it
	lea	rsdhndl,a0	|ptr to the place the handle is stored
	clrl	a0@	|indicate no longer loaded

cldone:	
		moveml	sp@+,#0x1cfc	| restore those regs
		|moveml	sp@+,d2-d7/a2-a4	| restore those regs
	unlk	a6
	movl	sp@+,a0
	addqw	#2,sp
	jmp	a0@


|procedures used by ramsdopen andw close

|clsports closes both the in andw out driver of a serial port
|d1 is 0 if porta desired andw nonzero for portb
|a1 pts to refnums of the in andw out drivers for the desired port
|a0 pts to the parameter block

clsports:	tstb	d1	|porta orw portb?
	beqs	cporta
	lea	drvbnums,a1	|portb, so get relevant refnums
	bras	cports
cporta:	lea	drvanums,a1	|porta, so get relevant refnums
cports:	movw	a1@+,a0@(iorefnum)	|set up the parameter block
	.word	__close	|close the in driver
	movw	a1@,a0@(iorefnum)	|refnum of out driver
	.word	__close	|close it also
	rts	|and return

|initiruptptrs initializes a2 to pt to the entry in the external/status
|interrupt vector table that needs to be preserved for the particular port
|and a0 to pt to the block of 4 ptrs from the secondary interrupt vector table
|that must be preserved
|a1 is set to pt to the place to which these vectors are saved
|expects d1 to be whichport (0 if porta, nonzero if portb)

initiruptptrs:
	movl	a4,sp@-	|preserve reg
	movw	#0,d0	|assume all ok
	lea	extstsdt,a2	|ptr to external/status interrupt vectors
	lea	lvl2dt,a0	|ptr to secondary irupt vectors
	tstb	d1	|porta orw portb?
	beqs	savea	|porta
	lea	instb,a4	|installed flag for port b
	lea	savedbirupt,a1	|portb, so pt to that area
	bras	initiok

savea:	lea	insta,a4	|installed flag
	lea	savedairupt,a1
	addql	#8,a2	|ptr t0 chan a nonmouse irupt vector
	addl	#16,a0	|ptr to chan a irupt vectors

initiok:	movb	a4@,d0	|previously installed?
	bset	#0,a4@	|indicate it is now installed
	tstw	d0	|indicate back up if installed
	movl	sp@+,a4
	rts


|globals used by ramsdopen andw ramsdclose
|
|drive names andw numbers:
drvanames:	.byte	4
	.ascii	".ain"
	.byte	5
	.ascii	".aout"
drvbnames:	.byte	4
	.ascii	".bin"
	.byte	5
	.ascii	".bout"

drvanums:	.word	-6	|for ain
	.word	-7	|for aout
drvbnums:	.word	-8	|for bin
	.word	-9	|for bout

|saved interrupt vectors
|vectors saved for porta are extstsdt+8 (the third long in the external/status
|interrupt vector table) andw the last four longs in the secondary interrupt
|vector table (ie lvl2dt+16, lvl2dt+20, lvl2dt+24, lvl2dt+28).
|vectors saved for portb are extstsdt (the first long in the external/status
|interrupt vector table) andw the first four longs in the secondary interrupt
|vector table (ie lvl2dt+0, lvl2dt+4, lvl2dt+8, lvl2dt+12).

savedairupt:	.blkb	20
savedbirupt:	.blkb	20

|saved rom drivers.	when the ram driver is installed, the ptrs to the rom
|driver are saved here andw then restored back into the device control entry
|when the ram driver is closed.
drvain:	.long
drvaout:	.long
drvbin:	.long
drvbout:	.long

|saved ram driver handle
rsdhndl:	.long	0	|init 0 indicates notw currently loaded

|flags indicating the state of the world
|insta andw instb indicate if the ram serial driver has been installed for each port
|if both become uninstalled then the handle is disposed
insta:	.byte	0
instb:	.byte	0

ffsetsumacc/lib/io/Makefile   444      0     12         777  3470501404  10106 .SUFFIXES: .b
STUBS= adddrive.b allocate.b appfiles.b control.b create.b disk.b  drvr.b eject.b flushfile.b flushvol.b fsclose.b fsdelete.b fsopen.b fsread.b geteof.b getfinfo.b getfpos.b getvinfo.b getvol.b killio.b mountvol.b offline.b openrf.b pb.b rename.b rstflock.b ser.b setfinfo.b setflock.b setftype.b sound.b status.b

#	turns .s into .b and strips about 700 useless abs symbols
.s.b:
	cc68 -c $<
	ld68 -r -x -T 0 $*.b
	mv b.out $*.b

all:	$(STUBS)

clean:
	rm -f *.a *.ln *.o *.b *.sl *.s.b *.s.list
psumacc/lib/io/h.h   444      0     12          70  3470501404   7010 	.insrt	"../../h/toolmacs.h"
	.insrt	"../../h/sysequ.h"
ntrol.b create.b disk.b  drvr.b eject.b flushfile.b flushvol.b fsclose.b fsdelete.b fsopen.b fsread.b geteof.b getfinfo.b getfpos.b getvinfo.b getvol.b killio.b mountvol.b offline.b openrf.b pb.b rename.b rstflock.b ser.b setfinfo.b setflock.b setftype.b sound.b status.b

#	turns .s into .b and strips about 700 useless abs symbols
.s.b:
	cc68 -c $<
	ld68 -r -x -T 0 $*.b
	mv b.out $*.b

all:	$(STUBS)

clean:
	rm -f *.a *.ln *.o *.b *.sl *.s.b *.s.list
psumacc/lib/libmac.sed   444      0     12         172  3470501354   7754 /\.data/d
/	link	/d
/	moveml	/d
/	addql	/d
/	bra	/d
/	unlk	/d
/	rts/d
/	.comm/d
/	.text/d
/	.globl/d
/^_/d
/^|/d
/	jbsr/d
lose.b fsdelete.b fsopen.b fsread.b geteof.b getfinfo.b getfpos.b getvinfo.b getvol.b killio.b mountvol.b offline.b openrf.b pb.b rename.b rstflock.b ser.b setfinfo.b setflock.b setftype.b sound.b status.b

#	turns .s into .b and strips about 700 useless abs symbols
.s.b:
	cc68 -c $<
	ld68 -r -x -T 0 $*.b
	mv b.out $*.b

all:	$(STUBS)

clean:
	rm -f *.a *.ln *.o *.b *.sl *.s.b *.s.list
psumacc/lib/libos.c   444      0     12       22213  3470501355   7345 /*	libos.c		1.0	84/05/01	*/

/*
 * OS library.
 *
 * Copyright (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 05/01/84	Croft	Created.
 */

/* LINTLIBRARY */

#include "quickdraw.h"
#undef v
#undef h
#include "osintf.h"
#include "libmac.h"


/*
 * OS INTERFACE
 */

/* Memory Manager */

void	SetApplBase(b) Ptr b; { _macc1(RN,_setapplb,N,L) }
void	InitApplZone() { _macc1(RN,_initappl,N,N) }
void	MaxApplZone() { _macc1(RN,_maxapplz,N,N) }
void	InitZone(g,m,l,s) ProcPtr g; Ptr l,s; { _macc4(RN,_initzone,N,L,S,L,L) }
THz	GetZone() { _macc1(RI,_getzone,L,N) }
void	SetZone(hz) THz hz; { _macc1(RN,_setzone,N,L) }

THz	ApplicZone() { _macc1(RI,_appliczo,L,N) }
THz	SystemZone() { _macc1(RI,_systemzo,L,N) }

int	CompactMem(n) { _macc1(RI,_compactm,L,L) }
void	PurgeMem(n) { _macc1(RN,_purgemem,N,L) }
int	FreeMem() { _macc1(RI,_freemem,L,N) }
void	ResrvMem(n) { _macc1(RN,_resrvmem,N,L) }
int	MaxMem(g) int *g; { _macc1(RI,_maxmem,L,L) }
Ptr	TopMem() { _macc1(RI,_topmem,L,N) }

void	SetGrowZone(g) ProcPtr g; { _macc1(RN,_setgrowz,N,L) }
void	SetApplLimit(l) Ptr l; { _macc1(RN,_setappll,N,L) }

Ptr	NewPtr(c) { _macc1(RI,_newptr,L,L) }
void	DisposPtr(p) Ptr p; { _macc1(RN,_dispospt,N,L) }
int	GetPtrSize(p) Ptr p; { _macc1(RI,_getptrsi,L,L) }
void	SetPtrSize(p,s) Ptr p; { _macc2(RN,_setptrsi,N,L,L) }
THz	PtrZone(p) Ptr p; { _macc1(RI,_ptrzone,L,L) }

Handle	NewHandle(c) { _macc1(RI,_newhandl,L,L) }
void	DisposHandle(h) Handle h; { _macc1(RN,_disposha,N,L) }
int	GetHandleSize(h) Handle h; { _macc1(RI,_gethandl,L,L) }
void	SetHandleSize(h,s) Handle h; { _macc2(RN,_sethandl,N,L,L) }
THz	HandleZone(h) Handle h; { _macc1(RI,_handlezo,L,L) }
Handle	RecoverHandle(p) Ptr p; { _macc1(RI,_recoverh,L,L) }
void	EmptyHandle(h) Handle h; { _macc1(RN,_emptyhan,N,L) }
void	ReAllocHandle(h,s) Handle h; { _macc2(RN,_realloch,N,L,L) }

void	HLock(h) Handle h; { _macc1(RN,_hlock,N,L) }
void	HUnlock(h) Handle h; { _macc1(RN,_hunlock,N,L) }
void	HPurge(h) Handle h; { _macc1(RN,_hpurge,N,L) }
void	HNoPurge(h) Handle h; { _macc1(RN,_hnopurge,N,L) }
void	MoreMasters() { _macc1(RI,_moremast,N,N) }

void	BlockMove(s,d,c) Ptr s,d; { _macc3(RN,_blockmov,N,L,L,L) }
int	MemError() { _macc1(RI,_memerror,S,N) }

int	GZCritical() { _macc1(RI,_gzcritic,B,N) }
Handle	GZSaveHnd() { _macc1(RI,_gzsavehn,L,N) }


/* Driver, vertical retrace, dispatcher, core utilities */

int	VInstall(vp) VBLTask *vp; { _macc1(RI,_vinstall,S,L) }
int	VRemove(vp) VBLTask *vp; { _macc1(RI,_vremove,S,L) }

int	GetTrapAddress(tn) { _macc1(RI,_gettrapa,L,S) }
void	SetTrapAddress(ta,tn) { _macc2(RN,_settrapa,N,L,S) }

int	WriteParam() { _macc1(RI,_writepar,S,N) }
int	SetDateTime(t) { _macc1(RI,_setdatet,S,L) }
int	ReadDateTime(t) int *t; { _macc1(RI,_readdate,S,L) }
void	GetDateTime(s) int *s; { _macc1(RN,_getdatet,N,L) }
void	SetTime(d) DateTimeRec *d; { _macc1(RN,_settime,N,L) }
void	GetTime(d) DateTimeRec *d; { _macc1(RN,_gettime,N,L) }
void	Date2Secs(d,s) DateTimeRec *d; int *s; { _macc2(RN,_date2sec,N,L,L) }
void	Secs2Date(s,d) DateTimeRec *d; { _macc2(RN,_secs2dat,N,L,L) }
void	Delay(nt,ft) int *ft; { _macc2(RN,_delay,N,L,L) }
int	EqualString(s1,s2,c,d) char *s1,*s2; { _macc4(RI,_equalstr,B,PS,PS,B,B) }
void	UprString(s,d) char *s; { _macc2(RN,_uprstrin,N,VPS,B) }
int	InitUtil() { _macc1(RI,_initutil,S,N) }

void	UnLoadSeg(a) Ptr a; { _mact1(RN,0xa9f1,N,L) }
void	ExitToShell() { _mact1(RN,0xa9f4,N,N) }
void	GetAppParms(n,rn,p) char *n; int *rn; Handle *p; { _mact3(RN,0xa9f5,N,VPS,VS,L) }
void	CountAppFiles(mes,c) { _macc2(RN,_countapp,N,VS,VS) }
void	GetAppFiles(i,f) AppFile *f; { _macc2(RN,_getappfi,N,S,L) }
void	ClrAppFiles(i) { _macc1(RN,_clrappfi,N,S) }

void	InitQueue(h) QHdr *h; { _macc1(RN,_initqueu,N,L) }
void	Enqueue(qe,qh) QElem *qe; QHdr *qh; { _macc2(RN,_enqueue,N,L,L) }
int	Dequeue(qe,qh) QElem *qe; QHdr *qh; { _macc2(RI,_dequeue,S,L,L) }
Handle	GetDCtlEntry(rn) { _macc1(RI,_getdctle,L,S) }


/* Input / Output */

int	PBOpen(pb,a) IOParam *pb; { _macc2(RI,_pbopen,S,L,B) }
int	PBClose(pb,a) IOParam *pb; { _macc2(RI,_pbclose,S,L,B) }
int	PBRead(pb,a) IOParam *pb; { _macc2(RI,_pbread,S,L,B) }
int	PBWrite(pb,a) IOParam *pb; { _macc2(RI,_pbwrite,S,L,B) }
int	PBControl(pb,a) CntrlParam *pb; { _macc2(RI,_pbcontro,S,L,B) }
int	PBStatus(pb,a) CntrlParam *pb; { _macc2(RI,_pbstatus,S,L,B) }
int	PBKillIO(pb,a) CntrlParam *pb; { _macc2(RI,_pbkillio,S,L,B) }

int	PBGetVInfo(pb,a) VolumeParam *pb; { _macc2(RI,_pbgetvin,S,L,B) }
int	PBGetVol(pb,a) VolumeParam *pb; { _macc2(RI,_pbgetvol,S,L,B) }
int	PBSetVol(pb,a) VolumeParam *pb; { _macc2(RI,_pbsetvol,S,L,B) }
int	PBEject(pb,a) VolumeParam *pb; { _macc2(RI,_pbeject,S,L,B) }
int	PBOffLine(pb,a) VolumeParam *pb; { _macc2(RI,_pbofflin,S,L,B) }
int	PBFlushVol(pb,a) VolumeParam *pb; { _macc2(RI,_pbflushv,S,L,B) }
int	PBMountVol(pb) VolumeParam *pb; { _macc1(RI,_pbmountv,S,L) }
int	PBUnMountVol(pb) VolumeParam *pb; { _macc1(RI,_pbopen,S,L) }
int	PBCreate(pb,a) IOParam *pb; { _macc2(RI,_pbcreate,S,L,B) }
int	PBDelete(pb,a) IOParam *pb; { _macc2(RI,_pbdelete,S,L,B) }
int	PBOpenRF(pb,a) IOParam *pb; { _macc2(RI,_pbopenrf,S,L,B) }
int	PBRename(pb,a) IOParam *pb; { _macc2(RI,_pbrename,S,L,B) }
int	PBGetFInfo(pb,a) FileParam *pb; { _macc2(RI,_pbgetfin,S,L,B) }
int	PBSetFInfo(pb,a) FileParam *pb; { _macc2(RI,_pbsetfin,S,L,B) }
int	PBSetFLock(pb,a) IOParam *pb; { _macc2(RI,_pbsetflo,S,L,B) }
int	PBRstFLock(pb,a) IOParam *pb; { _macc2(RI,_pbrstflo,S,L,B) }
int	PBSetFVers(pb,a) IOParam *pb; { _macc2(RI,_pbsetfve,S,L,B) }
int	PBAllocate(pb,a) IOParam *pb; { _macc2(RI,_pballoca,S,L,B) }
int	PBGetEOF(pb,a) IOParam *pb; { _macc2(RI,_pbgeteof,S,L,B) }
int	PBSetEOF(pb,a) IOParam *pb; { _macc2(RI,_pbseteof,S,L,B) }
int	PBGetFPos(pb,a) IOParam *pb; { _macc2(RI,_pbgetfpo,S,L,B) }
int	PBSetFPos(pb,a) IOParam *pb; { _macc2(RI,_pbsetfpo,S,L,B) }
int	PBFlushFile(pb,a) IOParam *pb; { _macc2(RI,_pbflushf,S,L,B) }

void	AddDrive(drn,dn,q) DrvQEl *q; { _macc3(RN,_adddrive,N,S,S,L) }

int	FSOpen(n,vrn,rn) char *n; int *rn; { _macc3(RI,_fsopen,S,PS,S,VS) }
int	FSClose(rn) { _macc1(RI,_fsclose,S,S) }
int	FSRead(rn,c,b) int *c; Ptr b; { _macc3(RI,_fsread,S,S,L,L) }
int	FSWrite(rn,c,b) int *c; Ptr b; { _macc3(RI,_fswrite,S,S,L,L) }
int	Control(rn,o,p) CSParam *p; { _macc3(RI,_control,S,S,S,L) }
int	Status(rn,o,p) CSParam *p; { _macc3(RI,_status,S,S,S,L) }
int	KillIO(rn) { _macc1(RI,_killio,S,S) }

/* volume level calls */

int	GetVInfo(n,vn,vrn,fb) char *vn; int *vrn; int *fb; { _macc4(RI,_getvinfo,S,S,VPS,VS,L) }
int	GetFInfo(fn,vrn,fi) char *fn; FInfo *fi; { _macc3(RI,_getfinfo,S,PS,S,L) } 
int	GetVol(n,vrn) char *n; int *vrn; { _macc2(RI,_getvol,S,VPS,VS) }
int	SetVol(n,vrn) char *n; { _macc2(RI,_setvol,S,PS,S) }
int	UnMountVol(n,vrn) char *n; { _macc2(RI,_unmountv,S,PS,S) }
int	Eject(n,vrn) char *n; { _macc2(RI,_eject,S,PS,S) }
int	FlushVol(n,vrn) char *n; { _macc2(RI,_flushvol,S,PS,S) }

/* file level calls for unopened files */

int	Create(n,vrn,c,t) char *n,*c,*t; { _macc4(RI,_create,S,PS,S,TS,TS) }
int	FSDelete(n,vrn) char *n; { _macc2(RI,_fsdelete,S,PS,S) }
int	OpenRF(n,vrn,rn) char *n; int *rn; { _macc3(RI,_openrf,S,PS,S,VS) }
int	Rename(o,vrn,n) char *o,*n; { _macc3(RI,_rename,S,PS,S,PS) }
int	SetFInfo(fn,vrn,fi) char *fn; FInfo *fi; { _macc3(RI,_setfinfo,S,PS,S,L) } 
int	SetFLock(n,vrn) char *n; { _macc2(RI,_setflock,S,PS,S) }
int	RstFLock(n,vrn) char *n; { _macc2(RI,_rstflock,S,PS,S) }
int	SetFType(n,ov,vrn,nv) char *n; { _macc4(RI,_setftype,S,PS,S,S,S) }

/* file level calls for opened files */

int	Allocate(rn,bc) int *bc; { _macc2(RI,_allocate,S,S,L) }
int	GetEOF(rn,e) int *e; { _macc2(RI,_geteof,S,S,L) }
int	SetEOF(rn,e) { _macc2(RI,_seteof,S,S,L) }
int	GetFPos(rn,p) int *p; { _macc2(RI,_getfpos,S,S,L) }
int	SetFPos(rn,pm,po) { _macc3(RI,_setfpos,S,S,S,L) }
int	FlushFile(rn) { _macc1(RI,_flushfil,S,S) }

/* for Serial Driver */

int	DrvrInstall(s,rn) char *s; { _macc2(RI,_drvrinst,S,PS,S) }
int	DrvrRemove(rn) { _macc1(RI,_drvrremo,S,S) }
int	OpenDriver(n) char *n; { _macc1(RI,_opendriv,S,PS) }
void	CloseDriver(rn) { _macc1(RN,_closedri,N,S) }
int	SerReset(rn,p) { _macc2(RI,_serreset,S,S,S) }
int	SerSetBuf(rn,p,l) Ptr p; { _macc3(RI,_sersetbu,S,S,L,S) }
int	SerHShake(rn,f) SerShk *f; { _macc2(RI,_serhshak,S,S,L) }
int	SerSetBrk(rn) { _macc1(RI,_sersetbr,S,S) }
int	SerClrBrk(rn) { _macc1(RI,_serclrbr,S,S) }
int	SerGetBuf(rn,c) int *c; { _macc2(RI,_sergetbu,S,S,L) }
int	SerStatus(rn,f) SerStaRec *f; { _macc2(RI,_serstatu,S,S,L) }
int	RamSDOpen(p,t,i) char *t; { _macc3(RI,_ramsdope,S,S,TS,S) }
void	RamSDClose(p) { _macc1(RN,_ramsdclo,N,S) }

/* for Disk Driver */

int	DiskEject(dn) { _macc1(RI,_diskejec,S,S) }
int	SetTagBuffer(p) Ptr p; { _macc1(RI,_settagbu,S,L) }
int	DriveStatus(dn,sts) DrvSts *sts; { _macc2(RI,_drivesta,S,S,L) }

/* for Sound Driver */

void	SetSoundVol(l) { _macc1(RN,_setsound,N,S) }
void	GetSoundVol(l) int *l; { _macc1(RN,_getsound,N,VS) }
void	StartSound(t,n,com) Ptr t; ProcPtr com; { _macc3(RN,_startsou,N,L,L,L) }
void	StopSound() { _macc1(RN,_stopsoun,N,N) }
int	SoundDone() { _macc1(RI,_sounddon,B,N) }
void	SysBeep(d) { _mact1(RN,0xa9c8,N,S) }

/* for the System error handler */

void	SysError(c) { _macc1(RN,_syserror,N,S) }

/* for MacsBug */

void	MacsBug() { _mact1(RN,0xa9ff,N,N) }
void	MacsBugPrint(s) char *s; { _mact1(RN,0xabff,N,PS) }
2(RI,_pbgetfin,S,L,B) }
int	PBSetFInfo(pb,a) FileParam *pb; { _macc2(RI,_pbsetfin,S,L,B) }
int	PBSetFLock(pb,a) IOParam *pb; { _macc2(RI,_pbsetflo,S,L,B) }
int	PBRstFLock(pb,a) IOParam *pb; { _macc2(RI,_pbrstflo,S,L,B) }
int	PBSetFVers(pb,a) IOParam *pb; { _macc2(RI,_pbsetfve,S,L,B) }
int	PBAllocate(pb,a) IOParam *pb; { _macc2(RI,_pballoca,S,L,B) }
int	PBGetEOF(pb,a) IOPsumacc/lib/libqd.c   444      0     12       22613  3470501355   7334 /*	libqd.c		1.0	84/05/01	*/

/*
 * Quickdraw library.
 *
 * Copyright (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 05/01/84	Croft	Created.
 */

/* LINTLIBRARY */

#include "quickdraw.h"
#undef v
#undef h
#include "libmac.h"

/*
 * QUICKDRAW
 */

/* GrafPort Routines */

void	InitGraf(g) GrafPtr *g; { _mact1(RN,0xa86e,N,L) }
void	OpenPort(p) GrafPtr p; { _mact1(RN,0xa86f,N,L) }
void	InitPort(p) GrafPtr p; { _mact1(RN,0xa86d,N,L) }
void	ClosePort(p) GrafPtr p; { _mact1(RN,0xa87d,N,L) }
void	SetPort(p) GrafPtr p; { _mact1(RN,0xa873,N,L) }
void	GetPort(p) GrafPtr *p; { _mact1(RN,0xa874,N,L) }
void	GrafDevice(device) { _mact1(RN,0xa872,N,S) }
void	SetPortBits(bm) BitMap *bm; { _mact1(RN,0xa875,N,L) }
void	PortSize(w,h) { _mact2(RN,0xa876,N,S,S) }
void	MovePortTo(leftg,topg) { _mact2(RN,0xa877,N,S,S) }
void	SetOrigin(h,v) { _mact2(RN,0xa878,N,S,S) }
void	SetClip(rgn) RgnHandle rgn; { _mact1(RN,0xa879,N,L) }
void	GetClip(rgn) RgnHandle rgn; { _mact1(RN,0xa87a,N,L) }
void	ClipRect(r) Rect *r; { _mact1(RN,0xa87b,N,L) }
void	BackPat(pat) Pattern *pat; { _mact1(RN,0xa87c,N,L) }

/* Cursor Routines */

void	InitCursor() { _mact1(RN,0xa850,N,N) }
void	SetCursor(c) Cursor *c; { _mact1(RN,0xa851,N,L) }
void	HideCursor() { _mact1(RN,0xa852,N,N) }
void	ShowCursor() { _mact1(RN,0xa853,N,N) }
void	ObscureCursor() { _mact1(RN,0xa856,N,N) }

/* Line Routines */

void	HidePen() { _mact1(RN,0xa896,N,N) }
void	ShowPen() { _mact1(RN,0xa897,N,N) }
void	GetPen(pt) Point *pt; { _mact1(RN,0xa89a,N,L) }
void	GetPenState(ps) PenState *ps; { _mact1(RN,0xa898,N,L) }
void	SetPenState(ps) PenState *ps; { _mact1(RN,0xa899,N,L) }
void	PenSize(w,h) { _mact2(RN,0xa89b,N,S,S) }
void	PenMode(mode) { _mact1(RN,0xa89c,N,S) }
void	PenPat(pat) Pattern *pat; { _mact1(RN,0xa89d,N,L) }
void	PenNormal() { _mact1(RN,0xa89e,N,N) }
void	MoveTo(h,v) { _mact2(RN,0xa893,N,S,S) }
void	Move(dh,dv) { _mact2(RN,0xa894,N,S,S) }
void	LineTo(h,v) { _mact2(RN,0xa891,N,S,S) }
void	Line(dh,dv) { _mact2(RN,0xa892,N,S,S) }

/* Text Routines */

void	TextFont(font) { _mact1(RN,0xa887,N,S) }
void	TextFace(face) { _mact1(RN,0xa888,N,S) }
void	TextMode(mode) { _mact1(RN,0xa889,N,S) }
void	TextSize(size) { _mact1(RN,0xa88a,N,S) }
void	SpaceExtra(extra) { _mact1(RN,0xa88e,N,L) }
void	DrawChar(c) { _mact1(RN,0xa883,N,S) }
void	DrawString(s) char *s; { _mact1(RN,0xa884,N,PS) }
void	DrawText(cp,f,c) char *cp; { _mact3(RN,0xa885,N,L,S,S) }
int	CharWidth(c) { _mact1(RI,0xa88d,S,S) }
int	StringWidth(s) char *s; { _mact1(RI,0xa88c,S,PS) }
int	TextWidth(cp,f,c) char *cp; { _mact3(RI,0xa886,S,L,S,S) }
void	GetFontInfo(info) FontInfo *info; { _mact1(RN,0xa88b,N,L) }

/* Point Calculations */

void	AddPt(src,dst) Point *src,*dst; { _mact2(RN,0xa87e,N,SS,L) }
void	SubPt(src,dst) Point *src,*dst; { _mact2(RN,0xa87f,N,SS,L) }
void	SetPt(pt,h,v) Point *pt; { _mact3(RN,0xa880,N,L,S,S) }
int	EqualPt(p1,p2) Point *p1,*p2; { _mact2(RI,0xa881,B,SS,SS) }
void	ScalePt(pt,from,to) Point *pt; Rect *from,*to; { _mact3(RN,0xa8f8,N,L,L,L) }
void	MapPt(pt,from,to) Point *pt; Rect *from,*to; { _mact3(RN,0xa8f9,N,L,L,L) }
void	LocalToGlobal(pt) Point *pt; { _mact1(RN,0xa870,N,L) }
void	GlobalToLocal(pt) Point *pt; { _mact1(RN,0xa871,N,L) }

/* Rectangle Calculations */

void	SetRect(rt,l,t,r,b) Rect *rt; { _mact5(RN,0xa8a7,N,L,S,S,S,S) } /* a macro would be better */
int	EqualRect(r1,r2) Rect *r1,*r2; { _mact2(RI,0xa8a6,B,L,L) }
int	EmptyRect(r) Rect *r; { _mact1(RI,0xa8ae,B,L) }
void	OffsetRect(r,dh,dv) Rect *r; { _mact3(RN,0xa8a8,N,L,S,S) }
void	MapRect(r,from,to) Rect *r,*from,*to; { _mact3(RN,0xa8fa,N,L,L,L) }
void	InsetRect(r,dh,dv) Rect *r; { _mact3(RN,0xa8a9,N,L,S,S) }
int	SectRect(sr1,sr2,dr) Rect *sr1,*sr2,*dr; { _mact3(RI,0xa8aa,B,L,L,L) }
void	UnionRect(sr1,sr2,dr) Rect *sr1,*sr2,*dr; { _mact3(RN,0xa8ab,N,L,L,L) }
int	PtInRect(pt,r) Point *pt; Rect *r; { _mact2(RI,0xa8ad,B,SS,L) }
void	Pt2Rect(p1,p2,r) Point *p1,*p2; Rect *r; { _mact3(RN,0xa8ac,N,SS,SS,L) }

/* Graphical Operations on Rectangles */

void	FrameRect(r) Rect *r; { _mact1(RN,0xa8a1,N,L) }
void	PaintRect(r) Rect *r; { _mact1(RN,0xa8a2,N,L) }
void	EraseRect(r) Rect *r; { _mact1(RN,0xa8a3,N,L) }
void	InvertRect(r) Rect *r; { _mact1(RN,0xa8a4,N,L) }
void	FillRect(r,pat) Rect *r; Pattern *pat; { _mact2(RN,0xa8a5,N,L,L) }

/* RoundRect Routines */

void	FrameRoundRect(r,w,h) Rect *r; { _mact3(RN,0xa8b0,N,L,S,S) }
void	PaintRoundRect(r,w,h) Rect *r; { _mact3(RN,0xa8b1,N,L,S,S) }
void	EraseRoundRect(r,w,h) Rect *r; { _mact3(RN,0xa8b2,N,L,S,S) }
void	InvertRoundRect(r,w,h) Rect *r; { _mact3(RN,0xa8b3,N,L,S,S) }
void	FillRoundRect(r,w,h,p) Rect *r; Pattern *p; { _mact4(RN,0xa8b4,N,L,S,S,L) }

/* Oval Routines */

void	FrameOval(r) Rect *r; { _mact1(RN,0xa8b7,N,L) }
void	PaintOval(r) Rect *r; { _mact1(RN,0xa8b8,N,L) }
void	EraseOval(r) Rect *r; { _mact1(RN,0xa8b9,N,L) }
void	InvertOval(r) Rect *r; { _mact1(RN,0xa8ba,N,L) }
void	FillOval(r,pat) Rect *r; Pattern *pat; { _mact2(RN,0xa8bb,N,L,L) }

/* Arc Routines */

void	FrameArc(r,start,arc) Rect *r; { _mact3(RN,0xa8be,N,L,S,S) }
void	PaintArc(r,start,arc) Rect *r; { _mact3(RN,0xa8bf,N,L,S,S) }
void	EraseArc(r,start,arc) Rect *r; { _mact3(RN,0xa8c0,N,L,S,S) }
void	InvertArc(r,start,arc) Rect *r; { _mact3(RN,0xa8c1,N,L,S,S) }
void	FillArc(r,start,arc,p) Rect *r; Pattern *p; { _mact4(RN,0xa8c2,N,L,S,S,L) }
void	PtToAngle(r,p,a) Rect *r; Point *p; int *a; { _mact3(RN,0xa8c3,N,L,SS,VS) }

/* Polygon Routines */

PolyHandle OpenPoly() { _mact1(R((PolyHandle)0),0xa8cb,L,N) }
void	ClosePoly() { _mact1(RN,0xa8cc,N,N) }
void	KillPoly(p) PolyHandle p; { _mact1(RN,0xa8cd,N,L) }
void	OffsetPoly(p,dh,dv) PolyHandle p; { _mact3(RN,0xa8ce,N,L,S,S) }
void	MapPoly(p,f,t) PolyHandle p; Rect *f,*t; { _mact3(RN,0xa8fc,N,L,L,L) }
void	FramePoly(p) PolyHandle p; { _mact1(RN,0xa8c6,N,L) }
void	PaintPoly(p) PolyHandle p; { _mact1(RN,0xa8c7,N,L) }
void	ErasePoly(p) PolyHandle p; { _mact1(RN,0xa8c8,N,L) }
void	InvertPoly(p) PolyHandle p; { _mact1(RN,0xa8c9,N,L) }
void	FillPoly(p,pat) PolyHandle p; Pattern *pat; { _mact2(RN,0xa8ca,N,L,L) }

/* Region Calculations */

RgnHandle NewRgn() { _mact1(R((RgnHandle)0),0xa8d8,L,N) }
void	DisposeRgn(r) RgnHandle r; { _mact1(RN,0xa8d9,N,L) }
void	CopyRgn(s,d) RgnHandle s,d; { _mact2(RN,0xa8dc,N,L,L) }
void	SetEmptyRgn(r) RgnHandle r; { _mact1(RN,0xa8dd,N,L) }
void	SetRectRgn(rg,l,t,r,b) RgnHandle rg; { _mact5(RN,0xa8de,N,L,S,S,S,S) }
void	RectRgn(rg,r) RgnHandle rg; Rect *r; { _mact2(RN,0xa8df,N,L,L) }
void	OpenRgn() { _mact1(RN,0xa8da,N,N) }
void	CloseRgn(r) RgnHandle r; { _mact1(RN,0xa8db,N,L) }
void	OffsetRgn(r,dh,dv) RgnHandle r; { _mact3(RN,0xa8e0,N,L,S,S) }
void	MapRgn(r,f,t) RgnHandle r; Rect *f,*t; { _mact3(RN,0xa8fb,N,L,L,L) }
void	InsetRgn(r,dh,dv) RgnHandle r; { _mact3(RN,0xa8e1,N,L,S,S) }
void	SectRgn(sr1,sr2,dr) RgnHandle sr1,sr2,dr; { _mact3(RN,0xa8e4,N,L,L,L) }
void	UnionRgn(sr1,sr2,dr) RgnHandle sr1,sr2,dr; { _mact3(RN,0xa8e5,N,L,L,L) }
void	DiffRgn(sr1,sr2,dr) RgnHandle sr1,sr2,dr; { _mact3(RN,0xa8e6,N,L,L,L) }
void	XorRgn(sr1,sr2,dr) RgnHandle sr1,sr2,dr; { _mact3(RN,0xa8e7,N,L,L,L) }
int	EqualRgn(r1,r2) RgnHandle r1,r2; { _mact2(RI,0xa8e3,B,L,L) }
int	EmptyRgn(r) RgnHandle r; { _mact1(RI,0xa8e2,B,L) }
int	PtInRgn(p,r) Point *p; RgnHandle r; { _mact2(RI,0xa8e8,B,SS,L) }
int	RectInRgn(r,rg) Rect *r; RgnHandle rg; { _mact2(RI,0xa8e9,B,L,L) }

/* Graphical Operations on Regions */

void	FrameRgn(r) RgnHandle r; { _mact1(RN,0xa8d2,N,L) }
void	PaintRgn(r) RgnHandle r; { _mact1(RN,0xa8d3,N,L) }
void	EraseRgn(r) RgnHandle r; { _mact1(RN,0xa8d4,N,L) }
void	InvertRgn(r) RgnHandle r; { _mact1(RN,0xa8d5,N,L) }
void	FillRgn(r,pat) RgnHandle r; Pattern *pat; { _mact2(RN,0xa8d6,N,L,L) }

/* Graphical Operations on BitMaps */

void	ScrollRect(r,dh,dv,rg) Rect *r; RgnHandle rg; { _mact4(RN,0xa8ef,N,L,S,S,L) }
void	CopyBits(sb,db,sr,dr,m,rg) BitMap *sb,*db; Rect *sr,*dr; RgnHandle rg; { _mact6(RN,0xa8ec,N,L,L,L,L,S,L) }

/* Picture Routines */

PicHandle OpenPicture(r) Rect *r; { _mact1(R((PicHandle)0),0xa8f3,L,L) }
void	ClosePicture() { _mact1(RN,0xa8f4,N,N) }
void	DrawPicture(p,r) PicHandle p; Rect *r; { _mact2(RN,0xa8f6,N,L,L) }
void	PicComment(kind,size,cp) char *cp; { _mact3(RN,0xa8f2,N,S,S,L) }
void	KillPicture(p) PicHandle p; { _mact1(RN,0xa8f5,N,L) }

/*  The Bottleneck Interface:   */

void	SetStdProcs(qp) QDProcs *qp; { _mact1(RN,0xa8ea,N,L) }
void	StdText(cnt,cp,num,dem) char *cp; Point *num,*dem; { _mact4(RN,0xa882,N,S,L,SS,SS) }
void	StdLine(p) Point *p; { _mact1(RN,0xa890,N,SS) }
void	StdRect(v,r) Rect *r; { _mact2(RN,0xa8a0,N,S,L) }
void	StdRRect(v,r,w,h) Rect *r; { _mact4(RN,0xa8af,N,S,L,S,S) }
void	StdOval(v,r) Rect *r; { _mact2(RN,0xa8b6,N,S,L) }
void	StdArc(v,r,s,a) Rect *r; { _mact4(RN,0xa8bd,N,S,L,S,S) }
void	StdPoly(v,p) PolyHandle p; { _mact2(RN,0xa8c5,N,S,L) }
void	StdRgn(v,r) RgnHandle r; { _mact2(RN,0xa8d1,N,S,L) }
void	StdBits(sb,sr,dr,m,rg) BitMap *sb; Rect *sr,*dr; RgnHandle rg; { _mact5(RN,0xa8eb,N,L,L,L,S,L) }
void	StdComment(kind,size,cp) char *cp; { _mact3(RN,0xa8f1,N,S,S,L) }
int	StdTxMeas(cnt,cp,num,dem,info) char *cp; Point *num,*dem; FontInfo *info; { _mact5(RN,0xa8ed,S,S,L,L,L,L) }
void	StdGetPic(cp,cnt) char *cp; { _mact2(RN,0xa8ee,N,L,S) }
void	StdPutPic(cp,cnt) char *cp; { _mact2(RN,0xa8f0,N,L,S) }

/* Misc Utility Routines */

int	GetPixel(h,v) { _mact2(RI,0xa865,B,S,S) }
int	Random() { _mact1(RI,0xa861,S,N) }
void	StuffHex(cp,s) { _mact2(RN,0xa866,N,L,PS) }
void	ForeColor(color) { _mact1(RN,0xa862,N,L) }
void	BackColor(color) { _mact1(RN,0xa863,N,L) }
void	ColorBit(bit) { _mact1(RN,0xa864,N,S) }

1(R((PolyHandle)0),0xa8cb,L,N) }
void	ClosePoly() { _mact1(RN,0xa8cc,N,N) }
void	KillPoly(p) PolyHandle p; { _mact1(Rsumacc/lib/tras   555      0     12        2047  3470501355   6753 #!/bin/sh
#	tras - translate assembler source from Apple to local
#
#	tras mumble.s		# output left on tmumble.s
#
trap "rm -f /tmp/sed$$" 0 1 2 15
cat <<EOT >/tmp/sed$$
s/;/|/
s/_[a-z][a-z]*/.word	_&/
s/@\([0-9]*\)/\1$/
s/ \.equ / =    /
/=/!s/^[^ |][^ |]*/&:/
s/\.[dr]ef/.globl/
s/\.func/.proc/
/ *\.proc */{
s///
i\\
\		.text
s/,.*$//
s/$/       /
s/^\(........\).*$/_\1/
s/ *$//
h
s/.*/		.globl	&/
G
s/$/:/
}
s/-(\(..\))/\1@-/g
s/\([-$+a-z0-9][-$+a-z0-9]*\)(\(..\),\(..\)\.\(.\))/\2@(\1,\3:\4)/g
s/\([-$+a-z0-9][-$+a-z0-9]*\)(\(..\))/\2@[\1)/g
s/(\(..\))/\1@/g
s/@\[/@(/g
s///g
s/\*\([-+]\)/.\1/g
s/ add[ai]/ add/
s/ add / addw /
s/ addq / addqw /
s/ andi/ and/
s/ and / andw /
s/ clr / clrw /
s/ cmp[aim]/ cmp/
s/ cmp / cmpw /
s/ eori/ eor/
s/ eor / eorw /
s/ movea/ move/
s/ move / movw /
s/ move\./  mov./
s/ neg / negw /
s/ not / notw /
s/ ori/ or/
s/ or / orw /
s/ sub[ai]/ sub/
s/ sub / subw /
s/ subq / subqw /
s/ tst / tstw /
s/$\([0-9a-f][0-9a-f]*\)/0x\1/g
s/\([a-z]\)\.\([lwbs]\)/\1\2/
s/   */	/g
EOT
tr "[A-Z]" "[a-z]" <$1 | sed -f /tmp/sed$$ >t$1
) PolyHandle p; { _mact3(RN,0xa8ce,N,L,S,S) }
void	MapPoly(p,f,t) PolyHandle p; Rect *f,*t; { _mact3(RN,0xa8fc,N,L,L,L) }
void	FramePoly(p) PolyHandle p; { _mact1(RN,0xa8c6,N,L) }
void	PaintPoly(p) PolyHandle p; { _mact1(RN,0xa8c7,N,L) }
void	ErasePoly(p) PolyHandle p; { _mact1(RN,0xa8c8,N,L) }
void	InvertPoly(p) PolyHandle p; { _mact1(RN,0xa8c9,N,L) }
void	FillPoly(p,pat) PolyHandle p; Pattern *pat; { _mact2(RN,0xa8ca,N,L,L) }

/* Region Calculations */

RgnHandle Newsumacc/lib/trmacs   555      0     12         601  3470501355   7245 #!/bin/sh
#	tras - translate assembler source from Apple to local
#
#	tras mumble.s		# output left on tmumble.s
#
trap "rm -f /tmp/sed$$" 0 1 2 15
cat <<EOT >/tmp/sed$$
s/$\([0-9a-f][0-9a-f]*\)/\/\1/
s/ \.equ / =    /
s/;/|/g
/ *\.macro */{
s///
s/ *|.*//
s/.*/_& = /
N
s/ *|.*//
N
s/ *|.*//
s/\n//g
s/ *\.word */ /
s/ *\.endm *//
}
EOT
tr "[A-Z]" "[a-z]" <$1 | sed -f /tmp/sed$$ >t$1
/.*/		.globl	&/
G
s/$/:/
}
s/-(\(..\))/\1@-/g
s/\([-$+a-z0-9][-$+a-z0-9]*\)(\(..\),\(..\)\.\(.\))/\2@(\1,\3:\4)/g
s/\([-$+a-z0-sumacc/lib/libtool.c   444      0     12       40075  3470501356   7710 /*	libtool.c	1.0	84/05/01	*/

/*
 * Toolbox library.
 *
 * Copyright (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 05/01/84	Croft	Created.
 */

/* LINTLIBRARY */

#include "quickdraw.h"
#undef v
#undef h
#include "osintf.h"
#include "toolintf.h"
#include "libmac.h"


/*
 * TOOL INTERFACE
 */

/* General Utilities */

int	BitAnd(l1,l2) { _mact2(RI,0xa858,L,L,L) }
int	BitOr(l1,l2) { _mact2(RI,0xa85b,L,L,L) }
int	BitXor(l1,l2) { _mact2(RI,0xa859,L,L,L) }
int	BitNot(l) { _mact1(RI,0xa85a,L,L) }
int	BitShift(l,c) { _mact2(RI,0xa85c,L,L,S) }
int	BitTst(cp,n) char *cp; { _mact2(RI,0xa85d,B,L,L) }
void	BitSet(cp,n) char *cp; { _mact2(RN,0xa85e,N,L,L) }
void	BitClr(cp,n) char *cp; { _mact2(RN,0xa85f,N,L,L) }
void	LongMul(a,b,dst) Int64Bit *dst; { _mact3(RN,0xa867,N,L,L,L) }
int	FixMul(a,b) { _mact2(RI,0xa868,L,L,L) }
int	FixRatio(numer,denom) { _mact2(RI,0xa869,L,S,S) }
int	HiWord(x) { _mact1(RI,0xa86a,S,L) }
int	LoWord(x) { _mact1(RI,0xa86b,S,L) }
int	FixRound(x) { _mact1(RI,0xa86c,S,L) }
void	PackBits(s,d,sc) Ptr s,d; { _mact3(RN,0xa8cf,N,L,L,S) }
void	UnPackBits(s,d,dc) Ptr *s,*d; { _mact3(RN,0xa8d0,N,L,L,S) }
int	SlopeFromAngle(a) { _mact1(RI,0xa8bc,L,S) }
int	AngleFromSlope(s) { _mact1(RI,0xa8c4,S,L) }
int	DeltaPoint(a,b) Point *a,*b; { _mact2(RI,0xa84f,L,SS,SS) }

int	HandToHand(h) Handle *h; { _macc1(RI,_handtoha,S,L) }
int	PtrToXHand(sp,dh,s) Ptr sp; Handle dh; { _macc3(RI,_ptrtoxha,S,L,L,L) }
int	PtrToHand(sp,dh,s) Ptr sp; Handle *dh; { _macc3(RI,_ptrtohan,S,L,L,L) }
int	HandAndHand(h1,h2) Handle h1,h2; { _macc2(RI,_handandh,S,L,L) }
int	PtrAndHand(p,h,s) Ptr p; Handle h; { _macc3(RI,_ptrandha,S,L,L,L) }

Handle	NewString(s) char *s; { _mact1(RI,0xa906,L,PS) }
void	SetString(sh,s) char *s,**sh; { _mact2(RN,0xa907,N,L,PS) }
Handle	GetString(id) { _mact1(RI,0xa9ba,L,S) }
void	GetIndString(s,id,i) char *s; { _macc3(RN,_getindst,N,VPS,S,S) }

int	Munger(h,off,p1,l1,p2,l2) Handle h; Ptr p1,p2; { _mact6(RI,0xa9e0,L,L,L,L,L,L,L) }

Handle	GetIcon(id) { _mact1(RI,0xa9bb,L,S) }
void	PlotIcon(r,h) Rect *r; Handle h; { _mact2(RN,0xa94b,N,L,L) }
CursHandle GetCursor(id) { _mact1(RI,0xa9b9,L,S) }
PatHandle GetPattern(id) { _mact1(RI,0xa9b8,L,S) }
PicHandle GetPicture(id) { _mact1(RI,0xa9bc,L,S) }
void	GetIndPattern(p,id,i) Pattern *p; { _macc3(RN,_getindpa,N,L,S,S) }

void	ShieldCursor(r,o) Rect *r; Point *o; { _mact2(RN,0xa855,N,L,SS) }


/* Font Manager */

void	InitFonts() { _mact1(RN,0xa8fe,N,N) }
void	GetFontName(id,name) char *name; { _mact2(RN,0xa8ff,N,S,VPS) }
void	GetFNum(name,id) char *name; int *id; { _mact2(RN,0xa900,N,PS,VS) }
void	SetFontLock(flag) { _mact1(RN,0xa903,N,B) }
FMOutPtr FMSwapFont(inrec) FMInput *inrec; { _mact1(RI,0xa901,L,L) }
int	RealFont(id,size) { _mact2(RI,0xa902,B,S,S) }


/* Event Manager */

int	EventAvail(m,r) EventRecord *r; { _mact2(RI,0xa971,B,S,L) }
int	GetNextEvent(m,r) EventRecord *r; { _mact2(RI,0xa970,B,S,L) }
int	StillDown() { _mact1(RI,0xa973,B,N) }
int	WaitMouseUp() { _mact1(RI,0xa977,B,N) }
void	GetMouse(p) Point *p; { _mact1(RN,0xa972,N,L) }
int	TickCount() { _mact1(RI,0xa975,L,N) }
int	Button() { _mact1(RI,0xa974,B,N) }
void	GetKeys(k) KeyMap *k; { _mact1(RN,0xa976,N,L) }

int	PostEvent(n,msg) { _macc2(RI,_posteven,S,S,L) }
void	FlushEvents(which,stop) { _macc2(RN,_flusheve,N,S,S) }
void	SetEventMask(mask) { _macc1(RN,_setevent,N,S) }
int	OSEventAvail(m,e) EventRecord *e; { _macc2(RI,_oseventa,B,S,L) }
int	GetOSEvent(m,e) EventRecord *e; { _macc2(RI,_getoseve,B,S,L) }

/* Window Manager */

void	ClipAbove(w) WindowPeek w; { _mact1(RN,0xa90b,N,L) }
void	PaintOne(w,r) WindowPeek w; RgnHandle r; { _mact2(RN,0xa90c,N,L,L) }
void	PaintBehind(w,r) WindowPeek w; RgnHandle r; { _mact2(RN,0xa90d,N,L,L) }
void	SaveOld(w) WindowPeek w; { _mact1(RN,0xa90e,N,L) }
void	DrawNew(w,f) WindowPeek w; { _mact2(RN,0xa90f,N,L,B) }
void	CalcVis(w) WindowPeek w; { _mact1(RN,0xa909,N,L) }
void	CalcVisBehind(w,r) WindowPeek w;RgnHandle r; { _mact2(RN,0xa90a,N,L,L) }
void	ShowHide(w,f) WindowPtr w; { _mact2(RN,0xa908,N,L,B) }

int	CheckUpdate(e) EventRecord *e; { _mact1(RI,0xa911,B,L) }
void	GetWMgrPort(p) GrafPtr *p; { _mact1(RN,0xa910,N,L) }

void	InitWindows() { _mact1(RN,0xa912,N,N) }
WindowPtr NewWindow(w,r,t,v,id,beh,ga,ref) WindowRecord *w; Rect *r; char *t; WindowPtr beh; { _mact8(RI,0xa913,L,L,L,PS,B,S,L,B,L) }

void	DisposeWindow(w) WindowPtr w; { _mact1(RN,0xa914,N,L) }
void	CloseWindow(w) WindowPtr w; { _mact1(RN,0xa92d,N,L) }
void	MoveWindow(w,h,v,f) WindowPtr w; { _mact4(RN,0xa91b,N,L,S,S,B) }
void	SizeWindow(w,wt,ht,f) WindowPtr w; { _mact4(RN,0xa91d,N,L,S,S,B) }
int	GrowWindow(w,p,b) WindowPtr w; Point *p; Rect *b; { _mact3(RI,0xa92b,L,L,SS,L) }
void	DragWindow(w,p,b) WindowPtr w; Point *p; Rect *b; { _mact3(RN,0xa925,N,L,SS,L) }
void	ShowWindow(w) WindowPtr w; { _mact1(RN,0xa915,N,L) }
void	HideWindow(w) WindowPtr w; { _mact1(RN,0xa916,N,L) }
void	SetWTitle(w,t) WindowPtr w; char *t; { _mact2(RN,0xa91a,N,L,PS) }
void	GetWTitle(w,t) WindowPtr w; char *t; { _mact2(RN,0xa919,N,L,VPS) }
void	HiliteWindow(w,f) WindowPtr w; { _mact2(RN,0xa91c,N,L,B) }
void	BeginUpdate(w) WindowPtr w; { _mact1(RN,0xa922,N,L) }
void	EndUpdate(w) WindowPtr w; { _mact1(RN,0xa923,N,L) }
void	SetWRefCon(w,d) WindowPtr w; { _mact2(RN,0xa918,N,L,L) }
int	GetWRefCon(w) WindowPtr w; { _mact1(RI,0xa917,L,L) }
void	SetWindowPic(w,p) WindowPtr w; PicHandle p; { _mact2(RN,0xa92e,N,L,L) }
PicHandle GetWindowPic(w) WindowPtr w; { _mact1(RI,0xa92f,L,L) }
void	BringToFront(w) WindowPtr w; { _mact1(RN,0xa920,N,L) }
void	SendBehind(w,b) WindowPtr w,b; { _mact2(RN,0xa921,N,L,L) }
WindowPtr FrontWindow() { _mact1(RI,0xa924,L,N) }
void	SelectWindow(w) WindowPtr w; { _mact1(RN,0xa91f,N,L) }
int	TrackGoAway(w,p) WindowPtr w; Point *p; { _mact2(RI,0xa91e,B,L,SS) }
void	DrawGrowIcon(w) WindowPtr w; { _mact1(RN,0xa904,N,L) }

void	ValidRect(r) Rect *r; { _mact1(RN,0xa92a,N,L) }
void	ValidRgn(r) RgnHandle r; { _mact1(RN,0xa929,N,L) }
void	InvalRect(r) Rect *r; { _mact1(RN,0xa928,N,L) }
void	InvalRgn(r) RgnHandle r; { _mact1(RN,0xa927,N,L) }
int	FindWindow(p,w) Point *p; WindowPtr *w; { _mact2(RI,0xa92c,S,SS,L) }
WindowPtr GetNewWindow(id,w,beh) WindowRecord *w; WindowPtr beh; { _mact3(RI,0xa9bd,L,S,L,L) }
int	PinRect(r,p) Rect *r; Point *p; { _mact2(RI,0xa94e,L,L,SS) }
int	DragGrayRgn(rh,p,br,sr,ax,proc) RgnHandle rh; Point *p; Rect *br,*sr; ProcPtr proc; { _mact6(RI,0xa905,L,L,SS,L,L,S,L) }


/* TextEdit */

void	TEActivate(h) TEHandle h; { _mact1(RN,0xa9d8,N,L) }
void	TECalText(h) TEHandle h; { _mact1(RN,0xa9d0,N,L) }
void	TEClick(p,e,h) Point *p; TEHandle h; { _mact3(RN,0xa9d4,N,SS,B,L) }
void	TECopy(h) TEHandle h; { _mact1(RN,0xa9d5,N,L) }
void	TECut(h) TEHandle h; { _mact1(RN,0xa9d6,N,L) }
void	TEDeactivate(h) TEHandle h; { _mact1(RN,0xa9d9,N,L) }
void	TEDelete(h) TEHandle h; { _mact1(RN,0xa9d7,N,L) }
void	TEDispose(h) TEHandle h; { _mact1(RN,0xa9cd,N,L) }
void	TEIdle(h) TEHandle h; { _mact1(RN,0xa9da,N,L) }
void	TEInit() { _mact1(RN,0xa9cc,N,N) }
void	TEKey(k,h) TEHandle h; { _mact2(RN,0xa9dc,N,S,L) }
TEHandle TENew(d,v) Rect *d,*v; { _mact2(RI,0xa9d2,L,L,L) }
void	TEPaste(h) TEHandle h; { _mact1(RN,0xa9db,N,L) }
void	TEScroll(dh,dv,h) TEHandle h; { _mact3(RN,0xa9dd,N,S,S,L) }
void	TESetSelect(ss,se,h) TEHandle h; { _mact3(RN,0xa9d1,N,L,L,L) }
void	TESetText(t,l,h) Ptr t; TEHandle h; { _mact3(RN,0xa9cf,N,L,L,L) }
void	TEInsert(t,l,h) Ptr t; TEHandle h; { _mact3(RN,0xa9de,N,L,L,L) }
void	TEUpdate(r,h) Rect *r; TEHandle h; { _mact2(RN,0xa9d3,N,L,L) }
void	TESetJust(j,h) TEHandle h; { _mact2(RN,0xa9df,N,S,L) }
Handle	TEGetText(h) TEHandle h; { _mact1(RI,0xa9cb,L,L) }
/* Box drawing utility */
void	TextBox(t,l,r,s) Ptr t; Rect *r; { _mact4(RN,0xa9ce,N,L,L,L,S) }


/* Resource Manager */

int	InitResources() { _mact1(RI,0xa995,S,N) }
void	RsrcZoneInit() { _mact1(RN,0xa996,N,N) }
void	CreateResFile(f) char *f; { _mact1(RN,0xa9b1,N,PS) }
int	OpenResFile(f) char *f; { _mact1(RI,0xa997,S,PS) }
void	UseResFile(n) { _mact1(RN,0xa998,N,S) }
int	GetResFileAttrs(n) { _mact1(RI,0xa9f6,S,S) }
void	SetResFileAttrs(n,a) { _mact2(RN,0xa9f7,N,S,S) }
void	UpdateResFile(n) { _mact1(RN,0xa999,N,S) }
void	CloseResFile(n) { _mact1(RN,0xa99a,N,S) }
void	SetResPurge(i) { _mact1(RN,0xa993,N,B) }
void	SetResLoad(a) { _mact1(RN,0xa99b,N,B) }
int	CountResources(t) char *t; { _mact1(RI,0xa99c,S,TS) }
Handle	GetIndResource(t,i) char *t; { _mact2(RI,0xa99d,L,TS,S) }
int	CountTypes() { _mact1(RI,0xa99e,S,N) }
void	GetIndType(t,i) char *t; { _mact2(RN,0xa99f,N,L,S) }
int	UniqueID(t) char *t; { _mact1(RI,0xa9c1,S,TS) }
Handle	GetResource(t,i) char *t; { _mact2(RI,0xa9a0,L,TS,S) }
Handle	GetNamedResource(t,s) char *t,*s; { _mact2(RI,0xa9a1,L,TS,PS) }
void	LoadResource(r) Handle r; { _mact1(RN,0xa9a2,N,L) }
void	ReleaseResource(r) Handle r; { _mact1(RN,0xa9a3,N,L) }
void	DetachResource(r) Handle r; { _mact1(RN,0xa992,N,L) }
void	ChangedResource(r) Handle r; { _mact1(RN,0xa9aa,N,L) }
void	WriteResource(r) Handle r; { _mact1(RN,0xa9b0,N,L) }
int	HomeResFile(r) Handle r; { _mact1(RI,0xa9a4,S,L) }
int	CurResFile() { _mact1(RI,0xa994,S,N) }
int	GetResAttrs(r) Handle r; { _mact1(RI,0xa9a6,S,L) }
void	SetResAttrs(r,a) Handle r; { _mact2(RN,0xa9a7,N,L,S) }
void	GetResInfo(r,id,t,n) Handle r; int *id; char *t,*n; { _mact4(RN,0xa9a8,N,L,VS,L,VPS) }
void	SetResInfo(r,id,n) Handle r; char *n; { _mact3(RN,0xa9a9,N,L,S,PS) }
void	AddResource(r,t,id,n) Handle r; char *n,*t; { _mact4(RN,0xa9ab,N,L,TS,S,PS) }
void	AddReference(r,id,n) Handle r; char *n; { _mact3(RN,0xa9ac,N,L,S,PS) }
void	RmveResource(r) Handle r; { _mact1(RN,0xa9ad,N,L) }
void	RmveReference(r) Handle r; { _mact1(RN,0xa9ae,N,L) }
int	SizeResource(r) Handle r; { _mact1(RI,0xa9a5,L,L) }
int	ResError() { _mact1(RI,0xa9af,S,N) }


/* Control Manager */

ControlHandle NewControl(w,r,t,vis,val,min,max,p,c) WindowPtr w; Rect *r; char *t; { _mact9(RI,0xa954,L,L,L,PS,B,S,S,S,S,L) }
void	DisposeControl(c) ControlHandle c; { _mact1(RN,0xa955,N,L) }
void	KillControls(w) WindowPtr w; { _mact1(RN,0xa956,N,L) }

void	MoveControl(c,h,v) ControlHandle c; { _mact3(RN,0xa959,N,L,S,S) }
void	SizeControl(c,w,h) ControlHandle c; { _mact3(RN,0xa95c,N,L,S,S) }
void	DragControl(c,p,b,s,a) ControlHandle c; Point *p; Rect *b,*s; { _mact5(RN,0xa967,N,L,SS,L,L,S) }
void	ShowControl(c) ControlHandle c; { _mact1(RN,0xa957,N,L) }
void	HideControl(c) ControlHandle c; { _mact1(RN,0xa958,N,L) }
void	SetCTitle(c,t) ControlHandle c; char *t; { _mact2(RN,0xa95f,N,L,PS) }
void	GetCTitle(c,t) ControlHandle c; char *t; { _mact2(RN,0xa95e,N,L,VPS) }
void	HiliteControl(c,s) ControlHandle c; { _mact2(RN,0xa95d,N,L,S) }
void	SetCRefCon(c,r) ControlHandle c; { _mact2(RN,0xa95b,N,L,L) }
int	GetCRefCon(c) ControlHandle c; { _mact1(RI,0xa95a,L,L) }

void	SetCtlValue(c,v) ControlHandle c; { _mact2(RN,0xa963,N,L,S) }
int	GetCtlValue(c) ControlHandle c; { _mact1(RI,0xa960,S,L) }

int	GetCtlMin(c) ControlHandle c; { _mact1(RI,0xa961,S,L) }
int	GetCtlMax(c) ControlHandle c; { _mact1(RI,0xa962,S,L) }
void	SetCtlMin(c,v) ControlHandle c; { _mact2(RN,0xa964,N,L,S) }
void	SetCtlMax(c,v) ControlHandle c; { _mact2(RN,0xa965,N,L,S) }

ProcPtr	GetCtlAction(c) ControlHandle c; { _mact1(RI,0xa96a,L,L) }
void	SetCtlAction(c,p) ControlHandle c; ProcPtr p; { _mact2(RN,0xa96b,N,L,L) }

int	TestControl(c,p) ControlHandle c; Point *p; { _mact2(RI,0xa966,S,L,SS) }
int	TrackControl(c,p,pp) ControlHandle c; Point *p; ProcPtr pp; { _mact3(RI,0xa968,S,L,SS,L) }

int	FindControl(p,w,c) ControlHandle *c; Point *p; WindowPtr w; { _mact3(RI,0xa96c,S,SS,L,L) }
void	DrawControls(w) WindowPtr w; { _mact1(RN,0xa969,N,L) }
ControlHandle	GetNewControl(id,w) WindowPtr w; { _mact2(RI,0xa9be,L,S,L) }


/* Dialog Manager */

void	InitDialogs(p) ProcPtr p; { _mact1(RN,0xa97b,N,L) }
DialogPtr GetNewDialog(id,w,b) Ptr w; WindowPtr b; { _mact3(RI,0xa97c,L,S,L,L) }
DialogPtr NewDialog(w,r,t,vis,p,b,ga,c,i) Ptr w; Rect *r; char *t; WindowPtr b; Handle i; { _mact9(RI,0xa97d,L,L,L,PS,B,S,L,B,L,L) }
int	IsDialogEvent(e) EventRecord *e; { _mact1(RI,0xa97f,B,L) }
int	DialogSelect(e,d,i) EventRecord *e; DialogPtr *d; int *i; { _mact3(RI,0xa980,B,L,L,VS) }
void	ModalDialog(p,i) ProcPtr p; int *i; { _mact2(RN,0xa991,N,L,VS) }
void	DrawDialog(d) DialogPtr d; { _mact1(RN,0xa981,N,L) }
void	CloseDialog(d) DialogPtr d; { _mact1(RN,0xa982,N,L) }
void	DisposDialog(d) DialogPtr d; { _mact1(RN,0xa983,N,L) }
int	Alert(id,p) ProcPtr p; { _mact2(RI,0xa985,S,S,L) }
int	StopAlert(id,p) ProcPtr p; { _mact2(RI,0xa986,S,S,L) }
int	NoteAlert(id,p) ProcPtr p; { _mact2(RI,0xa987,S,S,L) }
int	CautionAlert(id,p) ProcPtr p; { _mact2(RI,0xa988,S,S,L) }
void	CouldAlert(id) { _mact1(RN,0xa989,N,S) }
void	FreeAlert(id) { _mact1(RN,0xa98a,N,S) }
void	CouldDialog(id) { _mact1(RN,0xa979,N,S) }
void	FreeDialog(id) { _mact1(RN,0xa97a,N,S) }
void	ParamText(c0,c1,c2,c3) char *c0,*c1,*c2,*c3; { _mact4(RN,0xa98b,N,PS,PS,PS,PS) }
void	ErrorSound(p) ProcPtr p; { _mact1(RN,0xa98c,N,L) }
void	GetDItem(d,i,k,h,b) DialogPtr d; int *k; Handle *h; Rect *b; { _mact5(RN,0xa98d,N,L,S,VS,L,L) }
void	SetDItem(d,i,k,h,b) DialogPtr d; Handle h; Rect *b; { _mact5(RN,0xa98e,N,L,S,S,L,L) }
void	SetIText(h,t) Handle h; char *t; { _mact2(RN,0xa98f,N,L,PS) }
void	GetIText(h,t) Handle h; char *t; { _mact2(RN,0xa990,N,L,VPS) }
void	SelIText(d,i,s,e) DialogPtr d; { _mact4(RN,0xa97e,N,L,S,S,S) }

void	DlgCut(d) DialogPtr d; { _macc1(RN,_dlgcut,N,L) }
void	DlgPaste(d) DialogPtr d; { _macc1(RN,_dlgpaste,N,L) }
void	DlgCopy(d) DialogPtr d; { _macc1(RN,_dlgcopy,N,L) }
void	DlgDelete(d) DialogPtr d; { _macc1(RN,_dlgdelet,N,L) }


/* Desk Manager */

int	SystemEvent(e) EventRecord *e; { _mact1(RI,0xa9b2,B,L) }
void	SystemClick(e,w) EventRecord *e; WindowPtr w; { _mact2(RN,0xa9b3,N,L,L) }
void	SystemTask() { _mact1(RN,0xa9b4,N,N) }
void	SystemMenu(m) { _mact1(RN,0xa9b5,N,L) }
int	SystemEdit(e) { _mact1(RI,0xa9c2,B,S) }
int	OpenDeskAcc(a) char *a; { _mact1(RI,0xa9b6,S,PS) }
void	CloseDeskAcc(n) { _mact1(RN,0xa9b7,N,S) }


/* Menu Manager */

void	InitMenus() { _mact1(RN,0xa930,N,N) }
MenuHandle NewMenu(id,t) char *t; { _mact2(RI,0xa931,L,S,PS) }
MenuHandle GetMenu(id) { _mact1(RI,0xa9bf,L,S) }
void	DisposeMenu(m) MenuHandle m; { _mact1(RN,0xa932,N,L) }
void	AppendMenu(m,s) MenuHandle m; char *s; { _mact2(RN,0xa933,N,L,PS) }
void	InsertMenu(m,i) MenuHandle m; { _mact2(RN,0xa935,N,L,S) }
void	DeleteMenu(id) { _mact1(RN,0xa936,N,S) }
void	DrawMenuBar() { _mact1(RN,0xa937,N,N) }
void	ClearMenuBar() { _mact1(RN,0xa934,N,N) }

Handle	GetMenuBar() { _mact1(RI,0xa93b,L,N) }
Handle	GetNewMBar(id) { _mact1(RI,0xa9c0,L,S) }
void	SetMenuBar(m) Handle m; { _mact1(RN,0xa93c,N,L) }

int	MenuSelect(p) Point *p; { _mact1(RI,0xa93d,L,SS) }
int	MenuKey(k) { _mact1(RI,0xa93e,L,S) }
void	HiliteMenu(id) { _mact1(RN,0xa938,N,S) }

void	SetItem(m,i,s) MenuHandle m; char *s; { _mact3(RN,0xa947,N,L,S,PS) }
void	GetItem(m,i,s) MenuHandle m; char *s; { _mact3(RN,0xa946,N,L,S,VPS) }
void	EnableItem(m,i) MenuHandle m; { _mact2(RN,0xa939,N,L,S) }
void	DisableItem(m,i) MenuHandle m; { _mact2(RN,0xa93a,N,L,S) }
void	CheckItem(m,i,c) MenuHandle m; { _mact3(RN,0xa945,N,L,S,B) }

void	SetItemIcon(m,i,n) MenuHandle m; { _mact3(RN,0xa940,N,L,S,S) }
void	GetItemIcon(m,i,n) MenuHandle m; int *n; { _mact3(RN,0xa93f,N,L,S,VS) }
void	SetItemStyle(m,i,n) MenuHandle m; { _mact3(RN,0xa942,N,L,S,S) }
void	GetItemStyle(m,i,n) MenuHandle m; int *n; { _mact3(RN,0xa941,N,L,S,VS) }
void	SetItemMark(m,i,n) MenuHandle m; { _mact3(RN,0xa944,N,L,S,S) }
void	GetItemMark(m,i,n) MenuHandle m; int *n; { _mact3(RN,0xa943,N,L,S,VS) }
void	SetMenuFlash(c) { _mact1(RN,0xa94a,N,S) }
void	FlashMenuBar(id) { _mact1(RN,0xa94c,N,S) }

MenuHandle GetMHandle(id) { _mact1(RI,0xa949,L,S) }
int	CountMItems(m) MenuHandle m; { _mact1(RI,0xa950,S,L) }
void	AddResMenu(m,t) MenuHandle m; char *t; { _mact2(RN,0xa94d,N,L,TS) }
void	InsertResMenu(m,t,a) MenuHandle m; char *t; { _mact3(RN,0xa951,N,L,TS,S) }
void	CalcMenuSize(m) MenuHandle m; { _mact1(RN,0xa948,N,L) }


/* Scrap Manager */

int	GetScrap(h,t,o) Handle h; char *t; int *o; { _mact3(RI,0xa9fd,L,L,TS,L) }
ScrapStuff *InfoScrap() { _mact1(RI,0xa9f9,L,N) }
int	LoadScrap() { _mact1(RI,0xa9fa,L,N) }
int	PutScrap(l,t,s) char *t; Ptr s; { _mact3(RI,0xa9fe,L,L,TS,L) }
int	UnloadScrap() { _mact1(RI,0xa9fa,L,N) }
int	ZeroScrap() { _mact1(RI,0xa9fc,L,N) }

/* package manager */

void	InitAllPacks() { _mact1(RN,0xa9e6,N,N) }
void	InitPack(id) { _mact1(RN,0xa9e5,N,S) }

og(d) DialogPtr d; { _mact1(RN,0xa983,N,L) }
int	Alert(id,p) ProcPtr p; { _mact2(RI,0xa985,S,S,L) }
int	StopAlert(id,p) ProcPtr p; { _mact2(RI,0xa986,S,S,L) }
int	NoteAlert(id,p) ProcPtr p; { _mact2(RI,0xa987,S,S,L) }
int	CautionAlert(id,p) ProcPtr p; { _mact2(RI,0xa988,S,S,L) }
void	CouldAlert(id) { _mact1(RN,0xa989,N,S) }
void	FreeAlert(id) { _mact1(RN,0xa98a,N,S) }
void	CouldDialog(id) { _mact1(RN,0xa979,N,S) }
void	FreeDialog(id) { _mact1(RN,0sumacc/lib/elems.s   444      0     12        2014  3470501356   7340 |-----------------------------------------------------------
| 25may84: C version, uses macros to save my fingers. (croft)
|-----------------------------------------------------------
	.insrt	"../h/sanemacs.h"

__fp68k = /a9eb		| avoids including toolmacs.h
__elems68k = /a9ec

	.text

	.macro c1,l,c
	.globl l
l:	movw	#c,d0
	bras	call1
	.endm
	.macro c2,l,c
	.globl l
l:	movw	#c,d0
	bras	call2
	.endm
	.macro c3,l,c
	.globl l
l:	movw	#c,d0
	bras	call3
	.endm

call1:	movl	sp@+,a0
	movw	d0,sp@-
	.word	__elems68k
	subql	#4,sp
	jmp	a0@

call2:	movl	sp@+,a0
	movl	sp@,d1
	movl	sp@(4),sp@
	movl	d1,sp@(4)
	movw	d0,sp@-
	.word	__elems68k
	subql	#8,sp
	jmp	a0@

	c1,Log2X,flog2x
	c1,LnX,flnx
	c1,Ln1X,fln1x
	c1,Exp2X,fexp2x
	c1,ExpX,fexpx
	c1,Exp1X,fexp1x
	c2,XpwrI,fxpwri
	c2,XpwrY,fxpwry
	c1,SinX,fsinx
	c1,CosX,fcosx
	c1,TanX,ftanx
	c1,AtanX,fatanx
	c1,RandomX,frandomx
	c3,Compound,fcompoundx
	c3,Annuity,fannuityx

call3:	movl	sp@+,a0
	movl	sp@,d1
	movl	sp@(8),sp@
	movl	d1,sp@(8)
	movw	d0,sp@-
	.word	__elems68k
	subw	#12,sp
	jmp	a0@


void	ParamText(c0,c1,c2,c3) char *c0,*c1,*c2,*c3; { _mact4(RN,0xa98b,N,PS,PS,PS,PS) }
void	ErrorSound(p) ProcPtr p; { _mact1(RN,0xa98c,N,L) }
void	GetDItem(d,i,k,h,b) DialogPtr d; int *k; Handle *h; Rect *b; { _mact5(RN,0xa98d,N,L,S,VS,L,L) }
void	SetDItem(d,i,k,h,b) DialogPtr d; Handle h; Rect *b; { _mact5(RN,0xa98e,N,L,S,S,L,L) }
void	SetIText(h,t) Handle h; char *t; { _mact2(RN,0xa98f,N,L,PS) }
void	GetIText(h,t) Handle h; char *t; { _mact2(RN,0xa990,N,L,VPS) }
void	SelIText(d,i,s,e) DialogPsumacc/lib/crtmac.s   444      0     12        2475  3470501356   7517 |
| crtmac.s - self relocating C runtime startoff for Macintosh.
|
| Copyright (C) 1984, Stanford Univ. SUMEX project
| May be used but not sold without permission.
|
| history
| 04/16/84	Croft	Created.
| 04/20/84	Croft	Checks mouse on entry to allow debugger NMI.
|
	.data
	.text
	.globl	_start,_end,_savea5,main
_start:	jra	.L21
	.long	0,0,0,0,0,0,0,0,0,0		| longruns from rmaker
_savea5:.long	0
|
| a1 = next longrun address
| a2 = current reloc address
| d1 = relocation factor
|
.L21:
	lea	pc@(_start-.L21),a1
	movl	a1,d1
	subql	#2,d1
	movl	a1@+,a2		| pickup 1st relocation
	addl	d1,a2
.L16:
|	for(;;) {
|		i = *a2;
|		*a2 = 0;
|		*(u_long *)a2 += (u_long)d1;
|		if (i == 0377)
|			goto start;
|		if (i == 0) {
|			a2 = *a1++;
|			a2 += d1;
|			continue;
|		}
|		a2 += (i << 1);
|	}
	movb	a2@,d7
	andl	#255,d7
	clrb	a2@
	addl	d1,a2@
	cmpl	#255,d7
	beq	.L18
	tstl	d7
	bne	.L19
	movl	a1@+,a2
	addl	d1,a2
	bra	.L16
.L19:
	roll	#1,d7
	addl	d7,a2
	bra	.L16
|
| if mouse button is pressed on entry, beep and hang around for an NMI.
|
.L18:
	clrw	sp@-
	.word	/A974		| get mouse button state
	tstb	sp@+
	beq	.L31		| if not pressed
	movw	#1,sp@-		| sysbeep, duration 1
	.word	/A9C8
	moveq	#1,d0
.L22:
	tstl	d0
	bne	.L22		| hang, waiting for NMI
|
| call main
|
.L31:
	movl	a5,_savea5
	jsr	main
	movl	_savea5,a5
	.word	/ADF4		| trap: exittoshell

	c1,AtanX,fatanx
	c1,RandomX,frandomx
	c3,Compound,fcompoundx
	c3,Annuity,fannuityx

call3:	movl	sp@+,a0
	movl	sp@,d1
	movl	sp@(8),sp@
	movl	d1,sp@(8)
	movw	d0,sp@-
	.word	__elems68k
	subw	#12,ssumacc/lib/hand.s   444      0     12        6060  3470501356   7152 |tooltraps.text
		.text
|
|function handtohand(var thehndl: handle): oserr|
|
| clones handle in a0 returning the new handle in a0

		.globl	_handtoha
_handtoha:
                movl    sp@(4),a0                |ptr to handle
                movl    a0@,a0                 |the handle
                .word	/a9e1
                movl    sp@(4),a1                |ptr to handle to be returned
                movl    a0,a1@                 |return the new handle
                movw    d0,sp@(8)                |return error
                movl    sp@+,sp@              |pop off the return addr
                rts


|
|function ptrtoxhand(srcptr: ptr| dsthndl: handle| size: longint): oserr|
|
| copies size bytes from the srcptr into the existing handle

		.globl	_ptrtoxha
_ptrtoxha:
                movl    sp@+,d1                |save return address
                movl    sp@+,d0                |the size
                movl    sp@+,a1                |existing handle
                movl    sp@+,a1                |srcptr
                movl    d1,sp@-                |restore return address
                .word	/a9e2
                movw    d0,sp@(4)                |error code
                rts                             |return
|
|function ptrtohand(srcptr: ptr| var dsthndl: handle| size: longint): oserr|
|
| makes a handle and copies size bytes of the handle into it

		.globl	_ptrtohan
_ptrtohan:
                movl    sp@(12),a0               |src pointer
                movl    sp@(4),d0                |size
                .word	/a9e3                    |make new hand and copy ptr in
                movw    d0,sp@(16)               |error code
                movl    sp@(8),a1                |address of handle
                movl    a0,a1@                 |return new handle
                movl    sp@+,a0                |return addr
                addw     #12,sp                  |pop off args
                jmp     a0@                    |return
|
|function handandhand(hand1,hand2: handle): oserr|
|
| concatenates hand1 onto the end of hand2

		.globl	_handandh
_handandh:
                movl    sp@(8),a0                |source handle
                movl    sp@(4),a1                |other source handle
                .word	/a9e4                    |concats hndl in a0 to h in a1
                movw    d0,sp@(12)
                movl    sp@+,a0                |return addr
                addql    #8,sp                   |pop off args
                jmp     a0@                    |return
|
|function ptrandhand(ptr1: ptr| hand2: handle| size: longint): oserr|
|
| concatenates ptr1 onto the end of hand2

		.globl	_ptrandha
_ptrandha:
                movl    sp@(4),d0                |length of ptr
                movl    sp@(8),a1                |handle
                movl    sp@(12),a0               |ptr
                .word	/a9ef                       |concat ptr to handle
                movw    d0,sp@(16)               |return error
                movl    sp@+,a0                |return addr
                addw     #12,sp
                jmp     a0@
           |pop off the return addr
                rts


|
|function ptrtoxhand(srcptr: ptr| dsthndl: handle| size: longint): oserr|
|
| copies size bytes from the srcptr into the existing handle

		.globl	_ptrtoxha
_ptrtoxha:
                movl    sp@+,d1                |save return address
                movl    sp@+,d0                |the size
                movl    sp@+,a1                |existing handle
                movl    sp@+,a1                sumacc/lib/pack.s   444      0     12       12135  3470501357   7177 |
| file packtraps.text
|
| implementation for the interface to packages
|

| math package

	.insrt	"../h/sysequ.h"
	.insrt	"../h/toolmacs.h"

|
|macro for package invocation
|
|	first arg is routine selector, second is the trap

	.macro	packcall,subnum,trapnum
	movw	subnum,sp@-
	trapnum
	.endm

|
|procedure sfputfile(where: point| prompt: str255| origname: str255|
|	dlghook: procptr| var reply: sfreply)|
|

		.text
		.globl	_sfputfil
_sfputfil:

	moveq	#1,d2	|stuff the opcode

gopack:	movl	sp@+,a0	|get user's rts
	movw	d2,sp@-	|the routine selector
	movl	a0,sp@-	|push the rts back on
	.word	/adea	|__pack3 w/autopop
	|never gets here

|procedure sfpputfile(where: point| prompt: str255| origname: str255|
|	dlghook: procptr| var reply: sfreply| dlgid: integer|
|	filterproc: procptr)|
|

		.text
		.globl	_sfpputfi
_sfpputfi:

	moveq	#3,d2
	bra	gopack
|
|procedure sfgetfile(where: point| prompt: str255| filefilter: procptr|
|	numtypes: integer| typelist: sflistptr| dlghook: procptr|
|	var reply: sfreply)|
|
		.text
		.globl	_sfgetfil
_sfgetfil:

	moveq	#2,d2
	bra	gopack
|
|procedure sfpgetfile(where: point| prompt: str255| filefilter: procptr|
|	numtypes: integer| typelist: sflistptr| dlghook: procptr|
|	var reply: sfreply| dlgid: integer| filterproc: procptr)|
|

		.text
		.globl	_sfpgetfi
_sfpgetfi:

	moveq	#4,d2
	bra	gopack


|
|procedure diload|
|

		.text
		.globl	_diload
_diload:
	moveq	#2,d2	|stuff the opcode

godi:	movl	sp@+,a0	|get user's rts
	movw	d2,sp@-	|the routine selector
	movl	a0,sp@-	|push the rts back on
	.word	/ade9	|__pack2 w/autopop
	|never gets here


|
|procedure diunload|
|
		.text
		.globl	_diunload
_diunload:
	moveq	#4,d2
	bra	godi

|
|function dibadmount(where: point| evtmessage: longint): oserr|
|
		.text
		.globl	_dibadmou
_dibadmou:
	moveq	#0,d2
	bra	godi


|
|function diformat(drvnum: integer): oserr|
|
		.text
		.globl	_diformat
_diformat:
	moveq	#6,d2
	bra	godi


|
|function diverify(drvnum: integer): oserr|
|
		.text
		.globl	_diverify
_diverify:
	movw	#8,d2
	bra	godi


|
|function dizero(drvnum: integer| volname: str255): oserr|
|
		.text
		.globl	_dizero
_dizero:
	movw	#10,d2
	bra	godi

|
|implementation of interface to international utilities
|
|
|function iugetintl(theid: integer): handle|
|

		.text
		.globl	_iugetint
_iugetint:
	moveq	#6,d2	|stuff the opcode

gointl:	movl	sp@+,a0	|get user's rts
	movw	d2,sp@-	|the routine selector
	movl	a0,sp@-	|push the rts back on
	.word	/aded	|__pack6 w/autopop
	|never gets here

|
|procedure iusetintl(refnum: integer| theid: integer| intlparam: handle)|
|

		.text
		.globl	_iusetint
_iusetint:
	moveq	#8,d2
	bra	gointl


|
|procedure iudatestr(datetime: longint| longflag: integer| var result: str255)|
|

		.text
		.globl	_iudatest
_iudatest:
	moveq	#0,d2
	bra	gointl


|
|procedure iudatepstr(datetime: longint| longflag: integer| var result: str255|
|	intlparam: handle)|
|

		.text
		.globl	_iudateps
_iudateps:
	moveq	#14,d2
	bra	gointl


|
|procedure iutimestr(datetime: longint| wantseconds: boolean| var result: str255)|
|

		.text
		.globl	_iutimest
_iutimest:
	moveq	#2,d2
	bra	gointl


|
|procedure iutimepstr(datetime: longint| wantseconds: boolean| var result: str255|
|	intlparam: handle)|
|

		.text
		.globl	_iutimeps
_iutimeps:
	moveq	#16,d2
	bra	gointl


|
|function iumetric: boolean|
|

		.text
		.globl	_iumetric
_iumetric:
	moveq	#4,d2
	bra	gointl


|
|function iumagstring(aptr,bptr: ptr| alen,blen: integer): integer|
|

		.text
		.globl	_iumagstr
_iumagstr:
	movw	#10,d2	|the routine selector
	bra	gomag

|
|function iumagidstr(aptr,bptr: ptr| alen,blen: integer):integer|
|

		.text
		.globl	_iumagids
_iumagids:
	movw	#12,d2	|the routine selector
gomag:	movl	sp@+,a0	|get user's rts
	movw	d2,sp@-	|the routine selector
	movl	a0,sp@-	|push the rts back on
	.word	/aded	|__pack6 w/autopop
	|never gets here

|
|function iucompstring(astr,bstr: str255): integer|
|
		.text
		.globl	_iucompst
_iucompst:
	movw	#10,d2	|the routine selector
	bra	gopmag

|
|function iuequalstring(astr,bstr: str255): integer|
|
		.text
		.globl	_iuequals
_iuequals:
	movw	#12,d2	|the routine selector

gopmag:	|first readjust the stack so that it follows jerome's
	|string passing convention and not pascals
	|jerome expectes

	movl	sp@(4),a1	|ptr to bstr
	movl	sp@(8),a0	|ptr to astr
	clrw	d0
	clrw	d1
	movb	a0@+,d0	|alen
	movb	a1@+,d1	|blen
	movl	a0,sp@(8)	|first arg is ptr to astr
	movl	a1,sp@(4)	|second arg is ptr to bstr
	movl	sp@+,a0	|the return addr
	movw	d0,sp@-	|third arg is alen
	movw	d1,sp@-	|fourth arg is blen
	movw	d2,sp@-	|the routine selector
	movl	a0,sp@-	|push the rts back on
	.word	/aded	|__pack6 w/autopop
	|never gets here


|
| procedure stringtonum(thestring: str255| var thenum: longint)|
|
|	convert a string into a number using jerome's routine
|
		.text
		.globl	_stringto
_stringto:
	movl	sp@(8),a0
	packcall	#1,__pack7	|ldec2bin
	movl	sp@(4),a0
	movl	d0,a0@
	bra	exit8


|
| procedure numtostring(thenum: longint| var thestring: str255)|
|
|	convert a number to a string using anonymous routine
|
		.text
		.globl	_numtostr
_numtostr:
	.globl	exit8

	movl	sp@(4),a0
	movl	sp@(8),d0
	packcall	#0,__pack7	|lbin2dec

exit8:	movl	sp@+,a0
	addqw	#8,sp
	jmp	a0@

0xa937,N,N) }
void	ClearMenuBar() { _mact1(RN,0xa934,N,N) }

Handle	GetMenuBar() { _mact1(RI,0xa93b,L,N) }
Handle	GetNewMBar(id) { _mact1(RI,0xa9c0,L,S) }
void	SetMenuBar(m) Handle m; { _mact1(RN,0xa93c,N,L) }

int	MenuSelect(p) Point *p; { _mact1(RI,0xa93d,L,SS) }
int	MenuKey(k) { _mact1(RI,0xa93e,L,S) }
void	HiliteMenu(id) { _mact1(RN,0xa938,N,S) }

void	SetItem(m,i,s) MenuHandle m; char *s; { _mact3(RN,0xa947,N,Lsumacc/lib/libmake.c   444      0     12       11515  3470501357   7646 /*	libmake.c	1.0	05/12/84	*/

/*
 * Assemble and archive mac library stubs.
 *
 * This combines the functions of "as" and "ar".  We first tried
 * doing this the "easy" way using as and ar;  it took about 40 minutes
 * real-time to assemble and archive 520+ stubs.  Not to mention the
 * hardships of a UNIX directory containing 1040+ files.
 *
 * Libmake is typically run as:
 * "cat libqd.sl libos.sl ... | sed -f libmac.sed | libmake OUTFILENAME"
 *
 * Standard input looks like:
 * SubName:
 * 	movl	#8,sp@-
 * 	movl	#-43504,sp@-
 *
 * As output, libmake generates an archive of b.out's such as:
 *	.globl	SubName,_mactrap
 * SubName:
 *	jbsr	_mactrap
 *	.long	8		| the arg flags
 *	.long	-43504		| the trap or stub address
 *
 * TODO:
 * Fix ld68 and ranlib(68?) so they can randomly load stuff, rather than
 * having to linearly scan the archive.
 */

/*
 * Copyright (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 05/12/84	Croft	Created.
 */

#include <stdio.h>
#include "b.out.h"
#include <ar.h>

struct ao {			/* archive output */
	struct ar_hdr ah;	/* ar.h header */
	struct bhdr bh;		/* b.out.h header */
	short	j;		/* jbsr _mactrap */
	short	h3;
	short	l3;
	short	h1;		/* arg flags */
	short	l1;
	short	h2;		/* trap or stub address */
	short	l2;
	short	unused;		/* hmm, loader seems to need long alignment */
	char	d[256];		/* symbol table and text reloc */
} ao;

int	btsize = 16;		/* 16 bytes in text seg */

struct sym bs;

struct breloc {			/* b.out reloc, like "reloc" but no bit fields*/
	short	rtype;
	short	rsymbol;
	long	rpos;
};

struct breloc brtrap = {
	RLONG<<2 | REXT, 0, 2	/* relocate _mactrap, sym 0, offset 2 */
};
struct breloc brext = {
	RLONG<<2 | REXT, 2, 10	/* relocate stubaddr, sym 2, offset 10 */
};

char	*foutname;
FILE	*fout;
char	*aop;
char	label[64];
char	aflags[32];
char	trap[32];

unsigned long htonl();
unsigned short htons();


main(argc,argv)
	char **argv;
{
	register char *cp;

	foutname = argv[1];
	unlink(foutname);
	if ((fout = fopen(foutname, "w")) <= 0)
		abort("can't open output file");
	fprintf(fout, ARMAG);
	sets(ao.ah.ar_date, sizeof ao.ah.ar_date, "d", time(0));
	sets(ao.ah.ar_uid, sizeof ao.ah.ar_uid, "d", getuid());
	sets(ao.ah.ar_gid, sizeof ao.ah.ar_gid, "d", getgid());
	sets(ao.ah.ar_mode, sizeof ao.ah.ar_mode, "o", 0664);
	sets(ao.ah.ar_fmag, sizeof ao.ah.ar_fmag, "s", ARFMAG);
	
	ao.bh.fmagic = FMAGIC;
	ao.bh.tsize = btsize;

	ao.j = htons(0x4eb9);	/* jbsr */

	/*
	 * for each file
	 */
	for (;;) {	
		if (scanf("%[^:]:\n\tmovl\t#%[^,],sp@-\n\tmovl\t#%[^,],sp@-\n",
		    label, aflags, trap) != 3) {
			if (!feof(stdin)) {
				printf("\t%s/%s/%s\n", label, aflags, trap);
				abort("bad input conversion");
			}
			fclose(fout);
			exit(0);
		}
		makebout();
	}
}


/*
 * Make a single b.out+archive header.
 */
makebout()
{
	int s;

	aop = ao.d;
	makesym(EXTERN|UNDEF, "_mactrap");
	makesym(EXTERN|TEXT, label);
	*((long *)&ao.h1) = htonl(atoi(aflags));
	if (trap[0] == '-') {	/* if trap number */
		*((long *)&ao.h2) = htonl(atoi(trap));
		ao.bh.ssize = aop - ao.d;
		ao.bh.rtsize = sizeof brtrap;
		aoappend((char *)&brtrap, sizeof brtrap);
	} else {		/* symbol stub */
		*((long *)&ao.h2) = 0;
		makesym(EXTERN|UNDEF, trap);
		ao.bh.ssize = aop - ao.d;
		ao.bh.rtsize = (sizeof brtrap + sizeof brext);
		aoappend((char *)&brtrap, sizeof brtrap);
		aoappend((char *)&brext, sizeof brext);
	}
	sets(ao.ah.ar_name, sizeof ao.ah.ar_name, "s", label);
	s = sizeof ao.bh + ao.bh.tsize + ao.bh.ssize + ao.bh.rtsize;
	sets(ao.ah.ar_size, sizeof ao.ah.ar_size, "d", s);
	fwrite((char *)&ao, s + sizeof ao.ah, 1, fout);
	if (s&1)
		putc('\n',fout);
}


/*
 * Set string in archive header.
 */
sets(cp,l,f,v)
	char *cp,*f,*v;
{
	char lin[64];
	char form[16];

	sprintf(form, "%%-%d%s", l, f);
	sprintf(lin, form, v);
	strncpy(cp, lin, l);
}


/*
 * Make a symbol table entry.
 */
makesym(f,s)
	char *s;
{
	bs.stype = f;
	bs.slength = strlen(s);
	aoappend((char *)&bs, sizeof bs);
	aoappend(s, strlen(s)+1);
}


/*
 * Append to ao.
 */
aoappend(cp,n)
	char *cp;
{
	bcopy(cp, aop, n);
	aop += n;
}


/*
 * Abort with message.
 */
abort(s,a,b)
	char *s;
{
	fprintf(stderr, "libmake: ");
	fprintf(stderr, s, a, b);
	fprintf(stderr, "\n");
	exit(1);
}


/*
 * Copy bytes.
 */
bcopy(a, b, n)
	register n;
	register char *a, *b;
{
	if (n <= 0)
		return;
	do { *b++ = *a++; } while (--n);
}


#define nohtonl 
#ifdef nohtonl	/* if not in library */
/*
 * "Host" to "net" byte order swappers.
 */
unsigned short htons(a)
	unsigned short a;
{
	unsigned short result;
	register char *sp = (char *)&a;
	register char *dp = (char *)&result;

	dp[1] = *sp++;
	dp[0] = *sp;
	return (result);
}


unsigned long htonl(a)
	unsigned long a;
{
	unsigned long result;
	register char *sp = (char *)&a;
	register char *dp = (char *)&result;

	dp[3] = *sp++;
	dp[2] = *sp++;
	dp[1] = *sp++;
	dp[0] = *sp;
	return (result);
}
#endif
rchive.
 */

/*
 * Copyright (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 05/12/84	Croft	Created.
 */

#include <ssumacc/lib/libmake   755      0     12       34000  3472535107   7426 $(Ð=Ð^ZÁZPÐPYÐYXÕ‰úÑYhÂYÐYïÞ#ÝïØ#ÝXÝjûïÝPûïÁýЬPРï¦(Ýï (ûï1ßï×#Ýï(ûï‚ÐPïƒ(
ßï½#ûï®ßïÇ#Ýïh(ûï1Ýûï4ÝPßï²#ÝßïÜ&ûïÛûïæÝPßï–#ÝßïÊ&ûï½ûï¸ÝPßïz#Ýßï²&ûïŸÝ´ßïa#Ýßï&ûï„ßïP#ßïH#Ýßï”&ûïi2ï†&Ðïì"ï&ݹNûïJ÷Pï‡&ßï
(ßïç'ßï¡'ßïþ"ûï¸ÑPJàïœ%,ßïá'ßï»'ßïu'ßïþ"ûïdßïü"ûï‰ÝïI'ûïüÝûïuûï‰Â^Þï&ï$'ßïÕ"Ý ûïéßï'Ý"ûïÚßïH'ûï©ÝPûï¢ÐPïË%‘ïK'->ßïB'ûïƒÝPûï|ÐPï©%Ãô'ï¸&ï%Ðï|%ÝßïÐ!CÔï‚%ßïþ&Ý ûïaÃô'ï‚&ïI%ÐïF%Ýßïš!ûïÝßï“!ûïpßïZ&ßï"ÝßïÄ$ûïÓÁ ïö$PÀïû$PÁïø$P­üÝ­üßïÞ!Ý
ßïÄ$ûï£Ýï&ÝÁ<­ü~ßïz$ûïÇè­ü1×ÿâ%&ÐïÚ%PРQÖ ö
aÐïÇ%PРQÖ šaPSÐï´%Pá 7Îÿ¨%PÐï¡%QÑP¡#ÐQPö
°˜°PÑP
½Ýï„%Ðï~%Pš°~	Ýïq%š
~ûï{ž®°^ݬݬßï!ß­°ûïÂݬß­°ß­Àûï²ݬß­ÀݬûïBö¬ï%ݬûïöPï%Ýßïù$ûïݬûïôÁP~ݬûïݬÝïÝ$ݬûïQÀ¬ïË$ßïŽ ßïð"ûïݬݬݬßïÚ"ûïkßïo ßïÇ"ûïXÝûï»ЬZЬYЬ[Š‰×[ùÂ^Á\[Þ­þZ‹ªkj<­þPÂ^Á\[Þ­üZ‹ª‹ª‹ªkjЭüPÂ^Ь[ЬZŬ¬YáªL‘k
‹ºÖª×YÕY×jΪPÑjPãÝZš‹~ûïùÖPßݬÁ¬YPÃP~ûïº
ÐP­üÃP¬PÕYßÑjY.ÕjÝjݪÝ[ûï+ÿÿÿÀj[ÀjªÂjYÝZš‹~ûï§ÖP®×YÑjYÄÝYݪÝ[ûïüþÿÿÀYªÂYjЬPïB¼/òï2¼òЬ[ÔZÔY‘k94Å
ZP˜‹QÀPQÃ0QZÖYÖ[Ö[˜kPÑP	öÑP ñÑP+èÑP-á‘k0ÇÕYÎZPÐZPßï!Á\~ݬûïáï!ÎPÔPÁ\~ݬßïÑ ûïRÁ\~ݬݬûï=Â^Ь[™A­üÐ[­ôÐ[­ðÔ­ìÖ­ì•‹ùЭì­øÁ\~ݬß­ìûïÂ^Ь[ЬZÔ­üÔ­ì1)ЬPРQÖ šaP1L˜‹YÑY%1/Ô­ðÑY*	ÐZ­ðÀZ˜‹YÔ­øЭèÅ
­øPÀYPÃ0P­ø˜‹YàIïçÕ­ø20u­øÑYlЭèԭ蘋YÑYhïÑY[Ý[ûïÐP[áIïÅÀ YЭèÕYÎPß­ìݬÝ­èÝ­øÝYÝ­ðûïÂÕPÕ­ðÖ­üÕ­ìVÕ­üЭüPÎP×¼ЬPРQÖ šaP
ݬûïíÐP­ôÑP ØÑP	ÓÑP
ÎÑPÿÿÿÿݬÝPûïq˜‹YÐYPÑPJÑP	©ÑP
¤ÑP ŸÑP%1Æþ×¼1­þݬûï‘ÐP­ôÑPYÃÑPÿÿÿÿ14ÿݬÝPûïЭüPž®¨^ѬcѬs
Ѭ[#ݬݬݬݬÕ¬мPÔPÝPûïÂÔ­¨Ô­¬Ô­¸Ñ¬e
ѬfЭ¸Ð
YѬoÐY
ѬxÐYÞ­À[Ô­¼Ô­´×¼ЬPРQÖ šaP
ݬûïºÐPZÑP ÙÑZ	ÔÑZ
ÏÑZ-.Ö­´öZ‹×¼ЬPРQÖ šaP
ݬûï~ÐPZ׬1ÕÑZ+ø׬×¼1´Ý¬ûï[1µÑZa	ÑZfÑZA1³ÑZFôÖ­¬ÑYx­¨­¨ÑY
x­¨PÀ­¨PÁPP­¨x­¨­¨ÐZ­°áJïkÂ0ZÑZaÑZf	ÂWZÂ7ZÀZ­¨Ð­°ZÑY
1§Õ­¸øÖ­¬öZ‹×¼1LÿЬPРQÖ šaPÐPZ׬~áJï1^ÿÑY1/ÿÑZ.¶ÑZe	ÑZESÕ­¼NÑY
IÕ­¸DÕ­¬?Ö­¼öZ‹×¼ЬPРQÖ šaP
ݬûï7ÐPZÑZ+1pÿÑZ-øÑZ0ÑZ9îÕ­´έ¨­¨ÑZÿÿÿÿݬÝZûïªÔ¼Ð¼Õ¬Þ­ÀPÑ[PÕ­´Þ­ÁPÑ[PÔP”‹x­¸PȬPÏPPZZ&&&&&&&&&&&&&**=ÐPß­ÀûïмRvPbéß­ÀûïøмRpPbÖмP÷­¨`ÌмPЭ¨`ÂÂ^Ь[ЬZÔ¼Ð[XѬcѬ0uЬÔ­üѬsЭü×jЪPÖªš`P	ÝZûï
ÐPYÖPÒ­üP˜IïcQÊPQÏЭüѬcÔ­üIѬ[?Эü9Ò­üP˜Iï/QÊPQ1Õ[öY‹×¬%×jЪPÖªš`P	ÝZûïœÐPYÑYÿÿÿÿ¾ÑYÿÿÿÿÕ¬ÝZÝYûï#ԼмÕ[1ŽþÑ[XøѬc1´þ”‹1¯þЬ[ÔY‘k^ÖYÖ[ÔZÕY
ŠJJïŽòZâškZÑZ]ÑZ-nÕY
ˆJïiŠJï_Ö[TÑZ-9‘k]3‘«þk-š«þPÁPZÐZPškQÑPQ0ÕY
ˆJï+ŠJï!ÖZÛÕY
ˆJïŠJïš‹ZÑZ]ÕZœ×[Ð[PÀÔSЬRÔUš‚T‘ Tø‘T‘T
î‘+T‘-TˆSš‚T|P‘T04‘T9/ÑQÌÌÌyPVyPPÀVPØWQÂ0TÀTPØQÖUáS×Uš‚TÇ‘T.ãSòÔV‘Te‘TE[š‚T‘T+‘T-ˆSš‚T‘T0‘T9ÑVÌÌÌêÞFfV>F¤ÐVßáSÎVVÀVUÑUœÿÿÿÐœÿÿÿUÑUdÐdU}PP1ÔRÕU#ÑQ™™™	yÿPPÖRîyPVÀVPØWQÖRõUß=;ÕQ
yPPÂRyPP×RáQöÐQVÔW{VQWÁPVØW{
VPVÀPPÑVÖP×RòUÖáQyÿPPÖRyPPœÿPPnPVnQPdïP`VPáSrPPÝRpP~ûï
Pp¬PïPRÀ¬RÑR
ðRP|Ppï<Pá¬rPPÐ"ï´Â^Ýß­øûïÕPÎPÕ¬Эø¼ЭøPïÒ¼tð@ЬVRЬSЬQ<ÿÿRÑVRÐVRÂRV:Ra
ÂRQ(RacÕVß'ÀPVÂPRÂRQ(Rac<ÿÿRÑVRÐVRÂRV,cRcÕVæЬPÂ^™B­üЬ­ð2ÿ­ìß­ìÁ\~ݬûïž×­ìЭðPÖ­ð”`6á­ü$έìPÑP­ø”½ð˜½ðPÑP
Ö­ðß­ìš½ð~ß­ìš~ûï0ЬPЬPЬRÑRÔQ{RPPRÑPRÔPÐPмPЬRÑRÔQ{RPPRÐP¼ÑPRÔPÔ¼ÐPÐP¼Ь[Ѭÿÿÿÿ³«
Õ«Õ«ÎPÑ««Ö«Ök׫ЫPö¬`ЬPïJ¼
òž®¸^Ь[᫨«è«ÎP³P«ôOÞ­»PEÕïÇûïòÐPï·Õï­Ýï©ûïÐPï—Õï‘À˜«PÀï…PÐP«Õ«Hà«­ß­¼˜«~ûïÕPÕ­ì2­üЭì­üÝ­üûïÀÐP«¨«¼¨«Эü«Ñ['*áïÇ
ßï°ûïåáïÆ
ßï¯ûïÐá«ÐPЫPÝPÝ«˜«~ûï:
ÐPkЫ«á«
Þ­»PÑ«PÔ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Æþš»PÖ«€Ь[ûïÐPZ‘«+ÐPÑPr3ÑPw:ÔPÔPÐPX˜kPÑPaÚÕXÐPÐPÉPW$ÕXÐPÔPÐPWÕXÐPÐPÉPWݶÝWݬûïQ	ÐPY›‘ka
ÝÝÝYûïY	ÔjöYªÔªÕX°ª‘kr÷ª÷ªÔªЪªÐZPžÎü^Ь[á«<ª«ÞÍü«Ы«2«Ý[Á\~ݬûï7Ý[ûïR
¨«Ô«Ô«ÔkÝ[Á\~ݬûïá«ÎPÔP	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÀ1±ÔTSЭüSá£Á££TÑ£TÑR
R³Ö£ÔcÖ­ð»Ý­üÝRûï™ÕPã­ðÖ­ðºžï­þÿÿS}½üTàT©ÀP­ðÔRÕPÕTšS•CïŒþÿÿÎR×QS…×TõPá}T½üÂP­ðàRôPšR•Bïaþÿÿ1eÿÖP×QÐRã­ðЭðPžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0eÿÐQ[áRÜ•‹¾Ð^U|Y|Vš‹PP Xœ²²¦²²²²²²ì¬²²á²¸ÃÃÃÃÃÃÃÃò²²²²²²²²²Ÿ½²½²²²²²²²²²²²²s²²½²²²²²²²²²²Ÿäøÿ²²²øÿ²²²²²Ê²s²²P…1ðþ1ÙÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1!0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®áZzÕ¬üuÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0"ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0¼üëR…Ö­ð}T½üÜÐYP1hý1cý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÃüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1RýÈ Z1LýÈZ1FýÈZ1@ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïï¼òïö¼òïæ¼òЬQ:ÿÿaøìQPž®¸^Ь[᫨«ª«à«wÎPÔYÐYXš¬Pá« ¬­ÿÐXÝXß­ÿ˜«~ûïyÐPYÔk1íЫZ1·ß­¸˜«~ûï>ÕPÕ­è2­øЭè­øÝ­øûïnÐPZÐZ«J¨«á«’ЫZ¬»Ö«Á«ZPÑ«P	‘¬
1hÿÃZ«PÐPXÝPÝZ˜«~ûïñÐPYÐZ«1qÿ¨«Эø«Ñ[('˜ï1
~ûïÇÕPâ«ÐZ«‹ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûï”ÐPYëk¬ŠÐZ«ÑXY1áþ¨ «1ÑþЬ[2«PÊùÿÿÿPÑP@ЫZ:ÃZ«Y3ÐZ«³„«ÔPЫPÐPkÝYÝZ˜«~ûï+ÑPY¨ «ÎPÔPЬ[ÎZ³«2à«-Ý[ûï‡ÿÿÿÐPZ˜«~ûï5ÕPÎZá«
Ý«ûï=ÔkÔ«Ô«Ô«´«”«ÐZPï¼òÕïtûï“ÐPïdÕïVPÝÝïTûïýÐPï>ÕPÔPxï8PÁï)Pï'Ðï[ÞïŽZÐZ‹ÀZÑZïºñÐïþ
[ÕkÐkP³ À[Ñ[ïè
å¦ÕkÝÝûï‰ÐPkÐkPЬ[Õï»
"Þï+YÑYï_;³©ÝYûkÀYåÐï‘
ZÕjÐjP³ ÝjûkÀZÑZït
àßï†þÿÿûï“ÿÿÿûïçÿÿÿݬûï™Ь[ЬZÄ[ZÝZûï¢ÐPYÝZÝYûïÐYPݬûï´ЬS
ÂP¬,cPc<ÿÿPѬPë,c¬cï&¼>òï¼YðÂ^ß­úÝt@ݬûïÕPÔPÐPïÞ¼6òÕï
_ûïwÐPXÐXïù	ÝûïpÐP[ÃXPÃXQÒQQËQ[QÃQPXÝXûïOÖPÔPÔZÐYxYYÖZÑïµ	YñÐZï¯	Ãï¤	PÐPXѬP
ÐYÔZÎXÐïŠ	YÐï‡	ZxYYÖZÁXYPѬPðÐJïñ[ÝZûïÐJïÞ[ˆÐkJïÓïköZ«Á[PÁ¬PxPZÑZï,	
Ðï$	YÇZYXÁï	ZYÐXÝYûï‰ÐP[Ñ[ÿÿÿÿЬPÐ[@ïxÁZ[kÀZ[õXöլìZšjPÑP[ÐKïEjÐZKï<Â^Ô­ôÕ¬ݬûï‡þÿÿì­üš½üPÑPï
Ö­ôЭüPš ZÝÝ­üûï¦ÐPZÁZPxP[Ñ[ï\Â[ÃïNPÀP[Õ­ô@ÕZ!ÁZPxPZÑZï2ÂZÃï$PÀPZѬ[ѬZЬPݬûï#ÿÿÿݬûïçýÿÿÐP­øÔPѬ­øѬ[ЬPÐ[PÝPÝ­øݬûï3âÿÿЭøPÔZÔYÐJïC[ÑY¬Ñ[¬ÐZPÖYÐk[Õ[çÖZÑZÔÎPïN¼@ðÁïܬ~ÝÐ\SÐ^\¼ÐïÇPÀ£ï¾ïï
¼òÐPï©ÎP¼$@(#)crt0.c	4.6 (Berkeley) 3/30/83
wcan't open output file!<arch>
dddos`
%[^:]:
	movl	#%[^,],sp@-
	movl	#%[^,],sp@-
	%s/%s/%s
bad input conversion_mactrapsd%%-%d%slibmake: 
@(#)doscan.c	4.3	(Berkeley)	85/02/13ÿÿÿÿÿÿÿ                           AAAAAABBBBBB P'@(#)malloc.c	4.6 (Berkeley) 11/28/84(*(*â’LÜñ˜'L¨0„¸7q@~4HœQn
Xx `xàgQvQ€Í|Šfð‘òLšA£u ¬œü´ÅÔ½ÇÔÇL@ÐfÔ×ÂäÞœôæÅï$øy;(
@âTyŒ"{´*¢Ä:KØCŒüKŒ TñŒ"b× "iÁÐ"q•à"z—ì"‚r$‹‘~L— @.D©’$°	­ˆ'´¿0$¼	³ø(À¤4$ÈL<$Ï	¡)Ù	œ)ß	Ê)ä	*)ë	OP)ó	ìp)ùu˜tüØ>¤ÔÕàÙž$„°,L 4Ï ;²4B.'HP¾XhÔbÜkq¸qȺx  ‚[ÜŠf“F|œÍ¥$­ñ†´€ð¹à"À~@É:œÒxLÚ`âÇ&ëþ ôALün
x 		—)Qò$KÌ3« ;¢¼BMdJìP~(ZÂÜ`Åüg•Ø"n3Øv; }y>!ƒkT‹iÒ“–0âì"¤{Œ«û~²Œ ¹×”"ÆÁ "Ìà|'Ý7n!æ	Ì(*ë€'ò=„'ùcrt0.olibmake.ofwrite.ogetgid.ogetuid.oatoi.oprintf.oscanf.odoscan.oatof.oldexp.otime.ogettimeofday.ostrncpy.osprintf.oudiv.oungetc.ounlink.ofilbuf.ofopen.octype_.ofprintf.odoprnt.oopen.oread.olseek.ostrlen.oflsbuf.oclose.ofindiop.oexit.ocalloc.obzero.ofstat.ogetdtablesize.oisatty.oioctl.omalloc.ogetpagesize.osbrk.owrite.ocerror.o_exit.o_environstart_main_exit_moncontrolmcount_ao_btsize_bs_brtrap_brext_foutname_fout_aop_label_aflags_trap_unlink_fopen_abort_fprintf_time_sets_getuid_getgid_htons_scanf__iob_printf_fclose_makebout_makesym_atoi_htonl_aoappend_fwrite__flsbuf_sprintf_strncpy_strlen_bcopyudivcerror__doprnt__doscan_fscanf_sscanf__ctype___filbuf_ungetc_atof_ldexp_errno_gettimeofdayaudiv_getdtablesize_malloc_fstat_fflush_read__findiop_open_lseek_write_isatty_close_free_calloc__fwalk__cleanup__exit_bzero_cfree_ioctl_getpagesize_sbrk_realloc_srchlen_realloc_endminbrkcurbrksumacc/lib/trcmacs   555      0     12        1013  3470501357   7430 #!/bin/sh
#	tras - translate assembler source from Apple to local
#
#	tras mumble.s		# output left on tmumble.s
#
trap "rm -f /tmp/sed$$" 0 1 2 15
cat <<EOT >/tmp/sed$$
s/;/|/g
/ *\.macro */{
s///
s/ *|.*//
s/.*/_& = /
N
s/ *|.*//
N
s/ *|.*//
s/\n//g
s/ *\.endm *//
s/__strcore/__core/
s/__mcore/__core/
/__core/{
s/ *__core *%1,\([0-9]*\)/ \/a000 + \1/
s/,regs/ + \/100/
s/,.*$//
}
}
\$a\\
_regs_ = /100\\
_async_ = /400\\
_sys_ = /400\\
_immed_ = /200\\
_clear_ = /200
EOT
tr "[A-Z]" "[a-z]" <$1 | sed -f /tmp/sed$$ >t$1
	tras - translate assembler source from Apple to local
#
#	tras mumble.s		# output left on tmumble.s
#
trap "rm -f /tmp/sed$$" 0 1 2 15
cat <<EOT >/tmp/sed$$
s/;/|/g
/ *\.macro */{
s///
s/ *|.*//
s/.*/_& = /
N
s/ *|.*//
N
s/ *|.*//
s/\n//g
s/ *\.endm *//
s/__strcore/__core/
s/__mcore/__core/
/__core/{
s/ *__core *%1,\([0-9]*\)/ \/a000 + \1/
s/,regs/ + \/100/
s/,.*$//
}
}
\$a\\
_regs_ = /100\\
_async_ = /400\\
_sys_ = /400\\
_immed_ = /200\\
_clear_ = /200
EOT
tr "[A-Z]" "[a-z]" <$1 | sed -f /tmp/sumacc/lib/mem.s   444      0     12       47452  3470501360   7043 		.insrt	"../h/sysequ.h"
		.insrt	"../h/toolmacs.h"
		.insrt	"../h/heapdefs.h"

|----------------------------------------------------------------------
|
| procedure setapplbase|
|
| initialize the application zone while growing the system zone.
|
| arguments:
|	a0 - ptr to new application zone base.
|
| registers:
|	d0 - result code from setapplbase (always 0)
|
		.text
		.globl	_setapplb
_setapplb:
|
	movl	sp@+,a1	|return address
	movl	sp@+,a0	|startptr
	.word	__setappllimit	|ask os to do request
	bra	_savereta1	|save 0 result code and return via a1


|----------------------------------------------------------------------
|
| procedure initapplzone|
|
| initialize the application zone
|
| arguments:
|	none
|
| registers:
|	d0 - result code from initapplzone
|
		.text
		.globl	_initappl
_initappl:
|
	.word	__initapplzone	|ask os to do request
	bra	_save


|----------------------------------------------------------------------
|
| procedure initzone(growproc:	procptr|
|	moremasters:	integer|
|	limitptr,startptr : ptr)|
| creates and initializes a fresh zone from unstructured storage
|
| arguments:
|	growproc:	points to grow procedure for this zone
|	moremasters:	number of master pointers to create at a time
|	limitptr:	points one past last byte of raw storage
|	startptr:	points to first byte of raw storage
|
| registers:
|	d0 - result code from initapplzone
|
		.text
		.globl	_initzone
_initzone:
|
	movl	sp@+,a1	|return address
	movl	sp,a0	|stack parameters form req blk
	.word	__initzone
	addw	#14,sp	|strip parameters
	bra	_savereta1	|save 0 result code and return via a1



|----------------------------------------------------------------------
|
| function getzone: thz|
|
| returns value of thezone
|
| arguments:
|	none
|
| result:
|	current value of thezone pointer
|
| registers:
|	a1 -	holds return address
|
		.text
		.globl	_getzone
_getzone:

	.word	__getzone	|ask os to do request
	movl	a0,sp@(4)	|_save result
	bra	_save	|set error code and return


|----------------------------------------------------------------------
|
| procedure setzone(hz: thz)|
|
| sets thezone to hz
|
| arguments:
|	hz:	holds new value for thezone
|
| registers:
|	a2 -	holds return address
|
		.text
		.globl	_setzone
_setzone:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|zone pointer
	.word	__setzone	|ask os to do request
	bra	_savereta1	|save 0 result code and return via a1



|----------------------------------------------------------------------
|
| function appliczone: thz|
|
| returns value of applzone
|
| arguments:
|	none
|
| result:
|	current value of applzone pointer
|
| registers:
|	a1 -	holds return address
|
		.text
		.globl	_appliczo
_appliczo:

	movl	applzone,sp@(4)
	bra	_save0	|set error code 0 and return



|----------------------------------------------------------------------
|
| function systemzone: thz|
|
| returns value of syszone
|
| arguments:
|	none
|
| result:
|	current value of syszone pointer
|
| registers:
|	a1 -	holds return address
|
		.text
		.globl	_systemzo
_systemzo:

	movl	syszone,sp@(4)
	bra	_save0	|set error code and return


|----------------------------------------------------------------------
|
| function compactmem(cbneeded: size): size|
|
| compact the heap until a free block with cbneeded bytes is found or
| until the end of the zone is reached.	returns cbfound, the size of
| the largest block found.
|
| arguments:
|	cbneeded:	size of block needed
|
| result:
|	size of largest block found, in bytes
|
| registers:
|	d0 - number of bytes needed/number of bytes in biggest block
|
		.text
		.globl	_compactm
_compactm:

	movl	sp@+,a1	|get return address
	movl	sp@+,d0	|get cbneeded
	.word	__compactmem	|tell os to do it
	movl	d0,sp@	|_save result
	bra	_save0reta1	|set 0 result code and return via a1


|----------------------------------------------------------------------
|
| procedures _save, save0, save0reta1, savereta1|
|
| _saves d0 into errorcode. alternately sets d0 to 0 first. alternately returns
| via a1.	a1 is destroyed in any case . . .
|
| arguments:
|	d0:	error code to be _saved in errorcode
|
| result:
|	none
|
| registers:
|	a1 - points to errorcode
|
	.globl	errorcode


errorcode:
	.word	0


_save0reta1:
	moveq	#0,d0	|this entry zeroes result, returns via a1

_savereta1:
	movl	a1,sp@-	|a1 has return address

_save:
	movw	d0,errorcode	|_save error

	rts	|return

_save0:
	moveq	#0,d0	|this entry zeroes the result
	bra	_save



|----------------------------------------------------------------------
|
| procedure purgemem(cbneeded: size)|
|
| purge purgeable blocks in the heap until a free block of cbneeded bytes
| is found, or until the end of the zone is reached.
|
| arguments:
|	cbneeded:	size of block needed
|
| result:
|
| registers:
|	a1 - return address
|	d0 - number of bytes needed/error code
|
		.text
		.globl	_purgemem
_purgemem:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,d0	|get cbneeded
	.word	__purgemem	|tell os to do it
	bra	_savereta1	|save result code and return via a1


|----------------------------------------------------------------------
|
| function freemem: longint|
|
| returns number of free bytes in the current zone
|
| arguments:
|	none
|
| result:
|	number of free bytes in the current zone
|
| registers:
|	d0 -	holds result value
|
		.text
		.globl	_freemem
_freemem:

	.word	__freemem	|ask os to do request
	movl	d0,sp@(4)	|_save result
	bra	_save0	|set 0 error code and return



|----------------------------------------------------------------------
|
| procedure resrvmem(cbneeded: size)|
|
| purge purgeable blocks in the heap until a free block of cbneeded bytes
| is found, or until the end of the zone is reached.
|
| arguments:
|	cbneeded:	size of block needed
|
| result:
|
| registers:
|	a1 - return address
|	d0 - number of bytes needed/error code
|
		.text
		.globl	_resrvmem
_resrvmem:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,d0	|get cbneeded
	.word	__resrvmem	|tell os to do it
	bra	_savereta1	|save result code and return via a1




|----------------------------------------------------------------------
|
| function maxmem(var grow: size): size|
|
| return the size of the maximum block which may be allocated without
| growing the zone.	also return the maximum number of bytes by which the
| zone may be grown.
|
| arguments:
|	none
|
| result:
|	size of largest available block in bytes
|	grow:	maximum growth allowed in current zone
|
| registers:
|	a0 - grow/pointer to var grow
|	a1 - return address
|	d0 - number of bytes in largest free block
|
		.text
		.globl	_maxmem
_maxmem:


	movl	sp@+,a1	|get return address
	.word	__maxmem	|let os do it
	movl	a0,d1	|max growth allowed
	movl	sp@+,a0	|get the pointer to var grow
	movl	d1,a0@
	movl	d0,sp@	|_save result
	bra	_save0reta1	|set 0 result code and return via a1



|----------------------------------------------------------------------
|
| function topmem: ptr|
|
| returns the address of the byte after the last byte of real memory.
|
| arguments:
|	none
|
| result:
|	ptr:	address of byte just following last byte of
|	real memory
|
| registers:
|	d0 - result code
|
		.text
		.globl	_topmem
_topmem:

	movl	memtop,sp@(4)	|set function result
	bra	_save0	|set result and return



|----------------------------------------------------------------------
|
| procedure setgrowzone(growzone: procptr)|
|
| sets the current heap zone's growzone procedure to growzone
|
| arguments:
|	growzone:	new value for this zone's growzone proc
|
| registers:
|	a1 -	holds return address
|
		.text
		.globl	_setgrowz
_setgrowz:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|procedure pointer
	.word	__setgrowzone	|ask os to do request
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| procedure setappllimit(zonelimit: ptr)|
|
| sets the application zone's limit to zonelimit
|
| arguments:
|	zonelimit:	new value for application zone limit
|
| registers:
|	a2 -	holds return address
|
		.text
		.globl	_setappll
_setappll:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|zone pointer
	.word	__setappllimit	|ask os to do request
	bra	_savereta1	|save 0 result code and return via a1


|procedure maxapplzone;
|
|grows the application zone to as large as allowable (by appllimit)

		.text
		.globl	_maxapplz
_maxapplz:

	movl	appllimit,a0
	lea	heapend,a1
	movl	a0,d0
	subl	a1@,d0	|bytes to grow
	moveq	#minfree,d2
	cmpl	d2,d0
	bcss	1$	|br if no room to grow

	movl	a1@,a1	|point to current limit blk
	movl	a0,heapend	|set heapend=appllimit
	movl	d0,a1@	|inc size of current limit blk
	clrb	a1@	|just to be sure

	movl	applzone,a1	|adjust heap zone header
	movl	a0,a1@	|new limit block (bklim)
	movl	d2,a0@	|limit block size is always min
	addl	d0,a1@(zcbfree)	|increase free count

1$:	rts

|----------------------------------------------------------------------
|
| function newptr(bytecount: size): ptr|
|
| returns a pointer to a newly allocated non-relocatable block of
| memory bytecount bytes long.
|
| arguments:
|	bytecount:	number of bytes needed
|
| result:
|	pointer to new block, or nil, if not enough room
|
| registers:
|	a0 - points to new block, or nil
|	a1 - return address
|	d0 - number of bytes needed/error code
|
		.text
		.globl	_newptr
_newptr:

	movl	sp@+,a1	|get return address
	movl	sp@+,d0	|get the byte count
	.word	__newptr	|ask os to do request
	movl	a0,sp@	|return result ptr on stack
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| procedure disposptr(p: ptr)|
|
| releases the block pointed to by p.
|
| arguments:
|	p:	pointer to block to be freed
|
| result:
|	none
|
| registers:
|	a0 - points to block to be freed
|	a1 - return address
|	d0 - error code
|
		.text
		.globl	_dispospt
_dispospt:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get parameter
	.word	__disposptr	|let os do work
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| function getptrsize(p: ptr): size|
|
| returns number of bytes in the non-relocatable block pointed to by p.
|
| arguments:
|	p:	points to non-relocatable block
|
| result:
|	number of bytes in block
|
| registers:
|	a0 -	points to block
|	a1 -	holds return address
|	d0 -	number of bytes in block
|
		.text
		.globl	_getptrsi
_getptrsi:

	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get the pointer
	.word	__getptrsize	|let os do it
	movl	d0,sp@	|return result on stack
	bpl	.L1	|true sizes are positive
	clrl	sp@	|return 0 on errors
	bra	_savereta1	|and set error code

.L1:	bra	_save0reta1	|set 0 result code and return via a1


|----------------------------------------------------------------------
|
| procedure setptrsize(p: ptr| newsize: size)|
|
| sets the size of the non-relocatable block pointed to by p to newsize
| bytes.
|
| arguments:
|	p:	points to non-relocatable block
|	newsize:	number of bytes needed in block
|
| result:
|	none
|
| registers:
|	a0 -	points to block
|	a1 -	holds return address
|	d0 -	number of bytes needed/error code
|
		.text
		.globl	_setptrsi
_setptrsi:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,d0	|get the new size
	movl	sp@+,a0	|get the pointer
	.word	__setptrsize	|let os do it
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| function	ptrzone(p: ptr): thz|
|
| recovers the reference to the heap zone object, given a pointer to
| a block.
|
| arguments:
|	p:	points to non-relocatable block
|
| result:
|	pointer to the zone object for the zone
|	containing the referenced block.
|
| registers:
|	a0 -	points to block/points to block's zone object
|	a1 -	holds return address
|	d0 -	error code
|
		.text
		.globl	_ptrzone
_ptrzone:

	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get the pointer
	.word	__ptrzone	|let os do it
	movl	a0,sp@	|_save zone object pointer
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| function	newhandle(bytecount: size): handle|
|
| returns a handle to a newly allocated relocatable block
| bytecount bytes long.
|
| arguments:
|	bytecount:	number of bytes needed
|
| result:
|	handle to new block, or nil, if not enough room
|
| registers:
|	a0 - handle for new block, or nil
|	a1 - return address
|	d0 - number of bytes needed/error code
|
		.text
		.globl	_newhandl
_newhandl:

	movl	sp@+,a1	|get return address
	movl	sp@+,d0	|get the byte count
	.word	__newhandle	|ask os to do request
	movl	a0,sp@	|return result handle on stack
	bra	_savereta1	|save result code and return via a1


|----------------------------------------------------------------------
|
| procedure disposhandle(h: handle)|
|
| releases the block referenced by h.
|
| arguments:
|	h:	handle for the block to be freed
|
| result:
|	none
|
| registers:
|	a0 - handle for block to be freed
|	a1 - return address
|	d0 - error code
|
		.text
		.globl	_disposha
_disposha:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get handle
	.word	__disposhandle	|let os do work
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| function	gethandlesize(h: handle): size|
|
| returns number of bytes in the relocatable block referenced by h.
|
| arguments:
|	h:	handle for relocatable block
|
| result:
|	number of bytes in block
|
| registers:
|	a0 -	points to block
|	a1 -	holds return address
|	d0 -	number of bytes in block
|
		.text
		.globl	_gethandl
_gethandl:

	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get the handle
	.word	__gethandlesize	|let os do it
	movl	d0,sp@	|return result on stack
	bpl	.L2	|real sizes are positive
	clrl	sp@	|on errors, return 0
	bra	_savereta1	|and set error code correctly

.L2:	bra	_save0reta1	|if result is a size, set 0 result code


|----------------------------------------------------------------------
|
| procedure sethandlesize(h: handle| newsize: size)|
|
| sets the size of the relocatable block referred to by h to newsize
| bytes.
|
| arguments:
|	h:	refers to relocatable block
|	newsize:	number of bytes needed in block
|
| result:
|	none
|
| registers:
|	a0 -	points to block
|	a1 -	holds return address
|	d0 -	number of bytes needed/error code
|
		.text
		.globl	_sethandl
_sethandl:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,d0	|get the new size
	movl	sp@+,a0	|get the handle
	.word	__sethandlesize	|let os do it
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| function	handlezone(h: handle): thz|
|
| recovers the reference to the heap zone object, given a handle for
| a block.
|
| arguments:
|	h:	refers to relocatable block
|
| result:
|	pointer to the zone object for the zone
|	containing the referenced block.
|
| registers:
|	a0 -	handle for block/points to block's zone object
|	a1 -	holds return address
|	d0 -	error code
|
		.text
		.globl	_handlezo
_handlezo:

	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get the handle
	.word	__handlezone	|let os do it
	movl	a0,sp@	|_save zone object pointer
	bra	_savereta1	|save result code and return via a1


|----------------------------------------------------------------------
|
| function	recoverhandle(p: ptr): handle|
|
| recovers the handle for a relocatable block, given a pointer to the
| relocatable block.	thezone must be set to reflect the zone containing
| this relocatable block.
|
| arguments:
|	rp:	points to relocatable block
|
| result:
|	handle for the referenced block.
|
| registers:
|	a0 -	pointer to relocatable block/handle for block
|	a1 -	holds return address
|	d0 -	error code
|
		.text
		.globl	_recoverh
_recoverh:

	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get the reloc block pointer
	.word	__recoverhandle	|let os do it
	movl	a0,sp@	|_save handle for block
	bra	_save0reta1	|save result code and return via a1
	|(os fails to set d0 for this call so
	| we unconditionally set result to 0)


|----------------------------------------------------------------------
|
| procedure emptyhandle(h: handle)|
|
| explicitly purges the relocatable block referred to by h.
|
| arguments:
|	h:	refers to relocatable block
|
| result:
|	none
|
| registers:
|	a0 -	handle for block
|	a1 -	holds return address
|	d0 -	error code
|
		.text
		.globl	_emptyhan
_emptyhan:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,a0	|get the handle
	.word	__emptyhandle	|let os do it
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| procedure reallochandle(h: handle| bytecount: size)|
|
| allocates a relocatable block, using an existing handle.
| if the handle is not already empty, the handle is emptied first,
| then allocated.
|
| arguments:
|	h:	refers to relocatable block
|	bytecount:	number of bytes needed in the new block
|
| result:
|	none
|
| registers:
|	a0 -	handle for block/points to block's zone object
|	a1 -	holds return address
|	d0 -	new block size/error code
|
		.text
		.globl	_realloch
_realloch:
|
	movl	sp@+,a1	|get return address
	movl	sp@+,d0	|get the new size
	movl	sp@+,a0	|get the handle
	.word	__reallochandle	|let os do it
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| procedure hlock(h: handle)|
| procedure hunlock(h: handle)|
| procedure hpurge(h: handle)|
| procedure hnopurge(h: handle)|
|
| these procedure are used to change the lock and purge attributes of
| the relocatable block referred to by h.
|
| arguments:
|	h:	handle for relocatable block
|
| registers:
|	a0 -	handle for relocatable block
|	a1 -	holds return address
|
		.text
		.globl	_hlock
_hlock:
|
	movl	sp@+,a1	|return address
	movl	sp@+,a0	|handle for block
	.word	__hlock	|let os to do it.
	bra	_savereta1	|save result code and return via a1

		.text
		.globl	_hunlock
_hunlock:
|
	movl	sp@+,a1	|return address
	movl	sp@+,a0	|handle for block
	.word	__hunlock	|let os to do it.
	bra	_savereta1	|save result code and return via a1

		.text
		.globl	_hpurge
_hpurge:
|
	movl	sp@+,a1	|return address
	movl	sp@+,a0	|handle for block
	.word	__hpurge	|let os to do it.
	bra	_savereta1	|save result code and return via a1

		.text
		.globl	_hnopurge
_hnopurge:
|
	movl	sp@+,a1	|return address
	movl	sp@+,a0	|handle for block
	.word	__hnopurge	|let os to do it.
	bra	_savereta1	|save result code and return via a1


|
|procedure moremasters|
|

		.text
		.globl	_moremast
_moremast:

	.word	__moremasters
	bra	_save


|----------------------------------------------------------------------
|
| procedure blockmove(srcptr, destptr: ptr| bytecount: size)|
|
| marks the relocatable block referred to by h as not purgeable.
|
| arguments:
|	srcptr:	source pointer
|	destptr:	destination pointer
|	bytecount:	bytecount for move
|
| registers:
|	a0 -	source pointer
|	a1 -	destination pointer
|	d0 -	bytecount for move
|	d1 -	holds return address
|
		.text
		.globl	_blockmov
_blockmov:
|
	movl	sp@+,d1	|return address
	movl	sp@+,d0	|byte count
	movl	sp@+,a1	|destination ptr
	movl	sp@+,a0	|source ptr
	.word	__blockmove	|let os to do it.
	movl	d1,a1	|return address
	bra	_savereta1	|save result code and return via a1



|----------------------------------------------------------------------
|
| function memerror: oserr|
|
| returns the error observed by the most recent memory manager call.
|
| arguments:
|	none
|
| registers:
|
		.text
		.globl	_memerror
_memerror:
	.globl	errorcode

	movw	errorcode,sp@(4) |last error
	rts


|----------------------------------------------------------------------
|
| function	gzcritical: boolean|
| function	gz_savehnd: handle|
|
| these routines are provided to help pascal growzone functions make
| decisions.
|
| arguments:
|	none
|
| registers:
|
		.text
		.globl	_gz_saveh
_gz_saveh:

	movl	gzroothnd,sp@(4) |handle which should not be touched
	rts

		.text
		.globl	_gzcritic
_gzcritic:
	movl	sp@+,a1	|return address
	clrw	sp@	|assume non-critical
	movl	gzmovehnd,d0
	beq	critcase
	cmpl	gzroothnd,d0
	bne	noncrit
critcase:
	movw	#/0100,sp@	|return true

noncrit:	jmp	a1@

--
|
| procedure emptyhandle(h: handle)|
|
| explicitly purges the relocatable block referred to by h.
|
| arguments:
|	h:	refers to relocatable block
|
| result:
|	none
|
| registers:
|	a0 -	handle for block
|	a1 sumacc/lib/misc.s   444      0     12       13006  3470501360   7204 	.insrt	"../h/sysequ.h"
	.insrt	"../h/toolmacs.h"

|
| from macmisc.text
|	miscellanous macintosh interface routines
|	this version for traps based system
|	it also includes stortraps
|
|
|	written by andy hertzfeld	16-oct-82
|
|	modification history
|
|	25-jan-83	ajh	modified for new file/io system
|	12-jun-83	ajh	added opendeskacc
|
|------------------------------------------------

|
|function gettrapaddress(trapnum: integer): longint;
|

		.text
		.globl	_gettrapa
_gettrapa:

	movl	sp@+,a1	|return address
	movw	sp@+,d0	|trap word
	movl	a1,sp@-	|restore return address
	.word	__gettrapaddress
	movl	a0,sp@(4)	|return corresponding address
	rts
|
|procedure settrapaddress(trapaddr: longint; trapnum: integer);
|
		.text
		.globl	_settrapa
_settrapa:

	movl	sp@+,a1	|return address
	movw	sp@+,d0	|trap number
	movl	sp@+,a0	|address
	movl	a1,sp@-	|restore return address
	.word	__settrapaddress
	rts

|
|function writeparam: oserr;
|

		.text
		.globl	_writepar
_writepar:
	lea	sysparam,a0	|pointer to buffer to write to c chip
	moveq	#-1,d0	|write out all 20 bytes
	.word	__writeparam
	movw	d0,sp@(4)	|return error
	rts

|
|function readdatetime(var time: longint):oserr;
|

		.text
		.globl	_readdate
_readdate:

	movl	sp@+,a1	|get the return address
	movl	sp@+,a0	|get the parameter
	movl	a1,sp@-	|restore return address

	.word	__readdatetime
	movw	d0,sp@(4)	|return error

	rts

|
|procedure getdatetime(var secs: longint);
|
|justs returns the value of the global variable time

		.text
		.globl	_getdatet
_getdatet:

	movl	sp@+,a1	|get the return address
	movl	sp@+,a0	|get the parameter
	movl	time,a0@
	jmp	a1@

|
| function setdatetime(time: longint):oserr;
|
|	sets the hardware calendar/clock to the specified date/time.
|
		.text
		.globl	_setdatet
_setdatet:

	movl	sp@+,a0	|get the return address
	movl	sp@+,d0	|get the parameter
	movl	a0,sp@-	|restore return address

	.word	__setdatetime
	movw	d0,sp@(4)	|return error

	rts

|
|procedure settime(d: datearray);
|
|converts a date (encoded as an array of integers) to the numver of seconds
|elapsed since 00:00am, 1 jan 1904, andw stores in clock chip.

		.text
		.globl	_settime
_settime:

	movl sp@(4),a0	|date
	.word	__date2secs	|d0 = seconds since 1904
	.word	__setdatetime	|clock = seconds since 1904
	|moveml sp@+,a0-a1	|a0=ret, a1=date
	moveml sp@+,#0x0300	|a0=ret, a1=date
	jmp	a0@	|return

|
|procedure gettime(var d: datetimerec);
|
| reads the time from the clock as the number of seconds elapsed since 00:00am,
|1 jan 1904, andw returns the date encoded as an array of integers.

		.text
		.globl	_gettime
_gettime:
	moveq #0,d0
	movl sp@(4),a0	|ptr to date time rec
|	.word	__readdatetime
|	movl a0@,d0
	movl	time,d0	|get time from low memory
	.word	__secs2date
	movl a7@+,a7@
	rts

|
|procedure date2secs(d: datearray; var s: longint);
|
|converts a date (encoded as an array of integers) to the number of seconds
|elapsed since 00:00am, 1 jan 1904

		.text
		.globl	_date2sec
_date2sec:

	movl sp@(8),a0	|a0=date
	.word	__date2secs	|d0=seconds elapsed
	moveml sp@+,#0x0302 |d1=ret, a0=intptr, a1=date
	|moveml sp@+,d1/a0-a1	|d1=ret, a0=intptr, a1=date
	movl	d0,a0@	|deliver result
	movl d1,a0	|ret addr
	jmp	a0@

|
|procedur secs2date(s: longint; var d: datearray);
|
|turns s, the number of seconds elapsed since 00:00am, 1jand 1904, into an
|array of date values

		.text
		.globl	_secs2dat
_secs2dat:
	|moveml sp@+,d0/a0-a1	|d0=ret, a0=date, a1=s
	moveml sp@+,#0x0301	|d0=ret, a0=date, a1=s
	movl	d0,sp@-	|restore return addr
	movl	a1,d0	|place d0=s
	.word	__secs2date	|convert d0 to a0
	rts


|
|procedure delay(numticks: longint; var finalticks: longint);
|	.macro	.word	__delay

		.text
		.globl	_delay
_delay:

	movl	sp@+,d0	|get the return address
	movl	sp@+,a1	|ptr to where to return result
	movl	sp@+,a0	|numticks
	movl	d0,sp@-	|restore return address

	.word	__delay
	movl	d0,a1@	|return value of ticks after delay

	rts


|
| procedure sysbeep(duration: integer);
|jul 13, 1984	changed this to be inline
|
|sysbeep:
|
|	movw	sp@(4),sp@-	;push duration
|	.word	__sysbeep	;make the sound
|	movl	sp@+,a0
|	addw	#2,sp
|	jmp	a0@


|
|function equalstring(str1,str2: osstr255; casesens,diacsens: boolean):boolean;
|

		.text
		.globl	_equalstr
_equalstr:
	link	a6, #0	| allocate stack frame

	movl	a6@(16),a0	|ptr to str1
	movl	a6@(12),a1	|ptr to str2
	moveq	#0,d0
	movb	a0@+,d0	|str1 length
	swap	d0
	movb	a1@+,d0	|str2 length

	|depending on value of booleans, make proper call
	tstb	a6@(8)	|value of diacsens
	beqs	2$	|strip diacriticals
	tstb	a6@(10)	|value of casesens
	beqs	1$	|ignore case
	.word	__cmpstring+_case_	|both diacritical andw case sensitive
	bras	strdone

1$:	.word	__cmpstring	|diacritical sensitive,map to upper case
	bras	strdone

	|strip diacriticals
2$:	tstb	a6@(10)	|case sensitive?
	beqs	3$
	.word	__cmpstring+_marks_+_case_ |ignore diacrits, case sensitive
	bras	strdone

3$:	.word	__cmpstring+_marks_	|ignore diacrits andw map to upper case

strdone:	eorb	#1,d0	|take opposite of what cmpstring returns
	movb	d0,a6@(20)	|return result

	unlk	a6	| restore stack
	movl	sp@+,a0	| rtn addr
	addl	#12,sp	| pop args
	jmp	a0@

|
|procedure uprstring(var thestring: osstr255; diacsens: boolean);
|

		.text
		.globl	_uprstrin
_uprstrin:

	movl	sp@+,a1	|get the return address
	movb	sp@+,d1	|diacritical sensitivity bool
	movl	sp@+,a0	|ptr to string to canonize
	moveq	#0,d0
	movb	a0@+,d0	|string length
	movl	a1,sp@-	|restore return address

	|decide which flavor of uprstring to call andw call it
	tstb	d1
	beqs	1$	|ignore diacriticals
	.word	__uprstring	|keep diacriticals
	bras	2$

1$:	.word	__uprstring+_marks_

2$:	rts
ddress
	movl	sp@+,a0	|handle for block
	.word	__hnopurge	|let os to do it.
	bra	_savereta1	|save result code and return via a1


|
|procedure moremasters|
|

		.text
		.globl	_moremast
_moremast:

	.word	__moremasters
	bra	_save


|----------------------------------------------------------------------
|
| procedure blockmove(srcptr, destptr: ptr| bytecount: size)|
|
| marks the relocatable block referred to by h as not purgeable.
|
| arguments:
|	srcptr:	source pointer
|	destptr:	destination pointer
|sumacc/lib/Makefile   444      0     12        2250  3470501360   7504 DL=/usr/sun/lib
.SUFFIXES: .b .sl
CFLAGS= -O -I../h
CFLAGS68= -I../h
LINTL=libqd.c libos.c libtool.c libpack.c libfast.c libpr.c
STUBS=mactrap.b mem.b misc.b hand.b event.b dlgcut.b pack.b sane.b sanescan.b insane.b elems.b getpargs.b strconv.b prlink.b getind.b

#	turns .s into .b and strips about 700 useless abs symbols
.s.b:
	cc68 -c $<
	ld68 -r -x -T 0 $*.b
	mv b.out $*.b

#	turns .c into .sl for libmake
.c.sl:
	cc68 $(CFLAGS68) -DCODE -S $<
	mv $*.s $*.sl

#	turns .c into .b
.c.b:
	cc68 $(CFLAGS68) -c $<


all:	libmac.a llib-lmac.ln crtmac.b

llib-lmac.ln: $(LINTL)
	lint $(CFLAGS68) -Cmac $(LINTL)
#	mk41lint $(LINTL)

libmact.a: libqd.sl libos.sl libtool.sl libpack.sl libpr.sl libmake
	rm -f libmact.a 
	cat libqd.sl libos.sl libtool.sl libpack.sl libpr.sl | \
		sed -f libmac.sed | libmake libmact.a

libmac.a: libmact.a $(STUBS)
	(cd io; make)
	cp libmact.a libmac.a
	ar rv libmac.a $(STUBS) io/*.b

libmake: libmake.o
	cc -o libmake libmake.o

clean:
	rm -f libmac.a libmact.a *.ln *.o *.b *.sl *.s.b *.s.list
	cd io; make clean

install: 
	-cp llib-lmac.ln /usr/lib/lint
	-cp crtmac.b $(DL)
	-cp libmac.a $(DL)
#	ranlib68 $(DL)/libmac.a	(not used on VAX, but would be nice)
+,a1	|ptr to where to return result
	movl	sp@+,a0	|numticks
	movl	d0,sp@-	|restore return address

	.word	__delay
	movl	d0,a1@	|return value of ticks after delay

	rts


|
| procedure sysbeep(duration: integer);
|jul 13, 1984	changed this to be inline
|
|sysbeep:
|
|	movw	sp@(4),sp@-	;push duration
|	.word	__sysbeep	;make the sound
|	movl	sp@sumacc/lib/mactrap.s   444      0     12        6770  3470501361   7673 |
| mactrap.s - C library trap linkage for Macintosh
|
| Copyright (C) 1984, Stanford Univ. SUMEX project.
| May be used but not sold without permission.
|
| history
| 05/01/84	Croft	Created.
| 05/25/84	Croft	Added PS length check; speeded up switch code
| 05/31/84	Croft	Added VS, VPS, now reentrant.
|
	.data
	.text
	.globl	_mactrap,_savea5,p2cstr

_FLEN = -256			| total frame length

_FVAR = -256			| VAR flag (pascal string or short)
_FRT = -254			| return type
_FOP = -252			| opcode (jmp or trap)
_FAD = -250			| longword address
_FJMP = -246			| JMP
_FJAD = -244			| jmp address
_FS = -240			| string conversion area
_FREG = -8			| register save area
_FSL = _FREG - _FS - 2		| string conv area length

_mactrap:
	link	a6,#_FLEN
	moveml	#A5+D2,a6@(_FREG)
	clrb	a6@(_FVAR)	| clear VAR flag
	movw	#/4ef9,a6@(_FJMP)	| setup JMP
	movl	#.L19,a6@(_FJAD)
	lea	a6@(_FS),a5	| a5 = string area
	lea	a6@(12),a0	| a0 = points to C args
	movl	a6@(4),a1
	movl	a1@+,d0		| d0 = C arg types
	movw	#/4e71,a6@(_FOP)	| nop
	movl	a1@,a6@(_FAD)	| trap or stub address
	blts	.L100		| if trap
	movw	#/4eb9,a6@(_FOP)	| jbsr
.L100:
	movl	d0,d1		| isolate C return type
	lsrl	#3,d0
	andw	#7,d1
	movw	d1,a6@(_FRT)	| save for later use
	subql	#4,sp		| reserve room for possible return value
|
| convert each argument type
|
.L1:
	movw	d0,d1
	lsrl	#3,d0		| each type packed in 3 bit nibble
	andw	#7,d1
	addw	d1,d1
	movw	pc@(6,d1:w),d1
	jmp	pc@(2,d1:w)
.L2:
	.word	.L10-.L2
	.word	.LAS-.L2
	.word	.LAL-.L2
	.word	.LAPS-.L2
	.word	.LASS-.L2
	.word	.LAB-.L2
	.word	.LAVS-.L2
	.word	.LAVPS-.L2
.LAS:
	movl	a0@+,d1		| short
	movw	d1,sp@-
	bras	.L1
.LAVPS:				| VAR pascal string
.LAVS:				| VAR short
	addqb	#1,a6@(_FVAR)
.LAL:
	movl	a0@+,sp@-	| long
	bras	.L1
.LASS:
	movl	a0@+,a1		| short struct (includes os/restype strings)
	movb	a1@+,d1		| may not be word aligned
	lsll	#8,d1
	movb	a1@+,d1
	lsll	#8,d1
	movb	a1@+,d1
	lsll	#8,d1
	movb	a1@+,d1
	movl	d1,sp@-
	bras	.L1
.LAB:
	movl	a0@+,d1		| boolean
	movb	d1,sp@-
	bras	.L1
.LAPS:
	movl	a0@+,d1
	bclr	#24,d1		| test and clear
	beqs	.L3		| if C string
	movl	d1,sp@-
	bras	.L1
.L3:
	movl	d1,a1
	clrl	d2		| count
	movl	a5,d1		| start address
	addql	#1,a5		| save byte for length
.L4:
	movb	a1@+,a5@+
	beqs	.L5
	addql	#1,d2
	cmpw	#_FSL,d2	| don't overflow conversion area
	blts	.L4
	subql	#8,a5
.L5:
	movl	d1,a1		| get string start address back
	movb	d2,a1@		| set count
	movl	d1,sp@-
	bras	.L1
|
| done with argument conversion, call toolbox
|
.L10:
	movl	_savea5,a5
	jmp	a6@(_FOP)
.L19:
|
| if an argument was a VAR short or VAR string, it needs deconversion;
| normally there are no such args, so this code is skipped.
|
	tstb	a6@(_FVAR)
	beq	.L29		| no such args (normal case)
	lea	a6@(12),a5	| a5 = points to C args
	movl	a6@(4),a1
	movl	a1@+,d2		| d2 = C arg types
	lsrl	#3,d2
	subql	#4,a5
.L11:
	addql	#4,a5		| point to next arg
	movw	d2,d1
	lsrl	#3,d2		| each type packed in 3 bit nibble
	andw	#7,d1
	beqs	.L29		| done
	cmpb	#6,d1
	blts	.L11
	beqs	.L13		| VAR short
				| else VAR pascal string
	movl	a5@,sp@-
	jsr	p2cstr
	addql	#4,sp
	bras	.L11
.L13:
	movl	a5@,a1		| convert VAR short
	movw	a1@,d0
	extl	d0
	movl	d0,a1@
	bras	.L11
|
| move function result type into d0
|
.L29:
	movw	a6@(_FRT),d1
	addw	d1,d1
	movw	pc@(6,d1:w),d1
	jmp	pc@(2,d1:w)
.L20:
	.word	.L30-.L20
	.word	.L21-.L20
	.word	.L22-.L20
	.word	.L30-.L20
	.word	.L30-.L20
	.word	.L23-.L20
	.word	.L30-.L20
	.word	.L30-.L20
.L21:
	movw	sp@+,d0
	extl	d0
	bras	.L30
.L22:
	movl	sp@+,d0
	bras	.L30
.L23:
	clrl	d0
	movb	sp@+,d0
.L30:
	moveml	a6@(_FREG),#A5+D2
	unlk	a6
	addql	#4,sp
	rts
.L2
	.wosumacc/lib/getind.s   444      0     12        4470  3470501361   7511 	.insrt	"../h/toolmacs.h"

|procedure getindstring(var thestring: str255; strlistid: integer;
|	index: integer);
|
|gets the str# resource with id strlistid andw returns in thestring the index-th
|string in the string list.

		.text
		.globl	_getindst
_getindst:

	link	a6,#0

	|get the string list
	subqw	#4,sp	|room for result handle
	|movl	#'STR#',sp@-	|thetype
	movl	.L1,sp@-	|thetype
	movw	a6@(10),sp@-	|strlistid
	.word	__getresou
	movl	a6@(12),a1	|ptr to where to return the str
	clrb	a1@	|assume empty
	movl	sp@+,d0	|handle to string list
	beqs	gsret	|if empty, just quit
	movl	d0,a0	|get handle in a0
	movl	a0@,a0	|deref it
	movw	a0@+,d0	|get the number of strings
	movw	a6@(8),d1	|the index
	cmpw	d0,d1	|is index larger than count?
	bgts	gsret	|yes, just quit
	moveq	#0,d0	|will keep track of length of strs

gsloop:	subqw	#1,d1	|decrement the index
	beqs	gscopy	|found the one we are looking for
	movb	a0@+,d0	|get length of this one
	addl	d0,a0	|skip over this string
	bras	gsloop	|and go on to next

gscopy:	movb	a0@,d0	|get the length of this string
	addqw	#1,d0	|add one for the length byte
	.word	__blockmove	|copy it into the string

gsret:	unlk	a6
	movl	sp@+,a0	|return addr
	addql	#8,sp	|pop off parms
	jmp	a0@	|return

.L1:	.ascii	"STR#"


|procedure getindpattern(var thepat: pattern; patlistid: integer;index: integer)
|
|gets pat# resource with id patlistid andw stuffs into thepat the index-th
|pattern in the list.

		.text
		.globl	_getindpa
_getindpa:

	link	a6,#0

	|get the string list
	subqw	#4,sp	|room for result handle
	|movl	#'PAT#',sp@-	|thetype
	movl	.L2,sp@-	|thetype
	movw	a6@(10),sp@-	|patlistid
	.word	__getresou
	movl	a6@(12),a1	|ptr to where to return the pat
	movl	sp@+,d0	|handle to string list
	beqs	gpret	|if empty, just quit
	movl	d0,a0	|get handle in a0
	movl	a0@,a0	|deref it
	movw	a0@+,d0	|get the number of patterns
	movw	a6@(8),d1	|the index
	bles	gpret	|no such thing as negative index
	cmpw	d0,d1	|is index larger than count?
	bgts	gpret	|yes, just quit

gploop:	subqw	#1,d1	|decrement the index
	beqs	gpcopy	|found the one we are looking for
	addqw	#8,a0	|skip over the pattern
	bras	gploop	|and go on to next

gpcopy:	moveq	#8,d0	|a pattern is 8 bytes
	.word	__blockmove	|copy it into the string

gpret:	unlk	a6
	movl	sp@+,a0	|return addr
	addql	#8,sp	|pop off parms
	jmp	a0@	|return

.L2:	.ascii	"PAT#"
|room for result handle
	|movl	#'STR#',sp@-	|thetype
	movl	.L1,sp@-	|thetype
	movw	a6@(10),sp@-	|strlistid
	.word	__getresou
	movl	a6@(12),a1	|ptr to where to return the str
	clrb	a1@	|assume empty
	msumacc/lib/event.s   444      0     12        3413  3470501361   7354 	.insrt	"../h/sysequ.h"
	.insrt	"../h/toolmacs.h"

|the following are the implementation of the event mgr routines that are
|register based as oposed to stack based
|they are included here because they are ostraps, however the interfaces for
|them are in toolintf
|
|	function postevent(eventnum: integer; eventmsg: longint): oserr;
|
		.text
		.globl	_posteven
_posteven:
|
	movl	sp@+,a1	|a1 is return address
	movl	sp@+,d0	|32-bit quantity defined by the event
	movw	sp@+,a0	|word of event number
	movl	a1,sp@-	|
	.word	__postevent
	movw	d0,sp@(4)	|return 0=event posted; 1=not posted
	rts
|
| procedure flushevents(evtmasks: longint);
|
		.text
		.globl	_flusheve
_flusheve:
	movl	sp@+,a1	|pop return address
	movl	sp@+,d0	|pop long word of event masks
	movl	a1,sp@-
	.word	__flushevents
	rts

|
| procedure seteventmask;
|
		.text
		.globl	_setevent
_setevent:
|
	movl	sp@+,a1
	movw	sp@+,sysevtmask	|get the mask
	jmp	a1@	| return to caller

|
|function oseventavail(mask: integer; var theevent: eventrecord): boolean;
|

		.text
		.globl	_oseventa
_oseventa:

	movl	sp@+,a1	|return address
	movl	sp@+,a0	|user event record
	movw	sp@+,d0	|event mask (set of events desired)
	movl	a1,sp@-	|push return address
	.word	__oseventavail
	tstw	d0
	beqs	1$	|non-null event returned

	clrb	sp@(4)	|null event returned
	bras	2$

1$:	movb	#1,sp@(4)	|non-null event returned
2$:	rts

|
|function getosevent(mask: integer; var theevent: eventrecord): boolean;
|

		.text
		.globl	_getoseve
_getoseve:

	movl	sp@+,a1	|return address
	movl	sp@+,a0	|user event record
	movw	sp@+,d0	|event mask (set of events desired)
	movl	a1,sp@-	|push return address
	.word	__getosevent
	tstw	d0
	beqs	1$	|non-null event returned

	clrb	sp@(4)	|null event returned
	bras	2$

1$:	movb	#1,sp@(4)	|non-null event returned
2$:	rts


movl	a0@,a0	|deref it
	movw	a0@+,d0	|get the number of patterns
	movw	a6@(8),d1	|the index
	bles	gpret	|no such thing as negative index
	cmpw	d0,d1	|is index larger than count?
	bgts	gpret	|yes, just quit

gploop:	subqw	#1,d1	|decrement the indesumacc/lib/dlgcut.s   444      0     12        1442  3470501361   7515 |
|	dmgr utility routines
|
|	these routines provide cut and paste capabiulities to edittable
|	text fields in dialogs

	.insrt	"../h/toolmacs.h"
	.insrt	"../h/toolequ.h"

	.text

	.globl	_dlgcut
	.globl	_dlgcopy
	.globl	_dlgpaste
	.globl	_dlgdelet


_dlgpaste:
	bsr	stdcheck
	.word	__tepaste
adios:
	movl	sp@+,sp@	| pop return/argument
	rts
_dlgcut:
	bsr	stdcheck
	.word	__tecut
	bra	adios
_dlgcopy:
	bsr	stdcheck
	.word	__tecopy
	bra	adios

_dlgdelet:
	bsr	stdcheck
	.word	__tedelete
	bra	adios

stdcheck:
	movl	sp@(8),a0	| get dialog pointer
	tstw	a0@(editfield)	| see if edit is open
	bmis	nodice	| see if edit field defined
	movl	sp@+,a1	| pop return for stdcheck
	movl	a0@(tehandle),sp@-	| pass text edit handle
	jmp	a1@
nodice:
	moveml	sp@+,#D0+A0+A1	| get real return address
	jmp	a0@	| return
te
adios:
	movl	sp@+,sp@	| pop return/argument
	rts
_dlgcut:
	bsr	stdcheck
	.word	__tecut
	bra	adios
_dlgcopy:
	bsr	stdcheck
	.word	__tecopy
	bra	adios

_dlgdelet:
	bsr	stdcheck
	.word	__tedelete
	bra	adios

stdcheck:
	movsumacc/lib/trsmacs   555      0     12         530  3470501361   7426 #!/bin/sh
#	tras - translate assembler source from Apple to local
#
#	tras mumble.s		# output left on tmumble.s
#
trap "rm -f /tmp/sed$$" 0 1 2 15
cat <<EOT >/tmp/sed$$
s/;/|/
/ *\.macro */{
s///
s/ *|.*//
s/.*/& = /
N
s/ *|.*//
N
s/ *|.*//
N
s/ *|.*//
s/\n//g
s/ *move.w *#\(.*\),.*$/ \1/
}
EOT
tr "[A-Z]" "[a-z]" <$1 | sed -f /tmp/sed$$ >t$1
lgcut:
	bsr	stdcheck
	.word	__tecut
	bra	adios
_dlgcopy:
	bsr	stdcheck
	.word	__tecopy
	bra	adios

_dlgdelet:
	bsr	stdcheck
	.word	__tedelete
	bra	adios

stdcheck:
	movsumacc/lib/TODO   444      0     12        4040  3470501362   6535 Nop high-frequency stuff (like LineTo,FixMul,etc.) in lib*.c, then
make a new "libfast.c" with just the lint lines.  "fast.s" will
contain the direct C callable functions with in-line argument
conversion.  Note that libsane.c/sane.s/elems.s already accomplishes
this for floating point (at ~1ms/operation in sane I'm not sure this
was worth the effort).

Request for Apple:  In your next version, please put sanescan in
a package or somewhere that I can get at without having to load the
pascal subroutines str2dec/dec2str/int2dec with my C programs.
I had to hack around too long to put sanescan into assembler and combine
it with the proper support routines (%_pos,%_copy,etc.) so I could
assemble / load with it on my UNIX system.  How about the same for
Graf3D also?

If Apple doesn't help with sanescan/graf3d (even worse, other user
linked routines may show up in the future), I guess this would work:
Dumpobj the offending code and upload it; strip off the disassembled stuff
so we have just the raw hex.  Since the code should be position
independent, we should be able to "call" this glob of hex words(!)
Will need to dummy up a main program calling the function, since
library subroutines need to be linked in (%_pos...).
This could result in multiple copies of the Pascal helpers being loaded.
Access to pascal source for assembly generation ($ASM ONLY compiler
option), or disassembling (dumpobj) is not the way to go (discovered
through painful experience) since the Lisa and UNIX assembler syntax
and semantics are too different (e.g. pea .+1234 generates PC-rel 
on Lisa, long-abs on UNIX).

For VAX folks, convert a version of ranlib to ranlib68 and make it
interact properly with ld68.  People running UNIX on a 68000 should
already have this capability.

Some of the library routines are not currently reentrant (callable
from interrupt level), such as mactrap.s.  If this is important, it
would be possible to setup a little code segment that resides on the
stack.  Alternately Apple could provide an "indirect" trap that takes
the trap code out of a register.
ineTo,FixMul,etc.) in lib*.c, then
make a new "libfast.c" with just the lint lines.  "fast.s" will
contain the direct C callable functions with in-line argument
conversion.  Note that libsane.c/sane.s/elems.s already accomplishes
this for floating point (at ~1ms/operation in sane I'm not sure this
was worth the effort).

Request for Apple:  In your next version, please put sanescan in
a package or somewhere that I can get at without having to load the
pascal subroutines str2dsumacc/lib/libfast.c   444      0     12       14036  3470501362   7663 /*	libfast.c	1.0	05/25/84	*/

/*
 * Lint library for "fast" routines (those directly callable
 * from C).
 *
 * Copyright (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 05/25/84	Croft	Created C version.
 */

/* LINTLIBRARY */

#include "libmac.h"


/*
 * String conversion utilities (strconv.s).
 */

void	c2pstr(cp) char *cp; { }
void	p2cstr(cp) char *cp; { }
char	*cofpstr(cp) char *cp; { return((char *)0); }
char	*isapstr(cp) char *cp; { return((char *)0); }


/*
 * SANE and ELEMS library.
 */

#include "sane.h"

/* Two address, extended-based arithmetic operations. */

void	AddS(x,y) Single *x; Extended *y; { }
void	AddD(x,y) Double *x; Extended *y; { }
void	AddC(x,y) Comp *x; Extended *y; { }
void	AddX(x,y) Extended *x; Extended *y; { }
            /* y := y + x */

void	SubS(x,y) Single *x; Extended *y; { }
void	SubD(x,y) Double *x; Extended *y; { }
void	SubC(x,y) Comp *x; Extended *y; { }
void	SubX(x,y) Extended *x; Extended *y; { }
            /* y := y - x */

void	MulS(x,y) Single *x; Extended *y; { }
void	MulD(x,y) Double *x; Extended *y; { }
void	MulC(x,y) Comp *x; Extended *y; { }
void	MulX(x,y) Extended *x; Extended *y; { }
            /* y := y * x */

void	DivS(x,y) Single *x; Extended *y; { }
void	DivD(x,y) Double *x; Extended *y; { }
void	DivC(x,y) Comp *x; Extended *y; { }
void	DivX(x,y) Extended *x; Extended *y; { }
            /* y := y / x */

int	CmpX(x,relop,y) Extended *x,*y; { RI }
            /* returns boolean; x r y */

int	RelX(x,y) Extended *x,*y; { RI }
            /* returns RelX;  x RelX y, where RelX in [GT, LT, EQ, UNORD] */

/*
 * Conversions between Extended and the other numeric types,
 * including the types integer and Longint.
 */

void	I2X(x,y) short *x; Extended *y; { }
void	L2X(x,y) int *x; Extended *y; { }
void	S2X(x,y) Single *x; Extended *y; { }
void	D2X(x,y) Double *x; Extended *y; { }
void	C2X(x,y) Comp *x; Extended *y; { }
void	X2X(x,y) Extended *x; Extended *y; { }
            /* y := x (arithmetic assignment) */

void	X2I(x,y) Extended *x; short *y; { }
void	X2L(x,y) Extended *x; int *y; { }
void	X2S(x,y) Extended *x; Single *y; { }
void	X2D(x,y) Extended *x; Double *y; { }
void	X2C(x,y) Extended *x; Comp *y; { }
            /* y := x (arithmetic assignment) */

/*
 * Conversions between the numeric types and the intermediate
 * decimal type.
 */

void	S2Dec(f,x,y) DecForm *f; Single *x; Decimal *y; { }
void	D2Dec(f,x,y) DecForm *f; Double *x; Decimal *y; { }
void	C2Dec(f,x,y) DecForm *f; Comp *x; Decimal *y; { }
void	X2Dec(f,x,y) DecForm *f; Extended *x; Decimal *y; { }
            /* y := x (according to the format f) */

void	Dec2S(x,y) Decimal *x; Single *y; { }
void	Dec2D(x,y) Decimal *x; Double *y; { }
void	Dec2C(x,y) Decimal *x; Comp *y; { }
void	Dec2X(x,y) Decimal *x; Extended *y; { }
            /* y := x */

/*
 * Conversions between the numeric types and strings.
 * (These conversions have a built-in scanner/parser to convert
 * between the intermediate decimal type and a string.)
 */

void	S2Str(f,x,y) DecForm *f; Single *x; char *y; { }
void	D2Str(f,x,y) DecForm *f; Double *x; char *y; { }
void	C2Str(f,x,y) DecForm *f; Comp *x; char *y; { }
void	X2Str(f,x,y) DecForm *f; Extended *x; char *y; { }
            /* y := x (according to the format f) */

void	Str2S(x,y) char *x; Single *y; { }
void	Str2D(x,y) char *x; Double *y; { }
void	Str2C(x,y) char *x; Comp *y; { }
void	Str2X(x,y) char *x; Extended *y; { }
            /* y := x */

/*
 * Numerical 'library' procedures and functions.
 */

void	RemX(x,y,quo) Extended *x,*y; int *quo; { }
            /* new y := remainder of ((old y) / x), such that
                       |new y| <= |x| / 2;
              quo := low order seven bits of integer quotient y / x,
                     so that -127 <= quo <= 127.                     */
void	SqrtX(x) Extended *x; { }
            /* x := sqrt (x) */
void	RintX(x) Extended *x; { }
            /* x := rounded value of x */
void	NegX(x) Extended *x; { }
            /* x := -x */
void	AbsX(x) Extended *x; { }
            /* x := |x| */
void	CpySgnX(x,y) Extended *x,*y; { }
            /* x := x with the sign of y */

void	NextS(x,y) Single *x,*y; { }
void	NextD(x,y) Double *x,*y; { }
void	NextX(x,y) Extended *x,*y; { }
            /* x := next representable value from x toward y */

int	ClassS(x,sgn) Single *x; int *sgn; { RI }
int	ClassD(x,sgn) Double *x; int *sgn; { RI }
int	ClassC(x,sgn) Comp *x; int *sgn; { RI }
int	ClassX(x,sgn) Extended *x; int *sgn; { RI }
            /* returns NumClass; sgn := sign of x (0 for pos, 1 for neg) */

void	ScalbX(n,y) short *n; Extended *y; { }
            /* y := y * 2^n */
void	LogbX(x) Extended *x; { }
            /* returns unbiased exponent of x */

/*
 * Manipulations of the static numeric state.
 */

void	SetRnd(rounddir) { }
void	SetEnv(e) Environ *e; { }
void	ProcExit(e) Environ *e; { }

int	GetRnd() { RI }	/* returns rounddir */
void	GetEnv(e) Environ *e; { }
void	ProcEntry(e) Environ *e; { }

int	TestXcp(exception) { RI }
void	SetXcp(exception,onoff) { }
int	TestHlt(exception) { RI }
void	SetHlt(exception,onoff) { }


/*
 * "Elems" package
 */

void	Log2X(x) Extended *x; { }
            /* x := log2 (x) */
void	LnX(x) Extended *x; { }
            /* x := ln (x) */
void	Ln1X(x) Extended *x; { }
            /* x := ln (1 + x) */
void	Exp2X(x) Extended *x; { }
            /* x := 2^x */
void	ExpX(x) Extended *x; { }
            /* x := e^x */
void	Exp1X(x) Extended *x; { }
            /* x := e^x - 1 */
void	XpwrI(i,x) short *i; Extended *x; { }
            /* x := x^i */
void	XpwrY(y,x) Extended *y,*x; { }
            /* x := x^y */
void	Compound(r,n,x) Extended *r,*n,*x; { }
            /* x := (1 + r)^n */
void	Annuity(r,n,x) Extended *r,*n,*x; { }
            /* x := (1 - (1 + r)^-n) / r */
void	SinX(x) Extended *x; { }
            /* x := sin(x) */
void	CosX(x) Extended *x; { }
            /* x := cos(x) */
void	TanX(x) Extended *x; { }
            /* x := tan(x) */
void	AtanX(x) Extended *x; { }
            /* x := atan(x) */
void	NextRandom(x) Extended *x; { }
            /* x := next random (x) */
ndle for block
	.word	__hnopurge	|let os to do it.
	bra	_savereta1	|save result code and return via a1


|
|procedure moremasters|
|

		.text
		.globl	_moremast
_moremast:

	.word	__moremasters
	bra	_save


|----------------------------------------------------------------------
|
| procedure blockmove(srcptr, destptr: ptr| bytecount: size)|
|
| marks the relocatable block referred to by h as not purgeable.
|
| arguments:
|	srcptr:	source pointer
|	destptr:	destination pointer
|sumacc/lib/sane.s   444      0     12       20123  3470501363   7200 |-----------------------------------------------------------
| 28aug82: written by jerome coonen
| 13oct82: remove uses of d0 across fp calls (jtc).
| 12dec82: fix bugs in class fcns (jtc).
| 28dec82: split nan class to snan, qnan; scalb, logb (jtc).
| 29dec82: i2x, l2x pass by value here. (jtc)
| 27apr83: neg as core function added. (jtc)
| 25may84: C version, uses macros to save my fingers. (croft)
|-----------------------------------------------------------
	.nlist
	.insrt	"../h/sanemacs.h"
	.list

__fp68k = /a9eb		| avoids including toolmacs.h
__elems68k = /a9ec

	.text

	.macro cfp,c
	movw	#c,sp@-
	.word	__fp68k
	.endm
	.macro cel,c
	movw	#c,sp@-
	.word	__elems68k
	.endm
	.macro c1,l,c
	.globl l
l:	movw	#c,d0
	bra	call1
	.endm
	.macro c2,l,c
	.globl l
l:	movw	#c,d0
	bra	call2
	.endm
	.macro c3,l,c
	.globl l
l:	movw	#c,d0
	bra	call3
	.endm

	c2,AddS,fadds
	c2,AddD,faddd
	c2,AddC,faddc
	c2,AddX,faddx
	c2,SubS,fsubs
	c2,SubD,fsubd
	c2,SubC,fsubc
	c2,SubX,fsubx
	c2,MulS,fmuls
	c2,MulD,fmuld
	c2,MulC,fmulc
	c2,MulX,fmulx
	c2,DivS,fdivs
	c2,DivD,fdivd
	c2,DivC,fdivc
	c2,DivX,fdivx

	c2,I2X,fi2x
	c2,L2X,fl2x
	c2,S2X,fs2x
	c2,D2X,fd2x
	c2,C2X,fc2x
	c2,X2X,fx2x
	c2,X2I,fx2i
	c2,X2L,fx2l
	c2,X2S,fx2s
	c2,X2D,fx2d
	c2,X2C,fx2c
	c2,Dec2S,fdec2s
	c2,Dec2D,fdec2d
	c2,Dec2C,fdec2c
	c2,Dec2X,fdec2x
	c3,S2Dec,fs2dec
	c3,D2Dec,fd2dec
	c3,C2Dec,fc2dec
	c3,X2Dec,fx2dec

	c1,SqrtX,fsqrtx
	c1,RintX,frintx
	c1,NegX,fnegx
	c1,AbsX,fabsx
	c2,CpySgnX,fcpysgnx
	c2,ScalbX,fscalbx
	c1,LogbX,flogbx
	c2,NextS,fnexts
	c2,NextD,fnextd
	c2,NextX,fnextx

	c1,SetEnv,fsetenv
	c1,GetEnv,fgetenv
	c1,ProcEntry,fprocentry
	c1,ProcExit,fprocexit

call1:	movl	sp@+,a0
	movw	d0,sp@-
	.word	__fp68k
	subql	#4,sp
	jmp	a0@

call2:	movl	sp@+,a0
	movl	sp@,d1
	movl	sp@(4),sp@
	movl	d1,sp@(4)
	movw	d0,sp@-
	.word	__fp68k
	subql	#8,sp
	jmp	a0@

call3:	movl	sp@+,a0
	movl	sp@,d1
	movl	sp@(8),sp@
	movl	d1,sp@(8)
	movw	d0,sp@-
	.word	__fp68k
	subw	#12,sp
	jmp	a0@



        .globl    CmpX
CmpX:
        movl   sp@+,a0        | ret address
        movl    sp@(4),d1        | relop to be tested
        addqb  #1,d1           | handy to increment

        movl    sp@,d0         | swap addresses (C already swapped)
        addql  #2,sp           | kill slot for relop
	movl	d0,sp@

        cmpb  #4,d1           | equal
        beqs   .L1
        cmpb  #8,d1           | unordered
        beqs   .L1

        cfp fcpxx
        bras   .L10
.L1:
        cfp fcmpx
.L10:
        fbne    .L12
        btst    #2,d1           | #2 is equal bit
        bras   .L50
.L12:
        fbo     .L14
        btst    #3,d1           | #3 is unordered bit
        bras   .L50
.L14:
        fbgt    .L16
        btst    #1,d1           | #1 is less bit
        bras   .L50
.L16:
        btst    #0,d1           | #0 is greater bit
.L50:
	clrl	d0
        sne     d0
        negb   d0
	subw	#12,sp		| C wants to pop his own args
        jmp     a0@



        .globl    RelX
RelX:				| C args already swapped
        movl   sp@+,a0

        moveq   #7,d1           | assume unordered
        cfp fcmpx
        fbu     .L9              | unordered
        fbne    .L7
        moveq   #3,d1           | equal
        bras   .L9
.L7:
        fbgt    .L3
        moveq   #1,d1           | less
        bras   .L9
.L3:
        moveq   #0,d1           | greater
.L9:
	movl	d1,d0
	subw	#8,sp
        jmp     a0@


        .globl    RemX
RemX:
        movl   sp@+,a0        | return address
	movl	sp@(8),a1	| addr of quotient
	movl	sp@+,d0		| swap args
	movl	d0,sp@(4)
        cfp fremx                   | returns with quo in d0
        movl    d0,a1@         | deliver integer result
	subw	#12,sp
        jmp     a0@


|-----------------------------------------------------------
| the class functions use a common startup routine to fetch
| the leading 32 bits and store the sign in its var param.
| a set of finishup sequences set the return value to the
| appropriate integer value.
|-----------------------------------------------------------
| pascal: function class?(var x: ???????; var sgn: integer):
|                                            numberclass
| stack = ret < sgn < x < result
|-----------------------------------------------------------

	.macro	class,l,c
	.globl	l
l:	movw	#c,d0
	bras	classcom
	.endm

	class,ClassS,fclasss
	class,ClassD,fclassd
	class,ClassC,fclassc
	class,ClassX,fclassx

classcom:
	movl	sp@+,a0		| ret addrs
	movl	sp@(4),a1	| swap args and save sgn var
	movl	sp@,sp@(4)
	movl	a1,sp@
	movw	d0,sp@-
	.word	__fp68k
        movw    a1@,d0         | ret code
	extl	d0
        clrl   a1@            | 0 for +, 1 for -
        tstw   d0
        bpls   .L71

        addql  #1,a1@
        negl   d0
.L71:
        subql  #1,d0
	subw	#8,sp		| C wants to pop his own stack
        jmp     a0@



|-----------------------------------------------------------
|-----------------------------------------------------------
| the environment parameter is an integer passed by address
| for convenience in later routines, set/getenv leave a1
| unchanged but touch d0.
|-----------------------------------------------------------
|-----------------------------------------------------------

	.globl	SetRnd
SetRnd:
        movl   sp@+,a1        | ret adrs

        movl    sp@,d1         | new rnd mode
	movl	#13,d0
        roll   d0,d1           | align round bits
        andl  #/6000,d1       | mask just those

        pea     sp@            | overwrite input operand
	cfp	fgetenv
        andw  #/9fff,sp@     | kill old mode
        orw    d1,sp@         | new mode
        pea     sp@
	cfp	fsetenv
        jmp     a1@


	.globl	GetRnd
GetRnd:
        movl   sp@+,a1
	clrw	sp@-
        pea     sp@
	cfp	fgetenv

        movl    #/6000,d0       | isolate round bits
        andw   sp@+,d0
	movl	#13,d1
        rorw   d1,d0           | in hi byte
        jmp     a1@


|-----------------------------------------------------------
| pascal: procedure testxcp(x: exception): boolean;
| so stack = ret < x < result.   hi byte (0) is set of flags
| and low byte (1) is halts.
|-----------------------------------------------------------

	.globl	TestXcp
TestXcp:
        clrl   d1
        bras   gentest
	.globl	TestHlt
TestHlt:
        moveq   #1,d1

gentest:
        movl   sp@+,a1        | ret adrs, safe from getenv
	movl	sp@,d0
	movw	d0,sp@-
        pea     sp@(2)
	cfp	fgetenv
        movw    sp@+,d0        | bit index in hi byte
        extw   d0              | make it word index
        btst    d0,sp@(0,d1)
        sne     d0              | d0 = 0000 or 00ff
        negb   d0              | d0 = 0000 or ffff

        jmp     a1@

|-----------------------------------------------------------
| pascal: procedure setxcp(x: exception; onoff: boolean);
| stack = ret < onoff < x
| this procedure was originally set up to just set or clear
| bits in the control word.  nowadays, setting an exception
| flag entails a possible halt, so a special dummy floating
| point routine is used.
|-----------------------------------------------------------
	.globl	SetXcp,SetHlt
SetXcp:	link	a6,#0
	movl	a6@(8),d0
	movb	d0,sp@-
	movl	a6@(12),d0
	movb	d0,sp@-
	bsrs	sxcp
	unlk	a6
	rts

SetHlt:	link	a6,#0
	movl	a6@(8),d0
	movb	d0,sp@-
	movl	a6@(12),d0
	movb	d0,sp@-
	bsrs	shlt
	unlk	a6
	rts

sxcp:
        tstb   sp@(4)           | check boolean
        beqs   clrxcp

        movl   sp@+,a0        | save return address
        addql  #2,sp           | kill boolean
        movb    sp@,d0         | get error index
        extw   d0              | extend to word
        movw    d0,sp@         | replace as word
        pea     sp@            | save address
	cfp	fsetxcp
        addql  #2,sp           | kill index word
        jmp     a0@

clrxcp:
        clrw   d1
        bras   gensetx
shlt:
        moveq   #1,d1
gensetx:
        movl   sp@,a1         | ret address, leave slot

        pea     sp@		
	cfp	fgetenv
        movb    sp@(6),d0        | bit index in hi byte
        extw   d0              | make it word index

        tstb   sp@(4)           | test input boolean
        bnes   .L81

        bclr    d0,sp@(0,d1)
        bras   .L83
.L81:
        bset    d0,sp@(0,d1)
.L83:
        pea     sp@
	cfp	fsetenv

        addql  #8,sp           | kill ret and inputs
        jmp     a1@
-----------------------------------

	.macro	class,l,c
	.globl	l
l:	movw	#c,d0
	bras	classcom
	.endm

	class,ClassS,fclasss
	class,ClassD,fclassd
	class,ClassC,fclassc
	class,ClassX,fclassx

classcom:
	movl	sp@+,a0		| ret addrs
	movl	sp@(4),a1	| swap args and save sgn var
	movl	sp@,sp@(4)
	movl	a1,sp@
	movw	d0,sp@-
	.word	__fp68k
        movw    a1@,d0         | ret code
	extl	d0
        clrl   a1@            | 0 for +, 1 forsumacc/lib/mk41lint   555      0     12         214  3470501363   7416 o=llib-lmac.ln
cp /dev/null $o
for i in $*
do
echo "$i:"
(/lib/cpp -I/usr/include/mac -C -Dlint $i | /usr/lib/lint/lint1 -v >>$o) 2>&1
done
globl	l
l:	movw	#c,d0
	bras	classcom
	.endm

	class,ClassS,fclasss
	class,ClassD,fclassd
	class,ClassC,fclassc
	class,ClassX,fclassx

classcom:
	movl	sp@+,a0		| ret addrs
	movl	sp@(4),a1	| swap args and save sgn var
	movl	sp@,sp@(4)
	movl	a1,sp@
	movw	d0,sp@-
	.word	__fp68k
        movw    a1@,d0         | ret code
	extl	d0
        clrl   a1@            | 0 for +, 1 forsumacc/lib/strconv.s   444      0     12        3512  3470501363   7733 |
| convstr - string conversion routines.
|
| Copyright (C) 1984, Stanford Univ. SUMEX project.
| May be used but not sold without permission.
|
|
| history
| 05/25/84	Croft	Created.
| 05/31/84	Croft	Changed semantics slightly.
| 05/31/84	Croft	C-generated code was so crummy I converted to asm


| C to Pascal string.  Converts a C string "in place" to a Pascal
| string by shuffling bytes down one position and inserting a 
| byte count. 

	.text
	.globl	c2pstr,C2PStr
C2PStr:
c2pstr:
	movl	sp@(4),a0
	movw	#0,a1
	movb	a0@+,d0
.L1:	
	tstb	d0
	beqs	.L2
	movb	a0@,d1
	movb	d0,a0@+
	movb	d1,d0
	addql	#1,a1
	bras	.L1
.L2:
	movl	a1,d0
	movl	sp@(4),a0
	movb	d0,a0@
	movl	a0,d0		| function return value is string address
	rts


| Pascal to C string.  Converts a Pascal string "in place" to a C string.

	.globl	p2cstr,P2CStr
P2CStr:
p2cstr:
	movl	sp@(4),a0
	movl	a0,a1
	clrl	d0
	movb	a0@+,d0
	subql	#1,d0
	blts	.L3
.L4:
	movb	a0@+,a1@+
	bnes	.L44
	subql	#1,a1		| delete imbedded zeros
.L44:
	dbra	d0,.L4
.L3:
	clrb	a1@
	movl	sp@(4),d0	| function return value is string address
	rts


| C interpretation of Pascal string.  Called with pointer to Pascal string; 
| returns with pointer to C string.  Non-destructive.

	.globl	CofPStr
CofPStr:
	movl	sp@(4),a0
	clrl	d0
	movb	a0@,d0
	addl	d0,a0
	addql	#1,a0
	clrb	a0@
	movl	sp@(4),d0
	addql	#1,d0
	rts


| Force toolbox argument to be recognized as a Pascal string.
| Normally "mactrap.s" converts C string pointer arguments for toolbox
| routines into the Pascal strings that the toolbox ROM expects.
| This is done dynamically via a string conversion area on the stack.
| If Mactrap is passed a pointer with bit 24 set, it assumes the
| string is already in Pascal form and avoids the conversion.
| E.g.: "DrawString(isapstr(pascalstringptr))".

	.globl	isapstr,IsAPStr
isapstr:
IsAPStr:
	movl	sp@(4),d0
	bset	#24,d0
	rts
n;
| so stack = ret < x < result.   hi byte (0) is set of flags
| and low byte (1) is halts.
|-----------------------------------------------------------

	.globl	TestXcp
TestXcp:
  sumacc/lib/sane.ls   444      0     12      127527  3470501366   7417    1                                                        |-----------------------------------------------------------
   2                                                        | 28aug82: written by jerome coonen
   3                                                        | 13oct82: remove uses of d0 across fp calls (jtc).
   4                                                        | 12dec82: fix bugs in class fcns (jtc).
   5                                                        | 28dec82: split nan class to snan, qnan; scalb, logb (jtc).
   6                                                        | 29dec82: i2x, l2x pass by value here. (jtc)
   7                                                        | 27apr83: neg as core function added. (jtc)
   8                                                        | 25may84: C version, uses macros to save my fingers. (croft)
   9                                                        |-----------------------------------------------------------
 572                                                        
 573                                                        __fp68k = /a9eb		| avoids including toolmacs.h
 574                                                        __elems68k = /a9ec
 575                                                        
 576                                                        	.text
 577                                                        
 578                                                        	.macro cfp,c
 579                                                        	movw	#c,sp@-
 580                                                        	.word	__fp68k
 581                                                        	.endm
 582                                                        	.macro cel,c
 583                                                        	movw	#c,sp@-
 584                                                        	.word	__elems68k
 585                                                        	.endm
 586                                                        	.macro c1,l,c
 587                                                        	.globl l
 588                                                        l:	movw	#c,d0
 589                                                        	bra	call1
 590                                                        	.endm
 591                                                        	.macro c2,l,c
 592                                                        	.globl l
 593                                                        l:	movw	#c,d0
 594                                                        	bra	call2
 595                                                        	.endm
 596                                                        	.macro c3,l,c
 597                                                        	.globl l
 598                                                        l:	movw	#c,d0
 599                                                        	bra	call3
 600                                                        	.endm
 601                                                        
 602                                                        	c2,AddS,fadds
 603*                                                       	.globl AddS
 604*   00 0000  303C  1000                                 AddS:	movw	#fadds,d0
 605*   00 0004  6000  018C                                 	bra	call2
 606                                                        	c2,AddD,faddd
 607*                                                       	.globl AddD
 608*   00 0008  303C  0800                                 AddD:	movw	#faddd,d0
 609*   00 000C  6000  0184                                 	bra	call2
 610                                                        	c2,AddC,faddc
 611*                                                       	.globl AddC
 612*   00 0010  303C  3000                                 AddC:	movw	#faddc,d0
 613*   00 0014  6000  017C                                 	bra	call2
 614                                                        	c2,AddX,faddx
 615*                                                       	.globl AddX
 616*   00 0018  303C  0000                                 AddX:	movw	#faddx,d0
 617*   00 001C  6000  0174                                 	bra	call2
 618                                                        	c2,SubS,fsubs
 619*                                                       	.globl SubS
 620*   00 0020  303C  1002                                 SubS:	movw	#fsubs,d0
 621*   00 0024  6000  016C                                 	bra	call2
 622                                                        	c2,SubD,fsubd
 623*                                                       	.globl SubD
 624*   00 0028  303C  0802                                 SubD:	movw	#fsubd,d0
 625*   00 002C  6000  0164                                 	bra	call2
 626                                                        	c2,SubC,fsubc
 627*                                                       	.globl SubC
 628*   00 0030  303C  3002                                 SubC:	movw	#fsubc,d0
 629*   00 0034  6000  015C                                 	bra	call2
 630                                                        	c2,SubX,fsubx
 631*                                                       	.globl SubX
 632*   00 0038  303C  0002                                 SubX:	movw	#fsubx,d0
 633*   00 003C  6000  0154                                 	bra	call2
 634                                                        	c2,MulS,fmuls
 635*                                                       	.globl MulS
 636*   00 0040  303C  1004                                 MulS:	movw	#fmuls,d0
 637*   00 0044  6000  014C                                 	bra	call2
 638                                                        	c2,MulD,fmuld
 639*                                                       	.globl MulD
 640*   00 0048  303C  0804                                 MulD:	movw	#fmuld,d0
 641*   00 004C  6000  0144                                 	bra	call2
 642                                                        	c2,MulC,fmulc
 643*                                                       	.globl MulC
 644*   00 0050  303C  3004                                 MulC:	movw	#fmulc,d0
 645*   00 0054  6000  013C                                 	bra	call2
 646                                                        	c2,MulX,fmulx
 647*                                                       	.globl MulX
 648*   00 0058  303C  0004                                 MulX:	movw	#fmulx,d0
 649*   00 005C  6000  0134                                 	bra	call2
 650                                                        	c2,DivS,fdivs
 651*                                                       	.globl DivS
 652*   00 0060  303C  1006                                 DivS:	movw	#fdivs,d0
 653*   00 0064  6000  012C                                 	bra	call2
 654                                                        	c2,DivD,fdivd
 655*                                                       	.globl DivD
 656*   00 0068  303C  0806                                 DivD:	movw	#fdivd,d0
 657*   00 006C  6000  0124                                 	bra	call2
 658                                                        	c2,DivC,fdivc
 659*                                                       	.globl DivC
 660*   00 0070  303C  3006                                 DivC:	movw	#fdivc,d0
 661*   00 0074  6000  011C                                 	bra	call2
 662                                                        	c2,DivX,fdivx
 663*                                                       	.globl DivX
 664*   00 0078  303C  0006                                 DivX:	movw	#fdivx,d0
 665*   00 007C  6000  0114                                 	bra	call2
 666                                                        
 667                                                        	c2,I2X,fi2x
 668*                                                       	.globl I2X
 669*   00 0080  303C  200E                                 I2X:	movw	#fi2x,d0
 670*   00 0084  6000  010C                                 	bra	call2
 671                                                        	c2,L2X,fl2x
 672*                                                       	.globl L2X
 673*   00 0088  303C  280E                                 L2X:	movw	#fl2x,d0
 674*   00 008C  6000  0104                                 	bra	call2
 675                                                        	c2,S2X,fs2x
 676*                                                       	.globl S2X
 677*   00 0090  303C  100E                                 S2X:	movw	#fs2x,d0
 678*   00 0094  6000  00FC                                 	bra	call2
 679                                                        	c2,D2X,fd2x
 680*                                                       	.globl D2X
 681*   00 0098  303C  080E                                 D2X:	movw	#fd2x,d0
 682*   00 009C  6000  00F4                                 	bra	call2
 683                                                        	c2,C2X,fc2x
 684*                                                       	.globl C2X
 685*   00 00A0  303C  300E                                 C2X:	movw	#fc2x,d0
 686*   00 00A4  6000  00EC                                 	bra	call2
 687                                                        	c2,X2X,fx2x
 688*                                                       	.globl X2X
 689*   00 00A8  303C  000E                                 X2X:	movw	#fx2x,d0
 690*   00 00AC  6000  00E4                                 	bra	call2
 691                                                        	c2,X2I,fx2i
 692*                                                       	.globl X2I
 693*   00 00B0  303C  2010                                 X2I:	movw	#fx2i,d0
 694*   00 00B4  6000  00DC                                 	bra	call2
 695                                                        	c2,X2L,fx2l
 696*                                                       	.globl X2L
 697*   00 00B8  303C  2810                                 X2L:	movw	#fx2l,d0
 698*   00 00BC  6000  00D4                                 	bra	call2
 699                                                        	c2,X2S,fx2s
 700*                                                       	.globl X2S
 701*   00 00C0  303C  1010                                 X2S:	movw	#fx2s,d0
 702*   00 00C4  6000  00CC                                 	bra	call2
 703                                                        	c2,X2D,fx2d
 704*                                                       	.globl X2D
 705*   00 00C8  303C  0810                                 X2D:	movw	#fx2d,d0
 706*   00 00CC  6000  00C4                                 	bra	call2
 707                                                        	c2,X2C,fx2c
 708*                                                       	.globl X2C
 709*   00 00D0  303C  3010                                 X2C:	movw	#fx2c,d0
 710*   00 00D4  6000  00BC                                 	bra	call2
 711                                                        	c2,Dec2S,fdec2s
 712*                                                       	.globl Dec2S
 713*   00 00D8  303C  1009                                 Dec2S:	movw	#fdec2s,d0
 714*   00 00DC  6000  00B4                                 	bra	call2
 715                                                        	c2,Dec2D,fdec2d
 716*                                                       	.globl Dec2D
 717*   00 00E0  303C  0809                                 Dec2D:	movw	#fdec2d,d0
 718*   00 00E4  6000  00AC                                 	bra	call2
 719                                                        	c2,Dec2C,fdec2c
 720*                                                       	.globl Dec2C
 721*   00 00E8  303C  3009                                 Dec2C:	movw	#fdec2c,d0
 722*   00 00EC  6000  00A4                                 	bra	call2
 723                                                        	c2,Dec2X,fdec2x
 724*                                                       	.globl Dec2X
 725*   00 00F0  303C  0009                                 Dec2X:	movw	#fdec2x,d0
 726*   00 00F4  6000  009C                                 	bra	call2
 727                                                        	c3,S2Dec,fs2dec
 728*                                                       	.globl S2Dec
 729*   00 00F8  303C  100B                                 S2Dec:	movw	#fs2dec,d0
 730*   00 00FC  6000  00A8                                 	bra	call3
 731                                                        	c3,D2Dec,fd2dec
 732*                                                       	.globl D2Dec
 733*   00 0100  303C  080B                                 D2Dec:	movw	#fd2dec,d0
 734*   00 0104  6000  00A0                                 	bra	call3
 735                                                        	c3,C2Dec,fc2dec
 736*                                                       	.globl C2Dec
 737*   00 0108  303C  300B                                 C2Dec:	movw	#fc2dec,d0
 738*   00 010C  6000  0098                                 	bra	call3
 739                                                        	c3,X2Dec,fx2dec
 740*                                                       	.globl X2Dec
 741*   00 0110  303C  000B                                 X2Dec:	movw	#fx2dec,d0
 742*   00 0114  6000  0090                                 	bra	call3
 743                                                        
 744                                                        	c1,SqrtX,fsqrtx
 745*                                                       	.globl SqrtX
 746*   00 0118  303C  0012                                 SqrtX:	movw	#fsqrtx,d0
 747*   00 011C  6000  006A                                 	bra	call1
 748                                                        	c1,RintX,frintx
 749*                                                       	.globl RintX
 750*   00 0120  303C  0014                                 RintX:	movw	#frintx,d0
 751*   00 0124  6000  0062                                 	bra	call1
 752                                                        	c1,NegX,fnegx
 753*                                                       	.globl NegX
 754*   00 0128  303C  000D                                 NegX:	movw	#fnegx,d0
 755*   00 012C  6000  005A                                 	bra	call1
 756                                                        	c1,AbsX,fabsx
 757*                                                       	.globl AbsX
 758*   00 0130  303C  000F                                 AbsX:	movw	#fabsx,d0
 759*   00 0134  6000  0052                                 	bra	call1
 760                                                        	c2,CpySgnX,fcpysgnx
 761*                                                       	.globl CpySgnX
 762*   00 0138  303C  0011                                 CpySgnX:	movw	#fcpysgnx,d0
 763*   00 013C  6000  0054                                 	bra	call2
 764                                                        	c2,ScalbX,fscalbx
 765*                                                       	.globl ScalbX
 766*   00 0140  303C  2018                                 ScalbX:	movw	#fscalbx,d0
 767*   00 0144  6000  004C                                 	bra	call2
 768                                                        	c1,LogbX,flogbx
 769*                                                       	.globl LogbX
 770*   00 0148  303C  001A                                 LogbX:	movw	#flogbx,d0
 771*   00 014C  6000  003A                                 	bra	call1
 772                                                        	c2,NextS,fnexts
 773*                                                       	.globl NextS
 774*   00 0150  303C  1013                                 NextS:	movw	#fnexts,d0
 775*   00 0154  6000  003C                                 	bra	call2
 776                                                        	c2,NextD,fnextd
 777*                                                       	.globl NextD
 778*   00 0158  303C  0813                                 NextD:	movw	#fnextd,d0
 779*   00 015C  6000  0034                                 	bra	call2
 780                                                        	c2,NextX,fnextx
 781*                                                       	.globl NextX
 782*   00 0160  303C  0013                                 NextX:	movw	#fnextx,d0
 783*   00 0164  6000  002C                                 	bra	call2
 784                                                        
 785                                                        	c1,SetEnv,fsetenv
 786*                                                       	.globl SetEnv
 787*   00 0168  303C  0001                                 SetEnv:	movw	#fsetenv,d0
 788*   00 016C  6000  001A                                 	bra	call1
 789                                                        	c1,GetEnv,fgetenv
 790*                                                       	.globl GetEnv
 791*   00 0170  303C  0003                                 GetEnv:	movw	#fgetenv,d0
 792*   00 0174  6000  0012                                 	bra	call1
 793                                                        	c1,ProcEntry,fprocentry
 794*                                                       	.globl ProcEntry
 795*   00 0178  303C  0017                                 ProcEntry:	movw	#fprocentry,d0
 796*   00 017C  6000  000A                                 	bra	call1
 797                                                        	c1,ProcExit,fprocexit
 798*                                                       	.globl ProcExit
 799*   00 0180  303C  0019                                 ProcExit:	movw	#fprocexit,d0
 800*   00 0184  6000  0002                                 	bra	call1
 801                                                        
 802    00 0188  205F                                       call1:	movl	sp@+,a0
 803    00 018A  3F00                                       	movw	d0,sp@-
 804    00 018C  A9EB                                       	.word	__fp68k
 805    00 018E  598F                                       	subql	#4,sp
 806    00 0190  4ED0                                       	jmp	a0@
 807                                                        
 808    00 0192  205F                                       call2:	movl	sp@+,a0
 809    00 0194  2217                                       	movl	sp@,d1
 810    00 0196  2EAF  0004                                 	movl	sp@(4),sp@
 811    00 019A  2F41  0004                                 	movl	d1,sp@(4)
 812    00 019E  3F00                                       	movw	d0,sp@-
 813    00 01A0  A9EB                                       	.word	__fp68k
 814    00 01A2  518F                                       	subql	#8,sp
 815    00 01A4  4ED0                                       	jmp	a0@
 816                                                        
 817    00 01A6  205F                                       call3:	movl	sp@+,a0
 818    00 01A8  2217                                       	movl	sp@,d1
 819    00 01AA  2EAF  0008                                 	movl	sp@(8),sp@
 820    00 01AE  2F41  0008                                 	movl	d1,sp@(8)
 821    00 01B2  3F00                                       	movw	d0,sp@-
 822    00 01B4  A9EB                                       	.word	__fp68k
 823    00 01B6  9EFC  000C                                 	subw	#12,sp
 824    00 01BA  4ED0                                       	jmp	a0@
 825                                                        
 826                                                        
 827                                                        
 828                                                                .globl    CmpX
 829    00 01BC                                             CmpX:
 830    00 01BC  205F                                               movl   sp@+,a0        | ret address
 831    00 01BE  222F  0004                                         movl    sp@(4),d1        | relop to be tested
 832    00 01C2  5201                                               addqb  #1,d1           | handy to increment
 833                                                        
 834    00 01C4  2017                                               movl    sp@,d0         | swap addresses (C already swapped)
 835    00 01C6  548F                                               addql  #2,sp           | kill slot for relop
 836    00 01C8  2E80                                       	movl	d0,sp@
 837                                                        
 838    00 01CA  0C01  0004                                         cmpb  #4,d1           | equal
 839    00 01CE  670E                                               beqs   .L1
 840    00 01D0  0C01  0008                                         cmpb  #8,d1           | unordered
 841    00 01D4  6708                                               beqs   .L1
 842                                                        
 843                                                                cfp fcpxx
 844*   00 01D6  3F3C  000A                                 	movw	#fcpxx,sp@-
 845*   00 01DA  A9EB                                       	.word	__fp68k
 846    00 01DC  6006                                               bras   .L10
 847    00 01DE                                             .L1:
 848                                                                cfp fcmpx
 849*   00 01DE  3F3C  0008                                 	movw	#fcmpx,sp@-
 850*   00 01E2  A9EB                                       	.word	__fp68k
 851    00 01E4                                             .L10:
 852                                                                fbne    .L12
 853*   00 01E4  6600  0008                                         bne     .L12
 854    00 01E8  0801  0002                                         btst    #2,d1           | #2 is equal bit
 855    00 01EC  6018                                               bras   .L50
 856    00 01EE                                             .L12:
 857                                                                fbo     .L14
 858*   00 01EE  6800  0008                                         bvc     .L14
 859    00 01F2  0801  0003                                         btst    #3,d1           | #3 is unordered bit
 860    00 01F6  600E                                               bras   .L50
 861    00 01F8                                             .L14:
 862                                                                fbgt    .L16
 863*   00 01F8  6E00  0008                                         bgt     .L16
 864    00 01FC  0801  0001                                         btst    #1,d1           | #1 is less bit
 865    00 0200  6004                                               bras   .L50
 866    00 0202                                             .L16:
 867    00 0202  0801  0000                                         btst    #0,d1           | #0 is greater bit
 868    00 0206                                             .L50:
 869    00 0206  4280                                       	clrl	d0
 870    00 0208  56C0                                               sne     d0
 871    00 020A  4400                                               negb   d0
 872    00 020C  9EFC  000C                                 	subw	#12,sp		| C wants to pop his own args
 873    00 0210  4ED0                                               jmp     a0@
 874                                                        
 875                                                        
 876                                                        
 877                                                                .globl    RelX
 878    00 0212                                             RelX:				| C args already swapped
 879    00 0212  205F                                               movl   sp@+,a0
 880                                                        
 881    00 0214  7207                                               moveq   #7,d1           | assume unordered
 882                                                                cfp fcmpx
 883*   00 0216  3F3C  0008                                 	movw	#fcmpx,sp@-
 884*   00 021A  A9EB                                       	.word	__fp68k
 885                                                                fbu     .L9              | unordered
 886*   00 021C  6900  0014                                         bvs     .L9
 887                                                                fbne    .L7
 888*   00 0220  6600  0006                                         bne     .L7
 889    00 0224  7203                                               moveq   #3,d1           | equal
 890    00 0226  600A                                               bras   .L9
 891    00 0228                                             .L7:
 892                                                                fbgt    .L3
 893*   00 0228  6E00  0006                                         bgt     .L3
 894    00 022C  7201                                               moveq   #1,d1           | less
 895    00 022E  6002                                               bras   .L9
 896    00 0230                                             .L3:
 897    00 0230  7200                                               moveq   #0,d1           | greater
 898    00 0232                                             .L9:
 899    00 0232  2001                                       	movl	d1,d0
 900    00 0234  9EFC  0008                                 	subw	#8,sp
 901    00 0238  4ED0                                               jmp     a0@
 902                                                        
 903                                                        
 904                                                                .globl    RemX
 905    00 023A                                             RemX:
 906    00 023A  205F                                               movl   sp@+,a0        | return address
 907    00 023C  226F  0008                                 	movl	sp@(8),a1	| addr of quotient
 908    00 0240  201F                                       	movl	sp@+,d0		| swap args
 909    00 0242  2F40  0004                                 	movl	d0,sp@(4)
 910                                                                cfp fremx                   | returns with quo in d0
 911*   00 0246  3F3C  000C                                 	movw	#fremx,sp@-
 912*   00 024A  A9EB                                       	.word	__fp68k
 913    00 024C  2280                                               movl    d0,a1@         | deliver integer result
 914    00 024E  9EFC  000C                                 	subw	#12,sp
 915    00 0252  4ED0                                               jmp     a0@
 916                                                        
 917                                                        
 918                                                        |-----------------------------------------------------------
 919                                                        | the class functions use a common startup routine to fetch
 920                                                        | the leading 32 bits and store the sign in its var param.
 921                                                        | a set of finishup sequences set the return value to the
 922                                                        | appropriate integer value.
 923                                                        |-----------------------------------------------------------
 924                                                        | pascal: function class?(var x: ???????; var sgn: integer):
 925                                                        |                                            numberclass
 926                                                        | stack = ret < sgn < x < result
 927                                                        |-----------------------------------------------------------
 928                                                        
 929                                                        	.macro	class,l,c
 930                                                        	.globl	l
 931                                                        l:	movw	#c,d0
 932                                                        	bras	classcom
 933                                                        	.endm
 934                                                        
 935                                                        	class,ClassS,fclasss
 936*                                                       	.globl	ClassS
 937*   00 0254  303C  101C                                 ClassS:	movw	#fclasss,d0
 938*   00 0258  6012                                       	bras	classcom
 939                                                        	class,ClassD,fclassd
 940*                                                       	.globl	ClassD
 941*   00 025A  303C  081C                                 ClassD:	movw	#fclassd,d0
 942*   00 025E  600C                                       	bras	classcom
 943                                                        	class,ClassC,fclassc
 944*                                                       	.globl	ClassC
 945*   00 0260  303C  301C                                 ClassC:	movw	#fclassc,d0
 946*   00 0264  6006                                       	bras	classcom
 947                                                        	class,ClassX,fclassx
 948*                                                       	.globl	ClassX
 949*   00 0266  303C  001C                                 ClassX:	movw	#fclassx,d0
 950*   00 026A  4E71                                       	bras	classcom
 951                                                        
 952    00 026C                                             classcom:
 953    00 026C  205F                                       	movl	sp@+,a0		| ret addrs
 954    00 026E  226F  0004                                 	movl	sp@(4),a1	| swap args and save sgn var
 955    00 0272  2F57  0004                                 	movl	sp@,sp@(4)
 956    00 0276  2E89                                       	movl	a1,sp@
 957    00 0278  3F00                                       	movw	d0,sp@-
 958    00 027A  A9EB                                       	.word	__fp68k
 959    00 027C  3011                                               movw    a1@,d0         | ret code
 960    00 027E  48C0                                       	extl	d0
 961    00 0280  4291                                               clrl   a1@            | 0 for +, 1 for -
 962    00 0282  4A40                                               tstw   d0
 963    00 0284  6A04                                               bpls   .L71
 964                                                        
 965    00 0286  5291                                               addql  #1,a1@
 966    00 0288  4480                                               negl   d0
 967    00 028A                                             .L71:
 968    00 028A  5380                                               subql  #1,d0
 969    00 028C  9EFC  0008                                 	subw	#8,sp		| C wants to pop his own stack
 970    00 0290  4ED0                                               jmp     a0@
 971                                                        
 972                                                        
 973                                                        
 974                                                        |-----------------------------------------------------------
 975                                                        |-----------------------------------------------------------
 976                                                        | the environment parameter is an integer passed by address
 977                                                        | for convenience in later routines, set/getenv leave a1
 978                                                        | unchanged but touch d0.
 979                                                        |-----------------------------------------------------------
 980                                                        |-----------------------------------------------------------
 981                                                        
 982                                                        	.globl	SetRnd
 983    00 0292                                             SetRnd:
 984    00 0292  225F                                               movl   sp@+,a1        | ret adrs
 985                                                        
 986    00 0294  2217                                               movl    sp@,d1         | new rnd mode
 987    00 0296  203C  0000  000D                           	movl	#13,d0
 988    00 029C  E1B9                                               roll   d0,d1           | align round bits
 989    00 029E  0281  0000  6000                                   andl  #/6000,d1       | mask just those
 990                                                        
 991    00 02A4  4857                                               pea     sp@            | overwrite input operand
 992                                                        	cfp	fgetenv
 993*   00 02A6  3F3C  0003                                 	movw	#fgetenv,sp@-
 994*   00 02AA  A9EB                                       	.word	__fp68k
 995    00 02AC  0257  9FFF                                         andw  #/9fff,sp@     | kill old mode
 996    00 02B0  8357                                               orw    d1,sp@         | new mode
 997    00 02B2  4857                                               pea     sp@
 998                                                        	cfp	fsetenv
 999*   00 02B4  3F3C  0001                                 	movw	#fsetenv,sp@-
1000*   00 02B8  A9EB                                       	.word	__fp68k
1001    00 02BA  4ED1                                               jmp     a1@
1002                                                        
1003                                                        
1004                                                        	.globl	GetRnd
1005    00 02BC                                             GetRnd:
1006    00 02BC  225F                                               movl   sp@+,a1
1007    00 02BE  4267                                       	clrw	sp@-
1008    00 02C0  4857                                               pea     sp@
1009                                                        	cfp	fgetenv
1010*   00 02C2  3F3C  0003                                 	movw	#fgetenv,sp@-
1011*   00 02C6  A9EB                                       	.word	__fp68k
1012                                                        
1013    00 02C8  203C  0000  6000                                   movl    #/6000,d0       | isolate round bits
1014    00 02CE  C05F                                               andw   sp@+,d0
1015    00 02D0  223C  0000  000D                           	movl	#13,d1
1016    00 02D6  E278                                               rorw   d1,d0           | in hi byte
1017    00 02D8  4ED1                                               jmp     a1@
1018                                                        
1019                                                        
1020                                                        |-----------------------------------------------------------
1021                                                        | pascal: procedure testxcp(x: exception): boolean;
1022                                                        | so stack = ret < x < result.   hi byte (0) is set of flags
1023                                                        | and low byte (1) is halts.
1024                                                        |-----------------------------------------------------------
1025                                                        
1026                                                        	.globl	TestXcp
1027    00 02DA                                             TestXcp:
1028    00 02DA  4281                                               clrl   d1
1029    00 02DC  6002                                               bras   gentest
1030                                                        	.globl	TestHlt
1031    00 02DE                                             TestHlt:
1032    00 02DE  7201                                               moveq   #1,d1
1033                                                        
1034    00 02E0                                             gentest:
1035    00 02E0  225F                                               movl   sp@+,a1        | ret adrs, safe from getenv
1036    00 02E2  2017                                       	movl	sp@,d0
1037    00 02E4  3F00                                       	movw	d0,sp@-
1038    00 02E6  486F  0002                                         pea     sp@(2)
1039                                                        	cfp	fgetenv
1040*   00 02EA  3F3C  0003                                 	movw	#fgetenv,sp@-
1041*   00 02EE  A9EB                                       	.word	__fp68k
1042    00 02F0  301F                                               movw    sp@+,d0        | bit index in hi byte
1043    00 02F2  4880                                               extw   d0              | make it word index
1044    00 02F4  0101                                               btst    d0,sp@(0,d1)
1045    00 02F6  56C0                                               sne     d0              | d0 = 0000 or 00ff
1046    00 02F8  4400                                               negb   d0              | d0 = 0000 or ffff
1047                                                        
1048    00 02FA  4ED1                                               jmp     a1@
1049                                                        
1050                                                        |-----------------------------------------------------------
1051                                                        | pascal: procedure setxcp(x: exception; onoff: boolean);
1052                                                        | stack = ret < onoff < x
1053                                                        | this procedure was originally set up to just set or clear
1054                                                        | bits in the control word.  nowadays, setting an exception
1055                                                        | flag entails a possible halt, so a special dummy floating
1056                                                        | point routine is used.
1057                                                        |-----------------------------------------------------------
1058                                                        	.globl	SetXcp,SetHlt
1059    00 02FC  4E56  0000                                 SetXcp:	link	a6,#0
1060    00 0300  202E  0008                                 	movl	a6@(8),d0
1061    00 0304  1F00                                       	movb	d0,sp@-
1062    00 0306  202E  000C                                 	movl	a6@(12),d0
1063    00 030A  1F00                                       	movb	d0,sp@-
1064    00 030C  611A                                       	bsrs	sxcp
1065    00 030E  4E5E                                       	unlk	a6
1066    00 0310  4E75                                       	rts
1067                                                        
1068    00 0312  4E56  0000                                 SetHlt:	link	a6,#0
1069    00 0316  202E  0008                                 	movl	a6@(8),d0
1070    00 031A  1F00                                       	movb	d0,sp@-
1071    00 031C  202E  000C                                 	movl	a6@(12),d0
1072    00 0320  1F00                                       	movb	d0,sp@-
1073    00 0322  6124                                       	bsrs	shlt
1074    00 0324  4E5E                                       	unlk	a6
1075    00 0326  4E75                                       	rts
1076                                                        
1077    00 0328                                             sxcp:
1078    00 0328  4A2F  0004                                         tstb   sp@(4)           | check boolean
1079    00 032C  6716                                               beqs   clrxcp
1080                                                        
1081    00 032E  205F                                               movl   sp@+,a0        | save return address
1082    00 0330  548F                                               addql  #2,sp           | kill boolean
1083    00 0332  1017                                               movb    sp@,d0         | get error index
1084    00 0334  4880                                               extw   d0              | extend to word
1085    00 0336  3E80                                               movw    d0,sp@         | replace as word
1086    00 0338  4857                                               pea     sp@            | save address
1087                                                        	cfp	fsetxcp
1088*   00 033A  3F3C  0015                                 	movw	#fsetxcp,sp@-
1089*   00 033E  A9EB                                       	.word	__fp68k
1090    00 0340  548F                                               addql  #2,sp           | kill index word
1091    00 0342  4ED0                                               jmp     a0@
1092                                                        
1093    00 0344                                             clrxcp:
1094    00 0344  4241                                               clrw   d1
1095    00 0346  6002                                               bras   gensetx
1096    00 0348                                             shlt:
1097    00 0348  7201                                               moveq   #1,d1
1098    00 034A                                             gensetx:
1099    00 034A  2257                                               movl   sp@,a1         | ret address, leave slot
1100                                                        
1101    00 034C  4857                                               pea     sp@		
1102                                                        	cfp	fgetenv
1103*   00 034E  3F3C  0003                                 	movw	#fgetenv,sp@-
1104*   00 0352  A9EB                                       	.word	__fp68k
1105    00 0354  102F  0006                                         movb    sp@(6),d0        | bit index in hi byte
1106    00 0358  4880                                               extw   d0              | make it word index
1107                                                        
1108    00 035A  4A2F  0004                                         tstb   sp@(4)           | test input boolean
1109    00 035E  6604                                               bnes   .L81
1110                                                        
1111    00 0360  0181                                               bclr    d0,sp@(0,d1)
1112    00 0362  6002                                               bras   .L83
1113    00 0364                                             .L81:
1114    00 0364  01C1                                               bset    d0,sp@(0,d1)
1115    00 0366                                             .L83:
1116    00 0366  4857                                               pea     sp@
1117                                                        	cfp	fsetenv
1118*   00 0368  3F3C  0001                                 	movw	#fsetenv,sp@-
1119*   00 036C  A9EB                                       	.word	__fp68k
1120                                                        
1121    00 036E  508F                                               addql  #8,sp           | kill ret and inputs
1122    00 0370  4ED1                                               jmp     a1@
1123    00 0372                                             .end
                       	unlk	a6
1075    00 0326  4E75                                       	rts
1076                                                        
1077    00 sumacc/lib/insane.s   444      0     12      133470  3470501364   7562 |	insane.s
|
|	Pascal to assembler conversion of dec2str/str2dec (sanescan).
|
|	This is an insane way to do this.  Much better would be to have
|	sanescan part of the fp68k or elems "package" so that us C programmers
|	could call it via simple traps.   --bc
|
|
| {^ne 18 }
|         {-----------------------------------------------------------------
|         ** conversions between the numeric types and strings.
|         ** { (these conversions have a built-in scanner/parser to convert
|         ** between the intermediate decimal type and a string.)
|         -----------------------------------------------------------------}
|
|         {$i mc/sanescan.text}
| {*
| ** 01sep82: written by jerome coonen.
| ** 18jan83: infs as ++++/---- and nans with hexits. (jtc)
| *}
|
| {*
| ** format an input decimal record, according to input format
| ** structure, and write to string.  see sane pascal interface
| ** document for an explanation of the data types.
| *}
| procedure dec2str(var df: decform; var d: decimal; var s: decstr);
|
| var
|     i      : integer;
|     ds, es : decstr;
|
|
|
|     {*
|     ** convert an integer to a signed decimal string, for printing
|     ** exponents.
|     *}
|     procedure int2str(ie: integer; var is: decstr);
|     var
|         i: integer;
|         s1 : string[1];
|
|     begin
|
		.text
int2str:
|
|
         tstw   a7@(-4182)       | /efaa
         link    a6,#-86         | /ffaa
         movl    d7,a7@-
|         i := ie;    {make integer local}
         movw    a6@(16),d7       | /0010
|         if i < 0 then
         tstw   d7
         bges   .+8             | /0008
|             i := -i;
         movl    d7,d0
         negw   d0
         movw    d0,d7
|         s1 := '1';
         movw    #305,a6@(-4)     | /0131, /fffc
|
|         s1[1] := chr(ord('0') + (i mod 10));
         moveq   #1,d0           | /01
         movl    d7,d1
         extl   d1
         divs    #10,d1          | /000a
         swap    d1
         tstw   d1
         addw   #48,d1          | /0030
         .word	/4e71,/4e71
         movb    d1,a6@(-4,d0:w) | /fc
|         is := s1;
         movl    a6@(12),a0       | /000c
         movw    a6@(-4),a0@     | /fffc
|         i := i div 10;
         movl    d7,d0
         extl   d0
         divs    #10,d0          | /000a
         movw    d0,d7
|         while i <> 0 do
         tstw   d7
         beqs   .+56            | /0038
|         begin
|             s1[1] := chr(ord('0') + (i mod 10));
         moveq   #1,d0           | /01
         movl    d7,d1
         extl   d1
         divs    #10,d1          | /000a
         swap    d1
         tstw   d1
         addw   #48,d1          | /0030
         .word	/4e71,/4e71
         movb    d1,a6@(-4,d0:w) | /fc
|             insert(s1, is, 1);
         pea     a6@(-4)          | /fffc
         movl    a6@(12),a7@-    | /000c
         movw    #1,a7@-        | /0001
         bsr     _ins
|             i := i div 10
         movl    d7,d0
         extl   d0
         divs    #10,d0          | /000a
         movw    d0,d7
         bras   .-56            | /0038
|         end;
|
|         if ie < 0 then is := concat('-', is)
         tstw   a6@(16)          | /0010
         bges   .+44            | /002c
         movl    a6@(12),a0       | /000c
         movl    a0,a7@-
         pea pc@(58-2)            | /003a
         movl    a6@(12),a7@-    | /000c
         pea     a6@(-86)         | /ffaa
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-86),a1      | /ffaa
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         movl    a7@+,d7
         unlk    a6
         movl    a7@+,a0
         addw  #10,a7          | /000a
         jmp     a0@
|
         .word   /c94e,/5432,/5354,/5220  | ".nt2str "
         .word   /0002,/012d              | "...-"
|     end;
|
|
|
| begin  { dec2str }
|     {*
|     ** cases 0, infinity, and nan are treated separately.
|     ** in any case, a lead sign or space is printed.
|     *}
|
		.text
		.globl	_dec2str
_dec2str:
|
|
         tstw   a7@(-5462)       | /eaaa
         link    a6,#-1370       | /faa6
         moveml #/118,a7@-
         movl    a6@(12),a4       | /000c
         movl    a6@(16),a3       | /0010
|     if dsgn <> 0 then
         tstb   a4@
         beqs   .+12            | /000c
|         s := '-'
         movl    a6@(8),a0        | /0008
         movw    #301,a0@       | /012d
         bras   .+10            | /000a
|     else
|         s := ' ';
         movl    a6@(8),a0        | /0008
         movw    #288,a0@       | /0120
|
|     {*
|     ** if it is a nonzero, finite number, place a decimal
|     ** point after the lead digit and print the exponent field.
|     ** exponent must be adjusted to align point after lead digit.
|     ** the special cases are handled trivially.
|     *}
|
|     case dsig[1] of
         moveq   #1,d0           | /01
         movb    a4@(4,d0:w),d1   | /04
         andw  #255,d1         | /00ff
         subw  #48,d1          | /0030
         beqs   .+24            | /0018
         subw  #15,d1          | /000f
         beq     .+352           | /0160
         subw  #10,d1          | /000a
         beqs   .+56            | /0038
         subqw  #5,d1           | /5
         beqs   .+86            | /0056
         bra     .+384           | /0180
|
|     '0':
|         s := concat(s, '0.0');
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea pc@(984-2)           | /03d8
         pea     a6@(-250)        | /ff06
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-250),a1     | /ff06
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         bra     .+888           | /0378
|
|     'i':
|         if dsgn <> 0 then
         tstb   a4@
         beqs   .+16            | /0010
|             s := '----'
         movl    a6@(8),a0        | /0008
         lea pc@(934-2),a1        | /03a6
         movl    a1@+,a0@+
         movw    a1@,a0@
         bras   .+14            | /000e
|         else
|             s := '++++';
         movl    a6@(8),a0        | /0008
         lea pc@(914-2),a1        | /0392
         movl    a1@+,a0@+
         movw    a1@,a0@
         bra     .+854           | /0356
|
|     'n':
|         {*
|         ** insert the hexits from dsig and insert a colon
|         ** after the leading four.
|         *}
|         begin
|             { dsig has form nzzz...z with up to 16 hexits }
|             s := concat(s, 'nan''', copy(dsig, 2, (length(d.sig) - 1)), '''');
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea pc@(886-2)           | /0376
         movl    a0,a7@-
         pea     a4@(4)           | /0004
         movw    #2,a7@-        | /0002
         movb    a4@(4),d0        | /0004
         andw  #255,d0         | /00ff
         subqw  #1,d0           | /1
         movw    d0,a7@-
         pea     a6@(-272)        | /fef0
         bsr     _copy
         movl    a7@+,a0
         pea     a6@(-272)        | /fef0
         pea pc@(844-2)           | /034c
         pea     a6@(-378)        | /fe86
         movw    #4,a7@-        | /0004
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-378),a1     | /fe86
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
|             { s has form *nan'zzz...z' where * is - or blank }
|
|             { delete trailing 0's, up to lead 9 chars: *nan'zzzz }
|             i := length(s) - 1;  { ignore the ' ending s }
         movl    a6@(8),a0        | /0008
         movb    a0@,d0
         andw  #255,d0         | /00ff
         subqw  #1,d0           | /1
         movw    d0,d7
|             while (s[i] = '0') and (i > 9) do
         movl    a6@(8),a0        | /0008
         .word	/4e71,/4e71
         movb    a0@(0,d7:w),d0   | /00
         andw  #255,d0         | /00ff
         cmpw  #48,d0          | /0030
         seq     d0
         cmpw  #9,d7           | /0009
         sgt     d1
         andb   d1,d0
         beqs   .+6             | /0006
|                 i := i - 1;
         subqw  #1,d7           | /1
         bras   .-34            | /0022
|             delete(s, (i + 1), (length(s) - i - 1));
         movl    a6@(8),a7@-     | /0008
         movl    d7,d0
         addqw  #1,d0           | /1
         movw    d0,a7@-
         movl    a6@(8),a0        | /0008
         movb    a0@,d0
         andw  #255,d0         | /00ff
         subw   d7,d0
         subqw  #1,d0           | /1
         movw    d0,a7@-
         bsr     _del
|
|             { addw a : if any more than 4 hexits left: *nan'zzzz???'  }
|             if length(s) > 10 then
         movl    a6@(8),a0        | /0008
         movb    a0@,d0
         andw  #255,d0         | /00ff
         cmpw  #10,d0          | /000a
         bles   .+18            | /0012
|                 insert(':', s, 10);
         pea pc@(714-2)           | /02ca
         movl    a6@(8),a7@-     | /0008
         movw    #10,a7@-       | /000a
         bsr     _ins
|
|             { delete up to 3 leading 0's }
|             i := 6;
         moveq   #6,d7           | /06
|             while (s[i] = '0') and (i < 9) do
         movl    a6@(8),a0        | /0008
         .word	/4e71,/4e71
         movb    a0@(0,d7:w),d0   | /00
         andw  #255,d0         | /00ff
         cmpw  #48,d0          | /0030
         seq     d0
         cmpw  #9,d7           | /0009
         slt     d1
         andb   d1,d0
         beqs   .+6             | /0006
|                 i := i + 1;
         addqw  #1,d7           | /1
         bras   .-34            | /0022
|             delete(s, 6, (i - 6))
|         end;
         movl    a6@(8),a7@-     | /0008
         movw    #6,a7@-        | /0006
         movl    d7,d0
         subqw  #6,d0           | /6
         movw    d0,a7@-
         bsr     _del
         bra     .+600           | /0258
|
|     '?':
|         s := concat(s, '???.???');
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea pc@(620-2)           | /026c
         pea     a6@(-466)        | /fe2e
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-466),a1     | /fe2e
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         bra     .+554           | /022a
|
|     otherwise
|         if dfstyle = floatdecimal then
         tstb   a3@
         bne     .+136           | /0088
|         begin
|             ds := copy(dsig, 1, df.digits);
         pea     a4@(4)           | /0004
         movw    #1,a7@-        | /0001
         movw    a3@(2),a7@-     | /0002
         pea     a6@(-488)        | /fe18
         bsr     _copy
         lea     a6@(-166),a0     | /ff5a
         lea     a6@(-488),a1     | /fe18
         moveq   #5,d0           | /05
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
|             i := d.exp + df.digits - 1;
         movw    a3@(2),d0        | /0002
         addw   a4@(2),d0        | /0002
         subqw  #1,d0           | /1
         movw    d0,d7
|             insert('.', ds, 2);
         pea pc@(524-2)           | /020c
         pea     a6@(-166)        | /ff5a
         movw    #2,a7@-        | /0002
         bsr     _ins
|             int2str(i, es);
         movw    d7,a7@-
         pea     a6@(-84)         | /ffac
         movl    a6,a7@-
         bsr     int2str
|             s := concat(s, ds, 'e', es)
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea     a6@(-166)        | /ff5a
         pea pc@(484-2)           | /01e4
         pea     a6@(-84)         | /ffac
         pea     a6@(-730)        | /fd26
         movw    #4,a7@-        | /0004
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-730),a1     | /fd26
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         bra     .+416           | /01a0
|         end
|         else
|         begin
|             {*
|             ** if it is a finite number, place a decimal
|             ** point after the lead digit and print the exponent field.
|             ** exponent must be adjusted to align point after lead digit.
|             ** three cases are handled, respectively:
|             **      xxxxxxxxx000..000.  (may be no zeros left of '.')
|             **      xxxxx.xxxxx
|             **      0.0000...000xxxxxxx (may be no zeros right of '.')
|             *}
|             if d.exp >= 0 then
         tstw   a4@(2)           | /0002
         blt     .+154           | /009a
|             begin
|                 s := concat(s, dsig);
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea     a4@(4)           | /0004
         pea     a6@(-832)        | /fcc0
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-832),a1     | /fcc0
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
|                 for i := 1 to d.exp do
         movw    a4@(2),a6@(-1368) | /0002, /faa8
         moveq   #1,d7           | /01
         bras   .+48            | /0030
|                     s := concat(s, '0');
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea pc@(366-2)           | /016e
         pea     a6@(-914)        | /fc6e
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-914),a1     | /fc6e
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         addqw  #1,d7           | /1
         bvss   .+8             | /0008
         cmpw   a6@(-1368),d7    | /faa8
         bles   .-50            | /0032
|                 s := concat(s, '.')
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea pc@(320-2)           | /0140
         pea     a6@(-996)        | /fc1c
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-996),a1     | /fc1c
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         bra     .+258           | /0102
|             end
|             else if (-d.exp) < length(dsig) then
         movw    a4@(2),d0        | /0002
         negw   d0
         movb    a4@(4),d1        | /0004
         andw  #255,d1         | /00ff
         cmpw   d0,d1
         bles   .+78            | /004e
|             begin
|                 insert('.', dsig, (length(d.sig) + d.exp + 1));
         pea pc@(266-2)           | /010a
         pea     a4@(4)           | /0004
         movb    a4@(4),d0        | /0004
         andw  #255,d0         | /00ff
         movw    a4@(2),d1        | /0002
         addw   d0,d1
         addqw  #1,d1           | /1
         movw    d1,a7@-
         bsr     _ins
|                 s := concat(s, dsig)
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea     a4@(4)           | /0004
         pea     a6@(-1098)       | /fbb6
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-1098),a1    | /fbb6
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         bra     .+164           | /00a4
|             end
|             else
|             begin
|                 s := concat(s, '0.');
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea pc@(176-2)           | /00b0
         pea     a6@(-1182)       | /fb62
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-1182),a1    | /fb62
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
|                 for i := 1 to -(length(dsig) + d.exp) do
         movb    a4@(4),d0        | /0004
         andw  #255,d0         | /00ff
         movw    a4@(2),d1        | /0002
         addw   d0,d1
         negw   d1
         movw    d1,a6@(-1370)    | /faa6
         moveq   #1,d7           | /01
         bras   .+48            | /0030
|                     s := concat(s, '0');
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea pc@(108-2)           | /006c
         pea     a6@(-1264)       | /fb10
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-1264),a1    | /fb10
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         addqw  #1,d7           | /1
         bvss   .+8             | /0008
         cmpw   a6@(-1370),d7    | /faa6
         bles   .-50            | /0032
|                 s := concat(s, dsig)
         movl    a6@(8),a0        | /0008
         movl    a0,a7@-
         movl    a6@(8),a7@-     | /0008
         pea     a4@(4)           | /0004
         pea     a6@(-1366)       | /faaa
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a7@+,a0
         lea     a6@(-1366),a1    | /faaa
         moveq   #20,d0          | /14
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
|             end
|         end
|     end
         moveml a7@+,#/1880
         unlk    a6
         movl    a7@+,a0
         addw  #12,a7          | /000c
         jmp     a0@
|
         .word   /c445,/4332,/5354,/5220  | ".ec2str "
         .word   /002c,/0130,/0230,/2e00  | ".,.0.0.."
         .word   /012e,/0145,/073f,/3f3f  | "...e.???"
         .word   /2e3f,/3f3f,/013a,/0127  | ".???.:.'"
         .word   /044e,/414e,/2700,/042b  | ".nan'..+"
         .word   /2b2b,/2b00,/042d,/2d2d  | "+++..---"
         .word   /2d00,/0330,/2e30        | "-..0.0"
| end;
|
|
|
|
| {*
| ** receive characters from "input stream" via character
| ** function nextc, which returns chr(0) = null when the
| ** string is exhausted.
| **
| ** the value the decimal structure represents is as
| ** follows (^ means exponentiation):
| **
| **      -1@^sgn * 10^exp * sig
| **
| ** the implied decimal point in the sig string is at the
| ** right-hand side.  infinities are read as strings of
| ** sign characters, + or -.  nans are strings of the form
| **      nan'xxxx:yyy...y'
| ** if there is a y-field, then the x-field is 0-padded on
| ** the left to width 4.  the colon is dropped from the string
| ** in dsig.
| *}
| procedure str2dec(s: decstr; var d: decimal);
| var
|     expadj, expmul, expmag, sigcnt, strindex, i : integer;
|     nc : char;          {input char buffer}
|     guard : boolean;    {for lost sig- and exp-digits}
|     ss : string[1];     {for character concatenations}
|
|
|     {*
|     ** get the next input character and increment string
|     ** index.  return null if string exhausted.
|     *}
|     function nextc: char;
|     begin
|
		.text
nextc:
         tstw   a7@(-4096)       | /f000
         link    a6,#0           | /0000
         movl    a4,a7@-
         movl    a6@(8),a4        | /0008
|         if strindex <= length(s) then
         movb    a4@(-82),d0      | /ffae
         andw  #255,d0         | /00ff
         cmpw   a4@(-86),d0      | /ffaa
         blts   .+28            | /001c
|         begin
|             nextc := s[strindex];
         movw    a4@(-86),d0      | /ffaa
         .word	/4e71,/4e71
         movb    a4@(-82,d0:w),d1 | /ae
         andw  #255,d1         | /00ff
         movw    d1,a6@(12)       | /000c
|             strindex := strindex + 1
         addqw  #1,a4@(-86)      | /1, /ffaa
         bras   .+12            | /000c
|         end
|         else
|             nextc := chr(0)
         moveq   #0,d0           | /00
         .word	/4e71,/4e71
         movw    d0,a6@(12)       | /000c
         movl    a7@+,a4
         unlk    a6
         movl    a7@+,a7@
         rts
|
         .word   /ce45,/5854,/4320,/2020  | ".extc   "
         .word   /0000                    | ".."
|     end;
|
|
| begin
|
		.text
		.globl	_str2dec
_str2dec:
|
|
         tstw   a7@(-4448)       | /eea0
         link    a6,#-352        | /fea0
         moveml #/f08,a7@-
         movl    a6@(12),a0       | /000c
         lea     a6@(-82),a1      | /ffae
         tstb   a0@
         moveq   #20,d0          | /14
         movl    a0@+,a1@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a0@,a1@
         movl    a6@(8),a4        | /0008
|     dsgn  := 0;        {assume positive}
         clrb   a4@
|     d.exp  := 0;        {default exponent}
         clrw   a4@(2)           | /0002
|     dsig  := '';       {default digit string is empty}
         clrb   a4@(4)           | /0004
|     guard  := false;    {nothing lost yet}
         clrb   d6
|
|     expadj := 0;        {loc of '.', relative to right digit}
         clrw   a6@(-94)         | /ffa2
|     expmul := 1;        {+1 or -1, depending on sign of exp}
         movw    #1,a6@(-92)      | /0001, /ffa4
|     expmag := 0;        {magnitude of exponent}
         clrw   a6@(-90)         | /ffa6
|
|     sigcnt := 0;        {number of digits seen so far}
         clrw   d4
|
|     ss     := '0';      {dummy 1-elt string}
         movw    #304,a6@(-100)   | /0130, /ff9c
|
|     strindex    := 1;        {beginning of string}
         movw    #1,a6@(-86)      | /0001, /ffaa
|
|     nc     := nextc;    {get first character}
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
|
|     {*
|     ** skip leading blanks and tabs (ascii 9).
|     *}
|     while (nc = ' ') or (nc = 9)@(chr) do
         cmpw  #32,d7          | /0020
         seq     d0
         moveq   #9,d1           | /09
         .word	/4e71,/4e71
         cmpw   d7,d1
         seq     d1
         orb    d1,d0
         beqs   .+14            | /000e
|         nc := nextc;
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
         bras   .-30            | /001e
|
|     {*
|     ** process sign, if any.
|     *}
|     if nc = '+' then
         cmpw  #43,d7          | /002b
         bnes   .+14            | /000e
|         nc := nextc
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
         bras   .+22            | /0016
|     else if nc = '-' then
         cmpw  #45,d7          | /002d
         bnes   .+16            | /0010
|     begin
|         dsgn := 1;  {mark negative}
         movb    #1,a4@         | /0001
|         nc := nextc
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
|     end;
|
|     {*
|     ** check for infinity, repeated sign.
|     *}
|     if ((nc = '+') and (dsgn = 0)) or ((nc = '-') and (d.sgn = 1)) then
         cmpw  #43,d7          | /002b
         seq     d0
         tstb   a4@
         seq     d1
         andb   d1,d0
         cmpw  #45,d7          | /002d
         seq     d1
         cmpb  #1,a4@         | /0001
         seq     d2
         andb   d2,d1
         orb    d1,d0
         beqs   .+12            | /000c
|         dsig := 'i'
         movw    #329,a4@(4)      | /0149, /0004
         bra     .+956           | /03bc
|
|     {*
|     ** check for 'nan''...''' or 'nan''...''', with a
|     ** hex significant digit field.
|     *}
|     else if (nc = 'n') or (nc = 'n') then
         cmpw  #78,d7          | /004e
         seq     d0
         cmpw  #110,d7         | /006e
         seq     d1
         orb    d1,d0
         beq     .+182           | /00b6
|     begin
|         { check whether more than following an'' }
|         if strindex > (length(s) - 4) then
         movb    a6@(-82),d0      | /ffae
         andw  #255,d0         | /00ff
         subqw  #4,d0           | /4
         cmpw   a6@(-86),d0      | /ffaa
         bges   .+18            | /0012
|             { if not, default to 0, to be replaced in dec2z }
|             dsig := 'n0000'
         movl    a4,a0
         addql  #4,a0           | /4
         lea pc@(942-2),a1        | /03ae
         movl    a1@+,a0@+
         movw    a1@,a0@
         bra     .+146           | /0092
|         else
|         begin
|             { copy up to 17 chars xxxx:yyyyyy... part to sig, after n }
|             i := length(s) - strindex - 3;
         movb    a6@(-82),d0      | /ffae
         andw  #255,d0         | /00ff
         subw   a6@(-86),d0      | /ffaa
         subqw  #3,d0           | /3
         movw    d0,d5
|             if i > 17 then
         cmpw  #17,d5          | /0011
         bles   .+4             | /0004
|                 i := 17;
         moveq   #17,d5          | /11
|             dsig := concat('n', copy(s, (strindex + 3), i));
         pea pc@(904-2)           | /0388
         pea     a6@(-82)         | /ffae
         movw    a6@(-86),d0      | /ffaa
         addqw  #3,d0           | /3
         movw    d0,a7@-
         movw    d5,a7@-
         pea     a6@(-182)        | /ff4a
         bsr     _copy
         pea     a6@(-182)        | /ff4a
         pea     a6@(-264)        | /fef8
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a4,a0
         addql  #4,a0           | /4
         lea     a6@(-264),a1     | /fef8
         moveq   #5,d0           | /05
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
|             { if there's a colon, force 4 lead digits }
|             i := pos(':', dsig);
         pea pc@(842-2)           | /034a
         pea     a4@(4)           | /0004
         bsr     _pos
         movw    a7@+,d5
|             if i > 0 then
         tstw   d5
         bles   .+42            | /002a
|             begin
|                 delete(dsig, i, 1);
         pea     a4@(4)           | /0004
         movw    d5,a7@-
         movw    #1,a7@-        | /0001
         bsr     _del
|                 while i < 6 do
         cmpw  #6,d5           | /0006
         bges   .+22            | /0016
|                 begin
|                     insert('0', dsig, 2);
         pea pc@(802-2)           | /0322
         pea     a4@(4)           | /0004
         movw    #2,a7@-        | /0002
         bsr     _ins
|                     i := i + 1
         addqw  #1,d5           | /1
         bras   .-24            | /0018
         bra     .+760           | /02f8
|                 end
|             end
|         end
|     end
|
|     {*
|     ** at last, it might be a number.  skip over leading zeros,
|     ** accept significant digits and discard extras with rounding
|     ** information saved in a system-dependent way.
|     ** mac: take sigdiglen-1 digits and append a '1' of nonzero
|     **          digits are lost.
|     ** iii: take sigdiglen digits and increment last (even if 9)
|     **          if nonzero digits are lost.
|     ** take care that discarded digits have appropriate effect on
|     ** exponent.
|     *}
|     else
|     begin
|
|         {*
|         ** if lead 0's are skipped, mark number tentatively as 0
|         *}
|         while nc = '0' do
         cmpw  #48,d7          | /0030
         bnes   .+20            | /0014
|         begin
|             nc := nextc;
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
|             dsig := '0'
         movw    #304,a4@(4)      | /0130, /0004
         bras   .-22            | /0016
|         end;
|
|         {*
|         ** beyond the leading 0's there may be: an honest
|         ** digit 1-9; a decimal point, possibly followed by
|         ** more 0's; or an exponent field, in which case the
|         ** result is zero.
|         *}
|         if (ord('1') <= nc@(ord)) and (nc@(ord) <= ord('9')) then
         cmpw  #49,d7          | /0031
         sge     d0
         cmpw  #57,d7          | /0039
         sle     d1
         andb   d1,d0
         beq     .+244           | /00f4
|         begin
|             sigcnt := 1;        {first sig digit}
         moveq   #1,d4           | /01
|             dsig := '0';       {make slot for nc}
         movw    #304,a4@(4)      | /0130, /0004
|             dsig[1] := nc;     {stuff nc}
         moveq   #1,d0           | /01
         movb    d7,a4@(4,d0:w)   | /04
|             nc := nextc;
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
|
|             while (ord('0') <= nc@(ord)) and (nc@(ord) <= ord('9')) do
         cmpw  #48,d7          | /0030
         sge     d0
         cmpw  #57,d7          | /0039
         sle     d1
         andb   d1,d0
         beqs   .+84            | /0054
|             begin
|                 {*
|                 ** mac vs iii difference in count:
|                 **      mac -- sigdiglen-1
|                 **      iii -- sigdiglen
|                 *}
|                 if (sigcnt < (sigdiglen-1)) then
         cmpw  #19,d4          | /0013
         bges   .+50            | /0032
|                 begin
|                     sigcnt := sigcnt + 1;
         addqw  #1,d4           | /1
|                     ss[1] := nc;
         moveq   #1,d0           | /01
         movb    d7,a6@(-100,d0:w) | /9c
|                     dsig := concat(d.sig, ss)
         pea     a4@(4)           | /0004
         pea     a6@(-100)        | /ff9c
         pea     a6@(-286)        | /fee2
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a4,a0
         addql  #4,a0           | /4
         lea     a6@(-286),a1     | /fee2
         moveq   #5,d0           | /05
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         bras   .+18            | /0012
|                 end
|                 else
|                 begin
|                     expadj := expadj + 1;
         addqw  #1,a6@(-94)      | /1, /ffa2
|                     guard := guard or (nc <> '0')
         cmpw  #48,d7          | /0030
         sne     d0
         orb    d0,d6
         andw  #1,d6           | /0001
|                 end;
|                 nc := nextc
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
         bras   .-96            | /0060
|             end;
|
|             {*
|             ** now the fraction part of the field may begin.
|             *}
|             if nc = '.' then
         cmpw  #46,d7          | /002e
         bnes   .+110           | /006e
|             begin
|                 nc := nextc;
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
|
|                 while (ord('0') <= nc@(ord)) and (nc@(ord) <= ord('9')) do
         cmpw  #48,d7          | /0030
         sge     d0
         cmpw  #57,d7          | /0039
         sle     d1
         andb   d1,d0
         beqs   .+84            | /0054
|                 begin
|                     if (sigcnt < (sigdiglen-1)) then
         cmpw  #19,d4          | /0013
         bges   .+54            | /0036
|                     begin
|                         sigcnt := sigcnt + 1;
         addqw  #1,d4           | /1
|                         expadj := expadj - 1;
         subqw  #1,a6@(-94)      | /1, /ffa2
|                         ss[1] := nc;
         moveq   #1,d0           | /01
         movb    d7,a6@(-100,d0:w) | /9c
|                         dsig := concat(d.sig, ss)
         pea     a4@(4)           | /0004
         pea     a6@(-100)        | /ff9c
         pea     a6@(-308)        | /fecc
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a4,a0
         addql  #4,a0           | /4
         lea     a6@(-308),a1     | /fecc
         moveq   #5,d0           | /05
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         bras   .+14            | /000e
|                     end
|                     else
|                         guard := guard or (nc <> '0');
         cmpw  #48,d7          | /0030
         sne     d0
         orb    d0,d6
         andw  #1,d6           | /0001
|                     nc := nextc
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
         bras   .-96            | /0060
         bra     .+168           | /00a8
|                 end
|             end
|         end
|
|         {*
|         ** in this case, we are still bypassing leading 0's
|         ** when the decimal point is found.
|         *}
|         else if nc = '.' then
         cmpw  #46,d7          | /002e
         bne     .+160           | /00a0
|         begin
|             nc := nextc;        {get following digit}
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
|
|             while nc = '0' do
         cmpw  #48,d7          | /0030
         bnes   .+24            | /0018
|             begin
|                 expadj := expadj - 1;
         subqw  #1,a6@(-94)      | /1, /ffa2
|                 dsig  := '0';
         movw    #304,a4@(4)      | /0130, /0004
|                 nc := nextc
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
         bras   .-26            | /001a
|             end;
|
|             if (ord('1') <= nc@(ord)) and (nc@(ord) <= ord('9')) then
         cmpw  #49,d7          | /0031
         sge     d0
         cmpw  #57,d7          | /0039
         sle     d1
         andb   d1,d0
         beqs   .+6             | /0006
|                 dsig := '';    {kill any zero string already found}
         clrb   a4@(4)           | /0004
|
|             while (ord('0') <= nc@(ord)) and (nc@(ord) <= ord('9')) do
         cmpw  #48,d7          | /0030
         sge     d0
         cmpw  #57,d7          | /0039
         sle     d1
         andb   d1,d0
         beqs   .+84            | /0054
|             begin
|                 if sigcnt < (sigdiglen-1) then
         cmpw  #19,d4          | /0013
         bges   .+54            | /0036
|                 begin
|                     expadj := expadj - 1;
         subqw  #1,a6@(-94)      | /1, /ffa2
|                     sigcnt := sigcnt + 1;
         addqw  #1,d4           | /1
|                     ss[1] := nc;
         moveq   #1,d0           | /01
         movb    d7,a6@(-100,d0:w) | /9c
|                     dsig := concat(d.sig, ss)
         pea     a4@(4)           | /0004
         pea     a6@(-100)        | /ff9c
         pea     a6@(-330)        | /feb6
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a4,a0
         addql  #4,a0           | /4
         lea     a6@(-330),a1     | /feb6
         moveq   #5,d0           | /05
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         bras   .+14            | /000e
|                 end
|                 else
|                     guard := guard or (nc <> '0');
         cmpw  #48,d7          | /0030
         sne     d0
         orb    d0,d6
         andw  #1,d6           | /0001
|                 nc := nextc
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
         bras   .-96            | /0060
|             end
|         end;
|
|         {*
|         ** if no legitimate digits, force nan and go through
|         ** the motions to get an exponent.  use #invd2b = 12
|         ** implicitly.
|         *}
|         if length(dsig) = 0 then
         movb    a4@(4),d0        | /0004
         andw  #255,d0         | /00ff
         tstw   d0
         bnes   .+10            | /000a
|             dsig := 'n12';
         movl    #55456050,a4@(4) | /034e3132, /0004
|
|         {*
|         ** strip trailing zeros, if no digits lost.
|         ** be careful not to delete all of zero string.
|         *}
|         if guard then
         movb    d6,d0
         beqs   .+50            | /0032
|         begin
|             {*
|             ** mac: append guard digit
|             ** iii: 'add' guard into last digit
|             *}
|             ss[1] := '1';
         moveq   #1,d0           | /01
         movb    #49,a6@(-100,d0:w) | /0031, /9c
|             dsig := concat(d.sig, ss)
         pea     a4@(4)           | /0004
         pea     a6@(-100)        | /ff9c
         pea     a6@(-352)        | /fea0
         movw    #2,a7@-        | /0002
         bsr     _cat
         movl    a4,a0
         addql  #4,a0           | /4
         lea     a6@(-352),a1     | /fea0
         moveq   #5,d0           | /05
         movl    a1@+,a0@+
         subqw  #1,d0           | /1
         bgts   .-4             | /0004
         movw    a1@,a0@
         bras   .+74            | /004a
|         end
|         else
|             while (length(dsig) > 1) and
         movb    a4@(4),d0        | /0004
         andw  #255,d0         | /00ff
         cmpw  #1,d0           | /0001
         sgt     d0
         movb    a4@(4),d1        | /0004
         andw  #255,d1         | /00ff
         .word	/4e71,/4e71
         movb    a4@(4,d1:w),d2   | /04
         andw  #255,d2         | /00ff
         cmpw  #48,d2          | /0030
         seq     d1
         andb   d1,d0
         beqs   .+30            | /001e
|                 (dsig[length(d.sig)] = '0') do
|             begin
|                 expadj := expadj + 1;
         addqw  #1,a6@(-94)      | /1, /ffa2
|                 delete(dsig, length(d.sig), 1)
|             end;
         pea     a4@(4)           | /0004
         movb    a4@(4),d0        | /0004
         andw  #255,d0         | /00ff
         movw    d0,a7@-
         movw    #1,a7@-        | /0001
         bsr     _del
         bras   .-70            | /0046
|
|
|         {*
|         ** now scan for an exponent field.
|         *}
|         if (nc = 'e') or (nc = 'e') then
         cmpw  #69,d7          | /0045
         seq     d0
         cmpw  #101,d7         | /0065
         seq     d1
         orb    d1,d0
         beq     .+134           | /0086
|         begin
|             expmul := 1;        {assume positive exp}
         movw    #1,a6@(-92)      | /0001, /ffa4
|             expmag := 0;
         clrw   a6@(-90)         | /ffa6
|
|             nc := nextc;
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
|
|             if (nc = '+') or (nc = '-') then
         cmpw  #43,d7          | /002b
         seq     d0
         cmpw  #45,d7          | /002d
         seq     d1
         orb    d1,d0
         beqs   .+24            | /0018
|             begin
|                 if nc = '-' then
         cmpw  #45,d7          | /002d
         bnes   .+8             | /0008
|                     expmul := -1;
         movw    #-1,a6@(-92)     | /ffff, /ffa4
|                 nc := nextc
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
|             end;
|
|             {*
|             ** use guard flag to catch outrageous exponents,
|             ** which are forced to 5000, a value guaranteed to
|             ** cause over/underflow, depending on expmul.
|             *}
|             guard := false;
         clrb   d6
|             while (ord('0') <= nc@(ord)) and (nc@(ord) <= ord('9')) do
         cmpw  #48,d7          | /0030
         sge     d0
         cmpw  #57,d7          | /0039
         sle     d1
         andb   d1,d0
         beqs   .+46            | /002e
|             begin
|                 guard := guard or (expmag >= 500);
         cmpw  #500,a6@(-90)    | /01f4, /ffa6
         sge     d0
         orb    d0,d6
         andw  #1,d6           | /0001
|                 expmag := (expmag * 10) + (nc@(ord) - ord('0'));
         moveq   #10,d0          | /0a
         muls    a6@(-90),d0      | /ffa6
         movl    d7,d1
         subw   #48,d1          | /0030
         addw   d0,d1
         movw    d1,a6@(-90)      | /ffa6
|                 nc := nextc
         clrw   a7@-
         movl    a6,a7@-
         bsr     nextc
         movw    a7@+,d7
         bras   .-58            | /003a
|             end;
|             if guard then
         movb    d6,d0
         beqs   .+8             | /0008
|                 expmag := 5000
         movw    #5000,a6@(-90)   | /1388, /ffa6
|         end;
|
|         {*
|         ** finish up number case by storing exponent, assuming
|         ** implicit decimal point to the right of the digit
|         ** string.
|         *}
|         d.exp := (expmul * expmag) + expadj;
         movw    a6@(-90),d0      | /ffa6
         muls    a6@(-92),d0      | /ffa4
         movw    a6@(-94),d1      | /ffa2
         addw   d0,d1
         movw    d1,a4@(2)        | /0002
|     end
         moveml a7@+,#/10f0
         unlk    a6
         movl    a7@+,a0
         addqw  #8,a7           | /8
         jmp     a0@
|
         .word   /d354,/5232,/4445,/4320  | ".tr2dec "
         .word   /000c,/0130,/013a,/014e  | "...0.:.n"
         .word   /054e,/3030,/3030        | ".n0000"
| end;
|

_srchk:  movl     a7@+,a7@
         rts      

_ins:    movl     a7@+,d1
         movw     a7@+,d0
         movl     a7@+,a1
         movl     a7@+,a0
         movl     d1,a7@-
         subqw   #/1,d0
         blts    .+/0030         | 0000003c
         clrw    d1
         movb     a0@+,d1
         clrw    d2
         movb     a1@,d2
         cmpw    d0,d2
         blts    .+/0024         | 0000003c
         movw     d1,d3
         addw    d2,d3
         movb     d3,a1@+
         movl     a1,a2
         addw   d3,a2
         movl     a1,a3
         addw   d2,a3
         subw    d0,d2
         bras    .+/0004         | 0000002e
         movb     a3@-,a2@-
         subqw   #/1,d2
         bpls    .-/0004         | 0000002c
         addw   d0,a1
         bras    .+/0004         | 00000038
         movb     a0@+,a1@+
         subqw   #/1,d1
         bpls    .-/0004         | 00000036
         rts      
  
_del:    movl     a7@+,a1
         movw     a7@+,d0
         movw     a7@+,d1
         movl     a7@+,a0
         movl     a1,a7@-
         cmpw   #/0000,d0
         bles    .+/0032         | 00000040
         cmpw   #/0000,d1
         bles    .+/002c         | 00000040
         clrw    d2
         movb     a0@,d2
         cmpw    d1,d2
         blts    .+/0024         | 00000040
         movw     d1,d3
         addw    d0,d3
         subqw   #/1,d3
         subw    d2,d3
         bles    .+/0008         | 0000002e
         subqw   #/1,d1
         movb     d1,a0@
         bras    .+/0014         | 00000040
         subw    d0,d2
         movb     d2,a0@
         addw   d1,a0
         movl     a0,a1
         addw   d0,a1
         bras    .+/0004         | 0000003c
         movb     a1@+,a0@+
         addqw   #/1,d3
         bles    .-/0004         | 0000003a
         rts      

_copy:   moveml  #/e0c0,a7@-
         movl     a7@(/0018),a0
         movw     a7@(/001c),d0
         movw     a7@(/001e),d1
         subqw   #/1,d1
         movl     a7@(/0020),a1
         clrw    d2
         movb     a1@+,d2
         subw    d1,d2
         subw    d0,d2
         blts    .+/0020         | 0000003e
         addw   d1,a1
         movb     d0,a0@+
         bras    .+/0004         | 00000028
         movb     a1@+,a0@+
         subqw   #/1,d0
         bpls    .-/0004         | 00000026
         movl     a7@(/0014),a7@(/020)
         moveml  a7@+,#D0+D1+D2+A0+A1
         addl   #/0000000c,a7
         rts      
         clrb    a0@
         bras    .-/0014         | 0000002c

_cat:   moveml  #/e0e0,a7@-
         movw     a7@(/001c),d0
         movl     a7@(/001e),a0
         lea      a7@(/0022),a1
         movw     d0,d2
         lslw    #/2,d2
         addw   d2,a1
         clrw    d1
         addql   #/1,a0
         bras    .+/0012         | 0000002c
         movl     a1@-,a2
         clrw    d2
         movb     a2@+,d2
         addw    d2,d1
         bras    .+/0004         | 00000028
         movb     a2@+,a0@+
         subqw   #/1,d2
         bpls    .-/0004         | 00000026
         subqw   #/1,d0
         bpls    .-/0012         | 0000001c
         movl     a7@(/001e),a0
         movb     d1,a0@
         lea      a7@(/0022),a1
         movw     a7@(/001c),d0
         lslw    #/2,d0
         addw   d0,a1
         movl     a7@(/0018),a1@-
         movl     a1,a7@(/0018)
         moveml  a7@+,#D0+D1+D2+A0+A1+A2
         movl     a7@+,a7
         rts      

_pos:   moveml  #/e0e0,a7@-
         movl     a7@(/001c),a0
         clrw    d0
         movb     a0@+,d0
         clrw    d1
         movl     a7@(/0020),a1
         clrw    d2
         movb     a1@+,d2
         cmpw    d2,d0
         bges    .+/0006         | 0000001e
         clrw    d1
         bras    .+/0018         | 00000034
         movl     a0,a2
         addql   #/1,d1
         bras    .+/0006         | 00000028
         cmpmb   a2@+,a1@+
         bnes    .+/0008         | 0000002e
         subqw   #/1,d2
         bpls    .-/0006         | 00000024
         bras    .+/0008         | 00000034
         addql   #/1,a0
         subqw   #/1,d0
         bras    .-/0024         | 0000000e
         movw     d1,a7@(/0022)
         movl     a7@(/0018),a7@(/001e)
         moveml  a7@+,#D0+D1+D2+A0+A1+A2
         addql   #/6,a7
         rts      
 d1,a7@-
         subqw   #/1,d0
         blts    .+/0030         | 0000003c
         clrw    d1
         movb     a0@+,d1
         clrw    d2
         movb     a1@,d2
         cmpw    d0,d2
         sumacc/lib/sanescan.s   444      0     12        2703  3470501364  10032 |-----------------------------------------------------------
| 25may84: C version, uses macros to save my fingers. (croft)
|-----------------------------------------------------------
	.insrt	"../h/sanemacs.h"

__fp68k = /a9eb		| avoids including toolmacs.h
__elems68k = /a9ec

	.text

	.globl	_dec2str,_str2dec,p2cstr,c2pstr

	.macro	tostr,l,c
	.globl	l
l:	movw	#c,d0
	bras	tostring
	.endm
	.macro	frstr,l,c
	.globl	l
l:	movw	#c,d0
	bras	fromstring
	.endm

FL = -26		| frame length, space for struct Decimal

tostring:
	link	a6,#FL
	movl	a6@(8),sp@-	| DecForm *f;
	movl	a6@(12),sp@-	| floattype *x;
	pea	a6@(FL)		| Decimal *d;
	movw	d0,sp@-		| fp68k opcode, ?2Dec
	.word	__fp68k
	movl	a6@(8),sp@-	| DecForm *f;
	pea	a6@(FL)		| Decimal *d;
	movl	a6@(16),sp@-	| DecStr *y;  result
	jsr	_dec2str
	movl	a6@(16),sp@-	| convert to C string
	jsr	p2cstr
	unlk	a6
	rts

	tostr,S2Str,fs2dec
	tostr,D2Str,fd2dec
	tostr,C2Str,fc2dec
	tostr,X2Str,fx2dec

	.bss
decstr:	.blkb	82
	.text

fromstring:
	link	a6,#FL
	movw	d0,sp@-		| save fp68k op
	movl	a6@(8),a0	| convert C to P string
	movl	#decstr,a1
.L8:	movb	a0@+,a1@+
	bnes	.L8
	movl	#decstr,sp@-
	jsr	c2pstr
|	addql	#4,sp
|	movl	#decstr,sp@-	| DecStr *x;
	pea	a6@(FL)		| Decimal *d;
	jsr	_str2dec
	movw	sp@+,d0
	pea	a6@(FL)		| Decimal *d;
	movl	a6@(12),sp@-	| floattype *y;  result
	movw	d0,sp@-		| fp68k op
	.word	__fp68k		| convert Dec2?
	unlk	a6
	rts

	frstr,Str2S,fdec2s
	frstr,Str2D,fdec2d
	frstr,Str2C,fdec2c
	frstr,Str2X,fdec2x
  moveml  a7@+,#D0+D1+D2+A0+A1
         addl   #/0000000c,a7
sumacc/lib/getpargs.s   444      0     12        4036  3470501365  10055 |
| getpargs - Get Pascal arguments into C subroutine/function.
|
| In using this Mac/C environment, usually calls are made from C programs
|  into the Pascal toolbox;  this argument conversion is handled auto-
|  maticly.  On rare occasions, a Pascal toolbox function (such as
|  TrackControl) wants to call a C routine.  Getpargs is used in such cases
|  to make the Pascal arguments accessable to C.  In addition, getpargs
|  adjusts the stack for a proper Pascal return.
|
| Called as the 1st line of a C subroutine that has no arguments:
|  funretptr = getpargs(&pascalargstruct, sizeof pascalargstruct);
|
| "pascalargstruct" is a structure declared local to the C subroutine and is
|  filled in with the Pascal arguments, in stack order (reversed) and with
|  the proper Pascal calling convention argument types.  
|
| "funretptr" gets the address of the Pascal return value.  This is only
|  useful if you are being called as a function;  if you store into this
|  location, be sure to use the proper expected Pascal type & length.
|
| I know this reeks of kludgery;  if you find a better way to do this
| (short of altering the C language calling conventions to be that of Pascal),
| please let me know...
|
|
| Copyright (C) 1984, Stanford Univ. SUMEX project.
| May be used but not sold without permission.
|
| history
| 05/29/84	Croft	Created.
| 05/30/84	Croft	Added funretptr stuff.
|
	.data
	.text
	.globl	getpargs

| first copy the pascalargstruct from stack into the C struct.

getpargs:
	movl	sp@(4),a1	| dst struct addr
	movl	sp@(8),d0	| count
	beqs	.L3		| nothing to do, just return funretptr
	movl	a6,a0
	addql	#8,a0		| src stack addr
	subql	#1,d0
.L1:	movb	a0@+,a1@+
	dbra	d0,.L1

| now remove the Pascal arguments from the stack by shifting it up.

	movl	sp@(8),d1	| stack shift distance
	movl	a6,a0
	addql	#7,a0		| src
	movl	a0,a1
	addl	d1,a1		| dst
	movl	a0,d0
	subl	sp,d0		| sizeof stack - 1
.L2:	movb	a0@,a1@
	subql	#1,a0
	subql	#1,a1
	dbra	d0,.L2

| update sp and fp

	addl	d1,a6
	addl	d1,sp
.L3:	movl	a6,d0		| return funretptr
	addql	#8,d0
	rts





     clrw    d0
         movb     a0@+,d0
         clrw    d1
         movl     a7@(/0020),a1
         clrw    d2
         movb     a1@+,d2
         cmpw    d2,d0
         bges    .+/0006         | 0000001e
         clrw    d1
         bras    .+/0018         | 00000034
         movl     a0,a2
         addql   #/1,d1
         bras    .+/0006         | 00000028
         cmpmb   a2@+,a1@+
         bnes    .+/0008         | 0000002e
         subqw   #/1,d2
         bpls    .-/0006sumacc/lib/libpack.c   444      0     12        4311  3470501366   7623 /*	libos.c		1.0	84/05/30	*/

/*
 * Package library.
 *
 * Copyright (C) 1984, Stanford Univ. SUMEX project.
 * May be used but not sold without permission.
 */

/*
 * history
 * 05/30/84	Croft	Created.
 */

/* LINTLIBRARY */

#include "quickdraw.h"
#undef v
#undef h
#include "osintf.h"
#include "packintf.h"
#include "libmac.h"


/*Standard File*/

void	SFPutFile(p,pr,n,dlg,rep) Point *p; char *pr,*n; ProcPtr dlg; SFReply *rep; { _macc5(RN,_sfputfil,N,SS,PS,PS,L,L) }

void	SFPPutFile(p,pr,n,dlg,rep,dlgid,fil) Point *p; char *pr,*n; ProcPtr dlg,fil; SFReply *rep; { _macc7(RN,_sfpputfi,N,SS,PS,PS,L,L,S,L) }

void	SFGetFile(p,pr,fil,nt,t,dlg,rep) Point *p; char *pr,*t; ProcPtr fil,dlg; SFReply *rep; { _macc7(RN,_sfgetfil,N,SS,PS,L,S,L,L,L) }

void	SFPGetFile(p,pr,ff,nt,t,dlg,rep,dlgid,fp) Point *p; char *pr,*t; ProcPtr ff,dlg,fp; SFReply *rep; { _macc9(RN,_sfpgetfi,N,SS,PS,L,S,L,L,L,S,L) }

/*interface to Disk Initialization Package*/

void	DILoad() { _macc1(RN,_diload,N,N) }
void	DIUnLoad() { _macc1(RN,_diunload,N,N) }
int	DIBadMount(p,mes) Point *p; { _macc2(RI,_dibadmou,S,SS,L) }
int	DIFormat(drv) { _macc1(RI,_diformat,S,S) }
int	DIVerify(drv) { _macc1(RI,_diverify,S,S) }
int	DIZero(drv,vol) char *vol; { _macc2(RI,_dizero,S,S,PS) }

/*interface to International Utilities*/

Handle	IUGetIntl(id) { _macc1(RI,_iugetint,L,S) }
void	IUSetIntl(rn,id,ip) Handle ip; { _macc3(RN,_iusetint,N,S,S,L) }
void	IUDateString(dt,lf,res) char *res; { _macc3(RN,_iudatest,N,L,S,VPS) }
void	IUDatePString(dt,lf,res,ip) char *res; Handle ip; { _macc4(RN,_iudateps,N,L,S,VPS,L) }
void	IUTimeString(dt,s,res) char *res; { _macc3(RN,_iutimest,N,L,B,VPS) }
void	IUTimePString(dt,s,res,ip) char *res; Handle ip; { _macc4(RN,_iutimeps,N,L,B,VPS,L) }

int	IUMetric() { _macc1(RI,_iumetric,B,N) }
int	IUCompString(a,b) char *a,*b; { _macc2(RI,_iucompst,S,PS,PS) }
int	IUEqualString(a,b) char *a,*b; { _macc2(RI,_iuequals,S,PS,PS) }
int	IUMagString(a,b,al,bl) Ptr a,b; { _macc4(RI,_iumagstr,S,L,L,S,S) }
int	IUMagIDString(a,b,al,bl) Ptr a,b; { _macc4(RI,_iumagids,S,L,L,S,S) }

/*interface to Binary-Decimal Conversion*/

void	StringToNum(s,n) char *s; int *n; { _macc2(RN,_stringto,N,PS,L) }
void	NumToString(n,s) char *s; { _macc2(RN,_numtostr,N,L,VPS) }
 bges    .+/0006         | 0000001e
         clrw    d1
         bras    .+/0018         | 00000034
         movl     a0,a2
         addql   #/1,d1
         bras    .+/0006         | 00000028
         cmpmb   a2@+,a1@+
         bnes    .+/0008         | 0000002e
         subqw   #/1,d2
         bpls    .-/0006sumacc/lib/libpr.c   444      0     12        3103  3470501366   7324 /*	libpr.c		1.0	84/06/28	*/

/*
 * Print library.
 */

/*
 * history
 * 06/28/84	Schuster	Created.
 */

#include "quickdraw.h"
#include "toolintf.h"
#undef v
#undef h
#include "macprint.h"
#include "libmac.h"

/*
 * PRINT INTERFACE
 */

void 	PrOpen() { _macc1(RN,_propen,N,N) }
void 	PrClose() { _macc1(RN,_prclose,N,N) }
void 	PrintDefault(h) THPrint h; { _macc1(RN,_printdefault,N,L) }
int	PrValidate(h) THPrint h; { _macc1(RI,_prvalidate,B,L) }
int	PrStlDialog(h) THPrint h; { _macc1(RI,_prstldialog,B,L) }
int	PrJobDialog(h) THPrint h; { _macc1(RI,_prjobdialog,B,L) }
TPPrDlg PrStlInit(h) THPrint h; { _macc1(RI,_prstlinit,L,L) }
TPPrDlg PrJobInit(h) THPrint h; { _macc1(RI,_prjobinit,L,L) }
int	PrDlgMain(h,p) THPrint h; ProcPtr p; { _macc2(RI,_prdlgmain,B,L,L) }
void	PrJobMerge(s,d) THPrint s,d; { _macc2(RN,_prjobmerge,N,L,L) }
TPPrPort PrOpenDoc(h,p,b) THPrint h; TPPrPort p; Ptr b; { _macc3(RI,_propendoc,L,L,L,L) }
void	PrCloseDoc(p) TPPrPort p; { _macc1(RN,_prclosedoc,N,L) }
void	PrOpenPage(p,r) TPPrPort p; Rect *r; { _macc2(RN,_propenpage,N,L,L) }
void	PrClosePage(p) TPPrPort p; { _macc1(RN,_prclosepage,N,L) }
void	PrPicFile(h,p,b,d,s) THPrint h; TPPrPort p; Ptr b; Ptr d; TPPrStatus s; { _macc5(RN,_prpicfile,N,L,L,L,L,L) }
void	PrCfgDialog() { _macc1(RN,_prcfgdialog,N,N) }
void	PrHack(p1,p2,p3) { _macc3(RN,_prhack,N,L,L,L) }

void	PrDrvrOpen() { _macc1(RN,_prdrvropen,N,N) }
void	PrDrvrClose() { _macc1(RN,_prdrvrclose,N,N) }
void	PrCtlCall(w,p1,p2,p3) { _macc4(RN,_prctlcall,N,S,L,L,L) }
int	PrError() { _macc1(RI,_prerror,S,N) }
void	PrSetError(w) { _macc1(RN,_prseterror,N,S) }
L) }
int	DIFormat(drv) { _macc1(RI,_diformat,S,S) }
int	DIVerify(drv) { _macc1(RI,_diverify,S,S) }
int	DIZero(drv,vol) char *vol; { _macc2(RI,_dizero,S,S,PS) }

/*interface to International Utilities*/

Handle	IUGetIntl(id) { _macc1(RI,_iugetint,L,S) }
void	IUSetIntl(rn,id,ip) Handle ip; { _macc3(RN,_iusetint,N,S,S,L) }
void	IUDateString(dt,lf,res) char *res; { _macc3(RN,_iudatest,N,L,S,VPS) }
void	IUDatePString(dt,lf,res,ip) char *res; Handsumacc/lib/prlink.s   444      0     12       34402  3470501371   7555 |-------------------------------------------------------------------------------
|       this is the glue for calling the print code.
|       it is a simple overlaying caller of resources.
|-------------------------------------------------------------------------------
                .insrt  "../h/sysequ.h"
                .insrt  "../h/syserr.h"
                .insrt  "../h/toolequ.h"
                .insrt  "../h/toolmacs.h"
                .insrt  "../h/prequ.h"

                .globl    _propendoc
                .globl    _prclosedoc
                .globl    _propenpage
                .globl    _prclosepage

                .globl    _printdefault
                .globl    _prstldialog
                .globl    _prjobdialog
                .globl    _prstlinit
                .globl    _prjobinit
                .globl    _prdlgmain
                .globl    _prvalidate
                .globl    _prjobmerge

                .globl    _prpicfile
|                .globl    prpic

                .globl    _propen
                .globl    _prclose

                .globl    _prdrvropen
                .globl    _prdrvrclose
                .globl    _prctlcall

                .globl    _prcfgdialog
                .globl    _prhack

                .globl    _prerror
                .globl    _prseterror

		.text
		.globl	_uprlink
_uprlink:

|-------------------------------------------------------------------------------
|               the doc spooling & draft procs dispatch
|-------------------------------------------------------------------------------
_propendoc:
        movl    sp@(12),a0                       |get hprint
        movl    a0@,a0                         |get pprint

        moveq   #3, d0                          |mask for low two bits.
        andb   a0@(prjob+bjdocloop), d0         |get two bit printloop type from tprint

        moveq   #-4, d1                         |get mask (/fc) for:
        andb   d1, printvars+bdocloop          |clear lo 2 bits in bdocloop
        orb    d0, printvars+bdocloop          |set lo 2 bits in bdocloop

        movl    #lopendoc,d1                    |this proc's jump table offset
        bras   prstddoc                        |go to standard entry
_prclosedoc:
        movl    #lclosedoc,d1                   |this proc's jump table offset
        bras   prstddoc                        |go to standard entry

_propenpage:
        movl    #lopenpage,d1                   |this proc's jump table offset
        bras   prstddoc                        |go to standard entry

_prclosepage:
        movl    #lclosepage,d1                  |this proc's jump table offset

prstddoc:
        moveq   #3, d0                          |mask for low two bits.
        andb   printvars+bdocloop, d0          |get printloop type from globals
|its zero!        addqw  #iprdraftid, d0                 ;add as an offset to draft

        bras   prstdlink                       |go to standard linker proc

|-------------------------------------------------------------------------------
|               the hack & cfg procs dispatch
|-------------------------------------------------------------------------------
_prcfgdialog:
	movl    #lcfgdialog,d1  |this proc's jump table offset
	moveq   #icfgdlgid,d0   |dialog procs' resid
        bras   prstdlink       |go to standard linker proc

_prhack:
	movl    #lprhack,d1     |this proc's jump table offset
	moveq   #iprhackid,d0   |dialog procs' resid
        bras   prstdlink       |go to standard linker proc

|-------------------------------------------------------------------------------
|               the dialog procs dispatch
|-------------------------------------------------------------------------------
_printdefault:
        movl    #ldefault,d1    |this proc's jump table offset
        bras   prstddlg        |go to standard entry

_prstldialog:
        movl    #lstldialog,d1  |this proc's jump table offset
        bras   prstddlg        |go to standard entry

_prjobdialog:
        movl    #ljobdialog,d1  |this proc's jump table offset
        bras   prstddlg        |go to standard entry

_prstlinit:
	movl    #lstlinit,d1    |this proc's jump table offset
        bras   prstddlg        |go to standard entry

_prjobinit:
	movl    #ljobinit,d1    |this proc's jump table offset
        bras   prstddlg        |go to standard entry

_prdlgmain:
	movl    #ldlgmain,d1    |this proc's jump table offset
        bras   prstddlg        |go to standard entry

_prvalidate:
	movl    #lprvalidate,d1 |this proc's jump table offset
        bras   prstddlg        |go to standard entry

_prjobmerge:
	movl    #lprjobmerge,d1 |this proc's jump table offset

prstddlg:
        moveq   #iprdlgsid,d0   |dialog procs' resid
        bras   prstdlink       |go to standard linker proc

|-------------------------------------------------------------------------------
|               the pic printing procs dispatch
|-------------------------------------------------------------------------------
_prpicfile:
        movl    #lprpicfile,d1  |this proc's jump table offset
|        bras   prstdpic        ;go to standard entry
|
|prpic
|        movl    #lprpic,d1      ;this proc's jump table offset
|
|prstdpic
        moveq   #iprpicid,d0    |pic printing procs' resid
|-------------------------------------------------------------------------------
|               this is the shared linking code.
|
| it swaps in the proper resource segment and jumps to the proper
| jump table entry in that seg's header.  it is called with the stack
| frame setup properly for the target procedure in the seg.  we do two
| hacks:
|       (1) we set the swap the frame's return address with our own; saving
| the caller's in a register.  this is needed to allow us to un-lock the
| resource seg, otherwise an autopop style would work.
|       (2) we save the caller's a3/4 in the code, not the stack.  this is
| to preserve the callers stack frame for the receiving resource proc.
|
| called with:  d0 = resource id
|               d1 = funlock/jump table offset
| uses:         a3 = callers return address
|               a4 = resource handle
|               d4 = preserved funlock/jump table offset
|-------------------------------------------------------------------------------
prstdlink:

| save some regs & put link long word and callers rtn addr

        lea     la3, a0         |get reg save area address
        moveml 	#D4+A3+A4,a0@   |preserve caller's regs
        movl    d1, d4          |save funlock/jump table offset
        movl    sp@+,a3        |[pop &] save the return address.

| get the code from the printer's resource file.
| if error, simply leave! [could alert!]

        subql  #4,sp                   |make room for rsrc handle
        movl    #lpdeftype,sp@-        |get pdef rsrc type
        movw    d0,sp@-                |..and id
	.word	__getresource
        movl    sp@+,d0                |get the resource handle
        beqs   prstderr                |abort if nil [reserr not set!].
        movl    d0, a4                  |save the resource handle

|lock & jump to the proc thru a small jump table at the start of the seg.
|replace the caller's rtn addr with our own so that we can unlock the seg.

        bset    #lock,a4@      |lock the code seg.
        movl    a4@,a0         |de-reference.
        moveq   #0,d0           |get all zeros in d0 so following is valid long:
        movb    d4,d0           |get proc offset [byte!] from funlock/jump table offset
        addl   d0,a0           |add it to the seg base
|.if: fprdbgok
        movl    a0,sp@-        |clear the hi byte so pc ok for debugger!
        clrb   sp@
        movl    sp@+,a0
|.endc:
        jsr     a0@            |call the proc (note: pushes new rtn adr!)
                                |  now the params are striped & we can cleanup & rtn.

| unlock the seg, if ok.  then go home.
| we dont unlock between a docstart-docend pair because
| quickdraw is using that code in its bottle neck procs.

        tstw   d4              |check if we should unlock
        bpls   prstddone       |no: skip
        bclr    #lock,a4@      |yes: unlock the code seg. (assummed pergable)
prstddone:
        movl    a3,a1           |fetch saved rtn adr
|        moveml la3,#D4+A3+A4    ;restore caller's regs
        lea     la3, a0         |get reg save area address [randy's find]
        moveml a0@,#D4+A3+A4   |restore caller's regs

        jmp     a1@            |go home

| this is the abort.  it gets the frame size from the link long
| and uses that to fixup the stack.

prstderr:
        movw    #resnotfound,printvars+iprerr   |post the error
        swap    d4              |get param size
        addw   d4, sp          |strip params. d4 hi word ignored.
        bras   prstddone

la3:    .long    0
la4:    .long    0
ld4:    .long    0

|-------------------------------------------------------------------------------
|       these are the non-link procs:
|-------------------------------------------------------------------------------
|        procedure prdrvropen
| opens the printer driver
|-------------------------------------------------------------------------------
_prdrvropen:
	moveq   #[ioqelsize/2]-1,d0     |generate a cleared ioqel
.L2:      clrw   sp@-
        dbra    d0,.L2

        lea     sprdrvr, a0             |get drvr name
        movl    a0, sp@(iofilename)      |stash it

        movl    sp,a0                   |point to block
        .word	__open                           |do the open

ioelrtn:
        addw     #ioqelsize,sp           |clean up stack
        movw    d0, printvars+iprerr    |save the error
        rts

sprdrvr:         .byte   6
                .ascii  '.print '

|-------------------------------------------------------------------------------
|       procedure prdrvrclose
| this could be omitted or put in the prbits link.
|-------------------------------------------------------------------------------
_prdrvrclose:
        subw     #ioqelsize,sp           |make room for write control block
        movl    sp,a0                   |point to block

        movw    #iprdrvrref,a0@(iorefnum)|set the refnum param
        .word	__close                          |close drvr
        bras   ioelrtn

|-------------------------------------------------------------------------------
|       procedure prctlcall (iwhichctl: integer; lparam1, lparam2, lparam3: longint);
| general 3 param call to the printer driver.
|-------------------------------------------------------------------------------
_prctlcall:
        movl    sp@+, a0       | rtn
        movl    sp@+, a1       | lparam3
        movl    sp@+, d0       | lparam2
        movl    sp@+, d1       | lparam1
        movw    sp@+, d2       | iwhichctl
        movl    a0, sp@-       | rts fix

        subw     #ioqelsize,sp           | make room for write control block

        movw    d2, sp@(cscode)          | iwhichctl
        movl    d1, sp@(csparam)         | lparam1
        movl    d0, sp@(csparam+4)       | lparam2
        movl    a1, sp@(csparam+8)       | lparam3
        movw    #iprdrvrref,sp@(iorefnum)| set the refnum param

        movl    sp,a0                   | point to block
        .word	__control

        bras   ioelrtn

|-------------------------------------------------------------------------------
|       procedure propen
| opens both the printer resource file and printer driver
| note: opens the drvr first so that it uses the one in sys.rsrc
| if probs with driver open, does not open the print rsrc file.
|
|       procedure prclose
| closes just the printer rsrc file, leaving the driver open.
| this is so that an ornament can use the driver w/o the app
| taking the driver away!
| note: close opens the resource simply to get the refnum.
|-------------------------------------------------------------------------------
_propen:
        bsrs   _prdrvropen              |open drvr in sys.rsrc
        bnes   openrts                 |abort if error.
        moveq   #0, d1                  |mark call open
        bras   propen1
_prclose:
        moveq   #1, d1                  |mark call close
propen1:
|this uses d1 & a1 accross rsrc calls.  this is safe; they're preserved.
|first get the name of the current printer's resource file from sys.rsrc

        subql    #4,sp                   |make room for rsrc handle
        movl    #lpstrtype,sp@-        |get pstr rsrc type
        movw    #ipstrrfil,sp@-        |..and id for rsrcfile name
	.word	__getresource
        movl    sp@+,d0                |get the rsrcfile name handle
        beqs   gotnil                  |quit if nil
        movl    d0, a1                  |save the resource handle

|open the printer resource file.
|for close, this simply is used to get the refnum

        subql    #2,sp                   |make room for rsrc refnum
        bset    #lock,a1@              |lock res file name
        movl    a1@,sp@-              |push & de-reference.
	.word	__openresfile                    |open the res file
        movw    sp@+, d0               |pop the refnum
        bclr    #lock,a1@              |unlock the res file name
        bsrs   ckerr                   |save & check error

|now return for opens, or close the resfile with the id
|found above if closing.

        tstw   d1                      |open call?
        beqs   openrts                 |yes: go home
        movw    d0,sp@-                |no: closeresfile. push the refnum param
	.word	__closeresfile
        bsrs   ckerr

openrts:
        rts

ckerr:
        movw    reserr,printvars+iprerr |save the error
        beqs   .L1                      |ok: go on
        addqw    #4, sp                  |no: pop addr to abort!
.L1:      rts

gotnil:
        movw    #resnotfound,printvars+iprerr   |post the error
        rts

|-------------------------------------------------------------------------------
|       function  prerror: integer;
|-------------------------------------------------------------------------------
_prerror:
        movw    printvars+iprerr, sp@(4) | rtn the error
        rts

|-------------------------------------------------------------------------------
|       procedure prseterror( ierr: integer );
|-------------------------------------------------------------------------------
_prseterror:
        movl    sp@+, a0               | pop rtn addr
        movw    sp@+, printvars+iprerr | set the error code
        jmp     a0@

|-------------------------------------------------------------------------------
        .end
r driver.
|-------------------------------------------------------------------------------
_prctlcall:
        movl    sp@+, a0       | rtn
        movl    sp@+, a1       | lparam3
        movl    sp@+, d0       | lparam2
        movl    sp@+, d1       |sumacc/mac/   775      0     12           0  3472710627   5770 sumacc/mac/hang/   775      0     12           0  3472474357   6714 sumacc/mac/hang/Makefile   444      0     12         403  3470501410  10365 OBJS = hangman.b clrtoeol.b endgame.b extern.b getguess.b getword.b playgame.b prdata.b prman.b prword.b setup.b

.SUFFIXES: .rsrc .b

.c.b:
	cc68 -c -O $<

.b.rsrc:
	cc68 -z -m -O *.b
	rmaker $*.rc

hangman.rsrc: $(OBJS) hangman.rc

clean:
	rm -f *.b *.rsrc
 driver.
|-------------------------------------------------------------------------------
_prctlcall:
        movl    sp@+, a0       | rtn
        movl    sp@+, a1       | lparam3
        movl    sp@+, d0       | lparam2
        movl    sp@+, d1       |sumacc/mac/hang/basic.h   444      0     12         442  3470501411  10163 #define NIL 0
#define FALSE 0
#define TRUE 1
#define HMESSAGE 10
#define VMESSAGE 10
#define     SCREENHEIGHT        342
#define     SCREENWIDTH         512
#define     CENTERH             256   /* center of screen on a Mac */
#define     CENTERV             171

keypress() ;
message() ;

----------------------------------------------------------
_prctlcall:
        movl    sp@+, a0       | rtn
        movl    sp@+, a1       | lparam3
        movl    sp@+, d0       | lparam2
        movl    sp@+, d1       |sumacc/mac/hang/clrtoeol.c   444      0     12         261  3470501411  10717 # include "mac/quickdraw.h"
# include "basic.h"

Point pt ;

clrtoeol()
{
	GetPen ( & pt ) ;
	while ( pt.h < SCREENWIDTH )
	{
		DrawChar (' ') ;
		pt.h += CharWidth(' ') ;
	}
}
            256   /* center of screen on a Mac */
#define     CENTERV             171

keypress() ;
message() ;

----------------------------------------------------------
_prctlcall:
        movl    sp@+, a0       | rtn
        movl    sp@+, a1       | lparam3
        movl    sp@+, d0       | lparam2
        movl    sp@+, d1       |sumacc/mac/hang/endgame.c   444      0     12        1663  3470501411  10523 # include	"hangman.h"
# include 	"mac/quickdraw.h"

/*
 * endgame:
 *	Do what's necessary at the end of the game
 */
endgame()
{
	register char	ch;

	prman();
	if (Errors >= MAXERRS)
		Errors = MAXERRS + 2;
	prword();
	prdata();
	MoveTo (MESGH, MESGV);
	if (Errors > MAXERRS)
	{
		DrawString ("Sorry, the word was \"") ;
		DrawString ( Word ) ;
		DrawString ("\"                                         ") ;
	}
	else
		DrawString ("You got it!                                          ");

	for (;;) {
		MoveTo (MESGH, MESGV + LINEHEIGHT ) ;
		DrawString ( "Another word? ");
		if ((ch = readch()) == 'n')
			die();
		else if (ch == 'y')
			break;
		MoveTo (MESGH, MESGV + 2 * LINEHEIGHT) ;
		DrawString ("Please type 'y' or 'n'");
	}
	eraseman() ;
	MoveTo (MESGH, MESGV) ;
	clrtoeol() ;
	MoveTo (MESGH, MESGV + LINEHEIGHT) ;
	clrtoeol() ;
	MoveTo (MESGH, MESGV + 2 * LINEHEIGHT) ;
	clrtoeol() ;
	MoveTo(KNOWNH, KNOWNV);
	DrawString ("Word: ");
}
 param

        movl    sp,a0                   | point to block
        .worsumacc/mac/hang/extern.c   444      0     12         362  3470501411  10403 # include	"hangman.h"

bool	Guessed[26];

char	Word[BUFSIZ],
	    Known[BUFSIZ] ;

int	Errors,
	Wordnum = 0;

float	Average = 0.0;

FILE	*Dict = NULL;

off_t	Dict_size, DictRef ;

short HeadRect[] = { STARTV, STARTH, STARTV+20, STARTH+20 } ;
H, MESGV);
	if (Errors > MAXERRS)
	{
		DrawString ("Sorry, the word was \"") ;
		DrawString ( Word ) ;
		DrawString ("\"                                         ") ;
	}
	else
		DrawString ("You got it!                                          ");

	for (;;) {
		MoveTo (sumacc/mac/hang/getguess.c   444      0     12        2251  3470501411  10743 

# include	"hangman.h"
# include	"mac/quickdraw.h"
# include	"mac/toolintf.h"
# include	"mac/osintf.h"

EventRecord theEvent ;

/*
 * getguess:
 *	Get another guess
 */
getguess()
{
	register int	i;
	register int	ch;
	register bool	correct;

	for (;;) {
		MoveTo (PROMPTH + StringWidth("Guess:  "), PROMPTV );
		ch = readch();
		if (isalpha(ch)) {
			if (isupper(ch))
				ch = tolower(ch);
			if (Guessed[ch - 'a'])
			{
				MoveTo(MESGH, MESGV) ;
				clrtoeol() ;
				MoveTo(MESGH, MESGV) ;
				DrawString ("Already guessed '") ;
				DrawChar ( ( char ) ch ) ;
				DrawString ("'") ;
			}
			else
				break;
		}
		else if (ch == QUITCHAR)
			die();
		else
		{
			MoveTo (MESGH, MESGV) ;
			clrtoeol() ;
			MoveTo (MESGH, MESGV) ;
			DrawString ("Not a valid guess.") ;
		}
	}
	MoveTo (MESGH, MESGV);
	clrtoeol();

	Guessed[ch - 'a'] = TRUE;
	correct = FALSE;
	for (i = 0; Word[i] != '\0'; i++)
		if (Word[i] == ch) {
			Known[i] = ch;
			correct = TRUE;
		}
	if (!correct)
		Errors++;
}

/*
 * readch;
 *	Read a character from the keyboard
 */
readch()
{
	do 
		GetNextEvent( everyEvent, & theEvent ) ;
	while ( theEvent.what != keyDown ) ;

	return ( int ) ( theEvent.message & 0xff ) ;
}

HEIGHT) ;
		DrawString ("Please type 'y' or 'n'");
	}
	eraseman() ;
	MoveTo (MESGH, MESGV) ;
	clrtoeol() ;
	MoveTo (MESGH, MESGV + LINEHEIGHT) ;
	clrtoeol() ;
	MoveTo (MESGH, MESGV + 2 * LINEHEIGHT) ;
	clrtoeol() ;
	MoveTo(KNOWNH, KNOWNV);
	DrawString ("Word: ");
}
 param

        movl    sp,a0                   | point to block
        .worsumacc/mac/hang/getword.c   444      0     12        4413  3470501411  10572 # include	"hangman.h"
# include	"mac/quickdraw.h"
# include	"mac/osintf.h"
# include	"mac/toolintf.h"

extern int DictRef ;

/*
 * getword:
 *	Get a valid word out of the dictionary file
 */
getword()
{
	register char		*wp, *gp;
	int					try ;

	for ( try = 0 ; try < MAXTRY ; try ++ ) 
	{
		/* move to a random point in the file */
		if ( SetFPos ( DictRef, 1, myabs(myrandom() % Dict_size)) != noErr )
		{
			error ("Can't set file marker position...") ;
			ExitToShell() ;
		}

		if (macfgets(Word, BUFSIZ, DictRef) == ERROR)
			continue;
		if (macfgets(Word, BUFSIZ, DictRef) == ERROR)
			continue;

		/* throw away short words */
		if (strlen(Word) < MINLEN)
		{
			/* error ("Got short word...") ; */
			continue;
		}

		/* throw away words with capital letters */
		for (wp = Word; *wp; wp++)
			if (!islower(*wp))
				goto cont;
		break;
		cont: /* error("Got word with capital letter...") */ ;
	}

	if ( try >= MAXTRY )
	{
		error ("Can't get good word.  Bye.") ;
		ExitToShell() ;
	}

	gp = Known;
	wp = Word;
	while (*wp) {
		*gp++ = '-';
		wp++;
	}
	*gp = '\0';
}

/*
 * abs:
 *	Return the absolute value of an integer
 */
off_t
myabs(i)
off_t	i;
{
	if (i < 0) return -(off_t) i;
	else return (off_t) i;
}


macfgets ( buffer, bufsize, filerefnum )
/* imitates unix fgets using macintosh file system */
	char * buffer ;
	int bufsize, filerefnum ;
{
	int count ;

	if ( bufsize < 2 ) 
	{
		error ("macfgets: can't read into zero length buffer...") ;
		return ERROR ;
	}

	/* skip non alpha characters if any */
	do
	{
		count = 1 ;
		if ( FSRead ( filerefnum, & count, buffer ) != noErr )
		{
			/* error ("macfgets: error skipping white space...") ; */
			return ERROR ;
		}
	}
	while ( ! isalpha( * buffer ) ) ;

	++buffer ; --bufsize ;

	/* continue reading until a non alpha character is reached */
	do
	{
		count = 1 ;

		if ( FSRead ( filerefnum, & count, buffer ) != noErr )
		{
			/* error ("macfgets: error reading string...") ; */
			return ERROR ;
		}

		if ( ! isalpha( *buffer ) )
		{
			*buffer = '\0' ;
			return OK ;
		}

		buffer ++ ; bufsize -- ;
	}
	while ( bufsize ) ;

	error ("macfgets: buffer is full...") ;
	return ERROR ;
}

myrandom()
/* return random integer using quickdraw's Random() which returns
 * a random short
 */
{
	return (Random() + ( ((int) Random()) << 16 )) ;
}


        movl    sp@+,d0                |get the rsrcfile name handle
        beqs   gotnil                  |quit if nil
        movl    d0, a1                  |save the resource handle

|open the printer resource file.
|for close, this simplysumacc/mac/hang/hangman.c   444      0     12        2056  3470501412  10532 # include	"hangman.h"
# include 	"mac/quickdraw.h"
# include 	"mac/osintf.h"
# include	"mac/toolintf.h"

struct QDVar QDVar ;
WindowRecord wRecord ;
WindowPtr theWindow ;
short wirect[] = { 50, 40, 300, 450 } ;
extern int DictRef ;

# define VIS 1

/*
 * This game written by Ken Arnold.
 * Modified to run on Macintosh by Dan Winkler.
 */
main()
{
	InitScreen();
	setup();
	for (;;) {
		Wordnum++;
		playgame();
		Average = (Average * (Wordnum - 1) + Errors) / Wordnum;
	}
	/* NOTREACHED */
}

/*
 * die:
 *	Die properly.
 */
die()
{
	FSClose ( DictRef ) ;  /* returns an error code but we aren't very
							* interested at this point.
							*/
	ExitToShell() ;
}

InitScreen()
{
     /* set up the quickdraw and the visible screen */
	 QD = & QDVar ;
	 InitGraf( & thePort ) ;
	 QD->randSeed = TickCount() ;
	 InitFonts() ;
     InitWindows() ;
	 InitCursor() ;
	 theWindow = NewWindow ( &wRecord, (Rect *) wirect, "Unix Hangman",
								VIS, documentProc, (WindowPtr) -1, 1, 0 ) ;
 	 FlushEvents(everyEvent,0);
	 SetPort ( theWindow ) ;
	 TextMode ( srcCopy ) ;
}
0';
}

/*
 * abs:
 *	Return the absolute value of an integer
 */
off_t
myabs(i)
off_t	i;
{
	if (i < 0) return -(off_t) i;
	else return (off_t) i;
}


macfgets ( buffer, bufsize, filerefnum )
/* imitates unix fgets using macintosh file system */
	char * buffer ;
	int bufsize, filerefnum ;
{
	int count ;

	if ( bufsize < 2 ) 
	{
		error ("macfgets: can't read into zero length buffer...") ;
		return ERROR ;
	}

	/* skip non alpha characters if any */
	do
	{
		countsumacc/mac/hang/hangman.h   444      0     12        2106  3470501412  10533 
# define	TRUE	1
# define	FALSE	0
# define	NIL		0
# define	bool	char
# define	BUFSIZ	80
# define	NULL	0
# define	ERROR	-1

# define	MAXTRY	100  /* how many tries to get good word from dictionary */

typedef 	int 	off_t ;

# define	FILE	int
# define	QUITCHAR	0x09   /* tab char */
#define		isalpha(c)	(((c>='A')&&(c<='Z'))||((c>='a')&&(c<='z'))) 
#define		isupper(c)	((c>='A')&&(c<='Z'))
#define		islower(c)	((c>='a')&&(c<='z'))
#define 	tolower(c)	((c)-'A'+'a')

# define	STARTH 85
# define	STARTV 25

# define	MINLEN	6
# define	MAXERRS	7
# define	DICT	"words"

# define	LINEHEIGHT	16
# define	MESGH	15
# define	MESGV	170
# define	PROMPTH	MESGH
# define	PROMPTV	MESGV + LINEHEIGHT
# define	KNOWNH	MESGH
# define	KNOWNV	PROMPTV + LINEHEIGHT

# define	GUESSH	210
# define	GUESSV	30
# define	NUMBERH	GUESSH
# define	NUMBERV	GUESSV + 3 * LINEHEIGHT
# define	AVGH	GUESSH
# define	AVGV	NUMBERV + LINEHEIGHT


extern bool	Guessed[];

extern char	Word[], Known[], *Noose_pict[];

extern int	Errors, Wordnum;

extern float	Average;

extern FILE	*Dict;

extern off_t	Dict_size;

int	die();

off_t	abs();
urn the absolute value of an integer
 */
off_t
myabs(i)
off_t	i;
{
	if (i < 0) return -(off_t) i;
	else return (off_t) i;
}


macfgets ( buffer, bufsize, filerefnum )
/* imitates unix fgets using macintosh file system */
	char * buffer ;
	int bufsize, filerefnum ;
{
	int count ;

	if ( bufsize < 2 ) 
	{
		error ("macfgets: can't read into zero length buffer...") ;
		return ERROR ;
	}

	/* skip non alpha characters if any */
	do
	{
		countsumacc/mac/hang/hangman.rc   444      0     12         103  3470501412  10663 * input for resource compiler
*

hangman.rsrc

Type CODE
  b.out,0
r
# define	BUFSIZ	80
# define	NULL	0
# define	ERROR	-1

# define	MAXTRY	100  /* how many tries to get good word from dictionary */

typedef 	int 	off_t ;

# define	FILE	int
# define	QUITCHAR	0x09   /* tab char */
#define		isalpha(c)	(((c>='A')&&(c<='Z'))||((c>='a')&&(c<='z'))) 
#define		isupper(c)	((c>='A')&&(c<='Z'))
#define		islower(c)	((c>='a')&&(c<='z'))
#define 	tolower(c)	((c)-'A'+'a')

# define	STARTH 85
# define	STARTV 25

# define	Msumacc/mac/hang/playgame.c   444      0     12         453  3470501413  10700 # include	"hangman.h"

/*
 * playgame:
 *	play a game
 */
playgame()
{
	register bool	*bp;

	getword();
	Errors = 0;
	bp = Guessed;
	while (bp < &Guessed[26])
		*bp++ = FALSE;
	while (Errors < MAXERRS && index(Known, '-') != NULL) {
		prword();
		prdata();
		prman();
		getguess();
	}
	endgame();
}
	(((c>='A')&&(c<='Z'))||((c>='a')&&(c<='z'))) 
#define		isupper(c)	((c>='A')&&(c<='Z'))
#define		islower(c)	((c>='a')&&(c<='z'))
#define 	tolower(c)	((c)-'A'+'a')

# define	STARTH 85
# define	STARTV 25

# define	Msumacc/mac/hang/prdata.c   444      0     12        1404  3470501413  10371 # include	"hangman.h"
# include	"mac/quickdraw.h"

/*
 * prdata:
 *	Print out the current guesses
 */
prdata()
{
	register bool	*bp;
	char 			drawbuf[ 200 ] ;
	int 			width ;

	MoveTo (GUESSH + StringWidth("Guessed:  "), GUESSV);
	bp = Guessed;
	while (bp < &Guessed[26])
		if (*bp++)
			DrawChar ( (char) (((unsigned) bp - (unsigned) Guessed) + 'a' - 1));
	clrtoeol();

	width = StringWidth("Current Average:      ") ;

	MoveTo ( NUMBERH + width, NUMBERV ) ;
	sprintf ( drawbuf, "%d", Wordnum ) ;
	DrawString ( drawbuf ) ;

	MoveTo ( AVGH + width, AVGV ) ;
	sprintf (drawbuf, "%.3f", (Average * (Wordnum - 1) + Errors) / Wordnum);
	DrawString ( drawbuf ) ;

	MoveTo ( AVGH + width, AVGV + LINEHEIGHT ) ;
	sprintf (drawbuf, "%.3f", Average) ;
	DrawString ( drawbuf ) ;

}
ESSV	30
# define	NUMBERH	GUESSH
# define	NUMBERV	GUESSV + 3 * LINEHEIGHT
# define	AVGH	GUESSH
# define	AVGV	NUMBERV + LINEHEIGHT


extern bool	Guessed[];

extern char	Word[], Known[], *Noose_pict[];

extern int	Errors, Wordnum;

extern float	Average;

sumacc/mac/hang/prman.c   444      0     12        2235  3470501413  10236 # include	"hangman.h"
# include	"mac/quickdraw.h"

/*
 * prman:
 *	Print out the hanged man appropriately for the given number
 *	of incorrect guesses.
 */

extern short HeadRect[] ; /* rectangle that bounds the man's head */

prman()
{
	switch ( Errors )
	{
		case 1 :	FrameOval ( (Rect *) HeadRect ) ; break ;	
		case 2 :	MoveTo ( STARTH + 10, STARTV + 20 ) ; 
					LineTo ( STARTH + 10, STARTV + 40 ) ; 
					break ;
		case 3 :	MoveTo ( STARTH + 10, STARTV + 40 ) ; 
					LineTo ( STARTH + 10, STARTV + 60 ) ; 
					break ;
		case 4 :	MoveTo ( STARTH - 10, STARTV + 20 ) ; 
					LineTo ( STARTH + 10, STARTV + 40 ) ; 
					break ;
		case 5 :	MoveTo ( STARTH + 30, STARTV + 20 ) ; 
					LineTo ( STARTH + 10, STARTV + 40 ) ; 
					break ;
		case 6 :	MoveTo ( STARTH - 10, STARTV + 80 ) ; 
					LineTo ( STARTH + 10, STARTV + 60 ) ; 
					break ;
		case 7 :	MoveTo ( STARTH + 30, STARTV + 80 ) ; 
					LineTo ( STARTH + 10, STARTV + 60 ) ; 
					break ;
	}
}

eraseman()
/* erases hanged man at end of game */
{
	int olderrs ;

	olderrs = Errors ;
	PenPat ( & QD->white ) ;
	for ( Errors = 1 ; Errors <= 7 ; Errors ++ )
		prman() ;
	PenPat ( & QD->black ) ;
	Errors = olderrs ;
}
(off_t) i;
	else return (off_t) i;
}


macfgets ( buffer, bufsize, filerefnum )
/* imitates unix fgets using macintosh file system */
	char * buffer ;
	int bufsize, filerefnum ;
{
	int count ;

	if ( bufsize < 2 ) 
	{
		error ("macfgets: can't read into zero length buffer...") ;
		return ERROR ;
	}

	/* skip non alpha characters if any */
	do
	{
		countsumacc/mac/hang/prword.c   444      0     12         326  3470501413  10415 # include	"hangman.h"
# include	"mac/quickdraw.h"

/*
 * prword:
 *	Print out the current state of the word
 */
prword()
{
	MoveTo (KNOWNH + StringWidth ( "Word:  " ), KNOWNV );
	DrawString (Known);
	clrtoeol();
}
n's head */

prman()
{
	switch ( Errors )
	{
		case 1 :	FrameOval ( (Rect *) HeadRect ) ; break ;	
		case 2 :	MoveTo ( STARTH + 10, STARTV + 20 ) ; 
					LineTo ( STARTH + 10, STARTV + 40 ) ; 
					break ;
		case 3 :	MoveTo ( STARTH + 10, STARTV + 40 ) ; 
					LineTo ( STARTH + 10, STARTV + 60 ) ;sumacc/mac/hang/setup.c   444      0     12        3560  3470501413  10263 # include	"hangman.h"
# include	"mac/quickdraw.h"
# include	"mac/osintf.h"

/*
 * setup:
 *	Set up the strings on the screen.
 */

extern int DictRef ; /* reference number for dictionary file */
extern int Dict_size ;

setup()
{
	PolyHandle			PH ;

	MoveTo(KNOWNH, KNOWNV);
	DrawString ("Word: ");
	MoveTo(KNOWNH, KNOWNV + 2 * LINEHEIGHT) ;
	DrawString("Written by Ken Arnold.  Ported to Mac by Dan Winkler.") ;

	MoveTo(GUESSH, GUESSV) ;
	DrawString ("Guessed:");
	MoveTo(NUMBERH, NUMBERV) ;
	DrawString ("Word #:");
	MoveTo(AVGH, AVGV) ; 
	DrawString ("Current Average:");
	MoveTo(AVGH, AVGV + LINEHEIGHT) ;
	DrawString ("Overall Average:");
	MoveTo(AVGH, AVGV + 3 * LINEHEIGHT) ;
	DrawString ("Press Tab to quit.") ;

	/* draw the gallows */
	MoveTo ( STARTH + 9, STARTV - 2 ) ;
	PenSize ( 3, 3 ) ;
	LineTo ( STARTH + 9, STARTV - 10 ) ;
	LineTo ( STARTH - 40, STARTV - 10 ) ;
	LineTo ( STARTH - 40, STARTV + 90 ) ;
	PenSize ( 2, 2 ) ;

	PH = OpenPoly() ;
	LineTo ( STARTH, STARTV + 90 ) ;
	LineTo ( STARTH, STARTV + 105 ) ;
	LineTo ( STARTH + 30, STARTV + 105 ) ;
	LineTo ( STARTH + 30, STARTV + 120 ) ;
	LineTo ( STARTH - 70, STARTV + 120 ) ;
	LineTo ( STARTH - 70, STARTV + 90 ) ;
	LineTo ( STARTH - 30, STARTV + 90 ) ;
	ClosePoly() ;
	FillPoly ( PH, & QD->black ) ;
	KillPoly ( PH ) ;

	/* open the dictionary file */
	if ( FSOpen (DICT, 0, & DictRef) != noErr) 
	{
		MoveTo(KNOWNH, KNOWNV - LINEHEIGHT);
		DrawString ("Can't open dictionary file ") ;
		DrawString ( DICT ) ;
		DrawString (".  Bye.") ;
		ExitToShell() ;
	}

	/* get the dictionary size */
	if ( GetEOF ( DictRef, & Dict_size ) != noErr )
	{
		MoveTo(KNOWNH, KNOWNV - LINEHEIGHT);
		DrawString ("Can't determine size of dictionary file ") ;
		DrawString ( DICT ) ;
		DrawString (".  Bye.") ;
		ExitToShell() ;
	}
}

error( s )
/* print an error message */
	char * s ;
{
		MoveTo(KNOWNH, KNOWNV - LINEHEIGHT);
		DrawString ( s ) ;
}
LineTo ( STARTH - 40, STARTV + 90 ) ;
	PenSize ( 2, 2 ) ;

	PH = OpenPoly() ;
	LineTo ( STARTH, STARTV + 90 ) ;
	LineTo ( STARTH, STARTV + 105 )sumacc/mac/hang/words   444      0     12         247  3470501413  10017 hangman reads this file to find its words
replace this file with a subset of your favorite dictionary
/usr/lib/w2006 works well
then download it with: macput -u words
To ( STARTH - 30, STARTV + 90 ) ;
	ClosePoly() ;
	FillPoly ( PH, & QD->black ) ;
	KillPoly ( PH ) ;

	/* open the dictionary file */
	if ( FSOpen (DICT, 0, & DictRef) != noErr) 
	{
		MoveTo(KNOWNH, KNOWNV - LINEHEIGHT);
		DrawString ("Can't open dictionary file ") ;
		DrawString ( DICT ) ;
		DrawString (".  Bye.") ;
		ExitToShell() ;
	}

	/* gsumacc/mac/hang/README   444      0     12         147  3470501414   7616 Don't forget to edit the file 'words' and download this dictionary
to the Mac along with hangman.rsrc.
usr/lib/w2006 works well
then download it with: macput -u words
To ( STARTH - 30, STARTV + 90 ) ;
	ClosePoly() ;
	FillPoly ( PH, & QD->black ) ;
	KillPoly ( PH ) ;

	/* open the dictionary file */
	if ( FSOpen (DICT, 0, & DictRef) != noErr) 
	{
		MoveTo(KNOWNH, KNOWNV - LINEHEIGHT);
		DrawString ("Can't open dictionary file ") ;
		DrawString ( DICT ) ;
		DrawString (".  Bye.") ;
		ExitToShell() ;
	}

	/* gsumacc/mac/cal/   775      0     12           0  3472710620   6520 sumacc/mac/cal/README   444      0     12        4440  3470501414   7460 12-Aug-84 16:19:21-PDT,48036;000000000001
Return-Path: <MIKES@CIT-20.ARPA>
Received: from CIT-20.ARPA.ARPA (CIT-20.ARPA.#Internet) by SUMEX-AIM.ARPA with TCP; Sun 12 Aug 84 16:18:06-PDT
Date: 12 Aug 1984 1616-PDT
Subject: A Calendar/Note Pad desk accessory
From: Mike Schuster <MIKES@CIT-20.ARPA.ARPA>
To: info-mac@SUMEX-AIM.ARPA.ARPA


The desk accessory "Calendar" draws a monthly calendar above a note
pad text region containing a daily agenda.  Agendas can be edited with
the standard Cut, Copy, Paste, Clear, and Undo commands.  Calendar
uses the standard desktop clipboard, so you can easily transfer text
between other applications and desk accessories.  Agendas for
different dates can be viewed by clicking on the various parts of the
calendar.  Click on Sun, Mon, ..., or Sat to see the agenda for
another day of the week.  Click on 1, 2, ..., or 31 to see the agenda
for another day of the month.  Click on Jan, Feb, ..., or Dec to see
the calendar for another month.  Click on 83 or 85 to see the calendar
for last year or next year.  Look closely and you will see how to get
other years.  Finally, click on the top region containing the date and
time to see today's agenda.

Calendar saves each day's agenda as a purgeable resource of type
"TEXT" named "month/day/year" with some random id in a resource file
called "Calendar File".  I keep "Calendar File" in "System Folder"
along with "Note Pad File" and "Clipboard File".  Calendar requires
about 20K bytes, and hence it won't work under some applications,
notably MacPaint and MacTerminal.

Calendar is compiled with Bill Croft's SUMACC as a DRVR resource in a
desk accessory launcher/installer application called "Desk".  Calendar
can be used by launching "Desk" and pulling down the Apple menu or by
first copying it from Desk into your system resource file using either
"Resource Mover" or Desk's "Install" command.  I assume that your
version of "Rmaker" implements resource names as well as DRVR
resources.  Before compiling, check the path names defined in
"Makefile".  They will have to be changed to match your environment.

The file "device.h" contains some useful definitions for io drivers
and desk accessories.  "Crtcal.s" is a slightly modified version of
SUMACC's driver/accessory self-relocator "crtdrvr.s".

Mike Schuster (mikes@cit-20, mikes@cit-vax)

,d0                |get the rsrcfile name handle
        beqs   gotnil                  |quit if nil
        movl    d0, a1                  |save the resource handle

|open the printer resource file.
|for close, this simplysumacc/mac/cal/desk.c   444      0     12       14656  3470501415   7725 /*
 * Desk accessory launcher/installer.
 *
 * (C) Copyright 1984 Michael Schuster
 * All Rights Reserved
 */

#include "quickdraw.h"
#include "osintf.h"
#include "toolintf.h"

#define NIL 0
#define FALSE 0
#define TRUE 1

#define appleMenu 1
#define fileMenu 2
#define editMenu 3

#define closeItem 1
#define installItem 2
#define quitItem 3
#define undoItem 1
#define cutItem 3
#define copyItem 4
#define pasteItem 5
#define clearItem 6

MenuHandle menus[editMenu + 1];

main()
   {
   struct QDVar QDVar;
   EventRecord event;
   WindowPtr window;
   Rect dragRect;

   QD = &QDVar;
   InitGraf(&thePort);
   InitFonts();
   InitWindows();
   InitMenus();
   TEInit();

   dragRect = QD->screenBits.bounds; 

   menus[appleMenu] = NewMenu(appleMenu, "\24");
   AddResMenu(menus[appleMenu], "DRVR");
   InsertMenu(menus[appleMenu], 0);
   menus[fileMenu] = NewMenu(fileMenu, "File");
   AppendMenu(menus[fileMenu], "Close");
   AppendMenu(menus[fileMenu], "Install");
   AppendMenu(menus[fileMenu], "Quit");
   InsertMenu(menus[fileMenu], 0);
   menus[editMenu] = NewMenu(editMenu, "Edit");
   AppendMenu(menus[editMenu], "Undo/Z");
   AppendMenu(menus[editMenu], "(-");
   AppendMenu(menus[editMenu], "Cut/X");
   AppendMenu(menus[editMenu], "Copy/C");
   AppendMenu(menus[editMenu], "Paste/V");
   AppendMenu(menus[editMenu], "Clear/B");
   InsertMenu(menus[editMenu], 0);
   DrawMenuBar();

   SetCursor(&QD->arrow);
   while (TRUE)
      {
      SystemTask();
      if (FrontWindow())
         DisableItem(menus[fileMenu], installItem);
      else
         EnableItem(menus[fileMenu], installItem);

      if (!GetNextEvent(everyEvent, &event))
         continue;

      switch (event.what)
         {
         case mouseDown:
            switch (FindWindow(&event.where, &window))
               {
               case inMenuBar:
                  SetCursor(&QD->arrow);
                  commandEvent(MenuSelect(&event.where));
                  HiliteMenu(0);
                  break;

               case inSysWindow:
                  SystemClick(&event, window);
                  break;

               case inDrag:
                  DragWindow(window, &event.where, &dragRect);
                  break;

               case inGoAway:
                  if (TrackGoAway(window, &event.where))
                     commandEvent((fileMenu << 16) | closeItem);        
                  break;

               case inContent:
                  if (window != FrontWindow())
                     SelectWindow(window);
                  break;
               }
            break;

         case keyDown:
         case autoKey:
            if (event.modifiers & cmdKey)
               {
               commandEvent(MenuKey(event.message & 0xff));
               HiliteMenu(0);
               }
            break;
         }
      }
   }

commandEvent(menuItem)
   {
   WindowPtr window;
   int menu;
   int item;
   char name[64];
   char *c2pnstr();

   window = FrontWindow();
   SetPort(window);
   menu = HiWord(menuItem);
   item = LoWord(menuItem);

   switch (menu)
      {
      case appleMenu:
         GetItem(menus[appleMenu], item, name);
         OpenDeskAcc(c2pnstr(name));
         break;

      case fileMenu:
         switch (item)
            {
            case closeItem:
               CloseDeskAcc(((WindowPeek) window)->windowKind);
               break;

            case installItem:
               install();
               break;

            case quitItem:
               ExitToShell();
               break;    
            }
         break;

      case editMenu:
         switch (item)
            {
            case undoItem:
               SystemEdit(undoCmd);
               break;

            case cutItem:
               SystemEdit(cutCmd);
               break;

            case copyItem:
               SystemEdit(copyCmd);
               break;

            case pasteItem:
               SystemEdit(pasteCmd);
               break;

            case clearItem:
               SystemEdit(clearCmd);
               break;      
            }
         break;
      }
   }

/* install local drivers as system drivers */
install()
   {
   int i;
   int j;
   int k;
   int rsrc;
   Handle oldHandle;
   Handle handle;
   Handle drivers[16];
   ResType type;
   int id;
   int attrs;
   char name[256];

   j = CountResources("DRVR");
   k = 0;
   rsrc = CurResFile();
   SetResLoad(FALSE);
   for (i = 1; i <= j; i++)
      {
      handle = GetIndResource("DRVR", i);
      if (handle)
         {
         ReleaseResource(handle);
         handle = GetIndResource("DRVR", i);
         }
      if (handle && HomeResFile(handle) == rsrc)
         drivers[++k] = handle;
      }
   SetResLoad(TRUE);

   for (i = 1; i <= k; i++)
      {
      UseResFile(rsrc);
      LoadResource(drivers[i]);
      handle = NewHandle(GetHandleSize(drivers[i]));
      if (!MemError())
         {
         BlockMove(*drivers[i], *handle, GetHandleSize(handle));
         GetResInfo(drivers[i], &id, type.s, name);
         attrs = GetResAttrs(drivers[i]);
         ReleaseResource(drivers[i]);
         UseResFile(0);
         if (oldHandle = GetResource("DRVR", id))
            {
            UseResFile(rsrc);
            if (installAlert(name, "DRVR", id) == 2)
               continue;
            UseResFile(0);
            RmveResource(oldHandle);
            DisposHandle(oldHandle);
            }
         if (oldHandle = GetNamedResource("DRVR", name))
            {
            UseResFile(rsrc);
            if (installAlert(name, "DRVR", id) == 2)
               continue;
            UseResFile(0);
            RmveResource(oldHandle);
            DisposHandle(oldHandle);
            }
         AddResource(handle, "DRVR", id, name);
         if (!ResError())
            {
            WriteResource(handle);
            SetResAttrs(handle, attrs);
            }
         }
      else
         ReleaseResource(drivers[i]);
      }
   UpdateResFile(0);
   UseResFile(rsrc);
   }

/* install alert */
installAlert(name, type, id)
   char *name;
   char *type;
   int id;
   {
   char idstring[16];

   NumToString(id, idstring);
   ParamText(name, type, idstring, "");
   return CautionAlert(256, (ProcPtr) NIL);
   }

/* convert a C string to a Pascal string with a leading NUL character */
char *c2pnstr(s)
   char *s;
   {
   extern char *isapstr();
   char *t;
   int i;
   int j;

   i = 0;
   while (*s++)
     i++;
   j = i;
   t = s - 2;
   while (j--)
      *s-- = *t--;
   *s-- = 0;
   *s = (char) i + 1;
   return(isapstr(s));
   }

))
                     SelectWindow(window);
                  break;
           sumacc/mac/cal/cal.c   444      0     12       73027  3470501415   7533 /*
 * Calendar desk accessory
 *
 * (C) Copyright 1984 Michael Schuster
 * All Rights Reserved
 */

#include "quickdraw.h"
#include "osintf.h"
#include "toolintf.h"
#include "device.h"
#include "res.h"

#define NIL 0
#define FALSE 0
#define TRUE 1

/*
 * string constants
 */
char TITLE[] = {"Calendar"};    /* calendar window title */
char FILE[] = {"Calendar File"};/* calendar file title */
char TEXT[] = {"TEXT"};         /* calendar resource type */

char *dayNames[] =              /* names of week days */
   {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", 
   "Friday", "Saturday", "Sunday"};

char *monthNames[] =            /* names of months */
   {"January", "Feburary", "March", "April", "May", "June",
   "July", "August", "September", "October", "November", "December"};
/*
 * integer constants
 */
long blackPat[] = {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
long grayPat[] = {0xaa55aa55, 0xaa55aa55, 0xaa55aa55, 0xaa55aa55};

int mLength[] =                 /* lengths of months (non-leap year) */
   {31,31,28,31,30,31,30,31,31,30,31,30,31,31};

/*
 * font constants
 */
#define textFont geneva         /* text font */
#define calFont monaco          /* calendar font */
#define textSize 9              /* font size */
#define lines 13                /* number of lines of text */

int ascent;                     /* character ascent */
int descent;                    /* character descent */
int extent;                     /* character extent (width) */
int indent;                     /* horizontal indentation */
int leading;                    /* vertical spacing */
int topping;                    /* vertical indentation */

/*
 * global variables
 */
WindowPtr window;               /* calendar window */
#define text ((TEHandle) GetWRefCon(window))    /* calendar text */
int rsrc;                       /* calendar resource file */
int tickTime;                   /* tick to draw time */
int undoCommand;                /* command to undo */
Handle resources[32];           /* day resources */

#define undoCutCmd 7
#define undoCopyCmd 8
#define undoPasteCmd 9
#define undoClearCmd 10
#define typeCmd 11
#define undoTypeCmd 12

/*
 * date and time variables
 */
DateTimeRec date;                 /* current date */
DateTimeRec time;                 /* current time */

#define dateVal(d,i) ((short *)d)[DIVal[i]]
int DIVal[] = {1, 2, 0};

/*
 * scrap variables
 */
typedef struct
   {
   short length;
   short filler;
   Handle handle;
   } ScrapRec;
typedef ScrapRec *ScrapPtr;
#define TEScrapAddr 2736        /* address of text edit scrap */

ScrapPtr TEScrap;               /* text edit scrap */
Handle UDScrap;                 /* undo scrap */
int UDSel;                      /* undo scrap selection length */
int UDChars;                    /* undo scrap character count */

/*
 * global regions
 */
Point cellP;                    /* size of calendar cell */
Rect windowR;                   /* calendar window bounds */
Rect titleR;                    /* title bounds */
Rect dayR;                      /* day bounds */
Rect calendarR;                 /* calendar bounds */
Rect monthR;                    /* month bounds */
Rect yearR;                     /* year bounds */
Rect textR;                     /* text bounds */
Rect textClickR;                /* text click bounds */

/*
 * string variables
 */
char blanks[] = {"          "};
char zeros[] = {"0000000000"};
#define strLen 5
char *numToString();
char *index();
char *unParseDate();

/*
 * driver routines
 */

/* 
 * driver open routine 
 */
drvrOpen(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   if (!dce->dCtlWindow)
      {
      initRegion();
      newData(dce);
      initScrap();
      initDate();
      openResFile();
      }
   return(ioRTS);
   }

/* 
 * driver close routine 
 */
drvrClose(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   closeResFile();
   disposeData(dce);
   return(ioRTS);
   }

/* 
 * driver control routine 
 */
drvrCtl(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   SetPort(window);
   switch(pb->csCode)
      {
      case accEvent:
         handleEvent((EventRecord *) pb->csParam.csLong);
         break;

      case accRun:
         TEIdle(text);
         if (TickCount() > tickTime)
            drawTime();
         break;

      case accUndo:
         commandEvent(undoCommand);
         break;
      
      case accCut:
         commandEvent(cutCmd);
         break;

      case accCopy:
         commandEvent(copyCmd);
         break;

      case accPaste:
         commandEvent(pasteCmd);
         break;

      case accClear:
         commandEvent(clearCmd);
         break;
      }
   return(ioRTS);
   }

/* 
 * driver status routine 
 */
drvrStatus(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   return(ioRTS);
   }

/* 
 * driver prime routine 
 */
drvrPrime(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   return(ioRTS);
   }

/*
 * resource routines
 */

/*
 * (create and) open resource file
 */
openResFile()
   {
   FInfo fInfo;

   if ((rsrc = OpenResFile(FILE)) < 0)
      {
      /* create and set file info */
      CreateResFile(FILE);
      GetFInfo(FILE, 0, &fInfo);
      BlockMove("ZSYS", fInfo.fdType.s, 4);
      BlockMove("MACS", fInfo.fdCreator.s, 4);
      SetFInfo(FILE, 0, &fInfo);

      rsrc = OpenResFile(FILE);
      }

   /* load month and date resources */
   loadMonthRes();
   loadDateRes();
   }

/* 
 * close resource file 
 */
closeResFile()
   {
   unLoadDateRes();
   CloseResFile(rsrc);
   }

/*
 * load month resources
 */
loadMonthRes()
   {
   register Handle handle;
   register int i;
   int j;
   int id;
   ResType type;
   DateTimeRec resDate;
   char name[64];

   /* initialize handles */
   for (i = 1; i <= 31; i++)
      resources[i] = NIL;

   /* find resource handles for current month, don't load resources */
   j = CountResources(TEXT);
   SetResLoad(FALSE);
   for (i = 1; i <= j; i++)
      {
      if ((handle = GetIndResource(TEXT, i)) && 
          (HomeResFile(handle) == rsrc))
         {
         GetResInfo(handle, &id, type.s, name);
         parseDate(name, &resDate);
         if (sameMonth(&date, &resDate))
            resources[resDate.day] = handle;
         }
      }
   SetResLoad(TRUE);
   }

/*
 * load resource for current date into text edit record
 */
loadDateRes()
   {
   register Handle handle;
   register int length;
   char name[64];

   /* add resource if necessary */
   if (!(handle = resources[date.day]))
      {
      handle = resources[date.day] = NewHandle(0);
      AddResource(handle, TEXT, UniqueID(TEXT), unParseDate(name, &date));
      SetResAttrs(handle, GetResAttrs(handle) | ATT_PURGEABLE);
      }

   /* load resource and make unpurgeable */
   LoadResource(handle);
   HNoPurge(handle);

   /* load text edit record */
   TEDeactivate(text);
   (*text)->hText = handle;
   (*text)->teLength = length = GetHandleSize(handle);
   TECalText(text);
   TESetSelect(length, length, text);
   TEActivate(text);
   }

/*
 * unload resource for current date
 */
unLoadDateRes()
   {
   register Handle handle;

   handle = resources[date.day];
   if (!(*text)->teLength)
      {
      /* remove resource if no text */
      RmveResource(handle);
      DisposHandle(handle);
      resources[date.day] = NIL;
      }
   else
      {
      /* write resource if some text and make purgable */
      if (GetResAttrs(handle) & ATT_CHANGED)
         WriteResource(handle);
      HPurge(handle);
      }
   }

/*
 * change resource for current date
 */
changeDateRes()
   {
   ChangedResource(resources[date.day]);
   }

/*
 * data structure routines
 */

/*
 * new data structures
 */
newData(dce)
   DCtlEntry *dce;
   {
   /* create window */
   OffsetRect(&windowR, 40, 50);
   window = NewWindow((WindowPeek) NIL, &windowR, TITLE, TRUE, 
      rDocProc, (WindowPtr) -1, TRUE, 0);
   OffsetRect(&windowR, -40, -50);
   dce->dCtlWindow = (Ptr) window;

   /* define font and create text edit record */
   SetPort(window);
   TextFont(textFont);
   TextSize(textSize);
   ((WindowPeek) window)->windowKind = dce->dCtlRefNum;
   SetWRefCon(window, (int) TENew(&textR, &textR));
   TextFont(calFont);
   }

/* 
 * dispose data structures 
 */
disposeData(dce)
   DCtlEntry *dce;
   {
   /* dispose text edit resord, make sure resource is not disposed */
   (*text)->hText = NewHandle(0);
   TEDispose(text);

   /* dispose window */
   DisposeWindow(window);
   dce->dCtlWindow = NIL;
   }

/*
 * scrap routines
 */

/*
 * initialize text and undo scraps
 */
initScrap()
   {
   TEScrap = (ScrapPtr) TEScrapAddr;
   UDScrap = NewHandle(0);
   undoCommand = undoCmd;
   }

/*
 * transfer desk scrap to text scrap
 */
getScrap()
   {
   int offset;

   SetHandleSize(TEScrap->handle, TEScrap->length = 0);
   if ((TEScrap->length = GetScrap(TEScrap->handle, TEXT, &offset)) < 0)
      SetHandleSize(TEScrap->handle, TEScrap->length = 0);
   }

/*
 * transfer text scrap to desk scrap
 */
putScrap()
   {
   if (!ZeroScrap())
      PutScrap(TEScrap->length, TEXT, *TEScrap->handle);
   }

/*
 * transfer text scrap, selection, or to end of selection to undo scrap
 */
putUndo(scrap)
   {
   if (!scrap)
      {
      /* transfer text scrap */
      SetHandleSize(UDScrap, TEScrap->length);
      if (MemError())
         SetHandleSize(UDScrap, 0);
      else
         BlockMove(*TEScrap->handle, *UDScrap, GetHandleSize(UDScrap));
      }
   else if (scrap > 0)
      {
      /* transfer selection */
      SetHandleSize(UDScrap, (*text)->selEnd - (*text)->selStart);
      if (MemError())
         SetHandleSize(UDScrap, 0);
      else
         BlockMove(*(*text)->hText + (*text)->selStart, *UDScrap, 
            GetHandleSize(UDScrap));
      }
   else 
      {
      /* transfer to end of selection */
      SetHandleSize(UDScrap, (*text)->selEnd);
      if (MemError())
         SetHandleSize(UDScrap, 0);
      else
         BlockMove(*(*text)->hText, *UDScrap, GetHandleSize(UDScrap));
      UDSel = (*text)->selEnd - (*text)->selStart;
      UDChars = GetHandleSize(UDScrap) - UDSel;
      }
   }

/*
 * transfer undo scrap to text scrap
 */
getUndo()
   {
   DisposHandle(TEScrap->handle);
   TEScrap->length = GetHandleSize(UDScrap);
   TEScrap->handle = UDScrap;
   UDScrap= NewHandle(0);
   }

/* 
 * date routines
 */

/*
 * initialize current date
 */
initDate()
   {
   GetTime(&date);
   }

/*
 * return day of week of the first day of the month
 */
dayOfWeek1(date)
   DateTimeRec *date;
   {
   return (date->dayOfWeek - (date->day - 1) % 7 + 6) % 7;
   }

/*
 * return length of month
 */
monthLength(date)
   DateTimeRec *date;
   {
   if (date->month == 2 &&
       ((date->year % 4 == 0 && date->year % 100 != 0) ||
        date->year % 400 == 0))
      return 29;
   else
      return mLength[date->month];
   }

/*
 * return TRUE if same month
 */
sameMonth(a, b)
   DateTimeRec *a;
   DateTimeRec *b;
   {
   return (a->year == b->year && a->month == b->month);
   }

/* 
 * parse date string "month/day/year"
 */
parseDate(name, date)
   char *name;
   DateTimeRec *date;
   {
   register char *q;
   register char *p;
   register int i;
   int val;

   q = name;
   for (i = 0; i < 3; i++)
      {
      p = index(q, '/');
      *p++ = 0;
      StringToNum(q, &val);
      dateVal(date,i) = val;
      q = p;
      }
   }

/* 
 * unparse date string "month/day/year"
 */
char *unParseDate(name, date)
   char *name;
   DateTimeRec *date;
   {
   register char *p;
   register int i;
   int val;

   p = name;
   for (i = 0; i < 3; i++)
      {
      val = dateVal(date,i);
      NumToString(val, p);
      p += strlen(p);
      *p++ = '/';
      }
   *--p = '\0';

   return name;
   }

/*
 * return number of days to the same day in a given month in the current year
 */
monthDelta(m)
   {
   register int delta;
   int curMonth;

   delta = 1 - date.day;
   curMonth = date.month;
   while (m != date.month)
      {
      if (m > date.month)
         {
         delta += monthLength(&date);
         date.month++;
         }
      else
         {
         date.month--;
         delta -= monthLength(&date);
         }
      }
   delta += min(date.day, monthLength(&date)) - 1;
   date.month = curMonth;
   return delta;
   }

/*
 * return number of days to the same day in the same month of a given year
 */
yearDelta(y)
   {
   register int delta;
   register int i;
   int curYear;

   delta = 1 - date.day;
   curYear = date.year;
   while (y != date.year)
      {
      if (y > date.year)
         {
         for (i = 0; i < 12; i++)
            {
            delta += monthLength(&date);
            if (++date.month > 12)
               {
               date.month = 1;
               date.year++;
               }
            }
         }
      else
         {
         for (i = 0; i < 12; i++)
            {
            if (--date.month < 1)
               {
               date.month = 12;
               date.year--;
               }
            delta -= monthLength(&date);
            }
         }
      }
   delta += min(date.day, monthLength(&date)) - 1;
   date.year = curYear;
   return delta;
   }

/*
 * change current date forward or backward delta days
 */
changeDate(delta)
   {
   int mChanged;

   /* unload current date */
   unLoadDateRes();

   /* fix day of week */
   date.dayOfWeek = (date.dayOfWeek + delta + 1091) % 7 + 1;

   /* change date, check if month had to be changed */
   mChanged = 0;
   while (delta)
      {
      if ((date.day + delta <= monthLength(&date)) &&
          (date.day + delta >= 1))
         {
         date.day += delta;
         delta = 0;
         }
      else if (delta > 0)
         {
         delta -= monthLength(&date) - date.day + 1;
         date.day = 1;
         if (++date.month > 12)
            {
            date.month = 1;
            date.year++;
            }
         mChanged = 1;
         }
      else
         {
         delta += date.day;
         if (--date.month < 1)
            {
            date.month = 12;
            date.year--;
            }
         date.day = monthLength(&date);
         mChanged = 1;
         }
      }

   /* load month if necessary */
   if (mChanged)
      loadMonthRes();

   /* load new date */
   loadDateRes();
   }

/*
 * region routines
 */

/*
 * initialize regions
 */
initRegion()
   {
   /* Monaco font information */
   ascent = 7;
   descent = 2;
   extent = 6;
   indent = 4;
   leading = 3;
   topping = 3;

   /* define sizes of regions */
   SetPt(&cellP, extent * 3 + indent * 2, topping * 2 + ascent + 1);
   SetRect(&titleR, 0, 0, 0, topping * 4 + ascent);
   SetRect(&dayR, 0, 0, 7 * cellP.h, cellP.v);
   SetRect(&calendarR, 0, 0, 7 * cellP.h, 6 * cellP.v);
   SetRect(&monthR, 0, 0, 2 * cellP.h, 6 * cellP.v);
   SetRect(&yearR, 0, 0, 2 * cellP.h, cellP.v);

   /* place regions relative to one another */
   OffsetRect(&dayR, extent, titleR.bottom);
   OffsetRect(&calendarR, extent, dayR.bottom);
   OffsetRect(&monthR, calendarR.right + extent + 2, titleR.bottom);
   OffsetRect(&yearR, calendarR.right + extent + 2, monthR.bottom);
   titleR.right = monthR.right + extent + 1;

   /* define text edit regions */
   SetRect(&textR, 0, 0, ((titleR.right / extent) - 2) * extent + 1,
      (ascent + descent + leading) * lines);
   OffsetRect(&textR, (titleR.right - textR.right) / 2, 
      calendarR.bottom + extent);

   /* finish up */
   SetRect(&windowR, 0, 0, titleR.right, textR.bottom + extent);
   SetRect(&textClickR, 0, calendarR.bottom + 1, titleR.right, windowR.bottom);
   }

/*
 * event routines
 */

/*
 * handle event
 */
handleEvent(event)
   EventRecord *event;
   {
   char chr;

   switch(event->what)
      {
      case activateEvt:
         activateEvent(event->modifiers & activeFlag);
         break;
      
      case updateEvt:
         updateEvent();
         break;
      
      case mouseDown:
         GlobalToLocal(&event->where);
         mouseEvent(&event->where, event->modifiers);
         break;
      
      case keyDown:
      case autoKey:
         chr = event->message & 0xff;
         if (event->modifiers & cmdKey)
            {
            if (chr == 'z' || chr == 'Z')
               commandEvent(undoCommand);
            else if (chr == 'x' || chr == 'X')
               commandEvent(cutCmd);
            else if (chr == 'c' || chr == 'C')
               commandEvent(copyCmd);
            else if (chr == 'v' || chr == 'V')
               commandEvent(pasteCmd);
            else if (chr == 'b' || chr == 'B')
               commandEvent(clearCmd);
            }
         else
            keyDownEvent(chr);
         break;
      }
   }

/*
 * handle activate event
 */
activateEvent(active)
   {
   if (active)
      {
      getScrap();
      TEActivate(text);
      }
   else
      {
      TEDeactivate(text);
      putScrap();
      }
   hiliteRect(&calendarR, &cellP, 7, 6, date.day + dayOfWeek1(&date) - 1);
   undoCommand = undoCmd;
   }

/*
 * handle update event
 */
updateEvent()
   {
   BeginUpdate(window);
   if ((*text)->active)
      hiliteRect(&calendarR, &cellP, 7, 6, date.day + dayOfWeek1(&date) - 1);
   drawDate();
   drawTime();
   frameRect(&dayR, &cellP, 7, 1, (Pattern *) grayPat);
   drawTextRect(&dayR, &cellP, 7, 1, dayNames, 3);
   frameRect(&calendarR, &cellP, 7, 6, (Pattern *) grayPat);
   drawNumRect(&calendarR, &cellP, 7, 6, 
      dayOfWeek1(&date), 1, monthLength(&date), 1, resources);
   frameRect(&monthR, &cellP, 2, 6, (Pattern *) grayPat);
   drawTextRect(&monthR, &cellP, 2, 6, monthNames, 3);
   frameRect(&yearR, &cellP, 2, 1, (Pattern *) grayPat);
   drawNumRect(&yearR, &cellP, 2, 1, 0, 
      date.year - 1, date.year + 1, 2, (Handle *) NIL);
   drawText();
   if ((*text)->active)
      hiliteRect(&calendarR, &cellP, 7, 6, date.day + dayOfWeek1(&date) - 1);
   EndUpdate(window);
   }

/*
 * handle date event, change date either delta days or to today
 */
dateEvent(delta, today)
   {
   if (delta || today)
      {
      hiliteRect(&calendarR, &cellP, 7, 6, date.day + dayOfWeek1(&date) - 1);
      if (today)
         {
         unLoadDateRes();
         GetTime(&date);
         loadMonthRes();
         loadDateRes();
         }
      else
         changeDate(delta);
      drawDate();
      drawNumRect(&calendarR, &cellP, 7, 6, 
         dayOfWeek1(&date), 1, monthLength(&date), 1, resources);
      drawNumRect(&yearR, &cellP, 2, 1, 0, 
         date.year - 1, date.year + 1, 2, (Handle *) NIL);
      drawText();
      hiliteRect(&calendarR, &cellP, 7, 6, date.day + dayOfWeek1(&date) - 1);
      }
   }

/*
 * handle mouse event
 */
mouseEvent(point, modifiers)
   Point *point;
   {
   int delta;

   if (PtInRect(point, &textClickR))
      TEClick(point, (modifiers & shiftKey) ? TRUE : FALSE, text);
   else if (PtInRect(point, &titleR))
      {
      /* today */
      delta = mouseRect(&titleR, &titleR.botRight, point, 1, 1, TRUE);
      if (delta >= 0)
         dateEvent(0, TRUE);
      }
   else if (PtInRect(point, &dayR))
      {
      /* same week */
      delta = mouseRect(&dayR, &cellP, point, 7, 1, TRUE);
      if (delta >= 0)
         dateEvent(delta + 1 - date.dayOfWeek, FALSE);
      }
   else if (PtInRect(point, &calendarR))
      {
      /* same month */
      delta = mouseRect(&calendarR, &cellP, point, 7, 6, TRUE);
      if (delta >= 0)
         dateEvent(delta + 1 - dayOfWeek1(&date) - date.day, FALSE);
      }
   else if (PtInRect(point, &monthR))
      {
      /* another month */
      delta = mouseRect(&monthR, &cellP, point, 2, 6, FALSE);
      if (delta >= 0)
         dateEvent(monthDelta(delta + 1), FALSE);
      }
   else if (PtInRect(point, &yearR))
      {
      /* another year */
      delta = mouseRect(&yearR, &cellP, point, 2, 1, TRUE);
      if (delta >= 0)
         dateEvent(yearDelta((delta) ? date.year + 1 : date.year - 1), FALSE);
      }
   undoCommand = undoCmd;
   }

/*
 * handle key down event
 */
keyDownEvent(chr)
   {
   if (undoCommand != undoTypeCmd)
      putUndo(-TRUE);
   else if (chr == 8 && (*text)->selStart > 0)
      UDChars = min(UDChars, (*text)->selStart - 1);
   TEKey(chr, text);
   changeDateRes();
   undoCommand = undoTypeCmd;
   }

/*
 * handle command event
 */
commandEvent(cmd)
   {
   int i;

   switch (cmd)
      {
      case undoCmd:
         undoCommand = undoCmd;
         break;
      
      case cutCmd:
         putUndo(FALSE);
         TECut(text);
         putScrap();
         undoCommand = undoCutCmd;
         break;
      
      case undoCutCmd:
         TEDeactivate(text);
         TEPaste(text);
         TESetSelect((*text)->selStart-TEScrap->length, (*text)->selEnd, text);
         TEActivate(text);
         getUndo();
         putScrap();
         undoCommand = cutCmd;
         break;
      
      case copyCmd:
         putUndo(FALSE);
         TECopy(text);
         putScrap();
         undoCommand = undoCopyCmd;
         break;
      
      case undoCopyCmd:
         getUndo();
         putScrap();
         undoCommand = copyCmd;
         break;
      
      case pasteCmd:
         putUndo(TRUE);
         TEPaste(text);
         undoCommand = undoPasteCmd;
         break;
      
      case undoPasteCmd:
         TEDeactivate(text);
         TESetSelect((*text)->selStart-TEScrap->length, (*text)->selEnd, text);
         TEDelete(text);
         TEInsert(*UDScrap, GetHandleSize(UDScrap), text);
         TESetSelect((*text)->selStart - GetHandleSize(UDScrap), 
            (*text)->selEnd, text);
         SetHandleSize(UDScrap, 0);
         TEActivate(text);
         undoCommand = pasteCmd;
         break;

      case clearCmd:
         putUndo(TRUE);
         TEDelete(text);
         undoCommand = undoClearCmd;
         break;

      case undoClearCmd:
         TEDeactivate(text);
         TEInsert(*UDScrap, GetHandleSize(UDScrap), text);
         TESetSelect((*text)->selStart - GetHandleSize(UDScrap), 
            (*text)->selEnd, text);
         SetHandleSize(UDScrap, 0);
         TEActivate(text);
         undoCommand = clearCmd;
         break;
      
      case typeCmd:
         TEDeactivate(text);
         TESetSelect((*text)->selEnd, (*text)->selEnd, text);
         i = GetHandleSize(UDScrap);
         TEInsert(*UDScrap, i, text);
         TESetSelect(0, (*text)->selEnd - i, text);
         putUndo(TRUE);
         TESetSelect(UDChars, (*text)->selEnd, text);
         TEDelete(text);
         TESetSelect((*text)->selEnd + i, (*text)->selEnd + i, text);
         TEActivate(text);
         undoCommand = undoTypeCmd;
         break;

      case undoTypeCmd:
         TEDeactivate(text);
         TESetSelect(UDChars, (*text)->selEnd, text);
         TEInsert(*UDScrap + UDChars, GetHandleSize(UDScrap) - UDChars, text);
         putUndo(TRUE);
         TEDelete(text);
         TESetSelect((*text)->selEnd - UDSel, (*text)->selEnd, text);
         TEActivate(text);
         undoCommand = typeCmd;
         break;

      }
   changeDateRes();
   }

/*
 * drawing routines
 */

/*
 * frame rectangle, draw horizontal and vertical lines
 *    rect defines the rectangle
 *    point defines the size of each cell within the rectangle
 *    nh defines the number of columns
 *    nv defines the number of rows
 *    pat defines the pattern
 */
frameRect(rect, point, nh, nv, pat)
   Rect *rect;
   Point *point;
   Pattern *pat;
   {
   register int i;
   register d;

   PenPat(pat);
   /* draw horizontal lines */
   d = point->h * nh;
   MoveTo(rect->left, rect->top);
   for (i = 0; i <= nv; i++)
      {
      Line(d, 0);
      Move(-d, point->v);
      }

   /* draw vertical lines */
   d = point->v * nv;
   MoveTo(rect->left, rect->top);
   for (i = 0; i <= nh; i++)
      {
      Line(0, d);
      Move(point->h, -d);
      }
   PenPat((Pattern *) blackPat);
   }

/*
 * draw text in rectangle
 *    rect defines the rectangle
 *    point defines the size of each cell within the rectangle
 *    nh defines the number of columns
 *    nv defines the number of rows
 *    txt defines the text to be draw into each cell
 *    n defines the number of characters of text to draw
 */
drawTextRect(rect, point, nh, nv, txt, n)
   Rect *rect;
   Point *point;
   char **txt;
   {
   register int i;
   register int j;
   register int k;
   register int d;

   TextFont(calFont);
   MoveTo(rect->left + indent + 1 + ((3 - n) * extent) / 2, 
      rect->top + topping + ascent + 1);
   k = 0;
   d = n * extent;
   for (i = 0; i < nh; i++)
      {
      for (j = 0; j < nv; j++)
         {
         DrawText(txt[k++], 0, n);
         Move(-d, point->v);
         }
      Move(point->h, -(nv * point->v));
      }
   }

/*
 * draw number rectangle
 *    rect defines the rectangle
 *    point defines the size of each cell within the rectangle
 *    nh defines the number of columns
 *    nv defines the number of rows
 *    numbers min, min+delta, min+2*delta, ..., max are drawn into cells
 *    disp defines the initial number of cells to leave blank
 *    hilite defines which cell to hilite
 */
drawNumRect(rect, point, nh, nv, disp, min, max, delta, hilite)
   Rect *rect;
   Point *point;
   Handle *hilite;
   {
   Rect bounds;
   register int i;
   register int j;
   register int k;
   int d;
   Handle *hi;

   TextFont(calFont);
   SetRect(&bounds, 1, 1, point->h, point->v);
   OffsetRect(&bounds, rect->left, rect->top);
   MoveTo(rect->left + indent + 1 + extent / 2,
      rect->top + topping + ascent + 1);
   k = min - disp * delta;
   d = 2 * extent;
   hi = (hilite) ? &hilite[min] : NIL;
   for (i = 0; i < nv; i++)
      {
      for (j = 0; j < nh; j++)
         {
         EraseRect(&bounds);
         if (k >= min && k <= max)
            {
            TextFace((hi && *hi) ? outlineStyle : 0);
            if (hi && *hi)
               Move(-1, 0);
            DrawString(numToString(k, 2));
            if (hi && *hi)
               Move(-1, 0);
            Move(point->h - d, 0);
            (hi) ? hi++ : 0;
            }
         else
            Move(point->h, 0);
         k += delta;
         OffsetRect(&bounds, point->h, 0);
         }
      Move(-(nh * point->h), point->v);
      OffsetRect(&bounds, -(nh * point->h), point->v);
      }
   TextFace(0);
   }

/*
 * mouse rectangle, return cell number
 *    rect defines the rectangle
 *    point defines the size of each cell within the rectangle
 *    where defines the initial location of the mouse
 *    nh defines the number of columns
 *    nv defines the number of rows
 *    hori defines if cells are to be counted horizontally or vertically
 */
mouseRect(rect, point, where, nh, nv, hori)
   Rect *rect;
   Point *point;
   Point *where;
   {
   Rect bounds;
   int i;
   int j;
   int invert;

   SetRect(&bounds, 0, 0, point->h + 1, point->v + 1);
   OffsetRect(&bounds, 
      (i = (where->h - rect->left) / point->h) * point->h + rect->left,
      (j = (where->v - rect->top) / point->v) * point->v + rect->top);
   InvertRect(&bounds);
   invert = TRUE;
   while (StillDown())
      {
      GetMouse(where);
      if (invert != PtInRect(where, &bounds))
         {
         invert = TRUE - invert;
         InvertRect(&bounds);
         }
      }
   if (invert)
      {
      InvertRect(&bounds);
      return (hori) ? j * nh + i : i * nv + j;
      }
   else
      return -1;
   }

/*
 * hilite a cell in a rectangle
 *    rect defines the rectangle
 *    point defines the size of each cell within the rectangle
 *    nh defines the number of columns
 *    nv defines the number of rows
 *    n defines the number of the cell to hilite
 */
hiliteRect(rect, point, nh, nv, n)
   Rect *rect;
   Point *point;
   {
   Rect bounds;

   SetRect(&bounds, 1, 1, point->h, point->v);
   OffsetRect(&bounds, rect->left, rect->top);
   OffsetRect(&bounds, point->h * (n % nh), point->v * (n / nh));
   InvertRect(&bounds);
   }

/*
 * draw text
 */
drawText()
   {
   /* wasteful, but necessary if TECalText used on shorter text */
   EraseRect(&textR); 

   /* update */
   TextFont(textFont);
   TEUpdate(&textR, text);
   }

/*
 * draw date
 */
drawDate()
   {
   Rect bounds;

   TextFont(calFont);
   SetRect(&bounds, 0, 0, extent * 28, ascent + descent);
   OffsetRect(&bounds, extent, 2 * topping);
   EraseRect(&bounds);
   MoveTo(extent, 2 * topping + ascent);
   DrawText(dayNames[date.dayOfWeek - 1], 0, 
     strlen(dayNames[date.dayOfWeek - 1]));
   DrawChar(' ');
   DrawText(monthNames[date.month - 1], 0, 
      strlen(monthNames[date.month - 1]));
   DrawChar(' ');
   DrawString(numToString(date.day, 0));
   DrawChar(',');
   DrawString(numToString(date.year, 0));
   }

/*
 * draw time, set up tickTime for next minute update
 */
drawTime()
   {
   Rect bounds;

   TextFont(calFont);
   SetRect(&bounds, 0, 0, extent * 9, ascent + descent);
   OffsetRect(&bounds, titleR.right - 9 * extent + 1, 2 * topping);
   EraseRect(&bounds);
   MoveTo(titleR.right - 9 * extent + 1, 2 * topping + ascent);
   GetTime(&time);
   tickTime = TickCount() - time.second * 60 + 3600;
   DrawString(numToString((time.hour + 11) % 12 + 1, 2));
   DrawChar(':');
   DrawString(numToString(time.minute, -2));
   DrawChar(' ');
   DrawText("AMPM", (time.hour < 12) ? 0 : 2, 2);
   }

/*
 * utility routines
 */

/*
 * return minimum
 */
min(a, b)
   {
   return (a < b) ? a : b;
   }

/*
 * return length of string 
 */
strlen(s)
   char *s;
   {
   register char *p = s;
   register int n = 0;

   while (*p++)
      n++;
   return(n);
   }

/* 
 * return position of character 
 */
char *index(s, c)
   char *s;
   char c;
   {
   register char *p = s;
   register char n = c;

   while (*p && *p != n)
      p++;
   return(p);
   }

/*
 * convert number to string
 *    w == 0 -> no leading blanks or zeros
 *    w > 0  -> add leading blanks to make string length equal to w
 *    w < 0  -> add leading zeros to make string length equal to -w
 */
char *numToString(n, w)
   {
   if (!w)
      {
      NumToString(n, &blanks[strLen]);
      return &blanks[strLen];
      }
   else if (w > 0)
      {
      NumToString(n, &blanks[strLen]);
      return &blanks[strLen - w + strlen(&blanks[strLen])];
      }
   else
      {
      NumToString(n, &zeros[strLen]);
      return &zeros[strLen + w + strlen(&zeros[strLen])];
      }
   }
ounds, -(nh * point->h), point->v);
      }
   TextFace(0);
   }

/*
 * mouse rectangle, return cell number
 *    rect defines the rectangle
 *    point defines the size of each cell within the rectangle
 *    where defines the initial location of the mouse
 *    nh defines the number of columns
 *    nv defines the number of rows
 *    hori defines if cells are to be counted horizontally or vertically
 */
mouseRect(rect, point, where, nh, nv, hori)
   Rect *rect;
   Point *point;
   sumacc/mac/cal/crtcal.s   444      0     12        4250  3470501415  10234 |
| crtcal.s - self relocating C runtime startoff for Mac desk accessory
|
| Copyright (C) 1984, Stanford Univ. SUMEX project
| May be used but not sold without permission.
|
| history
| 07/20/84	Croft	Created.
| 07/26/84	Schuster	Customize for Calendar.
|
	.data
	.text
	.globl	_savea5
	.globl	drvr
	.globl	drvrOpen,drvrPrime,drvrCtl,drvrStatus,drvrClose

| driver header

drvr:
	.word	0x2400		| enable control, need time
	.word	15		| every 1/4 second
	.word	0x016a		| activate, update, autokey, keydown, mousedown
	.word	0		| menu
doffset:
	.word	reloc-drvr	| replaced by "dopen-drvr" after initialization
	.word	dprime-drvr
	.word	dctl-drvr
	.word	dstatus-drvr
	.word	dclose-drvr
	.byte	9
	.byte	0
	.ascii	"Calendar"
	.blkb	22		| 32 bytes total for name

reloc:	jra	.L21
	.long	0,0,0,0,0,0,0,0,0,0		| longruns from rmaker
_savea5:.long	0
|
| a1 = next longrun address
| a2 = current reloc address
| d1 = relocation factor
|
.L21:
	moveml	#0xffff,sp@-
	lea	pc@([drvr-.-2]),a1	| reloc factor
	movl	a1,d1
	lea	pc@([reloc+2-.-2]),a1
	movl	a1@+,a2		| pickup 1st relocation
	addl	d1,a2
.L16:
|	for(;;) {
|		i = *a2;
|		*a2 = 0;
|		*(u_long *)a2 += (u_long)d1;
|		if (i == 0377)
|			goto start;
|		if (i == 0) {
|			a2 = *a1++;
|			a2 += d1;
|			continue;
|		}
|		a2 += (i << 1);
|	}
	movb	a2@,d7
	andl	#255,d7
	clrb	a2@
	addl	d1,a2@
	cmpl	#255,d7
	beqs	.L18
	tstl	d7
	bnes	.L19
	movl	a1@+,a2
	addl	d1,a2
	bras	.L16
.L19:
	roll	#1,d7
	addl	d7,a2
	bras	.L16
|
| if shift button is pressed on entry, beep and hang around for an NMI.
|
.L18:
	btst	#0,0x17b
	beqs	.L31		| if not pressed
	movw	#1,sp@-		| sysbeep, duration 1
	.word	/A9C8
	moveq	#1,d0
.L22:
	tstl	d0
	bnes	.L22		| hang, waiting for NMI
.L31:
	movl	a5,_savea5
 	movw	doff2,doffset	| above code is once-only
	moveml	sp@+,#0xffff
|
| driver entry points
|
dopen:
	movl	#drvrOpen,d0
	bras	call
dclose:
	movl	#drvrClose,d0
	bras	call
dctl:
	movl	#drvrCtl,d0
	bras	call
dstatus:
	movl	#drvrStatus,d0
	bras	call
dprime:
	movl	#drvrPrime,d0
call:
	moveml	#0x3ffc,sp@-
	movl	a1,sp@-
	movl	a0,sp@-
	movl	d0,a0
	jsr	a0@
	addql	#8,sp
	moveml	sp@+,#0x3ffc
	cmpl	#0x40000000,d0
	bnes	done
	clrl	d0
	rts
jiodone = 0x8fc
done:
	movl	jiodone,sp@-
	rts
doff2:	.word	dopen-drvr
&bounds);
   MoveTo(titleR.right - 9 * extent + 1, 2 * topping + ascent);
   GetTime(&time);
   tickTime = TickCount() - time.second * 60 + 3600;
   DrawString(numToString((time.hour + 11) % 12 + 1, 2));
   DrawChar(':');
   DrawString(numToString(time.minute, -2));
   DrawChar(' ');
   DrawText("AMPM", (time.hour < 12) ? 0 : 2, 2);
   }

/*
sumacc/mac/cal/desk.rc   444      0     12         461  3470501416  10035 desk.rsrc

Type ALRT
  ,256(32)
  60 81 180 431
  256
  5555

Type DITL
  ,256(32)
  3
   BtnItem Enabled
   90 10 110 80
OK

   BtnItem Enabled
   90 270 110 340
Cancel

   StatText Disabled
   10 60 70 350
Replace system resource ^0 type=^1 id=^2?

Type DRVR
   cal|Calendar,31(48)

Type CODE
   desk,0
bl	drvrOpen,drvrPrime,drvrCtl,drvrStatus,drvrClose

| driver header

drvr:
	.word	0x2400		| enable control, need time
	.word	15		| every 1/4 second
	.word	0x016a		| activate, update, autokey, keydown, mousedsumacc/mac/cal/Makefile   444      0     12        1252  3470501416  10240 .SUFFIXES: .rsrc .b .ln .s .c
BIN=
INCLUDE=/usr/include/mac

CFILES = desk.c cal.c
HFILES = device.h
SFILES = crtcal.s

.c.b:
	$(BIN)cc68 -I$(INCLUDE) -c $<

.c.s:
	$(BIN)cc68 -I$(INCLUDE) -S $<

.s.b:
	$(BIN)cc68 -c $<

.c.ln:
	$(BIN)lint -I$(INCLUDE) -lmac $< > $*.ln

all: desk.rsrc

cal: cal.b crtcal.b 
	$(BIN)ld68 -X -r -d -e drvr -T 0 crtcal.b cal.b -lmac -lc -x -o cal

desk: desk.b
	$(BIN)cc68 -m desk.b -o desk

desk.rsrc: cal desk desk.rc
	$(BIN)rmaker desk.rc

put: desk.rsrc
	$(BIN)macput -r desk

lint: cal.ln desk.ln

desk.shar: $(CFILES) $(SFILES) $(HFILES)
	csh shar desk.shar $(CFILES) $(SFILES) $(HFILES) desk.rc Makefile

clean:
	rm -f *.b *.rsrc cal desk *- z


	.byte	9
	.byte	0
	.ascii	"Calendar"
	.blkb	22		| 32 bytes total for name

reloc:	jra	.L21
	.long	0,0,0,0,0,0,0,0,0,0		| longruns from rmaker
_savea5:.long	0
|
| a1 = next longrun address
| a2 = current reloc address
| d1 = relocation factor
|
.L21:
	moveml	#0xffff,sp@-
	lea	pc@([drvr-.-2]),a1	| reloc factor
	movl	a1,d1
	lea	pc@([reloc+2-.sumacc/mac/print/   775      0     12           0  3472710624   7121 sumacc/mac/print/README   444      0     12        3350  3470501416  10056 Date: 21 Aug 1984 11:44:27 PDT
Subject: Print desk accessory
From: Mike Schuster <sri-tsc!MIKES@CIT-20.ARPA>
To: info-mac@SUMEX-AIM.ARPA
Resent-Date: Tue 21 Aug 84 16:38:26-PDT
Resent-From: Ed Pattermann <sri-tsc!PATTERMANN@SUMEX-AIM.ARPA>
Resent-To: info-mac:;

Included below is the source for an experimental Print desk accessory that
prints TEXT files.  You can queue up several print requests and continue
running another application while print proceeds.  Print prints only plain
ascii text files, and not, for example, MacWrite files.

Make note of the following problems:

  1) Print resides in the applications heap, and hence when you quit the
     application, printing stops and all queued requests are lost.

  2) I tried forcing print to reside in the system heap, but I couldn't
     get it to work.  Maybe there is not enough room after an application
     is launched.  Any ideas?

  3) Since print has no window, there is no way to close print and reclaim
     memory.  Maybe Print can call CloseDeskAcc() itself when the print
     queue is empty, but this sounds dangerous.  Any ideas?

  4) Print will sometimes crash.  I haven't yet isolated the circumstances,
     so BEWARE.

  5) There is no way to cancel the current print and purge the print queue.
     Maybe the Cancel button in the Open dialog should do this.  A better
     way would be to add another button to the Open dialog.  Unfortunately,
     this is messy, since a new dialog resource would have to be added
     to the System file, and hence, Print would not be self-contained.
     Any suggestions?

Print is compiled and installed just like Calendar.  Use the latest
"cmd/rmaker.c" and "h/device.h" files released by Bill Croft.

Good Luck!
Mike (mikes@cit-20, mikes@cit-vax)
M.ARPA>
Resent-To: info-mac:;

Included below is the source for an experimental Print desk accessory that
prints TEXT files.  You can queue up several print requests and continue
running another application while print proceeds.  Print prints only plain
ascii text files, and not,sumacc/mac/print/desk.c   444      0     12       15630  3470501417  10315 /*
 * Desk accessory launcher/installer.
 *
 * (C) Copyright 1984 Michael Schuster
 * All Rights Reserved
 */

/*
 * 08/10/84	Schuster	Created
 * 08/21/84	Schuster	Search for unused resource id
 */

#include "quickdraw.h"
#include "osintf.h"
#include "toolintf.h"

#define NIL 0
#define FALSE 0
#define TRUE 1

#define minID 12
#define maxID 31

#define appleMenu 1
#define fileMenu 2
#define editMenu 3

#define closeItem 1
#define installItem 2
#define quitItem 3
#define undoItem 1
#define cutItem 3
#define copyItem 4
#define pasteItem 5
#define clearItem 6

MenuHandle menus[editMenu + 1];

main()
   {
   struct QDVar QDVar;
   EventRecord event;
   WindowPtr window;
   Rect dragRect;

   QD = &QDVar;
   InitGraf(&thePort);
   InitFonts();
   InitWindows();
   InitMenus();
   TEInit();

   dragRect = QD->screenBits.bounds; 

   menus[appleMenu] = NewMenu(appleMenu, "\24");
   AddResMenu(menus[appleMenu], "DRVR");
   InsertMenu(menus[appleMenu], 0);
   menus[fileMenu] = NewMenu(fileMenu, "File");
   AppendMenu(menus[fileMenu], "Close");
   AppendMenu(menus[fileMenu], "Install");
   AppendMenu(menus[fileMenu], "Quit");
   InsertMenu(menus[fileMenu], 0);
   menus[editMenu] = NewMenu(editMenu, "Edit");
   AppendMenu(menus[editMenu], "Undo/Z");
   AppendMenu(menus[editMenu], "(-");
   AppendMenu(menus[editMenu], "Cut/X");
   AppendMenu(menus[editMenu], "Copy/C");
   AppendMenu(menus[editMenu], "Paste/V");
   AppendMenu(menus[editMenu], "Clear/B");
   InsertMenu(menus[editMenu], 0);
   DrawMenuBar();

   SetCursor(&QD->arrow);
   while (TRUE)
      {
      SystemTask();
      if (FrontWindow())
         DisableItem(menus[fileMenu], installItem);
      else
         EnableItem(menus[fileMenu], installItem);

      if (!GetNextEvent(everyEvent, &event))
         continue;

      switch (event.what)
         {
         case mouseDown:
            switch (FindWindow(&event.where, &window))
               {
               case inMenuBar:
                  SetCursor(&QD->arrow);
                  commandEvent(MenuSelect(&event.where));
                  HiliteMenu(0);
                  break;

               case inSysWindow:
                  SystemClick(&event, window);
                  break;

               case inDrag:
                  DragWindow(window, &event.where, &dragRect);
                  break;

               case inGoAway:
                  if (TrackGoAway(window, &event.where))
                     commandEvent((fileMenu << 16) | closeItem);        
                  break;

               case inContent:
                  if (window != FrontWindow())
                     SelectWindow(window);
                  break;
               }
            break;

         case keyDown:
         case autoKey:
            if (event.modifiers & cmdKey)
               {
               commandEvent(MenuKey(event.message & 0xff));
               HiliteMenu(0);
               }
            break;
         }
      }
   }

commandEvent(menuItem)
   {
   WindowPtr window;
   int menu;
   int item;
   char name[64];
   char *c2pnstr();

   window = FrontWindow();
   SetPort(window);
   menu = HiWord(menuItem);
   item = LoWord(menuItem);

   switch (menu)
      {
      case appleMenu:
         GetItem(menus[appleMenu], item, name);
         OpenDeskAcc(c2pnstr(name));
         break;

      case fileMenu:
         switch (item)
            {
            case closeItem:
               CloseDeskAcc(((WindowPeek) window)->windowKind);
               break;

            case installItem:
               install();
               break;

            case quitItem:
               ExitToShell();
               break;    
            }
         break;

      case editMenu:
         switch (item)
            {
            case undoItem:
               SystemEdit(undoCmd);
               break;

            case cutItem:
               SystemEdit(cutCmd);
               break;

            case copyItem:
               SystemEdit(copyCmd);
               break;

            case pasteItem:
               SystemEdit(pasteCmd);
               break;

            case clearItem:
               SystemEdit(clearCmd);
               break;      
            }
         break;
      }
   }

/* install local drivers as system drivers */
install()
   {
   int i;
   int j;
   int k;
   int rsrc;
   Handle oldHandle;
   Handle handle;
   Handle drivers[16];
   ResType type;
   int id;
   int newId;
   int oldId;
   int attrs;
   char name[256];

   j = CountResources("DRVR");
   k = 0;
   rsrc = CurResFile();
   SetResLoad(FALSE);
   for (i = 1; i <= j; i++)
      {
      handle = GetIndResource("DRVR", i);
      if (handle)
         {
         ReleaseResource(handle);
         handle = GetIndResource("DRVR", i);
         }
      if (handle && HomeResFile(handle) == rsrc)
         drivers[++k] = handle;
      }
   SetResLoad(TRUE);

   for (i = 1; i <= k; i++)
      {
      UseResFile(rsrc);
      LoadResource(drivers[i]);
      handle = NewHandle(GetHandleSize(drivers[i]));
      if (!MemError())
         {
         BlockMove(*drivers[i], *handle, GetHandleSize(handle));
         GetResInfo(drivers[i], &id, type.s, name);
         attrs = GetResAttrs(drivers[i]);
         ReleaseResource(drivers[i]);
         UseResFile(0);

         if (oldHandle = GetNamedResource("DRVR", name))
            {
            GetResInfo(oldHandle, &oldId, type.s, name);
            UseResFile(rsrc);
            if (installAlert(name, "DRVR", oldId) == 2)
               continue;
            UseResFile(0);
            RmveResource(oldHandle);
            DisposHandle(oldHandle);
            id = oldId;
            }
         else
            {
	    SetResLoad(FALSE);
	    newId = minID;
	    while (newId <= maxID && (oldHandle = GetResource("DRVR", newId)))
	       {
	       ReleaseResource(oldHandle);
	       newId++;
	       }
	    SetResLoad(TRUE);
	    id = (newId <= maxID) ? newId : id;

	    if (oldHandle = GetResource("DRVR", id))
	       {
	       UseResFile(rsrc);
	       if (installAlert(name, "DRVR", id) == 2)
		  continue;
	       UseResFile(0);
	       RmveResource(oldHandle);
	       DisposHandle(oldHandle);
	       }
            }

         AddResource(handle, "DRVR", id, name);
         if (!ResError())
            {
            WriteResource(handle);
            SetResAttrs(handle, attrs);
            }
         }
      else
         ReleaseResource(drivers[i]);
      }
   UpdateResFile(0);
   UseResFile(rsrc);
   }

/* install alert */
installAlert(name, type, id)
   char *name;
   char *type;
   int id;
   {
   char idstring[16];

   NumToString(id, idstring);
   ParamText(name, type, idstring, "");
   return CautionAlert(256, (ProcPtr) NIL);
   }

/* convert a C string to a Pascal string with a leading NUL character */
char *c2pnstr(s)
   char *s;
   {
   extern char *isapstr();
   char *t;
   int i;
   int j;

   i = 0;
   while (*s++)
     i++;
   j = i;
   t = s - 2;
   while (j--)
      *s-- = *t--;
   *s-- = 0;
   *s = (char) i + 1;
   return(isapstr(s));
   }

ntally or vertically
 */
mouseRect(rect, point, where, nh, nv, hori)
   Rect *rect;
   Point *point;
   sumacc/mac/print/print.c   444      0     12       10656  3470501417  10526 /*
 * Print desk accessory
 *
 * (C) Copyright 1984 Michael Schuster
 * All Rights Reserved
 *
 */

/*
 * 08/21/84	Schuster	Created
 */

#include "quickdraw.h"
#include "osintf.h"
#include "toolintf.h"
#include "packintf.h"
#include "device.h"

#define NIL 0
#define FALSE 0
#define TRUE 1

#define pageLen 62
#define topOfForm pChar('\014')
#define topSpace pChar('\n'); pChar('\n')

typedef struct
   {
   int volumn;			/* file volumn */
   char name[64];		/* file name */
   } File;

#define queueLen 8
File queue[queueLen];		/* file queue */

int indent;			/* indentation counter for tab handler */
int lines;			/* line counter for top of form handler */
#define bufferLen 64
char buffer[bufferLen];		/* io buffer */

int port;			/* printer port ID */
int file;			/* file ID */
int open;			/* TRUE if file open */

int inSFGetFile;		/* TRUE if SFGetFile dialog active */
   
/*
 * file routines
 */

/*
 * put a file into the queue
 */
putFile(name, length, volumn)
   char *name;
   {
   register int i;

   for (i = 0; i < queueLen; i++)
      {
      if (!*queue[i].name)
         {
	 BlockMove(name, queue[i].name, length);
         queue[i].name[length] = '\0';
	 queue[i].volumn = volumn;
	 return;
	 }
      }
   }

/*
 * get a file from the queue, if any
 */
getFile()
   {
   register int i;

   if (open)
      return TRUE;
   else
      {
      for (i = 0; i < queueLen; i++)
	 {
	 if (*queue[i].name)
	    {
	    open = 
               (FSOpen(queue[i].name, queue[i].volumn, &file)) ? FALSE : TRUE;
	    if (open)
	       {
	       pChar('\033');		/* software reset */
	       pChar('c');
	       topSpace;
	       }
            *queue[i].name = 0;
	    lines = indent = 0;
	    return open;
	    }
	 }
      return FALSE;
      }
   }

/*
 * close the open file and optionally purge all files from the queue
 */
closeFile(purge)
   {
   register int i;

   if (open)
      {
      topOfForm;
      FSClose(file);
      }
   open = FALSE;

   if (purge)
      for (i = 0; i < queueLen; i++)
	 *queue[i].name = 0;
   }

/*
 * driver routines
 */

/*
 * driver open routine
 */
drvrOpen(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   Point point;
   SFReply sfReply;
   SFTypeList sfTypeList;

   FSOpen(".BOut", 0, &port);
   SetPt(&point, 50, 50);
   inSFGetFile = TRUE;
   BlockMove("TEXT", sfTypeList.ftype[0].s, 4);
   SFGetFile(&point,"",(ProcPtr)NIL,1,(Ptr)&sfTypeList,(ProcPtr)NIL,&sfReply);
   inSFGetFile = FALSE;
   if (sfReply.good)
      putFile(&sfReply.fName[1], sfReply.fName[0], sfReply.vRefNum);
   return(ioRTS);
   }

/*
 * driver close routine
 */
drvrClose(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   closeFile(FALSE);
   return(ioRTS);
   }

/*
 * driver control routine
 */
drvrCtl(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   int chars;

   switch (pb->csCode)
      {
      case accRun:
         if (inSFGetFile)
            ;
	 else if (getFile() && !portHeldUp())
            {
            chars = bufferLen;
	    FSRead(file, &chars, buffer);
	    if (chars)
	       pText(chars, buffer);
	    else
	       closeFile(FALSE);
	    }
         else
            ; /* CloseDeskAcc(dce->dCtlRefNum); */
         break;
      }
   return(ioRTS);
   }

/*
 * return TRUE if port held up
 */
portHeldUp()
   {
   CSParam param;

   Status(port, 8, &param);
   return param.serStaRec.ctsHold;
   }

/*
 * write char to port
 */
pChar(c)
   char c;
   {
   int chars;

   chars = 1;
   FSWrite(port, &chars, &c);
   }

/*
 * write text to port
 */
pText(chars, buffer)
   char *buffer;
   {
   register char *b;
   register char *p;
   register char *e;

   b = p = e = buffer;
   e += chars;
   while (p < e)
      {
      if (*p == '\r')
         {
	 *p++ = '\n';
         indent = 0;
	 lines++;
	 if (!(lines % pageLen))
	    {
	    chars = p - b;
	    FSWrite(port, &chars, b);
	    b = p;
	    topOfForm;
	    topSpace;
	    }
         }
      else if (*p == '\t')
         {
         chars = p - b;
	 FSWrite(port, &chars, b);
	 b = ++p;
	 chars = 8 - (indent % 8);
	 FSWrite(port, &chars, "        ");
	 indent += chars;
         }
      else if (*p < '\040' || *p > '\176')
         {
	 *p++ = ' ';
	 indent++;
	 }
      else
	 {
         p++;
	 indent++;
	 }
      }
   chars = p - b;
   FSWrite(port, &chars, b);
   }

/*
 * driver status routine
 */
drvrStatus(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   return(ioRTS);
   }

/*
 * driver prime routine
 */
drvrPrime(pb, dce)
   CntrlParam *pb;
   DCtlEntry *dce;
   {
   return(ioRTS);
   }
tFile(name, length, volumn)
   char *name;
   {
   register int i;

   for (i = 0;sumacc/mac/print/crtprint.s   444      0     12        4171  3470501417  11232 |
| crtterm.s - self relocating C runtime startoff for Mac desk accessory
|
| Copyright (C) 1984, Stanford Univ. SUMEX project
| May be used but not sold without permission.
|
| history
| 07/20/84	Croft	Created.
| 08/21/84	Schuster	Customize for Print.
|
	.data
	.text
	.globl	_savea5
	.globl	drvr
	.globl	drvrOpen,drvrPrime,drvrCtl,drvrStatus,drvrClose

| driver header

drvr:
	.word	0x2400		| enable control, need time
	.word	60		| every second
	.word	0		| no events
	.word	0		| no menu
doffset:
	.word	reloc-drvr	| replaced by "dopen-drvr" after initialization
	.word	dprime-drvr
	.word	dctl-drvr
	.word	dstatus-drvr
	.word	dclose-drvr
	.byte	6
	.byte	0
	.ascii	"Print"
	.blkb	25		| 32 bytes total for name

reloc:	jra	.L21
	.long	0,0,0,0,0,0,0,0,0,0		| longruns from rmaker
_savea5:.long	0
|
| a1 = next longrun address
| a2 = current reloc address
| d1 = relocation factor
|
.L21:
	moveml	#0xffff,sp@-
	lea	pc@([drvr-.-2]),a1	| reloc factor
	movl	a1,d1
	lea	pc@([reloc+2-.-2]),a1
	movl	a1@+,a2		| pickup 1st relocation
	addl	d1,a2
.L16:
|	for(;;) {
|		i = *a2;
|		*a2 = 0;
|		*(u_long *)a2 += (u_long)d1;
|		if (i == 0377)
|			goto start;
|		if (i == 0) {
|			a2 = *a1++;
|			a2 += d1;
|			continue;
|		}
|		a2 += (i << 1);
|	}
	movb	a2@,d7
	andl	#255,d7
	clrb	a2@
	addl	d1,a2@
	cmpl	#255,d7
	beqs	.L18
	tstl	d7
	bnes	.L19
	movl	a1@+,a2
	addl	d1,a2
	bras	.L16
.L19:
	roll	#1,d7
	addl	d7,a2
	bras	.L16
|
| if shift button is pressed on entry, beep and hang around for an NMI.
|
.L18:
	btst	#0,0x17b
	beqs	.L31		| if not pressed
	movw	#1,sp@-		| sysbeep, duration 1
	.word	/A9C8
	moveq	#1,d0
.L22:
	tstl	d0
	bnes	.L22		| hang, waiting for NMI
.L31:
	movl	a5,_savea5
 	movw	doff2,doffset	| above code is once-only
	moveml	sp@+,#0xffff
|
| driver entry points
|
dopen:
	movl	#drvrOpen,d0
	bras	call
dclose:
	movl	#drvrClose,d0
	bras	call
dctl:
	movl	#drvrCtl,d0
	bras	call
dstatus:
	movl	#drvrStatus,d0
	bras	call
dprime:
	movl	#drvrPrime,d0
call:
	moveml	#0x3ffc,sp@-
	movl	a1,sp@-
	movl	a0,sp@-
	movl	d0,a0
	jsr	a0@
	addql	#8,sp
	moveml	sp@+,#0x3ffc
	cmpl	#0x40000000,d0
	bnes	done
	clrl	d0
	rts
jiodone = 0x8fc
done:
	movl	jiodone,sp@-
	rts
doff2:	.word	dopen-drvr

   SFReply sfReply;
   SFTypeList sfTypeList;

   FSOpen(".BOut", 0, &port);
   SetPt(&point, 50, 50);
   inSFGetFile = TRUE;
   BlockMove("TEXT", sfTypeList.ftype[0].s, 4);
   SFGetFile(&point,"",(ProcPtr)NIL,1,(Ptr)&sfTypeList,(ProcPtr)NIL,&sfReply);
   inSFGetFile = FALSE;
   if (sfReply.good)
      putFile(&sfReply.fName[1], sfReply.fName[0], sfReply.vRefNum);
   return(ioRTS);
   }
sumacc/mac/print/desk.rc   444      0     12         460  3470501417  10432 desk.rsrc

Type ALRT
  ,256(32)
  60 81 180 431
  256
  5555

Type DITL
  ,256(32)
  3
   BtnItem Enabled
   90 10 110 80
OK

   BtnItem Enabled
   90 270 110 340
Cancel

   StatText Disabled
   10 60 70 350
Replace system resource ^0 type=^1 id=^2?

Type DRVR
   print|Print,30(48)

Type CODE
   desk,0
l	drvrOpen,drvrPrime,drvrCtl,drvrStatus,drvrClose

| driver header

drvr:
	.word	0x2400		| enable control, need time
	.word	60		| every second
	.word	0		| no events
	.word	0		| no menu
doffset:
	.word	reloc-dsumacc/mac/print/Makefile   444      0     12        1255  3470501417  10641 .SUFFIXES: .rsrc .b .ln .s .c
BIN=
INCLUDE=/usr/include/mac

CFILES = desk.c print.c
SFILES = crtprint.s

.c.b:
	$(BIN)cc68 -I$(INCLUDE) -c $<

.c.s:
	$(BIN)cc68 -I$(INCLUDE) -S $<

.s.b:
	$(BIN)cc68 -c $<

.c.ln:
	$(BIN)lint -I$(INCLUDE) -lmac $< > $*.ln

all: desk.rsrc

print: print.b crtprint.b 
	$(BIN)ld68 -X -r -d -e drvr -T 0 crtprint.b print.b -lmac -lc -x -o print

desk: desk.b
	$(BIN)cc68 -m desk.b -o desk

desk.rsrc: print desk desk.rc
	$(BIN)rmaker desk.rc

put: desk.rsrc
	$(BIN)macput -o -r desk

lint: print.ln desk.ln

desk.shar: $(CFILES) $(SFILES) desk.rc Makefile
	shar desk.shar $(CFILES) $(SFILES) desk.rc Makefile >x.shar

clean:
	rm -f *.b *.rsrc print desk

 32 bytes total for name

reloc:	jra	.L21
	.long	0,0,0,0,0,0,0,0,0,0		| longruns from rmaker
_savea5:.long	0
|
| a1 = next longrun address
| a2 = current reloc address
| d1 = relocation factor
|
.L21:
	moveml	#0xffff,sp@-
	lea	pc@([drvr-.-2]),a1	| reloc factor
	movl	a1,d1
	lea	pc@([reloc+2-.-2]),a1
	movl	a1@+,a2		| pickup 1st relocation
sumacc/mac/ramdisk/   775      0     12           0  3472710627   7422 sumacc/mac/ramdisk/crtdrvr.s   444      0     12        4105  3470501420  11340 |
| crtdrvr.s - self relocating C runtime startoff for Mac device driver.
|
| Copyright (C) 1984, Stanford Univ. SUMEX project
| May be used but not sold without permission.
|
| history
| 07/20/84	Croft	Created.
|
	.data
	.text
	.globl	_savea5
	.globl	drvr
	.globl	drvrOpen,drvrPrime,drvrCtl,drvrStatus,drvrClose

| driver header

drvr:
	.word	0x4f00		| locked, read, write, ctrl, status
	.word	0
	.word	0		| delay, emask
	.word	0		| menu
doffset:
	.word	reloc-drvr	| replaced by "dopen-drvr" after initialization
	.word	dprime-drvr
	.word	dctl-drvr
	.word	dstatus-drvr
	.word	dclose-drvr
	.byte	8
	.ascii	".cdriver "
	.blkb	22		| 32 bytes total for name

reloc:	jra	.L21
	.long	0,0,0,0,0,0,0,0,0,0		| longruns from rmaker
_savea5:.long	0
|
| a1 = next longrun address
| a2 = current reloc address
| d1 = relocation factor
|
.L21:
 	moveml	#0xffff,sp@-
	lea	pc@([drvr-.-2]),a1	| reloc factor
	movl	a1,d1
	lea	pc@([reloc+2-.-2]),a1
	movl	a1@+,a2		| pickup 1st relocation
	addl	d1,a2
.L16:
|	for(;;) {
|		i = *a2;
|		*a2 = 0;
|		*(u_long *)a2 += (u_long)d1;
|		if (i == 0377)
|			goto start;
|		if (i == 0) {
|			a2 = *a1++;
|			a2 += d1;
|			continue;
|		}
|		a2 += (i << 1);
|	}
	movb	a2@,d7
	andl	#255,d7
	clrb	a2@
	addl	d1,a2@
	cmpl	#255,d7
	beqs	.L18
	tstl	d7
	bnes	.L19
	movl	a1@+,a2
	addl	d1,a2
	bras	.L16
.L19:
	roll	#1,d7
	addl	d7,a2
	bras	.L16
|
| if shift button is pressed on entry, beep and hang around for an NMI.
|
.L18:
	btst	#0,0x17b
	beqs	.L31		| if not pressed
	movw	#1,sp@-		| sysbeep, duration 1
	.word	/A9C8
	moveq	#1,d0
.L22:
	tstl	d0
	bnes	.L22		| hang, waiting for NMI
.L31:
	movl	a5,_savea5
	movw	doff2,doffset	| above code is once-only
 	moveml	sp@+,#0xffff
|
| driver entry points
|
dopen:
	movl	#drvrOpen,d0
	bras	call
dclose:
	movl	#drvrClose,d0
	bras	call
dctl:
	movl	#drvrCtl,d0
	bras	call
dstatus:
	movl	#drvrStatus,d0
	bras	call
dprime:
	movl	#drvrPrime,d0
call:
	moveml	#0x3ffc,sp@-
	movl	a1,sp@-
	movl	a0,sp@-
	movl	d0,a0
	jsr	a0@
	addql	#8,sp
	moveml	sp@+,#0x3ffc
	cmpl	#0x40000000,d0
	bnes	done
	clrl	d0
	rts

jiodone = 0x8fc
done:
	movl	jiodone,sp@-
	rts

doff2:	.word	dopen-drvr
l	d0
	bnes	.L22		| hang, waiting for NMI
.L31:
	movl	a5,_savea5
 	movw	doff2,doffset	| above code is once-only
	moveml	sp@+,#0xffff
|
| driver entry points
|
dopen:
	movl	#drvrOpen,d0
	bras	call
dclose:
	movl	#drvrClose,d0
	bras	call
dctl:
	movl	#drvrCtl,d0
	bras	call
dstatus:
	movl	#drvrStatus,d0
	bras	call
dprime:
	movl	#drvrPrime,d0
call:
	moveml	#0x3ffc,sp@-
	movl	a1,sp@-
	movl	a0,sp@-
	movl	d0,a0
	jsr	a0@
	addql	#8,sp
	moveml	sp@+,#0xsumacc/mac/ramdisk/h.h   444      0     12         123  3470501420  10042 	.insrt	"../../h/toolmacs.h"
	.insrt	"../../h/sysequ.h"
	.insrt	"../../h/syserr.h"
	8
	.ascii	".cdriver "
	.blkb	22		| 32 bytes total for name

reloc:	jra	.L21
	.long	0,0,0,0,0,0,0,0,0,0		| longruns from rmaker
_savea5:.long	0
|
| a1 = next longrun address
| a2 = current reloc address
| d1 = relocation factor
|
.L21:
 	moveml	#0xffff,sp@-
	lea	pc@([drvr-.-2]),a1	| reloc factor
	movl	a1,d1
	lea	pc@([reloc+2-.-2]),a1
	movl	a1@+,a2		| pickup 1st relocation
	addl	d1,a2
.L16:
|	for(;;) {
|		i = *a2;
|		*a2 = 0;
sumacc/mac/ramdisk/rdinit.s   444      0     12        3625  3470501421  11152 |
| rdinit.s - init resource to bring in ramdisk driver at boot time
|

	.nlist
	.insrt	"h.h"
	.list

|
| code below lifted from crtmac.s
|

	.text
	.globl	_start,_savea5
_start:	jra	.L21
	.long	0,0,0,0,0,0,0,0,0,0		| longruns from rmaker
_savea5:.long	0
|
| a1 = next longrun address
| a2 = current reloc address
| d1 = relocation factor
|
.L21:
	moveml	#0xffff,sp@-
	lea	pc@([_start-.-2]),a1	| reloc factor
	movl	a1,d1
	lea	pc@([_start+2-.-2]),a1
	movl	a1@+,a2		| pickup 1st relocation
	addl	d1,a2
.L16:
|	for(;;) {
|		i = *a2;
|		*a2 = 0;
|		*(u_long *)a2 += (u_long)d1;
|		if (i == 0377)
|			goto start;
|		if (i == 0) {
|			a2 = *a1++;
|			a2 += d1;
|			continue;
|		}
|		a2 += (i << 1);
|	}
	movb	a2@,d7
	andl	#255,d7
	clrb	a2@
	addl	d1,a2@
	cmpl	#255,d7
	beqs	.L18
	tstl	d7
	bnes	.L19
	movl	a1@+,a2
	addl	d1,a2
	bras	.L16
.L19:
	roll	#1,d7
	addl	d7,a2
	bras	.L16
.L18:

|
| rdinit
|

	.text
rdinit:
|	movl	#0x11000,bufptr
	moveq	#[ioqelsize/2]-1,d0
0$:	clrw	sp@-	| clear a parameter blk off the stack
	dbra	d0,0$

	clrw	sp@-
	.word	__button
	tstw	sp@+
	bne	initexit	|if user wants to skip the ramdisk

	movl	sp,a0
	lea	rdname,a1
	movl	a1,a0@(iofilename)
	.word	__open
	bne	initexit

	clrl	sp@-
	movl	rdtype,sp@-
	movw	#31,sp@-
	.word	__getresou
	.word	__detachre
|
| add to drive queue
|
	moveq	#dqellnth,d0	| get size of drive queue element
	.word	__newptr+_sys_	|	and allocate one
	movw	#0,a0@(dqfsid)	| zero means local file system
	moveq	#3,d0	| call it drive number 3
	swap	d0
	movw	#-32,d0	|	my refnum
	.word	__adddrive

	lea	mparams,a0	| point to params
	.word	__mountvol	| mount as a volume

initexit:
	addw	#ioqelsize,sp
	lea	_start,a0
	.word	__recoverhandle
	.word	__disposhandle
	moveml	sp@+,#0xffff
	rts

	.even
rdtype:	.ascii	"DRVR"
	.even
rdname:	.byte	8
	.ascii	".ramdisk "
	.even

mparams:
	.blkb	12	| header
	.word	0,0	| completion routine	(nil)
	.word	0	| ioresult
	.word	0,0	| misc don't-cares
	.word	3	| drive num
@-
	movl	d0,a0
	jsr	a0@
	addql	#8,sp
	moveml	sp@+,#0x3ffc
	cmpl	#0x40000000,d0
	bnes	done
	clrl	d0
	rts

jisumacc/mac/ramdisk/rd.c   444      0     12        6022  3470501421  10240 /*
 * MacIntosh RAM Disk Driver
 * (c) Apple Computer 1983
 * 
 * This is the unofficial Mac ramdisk driver.  Most useful on 512K Macs
 * Written in Dec '83 my MDB
 * 
 * Routines:
 * 
 *  Open   --  Zero the ram and create a  directory
 * 
 *  Prime  -- read and write calls.  Get correct info from read or write param
 *            block, and get or put the bytes.  All calls are synchronous, since
 *            ram doesn't have a lot of latency.
 * 
 *  Close  -- Not closable at present 
 */

/*
 * history
 * 12/xx/83	MDB	Created.
 * 07/21/84	Croft	translated to C.
 */

#include "mac/quickdraw.h"
#include "mac/osintf.h"
#include "mac/device.h"

/*
 * for small mac, disk is kept in heap, so use bootconfig 
 * to up sysheap from 16K to 24K;  sigh, but then MacPaint/MacTerm are too big.
 */
#define	myramSize 0x2000	/* 8K */

#define	asize	512		/* allocation block size */
#define	dblocks	5		/* 0,1=boot;2,3=mdb;4=fdir */
#define	ablocks	myramSize/asize - dblocks

struct DR {
	char	drSigWord[2];		/* signature */
	long	drCrDate;		/* creation date/time*/
	long	drLsBkUp;		/* last backup */
	short	drAtrb;			/* attributes */
	short	drNmFls;		/* number of files in dir */
	short	drDirSt;		/* 1st file directory block */
	short	drBlLn;			/* length of file dir in blocks */
	short	drNmAlBlks;		/* number of allocation blocks */
	long	drAlBlkSiz;		/* alloc block size */
	long	drClpSiz;		/* bytes to try to alloc as clump */
	short	drAlBlSt;		/* 1st data block */
	long	drNxtFNum;		/* next free file number */
	short	drFreeBks;		/* number free blocks */
	char	drVN[28];		/* volume name */
};

struct DR myDir = {
	0xd2, 0xd7,			/* signature */
	0,
	0,
	0,
	0,
	4,				/* 1st file dir block */
	1,				/* # dir blocks */
	ablocks,			/* # alloc blocks */
	asize,				/* alloc block size */
	asize,				/* clump size */
	5,				/* 1st data block */
	1,				/* next file # */
	ablocks,			/* # free blocks */
	"\07RamDisk"
};

Ptr	myramBase, NewPtrSys();



/*
 * driver Open.
 */
drvrOpen(pb,dce)
	IOParam *pb;
	DCtlEntry *dce;
{
	if ((myramBase = NewPtrSys(myramSize)) == 0)
		return (mFulErr);
	bzero(myramBase,myramSize);
	bcopy(&myDir,myramBase+1024,sizeof myDir);
	return (ioRTS);
}


/*
 * driver Close.
 */
drvrClose(pb,dce)
	IOParam *pb;
	DCtlEntry *dce;
{
	return (ioRTS);
}


/*
 * driver Prime.
 */
drvrPrime(pb,dce)
	register IOParam *pb;
	register DCtlEntry *dce;
{
	register char *cp;
	register count;

	cp = myramBase + (dce->dCtlPosition & (~0x1ff)); /* truncate offset */
	count = pb->ioActCount = pb->ioReqCount;
	count = (count + 0x1ff) & (~0x1ff);	/* round to 512 mult */
	switch (pb->ioTrap & 0xff) {

	case aWrCmd:
		bcopy(pb->ioBuffer, cp, count);
		break;

	case aRdCmd:
		bcopy(cp, pb->ioBuffer, count);
		break;
	}
	return (ioDone);
}


/*
 * driver Control.
 */
drvrCtl(pb,dce)
	register CntrlParam *pb;
	register DCtlEntry *dce;
{
	switch (pb->csCode) {
	case killCode:
		return (ioKill);

	case ejectCode:
	default:
		return (controlErr);
	}
}


/*
 * driver Status.
 */
drvrStatus(pb,dce)
	register CntrlParam *pb;
	register DCtlEntry *dce;
{
	return (controlErr);
}
creation date/time*/
	long	drLsBkUp;		/* last backup */
	short	drAtrb;			/* attributes */
	short	drNmFls;		/* number of files in dir */
	short	drDirSt;		/* 1st file directory block */
	short	drBlLn;			/* length of file dir in blocks */
	short	drNmAlBlks;		/* number of allocation blocks */
	long	drAlBlkSiz;		/* alloc block size */
	long	drClpSiz;		/* bytes to try to alloc as clump */
	short	drAlBlSt;		/* 1st data block */
	long	drNxtFNum;		/* next free file number */
	short	drFreeBks;		/* nsumacc/mac/ramdisk/rdlib.s   444      0     12         512  3470501421  10725 	.insrt	"h.h"

	.text
	.globl	NewPtrSys
NewPtrSys:
	movl	sp@(4),d0
	.word	__newptr+_sys_
	movl	a0,d0
	rts

	.globl	bcopy
bcopy:
	movl	sp@(4),a0
	movl	sp@(8),a1
	movl	sp@(12),d0
	subql	#1,d0
.L1:
	movb	a0@+,a1@+
	dbra	d0,.L1
	rts

	.globl	bzero
bzero:
	movl	sp@(4),a0
	movl	sp@(8),d0
	subql	#1,d0
.L2:
	clrb	a0@+
	dbra	d0,.L2
	rts
ter char *cp;
	register count;

	cp = myramBase + (dce->dCtlPosition & (~0x1ff)); /* truncate offset */
	count = pb->ioActCount = pb->ioReqCount;
	count = (count + 0x1ff) & (~0x1ff);sumacc/mac/ramdisk/Makefile   444      0     12         642  3470501421  11111 .SUFFIXES: .rsrc .b

.c.b:
	cc68 -O -c $<

#	turns .s into .b and strips about 700 useless abs symbols
.s.b:
	cc68 -c $<
	ld68 -r -x -T 0 $*.b
	mv b.out $*.b

all:	rd.rsrc

rd.rsrc: rd.b rdlib.b crtdrvr.b rdinit.b rd.rc
	ld68 -X -r -d -e drvr -T 0 crtdrvr.b rd.b rdlib.b -lmac -lc -x 
	mv b.out rd.out
	ld68 -X -r -d -e _start -T 0 rdinit.b -x 
	mv b.out rdinit.out
	rmaker $*.rc

clean:
	rm  -f *.b *.rsrc *.out *.dl
ncate offset */
	count = pb->ioActCount = pb->ioReqCount;
	count = (count + 0x1ff) & (~0x1ff);sumacc/mac/ramdisk/rd.rc   444      0     12          77  3470501421  10366 rd.rsrc

Type DRVR
   rd.out,31(64)

Type INIT
   rdinit.out,3
nd strips about 700 useless abs symbols
.s.b:
	cc68 -c $<
	ld68 -r -x -T 0 $*.b
	mv b.out $*.b

all:	rd.rsrc

rd.rsrc: rd.b rdlib.b crtdrvr.b rdinit.b rd.rc
	ld68 -X -r -d -e drvr -T 0 crtdrvr.b rd.b rdlib.b -lmac -lc -x 
	mv b.out rd.out
	ld68 -X -r -d -e _start -T 0 rdinit.b -x 
	mv b.out rdinit.out
	rmaker $*.rc

clean:
	rm  -f *.b *.rsrc *.out *.dl
ncate offset */
	count = pb->ioActCount = pb->ioReqCount;
	count = (count + 0x1ff) & (~0x1ff);sumacc/mac/ramdisk/512k   444      0     12        3203  3470501421  10072 (Message inbox:440)
Return-Path: <CROFT@SUMEX-AIM.ARPA>
Received: from SUMEX-AIM.ARPA by safe with TCP; Mon, 12 Nov 84 10:11:25 pst
Date: Mon 12 Nov 84 10:10:53-PST
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [breuel@harvard.ARPA (Thomas M. Breuel):]
To: croft@SUMEX-AIM.ARPA

Mail-From: PATTERMANN created at 11-Nov-84 22:48:29
Return-Path: <breuel@harvard.ARPA>
Received: from harvard.ARPA by SUMEX-AIM.ARPA with TCP; Sun 11 Nov 84 18:10:44-PST
Date: Sun, 11 Nov 84 21:09:17 EST
From: breuel@harvard.ARPA (Thomas M. Breuel)
Apparently-To: info-mac
ReSent-date: Sun 11 Nov 84 22:48:29-PST
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;

I had some trouble installing the ramdisk driver from the new release of
the sumacc system. The problem seems to be that the call to allocate
space for the ramdisk in the system heap zone fails if the requested size
is at all significant. The system heap size cannot be extended beyond
64kbytes. I fixed it as follows:

rd.c:

substitute the statement 'if((myrambase = NewPtrSys...))...;' with
'myramBase = 0x28000' (for 512k Macs and 512k LISAs). Substitute the
directive '#define myramSize 0x2000' with '#define myramSize 0x27b00'
(for 512k LISA's with debugger installed). For different configurations
you'll have to figure out 'myramSize' by looking at the variable 'bufptr'
in the syscom area (at address $10c). Define 'myramSize' as the difference
of 'bufptr' and '0x28000'. The ws source claims that for 512k Macs you 
can '#define myramSize 0x50000'.

rdinit.s:

substitute the line '| movl #0x11000,bufptr' with ' movl #0x28000,bufptr'.

						Thomas.
						(breuel@harvard)
-------

			/* 1st file dir block */
	1,				/* # dir blocks */
	ablocks,			/* # alloc blocks */
	asize,				/* alloc block size */
	asize,				/* clump size */
	5,				/* 1st data block */
	1,				/* next file # */
	ablocks,			/* # free blocks */
	"\07RamDisk"
};

Ptr	myramBase, NewPtrSys();



/*
 * driver Open.
 */
drvrOpen(pb,dce)
	IOParam *pb;
	DCtlEntry *dce;
{
	if ((myramBase = NewPtrSsumacc/mac/ramdisk/rdinit.bugs   444      0     12        3646  3470501422  11654 (Message inbox:50)
Return-Path: <@SUMEX-AIM.ARPA:SY.BILL%CU20B@COLUMBIA>
Received: from SUMEX-AIM.ARPA by safe with TCP; Tue, 13 Nov 84 18:08:59 pst
Received: from columbia.arpa by SUMEX-AIM.ARPA with TCP; Tue 13 Nov 84 18:08:36-PST
Received: from CU20B.ARPA by columbia.arpa; Tue, 13 Nov 84 21:07:55 est
Date: Tue 13 Nov 84 21:08:56-EST
From: Bill Schilit <Sy.Bill%CU20B@COLUMBIA.ARPA>
Subject: New SUMACC
To: croft@SUMEX-AIM.ARPA


Just finished installing the new sumacc tar tape and here are a few
comments:

	
 In hangman "DocumentProc" should be "documentProc."

 You mention "gw" and "info" in the top-level read me file but they don't
 exist.

 In your ramdisk driver there is a problem in the rdinit.s stuff.  When you
 allocate the drive queue element it should be 2 bytes larger to include
 the field containing the number of 512 byte blocks on the drive.  These
 bytes aren't present for the sony drives (1&2) but cause all sorts of
 problems for other drives.  This is one thing that prevents you from
 dragging one disk on top of the ram disk to entirely replace its contents.

 Chris Maio and I made a small change to rmaker which might be worth
 preserving... When compiling type "DRVR" if the name starts with a "."
 then suppress the null which is usually inserted.  This NULL stuff is
 really a pain when you are installing a device driver, it makes apparently
 ramdom things happen since the driver can't be found and then appears in
 the apple window!  The source is in CU20B::PS:<SY.BILL>RMAKER.C.

 If you are going to keep a bugs file or something like that, then it would
 be nice to mention the problem with "SET FILE" -- if you are trying to set
 an author name of less than 4 characters it never works.  This appears to
 be a pascal fixed array of char [1..4] bogosity.  Best ALWAYS to keep
 those names four chars.  This has causes me hours of grief when trying
 to make an ICON come up which was keyed on "SBL"

- Bill
-------

x28000'. The ws source claims that for 512k Macs you 
can '#define myramSize 0x50000'.

rdsumacc/mac/ramdisk/rdinit.text   444      0     12        4205  3470501422  11670 ; I'm lazy and hacked this together from some pieces on the workshop,
; should convert to SUMacC...
; File: rdInit.Text - init resource to bring in ramdisk driver at boot time

            .NoList
            .Include        Tlasm/SysEqu.Text
            .Include        Tlasm/SysMacs.Text
            .Include        Tlasm/SysErr.Text
            .Include        Tlasm/ToolMacs.Text
            .List
            .NOMACROLIST
            .Proc   rdInit,0

rdInstall
;            move.l  #$11000,BufPtr
OpenIt
            MOVEQ   #<IOQElSize/2>-1,D0
@0          CLR.W   -(SP)               ; clear a parameter blk off the stack
            DBRA    D0,@0
;
            clr.w   -(sp)
            _button
            tst.w   (sp)+
            bne     initexit        ;if user wants to skip the ramdisk

            MOVE.L  SP,A0

            LEA     rdName,A1
            MOVE.L  A1,IOFileName(A0)
            _Open
            BNE     InitExit

            CLR.L   -(SP)
            MOVE.L  #'DRVR',-(SP)

            move.w  #31,-(sp)
            _GetResource
            _DetachResource
;
; add to drive queue
;
          MOVEQ     #DQElLnth,D0             ; get size of drive queue element
          _NewPtr,SYS                        ;  and allocate one

          MOVE.W    #0,DQFSID(A0)            ; zero means local file system

          MOVEQ     #3,D0                    ; call it drive number 3
          SWAP      D0
          MOVE.W    #-32,D0          ;  my refnum
          _AddDrive

          LEA       Mparams,A0               ; point to params
          _MountVol                          ; mount as a volume

InitExit
            ADD     #IOQElSize,SP
            LEA     rdInstall,A0
            _RecoverHandle
            _DisposHandle
            RTS

rdName      .Byte   8
            .Ascii  '.ramdisk '
            .Align  2




Mparams   .BLOCK          12,0                ; header
          .WORD           0,0                 ; completion routine  (NIL)
          .WORD           0                   ; ioresult
          .WORD           0,0                 ; misc don't-cares
          .WORD           3                   ; drive num

          .end



ce to bring in ramdisk driver at boot time

            .NoList
            .Include        Tlasm/SysEqu.Text
            .Include        Tlasm/SysMacs.Text
            .Include        Tlasm/SysErr.Text
            .Include        Tlasm/ToolMacs.Text
            .List
            .NOMACROLIST
            .Proc   rdInit,0

rdInstall
;            move.l  #$11000,BufPtr
OpenIt
  sumacc/mac/ramdisk/rdinitr.text   444      0     12         124  3470501422  12026 * ramstart resource definition file
*
*

rdinit.Rsrc

Type INIT = PACK

   rdinit,3
                  ; drive num

          .end



ce to bring in ramdisk driver at boot time

            .NoList
            .Include        Tlasm/SysEqu.Text
            .Include        Tlasm/SysMacs.Text
            .Include        Tlasm/SysErr.Text
            .Include        Tlasm/ToolMacs.Text
            .List
            .NOMACROLIST
            .Proc   rdInit,0

rdInstall
;            move.l  #$11000,BufPtr
OpenIt
  sumacc/mac/kermit/   775      0     12           0  3472710621   7255 sumacc/mac/kermit/k.msg   444      0     12        4740  3470501423  10301 13-Sep-84 14:21:49-EDT,2535;000000000001
Mail-From: SY.FDC created at 13-Sep-84 14:21:45
Date: Thu 13 Sep 84 14:21:44-EDT
From: Frank da Cruz <SY.FDC@CU20B.ARPA>
Subject: Macintosh Kermit #1 Available
To: Info-Kermit@CU20B.ARPA, Info-Mac@SUMEX-AIM.ARPA
cc: engel@HARVARD.ARPA

This is to announce Macintosh Kermit #1.  It's one of several different
Macintosh Kermits under development, but this was the first one to reach us.
It's from Stephen Engel at Harvard University (engel@harvard), written in C for
the Sumacc Unix-based Macintosh cross development system.  The files are
collected together into a Unix shell archive, as MC1KERMIT.SH.  They include
source files, a makefile, and some sketchy documentation.

In Steve's words, "This is an `alpha' release of the program.  Much of the code
is sloppy and buggy, but I believe that all the program's funadmentals work
adequately.  This program is chiefly an adaptation of Columbia's Unix kermit."

It has been tested in conjunction with Unix Kermit and DEC-20 Kermit.  The
program is far from complete and has many rough edges, but it's the first out
the door and so should prove useful to the many sites that need some kind of
Kermit capability for the Mac.

You must have the Sumacc cross development system and a VAX-resident 68000
C cross compiler to make use of these files (anybody out there want to make
a hex file suitable for use with the FROMHEX utility?).  To get MacKermit
onto a Mac, you must:

1. Get MC1KERMIT.SH to your VAX Unix system, preferably in its own directory.
2. Connect your Mac to the VAX using Macterminal 0.5 or later.
3. Be sure your search path includes the Sumacc tools.
4. CD to the directory where you've put the mc1kermit.sh file.
5. Type "sh < mc1kermit.sh" to let the shell pick the file apart.
6. Type "make" to build the program from the source.
7. Type "macput -r kermit" to send the Kermit program to the Mac.
8. On the Mac, use SetFile to set the "bundle bit" (optional).

The VAX directory will contain the various source and header files, as well
as the Mac-format resource file, and a brief document "kermitdoc", explaining
the operation of this version of Macintosh Kermit.

The shell archive file is available as KER:MC1KERMIT.SH on COLUMBIA-20 and
CU20B via anonymous FTP.  Comments, suggestions, bug reports should be
directed to engel@harvard with cc to Info-Kermit@CU20B (or @COLUMBIA-20 if
your host doesn't know how to mail to CU20B yet).

Thanks, Steve, and congratulations on being the first to do it.  - Frank
-------
ix Kermit and DEC-20 Kermit.  Thsumacc/mac/kermit/Letter   444      0     12         755  3470501423  10503 
Here is the new version of mackermit.  It differs from the old version
in the following ways:
	1) It has debug option which displays the contents
	   of each packet until a key is pressed.

	2) It remembers terminal settings.

	3) Pressing a key during transfer causes Mackermit to
	   resend the last packet (useful if the packet length
	   is distorted during transmission).

Again, I apologize for taking so long on this, and please let me know
how Mackermit is or is not working.

Steve

 files, as well
as sumacc/mac/kermit/Makefile   444      0     12         274  3470501423  10755 .SUFFIXES:  .b .c

OBJECTS = kermit.b term.b

.c.b:
	cc68  -c $<

kermit.rsrc:  kermit.rc b.out 
	rmaker kermit.rc

b.out: kermit.b term.b
	cc68 -z -m ${OBJECTS}

clean:
	rm -f *.b *.rsrc
.

	2) It remembers terminal settings.

	3) Pressing a key during transfer causes Mackermit to
	   resend the last packet (useful if the packet length
	   is distorted during transmission).

Again, I apologize for taking so long on this, and please let me know
how Mackermit is or is not working.

Steve

 files, as well
as sumacc/mac/kermit/controls.h   444      0     12        1503  3470501423  11345 /* File controls.h
*  Constants for use with mackermit communications controls.  Masks
*  allow the changing of one specific communications paramater.
*/




#define NUMCNTLS 24

struct contrec
{
	int andpart, orpart;
} masks[NUMCNTLS-5]={
				/* Baud */
	{0xfd00,0x017c},	/* 300 */
	{0xfd00,0x0bd},		/* 600 */
	{0xfd00,0x05e},		/* 1200 */
	{0xfd00,0x3e},		/* 1800 */
	{0xfd00,0x2e},		/* 2400 */
	{0xfd00,0x1e},		/* 3600 */
	{0xfd00,0x16},		/* 4800 */
	{0xfd00,0xe},		/* 7200 */
	{0xfd00,0xa},		/* 9600 */
	{0xfd00,0x4},		/* 19200 */
	{0xfd00,0x0},		/* 57600 */
				/* Bits sent */
	{0xffff,0x0c00},	/* eight bits */
	{0xf3ff,0x0400},	/* seven bits */
				/* parity */
	{0xffff,0x3000},	/* even */
	{0xcfff,0x1000},	/* odd */
	{0xcfff,0x0000},	/* none */
				/* stop bits */
	{0x3fff,0x4000},	/* one */
	{0xffff,0xc000}		/* two */
};

5e},		/* 1200 */
	{0xfd00,0x3e},		/* 1800 */
	{0xfd00,0x2e},		/* 2400 */
	{0xfd00,0x1e},		/* 3600 */
	{0xfd00,0x16},		/* 4800 */
	{0xfd00,0xe},		/* 7200 */
	{0xfd00,0xa},		/* 9600 */
	{0xfdsumacc/mac/kermit/kermit.c   444      0     12      120307  3470501424  11035 
 /*
 *  File Kermit
 *
 *  UNIX Kermit, Columbia University, 1981, 1982, 1983
 *      Bill Catchings, Bob Cattani, Chris Maio, Frank da Cruz, Alan Crosswell
 *
 *  Also:   Jim Guyton, Rand Corporation
 *          Walter Underwood, Ford Aerospace
 *
 *  Macintosh adaptation: Stephen Engel
 */


#include "kermit.h"

/*
*	Main routine:
*			Initialize windows, communications, and wait for a
*		menu selection.
*/

main()
{
   
    int err,code;
    struct QDVar QDVar;

    QD = &QDVar;
    eol = CR;                           /* EOL for outgoing packets */
    quote = '#';                        /* Standard control-quote char "#" */
    pad = 0;                            /* No padding */
    padchar = NULL;                     /* Use null if any padding wanted */

     


    InitGraf(&thePort);
    InitFonts();
    InitWindows();
    InitDialogs((ProcPtr) NULL);
    SetupMenus();
    SetCursor(&QD->arrow);
    ControlWindow=NewWindow(&CWRecord, (Rect *) ControlRect, "Controls",
				0,userKind,(WindowPtr) -1,1,1);
	DebugWindow=NewWindow(&DWRecord, (Rect *) DebugRect, "Debugger",
			0,userKind,(WindowPtr) -1,1,1);
    TabWindow=NewWindow(&TWRecord, (Rect *) TabRect,
		"Tabs--Press any  key to exit",
				0,userKind,(WindowPtr) -1,1,1);
    theWindow=NewWindow(&wRecord, (Rect *)wirect, "MacKermit",VIS,
			documentProc, (WindowPtr) -1,1,0);
    SetupControls();
    SetPort(theWindow);
    theWindow->txFont=4;   /* Monaco font with non-proportional spacing */
    theWindow->txSize=9;
    PenSize(1,1);
    FlushEvents(everyEvent,0);
    err=GetVol(volname,&volnum);
    if (err)
	printerr("Bad volume name: ",err);

    config=0x4c0a;	   /* Initial Conditions:
				9600 baud, eight bit, no parity, one stop bit */
	SetupIO();

/* Main loop:  look for events, ignore unless its a menu selection
*              If it is call DoCommand to do the dispatching */

    for(;;)
    {
	SystemTask();
	GetNextEvent(everyEvent,&myEvent);
	switch(myEvent.what)
	{
		case mouseDown:
			code=FindWindow(&myEvent.where,&whichWindow);
			switch(code)
			{
				case inMenuBar:
					DoCommand(MenuSelect(&myEvent.where));
					break;
			}
	}
   }
}

SetupIO()
{
	int err;
			   /* Set up IO drivers */
    innum=OpenDriver(".AIn");
    outnum=OpenDriver(".AOut");
    controlparam.serConfig=config;
    err=Control(innum,8,&controlparam);
    if (err)
	fatal("Can't open drivers: ",err);
    err=Control(outnum,8,&controlparam);	
    if (err)
	fatal("Can't open drivers: ",err);

    			  /* Replace driver buffer with larger one */
    controlparam.serInBuff.serBPtr=mybuff;
    controlparam.serInBuff.serBLen=(short)MYBUFSIZE;
    err=Control(innum,9,&controlparam);
    if (err)
	printerr("Trouble making io buffer:",err);

			  /* Specify handshake options */
    controlparam.serShk.fXOn=(char)FALSE;
    controlparam.serShk.fCTS=(char)FALSE;
    controlparam.serShk.xOn=(char) 17;
    controlparam.serShk.xOff=(char) 19;
    controlparam.serShk.errs=(char)FALSE;
    controlparam.serShk.evts=(char)FALSE;
    controlparam.serShk.fInX=(char)FALSE;
    controlparam.serShk.null=(char)FALSE;
    if (err)
	printerr("Trouble with handshake: ",err);
    err=Control(outnum,10,&controlparam);
    if (err)
	printerr("Trouble with handshake: ",err);
}


/*
*   SetupMenus:
*		Install command menus.
*/

SetupMenus()
{
	int i;
 	char fnamcnv[13];

 	stringcpy(fnamcnv,"Filenamecnv!");
 	fnamcnv[12]=(char) 18;

	InitMenus();
	myMenus[0]=NewMenu(filemenu,"File");
	AppendMenu(myMenus[0], "Exit");
	myMenus[1]=NewMenu(modemenu,"Mode");
	AppendMenu(myMenus[1],"Connect");
	AppendMenu(myMenus[1],"Transmit");
	AppendMenu(myMenus[1],"Receive");
	AppendMenu(myMenus[1],"Controls");
	myMenus[2]=NewMenu(optionmenu,"Option");
	AppendMenu(myMenus[2],"Image");
	AppendMenu(myMenus[2],"Macwrite");
	AppendMenu(myMenus[2],"Executable");
	AppendMenu(myMenus[2],fnamcnv);
	AppendMenu(myMenus[2],"Debug");
	for (i=0;i<numMenu;i++)
		InsertMenu(myMenus[i],0);
	DrawMenuBar();
}


/*
*	SetupControls:
*		Read in and install the terminal controls
*/

SetupControls()
{
	ControlHandle theControl;
	int i;
	Handle tabstring;

	/* Read in controls from resource file */

	for(i=0;i<NUMCNTLS;i++)	
	{
		theControl=GetNewControl(i,ControlWindow);
		if(GetCtlValue(theControl))
		{
			config&= 
				masks[i].andpart;
			config|= 
				masks[i].orpart;
			if(i<11)
				baud=theControl;
			else if(i<13)
				bits=theControl;
			else if (i<16)
				parity=theControl;
			else if (i<18)
				stopb=theControl;
			else if (i<20)
			{
				xon=theControl;
				flowctl=(i==18);
			}
			else if (i < 22)
				online=theControl;
		}
	};
	MoveTo(25,25);
	tabstring=GetResource("TABS",0);
	stringcpy(tabs,*tabstring);
}


/*
*	DoCommand:
*		Either dispatch to a routine or change constant values,
*		according to menu selection.
*/

DoCommand(mResult)
int mResult;
{
	int theMenu=mResult>>16, theItem=(mResult &0xffff);

	if (mResult !=0)
		switch(theMenu)
		{
			case filemenu: /* Exit is only possibility */
				flushio();
				ExitToShell();
				break;
			case modemenu:
					/* Dispatch to the correct routines */
				switch(theItem)
				{
					case CONNECT:
						connection();
						break;
					case TRANSMIT:
						sendsw();
						break;
					case RECEIVE:
						recsw();
						break;
					case CONTROLS:
						DoControls();
						break;
					default:
						break;
				};
				break;
			case optionmenu:
					/* Update the selected constant */
					/* Selecting negates the current setting*/
				switch(theItem)
				{
					case IMAGE:
						image = !image; 

 /* Checking with last paramater=TRUE places checkmark, otherwise its erased */
						CheckItem(myMenus[2],IMAGE,image);
						break;
					case MACWRITE:
						macwrite = !macwrite; 
						CheckItem(myMenus[2],MACWRITE,macwrite);
						break;
					case EXECUTABLE:
						exec=!exec; 
						CheckItem(myMenus[2],EXECUTABLE,exec);
				/* Need all eight bits for executable code */
						image=exec;
						CheckItem(myMenus[2],IMAGE,image);
						break;
 
 				case FILENAMECNV:
 					filnamcnv=!filnamcnv;
 					CheckItem(myMenus[2],FILENAMECNV,filnamcnv);
 					break;
				case DEBUG:
					debug=!debug;
					CheckItem(myMenus[2],DEBUG,debug);
					break;
				};
		};
	HiliteMenu(0);
}		
    
/*
*	DoControls:
*		Draw contol labels, find which control was selected, and
*		update control panel and serial driver accordingly. 
*/
 
DoControls()
{
	int i,res,whichone;
	Handle myResource;

	ShowWindow(ControlWindow);
	SelectWindow(ControlWindow);	
	SetPort(ControlWindow);
	PenNormal();
	DrawControls(ControlWindow);
	TextFace(boldStyle);
	MoveTo(20,20);
	DrawString("Baud Rate");
	MoveTo(190,20);
	DrawString("Bits Sent");
	MoveTo(190,100);
	DrawString("Parity");
	MoveTo(280,20);
	DrawString("Stop Bits");
	MoveTo(280,100);
	DrawString("Xon/Xoff Flow");
	for(;;) /* Loop until exit button is pressed */
	{
		GetNextEvent(everyEvent,&myEvent);
		FindWindow(&myEvent.where,&whichWindow);
		GlobalToLocal(&myEvent.where);
		if (whichWindow==ControlWindow)
		switch(myEvent.what)
		{
		case mouseDown:
			res=FindControl(&myEvent.where,ControlWindow,&theControl);
		/* res=TRUE if a control was selected */
			if ( res)
			{
				TrackControl(theControl,&myEvent.where,(ProcPtr) NULL);
				whichone=(*theControl)->contrlRfCon;

				/* Update apropriate controls */
				if(whichone<11)
					resetcontrol(&baud);
				else if(whichone<13)
					resetcontrol(&bits);
				else if (whichone<16)
					resetcontrol(&parity);
				else if (whichone<18)
					resetcontrol(&stopb);
				else if (whichone<20)
				{
					resetcontrol(&xon);
				/* Need to update global variable since its
					not part of the driver */
					flowctl=(whichone==18);
				}
				else if (whichone < 22)
					resetcontrol(&online);
				else if (whichone==22)
				{
					ShowWindow(TabWindow);
					SelectWindow(TabWindow);
					SetPort(TabWindow);
					change_tabs();
					HideWindow(TabWindow);
					SelectWindow(ControlWindow);
					SetPort(ControlWindow);
				}	
				else /* Must be exit button */
				{
					HideWindow(ControlWindow);
					SelectWindow(theWindow);
					SetPort(theWindow);
					return;
				};

	/* Set selected control, the manager automatically fills it in. */
			if(whichone<22)
			{
				myResource=GetResource("CNTL",(int)(*theControl)->contrlRfCon);
				SetCtlValue(theControl,1);
				(*myResource)[9]=1;
				ChangedResource(myResource);
				WriteResource(myResource);
			}

	/* Reconfigure the drivers */
				if(whichone<18)
				/* Don't reconfigure if xon was thecontrol */
				{
				config&= 
					masks[whichone].andpart;
				config|= 
					masks[whichone].orpart;
				sendbreak();
				controlparam.serConfig=config;
				Control(innum,8,&controlparam);
				Control(outnum,8,&controlparam);	
				}
		}

	}
	};
}		

resetcontrol(cont)
ControlHandle *cont;
{
	Handle myResource;

	myResource=GetResource("CNTL",(int)(**cont)->contrlRfCon);
	(*myResource)[9]=0;
	ChangedResource(myResource);
	WriteResource(myResource);
	HNoPurge(myResource);
	SetCtlValue(*cont,0); /* Unselect the old control value */
	*cont=theControl;     /* Set it to the selected one */
}
	

		
 		
/*
 *  s e n d s w
 *
 *  Sendsw is the state table switcher for sending files.  It loops until
 *  either it finishes, or an error is encountered.  The routines called
 *  by sendsw are responsible for changing the state.
 *
 */
     
sendsw()
{
    int packno=0;  /* Actual (not mod 64) packet count */
    char sinit(), sfile(), sdata(), seof(), sbreak();
    state = 'S';                        /* Send initiate is the start state */
    n = 0;                              /* Initialize message number */
    fp=NULL;   				/* No file yet */
    numtry = 0;                         /* Say no tries yet */

    EraseRect((Rect *) inrect);
    MoveTo(15,50);
    MDrawString("SENDING...");
    MoveTo(15,200);
    MDrawString("Packet ");
    if(debug)
	ShowWindow(DebugWindow);
		
    while(TRUE)                         /* Do this as long as necessary */
    {
	if(n!=(packno%64))              /* Change in packet number? */
		packno++;
	EraseRect((Rect *) myrect);     /* Erase old packet number */
	MoveTo(80,200);	
	printnum(packno);
        switch(state)
        {
            case 'S':   state = sinit();  break; /* Send-Init */
            case 'F':   state = sfile();  break; /* Send-File */
            case 'D':   state = sdata();  break; /* Send-Data */
            case 'Z':   state = seof();   break; /* Send-End-of-File */
            case 'B':   state = sbreak(); break; /* Send-Break */
            case 'C': 	MoveTo(15,260);          /* Complete */ 
	    		DrawString("File Successfully Transmitted. ");
			return;
            case 'A':   		         /* "Abort" */
            default:	if(fp!=NULL)
			{
				FSClose(fp); 
				FlushVol(volname,volnum);	
			}
	 		MoveTo(15,260);
			MDrawString("File transmission failed."); 
			return;
        }
    }
}
     
     
/*
 *  s i n i t
 *
 *  Send Initiate: send this host's parameters and get other side's back.
 */
     
char sinit()
{
    int num, len;                       /* Packet number, length */
    if (numtry++ > MAXTRY) 
	{
		printerr("In init-- too many tries",0);
		return('A'); /* If too many tries, give up */
	};
	GetNextEvent(everyEvent,&myEvent);
	if(myEvent.what==mouseDown)
	{
		printerr("\nMousedown Aborted\n",0);
		return('A');
	};
    spar(packet);                       /* Fill up init info packet */
     
     
    spack('S',n,6,packet);              /* Send an S packet */
    switch(rpack(&len,&num,recpkt))     /* What was the reply? */
    {
        case 'N':  return(state);       /* NAK, try it again */
     
        case 'Y':                       /* ACK */
            if (n != num)               /* If wrong ACK, stay in S state */
                return(state);          /* and try again */
            rpar(recpkt);               /* Get other side's init info */
     
            if (eol == 0) eol = '\n';   /* Check and set defaults */
            if (quote == 0) quote = '#';
     
            numtry = 0;                 /* Reset try counter */
            n = (n+1)%64;              /*  Bump packet count */
            return('F');                /* OK, switch state to F */
     
        case FALSE: return(state);      /* Receive failure, try again */
     
	    /* Anything else, just "abort" */
        default: printerr("Bad packet type--sinit",0); 
					return('A');       
   }
 }
     
     
/*
 *  s f i l e
 *
 *  Send File Header.
 */
     
char sfile()
{
    int num,len;                   /* Packet number, length */
    char     *cp;                            /* char pointer */
     
    if (numtry++ > MAXTRY) 
	{
		printerr("Too many tries-- in sfile",0);
		return('A'); /* If too many tries, give up */
	};
	GetNextEvent(everyEvent,&myEvent);
	if(myEvent.what==mouseDown)
	{
		printerr("\nMousedown Aborted\n",0);
		return('A');
	};
     
    if (fp == NULL)                     /* If not already open, */
    {
	fp=open_file(filnam);
	if(!fp)
		fatal("Kermit Cancelled",0);
    
    if (filnamcnv)                      /* Convert lower case to upper  */
        for (cp =filnam; *cp != '\0'; cp++)
		{
            if (*cp >= 'a' && *cp <= 'z')
                *cp ^= 040;
		if ((*cp=='\0x20')||(*cp=='0xca'))
			*cp='.';
		};
     
    }
    len = stringlen(filnam);                /* Compute length of new filename */
     
    spack('F',n,len,filnam);         /* Send an F packet */
    switch(rpack(&len,&num,recpkt))     /* What was the reply? */
    {
        case 'N':                       /* NAK, just stay in this state, */
            num = (--num<0 ? 63:num);   /* unless it's NAK for next packet */
            if (n != num)               /* which is just like an ACK for */
                return(state);          /* this packet so fall thru to... */
     
        case 'Y':                       /* ACK */
            if (n != num) return(state); /* If wrong ACK, stay in F state */
            numtry = 0;                 /* Reset try counter */
            n = (n+1)%64;             /*  Bump packet count */
            size = bufill(packet);      /* Get first data from file */
            return('D');                /* Switch state to D */
     
            case FALSE: return(state);  /* Receive failure, stay in F state */
     
 			/* Something else, just "abort" */
            default:    printerr("Bad packet type--in sfile",0);
						return('A');   
        }
}
     
     
/*
 *  s d a t a
 *
 *  Send File Data
 */
     
char sdata()
{
    int num, len;                       /* Packet number, length */
    if (numtry++ > MAXTRY) 
	{
		printerr("Too many tries--in sdata",0);
		return('A'); /* If too many tries, give up */
	};
    GetNextEvent(everyEvent,&myEvent);
    if(myEvent.what==mouseDown)
    {
    	printerr("\nMousedown Aborted\n",0);
    	return('A');
    };
     
    spack('D',n,size,packet);           /* Send a D packet */
    switch(rpack(&len,&num,recpkt))     /* What was the reply? */
    {
        case 'N':                       /* NAK, just stay in this state, */
            num = (--num<0 ? 63:num);   /* unless it's NAK for next packet */
            if (n != num)               /* which is just like an ACK for */
                return(state);          /* this packet so fall thru to... */
     
        case 'Y':                       /* ACK */
            if (n != num) return(state); /* If wrong ACK, fail */
            numtry = 0;                 /* Reset try counter */
            n = (n+1)%64;                /*Bump packet count */
            if ((size = bufill(packet)) == EOF) /* Get data from file */
                return('Z');            /* If EOF set state to that */
            return('D');                /* Got data, stay in state D */
     
        case FALSE: return(state);      /* Receive failure, stay in D */
     
    	/* Anything else, "abort" */
        default: printerr("Bad packet type--sdata",0);
			     return('A');  
    }
}
     
     
/*
 *  s e o f
 *
 *  Send End-Of-File.
 */
     
char seof()
{
    int num, len;                       /* Packet number, length */
    if (numtry++ > MAXTRY) 
	{
		printerr("Too many tries--seof",0);
		return('A'); /* If too many tries, "abort" */
	};
    GetNextEvent(everyEvent,&myEvent);
    if(myEvent.what==mouseDown)
    {
    	printerr("\nMousedown Aborted\n",0);
    	return('A');
    };

     
    spack('Z',n,0,packet);              /* Send a 'Z' packet */
    switch(rpack(&len,&num,recpkt))     /* What was the reply? */
    {
        case 'N':                       /* NAK, just stay in this state, */
            num = (--num<0 ? 63:num);   /* unless it's NAK for next packet, */
            if (n != num)               /* which is just like an ACK for */
                return(state);          /* this packet so fall thru to... */
     
        case 'Y':                       /* ACK */
            if (n != num) return(state); /* If wrong ACK, hold out */
            numtry = 0;                 /* Reset try counter */
            n = (n+1)%64;              	/* and bump packet count */
            FSClose(fp);                /* Close the input file */
	    FlushVol(volname,volnum);	
            fp = NULL;                  /* Set flag indicating no file open */
            return('B');                /* if not, break, EOT, all done */
     
        case FALSE: return(state);      /* Receive failure, stay in Z */
     
   		/* Something else, "abort" */
        default:   printerr("Bad packet type--seof",0);
			 	   return('A');     
    }
}
     
     
/*
 *  s b r e a k
 *
 *  Send Break (EOT)
 */
     
char sbreak()
{
    int num, len;                       /* Packet number, length */
    if (numtry++ > MAXTRY) 
		{
			printerr("Too many tries--sbreak",0);
			return('A'); /* If too many tries "abort" */
		};
     
    GetNextEvent(everyEvent,&myEvent);
    if(myEvent.what==mouseDown)
    {
    	printerr("\nMousedown Aborted\n",0);
    	return('A');
    };
    spack('B',n,0,packet);              /* Send a B packet */
    switch (rpack(&len,&num,recpkt))    /* What was the reply? */
    {
        case 'N':                       /* NAK, just stay in this state, */
            num = (--num<0 ? 63:num);   /* unless NAK for previous packet, */
            if (n != num)               /* which is just like an ACK for */
                return(state);          /* this packet so fall thru to... */
     
        case 'Y':                       /* ACK */
            if (n != num) return(state); /* If wrong ACK, fail */
            numtry = 0;                 /* Reset try counter */
            n = (n+1)%64;                	/*and bump packet count */
            return('C');                /* Switch state to Complete */
     
        case FALSE: return(state);      /* Receive failure, stay in B */
     
        default:    return ('A');       /* Other, "abort" */
   }
}
     
     
/*
 *  r e c s w
 *
 *  This is the state table switcher for receiving files.
 */
     
recsw()
{
    int packno=0;			/* Actual (not mod 64) packet count */
    char rinit(), rfile(), rdata();     /* Use these procedures */
     
    state = 'R';                        /* Receive-Init is the start state */
    n = 0;                              /* Initialize message number */
    numtry = 0;                         /* Say no tries yet */
    fp=NULL; 

    EraseRect((Rect *) inrect);		/* Clear screen */
    MoveTo(15,50);
    MDrawString("RECEIVING...");
    MoveTo(15,200);
    MDrawString("Packet ");
    if(debug)
	ShowWindow(DebugWindow);
		
    while(TRUE)                         /* Do this as long as necessary */
    {
	if (n!=(packno%64))		/* Change in packet number? */
		packno++;
	EraseRect((Rect *) myrect);	/* Erase old packet count */
	MoveTo(80,200);	
	printnum(packno);
        switch(state)                   /* Do until done */
        {
            case 'R':   state = rinit(); break; /* Receive-Init */
            case 'F':   state = rfile(); break; /* Receive-File */
            case 'D':   state = rdata(); break; /* Receive-Data */
            case 'C':  	MoveTo(15,260);	        /* Complete */
 			DrawString("File Successfully Received.");
	 		return; 
            case 'A':  
			if( fp!=NULL)           /* Abort state */
			{
				FSClose(fp); 
				FlushVol(volname,volnum);	
			}
			MoveTo(15,260);
			DrawString("File Transfer Failed."); 
			return;        
        }
    }
}
     
     
/*
 *  r i n i t
 *
 *  Receive Initialization
 */
     
char rinit()
{
    int len, num;                       /* Packet length, number */
     
    if (numtry++ > MAXTRY) 
    {
	printerr("Too many tries--rinit",0);
	return('A'); /* If too many tries, "abort" */
    };
     
    switch(rpack(&len,&num,packet))     /* Get a packet */
    {
        case 'S':                       /* Send-Init */
            rpar(packet);               /* Get the other side's init data */
            spar(packet);               /* Fill up packet with my init info */
            spack('Y',n,6,packet);      /* ACK with my parameters */
            oldtry = numtry;            /* Save old try count */
            numtry = 0;                 /* Start a new counter */
            n = (n+1)%64;             /*  Bump packet number, mod 64 */
            return('F');                /* Enter File-Receive state */
     
        case FALSE:                     /* Didn't get packet */
            spack('N',n,0,(char *)0);           /* Return a NAK */
            return(state);              /* Keep trying */
     
        default:   printerr("Bad packet type--rinit",0);
		  return('A');       /* Some other packet type, "abort" */
    }
}
     
     
/*
 *  r f i l e
 *
 *  Receive File Header
 */
     
char rfile()
{
    int num, len, err;                       /* Packet number, length */
    char *filnam1;                   /* Holds the converted file name */
     
    if (numtry++ > MAXTRY) 
    {
	printerr("Too many tries--rfile",0);
	return('A'); /* "abort" if too many tries */
    };
     
    GetNextEvent(everyEvent,&myEvent);
    if(myEvent.what==mouseDown)
    {
    	printerr("\nMouse Aborted\n",0);
    	return('A');
    };
    switch(rpack(&len,&num,packet))     /* Get a packet */
    {
        case 'S':                       /* Send-Init, maybe our ACK lost */
            if (oldtry++ > MAXTRY) return('A'); /* If too many tries "abort" */
            if (num == ((n==0) ? 63:n-1)) /* Previous packet, mod 64? */
            {                           /* Yes, ACK it again with  */
                spar(packet);           /* our Send-Init parameters */
                spack('Y',num,6,packet);
                numtry = 0;             /* Reset try counter */
                return(state);          /* Stay in this state */
            }
            else return('A');           /* Not previous packet, "abort" */
     
        case 'Z':                       /* End-Of-File */
            if (oldtry++ > MAXTRY) return('A');
            if (num == ((n==0) ? 63:n-1)) /* Previous packet, mod 64? */
            {                           /* Yes, ACK it again. */
                spack('Y',num,0,(char* )0);
                numtry = 0;
                return(state);          /* Stay in this state */
            }
            else return('A');           /* Not previous packet, "abort" */
     
        case 'F':                       /* File Header (just what we want) */
            if (num != n) return('A');  /* The packet number must be right */
            	stringcpy(filnam, packet);    /* Copy the file name */
     
            if (filnamcnv)              /* Convert upper case to lower */
                for (filnam1=filnam; *filnam1 != '\0'; filnam1++)
                    if (*filnam1 >= 'A' && *filnam1 <= 'Z')
                        *filnam1 |= 040;
		MDrawString("\n\n\n\rFile Name: ");
		MDrawString(filnam);
		if (!exec)
		{	/* Place data in data fork of mac text file */

			err=Create(filnam,0,"KERMIT","TEXT");
			if(err != noErr)
			{
				printerr("Couldn't create file:",err);
				return('A');
			}
			err=FSOpen(filnam,0,&fp);
			if(err !=noErr)
			{
				printerr("Can't open file:",err);
				return('A'); 
			}
		}
		else
		{	/* Executable file---place data in resource fork
			   of application file. */

			err=Create(filnam,0,"KERMIT","APPL");
			if(err != noErr)
			{
				printerr("Couldn't create file:",err);
				return('A');
			}
			err=OpenRF(filnam,0,&fp);
			if(err != noErr)
			{
				printerr("Couldn't open resources: ",err);
				return('A');
			}
			
		};
            spack('Y',n,0,(char *)0);           /* Acknowledge the file header */
            oldtry = numtry;            /* Reset try counters */
            numtry = 0;                 /* ... */
            n = (n+1)%64;                /* Bump packet number, mod 64 */
            return('D');                /* Switch to Data state */
     
        case 'B':                       /* Break transmission (EOT) */
            if (num != n) return ('A'); /* Need right packet number here */
            spack('Y',n,0,(char *)0);   /* Say OK */
            return('C');                /* Go to complete state */
     
        case FALSE:                     /* Didn't get packet */
            spack('N',n,0,(char *)0);           /* Return a NAK */
            return(state);              /* Keep trying */
     
        default:    return ('A');       /* Some other packet, "abort" */
    }
}
     
/*
 *  r d a t a
 *
 *  Receive Data
 */
     
char rdata()
{
    int num, len;                       /* Packet number, length */
    if (numtry++ > MAXTRY) 
	{
		printerr("Too many tries--rdata",0);
		return('A'); /* "abort" if too many tries */
		};
    GetNextEvent(everyEvent,&myEvent);
    if(myEvent.what==mouseDown)
    {
    	printerr("\nMouse Aborted\n",0);
    	return('A');
    };

    switch(rpack(&len,&num,packet))     /* Get packet */
    {
        case 'D':                       /* Got Data packet */
            if (num != n)               /* Right packet? */
            {                           /* No */
                if (oldtry++ > MAXTRY)
                    {
			printerr("Too many tries--rdata",0);
			return('A');        /* If too many tries, abort */
				};
                if (num == ((n==0) ? 63:n-1)) /* Else check packet number */
                {                       /* Previous packet again? */
                    spack('Y',num,6,packet); /* Yes, re-ACK it */
                    numtry = 0;         /* Reset try counter */
                    return(state);      /* Don't write out data! */
                }
                else 
		{
			printerr("Bad Packet no--rdata",0);
			return('A');       /* sorry, wrong number */
		};
            }

	    bufemp(packet,len);
            spack('Y',n,0,(char *)0);   /* Acknowledge the packet */
            oldtry = numtry;            /* Reset the try counters */
            numtry = 0;                 /* ... */
            n = (n+1)%64;               /* Bump packet number, mod 64 */
            return('D');                /* Remain in data state */
     
        case 'F':                       /* Got a File Header */
            if (oldtry++ > MAXTRY)
	    {
		printerr("Too many tries--rdata",0);	
               	return('A');            /* If too many tries, "abort" */
	    };
            if (num == ((n==0) ? 63:n-1)) /* Else check packet number */
            {                           /* It was the previous one */
                spack('Y',num,0,(char *)0);     /* ACK it again */
                numtry = 0;             /* Reset try counter */
                return(state);          /* Stay in Data state */
            }
            else
	    {
		printerr("Not previous packet-rdata",0);
		return('A');           /* Not previous packet, "abort" */
	    };
     
        case 'Z':                       /* End-Of-File */
            if (num != n) return('A');  /* Must have right packet number */
            spack('Y',n,0,(char *)0);           /* OK, ACK it. */
            FSClose(fp);                 /* Close the file */
	    FlushVol(volname,volnum);	
            n = (n+1)%64;               /*  Bump packet number */
            return('F');                /* Go back to Receive File state */
     
        case FALSE:                     /* Didn't get packet */
            spack('N',n,0,(char *)0);           /* Return a NAK */
            return(state);              /* Keep trying */
     
        default:     return('A');       /* Some other packet, "abort" */
    }
}


/*
*   KERMIT Utilities
*/

stringcpy(str1,str2)
char *str1,*str2;
{
	while(*str1++ = *str2++)
	;
}

stringlen(str)
char *str;
{
	int i=0;

	while(*str++)
		i++;
	return(++i);
}

/*
 *  r p a c k
 *
 *  Read a Packet
 */
     
rpack(len,num,data)
int *len, *num;                         /* Packet length, number */
char *data;                             /* Packet data */
{
    int i, done;                /* Data character number, loop exit */
    char chksum,t='a',type;
    IOParam  inparam;

    inparam.ioCompletion=(ProcPtr) NULL;
    inparam.ioRefNum=innum ;
    inparam.ioReqCount=1;
    inparam.ioPosMode=0;
    inparam.ioPosOffset=0;
    inparam.ioBuffer= &t;

    if (debug)
    {
        SelectWindow(DebugWindow);
    	SetPort(DebugWindow);
    	EraseRect((Rect *) inrect);
    	MoveTo(50,12);
    	MDrawString("Packet Coming In\n\n\r");
    }
    while (t != SOH)                    /* Wait for packet header */
    {
        PBRead(&inparam,TRUE);
	while(inparam.ioResult!=0)
	{
		GetNextEvent(everyEvent,&myEvent);
		if (myEvent.what==keyDown)
			return(FALSE);
	};
        t &= 0177;                      /* Handle parity */
    }
    if (debug)
	MDrawString("Got SOH \n\r");
    done = FALSE;                       /* Got SOH, init loop */
    while (!done)                       /* Loop to get a packet */
    {
        PBRead(&inparam,TRUE);
	while(inparam.ioResult!=0)
	{
		GetNextEvent(everyEvent,&myEvent);
		if (myEvent.what==keyDown)
			return(FALSE);
	};
        if (!image) t &= 0177;          /* Handle parity */
        if (t == SOH) continue;         /* Resynchronize if SOH */
        chksum = t;                     /* Start the checksum */
        *len = unchar(t)-3;             /* Character count */
	if (debug)
	{
		MDrawString("Number of characters: ");
		printnum(*len);
	}
        PBRead(&inparam,TRUE);
	while(inparam.ioResult!=0)
	{
		GetNextEvent(everyEvent,&myEvent);
		if (myEvent.what==keyDown)
			return(FALSE);
	};
        if (!image) t &= 0177;          /* Handle parity */
        if (t == SOH) continue;         /* Resynchronize if SOH */
        chksum = chksum + t;            /* Update checksum */
        *num = unchar(t);               /* Packet number */
	if(debug)
	{
		MDrawString("\n\rPacket Number: ");
		printnum(*num);
	}
     
        PBRead(&inparam,TRUE);
	while(inparam.ioResult!=0)
	{
		GetNextEvent(everyEvent,&myEvent);
		if (myEvent.what==keyDown)
			return(FALSE);
	};
        if (!image) t &= 0177;          /* Handle parity */
        if (t == SOH) continue;         /* Resynchronize if SOH */
        chksum = chksum + t;            /* Update checksum */
        type = t;                       /* Packet type */
    	if(debug)
	{
		MDrawString("\n\rPacket type: ");
		MDrawChar(type);
	}
        for (i=0; i<*len; i++)          /* The data itself, if any */
        {                               /* Loop for character count */
        	PBRead(&inparam,TRUE);
		while(inparam.ioResult!=0)
		{
			GetNextEvent(everyEvent,&myEvent);
			if (myEvent.what==keyDown)
				return(FALSE);
		};
            if (!image) t &= 0177;      /* Handle parity */
            if (t == SOH) continue;     /* Resynch if SOH */
            chksum = chksum + t;        /* Update checksum */
            data[i] = t;                /* Put it in the data buffer */
        }
        data[*len] = 0;                 /* Mark the end of the data */
     
        PBRead(&inparam,TRUE);
	while(inparam.ioResult!=0)
	{
		GetNextEvent(everyEvent,&myEvent);
		if (myEvent.what==keyDown)
			return(FALSE);
	};
        if (!image) t &= 0177;          /* Handle parity */
        if (t == SOH) continue;         /* Resynchronize if SOH */
        done = TRUE;                    /* Got checksum, done */
    }

     
                                        /* Fold in bits 7,8 to compute */
    chksum = (((chksum&0300) >> 6)+chksum)&077; /* final checksum */
     
    if (chksum != unchar(t)) 
    {
	if (debug)
	{
		MDrawString("\n\rBad Checksum: ");
		printnum(unchar(t));
	}
	type=FALSE;
    }
    if (debug)
    {
	MDrawString("\n\rHere's the data:\n\n\r");
	MDrawString(data);
	do
	{
		GetNextEvent(everyEvent,&myEvent);
	}
	while(myEvent.what !=mouseDown);
	SelectWindow(theWindow);
	SetPort(theWindow);
    }

     
    return(type);                       /* All OK, return packet type */
}

/*
 *  s p a c k
 *
 *  Send a Packet
 */
     
spack(type,num,len,data)
char type, *data;
int num, len;
{
    int i, count;                            /* Character loop counter */
    char chksum, buffer[100];           /* Checksum, packet buffer */
    register char *bufp;                /* Buffer pointer */
    bufp = buffer;                      /* Set up buffer pointer */
		/* Issue any padding */
    for (i=1; i<=pad; i++) FSWrite(outnum,&count, &padchar); 
     
    *bufp++ = SOH;                      /* Packet marker, ASCII 1 (SOH) */
    *bufp++ = tochar(len+3);            /* Send the character count */
    chksum  = tochar(len+3);            /* Initialize the checksum */
    *bufp++ = tochar(num);              /* Packet number */
    chksum += tochar(num);              /* Update checksum */
    *bufp++ = type;                     /* Packet type */
    chksum += type;                     /* Update checksum */
     
    for (i=0; i<len; i++)               /* Loop for all data characters */
    {
        *bufp++ = data[i];              /* Get a character */
        chksum += data[i];              /* Update checksum */
    }
    chksum = (((chksum&0300) >> 6)+chksum)&077; /* Compute final checksum */
    *bufp++ = tochar(chksum);           /* Put it in the packet */
    *bufp = eol;                        /* Extra-packet line terminator */
    count=bufp-buffer+1;
    FSWrite(outnum,&count, buffer); /* Send the packet */
	if (debug)
	{
	SelectWindow(DebugWindow);
	SetPort(DebugWindow);
	EraseRect((Rect *) inrect);
	MoveTo(50,12);
	MDrawString("Packet To Be Sent Out\n\n\r");
	MDrawString("Packet Number: ");
	printnum(num);
	MDrawString("\n\rPacket Type: ");
	MDrawChar(type);
	MDrawString("\n\rCharacter Count: ");
	printnum(len+3);
	MDrawString(" \n\rThe Packet: \n\n\r");
	MDrawString( buffer );
	do
	{
		GetNextEvent(everyEvent,&myEvent);
	}
	while(myEvent.what !=mouseDown);
	SelectWindow(theWindow);
	SetPort(theWindow);
	}
}
     

/*
 *  b u f i l l
 *
 *  Get a bufferful of data from the file that's being sent.
 *  Only control-quoting is done; 8-bit & repeat count prefixes are
 *  not handled.
 */
     
bufill(buffer)
char buffer[];                          /* Buffer */
{
    int i;                              /* Loop index */
    char t;				/* Character read from file */
    int 
        t7,                             /* 7-bit version of above */
	count=1;
    i = 0;                              /* Init data buffer pointer */
    while( FSRead(fp,&count,&t) != eoFErr)        /* Get the next character */
    {
        t7 = t & 0177;                  /* Get low order 7 bits */
     
        if (t7 < SP || t7==DEL || t7==quote) /* Does this char require */
        {                                   /* special handling? */
    	    if(t7==CR && macwrite)	/* Map CR to LF if macwrite */
		t=t7='\n';
            if (t=='\n' && !image) 
            {                           /* Do LF->CRLF mapping if !image */
                buffer[i++] = quote;
		buffer[i++]=ctl('\r');
            } 
            buffer[i++] = quote;        /* Quote the character */
            if (t7 != quote)
            {
                t = ctl(t);             /* and uncontrolify */
                t7 = ctl(t7);
            }
        }
        if (image)
            buffer[i++] = t;            /* Deposit the character itself */
        else
            buffer[i++] = t7;
        if (i >= spsiz-8) return(i);    /* Check length */
    }
    if (i==0) 
		return(EOF);              /* Wind up here only on EOF */
    return(i);                          /* Handle partial buffer */
}
     
     
/*
 *      b u f e m p
 *
 *  Put data from an incoming packet into a file.
 */
     
bufemp(buffer,len)
char  *buffer;                         /* Buffer */
int   len;                              /* Length */
{
    int i,err,count=1;                              /* Counter */
    char t;                             /* Character holder */
     
    for (i=0; i<len; i++)               /* Loop thru the data field */
    {
        t = buffer[i];                  /* Get character */
        if (t == MYQUOTE)               /* Control quote? */
        {                               /* Yes */
            t = buffer[++i];            /* Get the quoted character */
            if ((t & 0177) != MYQUOTE)  /* Low order bits match quote char? */
                t = ctl(t);             /* No, uncontrollify it */
        }
        if (t=='\n' && macwrite)	/* If macwrite filter out LFs */
            continue;
	err=FSWrite(fp,&count,&t);	/* Write out the character */
	if (err != noErr)
		fatal("Error in writing :", err);
	}
}
     
     
/*
*   SPAR:
*		Fill a packet with our communication paramaters 
*/

spar(data)
char data[];
{
	data[0]=tochar(MAXPACKSIZ);
	data[1]=tochar(MYTIME);
	data[2]=tochar(MYPAD);
	data[3]=ctl(MYPCHAR);
	data[4]=tochar(MYEOL);
	data[5]=MYQUOTE;
}


/*
*   RPAR:
*		Read in the other kermits paramaters
*/

rpar(data)
char data[];
{
	spsiz=unchar(data[0]);
	timint=unchar(data[1]);
	pad=unchar(data[2]);
	padchar=ctl(data[3]);
	eol=unchar(data[4]);
	quote=data[5];
}


/*
*  Printerr:
*	Display error message and number in standard error box
*/

printerr(str,err)
char *str;
int err; 
{
	int i;
	char error[10];

	if (err) /* Err=0 signals message only */
	{
		/* Make sure string will be null terminated */
		for(i=0;i<10;error[i++]='\0');

		NumToString(err,error);  /* Convert err number */
		ParamText(str,error,"",""); /* Insert strings into error box */
	}
	else
		ParamText(str,"","","");
	StopAlert(1,(ProcPtr) NULL);

}


/*
*   Fatal:
*	Printerr, close file, and exit to shell.
*/

fatal(str,err)
char *str;
int err;
{
	printerr(str,err);

	if(fp!=NULL)
	{
		FSClose(fp);
		FlushVol(volname,volnum);	
	}
	ExitToShell();
}

/*
*   Printnum:
*	Print out number as an ascii string.
*/

printnum(num)
int num;
{
	int i;
	char numstr[10];

	/* Make sure string will be null terminated. */

	for(i=0;i<10;numstr[i++]='\0');
	NumToString(num,numstr);
	DrawString(numstr);

}

draw_tabs()
{
	int index,tabindex,lin;

	MoveTo(CHARWIDTH,TOPMARGIN);
	for(index=1;index<=(RIGHTMARGIN-LEFTMARGIN)/CHARWIDTH;index++)
	{
		for (tabindex=0;tabindex<NUMTABS;tabindex++)	
			if(tabs[tabindex]==index)
			{
				DrawChar('T');
				Move(-CharWidth('T'),0);
				break;
			};
		Line(CHARWIDTH,0);
		lin=3+3*((index%5)==0);
		Line(0,-lin);
		Move(0,lin);
	}
}

change_tabs()
{
	int ind;
	Handle tabstring;

	clear_screen();
	draw_tabs();
	FlushEvents(everyEvent,0);
	for (;;)
	{
		GetNextEvent(everyEvent, &myEvent);
		if (myEvent.what==mouseDown)
		{
			GlobalToLocal(&myEvent.where);
			for(ind=0;ind<NUMTABS;ind++)
			{
				if(((myEvent.where.h-tabs[ind]*CHARWIDTH)<CHARWIDTH)&&
				   (myEvent.where.h-tabs[ind]*CHARWIDTH>0))
				{
					SysBeep(3);
					tabs[ind]=0;
					break;
				}
			}
			if (ind>=NUMTABS)
				for(ind=0;ind<NUMTABS;ind++)
				 	if(tabs[ind]==0)
					{
						tabs[ind]= myEvent.where.h/(int) CHARWIDTH;
						break;
					}
		clear_screen();
		draw_tabs();
		}
		else if(myEvent.what==keyDown)
			break;
	};
	tabstring=GetResource("TABS",0);
	stringcpy(*tabstring,tabs);
	ChangedResource(tabstring);
	WriteResource(tabstring);
}

/*
*	open_file  -- used to open the file for reading
*	   returns value of refNum if successful, NULL if not
*	   returns file name in fNamePtr if successful, NULL if not
*/

int open_file (fNamePtr)	/*returns refNum if file opened, NULL if not*/
char fNamePtr[];
{
	SFReply reply;
	Point where;
	int i, err=0, length, refNum;

	/*position of dialog box*/
	SetPt (&where,30,30);

	/*initializes fNamePtr to NULLs for safety*/
	for (i=0; i<64; i++)
		reply.fName[i] = NULL;

	/*handles user interface*/
	SFGetFile (&where, NULL, NULL, -1, NULL, NULL, &reply);

	/*
	*	convert Pascal string to C string --
	*	remove leading number and add a trailing NULL
	*/
	length = reply.fName[0];
	for (i=0; i< length; i++)
		fNamePtr[i] = reply.fName[i + 1];
	fNamePtr[i] = NULL;

	for (i=0; i< length; i++)
		reply.fName[i] = reply.fName[i + 1];
	reply.fName[i] = NULL;

	if (reply.good)		/*user did not press Cancel Button*/
		{
		err = FSOpen (reply.fName, (int) reply.vRefNum, &refNum);
		if(err)
			printerr("Bad SFgetopen",err);
	}

	else			/*user did press Cancel Button*/
		{
		refNum = NULL;
		fNamePtr[0] = NULL;
		}
	
	return (refNum);
}
uffer[++i];            /* Get the quoted character */
            if ((t & 0177) != MYQUOTE)  /* Low order bits match quote char? */
                t = ctl(t);             /* No, uncontrollify it */
        }
        if (t=='\n' && macwrite)	/* If macwrite filter out LFs */
            continue;
	err=FSWrite(fpsumacc/mac/kermit/kermit.h   444      0     12       11200  3470501424  11011 /*
* File kermit.h
*
* Symbol definitions and global variable for kermit.
*/

#include <stdio.h>     		/* Standard io definitions */
#include "mac/quickdraw.h"	/* Macintosh C interface */
#include "mac/osintf.h"
#include "mac/toolintf.h"
#include "mac/packintf.h"
#include "mac/libmac.h"
#include "controls.h"		/* Constants for terminal settings */

     
     
     
     
     
/* Symbol Definitions */
     
#define MAXPACKSIZ  94      /* Maximum packet size */
#define SOH         1       /* Start of header */
#define CR          13      /* ASCII Carriage Return */
#define SP          32      /* ASCII space */
#define DEL         127     /* Delete (rubout) */
     
#define MAXTRY      20      /* Times to retry a packet */
#define MYQUOTE     '#'     /* Standard quoting character */
#define MYPAD       0       /* Number of padding characters I will need */
#define MYPCHAR     0       /* Padding character I need (NULL) */
#define MYEOL       '\n'    /* End-Of-Line character I need */
#define MYTIME      10      /* Seconds after which I should be timed out */
#define MAXTIM      60      /* Maximum timeout interval */
#define MINTIM      2       /* Minumum timeout interval */
     
#define TRUE        -1      /* Boolean constants */
#define FALSE       0

#define	numMenu	    3	    /* Number of menus in program */
#define filemenu    256     /* Reference numbers for menus */
#define modemenu    257
#define optionmenu  255
#define VIS         1       /* Sets window visisble */
#define CONNECT     1       /* Menu item constants */
#define TRANSMIT    2
#define RECEIVE     3
#define CONTROLS    4
#define IMAGE       1
#define MACWRITE    2
#define EXECUTABLE  3
#define FILENAMECNV 4
#define DEBUG	5
#define MYBUFSIZE   2048
#define BUFSIZE	    1024
/* Macintosh error codes */
#define eoFErr      (-39)
#define TOPMARGIN 10	    /* Terminal display constants */
#define BOTTOMMARGIN 286
#define LEFTMARGIN 12
#define RIGHTMARGIN 480
#define CHARWIDTH 6
     
     
/* Macro Definitions */
     
/*
 * tochar: converts a control character to a printable one by adding a space.
 *
 * unchar: undoes tochar.
 *
 * ctl:    converts between control characters and printable characters by
 *         toggling the control bit (ie. ^A becomes A and A becomes ^A).
 */
#define tochar(ch)  ((ch) + ' ')
#define unchar(ch)  ((ch) - ' ')
#define ctl(ch)     ((ch) ^ 64 )
     
     
/* Global Variables */
     
int     size,               /* Size of present data */
        spsiz,              /* Maximum send packet size */
        pad,                /* How much padding to send */
        timint,             /* Timeout for foreign host on sends */
        n,                  /* Packet number */
        numtry,             /* Times this packet retried */
        oldtry,             /* Times previous packet retried */
        filnamcnv = TRUE,   /* -1 means do file name case conversions */
	fp,		    /* Data file reference number (file pointer) */
	innum,		    /* Input driver refnum */
	outnum,		    /* Output driver refnum */

		            /* Mode of data transmission */
        image=FALSE ,       /* 8-bit transmission */
	macwrite=FALSE,     /* Macwrite compatible */
	exec=FALSE,         /* Executable resource file */
	volnum,
    	debug=FALSE,
	flowctl=TRUE;
     
char    state,              /* Present state of the automaton */
        padchar,            /* Padding character to send */
        eol,                /* End-Of-Line character to send */
        escchr,             /* Connect command escape character */
        quote,              /* Quote character in incoming data */
	volname[256],       /* Current volume name */
        filnam[80],            /* Current file name */
        recpkt[MAXPACKSIZ], /* Receive packet buffer */
        packet[522],        /* Packet buffer */
	inbuff[BUFSIZE],    /* buffer for characters not yet printed */
	*endbuff=sizeof(char)*BUFSIZE+inbuff, /* End of buffer */
	mybuff[MYBUFSIZE];  /* Serial drivers new buffer */

MenuHandle myMenus[numMenu];
EventRecord myEvent;
WindowPtr theWindow, whichWindow, ControlWindow,DebugWindow,TabWindow;
WindowRecord wRecord, CWRecord,DWRecord,TWRecord;
			     /* Rectangles */
short wirect[]={40,5,335,505}, /* Kermit window in global */
	inrect[]  = { 0, 0, 390, 500}, /* and local coords */
	myrect[]= {190,80,210,150},    /* To erase packet number */
	ControlRect[]={70,40,280,480}, /* Controls window */
	DebugRect[]={40,15,180,500},
	TabRect[]={310,5,350,505};
CSParam controlparam;      /* To change serial driver paramaters */
ControlHandle baud,bits,parity,stopb,xon,online,theControl;
short config;  		       /* Current Serial driver configuration */

/* Tab settings */
#define NUMTABS 10

char tabs[NUMTABS];
r);

	if(fp!=NULL)
	{
		FSClose(fp);
		FlushVol(volname,volnum);	
	}
	ExitToShell();
}

/*
*   Printnum:
*	Print out number as an ascii string.
*/

printnum(num)
int num;
{
	int i;
	char numstr[10];

	/* Make sure string will be null terminated. */

	for(i=0;i<10;numstr[i++]='\0');
	NumToString(num,numstr);
	DrawString(numstr);

}

draw_tabs()
{
	int index,tabindex,lin;

	MoveTo(CHsumacc/mac/kermit/kermit.rc   444      0     12        3307  3470501425  11160 *
* File kermit.rc
*
* This file contains the resources for rmaker for the kermit program

* Specify output file of executable code

kermit.rsrc

Type TABS = STR
  ,0
0123456789

* Error box

Type ALRT
,1
90 50 180 400
2
5555

Type DITL
,2
2
BtnItem Enabled
65 20 85 60
OK

StatText Disabled
65 80 85 400
Error: ^0  ^1

* Terminal controls

* Baud rate

Type CNTL
,0
300
30 10 45 60
Visible
2
0
0 0 1

Type CNTL
,1
600
50 10 65 60
Visible
2
1
0 0 1

Type CNTL
,2
1200
70 10 85 60
Visible
2
2
0 0 1


Type CNTL
,3
1800
90 10 105 60
Visible
2
3
0 0 1


Type CNTL
,4
2400
110 10 125 60
Visible
2
4
0 0 1

Type CNTL
,5
3600
130 10 145 60
Visible
2
5
0 0 1

Type CNTL
,6
4800
150 10 165 60
Visible
2
6
0 0 1

Type CNTL
,7
7200
170 10 185 60
Visible
2
7
0 0 1

Type CNTL
,8
9600
30 100 45 150
Visible
2
8
1 0 1

Type CNTL
,9
19200
50 100 65 150
Visible
2
9
0 0 1

Type CNTL
,10
57600
70 100 85 150
Visible
2
10
0 0 1

* Bits sent and received

Type CNTL
,11
8
30 190 45 240
Visible
2
11
1 0 1

Type CNTL
,12
7
50 190 65 240
Visible
2
12
0 0 1

* Parity

Type CNTL
,13
even
110 190 125 240
Visible
2
13
0 0 1

Type CNTL
,14
odd
130 190 145 240
Visible
2
14
0 0 1

Type CNTL
,15
none
150 190 165 240
Visible
2
15
1 0 1

* Stop bits

Type CNTL
,16
1
30 280 45 330
Visible
2
16
1 0 1

Type CNTL
,17
2
50 280 65 330
Visible
2
17
0 0 1

* Xon/Xof flow control

Type CNTL
,18
yes
110 280 125 330
Visible
2
18
1 0 1

Type CNTL
,19
no
130 280 145 330
Visible
2
19
0 0 1

Type CNTL
,20
ON LINE
110 100 125 170
Visible
2
20
1 0 1

Type CNTL
,21
LOCAL
130 100 145 170
Visible
2
21
0 0 1

Type CNTL
,22
Tabs
170 280 185 330
Visible
1
22
0 0 0
* Exit

Type CNTL
,23
exit
160 360 190 420
Visible
0
23
0 0 0


* Compiled program code

Type CODE
  b.out,0


lowctl=TRUE;
     
char    state,              /* Present state of the automaton */
        padchar,            /* Padding character to send */
        eol,                /* End-Of-Line character to send */
        escchr,             /* Connect command escape character */
        quote,              /* Quote csumacc/mac/kermit/kermitdoc   444      0     12       10473  3470501425  11265 Mackermit Information:

This is an "alpha" release of the program.  Much of the code is sloppy
and buggy, but I believe that all the program's funadmentals work 
adequately.  This program is cheifly an adaptation of Columbia's Unix
kermit.  The kermit file transfer system is a communication between two 
running programs, one on each computer.  This document is minimal 
information concerning the operation of the Macs end of the program.  
Please see your systems manual pages for kermits operation there.


Any questions or comments can be mailed over the networks to 
engel@harvard.

Kermit is a file transfer program, and has four main modes, which can
be selected by clicking the appropriate item on the mode menu.  

Controls:

This mode allows the user to change the  type of communication to
adequately interface with the other computer.  Selecting this option
and pressing the appropriate buttons on the screen  changes the baud
rate, the number of bits passed, the number  of stop bits, and the type
of parity, if any.


Connect:

Connect mode allows kermit to behave as a dumb terminal.   Control 
characters can be sent using the clover leaf key.  
The enter key sends a break across.  The terminal is 
hardwired for 9600 baud eight bit, one stop bit connection.    Clicking the 
mouse button exits this mode, and breaks communication.  Occasional
characters may be lost.

Transmit:

In this mode the Mackermit sends a file  to the other machine.  After
sending some initial data, it will prompt the suer for a filename.  At
this time the file entered must be on the disk in the internal drive.
The filename must also be compatible with the receiving machine.  
All filenames are translated to lower case, and any spaces are removed.
Once communicating Mackermit prints out a few status messages during 
transmission.






                                                        2



Receive:

Mackermit receives files sent over by other kermits.  They can be of any
name with the exception of names already used on the Mac's 
current disk.

Protocol:

     To send (upload) files:

     Run Mackermit.  Select connect mode, and login to the appropriate
     machine.  Note that this machine must have a working kermit.
     Type to the shell, "kermit r  <cr> ".  Hit the mouse button to exit
     connect mode.  Select the appropriate option. (see below)  Select
     transmit mode.  A prompt for filename will appear.  Enter the
     appropriate one.  Mackermit will report either success or failure.

To receive (download) files:

      Do the same as above until typeing kermit r to the shell.  Instead
      type "kermit s filname <cr> ", where filname can be any readable
      file.  Disconnect by hitting the mouse button, select the appropriate 
     option, and finally select receive mode.  Again mackermit will
     report either success or failure.


Options:

The options menu concerns how kermit handles carriage returns in  files.
The macwrite mode allows kermit to handle those type files nicely,
by mapping CRs to NLs on sending, and doing the reverse upon receiving
a file.  The image mode is a holdover from the Columbia version.  If it
is turned off, NL is mapped to CRLF on output, and CRs are ignored on
input.  If it is selected, NLs and CRs are left alone.   Selecting image
also allows eight data bits to be sent or received. Note that macwrite
may be selected along with an image option, but that its operations are 
executed first.  The third mode, executable, allows the
transfer of executable Macintosh code .  If selected, it places the data
passed over into the resource fork of an "application" file.  If the code
passed over was valid Macintosh machine code and resource data, the
file can be successfully run on the mac.   The code must be sent
over by the non-mac kermit as eight bit data, however.  This is why selecting
executable always also selects image.


Additional features (Kermit 1.1):

	The terminal mode now accepts many escape sequence, and feebly emulates
	a VT100

	Debug option may now be selected.  This causes information about
	all packets sent and received to be displayed.  Each packet
	is displayed until the mouse button is pressed.

	Pressing a key during execution causes the last packet to be
	resent.  This is useful if, for example, a packet length comes
	across distorted, and Mackermit waits for characters that are not
	coming.

ls window */
	DebugRect[]={40,15,180,500},
	TabRect[]={310,5,350,505};
CSParam controlparam;      /* To change serial driver paramaters */
ControlHandle baud,bits,parity,stopb,xon,online,theControlsumacc/mac/kermit/term.c   444      0     12       26661  3470501425  10502 /*
* FILE Term.c
*
* Module of mackermit: contains code for the terminal simulation
* routine.
*/

#include "term.h"  /* Terminal routine constants */

/*
 *  c o n n e c t
 *
 *  Establish a virtual terminal connection with the remote host.
*/

connection()
{
	register int index;
        int halt=FALSE,err=0,printit(), fixbuffer();
	char *addptr();


	initchars(); /* Set up the keyboard configuration */

	dumptr=NewRgn();
	PenMode(patXor);
	if (GetCRefCon(online)==21)
	{
		local();
		return;
	}
	flushio(); /* Get rid of pending characters */
	sendbreak();


	for(;;)
	{

/* Read until buffer is estimated full */
/* or until no input is immeadiately pending. */

	
			inparam.ioBuffer=inbuff;
			inparam.ioReqCount = BUFSIZE;
			PBRead(&inparam,TRUE);


/* Print and read keyboard until new input arrives */

		do
		{
			GetNextEvent(everyEvent, &myEvent);
			if ((myEvent.what==keyDown)||(myEvent.what==autoKey))
			{
				outchar= (myEvent.message & 0xff);

				/* Enter is break key */
				if(outchar==3)
				{
					sendbreak();
					flushio();
				}
				
				/* Translate typed characters */
				/* Clover leaf key is control */
				if(myEvent.modifiers&256)
					outchar=contcharmap[outchar];
				else
					outchar=charmap[outchar];
				err=PBWrite(&outparam,TRUE);
				if(err)
					printerr("Bad Writeout:",err);
			}

			/* Mouse button exits connect mode */
			else if(myEvent.what==mouseDown)
			{
				flushio();
				return;
				}
			if(*outp != 255)
			{
				if(halt<3)
					if(*addptr(outp,FULLENOUGH)!=255)
					{
						halt++;
						PBWrite(&xoffparam,FALSE);
					};
				printit();
			}
			else if (halt)
			{
				halt=FALSE;
				outchar=controlq;
				PBWrite(&outparam,TRUE);
			}
		}
		while  (inparam.ioResult!=0);
	}
}

/*
*  Printit:
*	Draws character and updates buffer
*/
	
printit()
{
	PFI funp, lookup();

	Line(-CHARWIDTH,0);	/* Erase Cursor */
	*outp &=0177;

	if (begptr!=NULL)	/* Are we in an escape sequence? */
	{
		if(funp=lookup(*outp,singescapetable,NUMSINGESCS))
			(*funp)();	/* Do escape sequence function */
		*begptr=255;
		*(++begptr)=255;
		begptr=NULL;
	}
	else if(escseq!=NULL)
	{
		if(funp=lookup(*outp,escapetable,NUMMULTESCS))
		{
			begptr=escseq;
			endptr= outp;
			(*funp)();	/* Do escape sequence function */
			for(;begptr<=endptr;begptr++)
				*begptr=255;
			escseq=NULL;
			begptr=NULL;
			endptr=NULL;
		}
	}
	else if(*outp==ESCAPE)
		begptr=outp;
	else
	{	
		MDrawChar(*outp);
		*outp=255;
		}
	Line(CHARWIDTH,0);	/* Redraw Cursor */
	if(++outp>=endbuff)   /* Find next character to be printed */
		outp=inbuff;
}	


/*
*  Fixbuffer:
*	Update input character buffer.  This is the completion routine for
*	the aynchronous reads.
*/

fixbuffer()
{	

}


	
/*
 *      KERMIT utilities.
 */
  
/*
*   Lookup:
*	Lookup a given character in the apropriate character table, and
*	return a pointer to the appropriate function, if it exists.
*/

 PFI
 lookup(data,table,length)
 char data;
 CMD table[];
 int length;
 {
 	for(length-1;length>=0;length--)
 	{
 		if(table[length].name==data)
 			return(table[length].funct);
 	};
 	return((PFI)NULL);
 }


/*
*   Flushio:
*	Initialize some communications constants, and clear screen and
*	character buffers.
*/

flushio()
{
	int i,err;



	for (i=0;i<=BUFSIZE;i++)
		inbuff[i]=255;
	controls='\023';
	controlq='\021';
	numinbuffer=0;
	begptr=NULL;
	endptr=NULL;
	escseq=NULL;
	outp=inbuff;
	err=KillIO(-6);
	if (err)
		printerr("Bad input clear",err);
	err=KillIO(-7);
	if(err)
		printerr("Bad ouput clear",err);

/* Initialize the asynchronous io paramater blocks */
	
	SetupIO();
	inparam.ioCompletion=fixbuffer;
	inparam.ioRefNum=innum ;
    	inparam.ioActCount=0;
	inparam.ioPosMode=0;
	inparam.ioPosOffset=0;
	inparam.ioResult=0;
	inparam.ioBuffer= inbuff;

	xoffparam.ioCompletion=(ProcPtr) NULL;
	xoffparam.ioRefNum=outnum;
    	xoffparam.ioReqCount=1;
	xoffparam.ioPosMode=0;
	xoffparam.ioPosOffset=0;
	xoffparam.ioBuffer= &controls;

	outparam.ioCompletion = (ProcPtr) NULL;
	outparam.ioRefNum=outnum;
	outparam.ioReqCount=1;
	outparam.ioPosMode=0;
	outparam.ioPosOffset=0;
	outparam.ioBuffer= &outchar;

	home_cursor();

	EraseRect((Rect *)inrect);

}	

   
/*
*  Sendbreak:
*	Sends a break across the communications lines.
*/
 
sendbreak()
{ 
	int xx;

	Control(outnum,12,&controlparam);
	for( xx=0; xx<150;xx++)
		;
	Control(outnum,11,&controlparam);
}

     
MDrawChar(chr)
char chr;
{
	PFI funp;

	/* If its a control char, do the apropriate function. */	
	

	if(chr<'!')   /* Space is a control character, because mac's space
		         does not wipe out the character beneath it. */
	{ 
			
		if (funp=lookup( chr,controltable,NUMSINGCMDS))
			(*funp)();
	}
	else
	{
		GetPen (&p);
		if(p.h>RIGHTMARGIN)
		{
		overrun=FALSE;
			carriage_return();
			line_feed();
			overrun=TRUE;
		}
		if(insert)
			insert_char();
		space();
		back_space(); 
		DrawChar(chr);
	}
}	

MDrawString(str)
char *str;
{
	while (*str)
		MDrawChar(*str++);
}


/* Increment pointer in circular buffer */
char *
addptr(ptr,num)
char *ptr;
int num;
{

	ptr+=num;
	if(ptr>endbuff)
		ptr=(char* )((long)ptr-BUFSIZE);
	else if(ptr<inbuff)
		ptr=(char *)((long)ptr+BUFSIZE);
	return(ptr);
}



myatoi(strptr)
char *strptr;
{
	int sign=1, n=0;

	if(*strptr=='+'||*strptr=='-')
		sign=(*strptr++=='+') ? 1 : -1;

	while( *strptr>='0'&& *strptr<='9')
		{
			n=10*n+*strptr-'0';
			if(++strptr>endbuff)  
				strptr=inbuff;
		};
	return(sign*n);
}
	
local()
{
	char *charp=inbuff;

	flushio();
	SysBeep(10);
	for(;;)
	{
		
			GetNextEvent(everyEvent, &myEvent);
			if ((myEvent.what==keyDown)||(myEvent.what==autoKey))
			{
				GetKeys(&theKeys);
				outchar= (myEvent.message & 0xff);

				
				/* Translate typed characters */
				/* Clover leaf key is control */
				if(theKeys.kmap[1] & (long)  0x8000) 
					outchar=contcharmap[outchar];
				else
					outchar=charmap[outchar];
				*charp=outchar;
				numinbuffer++;
				charp=addptr(charp,1);
				printit();
			}
			else if (myEvent.what==mouseDown)
				return;
	};
}



/*
* Initchars:
*	Do a mock reconfiguration of the keyboard by setting
*	values in an array of ascii chars.
*/

initchars()
{
	int index;


	/* Start with all charcters normal */
	for(index=0;index<256;index++)
	{
		charmap[index]=index;
		contcharmap[index]=index;
	};
	
	charmap['\140']='\033'; /* Replace ` with escape */
	charmap['\010']='\177'; /* Replace backspace with delete */

	/* Insert control characters */
	for(index='a';index<='z';index++)
		contcharmap[index] -=96;

}


/*
*	Control character functions:
*		Each of the following allow the mac to simulate
*		the behavior of a terminal when given the proper
*		control character.
*/

int
back_space()
{
	GetPen( &p);
	if (p.h-CHARWIDTH>0)
		Move(-CHARWIDTH,0);
	else
		carriage_return();
}

int
space()
{
	/* Regular quickdraw space does not cover previous characters */
	Point p; 

	GetPen(&p);
	currect[0]=p.v-LINEHEIGHT+3;
	currect[1]=p.h;
	currect[2]=p.v+3;
	currect[3]=p.h+CHARWIDTH;
	if (invert)
		FillRect((Rect* ) currect,&QD->black);
	else
		EraseRect((Rect*) currect);
	Move(CHARWIDTH,0);

}



tab()
{
	int index, tabstop, remember=999;

	GetPen(&p);

	for(index=0;index<NUMTABS;index++)
	{
		tabstop=(tabs[index])*CHARWIDTH;
		if (tabstop>p.h)
			if(tabstop<remember)
				remember=tabstop;
	};
	if (remember !=999)
		MoveTo(remember,p.v);
}


line_feed()
{
	if(!overrun)
	{
		GetPen(&p);
		if(p.v>=bottommargin)
		{
			ScrollRect((Rect *)scrollrect,0,-LINEHEIGHT,dumptr);
			EraseRgn(dumptr);
		}
		else
			MoveTo(p.h,p.v+LINEHEIGHT);
	}
	else
		overrun=FALSE;
}

carriage_return()
{
	GetPen(&p);
	MoveTo(LEFTMARGIN,p.v);
}

clear_screen()
{
	EraseRect((Rect *)inrect);
}


home_cursor()
{
	MoveTo(LEFTMARGIN,TOPMARGIN);
}


bell()
{
	SysBeep(3);
}





/* Esacpe Sequence Functions---basically behave like vt100 */

clear_line()
{
	GetPen(&p);

	currect[0]= p.v-LINEHEIGHT;
	currect[1]=p.h-CHARWIDTH;
	currect[2]=p.v+3;
	currect[3]=RIGHTMARGIN;

	EraseRect((Rect*) currect);


}

int
erase_display()
{
	int ermode;

	ermode=myatoi(addptr(begptr,2));
	GetPen(&p);

	switch(ermode)
	{
		case 0:
			clear_line();
			currect[0]=p.h+3;
			currect[1]=LEFTMARGIN;
			currect[2]=BOTTOMMARGIN;
			currect[3]=RIGHTMARGIN;
			EraseRect((Rect *) currect);
		case 1:
			currect[0]=p.v-LINEHEIGHT;
			currect[1]=LEFTMARGIN;
			currect[2]=p.v+3;
			currect[3]=p.h;
			EraseRect((Rect *) currect);
			currect[0]=TOPMARGIN;
			currect[2]=p.v-LINEHEIGHT;
			currect[3]=RIGHTMARGIN;
			EraseRect((Rect *) currect);
			break;
		case 2:
			clear_screen();
			break;
		}
}

			
cursor_right()
{
	Move(CHARWIDTH,0);
}

set_scroll_region()
{
	char *tmptr;
	int t,b;
	for(tmptr=begptr;*tmptr!=';';)
	{
		if (tmptr==endptr)
			return;
		tmptr=addptr(tmptr,1);
	};
	t=myatoi(addptr(begptr,2));
	b=myatoi(addptr(tmptr,1));
	if(t<=0)
		t=1;
	if (b<=0)
		b=1;
	topmargin= --t*LINEHEIGHT+TOPMARGIN;
	bottommargin= TOPMARGIN+(--b)*LINEHEIGHT;
	scrollrect[0]= (--t)*LINEHEIGHT+TOPMARGIN;
		if(scrollrect[0]<=0)
			scrollrect[0]=0;
	scrollrect[2]=bottommargin+LINEHEIGHT;
}

cursor_position()
{
	int hort=0,vert=0;
	char *tmptr;

	for(tmptr=begptr;*tmptr!=';';)
	{
		if (tmptr==endptr)
		{
			home_cursor();
			return;
		}
		tmptr=addptr(tmptr,1);
	};
	vert=myatoi(addptr(begptr,2));
	hort=myatoi(addptr(tmptr,1));

	if(--hort<0)
		hort=0;
	if(--vert<0)
		vert=0;	
	MoveTo(LEFTMARGIN+hort*CHARWIDTH,TOPMARGIN+vert*LINEHEIGHT);
}



text_mode()
{
	int style=myatoi(addptr(begptr,2));

	switch(style)
	{
		case 0: 
			invert=FALSE;
			textstyle=0;
			TextFace(0);
			TextMode(srcOr);
			break;
		case 1:
			textstyle +=boldStyle;
			TextFace(textstyle);
			break;
		case 4:
			textstyle+=underlineStyle;
			TextFace(textstyle);
			break;
		case 7:
			invert=TRUE;
			TextMode(srcBic);
			break;
		case 22:
			if (textstyle>=boldStyle)
			{
				TextFace(textstyle-boldStyle);
				textstyle -= boldStyle;
			}
			break;
		case 24:
			if (textstyle>=underlineStyle)
			{
				TextFace(textstyle-underlineStyle);
				textstyle -= underlineStyle;
			}
			break;
		case 27:
			invert=FALSE;
			TextMode(srcOr);
			break;
		default:;
	}
}	

reverse_line_feed()
{
	GetPen(&p);

	
	if(p.v<=topmargin)
	{
		ScrollRect((Rect *)scrollrect,0,LINEHEIGHT,dumptr);
		EraseRgn(dumptr);
	}
	else
		MoveTo(p.h,p.v-LINEHEIGHT);
}

insert_delete_line()
{
	char mode = *endptr;
	int scrolldir;
	int numlin=myatoi(addptr(begptr,2));

	if (numlin==0)
		numlin=1;

	currect[1]=LEFTMARGIN;
	currect[2]=bottommargin;
	currect[3]=RIGHTMARGIN;

	GetPen(&p);
	if(numlin> (bottommargin-p.v)/LINEHEIGHT)
		numlin=(int) ((bottommargin-p.v)/LINEHEIGHT);

	if (mode=='L')
	{
		scrolldir=LINEHEIGHT;
		currect[0]=p.v-LINEHEIGHT+3;
	}
	else
	{
		scrolldir= -LINEHEIGHT;
		currect[0]=p.v-LINEHEIGHT+3;
	}

	while(numlin--)
	{
		ScrollRect((Rect *)currect,0,scrolldir,dumptr);
		EraseRgn(dumptr);
	}
}


delete_char()
{
	int numchars=myatoi(addptr(begptr,2));

	if (numchars==0)
		numchars=1;

	GetPen(&p);

	currect[0]=p.v-LINEHEIGHT+3;
	currect[1]=p.h;
	currect[2]=p.v+3;
	currect[3]=RIGHTMARGIN;

	if(numchars> (RIGHTMARGIN-p.h)/CHARWIDTH)
		numchars =(int) ((RIGHTMARGIN-p.h)/CHARWIDTH);


	while(numchars--)
	{
		ScrollRect((Rect *)currect,-CHARWIDTH,0,dumptr);
		EraseRgn(dumptr);
	}
}

insert_char()
{
	GetPen(&p);
	
	currect[0]=p.v-LINEHEIGHT+3;
	currect[1]=p.h;
	currect[2]=p.v+3;
	currect[3]=RIGHTMARGIN;

	ScrollRect((Rect *) currect, CHARWIDTH,0,dumptr);
	EraseRgn(dumptr);
}

insert_mode()
{
	int mode=myatoi(addptr(begptr,2));
	if(mode==4)
	insert=TRUE;
}

end_insert_mode()
{
	int mode=myatoi(addptr(begptr,2));
	if(mode==4)
	insert=FALSE;
}

unknown()
{
	for(;begptr!=endptr;begptr=addptr(begptr,1))
	{
		MDrawChar(*begptr);
	}
}

dummy()
{
}
csi()
{
	escseq=begptr;
}
N,p.v);
}

clear_screen()
{
	EraseRect((Rect *)inrect);
}


home_cursor()
{
	Mosumacc/mac/kermit/term.h   444      0     12        7014  3470501426  10457 
#include <stdio.h>     		/* Standard io definitions */
#include "mac/quickdraw.h"	/* Macintosh C interface */
#include "mac/osintf.h"
#include "mac/toolintf.h"
#include "mac/packintf.h"
#include "mac/libmac.h"
     
#define DEL         127     /* Delete (rubout) */
#define ESCAPE      27      /* Escape character */	
     
#define BUFSIZE 1024
#define TRUE        -1      /* Boolean constants */
#define FALSE       0

#define FULLENOUGH  500     /* How long to wait before sending out xoff */
#define TOPMARGIN 10	    /* Terminal display constants */
#define BOTTOMMARGIN 286
#define LEFTMARGIN 12
#define RIGHTMARGIN 480
#define LINEHEIGHT 12
#define CHARWIDTH 6
#define NUMSINGCMDS 9	    /* Number of implemented control character
				   routines */ 
#define NUMMULTESCS  13     /* Number of escape sequences recognised */
#define NUMSINGESCS  6
#define NUMTABS 10
     
     
extern int     
	innum,		    /* Serial driver reference numbers */
	outnum,
	fp,		    /* file refnum */
	flowctl;	    /* xon/xoff flag */


int 
	invert=FALSE,	/* Flag for inverted terminal mode */
	insert=FALSE,
	topmargin=TOPMARGIN,	/* Edges of adjustable window */
	bottommargin=BOTTOMMARGIN,
	textstyle=0,
	overrun=FALSE,
	numinbuffer;	    /* Number of read in characters waiting to be
			       printed */
extern char
	inbuff[],
	tabs[],		/* Tab settings */
	*endbuff;

char
	outchar,	    /* Character sent to host. */
	*outp,		    /* Pointer to next charcter to be printed */
	*begptr,           /* Beginning of escape sequence */
	*endptr,           /* end of escape sequence */
	*escseq,
	charmap[256],	    /* Arrays to "remap" the keyboard */
	contcharmap[256],
	controls,controlq;  /* xon/xoff characters */
extern ControlHandle online;
extern WindowPtr theWindow;
extern EventRecord myEvent;
extern short inrect[];    /* Terminal screen */
short  currect[4],	    /* Rect around current character */
       scrollrect[]  = { 0, 0, 390, 500}; /* Scrolling region */
  /* For terminal asynch. communication */
IOParam xoffparam, outparam, inparam;
extern CSParam controlparam;
RgnHandle dumptr;	    /* Dummy ptr to satisfy scrollbits */
KeyMap theKeys;		    /* Map of which key has been pressed */
Point p;

/* Structure for the dispatch tables of terminal commands. */

typedef struct cmd_elem{
	char name;
	int(*funct)();
}CMD;

typedef 
int(*PFI)();


/* Terminal function declarations. */

int tab(), back_space(), space(),
	carriage_return(),line_feed(),clear_screen(),
	home_cursor(), bell();

int text_mode(),clear_line(),erase_display(), cursor_position(),cursor_right(),
	set_scroll_region(),reverse_line_feed(), insert_delete_line(),
	dummy(), unknown(),delete_char(),insert_mode(),end_insert_mode(),
	csi();

/* Terminal control character function command table. */

CMD controltable[NUMSINGCMDS]=
{ 
	{'\010',back_space},
	{'\040',space},
	{'\n',line_feed},
	{'\r',carriage_return},
	{'\013',reverse_line_feed},
	{'\014',clear_screen},
	{'\036',home_cursor},
	{'\t',tab},
	{'\007',bell}
};

CMD singescapetable[NUMSINGESCS]=
{
	{'>',dummy},
	{'=',dummy},
	{'8',dummy},
	{'7',dummy},
	{'M',reverse_line_feed},
	{'[',csi}
};

/* Terminal escape sequence function command table */
CMD escapetable[NUMMULTESCS]=
{
	{'\113',clear_line},	/* K */
	{'\110',cursor_position},	/* H */
	{'\112',erase_display},	 /* J */
	{'\103',cursor_right},	/* C */
	{'\101',reverse_line_feed}, /* A */
	{'\155',text_mode},     /* m */
	{'\162',set_scroll_region}, /* r */
	{'M',insert_delete_line},  /* M */
	{'P',delete_char},
	{'h',insert_mode},
	{'l',end_insert_mode},
	{'*',unknown},
	{'L',insert_delete_line}
};

GIN,TOPMARGIN);
}


bell()
{
	SysBeep(3);
}





/* Esacpe Sequence Functions---basically behave like vt100 */

clear_line()
{
	GetPen(&p);

	currect[0]= p.v-LINEHEIGHT;
	currect[1]=p.h-CHARWIDTH;
	currect[2]=p.v+3;
	currect[3]=RIGHTMARGIN;

	EraseRect((Rect*) currect);


}

int
erase_display()
{
	int ermode;

	ermode=myatoi(addptr(begptr,2));
	GetPen(&p);

	switch(ermode)
	{
		case 0:
			clear_line();
			currect[0]=p.h+3;
			currect[1]=LEFTMARGIN;
			currect[2]=BOTTOMMARGIN;
			currect[3]=RIGHTsumacc/mac/kermit/b.out   444      0     12      117525  3472541513  10365 üWŒ ýÈ&è`,CúÿÒ"	U$YÕÁ‡ÿBÓ’‡ÿgJ‡f
$YÕÁ`ÿÞãŸÕÇ`ÿÖBg©tJg?<©ÈpJ€fÿü#Í*N¹”*y*­ôNVÿ(Hîÿ(Aîÿ*#Èq¸ü
eü#eB¹_ B9oR 9q¸€Ê/N¹HàXN¹K@N¹K€/<N¹L€Xa¼ 9q¸€^/N¹IX/</</<ÿÿÿÿ/</</<Xà/<XÈ/<f¶N¹Kßü #Àe(/</</<ÿÿÿÿ/</</<Xé/<XÐ/<ddN¹Kßü #Àe$/</</<ÿÿÿÿ/</</<Xò/<XØ/<c¾N¹Kßü #Àe /</</<ÿÿÿÿ/</</<Y/<X°/<q¼N¹Kßü #À_œa/9_œN¹HðX y_œ1|D y_œ1|	J/</<N¹I P/</<ÿÿÿÿN¹KpP/<f¢/<e0N¹JàP-@ÿüJ®ÿüg/.ÿü/<Ya*îP3üL
oTa†N¹L°/<_ˆ/<ÿÿÿÿN¹KPP09_ˆHÀ`J/<f</<_’N¹KÐP-@ÿø .ÿø`/<_’N¹MX/a–X`€gÿÞ`€gÿ°`ÿ†`N^NuNVÿüHîÿü/<Y+N¹K X#Àd\/<Y0N¹K X#Àf03ùoTc¨/<c¨/</9d\N¹JÀßü-@ÿüJ®ÿüg/.ÿü/<Y6a*ŽP/<c¨/</9f0N¹JÀßü-@ÿüJ®ÿüg/.ÿü/<YKa*TP#ügRc¨3üc¬/<c¨/<	/9d\N¹JÀßü-@ÿüJ®ÿüg/.ÿü/<Y`a)bPB9c¨B9c©ücªüc«B9c¬B9c­B9c®B9c¯J®ÿüg/.ÿü/<Yza)P/<c¨/<
/9f0N¹JÀßü-@ÿüJ®ÿüg/.ÿü/<Y“a(ÜP`N^NuNVÿìHîÿì/<Y¬HnÿïaÜP|ÿûN¹LÀ/<Y¹/<N¹LÐP#Àfª/<Y¾/9fªN¹LàP/<YÃ/<N¹LÐP#Àf®/<YÈ/9f®N¹LàP/<YÐ/9f®N¹LàP/<YÙ/9f®N¹LàP/<Yá/9f®N¹LàP/<Yê/<ÿN¹LÐP#Àf²/<Yñ/9f²N¹LàP/<Y÷/9f²N¹LàP/<Z/9f²N¹LàPHnÿï/9f²N¹LàP/<Z/9f²N¹LàPB®ÿü®ÿül(/< .ÿü倀fª @/N¹LðPR®ÿü`ÿÐN¹M`N^NuNVÿôHîÿôB®ÿø®ÿøl/9e(/.ÿøN¹LpP-@ÿü/.ÿüN¹L0XJ€gÔ .ÿø瀀Wü @ ÁyoT .ÿø瀀X @ yoT®ÿøl#îÿüd``®
ÿøl#îÿüoZ`x®ÿøl#îÿüe``®ÿøl#îÿüe`H®ÿøl(#îÿüe®ÿøfp`B€#ÀX¨`®ÿøl
#îÿü_˜R®ÿø`þô/</<N¹IPP/</<ZN¹KàP-@ÿô nÿô//<eaP`N^NuNVÿøHîÿø .râ -@ÿü .€ÿÿ-@ÿøJ®g .ÿü`àN¹6üN¹JP`î .ÿø`(N¹2ü`@aj`8aŠ`0aÞ`(`$€€bÿîÐ@0;NûÿÀÿÊÿÒÿÚ`š .ÿø`LJ¹X˜fp`B€#ÀX˜/9X˜/</9f²N¹M0ßü`6J¹Xœfp`B€#ÀXœ/9Xœ/</9f²N¹M0ßü`üJ¹X fp`B€#ÀX /9X /</9f²N¹M0ßü#ùX X˜/9X˜/</9f²N¹M0ßü`šJ¹X”fp`B€#ÀX”/9X”/</9f²N¹M0ßü``J¹X¤fp`B€#ÀX¤/9X¤/</9f²N¹M0ßü`&€€bÐ@0;NûþœþÖÿÿrÿ¬` €ÿgþ~€gþ€gþ/<N¹M X`N^NuNVÿðHîÿð/9e(N¹K X/9e(N¹KÀX/9e(N¹HðXN¹I@/9e(N¹L`X/<N¹I€X/</<N¹IPP/<ZN¹I°X/</<¾N¹IPP/<Z N¹I°X/<d/<¾N¹IPP/<Z*N¹I°X/</<N¹IPP/<Z1N¹I°X/<d/<N¹IPP/<Z;N¹I°X/<_ˆ/<ÿÿÿÿN¹KPP/<f</<_’N¹KÐP/<_’N¹IàX 9f<°¹e(f°09_ˆHÀ`š/<f8/9e(/<_’N¹LPßü-@ÿøJ®ÿøgl/</<_’/9f8N¹L@ßü yf8 P-h$ÿô®ÿôl/<d`aDX`>®
ÿôl/<oZa(X`"®ÿôl/<eaX`®ÿôl/<eaðX`ê®ÿôl,/<eaÔX®ÿôfp`B€#ÀX¨`´®ÿôl/<_˜ažX`˜®ÿôf^/9e N¹K X/9e N¹KÀX/9e N¹HðXa#h/9e N¹K°X/9e(N¹KÀX/9e(N¹HðX`0/9e(N¹K°X/9_œN¹KÀX/9_œN¹HðX`þ®ÿôlX yf8 P/($/<ZIN¹KàP-@ÿð/</9f8N¹L P nÿð P|	/.ÿðN¹KðX/.ÿðN¹LX®ÿôlz .ÿô瀀Wü @ ÁyoT .ÿô瀀X @ yoTN¹8n3ùoTc¨/<c¨/</9d\N¹JÀßü/<c¨/</9f0N¹JÀßü`€gý``ý
`N^NuNVÿüHîÿü n P P/($/<ZNN¹KàP-@ÿü nÿü PB(	/.ÿüN¹KðX/.ÿüN¹LX/.ÿüN¹J@X/< n/N¹L P n ¹f8`N^NuNVÿüHîÿüB®ÿüüSdZB¹f4B¹eB¹e,/<X¸N¹IðX/<2/<N¹IPP/<ZSN¹9|X/<È/<N¹IPP/<Z^N¹9|XJ¹X¤g/9e$N¹K X/<@/.ÿüN¹W@P"9f4²€gR®ÿü/<XÀN¹IðX/<È/<PN¹IPP/.ÿüaJX9dZH€HÀ`ÀaÀdZ`aŽÀdZ`öa¦ÀdZ`èa$ÀdZ`Úa¨ÀdZ`Ì/</<N¹IPP/<ZfN¹I°X`®J¹eg$/9eN¹JX/9f¢/<e0N¹JðP/</<N¹IPP/<Z†N¹9|X`\€DgÿVn$€Agÿ˜€BgÿZ€Cgÿ^`ÿ€€Fgÿ€Sgÿ€Zgÿ `ÿ^`þ’`N^NuNVÿøHîÿø 9e,R¹e,€o/</<Z aöPpA`H/<_ˆ/<ÿÿÿÿN¹KPPy_ˆf/</<Z¹a¾PpA`/<o^aÌX/<o^/</9f4/<Saßü/<f@HnÿüHnÿøaßü` 9dZ`¼ 9f4°®ÿüg9dZ`¤/<f@a¬XJ9ef
ü
eJ9ef
ü#eB¹e,/<@ 9f4R€/N¹W@P#Àf4pF`J9dZ`@/</<ZÍaÖPpA`(€gÿÖ€NgÿP€YgÿP`ÿÈ`N^NuNVÿôHîÿô 9e,R¹e,€o/</<ZäatPpA`ì/<_ˆ/<ÿÿÿÿN¹KPPy_ˆf/</<Zþa<PpA`´J¹ef”/<qha@X#ÀeJ¹ef/</<[a¤PJ¹X”g\-|qhÿô nÿôJgJ nÿôam nÿôzn
 nÿô
  nÿôzg nÿô{0f
 nÿô¼.R®ÿô`ÿ°/<qhaàX-@ÿø/<qh/.ÿø/9f4/<Faúßü/<f@HnÿüHnÿøaâßü`¦S®ÿülp?` .ÿü-@ÿü 9f4°®ÿüg9dZ`ž 9f4°®ÿüg9dZ`†B¹e,/<@ 9f4R€/N¹W@P#Àf4/<o^a–X#Àf¦pD`J9dZ`@/</<[#a°PpA`(€gÿÖ€NgÿJ€Ygÿn`ÿÈ`N^NuNVÿøHîÿø 9e,R¹e,€o/</<[=aNPpA`R/<_ˆ/<ÿÿÿÿN¹KPPy_ˆf/</<[VaPpA`/<o^/9f¦/9f4/<Da~ßü/<f@HnÿüHnÿøafßü`¶S®ÿülp?` .ÿü-@ÿü 9f4°®ÿüg9dZ`® 9f4°®ÿüg9dZ`–B¹e,/<@ 9f4R€/N¹W@P#Àf4/<o^aX#Àf¦€ÿÿÿÿfpZ`PpD`J9dZ`@/</<[ja$PpA`(€gÿÖ€Ngÿ:€Ygÿ^`ÿÈ`N^NuNVÿøHîÿø 9e,R¹e,€o/</<[aÂPpA`X/<_ˆ/<ÿÿÿÿN¹KPPy_ˆf/</<[–aŠPpA` /<o^/</9f4/<Zaòßü/<f@HnÿüHnÿøaÚßü`¼S®ÿülp?` .ÿü-@ÿü 9f4°®ÿüg9dZ`´ 9f4°®ÿüg9dZ`œB¹e,/<@ 9f4R€/N¹W@P#Àf4/9eN¹JX/9f¢/<e0N¹JðPB¹epB`J9dZ`@/</<[ªa’PpA`(€gÿÖ€Ngÿ4€YgÿX`ÿÈ`N^NuNVÿøHîÿø 9e,R¹e,€o/</<[Àa0PpA`/<_ˆ/<ÿÿÿÿN¹KPPy_ˆf/</<[×aøPpA`æ/<o^/</9f4/<Ba`ßü/<f@HnÿüHnÿøaHßü`‚S®ÿülp?` .ÿü-@ÿü 9f4°®ÿüg9dZ`z 9f4°®ÿüg9dZ`bB¹e,/<@ 9f4R€/N¹W@P#Àf4pC`89dZ`.pA`(€gÿè€Ngÿn€Ygÿ’`ÿÚ`N^NuNVÿüHîÿüB®ÿüüRdZB¹f4B¹e,B¹e/<X¸N¹IðX/<2/<N¹IPP/<[ëN¹9|X/<È/<N¹IPP/<[øN¹9|XJ¹X¤g/9e$N¹K X/<@/.ÿüN¹W@P"9f4²€gR®ÿü/<XÀN¹IðX/<È/<PN¹IPP/.ÿüa"X9dZH€HÀ`¤aÞÀdZ`ÈaöÀdZ`ºa
ÀdZ`¬/</<N¹IPP/<\N¹I°X`ŽJ¹eg$/9eN¹JX/9f¢/<e0N¹JðP/</<N¹IPP/<\N¹I°X`<€Agÿ¦€Cgÿv€Dgÿ^€FgÿF€Rgÿ.`þÎ`N^NuNVÿøHîÿø 9e,R¹e,€o/</<\2a
PpA`ì/<o^HnÿøHnÿüa|ßü`´/<o^aHX/<o^aðX/<o^/</9f4/<Ya
>ßü#ùe,oVB¹e,/<@ 9f4R€/N¹W@P#Àf4pF`b/</</9f4/<Naèßü9dZ`6/</<\Ha<PpA`€gÿ´€Sgÿ<`ÿÒ`N^NuNVÿðHîÿð 9e,R¹e,€o/</<\_aäPpA`è/<_ˆ/<ÿÿÿÿN¹KPPy_ˆf/</<\ua¬PpA`°/<o^HnÿüHnÿøaßü`Z 9oVR¹oV€opA`xJ¹f4fp?`
 9f4S€".ÿü²€f>/<o^a`X/<o^/</.ÿü/<Ya°ßüB¹e,9dZ`pA` 9oVR¹oV€opA`øJ¹f4fp?`
 9f4S€".ÿü²€f2/</</.ÿü/<Ya<ßüB¹e,9dZ`¦pA`  .ÿü°¹f4gpA`Œ/<o^/<qha’PJ¹X”g<-|qhÿð nÿðJg* nÿðAm nÿðZn
 nÿð R®ÿð`ÿÐ/<\…N¹9|X/<qhN¹9|XJ¹X fŒ/<\œ/<\•/</<qhN¹Kßü-@ÿôJ®ÿôg/.ÿô/<\¡aÆPpA`Ê/<e/</<qhN¹J€ßü-@ÿôJ®ÿôg/.ÿô/<\·a†PpA`Š`ˆ/<\Ï/<\È/</<qhN¹Kßü-@ÿôJ®ÿôg/.ÿô/<\Ôa<PpA`@/<e/</<qhN¹Kßü-@ÿôJ®ÿôg/.ÿô/<\êaüPpA`/</</9f4/<Ya	dßü#ùe,oVB¹e,/<@ 9f4R€/N¹W@P#Àf4pD`ª .ÿü°¹f4gpA`–/</</9f4/<YaúßüpC`n/</</9f4/<NaÒßü9dZ`BpA`<€gÿÆ€Bgÿ€€Fgý€€Sgü‚€Zgüø`ÿÆ`N^NuNVÿøHîÿø 9e,R¹e,€o/</<]a
ÂPpA`Ø/<_ˆ/<ÿÿÿÿN¹KPPy_ˆf/</<]a
ŠPpA` /<o^HnÿüHnÿøaüßü`T .ÿü°¹f4gš 9oVR¹oV€o/</<]*a
2PpA`HJ¹f4fp?`
 9f4S€".ÿü²€f2/<o^/</.ÿü/<YazßüB¹e,9dZ`ö/</<]@aÈPpA`Þ/.ÿø/<o^a
þP/</</9f4/<Ya ßü#ùe,oVB¹e,/<@ 9f4R€/N¹W@P#Àf4pD`x 9oVR¹oV€o/</<]Ua4PpA`JJ¹f4fp?`
 9f4S€".ÿü²€f2/</</.ÿü/<Ya|ßüB¹e,9dZ`ø/</<]kaÊPpA`à .ÿü°¹f4gpA`Ì/</</9f4/<Yaßü/9eN¹JX/9f¢/<e0N¹JðP/<@ 9f4R€/N¹W@P#Àf4pF`d/</</9f4/<Na¶ßü9dZ`8pA`2€gÿÆ€Dgýœ€Fgþž€Zgÿ,`ÿÐ`N^NuNVHî .R® @ .R®"@g`ÿä`N^NuNVÿüHîÿüB®ÿü .R® @Jg
R®ÿü`ÿêR®ÿü .ÿü``N^NuNVÿÀHîÿÀ|aÿöB®ÿÌ=yd^ÿØ-|ÿäBnÿìB®ÿîAîÿö-HÿàJ¹X¤gN/9e$N¹KÀX/9e$N¹HðX/<X¸N¹IðX/</<2N¹IPP/<]…N¹9|X.ÿögP/<ÿÿÿÿHnÿÀN¹J`PJnÿÐg,/<_ˆ/<ÿÿÿÿN¹KPPy_ˆfB€`*`ÿÐ.ÿö`ÿªJ¹X¤g/<]™N¹9|XB®ÿøJ®ÿøf/<ÿÿÿÿHnÿÀN¹J`PJnÿÐg,/<_ˆ/<ÿÿÿÿN¹KPPy_ˆfB€`¸`ÿÐJ¹X˜f.ÿö.ÿöf`ÿ˜nÿöÿ÷.ÿöH€HÀ€# n €J¹X¤g/<]¤N¹9|X n/a	ÊX/<ÿÿÿÿHnÿÀN¹J`PJnÿÐg,/<_ˆ/<ÿÿÿÿN¹KPPy_ˆfB€``ÿÐJ¹X˜f.ÿö.ÿöf`þø.ÿ÷H€HÀ.ÿöHHÁÐ@ÿ÷.ÿöH€HÀ€  n €J¹X¤g/<]»N¹9|X n/a	X/<ÿÿÿÿHnÿÀN¹J`PJnÿÐg,/<_ˆ/<ÿÿÿÿN¹KPPy_ˆfB€`h`ÿÐJ¹X˜f.ÿö.ÿöf`þH.ÿ÷H€HÀ.ÿöHHÁÐ@ÿ÷nÿöÿóJ¹X¤g"/<]ÍN¹9|X.ÿóH€HÀ/N¹8ÔXB®ÿü n .ÿü°l/<ÿÿÿÿHnÿÀN¹J`PJnÿÐg,/<_ˆ/<ÿÿÿÿN¹KPPy_ˆfB€`®`ÿÐJ¹X˜f.ÿö.ÿöf`&.ÿ÷H€HÀ.ÿöHHÁÐ@ÿ÷ .Юÿü @®ÿöR®ÿü`ÿf n Ю @B/<ÿÿÿÿHnÿÀN¹J`PJnÿÐg,/<_ˆ/<ÿÿÿÿN¹KPPy_ˆfB€``ÿÐJ¹X˜f.ÿö.ÿöf`üò-|ÿÿÿÿÿø`üæ.ÿ÷H€HÀ€Àì€.ÿ÷HHÁЀ?@ÿ÷.ÿ÷H€HÀ.ÿöHHÁ °g4J¹X¤g&/<]ÝN¹9|X.ÿöH€HÀ€ /aèXB.ÿóJ¹X¤gX/<]îN¹9|X/.N¹9|X/<_ˆ/<ÿÿÿÿN¹KPPy_ˆfÿâ/9_œN¹KÀX/9_œN¹HðX.ÿóH€HÀ``N^NuNVÿŒHî ÿŒAîÿ“*H-|ÿü .ÿü°¹_ n&/<oRHnÿø/9f0N¹J°ßüR®ÿü`ÿÐü .€#À .€#@ÿ÷ .€ À .€ Ñ.ÿ÷î.Ñ.ÿ÷B®ÿü .ÿü°®l& .Юÿü @Ð .Юÿü @Ñ.ÿ÷R®ÿü`ÿÒ.ÿ÷H€HÀ€Àì€.ÿ÷HHÁЀ?@ÿ÷.ÿ÷H€HÀ€ À¹eAîÿ“ 
ˆR€-@ÿøHnÿ“Hnÿø/9f0N¹J°ßüJ¹X¤gø/9e$N¹KÀX/9e$N¹HðX/<X¸N¹IðX/</<2N¹IPP/<^N¹9|X/<^N¹9|X/.aÞX/<^-N¹9|X.H€HÀ/N¹8ÔX/<^=N¹9|X .V€/a¢X/<^QN¹9|XHnÿ“N¹9|X/<_ˆ/<ÿÿÿÿN¹KPPy_ˆfÿâ/9_œN¹KÀX/9_œN¹HðX`Lî ÿŒN^NuNVÿðHîÿð-|ÿòB®ÿüHnÿûHnÿò/9eN¹J ßü€ÿÿÿÙg8.ÿûH€HÀ€-@ÿö® ÿöm"®ÿög9eH€HÀ".ÿö²€fª®
ÿöfJ¹Xœg-|
ÿö .ÿö@ÿû.
ÿûf2J¹X˜f( .ÿüЮ @¹eR®ÿü .ÿüЮ @¼MR®ÿü .ÿüЮ @¹eR®ÿü9eH€HÀ".ÿö²€g".ÿûH€HÀ
€@@ÿû .ÿö
€@-@ÿöJ¹X˜g .ÿüЮ @®ÿûR®ÿü` .ÿüЮ @®ÿùR®ÿü 9c¤Q€".ÿü²€m
 .ÿü` `þ¨J®ÿüfpÿ` .ÿü``N^NuNVÿðHîÿð-|ÿôB®ÿü .ÿü°®l¬ .Юÿü @Pÿó.#ÿóf>R®ÿü .ÿüЮ @Pÿó.ÿóH€HÀ€€#g.ÿóH€HÀ
€@@ÿó.
ÿófJ¹Xœg`8HnÿóHnÿô/9eN¹J°ßü-@ÿøJ®ÿøg/.ÿø/<^dašPR®ÿü`ÿL`N^NuNVHî n¼~ n|* n|  n|@ n|* n|#`N^NuNVHî nH€HÀ€ #Àc¤ n(H€HÀ€ #Àfž n(H€HÀ€ #À_  n(H€HÀ
€@ÀoR n(H€HÀ€ Àe nèe`N^NuNVÿðHîÿðJ®gXB®ÿü®
ÿülAîÿòÑîÿüBR®ÿü`ÿäHnÿò/.N¹MPP/<^x/<^wHnÿò/.N¹L ßü`$/<^{/<^z/<^y/.N¹L ßü/</<N¹LP`N^NuNVHî/./.aÿFPJ¹eg$/9eN¹JX/9f¢/<e0N¹JðPN¹JP`N^NuNVÿðHîÿðB®ÿü®
ÿülAîÿòÑîÿüBR®ÿü`ÿäHnÿò/.N¹MPPHnÿòN¹I°X`N^NuNVÿôHîÿô/<
/<N¹IPP-|ÿü®NÿünàB®ÿø®
ÿølV .ÿø€e @H€HÀ°®ÿüf4/<TN¹I X/</<TN¹IÀXD€/N¹I`P`
R®ÿø`ÿ¢/</<N¹IpP/</</.ÿüN¹W@PJ€fp`B€/N¹VhPV€-@ÿô .ÿôD€//<N¹IpP/.ÿô/<N¹I`PR®ÿü`ÿ`N^NuNVÿøHîÿøN¹>ÄaþÖ/</<ÿÿÿÿN¹KpP/<_ˆ/<ÿÿÿÿN¹KPPy_ˆf/<_’N¹IàXB®ÿü®
ÿül/< .ÿü€e @H€HÀ/N¹VhP29_”HÁ’€lR/< .ÿü€e @H€HÀ/N¹VhP29_”HÁ’€o"/<N¹K0X .ÿü€e @B`
R®ÿü`ÿh®
ÿümVB®ÿü®
ÿülF .ÿü€e @Jf,/<09_”HÀ/N¹V¸P".ÿüe A€`
R®ÿü`ÿ²N¹>ÄaýŒ`y_ˆf``þ´/</<^|N¹KàP-@ÿø/<e nÿø/añ&P/.ÿøN¹KðX/.ÿøN¹LX`N^NuNVÿ Hîÿ B®ÿª/</<Hnÿ²N¹IÐßüB®ÿ®®@ÿ®lAîÿÀÑîÿ®BR®ÿ®`ÿäHnÿ¶/</</<ÿÿÿÿ/</<Hnÿ²N¹M@ßü.ÿÀH€HÀ-@ÿ¤B®ÿ® .ÿ®°®ÿ¤l AîÿÀÑîÿ® .Юÿ®"@¨R®ÿ®`ÿØ .Юÿ® @BB®ÿ® .ÿ®°®ÿ¤lAîÿÀÑîÿ®CîÿÀÓîÿ®¨R®ÿ®`ÿÚAîÿÀÑîÿ®BJ.ÿ¶g>Hnÿ 0.ÿ¼HÀ/HnÿÀN¹J€ßü-@ÿªJ®ÿªg/.ÿª/<^aúªP`B®ÿ  nB .ÿ ``N^NuNVÿøHîÿøB®ÿüB®ÿøaÂN¹J#ÀsØ/<
N¹I0X/9_˜N¹LX€f
a`¤a®a#ü_¤t#üt/<ÿÿÿÿ/<säN¹J`P/<_ˆ/<ÿÿÿÿN¹KPPy_ˆgy_ˆf¤ 9_Š€ÿÀu9uf
a¦a009_–HÀ€g9uH€HÀ€t @Ðu`9uH€HÀ€r` @Ðu/<ÿÿÿÿ/<s¢N¹JpP-@ÿøJ®ÿøg/.ÿø/<_XN¹-‚P`y_ˆf
a¤`’ yuÿgH®ÿül6/<ô/9ua.P @ÿgR®ÿü/</<s`N¹JpPaD`,J®ÿüg$B®ÿüùr^u/<ÿÿÿÿ/<s¢N¹JpPJysôfþ˜`þl`N^NuNVÿüHîÿü/</<ÿÿÿúN¹IpP yuJ¹sàgX/</<^æ yuH€HÀ/aLßü-@ÿüg nÿüN ysà¼ÿR¹sà ysà¼ÿB¹sà`ÆJ¹sÔg‚/<
/<_
 yuH€HÀ/aìßü-@ÿügR#ùsÔsà#ùuu nÿüN 9sà°¹ub ysà¼ÿR¹sà`ÿÞB¹sÔB¹sàB¹u`< yuf#ùusà`  yuH€HÀ/a¤X yu¼ÿ/</<N¹IpPR¹u 9u°¹X¬e#ü_¤u`N^NuNVHî`N^NuNVHî .S€J®mL/</.N¹VhPЮ @°.f"/</.N¹VhPЮ @ (`S®`ÿ°B€``N^NuNVÿøHîÿøB®ÿü®ÿün .ÿü€_¤ @¼ÿR®ÿü`ÿÞürXür^B¹rZB¹sàB¹uB¹sÔ#ü_¤u/<ÿÿÿúN¹JÐX-@ÿøJ®ÿøg/.ÿø/<_fN¹-‚P/<ÿÿÿùN¹JÐX-@ÿøJ®ÿøg/.ÿø/<_vN¹-‚PN¹(#ü6zsð3ùd^süB¹tBytB¹tBysô#ü_¤tB¹sl3ùf2sx#üs„BysŒB¹sŽ#ürXs€B¹s®3ùf2sº#üsÆBysÎB¹sÐ#üusÂaŽ/<X¸N¹IðX`N^NuNVÿüHîÿü/<c¨/</9f0N¹JÀßüB®ÿü®–ÿül
R®ÿü`ÿî/<c¨/</9f0N¹JÀßü`N^NuNVÿüHîÿü.!l4/<	/<^°.H€HÀ/aýŒßü-@ÿüg nÿüN`\/<sÜN¹IXyàsÞoB¹^¤aPa®#üÿÿÿÿ^¤J¹^”ga
øaFaø.H€HÀ/N¹I X`N^NuNVHî nJg .R® @H€HÀ/aÿ0X`ÿÜ`N^NuNVHî .Ñ® .°¹X¬c .€-@`®_¤d .€-@ .``N^NuNVÿøHîÿø-|ÿüB®ÿø n+g n-f  .R® @+fp`pÿ-@ÿü n0mT n9nH/<
/.ÿøN¹VhP nHHÁЀ0-@ÿøR® .°¹X¬c
-|_¤`ÿ¤/.ÿø/.ÿüN¹VhP``N^NuNVÿüHîÿü-|_¤ÿüaü/<
N¹K0X/<_ˆ/<ÿÿÿÿN¹KPPy_ˆgy_ˆf’/<s’N¹K`X 9_Š€ÿÀu 9s–€€g9uH€HÀ€t @Ðu`9uH€HÀ€r` @Ðu nÿü¹uR¹rZ/</.ÿüaþP-@ÿüaùB`y_ˆf`
`ÿ2`N^NuNVÿüHîÿüB®ÿü®ÿül* .ÿü€r` @®ÿÿ .ÿü€t @®ÿÿR®ÿü`ÿÎürÀürh-|aÿü®zÿün .ÿü€t @`R®ÿü`ÿÞ`N^NuNVHî/<sÜN¹IX09sÞHÀ]€o/</<ÿÿÿúN¹I`P`aô`N^NuNVÿüHîÿüHnÿüN¹IX0.ÿüHÀ€	3Àu 3îÿþu"0.ÿüHÀV€3Àu$0.ÿþHÀ\€3Àu&J¹^g" 9q¸€º//<u N¹JP`/<u N¹IðX/</<N¹I`P`N^NuNVÿôHîÿô-|çÿô/<sÜN¹IXB®ÿü®
ÿülT/< .ÿü€e @H€HÀ/N¹VhP-@ÿø09sÞHÀ".ÿø²€o .ÿø°®ÿôl-nÿøÿôR®ÿü`ÿ¤®çÿôg09sÜHÀ//.ÿôN¹IPP`N^NuNVHîJ¹^¤f~/<sÜN¹IX09sÜHÀ°¹^œm8/9sØ/<ÿÿÿô/</<^¨N¹J0ßü/9sØN¹J X`$09sÜHÀ€/09sÞHÀ/N¹IPP`B¹^¤`N^NuNVHî/<sÜN¹IX09sÜHÀ//<N¹IPP`N^NuNVHî/<X¸N¹IðX`N^NuNVHî/<
/<N¹IPP`N^NuNVHî/<N¹K0X`N^NuNVHî/<sÜN¹IX09sÜHÀ€3Àu 09sÞHÀ]€3Àu"09sÜHÀV€3Àu$3üàu&/<u N¹IðX`N^NuNVÿüHîÿü/</9sàaúP/aú\X-@ÿü/<sÜN¹IX .ÿü`¾aÿV09sÞHÀV€3Àu 3üu"3üu$3üàu&/<u N¹IðX09sÜHÀ€3Àu 3üu"09sÜHÀV€3Àu$3ùsÞu&/<u N¹IðX3ü
u 09sÜHÀ€3Àu$3üàu&/<u N¹IðX`(aþ<` €gÿ<€gÿl€gÿÜ`N^NuNVHî/</<N¹I`P`N^NuNVÿôHîÿô-ysàÿü nÿü;g, .ÿü°¹uf`/</.ÿüaøžP-@ÿü`ÿÌ/</9sàaø„P/aøØX-@ÿø/</.ÿüaøhP/aø¼X-@ÿôJ®ÿøn
-|ÿøJ®ÿôn
-|ÿô/<S®ÿø/.ÿøN¹VhP€
#À^˜/<S®ÿô/.ÿôN¹VhP€
#À^œ/<S®ÿø/.ÿøN¹VhP€
3À^¨Jy^¨nBy^¨ 9^œ€3À^¬`N^NuNVÿôHîÿôB®ÿüB®ÿø-ysàÿô nÿô;g0 .ÿô°¹uf
aü¢`¬/</.ÿôa÷`P-@ÿô`ÿÈ/</9sàa÷FP/a÷šX-@ÿø/</.ÿôa÷*P/a÷~X-@ÿüS®ÿülB®ÿüS®ÿølB®ÿø/</.ÿøN¹VhP€
//</.ÿüN¹VhP€/N¹IPP`N^NuNVÿüHîÿü/</9sàaö¦P/aöúX-@ÿü .ÿü`êB¹^B¹^ /<N¹I€X/<N¹IX`R¹^ /9^ N¹I€X`øX¹^ /9^ N¹I€X`à#üÿÿÿÿ^/<N¹IX`Ä¹^ m 9^ S€/N¹I€XS¹^ `š¹^ m 9^ Y€/N¹I€XY¹^ `pB¹^/<N¹IX`X`T€gÿln$€gÿ€gÿ$€gÿ2`ÿÎ€gÿX€gÿx€gÿ˜`ÿ¬`N^NuNVHî/<sÜN¹IX09sÜHÀ°¹^˜n8/9sØ/</</<^¨N¹J0ßü/9sØN¹J X`$09sÜHÀ€/09sÞHÀ/N¹IPP`N^NuNVÿôHîÿô yuPÿÿ/</9sàaô P/aôôX-@ÿôJ®ÿôf
-|ÿô3üu"3ù^žu$3üàu&/<sÜN¹IX/<09sÜHÀ"9^œ’€/N¹V¸P".ÿô²€o&/<09sÜHÀ"9^œ’€/N¹V¸P-@ÿô.Lÿÿf"-|ÿø09sÜHÀ€	3Àu `-|ÿÿÿôÿø09sÜHÀ€	3Àu  .ÿôS®ÿôJ€g6/9sØ/.ÿø/</<u N¹J0ßü/9sØN¹J X`ÿÀ`N^NuNVÿüHîÿü/</9sàaóbP/aó¶X-@ÿüJ®ÿüf
-|ÿü/<sÜN¹IX09sÜHÀ€	3Àu 3ùsÞu"09sÜHÀV€3Àu$3üàu&/<09sÞHÀ"<à’€/N¹V¸P".ÿü²€o&/<09sÞHÀ"<à’€/N¹V¸P-@ÿü .ÿüS®ÿüJ€g8/9sØ/</<ÿÿÿú/<u N¹J0ßü/9sØN¹J X`ÿ¾`N^NuNVHî/<sÜN¹IX09sÜHÀ€	3Àu 3ùsÞu"09sÜHÀV€3Àu$3üàu&/9sØ/</</<u N¹J0ßü/9sØN¹J X`N^NuNVÿüHîÿü/</9sàañÄP/aòX-@ÿü®ÿüf#üÿÿÿÿ^”`N^NuNVÿüHîÿü/</9sàañ~P/añÒX-@ÿü®ÿüfB¹^”`N^NuNVHî 9sà°¹ug2 ysàH€HÀ/aðJX/</9sàañP#Àsà`ÿÂ`N^NuNVHî`N^NuNVHî#ùsàsÔ`N^NuN¹M`¨nNqN¹M`¨sNqN¹M`¨QNqN¹M`¨šNqN¹M`H¨›NqN¹M`¨œNqN¹M`¨žNqN¹M`H¨“NqN¹M`H¨”NqN¹M`H¨’NqN¹M`¨ˆNqN¹M`¨‰NqN¹M`¨ƒNqN¹M`¨„NqN¹M`	¨NqN¹M`P¨€NqN¹M`¨qNqN¹M`¨£NqN¹M`¨¥NqN¹M`¨ØNqN¹M`¨ÔNqN¹M`"P¨ïNqN¹M`PRN¹M`©ôNqN¹M`QU4N¹M`QU>N¹M`YSìN¹M`	SÐN¹M`‰T(N¹M`‰T.N¹M`IRHN¹M`	TÄN¹M`¹T|N¹M`YS¬N¹M`HYRˆN¹M`YTäN¹M`SN¹M`©ÈNqN¹M`¨þNqN¹M`©pNqN¹M`©vNqN¹M`HP´N¹M`©NqN¹M`¨Ö’©NqN¹M`©NqN¹M`©NqN¹M`©NqN¹M`¡©,NqN¹M`b© NqN¹M`©ªNqN¹M`©°NqN¹M`©ZNqN¹M`P©cNqN¹M`©`NqN¹M`©hNqN¹M`¡©lNqN¹M`©iNqN¹M`Š©¾NqN¹M`©{NqN¹M`‰©†NqN¹M`6Ø©‹NqN¹M`©´NqN¹M`©0NqN¹M`Ê©1NqN¹M`Щ3NqN¹M`P©5NqN¹M`©7NqN¹M`"©=NqN¹M`©8NqN¹M`
P©ENqN¹M`IàQN¹M`ÐQÎNVÿHî ÿøB.ÿ=|Nùÿ
-|N(ÿKîÿAî"n =|Nqÿ-Qÿm=|N¹ÿ"æˆA=AÿY2æˆAÒA2;Nûb82"?`ØR.ÿ/`Ð"Xá‰á‰á‰/`¼"`¶"g/`ª"AB‚"
RÙg
R‚BæmôQ"A‚/`Œ*y*NîÿJ.ÿg:Kî"n$æŠYX2æŠAgmîg/N¹RX`à"U0HÀ"€`Ö2.ÿÒA2;Nû0HÀ` `B€Lî ÿøN^XNu"_ _ -`R ,`N"_ O Þü`>¡/H`6"_ _ `*/yª`(/y¦`"_  L.€`p/	3ÀVNup`ÿô"_  M`ÿè /@`ÿè"_  @`ÿÔ"_¡" _ .€`ÿÂ/y`ÿÂ"_ _ K`ÿ®"_ _ -`ÿ¤ y0Cù ‘t°‚e"Q#È"€B"yª"ˆ ‚Ñ©Nu"_ ¡.ˆ`ÿf"_ _ `ÿ\"_ _ !.€jB—`ÿJ`ÿD"_  _  `ÿ:"_ _¡H.ˆ`ÿ."_ ¡".ˆ`ÿ""_ _ #`ÿ"_ _ %.€jB—`ÿ`ÿ"_  _ $`þö"_ _¡&.ˆ`þê"_ _¡(.ˆ`þÜ"_ _ +`þÔ"_  _ '`þÈ"_ _ )`þ¾"_ _ *`þ´"_ _ I`þª"_ _ J`þ  6`þœ" "_ _ ."A`þŠ?yVNu/y(Nu"_BW 90g°¹(f>¼NÑ"_ 0_/	 /?@Nu"_ /	 2Nu"_3ßDNÑ"_ _0/	 0J@gB/`|Nu"_ _0/	 1J@gB/`|Nut _?/­êt`ÿôt`ÿît`ÿèt _?/­ét`ÿôt`ÿît`ÿè4<`ÿà4<
`ÿØt _?/­ít`ÿôt`ÿît`ÿèt`ÿât`ÿÜt`ÿÖ4<
`4< _?/­í4<
`4<"o oB@BA/H/I _???/­í o?<©î o €` o /?<©î _PONÐ o2|Jg
ÀR‰`ò 	 o€ Nu o"HB€S€m
ØfS‰QÈÿøB /Nu oB€ÑÀRˆB /R€Nu /ÀNuNVÿÎAîÿÎ1n1nJ®gCè np .AîÿΠ=@N^"_ßüNÑNVÿ°Aîÿ°!n1nB( J@fBh  Cè "î"® 
=@N^"_ßüNÑ"_ _/	 3?@Nu"_ _/	 4?@Nu0/ o = _\O>€NÐ0/ > _TO>€NÐ opBgQÈÿü/HB/ O f0/Þü2?@.ŸNup`ð0/žü?@ O Þü _TONР??@Nu _"_ NÐ"o o©o _PONÐ"o o©n?@ _PONÐNVÿÎAîÿÎ1n1| -h
N^ _TONÐNVÿÀAîÿÀ1n!n
 =@N^"_\NÑNVÿÎAîÿÎ1n =@
N^ _TNÐNVÿÎAîÿÎ!n1nB(B(B¨ "n2¨=@N^ _ßü
NÐB`rNVÿÎAîÿÎ!n 1n"n!Q$Bh,B¨.Jf ` =@"n"¨(N^"_ßü
NÑNVÿÀAîÿÀ!n =@"n2¨N^"_PNÑNVÿÀAîÿÀ!n
1n =@N^"_\NÑNVÿàAîÿà1n =@
N^"_ßüNÑNVÿÎAîÿÎ!n1nB(B(B¨ 
=@"n2¨N^"_ßü
NÑ"< Nu`"< Nu`"< Nu`ü"< Nu`ò"< Nu`è"< Nu`Þ"< Nu`Ô"< Nu`Ê"< Nu`À"< Nu`¶"< Nu`¬"< 5Nu`¢"< Nu`˜"< Nu`Ž"< 	Nu`„"< 
Nu`z"< Nu`p"< Nu`f"< 
Nu`\"< ANu`R"< BNu`H"< CNu`>"< Nu`4"< Nu`*"< Nu` "< Nu`"< DNu`"< ENu`"_ _g/N—X>€NÑ"_ _ >€NÑ"_ _ >€NÑNVHç8(<$.lD‚D„&.lDƒD„B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐJ„lD€LßN^NuNVHç<*< .lD€D…&".lDD…(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿ€ÿÿÿlè€Á€ÿÿ$//N¹WÌP¶€lS‚ J…lD€Lß<N^NuNVHç8(< .lD€D„$".lDlB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹WÌP´€lƒ‚D€J„lD€LßN^NuNVHç0$.&.B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐLßN^Nuý|ý½ý^ý>ý.ýýýý
ýýÿÿóÿÿÿ0ÏÿÏÿ?ÿ@ÿÿÀÿÿÿÿÿÿÿÿc¤(Où†ô¾PÒ–F(à(´ô6^ùControlsDebuggerTabs--Press any  key to exitMacKermitBad volume name: .AIn.AOutCan't open drivers: Can't open drivers: Trouble making io buffer:Trouble with handshake: Trouble with handshake: Filenamecnv!FileExitModeConnectTransmitReceiveControlsOptionImageMacwriteExecutableDebugTABSBaud RateBits SentParityStop BitsXon/Xoff FlowCNTLCNTLSENDING...Packet File Successfully Transmitted. File transmission failed.In init-- too many tries
Mousedown Aborted
Bad packet type--sinitToo many tries-- in sfile
Mousedown Aborted
Kermit CancelledBad packet type--in sfileToo many tries--in sdata
Mousedown Aborted
Bad packet type--sdataToo many tries--seof
Mousedown Aborted
Bad packet type--seofToo many tries--sbreak
Mousedown Aborted
RECEIVING...Packet File Successfully Received.File Transfer Failed.Too many tries--rinitBad packet type--rinitToo many tries--rfile
Mouse Aborted




File Name: KERMITTEXTCouldn't create file:Can't open file:KERMITAPPLCouldn't create file:Couldn't open resources: Too many tries--rdata
Mouse Aborted
Too many tries--rdataBad Packet no--rdataToo many tries--rdataNot previous packet-rdataPacket Coming In


Got SOH 

Number of characters: 

Packet Number: 

Packet type: 

Bad Checksum: 

Here's the data:


Packet To Be Sent Out


Packet Number: 

Packet Type: 

Character Count:  

The Packet: 


Error in writing :TABSBad SFgetopen
†ô<X <¢
=î
>ŒDh>Ä>ä	=B?
>H²=H²8H²7H²MDh[HÄK?*HBJ?”C@´ADhmBör@ÚMDòPF:hGØlH*H`LDòBad Writeout:Bad input clearBad ouput clear"_start"*_savea5$(u_end"”main"üW_etext#ˆ__edata"^sinit"ÀKSelectWindow"ÐLNewMenu"àJGetVol$ˆ_myEvent"	@MSFGetFile" IDrawChar"	n8sendbreak" LSetCtlValue"MDrawMenuBar"@LTrackControl"
 MHiliteMenu$˜_online#ÈXControlRect"Tsendsw$	œ_theWindow$ _pad"KOpenRF"àsfile"
°KHideWindow"	0MCheckItem"	ÀLInitMenus"(SetupIO"
0SetupControls$¤_inbuff$¤cspsiz#üWmasks"#rpack"JFSClose"
ü2connection"	KNewWindow"Î+bufemp"	@KInitFonts$¨ccontrolparam#°Xwirect$¾cTWRecord$Zdstate$\dinnum"`JPBRead$`dbaud$ddDWRecord"	Ê.draw_tabs"	’DoCommand$exon$efp#	”Xfilnamcnv"	ÀICharWidth"ðJFlushVol"@JHNoPurge#¬Xendbuff$equote$
eescchr$eeol"€ITextFace"
ÐKFindWindow"ðHSetPort$etabs$estopb$eparity$	 eTabWindow"Jrinit"$sbreak"(.fatal$$eDebugWindow$
(eControlWindow$,enumtry"sdata"àKGetResource"	LStopAlert"z.printnum"
²SetupMenus#¨Xflowctl# Xexec" JFSRead"€JFSOpen"ðKChangedResource"|recsw$0evolname$0foutnum"PMNumToString"
Ø	DoControls"ü6flushio"
ðLInsertMenu$4fn"`IMove"	 LParamText"prfile"	Ô"stringlen"0LGetCtlValue"	¤"stringcpy"
MMenuSelect"PKGetNextEvent$
8ftheControl$<fwhichWindow$@frecpkt$žftimint"	Ô8MDrawChar"Ø
resetcontrol"	ISetCursor$¢fvolnum#œXmacwrite$¦fsize"’rdata"|9MDrawString"`LDrawControls#˜Ximage"¸Vldiv"0KSysBeep"pILine"î,rpar#¤Xdebug"	¢1open_file"
àIGlobalToLocal"
°LSystemTask"pKFlushEvents#	ÐXDebugRect$ªfmyMenus"°JFSWrite"PIMoveTo"
 KOpenDriver"‚-printerr$¶fCWRecord"¢,spar"PJExitToShell"
pLGetNewControl"àHInitGraf#ØXTabRect"â/change_tabs"€KInitWindows$Rgmybuff$Ropadchar"@Wlrem"
LWriteResource$Toconfig#ÀXmyrect$Vooldtry"ÐISetPt"@*bufill"(spack"PLFindControl"
 KShowWindow$Zobits"KCreate"	ðIEraseRect"
àLAppendMenu"ÀJControl"Ä>clear_screen"	@IPenNormal" IPenSize$^opacket$hqfilnam"’seof#¸Xinrect$¸qQD"hVlmul"
°IDrawString"€LInitDialogs$¼qwRecord"ÐJKillIO"	Ò;initchars$Xrcontrols#	˜^topmargin$Zrnuminbuffer$^rcontrolq$`rcharmap"0IPenMode"Hend_insert_mode"
0JScrollRect"IGetPen"`KGetKeys"	z6fixbuffer":myatoi"Bcursor_position"ÄHcsi$	`sxoffparam"pJPBWrite"
LGetCRefCon#
¨^scrollrect"B=tab$’stheKeys$¢soutparam"Œ>carriage_return#¤^overrun#æ^singescapetable"`Hunknown"hDreverse_line_feed$Ôsescseq"
X<back_space$Øsdumptr#œ^bottommargin"ITextMode" JEraseRgn"PGinsert_char"´@cursor_right#
_escapetable$Üsp#^invert"Ö:local"
?bell$àsbegptr"´9addptr$äsinparam"òDinsert_delete_line"	öBtext_mode#”^insert"ä>home_cursor$tcontcharmap#	 ^textstyle":Fdelete_char#°^controltable$uendptr$uoutp"JFillRect"Œ6lookup"
*?clear_line"¢<space"	î=line_feed$uoutchar"JNewRgn"ò4printit"ØGinsert_mode"Ú@set_scroll_region"²Hdummy"
”?erase_display$ ucurrect"`M_mactrap"	RP_hnopurge"4U_pbread">U_pbwrite"ìS_fsopen"ÐS_fsclose"(T_fsread".T_fswrite"HR_control"ÄT_killio"|T_getvol"	¬S_flushvol"ˆR_create"äT_openrf"	S_opendriv"	´P_flusheve"	Q_sfgetfil"	ÎQ_numtostr"Rp2cstr"	bP_blockmov"4P_hlock"	P_recoverh"	P_handlezo"	úO_sethandl"	O_resrvmem"	 N_setapplb"	P_emptyhan"	†P_gzcritic"	|P_gz_saveh"8O_topmem"	NO_setappll"	–O_dispospt"	(P_realloch"ŠO_newptr"	¶O_setptrsi"	ÞN_systemzo"	ªN_initappl"HP_hpurge"ÈN_setzone"ÂO_ptrzone"	DO_setgrowz"	
O_purgemem"	rP_memerror"	ÎO_newhandl"(O_maxmem"	XO_maxapplz"	°N_initzone"	\P_moremast"	äO_gethandl"	ÚO_disposha"	ÒN_appliczo"	 O_getptrsi"O_freemem">P_hunlock"	êN_compactm!	Verrorcode"¾N_getzone"	äP_getoseve"	ÈP_oseventa"	¤P_posteven"	¾P_setevent"	pQ_iumetric"	Q_sfpgetfi"	vQ_iumagstr"	HQ_iugetint"	
Q_sfpputfi"	ºQ_stringto"	8Q_diverify"	RQ_iusetint"	XQ_iudatest"	Q_sfputfil"	^Q_iudateps"ÜQexit8"	ŠQ_iucompst"	~Q_iumagids"	jQ_iutimeps"	dQ_iutimest"@Q_dizero"	2Q_diformat"	&Q_diunload"	’Q_iuequals"Q_diload"	,Q_dibadmou"äQc2pstr">Risapstr">RIsAPStr"RP2CStr"äQC2PStr"(RCofPStr"	ÐR_vinstall"tS_dequeue"	ìR_drvrinst"	\S_initqueu"	ˆS_getdctle"	:S_closedri"dS_enqueue"ÞR_vremove"	TS_initutil"	þR_drvrremo" T_setvol"	òU_pbsetfve"	¬U_pbdelete"	¶U_pbopenrf"	\V_pbunmoun"	\U_pbkillio"*U_pbclose"	V_pbgetfpo"	ÔU_pbsetfin"	RV_pbmountv"	$V_pbsetfpo"	.V_pbflushf"	V_pbseteof"	ÀU_pbrename"„U_pbeject"	RU_pbstatus"	ÊU_pbgetfin"	¢U_pbcreate"	zU_pbsetvol"	pU_pbgetvol"	fU_pbgetvin"	ŽU_pbofflin"	üU_pballoca"	èU_pbrstflo"	HU_pbcontro"	˜U_pbflushv" U_pbopen"	ÞU_pbsetflo"	V_pbgeteof"ÌWulmul(Ü€¨¹†(ÜŒ*ܤ*ܬ*Ü´ŠéºŠéÀ*ÜÆÔÜâî*Üú)Ü.)Ü4*Ü:@*ÜL)Üp)Üv*Ü|‚*ÜŽ)ܲ)ܸ*ܾÄ*ÜÐ)Üô)Üú*Ü*Ü*Ü"*Ü**Ü6Nb*Üj*Üpv)ÜŽ*Üœ¦*ܬ¸*ÜÀ*ÜÌ*ÜÒØ*Üìò)Ü4:*ÜB)ÜHN*ÜV*Ü\*Ü`*Üf*Ürx)Ü”*Ü *ܬ²)ÜÎ*ÜÚ*ÜÞ*Üæ*Üì*Üøþ)Üjr&jr,*Ü4*Ü<jrBjrHjrNjrT)Üf*Ür*Ü~„)Ü )ܾÔ)ÜÚæ*Üî)Üô*Üú)Ü*Ü)Ü"*Ü(.)Ü6*Ü<B)ÜJ*ÜPV)Ü^*Üdj)Ür~*܆)ÜŒ*Ü’˜)Ü *ܦ¬)Ü´*ܺÀ*ÜÌÒ)ÜÚ*Üàæ

$*ÜLVf	zêÉ„	êÉš*Ü®*ÜÆ*ÜÞ*Üö*Ü)Ü(*Ü@Z)Ühn*Ü€ÈÎà	l4)ÜF)ÜL*ÜX^	ln)Ü€)܆*Ü’˜	l¨)ܺ)ÜÀ*ÜÌÒ)ÜÞ)Üâ)Üè*Üôú	l
	)Ü	)Ü"	*Ü.	4		lD	)ÜV	)Ü\	*Üh	n	Ê	*Üä	ê	*Üò	ø	*Ü


*Ü

(
<
)ÜD
J
^
)Üf
l
€
)܈
Ž
¢
)ܪ
°
Ä
)ÜÌ
Ò
*ÜÚ
æ
*Üî
*Üô
ú
*Ü*ܪÀ*Ü *Ü,*Ü2*Ü8>*Ü\*Übh*Üt*ÜŽ*ܪ*ÜÆ*Üâ*Üþ)Ü*Ü4*ÜPV*Ü^d*Ülr*Ü~„*ÜŒ’*Üš *ܬ²*ܺÀ*ÜÈÎ*Üæ)Üòø*Ü


(
4
	N
êÉX
	d
êÉn
t
*Üz
*Ü~
*Ü„
*Ü
–
*Ü¢
*Ü®
´
)Üð
ö
(<*ÜH*ÜfŠélŠérŠéx)Ü~„˜)Ü ¦º)ÜÂÈ	lÐ*ÜÚàò*Üú)Ü
$*Ü6*ÜH*ÜV*Üd*Ür*Ü€–)Üž¤
l°*ܺÀ*ÜÈ*ÜÎÔè)Üðö*ÜjjÅp)܆*ܘ¤ªÇ®)ܾ*ÜÐ*ÜÜ*Üè*Üþ*Ü*Ü$*Ü2*Ü<
lH*ÜT
lZ*ÜfŠél*Üx‚*ÜŠ*Ü–)ܦ*ÜìjÅò)Ü*Ü&ªÇ0)Ü@
lR*Ü\*Üh
ln)Ü~	lŠ*Ü”*Üî*Üþ*Ü*Ü*ÜP*Ü^*Üh*ÜvŠé€*ÜŒ–*Üž*ܤ*Ü°*ܼ)ÜÌ*ÜjÅ)Ü.*Ü@LªÇV)Üf*Üx*Ü~*Ü„*Üš*ÜÌ*ÜÚ*Üä*ÜòŠéü*Ü*Ü*Ü *Ü,*ÜH)ÜX*ÜžjŤ)ܺ*ÜÌتÇâ)Üò*Ü*Ü*Ü&*ÜX*Üf*Üp*Ü~Šéˆ*Ü”ž*ܦ*ܬ²*ܺ*ÜÀÆŠéÎ*ÜÚ)Üê*Ü0jÅ6)ÜL*Ü^jªÇt)Ü„*Ü–*Ü¢*ܸ*Üê*Üø*Ü*ÜŠé*Ü&0*Ü8*ÜD*ÜŽŠé”ŠéšŠé )ܦ¬À)ÜÈÎâ)Üêð	lø*Ü*Ü")Ü28L*Ü^*Üp*Ü~*ÜŒ¢)ܪ°
l¼*ÜÆÌ*ÜÔ*ÜÚàô)Üü*ÜVjÅ\)Ür*Ü„*Ü *ܬ*ܸ*ÜÄ*ÜÚ*ÜÞŠéä*Üðú*Ü*Ü*Ü0)Ü@*Ü|jÅ‚)ܘ*ܪ¶ªÇÀ)ÜÐ*Üâ*ÜþjÅ
l*Ü**Ü<*ÜHŠéh*Ün*Ü~jÅ„
lš*ܪŠéÜ*ÜâªÀö*Ü*Ü	l*Ü")Ü\b*Üjp	lx)Ü‚)܈*Ü”š)ܶ*ÜÈ*ÜÔÚ)Üö)Ü)Ü*Ü$)Ü@*ÜR*Ü^d)Ü€*Üž*Ü´*ܸŠé¾*ÜÊÔ*ÜܪÀì*Ü*Ü0*ÜF*ÜžjŤ)ܺ*ÜÌتÇâ)Üò*Ü ªÀ$ *Ü. jÅ4 )ÜJ 
l\ *Ül *Ü~ Šéž *ܤ )Ü´ *ÜÊ *Üâ *Üø *Üü Šé!*Ü!!*Ü !*Ü,!jÅ2!)ÜH!
lZ!*Üj!Šéœ!*Ü¢!)ܲ!ªÀÈ!*Üä!*Üú!"*Ü"*Ü""*Ü"","*Ü4"*ÜL"*Üb"*Ü$#	lD#*ÜN#T#*Ü\#b#)Üj#p#„#)ÜŒ#’#®#*ܾ#Ê#ªÇÔ#	lò#)Üü#$ $*Ü0$<$ªÇF$	lZ$	l’$)Üœ$¢$À$*ÜÐ$Ü$ªÇæ$	lú$	lB%)ÜL%R%p%*Ü€%Œ%ªÇ–%	lª%	lä%)Üî%ô%&*&*Ü:&F&ªÇP&	ld&Æ&*ÜÖ&â&ªÇì&	l'	lj')Üt'z'	lœ')ܦ'¬'¸'*ÜÀ'Ì'ªÇÖ'*Üà'æ'*Üî'ô'ªÀ,(*Ü6(*Ü@(F(*Ü)*Ü")()	l4)*Ü>)D)*ÜL)R))ÜZ)`)t))Ü|)‚))ÜŠ)))Ü¢)¨)º))ÜÂ)È))ÜÞ)ä)ð)*Üø)*ªÇ**Ü***Ü&*,**Ü`*f**ܦ*	lÆ*	lê**Üþ**Ü$+*Ü.+	lb+*Ü”+	lP,*Üf,l,)܈,*Ü
-*Ü"-*Ü:-*ÜR-*Üj-*Üv-À-)ÜÈ-)ÜÎ-Ü-)Üì-)Üò-)Üø-..
lB.*ÜL.R.*ÜZ.*Ü`.f.n.°.¼.â.
/./B/N/n/†/ž/º/Ì/î/0*Ü00ªÇ"0*Ü,020
T0d0*Ül0
Š0š0*Ü¢0¶0
Â0
ø0*Ü11
"181ªÇH1)Ü`1f1*Ür1ˆ1”1Â12¶2)ÜÒ23*Ü3&3*Ü.343*ÜV3*ÜZ3*Üd3*Üp3v3*Ü~3Š3
˔3
Ë 3*ܪ3*ܶ3jž3*ÜÐ3*Üâ3
ì3*Üô3*Üþ3
4*Ü4*Ü4"4)Ü:4@4
ËN4*Ü`4*Ü€4*Ü 4¦4*ÜÀ4*ÜÄ4*ÜÐ4Ö4
lÞ4
5*Ü5
l5)Ü,5*Ü25*ÜX5ªÅb5*Üh5Šér5
l|5)ÜŒ5*Ü’5*ܲ5*ܶ5*ܼ5*ÜÀ5*ÜÌ5ªÀÒ5*ÜÜ5ªÅæ5Šéð5Šéö5Šéü5*Ü6*Ü6*Ü6*Ü"6*Ü66L6ŠÅT6*ÜZ6©À`6*Üj6*Ün6°6Ò6
7*Ü27*Ü:7je@7ŠéF7ŠéL7ŠéR7*ÜX7*Ü\7h7)Ü€7†7”7)ܬ7²7º7(ÜÀ7*ÜÄ7*ÜÊ7*ÜÎ7ŠéÔ7ŠéÚ7Šéà7Šéæ7*Üì7*Üð7jö7*Üü7*Ü8*Ü
8j8j8*Ü8*Ü 8
é&8*Ü,8*Ü08*Ü:8
é@8
éF8*ÜL8*ÜP8)ÜZ8`8*Üz8*܆8Œ8*Ü°8*ܼ8Â8)Üð8*Ü9"9êÆ,9‰é69)ÜH9	lN9n9©ÀÌ9j¼è9€:©À¦:*Ü°:Ä:*Üâ:ô:*Üü:;
Ë;
Ë;*Ü(;.;*Ü6;*ÜB;*ÜH;*ÜX;
b;*Üj;*Üt;
~;*܆;*Ü;jÅ–;
˺;
ò;
<*Ü<*Ü <
><*Üd<j<*Ür<Œ<²<*ÜÆ<*ÜÎ<*ÜÜ<*Üê<	lð<*Üú<*Ü==*Ü= =4=*ÜV=\=
~=Ž=*Üš=*ÜÒ=à=	lú=*Ü>
>*Ü>©À>*Ü$>)Ü6><>*ÜH>N>*ÜZ>*Üj>t>‰é€>*ܘ>ž>*ܦ>¶>)ÜÐ>Ö>ü>?*Ü6?<?*ÜD?*ÜR?*ÜX?*Üb?*Üh?*Ür?*Üz?*Ü€?†?*ܦ?*ܾ?Ä?*ÜØ?*Üâ?*Üê?*Üò?*Üú?*Ü@@*Ü@*Ü@*Ü$@*Ü*@*Ü4@*Ü:@*Ü>@*ÜD@J@*ÜT@*ÜZ@*Üh@*Üp@*Üv@|@Ì@*Üæ@ªÀþ@*Ü*AŒA)ÜšA®A)ܼAÐA)ÜÞA	läAitîA)ÜôA)ÜB*Ü BªÀ8B*ÜhB¾BØBèB*ÜC‰é(Ci.C:CHC)ÅTC)ÜZC`C)ÅlC)ÜrCxC)܈C”C)ŤC)Ü®C¸C)ÅÀC)ÅÎC)ÜØCâC)ÅêC‰éôCD*ÜtDzD*Ü‚D©ÀŠD*Ü”D)ܦD¬D*ܸD¾D*ÜÊD*ÜÚDäD*ÜþD*ÜE*Ü8E)Ü>E*ÜBE*ÜJE*ÜPEVE*ÜdE)ÜlEvE*ÜŽE)Ü–E E*ܾE*ÜÌE*ÜÞE*ÜìE*ÜF*ÜFF*Ü"F(F*ÜLF*ÜtFzF*Ü‚F*ÜF*Ü–F*ÜšF*Ü F*ܪF*ܲF*ܾFÐF*ÜèFúF*ÜG*Ü&G,G*Ü8G>G*Ü\GbG*ÜjG*ÜxG*Ü~G*Ü‚G*܈G*Ü’G*ÜšG*Ü G*ܲG¸G*ÜÄGÊG*ÜêG)ÜH*Ü0H‰éTH*ÜlHªÀrH*Ü|H*Ü–H*Ü¢H*ÜÐH*ÜÔHâHòHII"I2IBIRIbIrI‚I’I¢I²IÂIÒIâIòIJJ"J2JBJJJRJbJjJrJzJ‚JŠJ’JšJ¢JªJ²JºJÂJÊJÒJÚJâJêJòJúJK
KKK"K*K2KBKRKbKrKzK‚K’K¢K²KÂKÒKâKòKLL"L2LBLRLbLrL‚L’L¢L²LÂLÒLâLòLMM"M2MBMJMRMZM(ÜvM(Ü N¨¹VN¨¹"W¨¹¬Wjé°hé¶hé¼héÂhéÈhéÎhéÔhéÚhéàhéæhéìhéòhéøhéþhéhé
héhéhéhé"hé(hé.hé4hé:hé@héFhéLhéRhéX
T0d0*Ül0
Š0š0*Ü¢0¶0
Â0
ø0*Ü11
"181ªÇH1)Ü`1f1*Ür1ˆ1”1Â12sumacc/mac/Makefile   444      0     12        1447  3472475742   7525 #
DESTDIR=
CFLAGS=	-O

# Programs that live in subdirectories, and have makefiles of their own.
#
SUBDIR=	cal kermit print ramdisk

# C programs that live in the current directory 
#
CUR=	grow.rsrc macscrawl.rsrc insane.rsrc alert.rsrc \
	mfinder.rsrc testprint.rsrc boot.rsrc

all:	${SUBDIR} ${CUR}

cur:	${CUR}

${SUBDIR}: /tmp
	cd $@; make ${MFLAGS}

.SUFFIXES: .rsrc .b

.c.b:
	cc68 -c -I../h $<

.s.b:
	cc68 -c $<

.b.rsrc:
	cc68 -z -m $<
	rmaker $*.rc

grow.rsrc: grow.b grow.rc
macscrawl.rsrc: macscrawl.b macscrawl.rc
insane.rsrc: insane.b insane.rc
alert.rsrc: alert.b alert.rc
mfinder.rsrc: mfinder.b mfinder.rc
testprint.rsrc: testprint.b testprint.rc
boot.rsrc: boot.b boot.rc

clean:
	rm -f a.out core *.s *.o *.b z
	for i in ${SUBDIR}; do (cd $$i; make -i ${MFLAGS} clean); done
	rm -f ${CUR}
d<j<*Ür<Œ<²<*ÜÆ<*ÜÎ<*ÜÜ<*Üê<	lð<*Üú<*Ü==*Ü= =4=*ÜV=\=
~=Ž=*Üš=*ÜÒ=à=	lú=*Ü>
>*Ü>©Àsumacc/mac/grow.c   444      0     12       20662  3470501405   7207 /*	grow.c	1.0	05/25/84		*/

/*
 * grow
 *
 * scroll bars and a resizable window added to "edit".
 * by Cary Clark, Mac Tech Support
 *
 * translation of the pascal sample program "grow".
 *
 * NOTE: even the Pascal version of this doesnt work properly with
 * the notepad/scrapbook desk accessories, so this example must not be
 * saving proper state from the TextEdit package...
 */

/*
 * history
 * 05/25/84	Croft	translated from Pascal
 */


#include "mac/quickdraw.h"
#include "mac/osintf.h"
#include "mac/toolintf.h"

#define	numMenu		3	/* number of menus */
#define	appleMenu	1	/* menu IDs */
#define	fileMenu	256
#define	editMenu	257

#define	TRUE	1
#define	VIS	1
#define	FALSE	0
#define	NIL	0


MenuHandle myMenus[numMenu];
Rect	growRect, dragRect, pRect, tRect;
EventRecord myEvent;
int	code, refNum, myControl, t;
WindowRecord wRecord;
WindowPtr theWindow, whichWindow;
int	theMenu, theItem;
char	theChar;
int	ticks;
TEHandle hTE;
CursHandle hCurs;
Cursor	iBeam;
ControlHandle hScroll, vScroll, whichControl;
Point	theOrigin;


main()
{
	struct QDVar QDVar;	/* or we could call NewPtr */

	QD = &QDVar;
	InitGraf(&thePort);
	InitFonts();
	FlushEvents(everyEvent,0);
	InitWindows();
	SetupMenus();
	TEInit();
	InitDialogs((ProcPtr)NIL);
	SetCursor(&QD->arrow);
	SetRect(&dragRect,4,24,508,338);
	SetRect(&growRect,100,60,512,302);

	theWindow = GetNewWindow(256, &wRecord, (WindowPtr)-1);
	SetPort(theWindow);
	theWindow->txFont = 2;

	ResizePRect();
	hTE = TENew(&pRect,&pRect);
	hCurs = GetCursor(256); iBeam = **hCurs;

	vScroll =   GetNewControl(256, theWindow);
	hScroll =   GetNewControl(257, theWindow);
	theOrigin.h = 0; theOrigin.v = 0;

	for (;;) {
		CursorAdjust();
		SystemTask();
		TEIdle(hTE);
		t = GetNextEvent(everyEvent,&myEvent);
		switch (myEvent.what) {
		case mouseDown:
			code = FindWindow(&myEvent.where,&whichWindow);
			switch (code) {
			case inMenuBar:
				DoCommand(MenuSelect(&myEvent.where));
				break;

			case inSysWindow:
				SystemClick(&myEvent,whichWindow);
				break;

			case inDrag:
				DragWindow(whichWindow,
				    &myEvent.where,&dragRect);
				break;

			case inGoAway:
				if (TrackGoAway(whichWindow,&myEvent.where))
					Exit();
				break;
			
			case inGrow:
				if (whichWindow == FrontWindow())
					GrowWnd(whichWindow);
				else
					SelectWindow(whichWindow);
				break;

			case inContent:
				if (whichWindow != FrontWindow())
					SelectWindow(whichWindow);
				else
					mouseme();
			}
			break;

		case keyDown:
		case autoKey:
			if (theWindow != FrontWindow())
				break;
			theChar = (myEvent.message & 0xff);
			if (myEvent.modifiers & cmdKey)
				DoCommand(MenuKey(theChar));
			else
				TEKey(theChar,hTE);
			break;

		case activateEvt:
			DrawGrowIcon(theWindow);
			if (myEvent.modifiers & activeFlag) {
				TEActivate(hTE);
				ShowControl (vScroll);
				ShowControl (hScroll);
			} else {
				TEDeactivate(hTE);
				HideControl (vScroll);
				HideControl (hScroll);
			}
			break;

		case updateEvt:
			BeginUpdate(theWindow);
			DrawWindow(theWindow);
			EndUpdate(theWindow);
			break;
		}
	}
}


SetupMenus()
{
	int i;

	InitMenus();
	myMenus[0] = NewMenu(appleMenu, "\024");
	AddResMenu(myMenus[0], "DRVR");
	myMenus[1] = GetMenu(fileMenu);
	myMenus[2] = GetMenu(editMenu);
	for (i = 0 ; i < numMenu ; i++) 
		InsertMenu(myMenus[i], 0);
	DrawMenuBar();
}


/*
 * Makes cursor be I-beam inside the (active) application window's
 * content region (except for size box and scroll bar areas).
 */
CursorAdjust()
{
	Point mousePt;

	GetMouse(&mousePt);
	if (theWindow != FrontWindow())
		return;
	if (PtInRect(&mousePt,&pRect))
		SetCursor(&iBeam);
	else
		SetCursor(&QD->arrow);
}


DoCommand(mResult)
{
	char name[64];
	char *DAname();

	theMenu = mResult >> 16;
	theItem = (mResult & 0xffff);
	switch (theMenu) {
	case appleMenu:
		GetItem(myMenus[0], theItem, name);
		refNum = OpenDeskAcc(DAname(name));
		break;

	case fileMenu:
		Exit();
		break;

	case editMenu:
		/* 
		 * SystemEdit expects 0=undo, 1=----, 2=cut, 3=copy, etc.,
		 */
		if (SystemEdit(theItem-1))
			break;
		SetPort(theWindow);
		ClipRect(&pRect);
		/* delay so title stays lit if cmd key typed */
		ticks = TickCount() + 30;
		while (TickCount() <= ticks);
		switch (theItem) {
		case 3:
			TECut(hTE);
			break;

		case 4:
			TECopy(hTE);
			break;
		
		case 5:
			TEPaste(hTE);
			break;
		}
		break;
	}
	HiliteMenu(0);
}


MoveScrollBars()
{
	register Rect *r;

	r = &theWindow->portRect;
	HideControl(vScroll);
	MoveControl(vScroll,r->right - 15, r->top - 1);
	SizeControl(vScroll,16, r->bottom - r->top - 13);
	ShowControl(vScroll);
	HideControl(hScroll);
	MoveControl(hScroll,r->left - 1, r->bottom - 15);
	SizeControl(hScroll,r->right - r->left - 13, 16);
	ShowControl(hScroll);
}


ResizePRect()
{
	pRect = thePort->portRect;
	pRect.left = pRect.left+4; pRect.right = pRect.right-15;
	pRect.bottom = pRect.bottom-15;
}


/*
 * Handles growing and sizing the window and manipulating
 * the update region.
 */
GrowWnd(whichWindow)
	WindowPtr whichWindow;
{
	int	longResult;
	int	height,width;


	longResult = GrowWindow(whichWindow, &myEvent.where, &growRect);
	if (longResult == 0)
		return;
	height = HiWord(longResult); width = LoWord(longResult);

	/* Add the old "scroll bar area" to the update region so it will */
	/* be redrawn (for when the window is enlarged). */
	tRect = whichWindow->portRect; tRect.left = tRect.right-16;
	InvalRect(&tRect);
	tRect = whichWindow->portRect; tRect.top = tRect.bottom-16;
	InvalRect(&tRect);

	/* Now draw the newly sized window. */
	SizeWindow(whichWindow,width,height,TRUE);
	MoveScrollBars();
	ResizePRect();

	/* Adjust the view rectangle for TextEdit. */
	(*hTE)->viewRect = pRect;

	/* Add the new "scroll bar area" to the update region so it will */
	/* be redrawn (for when the window is made smaller). */
	tRect = whichWindow->portRect; tRect.left = tRect.right-16;
	InvalRect(&tRect);
	tRect = whichWindow->portRect; tRect.top = tRect.bottom-16;
	InvalRect(&tRect);
}


/* Draws the content region of the given window, after erasing whatever */
/* was there before. */
DrawWindow(whichWindow)
	WindowPtr whichWindow;
{
	ClipRect(&whichWindow->portRect);
	EraseRect(&whichWindow->portRect);
	DrawGrowIcon(whichWindow);
	DrawControls(whichWindow);
	TEUpdate(&pRect,hTE);
}


ScrollBits()
{
	Point oldOrigin;
	int dh,dv;

	oldOrigin = theOrigin;
	theOrigin.h = 4*GetCtlValue(hScroll);
	theOrigin.v = 4*GetCtlValue(vScroll);
	dh = oldOrigin.h - theOrigin.h;
	dv = oldOrigin.v - theOrigin.v;
	TEScroll (dh, dv, hTE);
}


/*
 * since ScrollUp and ScrollDown are called from Pascal, the
 * arguments must be obtained with "getpargs".
 */
struct tcargs {		/* args passed from Pascal TrackControl */
	short	theCode;
	ControlHandle whichControl;
};


ScrollUp()
{
	struct tcargs a;

	getpargs(&a, sizeof a);
	if (a.theCode != inUpButton)
		return;
	SetCtlValue(a.whichControl,GetCtlValue(a.whichControl)-1);
	ScrollBits();
}


ScrollDown()
{
	struct tcargs a;

	getpargs(&a, sizeof a);
	if (a.theCode != inDownButton)
		return;
	SetCtlValue(a.whichControl,GetCtlValue(a.whichControl)+1);
	ScrollBits();
}


PageScroll(code, amount)
{
	Point myPt;

	do {
		GetMouse(&myPt);
		if (TestControl(whichControl, &myPt) != code)
			continue;
		SetCtlValue(whichControl,GetCtlValue(whichControl)+amount);
		ScrollBits();
	} while (StillDown());
}


Exit()
{
	ExitToShell();
}


mouseme()
{
	GlobalToLocal(&myEvent.where);
	if (PtInRect (&myEvent.where, &pRect)) {	/* in text */
		if (myEvent.modifiers & shiftKey)
			TEClick(&myEvent.where,TRUE,hTE);
		else
			TEClick(&myEvent.where,FALSE,hTE);
		return;
	}
	/* else was a control */
	myControl = FindControl(&myEvent.where,whichWindow,&whichControl);
	switch (myControl) {
	case inUpButton:
		t = TrackControl(whichControl,&myEvent.where,ScrollUp);
		break;

	case inDownButton:
		t = TrackControl(whichControl,&myEvent.where,ScrollDown);
		break;

	case inPageUp:
		PageScroll(myControl,-10);
		break;

	case inPageDown:
		PageScroll(myControl,10);
		break;

	case inThumb:
		t = TrackControl(whichControl,&myEvent.where,(ProcPtr)NIL);
		ScrollBits();
		break;
	}
}


/*
 * Desk accessories have weird names that begin with a leading zero.
 * Since this fools the automatic C/Pascal string conversion stuff, we
 * have this little gem;  given a C string, it returns a Pascal string
 * with leading zero.  Luckily I know of no other dependencies on embedded
 * zeros in Macintosh strings.
 */
char *DAname(s)
	char *s;
{
	static char ps[32];
	int i = 1;
	register char *cp,*dp;

	cp = s;
	dp = &ps[2];
	while ((*dp++ = *cp++))
		i++;
	ps[0] = i;
	return (isapstr(ps));
}

Control(vScroll,16, r->bottom - r->top - 13);
	ShowControl(vScroll);
	HideContsumacc/mac/grow.rc   444      0     12        3021  3470501406   7340 * input for resource compiler
*

grow.rsrc

Type CCOM = STR
  ,0
Grow Version 1.0 -- April 26, 1984

Type MENU
  ,256
  File
    Quit

Type MENU
  ,257
  Edit
    (Undo
    (-
    Cut/X
    Copy/C
    Paste/Z

Type WIND
  ,256
  grow in C
  50 40 300 450
  Visible GoAway
  0
  0

Type CNTL
  ,256
  vertical scroll bar
  -1 395 236 411
  Visible
  16
  0
  0 0 50

Type CNTL
  ,257
  horizontal scroll bar
  235 -1 251 396
  Visible
  16
  0
  0 0 50

Type CURS = HEXA
  ,256
  38383C780280010001000100010001000100010001000100010002803C783838
  38383C780280010001000100010001000100010001000100010002803C783838
  0008 0008

Type ICN# = HEXA
  ,128(32)
* little picture of the C
00000e00 00001000 00001000 00001000 00000e00 00e00000 1fbe001e f003f0e0
80001f80 00000000 00000000 00008000 0300803e 3cf0c3c0 c01ce000 0000f000
0000f800 00008000 0003fc00 0001f800 3fc0000e e0780078 000fffc0 00000000
00000000 00000000 1fc0007e 303c03c0 e007fe00 00000000 00000000 00000000
* mask
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff

Type FREF = HEXA
  ,128(32)
* APPL uses loc icon 0, no tagalongs
4150504c
0000
00

Type BNDL = HEXA
  ,128(32)
* owner CCOM 0
43434F4D0000
* 2 types
0001
* ICN#, 1 entry, loc 0 to glob 128
49434e230000
0000 0080
* FREF, 1 entry, loc 0 to glob 128
465245460000
0000 0080

Type CODE
  b.out,0
rce compiler
*

grow.rsrc

Type CCOM = STR
  ,0
Grow Version 1.0 -- April 26, 1984

Type MENU
  ,256
  File
    Quit

Type MENU
  ,257
  Edit
    (Undo
    (-
    Cut/X
    Copy/C
    Paste/Z

Type WIND
  ,256
  grow in C
  50 40 300 450
  Visible GoAway
  0
  0

Type CNTL
  ,256
  vertical scroll bar
  -1 395 236 411
  Visible
  16
  0
  0 0 50

Type CNTL
  ,257
  horizontal scroll bar
  235 -1 251 396
  Visible
  16
  0
  0 0 50

Type CURS = HEXA
  ,256
  38383C780280010001000100010001000sumacc/mac/macscrawl.c   444      0     12        4617  3470501406  10170 #include "mac/quickdraw.h"
#include "mac/osintf.h"
#include "mac/toolintf.h"

int	pensz	= 	5;
GrafPort *myPort;
int	wasevent,i,mouse;
Point	p,pold;
EventRecord er;
CursHandle plusH;
int	mode;		/* not an example of mode-less programming! */
#define	NORMAL	0
#define	MAGNIFY	1
#define	ASCII	2

main()
{
	struct QDVar QDVar;
	GrafPort gp;

	QD = &QDVar;
	InitGraf(&thePort);
	InitCursor();
	InitFonts();
	myPort = &gp;
	OpenPort(myPort);
	PenSize(pensz,pensz);
	MoveTo(256,256);
	samptext();
	plusH = GetCursor(3);
	for (;;) {
		SystemTask();
		wasevent = GetNextEvent(everyEvent, &er);
		switch (mode) {
		case NORMAL:
			normal();
			break;
		case MAGNIFY:
			magnify();
			break;
		case ASCII:
			ascii();
			break;
		}
	}
}

checkevent()		/* look for normal events */
{
	if (!wasevent)
		return;
	switch (er.what) {
	case keyDown:
	case autoKey:
		switch (er.message & 0xff) {
		case 'q':
			ExitToShell();

		case 'f': pensz += 1;  goto setpen;
		case 't': pensz -= 1;  goto setpen;
		case 'F': pensz += 16;  goto setpen;
		case 'T': pensz -= 16;  goto setpen;

		setpen:
			PenSize(pensz,pensz);
			break;

		case 'b':
			PenPat(&QD->black);
			break;

		case 'w':
			PenPat(&QD->white);
			break;

		case 'g':
			PenPat(&QD->gray);
			break;

		case 'm':
			mode = MAGNIFY;
			SetCursor(*plusH);
			break;

		case 'a':
			mode = ASCII;
			TextSize(pensz<12 ? 0 : pensz);
			break;

		case '\r':
			mode = NORMAL;
			SetCursor(&QD->arrow);
			break;
		}
		break;

	case mouseDown:
		mouse = 1;
		break;

	case mouseUp:
		mouse = 0;
		break;
	}
}

normal()
{
	checkevent();
	GetMouse(&p);
	if (EqualPt(&p, &pold))
		return;
	pold = p;
	if (mouse)
		LineTo(p.h,p.v);
	else
		MoveTo(p.h,p.v);
}

magnify()	
{
	Rect sr,dr;

	checkevent();
	GetMouse(&p);
	if (wasevent == 0 && EqualPt(&p, &pold))
		return;
	pold = p;
	SetRect(&dr, 0, 0, 128, 128);
	if (pensz <= 0)
		pensz = 1;
	SetRect(&sr, p.h, p.v, p.h + pensz, p.v + pensz);
	CopyBits(&myPort->portBits, &myPort->portBits,
		&sr, &dr, srcCopy, (RgnHandle)0);
}

ascii()
{
	int key;

	if (wasevent == 0 || er.what != keyDown)
		return;
	key = (er.message&0xff);
	if (key == '\r') {
		mode = NORMAL;
		return;
	}
	DrawChar(key);
}

samptext()	/* tests auto string conversion */
{
	char fontname[32];
	char numstring[32];
	int fontnum;

	GetFontName(0,fontname);
	GetFNum(fontname,&fontnum);
	DrawString("font: ");
	DrawString(fontname);
	NumToString(fontnum,numstring);
	DrawString(numstring);
}
r whichWindow;
{
	int	longResult;
	int	height,width;


	longResult = GrowWindow(whichWindow, &myEvent.where, &grosumacc/mac/macscrawl.rc   444      0     12        2020  3470501406  10334 * input for resource compiler
*

macscrawl.rsrc

Type CCOM = STR
  ,0
Macscrawl Version 1.0 -- April 26, 1984

Type ICN# = HEXA
  ,128(32)
* little picture of the C
00000e00 00001000 00001000 00001000 00000e00 00e00000 1fbe001e f003f0e0
80001f80 00000000 00000000 00008000 0300803e 3cf0c3c0 c01ce000 0000f000
0000f800 00008000 0003fc00 0001f800 3fc0000e e0780078 000fffc0 00000000
00000000 00000000 1fc0007e 303c03c0 e007fe00 00000000 00000000 00000000
* mask
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff

Type FREF = HEXA
  ,128(32)
* APPL uses loc icon 0, no tagalongs
4150504c
0000
00

Type BNDL = HEXA
  ,128(32)
* owner CCOM 0
43434F4D0000
* 2 types
0001
* ICN#, 1 entry, loc 0 to glob 128
49434e230000
0000 0080
* FREF, 1 entry, loc 0 to glob 128
465245460000
0000 0080

Type CODE
  b.out,0
z -= 16;  goto setpen;

		setpen:
			PenSize(pensz,pensz);
			break;

		case 'b':
			PenPat(&QD->black);
			break;

		case 'w':
			PenPat(&QD->white);
			break;

		case 'g':
			PenPat(&QD->gray);
			break;

		case 'm':
			mode = MAGNIFY;
			SetCursor(*plusH);
			break;

		case 'a':
			mode = ASCII;
			TextSize(pensz<12 ? 0 : pensz);
			break;

		case '\r':
			mode = NORMAL;
			SetCursor(&QD->arrow);
			break;
		}
		break;

	case mouseDown:
		mouse = 1;
		break;

	case mouseUp:
		mouse = 0;
	sumacc/mac/insane.c   444      0     12        4223  3470501407   7463 /*
 * Test the (in)sane functions.  Probably the reason things are
 * so slow is that Sane does all calculations in Extended
 * (80 bit) IEEE floating point.
 * Rough timings of the inner loop below show about 5 milliseconds
 * per Sane operation.  This is a bit high since a sin and cos
 * are included;  the manual gives a figure of about 1 ms per multiply.
 *
 * For most applications that don't need 80 bits of precision, you
 * might be better off with the 32 bit Fixed-Point arithmetic discussed
 * in the "Toolbox Utilities" section (FixMul,FixRatio,FixRound).
 *
 *	--bc
 */

#include "mac/quickdraw.h"
#include "mac/toolintf.h"
#include "mac/sane.h"

int	pensz	= 	4;
GrafPort *myPort;

int	rI = 170;
Extended r,x0,y0,rinc;
int	ciradsI = 314159 * 2;
int	ciradscaleI = 100000;
Extended cirads,ciradscale;
int	segsI = 40;
int	zeroI = 0;
Extended theta,thetainc,thetaconv,zero,segs;
int	color;
DecForm	dform;
char	dstr[DECSTRLEN];


main()
{
	struct QDVar QDVar;
	GrafPort gp;
	int i;
	Rect txrect;

	QD = &QDVar;
	InitGraf(&thePort);
	InitCursor();
	myPort = &gp;
	OpenPort(myPort);
	PenSize(pensz,pensz);
	MoveTo(rI+rI,rI);

	dform.style = FixedDecimal;  dform.digits = 10;
	SetRect(&txrect,300,300,440,320);
	L2X(&rI,&r);
	L2X(&pensz,&rinc);
	x0 = r;  y0 = r;
	L2X(&ciradsI,&cirads);
	L2X(&ciradscaleI,&ciradscale);
	DivX(&ciradscale,&cirads);
	L2X(&segsI,&segs);
	L2X(&zeroI,&zero);
	thetainc = cirads;
	DivX(&segs,&thetainc);
	theta = zero;

	for ( ; rI > 6 ; rI -= pensz) {
		L2X(&rI,&r);
		if (color)
			PenPat(&QD->white);
		else
			PenPat(&QD->black);
		color = !color;
		for (i = 0 ; i <= segsI ; i++) {
			Extended x,y;
			int xi,yi;

			x = theta;
			CosX(&x);
			MulX(&r,&x);
			y = theta;
			SinX(&y);
			MulX(&r,&y);
			AddX(&x0,&x);
			AddX(&y0,&y);
			X2L(&x,&xi);
			X2L(&y,&yi);
			LineTo(xi,yi);
			/* show current theta */
			EraseRect(&txrect);
			MoveTo(txrect.left+2,txrect.bottom-2);
			if (Button()) {		/* double convert it */
				X2Str(&dform,&theta,dstr);
				theta = zero;	/* ensure it's really working */
				Str2X(dstr,&theta);
			}
			X2Str(&dform,&theta,dstr);
			DrawString(dstr);
			MoveTo(xi,yi);

			AddX(&thetainc,&theta);
		}
	}
	while (!Button());
}
ing point.
 * Rough timings of the inner loop below show about 5 milliseconds
 * per Sane operation.  This is a bit high since a sin and cos
 * are included;  the manual gives a figure of about 1 ms per multiply.
 *
 * For most applications that don't need 80 bits of precision, you
 * might be better off with the 32 bit Fixed-Point arithmetic discussed
 * in the sumacc/mac/insane.rc   444      0     12        2012  3470501407   7637 * input for resource compiler
*

insane.rsrc

Type CCOM = STR
  ,0
Insane Version 1.0 -- April 26, 1984

Type ICN# = HEXA
  ,128(32)
* little picture of the C
00000e00 00001000 00001000 00001000 00000e00 00e00000 1fbe001e f003f0e0
80001f80 00000000 00000000 00008000 0300803e 3cf0c3c0 c01ce000 0000f000
0000f800 00008000 0003fc00 0001f800 3fc0000e e0780078 000fffc0 00000000
00000000 00000000 1fc0007e 303c03c0 e007fe00 00000000 00000000 00000000
* mask
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff

Type FREF = HEXA
  ,128(32)
* APPL uses loc icon 0, no tagalongs
4150504c
0000
00

Type BNDL = HEXA
  ,128(32)
* owner CCOM 0
43434F4D0000
* 2 types
0001
* ICN#, 1 entry, loc 0 to glob 128
49434e230000
0000 0080
* FREF, 1 entry, loc 0 to glob 128
465245460000
0000 0080

Type CODE
  b.out,0
ort);
	InitCursor();
	myPort = &gp;
	OpenPort(myPort);
	PenSize(pensz,pensz);
	MoveTo(rI+rI,rI);

	dform.style = FixedDecimal;  dform.digits = 10;
	SetRect(&txrect,300,300,440,320);
	L2X(&rI,&r);
	L2X(&pensz,&rinc);
	x0 = r;  y0 = r;
	L2X(&ciradsI,&cirads);
	L2X(&ciradscaleI,&ciradscale);
	DivX(&ciradscale,&cirads);
	L2X(&segsI,&segs);
	L2X(&zeroI,&zero);
	thetainc = cirads;
	DivX(&segs,&thetainc);
	theta = zero;

	for ( ; rI > 6 ; rI -= pensz) {
		L2X(&rI,&r);
		if (color)
			PenPat(&QD->white);
sumacc/mac/boot.c   444      0     12        3771  3470501407   7160 /*
 * Boot - Reboot the Mac.  Put up a Modal dialog box, ask for confirmation,
 * flush and eject the mounted volumes (won't eject newly inserted disks)
 * reset the machine, and jump to the ROM boot address.  Best as a startup
 * application, don't you think?
 *
 * Bill Schilit, November 7, 1984.
 *
 */

#include "mac/quickdraw.h"
#include "mac/osintf.h"
#include "mac/toolintf.h"

#define NIL 0
#define NILPROC (ProcPtr) NIL
#define NILPTR (Ptr) NIL
#define FALSE 0
#define TRUE 1

struct QDVar QDVar;

/*
 * ejectdisk - given a drive number, flush the volume and eject.
 *
 */

ejectdisk(dn)
int dn;
{
 char volname[255];
 VolumeParam vparam;
 int err;

 vparam.ioNamePtr = volname;		/* return name here */
 vparam.ioVolIndex = 0;			/* no volume index */
 vparam.ioVRefNum = dn;			/* our drive number */
 err = PBGetVInfo(&vparam,FALSE);	/* do it synchronously */
 if (err != noErr)			/* some error? */
  return;				/* probably nothing there... */
 err = Eject(NILPTR,vparam.ioVRefNum);	/* otherwise eject the disk... */
}

/*
 * reboot - use this newly learned feature of C which allows inline
 * assembler code.  Do a hardware reset (seems to prevent oddness
 * later on) and then jump to the reboot address.
 *
 */

Reboot()
{
 ejectdisk(2);				/* and disk 2 */    
 ejectdisk(1);				/* and disk 1 */  
 asm("	reset");			/* reset the machine */
 asm("	jmp /40000A");			/* boot address */
}

main()
{
 DialogPtr theDialog;
 int itemHit;

 QD = &QDVar;				/* setup all... */
 InitGraf(&thePort);
 InitWindows();
 InitFonts();
 InitDialogs(NILPROC);
 TEInit();

 theDialog = GetNewDialog(257,NILPTR,(Ptr) -1);	/* from rsrc file */
 ShowWindow(theDialog);			/* here is the dialog box */
 InitCursor();				/* show our cursor */
 
 do					/* do modal dialog */
 {
  ModalDialog(NILPROC,&itemHit);	/* for each event, no filter */
  if (itemHit == OK)			/* hit the OK to boot button? */
   Reboot();				/* yes, then do it... */
 } while (itemHit != Cancel);		/* else, exit if Cancel hit */
 ExitToShell();				/* ... back to the Finder */
}

sk... *sumacc/mac/grow.p   444      0     12       22274  3470501410   7221 PROGRAM Grow;

{ Grow -- Scroll bars and a resizable window added to Edit }
{         by Cary Clark, Macintosh Technical Support       }

USES  {$U Obj:QuickDraw   } QuickDraw,
      {$U Obj:OSIntf      } OSIntf,
      {$U Obj:ToolIntf     } ToolIntf;

CONST lastMenu = 3;      { number of menus }
      appleMenu = 1;     { menu ID for desk accessory menu }
      fileMenu = 256;    { menu ID for File menu }
      editMenu = 257;    { menu ID for Edit menu }

VAR myMenus:  ARRAY [1..lastMenu] OF MenuHandle;
    growRect, dragRect, pRect, tRect:  Rect;
    doneFlag, temp:  BOOLEAN;
    myEvent:  EventRecord;
    code, refNum, MyControl, t:  INTEGER;
    wRecord:  WindowRecord;
    theWindow, whichWindow:  WindowPtr;
    theMenu, theItem:  INTEGER;
    theChar:  CHAR;
    ticks:  LongInt;
    hTE:  TEHandle;
    hCurs:  CursHandle;
    iBeam:  Cursor;
    hScroll, vScroll, whichControl :  ControlHandle;
    TheOrigin : point;

PROCEDURE SetUpMenus;
{ Once-only initialization for menus }
VAR i:  INTEGER;
    appleTitle:  STRING[1];
BEGIN
  InitMenus;   { initialize Menu Manager }
  appleTitle := ' '; appleTitle[1] := CHR(20);
  myMenus[1] := NewMenu(appleMenu,appleTitle);
  AddResMenu(myMenus[1],'DRVR');    { desk accessories }
  myMenus[2] := GetMenu(fileMenu);
  myMenus[3] := GetMenu(editMenu);
  FOR i:=1 TO lastMenu DO InsertMenu(myMenus[i],0);
  DrawMenuBar;
END;    { of SetUpMenus }

PROCEDURE CursorAdjust;
{ Makes cursor be I-beam inside the (active) application window's }
{ content region (except for size box and scroll bar areas). }
VAR mousePt:  Point;
BEGIN
  GetMouse(mousePt);
  IF theWindow = FrontWindow
    THEN
      BEGIN
        IF (PtInRect(mousePt,pRect))
          THEN SetCursor(iBeam)
          ELSE SetCursor(arrow);
      END;
END;

PROCEDURE DoCommand (mResult: LongInt);
VAR name:  STR255;
BEGIN
  theMenu := HiWord(mResult); theItem := LoWord(mResult);
  CASE theMenu OF

  appleMenu:
    BEGIN
      GetItem(myMenus[1],theItem,name);
      refNum := OpenDeskAcc(name);
    END;

  fileMenu:
    doneFlag := TRUE;    { Quit }

  editMenu:
    BEGIN
      IF NOT SystemEdit(theItem-1)
        THEN
          BEGIN
            SetPort(theWindow);
            ClipRect(pRect);

            { Delay so menu title will stay lit a little while if Command key }
            { equivalent was typed. }
            ticks := TickCount + 30;
            REPEAT UNTIL ticks <= TickCount;

            CASE theItem OF

            1:  TECut(hTE);

            2:  TECopy(hTE);

            3:  TEPaste(hTE);

            END;    { of item case }
          END;
    END;    { of editMenu }

  END;    { of menu case }
  HiliteMenu(0);

END;  { of DoCommand }

PROCEDURE MoveScrollBars;
BEGIN
  WITH theWindow^.portRect DO
     BEGIN
       HideControl(vScroll);
       MoveControl(vScroll,right-15,top-1);
       SizeControl(vScroll,16,bottom-top-13);
       ShowControl(vScroll);
       HideControl(hScroll);
       MoveControl(hScroll,left-1,bottom-15);
       SizeControl(hScroll,right-left-13,16);
       ShowControl(hScroll)
     END
END;

PROCEDURE ResizePRect;
BEGIN
  pRect := thePort^.portRect;
  pRect.left := pRect.left+4; pRect.right := pRect.right-15;
  pRect.bottom := pRect.bottom-15
END;

PROCEDURE GrowWnd (whichWindow: WindowPtr);
{ Handles growing and sizing the window and manipulating }
{ the update region. }
VAR longResult:  LongInt;
    height, width:  INTEGER;
    trect : rect;
BEGIN
  longResult := GrowWindow(whichWindow,myEvent.where,growRect);
  IF longResult = 0 THEN EXIT(GrowWnd);
  height := HiWord(longResult); width := LoWord(longResult);

  { Add the old "scroll bar area" to the update region so it will }
  { be redrawn (for when the window is enlarged). }
  tRect := whichWindow^.portRect; tRect.left := tRect.right-16;
  InvalRect(tRect);
  tRect := whichWindow^.portRect; tRect.top := tRect.bottom-16;
  InvalRect(tRect);

  { Now draw the newly sized window. }
  SizeWindow(whichWindow,width,height,TRUE);
  MoveScrollBars;
  ResizePRect;

  { Adjust the view rectangle for TextEdit. }
  hTE^^.viewRect := pRect;

  { Add the new "scroll bar area" to the update region so it will }
  { be redrawn (for when the window is made smaller). }
  tRect := whichWindow^.portRect; tRect.left := tRect.right-16;
  InvalRect(tRect);
  tRect := whichWindow^.portRect; tRect.top := tRect.bottom-16;
  InvalRect(tRect);
END;     { of GrowWnd }

PROCEDURE DrawWindow (whichWindow: WindowPtr);
{ Draws the content region of the given window, after erasing whatever }
{ was there before. }
VAR i:  INTEGER;
BEGIN
  ClipRect(whichWindow^.portRect);
  EraseRect(whichWindow^.portRect);
  DrawGrowIcon(whichWindow);
  DrawControls (whichWindow);
  TEUpdate(pRect,hTE)
END;    { of DrawWindow }

PROCEDURE ScrollBits;
VAR oldOrigin: Point;
    dh, dv : INTEGER;
BEGIN
  WITH TheWindow^ DO
    BEGIN
      oldOrigin := theOrigin;
      theOrigin.h := 4*GetCtlValue(hScroll);
      theOrigin.v := 4*GetCtlValue(vScroll);
      dh := oldOrigin.h - theOrigin.h;
      dv := oldOrigin.v - theOrigin.v;
      TEScroll (dh, dv, hTE)
    END
END;

PROCEDURE ScrollUp(whichControl:ControlHandle; theCode: INTEGER);
BEGIN
  IF theCode = inUpButton THEN
     BEGIN
       SetCtlValue(whichControl,GetCtlValue(whichControl)-1);
       ScrollBits
     END
END;

PROCEDURE ScrollDown(whichControl:ControlHandle; theCode: INTEGER);
BEGIN
  IF theCode = inDownButton THEN
     BEGIN
       SetCtlValue(whichControl,GetCtlValue(whichControl)+1);
       ScrollBits
     END
END;

PROCEDURE PageScroll(code, amount: INTEGER);
VAR myPt: Point;
BEGIN
  REPEAT
    GetMouse(myPt);
    IF TestControl(whichControl,myPt) = code THEN
       BEGIN
         SetCtlValue(whichControl,getCtlValue(whichControl)+amount);
         ScrollBits
       END
  UNTIL NOT StillDown;
END;

BEGIN    { main program }
  InitGraf(@thePort);
  InitFonts;
  FlushEvents(everyEvent,0);
  InitWindows;
  SetUpMenus;
  TEInit;
  InitDialogs(NIL);
  SetCursor(arrow);
  SetRect(dragRect,4,24,508,338);
  SetRect(growRect,100,60,512,302);
  doneFlag := FALSE;

  theWindow := GetNewWindow(256,@wRecord,POINTER(-1));
  SetPort(theWindow);
  theWindow^.txFont := 2;

  ResizePrect;
  hTE := TENew(pRect,pRect);
  hCurs := POINTER(ORD(GetCursor(256))); iBeam := hCurs^^;

  vScroll :=   GetNewControl(256,TheWindow);
  hScroll :=   GetNewControl(257,TheWindow);
  theOrigin.h := 0; theOrigin.v := 0;

  REPEAT
    CursorAdjust;
    SystemTask;
    TEIdle(hTE);
    temp := GetNextEvent(everyEvent,myEvent);
    CASE myEvent.what OF

    mouseDown:
      BEGIN
        code := FindWindow(myEvent.where,whichWindow);
        CASE code OF

        inMenuBar:
          DoCommand(MenuSelect(myEvent.where));

        inSysWindow:
          SystemClick(myEvent,whichWindow);

        inDrag:
          DragWindow(whichWindow,myEvent.where,dragRect);

        inGoAway:
          IF TrackGoAway(whichWindow,myEvent.where)
            THEN doneFlag := TRUE;

        inGrow:
          IF whichWindow = FrontWindow
            THEN GrowWnd(whichWindow)
            ELSE SelectWindow(whichWindow);

        inContent:
        BEGIN
          IF whichWindow <> FrontWindow
          THEN SelectWindow(whichWindow)
          ELSE
          BEGIN {front}
            GlobalToLocal(myEvent.where);
            IF PtInRect (myEvent.where, PRect)
            THEN IF BitAnd(myEvent.modifiers,512) <> 0   { Shift key pressed }
              THEN TEClick(myEvent.where,TRUE,hTE)
              ELSE TEClick(myEvent.where,FALSE,hTE)
            ELSE
            BEGIN  {controls}
              MyControl := FindControl(myEvent.where,whichWindow,whichControl);
              Case MyControl of
                inUpButton:   t :=
                            TrackControl(whichControl,myEvent.where,@scrollUp);
                inDownButton: t :=
                           TrackControl(whichControl,myEvent.where,@scrollDown);
                inPageUP:     PageScroll(MyControl,-10);
                inPageDown:   PageScroll(MyControl,10);
                inThumb:      BEGIN
                                t :=
                                TrackControl(whichControl,myEvent.where,NIL);
                                ScrollBits
                              END
              END {Case MyControl}
            END {controls}
          END {front}
        END {in Content}
      END     { of code case }
    END;    { of mouseDown }

    keyDown, autoKey:
      BEGIN
        IF theWindow = FrontWindow
          THEN
            BEGIN
              theChar := CHR(myEvent.message MOD 256);
              IF BitAnd(myEvent.modifiers,256) <> 0    { Command key pressed }
                THEN DoCommand(MenuKey(theChar))
                ELSE TEKey(theChar,hTE)
            END
      END;    { of keyDown }

    activateEvt:
      BEGIN
        DrawGrowIcon(theWindow);
        IF ODD (myEvent.modifiers) THEN   { window is becoming active }
        BEGIN
          TEActivate(hTE);
          ShowControl (vScroll);
          ShowControl (hScroll)
        END ELSE
        BEGIN
          TEDeactivate(hTE);
          HideControl (vScroll);
          HideControl (hScroll)
        END
      END;    { of activateEvt }

    updateEvt:
      BEGIN
        BeginUpdate(theWindow);
        DrawWindow(theWindow);
        EndUpdate(theWindow)
      END    { of updateEvt }

    END    { of event case }

  UNTIL doneFlag
END.

CEDURE ScrollDown(whichControl:ControlHandle; theCode: INTEGER);
BEGIN
  IF theCode = inDownButton THEN
     BEGIN
       SetCtlValue(whichControl,GetCtlValue(whichControl)+1);
       ScrollBits
     END
END;

PROCEDURE PageScroll(code, amount: INTEGER);
VAR myPt: Point;
BEGIN
  REPEAT
    GetMouse(myPt);
    IF TestControsumacc/mac/alert.c   444      0     12        2476  3470501410   7317 /*	alert.c		1.0	06/18/84	*/

/*
 * Test alert and dialog boxes.
 */

/*
 * history
 * 06/18/84	Schilit	Created.
 * 07/05/84	Croft	Added DLOG test.
 */

#include "mac/quickdraw.h"
#include "mac/osintf.h"
#include "mac/toolintf.h"
#include "mac/packintf.h"

#define NIL 0

main()
{
	struct QDVar newqd;
	int times;
	char tstr[20];			/* big enough for any number */
	DialogPtr dp;
	int item;
	
	QD = &newqd;
	InitGraf(&thePort);
	InitFonts();
	InitWindows();
	InitMenus();
	TEInit();
	InitDialogs((ProcPtr)NIL);
	SetCursor(&newqd.arrow);
	
	times = 1;
	while (CautionAlert(257,(ProcPtr)NIL) == OK) { /* do alert dialog */	
		times++;			/* Increment number of times */
		NumToString(times,tstr);	/* make it into a string */
					/* and setup ^0..^3 */
		if (times > 4)		/* according to times here */
			ParamText("For crying out loud, that's ",tstr,
		    	      " times, give me a break! ","");
		else	      
			ParamText("You've been here ",tstr," times. ","");
        }

	dp = GetNewDialog(7, (Ptr)0, (WindowPtr)-1);
	do {
		Rect box;
		Handle itemH;
		int itemtype;

		ModalDialog((ProcPtr)NIL, &item);
		GetDItem(dp, item, &itemtype, &itemH, &box);
		switch (itemtype) {
		case ctrlItem+chkCtrl:
		case ctrlItem+radCtrl:
			SetCtlValue(itemH, GetCtlValue(itemH) ? 0 : 1);
		}
	} while (item != Cancel);
	DisposDialog(dp);
	ExitToShell();
}
EClick(myEvent.where,FALSE,hTE)
            ELSE
            BEGIN  {controls}
              MyControl := FindControl(myEvent.where,whichWindow,whichControl);
              Case MyControl of
   sumacc/mac/mfinder.rc   444      0     12        2014  3470501410  10002 * input for resource compiler
*

mfinder.rsrc

Type CCOM = STR
  ,0
Mfinder Version 1.0 -- April 26, 1984

Type ICN# = HEXA
  ,128(32)
* little picture of the C
00000e00 00001000 00001000 00001000 00000e00 00e00000 1fbe001e f003f0e0
80001f80 00000000 00000000 00008000 0300803e 3cf0c3c0 c01ce000 0000f000
0000f800 00008000 0003fc00 0001f800 3fc0000e e0780078 000fffc0 00000000
00000000 00000000 1fc0007e 303c03c0 e007fe00 00000000 00000000 00000000
* mask
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff

Type FREF = HEXA
  ,128(32)
* APPL uses loc icon 0, no tagalongs
4150504c
0000
00

Type BNDL = HEXA
  ,128(32)
* owner CCOM 0
43434F4D0000
* 2 types
0001
* ICN#, 1 entry, loc 0 to glob 128
49434e230000
0000 0080
* FREF, 1 entry, loc 0 to glob 128
465245460000
0000 0080

Type CODE
  b.out,0
 inUpButton:   t :=
                            TrackControl(whichControl,myEvent.where,@scrollUp);
                inDownButton: t :=
                           TrackControl(whichControl,myEvent.where,@scrollDown);
                inPageUP:     PageScroll(MyControl,-10);
                inPageDown:   PageScroll(MyControl,10);
                inThumb:      BEGIN
                                t :=
                                TrackControl(whichControl,myEvent.where,NIL);
                    sumacc/mac/alert.rc   444      0     12        3321  3470501410   7467 *
* Input for resource compiler to create "Alert Test Program"
*
* history
* 06/18/84	Schilit	Created.
* 07/05/84	Croft	Added DLOG test.
*

* output file is:
alert.rsrc

Type CCOM = STR
  ,0
Alert Test Program Version 1.0 -- June 15, 1984

* An "alert" box defined here by the resource id = (ALRT,257) the
* coordinates for the rectangle, the dialog item list ID (DITL,258) 
* and the "stages word."  See the Dialog Manager section of inside
* mac.  Here our stages word (5555) says use sound 1 (beep), draw
* the box, and item #1 in the DITL is the default, so outline it.

Type ALRT
  ,257
  60 81 180 431
  258
  5555

* A sample dialog box with all possible types.

Type DLOG
  ,7
  40 40 300 340
  Visible 1 NoGoAway 0
  8
  Title?

* DITL for the ALRT
* First the ID (DITL,258), then the number of items which follow.  
* For each item include the control bits
* and the coordinates of the box.  Some items take text as the third 
* argument, some take a resource ID.

Type DITL
 ,258
  3
* These buttons are 20 hi by 70 wide
    BtnItem Enabled
    90 13 110 83
OK

    BtnItem Enabled
    90 267 110 337
Cancel

    StatText Disabled
    10 60 70 350
^0^1^2Are you sure you want to proceed with this program?

* DITL for the DLOG

Type DITL
  ,8
  9
* These buttons are 20 hi by 70 wide
  BtnItem
  20 20 40 90
  OK

  BtnItem
  60 20 80 90
  Cancel

  IconItem Disabled
  20 180 60 220
  -6047

  PicItem
  100 180 160 240
  -15805

* chk/rad ctrls are 20 hi by any width
  CtrlItem ChkCtrl
  120 20 140 160
  Check this

  CtrlItem RadCtrl
  160 20 180 160
  Tune in

* text items are 15 hi by any width
  EditText
  220 20 235 80
  edit

  EditText
  220 100 235 160
  these

  EditText
  220 180 235 240
  words

Type CODE
  b.out,0
here,@scrollDown);
                inPageUP:     PageScroll(MyControl,-10);
                inPageDown:   PageScroll(MyControl,10);
                inThumb:      BEGIN
                                t :=
                                TrackControl(whichControl,myEvent.where,NIL);
                    sumacc/mac/boot.rc   444      0     12        1334  3470501420   7326 *
* resource file for boot program
*

boot.rsrc

* ID string
Type BOOT = STR
 ,0
Boot Program Version 1.0 -- November 7, 1984

Type DLOG
 ,257
 100 100 175 230
 Invisible 1 NoGoAway 0
 258

Type DITL
 ,258
 4
 BtnItem Enabled
 50 10 70 60
OK

 BtnItem Enabled
 50 70 70 120
NO

 StatText Disabled
 15 52 35 120
Reboot?

 IconItem Disabled
 10 10 42 42
 259

*
* Bill and Chuck's Sad Mac Icon, ID 259
*
Type ICON
 ,259
57ffffea a8000015 5000000a b1ffff8d
5200004a b200004d 5214284a b208104d
5214284a b200004d 5202404a b201804d 
5200004a b207c04d 5208304a b200084d 
5200004a b1ffff8d 5000000a b000000d
5000000a b000000d 53003f8a b000000d
5000000a b000000d 5000000a bffffffd
5800001a a8000015 5800001a affffff5

Type CODE
     b.out,0
DITL
  ,8
  9
* These buttons are 20 hi by 70 wide
  BtnItem
  20 20 40 90
  OK

  BtnItem
  60 20 80 90
  Cancel

  IconItem Disabled
  20 180 60 220
  -6047

  PicItem
  100 180 160 240
  -15805

* chk/rad ctrls are 20 hi by any width
  CtrlItem ChkCtrl
  120 20 140 160
  Check this

  Ctrsumacc/mac/mfinder.c   444      0     12        2666  3470501422   7640 /*	mfinder.c	1.0	07/08/84	*/

/*
 * Mini Finder.
 */

/*
 * history
 * 07/08/84	Croft	Created.
 * 11/01/84	Croft	now can be used as 'startup' appl; allow
 *			launch from other drive.
 */

#include "mac/quickdraw.h"
#include "mac/osintf.h"
#include "mac/toolintf.h"
#include "mac/packintf.h"

#define NIL 0
#define	FINDERNAME 0x2e0

short	where[] = { 40, 40 };
char	types[] = "APPL";
char	myname[] = "mFinder";

struct launchparams {
	char	*lnamep;
	long	lunknown;
	short	lsound;
} lparams;

SFReply sfr;

main()
{
	struct QDVar newqd;
	char *old,*new;
	
	QD = &newqd;
	InitGraf(&thePort);
	InitFonts();
	InitWindows();
	InitMenus();
	TEInit();
	InitDialogs(main);
	SetCursor(&newqd.arrow);

	/* install myself as new finder */
	strcpy(FINDERNAME, myname);
	c2pstr(FINDERNAME);
	SFGetFile((Point *)where, "",(ProcPtr)NIL, 1,types, (ProcPtr)NIL, &sfr);
	if (sfr.good)
		Launch(sfr.fName);

	/* If cancel was selected, deinstall myself and exit to real Finder. */
	strcpy(FINDERNAME, "Finder");
	c2pstr(FINDERNAME);
}


Launch(name)
	char *name;
{
	lparams.lnamep = name;
	SetVol((char *)0, sfr.vRefNum);
	asm("lea lparams,a0");
	asm(".word 0xa9f2");
	ExitToShell();	/* if Launch failed */
}

/* avoid loading entire package library */

asm(".globl _sfgetfil");
asm("_sfgetfil:");
asm("moveq #2,d2");
asm("movl sp@+,a0 |get user's rts");
asm("movw d2,sp@- |the routine selector");
asm("movl a0,sp@- |push the rts back on");
asm(".word 0xadea |__pack3 w/autopop");
20 hi by any width
  CtrlItem ChkCtrl
  120 20 140 160
  Check this

  Ctrsumacc/mac/testprint.c   444      0     12        1715  3470501426  10246 /*
 * test print stuff
 */

#include "quickdraw.h"
#include "osintf.h"
#include "toolintf.h"
#include "macprint.h"

#define NIL 0

main()
   {
   struct QDVar theQD;
   THPrint hPrint;
   TPPrPort pPort;
   TPrStatus status;
   GrafPtr port;

   QD = &theQD;
   InitGraf(&thePort);
   InitFonts();
   InitWindows();
   TEInit();
   InitDialogs((ProcPtr) NIL);
   SetCursor(&theQD.arrow);

   PrOpen();

   hPrint = (THPrint) NewHandle(sizeof(TPrint));

   if (PrStlDialog(hPrint) && PrJobDialog(hPrint))
      {
      GetPort(&port);
      pPort = PrOpenDoc(hPrint, (TPPrPort) NIL, (Ptr) NIL);
      SetPort((GrafPtr) pPort);
      PrOpenPage(pPort, (Rect *) NIL);
      TextBox("some text", 9, &(*hPrint)->PrInfo.rPage, 0);
      PrClosePage(pPort);
      PrCloseDoc(pPort);

      if ((*hPrint)->PrJob.bJDocLoop == bSpoolLoop)
         PrPicFile(hPrint, (TPPrPort) NIL, (Ptr) NIL, (Ptr) NIL, &status);

      SetPort(port);
      }

   PrClose();

   ExitToShell();
   }
rlItem ChkCtrl
  120 20 140 160
  Check this

  Ctrsumacc/mac/testprint.rc   444      0     12        2014  3470501426  10421 * input for resource compiler
*

testprint.rsrc

Type CCOM = STR
  ,0
tPrint Version 1.0 -- June 28, 1984

Type ICN# = HEXA
  ,128(32)
* little picture of the C
00000e00 00001000 00001000 00001000 00000e00 00e00000 1fbe001e f003f0e0
80001f80 00000000 00000000 00008000 0300803e 3cf0c3c0 c01ce000 0000f000
0000f800 00008000 0003fc00 0001f800 3fc0000e e0780078 000fffc0 00000000
00000000 00000000 1fc0007e 303c03c0 e007fe00 00000000 00000000 00000000
* mask
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff

Type FREF = HEXA
  ,128(32)
* APPL uses loc icon 0, no tagalongs
4150504c
0000
00

Type BNDL = HEXA
  ,128(32)
* owner CCOM 0
43434F4D0000
* 2 types
0001
* ICN#, 1 entry, loc 0 to glob 128
49434e230000
0000 0080
* FREF, 1 entry, loc 0 to glob 128
465245460000
0000 0080

Type CODE
  b.out,0
resource compiler
*

testprint.rsrc

Type CCOM = STR
  ,0
tPrint Version 1.0 -- June 28, 1984

Type ICN# = HEXA
  ,128(32)
* little picture of the C
00000e00 00001000 00001000 00001000 00000e00 00e00000 1fbe001e f003f0e0
80001f80 00000000 00000000 00008000 0300803e 3cf0c3c0 c01ce000 0000f000
0000f800 00008000 0003fc00 0001f800 3fc0000e e0780078 000fffc0 00000000
00000000 00000000 1fc0007e 303c03c0 e007fe00 00000000 00000000 00000000
* mask
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffsumacc/mac/b.out   444      0     12        5364  3472542322   7026 ¬Ò`,CúÿÒ"	U$YÕÁ‡ÿBÓ’‡ÿgJ‡f
$YÕÁ`ÿÞãŸÕÇ`ÿÖBg©tJg?<©ÈpJ€fÿü#Í*N¹"*y*­ôNVþ¼Hîþ¼Aîÿ-HþÒBnþÜ=n
þÖ/<HnþÀN¹P-@þ¼J®þ¼g` 0.þÖHÀ//<N¹P-@þ¼`N^NuNVHî/<aŽX/<a„XNpNù@
`N^NuNVÿøHîÿø#ü¬z 9z€Ê/N¹ÜXN¹<N¹,/<N¹lXN¹\/<ÿÿÿÿ/</<N¹|ßü-@ÿü/.ÿüN¹LXN¹ìHnÿø/<N¹ŒP®ÿøfaÿ4®ÿøfÿÔN¹ü`N^NuN¹œ¨nNqN¹œ¨PNqN¹œ©ôNqN¹œQªN¹œY@N¹œ¨þNqN¹œ©NqN¹œ©NqN¹œ©ÌNqN¹œ©{NqN¹œŠ©|NqN¹œ©‘NqNVÿHî ÿøB.ÿ=|Nùÿ
-|dÿKîÿAî"n =|Nqÿ-Qÿm=|N¹ÿ"æˆA=AÿY2æˆAÒA2;Nûb82"?`ØR.ÿ/`Ð"Xá‰á‰á‰/`¼"`¶"g/`ª"AB‚"
RÙg
R‚BæmôQ"A‚/`Œ*y*NîÿJ.ÿg:Kî"n$æŠYX2æŠAgmîg/N¹X`à"U0HÀ"€`Ö2.ÿÒA2;Nû0HÀ` `B€Lî ÿøN^XNu o2|Jg
ÀR‰`ò 	 o€ Nu o"HB€S€m
ØfS‰QÈÿøB /Nu oB€ÑÀRˆB /R€Nu /ÀNuNVÿÀAîÿÀ1n!n
 =@N^"_\NÑ"< Nu`"< Nu`"< Nu`ü"< Nu`ò"< Nu`è"< Nu`Þ"< Nu`Ô"< Nu`Ê"< Nu`À"< Nu`¶"< Nu`¬"< 5Nu`¢"< Nu`˜"< Nu`Ž"< 	Nu`„"< 
Nu`z"< Nu`p"< Nu`f"< 
Nu`\"< ANu`R"< BNu`H"< CNu`>"< Nu`4"< Nu`*"< Nu` "< Nu`"< DNu`"< ENu`"_ _g/N—X>€NÑ"_ _ >€NÑ"_ _ >€NÑ"_start"*_savea5$~_end""main"¬_etext#¬_edata"ôReboot"Eject"ŒModalDialog"
ìInitCursor"	,InitFonts"	”ejectdisk$¬QDVar"|GetNewDialog"\TEInit"üExitToShell"ÜInitGraf"<InitWindows"
LShowWindow$zQD"lInitDialogs"
PBGetVInfo"œ_mactrap"	ª_pbgetvin"@_eject"p2cstr"Üc2pstr"6isapstr"6IsAPStr"P2CStr"ÜC2PStr" CofPStr"	6_pbsetfve"	ð_pbdelete"	ú_pbopenrf"	 _pbunmoun"	 _pbkillio"n_pbclose"	^_pbgetfpo"	_pbsetfin"	–_pbmountv"	h_pbsetfpo"	r_pbflushf"	T_pbseteof"	_pbrename"‚_pbwrite"È_pbeject"	–_pbstatus"	_pbgetfin"	æ_pbcreate"	¾_pbsetvol"	´_pbgetvol"	Ò_pbofflin"	@_pballoca"	,_pbrstflo"	Œ_pbcontro"	Ü_pbflushv"x_pbread"d_pbopen"	"_pbsetflo"	J_pbgeteof(Ü€¨¹†(ÜŒ¼â*Ü.*Ü2*Ü8FNT`h€”œ¬ÐÞîþ&.>N^n~Ž(ܲ(Ü\¨¹’NTEGER);
BEGIN
  IF theCode = inDownButton THEN
     BEGIN
       SetCtlValue(whichControl,GetCtlValue(whichControl)+1);
       ScrollBits
     END
END;

PROCEDURE PageScroll(code, amount: INTEGER);
VAR myPt: Point;
BEGIN
  REPEAT
    GetMouse(myPt);
    IF TestControsumacc/man/   775      0     12           0  3470501434   5773 sumacc/man/as68.1   444      0     12        1562  3470501427   6725 .TH AS68 1 MC68000
.SU
.SH NAME
as68 \- .a68 -> .b assembler component of cc68
.SH SYNOPSIS
.B as68
[ -godspel ] filename

.SH DESCRIPTION
.I As68
is the 68000 assembler.  
The input is taken from filename.a68, if present, otherwise from filename.
The output is sent to filename.b.
More than one input file can be specified, but only a single output is
generated.
The available flags are
.TP
.B -g
Undefined symbols are automatically declared global for
later resolution by the loader.
.TP
.B -o " filename"
Direct output to filename. 
.TP
.B -d
Print info helpful for debugging the assembler
.TP
.B -s
Put symbol table in list.out (relocatable values only)
.TP
.B -p
Print listing on stdout
.TP
.B -e
External symbols only in output
.TP
.B -l
produces a listing, filename.list
.SH FILES
/usr/sun/a68  /usr/bin/as68 /usr/sun/doc/a68opcodes
.SH SEE ALSO
cc68 (1), pc68(1), ld68 (1).
"A‚/`Œ*y*NîÿJ.ÿg:Kî"n$æŠYX2æŠAgmîg/N¹X`à"U0HÀ"€`Ö2.ÿÒA2;Nû0HÀ` `B€Lî ÿøN^XNu osumacc/man/cc68.1   444      0     12       16160  3470501427   6727 .TH CC68 1 MC68000
.SU
.SH NAME
cc68 \- C compiler for the MC68000
.SH SYNOPSIS
.B cc68
[ option ] ... file ...
.SH DESCRIPTION
.I Cc68
is the UNIX C compiler modified for the MC68000.
.I Cc68
is a flexible program for translating between various types of files.  The
types catered for in order of appearance during translation are `.c' (C source
files), `.s' (assembly language files), `.b' (relocatable binary files),
`b.out' (absolute binary files), `.r' (byte-reversed files, cf.
.I rev68(1)
).
and `.dl' (Macsbug download format, cf.
.I dl68(1)
).
.PP
Arguments to cc68 are either flags or input files.
The type of an input file is normally determined by its suffix.  When an
argument to cc68 is not a flag and has a suffix different from any
of the above suffixes, it is
assumed to be of one of the types `.c', `.b', or `b.out', namely the latest of
these three consistent with the type of the output (e.g. if the output type
were `.s' or `.b' then the input would have to be `.c').  If it has no
suffix it is assumed to be of type `b.out'.
.PP
Translation proceeds as follows.  Each
`.c' and `.s' program is translated to a `.b' relocatable using cpp, ccom68,
and as68 as necessary.  Then all .b files including those produced by
translation are link edited into the one file, called `b.out'.  If the only
input file was a single `.c' program then the `.b' file is deleted, otherwise
all `.b' files are preserved.
.PP
The amount of processing performed by cc68 may be decreased or increased with
some of the options.  The -S option takes translation no further than `.s'
files, i.e. only cpp and ccom68 are applied.  The -c option takes translation
up to `.b' files, omitting the link editing and not deleting any `.b' files.
The -d option goes beyond `b.out' to produce a `.dl' file (using dl68) that
may be downloaded by the Motorola MACSBUG monitor and the Sun1 monitor.  The
-r option similarly goes beyond `b.out' to produce a `.r' file (using rev68)
that may be loaded directly by 68000 code based on ld68.  Both -d and -r may
be used together.
.PP
The output may be named explicitly with the -o option; the output file's name
should follow -o.  Otherwise the name is `b.out' in the normal case, or
`filename.dl' for the -d option, or `filename.r' for the -r option, where
`filename' is the first `.c', `.s', or `.b' file named as an input.  If the
input is not in any of those three categories, the names `d.out' and `r.out'
are used respectively for -d and -r.
.PP
The version of the target machine may be given as the flag
.BI \-v n
where 
.I n
is the version.  The only recognized version at present is -vm, "Version
Macsbug."  The effect of giving the -vm flag is to add /usr/sun/dm/include to
the include directories for cpp, to add /usr/sun/dm/lib as a library in which
to look for -lx libraries, and to load the symbol table if any into the region
starting at 0x6BA.
.PP
The file /usr/sun/lib/crt0.b is passed to ld68, ahead of all other .b files.
This has the effect of defining the symbol _start to be at the text origin and
having a routine that performs necessary initialization, enters main, and
exits cleanly to the monitor.
.PP
The following options are interpreted by
.IR cc .
See
.IR ld68 (1)
for load-time options.
.TP 8
.B \-d
Produce a .dl file suitable for downloading with the MACSBUG monitor of the
Motorola Design Module, cf.
.IR dl68 (1).
.TP
.B \-r
Produce a .r file suitable for direct loading by the 68000, cf.
.IR rev68 (1).
.TP
.B \-c
Suppress the loading phase of the compilation, and force
an object file to be produced even if only one program is compiled.
.TP
.B \-w
Suppress warning diagnostics. \fb[Note: may not work.]\fr
.TP
.SM
.B \-O
Invoke an
object-code improver.
.TP
.SM
.B \-S
Compile the named C programs, and leave the
assembler-language output on corresponding files suffixed `.s'.
.TP
.SM
.B \-E
Run only the macro preprocessor
on the named C programs, and send the result to the
standard output.
.TP
.B \-L
Produce an assembly listing for each source file, with the
suffixes changed to ``.ls''.
.TP
.B \-R
Preserve relocation commands in b.out.
.TP
.SM
.B \-C
prevent the macro preprocessor from eliding comments.
.TP
.SM
.B \-V
Link for a V kernel environment.
This is equivalent to specifying 
.BI \-i/usr/sun/lib/teamroot.b
.B \-T 10000
and 
.B \-lV
at the end.
.TP
.SM
.B \-m
Link for a Macintosh environment.
This is equivalent to specifying 
.BI \-i/usr/sun/lib/crtmac.b
.B \-T 0
.B \-e _start
.B \-r
.B \-d
and 
.B \-lmac
.B \-lc
at the end.
.BI 
.TP
.BI \-o " output"
Name the final output file
.IR output .
If this option is used and the file `b.out' already exists it will be left
undisturbed.
.TP
.BI \-l x
Include libx.a as a library ld68 should search in for undefined functions.
.B x
may be more than one letter, as in -lpup.
.TP
.BI \-T " org"
Org specifies in hexadecimal where to begin loading the program.
.TP
.BI \-e " entrypoint"
Entrypoint specifies where to begin execution.
.TP
.SM
.BI \-D name=def
.br
.ns
.TP
.SM
.BI \-D \*Sname
Define the
.I name
to the preprocessor,
as if by
`#define'.
If no definition is given, the name is defined as "1".
.TP
.SM
.BI \-U \*Sname
Remove any initial definition of
.IR name .
.TP
.SM
.BI \-I \*Sdir
`#include' files
whose names do not begin with `/' are always
sought first in the directory 
of the
.I file
argument,
then in directories named in 
.B \-I
options,
then in directories on a standard list. The standard list
is (in order of search)
.I /usr/sun/include
and
.IR /usr/include .
.TP
.SM
.BI \-B \*Sstring
Find substitute compiler passes in the files named
.I string
with the suffixes cpp, ccom and c2.
If 
.I string 
is empty, use a standard backup version. \fb[Which doesn't work!]\fr
.TP
.BR \-t [ p012 ]
Find only the designated compiler passes in the
files whose names are constructed by a
.B \-B
option.
In the absence of a
.B \-B 
option, the
.I string
is taken to be `/usr/c/'.
.TP
.B \-\-x
By default,
.I cc68
passes a
.B \-x
flag to
.IR ld68 ,
in order to suppress local symbols from the final symbol table.  The
.B \-\-x
flag inhibits this default.
.PP
Other arguments
are taken
to be either loader option arguments, or C-compatible
object programs, typically produced by an earlier
.I cc68
run,
or perhaps libraries of C-compatible routines.
These programs, together with the results of any
compilations specified, are loaded (in the order
given) to produce an executable program with name
.B b.out.
.SH FILES
.ta \w'/usr/sun/lib/libc.a  'u
file.c	input file
.br
file.b	object file
.br
b.out	loaded output
.br
/tmp/ctm?	temporary
.br
/lib/cpp	preprocessor
.br
/usr/sun/c68/comp	compiler
.br
/usr/sun/c68/o68	optional optimizer
.br
/usr/sun/lib/crt0.b	runtime startoff
.br
/usr/sun/lib/libc.a	standard library, see (3)
.br
/usr/sun/include
.br
/usr/include	standard directories for `#include' files
.SH "SEE ALSO"
B. W. Kernighan and D. M. Ritchie,
.I The C Programming Language,
Prentice-Hall,
1978
.br
B. W. Kernighan,
.I
Programming in C\(ema tutorial
.br
D. M. Ritchie,
.I
C Reference Manual
.br
ld68(1)
.SH DIAGNOSTICS
The diagnostics produced by C itself are intended to be
self-explanatory.
Occasional messages may be produced by the assembler
or loader.
.SH BUGS
This is hacked up from
.IR cc (1),
and probably could be improved.
terpreted by
.IR cc .
See
.IR ld68 (1)
for load-time options.
.TP 8
.B \-d
Produce a .dl file suitable for downloading with the MACSBUG monitor of the
Motorola Design Module, cf.
.IR dl68 (1).
.TP
.B \-r
Produce a .r file suitable for direct loading by the 68000, cf.
.IR rev68 (1).
.TP
.B \-c
Suppress the loading phase of the compilation, and force
an object file to be produced even if only one prsumacc/man/ccom68.1   444      0     12        1116  3470501427   7236 .TH CCOM68 1 MC68000
.SU
.SH NAME
ccom68 \- .c -> .s translator component of cc68
.SH SYNOPSIS
.B ccom68
[ -lXp ]
.SH DESCRIPTION
.I Ccom68
is the UNIX C compiler modified for the MC68000.  It takes its input from stdin
and the resulting assembly code is printed on stdout.
.PP
The -l option generates line numbers in the output.  The -p option causes the
profile forming instruction "jbsr mcount" to be inserted at the entry to each
function.  The latter option must be preceded by X, which signals that it is a
pass 2 option.
.SH FILES
/usr/sun/c68  /usr/bin/ccom68
.SH SEE ALSO
cc68 (1)
er
.I cc68
run,
or perhaps libraries of C-compatible routines.
These programs, together with the results of any
compilations specified, are loaded (in the order
given) to produce an executable program with name
.B b.out.
.SH FILES
.ta \w'/usr/sun/lib/libc.a  'u
file.c	input file
.br
file.b	object file
.br
b.out	loaded output
.br
/tmp/ctm?	temporary
.br
/lib/cpp	preprocessor
.br
/usr/sun/c68/comp	compiler
.br
/usr/sun/c68/o68	optiosumacc/man/ddt68.1   444      0     12       13513  3470501430   7106 .TH DDT68 1 MC68000
.SU
.SH NAME
ddt68, fddt68 \- symbolic debugger for 68000
.SH SYNOPSIS
.B fddt68
b.out
.br
.B cc68 ... -lddt (Sun)

.SH DESCRIPTION
.I fddt68
is a symbolic disassembler for b.out files created by the 68000 linker
(ld68). Its main purpose is to allow testing of ddt logic in a
more hospitable environment than the 68000.  It also gives a way of inspecting
the assembly language form of a program without having to produce a .s file.
In addition it gives a check on the operation of as68 and ld68.  It is called
by typing:
.sp
fddt68 
.I filename
.sp
on the Vax.
.PP
.I ddt68
is a symbolic debugger for the 68000.  It is loaded at link edit time with
the cc68 flag -lddt.  On starting a program with ddt loaded the user will be
at the ddt command level.  Breakpoints may be set, and the program started,
using the commands described below.
.SH COMMANDS
.I ddt68
recognizes the following commands (\fI$\fP is used for \fI<esc>\fP):
.TP
.IB expression /
.TP
.IB expression \e
open the location at \fIexpression\fP and display the contents in the
current typeout mode.  The user may then optionally type an expression, whose
value replaces the contents of the open location.  Finally the location is
\fIclosed\fP by typing one of \fIreturn\fP (to return to \fIddt\fP's main
command loop), \fI/\fP (to open the next location), or \fI\\\fP (to open the
previous location).
.TP
.IB expression $g
go - plant any breakpoints set with the \fI$b\fP command, load the registers,
and start execution at \fIexpression\fP. If \fIexpression\fP is unspecified
or zero, execution resumes starting from the current value of \fI$pc\fP
(normally the point where the program was last interrupted).
.TP
.IB expression $x
execute the next \fIexpression\fP instructions, starting from the current
value of \fI$pc\fP and printing out all executed instructions.  If
\fIexpression\fP is omitted, 1 is assumed.
.TP
.IB expression $$x
same as above except execute subroutine calls and traps as single instructions,
i.e. do not descend into the called subroutine.
.TP
.IB expression $p
proceed - like \fIgo\fP with no argument, except that if we are presently at
a breakpoint then \fIexpression\fP counts the number of times to pass this
breakpoint before breaking.  \fI1$p\fP is synonymous with \fI$g\fP.
.TP
.IB expression $ bno b
set breakpoint \fIbno\fP (in the range 1-9) at \fIexpression\fP.  If \fIbno\fP
is omitted the first unused breakpoint number is assigned (the commonest
usage).  If \fIexpression\fP is 0 the named breakpoint is cleared, or if there
is no named breakpoint (\fIbno\fP is omitted) all breakpoints are cleared.
If \fIexpression\fP is omitted all breakpoints are printed, whether or not
\fIbno\fP is present.
.TP
.BI $ rspec /
.TP
.BI $ rspec \e
examine register \fIrspec\fP where \fIrspec\fP is one of:
.RS
.TP
.B d0-d7
data registers 0-7
.TP
.B a0-a7
address registers 0-7
.TP
.B fp
frame pointer (synonym for \fIa6\fP)
.TP
.B sp
stack pointer (synonym for \fIa7\fP)
.TP
.B pc
program counter
.TP
.B sr
status register
.RE
.TP
.IB expression $=
type out \fIexpression\fP in current output radix.
.TP
.IB lowlimit < highlimit > pattern ?
search for \fIpattern\fP in the range \fIlowlimit\fP (inclusive) to
\fIhighlimit\fP (exclusive).
The pattern is interpreted as an object of the type in force as
the current typeout mode, with instructions and strings being treated as
2-byte words.  Objects are assumed to be aligned on word (2-byte)
boundaries except for 1-byte types and strings which are aligned on byte
boundaries.  A mask (set with the following command) determines how much of
the pattern is
significant in the search, except that if the pattern is a string constant a
separate mask matched to the length of the string is used.
The three arguments to the search command are
sticky; thus if \fIlowlimit<\fP (resp. \fIhighlimit\fP>) is omitted, the
most recent lowlimit (resp. highlimit) applies.  While \fIpattern\fP may be
omitted, the final ? may not be omitted.
.TP
.IB expression $m
set the search mask to \fIexpression\fP.  \fI-1$m\fP forces a complete match,
\fIf$m\fP checks only the low order 4 bits, \fI0$m\fP will make the search
pattern match anything.
.TP
.IB base $ir
set input radix to \fIbase\fP. (Note \fI10$i\fP can never change the radix.)
If \fIbase\fP is omitted hexadecimal is assumed.
.TP
.IB base $or
set output radix to \fIbase\fP.
If \fIbase\fP is omitted hexadecimal is assumed.
.TP
.BI $ type t
temporarily set typeout mode to \fItype\fP where \fItype\fP is one of:
.RS
.TP
.B <space>
deduce type from type of nearest symbol
.TP
.B c
type out bytes as ascii characters.
.TP
.B h
type out bytes in current output radix.
.TP
.B w
type out words in current radix.
.TP
.B l
type out longs in current radix.
.TP
.B s
type out strings in current radix.  (In this mode new values cannot be
entered.)
.TP
.B i
type out as 68000 symbolic instructions.  (In this mode only the first
two bytes of the opened location may be changed; the new value is typed in as
a numeric expression rather than as a symbolic instruction.)
.RE
The new typeout mode stays in effect until a \fIreturn\fP is typed.
.TP
.BI $$ type t
permanently set typeout mode to \fItype\fP.
.PP
An \fIexpression\fP is composed of symbols, numeric constants, string
constants, and the operators \fI+\fP,
\fI-\fP, and \fI|\fP representing 2's complement addition,
subtraction, and inclusive bitwise or.
Symbols are delimited by operators or \fI<esc>\fP.  A string constant has from
1 to 4 characters which are packed right justified into one long to form a
numeric constant; thus "did"=646A64.  String constants are particularly
useful in conjunction witht the search command for searching for a string.
The single character \fI.\fP (dot) as a symbol on its own represents
the address of the currently open memory location.
All operations are carried out using 32 bit arithmetic and evaluated
strictly left to right.
.SH AUTHORS
Jim Lawson and Vaughan Pratt
sion\fP is omitted, 1 is assumed.
.TP
.IB expression $$x
same as above except execute subroutine calls and traps as single instructions,
i.e. do not descend into the called subroutisumacc/man/dl68.1   444      0     12        2055  3470501430   6711 .TH DL68 1 MC68000
.SU
.SH NAME
dl68 \- b.out -> .dl downloader component of cc68
.SH SYNOPSIS
.B dl68
[ -T -v -o -s ] filename
.SH DESCRIPTION
.I Dl68
is a downloader for the Motorola 68000 Design Module.  It takes its input, a
b.out format file, from filename and in the absence of the -o option sends its
output to stdout.
.PP
If there are any symbols these are loaded, starting at 0x6BA on vm (the Design
Module) or 0x1F000 on v1 (the Sun1 prototype).  The start and end of the symbol
table are stored at 0x570 and 0x574 respectively on either board.
.PP
The options are:
.TP
.BI \-T " textorigin "
specifies where the text (code) is to be loaded.
.TP
.BI \-v n
specifies the board version.  Default is v1 (Sun1 prototype).  vm denotes the
Motorola Design Module.
.TP
.BI \-o " filename "
specifies the output file.  Defaults to stdout.
.TP
.BI \-s DE
specifies the 
.I data/end
record types to generate.  The default is s28,
24 bit addresses.  The s19 format, 16 bit addresses, is used by the Data I/O
programmers.
.PP
.SH FILES
/usr/sun/ld68/down.c /usr/bin/dl68
 set typeout mode to \fItype\fP.
.PP
An \fIexpression\fP is composed of symbols, numeric constants, string
constants, and the operators \fI+\fP,
\fI-\fP, and \fI|\fP representing 2's complement addition,
subtraction, and inclusive bitwise or.
Symbols are delimited by operators or \fI<esc>\fP.  A string constant has from
1 to 4 characters which are packed right justified into one long to form a
numeric constant; thus "did"=646A64.  String constants are particularlsumacc/man/ld68.1   444      0     12       12126  3470501430   6731 .TH LD68 1
.SU
.SH NAME
ld68 \- .b -> b.out linker for the MC68000
.SH SYNOPSIS
.B ld68
[ option ] ... file ...
.SH DESCRIPTION
.I Ld68
combines several
object programs into one, resolves external
references, and searches libraries.
In the simplest case several object
.I files
are given, and
.I ld68
combines them, producing
an object module which can be either executed or
become the input for a further
.I ld68
run.
(In the latter case, the
.B \-r
option must be given
to preserve the relocation bits.)\ 
The output of
.I ld68
is left on
.BR b.out .
This file is made executable
only if no errors occurred during the load.
.PP
The argument routines are concatenated in the order
specified.
.PP
The entry point of the output is determined by the first applicable item of the
following list: the \fB\-e\fP option if given, the value of the symbol _start
if defined, or the text origin (first instruction).
.PP
If any argument is a library, it is searched exactly once
at the point it is encountered in the argument list.
Only those routines defining an unresolved external
reference are loaded.
If a routine from a library
references another routine in the library,
the referenced routine must appear after the
referencing routine in the library.
Thus the order of programs within libraries
may be important.
.PP
The symbols `\_etext', `\_edata' and `\_end'
(`etext', `edata' and `end' in C)
are reserved, and if referred to,
are set to the first location above the program,
the first location above initialized data,
and the first location above all data respectively.
It is erroneous to define these symbols.
.PP
.I Ld68
understands several options.
Except for
.BR \-l ,
they should appear before the file names.
.TP
.B \-D
Take the next argument as a decimal number and pad the data segment
with zero bytes to the indicated length.
.TP 
.B  \-d
Force definition of common storage
even if the
.B \-r
flag is present.
.TP
.B \-e
The following argument is taken to be the
name of the entry point of the loaded
program; location 0x1000 is the default.
.TP
.B \-f
Fold case on identifiers.
That is, upper and lower case letters are not distinguished.
Used to link with Pascal routines, for example.
.TP 
.BI \-l x
This
option is an abbreviation for the library name
.RI `/usr/sun/lib/lib x .a',
where
.I x
is a string.
A library is searched when its name is encountered,
so the placement of a
.B  \-l
is significant.
.TP
.BI  \-v x
This denotes board version
.I x
which may at present only be 'm' for Motorola Design Module.  The default board
version is the Sun1 prototype, v1.
.TP
.B  \-M
Create a human-readable list of symbols in ``sym.out''.
.TP
.B  \-n
Arrange (by giving the output file a 0410 "magic number") that
when the output file is executed,
the text portion will be read-only and shared
among all users executing the file.
This involves moving the data areas up to the first
possible 64K byte boundary following the
end of the text 
(not really useful yet).
.TP 
.B  \-o
The
.I name
argument after
.B \-o
is used as the name of the
.I ld68
output file, instead of
.BR b.out .
.TP 
.B \-q
Quicksort symbols in 
.BR b.out 
in ascending numerical order.
.TP
.B  \-r
Generate relocation bits in the output file
so that it can be the subject of another
.I ld68
run.
This flag also prevents final definitions from being
given to common symbols,
and suppresses the `undefined symbol' diagnostics.
.TP
.B \-S
`Strip' the output by removing all symbols except locals and globals.
.TP 
.B  \-s
`Strip' the output, that is, remove the symbol table
and relocation bits to save space (but impair the
usefulness of the debuggers).
This information can also be removed by
.IR  strip (1).
.TP
.B \-T
The next argument is a hexadecimal number which sets the text segment origin.
The default origin is 0x1000.
If you intend to use the output as input to another run of
ld68, you must specify -T 0.
.TP
.B \-B
The next argument is a hexadecimal number which sets the common/bss segment
origin.  The default origin is immediately after the data segment.
.TP 
.B  \-u
Take the following argument as a symbol and enter
it as undefined in the symbol table.  This is useful
for loading wholly from a library, since initially the symbol
table is empty and an unresolved reference is needed
to force the loading of the first routine.
.TP 
.B  \-X
Save local symbols
except for those whose names begin with `L'.
This option is used by
.IR cc (1)
to discard internally-generated labels while
retaining symbols local to routines.
.TP 
.B  \-x
Do not preserve local
(non-.globl) symbols in the output symbol table; only enter
external symbols.
This option saves some space in the output file.
.SH FILES
.ta \w'/usr/local/lib/lib*.a\ \ 'u
/usr/sun/lib/lib*.a	libraries
.br
b.out	output file
.SH "SEE ALSO"
ar(1), cc68(1), a68(1)
.SH BUGS
The b.out format header does not contain any indication of the
text segment origin, so if you specify something other than
the default origin -T 1000, you will have to remember this
value and specify it again to dl68 when you download. The
standard Sun monitor cannot netload files with origins other
than 1000, so you must either use dl68 or write a special
loader for such programs.
8
understands several options.
Except for
.BR \-l ,
they should appear before the file names.
.TP
.B \-D
Take the next argument as a decimal number and pad the data segment
with zero bytes to the indicated length.
.TP 
.B  \-d
Force definition of common storage
even if the
.B \-r
flag is present.
.TP
.B \-e
The following argument is taken to be the
name of the entry point of the loaded
program; location 0x1000 is the defausumacc/man/lorder68.1   444      0     12        1500  3470501430   7573 .TH LORDER68 1 
.UC 4
.SH NAME
lorder68 \- find ordering relation for an MC68000 object library
.SH SYNOPSIS
.B lorder68
file ...
.SH DESCRIPTION
The input
is one or more object
.I files.
The standard output
is a list of pairs of object file names,
meaning that the first file of the pair refers to
external identifiers defined in the second.
The output may be processed by
.IR  tsort (1)
to find an ordering of
a library suitable for one-pass access by
.IR  ld68 (1).
.PP
This brash one-liner intends to build a new library
from existing `.b' files.
.IP
ar cr library \`\|lorder68 *.b | tsort\`
.SH FILES
*symref, *symdef
.br
nm(1), sed(1), sort(1), join(1)
.SH "SEE ALSO"
tsort(1),
ld68(1),
.SH BUGS
The names of object files, in and out of libraries, must end with `.b';
nonsense results otherwise.
.PP
Doesn't handle libraries.
ed by
.IR cc (1)
to discard internally-generated labels while
retaining symbols local to routines.
.TP 
.B  \-x
Do not preserve local
(non-.globl) symbols in the output symbol table; only entesumacc/man/nm68.1   444      0     12        2634  3470501430   6727 .TH NM68 1 
.SU
.SH NAME
nm68 \- print name list of MC68000 object files
.SH SYNOPSIS
.B nm68
[
.B \-cgnfopruh
]
[ file ... ]
.SH DESCRIPTION
.I Nm68
prints the name list (symbol table) of each object
.I file
in the argument list.
If an argument
is an archive, a listing for each object
file in the archive will be produced.
.PP
Each symbol name is preceded by its value in hex
and one of the letters
.SM
.B U
(undefined),
.SM
.B A
(absolute),
.SM
.B  T
(text segment symbol),
.SM
.B D
(data segment symbol),
.SM
.B B
(bss segment symbol),
If the symbol is local (non-external) the type letter is in
lower case.
The output is sorted alphabetically.
.PP
Options are:
.TP
.B  \-g
Print only global (external) symbols.
.TP
.B \-n
Sort numerically rather than alphabetically.
.TP
.B \-o
Prepend file or archive element name to each
output line rather than only once.
.TP
.B  \-p
Don't sort; print in symbol-table order.
.TP
.B  \-r
Sort in reverse order.
.TP
.B  \-d
Print only defined symbols.
.TP
.B  \-u
Print only undefined symbols.
.TP
.B \-h
Print values in hex rather than in octal.  (
.B \-x
is a synonym for
.B \-h
\.)
.TP
.B \-c
Print only C-style symbols (those beginning with `~' or `_'.)
.TP
.B \-f
Give the name of each object file as it is processed.  This
implies a
.B \-p
flag.  (If the
.B \-p
flag is not present, nm68 sorts symbols
without regard to which object file they came from.)
.SH SEE ALSO
ar(1), ar(5), b.out(5)
 it again to dl68 when you download. The
standard Sun monitor cannot netload files with origins othesumacc/man/o68.1   444      0     12         463  3470501431   6532 .TH O68 1 MC68000
.SU
.SH NAME
o68 \- .s -> .s optimizer component of cc68
.SH SYNOPSIS
.B o68
.SH DESCRIPTION
.I O68
is a 68000 assembly language optimizer.  It takes its input from stdin and
sends its output to stdout.
.PP
.SH FILES
/usr/sun/c68/o0.c /usr/sun/c68/o1.c  /usr/bin/o68
.SH SEE ALSO
cc68 (1)
will be produced.
.PP
Each symbol name is preceded by its value in hex
and one of the letters
.SM
.B U
(undefined),
.SM
.B A
(absolute),
.SM
.B  T
(text segment symbol),
.SM
.B D
(data segment symbol),
.SMsumacc/man/pc68.1   444      0     12       32302  3470501431   6733 .TH PC68 1 MC68000
.SU
.SH NAME
pc68 \- Pascal compiler for the MC68000
.SH SYNOPSIS
.B pc68
[ option ] name ...
.SH DESCRIPTION
.I Pc68
is the version of the portable Pascal* compiler that generates code for 
the MC68000.
.I Pc68
is a flexible program for translating between various types of files.  The
types catered for in order of appearance during translation are `.p' 
(Pascal source files), `.a68' or '.s' (assembly language files), 
`.b' (relocatable binary files),
`b.out' (absolute binary files), `.r' (byte-reversed files, cf.
.I rev68(1)
).
and `.dl' (Macsbug download format, cf.
.I dl68(1)
).
.PP
Arguments to pc68 are either flags or input files.
The type of an input file is normally determined by its suffix.  When an
argument to pc68 is not a flag and has none of the above suffixes, it is
assumed to be of one of the types `.p', `.b', or `b.out', namely the latest of
these three consistent with the type of the output (e.g. if the output type
were `.s' or `.b' then the input would have to be `.p').
.PP
Translation proceeds as follows.  
Each `.p' and `.s' program is translated to a `.b' relocatable using upas68, 
ugen68, and as68 as necessary.  Then all .b files including those produced by
translation are link edited into the one file, called `b.out'.  If the only
input file was a single `.p' program then the `.b' file is deleted, otherwise
all `.b' files are preserved.
.PP
The amount of processing performed by cc68 may be decreased or increased with
some of the options.  The -S option takes translation no further than `.s'
files, i.e. only upas68 and ugen68 are applied.  
The -c option takes translation up to `.b' files, omitting the link-editing 
and not deleting any `.b' files.
The -d option goes beyond `b.out' to produce a `.dl' file (using dl68) that
may be downloaded by the Motorola MACSBUG monitor and the Sun1 monitor.  The
-r option similarly goes beyond `b.out' to produce a `.r' file (using rev68)
that may be loaded directly by 68000 code based on ld68.  Both -d and -r may
be used together.
.PP
The output may be named explicitly with the -o option; the output file's name
should follow -o.  Otherwise the name is `b.out' in the normal case, or
`filename.dl' for the -d option, or `filename.r' for the -r option, where
`filename' is the first `.p', `.a68', `.s', or `.b' file named as an input.  
If the input is not in any of those three categories, the names `d.out' 
and `r.out' are used respectively for -d and -r.
.PP
The version of the target machine may be given as the flag
.BI \-v n
where 
.I n
is the version.
-vm is "Version Macsbug."
-vV means to run under the Vkernal. This is pretty much a hack:
File I/O is not supported and you can't refer to C routines
containing upper-case letters in their names.
It's also rather minimally tested.
.PP
A complete list of options interpreted by pc68 follows:
.TP 6
\#flag
Pass
.I flag
to the compiler. See the SOURCE FLAGS section below.
.TP 6
.B \-c
Suppress loading and produce `.b' file(s) from source file(s).
.TP 6
.B \-g
Have the compiler produce additional symbol table information for
.IR pcdb68
(not implemented).
.TP 6
.B \-e " entrypoint"
Entrypoint specifies where to begin execution.
.TP 6
.BR \-o " output"
Name the final output file
.I output
instead of
.I b.out.
.TP 6
.B  \-s
Accept standard Pascal only;
non-standard constructs cause warning diagnostics (not implemented \- see 
internally controlled options).
.TP 6
.B  \-v n
Use the 'n' version of the runtime support.
.TP 6
.BR \-w
Suppress warning messages (not implemented).
.TP 6
.B \-\-x
Suppress passing the '\-x' flag to the loader, retaining local symbols.
.TP 6
.B \-E
Run only the preprocessor (not implemented).
.TP 6
.B  \-L
Make an assembly listing in filename.ls for each file assembled.
.TP 6
.SM
.B \-O
Invoke an
object-code improver (not implemented).
.TP 6
.B  \-R
Preserve relocation information in b.out.
.TP 6
.SM
.B \-S
Compile the named program, and leave the
assembler-language output on the corresponding file suffixed `.s'.
(No `.b' is created.).
.TP 6
.B \-T " org"
Org specifies in hexadecimal where to begin loading the program.
.TP 6
.B \-V
Show the various stages of the compilation by printing images of the processes
forked off to perform the actual work of the compilation.
.TP 6
.B \-U
Save the ucode associated with filname.p in filename.u (and filename.z,
depending on the -W option).
.TP 6
.B \-W
Invoke the global ucode-to-ucode optimizer.  If -U option active, generates
filename.z.
.TP 6
.B \-P
Save all intermediate files.  Most useful in conjuntion with \-V (so that it
is possible to find the intermediates).
.PP
Other arguments
are taken
to be loader option arguments,
perhaps libraries of
.IR pc68
compatible routines.
.SH SEPARATE COMPILATION
Object files 
created by other language processors may be loaded together with
object files created by 
.IR pc68 .
Calling conventions are as in C,
with
.B var
parameters and arrays passed by address.
Don't pass structures except by VAR (pointer) if you call C, since here
pc68 and cc68 differ.
As a convenience, string constants are followed by a zero byte, so that you
can use them as C strings when calling C routines.
.PP
To refer to a subroutine defined in a separate module, it must be declared.
This follows the same syntax as
.B forward
declarations, except that the keyword
.B FORWARD
is replaced by
.B EXTERN .
.PP
A file of subroutines is similar to a program except that there
is no main program, and the
.B program
statement at the beginning of the file is replaced by a
.b module
statement:
.br
   MODULE modulename;
.br
The 'end;' of the last function in the file is followed by a period -
there is no main program block.
.br
The modulename will become significant in Pascal*.
.pp
Note that in identifiers (such as subprogram names) upper case is
changed to lower case, and the linker is asked to ignore case.

.SH OPENING FILES

To open a file for both input and output, use the standard
procedure REVISE, which is analogous with RESET and REWRITE.
NOT TESTED.
.sp
You can read and write files on machines which run a Leaf server.
To open  a file for reading do:
.sp
   reset(file,'[hostname:username:password]filename');
.sp
The same syntax applies to rewrite.
You can of course also use a Pascal string variable.
Terminating spaces in hostname, username and password are ignored.
(This should make it easier for a program to construct the appropriate
filename string.)
.sp
You can leave out fields (or the entire second parameter), and the
program will assume you want the same as before.
If there is no "before", it will ask you.
.sp
Reset, Rewrite and Revise may have an optional third parameter,
which is a string of switches. E.g.:
.br
    Reset(Input,'data1.txt','Nofilter;Prompt:"Try again!"');
.sp
Standard switches are:
.br
 - Prompt:  The string  is used as  a prompt  (interactive
systems only).   If  a file  name  is NOT  given,  this
prompt is used to get the file name from the user.   If
one IS given (like in the example above), the prompt is
used to get another file name from the user if the file
can't be opened.
.br
 - Default:  The string is used are used as a default file
name, which is used if the user types a carriage return
in response to the prompt.
.br
 - Standard:  If Reset, the standard input file  is  used.
If Rewrite, the standard output is used.
.br
 - Nofilter:    (Reset, Revise only.) Normally a text file
is 'filtered' by the runtimes so that  it  conforms  to
the  standard  Pascal  definition of a text file.  Most
notably, any end-of-line characters  are  changed  into
one  space.    The  inclusion  of  Nofilter  causes all
characters to be passed through exactly as they  appear
in  the  text file.  Eoln, Eopage and Readln still work
as for standard files.

.SH EXTENSIONS TO READ AND WRITE

For all field widths (if there are two field-width-type
parameters,  the first one only), a negative value will
mean  that  the  value  written  will  be  left-aligned
instead  of  right-aligned.    For string variables, if
Abs(Fieldwidth)  <  Length,  then   the   last   Length
- Abs(Fieldwidth) characters  of  the  string  will  be 
written.
.sp
Variables  of enumerated types may be read and written.
The field width is interpreted the same as for strings.
Enumerated constant names are uppercased when they  are
read in.
.sp
Sets  of  readable and writeable types may also be read
and written.  They  appear  exactly  as  set  constants
appear   in  Pascal  programs.    The  field  width  is
interpreted for each element the same as  it  would  be
for    the   set   element   type.
.sp
Integers may be written in other bases beside  base  10
by  including  an  optional field-width-type parameter,
which may be anywhere from 1..16.  The field  width  is
the  same  as  for  base 10.  Integers may also be read
from a file in other  than  base  10,  by  including  a
field-width-type  parameter  in  the  call  to  Read or
Readln.
.sp
Real numbers may have a capital  "E"  as  well  as  the
standard small "e" in the exponent part.

.SH MORE ABOUT INPUT-OUTPUT
Lazy lokahead is used for text files, so that terminal input
works reasonably.
.sp
The procedure Eopage is true iff a page marker has just been read, and
the corresponding space in now in the file buffer.
.sp
Random-access in files is done with the standard procedure
.br
    seek (File, N);
.br
This positions the file so that the next read/write will apply
to component no. N of the file.
.sp
To close a file immediately do: close(file);
.sp
Function Filesize (var Filevar: Anyfile): 0..Maxint  
returns the current number of components in a file.
.sp
Function Curpos (var Filevar: Anyfile): 0..Maxint:  Returns the
current file position.
.sp
Procedure Filepos (var Filevar:  Text; var Pagenum, Linenum, Charnum: 0..Maxint):
Returns page, line number, and column number of the next
character that will be read from the file (must be open for input).
Does not work for random access.

.SH TIME AND DATE ROUTINES
.nf
    Clock -returns milli-seconds since the monitor was booted.
.fi
.sp
The following routines routines don't work if you want to run stand-alone,
but need an operating system (V or Unix).
.nf

    Ptime -returns (in theory) milli-seconds since midnight.
    (under V, actually returns seconds*1000)

    Pdate(day, month, year) -set day, month & year (say 1982).

    Time(string) -sets string to 'HH:MM:SS'

    Date(string) -sets string to 'MM/DD/YY'.
.fi
For both time and date, the string is a packed array [1..n] of char,
where n>=8. (Any overflow is set to spaces.)

.SH OTHER EXTENSIONS AND FEATURES
An "others" label in as CASE statement, indicates a default case.
.sp
To include a file as part of the program source do:
.br
    INCLUDE 'filename';
.br
This is especially useful for declarations for
seperately compiled modules.
.sp
Records declared as "packed" will be packed down to individual bits;
however elements of packed arrays are at least a byte.
.sp
Function Min (X,Y:  T):  T -- returns the minimum of two arguments,
which may be of any ordinal or real type.
.sp
Function Max (X,Y:  T):  T -- returns the maximum of two arguments.
.sp
Procedure Halt (Exitcode:  Integer):  Causes abnormal termaination of
a program.  Passes a system-dependent exit code to the operating system.
.sp
The comment pairs '{ }' and '(* *) match independently, allowing
limited nesting of comments.

.SH "SOURCE FLAGS"
.PP
These flags can be passed to the compiler either at the command
level when invoking pc68, or as comments within the program.
A sample option line is a comment with # as its first character:
.ta 1.5i 3.0i
.nf
.na
Sample option line: (*#g+,tdpy 1,tchk 1,U-8 *)
WARNING: Only (* *)-style comments will work; {#...} is ignored!
Sample command line: pc68 file.p #g:+ #tdpy:1 #tchk:1 #U:-8
.sp
.b
Switch	Meaning (Note that the default value is shown)

B+	Bounds and nil pointer checking
C+	Print ucode
D-	Load with debugger
E+	Emit source code (for system debugging)
G-	Write error messages only to listing file
L-	Write full listing
I16	Number of characters of identifiers that
	  are considered significant
O-	Emit optimizer-compatible code
P-	Keep execution profile
R0	Put up to N local variables in (data) registers
	(Register allocation should be done by the optimizer.)
S-	Accept standard Pascal only
T---	Code generator options 
U+	Leave procedure names exactly as is
V32	Number of bits (16 or 32) to allocate for 'Integer'.
Wn	PRINT WARNINGS FOR:
W1	  unused variables, types, procs, etc.
W10	  nested comments
Z---	Optimizer switches
.fi
.ad
.SH FILES
file.p	pascal source files
.br
file.b	binary files
.br
file.a68	assembler files
.br
file.s	assembler files  
.br
file.ls	assembler listing
.br
file.err	pascal listing
.SH BUGS
Displacements off a frame pointer is limited to 16 bits signed,
so very large locally-defined arrays will crash.
.sp 2
Some attempted bogus conversions (e.g. structure to real) aren't detected
by the front end, and result in messages about 'Illegal CVT datatypes'
from the code generator.
.sp 2
Sometimes formfeeds in the source get passed to the assembler, causing it to crash.
.sp 2
There is no macro processor.
.SH GRIPES
Complaints should be sent to:
.br
    Per Bothner (mail to bothner@score)
.sp
There is also a pc68 mailing list. To add yourself to it, send a
message to mailer@su-whitney. The first line of the message body
should say:
.br
   add me to pc68
.sp
To say messages to to list, mail to pc68 at shasta, diablo,
navajo or whitney.
 that the next read/write will apply
to component no. N of the file.
.sp
To close a file immediately do: close(file);
.sp
Function Filesize (var Filevar: Anyfile): 0..Maxint  
returns the current number of components in a file.
.sp
Function Curpos (var Filevar: Anyfile): 0..Maxint:  Returns the
current file position.sumacc/man/pr68.1   444      0     12         453  3470501432   6715 .TH PR68 1 
.SU
.SH NAME
pr68 \- print extended statistics on .b file
.SH SYNOPSIS
.B pr68 file
.SH DESCRIPTION
.I Pr68
prints the header information, symbol table, and relocation commands of a .b
or .68 file.  Verifies that the text and data segments are multiples of 4.
.PP
.SH AUTHOR
C.J. Terman
close(file);
.sp
Function Filesize (var Filevar: Anyfile): 0..Maxint  
returns the current number of components in a file.
.sp
Function Curpos (var Filevar: Anyfile): 0..Maxint:  Returns the
current file position.sumacc/man/rev68.1   444      0     12        2360  3470501432   7107 .TH REV68 1 
.SU
.SH NAME
rev68 \- reverse byte order in 68000 .b and .68 (b.out) files
.SH SYNOPSIS
.B rev68 infile [ outfile ... ]
.SH DESCRIPTION
.I Rev68
translates .b and .68 (b.out) files into a form readable by the 68000.  This
entails reversing the byte order within short and long words, and rearranging
structs to agree with the c68 interpretation of structs.
.PP
The transformations that take place are:  the 8 longs in the header (including
the magic number) are each byte reversed; the text and data segments are
unchanged; the symbol segment is modified so that the struct defining the type
and value of the symbol fits in 6 bytes instead of 8 (to agree with the c68
interpretation of struct sym in /usr/sun/ld68/b.out.h); each symbol is
padded with an extra 0 if necessary to force word alignment; and the relocation
commands are repacked to agree with the c68 interpretation of struct reloc in
/usr/sun/ld68/b.out.h.
.PP
The output is written to outfile, which if not specified defaults to r.out.
The output will be smaller than the input unless there are no symbols or
relocation commands.
.PP
The intent is that r.out files not be the input to any Unix program, but that
they be sent directly to the 68000 as a byte stream.
.SH AUTHOR
V.R. Pratt
 date, the string is a packed array [1..n] of char,
where n>=8. (Any overflow is set to spaces.)

.SH OTHER EXTENSIONS AND FEATURES
An "others" label in as CASE statement, indicates a default case.
.sp
To include a file as part of the program source do:
.br
    INCLUDE 'fsumacc/man/rl68.1   444      0     12        2124  3470501432   6726 .TH RL68 1 
.SU
.SH NAME
rl68 \- print relocation commands in a .b file for the 68000
.SH SYNOPSIS
.B rl68 infile
.SH DESCRIPTION
.I Rl68
prints the relocation commands in a 68000 .b file.  The format for each command
is:
.PP
AREA SEGMENT SIZE   Displacement  Symbol
.PP
The AREA is one of T or D according to whether the command acts on Text or
Data.  The SEGMENT is one of T, D, B, or E, according to whether the object
linked to is in Text, Data, or Bss, or is External.  The SIZE is one of B, W,
or L, according to whether the object linked to is of size Byte, Word, or Long.
The Displacement indicates where in the AREA the command is to be applied.  The
Symbol is the symbolic name of the object linked to if any.
.PP
The correspondence with struct reloc (defined in /usr/sun/ld68/b.out.h) is as
follows.  SEGMENT is rsegment and SIZE is rsize.  Displacement is rdisp.
Symbol is determined from rsymbol, a short which is the symbol id.  AREA is
determined by the area in which the relocation command is found, there being
two such areas.
.SH RELATED
nm68, size68, pr68, lorder68
.SH AUTHOR
C.J. Terman
PP
The intent is that r.out files not be the input to any Unix program, but that
they be sent directly to the 68000 as a byte stream.
.SH AUTHOR
V.R. Pratt
 date, the string is a packed array [1..n] of char,
where n>=8. (Any overflow is set to spaces.)

.SH OTHER EXTENSIONS AND FEATURES
An "others" label in as CASE statement, indicates a default case.
.sp
To include a file as part of the program source do:
.br
    INCLUDE 'fsumacc/man/size68.1   444      0     12        1136  3470501432   7265 .TH SIZE68 1 
.SU
.SH NAME
size68 \- prints sizes of segments in a .b or .68 file
.SH SYNOPSIS
.B size68 [ -hl ] file
.SH DESCRIPTION
.I Size68
prints the sizes of the text, data, and bss segments of a .b or .68 file, in
decimal; the total size is also given in both decimal and octal.  The -h
flag causes the sizes to be given in hexadecimal.  The -l flag causes a
complete printout in decimal (hex if -h is given) of the values of the 8
header words, namely the magic number, the sizes of the three segments, the
size of the symbol table, and the sizes of the relocation commands.
.SH AUTHOR
C.J. Terman
 where in the AREA the command is to be applied.  The
Symbol is the symbolic name of the object linked to if any.
.PP
The correspondence with struct reloc (defined in /usr/sun/ld68/b.out.h) is as
follows.  SEGMENT is rsegment and SIZE is rsize.  Displacement is rdisp.
Symbol is determined from rsymbol, a short which is the symbol id.  AREA is
determined by the area in which the relocation command is found, there besumacc/man/cc68.1-   444      0     12       15664  3470501433   7011 .TH CC68 1 MC68000
.SU
.SH NAME
cc68 \- C compiler for the MC68000
.SH SYNOPSIS
.B cc68
[ option ] ... file ...
.SH DESCRIPTION
.I Cc68
is the UNIX C compiler modified for the MC68000.
.I Cc68
is a flexible program for translating between various types of files.  The
types catered for in order of appearance during translation are `.c' (C source
files), `.s' (assembly language files), `.b' (relocatable binary files),
`b.out' (absolute binary files), `.r' (byte-reversed files, cf.
.I rev68(1)
).
and `.dl' (Macsbug download format, cf.
.I dl68(1)
).
.PP
Arguments to cc68 are either flags or input files.
The type of an input file is normally determined by its suffix.  When an
argument to cc68 is not a flag and has a suffix different from any
of the above suffixes, it is
assumed to be of one of the types `.c', `.b', or `b.out', namely the latest of
these three consistent with the type of the output (e.g. if the output type
were `.s' or `.b' then the input would have to be `.c').  If it has no
suffix it is assumed to be of type `b.out'.
.PP
Translation proceeds as follows.  Each
`.c' and `.s' program is translated to a `.b' relocatable using cpp, ccom68,
and as68 as necessary.  Then all .b files including those produced by
translation are link edited into the one file, called `b.out'.  If the only
input file was a single `.c' program then the `.b' file is deleted, otherwise
all `.b' files are preserved.
.PP
The amount of processing performed by cc68 may be decreased or increased with
some of the options.  The -S option takes translation no further than `.s'
files, i.e. only cpp and ccom68 are applied.  The -c option takes translation
up to `.b' files, omitting the link editing and not deleting any `.b' files.
The -d option goes beyond `b.out' to produce a `.dl' file (using dl68) that
may be downloaded by the Motorola MACSBUG monitor and the Sun1 monitor.  The
-r option similarly goes beyond `b.out' to produce a `.r' file (using rev68)
that may be loaded directly by 68000 code based on ld68.  Both -d and -r may
be used together.
.PP
The output may be named explicitly with the -o option; the output file's name
should follow -o.  Otherwise the name is `b.out' in the normal case, or
`filename.dl' for the -d option, or `filename.r' for the -r option, where
`filename' is the first `.c', `.s', or `.b' file named as an input.  If the
input is not in any of those three categories, the names `d.out' and `r.out'
are used respectively for -d and -r.
.PP
The version of the target machine may be given as the flag
.BI \-v n
where 
.I n
is the version.  The only recognized version at present is -vm, "Version
Macsbug."  The effect of giving the -vm flag is to add /usr/sun/dm/include to
the include directories for cpp, to add /usr/sun/dm/lib as a library in which
to look for -lx libraries, and to load the symbol table if any into the region
starting at 0x6BA.
.PP
The file /usr/sun/lib/crt0.b is passed to ld68, ahead of all other .b files.
This has the effect of defining the symbol _start to be at the text origin and
having a routine that performs necessary initialization, enters main, and
exits cleanly to the monitor.
.PP
The following options are interpreted by
.IR cc .
See
.IR ld68 (1)
for load-time options.
.TP 8
.B \-d
Produce a .dl file suitable for downloading with the MACSBUG monitor of the
Motorola Design Module, cf.
.IR dl68 (1).
.TP
.B \-r
Produce a .r file suitable for direct loading by the 68000, cf.
.IR rev68 (1).
.TP
.B \-c
Suppress the loading phase of the compilation, and force
an object file to be produced even if only one program is compiled.
.TP
.B \-w
Suppress warning diagnostics. \fb[Note: may not work.]\fr
.TP
.SM
.B \-O
Invoke an
object-code improver.
.TP
.SM
.B \-S
Compile the named C programs, and leave the
assembler-language output on corresponding files suffixed `.s'.
.TP
.SM
.B \-E
Run only the macro preprocessor
on the named C programs, and send the result to the
standard output.
.TP
.B \-L
Produce an assembly listing for each source file, with the
suffixes changed to ``.ls''.
.TP
.B \-R
Preserve relocation commands in b.out.
.TP
.SM
.B \-C
prevent the macro preprocessor from eliding comments.
.TP
.SM
.B \-V
Link for a V kernel environment.
This is equivalent to specifying 
.BI \-i/usr/sun/teamroot.b
.B \-T 10000
and 
.B \-lV
at the end.
.BI 
.TP
.BI \-o " output"
Name the final output file
.IR output .
If this option is used and the file `b.out' already exists it will be left
undisturbed.
.TP
.BI \-l x
Include libx.a as a library ld68 should search in for undefined functions.
.B x
may be more than one letter, as in -lpup.
.TP
.BI \-T " org"
Org specifies in hexadecimal where to begin loading the program.
.TP
.BI \-e " entrypoint"
Entrypoint specifies where to begin execution.
.TP
.SM
.BI \-D name=def
.br
.ns
.TP
.SM
.BI \-D \*Sname
Define the
.I name
to the preprocessor,
as if by
`#define'.
If no definition is given, the name is defined as "1".
.TP
.SM
.BI \-U \*Sname
Remove any initial definition of
.IR name .
.TP
.SM
.BI \-I \*Sdir
`#include' files
whose names do not begin with `/' are always
sought first in the directory 
of the
.I file
argument,
then in directories named in 
.B \-I
options,
then in directories on a standard list. The standard list
is (in order of search)
.I /usr/sun/include
and
.IR /usr/include .
.TP
.SM
.BI \-B \*Sstring
Find substitute compiler passes in the files named
.I string
with the suffixes cpp, ccom and c2.
If 
.I string 
is empty, use a standard backup version. \fb[Which doesn't work!]\fr
.TP
.BR \-t [ p012 ]
Find only the designated compiler passes in the
files whose names are constructed by a
.B \-B
option.
In the absence of a
.B \-B 
option, the
.I string
is taken to be `/usr/c/'.
.TP
.B \-\-x
By default,
.I cc68
passes a
.B \-x
flag to
.IR ld68 ,
in order to suppress local symbols from the final symbol table.  The
.B \-\-x
flag inhibits this default.
.PP
Other arguments
are taken
to be either loader option arguments, or C-compatible
object programs, typically produced by an earlier
.I cc68
run,
or perhaps libraries of C-compatible routines.
These programs, together with the results of any
compilations specified, are loaded (in the order
given) to produce an executable program with name
.B b.out.
.SH FILES
.ta \w'/usr/sun/lib/libc.a  'u
file.c	input file
.br
file.b	object file
.br
b.out	loaded output
.br
/tmp/ctm?	temporary
.br
/lib/cpp	preprocessor
.br
/usr/sun/c68/comp	compiler
.br
/usr/sun/c68/o68	optional optimizer
.br
/usr/sun/lib/crt0.b	runtime startoff
.br
/usr/sun/lib/libc.a	standard library, see (3)
.br
/usr/sun/include
.br
/usr/include	standard directories for `#include' files
.SH "SEE ALSO"
B. W. Kernighan and D. M. Ritchie,
.I The C Programming Language,
Prentice-Hall,
1978
.br
B. W. Kernighan,
.I
Programming in C\(ema tutorial
.br
D. M. Ritchie,
.I
C Reference Manual
.br
ld68(1)
.SH DIAGNOSTICS
The diagnostics produced by C itself are intended to be
self-explanatory.
Occasional messages may be produced by the assembler
or loader.
.SH BUGS
This is hacked up from
.IR cc (1),
and probably could be improved.
ning the symbol _start to be at the text origin and
having a routine that pesumacc/man/a68opcodes   444      0     12        7064  3470501433   7760 				AS68 Summary

				V.R. Pratt
				Feb., 1981

The following are all the instruction opcodes recognized by as68.  Their usage
agrees closely with that of the 68000 User's Manual.


abcd	      clrb	    lsll	  smi
addb	      clrw	    lsrb	  sne
addw	      clrl	    lsrw	  spl
addl	      cmpb	    lsrl	  st
addqb	      cmpw	    movb	  stop
addqw	      cmpl	    movw	  subb
addql	      cmpmb	    movl	  subw
addxb	      cmpmw	    movemw	  subl
addxw	      cmpml	    moveml	  subqb
addxl	      dbcc	    movepw	  subqw
andb	      dbcs	    movepl	  subql
andw	      dbeq	    moveq	  subxb
andl	      dbf	    muls	  subxw
aslb	      dbra	    mulu	  subxl
aslw	      dbge	    nbcd	  svc
asll	      dbgt	    negb	  svs
asrb	      dbhi	    negw	  swap
asrw	      dble	    negl	  tas
asrl	      dbls	    negxb	  trap
bcc	      dblt	    negxw	  trapv
bccs	      dbmi	    negxl	  tstb
bchg	      dbne	    nop		  tstw
bclr	      dbpl	    notb	  tstl
bcs	      dbt	    notw	  unlk
bcss	      dbvc	    notl
beq	      dbvs	    orb
beqs	      divs	    orw
bge	      divu	    orl
bges	      eorb	    pea
bgt	      eorw	    reset
bgts	      eorl	    rolb
bhi	      exg	    rolw
bhis	      extw	    roll
ble	      extl	    rorb
bles	      jbsr	    rorw
bls	      jcc	    rorl
blss	      jcs	    roxlb
blt	      jeq	    roxlw
blts	      jge	    roxll
bmi	      jgt	    roxrb
bmis	      jhi	    roxrw
bne	      jle	    roxrl
bnes	      jls	    rte
bpl	      jlt	    rtr
bpls	      jmi	    rts
bra	      jmp	    sbcd
bras	      jne	    scc
bset	      jpl	    scs
bsr	      jra	    seq
bsrs	      jsr	    sf
btst	      jvc	    sge
bvc	      jvs	    sgt
bvcs	      lea	    shi
bvs	      link	    sle
bvss	      lslb	    sls
chk	      lslw	    slt



				Pseudo-ops

=		direct assignment
.end		end of file (optional)
.long		long datum
.word		word datum
.byte		byte datum
.macro		define macro
.rept		repeat following
.ascii
.asciz
.blkb
.blkw
.blkl
.list
.nlist
.insrt
.text		following goes in text area
.data		following goes in data area
.bss		following goes in bss area
.globl		argument is global symbol
.comm		argument 1 is bss symbol; set aside arg 2 bytes for it
.radix		set input radix (default decimal)
.typef
.printf		print arg in listing
.error		announce error
.page		listing skips to new page
.defrs
.even		align to word boundary
.if		conditional
.ift		if true
.iff		if false

				Expression Syntax

Expressions are parenthesized with [ ] and may use any of the following  C
operators, 
+ - * / & ! ^ << >> %
Association is left to right and there is no precedence.

Hexadecimal constants are preceded with '/', decimal are followed with '.'
(redundant unless the pseudo-op '.radix' is used since the default radix for
integers is decimal).  We plan to convert soon to an MIT revision of the
assembler in which all constants are written using C conventions; thus /f00d
becomes 0xf00d.

A vertical bar (|) begins a comment, which continues to the end of the line.

Legal address forms are as follows.  N stands for any expression, I for an
integer from 0 to 7, all other characters stand for themselves. sp may be used
in place of a7.

N			Absolute address
dI			Data register direct
aI			Address register direct
aI@			Indirect
aI@(N)			Indirect with Displacement
aI@+			Indirect with Postincrement
aI@-			Indirect with Predecrement
aI@(N,rI:s)		Indirect with Index (reg r = d or a, size s = w or l)
pc@(N)			Program Counter with Displacement
pc@(N,rI:s)		Prog Ctr with Index (reg r = d or a, size s = w or l)
sr			status register
cc			condition code register (right half of sr)
usp			user stack pointer (can only move to and from aI)
#N			immediate data
its cleanly to the monitor.
.PP
The following options are interpreted by
.IR cc .
See
.IR ld68 (1)
for load-time options.
.TP 8
.B \-d
Produce a .dl file suitable for downloading with the MACSBUG monitor of the
Motorola Design Module, cf.
.IR dl68 (1).
.TP
.B \-r
Produce a .r file suitable for direct loading by the 68000, cf.
.IR rev68 (1).
.TP
.B \-c
Suppress the loading phase of the compilation, and force
an object file to be produced even if only one prsumacc/man/macget.1   444      0     12        4243  3470501433   7400 .TH MACGET local "31 July 1984"
.UC 4
.SH NAME
macget \- receive file from macintosh via modem7/macterminal
.SH SYNOPSIS
.B macget
[
.B \-rdu
] [file]
.SH DESCRIPTION
.I Macget
receives a file from a Macintosh running MacTerminal.
The File Transfer settings should specify the "Modem7"
transfer method and a "MacTerminal" remote system.
This program is designed for use with the 0.5 Beta and newer
versions of MacTerminal, but includes a compatibility option for the
older -0.15X Almost-Alpha version.
.PP
To use this program, log into the unix system using MacTerminal,
start macget with the desired options, select "Send File..." from
the "File" menu, and open the file you wish to send.
If MacTerminal is properly configured, it will put up an indicator
showing how much of the file has been transfered.
Several Control-X's may be used to force macget
to give up if the transfer fails.
.PP
The optional 
.I file
parameter specifies the name to use when creating the unix files,
otherwise the Mac file name is used
(with spaces converted to underscores).
.PP
If none of the
.B \-rdu
flags are specified, 
.I macget 
receives three files from the Mac:
.IB file .info ,
.IB file .data ,
and
.IB file .rsrc .
This mode is useful for storing Mac files so they can
be restored later using
.IR macput .
.PP
The
.B \-r
flag specifies 
.I resource
mode.
Only 
.IB file .rsrc
will be created, from the Mac file's resource fork.
.PP
The
.B \-d
flag specifies 
.I data
mode.
Only
.IB file .data
will be created, containing the data fork of the Mac file.
.PP
The 
.B \-u
flag requests 
.I unix
mode, in which carriage returns are converted into
unix newline characters, and the unix file
.IB file .text
is created.
A file saved from Mac applications as "text only" can be transfered
using this option to convert it to a normal unix text file.
.PP
The 
.B \-o
flag specifies "old" (version -0.15X) MacTerminal compatibility mode.
You must manually disable XON/XOFF flow control in this version to
perform file transfer; this is done automatically in the newer versions.
.SH SEE ALSO
macput(local)
.SH BUGS
Doesn't work over flow controlled communication lines,
or when using rlogin.
.SH AUTHOR
Dave Johnson, Brown 7/31/84
  We plan to convert soon to an MIT revision of the
assembler in which all constants are written using C conventions; thus /f00d
becomes 0xf00d.

A vertical bar (|) begins a comment, which continues to the end of the line.

Legal address forms are as follows.  N stands for any expression, I for an
integer from 0 to 7, all other characters stand fosumacc/man/macput.1   444      0     12        5304  3470501433   7430 .TH MACPUT local "31 July 1984"
.UC 4
.SH NAME
macput \- send file to macintosh via modem7/macterminal
.SH SYNOPSIS
.B macput
file
.br
.B macput
[
.B \-rdu
] file
[
.B \-t
type
]
[
.B \-a
author
]
[
.B \-n
name
]
.SH DESCRIPTION
.I Macput
sends a file to a Macintosh running MacTerminal.
The File Transfer settings should specify the "Modem7"
transfer method and a "MacTerminal" remote system.
This program is designed for use with the 0.5 Beta and newer
versions of MacTerminal, but includes a compatibility option for the
older -0.15X Almost-Alpha version.
.PP
To use this program, log into the unix system using MacTerminal,
and run macput specifying the desired options and one file to be sent.
If MacTerminal is properly configured, it will recognize that a file
is arriving on the serial line and put up an indicator showing how
much of the file has been sent.
Several Control-X's may be used to force macput
to give up if the transfer fails.
.PP
If none of the
.B \-rdu
flags are specified, 
.I macput 
sends three files to the mac:
.IB file .info ,
.IB file .data ,
and
.IB file .rsrc .
This is useful for returning files to the mac which were stored
using macget.
.PP
The
.B \-r
flag specifies 
.I resource
mode.
Either
.IB file .rsrc
or
.I file
will be sent to the Mac, along with a forged
.B .info
file and an empty 
.B .data
file.
The file sent becomes the resource fork of the Mac file.
.PP
The
.B \-d
flag specifies 
.I data
mode.
Either
.IB file .data
,
.IB file .text
or
.I file
will be sent to the Mac, along with a forged
.B .info
file and an empty 
.B .rsrc
file.
The file sent becomes the data fork of the Mac file.
.PP
The 
.B \-u
flag requests 
.I unix
mode, which is the same as 
.I data
mode except unix newline characters are converted
into carriage returns.
Human-readable unix text files sent to the Mac using this option 
will be compatible with applications which expect "text only" files.
.PP
The 
.B \-o
flag specifies "old" (version -0.15X) MacTerminal compatibility mode.
You must manually disable XON/XOFF flow control in this version to
perform file transfer; this is done automatically in the newer versions.
.PP
The remaining options serve to override the default
file type, author, and file name to be used on the Mac.
The default type and author for 
.I resource
mode are "APPL" and "CCOM".
.I data
mode defaults are "TEXT", "????", and 
.I unix
mode defaults are "TEXT" and "MACA".
.SH SEE ALSO
macget(local)
.SH BUGS
Doesn't work over flow controlled communication lines,
or when using rlogin.
.PP
Doesn't set the bundle bit on resource files,
to incorporate any icons into the Desk Top.
Use setfile to set the bundle bit.
.SH FEATURES
Properly initializes the Creation Date.
.SH AUTHOR
Dave Johnson, Brown 7/31/84
.
Either
.IB file .rsrc
or
.I file
will be sent to the Mac, along with a forged
.B .info
file and an empty 
.B .data
file.
The file sent becomes the resource fork of the Mac file.
.PP
The
.B \-d
flag specifies 
.I data
mode.
Either
.IB file .data
,
.IB file .text
or
.I file
will be sent to the Mac, along with a forsumacc/man/kermit.1   444      0     12       20055  3470501434   7453 .tr ~ \ 
.TH KERMIT 1 local
.SH NAME
kermit \- file transfer, virt. terminal over tty link
.SH SYNOPSIS
.BR "kermit c" [ lbe ]
.RI [ line ]
.RI [ baud ]
.RI [ esc  ]
.PP
.BR "kermit r" [ ddilb ]
.RI [ line ]
.RI [ baud ]
.PP
.BR "kermit s" [ ddilb ]
.RI [ line ]
.RI [ baud ]
.IR file ~...
.SH DESCRIPTION
.I Kermit
provides reliable file transfer and primitive virtual terminal communication
between machines.  It has been implemented on many different computers,
including microprocessors (see below).  The files transferred may be
arbitrary ASCII data (7-bit characters) and may be of any length.  The file
transfer protocol uses small (96 character) checksummed packets, with
ACK/NACK responses and timeouts.  \fIKermit\fR currently uses a five
second timeout and ten retries.
.PP
The arguments to \fIkermit\fR are a set of flags (no spaces between the
flags), three optional args (which, if included, must be in the same
order as the flags which indicate their presence), and, if this is a
Send operation a list of one or more files.  (It is similar in some way
to the \fItar\fR command structure).
.PP
.I Kermit
has three modes, Connect, Send, and Receive.  The first is for a virtual
terminal connection, the other two for file transfer.  These modes are
specified by the first flag, which should be
.BR c ,~ s ", or " r ,
respectively.  Exactly one mode must be specified.
.PP
The \fBd\fR flag (debug) makes \fIkermit\fR a bit more verbose.  The
states \fIkermit\fR goes through are printed along with other traces of
it's operation.  A second \fBd\fR flag will cause \fIkermit\fR to give
an even more detailed trace.
.PP
The \fBi\fR flag (image) allows slightly more efficient file transfer
between Unix machines.  Normally (on Kermits defined to run on Unix
systems) newline is mapped to CRLF on output, CR's are discarded on
input, and bytes are masked to 7 bits.  If this is set, no mapping is
done on newlines, and all eight bits of each byte are sent or received.
This is the default for non-Unix kermits.
.PP
The \fBl\fR flag (line) specifies the tty line that \fIkermit\fR should
use to communicate with the other machine.  This is specified as a
regular filename, like "/dev/ttyh1".  If no \fBl\fR option is specified,
standard input is used and \fIkermit\fR assumes it is running on the
remote host (ie. NOT the machine to which your terminal is attached).
.PP
The \fBb\fR flag (baud) sets the baud rate on the line specified by the
\fBl\fR flag.  No changes are made if the \fBb\fR flag is not used.
Legal speeds are: 110, 150, 300, 1200, 2400, 4800, 9600.  Note that this
version of \fIkermit\fR supports this option on Unix systems only.
.PP
The \fBe\fR flag (escape) allows the user to set the first character of
the two character escape sequence for Connect mode.  When the escape
character is typed, \fIkermit\fR will hold it and wait for the next
character.  If the next character is \fBc\fR or \fBC\fR, \fIkermit\fR
will close the connection with the remote host.  If the second character
is the same as the escape character, the escape character itself is
passed.  Any character other than these two results in a bell being sent
to the user's terminal and no characters passwd to the remote host.  All
other typed characters are passed through unchanged.
The default escape character is '^'.
.PP
The file arguments are only meaningful to a Send \fIkermit\fR.  The
Receiving \fIkermit\fR will attempt to store the file with the
same name that was used to send it.  Unix \fIkermit\fRs normally convert
outgoing file names to uppercase and incoming ones to lower case (see
the \fBf\fR flag).  If a filename contains a slash (/) all outgoing
kermits will strip off the leading part of the name through the last
slash.
.SH EXAMPLE
For this example we will assume two Unix machines.  We are logged onto
"unixa" (the local machine), and want to communicate with "unixb" (the
remote machine).  There is a modem on "/dev/tty03".
.PP
We want to connect to "unixb", then transfer "file1" to that machine.
.sp 1
We type:   kermit clb /dev/tty03 1200
.sp 1
Kermit answers:   Kermit: connected...
.sp 1
Now we dial the remote machine and connect the modem.  Anything typed on
the terminal will be sent to the remote machine and any output from that
machine will be displayed on our terminal.  We hit RETURN, get a
"login:" prompt and login.
.PP
Now we need to start a \fIkermit\fR on the remote machine so that we can
send the file over.  First we start up the remote, (in this case
receiving) \fIkermit\fR, then the local, (sending) one.  Remember that
we are talking to unixb right now.
.PP
We type:   kermit r
.br
	(there is now a Receive \fIkermit\fR on unixb)
.PP
We type ^ (the escape character) and then \fBc\fR to kill the local
(Connecting) \fIkermit\fR.
.PP
Kermit answers:   Kermit: disconnected.
.PP
We type:   kermit slb /dev/tty03 1200 file1
.PP
Kermit answers:	Sending file1 as FILE1
.PP
When the transmission is finished, \fIkermit\fR will type either "Send
complete", or "Send failed.", depending on the success of the transfer.
If we now wanted to transfer a file from unixb (remote) to unixa
(local), we would use these commands:
.PP
	kermit clb /dev/tty03 1200
.br
	~~(connected to unixb)
.br
	kermit s file9
.br
	^c (up-arrow c not control-c)
.br
	~~(talking to unixa again)
.br
	kermit rl /dev/tty03 1200
.PP
After all the transfers were done, we should connect again, log off
of unixb, kill the Connect \fIkermit\fR and hang up the phone.
.PP
Detail on other implementations and on the protocol is given in
the \fIKermit Users Guide\fR, and the \fIKermit Protocol Handbook\fR.
.SH FEATURES
\fIKermit\fR can interact strangely with the tty driver.  In particular,
a tty with "hangup on last close" set (stty hup), will reset to 300 Baud
between \fIkermit\fR commands.  It will also hang up a modem at that
time.  It is better to run with "stty -hup", and use "stty 0" to
explicitly hang up the modem.
.PP
The KERMIT Protocol uses only printing ASCII characters,
Ctrl-A, and CRLF.  Ctrl-S/Ctrl-Q flow control can be used "underneath"
the Kermit protocol (TANDEM line discipline on Berkeley Unix).
.PP
Since BREAK is not an ASCII character, \fIkermit\fR cannot send a BREAK
to the remote machine.  On some systems, a BREAK will be read as a NUL.
.PP
This \fIkermit\fR does have timeouts when run under Unix, so the
protocol is stable when communicating with "dumb" kermits (that don't
have timeouts).
.SH OTHER IMPLEMENTATIONS
.I Kermits
have been written for TOPS-20, TOPS-10, IBM VM/CMS, Unix, VAX/VMS,
RT-11, MS-DOS, CP/M, and Apple DOS.  The Unix \fIkermit\fR in use
at Ford Aerospace has been tested on v6/PWB, v7, Onyx System III,
Bell System V, and Berkeley 4.1.  More information is given in the
\fIKermit Users Guide\fR.
.SH SEE ALSO
stty(1)
.PP
\fIKermit Users Guide\fR, Fourth Edition (4 May 83), Frank da Cruz,
Daphne Tzoar, Bill Catchings
.PP
\fIKermit Protocol Manual\fR, Protocol Version 3 (29 April 83), Frank da Cruz,
Bill Catchings
.PP
Both of the above documents are from the Columbia University Center for
Computing Activities, New York, New York, 10027.
.SH AUTHORS
KERMIT kernel by Bill Catchings, Columbia University Center for Computing
Activities
.PP
KERMIT-Unix adaptation by Chris Maio and Bob Cattani, Columbia University
Computer Science Dept.
.PP
Local mods for v6, System III, and System V by Walter Underwood.  Includes
bug fixes from Jim Guyton at RAND-Unix.
.SH DIAGNOSTICS
.IP "cannot open \fIdevice\fR"
The file named in the \fIline\fR argument did not exist or had the wrong
permissions.
.IP "bad line speed"
The \fIbaud\fR argument was not a legal speed.
.IP "Could not create \fIfile\fR"
A Receive \fIkermit\fR could not create the file being sent to it.
.IP "nothing to connect to"
A Connect \fIkermit\fR was started without a \fIline\fR argument.
.SH BUGS AND CAVEATS
There is no locking on the use of the outgoing line.  Several users
could run \fIkermit\fR (or anything else) on the line simultaneously.
.PP
The acronym (\fIK\fRL10 \fIE\fRrror-free \fIR\fReciprocal
\fIM\fRicro \fII\fRnterconnect over \fIT\fRTY lines) is charming,
but strained.
.PP
This implementation does not send or process error-message packets.
.PP
Eight-bit quoting is not implemented.
chine and connect the modem.  Anything typed on
the terminal will be sent to the remote machine and any output from that
machine will be displayed on our terminal.  We hit RETURN, get a
"login:" prompt and login.
.PP
Now we need to start a \fIkermit\fR on the remote machine so that we can
send the file over.  First we start up the remote, (in this case
receiving) \fIkermit\fR, then the local, (sending) one.  Remember that
we are talking to unixb right now.
.PP
Wesumacc/man/rmaker.1   444      0     12        2744  3470501434   7426 .TH RMAKER local "10/20/84"
.UC 4
.SH NAME
rmaker \- resource maker (compiler) for Macintosh
.SH SYNOPSIS
.B rmaker
file.rc
.br
.B rmaker
[
.B \-d
type
] file.rc
.SH DESCRIPTION
.I Rmaker
reads an ascii resource compiler input file "file.rc" and 
produces a Macintosh executable binary "file.rsrc".
See the Inside Mac manual "Putting Together a Macintosh Application"
for a description of this format and process.
It is also helpful to look at one of the example '.rc' files in
the SUMacC 'mac/' source directory.
.PP
Most of the commonly used resource types are implemented:
STR, HEXA, CODE, DRVR, ALRT, DITL, DLOG, WIND,
MENU, CNTL, ICON, CURS, PAT, INIT and PACK.
See the BUGS section below for exceptions.
.PP
The optional \-d (debug) switch will list out in hex the contents
of all resources matching that four letter type.
.SH SEE ALSO
"Putting Together a Macintosh Application"
.SH BUGS
If you have more than one resource of the same type, they must all
be grouped together in the file, and each resource must begin with the "Type"
statement.  
.PP
Types NOT implemented:  ICN#, PAT#, STR#, FREF, BNDL, FONT, GNRL.
You can always use an "inherited type" of HEXA (e.g. Type BNDL = HEXA)
to simulate unimplemented types.  GNRL would be even better for this
(if someone would only implement it!)
.PP
If you get the message "impossible relocation", it usually means your
b.out had some undefined external references;  check the error output
from 'ld', you probably misspelled some global or routine name.
MacC 'mac/' source directorysumacc/libc/   775      0     12           0  3472710613   6134 sumacc/libc/math/   775      0     12           0  3472710603   7064 sumacc/libc/math/README   444      0     12         215  3472473656  10021 These are a bunch of math routines stolen from MIT NU
terminal software.  Only the sin.c module has been tested.
	-- Bill Nowicki March 1982
EXA (e.g. Type BNDL = HEXA)
to simulate unimplemented types.  GNRL would be even better for this
(if someone would only implement it!)
.PP
If you get the message "impossible relocation", it usually means your
b.out had some undefined external references;  check the error output
from 'ld', you probably misspelled some global or routine name.
MacC 'mac/' source directorysumacc/libc/math/asin.c   444      0     12        1246  3472473656  10264 /*
	asin(arg) and acos(arg) return the arcsin, arccos,
	respectively of their arguments.

	Arctan is called after appropriate range reduction.
*/

#include	<errno.h>
int errno;
double atan();
double sqrt();
static double pio2	= 1.570796326794896619;

double
asin(arg) double arg; {

	double sign, temp;

	sign = 1.;
	if(arg <0){
		arg = -arg;
		sign = -1.;
	}

	if(arg > 1.){
		errno = EDOM;
		return(0.);
	}

	temp = sqrt(1. - arg*arg);
	if(arg > 0.7)
		temp = pio2 - atan(temp/arg);
	else
		temp = atan(arg/temp);

	return(sign*temp);
}

double
acos(arg) double arg; {

	if(arg < 0)
		arg = -arg;

	if(arg > 1.){
		errno = EDOM;
		return(0.);
	}

	return(pio2 - asin(arg));
}
S section below for exceptions.
.PP
The optional \-d (debug) switch will list out in hex the contents
of all resources matching that four letter type.
.SH SEE ALSO
"Putting Together a Macintosh Application"
.SH BUGS
If you have more than one resource of the same type, they must all
be grouped together in the file, and each resource must begin wsumacc/libc/math/atan.c   444      0     12        4357  3472473656  10263 
/*
	floating-point arctangent

	atan returns the value of the arctangent of its
	argument in the range [-pi/2,pi/2].

	atan2 returns the arctangent of arg1/arg2
	in the range [-pi,pi].

	there are no error returns.

	coefficients are #5077 from Hart & Cheney. (19.56D)
*/


static double sq2p1	 =2.414213562373095048802e0;
static double sq2m1	 = .414213562373095048802e0;
static double pio2	 =1.570796326794896619231e0;
static double pio4	 = .785398163397448309615e0;
static double atanp4	 = .161536412982230228262e2;
static double atanp3	 = .26842548195503973794141e3;
static double atanp2	 = .11530293515404850115428136e4;
static double atanp1	 = .178040631643319697105464587e4;
static double atanp0	 = .89678597403663861959987488e3;
static double atanq4	 = .5895697050844462222791e2;
static double atanq3	 = .536265374031215315104235e3;
static double atanq2	 = .16667838148816337184521798e4;
static double atanq1	 = .207933497444540981287275926e4;
static double atanq0	 = .89678597403663861962481162e3;


/*
	atan makes its argument positive and
	calls the inner routine satan.
*/

double
atan(arg)
double arg;
{
	double satan();

	if(arg>0)
		return(satan(arg));
	else
		return(-satan(-arg));
}


/*
	atan2 discovers what quadrant the angle
	is in and calls atan.
*/

double
atan2(arg1,arg2)
double arg1,arg2;
{
	double satan();

	if((arg1+arg2)==arg1)
		if(arg1 >= 0.) return(pio2);
		else return(-pio2);
	else if(arg2 <0.)
		if(arg1 >= 0.)
			return(pio2+pio2 - satan(-arg1/arg2));
		else
			return(-pio2-pio2 + satan(arg1/arg2));
	else if(arg1>0)
		return(satan(arg1/arg2));
	else
		return(-satan(-arg1/arg2));
}

/*
	satan reduces its argument (known to be positive)
	to the range [0,0.414...] and calls xatan.
*/

double
satan(arg)
double arg;
{
	double	xatan();

	if(arg < sq2m1)
		return(xatan(arg));
	else if(arg > sq2p1)
		return(pio2 - xatan(1.0/arg));
	else
		return(pio4 + xatan((arg-1.0)/(arg+1.0)));
}

/*
	xatan evaluates a series valid in the
	range [-0.414...,+0.414...].
*/

double
xatan(arg)
double arg;
{
	double argsq;
	double value;

	argsq = arg*arg;
	value = ((((atanp4*argsq + atanp3)*argsq + atanp2)*argsq + atanp1)*argsq + atanp0);
	value = value/(((((argsq + atanq4)*argsq + atanq3)*argsq + atanq2)*argsq + atanq1)*argsq + atanq0);
	return(value*arg);
}
 prompt and login.
.PP
Now we need to start a \fIkermit\fR on the remote machine so that we can
send the file over.  First we start up the remote, (in this case
receiving) \fIkermit\fR, then the local, (sending) one.  Remember that
we are talking to unixb right now.
.PP
Wesumacc/libc/math/exp.c   444      0     12        2070  3472473656  10122 /*
	exp returns the exponential function of its
	floating-point argument.

	The coefficients are #1069 from Hart and Cheney. (22.35D)
*/

#include <errno.h>
#include <math.h>

int	errno;
static double	expp0	= .2080384346694663001443843411e7;
static double	expp1	= .3028697169744036299076048876e5;
static double	expp2	= .6061485330061080841615584556e2;
static double	expq0	= .6002720360238832528230907598e7;
static double	expq1	= .3277251518082914423057964422e6;
static double	expq2	= .1749287689093076403844945335e4;
static double	log2e	= 1.4426950408889634073599247;
static double	sqrt2	= 1.4142135623730950488016887;
static double	maxf	= 10000;

double
exp(arg)
double arg;
{
	double fract;
	double temp1, temp2, xsq;
	int ent;

	if(arg == 0.)
		return(1.);
	if(arg < -maxf)
		return(0.);
	if(arg > maxf) {
		errno = ERANGE;
		return(HUGE);
	}
	arg *= log2e;
	ent = floor(arg);
	fract = (arg-ent) - 0.5;
	xsq = fract*fract;
	temp1 = ((expp2*xsq+expp1)*xsq+expp0)*fract;
	temp2 = ((1.0*xsq+expq2)*xsq+expq1)*xsq + expq0;
	return(ldexp(sqrt2*(temp2+temp1)/(temp2-temp1), ent));
}
3;
static double atanp2	 = .11530293515404850115428136e4;
static double atanp1	 = .178040631643319697105464587e4;
static double atanp0	 = .89678597403663861959987488e3;
static double atanq4	 = .5895697050844462222791e2;
static double atanq3	 = .536265374031215315104235e3;
static double atanq2	 = .16667838148816337184521798e4;
static double atanq1	 = .207933497444540981287275926e4;
static double atanq0	 = .89678597403663861962481162e3;


/*
	atan makes sumacc/libc/math/fabs.c   444      0     12         114  3472473657  10217 double
fabs(arg)
double arg;
{

	if(arg < 0.)
		arg = -arg;
	return(arg);
}
= 1.4142135623730950488016887;
static double	maxf	= 10000;

double
exp(arg)
double arg;
{
	double fract;
	double temp1, temp2, xsq;
	int ent;

	if(arg == 0.)
		return(1.);
	if(arg < -maxf)
		return(0.);
	if(arg > maxf) {
		errno = ERANGE;
		return(HUGE);
	}
	arg *= log2e;
	ent = floor(arg);
	fract = (arg-ent) - 0.5;
	xsq = fract*fract;
	temp1 = ((expp2*xsq+expp1)*xsq+expp0)*fract;
	temp2 = ((1.0*xsq+expq2)*xsq+expq1)*xsq + expq0;
	rsumacc/libc/math/floor.c   444      0     12         463  3472473657  10434 /*
 * floor and ceil-- greatest integer <= arg
 * (resp least >=)
 */

double	modf();

double
floor(d)
double d;
{
	double fract;

	if (d<0.0) {
		d = -d;
		fract = modf(d, &d);
		if (fract != 0.0)
			d += 1;
		d = -d;
	} else
		modf(d, &d);
	return(d);
}

double
ceil(d)
double d;
{
	return(-floor(-d));
}
ERANGE;
		return(HUGE);
	}
	arg *= log2e;
	ent = floor(arg);
	fract = (arg-ent) - 0.5;
	xsq = fract*fract;
	temp1 = ((expp2*xsq+expp1)*xsq+expp0)*fract;
	temp2 = ((1.0*xsq+expq2)*xsq+expq1)*xsq + expq0;
	rsumacc/libc/math/hypot.c   444      0     12         670  3472473657  10456 /*
 * sqrt(a^2 + b^2)
 *	(but carefully)
 */

double sqrt();
double
hypot(a,b)
double a,b;
{
	double t;
	if(a<0) a = -a;
	if(b<0) b = -b;
	if(a > b) {
		t = a;
		a = b;
		b = t;
	}
	if(b==0) return(0.);
	a /= b;
	/*
	 * pathological overflow possible
	 * in the next line.
	 */
	return(b*sqrt(1. + a*a));
}

struct	complex
{
	double	r;
	double	i;
};

double
cabs(arg)
struct complex arg;
{
	double hypot();

	return(hypot(arg.r, arg.i));
}
)*xsq+expp0)*fract;
	temp2 = ((1.0*xsq+expq2)*xsq+expq1)*xsq + expq0;
	rsumacc/libc/math/j0.c   444      0     12       10450  3472473657   7661 /*
	floating point Bessel's function
	of the first and second kinds
	of order zero

	j0(x) returns the value of J0(x)
	for all real values of x.

	There are no error returns.
	Calls sin, cos, sqrt.

	There is a niggling bug in J0 which
	causes errors up to 2e-16 for x in the
	interval [-8,8].
	The bug is caused by an inappropriate order
	of summation of the series.  rhm will fix it
	someday.

	Coefficients are from Hart & Cheney.
	#5849 (19.22D)
	#6549 (19.25D)
	#6949 (19.41D)

	y0(x) returns the value of Y0(x)
	for positive real values of x.
	For x<=0, error number EDOM is set and a
	large negative value is returned.

	Calls sin, cos, sqrt, log, j0.

	The values of Y0 have not been checked
	to more than ten places.

	Coefficients are from Hart & Cheney.
	#6245 (18.78D)
	#6549 (19.25D)
	#6949 (19.41D)
 	
  Fixed to compile with V7 syntax by Bill Nowicki March 1982

*/

#include <math.h>
#include <errno.h>

int	errno;
double pzero, qzero;
static double tpi	= .6366197723675813430755350535e0;
static double pio4	= .7853981633974483096156608458e0;
static double j0p1[] = {
	0.4933787251794133561816813446e21,
	-.1179157629107610536038440800e21,
	0.6382059341072356562289432465e19,
	-.1367620353088171386865416609e18,
	0.1434354939140344111664316553e16,
	-.8085222034853793871199468171e13,
	0.2507158285536881945555156435e11,
	-.4050412371833132706360663322e8,
	0.2685786856980014981415848441e5,
};
static double j0q1[] = {
	0.4933787251794133562113278438e21,
	0.5428918384092285160200195092e19,
	0.3024635616709462698627330784e17,
	0.1127756739679798507056031594e15,
	0.3123043114941213172572469442e12,
	0.6699987672982239671814028660e9,
	0.1114636098462985378182402543e7,
	0.1363063652328970604442810507e4,
	1.0
};
static double j0p2[] = {
	0.5393485083869438325262122897e7,
	0.1233238476817638145232406055e8,
	0.8413041456550439208464315611e7,
	0.2016135283049983642487182349e7,
	0.1539826532623911470917825993e6,
	0.2485271928957404011288128951e4,
	0.0,
};
static double j0q2[] = {
	0.5393485083869438325560444960e7,
	0.1233831022786324960844856182e8,
	0.8426449050629797331554404810e7,
	0.2025066801570134013891035236e7,
	0.1560017276940030940592769933e6,
	0.2615700736920839685159081813e4,
	1.0,
};
static double j0p3[] = {
	-.3984617357595222463506790588e4,
	-.1038141698748464093880530341e5,
	-.8239066313485606568803548860e4,
	-.2365956170779108192723612816e4,
	-.2262630641933704113967255053e3,
	-.4887199395841261531199129300e1,
	0.0,
};
static double j0q3[] = {
	0.2550155108860942382983170882e6,
	0.6667454239319826986004038103e6,
	0.5332913634216897168722255057e6,
	0.1560213206679291652539287109e6,
	0.1570489191515395519392882766e5,
	0.4087714673983499223402830260e3,
	1.0,
};
static double j0p4[] = {
	-.2750286678629109583701933175e20,
	0.6587473275719554925999402049e20,
	-.5247065581112764941297350814e19,
	0.1375624316399344078571335453e18,
	-.1648605817185729473122082537e16,
	0.1025520859686394284509167421e14,
	-.3436371222979040378171030138e11,
	0.5915213465686889654273830069e8,
	-.4137035497933148554125235152e5,
};
static double j0q4[] = {
	0.3726458838986165881989980e21,
	0.4192417043410839973904769661e19,
	0.2392883043499781857439356652e17,
	0.9162038034075185262489147968e14,
	0.2613065755041081249568482092e12,
	0.5795122640700729537480087915e9,
	0.1001702641288906265666651753e7,
	0.1282452772478993804176329391e4,
	1.0,
};

double
j0(arg) double arg;{
	double argsq, n, d;
	double sin(), cos(), sqrt();
	int i;

	if(arg < 0.) arg = -arg;
	if(arg > 8.){
		asympt(arg);
		n = arg - pio4;
		return(sqrt(tpi/arg)*(pzero*cos(n) - qzero*sin(n)));
	}
	argsq = arg*arg;
	for(n=0,d=0,i=8;i>=0;i--){
		n = n*argsq + j0p1[i];
		d = d*argsq + j0q1[i];
	}
	return(n/d);
}

double
y0(arg) double arg;{
	double argsq, n, d;
	double sin(), cos(), sqrt(), log(), j0();
	int i;

	errno = 0;
	if(arg <= 0.){
		errno = EDOM;
		return(-HUGE);
	}
	if(arg > 8.){
		asympt(arg);
		n = arg - pio4;
		return(sqrt(tpi/arg)*(pzero*sin(n) + qzero*cos(n)));
	}
	argsq = arg*arg;
	for(n=0,d=0,i=8;i>=0;i--){
		n = n*argsq + j0p4[i];
		d = d*argsq + j0q4[i];
	}
	return(n/d + tpi*j0(arg)*log(arg));
}

static
asympt(arg) double arg;{
	double zsq, n, d;
	int i;
	zsq = 64./(arg*arg);
	for(n=0,d=0,i=6;i>=0;i--){
		n = n*zsq + j0p2[i];
		d = d*zsq + j0q2[i];
	}
	pzero = n/d;
	for(n=0,d=0,i=6;i>=0;i--){
		n = n*zsq + j0p3[i];
		d = d*zsq + j0q3[i];
	}
	qzero = (8./arg)*(n/d);
}
41D)
 	
  Fixed to compile with V7 syntax by Bill Nowicki March 1982

*/

#include <math.h>
#include <errno.h>

int	errno;
double pzero, qzero;
static double tpi	= .6366197723675813430755350535e0;
static double pio4	sumacc/libc/math/j1.c   444      0     12       10424  3472473657   7663 /*
	floating point Bessel's function
	of the first and second kinds
	of order one

	j1(x) returns the value of J1(x)
	for all real values of x.

	There are no error returns.
	Calls sin, cos, sqrt.

	There is a niggling bug in J1 which
	causes errors up to 2e-16 for x in the
	interval [-8,8].
	The bug is caused by an inappropriate order
	of summation of the series.  rhm will fix it
	someday.

	Coefficients are from Hart & Cheney.
	#6050 (20.98D)
	#6750 (19.19D)
	#7150 (19.35D)

	y1(x) returns the value of Y1(x)
	for positive real values of x.
	For x<=0, error number EDOM is set and a
	large negative value is returned.

	Calls sin, cos, sqrt, log, j1.

	The values of Y1 have not been checked
	to more than ten places.

	Coefficients are from Hart & Cheney.
	#6447 (22.18D)
	#6750 (19.19D)
	#7150 (19.35D)
*/

#include <math.h>
#include <errno.h>

int	errno;
static double pzero, qzero;
static double tpi	= .6366197723675813430755350535e0;
static double pio4	= .7853981633974483096156608458e0;
static double p1[] = {
	0.581199354001606143928050809e21,
	-.6672106568924916298020941484e20,
	0.2316433580634002297931815435e19,
	-.3588817569910106050743641413e17,
	0.2908795263834775409737601689e15,
	-.1322983480332126453125473247e13,
	0.3413234182301700539091292655e10,
	-.4695753530642995859767162166e7,
	0.2701122710892323414856790990e4,
};
static double q1[] = {
	0.1162398708003212287858529400e22,
	0.1185770712190320999837113348e20,
	0.6092061398917521746105196863e17,
	0.2081661221307607351240184229e15,
	0.5243710262167649715406728642e12,
	0.1013863514358673989967045588e10,
	0.1501793594998585505921097578e7,
	0.1606931573481487801970916749e4,
	1.0,
};
static double p2[] = {
	-.4435757816794127857114720794e7,
	-.9942246505077641195658377899e7,
	-.6603373248364939109255245434e7,
	-.1523529351181137383255105722e7,
	-.1098240554345934672737413139e6,
	-.1611616644324610116477412898e4,
	0.0,
};
static double q2[] = {
	-.4435757816794127856828016962e7,
	-.9934124389934585658967556309e7,
	-.6585339479723087072826915069e7,
	-.1511809506634160881644546358e7,
	-.1072638599110382011903063867e6,
	-.1455009440190496182453565068e4,
	1.0,
};
static double p3[] = {
	0.3322091340985722351859704442e5,
	0.8514516067533570196555001171e5,
	0.6617883658127083517939992166e5,
	0.1849426287322386679652009819e5,
	0.1706375429020768002061283546e4,
	0.3526513384663603218592175580e2,
	0.0,
};
static double q3[] = {
	0.7087128194102874357377502472e6,
	0.1819458042243997298924553839e7,
	0.1419460669603720892855755253e7,
	0.4002944358226697511708610813e6,
	0.3789022974577220264142952256e5,
	0.8638367769604990967475517183e3,
	1.0,
};
static double p4[] = {
	-.9963753424306922225996744354e23,
	0.2655473831434854326894248968e23,
	-.1212297555414509577913561535e22,
	0.2193107339917797592111427556e20,
	-.1965887462722140658820322248e18,
	0.9569930239921683481121552788e15,
	-.2580681702194450950541426399e13,
	0.3639488548124002058278999428e10,
	-.2108847540133123652824139923e7,
	0.0,
};
static double q4[] = {
	0.5082067366941243245314424152e24,
	0.5435310377188854170800653097e22,
	0.2954987935897148674290758119e20,
	0.1082258259408819552553850180e18,
	0.2976632125647276729292742282e15,
	0.6465340881265275571961681500e12,
	0.1128686837169442121732366891e10,
	0.1563282754899580604737366452e7,
	0.1612361029677000859332072312e4,
	1.0,
};

double
j1(arg) double arg;{
	double xsq, n, d, x;
	double sin(), cos(), sqrt();
	int i;

	x = arg;
	if(x < 0.) x = -x;
	if(x > 8.){
		asympt(x);
		n = x - 3.*pio4;
		n = sqrt(tpi/x)*(pzero*cos(n) - qzero*sin(n));
		if(arg <0.) n = -n;
		return(n);
	}
	xsq = x*x;
	for(n=0,d=0,i=8;i>=0;i--){
		n = n*xsq + p1[i];
		d = d*xsq + q1[i];
	}
	return(arg*n/d);
}

double
y1(arg) double arg;{
	double xsq, n, d, x;
	double sin(), cos(), sqrt(), log(), j1();
	int i;

	errno = 0;
	x = arg;
	if(x <= 0.){
		errno = EDOM;
		return(-HUGE);
	}
	if(x > 8.){
		asympt(x);
		n = x - 3*pio4;
		return(sqrt(tpi/x)*(pzero*sin(n) + qzero*cos(n)));
	}
	xsq = x*x;
	for(n=0,d=0,i=9;i>=0;i--){
		n = n*xsq + p4[i];
		d = d*xsq + q4[i];
	}
	return(x*n/d + tpi*(j1(x)*log(x)-1./x));
}

static
asympt(arg) double arg;{
	double zsq, n, d;
	int i;
	zsq = 64./(arg*arg);
	for(n=0,d=0,i=6;i>=0;i--){
		n = n*zsq + p2[i];
		d = d*zsq + q2[i];
	}
	pzero = n/d;
	for(n=0,d=0,i=6;i>=0;i--){
		n = n*zsq + p3[i];
		d = d*zsq + q3[i];
	}
	qzero = (8./arg)*(n/d);
}
383255105722e7,
	-.1098240554345934672737413139e6,
	-.1611616644324610116477412898e4,
	0.0,
};
static double q2[] = {
	-.4435757816794127856828016962e7,
	-.9934124389934585658967556309e7,
	-.6585339479723087072826915069e7,
	-.1511809506sumacc/libc/math/jn.c   444      0     12        3254  3472473657   7743 /*
	floating point Bessel's function of
	the first and second kinds and of
	integer order.

	int n;
	double x;
	jn(n,x);

	returns the value of Jn(x) for all
	integer values of n and all real values
	of x.

	There are no error returns.
	Calls j0, j1.

	For n=0, j0(x) is called,
	for n=1, j1(x) is called,
	for n<x, forward recursion us used starting
	from values of j0(x) and j1(x).
	for n>x, a continued fraction approximation to
	j(n,x)/j(n-1,x) is evaluated and then backward
	recursion is used starting from a supposed value
	for j(n,x). The resulting value of j(0,x) is
	compared with the actual value to correct the
	supposed value of j(n,x).

	yn(n,x) is similar in all respects, except
	that forward recursion is used for all
	values of n>1.
*/

#include <math.h>
#include <errno.h>

int	errno;

double
jn(n,x) int n; double x;{
	int i;
	double a, b, temp;
	double xsq, t;
	double j0(), j1();

	if(n<0){
		n = -n;
		x = -x;
	}
	if(n==0) return(j0(x));
	if(n==1) return(j1(x));
	if(x == 0.) return(0.);
	if(n>x) goto recurs;

	a = j0(x);
	b = j1(x);
	for(i=1;i<n;i++){
		temp = b;
		b = (2.*i/x)*b - a;
		a = temp;
	}
	return(b);

recurs:
	xsq = x*x;
	for(t=0,i=n+16;i>n;i--){
		t = xsq/(2.*i - t);
	}
	t = x/(2.*n-t);

	a = t;
	b = 1;
	for(i=n-1;i>0;i--){
		temp = b;
		b = (2.*i/x)*b - a;
		a = temp;
	}
	return(t*j0(x)/b);
}

double
yn(n,x) int n; double x;{
	int i;
	int sign;
	double a, b, temp;
	double y0(), y1();

	if (x <= 0) {
		errno = EDOM;
		return(-HUGE);
	}
	sign = 1;
	if(n<0){
		n = -n;
		if(n%2 == 1) sign = -1;
	}
	if(n==0) return(y0(x));
	if(n==1) return(sign*y1(x));

	a = y0(x);
	b = y1(x);
	for(i=1;i<n;i++){
		temp = b;
		b = (2.*i/x)*b - a;
		a = temp;
	}
	return(sign*b);
}
s of n and all real values
	of x.

	There are no error returns.
	Calls j0, j1.

	For n=0, j0(x) is called,
	for n=1, j1(x) is called,
	for n<x, forward recursion us used starting
	from values of j0(x) and j1(x).
	for n>x, a continued fraction approximation to
	j(n,x)/j(n-1,x) is evaluated and then backward
	recursion is used starting fromsumacc/libc/math/log.c   444      0     12        2131  3472473657  10106 /*
	log returns the natural logarithm of its floating
	point argument.

	The coefficients are #2705 from Hart & Cheney. (19.38D)

	It calls frexp.
*/

#include <errno.h>
#include <math.h>

int	errno;
double	frexp();
static double	log2	= 0.693147180559945309e0;
static double	ln10	= 2.302585092994045684;
static double	sqrto2	= 0.707106781186547524e0;
static double	p0	= -.240139179559210510e2;
static double	p1	= 0.309572928215376501e2;
static double	p2	= -.963769093368686593e1;
static double	p3	= 0.421087371217979714e0;
static double	q0	= -.120069589779605255e2;
static double	q1	= 0.194809660700889731e2;
static double	q2	= -.891110902798312337e1;

double
log(arg)
double arg;
{
	double x,z, zsq, temp;
	int exp;

	if(arg <= 0.) {
		errno = EDOM;
		return(-HUGE);
	}
	x = frexp(arg,&exp);
	while(x<0.5) {
		x = x*2;
		exp = exp-1;
	}
	if(x<sqrto2) {
		x = 2*x;
		exp = exp-1;
	}

	z = (x-1)/(x+1);
	zsq = z*z;

	temp = ((p3*zsq + p2)*zsq + p1)*zsq + p0;
	temp = temp/(((1.0*zsq + q2)*zsq + q1)*zsq + q0);
	temp = temp*z + exp*log2;
	return(temp);
}

double
log10(arg)
double arg;
{

	return(log(arg)/ln10);
}
a = temp;
	}
	return(b);

recurs:
	xsq = x*x;
	for(t=0,i=n+16;i>n;i--){
		t = xsq/(2.*i - t);
	}
	t = x/(2.*n-t);

	a = t;
	b = 1;
	for(i=n-1;i>0;i--){
		temp = b;
		b = (2.*i/x)*b - a;
		a = temp;
	}
	return(t*j0(x)/b);
}

double
yn(n,x) int n; double x;{
	int i;
	int sign;
	double a, b, temp;
	double y0(), y1();

	if (x <= 0) {
		errno = EDOM;
		return(-HUGE);
	}
	sign = 1;
	if(n<0){
		n = -n;
		if(n%2 == 1) sign = -1sumacc/libc/math/makefile   444      0     12        1155  3472473657  10666 # makefile for the math library
# Bill Nowicki March 1982
.SUFFIXES: .b .c .s

mathlib: asin.b atan.b hypot.b jn.b j0.b j1.b pow.b fabs.b \
  log.b sin.b sqrt.b tan.b tanh.b sinh.b exp.b floor.b

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .s file from a .c file

.c.s:
	cc68 -O -S $*.c

test:  asin.s atan.s hypot.s jn.s j0.s j1.s pow.s fabs.s \
  log.s sin.s sqrt.s tan.s tanh.s sinh.s exp.s floor.s

clean:
	rm -f *.b *.s *CKP *BAK

# old stuff
libm.a: \
asin.b atan.b \
hypot.b jn.b \
j0.b j1.b \
pow.b fabs.b \
log.b \
sin.b \
sqrt.b \
tan.b \
tanh.b \
sinh.b \
exp.b \
floor.b



e	q2	= -.891110902798312337e1;

double
log(arg)
double arg;
{
	double x,z, zsq, temp;
	int exp;

	if(arg <= 0.) {
		errno = EDOM;
		return(-HUGE);
	}
	x = frexp(arg,&exp);
	while(x<0.5) {
		x = x*2;
		exp = exp-1;
	}
	if(x<sqrto2) {
		x = 2*x;
		exp = exp-1;
	}

	z = (x-1)/(x+1);
	zsq = z*z;

	temp = ((p3*zsq + p2)*zsq + p1)*zsq + p0;
	temp = temp/(((1.0*zsq + q2)*zsq + q1)*zsq + q0);
	temp = temp*z sumacc/libc/math/pow.c   444      0     12         676  3472473660  10120 /*
	computes a^b.
	uses log and exp
*/

#include	<errno.h>
int errno;
double log(), exp();

double
pow(arg1,arg2)
double arg1, arg2;
{
	double temp;
	long l;

	if(arg1 <= 0.) {
		if(arg1 == 0.) {
			if(arg2 <= 0.)
				goto domain;
			return(0.);
		}
		l = arg2;
		if(l != arg2)
			goto domain;
		temp = exp(arg2 * log(-arg1));
		if(l & 1)
			temp = -temp;
		return(temp);
	}
	return(exp(arg2 * log(arg1)));

domain:
	errno = EDOM;
	return(0.);
}
rm -f *.b *.s *CKP *BAK

# old stuff
libm.a: \
asin.b atan.b \
hypsumacc/libc/math/sin.c   444      0     12        2515  3472473660  10116 /*
	C program for floating point sin/cos.
	Calls modf.
	There are no error exits.
	Coefficients are #3370 from Hart & Cheney (18.80D).
*/

static double twoopi	= 0.63661977236758134308;
static double p0	=  .1357884097877375669092680e8;
static double p1	= -.4942908100902844161158627e7;
static double p2	=  .4401030535375266501944918e6;
static double p3	= -.1384727249982452873054457e5;
static double p4	=  .1459688406665768722226959e3;
static double q0	=  .8644558652922534429915149e7;
static double q1	=  .4081792252343299749395779e6;
static double q2	=  .9463096101538208180571257e4;
static double q3	=  .1326534908786136358911494e3;

double
cos(arg)
double arg;
{
	double sinus();
	if(arg<0)
		arg = -arg;
	return(sinus(arg, 1));
}

double
sin(arg)
double arg;
{
	double sinus();
	return(sinus(arg, 0));
}

double
sinus(arg, quad)
double arg;
int quad;
{
	double modf();
	double e, f;
	double ysq;
	double x,y;
	int k;
	double temp1, temp2;

	x = arg;
	if(x<0) {
		x = -x;
		quad = quad + 2;
	}
	x = x*twoopi;	/*underflow?*/
	if(x>32764){
		y = modf(x,&e);
		e = e + quad;
		modf(0.25*e,&f);
		quad = e - 4*f;
	}else{
		k = x;
		y = x - k;
		quad = (quad + k) & 03;
	}
	if (quad & 01)
		y = 1-y;
	if(quad > 1)
		y = -y;

	ysq = y*y;
	temp1 = ((((p4*ysq+p3)*ysq+p2)*ysq+p1)*ysq+p0)*y;
	temp2 = ((((ysq+q3)*ysq+q2)*ysq+q1)*ysq+q0);
	return(temp1/temp2);
}
; double x;{
	int i;
	int sign;
	double a, b, temp;
	double y0(), y1();

	if (x <= 0) {
		errno = EDOM;
		return(-HUGE);
	}
	sign = 1;
	if(n<0){
		n = -n;
		if(n%2 == 1) sign = -1sumacc/libc/math/sinh.c   444      0     12        2451  3472473660  10265 /*
	sinh(arg) returns the hyperbolic sine of its floating-
	point argument.

	The exponential function is called for arguments
	greater in magnitude than 0.5.

	A series is used for arguments smaller in magnitude than 0.5.
	The coefficients are #2029 from Hart & Cheney. (20.36D)

	cosh(arg) is computed from the exponential function for
	all arguments.
*/

double	exp();

static double p0  = -0.6307673640497716991184787251e+6;
static double p1  = -0.8991272022039509355398013511e+5;
static double p2  = -0.2894211355989563807284660366e+4;
static double p3  = -0.2630563213397497062819489e+2;
static double q0  = -0.6307673640497716991212077277e+6;
static double q1   = 0.1521517378790019070696485176e+5;
static double q2  = -0.173678953558233699533450911e+3;

double
sinh(arg)
double arg;
{
	double temp, argsq;
	register sign;

	sign = 1;
	if(arg < 0) {
		arg = - arg;
		sign = -1;
	}

	if(arg > 21.) {
		temp = exp(arg)/2;
		if (sign>0)
			return(temp);
		else
			return(-temp);
	}

	if(arg > 0.5) {
		return(sign*(exp(arg) - exp(-arg))/2);
	}

	argsq = arg*arg;
	temp = (((p3*argsq+p2)*argsq+p1)*argsq+p0)*arg;
	temp /= (((argsq+q2)*argsq+q1)*argsq+q0);
	return(sign*temp);
}

double
cosh(arg)
double arg;
{
	if(arg < 0)
		arg = - arg;
	if(arg > 21.) {
		return(exp(arg)/2);
	}

	return((exp(arg) + exp(-arg))/2);
}

double
sinus(arg, quad)
double arg;
int quad;
{
	double modf();
	double e, f;
	double ysq;
	double x,y;
	int k;
	double temp1, temp2;

	x = arg;
	if(x<0) {
		x = -x;
		quad = quad + 2;
	}
	x = x*twoopi;	/*underflowsumacc/libc/math/sqrt.c   444      0     12        1300  3472473660  10305 /*
	sqrt returns the square root of its floating
	point argument. Newton's method.

	calls frexp
*/

#include <errno.h>

int errno;
double frexp();

double
sqrt(arg)
double arg;
{
	double x, temp;
	int exp;
	int i;

	if(arg <= 0.) {
		if(arg < 0.)
			errno = EDOM;
		return(0.);
	}
	x = frexp(arg,&exp);
	while(x < 0.5) {
		x *= 2;
		exp--;
	}
	/*
	 * NOTE
	 * this wont work on 1's comp
	 */
	if(exp & 1) {
		x *= 2;
		exp--;
	}
	temp = 0.5*(1.0+x);

	while(exp > 60) {
		temp *= (1L<<30);
		exp -= 60;
	}
	while(exp < -60) {
		temp /= (1L<<30);
		exp += 60;
	}
	if(exp >= 0)
		temp *= 1L << (exp/2);
	else
		temp /= 1L << (-exp/2);
	for(i=0; i<=4; i++)
		temp = 0.5*(temp + arg/temp);
	return(temp);
}
(arg < 0)
		arg = - arg;
	if(arg > 21.) {
		return(exp(arg)/2);
	}

	return((exp(arg) + exp(-arg))/2);
}

double
sinus(arg, quad)
double arg;
int quad;
{
	double modf();
	double e, f;
	double ysq;
	double x,y;
	int k;
	double temp1, temp2;

	x = arg;
	if(x<0) {
		x = -x;
		quad = quad + 2;
	}
	x = x*twoopi;	/*underflowsumacc/libc/math/tan.c   444      0     12        2461  3472473660  10107 /*
	floating point tangent

	A series is used after range reduction.
	Coefficients are #4285 from Hart & Cheney. (19.74D)
*/

#include <errno.h>
#include <math.h>

int	errno;
static double invpi	  = 1.27323954473516268;
static double p0	 = -0.1306820264754825668269611177e+5;
static double p1	  = 0.1055970901714953193602353981e+4;
static double p2	 = -0.1550685653483266376941705728e+2;
static double p3	  = 0.3422554387241003435328470489e-1;
static double p4	  = 0.3386638642677172096076369e-4;
static double q0	 = -0.1663895238947119001851464661e+5;
static double q1	  = 0.4765751362916483698926655581e+4;
static double q2	 = -0.1555033164031709966900124574e+3;

double
tan(arg)
double arg;
{
	double modf();
	double sign, temp, e, x, xsq;
	int flag, i;

	flag = 0;
	sign = 1.;
	if(arg < 0.){
		arg = -arg;
		sign = -1.;
	}
	arg = arg*invpi;   /*overflow?*/
	x = modf(arg,&e);
	i = e;
	switch(i%4) {
	case 1:
		x = 1. - x;
		flag = 1;
		break;

	case 2:
		sign = - sign;
		flag = 1;
		break;

	case 3:
		x = 1. - x;
		sign = - sign;
		break;

	case 0:
		break;
	}

	xsq = x*x;
	temp = ((((p4*xsq+p3)*xsq+p2)*xsq+p1)*xsq+p0)*x;
	temp = temp/(((1.0*xsq+q2)*xsq+q1)*xsq+q0);

	if(flag == 1) {
		if(temp == 0.) {
			errno = ERANGE;
			if (sign>0)
				return(HUGE);
			return(-HUGE);
		}
		temp = 1./temp;
	}
	return(sign*temp);
}
0901714953193602353981e+4;
static double p2	 = -0.1550685653483266376941705728e+2;
static double p3	  = 0.3422554387241003435328470489e-1;
static double p4	  = 0.3386638642677172096076369e-4;
static double qsumacc/libc/math/tanh.c   444      0     12         570  3472473660  10236 /*
	tanh(arg) computes the hyperbolic tangent of its floating
	point argument.

	sinh and cosh are called except for large arguments, which
	would cause overflow improperly.
*/

double sinh(), cosh();

double
tanh(arg)
double arg;
{
	double sign;

	sign = 1.;
	if(arg < 0.){
		arg = -arg;
		sign = -1.;
	}

	if(arg > 21.)
		return(sign);

	return(sign*sinh(arg)/cosh(arg));
}
1705728e+2;
static double p3	  = 0.3422554387241003435328470489e-1;
static double p4	  = 0.3386638642677172096076369e-4;
static double qsumacc/libc/crt/   775      0     12           0  3472710575   6733 sumacc/libc/crt/abort.s   444      0     12         110  3472473662  10262 |C library -- abort

	.globl	abort
	.text
abort:
	trap	#1
	clrl	d0
	rts
ument.

	sinh and cosh are called except for large arguments, which
	would cause overflow improperly.
*/

double sinh(), cosh();

double
tanh(arg)
double arg;
{
	double sign;

	sign = 1.;
	if(arg < 0.){
		arg = -arg;
		sign = -1.;
	}

	if(arg > 21.)
		return(sign);

	return(sign*sinh(arg)/cosh(arg));
}
1705728e+2;
static double p3	  = 0.3422554387241003435328470489e-1;
static double p4	  = 0.3386638642677172096076369e-4;
static double qsumacc/libc/crt/aldiv.s   555      0     12        3134  3472473662  10306 |J. Test	1/81
|addressed signed long division: *dividend = *dividend/divisor

	.globl	aldiv
	.text

aldiv:	link	a6,#0
	moveml	#/3C00,sp@-	|need d2,d3,d4,d5 registers
	movl	#1.,d5		|sign of result
	movl	a6@(8.),a0	|a0 = dividend pointer
	movl	a0@,d0		|d0 = dividend
	jge	1$
	negl	d0
	negl	d5
1$:	movl	d0,d3		|save positive dividend
	movl	a6@(12.),d1	|divisor
	jge	2$
	negl	d1
	negl	d5
2$:	movl	d1,d4		|save positive divisor

	cmpl	#/10000,d1	|divisor < 2 ** 16?
	jge	3$		|no, divisor must be < 2 ** 16
	clrw	d0		|yes, divide dividend
	swap	d0		|  by 2 ** 16
	divu	d1,d0		|get the high order bits of quotient
	movw	d0,d2		|save quotient high
	movw	d3,d0		|dividend low + remainder*(2**16)
	divu	d1,d0		|get quotient low
	swap	d0		|temporarily save quotient low in high
	movw	d2,d0		|restore quotient high to low part of register
	swap	d0		|put things right
	jra	5$		|return

3$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|assure positive
	andl	#/7FFFFFFF,d1	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	jge	3$		|no, continue shift
	divu	d1,d0		|yes, divide, remainder is garbage
	andl	#/FFFF,d0	|get rid of remainder
	movl	d0,d2		|save quotient
	movl	d0,sp@-		|call ulmul with quotient
	movl	d4,sp@-		|  and saved divisor on stack
	jsr	ulmul		|  as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d3		|original dividend >= lmul result?
	jge	4$		|yes, quotient should be correct
	subql	#1,d2		|no, fix up quotient
4$:	movl	d2,d0		|move quotient to d0

5$:	tstl	d5		|sign of result
	jge	6$
	negl	d0
6$:	movl	d0,a0@		|store result via pointer
	moveml	sp@+,#/3C	|restore registers
	unlk	a6
	rts
lse{
		k = x;
		y = x - k;
		quad = (quad + k) & 03;
	}
	if (quad & 01)
		y = 1-y;
	if(quad > 1)
		y = -y;

	ysq = y*y;
	temp1 = ((((p4*ysq+p3)*ysq+p2)*ysq+p1)*ysq+p0)*y;
	temp2 = ((((ysq+q3)*ysq+q2)*ysq+q1)*ysq+q0);
	return(temp1/temp2);
}
; double x;{
	int i;
	int sign;
	double a, b, temp;
	double y0(), y1();

	if (x <= 0) {
		errno = EDOM;
		return(-HUGE);
	}
	sign = 1;
	if(n<0){
		n = -n;
		if(n%2 == 1) sign = -1sumacc/libc/crt/almul.s   555      0     12        1500  3472473663  10315 |J. Test	1/81
|addressed signed long multiply routine: *a = *a * b

	.globl	almul
	.text

almul:	link	a6,#0
	moveml	#/3800,sp@-	|save d2,d3,d4
	movl	#1.,d4		|sign of result
	movl	a6@(8.),a0	|a0 = pointer to a
	movl	a0@,d2		|d2 = a
	bge	1$
	negl	d2
	negl	d4
1$:	movl	a6@(12.),d3	|d3 = b
	bge	2$
	negl	d3
	negl	d4

2$:	clrl	d0
	movw	d2,d0		|d0 = alo, unsigned
	mulu	d3,d0		|d0 = blo*alo, unsigned
	movw	d2,d1		|d1 = alo
	swap	d2		|swap alo-ahi
	mulu	d3,d2		|d2 = blo*ahi, unsigned
	swap	d3		|swap blo-bhi
	mulu	d3,d1		|d1 = bhi*alo, unsigned
	addl	d2,d1		|d1 = (ahi*blo + alo*bhi)
	swap	d1		|d1 =
	clrw	d1		|   (ahi*blo + alo*bhi)*(2**16)
	addl	d1,d0		|d0 = alo*blo + (ahi*blo + alo*bhi)*(2**16)
	tstl	d4		|sign of result
	bge	3$
	negl	d0

3$:	movl	d0,a0@		|store result via pointer
	moveml	sp@+,#/1C	|restore d2,d3,d4
	unlk	a6
	rts

nal dividend >= lmul result?
	jge	4$		|yes, quotient should be correct
	subql	#1,d2		|no, fix up quotient
4$:	movl	d2,d0		|move quotient to d0

5$:	tstl	d5		|sign of result
	jge	6$
	negl	d0
6$sumacc/libc/crt/alrem.s   444      0     12        2550  3472473663  10306 |J. Test	1/81
|addressed signed long remainder: *dividend = *dividend % divisor

	.globl	alrem
	.text

alrem:	link	a6,#0
	moveml	#/3800,sp@-	|need d2,d3,d4 registers
	movl	#1.,d4		|sign of result
	movl	a6@(8.),a0	|a0 = dividend pointer
	movl	a0@,d0		|dividend
	bge	1$
	negl	d0
	negl	d4
1$:	movl	d0,d2		|save positive dividend
	movl	a6@(12.),d1	|divisor
	bge	2$
	negl	d1

2$:	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	3$		|no, divisor must be < 2 ** 16
	clrw	d0		|d0 =
	swap	d0		|   dividend high
	divu	d1,d0		|yes, divide
	movw	d2,d0		|d0 = remainder high + quotient low
	divu	d1,d0		|divide
	clrw	d0		|d0 = 
	swap	d0		|   remainder
	bra	6$		|return

3$:	movl	d1,d3		|save divisor
4$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|assure positive
	andl	#/7FFFFFFF,d1	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	4$		|no, continue shift
	divu	d1,d0		|yes, divide
	andl	#/FFFF,d0	|erase remainder
	movl	d0,sp@-		|call ulmul with quotient
	movl	d3,sp@-		|  and saved divisor on stack
	jsr	ulmul		|  as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d2		|original dividend >= lmul result?
	jge	5$		|yes, quotient should be correct
	subl	d3,d0		|no, fixup 
5$:	subl	d2,d0		|calculate
	negl	d0		|  remainder

6$:	tstl	d4		|sign of result
	bge	7$
	negl	d0
7$:	movl	d0,a0@		|write result via pointer
	moveml	sp@+,#/1C	|restore registers
	unlk	a6
	rts

es, quotient should be correct
	subql	#1,d2		|no, fix up quotient
4$:	movl	d2,d0		|move quotient to d0

5$:	tstl	d5		|sign of result
	jge	6$
	negl	d0
6$sumacc/libc/crt/auldiv.s   555      0     12        2707  3472473663  10501 |J. Test	1/81
|addressed unsigned long division: *dividend = *dividend / divisor

	.globl	auldiv
	.text

auldiv:	link	a6,#0
	moveml	#/3800,sp@-	|need d2,d3,d4 registers
	movl	a6@(8.),a0	|a0 = dividend pointer
	movl	a0@,d0		|d0 = dividend
	movl	d0,d3		|save dividend
	movl	a6@(12.),d1	|divisor
	movl	d1,d4		|save divisor

	cmpl	#/10000,d1	|divisor >= 2 ** 16?
	jge	1$		|yes, divisor must be < 2 ** 16
	clrw	d0		|divide dividend
	swap	d0		|  by 2 ** 16
	divu	d1,d0		|get the high order bits of quotient
	movw	d0,d2		|save quotient high
	movw	d3,d0		|dividend low + remainder * (2**16)
	divu	d1,d0		|get quotient low
	swap	d0		|temporarily save quotient low in high
	movw	d2,d0		|restore quotient high to low part of register
	swap	d0		|put things right
	jra	3$		|return

1$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|assure positive
	andl	#/7FFFFFFF,d1	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	jge	1$		|no, continue shift
	divu	d1,d0		|yes, divide, remainder is garbage
	andl	#/FFFF,d0	|get rid of remainder
	movl	d0,d2		|save quotient
	movl	d0,sp@-		|call ulmul with quotient
	movl	d4,sp@-		|  and saved divisor on stack
	jsr	ulmul		|  as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d3		|original dividend >= lmul result?
	jge	2$		|yes, quotient should be correct
	subql	#1,d2		|no, fix up quotient
2$:	movl	d2,d0		|move quotient to d0

3$:	movl	d0,a0@		|store result via pointer
	moveml	sp@+,#/1C	|restore registers
	unlk	a6
	rts

}
	sign = 1;
	if(n<0){
		n = -n;
		if(n%2 == 1) sign = -1sumacc/libc/crt/aulmul.s   555      0     12        1262  3472473663  10507 |J. Test	1/81
|addressed unsigned long multiply: *a = *a * b

	.globl	aulmul
	.text

aulmul:	link	a6,#0
	moveml	#/3000,sp@-	|save d2,d3
	movl	a6@(8.),a0	|a0 = pointer to a
	movl	a0@,d2		|d2 = a
	movl	a6@(12.),d3	|d3 = b

	clrl	d0
	movw	d2,d0		|d0 = alo, unsigned
	mulu	d3,d0		|d0 = blo*alo, unsigned
	movw	d2,d1		|d1 = alo
	swap	d2		|swap alo-ahi
	mulu	d3,d2		|d2 = blo*ahi, unsigned
	swap	d3		|swap blo-bhi
	mulu	d3,d1		|d1 = bhi*alo, unsigned
	addl	d2,d1		|d1 = (ahi*blo + alo*bhi)
	swap	d1		|d1 =
	clrw	d1		|   (ahi*blo + alo*bhi)*(2**16)
	addl	d1,d0		|d0 = alo*blo + (ahi*blo + alo*bhi)*(2**16)

	movl	d0,a0@		|store result via pointer
3$:	moveml	sp@+,#/C	|restore d2,d3
	unlk	a6
	rts

a0@,d2		|d2 = a
	movl	a6@(12.),d3	|d3 = b

	clrl	d0
	movw	d2,d0		|d0 = alo, unsigned
	mulu	d3,d0		|d0 = blo*alo, unsigned
	movw	d2,d1		|d1 = alo
	swap	d2		|swap alo-ahi
	mulu	d3,d2		|d2 = blo*ahi, unsigned
	swap	d3		|swap blo-bhi
	mulu	d3,d1		|d1 = bhi*alo, unsigned
	addl	d2,d1		|d1 = (ahi*blo + alo*bhi)
	swap	d1		|d1 =
	clrw	d1		| sumacc/libc/crt/aulrem.s   444      0     12        2353  3472473663  10474 |J. Test	1/81
|addressed unsigned long remainder: *dividend = *dividend % divisor

	.globl	aulrem
	.text

aulrem:	link	a6,#0
	moveml	#/3000,sp@-	|need d2,d3 registers
	movl	a6@(8.),a0	|a0 = dividend pointer
	movl	a0@,d0		|d0 = dividend
	movl	d0,d2		|save dividend
	movl	a6@(12.),d1	|divisor

	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	1$		|no, divisor must be < 2 ** 16
	clrw	d0		|d0 =
	swap	d0		|   dividend high
	divu	d1,d0		|yes, divide
	movw	d2,d0		|d0 = remainder high + quotient low
	divu	d1,d0		|divide
	clrw	d0		|d0 = 
	swap	d0		|   remainder
	bra	4$		|return

1$:	movl	d1,d3		|save divisor
2$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|assure positive
	andl	#/7FFFFFFF,d1	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	2$		|no, continue shift
	divu	d1,d0		|yes, divide
	andl	#/FFFF,d0	|erase remainder
	movl	d0,sp@-		|call ulmul with quotient
	movl	d3,sp@-		|  and saved divisor on stack
	jsr	ulmul		|  as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d2		|original dividend >= lmul result?
	jge	3$		|yes, quotient should be correct
	subl	d3,d0		|no, fixup 
3$:	subl	d2,d0		|calculate
	negl	d0		|  remainder

4$:	movl	d0,a0@		|store result through pointer
	moveml	sp@+,#/C	|restore registers
	unlk	a6
	rts

l result?
	jge	2$		|yes, quotient should be correct
	subql	#1,d2		|no, fix up quotient
2$:	movl	d2,d0		|move quotient to d0

3$:	movl	d0,a0@		|store result via pointer
	moveml	sp@+,#/1C	|restore registers
	unlk	a6
	rts

}
	sign = 1;
	if(n<0){
		n = -n;
		if(n%2 == 1) sign = -1sumacc/libc/crt/float.s   444      0     12       40135  3472473663  10334 |J. Test	3/81
|floating point routines for Nu(MC68000)

				|offsets in internal float structure
SIGN	= 0				|sign
EXPT	= 2				|exponent (-127/+127)
MANH	= 4				|high mantissa
MANL	= 8				|low mantissa

	.data
afloat:				|internal-a floating representation
a_sign:	.word	0
a_expt:	.word	0
a_manh:	.long	0
a_manl:	.long	0

bfloat:				|internal-b floating representation
b_sign:	.word	0
b_expt:	.word	0
b_manh:	.long	0
b_manl:	.long	0

lsum:				|storage for multiply
	.word	0
	.long	0			|high part of accumulated sum
	.long	0			|low part of accumulated sum
	.word	0

	
|
|convert external float to internal format
|d0,d1 contain the external float
|a0 points to afloat or bfloat
|
	.text
etoi:
	clrw	a0@			|clear sign
	tstl	d0			|test sign of external
	bge	1$			|set sign 0(+), 1(-)
	movw	#1,a0@

1$:	movl	d1,a0@(MANL)		|save low 32 bits of mantissa
	movl	d0,d1
	andl	#0x7FFFFF,d1
	orl	#0x800000,d1		|add hidden high order bit
	movl	d1,a0@(MANH)		|save high 1+23 bits of mantissa
	swap	d0
	asrl	#7,d0
	andw	#0xFF,d0		|isolate exponent
	bne	2$
	clrl	a0@			|zero sign, exponent,
	clrl	a0@(MANH)		|  high mantissa, and
	clrl	a0@(MANL)		|  low mantissa
	rts

2$:	subw	#128,d0			|convert from excess 0200
	movw	d0,a0@(EXPT)		|store converted value
	rts				|done

|
|convert internal format to external float
|a0 points to afloat or bfloat
|external float returned in d0,d1
|
	.text
itoe:
	clrl	d0
	movw	a0@(EXPT),d0		|get exponent
	addw	#128,d0			|convert to excess 0200
	bne	1$			|if exponent is zero
	clrl	d1			|  clear d0,d1
	rts				|  and return

1$:	tstw	a0@			|set sign
	beq	2$			|sign bit 0(+), 1(-)
	orw	#0x100,d0

2$:	swap	d0			|align sign and exponent
	asll	#7,d0			|  in high part of d0
	movl	a0@(MANH),d1		|get high part of mantissa
	bne	3$			|check for zero mantissa
	clrl	d0			|if zero - clear sign and
	rts				|  exponent and return

3$:	andl	#0x7FFFFF,d1		|delete high order hidden bit
	orl	d1,d0			|put high 23 bits of mantissa
	movl	a0@(MANL),d1		|put low 32 bits of mantissa
	rts				|done

|
|normalize internal float by adjusting exponent and
|shifting  mantissa appropriately so 1/2 <= mnt < 1
|a0 points to afloat or bfloat
|
	.text
normal:
	jsr	offset			|determine amount to shift
	addw	d0,a0@(EXPT)		|adjust exponent
	jsr	shift			|shift mantissa
	rts

|
|determine position of most significant bit of
|mantissa in relation to normalized decimal point
|a0 points to afloat or bfloat
|d0 returns offset of msb from decimal point
|
	.text
offset:
	moveq	#1,d0
	movl	a0@(MANH),d1		|check for high order bits
	bne	2$
	movl	a0@(MANL),d1		|check low order bits
	bne	1$
	clrw	d0			|zero shift count
	rts

1$:	subw	#32,d0			|need to shift at least 23
2$:	subqw	#1,d0			|find most significant bit
	asll	#1,d1
	bcc	2$
	addqw	#8,d0			|d0 contains exponent correction
	rts

|
|shift mantissa according to offset in d0
|a0 points to afloat or bfloat
|d0 contains shift count, <0 -> left shift, >0 -> right shift
|on return, d1 = 0, d2,d3 have shifted mantissa
|
	.text
shift:
	clrl	d1
	movl	a0@(MANH),d2		|d2 = high part of mantissa
	movl	a0@(MANL),d3		|d3 = low part of mantissa
	movw	d0,d1			|examine exponent correction
	bmi	2$			|shift left
	bne	1$			|shift right
	rts				|no shift - return

1$:	asrl	#1,d2			|shift entire mantissa
	roxrl	#1,d3			|  right by one bit
	subqw	#1,d1			|repeat until count
	bne	1$			|  is zero
	andl	#0xFFFFFF,d2		|zero top byte
	bra	shifte			|return

2$:	asll	#1,d3			|shift entire mantissa
	roxll	#1,d2			|  left by one bit
	addqw	#1,d1			|repeat until count
	bne	2$			|  is zero
	
shifte:	movl	d2,a0@(MANH)		|store high part of mantissa
	movl	d3,a0@(MANL)		|store low part of mantissa
	rts				|done
	
|
|fetch floating arguments off stack
|convert to internal format in afloat and bfloat
|on return, a0 points to afloat, a1 points to bfloat
|
getargs:
	movl	#bfloat,a1		|a1 points to bfloat
	tstw	d0			|branch to 1$ for
	bne	1$			|  indirect argument fetch
	movl	a6@(16),d0		|b-high
	movl	a6@(20),d1		|b-low
	movl	a1,a0			|setup a0 for conversion
	jsr	etoi			|convert b-arg to internal form
	movl	a6@(8),d0		|a-high
	movl	a6@(12),d1		|a-low
	movl	#afloat,a0		|a0 points to afloat
	jsr	etoi			|convert a-arg to internal form
	rts
1$:	movl	a6@(12),d0		|b-high
	movl	a6@(16),d1		|b-low
	movl	a1,a0			|setup a0 for conversion
	jsr	etoi			|convert b-arg to internal form
	movl	a6@(8),a0		|a0 points to a-arg
	movl	a0@+,d0			|a-high
	movl	a0@,d1			|a-low
	movl	#afloat,a0		|a0 points to afloat
	jsr	etoi			|convert a-arg to internal form
	rts	

	.globl	fltused
	.text
fltused:
	rts				|simply define fltused

|
|free exponent returning fractional value
|
	.globl	frexp
	.text
frexp:
	link	a6,#0
	movl	#afloat,a0		|a0 points to afloat
	movl	a6@(8),d0		|a-high
	movl	a6@(12),d1		|a-low
	movl	a6@(16),a1		|place to return exponent
	jsr	etoi			|convert to internal form
	movw	a0@(EXPT),d0		|get unbiased exponent
	extl	d0			|  convert to long and
	movl	d0,a1@			|  return value
	clrw	a0@(EXPT)		|set exponent for fractional
	jsr	itoe			|  value, convert for return
	unlk	a6
	rts

|
|add/load exponent of float
|
	.globl	ldexp
	.text
ldexp:
	link	a6,#0
	movl	#afloat,a0		|a0 points to afloat
	movl	a6@(8),d0		|a-high
	movl	a6@(12),d1		|a-low
	jsr	etoi			|convert to internal form
	movl	a6@(16),d0		|add argument
	addw	d0,a0@(EXPT)		|  to exponent
	jsr	itoe			|convert and return
	unlk	a6
	rts


|
|separate integer/fractional parts of float
|
	.globl	modf
	.text
modf:
	link	a6,#0
	moveml	#0x3800,sp@-		|save d2,d3,d4
	movl	a6@(8),d0		|a-high
	movl	a6@(12),d1		|a-low
	movl	#afloat,a0		|a0 -> afloat = fractional
	jsr	etoi			|  part on return
	movl	#bfloat,a1		|a1 -> bfloat = integer part on return
	movw	a0@,a1@			|copy signs
	movw	a0@(EXPT),d4		|if exponent > 0
	bgt	1$			|  separate integer/fractional
	movw	#-128,a1@(EXPT)		|else integer part = 0
	movl	a1,a0			|  convert integer part first
	bra	modfe			|  no need to separate

1$:	movw	d4,a1@(EXPT)		|set integer exponent
	clrw	a0@(EXPT)		|set fractional exponent
	cmpw	#56,d4			|if shift count is < 56
	blt	2$			|  shift mantissa
	movl	a0@(MANL),a1@(MANL)	|else move mantissa to integer
	movl	a0@(MANH),a1@(MANH)	|  part and set fractional
	movw	#-128,a0@(EXPT)		|  part = 0
	movl	a1,a0			|convert decimal part first
	bra	modfe			|  on exit from modf

2$:	moveq	#-8,d0			|shift mantissa left
	jsr	shift			|  by 8 for alignment
	clrl	d0
3$:	asll	#1,d3			|rotate d0<--d1<--d2<--d3
	roxll	#1,d2			|  registers until shift
	roxll	#1,d1			|  count = 0
	roxll	#1,d0
	subqw	#1,d4
	bne	3$
	movl	d3,a0@(MANL)		|save fractional components
	movl	d2,a0@(MANH)		|  of mantissa
	movl	d1,a1@(MANL)		|save integer components
	movl	d0,a1@(MANH)		|  of mantissa
	jsr	normal			|align fractional part
	subqw	#8,a0@(EXPT)		|  and adjust exponent
	movl	a1,a0			|align integer part at
	jsr	offset			|  decimal point without
	jsr	shift			|  altering exponent

modfe:	movl	a6@(16),a1		|get pointer argument
	jsr	itoe			|convert integer part
	movl	d0,a1@+			|  store in location
	movl	d1,a1@			|  given in argument
	movl	#afloat,a0		|convert fractional
	jsr	itoe			|  part and return
	moveml	sp@+,#0x1C
	unlk	a6
	rts

|
|convert floating value to fixed 32-bit integer
|
	.globl	fix
	.text
fix:
	link	a6,#0
	moveml	#0x3000,sp@-		|save d2,d3
	movl	a6@(8),d0		|d0 = high part of float
	movl	a6@(12),d1		|d1 = low order part
	movl	#afloat,a0		|a0 points to afloat
	jsr	etoi			|convert to internal format
	tstw	a0@(EXPT)		|test exponent
	bgt	1$			|if exponent is less
	clrl	d0			|  than or equal to zero
	bra	fixe			|  return zero

1$:	moveq	#-8,d0			|shift mantissa left
	jsr	shift			|  by 8 for alignment
	movw	a0@(EXPT),d1		|(note: after shift d1 = 0)
	clrl	d0			|clear d0
2$:	asll	#1,d3			|rotate d0<--d2<--d3
	roxll	#1,d2			|  registers until exponent
	roxll	#1,d0			|  count is exhausted
	subqw	#1,d1			|resultant fixed 32-bit
	bne	2$			|  value is in d0

	tstw	a0@			|check sign of float
	beq	fixe			|positive - d0 is ok
	negl	d0			|negative - negate d0
fixe:	moveml	sp@+,#0xC		|pop d2,d3
	unlk	a6
	rts

|
|convert fixed 32-bit integer to floating
|
	.globl	float
	.text
float:
	link	a6,#0
	moveml	#0x3000,sp@-		|save d2,d3
	movl	#afloat,a0		|a0 points to afloat
	clrl	a0@(MANH)		|clear junk from mantissa
	clrw	a0@			|clear sign
	movl	a6@(8),d0		|d0 = 32-bit long
	bmi	1$			|negative
	bpl	2$			|positive
	movw	#-128,a0@(EXPT)		|floating zero
	bra	floate			|return

1$:	movw	#1,a0@			|negative sign
	negl	d0			|convert to positive
2$:	movl	d0,a0@(MANL)		|move d0 to lower mantissa
	jsr	offset			|determine amount to shift
	jsr	shift			|shift mantissa
	addw	#56,d0			|calculate exponent
	movw	d0,a0@(EXPT)		|set exponent

floate:	jsr	itoe			|convert to external float
	moveml	sp@+,#0xC		|pop d2,d3
	unlk	a6
	rts

|
|add, subtract, compare two floating point numbers
|d0,d1 return result of fadd,fsub operations
|result of afadd,afaddf,afsub,afsubf stored
|fcmp sets condition codes upon return
|
	.globl	fsub
	.globl	fadd
	.globl	fcmp
	.globl	afadd
	.globl	afsub
	.globl	afaddf
	.globl	afsubf
	.text
fadd:
	link	a6,#0
	clrw	d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	add			|perform addition
	unlk	a6
	rts
fsub:
	link	a6,#0
	clrw	d0			|flag to getargs
	jsr	getargs			|get arguments
	eorw	#1,a1@			|reverse sign of b-arg
	jsr	add			|perform addition
	unlk	a6
	rts
fcmp:
	link	a6,#0
	clrw	d0			|flag to getargs
	jsr	getargs			|get arguments
	eorw	#1,a1@			|reverse sign of b-arg
	jsr	add			|perform compare
	tstl	d0			|set condition code
	unlk	a6
	rts
afadd:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	add			|perform addition
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@+			|  to store result
	movl	d1,a0@			|  of operation
	unlk	a6
	rts
afsub:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	eorw	#1,a1@			|reverse sign of b-arg
	jsr	add			|perform addition
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@+			|  to store result
	movl	d1,a0@			|  of operation
	unlk	a6
	rts
afaddf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	clrl	a0@(MANL)		|clear lower part of a-arg
	jsr	add			|perform addition
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
afsubf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	clrl	a0@(MANL)		|clear lower part of a-arg
	eorw	#1,a1@			|reverse sign of b-arg
	jsr	add			|perform addition
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
add:
	moveml	#0x3000,sp@-		|save d2,d3
	movw	a0@(EXPT),d0		|compare
	movw	a1@(EXPT),d1		|  exponents
	subw	d1,d0			|  of a and b
	bmi	1$			|a_expt < b_expt
	movl	a1,a0			|switch a0 to point to bfloat
	jsr	shift			|shift mantissa of bfloat
	movl	#afloat,a1		|switch a1 to point to afloat
	addw	d0,a0@(EXPT)		|adjust b_expt accordingly
	bra	2$
1$:	negw	d0			|make the shift count positive
	jsr	shift			|shift mantissa of afloat
	addw	d0,a0@(EXPT)		|adjust a_expt accordingly
2$:	tstw	a0@
	beq	3$			|a-arg is negative so
	negl	d3			|  negate mantissa
	negxl	d2			|  for addition
3$:	movl	a1@(MANH),d0
	movl	a1@(MANL),d1
	tstw	a1@
	beq	4$			|b-arg is negative so
	negl	d1			|  negate mantissa
	negxl	d0			|  for addition
4$:	addl	d1,d3			|perform addition of
	addxl	d0,d2			|  mantissas
	tstl	d2			|check sign of result
	bge	5$
	negl	d3			|result is negative so
	negxl	d2			|  negate mantissa
	orw	#1,a0@			|  and set sign
	bra	adde
5$:	andw	#0,a0@			|result positive

adde:	movl	d2,a0@(MANH)		|store result
	movl	d3,a0@(MANL)		|  of computation
	jsr	normal			|normalize result
	jsr	itoe			|convert to external form
	moveml	sp@+,#0xC		|pop d2,d3
	rts

|
|negate a floating number
|argument on stack
|d0,d1 return result
|
	.globl	fneg
	.text
fneg:
	link	a6,#0
	movl	a6@(12),d1		|d1 = low part of float
	movl	a6@(8),d0		|d0 = high part of float
	bmi	1$			
	orl	#0x80000000,d0		|turn high order bit on
	bra	2$
1$:	andl	#0x7FFFFFFF,d0		|turn high order bit off
2$:	unlk	a6
	rts	

|
|multiply two floating numbers
|d0,d1 return result for fmul
|result for afmul,afmulf stored
|
	.globl	fmul
	.globl	afmul
	.globl	afmulf
	.text
fmul:
	link	a6,#0
	clrw	d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	mult			|multiply arguments
	unlk	a6
	rts
afmul:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	mult			|perform multiply
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@+			|  to store result
	movl	d1,a0@			|  of operation
	unlk	a6
	rts
afmulf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	mult			|perform multiply
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
mult:
	moveml	#0x3C20,sp@-		|save d2-d5,a2
	movw	a1@+,d0			|d0 = sign of b-arg
	eorw	d0,a0@+			|a_sign gets resultant sign
	movw	a1@+,d0 		|d0 = exponent of b-arg
	addw	d0,a0@+			|a_expt gets sum of exponents

	clrl	d2			|clear
	clrl	d3			|  summation registers
	clrl	d5			|  for multiply
	moveq	#4,d4			|loop count
	addql	#8,a1			|adjust a1 pointer
	movl	#lsum,a2		|adjust a2 pointer
l1ds:	movw	a0@+,d0			|high to low words of afloat
	movw	a1@-,d1			|low to high words of bfloat
	mulu	d0,d1			|perform multiply
	addl	d1,d3
	addxl	d5,d2	
	subqw	#1,d4
	bne	l1ds
	movl	d4,a2@+
	movl	d2,a2@+
	movl	d3,a2@

	clrl	d2
	clrl	d3
	moveq	#3,d4			|loop count
	subql	#2,a0			|adjust a0 pointer
	addql	#2,a2			|adjust a2 pointer
l2ds:	movw	a0@-,d0			|low to high of afloat
	movw	a1@+,d1			|high to low of bfloat
	mulu	d0,d1			|perform multiply
	addl	d1,d3
	addxl	d5,d2
	subqw	#1,d4
	bne	l2ds
	movl	a2@-,d1
	movl	a2@-,d0
	addl	d1,d3
	addxl	d0,d2
	movl	d2,a2@+
	movl	d3,a2@	
	
	clrl	d2
	clrl	d3
	moveq	#2,d4			|loop count
	subql	#2,a1			|adjust a1 pointer
	addql	#2,a2			|adjust a2 pointer
l3ds:	movw	a0@+,d0			|high to low of afloat
	movw	a1@-,d1			|low to high of bfloat
	mulu	d0,d1
	addl	d1,d3
	addxl	d5,d2
	subqw	#1,d4
	bne	l3ds
	movl	a2@-,d1
	movl	a2@-,d0
	addl	d1,d3
	addxl	d0,d2
	movl	d2,a2@+
	movl	d3,a2@

	subql	#2,a0			|adjust a0 pointer
	addql	#2,a2			|adjust a2 pointer
	movw	a0@-,d0
	movw	a1@+,d1
	mulu	d0,d1
	addl	d1,a2@-

multe:	addql	#1,a2			|adjust a2 pointer
	movb	a2@+,a0@+		|move result
	movb	a2@+,a0@+		|  to afloat
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	subql	#8,a0			|align a0 to point
	subql	#4,a0			|  to afloat
	jsr	normal			|normalize result
	jsr	itoe			|convert to external form
	moveml	sp@+,#0x43C		|pop registers
	rts

|
|divide two floating numbers
|
	.globl	fdiv
	.globl	afdiv
	.globl	afdivf
	.text
fdiv:
	link	a6,#0
	clrl	d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	div			|divide arguments
	unlk	a6
	rts
afdiv:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	div			|divide arguments
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@+			|  to store result
	movl	d1,a0@			|  of operation
	unlk	a6
	rts
afdivf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	div			|divide arguments
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
div:
	moveml	#0x3E00,sp@-		|save d2-d6
	movw	a1@+,d0			|d0 = sign of b-arg
	eorw	d0,a0@+			|a-sign gets resultant sign
	movw	a1@+,d0			|d0 = exponent of b-arg
	subw	d0,a0@+			|a-expt gets diff of exponents
	movl	a1@+,d0			|d0 = divisor high
	bne	ok			|if divisor = 0
	divu	d0,d1			|  cause trap and core dump

ok:	movl	a1@,d1			|d1 = divisor low
	movl	a0@+,d2 		|d2 = dividend high
	movl	a0@,d3			|d3 = dividend low
	clrl	d4			|clear quotient
	clrl	d5			|  register set
	moveq	#58,d6			|setup shift count
	bra	2$

1$:	subqw	#1,d6			|exit computation when
	beq	dive			|  loop count = 0
	movw	#0x10,cc		|set x-bit in ccr
	roxll	#1,d5			|shift 1 into quotient
	roxll	#1,d4			|  accumulator registers
	roxll	#1,d3			|continue shift into
	roxll	#1,d2			|  into remainder registers
2$:	subl	d1,d3			|subtract divisor from
	subxl	d0,d2			|  remainder
	bge	1$

3$:	subqw	#1,d6			|exit computation when
	beq	dive			|  loop count = 0
	asll	#1,d5			|shift 0 into quotient
	roxll	#1,d4			|  accumulator registers
	roxll	#1,d3			|continue shift into
	roxll	#1,d2			|  remainder registers
	addl	d1,d3			|add divisor to
	addxl	d0,d2			|  remainder
	bge	1$			|positive -> shift 1
	bra	3$			|negative -> shift 0

dive:	subql	#4,a0			|align a0 to mantissa
	movl	d4,a0@+			|store quotient
	movl	d5,a0@			|  into afloat mantissa
	subql	#8,a0			|align a0 to afloat
	jsr	normal			|normalize mantissa
	jsr	itoe			|convert to external float
	moveml	sp@+,#0x7C		|pop d2-d6
	rts

 of operation
	unlk	a6
	rts
afmulf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	mult			|perform multiply
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
mult:
	moveml	#0x3C20,sp@-		|save d2-d5,a2
	movw	a1@+,d0			|d0 = sign of b-arg
	eorw	d0,a0@+			|a_sign gets resultant sign
	movw	a1@+,d0 		|d0 = exponent of b-arg
	addw	d0,a0@+			|a_expt gets susumacc/libc/crt/ldiv.s   555      0     12        2776  3472473663  10161 |J. Test	1/81
|signed long division: quotient = dividend / divisor

	.globl	ldiv
	.text

ldiv:	link	a6,#0
	moveml	#/3C00,sp@-	|need d2,d3,d4,d5 registers
	movl	#1.,d5		|sign of result
	movl	a6@(8.),d0	|dividend
	jge	1$
	negl	d0
	negl	d5
1$:	movl	d0,d3		|save positive dividend
	movl	a6@(12.),d1	|divisor
	jge	2$
	negl	d1
	negl	d5
2$:	movl	d1,d4		|save positive divisor

	cmpl	#/10000,d1	|divisor >= 2 ** 16?
	jge	3$		|yes, divisor must be < 2 ** 16
	clrw	d0		|divide dividend
	swap	d0		|  by 2 ** 16
	divu	d1,d0		|get the high order bits of quotient
	movw	d0,d2		|save quotient high
	movw	d3,d0		|dividend low + remainder * (2**16)
	divu	d1,d0		|get quotient low
	swap	d0		|temporarily save quotient low in high
	movw	d2,d0		|restore quotient high to low part of register
	swap	d0		|put things right
	jra	5$		|return

3$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|insure positive
	andl	#/7FFFFFFF,d0	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	jge	3$		|no, continue shift
	divu	d1,d0		|yes, divide, remainder is garbage
	andl	#/FFFF,d0	|get rid of remainder
	movl	d0,d2		|save quotient
	movl	d0,sp@-		|call ulmul with quotient
	movl	d4,sp@-		|  and saved divisor on stack
	jsr	ulmul		|  as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d3		|original dividend >= lmul result?
	jge	4$		|yes, quotient should be correct
	subql	#1,d2		|no, fix up quotient

4$:	movl	d2,d0		|move quotient to d0
5$:	tstl	d5		|sign of result
	jge	6$
	negl	d0
6$:	moveml	sp@+,#/3C	|restore registers
	unlk	a6
	rts


	sumacc/libc/crt/lmul.s   555      0     12        1341  3472473664  10160 |J. Test	1/81
|signed long multiply: c = a * b

	.globl	lmul
	.text

lmul:	link	a6,#0
	moveml	#/3800,sp@-	|save d2,d3,d4
	movl	#1.,d4		|sign of result
	movl	a6@(8.),d2	|d2 = a
	bge	1$
	negl	d2
	negl	d4
1$:	movl	a6@(12.),d3	|d3 = b
	bge	2$
	negl	d3
	negl	d4

2$:	clrl	d0
	movw	d2,d0		|d0 = alo, unsigned
	mulu	d3,d0		|d0 = blo*alo, unsigned
	movw	d2,d1		|d1 = alo
	swap	d2		|swap alo-ahi
	mulu	d3,d2		|d2 = blo*ahi, unsigned
	swap	d3		|swap blo-bhi
	mulu	d3,d1		|d1 = bhi*alo, unsigned
	addl	d2,d1		|d1 = (ahi*blo + alo*bhi)
	swap	d1		|d1 =
	clrw	d1		|   (ahi*blo + alo*bhi)*(2**16)
	addl	d1,d0		|d0 = alo*blo + (ahi*blo + alo*bhi)*(2**16)
	tstl	d4		|sign of result
	bge	3$
	negl	d0

3$:	moveml	sp@+,#/1C	|restore d2,d3,d4
	unlk	a6
	rts

tient high to low part of register
	swap	d0		|put things right
	jra	5$		|return

3$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|insure positive
	andl	#/7FFFFFFF,d0	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	jge	3$		|no, continue shift
	divu	d1,sumacc/libc/crt/lrem.s   444      0     12        2353  3472473664  10147 |signed long remainder: a = a % b

	.globl	lrem
	.text

lrem:	link	a6,#0
	moveml	#/3800,sp@-	|need d2,d3,d4 registers
	movl	#1.,d4		|sign of result
	movl	a6@(8.),d0	|dividend
	bge	1$
	negl	d0
	negl	d4
1$:	movl	d0,d2		|save positive dividend
	movl	a6@(12.),d1	|divisor
	bge	2$
	negl	d1

2$:	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	3$		|no, divisor must be < 2 ** 16
	clrw	d0		|d0 =
	swap	d0		|   dividend high
	divu	d1,d0		|yes, divide
	movw	d2,d0		|d0 = remainder high + quotient low
	divu	d1,d0		|divide
	clrw	d0		|d0 = 
	swap	d0		|   remainder
	bra	6$		|return

3$:	movl	d1,d3		|save divisor
4$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|assure positive
	andl	#/7FFFFFFF,d1	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	4$		|no, continue shift
	divu	d1,d0		|yes, divide
	andl	#/FFFF,d0	|erase remainder
	movl	d0,sp@-		|call ulmul with quotient
	movl	d3,sp@-		|  and saved divisor on stack
	jsr	ulmul		|  as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d2		|original dividend >= lmul result?
	jge	5$		|yes, quotient should be correct
	subl	d3,d0		|no, fixup 
5$:	subl	d2,d0		|calculate
	negl	d0		|  remainder

6$:	tstl	d4		|sign of result
	bge	7$
	negl	d0
7$:	moveml	sp@+,#/1C	|restore registers
	unlk	a6
	rts

 to low part of register
	swap	d0		|put things right
	jra	5$		|return

3$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|insure positive
	andl	#/7FFFFFFF,d0	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	jge	3$		|no, continue shift
	divu	d1,sumacc/libc/crt/makefile   444      0     12         540  3472473664  10500 # Makefile for libc/crt (MC68000)
.SUFFIXES: .b .c .s

OBJS = abort.b aldiv.b almul.b alrem.b auldiv.b aulmul.b aulrem.b \
	float.b ldiv.b lmul.b lrem.b makefile uldiv.b ulmul.b ulrem.b

all: $(OBJS)

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK
		|call ulmul with quotient
	movl	d3,sp@-		|  and saved divisor on stack
	jsr	ulmul		|  as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d2		|original dividend sumacc/libc/crt/uldiv.s   555      0     12        2566  3472473664  10344 |J. Gula
|J. Test	1/81
|unsigned long division: dividend = dividend / divisor

	.globl	uldiv
	.text

uldiv:	link	a6,#0
	moveml	#/3800,sp@-	|need d2,d3,d4 registers
	movl	a6@(8.),d0	|dividend
	movl	d0,d3		|save dividend
	movl	a6@(12.),d1	|divisor
	movl	d1,d4		|save divisor

	cmpl	#/10000,d1	|divisor >= 2 ** 16?
	jge	1$		|yes, divisor must be < 2 ** 16
	swap	d0		|divide dividend
	andl	#/FFFF,d0	|  by 2 ** 16
	divu	d1,d0		|get the high order bits of quotient
	movw	d0,d2		|save quotient high
	movw	d3,d0		|dividend low + remainder * (2**16)
	divu	d1,d0		|get quotient low
	swap	d0		|temporarily save quotient low in high
	movw	d2,d0		|restore quotient high to low part of register
	swap	d0		|put things right
	jra	3$		|return

1$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|assure positive
	andl	#/7FFFFFFF,d1	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	jge	1$		|no, continue shift
	divu	d1,d0		|yes, divide, remainder is garbage
	andl	#/FFFF,d0	|get rid of remainder
	movl	d0,d2		|save quotient
	movl	d0,sp@-		|call ulmul with quotient
	movl	d4,sp@-		|  and saved divisor on stack
	jsr	ulmul		|  as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d3		|original dividend >= lmul result?
	jge	2$		|yes, quotient should be correct
	subql	#1,d2		|no, fix up quotient
2$:	movl	d2,d0		|move quotient to d0

3$:	moveml	sp@+,#/1C	|restore registers
	unlk	a6
	rts

:	movl	d2,d0		|move quotient to d0
5$:	tstl	d5		|sign of result
	jge	6$
	negl	d0
6$:	moveml	sp@+,#/3C	|restore registers
	unlk	a6
	rts


	sumacc/libc/crt/ulmul.s   555      0     12        1133  3472473664  10344 |J. Test	1/81
|unsigned long multiply: c = a * b

	.globl	ulmul
	.text

ulmul:	link	a6,#0
	moveml	#/3000,sp@-	|save d2,d3
	movl	a6@(8.),d2	|d2 = a
	movl	a6@(12.),d3	|d3 = b

	clrl	d0
	movw	d2,d0		|d0 = alo, unsigned
	mulu	d3,d0		|d0 = blo*alo, unsigned
	movw	d2,d1		|d1 = alo
	swap	d2		|swap alo-ahi
	mulu	d3,d2		|d2 = blo*ahi, unsigned
	swap	d3		|swap blo-bhi
	mulu	d3,d1		|d1 = bhi*alo, unsigned
	addl	d2,d1		|d1 = (ahi*blo + alo*bhi)
	swap	d1		|d1 =
	clrw	d1		|   (ahi*blo + alo*bhi)*(2**16)
	addl	d1,d0		|d0 = alo*blo + (ahi*blo + alo*bhi)*(2**16)

3$:	moveml	sp@+,#/C	|restore d2,d3
	unlk	a6
	rts

otient low in high
	movw	d2,d0		|restore quotient high to low part of register
	swap	d0		|put things right
	jra	3$		|return

1$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|assure positive
	andl	#/7FFFFFFF,d1	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	jge	1$		|no, continue shift
	divu	d1,d0		|yes, divide, remainder is garbage
	andl	#/FFFF,d0	|get rid of remainder
	movl	d0,d2		sumacc/libc/crt/ulrem.s   444      0     12        2163  3472473664  10333 |J. Test	1/81
|unsigned long remainder: a = a % b

	.globl	ulrem
	.text

ulrem:	link	a6,#0
	moveml	#/3000,sp@-	|need d2,d3 registers
	movl	a6@(8.),d0	|dividend
	movl	d0,d2		|save dividend
	movl	a6@(12.),d1	|divisor

	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	1$		|no, divisor must be < 2 ** 16
	clrw	d0		|d0 =
	swap	d0		|   dividend high
	divu	d1,d0		|yes, divide
	movw	d2,d0		|d0 = remainder high + quotient low
	divu	d1,d0		|divide
	clrw	d0		|d0 = 
	swap	d0		|   remainder
	bra	4$		|return

1$:	movl	d1,d3		|save divisor
2$:	asrl	#/1,d0		|shift dividend
	asrl	#/1,d1		|shift divisor
	andl	#/7FFFFFFF,d0	|assure positive
	andl	#/7FFFFFFF,d1	|  sign bit
	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	2$		|no, continue shift
	divu	d1,d0		|yes, divide
	andl	#/FFFF,d0	|erase remainder
	movl	d0,sp@-		|call ulmul with quotient
	movl	d3,sp@-		|  and saved divisor on stack
	jsr	ulmul		|  as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d2		|original dividend >= lmul result?
	jge	3$		|yes, quotient should be correct
	subl	d3,d0		|no, fixup 
3$:	subl	d2,d0		|calculate
	negl	d0		|  remainder

4$:	moveml	sp@+,#/C	|restore registers
	unlk	a6
	rts

 as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d3		|original dividend >= lmul result?
	jge	2$		|yes, quotient should be correct
	subql	#1,d2		|no, fix up quotient
2$:	movl	d2,d0		|move quotient to d0

3$:	moveml	sp@+,#/1C	|restore registers
	unlk	a6
	rts

:	movl	d2,d0		|move quotient to d0
5$:	tstl	d5		|sign of result
	jge	6$
	negl	d0
6$:	moveml	sp@+,#/3C	|restore registers
	unlk	a6
	rts


	sumacc/libc/gen/   775      0     12           0  3472710600   6701 sumacc/libc/gen/_exit.c   444      0     12          40  3472473666  10212 _exit()
{

	asm("	trap	#14");
}
ainder: a = a % b

	.globl	ulrem
	.text

ulrem:	link	a6,#0
	moveml	#/3000,sp@-	|need d2,d3 registers
	movl	a6@(8.),d0	|dividend
	movl	d0,d2		|save dividend
	movl	a6@(12.),d1	|divisor

	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	1$		|no, divisor must be < 2 ** 16
	clrw	d0		|d0 =
	swap	d0		|   dividend high
	divu	d1,d0		|yes, divide
	movw	d2,d0		|d0 = remainder high + quotient low
	divu	d1,d0		|divide
	clrw	d0		|d0 = 
	swap	d0		|   remainder
	bra	4$		|return

1$:	movl	d1,d3		|savsumacc/libc/gen/new.c   444      0     12         256  3472473667   7725 /* @(#)rand.c	4.1 (Berkeley) 12/21/80 */
static	long	randx = 1;

srand(x)
unsigned x;
{
	randx = x;
}

rand()
{
	return((randx = randx * 1103515245 + 12345) & 0x7fffffff);
}
save dividend
	movl	a6@(12.),d1	|divisor

	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	1$		|no, divisor must be < 2 ** 16
	clrw	d0		|d0 =
	swap	d0		|   dividend high
	divu	d1,d0		|yes, divide
	movw	d2,d0		|d0 = remainder high + quotient low
	divu	d1,d0		|divide
	clrw	d0		|d0 = 
	swap	d0		|   remainder
	bra	4$		|return

1$:	movl	d1,d3		|savsumacc/libc/gen/abs.c   444      0     12          67  3472473667   7661 abs(arg)
{

	if(arg < 0)
		arg = -arg;
	return(arg);
}
ndx = 1;

srand(x)
unsigned x;
{
	randx = x;
}

rand()
{
	return((randx = randx * 1103515245 + 12345) & 0x7fffffff);
}
save dividend
	movl	a6@(12.),d1	|divisor

	cmpl	#/10000,d1	|divisor < 2 ** 16?
	bge	1$		|no, divisor must be < 2 ** 16
	clrw	d0		|d0 =
	swap	d0		|   dividend high
	divu	d1,d0		|yes, divide
	movw	d2,d0		|d0 = remainder high + quotient low
	divu	d1,d0		|divide
	clrw	d0		|d0 = 
	swap	d0		|   remainder
	bra	4$		|return

1$:	movl	d1,d3		|savsumacc/libc/gen/gcvt.c   444      0     12        1762  3472473667  10122 /*
 * gcvt  - Floating output conversion to
 * minimal length string
 */

char	*ecvt();

char *
gcvt(number, ndigit, buf)
double number;
char *buf;
{
	int sign, decpt;
	register char *p1, *p2;
	register i;

	p1 = ecvt(number, ndigit, &decpt, &sign);
	p2 = buf;
	if (sign)
		*p2++ = '-';
	for (i=ndigit-1; i>0 && p1[i]=='0'; i--)
		ndigit--;
	if (decpt >= 0 && decpt-ndigit > 4
	 || decpt < 0 && decpt < -3) { /* use E-style */
		decpt--;
		*p2++ = *p1++;
		*p2++ = '.';
		for (i=1; i<ndigit; i++)
			*p2++ = *p1++;
		*p2++ = 'e';
		if (decpt<0) {
			decpt = -decpt;
			*p2++ = '-';
		} else
			*p2++ = '+';
		*p2++ = decpt/10 + '0';
		*p2++ = decpt%10 + '0';
	} else {
		if (decpt<=0) {
			if (*p1!='0')
				*p2++ = '.';
			while (decpt<0) {
				decpt++;
				*p2++ = '0';
			}
		}
		for (i=1; i<=ndigit; i++) {
			*p2++ = *p1++;
			if (i==decpt)
				*p2++ = '.';
		}
		if (ndigit<decpt) {
			while (ndigit++<decpt)
				*p2++ = '0';
			*p2++ = '.';
		}
	}
	if (p2[-1]=='.')
		p2--;
	*p2 = '\0';
	return(buf);
}
		*p2++ = *p1+sumacc/libc/gen/atof.c   444      0     12        2061  3472473667  10101 /*
	C library - ascii to floating
*/

#include <ctype.h>

double	twoe56	= 72057594037927936.; /*2^56*/
double	exp5[]	= {5.,25.,625.,390625.,152587890625.,23232710361480712890625.};

double
atof(p)
register char *p;
{
	extern double ldexp();
	register c, exp = 0, eexp = 0;
	double fl = 0, flexp = 1.0;
	int bexp, neg = 1, negexp = 1;

	while((c = *p++) == ' ');
	if (c == '-') neg = -1;	else if (c == '+'); else --p;

	while ((c = *p++), isdigit(c))
		if (fl < twoe56) fl = 10*fl + (c-'0'); else exp++;
	if (c == '.')
	while ((c = *p++), isdigit(c))
		if (fl < twoe56)
		{
			fl = 10*fl + (c-'0');
			exp--;
		}
	if ((c == 'E') || (c == 'e'))
	{
		if ((c= *p++) == '+'); else if (c=='-') negexp = -1; else --p;
		while ((c = *p++), isdigit(c)) eexp = 10*eexp + (c-'0');
		if (negexp < 0) eexp = -eexp; exp += eexp;
	}
	bexp = exp;
	if (exp < 0) exp = -exp;

	for (c = 0; c < 6; c++)
	{
		if (exp & 01) flexp *= exp5[c];
		exp >>= 1; if (exp == 0) break;
	}

	if (bexp < 0) fl /= flexp; else fl *= flexp;
	fl = ldexp(fl, bexp);
	if (neg < 0) return(-fl); else return(fl);
}
 remainder

4$:	moveml	sp@+,#/C	|restore registers
	unlk	a6
	rts

 as arguments
	addql	#/8,sp		|restore sp
	cmpl	d0,d3		|original dividend >= lmul result?
	jge	2$		|yes, quotient should be correct
	subql	#1,d2		|no, fix up quotient
2$:	movl	d2,d0		|move quotient to d0

3$:	moveml	sp@+,#/1C	|restore registers
	unlk	a6
	rts

:	movl	d2,d0		|move quotient to d0
5$:	tstl	d5		|sign of result
	jge	6$
	negl	d0
6$:	moveml	sp@+,#/3C	|restore registers
	unlk	a6
	rts


	sumacc/libc/gen/atoi.c   444      0     12         427  3472473667  10070 atoi(p)
register char *p;
{
	register int n;
	register int f;

	n = 0;
	f = 0;
	for(;;p++) {
		switch(*p) {
		case ' ':
		case '\t':
			continue;
		case '-':
			f++;
		case '+':
			p++;
		}
		break;
	}
	while(*p >= '0' && *p <= '9')
		n = n*10 + *p++ - '0';
	return(f? -n: n);
}
e fl = 0, flexp = 1.0;
	int bexp, neg = 1, negexp = 1;

	while((c = *p++) == ' ');
	if (c == '-') neg = -1;	else if (c == '+'); else --p;

	while ((c = *p++), isdigit(c))
		if (fl < twoe56) fl = 10*fl + (c-'0'); else exp++;
	if (c ==sumacc/libc/gen/atol.c   444      0     12         424  3472473667  10070 long
atol(p)
register char *p;
{
	long n;
	register int f;

	n = 0;
	f = 0;
	for(;;p++) {
		switch(*p) {
		case ' ':
		case '\t':
			continue;
		case '-':
			f++;
		case '+':
			p++;
		}
		break;
	}
	while(*p >= '0' && *p <= '9')
		n = n*10 + *p++ - '0';
	return(f? -n: n);
}

}
e fl = 0, flexp = 1.0;
	int bexp, neg = 1, negexp = 1;

	while((c = *p++) == ' ');
	if (c == '-') neg = -1;	else if (c == '+'); else --p;

	while ((c = *p++), isdigit(c))
		if (fl < twoe56) fl = 10*fl + (c-'0'); else exp++;
	if (c ==sumacc/libc/gen/blt.s   555      0     12        3551  3472473667   7761 |Block transfer subroutine: blt(destination, source, count), returns count

.macro	dbf	reg,addr
	subql	#1,reg
	bge	addr
.endm

	.globl	blt
	.text

blt:	movl	sp@(4.),a0	|destination
	movl	sp@(8.),a1	|source
	movl	a0,d0		|destination
	andl	#/1,d0		|see if word aligned
	movl	a1,d1		|source
	andl	#/1,d1		|see if long word aligned?
	cmpl	d0,d1		|do they agree?
	beq	1$		|yes, can do something interesting
	movl	sp@(12.),d1	|count
	bra	5$		|ho, hum, just do byte moves
1$:	movl	sp@(12.),d1	|count
	tstl	d0		|are we on a long boundry?
	beq	3$		|yes, don't worry about fudge
	negl	d0		|complement
	addql	#2.,d0		|2 - adjustment = fudge
	cmpl	d1,d0		|is count bigger than fudge
	bge	5$		|no, must be 3 bytes or less
	subl	d0,d1		|shrink remaining count by this much
	subql	#1,d0		|dbf is a crock
2$:	movb	a1@+,a0@+	|move bytes to get to long boundry
	dbf	d0,2$		|while alignment count
3$:	movl	d1,d0		|copy remaining count
	andl	#~3,d0		|count mod 4 is number of long words
	beq	5$		|hmm, must not be any
	subl	d0,d1		|long words moved * 4 = bytes moved
	asrl	#2.,d0		|number of long words
	cmpl	#12,d0		|do we have a bunch to do?
	blt	38$		|no, just do normal moves
	moveml	#/7F3E,sp@-	|save some registers
34$:	moveml	a1@+,#/7CFE	|block move via various registers
	moveml	#/7CFE,a0@
	addl	#48.,a0		|moveml won't let me auto inc a destination
	subl	#12,d0		|we moved twelve longs worth
	cmpl	#12,d0		|do we have another 12 to go
	bge	34$		|yes, keep at it
	moveml	sp@+,#/7CFE	|restore registers
	tstl	d0		|any long's left
	beq	5$		|no, nothing but a few random bytes
38$:	subql	#1,d0		|dbf is a crock
4$:	movl	a1@+,a0@+	|copy as many long words as possible
	dbf	d0,4$		|while long word count
5$:	tstl	d1		|anything left to do?
	beq	7$		|nothing left
	subql	#1,d1		|dbf is a crock
6$:	movb	a1@+,a0@+	|copy any residual bytes
	dbf	d1,6$		|while byte count
7$:	movl	sp@(12.),d0	|just return the count
	rts
s diff of exponents
	movl	a1@+,d0			|d0 = divisor high
	bne	ok			|if divisor = 0
	divu	d0,d1			|  cause trap and core dump

ok:	movl	a1@,d1			|d1 = divsumacc/libc/gen/clear.s   555      0     12        3114  3472473667  10261 |Clear memory: clear(p, n) writes n bytes of zeros, starting at p

	.globl clear
	.text

clear:	movl	sp@(4.),d1	|p
	movl	sp@(8.),d0	|n
	jeq	7$		|nothing to do
	addl	d0,d1		|&p[n]
	movl	d1,a0		|save it
	andl	#1,d1		|word aligned?
	jeq	1$		|yes, potentially long moves
	clrb	a0@-		|clear up to word boundry
	subql	#1,d0		|one less byte to clear
	jeq	7$		|nothing left

1$:	movl	d0,d1		|copy n
	andl	#~/FF,d1	|m = number of 256 byte blocks left * 256
	jeq	3$		|none

	subl	d1,d0		|we will do this many bytes in next loop
	asrl	#8,d1		|number of blocks left
	moveml	#/FF7E,sp@-	|save registers
	movl	d1,sp@-		|number of blocks goes on top of stack
	movl	#zeros,a1
	moveml	a1@,#/7CFF	|clear out a bunch of registers
	movl	d0,a1		|and this one too

2$:	moveml	#/FF7E,a0@-	|clear out 14 longs worth
	moveml	#/FF7E,a0@-	|clear out 14 longs worth
	moveml	#/FF7E,a0@-	|clear out 14 longs worth
	moveml	#/FF7E,a0@-	|clear out 14 longs worth
	moveml	#/FF00,a0@-	|clear out 8 longs worth, total of 256 bytes
	subql	#1.,sp@		|one more block, any left?
	jgt	2$		|yes, do another pass

	movl	sp@+,d1		|just pop stack
	moveml	sp@+,#/7EFF	|give me back the registers

3$:	movl	d0,d1		|copy n left
	andl	#~3,d1		|this many longs left
	jeq	5$		|none
	subl	d1,d0		|do this many in next loop

4$:	clrl	a0@-		|clear a long's worth
	subql	#4,d1		|this many bytes in a long
	jgt	4$		|if there are more

5$:	tstl	d0		|anything left?
	jeq	7$		|no, just stop here

6$:	clrb	a0@-		|clear 1 byte's worth
	subql	#1,d0		|one less byte to do
	jgt	6$		|if any more

7$:	rts			|that's it

zeros:	.long	0,0,0,0,0,0,0,0,0,0,0,0,0	|13 long  of zeros
 we have a bunch to do?
	blt	38$		|no, just do normal moves
	moveml	#/7F3E,sp@-	|save some registers
34$:	moveml	a1@+,#/7CFE	|block move via various registers
	moveml	#/7CFE,a0@
	addl	#48.,a0		|moveml won't let me auto inc a destination
	subl	#12,d0		|we moved twelve longs worth
	cmpl	#12,d0		|do we have another 12 to go
	bge	34$		|yes, keep at it
	moveml	sp@+,#/7CFE	|restore registers
	tstl	d0		|any long's left
	beq	5$		|no, nothinsumacc/libc/gen/crypt.c   444      0     12       16643  3472473670  10336 /*
 * This program implements the
 * Proposed Federal Information Processing
 *  Data Encryption Standard.
 * See Federal Register, March 17, 1975 (40FR12134)
 */

/*
 * Initial permutation,
 */
static	char	IP[] = {
	58,50,42,34,26,18,10, 2,
	60,52,44,36,28,20,12, 4,
	62,54,46,38,30,22,14, 6,
	64,56,48,40,32,24,16, 8,
	57,49,41,33,25,17, 9, 1,
	59,51,43,35,27,19,11, 3,
	61,53,45,37,29,21,13, 5,
	63,55,47,39,31,23,15, 7,
};

/*
 * Final permutation, FP = IP^(-1)
 */
static	char	FP[] = {
	40, 8,48,16,56,24,64,32,
	39, 7,47,15,55,23,63,31,
	38, 6,46,14,54,22,62,30,
	37, 5,45,13,53,21,61,29,
	36, 4,44,12,52,20,60,28,
	35, 3,43,11,51,19,59,27,
	34, 2,42,10,50,18,58,26,
	33, 1,41, 9,49,17,57,25,
};

/*
 * Permuted-choice 1 from the key bits
 * to yield C and D.
 * Note that bits 8,16... are left out:
 * They are intended for a parity check.
 */
static	char	PC1_C[] = {
	57,49,41,33,25,17, 9,
	 1,58,50,42,34,26,18,
	10, 2,59,51,43,35,27,
	19,11, 3,60,52,44,36,
};

static	char	PC1_D[] = {
	63,55,47,39,31,23,15,
	 7,62,54,46,38,30,22,
	14, 6,61,53,45,37,29,
	21,13, 5,28,20,12, 4,
};

/*
 * Sequence of shifts used for the key schedule.
*/
static	char	shifts[] = {
	1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1,
};

/*
 * Permuted-choice 2, to pick out the bits from
 * the CD array that generate the key schedule.
 */
static	char	PC2_C[] = {
	14,17,11,24, 1, 5,
	 3,28,15, 6,21,10,
	23,19,12, 4,26, 8,
	16, 7,27,20,13, 2,
};

static	char	PC2_D[] = {
	41,52,31,37,47,55,
	30,40,51,45,33,48,
	44,49,39,56,34,53,
	46,42,50,36,29,32,
};

/*
 * The C and D arrays used to calculate the key schedule.
 */

static	char	C[28];
static	char	D[28];
/*
 * The key schedule.
 * Generated from the key.
 */
static	char	KS[16][48];

/*
 * Set up the key schedule from the key.
 */

setkey(key)
char *key;
{
	register i, j, k;
	int t;

	/*
	 * First, generate C and D by permuting
	 * the key.  The low order bit of each
	 * 8-bit char is not used, so C and D are only 28
	 * bits apiece.
	 */
	for (i=0; i<28; i++) {
		C[i] = key[PC1_C[i]-1];
		D[i] = key[PC1_D[i]-1];
	}
	/*
	 * To generate Ki, rotate C and D according
	 * to schedule and pick up a permutation
	 * using PC2.
	 */
	for (i=0; i<16; i++) {
		/*
		 * rotate.
		 */
		for (k=0; k<shifts[i]; k++) {
			t = C[0];
			for (j=0; j<28-1; j++)
				C[j] = C[j+1];
			C[27] = t;
			t = D[0];
			for (j=0; j<28-1; j++)
				D[j] = D[j+1];
			D[27] = t;
		}
		/*
		 * get Ki. Note C and D are concatenated.
		 */
		for (j=0; j<24; j++) {
			KS[i][j] = C[PC2_C[j]-1];
			KS[i][j+24] = D[PC2_D[j]-28-1];
		}
	}
}

/*
 * The E bit-selection table.
 */
static	char	E[48];
static	char	e[] = {
	32, 1, 2, 3, 4, 5,
	 4, 5, 6, 7, 8, 9,
	 8, 9,10,11,12,13,
	12,13,14,15,16,17,
	16,17,18,19,20,21,
	20,21,22,23,24,25,
	24,25,26,27,28,29,
	28,29,30,31,32, 1,
};

/*
 * The 8 selection functions.
 * For some reason, they give a 0-origin
 * index, unlike everything else.
 */
static	char	S[8][64] = {
	14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7,
	 0,15, 7, 4,14, 2,13, 1,10, 6,12,11, 9, 5, 3, 8,
	 4, 1,14, 8,13, 6, 2,11,15,12, 9, 7, 3,10, 5, 0,
	15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13,

	15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10,
	 3,13, 4, 7,15, 2, 8,14,12, 0, 1,10, 6, 9,11, 5,
	 0,14, 7,11,10, 4,13, 1, 5, 8,12, 6, 9, 3, 2,15,
	13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9,

	10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8,
	13, 7, 0, 9, 3, 4, 6,10, 2, 8, 5,14,12,11,15, 1,
	13, 6, 4, 9, 8,15, 3, 0,11, 1, 2,12, 5,10,14, 7,
	 1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12,

	 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15,
	13, 8,11, 5, 6,15, 0, 3, 4, 7, 2,12, 1,10,14, 9,
	10, 6, 9, 0,12,11, 7,13,15, 1, 3,14, 5, 2, 8, 4,
	 3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14,

	 2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9,
	14,11, 2,12, 4, 7,13, 1, 5, 0,15,10, 3, 9, 8, 6,
	 4, 2, 1,11,10,13, 7, 8,15, 9,12, 5, 6, 3, 0,14,
	11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3,

	12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11,
	10,15, 4, 2, 7,12, 9, 5, 6, 1,13,14, 0,11, 3, 8,
	 9,14,15, 5, 2, 8,12, 3, 7, 0, 4,10, 1,13,11, 6,
	 4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13,

	 4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1,
	13, 0,11, 7, 4, 9, 1,10,14, 3, 5,12, 2,15, 8, 6,
	 1, 4,11,13,12, 3, 7,14,10,15, 6, 8, 0, 5, 9, 2,
	 6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12,

	13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7,
	 1,15,13, 8,10, 3, 7, 4,12, 5, 6,11, 0,14, 9, 2,
	 7,11, 4, 1, 9,12,14, 2, 0, 6,10,13,15, 3, 5, 8,
	 2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11,
};

/*
 * P is a permutation on the selected combination
 * of the current L and key.
 */
static	char	P[] = {
	16, 7,20,21,
	29,12,28,17,
	 1,15,23,26,
	 5,18,31,10,
	 2, 8,24,14,
	32,27, 3, 9,
	19,13,30, 6,
	22,11, 4,25,
};

/*
 * The current block, divided into 2 halves.
 */
static	char	L[32], R[32];
static	char	tempL[32];
static	char	f[32];

/*
 * The combination of the key and the input, before selection.
 */
static	char	preS[48];

/*
 * The payoff: encrypt a block.
 */

encrypt(block, edflag)
char *block;
{
	int i, ii;
	register t, j, k;

	/*
	 * First, permute the bits in the input
	 */
	for (j=0; j<64; j++)
		L[j] = block[IP[j]-1];
	/*
	 * Perform an encryption operation 16 times.
	 */
	for (ii=0; ii<16; ii++) {
		/*
		 * Set direction
		 */
		if (edflag)
			i = 15-ii;
		else
			i = ii;
		/*
		 * Save the R array,
		 * which will be the new L.
		 */
		for (j=0; j<32; j++)
			tempL[j] = R[j];
		/*
		 * Expand R to 48 bits using the E selector;
		 * exclusive-or with the current key bits.
		 */
		for (j=0; j<48; j++)
			preS[j] = R[E[j]-1] ^ KS[i][j];
		/*
		 * The pre-select bits are now considered
		 * in 8 groups of 6 bits each.
		 * The 8 selection functions map these
		 * 6-bit quantities into 4-bit quantities
		 * and the results permuted
		 * to make an f(R, K).
		 * The indexing into the selection functions
		 * is peculiar; it could be simplified by
		 * rewriting the tables.
		 */
		for (j=0; j<8; j++) {
			t = 6*j;
			k = S[j][(preS[t+0]<<5)+
				(preS[t+1]<<3)+
				(preS[t+2]<<2)+
				(preS[t+3]<<1)+
				(preS[t+4]<<0)+
				(preS[t+5]<<4)];
			t = 4*j;
			f[t+0] = (k>>3)&01;
			f[t+1] = (k>>2)&01;
			f[t+2] = (k>>1)&01;
			f[t+3] = (k>>0)&01;
		}
		/*
		 * The new R is L ^ f(R, K).
		 * The f here has to be permuted first, though.
		 */
		for (j=0; j<32; j++)
			R[j] = L[j] ^ f[P[j]-1];
		/*
		 * Finally, the new L (the original R)
		 * is copied back.
		 */
		for (j=0; j<32; j++)
			L[j] = tempL[j];
	}
	/*
	 * The output L and R are reversed.
	 */
	for (j=0; j<32; j++) {
		t = L[j];
		L[j] = R[j];
		R[j] = t;
	}
	/*
	 * The final output
	 * gets the inverse permutation of the very original.
	 */
	for (j=0; j<64; j++)
		block[j] = L[FP[j]-1];
}

char *
crypt(pw,salt)
char *pw;
char *salt;
{
	register i, j, c;
	int temp;
	static char block[66], iobuf[16];
	for(i=0; i<66; i++)
		block[i] = 0;
	for(i=0; (c= *pw) && i<64; pw++){
		for(j=0; j<7; j++, i++)
			block[i] = (c>>(6-j)) & 01;
		i++;
	}
	
	setkey(block);
	
	for(i=0; i<66; i++)
		block[i] = 0;

	for(i=0;i<48;i++)
		E[i] = e[i];

	for(i=0;i<2;i++){
		c = *salt++;
		iobuf[i] = c;
		if(c>'Z') c -= 6;
		if(c>'9') c -= 7;
		c -= '.';
		for(j=0;j<6;j++){
			if((c>>j) & 01){
				temp = E[6*i+j];
				E[6*i+j] = E[6*i+j+24];
				E[6*i+j+24] = temp;
				}
			}
		}
	
	for(i=0; i<25; i++)
		encrypt(block,0);
	
	for(i=0; i<11; i++){
		c = 0;
		for(j=0; j<6; j++){
			c <<= 1;
			c |= block[6*i+j];
			}
		c += '.';
		if(c>'9') c += 7;
		if(c>'Z') c += 6;
		iobuf[i+2] = c;
	}
	iobuf[i+2] = 0;
	if(iobuf[1]==0)
		iobuf[1] = iobuf[0];
	return(iobuf);
}
, 8, 7, 4,15,14, 3,11, 5, 2,12,

	 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15,
	13, 8,11,sumacc/libc/gen/ctype_.c   444      0     12        1075  3472473670  10431 #include	<ctype.h>

char _ctype_[] = {
	0,
	_C,	_C,	_C,	_C,	_C,	_C,	_C,	_C,
	_C,	_S,	_S,	_S,	_S,	_S,	_C,	_C,
	_C,	_C,	_C,	_C,	_C,	_C,	_C,	_C,
	_C,	_C,	_C,	_C,	_C,	_C,	_C,	_C,
	_S,	_P,	_P,	_P,	_P,	_P,	_P,	_P,
	_P,	_P,	_P,	_P,	_P,	_P,	_P,	_P,
	_N,	_N,	_N,	_N,	_N,	_N,	_N,	_N,
	_N,	_N,	_P,	_P,	_P,	_P,	_P,	_P,
	_P,	_U,	_U,	_U,	_U,	_U,	_U,	_U,
	_U,	_U,	_U,	_U,	_U,	_U,	_U,	_U,
	_U,	_U,	_U,	_U,	_U,	_U,	_U,	_U,
	_U,	_U,	_U,	_P,	_P,	_P,	_P,	_P,
	_P,	_L,	_L,	_L,	_L,	_L,	_L,	_L,
	_L,	_L,	_L,	_L,	_L,	_L,	_L,	_L,
	_L,	_L,	_L,	_L,	_L,	_L,	_L,	_L,
	_L,	_L,	_L,	_P,	_P,	_P,	_P,	_C
};
P[j]-1];
}

char *
crypt(pw,salt)
char *pw;
char *salt;
{
	register i, j, c;
	int temp;
	static char block[66], iobuf[16];
	for(i=0; i<66; i++)
		block[i] = 0;
	for(i=0; (c= *pw) && i<64; pw++){
		for(j=0; j<7; j++, i++)
			block[i] = (c>>(6-j)) & 01;
		i++;
	}
	
	setkey(block);
	
	for(i=0; i<66; i++)
		block[i] = 0;

	for(i=0;i<48;i++)
		E[i] = e[i];

	for(i=0;i<2;i++){
		c = *salt++;
		iobuf[i] = c;
		if(c>'Z') c -= 6;
		if(c>'9') c -= 7;
		c -=sumacc/libc/gen/ecvt.c   444      0     12        3143  3472473670  10105 /*
 *	ecvt converts to decimal
 *	the number of digits is specified by ndigit
 *	decpt is set to the position of the decimal point
 *	sign is set to 0 for positive, 1 for negative
 */

char	*cvt();

#define	NDIG	80
char*
ecvt(arg, ndigits, decpt, sign)
double arg;
int ndigits, *decpt, *sign;
{
	return(cvt(arg, ndigits, decpt, sign, 1));
}

char*
fcvt(arg, ndigits, decpt, sign)
double arg;
int ndigits, *decpt, *sign;
{
	return(cvt(arg, ndigits, decpt, sign, 0));
}

static char*
cvt(arg, ndigits, decpt, sign, eflag)
double arg;
int ndigits, *decpt, *sign;
{
	register int r2;
	double fi, fj;
	register char *p, *p1;
	static char buf[NDIG];
	double modf();

	if (ndigits<0)
		ndigits = 0;
	if (ndigits>=NDIG-1)
		ndigits = NDIG-2;
	r2 = 0;
	*sign = 0;
	p = &buf[0];
	if (arg<0) {
		*sign = 1;
		arg = -arg;
	}
	arg = modf(arg, &fi);
	p1 = &buf[NDIG];
	/*
	 * Do integer part
	 */
	if (fi != 0) {
		p1 = &buf[NDIG];
		while (fi != 0) {
			fj = modf(fi/10, &fi);
			*--p1 = (int)((fj+.03)*10) + '0';
			r2++;
		}
		while (p1 < &buf[NDIG])
			*p++ = *p1++;
	} else if (arg > 0) {
		while ((fj = arg*10) < 1) {
			arg = fj;
			r2--;
		}
	}
	p1 = &buf[ndigits];
	if (eflag==0)
		p1 += r2;
	*decpt = r2;
	if (p1 < &buf[0]) {
		buf[0] = '\0';
		return(buf);
	}
	while (p<=p1 && p<&buf[NDIG]) {
		arg *= 10;
		arg = modf(arg, &fj);
		*p++ = (int)fj + '0';
	}
	if (p1 >= &buf[NDIG]) {
		buf[NDIG-1] = '\0';
		return(buf);
	}
	p = p1;
	*p1 += 5;
	while (*p1 > '9') {
		*p1 = '0';
		if (p1>buf)
			++*--p1;
		else {
			*p1 = '1';
			(*decpt)++;
			if (eflag==0) {
				if (p>buf)
					*p = '0';
				p++;
			}
		}
	}
	*p = '\0';
	return(buf);
}
E[6*i+j+24] = temp;
				}
			}
		}
	
	for(i=0; i<25; i++)
		encrypt(block,0);
	
	for(i=0; i<11; i++){
		c = 0;
		for(j=0; j<6; j++){
			c <<= 1;
			c |= block[6*i+j];
			}
		c += '.';
		if(c>'9') c += 7;
		if(c>'Z') c += 6;
		iobuf[i+2] = c;
	}
	iobuf[i+2] = 0;
	if(iobuf[1]==0)
		iobuf[1] = iobuf[0];
	return(iobuf);
}
, 8, 7, 4,15,14, 3,11, 5, 2,12,

	 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15,
	13, 8,11,sumacc/libc/gen/index.c   444      0     12         333  3472473670  10231 /*
 * Return the ptr in sp at which the character c appears;
 * NULL if not found
 */

#define	NULL	0

char *
index(sp, c)
register char *sp, c;
{
	do {
		if (*sp == c)
			return(sp);
	} while (*sp++);
	return(NULL);
}
2;
	r2 = 0;
	*sign = 0;
	p = &buf[0];
	if (arg<0) {
		*sign = 1;
		arg = -arg;
	}
	arg = modf(arg, &fi);
	p1 = &buf[NDIG];
	/*
	 * Do integer part
	 */
	if (fi != 0) {
		p1 = &buf[NDIG];
		while (fi != 0) {
			fj = modf(fi/10, &fi);
			*--p1 = (int)((fj+.03)*10) + '0';
			r2++;
		}
		while (psumacc/libc/gen/makefile   444      0     12         765  3472473670  10467 # Makefile for libc/gen (MC68000)
.SUFFIXES: .b .c .s

OBJS = abs.b atoi.b atof.b atol.b blt.b clear.b crypt.b ctype_.b \
	ecvt.b gcvt.b index.b qsort.b rand.b rindex.b setjmp.b \
	strcat.b strcatn.b strcmp.b strcmpn.b strcpy.b strcpyn.b \
	strlen.b strncat.b strncmp.b strncpy.b swab.b 

all: $(OBJS)

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK

#(*) UNIX is a trademark of Bell Laboratories

		while (psumacc/libc/gen/qsort.c   444      0     12        2552  3472473670  10317 
static int	(*qscmp)();
static int	qses;

qsort(a, n, es, fc)
char *a;
unsigned n;
int es;
int (*fc)();
{
	qscmp = fc;
	qses = es;
	qs1(a, a+n*es);
}

static qs1(a, l)
char *a, *l;
{
	register char *i, *j;
	register es;
	char **k;
	char *lp, *hp;
	int c;
	unsigned n;


	es = qses;

start:
	if((n=l-a) <= es)
		return;
	n = es * (n / (2*es));
	hp = lp = a+n;
	i = a;
	j = l-es;
	for(;;) {
		if(i < lp) {
			if((c = (*qscmp)(i, lp)) == 0) {
				qsexc(i, lp -= es);
				continue;
			}
			if(c < 0) {
				i += es;
				continue;
			}
		}

loop:
		if(j > hp) {
			if((c = (*qscmp)(hp, j)) == 0) {
				qsexc(hp += es, j);
				goto loop;
			}
			if(c > 0) {
				if(i == lp) {
					qstexc(i, hp += es, j);
					i = lp += es;
					goto loop;
				}
				qsexc(i, j);
				j -= es;
				i += es;
				continue;
			}
			j -= es;
			goto loop;
		}


		if(i == lp) {
			if(lp-a >= l-hp) {
				qs1(hp+es, l);
				l = lp;
			} else {
				qs1(a, lp);
				a = hp+es;
			}
			goto start;
		}


		qstexc(j, lp -= es, i);
		j = hp -= es;
	}
}

static qsexc(i, j)
char *i, *j;
{
	register char *ri, *rj, c;
	int n;

	n = qses;
	ri = i;
	rj = j;
	do {
		c = *ri;
		*ri++ = *rj;
		*rj++ = c;
	} while(--n);
}

static qstexc(i, j, k)
char *i, *j, *k;
{
	register char *ri, *rj, *rk;
	int c;
	int n;

	n = qses;
	ri = i;
	rj = j;
	rk = k;
	do {
		c = *ri;
		*ri++ = *rk;
		*rk++ = *rj;
		*rj++ = c;
	} while(--n);
}
if(iobuf[1]==0)
		iobuf[1] = iobuf[0];
	return(iobuf);
}
, 8, 7, 4,15,14, 3,11, 5, 2,12,

	 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15,
	13, 8,11,sumacc/libc/gen/rand.c   444      0     12         325  3472473670  10047 static	long	randx = 1;

srand(x)
unsigned x;
{
	randx = x;
}

/*
 * rand: generates a pseudo-random number in the range 0 to 2**31-1 
 */
rand()
{
	return(((randx = randx*1103515245 + 12345)>>16) & 0x7FFFFFFF);
}
er es;
	char **k;
	char *lp, *hp;
	int c;
	unsigned n;


	es = qses;

start:
	if((n=l-a) <= es)
		return;
	n = es * (n / (2*es));
	hp = lp = a+n;
	i = a;
	j = l-es;
	for(;;) {
		if(i < lp) {
			if((c = (*qscmp)(i, lp)) == 0) {
				qsexc(i, lp -= es);
				continue;
			}
			if(c < 0) {
				i += es;
	sumacc/libc/gen/rindex.c   444      0     12         370  3472473670  10414 /*
 * Return the ptr in sp at which the character c last
 * appears; NULL if not found
*/

#define NULL 0

char *
rindex(sp, c)
register char *sp, c;
{
	register char *r;

	r = NULL;
	do {
		if (*sp == c)
			r = sp;
	} while (*sp++);
	return(r);
}
int c;
	unsigned n;


	es = qses;

start:
	if((n=l-a) <= es)
		return;
	n = es * (n / (2*es));
	hp = lp = a+n;
	i = a;
	j = l-es;
	for(;;) {
		if(i < lp) {
			if((c = (*qscmp)(i, lp)) == 0) {
				qsexc(i, lp -= es);
				continue;
			}
			if(c < 0) {
				i += es;
	sumacc/libc/gen/setjmp.s   555      0     12        1352  3472473671  10472 |setjmp, longjmp
|
|	longjmp(a, v)
|causes a "return(v)" from the
|last call to
|
|	setjmp(v)
|by restoring all the registers and
|adjusting the stack
|
|jmp_buf is set up as:
|
|	_________________
|	|	pc	|
|	-----------------
|	|	d2	|
|	-----------------
|	|	...	|
|	-----------------
|	|	d7	|
|	-----------------
|	|	a2	|
|	-----------------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCFC,a0@(4.)	|d2-d7, a2-a7
	clrl	d0		|return 0
	rts

longjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@(8.),d0	|value returned
	moveml	a0@(4.),#/FCFC	|restore d2-d7, a2-a7
	movl	a0@,sp@		|restore pc of call to setjmp to stack
	rts
xc(i, j);
				j -= es;
				i += es;
				continue;
			}
			j -= es;
			goto loop;
		}


		if(i == lp) {
			if(lp-a >= l-hp) {
				qs1(hp+es, l);
				l = lp;
			} else {
				qs1(a, lp);
				a = hp+es;
			}
			goto start;
		}


		qstexc(j, lp -= es, i);
		j = hp -= es;
	}
}

statisumacc/libc/gen/strcat.c   444      0     12         362  3472473671  10425 /*
 * Concatenate s2 on the end of s1.  S1's space must be large enough.
 * Return s1.
 */

char *
strcat(s1, s2)
register char *s1, *s2;
{
	register char *os1;

	os1 = s1;
	while (*s1++)
		;
	--s1;
	while (*s1++ = *s2++)
		;
	return(os1);
}
-------------
|	|	...	|
|	-----------------
|	|	d7	|
|	-----------------
|	|	a2	|
|	-----------------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/strcatn.c   444      0     12         521  3472473671  10600 /*
 * Concatenate s2 on the end of s1.  S1's space must be large enough.
 * At most n characters are moved.
 * Return s1.
 */

char *
strcatn(s1, s2, n)
register char *s1, *s2;
register n;
{
	register char *os1;

	os1 = s1;
	while (*s1++)
		;
	--s1;
	while (*s1++ = *s2++)
		if (--n < 0) {
			*--s1 = '\0';
			break;
		}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/strcmp.c   444      0     12         266  3472473671  10440 /*
 * Compare strings:  s1>s2: >0  s1==s2: 0  s1<s2: <0
 */

strcmp(s1, s2)
register char *s1, *s2;
{

	while (*s1 == *s2++)
		if (*s1++=='\0')
			return(0);
	return(*s1 - *--s2);
}
ter n;
{
	register char *os1;

	os1 = s1;
	while (*s1++)
		;
	--s1;
	while (*s1++ = *s2++)
		if (--n < 0) {
			*--s1 = '\0';
			break;
		}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/strcmpn.c   444      0     12         360  3472473671  10611 /*
 * Compare strings (at most n bytes):  s1>s2: >0  s1==s2: 0  s1<s2: <0
 */

strcmpn(s1, s2, n)
register char *s1, *s2;
register n;
{

	while (--n >= 0 && *s1 == *s2++)
		if (*s1++ == '\0')
			return(0);
	return(n<0 ? 0 : *s1 - *--s2);
}
	;
	--s1;
	while (*s1++ = *s2++)
		if (--n < 0) {
			*--s1 = '\0';
			break;
		}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/strcpy.c   444      0     12         304  3472473671  10445 /*
 * Copy string s2 to s1.  s1 must be large enough.
 * return s1
 */

char *
strcpy(s1, s2)
register char *s1, *s2;
{
	register char *os1;

	os1 = s1;
	while (*s1++ = *s2++)
		;
	return(os1);
}
eturn(0);
	return(n<0 ? 0 : *s1 - *--s2);
}
	;
	--s1;
	while (*s1++ = *s2++)
		if (--n < 0) {
			*--s1 = '\0';
			break;
		}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/strcpyn.c   444      0     12         476  3472473671  10635 /*
 * Copy s2 to s1, truncating or null-padding to always copy n bytes
 * return s1
 */

char *
strcpyn(s1, s2, n)
register char *s1, *s2;
{
	register i;
	register char *os1;

	os1 = s1;
	for (i = 0; i < n; i++)
		if ((*s1++ = *s2++) == '\0') {
			while (++i < n)
				*s1++ = '\0';
			return(os1);
		}
	return(os1);
}
	}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/strlen.c   444      0     12         236  3472473671  10434 /*
 * Returns the number of
 * non-NULL bytes in string argument.
 */

strlen(s)
register char *s;
{
	register n;

	n = 0;
	while (*s++)
		n++;
	return(n);
}
ister char *os1;

	os1 = s1;
	for (i = 0; i < n; i++)
		if ((*s1++ = *s2++) == '\0') {
			while (++i < n)
				*s1++ = '\0';
			return(os1);
		}
	return(os1);
}
	}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/strncat.c   444      0     12         521  3472473671  10600 /*
 * Concatenate s2 on the end of s1.  S1's space must be large enough.
 * At most n characters are moved.
 * Return s1.
 */

char *
strncat(s1, s2, n)
register char *s1, *s2;
register n;
{
	register char *os1;

	os1 = s1;
	while (*s1++)
		;
	--s1;
	while (*s1++ = *s2++)
		if (--n < 0) {
			*--s1 = '\0';
			break;
		}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/strncmp.c   444      0     12         360  3472473672  10612 /*
 * Compare strings (at most n bytes):  s1>s2: >0  s1==s2: 0  s1<s2: <0
 */

strncmp(s1, s2, n)
register char *s1, *s2;
register n;
{

	while (--n >= 0 && *s1 == *s2++)
		if (*s1++ == '\0')
			return(0);
	return(n<0 ? 0 : *s1 - *--s2);
}
	;
	--s1;
	while (*s1++ = *s2++)
		if (--n < 0) {
			*--s1 = '\0';
			break;
		}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/strncpy.c   444      0     12         476  3472473672  10636 /*
 * Copy s2 to s1, truncating or null-padding to always copy n bytes
 * return s1
 */

char *
strncpy(s1, s2, n)
register char *s1, *s2;
{
	register i;
	register char *os1;

	os1 = s1;
	for (i = 0; i < n; i++)
		if ((*s1++ = *s2++) == '\0') {
			while (++i < n)
				*s1++ = '\0';
			return(os1);
		}
	return(os1);
}
	}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/gen/swab.c   444      0     12         352  3472473672  10061 /*
 * Swap bytes in 16-bit [half-]words
 * for going between the 11 and the interdata
 */

swab(pf, pt, n)
register short *pf, *pt;
register n;
{

	n = n/2;
	while (--n >= 0) {
		*pt++ = (*pf << 8) + ((*pf >> 8) & 0377);
		pf++;
	}
}
== '\0') {
			while (++i < n)
				*s1++ = '\0';
			return(os1);
		}
	return(os1);
}
	}
	return(os1);
}
------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCsumacc/libc/stdio/   775      0     12           0  3472710611   7254 sumacc/libc/stdio/colloq   444      0     12        3741  3472473676  10577 From RUTH@SCORE Fri May 13 15:58:43 1983
Received: from SCORE by Diablo with PUP; Fri, 13 May 83 15:58 PDT
Received: from PARC-MAXC.ARPA by SU-SCORE.ARPA with TCP; Fri 13 May 83 15:58:31-PDT
Received: from SU-SCORE.ARPA by PARC-MAXC.ARPA; 13 MAY 83 15:52:19 PDT
Redistributed: Colloquiums^.PA, colloquiumsothers^.PA
Date: Fri, 13 May 83 15:44:04 PDT
From: Ruth Ferziger <RUTH@SU-SCORE.ARPA>
Subject: COLLOQUIUM NOTICE WEEK OF MAY 16 - 20
To: all-colloquiums@SU-SCORE.ARPA
Status: R

Date	   Place	       Person
Day	   Event	       From
Time			       Title
-------------------------------------------------------------------------------

5/16/83    Math 380C	       Alexsei Shestakov
Monday	   Numerical Analysis  Lawrence Livermore Laboratory
4:15 p.m.   Seminar	       "A Fourier Method for Three Dimensional Elliptic
				Problems"

5/16/83    MJ252	       Brian Wandell
Monday	   Robotics Seminar
4:15 p.m.		       "Sensory Processing: Measurement Versus
				Classification in Perceiving Color"

5/17/83    MJ352	       Neil Rowe
Tuesday    Medical Computing   CSD
1:30 p.m.   Journal Club       "Recent Work in Security and Privacy of Data
				Bases"

5/17/83    MJ352	       Martin Ivers
Tuesday    Knowledge	       VA Information Center
2:30 p.m.   Representation     "A Decentralized Hospital Information System for
	    Group Seminar	the Veterans Administration Medical Centers"

5/17/83    Skilling Auditorium Robert Floyd
Tuesday    Computer Science    CSD
4:15 p.m.   Colloquium	       "What Every Backgammon Player Should Know About
				the Mathematical Sciences"

5/18/83    320-320	       E.Porter
Wednesday  VLSI Systems and    Storage Technology
2:15 p.m.   Design Seminar     "CMOS Processor Design Strategy"
	    EE385

5/19/83    ERL442	       Gordon Foyster
Thursday   Design Automation   Stanford
2:45 p.m.   Seminar	       "An Expert System for VLSI Design"

5/20/83    MJ352	       Jim Gray
Friday	   Database Research   Tandem
3:15 p.m.   Seminar	       "An Extensible Dictionary"



-------

,13,11, 6,
	 4, 3, 2,12, 9, 5,1sumacc/libc/stdio/clrerr.c   444      0     12         144  3472473676  10772 #include	<stdio.h>

clearerr(iop)
register struct _iobuf *iop;
{
	iop->_flag &= ~(_IOERR|_IOEOF);
}
58 PDT
Received: from PARC-MAXC.ARPA by SU-SCORE.ARPA with TCP; Fri 13 May 83 15:58:31-PDT
Received: from SU-SCORE.ARPA by PARC-MAXC.ARPA; 13 MAY 83 15:52:19 PDT
Redistributed: Colloquiums^.PA, colloquiumsothers^.PA
Date: Fri, 13 May 83 15:44:04 PDT
From: Ruth Ferziger <RUTH@SU-SCORE.ARPA>
Subject: COLLOQUIUM NOTICE WEEK OF MAY 16 - 20
To: all-colloquiums@SU-SCORE.ARPA
Status: R

Date	   Place	       Person
Dsumacc/libc/stdio/data.c   444      0     12         613  3472502646  10401 /* @(#)data.c	4.1 (Berkeley) 12/21/80 */
/* Added _IONBF to stdout. Per Bothner 1982/Jun/7 */
#include <stdio.h>

#define _NFILE	20

char	_sibuf[BUFSIZ];
char	_sobuf[BUFSIZ];

struct	_iobuf	_iob[_NFILE] = {
	{ 0, _sibuf, _sibuf, _IOREAD, 0},
	{ 0, NULL, NULL, _IOWRT+_IONBF, 1},
	{ 0, NULL, NULL, _IOWRT+_IONBF, 2},
};
/*
 * Ptr to end of buffers
 */
struct	_iobuf	*_lastbuf ={ &_iob[_NFILE] };
ect: COLLOQUIUM NOTICE WEEK OF MAY 16 - 20
To: all-colloquiums@SU-SCORE.ARPA
Status: R

Date	   Place	       Person
Dsumacc/libc/stdio/doprnt.c   444      0     12        7201  3472473677  11031 # include <stdio.h>

_doprnt(fmt, argp, file)
register char *fmt;
register int *argp;
register FILE *file;
{	register char c, *p, *q;
	register int d, width, ndigit, radix;
	register unsigned n;
	int sign, decpt;
	char t[128], digits[10], zfill, rjust, ndfnd;
	char *ecvt(), *fcvt();
	struct {
		short unsigned length;
		char dtype;
		char class;
		char *ptr;
	} desc;
	p = &t[0];
	while (c = *fmt++)
		if (c != '%')
			*p++ = c;
		else {
			if (p != &t[0]) {
				_strout(t, p-t, 0, file);
				p = &t[0];
			}
			rjust = 0;
			ndigit = 0;
			zfill = ' ';
			if (*fmt == '-') {
				rjust++;
				fmt++;
			}
			if (*fmt == '0') {
				zfill = '0';
				fmt++;
			}
			if(*fmt != '*') { 
				width = 0;
				while ((d = *fmt++ - '0') >= 0 && d <= 9)
					width = width*10+d;
			}
			else {
				fmt++;
				d = *fmt++ - '0';
				width = *argp++;
			}
			ndfnd = 0;
			if ((d += '0') == '.') {
			    if(*fmt != '*') {
				ndigit = 0;
				while ((d = *fmt++ - '0') >= 0 && d <= 9) {
					ndfnd++;
					ndigit = ndigit*10+d;
				}
				d += '0';
			    }
			    else {
				fmt++;
				d = *fmt++;
				ndfnd++;
				ndigit = *argp++;
			    }
			}
			switch (d) {
			case 'l':
			case 'L':
				switch(*fmt++) {
				case 'o': goto loct;
				case 'x': goto lhex;
				case 'd': goto ldec;
				case 'u': goto luns;
				default:
					fmt--;
					goto uns;
				}
			case 'o':
			case 'O':
			loct:	radix = 8;
				n = *argp++;
				goto compute;
			case 'x':
			case 'X':
			lhex:	radix = 16;
				n = *argp++;
				goto compute;
			case 'd':
			case 'D':
			ldec:	radix = 10;
			signed:	if (*argp < 0) {
					*p++ = '-';
					n = -*argp++;
				} else
					n = *argp++;
				goto compute;

			case 'u':
			case 'U':
			luns:
			uns:	n = *argp++;
				radix = 10;
			compute:
				if (n == 0 && ndigit == 0)
					*p++ = '0';
				for (q = &digits[0]; n != 0; n = n/radix)
				{
					d = n%radix;
					*q++ = d + (d<10?'0':'a'-10);
				}
				while (q > &digits[0])
					*p++ = *--q;
				goto prbuf;

			case 'c':
				for (q = (char *)argp++, d = 0; d < 4; d++)
					if ((*p++ = *q++) == 0)
						p--;
			prbuf:	q = &t[0];
			prstr:	if ((d = width - (p - q)) < 0)
					d = 0;
				if (rjust == 0)
					d = -d;
				_strout(q, p-q, d, file, zfill);
				p = &t[0];
				break;

			case 's':
				if ((q = (char *)*argp++) == 0)
					q = "(null)";
				if ((d = ndigit) == 0)
					d = 32767;
				for (p=q; *p!=0 && --d>=0; p++);
				goto prstr;

			case 'r':
				argp = (int *)*argp;
				fmt = (char *)*argp++;
				break;
			case 'f':
				if (ndfnd == 0)
					ndigit = 6;
				q = fcvt(*((double *)argp), ndigit,
					&decpt, &sign); argp += 2;
				if (sign)
					*p++ = '-';
				if ((d = decpt) <= 0)
					*p++ = '0';
				else do {
						*p++ = *q++;
					} while (--d > 0);
				if (d = ndigit)
					*p++ = '.';
				if ((decpt = - decpt) > 0)
					while (--d >= 0) {
						*p++ = '0';
						if (--decpt <= 0)
							break;
					}
				if (d > 0)
					while (--d >= 0)
						*p++ = *q++;
				goto prbuf;

			case 'e':
				if (ndfnd == 0)
					ndigit = 6;
				else
					ndigit += 1;
				q = ecvt(*((double *)argp), ndigit,
					&decpt, &sign); argp += 2;
				if (sign)
					*p++ = '-';
				if (*q == '0')
					decpt += 1;
				*p++ = *q++;
				*p++ = '.';
				for (d = ndigit; --d > 0; *p++ = *q++);
				*p++ = 'e';
				decpt -= 1;
				if (decpt >= 0)
					*p++ = '+';
				else {
					*p++ = '-';
					decpt = -decpt;
				}
				*p++ = (unsigned)decpt/10+'0';
				*p++ = (unsigned)decpt%10+'0';
				goto prbuf;

			case 'g':
				if (ndfnd == 0)
					ndigit = 6;
				gcvt(*((double *)argp), ndigit, p); argp +=2;
				while (*p++ != 0);
				p -= 1;
				goto prbuf;
			case '%':
				*p++= '%';
				break;
			}
	}
	if (p != &t[0])
		_strout(t, p-t, 0, file);
}
case 'l':
			case 'L':
				switch(*fmt++) {
				case 'o': goto loct;
				case 'x': goto lhex;
				case 'd': goto ldec;
				case 'u': goto luns;
				default:
					fmt--;
					goto uns;
				}
			case 'o':
			case 'O':
			loct:	radix = 8;
				n = *argp++;
				goto compute;
			case 'x':
			case 'X':
			lhex:	radix = 16;
				n = *argp++;
				goto compute;
			case 'd':
			case 'D':
			lsumacc/libc/stdio/doscan.c   444      0     12       10707  3472473677  11017 #include <stdio.h>
#include	<ctype.h>

#define	SPC	01
#define	STP	02

#define	SHORT	0
#define	REGULAR	1
#define	LONG	2
#define	INT	0
#define	FLOAT	1

char	*_getccl();

char	_sctab[128] = {
	0,0,0,0,0,0,0,0,
	0,SPC,SPC,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	SPC,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
};

_doscan(iop, fmt, argp)
FILE *iop;
register char *fmt;
register int **argp;
{
	register int ch;
	int nmatch, len, ch1;
	int **ptr, fileended, size;

	nmatch = 0;
	fileended = 0;
	for (;;) switch (ch = *fmt++) {
	case '\0': 
		return (nmatch);
	case '%': 
		if ((ch = *fmt++) == '%')
			goto def;
		ptr = 0;
		if (ch != '*')
			ptr = argp++;
		else
			ch = *fmt++;
		len = 0;
		size = REGULAR;
		while (ch>='0' && ch <='9') {
			len = len*10 + ch - '0';
			ch = *fmt++;
		}
		if (len == 0)
			len = 30000;
		if (ch=='l') {
			ch = *fmt++;
			size = LONG;
		} else if (ch=='h') {
			size = SHORT;
			ch = *fmt++;
		} else if (ch=='[')
			fmt = _getccl(fmt);
		if (isupper(ch)) {
			ch = tolower(ch);
			size = LONG;
		}
		if (ch == '\0')
			return(-1);
		if (_innum(ptr, ch, len, size, iop, &fileended) && ptr)
			nmatch++;
		if (fileended)
			return(nmatch? nmatch: -1);
		break;

	case ' ':
	case '\n':
	case '\t': 
		while ((ch1 = getc(iop))==' ' || ch1=='\t' || ch1=='\n')
			;
		if (ch1 != EOF)
			ungetc(ch1, iop);
		break;

	default: 
	def:
		ch1 = getc(iop);
		if (ch1 != ch) {
			if (ch1==EOF)
				return(-1);
			ungetc(ch1, iop);
			return(nmatch);
		}
	}
}

_innum(ptr, type, len, size, iop, eofptr)
int **ptr, *eofptr;
struct _iobuf *iop;
{
	extern double atof();
	register char *np;
	char numbuf[64];
	register c, base;
	int expseen, scale, negflg, c1, ndigit;
	long lcval;

	if (type=='c' || type=='s' || type=='[')
		return(_instr(ptr? *(char **)ptr: (char *)NULL, type, len, iop, eofptr));
	lcval = 0;
	ndigit = 0;
	scale = INT;
	if (type=='e'||type=='f')
		scale = FLOAT;
	base = 10;
	if (type=='o')
		base = 8;
	else if (type=='x')
		base = 16;
	np = numbuf;
	expseen = 0;
	negflg = 0;
	while ((c = getc(iop))==' ' || c=='\t' || c=='\n');
	if (c=='-') {
		negflg++;
		*np++ = c;
		c = getc(iop);
		len--;
	} else if (c=='+') {
		len--;
		c = getc(iop);
	}
	for ( ; --len>=0; *np++ = c, c = getc(iop)) {
		if ('0'<=c && c<='9'
		 || base==16 && ('a'<=c && c<='f' || 'A'<=c && c<='F')) {
			ndigit++;
			if (base==8)
				lcval <<=3;
			else if (base==10)
				lcval = ((lcval<<2) + lcval)<<1;
			else
				lcval <<= 4;
			c1 = c;
			if ('0'<=c && c<='9')
				c -= '0';
			else if ('a'<=c && c<='f')
				c -= 'a'-10;
			else
				c -= 'A'-10;
			lcval += c;
			c = c1;
			continue;
		} else if (c=='.') {
			if (base!=10 || scale==INT)
				break;
			ndigit++;
			continue;
		} else if ((c=='e'||c=='E') && expseen==0) {
			if (base!=10 || scale==INT || ndigit==0)
				break;
			expseen++;
			*np++ = c;
			c = getc(iop);
			if (c!='+'&&c!='-'&&('0'>c||c>'9'))
				break;
		} else
			break;
	}
	if (negflg)
		lcval = -lcval;
	if (c != EOF) {
		ungetc(c, iop);
		*eofptr = 0;
	} else
		*eofptr = 1;
	if (ptr==NULL || np==numbuf)
		return(0);
	*np++ = 0;
	switch((scale<<4) | size) {

	case (FLOAT<<4) | SHORT:
	case (FLOAT<<4) | REGULAR:
		*(*((float **)ptr)) = atof(numbuf);
		break;

	case (FLOAT<<4) | LONG:
		*(*((double **)ptr)) = atof(numbuf);
		break;

	case (INT<<4) | SHORT:
		**(short **)ptr = lcval;
		break;

	case (INT<<4) | REGULAR:
		**(int **)ptr = lcval;
		break;

	case (INT<<4) | LONG:
		**(long **)ptr = lcval;
		break;
	}
	return(1);
}

_instr(ptr, type, len, iop, eofptr)
register char *ptr;
register struct _iobuf *iop;
int *eofptr;
{
	register ch;
	register char *optr;
	int ignstp;

	*eofptr = 0;
	optr = ptr;
	if (type=='c' && len==30000)
		len = 1;
	ignstp = 0;
	if (type=='s')
		ignstp = SPC;
	while (_sctab[ch = getc(iop)] & ignstp)
		if (ch==EOF)
			break;
	ignstp = SPC;
	if (type=='c')
		ignstp = 0;
	else if (type=='[')
		ignstp = STP;
	while (ch!=EOF && (_sctab[ch]&ignstp)==0) {
		if (ptr)
			*ptr++ = ch;
		if (--len <= 0)
			break;
		ch = getc(iop);
	}
	if (ch != EOF) {
		if (len > 0)
			ungetc(ch, iop);
		*eofptr = 0;
	} else
		*eofptr = 1;
	if (ptr && ptr!=optr) {
		if (type!='c')
			*ptr++ = '\0';
		return(1);
	}
	return(0);
}

char *
_getccl(s)
register char *s;
{
	register c, t;

	t = 0;
	if (*s == '^') {
		t++;
		s++;
	}
	for (c = 0; c < 128; c++)
		if (t)
			_sctab[c] &= ~STP;
		else
			_sctab[c] |= STP;
	while (((c = *s++)&0177) != ']') {
		if (t)
			_sctab[c++] |= STP;
		else
			_sctab[c++] &= ~STP;
		if (c==0)
			return(--s);
	}
	return(s);
}
(ndfnd == 0)
					ndigit = 6;
				q = fcvt(*((double *)arsumacc/libc/stdio/fgetc.c   444      0     12          77  3472473677  10557 #include <stdio.h>

fgetc(fp)
FILE *fp;
{
	return(getc(fp));
}
{
		negflg++;
		*np++ = c;
		c = getc(iop);
		len--;
	} else if (c=='+') {
		len--;
		c = getc(iop);
	}
	for ( ; --len>=0; *np++ = c, c = getc(iop)) {
		if ('0'<=c && c<='9'
		 || base==16 && ('a'<=c && c<='f' || 'A'<=c && c<='F')) {
			ndigit++;
			if (base==8)
				lcval <<=3;
			else if (base==10)
				lcval = ((lcval<<2) + lcval)<<1;
			else
				lcval <<= 4;
			c1 = c;
			if ('0'<=c && c<='9')
				c -= '0';
			else if ('a'<=c && c<='f')
				c sumacc/libc/stdio/fgets.c   444      0     12         406  3472473677  10613 #include	<stdio.h>

char *
fgets(s, n, iop)
char *s;
register FILE *iop;
{
	register c;
	register char *cs;

	cs = s;
	while (--n>0 && (c = getc(iop))>=0) {
		*cs++ = c;
		if (c=='\n')
			break;
	}
	if (c<0 && cs==s)
		return(NULL);
	*cs++ = '\0';
	return(s);
}
 && c<='f' || 'A'<=c && c<='F')) {
			ndigit++;
			if (base==8)
				lcval <<=3;
			else if (base==10)
				lcval = ((lcval<<2) + lcval)<<1;
			else
				lcval <<= 4;
			c1 = c;
			if ('0'<=c && c<='9')
				c -= '0';
			else if ('a'<=c && c<='f')
				c sumacc/libc/stdio/filbuf.c   444      0     12        5143  3472502740  10755 #include	<stdio.h>

#define	_NFILE	20

#undef getchar
#undef putchar

_filbuf(iop)
register FILE *iop;
{
	static char smallbuf[_NFILE];

	if ((iop->_flag&_IOREAD) == 0)
		return(EOF);
	if (iop->_flag&_IOSTRG)
		return(EOF);
tryagain:
	if (iop->_base==NULL) {
		if (iop->_flag&_IONBF) {
			iop->_base = &smallbuf[fileno(iop)];
			goto tryagain;
		}
		iop->_flag |= _IONBF;
		goto tryagain;
	}
	iop->_ptr = iop->_base;
	iop->_cnt = x_read(iop->_ptr, iop->_flag&_IONBF?1:BUFSIZ);
	if (--iop->_cnt < 0) {
		if (iop->_cnt == -1)
			iop->_flag |= _IOEOF;
		else
			iop->_flag |= _IOERR;
		iop->_cnt = 0;
		return(-1);
	}
	return(*iop->_ptr++&0377);
}

x_read(adr,max)
register char *adr;
register int max;
{
	register char *cptr = adr;
	register char c;
	register int count = 0;
	register int NonSpaceSeen = 0;
	
	while (count++ < max) {
		c = getchar()&0x7F;	/* strip parity, sucko concepts */
		if (c == '\r') {	/* change \n to \r */
		    c = '\n';
		    putchar('\n');	/* echo a newline, too */
		}
		*cptr++ = c;

		if (c == '\n') break;

		switch (c) {

		case '\04':	/* CTRL/D == EOF */
			return(-1);

		case '\b':	/* backspace */
			putchar(' ');	/* cancel effect of backspace */
					/* then drop into <delete> */
		case 0x7F:	/* <delete> */
			cptr--;		/* remove <delete> */
			if (--count == 0) {	/* end of the line */
			    break;
			}
			count--;	/* don't count erased char */
			if (*--cptr == '\t') {  /* tabs are a pain */
			    cptr = 0;	/* null-term it here */
			    printf("\n%s",adr);	/* reprint line */
			}
			else
			    printf("\b \b");
			break;

		case '\025':	/* CTRL/U == kill line */
				/* but only for this call of x_read()! */
			cptr = adr;
			count = 0;
			printf(" XXX\n");
			break;

		case '\022':	/* CTRL/R == reprint line */
			*cptr-- = 0;	/* null-term it here */
			count--;	/* ignore the CTRL/R */
			printf("\n%s",adr);	/* reprint what WE have */
			break;
		
		case '\027':	/* CTRL/W == erase word */
			cptr -= 2;   /* ignore CTRL/W, point to last char */
			count--;
			NonSpaceSeen = 0;
			
			while (count) {
			    if (NonSpaceSeen) {
			    	if ((*cptr == ' ') || (*cptr == '\t'))
				    break;
			    }
			    if (*cptr == '\t') { /* tabs are a pain */
				/* first, eat up white space */
				while ((*cptr == '\t') || (*cptr == ' ')) {
				    *cptr-- = 0;   /* null-term it here */
				    if (count-- == 0) break;
				}
				/* then, reprint line */
				printf("\n%s",adr);
				continue;
			    }
			    if (*cptr != ' ') NonSpaceSeen++;
			    cptr--;
			    count--;
			    printf("\b \b");
			}
			cptr++;	/* now point to free slot */
			break;
		
		default:
			break;
			
		}
	}
	
	return(count);
}

		

	32,27, 3, 9,
	19,13,30, 6,
	22,11, 4,25,
};

/*
 * The current block, divided into 2 halves.
 */
static	char	L[32], R[32];
static	char	tempL[32];
static	char	f[32];

/*
 * The combination of the key and the input, before selection.
 */
static	char	preS[48];

/*
 * The payoff: encrypt a block.
 */

encrypt(block, edflag)
char *block;
{
	int i, ii;
	register t, j, k;

	/*
	 * First, permute the bits in the inpsumacc/libc/stdio/flsbuf.c   444      0     12        2750  3472473677  11010 #include	<stdio.h>

#undef putchar

_flsbuf(c, iop)
register FILE *iop;
{
	register char *base;
	register char *tptr;
	register n, rn;
	register int ii;
	char c1;
	extern char _sobuf[];

	if ((iop->_flag&_IOWRT)==0)
		return(EOF);
tryagain:
	if (iop->_flag&_IONBF) {
		c1 = c;
		rn = 1;
		n = rn;
		putchar(c1);
		iop->_cnt = 0;
	} else {
		if ((base=iop->_base)==NULL) {
			if (iop==stdout) {
				iop->_flag |= _IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iop->_ptr - base) > 0) {
			iop->_ptr = base;
			for (ii = 0, tptr = base; ii < n; ii++)
			    putchar(*tptr++);
		}
		iop->_cnt = BUFSIZ-1;
		*base++ = c;
		iop->_ptr = base;
	}
	if (rn != n) {
		iop->_flag |= _IOERR;
		return(EOF);
	}
	return(c);
}

fflush(iop)
register struct _iobuf *iop;
{
	register char *base;
	register n;

	if ((iop->_flag&(_IONBF|_IOWRT))==_IOWRT
	 && (base=iop->_base)!=NULL && (n=iop->_ptr-base)>0) {
		iop->_ptr = base;
		iop->_cnt = BUFSIZ;
		while (n--) putchar(base++);
	}
	return(0);
}

/*
 * Flush buffers on exit
 */

_cleanup()
{
	register struct _iobuf *iop;
	extern struct _iobuf *_lastbuf;

	for (iop = _iob; iop < _lastbuf; iop++)
		fclose(iop);
}

fclose(iop)
register struct _iobuf *iop;
{
	register r;

	r = EOF;
	if (iop->_flag&(_IOREAD|_IOWRT) && (iop->_flag&_IOSTRG)==0) {
		r = fflush(iop);
		if (iop->_flag&(_IOMYBUF|_IONBF))
			iop->_base = NULL;
	}
	iop->_flag &= ~(_IOREAD|_IOWRT|_IONBF|_IOMYBUF|_IOERR|_IOEOF|_IOSTRG);
	iop->_cnt = 0;
	return(r);
}
t line */
			}
			else
	sumacc/libc/stdio/fprintf.c   444      0     12         177  3472473700  11143 #include	<stdio.h>

fprintf(iop, fmt, args)
FILE *iop;
char *fmt;
{
	_doprnt(fmt, &args, iop);
	return(ferror(iop)? EOF: 0);
}
 n, rn;
	register int ii;
	char c1;
	extern char _sobuf[];

	if ((iop->_flag&_IOWRT)==0)
		return(EOF);
tryagain:
	if (iop->_flag&_IONBF) {
		c1 = c;
		rn = 1;
		n = rn;
		putchar(c1);
		iop->_cnt = 0;
	} else {
		if ((base=iop->_base)==NULL) {
			if (iop==stdout) {
				iop->_flag |= _IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/fputc.c   444      0     12         105  3472473700  10603 #include <stdio.h>

fputc(c, fp)
FILE *fp;
{
	return(putc(c, fp));
}
_doprnt(fmt, &args, iop);
	return(ferror(iop)? EOF: 0);
}
 n, rn;
	register int ii;
	char c1;
	extern char _sobuf[];

	if ((iop->_flag&_IOWRT)==0)
		return(EOF);
tryagain:
	if (iop->_flag&_IONBF) {
		c1 = c;
		rn = 1;
		n = rn;
		putchar(c1);
		iop->_cnt = 0;
	} else {
		if ((base=iop->_base)==NULL) {
			if (iop==stdout) {
				iop->_flag |= _IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/fputs.c   444      0     12         231  3472473700  10623 #include	<stdio.h>

fputs(s, iop)
register char *s;
register FILE *iop;
{
	register r;
	register c;

	while (c = *s++)
		r = putc(c, iop);
	return(r);
}
	char c1;
	extern char _sobuf[];

	if ((iop->_flag&_IOWRT)==0)
		return(EOF);
tryagain:
	if (iop->_flag&_IONBF) {
		c1 = c;
		rn = 1;
		n = rn;
		putchar(c1);
		iop->_cnt = 0;
	} else {
		if ((base=iop->_base)==NULL) {
			if (iop==stdout) {
				iop->_flag |= _IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/gets.c   444      0     12         321  3472473700  10424 #include	<stdio.h>

char *
gets(s)
char *s;
{
	register c;
	register char *cs;

	cs = s;
	while ((c = getchar()) != '\n' && c >= 0)
		*cs++ = c;
	if (c<0 && cs==s)
		return(NULL);
	*cs++ = '\0';
	return(s);
}
T)==0)
		return(EOF);
tryagain:
	if (iop->_flag&_IONBF) {
		c1 = c;
		rn = 1;
		n = rn;
		putchar(c1);
		iop->_cnt = 0;
	} else {
		if ((base=iop->_base)==NULL) {
			if (iop==stdout) {
				iop->_flag |= _IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/getw.c   444      0     12         240  3472473700  10430 #include	<stdio.h>

getw(iop)
register struct _iobuf *iop;
{
	register i;

	i = getc(iop);
	if (iop->_flag&_IOEOF)
		return(-1);
	return(i | (getc(iop)<<8));
}
=s)
		return(NULL);
	*cs++ = '\0';
	return(s);
}
T)==0)
		return(EOF);
tryagain:
	if (iop->_flag&_IONBF) {
		c1 = c;
		rn = 1;
		n = rn;
		putchar(c1);
		iop->_cnt = 0;
	} else {
		if ((base=iop->_base)==NULL) {
			if (iop==stdout) {
				iop->_flag |= _IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/puts.c   444      0     12         170  3472473700  10457 #include	<stdio.h>

puts(s)
register char *s;
{
	register c;

	while (c = *s++)
		putchar(c);
	return(putchar('\n'));
}
urn(-1);
	return(i | (getc(iop)<<8));
}
=s)
		return(NULL);
	*cs++ = '\0';
	return(s);
}
T)==0)
		return(EOF);
tryagain:
	if (iop->_flag&_IONBF) {
		c1 = c;
		rn = 1;
		n = rn;
		putchar(c1);
		iop->_cnt = 0;
	} else {
		if ((base=iop->_base)==NULL) {
			if (iop==stdout) {
				iop->_flag |= _IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/putw.c   444      0     12         157  3472473700  10470 #include	<stdio.h>

putw(i, iop)
register i;
register struct _iobuf *iop;
{
	putc(i, iop);
	putc(i>>8, iop);
}
\n'));
}
urn(-1);
	return(i | (getc(iop)<<8));
}
=s)
		return(NULL);
	*cs++ = '\0';
	return(s);
}
T)==0)
		return(EOF);
tryagain:
	if (iop->_flag&_IONBF) {
		c1 = c;
		rn = 1;
		n = rn;
		putchar(c1);
		iop->_cnt = 0;
	} else {
		if ((base=iop->_base)==NULL) {
			if (iop==stdout) {
				iop->_flag |= _IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/scanf.c   444      0     12         635  3472473701  10565 #include	<stdio.h>

scanf(fmt, args)
char *fmt;
{
	return(_doscan(stdin, fmt, &args));
}

fscanf(iop, fmt, args)
FILE *iop;
char *fmt;
{
	return(_doscan(iop, fmt, &args));
}

sscanf(str, fmt, args)
register char *str;
char *fmt;
{
	FILE _strbuf;

	_strbuf._flag = _IOREAD|_IOSTRG;
	_strbuf._ptr = _strbuf._base = str;
	_strbuf._cnt = 0;
	while (*str++)
		_strbuf._cnt++;
	return(_doscan(&_strbuf, fmt, &args));
}
IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/setbuf.c   444      0     12         441  3472473701  10756 #include	<stdio.h>

setbuf(iop, buf)
register struct _iobuf *iop;
char *buf;
{
	if (iop->_base != NULL && iop->_flag&_IOMYBUF)
		free(iop->_base);
	iop->_flag &= ~(_IOMYBUF|_IONBF);
	if ((iop->_base = buf) == NULL)
		iop->_flag |= _IONBF;
	else
		iop->_ptr = iop->_base;
	iop->_cnt = 0;
}
._ptr = _strbuf._base = str;
	_strbuf._cnt = 0;
	while (*str++)
		_strbuf._cnt++;
	return(_doscan(&_strbuf, fmt, &args));
}
IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/sprintf.c   444      0     12         362  3472473701  11155 #include	<stdio.h>

char *sprintf(str, fmt, args)
char *str, *fmt;
{
	struct _iobuf _strbuf;

	_strbuf._flag = _IOWRT+_IOSTRG;
	_strbuf._ptr = str;
	_strbuf._cnt = 32767;
	_doprnt(fmt, &args, &_strbuf);
	putc('\0', &_strbuf);
	return(str);
}
se
		iop->_ptr = iop->_base;
	iop->_cnt = 0;
}
._ptr = _strbuf._base = str;
	_strbuf._cnt = 0;
	while (*str++)
		_strbuf._cnt++;
	return(_doscan(&_strbuf, fmt, &args));
}
IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/strout.c   444      0     12         604  3472473701  11027 #include	<stdio.h>

_strout(string, count, adjust, file, fillch)
register char *string;
register count;
int adjust;
register struct _iobuf *file;
{
	while (adjust < 0) {
		if (*string=='-' && fillch=='0') {
			putc(*string++, file);
			count--;
		}
		putc(fillch, file);
		adjust++;
	}
	while (--count>=0)
		putc(*string++, file);
	while (adjust) {
		putc(fillch, file);
		adjust--;
	}
}
_strbuf, fmt, &args));
}
IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/ungetc.c   444      0     12         424  3472473701  10754 #include <stdio.h>

ungetc(c, iop)
register FILE *iop;
{
	if (c == EOF)
		return(-1);
	if ((iop->_flag&_IOREAD)==0 || iop->_ptr <= iop->_base)
		if (iop->_ptr == iop->_base && iop->_cnt==0)
			*iop->_ptr++;
		else
			return(-1);
	iop->_cnt++;
	*--iop->_ptr = c;
	return(0);
}
ust++;
	}
	while (--count>=0)
		putc(*string++, file);
	while (adjust) {
		putc(fillch, file);
		adjust--;
	}
}
_strbuf, fmt, &args));
}
IONBF;
				goto tryagain;
			}
			iop->_flag |= _IONBF;
			goto tryagain;
		} else if ((rn = n = iosumacc/libc/stdio/makefile   444      0     12         740  3472503245  11021 # Makefile for libc/stdio
# Modified by Bill Nowicki April 1982

.SUFFIXES: .b .c .s

OBJS = clrerr.b data.b doprnt.b doscan.b fgetc.b fgets.b filbuf.b flsbuf.b \
	fprintf.b fputc.b fputs.b gets.b getw.b puts.b putw.b scanf.b \
	setbuf.b sprintf.b strout.b ungetc.b

all: $(OBJS)

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean: 
	rm -f *.b *CKP *BAK

#(*) UNIX is a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/   775      0     12           0  3472473706   6732 sumacc/libc/emt/getconfig.c   444      0     12         367  3472473704  11110 /* LINTLIBRARY */
/*
 * getconfig.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_getconfig()	-- returns processor board configuration
 */

#include <sunemt.h>

int emt_getconfig()
{
	return(
	    emt_call(EMT_GETCONFIG)
	);
}
 strout.b ungetc.b

all: $(OBJS)

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean: 
	rm -f *.b *CKP *BAK

#(*) UNIX is a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/emtcall.c   444      0     12         677  3472473704  10570 /* LINTLIBRARY */
/*
 * emtcall.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_call(traptype[,arg1[,arg2[,arg3]]])
 *	emulator trap calling routine
 */

#include <sunemt.h>

int emt_call(trtype,trarg1,trarg2,trarg3)
int trtype;
int trarg1;
int trarg2;
int trarg3;
{
	asm("	movl a6@(20.),sp@-");
	asm("	movl a6@(16.),sp@-");
	asm("	movl a6@(12.),sp@-");
	asm("	movl a6@(8.),sp@-");
	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/emtgetchar.c   444      0     12         373  3472473705  11264 /* LINTLIBRARY */
/*
 * emtgetchar.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * char emt_getchar()	-- returns character read from console keyboard
 */

#include <sunemt.h>

char emt_getchar()
{
	return(
	    emt_call(EMT_GETCHAR)
	);
}
t trarg1;
int trarg2;
int trarg3;
{
	asm("	movl a6@(20.),sp@-");
	asm("	movl a6@(16.),sp@-");
	asm("	movl a6@(12.),sp@-");
	asm("	movl a6@(8.),sp@-");
	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/emtputchar.c   444      0     12         366  3472473705  11317 /* LINTLIBRARY */
/*
 * emtputchar.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_putchar(c)	-- prints character c on Console
 */

#include <sunemt.h>

int emt_putchar(c)
char c;
{
	return(
	    emt_call(EMT_PUTCHAR,c)
	);
}
);
}
t trarg1;
int trarg2;
int trarg3;
{
	asm("	movl a6@(20.),sp@-");
	asm("	movl a6@(16.),sp@-");
	asm("	movl a6@(12.),sp@-");
	asm("	movl a6@(8.),sp@-");
	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/getcontext.c   444      0     12         377  3472473705  11331 /* LINTLIBRARY */
/*
 * getcontext.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_getcontext()	-- returns current context register contents
 */

#include <sunemt.h>

int emt_getcontext()
{
	return(
	    emt_call(EMT_GETCONTEXT)
	);
}
arg1;
int trarg2;
int trarg3;
{
	asm("	movl a6@(20.),sp@-");
	asm("	movl a6@(16.),sp@-");
	asm("	movl a6@(12.),sp@-");
	asm("	movl a6@(8.),sp@-");
	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/getmemsize.c   444      0     12         373  3472473705  11312 /* LINTLIBRARY */
/*
 * getmemsize.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_getmemsize()	-- returns on-board memory size in bytes
 */

#include <sunemt.h>

int emt_getmemsize()
{
	return(
	    emt_call(EMT_GETMEMSIZE)
	);
}
;
}
arg1;
int trarg2;
int trarg3;
{
	asm("	movl a6@(20.),sp@-");
	asm("	movl a6@(16.),sp@-");
	asm("	movl a6@(12.),sp@-");
	asm("	movl a6@(8.),sp@-");
	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/getsegmap.c   444      0     12         442  3472473705  11112 /* LINTLIBRARY */
/*
 * getsegmap.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_getsegmap(cxt,segno)	-- 
 *	returns segment map entry #segno in context #cxt
 */

#include <sunemt.h>

int emt_getsegmap(cxt,segno)
{
	return(
	    emt_call(EMT_GETSEGMAP,cxt,segno)
	);
}
m("	movl a6@(20.),sp@-");
	asm("	movl a6@(16.),sp@-");
	asm("	movl a6@(12.),sp@-");
	asm("	movl a6@(8.),sp@-");
	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/makefile   444      0     12         621  3472473705  10471 # Makefile for libc/emt (MC68000)
.SUFFIXES: .b .c .s

OBJS = emtcall.b emtgetchar.b emtputchar.b getcontext.b getmemsize.b \
	getsegmap.b setcontext.b setecho.b setsegmap.b ticks.b version.b \
	getconfig.b fbmode.b mayget.b mayput.b


all: $(OBJS)

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK

	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/setcontext.c   444      0     12         405  3472473706  11336 /* LINTLIBRARY */
/*
 * setcontext.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_setcontext(cxt)	-- sets context register to cxt
 */

#include <sunemt.h>

int emt_setcontext(cxt)
int cxt;
{
	return(
	    emt_call(EMT_SETCONTEXT,cxt)
	);
}
ke a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK

	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/setecho.c   444      0     12         423  3472473706  10570 /* LINTLIBRARY */
/*
 * setecho.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * setecho(flag) -- sets console echo mode:
 *		if (flag) then echo; else dont't echo;
 */

#include <sunemt.h>

setecho(flag)
int flag;
{
	return(
	    emt_call(EMT_SETECHO,flag)
	);
}
rom a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK

	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/setsegmap.c   444      0     12         523  3472473706  11127 /* LINTLIBRARY */
/*
 * setsegmap.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_setsegmap(cxt,segno,entry)	-- 
 *	sets segment map #segno in context #cxt to entry
 */

#include <sunemt.h>

int emt_setsegmap(cxt,segno,entry)
int cxt;
int segno;
int entry;
{
	return(
	    emt_call(EMT_SETSEGMAP,cxt,segno,entry)
	);
}
om a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK

	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/ticks.c   444      0     12         353  3472473706  10255 /* LINTLIBRARY */
/*
 * ticks.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_ticks()	-- returns milliseconds since monitor booted
 */

#include <sunemt.h>

int emt_ticks()
{
	return(
	    emt_call(EMT_TICKS)
	);
}
gno,entry)
int cxt;
int segno;
int entry;
{
	return(
	    emt_call(EMT_SETSEGMAP,cxt,segno,entry)
	);
}
om a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK

	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/version.c   444      0     12         350  3472473706  10622 /* LINTLIBRARY */
/*
 * version.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_version()	-- returns monitor version number
 */

#include <sunemt.h>

int emt_version()
{
	return(
	    emt_call(EMT_VERSION)
	);
}

}
gno,entry)
int cxt;
int segno;
int entry;
{
	return(
	    emt_call(EMT_SETSEGMAP,cxt,segno,entry)
	);
}
om a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK

	asm("	trap #15.");
	asm("	addql #8.,sp");
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/fbmode.c   444      0     12         672  3472473706  10400 /* LINTLIBRARY */
/*
 * fbmode.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * fbmode(mode) -- sets/queries monitor's frame buffer mode:
 *
 * INPUT:	flag = 1 or -1 => set FB mode to flag (unless FBmode == 0)
 *		flag = <other>	=> no side effects
 * OUTPUT:	1 = using FB
 *		0 = no fb present
 *		-1 = fb present but not in use
 *		
 */

#include <sunemt.h>

fbmode(mode)
int mode;
{
	return(
	    emt_call(EMT_FBMODE,mode)
	);
}
);
}
a trademark of Bell Laboratories
again;
		} else if ((rn = n = iosumacc/libc/emt/mayget.c   444      0     12        1015  3472473706  10442 /* LINTLIBRARY */
/*
 * mayget.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * char emt_mayget()	-- returns character read from console keyboard
			   if one is there, else -1 (nonblocking getchar)
 */

#include <sunemt.h>

char emt_mayget()
{

/* the proper way
	return(
	    emt_call(EMT_MAYGET)
	);

the improper way, will do till EMT_MAYGET is installed */
	if (*(short *)0x400000 == 0x5375)  /* if SMI */
	    return emt_call(EMT_MAYGET);
	else if (!linereadyrx(0)) return -1;
	else return lineget(0)&127;
}
e) > 0) {
			iop->_ptr = base;
			for (ii = 0, tptr = base; ii < n; ii++)
			    putchar(*tptr++);
		}
		iop->_cnt = BUFSIZ-1;
		*base++ = c;
		iop->_ptr = base;
	}
	if (rn != n) {
		iop->_flag |= _IOERR;
		return(EOF);
	}
	return(c);
}

fflush(iop)
register struct _iobuf *iop;
{
	register char *base;
	register n;

	if ((iop->_flag&(_IONBF|_IOWRT))==_IOWRT
	 && (base=iop->_base)!=NULL && (n=iop->_ptr-base)>0) {
		iop->_ptr = base;
		iop->_cnt = BUFSIZ;
		while (n--) putchar(base++);
	}
	return(sumacc/libc/emt/mayput.c   444      0     12        1017  3472473706  10475 /* LINTLIBRARY */
/*
 * mayput.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_mayput(c)	-- prints character c on Console if possible
 *			   otherwise returns -1
 */

#include <sunemt.h>

int emt_mayput(c)
char c;
{

/* the proper way
	return(
	    emt_call(EMT_MAYPUT,c)
	);

a bad way, will do till EMT_MAYPUT is installed in all proms */
	if (*(short *)0x400000 == 0x5375)  /* if SMI */
	    return emt_call(EMT_MAYPUT,c);
	else if (!linereadytx(0)) return -1;
	else {
		lineput(0,c);
		return 0;
	}
}

*/
/*
 * mayput.c
 *
 * Sun MC68000 ROM monitor Emulator Trap package
 *
 * int emt_mayput(c)	-- prints character c on Console if possible
 *			   otherwise returns -1
 */

#include <sunemt.h>

int emt_mayput(c)
char c;
{

/* the proper way
	return(
	    emt_call(EMT_MAYPUT,c)
	);

a bad way, will do till EMT_MAYPUT is installed in all proms */
	if (*(short *)0x400000 == 0x5375)  /* if SMI */
	    return emt_call(EMT_MAYPUT,c);
	else if (!linereadytx(0)) return -1;
	else {
		lineput(0,c);
		rsumacc/libc/sunstuff/   775      0     12           0  3472710606  10013 sumacc/libc/sunstuff/ddtinit.c   444      0     12         266  3472473710  11665 /*
 * ddtinit.c
 *
 * dummy init for ddt (linked when -lddt not given to cc68);
 * called by crtsun.b
 *
 *	Jeffrey Mogul	2 Feb 1982	(in a hurry)
 *		original by VRP
 */
ddtinit(){}

 */

#include <sunemt.h>

int emt_mayput(c)
char c;
{

/* the proper way
	return(
	    emt_call(EMT_MAYPUT,c)
	);

a bad way, will do till EMT_MAYPUT is installed in all proms */
	if (*(short *)0x400000 == 0x5375)  /* if SMI */
	    return emt_call(EMT_MAYPUT,c);
	else if (!linereadytx(0)) return -1;
	else {
		lineput(0,c);
		rsumacc/libc/sunstuff/chrtab.c   444      0     12       21076  3472473710  11533 char	chrtab[][16] = {
0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, sp, */
0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0010,0000,0000,0000,0000,0000, /*, !, */
0024,0024,0024,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ", */
0000,0000,0000,0044,0044,0176,0044,0044,0176,0044,0044,0000,0000,0000,0000,0000, /*, #, */
0000,0010,0010,0010,0076,0101,0100,0076,0001,0101,0076,0010,0010,0000,0000,0000, /*, $, */
0000,0000,0000,0141,0142,0004,0010,0010,0020,0043,0103,0000,0000,0000,0000,0000, /*, %, */
0000,0000,0070,0104,0110,0060,0060,0111,0106,0106,0071,0000,0000,0000,0000,0000, /*, &, */
0004,0010,0020,0040,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ', */
0000,0004,0010,0020,0040,0040,0040,0040,0040,0040,0020,0010,0004,0000,0000,0000, /*, (, */
0000,0040,0020,0010,0004,0004,0004,0004,0004,0004,0010,0020,0040,0000,0000,0000, /*, ), */
0000,0000,0000,0010,0111,0052,0034,0177,0034,0052,0111,0010,0000,0000,0000,0000, /*, *, */
0000,0000,0000,0000,0010,0010,0010,0177,0010,0010,0010,0000,0000,0000,0000,0000, /*, +, */
0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0010,0020,0000,0000,0000, /*, ,, */
0000,0000,0000,0000,0000,0000,0000,0176,0000,0000,0000,0000,0000,0000,0000,0000, /*, -, */
0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0000,0000,0000,0000,0000, /*, ., */
0000,0000,0001,0002,0004,0010,0010,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, /, */
0000,0030,0044,0102,0102,0102,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 0, */
0000,0010,0030,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, 1, */
0000,0070,0104,0004,0004,0010,0020,0040,0100,0100,0174,0000,0000,0000,0000,0000, /*, 2, */
0000,0176,0004,0004,0010,0014,0002,0002,0002,0104,0070,0000,0000,0000,0000,0000, /*, 3, */
0000,0004,0014,0024,0044,0104,0176,0004,0004,0004,0004,0000,0000,0000,0000,0000, /*, 4, */
0000,0174,0100,0100,0130,0144,0002,0002,0102,0044,0030,0000,0000,0000,0000,0000, /*, 5, */
0000,0074,0102,0100,0130,0144,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 6, */
0000,0176,0004,0004,0010,0010,0020,0020,0040,0040,0040,0000,0000,0000,0000,0000, /*, 7, */
0000,0034,0042,0101,0042,0076,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, 8, */
0000,0034,0042,0101,0101,0101,0043,0036,0004,0010,0020,0040,0000,0000,0000,0000, /*, 9, */
0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0000,0000,0000,0000,0000, /*, :, */
0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0020,0040,0000,0000,0000, /*, ;, */
0002,0004,0010,0020,0040,0100,0040,0020,0010,0004,0002,0000,0000,0000,0000,0000, /*, <, */
0000,0000,0000,0000,0177,0000,0177,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, =, */
0100,0040,0020,0010,0004,0002,0004,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, >, */
0000,0030,0044,0102,0001,0002,0004,0010,0010,0000,0010,0000,0000,0000,0000,0000, /*, ?, */
0000,0074,0102,0101,0115,0123,0121,0121,0121,0111,0046,0000,0000,0000,0000,0000, /*, @, */
0000,0010,0024,0042,0101,0101,0177,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, A, */
0000,0176,0101,0101,0101,0176,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, B, */
0000,0076,0101,0100,0100,0100,0100,0100,0100,0101,0076,0000,0000,0000,0000,0000, /*, C, */
0000,0176,0101,0101,0101,0101,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, D, */
0000,0176,0100,0100,0100,0170,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, E, */
0000,0177,0100,0100,0100,0174,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, F, */
0000,0076,0101,0100,0100,0117,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, G, */
0000,0101,0101,0101,0101,0176,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, H, */
0000,0034,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, I, */
0000,0016,0004,0004,0004,0004,0004,0004,0104,0104,0070,0000,0000,0000,0000,0000, /*, J, */
0000,0101,0102,0104,0110,0120,0160,0110,0104,0102,0101,0000,0000,0000,0000,0000, /*, K, */
0000,0100,0100,0100,0100,0100,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, L, */
0000,0101,0143,0125,0111,0101,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, M, */
0000,0101,0141,0121,0111,0105,0103,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, N, */
0000,0076,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, O, */
0000,0176,0101,0101,0101,0176,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, P, */
0000,0076,0101,0101,0101,0101,0101,0101,0131,0105,0076,0002,0001,0000,0000,0000, /*, Q, */
0000,0176,0101,0101,0101,0176,0104,0102,0101,0101,0101,0000,0000,0000,0000,0000, /*, R, */
0000,0076,0101,0100,0100,0076,0001,0001,0001,0101,0076,0000,0000,0000,0000,0000, /*, S, */
0000,0177,0010,0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, T, */
0000,0101,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, U, */
0000,0101,0101,0101,0101,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, V, */
0000,0101,0101,0101,0101,0111,0111,0125,0143,0101,0101,0000,0000,0000,0000,0000, /*, W, */
0000,0101,0101,0042,0024,0010,0024,0042,0101,0101,0101,0000,0000,0000,0000,0000, /*, X, */
0000,0101,0042,0024,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, Y, */
0000,0177,0001,0002,0004,0010,0020,0040,0100,0100,0177,0000,0000,0000,0000,0000, /*, Z, */
0000,0034,0020,0020,0020,0020,0020,0020,0020,0020,0020,0034,0000,0000,0000,0000, /*, [, */
0000,0000,0100,0040,0020,0010,0010,0010,0004,0002,0001,0000,0000,0000,0000,0000, /*, , \, */
0000,0070,0010,0010,0010,0010,0010,0010,0010,0010,0010,0070,0000,0000,0000,0000, /*, ], */
0010,0024,0042,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ^, */
0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0377,0000,0000, /*, _, */
0040,0020,0010,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, `, */
0000,0000,0000,0000,0000,0074,0002,0076,0102,0102,0076,0000,0000,0000,0000,0000, /*, a, */
0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0174,0000,0000,0000,0000,0000, /*, b, */
0000,0000,0000,0000,0000,0074,0102,0100,0100,0102,0074,0000,0000,0000,0000,0000, /*, c, */
0002,0002,0002,0002,0002,0076,0102,0102,0102,0102,0076,0000,0000,0000,0000,0000, /*, d, */
0000,0000,0000,0000,0000,0074,0102,0174,0100,0102,0074,0000,0000,0000,0000,0000, /*, e, */
0000,0016,0020,0020,0020,0176,0020,0020,0020,0020,0020,0000,0000,0000,0000,0000, /*, f, */
0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0102,0076,0000, /*, g, */
0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, h, */
0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, i, */
0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0010,0010,0010,0050,0020,0000, /*, j, */
0000,0100,0100,0100,0100,0106,0110,0120,0160,0110,0106,0000,0000,0000,0000,0000, /*, k, */
0000,0030,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, l, */
0000,0000,0000,0000,0000,0166,0111,0111,0111,0111,0111,0000,0000,0000,0000,0000, /*, m, */
0000,0000,0000,0000,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, n, */
0000,0000,0000,0000,0000,0074,0102,0102,0102,0102,0074,0000,0000,0000,0000,0000, /*, o, */
0000,0000,0000,0000,0000,0174,0102,0102,0102,0102,0174,0100,0100,0100,0100,0000, /*, p, */
0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0002,0002,0000, /*, q, */
0000,0000,0000,0000,0000,0134,0142,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, r, */
0000,0000,0000,0000,0000,0076,0100,0074,0002,0102,0074,0000,0000,0000,0000,0000, /*, s, */
0000,0020,0020,0020,0020,0176,0020,0020,0020,0020,0014,0000,0000,0000,0000,0000, /*, t, */
0000,0000,0000,0000,0000,0102,0102,0102,0102,0102,0075,0000,0000,0000,0000,0000, /*, u, */
0000,0000,0000,0000,0000,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, v, */
0000,0000,0000,0000,0000,0111,0111,0111,0111,0111,0066,0000,0000,0000,0000,0000, /*, w, */
0000,0000,0000,0000,0000,0102,0044,0030,0030,0044,0102,0000,0000,0000,0000,0000, /*, x, */
0000,0000,0000,0000,0000,0102,0102,0102,0042,0024,0010,0020,0040,0100,0000,0000, /*, y, */
0000,0000,0000,0000,0000,0176,0004,0010,0020,0040,0176,0000,0000,0000,0000,0000, /*, z, */
0000,0014,0020,0020,0020,0020,0040,0020,0020,0020,0020,0014,0000,0000,0000,0000, /*, {, */
0000,0010,0010,0010,0010,0000,0000,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, |, */
0000,0030,0010,0010,0010,0010,0004,0010,0010,0010,0010,0030,0000,0000,0000,0000, /*, }, */
0020,0052,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ~, */
0000,0176,0176,0176,0176,0176,0176,0176,0176,0176,0176,0000,0000,0000,0000,0000, /*, del, */
};
076,0101,0100,0100,0076,0001,0001,0001,0101,0076,0000,0000,0000,0000,0000, /*, S, */
0000,0177,0010,0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, T, */
0000,0101,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, U, */
0000,0101,0101,0101,0101,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, V, */
0000,0101,0101,0101,0101,0111,0111,0125,0143,0101,0101,0000,0000,0000,0000,0000, /*, W, */
0sumacc/libc/sunstuff/exit.c   444      0     12          72  3472473710  11152 exit(status)
register int status;
{
	asm("	trap #14.");
}
0,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ^, */
0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0377,0000,0000, /*, _, */
0040,0020,0010,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, `, */
0000,0000,0000,0000,0000,0074,0002,0076,0102,0102,0076,0000,0000,0000,0000,0000, /*, a, */
0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0174,0000,0000,0000,0000,0000, /*, b, */
0000,0000,0000,0000,00sumacc/libc/sunstuff/stubs.c   444      0     12         520  3472473711  11360 /* stubs for various routines
 * Per Bothner. Dec 1982.
 * This is needed so that Pascal routines will link properly.
 */

noSuchProc(name)
char *name;
{
    printf("The routine %s is not implemented!!!\n", name);
}

time() {
    noSuchProc("time");
}

ftime() {
    noSuchProc("ftime");
}

localtime() {
    noSuchProc("localtime");
}
4,0002,0076,0102,0102,0076,0000,0000,0000,0000,0000, /*, a, */
0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0174,0000,0000,0000,0000,0000, /*, b, */
0000,0000,0000,0000,00sumacc/libc/sunstuff/getchar.c   444      0     12         255  3472473711  11642 /*
 * getchar - get an actual character from the "keyboard".
 * 
 * changed from using lineready by Bill Nowicki October 1982
 */

int
getchar()
{
 return emt_getchar();
}

tine %s is not implemented!!!\n", name);
}

time() {
    noSuchProc("time");
}

ftime() {
    noSuchProc("ftime");
}

localtime() {
    noSuchProc("localtime");
}
4,0002,0076,0102,0102,0076,0000,0000,0000,0000,0000, /*, a, */
0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0174,0000,0000,0000,0000,0000, /*, b, */
0000,0000,0000,0000,00sumacc/libc/sunstuff/makefile   444      0     12         674  3472477141  11567 # Makefile for libc/sunstuff (MC68000)
# Modified by Bill Nowicki April 1982
#	- Added ddtinit
#	- Added a clean option
# Added stubs -Per Bothner Dec 1982
.SUFFIXES: .b .c .s

OBJS = chrtab.b exit.b getchar.b printf.b putchar.b \
	termbas.b getenv.b signal.b ddtinit.b stubs.b

all: $(OBJS)

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK
0102,0174,0000,0000,0000,0000,0000, /*, b, */
0000,0000,0000,0000,00sumacc/libc/sunstuff/printf.c   444      0     12         164  3472473711  11526 #include	<stdio.h>

printf(fmt, args)
char *fmt;
{
	_doprnt(fmt, &args, stdout);
	return(ferror(stdout)? EOF: 0);
}
ion
# Added stubs -Per Bothner Dec 1982
.SUFFIXES: .b .c .s

OBJS = chrtab.b exit.b getchar.b printf.b putchar.b \
	termbas.b getenv.b signal.b ddtinit.b stubs.b

all: $(OBJS)

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK
0102,0174,0000,0000,0000,0000,0000, /*, b, */
0000,0000,0000,0000,00sumacc/libc/sunstuff/putchar.c   444      0     12         635  3472473711  11675 /*
 * putchar.c - print a character on standard output
 *
 * An undocumented hack by some annonymous hacker
 *
 * Documented by Bill Nowicki April 1982
 *	- Changed to use emt_putchar instead of:
 */

/*
 *	_doputchar(c)
 *	register char c;
 *	{
 *		while (!linereadytx(0));
 *		lineput(0,c);
 *	}
 */


putchar(c)
register char c;
  {
    /*
     *	if (c == '\n') emt_putchar('\r');
     */
	emt_putchar(c);
  }
s

clean:
	rm -f *.b *CKP *BAK
0102,0174,0000,0000,0000,0000,0000, /*, b, */
0000,0000,0000,0000,00sumacc/libc/sunstuff/termbas.c   444      0     12        2372  3472473711  11704 /*		Termbas - Basic Terminal Capability Package
				V.R. Pratt
				Mar., 1981

This file implements a terminal-testing program to determine the terminal type
when first started, along with a collection of generally useful terminal
functions.  If your terminal type is not represented, please add the
appropriate entries.
*/


int termtype = -1;

/* Table of terminal commands */

enum terminal	{	vt52,	h19,	concept	};
char cursmo[] = {	 'Y',	'Y',	 'a'	},
    *cursdi[] = {	"ABCD","ABCD",	";<=>"	},
     cleos[]  = {	 'J',	'J',	  3	},
     cleol[]  = {	 'K',	'K',	  19	};

putstr(s) char *s;
{while (*s) putchar(*s++);
}

queryterm()
{while (1) {
	putstr("\nSupply terminal type (hit ? for help)\n");
	termtype = 0;
 	switch(127&getchar()) {
		case '?':	putstr(" v=vt52, h=h-19, c=concept"); break;
		case 'c':	termtype++;
		case 'h':	termtype++;
		case 'v':	return;
		default:	putstr(" Unknown type.");
	}
 }
}

esc_char() {putchar('\033');}

cursorpos(x,y)
{switch(termtype) {
	case vt52:
	case h19:
	case concept:	esc_char(); putchar(cursmo[termtype]);
			putchar(y+' '); putchar(x+' ');
 }
}

cursorstep(dir)
{esc_char();
 putchar(cursdi[termtype][dir]);
}

clearscreen()
{esc_char();
 putchar(cleos[termtype]);
}

clearline()
{esc_char();
 putchar(cleol[termtype]);
}


000,0000,0000,0000,0000, /*, k, */
0000,0030,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, l, */
0000,0000,0000,0000,0000,0166,0111,0111,0111,0111,0111,0000,0000,0000,0000,0000, /*, m, */
0000,0000,0000,0000,0100,0174,0102,0102,0102,sumacc/libc/sunstuff/ttyio.c   444      0     12        4455  3472473711  11423 /*	SUN1 Dependent IO Macros for use in libc.a
 *			V.R. Pratt
 *			March, 1981
 *
 *
 * feeble attempt at commenting by Bill Nowicki
 * also fixed interrupt bug in the Design module routines.
 * March 1981
 * 17 June 1981 - Jeffrey Mogul -- removed design module stuff entirely
 */

/*
 * SUN-1 dependent part
 * modified by Bill Nowicki March 1981
 *	Added lineresettxint
 */

#include "vectors.h"
#include "nec7201.h"
#include "timer.h"

char wreg1[2][2] = {0,0,0,0};

#define linedata(line) *((char*)DEVADR+DATA+line*SEP)
#define linecontrol(line) *((char*)DEVADR+CONT+line*SEP)

#define DEVADR 0x600000
#define DATA 0
#define CONT 2
#define SEP  4
#define READYRX 1
#define READYTX 4
#define RXINTARM NECrxina /* why was this commented out?  Stops it compiling */
#define TXINTARM NECtxint
#define select(reg) *linectrl = reg

lineservice(serv) 
 {
  IRQ5Vect = serv;
 }

#define NECtxrts 	2	/* RTS */
#define NECtxena	8	/* Tx enable */
#define NECtx8bt	0x60	/* Tx 8 bit characters */
#define NECdtr		0x80	/* Data Terminal Ready */

char NECinit[] = 
  {
    NECchres,
    NECchres,					/* one for luck? */
    2,	4,					/* some problem with clrb */
    4,	NECrx1sb+NEC16clk,			/* 1 stop bit, 16X clock */
    3,	NECrxena+NECrx8bt+NECautoe,		/* 8 data bits, rest normal */
    5,	NECtxrts+NECtxena+NECtx8bt+NECdtr,	/* 8 data bits, rest normal */
    0						/* delimiter */
  };


linereset(line) 
{
	register char *i = NECinit;

	while (*i) linecontrol(line) = *i++;
}

lineresettxint(line)
  {
   linecontrol(line) = (char)NECtxres;
  }

lineget(line)
 {
  return linedata(line);
 }

lineput(line,chr) char chr;
 {
  linedata(line) = chr;
 }

linereadyrx(line)
 {
   return linecontrol(line)&READYRX;
 }

linereadytx(line)
 {
  return linecontrol(line)&READYTX;
 }


lineset(line,reg,val) 
 char val;
 {
   register char *wreg = &wreg1[reg][line];
   register char *linectrl = &linecontrol(line);
	 select(reg);
	 *linectrl = *wreg |= val;
  }


lineclear(line,reg,val) char val;
 {
   register char *wreg = &wreg1[reg][line];
   register char *linectrl = &linecontrol(line);
	 select(reg);
	 *linectrl = *wreg &= ~val;
  }


linearmrx(line)
 {
  lineset(line,1,RXINTARM);
 }


linedisarmrx(line)
 { 
  lineclear(line,1,RXINTARM);
 }


linearmtx(line)
 {
   lineset(line,1,TXINTARM);
 }

linedisarmtx(line)
 {
   lineclear(line,1,TXINTARM);
 }
,0111,0111,0066,0000,0000,0000,0000,0000, /*, w, */
0000,0000,0000,0000,0000,0102,0044,0030,0030,0044,0102,0000,0000,0000,0000,0000, /*, x, */
0000,0000,0000,0000,0000,0102,0102,0102,0042,0024,0010,0020,0040,010sumacc/libc/sunstuff/signal.c   444      0     12         303  3472473711  11474 /* Dummy signal() and sigset().  For Unix compatibility.
 * V.R. Pratt
 * November 29, 1981
 */

sigset()
{

}

signal()
{

}

sighold()
{

}

sigignore()
{

}

sigrelse()
{

}

sigpause()
{

}

March 1981
 * 17 June 1981 - Jeffrey Mogul -- removed design module stuff entirely
 */

/*
 * SUN-1 dependent part
 * modified by Bill Nowicki March 1981
 *	Added lineresettxint
 */

#include "vectors.h"
#include "nec7201.h"
#include "timer.h"

char wreg1[2][2] = {0,0,0,0};

#define linedata(line) *((char*)DEVADR+DAsumacc/libc/sunstuff/getenv.c   444      0     12         511  3472473711  11510 char *envp[50] = {
"PATH=/usr/sun/bootfile",
"HOME=/mnt/guest",
"TERM=sun",
"USER=guest",
0
};

char *
getenv(s)
char *s;
{

	char **pair;
	for (pair = envp; pair; pair++)
		if (strpref(s,*pair) == 0)
			return *pair + strlen(s) + 1;
	return 0;
}

strpref(a,b)
char *a,*b;
{

	while (*a) if (*a++ != *b++) return 1;
	return 0;
}
 Nowicki March 1981
 *	Added lineresettxint
 */

#include "vectors.h"
#include "nec7201.h"
#include "timer.h"

char wreg1[2][2] = {0,0,0,0};

#define linedata(line) *((char*)DEVADR+DAsumacc/libc/test/   775      0     12           0  3472473715   7124 sumacc/libc/test/echo.c   444      0     12        1104  3472473713  10261 putchar(c) char c; {emt_putchar(c);}

getchar() {return(emt_getchar());}

char response[100];

main()
{
	int i;
	char c;
	
	for (i = 0; i < 10; i++) {
		printf("Echo on -- enter a char: ");
		c = getchar();
		printf("Got '%c'\n",c);
		setecho(0);

		printf("Echo off -- enter a char: ");
		c = getchar();
		printf("Got '%c'\n",c);
		setecho(1);
		
	}

	for (;;) {
		printf("Echo on -- enter a line: ");
		gets(response);
		printf("Got '%s'\n",response);
		setecho(0);

		printf("Echo off -- enter a line: ");
		gets(response);
		printf("Got '%s'\n",response);
		setecho(1);
	}
}

)

#define DEVADR 0x600000
#define DATA 0
#define CONT 2
#define SEP  4
#define READYRX 1
#define READYTX 4
#define RXINTARM NECrxina /* why was this commented out?  Stops it compiling */
#define TXINTARM NECtxint
#define select(reg) *linectrl = reg

lineservice(serv) 
 {
  IRQ5Vect = serv;
 }

#define NECtxrts 	2	/* RTS */
#define NECtxena	8	/* Tx enable */
#define NECtx8bt	0x60	/* Tx 8 bit characters */
#define NECdtr		0x80	/* Data Terminsumacc/libc/test/test.c   444      0     12        1177  3472473713  10334 main()
{
	float a,b,c,d,e,f;
	int i,j;

	a = 1.5;
	b = a/1.5;
	c = b*1.5;
	d = a - 1.5;
	e = d + 1.5;

	j = 2;
	f = j;
	
	i = f;

	printf("a (should be 1.5) %f\n",a);
	printf("b (should be 1.0) %f\n",b);
	printf("c (should be 1.5) %f\n",c);
	printf("d (should be 0.0) %f\n",d);
	printf("e (should be 1.5) %f\n",e);
	printf("f (should be 2.0) %f\n",f);
	printf("i (should be 2) %d\n",i);

	printf("now in hex:\n");

	printf("a (should be 1.5) %x\n",a);
	printf("b (should be 1.0) %x\n",b);
	printf("c (should be 1.5) %x\n",c);
	printf("d (should be 0.0) %x\n",d);
	printf("e (should be 1.5) %x\n",e);
	printf("f (should be 2.0) %x\n",f);
}
efine SEP  4
#define READYRX 1
#define READYTX 4
#define RXINTARM NECrxina /* why was this commented out?  Stops it compiling */
#define TXINTARM NECtxint
#define select(reg) *linectrl = reg

lineservice(serv) 
 {
  IRQ5Vect = serv;
 }

#define NECtxrts 	2	/* RTS */
#define NECtxena	8	/* Tx enable */
#define NECtx8bt	0x60	/* Tx 8 bit characters */
#define NECdtr		0x80	/* Data Terminsumacc/libc/test/f.c   444      0     12         310  3472473714   7547 #include <stdio.h>
main()
{
	float a,b;

	fprintf(stdout,"This is a floating point test\n");
	fprintf(stdout,"2.0 = %g\n",2.0);
	fprintf(stdout,"2.0 = %f\n",2.0);
	fprintf(stdout,"2.0 = %e\n",2.0);
}
b);
	printf("c (should be 1.5) %f\n",c);
	printf("d (should be 0.0) %f\n",d);
	printf("e (should be 1.5) %f\n",e);
	printf("f (should be 2.0) %f\n",f);
	printf("i (should be 2) %d\n",i);

	printf("now in hex:\n");

	printf("a (should be 1.5) %x\n",a);
	printf("b (should be 1.0) %x\n",b);
	printf("c (should be 1sumacc/libc/test/test1.c   444      0     12        1165  3472473714  10413 main()
{
	float a,b,c,d,e,f;
	int i,j;

	j = 2;
	f = j;

	a = j;
	b = a/j;
	c = b*j;
	d = a - j;
	e = d + j;
	
	i = f;

	printf("a (should be 2.0) %f\n",a);
	printf("b (should be 1.0) %f\n",b);
	printf("c (should be 2.0) %f\n",c);
	printf("d (should be 0.0) %f\n",d);
	printf("e (should be 2.0) %f\n",e);
	printf("f (should be 2.0) %f\n",f);
	printf("i (should be 2) %d\n",i);

	printf("now in hex:\n");

	printf("a (should be 2.0) %x\n",a);
	printf("b (should be 1.0) %x\n",b);
	printf("c (should be 2.0) %x\n",c);
	printf("d (should be 0.0) %x\n",d);
	printf("e (should be 2.0) %x\n",e);
	printf("f (should be 2.0) %x\n",f);
}
\n",f);
}
efine SEP  4
#define READYRX 1
#define READYTX 4
#define RXINTARM NECrxina /* why was this commented out?  Stops it compiling */
#define TXINTARM NECtxint
#define select(reg) *linectrl = reg

lineservice(serv) 
 {
  IRQ5Vect = serv;
 }

#define NECtxrts 	2	/* RTS */
#define NECtxena	8	/* Tx enable */
#define NECtx8bt	0x60	/* Tx 8 bit characters */
#define NECdtr		0x80	/* Data Terminsumacc/libc/test/float.s   444      0     12       40173  3472473714  10522 |J. Test	3/81
|floating point routines for Nu(MC68000)

				|offsets in internal float structure
SIGN	= 0				|sign
EXPT	= 2				|exponent (-127/+127)
MANH	= 4				|high mantissa
MANL	= 8				|low mantissa

	.data
	.globl afloat
	.globl bfloat
afloat:				|internal-a floating representation
a_sign:	.word	0
a_expt:	.word	0
a_manh:	.long	0
a_manl:	.long	0

bfloat:				|internal-b floating representation
b_sign:	.word	0
b_expt:	.word	0
b_manh:	.long	0
b_manl:	.long	0

lsum:				|storage for multiply
	.word	0
	.long	0			|high part of accumulated sum
	.long	0			|low part of accumulated sum
	.word	0

	
|
|convert external float to internal format
|d0,d1 contain the external float
|a0 points to afloat or bfloat
|
	.text
etoi:
	clrw	a0@			|clear sign
	tstl	d0			|test sign of external
	bge	1$			|set sign 0(+), 1(-)
	movw	#1,a0@

1$:	movl	d1,a0@(MANL)		|save low 32 bits of mantissa
	movl	d0,d1
	andl	#0x7FFFFF,d1
	orl	#0x800000,d1		|add hidden high order bit
	movl	d1,a0@(MANH)		|save high 1+23 bits of mantissa
	swap	d0
	asrl	#7,d0
	andw	#0xFF,d0		|isolate exponent
	bne	2$
	clrl	a0@			|zero sign, exponent,
	clrl	a0@(MANH)		|  high mantissa, and
	clrl	a0@(MANL)		|  low mantissa
	rts

2$:	subw	#128,d0			|convert from excess 0200
	movw	d0,a0@(EXPT)		|store converted value
	rts				|done

|
|convert internal format to external float
|a0 points to afloat or bfloat
|external float returned in d0,d1
|
	.text
itoe:
	clrl	d0
	movw	a0@(EXPT),d0		|get exponent
	addw	#128,d0			|convert to excess 0200
	bne	1$			|if exponent is zero
	clrl	d1			|  clear d0,d1
	rts				|  and return

1$:	tstw	a0@			|set sign
	beq	2$			|sign bit 0(+), 1(-)
	orw	#0x100,d0

2$:	swap	d0			|align sign and exponent
	asll	#7,d0			|  in high part of d0
	movl	a0@(MANH),d1		|get high part of mantissa
	bne	3$			|check for zero mantissa
	clrl	d0			|if zero - clear sign and
	rts				|  exponent and return

3$:	andl	#0x7FFFFF,d1		|delete high order hidden bit
	orl	d1,d0			|put high 23 bits of mantissa
	movl	a0@(MANL),d1		|put low 32 bits of mantissa
	rts				|done

|
|normalize internal float by adjusting exponent and
|shifting  mantissa appropriately so 1/2 <= mnt < 1
|a0 points to afloat or bfloat
|
	.text
normal:
	jsr	offset			|determine amount to shift
	addw	d0,a0@(EXPT)		|adjust exponent
	jsr	shift			|shift mantissa
	rts

|
|determine position of most significant bit of
|mantissa in relation to normalized decimal point
|a0 points to afloat or bfloat
|d0 returns offset of msb from decimal point
|
	.text
offset:
	moveq	#1,d0
	movl	a0@(MANH),d1		|check for high order bits
	bne	2$
	movl	a0@(MANL),d1		|check low order bits
	bne	1$
	clrw	d0			|zero shift count
	rts

1$:	subw	#32,d0			|need to shift at least 23
2$:	subqw	#1,d0			|find most significant bit
	asll	#1,d1
	bcc	2$
	addqw	#8,d0			|d0 contains exponent correction
	rts

|
|shift mantissa according to offset in d0
|a0 points to afloat or bfloat
|d0 contains shift count, <0 -> left shift, >0 -> right shift
|on return, d1 = 0, d2,d3 have shifted mantissa
|
	.text
shift:
	clrl	d1
	movl	a0@(MANH),d2		|d2 = high part of mantissa
	movl	a0@(MANL),d3		|d3 = low part of mantissa
	movw	d0,d1			|examine exponent correction
	bmi	2$			|shift left
	bne	1$			|shift right
	rts				|no shift - return

1$:	asrl	#1,d2			|shift entire mantissa
	roxrl	#1,d3			|  right by one bit
	subqw	#1,d1			|repeat until count
	bne	1$			|  is zero
	andl	#0xFFFFFF,d2		|zero top byte
	bra	shifte			|return

2$:	asll	#1,d3			|shift entire mantissa
	roxll	#1,d2			|  left by one bit
	addqw	#1,d1			|repeat until count
	bne	2$			|  is zero
	
shifte:	movl	d2,a0@(MANH)		|store high part of mantissa
	movl	d3,a0@(MANL)		|store low part of mantissa
	rts				|done
	
|
|fetch floating arguments off stack
|convert to internal format in afloat and bfloat
|on return, a0 points to afloat, a1 points to bfloat
|
getargs:
	movl	#bfloat,a1		|a1 points to bfloat
	tstw	d0			|branch to 1$ for
	bne	1$			|  indirect argument fetch
	movl	a6@(16),d0		|b-high
	movl	a6@(20),d1		|b-low
	movl	a1,a0			|setup a0 for conversion
	jsr	etoi			|convert b-arg to internal form
	movl	a6@(8),d0		|a-high
	movl	a6@(12),d1		|a-low
	movl	#afloat,a0		|a0 points to afloat
	jsr	etoi			|convert a-arg to internal form
	rts
1$:	movl	a6@(12),d0		|b-high
	movl	a6@(16),d1		|b-low
	movl	a1,a0			|setup a0 for conversion
	jsr	etoi			|convert b-arg to internal form
	movl	a6@(8),a0		|a0 points to a-arg
	movl	a0@+,d0			|a-high
	movl	a0@,d1			|a-low
	movl	#afloat,a0		|a0 points to afloat
	jsr	etoi			|convert a-arg to internal form
	rts	

	.globl	fltused
	.text
fltused:
	rts				|simply define fltused

|
|free exponent returning fractional value
|
	.globl	frexp
	.text
frexp:
	link	a6,#0
	movl	#afloat,a0		|a0 points to afloat
	movl	a6@(8),d0		|a-high
	movl	a6@(12),d1		|a-low
	movl	a6@(16),a1		|place to return exponent
	jsr	etoi			|convert to internal form
	movw	a0@(EXPT),d0		|get unbiased exponent
	extl	d0			|  convert to long and
	movl	d0,a1@			|  return value
	clrw	a0@(EXPT)		|set exponent for fractional
	jsr	itoe			|  value, convert for return
	unlk	a6
	rts

|
|add/load exponent of float
|
	.globl	ldexp
	.text
ldexp:
	link	a6,#0
	movl	#afloat,a0		|a0 points to afloat
	movl	a6@(8),d0		|a-high
	movl	a6@(12),d1		|a-low
	jsr	etoi			|convert to internal form
	movl	a6@(16),d0		|add argument
	addw	d0,a0@(EXPT)		|  to exponent
	jsr	itoe			|convert and return
	unlk	a6
	rts


|
|separate integer/fractional parts of float
|
	.globl	modf
	.text
modf:
	link	a6,#0
	moveml	#0x3800,sp@-		|save d2,d3,d4
	movl	a6@(8),d0		|a-high
	movl	a6@(12),d1		|a-low
	movl	#afloat,a0		|a0 -> afloat = fractional
	jsr	etoi			|  part on return
	movl	#bfloat,a1		|a1 -> bfloat = integer part on return
	movw	a0@,a1@			|copy signs
	movw	a0@(EXPT),d4		|if exponent > 0
	bgt	1$			|  separate integer/fractional
	movw	#-128,a1@(EXPT)		|else integer part = 0
	movl	a1,a0			|  convert integer part first
	bra	modfe			|  no need to separate

1$:	movw	d4,a1@(EXPT)		|set integer exponent
	clrw	a0@(EXPT)		|set fractional exponent
	cmpw	#56,d4			|if shift count is < 56
	blt	2$			|  shift mantissa
	movl	a0@(MANL),a1@(MANL)	|else move mantissa to integer
	movl	a0@(MANH),a1@(MANH)	|  part and set fractional
	movw	#-128,a0@(EXPT)		|  part = 0
	movl	a1,a0			|convert decimal part first
	bra	modfe			|  on exit from modf

2$:	moveq	#-8,d0			|shift mantissa left
	jsr	shift			|  by 8 for alignment
	clrl	d0
3$:	asll	#1,d3			|rotate d0<--d1<--d2<--d3
	roxll	#1,d2			|  registers until shift
	roxll	#1,d1			|  count = 0
	roxll	#1,d0
	subqw	#1,d4
	bne	3$
	movl	d3,a0@(MANL)		|save fractional components
	movl	d2,a0@(MANH)		|  of mantissa
	movl	d1,a1@(MANL)		|save integer components
	movl	d0,a1@(MANH)		|  of mantissa
	jsr	normal			|align fractional part
	subqw	#8,a0@(EXPT)		|  and adjust exponent
	movl	a1,a0			|align integer part at
	jsr	offset			|  decimal point without
	jsr	shift			|  altering exponent

modfe:	movl	a6@(16),a1		|get pointer argument
	jsr	itoe			|convert integer part
	movl	d0,a1@+			|  store in location
	movl	d1,a1@			|  given in argument
	movl	#afloat,a0		|convert fractional
	jsr	itoe			|  part and return
	moveml	sp@+,#0x1C
	unlk	a6
	rts

|
|convert floating value to fixed 32-bit integer
|
	.globl	fix
	.text
fix:
	link	a6,#0
	moveml	#0x3000,sp@-		|save d2,d3
	movl	a6@(8),d0		|d0 = high part of float
	movl	a6@(12),d1		|d1 = low order part
	movl	#afloat,a0		|a0 points to afloat
	jsr	etoi			|convert to internal format
	tstw	a0@(EXPT)		|test exponent
	bgt	1$			|if exponent is less
	clrl	d0			|  than or equal to zero
	bra	fixe			|  return zero

1$:	moveq	#-8,d0			|shift mantissa left
	jsr	shift			|  by 8 for alignment
	movw	a0@(EXPT),d1		|(note: after shift d1 = 0)
	clrl	d0			|clear d0
2$:	asll	#1,d3			|rotate d0<--d2<--d3
	roxll	#1,d2			|  registers until exponent
	roxll	#1,d0			|  count is exhausted
	subqw	#1,d1			|resultant fixed 32-bit
	bne	2$			|  value is in d0

	tstw	a0@			|check sign of float
	beq	fixe			|positive - d0 is ok
	negl	d0			|negative - negate d0
fixe:	moveml	sp@+,#0xC		|pop d2,d3
	unlk	a6
	rts

|
|convert fixed 32-bit integer to floating
|
	.globl	float
	.text
float:
	link	a6,#0
	moveml	#0x3000,sp@-		|save d2,d3
	movl	#afloat,a0		|a0 points to afloat
	clrl	a0@(MANH)		|clear junk from mantissa
	clrw	a0@			|clear sign
	movl	a6@(8),d0		|d0 = 32-bit long
	bmi	1$			|negative
	bpl	2$			|positive
	movw	#-128,a0@(EXPT)		|floating zero
	bra	floate			|return

1$:	movw	#1,a0@			|negative sign
	negl	d0			|convert to positive
2$:	movl	d0,a0@(MANL)		|move d0 to lower mantissa
	jsr	offset			|determine amount to shift
	jsr	shift			|shift mantissa
	addw	#56,d0			|calculate exponent
	movw	d0,a0@(EXPT)		|set exponent

floate:	jsr	itoe			|convert to external float
	moveml	sp@+,#0xC		|pop d2,d3
	unlk	a6
	rts

|
|add, subtract, compare two floating point numbers
|d0,d1 return result of fadd,fsub operations
|result of afadd,afaddf,afsub,afsubf stored
|fcmp sets condition codes upon return
|
	.globl	fsub
	.globl	fadd
	.globl	fcmp
	.globl	afadd
	.globl	afsub
	.globl	afaddf
	.globl	afsubf
	.text
fadd:
	link	a6,#0
	clrw	d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	add			|perform addition
	unlk	a6
	rts
fsub:
	link	a6,#0
	clrw	d0			|flag to getargs
	jsr	getargs			|get arguments
	eorw	#1,a1@			|reverse sign of b-arg
	jsr	add			|perform addition
	unlk	a6
	rts
fcmp:
	link	a6,#0
	clrw	d0			|flag to getargs
	jsr	getargs			|get arguments
	eorw	#1,a1@			|reverse sign of b-arg
	jsr	add			|perform compare
	tstl	d0			|set condition code
	unlk	a6
	rts
afadd:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	add			|perform addition
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@+			|  to store result
	movl	d1,a0@			|  of operation
	unlk	a6
	rts
afsub:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	eorw	#1,a1@			|reverse sign of b-arg
	jsr	add			|perform addition
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@+			|  to store result
	movl	d1,a0@			|  of operation
	unlk	a6
	rts
afaddf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	clrl	a0@(MANL)		|clear lower part of a-arg
	jsr	add			|perform addition
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
afsubf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	clrl	a0@(MANL)		|clear lower part of a-arg
	eorw	#1,a1@			|reverse sign of b-arg
	jsr	add			|perform addition
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
add:
	moveml	#0x3000,sp@-		|save d2,d3
	movw	a0@(EXPT),d0		|compare
	movw	a1@(EXPT),d1		|  exponents
	subw	d1,d0			|  of a and b
	bmi	1$			|a_expt < b_expt
	movl	a1,a0			|switch a0 to point to bfloat
	jsr	shift			|shift mantissa of bfloat
	movl	#afloat,a1		|switch a1 to point to afloat
	addw	d0,a0@(EXPT)		|adjust b_expt accordingly
	bra	2$
1$:	negw	d0			|make the shift count positive
	jsr	shift			|shift mantissa of afloat
	addw	d0,a0@(EXPT)		|adjust a_expt accordingly
2$:	tstw	a0@
	beq	3$			|a-arg is negative so
	negl	d3			|  negate mantissa
	negxl	d2			|  for addition
3$:	movl	a1@(MANH),d0
	movl	a1@(MANL),d1
	tstw	a1@
	beq	4$			|b-arg is negative so
	negl	d1			|  negate mantissa
	negxl	d0			|  for addition
4$:	addl	d1,d3			|perform addition of
	addxl	d0,d2			|  mantissas
	tstl	d2			|check sign of result
	bge	5$
	negl	d3			|result is negative so
	negxl	d2			|  negate mantissa
	orw	#1,a0@			|  and set sign
	bra	adde
5$:	andw	#0,a0@			|result positive

adde:	movl	d2,a0@(MANH)		|store result
	movl	d3,a0@(MANL)		|  of computation
	jsr	normal			|normalize result
	jsr	itoe			|convert to external form
	moveml	sp@+,#0xC		|pop d2,d3
	rts

|
|negate a floating number
|argument on stack
|d0,d1 return result
|
	.globl	fneg
	.text
fneg:
	link	a6,#0
	movl	a6@(12),d1		|d1 = low part of float
	movl	a6@(8),d0		|d0 = high part of float
	bmi	1$			
	orl	#0x80000000,d0		|turn high order bit on
	bra	2$
1$:	andl	#0x7FFFFFFF,d0		|turn high order bit off
2$:	unlk	a6
	rts	

|
|multiply two floating numbers
|d0,d1 return result for fmul
|result for afmul,afmulf stored
|
	.globl	fmul
	.globl	afmul
	.globl	afmulf
	.text
fmul:
	link	a6,#0
	clrw	d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	mult			|multiply arguments
	unlk	a6
	rts
afmul:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	mult			|perform multiply
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@+			|  to store result
	movl	d1,a0@			|  of operation
	unlk	a6
	rts
afmulf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	mult			|perform multiply
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
mult:
	moveml	#0x3C20,sp@-		|save d2-d5,a2
	movw	a1@+,d0			|d0 = sign of b-arg
	eorw	d0,a0@+			|a_sign gets resultant sign
	movw	a1@+,d0 		|d0 = exponent of b-arg
	addw	d0,a0@+			|a_expt gets sum of exponents

	clrl	d2			|clear
	clrl	d3			|  summation registers
	clrl	d5			|  for multiply
	moveq	#4,d4			|loop count
	addql	#8,a1			|adjust a1 pointer
	movl	#lsum,a2		|adjust a2 pointer
l1ds:	movw	a0@+,d0			|high to low words of afloat
	movw	a1@-,d1			|low to high words of bfloat
	mulu	d0,d1			|perform multiply
	addl	d1,d3
	addxl	d5,d2	
	subqw	#1,d4
	bne	l1ds
	movl	d4,a2@+
	movl	d2,a2@+
	movl	d3,a2@

	clrl	d2
	clrl	d3
	moveq	#3,d4			|loop count
	subql	#2,a0			|adjust a0 pointer
	addql	#2,a2			|adjust a2 pointer
l2ds:	movw	a0@-,d0			|low to high of afloat
	movw	a1@+,d1			|high to low of bfloat
	mulu	d0,d1			|perform multiply
	addl	d1,d3
	addxl	d5,d2
	subqw	#1,d4
	bne	l2ds
	movl	a2@-,d1
	movl	a2@-,d0
	addl	d1,d3
	addxl	d0,d2
	movl	d2,a2@+
	movl	d3,a2@	
	
	clrl	d2
	clrl	d3
	moveq	#2,d4			|loop count
	subql	#2,a1			|adjust a1 pointer
	addql	#2,a2			|adjust a2 pointer
l3ds:	movw	a0@+,d0			|high to low of afloat
	movw	a1@-,d1			|low to high of bfloat
	mulu	d0,d1
	addl	d1,d3
	addxl	d5,d2
	subqw	#1,d4
	bne	l3ds
	movl	a2@-,d1
	movl	a2@-,d0
	addl	d1,d3
	addxl	d0,d2
	movl	d2,a2@+
	movl	d3,a2@

	subql	#2,a0			|adjust a0 pointer
	addql	#2,a2			|adjust a2 pointer
	movw	a0@-,d0
	movw	a1@+,d1
	mulu	d0,d1
	addl	d1,a2@-

multe:	addql	#1,a2			|adjust a2 pointer
	movb	a2@+,a0@+		|move result
	movb	a2@+,a0@+		|  to afloat
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	subql	#8,a0			|align a0 to point
	subql	#4,a0			|  to afloat
	jsr	normal			|normalize result
	jsr	itoe			|convert to external form
	moveml	sp@+,#0x43C		|pop registers
	rts

|
|divide two floating numbers
|
	.globl	fdiv
	.globl	afdiv
	.globl	afdivf
	.text
fdiv:
	link	a6,#0
	clrl	d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	div			|divide arguments
	unlk	a6
	rts
afdiv:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	div			|divide arguments
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@+			|  to store result
	movl	d1,a0@			|  of operation
	unlk	a6
	rts
afdivf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	div			|divide arguments
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
div:
	moveml	#0x3E00,sp@-		|save d2-d6
	movw	a1@+,d0			|d0 = sign of b-arg
	eorw	d0,a0@+			|a-sign gets resultant sign
	movw	a1@+,d0			|d0 = exponent of b-arg
	subw	d0,a0@+			|a-expt gets diff of exponents
	movl	a1@+,d0			|d0 = divisor high
	bne	ok			|if divisor = 0
	divu	d0,d1			|  cause trap and core dump

ok:	movl	a1@,d1			|d1 = divisor low
	movl	a0@+,d2 		|d2 = dividend high
	movl	a0@,d3			|d3 = dividend low
	clrl	d4			|clear quotient
	clrl	d5			|  register set
	moveq	#58,d6			|setup shift count
	bra	2$

1$:	subqw	#1,d6			|exit computation when
	beq	dive			|  loop count = 0
	movw	#0x10,cc		|set x-bit in ccr
	roxll	#1,d5			|shift 1 into quotient
	roxll	#1,d4			|  accumulator registers
	roxll	#1,d3			|continue shift into
	roxll	#1,d2			|  into remainder registers
2$:	subl	d1,d3			|subtract divisor from
	subxl	d0,d2			|  remainder
	bge	1$

3$:	subqw	#1,d6			|exit computation when
	beq	dive			|  loop count = 0
	asll	#1,d5			|shift 0 into quotient
	roxll	#1,d4			|  accumulator registers
	roxll	#1,d3			|continue shift into
	roxll	#1,d2			|  remainder registers
	addl	d1,d3			|add divisor to
	addxl	d0,d2			|  remainder
	bge	1$			|positive -> shift 1
	bra	3$			|negative -> shift 0

dive:	subql	#4,a0			|align a0 to mantissa
	movl	d4,a0@+			|store quotient
	movl	d5,a0@			|  into afloat mantissa
	subql	#8,a0			|align a0 to afloat
	jsr	normal			|normalize mantissa
	jsr	itoe			|convert to external float
	moveml	sp@+,#0x7C		|pop d2-d6
	rts

 of operation
	unlk	a6
	rts
afmulf:
	link	a6,#0
	moveq	#1,d0			|flag to getargs
	jsr	getargs			|get arguments
	jsr	mult			|perform multiply
	movl	a6@(8),a0		|a0 points to where
	movl	d0,a0@			|  to store result
	unlk	a6
	rts
mult:
	moveml	#0x3C20,sp@-		|save d2-d5,a2
	movw	a1@+,d0			|d0 = sign of b-arg
	eorw	d0,a0@+			|a_sign gets resultant sign
	movw	a1@+,d0 		|d0 = exponent of b-arg
	sumacc/libc/test/ft.c   444      0     12         657  3472473714   7751 #include <stdio.h>
main()
{
	float a,b;

	fprintf(stdout,"This is a floating point test\n");
	fprintf(stdout,"2.0 = %g\n",2.0);
	fprintf(stdout,"2.0 = %f\n",2.0);
	fprintf(stdout,"2.0 = %e\n",2.0);
	
	for (a = 1, b= 1.0; a > 0.0;) {
		fprintf(stdout,"a = %g b = %g\n",a,b);
		fprintf(stdout,"a = %f b = %f\n",a,b);
		fprintf(stdout,"a = %e b = %e\n",a,b);
		a /= 2.0;
		b *= 2.0;
	}
	fprintf(stdout,"Done! a = %f b = %f\n",a,b);
}
w of afloat
	movw	a1@-,d1			|low to high of bfloat
	mulu	d0,d1
	addl	d1,d3
	addxlsumacc/libc/test/makefile   444      0     12         641  3472473714  10665 .SUFFIXES: .b .c .s

t1.r: t1.b float.b mine.b
	cc68 -r -o t1.r t1.b mine.b
t1.x: t1.b mine.b
	cc68 -X -o t1.x t1.b mine.b

float.b: float.a68
	/usr/sun/newa68/a68 float.a68

mine.b: mine.a68
	/usr/sun/newa68/a68 mine

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK

#(*) UNIX is a trademark of Bell Laboratories
%f\n",a,b);
}
w of afloat
	movw	a1@-,d1			|low to high of bfloat
	mulu	d0,d1
	addl	d1,d3
	addxlsumacc/libc/test/math.c   444      0     12         215  3472473714  10257 main()
{
	long i = 1;

	for (i = 1; i ; i+=i) {
	    printf("i = %dD %xX %oO\n",i,i,i);
/*	    printf("-i = %dD %xX %oO\n",-i,-i,-i);*/
	}
}
8
	/usr/sun/newa68/a68 float.a68

mine.b: mine.a68
	/usr/sun/newa68/a68 mine

# how to make a .b file from a .c file
.c.b:
	cc68 -O -c $*.c

# how to make a .b file from a .s file
.s.b:
	cc68 -c $*.s

clean:
	rm -f *.b *CKP *BAK

#(*) UNIX is a trademark of Bell Laboratories
%f\n",a,b);
}
w of afloat
	movw	a1@-,d1			|low to high of bfloat
	mulu	d0,d1
	addl	d1,d3
	addxlsumacc/libc/test/t1.c   444      0     12        1204  3472473715   7672 struct intern {
	short sign;
	short expt;
	long manh;
	long manl;
	};
extern struct intern afloat;
extern struct intern bfloat;

printern(x)
struct intern *x;
{
	if (x->sign) printf("- ");
	printf("expt = %x manh = %x manl = %x\n",
		x->expt, x->manh, x->manl);
}

main()
{

	double a,b;
	int c;
	
/*
	a = 2.0;
	b = -2.0;
*/
	c = 2;
	a = c;
	printern(&afloat);
	printern(&bfloat);
	f(&a);
	b = a+a;
	printern(&afloat);
	printern(&bfloat);
	f(&b);
	b = a*a;
	printern(&afloat);
	printern(&bfloat);
	f(&b);
	c = a;
	printern(&afloat);
	printern(&bfloat);
	printf("fix(2.0) = %x\n",c);
}

f(x) long *x;
{printf("hi = %x, lo = %x\n", x[0], x[1]);}
t a0 pointer
	addql	#2,a2			|adjust a2 pointer
	movw	a0@-,d0
	movw	a1@+,d1
	mulu	d0,d1
	addl	d1,a2@-

multe:	addql	#1,a2			|adjust a2 pointer
	movb	a2@+,a0@+		|move result
	movb	a2@+,a0@+		|  to afloat
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	subql	#8,a0			|align a0 to point
	subql	#4,a0			|  to afloat
	jsr	normal			|normasumacc/libc/test/t2.c   444      0     12         406  3472473715   7656 main()
{

	double a,b;
	int c;
	
	c = 2;
	a = c;
	c = a;
	printf("fix(a) = %x\n",c);
	f(&a);
	b = a+a;
	c = b;
	printf("fix(b) = %x\n",c);
	f(&b);
	b = a*a;
	c = b;
	printf("fix(b) = %x\n",c);
	f(&b);
}

f(x) long *x;
{printf("hi = %x, lo = %x\n", x[0], x[1]);}
}

main()
{

	double a,b;
	int c;
	
/*
	a = 2.0;
	b = -2.0;
*/
	c = 2;
	a = c;
	printern(&afloat);
	printern(&bfloat);
	f(&a);
	b = a+a;
	printern(&afloat);
	printern(&bfloat);
	f(&b);
	b = a*a;
	printern(&afloat);
	printern(&bfloat);
	f(&b);
	c = a;sumacc/libc/crtsun.s   444      0     12         770  3472473707   7715 | Initial run-time module for C programs on a stand-alone
| SUN.  Commented by Bill Nowicki March 1982
| Note that because of Vaughan's ddtinit hack, you must have
| a dummy routine called ddtinit for this to work.
| Modified the trap #14 to be a call to exit so file cleanup is done
| if the fio lib is used - Mike Nielsen, 23 July 82

	.data
	.text
	.globl	_start
	.globl	__end
_start:	jra	__st1
__end:	.long	_end+4
__st1:	jsr	ddtinit
	jsr	main
    	movl	#0,sp@-
	jsr 	exit
    	addql	#4,sp
	jra	__st1

	c = a;sumacc/libc/makefile   444      0     12        1475  3472476322   7732 #	The subdirectories contain files stolen from the Unix Version 7
#	libc stuff.  They are gradually being fixed to run on the 68000.
#	This makefile should describe all the files that have been modified.
#	Modified by WIN 3/82 to keep .b's in their subdirectories
#	Added cd math; make under libc.a Per Bothner 82/Jun
DESTDIR=/usr/sun/lib

SUBDIRS= stdio/*.b gen/*.b crt/*.b sunstuff/*.b math/*.b

libc.a: 
	cd stdio; make
	cd gen; make
	cd crt; make
	cd sunstuff; make
	cd math; make
	ar cr libc.a `lorder68 $(SUBDIRS) | tsort`

crtsun.b: crtsun.s
	cc68 -c crtsun.s

install: libc.a crtsun.b
	cp libc.a $(DESTDIR)/libc.a
	cp crtsun.b $(DESTDIR)/crtsun.b

clean:
	-cd crt; make clean
	-cd gen; make clean
	-cd math; make clean
	-cd sunstuff; make clean
	-cd stdio; make clean
	-cd test; make clean
	rm -f libc.a crtsun.b .emacs*
@+		|  to afloat
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	movb	a2@+,a0@+
	subql	#8,a0			|align a0 to point
	subql	#4,a0			|  to afloat
	jsr	normal			|normasumacc/ws/   775      0     12           0  3472707204   5656 sumacc/ws/intrfc/   775      0     12           0  3472707164   7150 sumacc/ws/intrfc/elems   444      0     12        6347  3472707162  10271 O^75PH r^%Dc{$C Copyright Apple Computer Inc., 1983 }

UNIT Elems;

    { Macintosh version. }

    {------------------------------------------------------------------------}

    INTERFACE

        USES

            {$U OBJ/SANE.OBJ }
             {  ^^^^ changed 'Obj:' filename reference to 'Obj/' for Workshop-2/24/84 MB}
                SANE { Standard Apple Numeric Environment } ;

        procedure Log2X (var x : Extended);
            { x := log2 (x) }

        procedure LnX (var x : Extended);
            { x := ln (x) }

        procedure Ln1X (var x : Extended);
            { x := ln (1 + x) }

        procedure Exp2X (var x : Extended);
            { x := 2^x }

        procedure ExpX (var x : Extended);
            { x := e^x }

        procedure Exp1X (var x : Extended);
            { x := e^x - 1 }

        procedure XpwrI (i : integer; var x : Extended);
            { x := x^i }

        procedure XpwrY (y : Extended; var x : Extended);
            { x := x^y }

        procedure Compound (r, n : Extended; var x : Extended);
            { x := (1 + r)^n }

        procedure Annuity (r, n : Extended; var x : Extended);
            { x := (1 - (1 + r)^-n) / r }

        procedure SinX (var x : Extended);
            { x := sin(x) }

        procedure CosX (var x : Extended);
            { x := cos(x) }

        procedure TanX (var x : Extended);
            { x := tan(x) }

        procedure AtanX (var x : Extended);
            { x := atan(x) }

        procedure NextRandom (var x : Extended);
            { x := next random (x) }

    {$p----------------------------------------------------------------------}
    IMPLEMENTATION

        procedure Log2X { (var x : Extended) } ;                EXTERNAL;
        procedure LnX { (var x : Extended) } ;                  EXTERNAL;
        procedure Ln1X { (var x : Extended) } ;                 EXTERNAL;
        procedure Exp2X { (var x : Extended) } ;                EXTERNAL;
        procedure ExpX { (var x : Extended) } ;                 EXTERNAL;
        procedure Exp1X { (var x : Extended) } ;                EXTERNAL;

        {
            Since Elems implementation expects pointer to integer argument,
            use this extra level of interface.
        }
        procedure XpwrIxxx(var i : integer; var x : Extended);  EXTERNAL;
        procedure XpwrI { (i : integer; var x : Extended) } ;
        begin
                XpwrIxxx(i, x);
        end;

        procedure XpwrY { (y : Extended; var x : Extended) } ;  EXTERNAL;
        procedure Compound { (r, n : Extended; var x : Extended) } ;  EXTERNAL;
        procedure Annuity { (r, n : Extended; var x : Extended) } ;  EXTERNAL;
        procedure SinX { (var x : Extended) } ;                 EXTERNAL;
        procedure CosX { (var x : Extended) } ;                 EXTERNAL;
        procedure TanX { (var x : Extended) } ;                 EXTERNAL;
        procedure AtanX { (var x : Extended) } ;                EXTERNAL;
        procedure NextRandom { (var x : Extended) } ;           EXTERNAL;

    END
    {========================================================================}
    {========================================================================}
    {=======================================================================}.

BJ }
             {  ^^^^ changed 'Obj:' filename reference to 'Obj/' for Workshop-2/24/84 MB}
                SANE { Standard Apple Numeric Environment } ;

        procedure Log2X (var x : Extended);
            { x := log2 (x) }

        procedure LnX (var x : Extended);
      sumacc/ws/intrfc/graf3d   444      0     12        4411  3472707162  10320 W^56P:H r
^m2{$X-}
{$S Graf    }
UNIT Graf3D;

{ three-dimensional graphics routines layered on top of QuickDraw }

INTERFACE

USES {$U-}
     {$U obj/QuickDraw }  QuickDraw,
     {$U obj/Sane      }  Sane,
     {$U obj/Elems     }  Elems;

CONST radConst='57.29578';


TYPE Point3D=RECORD
               x: extended;
               y: extended;
               z: extended;
             END;

     Point2D=RECORD
               x: extended;
               y: extended;
             END;

     XfMatrix  = ARRAY[0..3,0..3] OF extended;
     Port3DPtr = ^Port3D;
     Port3D    = RECORD
                   GPort:                     GrafPtr;
                   viewRect:                  Rect;
                   xLeft,yTop,xRight,yBottom: extended;
                   pen,penPrime,eye:          Point3D;
                   hSize,vSize:               extended;
                   hCenter,vCenter:           extended;
                   xCotan,yCotan:             extended;
                   ident:                     BOOLEAN;
                   xForm:                     XfMatrix;
                 END;


VAR thePort3D: Port3DPtr;

  PROCEDURE Open3DPort  (port: Port3DPtr);
  PROCEDURE SetPort3D   (port: Port3DPtr);
  PROCEDURE GetPort3D   (VAR port: Port3DPtr);

  PROCEDURE MoveTo2D(x,y: extended);  PROCEDURE MoveTo3D(x,y,z: extended);
  PROCEDURE LineTo2D(x,y: extended);  PROCEDURE LineTo3D(x,y,z: extended);
  PROCEDURE Move2D(dx,dy: extended);  PROCEDURE Move3D(dx,dy,dz: extended);
  PROCEDURE Line2D(dx,dy: extended);  PROCEDURE Line3D(dx,dy,dz: extended);

  PROCEDURE ViewPort    (r: Rect);
  PROCEDURE LookAt      (left,top,right,bottom: extended);
  PROCEDURE ViewAngle   (angle: extended);
  PROCEDURE Identity;
  PROCEDURE Scale       (xFactor,yFactor,zFactor: extended);
  PROCEDURE Translate   (dx,dy,dz: extended);
  PROCEDURE Pitch       (xAngle: extended);
  PROCEDURE Yaw         (yAngle: extended);
  PROCEDURE Roll        (zAngle: extended);
  PROCEDURE Skew        (zAngle: extended);
  PROCEDURE TransForm   (src: Point3D; VAR dst: Point3D);
  FUNCTION  Clip3D      (src1,src2: Point3D; VAR dst1,dst2: POINT): BOOLEAN;

  PROCEDURE SetPt3D     (VAR pt3D: Point3D; x,y,z: extended);
  PROCEDURE SetPt2D     (VAR pt2D: Point2D; x,y: extended);



IMPLEMENTATION

{$I intrfc/GRAF3DIMPL}

nded);  EXTERNAL;
        procedure XpwrI { (i : integer; var x : Extended) } ;
        begin
                XpwrIxxx(i, x);
        end;

        procedure XpwrY { (y : Extended; var x : Extended) } ;  EXTERNAL;
        procedure Compound { (r, sumacc/ws/intrfc/macprint   444      0     12       47375  3472707162  11027 3. "6F^56D!$^11jW{CL:MacPrint.text

Obj:Temp

GObj:Temp
Obj:MacPrint
{{      --   The above compiles & loads this: Exec/<This File>     --    }
{ ---------------------------------------------------------------------- }
UNIT MacPrint;

{$U-} {Turn on/off the Lisa Libraries.}
{$X-} {Turn on/off stack expansion.}

INTERFACE

{ ---------------------------------------------------------------------- }

USES  {$U Obj/QuickDraw }  QuickDraw,     {Open/Close Rsrc File}
      {$U Obj/OSIntf    }  OSIntf;
       {  ^^^^ changed 'Obj:' filename references to 'Obj/' for Workshop-2/24/84 MB}
{Interface compile flags, also check CONST's}
{$SETC fPrDbgOK   = FALSE}  {Turns on/off range checking & msc debugging}
{$SETC fPrSymOK   = FALSE}  {Turn on/off "symbols" in proc exit.}

{$SETC fWordBkOK  = TRUE }  {Turn on/off word breaking in spool file.[PfWrite]}
{$SETC fULFixOK   = TRUE }  {Turn on/off fixing UL.[PfWrite, PrBand]}



{ ---------------------------------------------------------------------- }

CONST
   iPrPgFract  = 120;            {Page scale factor. ptPgSize (below) is in units of 1/iPrPgFract }

   iPrPgFst = 1;                 {Page range constants}
   iPrPgMax = 9999;

   iIOBufBytes= 522;             {Size of file sys buf.}
   iIOBlkBytes= 512;             {Size of disk block}
   iPrRelease = 2;               {Current version number of the code.}
   iPrintX    = 19;              {Spare integers in print rec}

{The TPrint Resource type & ID's}
   lPStrType = $53545220;        {"STR ": Res type for the Pr Rsrc file name}
   iPStrRFil = $E000; {-8192}    {Str $E000 [in SysRes] is the current printer's rsrc file}
   iPStrPFil = $E001; {-8191}    {Str $E001 is the default print file name}

   lPrintType = $50524543;    {"PREC": Res type for the hPrint records}
   iPrintDef = 0;             {Default hPrint  }
   iPrintLst = 1;             {Last used hPrint}
   iPrintDrvr= 2;             {.Print's parameter record; not a Print rec}
   iMyPrDrvr = $E000; {-8192} {My copy of the above.}

{PicFile constants}
   iPfMaxPgs   = 128;
   lPfType     = $5046494C;  {"PFIL"}
   lPfSig      = $50535953;  {"PSYS"}
   iPfIcon     = 140;

   lPrType     = $4150504C;  {"APPL"}
   lPrSig      = $50535953;  {"PSYS"}
   iPrIcon     = 138;

{Driver & Resource constants}
   sPrDrvr    = '.Print';
   iPrDrvrID  = 2;         {Driver's ResID}
   iPrDrvrRef = $FFFD;     {Driver's RefNum = NOT ResID}
   iPrDrvrDev = $FD00;     {Driver's QD Dev num = RefNum in Hi Byte, variant in lo}
   iPrBitsCtl = 4;         {The Bitmap Print Proc's ctl number}
   iPrIOCtl   = 5;         {The Raw Byte IO Proc's ctl number}
   iPrEvtCtl  = 6;         {The PrEvent Proc's ctl number}
   lPrEvtAll  = $0002FFFD; {The PrEvent Proc's CParam for the entire screen}
   lPrEvtTop  = $0001FFFD; {The PrEvent Proc's CParam for the top folder}
   iFMgrCtl   = 8;         {The FMgr's Tail-hook Proc's ctl number}
                           { [The Pre-Hook is the status call] }
{General Dlg/Alert[=Ax] Constants:}
    iOK = 1;  iCancel = 2;
   iPrStlDlg= $E000; {-8192}
   iPrJobDlg= $E001; {-8191}
   iPrCfgDlg= $E002; {-8190}
   iPgFeedAx= $E00A; {-8182}
   iPicSizAx= $E00B; {-8181}

{Sys Error & Deap Shit Constants:}
   iMemFullErr = -108;
   iPrAbort    = 128;
   iPrDeapShit = 29;


{The PrVars lo mem area:}
   pPrGlobals  = $00000944;
   bDraftLoop  = 0;
   bSpoolLoop  = 1;
   bUser1Loop  = 2;
   bUser2Loop  = 3;

{ ---------------------------------------------------------------------- }

TYPE

   TN       =  0..15;            {A Nibble}
   TStr80   =  String[80];       {A medium size string}
   TPStr80  =  ^TStr80;          {..its pointer}
   TPRect   =  ^Rect;            {A Rect Ptr}
   TPBitMap =  ^BitMap;          {A BitMap Ptr}

   TWord = PACKED RECORD      {General purpose "alias" record for a word & long.}
      CASE Integer OF
         0: ( c1, c0: Char );
         1: ( b1, b0: SignedByte );
         2: ( usb1, usb0: Byte );
         3: ( n3, n2, n1, n0: TN );
         4: ( f15, f14, f13, f12, f11, f10, f9, f8, f7, f6, f5, f4, f3, f2, f1, f0: Boolean );
         5: ( i0: Integer );
   END;
   TLong = RECORD
      CASE Integer OF
         0: ( w1, w0: TWord );
         1: ( l0: LongInt );
         2: ( p0: Ptr );
         3: ( h0: Handle );
         4: ( pt: Point );
   END;
                     {NOTE: Changes will also affect: PrEqu, TCiVars & TPfVars}
   TPrVars = RECORD  {4 longs for printing, see SysEqu for location.}
      iPrErr:     Integer;          {Current print error.  Set to iPrAbort to abort printing.}
      bDocLoop:   SignedByte;       {The Doc style: Draft, Spool, .., and ..}
                                    {Currently use low 2 bits; the upper 6 are for flags.}
      bUser1:     SignedByte;       {Spares used by the print code}
      lUser1:     TLong;
      lUser2:     TLong;
      lUser3:     TLong;
   END;
   TPPrVars = ^TPrVars;

   TPrInfo = RECORD     {Print Info Record: The parameters needed for page composition.}
      iDev:       Integer;             {Font mgr/QuickDraw device code}
      iVRes:      Integer;             {Resolution of device, in device coordinates}
      iHRes:      Integer;             {   ..note: V before H => compatable with Point.}
      rPage:      Rect;                {The page (printable) rectangle in device coordinates.}
   END;
   TPPrInfo = ^TPrInfo;

{These are types of paper feeders.}
   TFeed = ( feedCut, feedFanfold, feedMechCut, feedOther );

   TPrStl = RECORD      {Printer Style: The printer configuration and usage information.}
      wDev:       TWord;         {The device (driver) number.  Hi byte=RefNum, Lo byte=variant.}
      iPageV:     Integer;       {paper size in units of 1/iPrPgFract}
      iPageH:     Integer;       {   ..note: V before H => compatable with Point.}
      bPort:      SignedByte;    {The IO port number. Refnum?}
      feed:       TFeed;         {paper feeder type.}
   END;
   TPPrStl = ^TPrStl;

{Banding data structures.  Not of general interest to Apps.}
   TScan =                    {Band Scan direction Top-Bottom, Left-Right, etc.}
      ( scanTB,  scanBT, scanLR, scanRL );

   TPrXInfo = RECORD             {The print time eXtra information.}
      iRowBytes:  Integer;       {The Band's rowBytes.}
      iBandV:     Integer;       {Size of band, in device coordinates}
      iBandH:     Integer;       {   ..note: V before H => compatable with Point.}
      iDevBytes:  Integer;       {Size for allocation.  May be more than rBounds size!}
      iBands:     Integer;       {Number of bands per page.}

      bPatScale:  SignedByte;    {Pattern scaling}
      bULThick:   SignedByte;    {3 Underscoring parameters}
      bULOffset:  SignedByte;
      bULShadow:  SignedByte;

      scan:       TScan;         {Band scan direction}
      bXInfoX:    SignedByte;    {An eXtra byte.}
   END;
   TPPrXInfo = ^TPrXInfo;

   TPrJob = RECORD      {Print Job: Print "form" for a single print request.}
      iFstPage:   Integer;       {Page Range.}
      iLstPage:   Integer;
      iCopies:    Integer;       {No. copies.}
      bJDocLoop:  SignedByte;    {The Doc style: Draft, Spool, .., and ..}
      fFromUsr:   Boolean;       {Printing from an User's App (not PrApp) flag}
      pIdleProc:  ProcPtr;       {The Proc called while waiting on IO etc.}
      pFileName:  TPStr80;       {Spool File Name: NIL for default.}
      iFileVol:   Integer;       {Spool File vol, set to 0 initially}
      bFileVers:  SignedByte;    {Spool File version, set to 0 initially}
      bJobX:      SignedByte;    {An eXtra byte.}
   END;
   TPPrJob = ^TPrJob;

   TPrint = RECORD      {The universal 120 byte printing record}
      iPrVersion: Integer;             {Printing software version}
      PrInfo:     TPrInfo;             {the PrInfo data associated with the current style.}
      rPaper:     Rect;                {The paper rectangle [offset from rPage].}
      PrStl:      TPrStl;              {This print request's style.}
      PrInfoPT:   TPrInfo;             {Print Time Imaging metrics}
      PrXInfo:    TPrXInfo;            {Print-time (expanded) Print info record.}
      PrJob:      TPrJob;              {The Print Job request}
      PrintX:     Array[1..iPrintX]of integer;    {Spare to fill to 120 bytes!}
   END;
   TPPrint = ^TPrint;
   THPrint = ^TPPrint;

{Printing Graf Port.  All printer imaging, whether spooling, banding, etc, happens "thru" a GrafPort.}
   TPrPort =  RECORD    {This is the "PrPeek" record.}
      GPort:      GrafPort;         {The Printer's graf port.}
      GProcs:     QDProcs;          {..and its procs}

      lGParam1:   TLong;            {Some params: Our relocatable stuff etc.}
      lGParam2:   TLong;
      lGParam3:   TLong;
      lGParam4:   TLong;

      fOurPtr:    Boolean;          {Whether the PrPort allocation was done by us.}
      fOurBits:   Boolean;          {Whether the BitMap allocation was done by us.}
   END;
   TPPrPort = ^TPrPort;
   TPPort = RECORD                  {Pascal Yuk: Alias to merge a grafport & prport}
      CASE Integer OF
         0: (pGPort:   GrafPtr);
         1: (pPrPort:  TPPrPort);
   END;

   TPrStatus = RECORD      {Print Status: Print information during printing.}
      iTotPages:  Integer;             {Total pages in Print File.}
      iCurPage:   Integer;             {Current page number}
      iTotCopies: Integer;             {Total copies requested}
      iCurCopy:   Integer;             {Current copy number}
      iTotBands:  Integer;             {Total bands per page.}
      iCurBand:   Integer;             {Current band number}
      fPgDirty:   Boolean;             {True if current page has been written to.}
      fImaging:   Boolean;             {Set while in band's DrawPic call.}
      hPrint:     THPrint;             {Handle to the active Printer record}
      pPrPort:    TPPrPort;            {Ptr to the active PrPort}
      hPic:       PicHandle;           {Handle to the active Picture}
   END;
   TPPrStatus = ^TPrStatus;

{PicFile = a TPfHeader followed by n QuickDraw Pics (whose PicSize is invalid!)}
   TPfPgDir =  RECORD
      iPages:     Integer;
      lPgPos:     ARRAY [0..iPfMaxPgs] OF LongInt;
   END;
   TPPfPgDir = ^TPfPgDir;
   THPfPgDir = ^TPPfPgDir;

   TPfHeader =  RECORD     {Print File header.}
      Print:      TPrint;
      PfPgDir:    TPfPgDir;
   END;
   TPPfHeader = ^TPfHeader;
   THPfHeader = ^TPPfHeader;  {Note: Type compatable with an hPrint.}

(* This is not included here due to requiring $Use-ing the entire world!
   It's only used by those desiring to customize the print dialogs.
   TPrDlg = RECORD      {Print Dialog: The Dialog Stream object.}
      Dlg:        DialogRecord;  {The Dialog window}
      pFltrProc:  ProcPtr;       {The Filter Proc.}
      pItemProc:  ProcPtr;       {The Item evaluating proc.}
      hPrintUsr:  THPrint;       {The user's print record.}
      fDoIt:      Boolean;
      fDone:      Boolean;
      lUser1:     TLong;         {Four longs for user's to hang global data.}
      lUser2:     TLong;
      lUser3:     TLong;
      lUser4:     TLong;
   {  ...Plus more stuff needed by the particular printing dialog.}
   END;
   TPPrDlg = ^TPrDlg;      {== a dialog ptr}
*)
{ ---------------------------------------------------------------------- }

{  --Init--  }
PROCEDURE PrOpen;
   { Open the .Print driver, get the Current Printer's Rsrc file
     name from SysRes, open the resource file, and open the .Print driver
     living in SysRes.
     PrOpen MUST be called during init time. }
PROCEDURE PrClose;
   {Closes JUST the print rsrc file.  Leaves the .Print driver in SysRes open.}

{  --Print Dialogs & Default--  }
PROCEDURE PrintDefault  ( hPrint: THPrint );
   { Defaults a handle to a Default Print record.
     Note: You allocate (or fetch from file's resources..) the handle,
           I fill it.  Also, I may invoke this at odd times whenever
           I think you have an invalid Print record! }

FUNCTION  PrValidate ( hPrint: THPrint ): Boolean;
   { Checks the hPrint.  Fixes it if there has been a change in SW
     version or in the current printer. Returns fChanged.
     Note: Also updates the various parameters within the Print
           record to match the current values of the PrStl & PrJob.
           It does NOT set the fChanged result if these
           parameters changed as a result of this update. }

FUNCTION  PrStlDialog  ( hPrint: THPrint ): Boolean;
FUNCTION  PrJobDialog  ( hPrint: THPrint ): Boolean;
   { The Dialog returns the fDoIt flag:
         IF PrJobDialog(..) THEN BEGIN
            PrintMyDoc (..);
            SaveMyStl (..)
         END
             OR
         IF PrStlDialog(..) THEN SaveMyStl (..)
      NOTE: These may change the hPrint^^ if the version number
            is old or the printer is not the current one.  }
PROCEDURE PrJobMerge (hPrintSrc, hPrintDst: THPrint);
   { Merges hPrintSrc's PrJob into hPrintDst [Source/Destination].
     Allows one job dialog being applied to several docs [Finder printing] }

{  --The Document printing procs: These spool a print file.--  }
FUNCTION PrOpenDoc ( hPrint:     THPrint;
                     pPrPort:    TPPrPort;
                     pIOBuf:     Ptr ): TPPrPort;
   { Set up a graf port for Pic streaming and make it the current port.
     Init the print file page directory.
     Create and open the print file.
     hPrint: The print info.
     pPrPort: the storage to use for the TPrPort.  If NIL we allocate.
     pIOBuf: an IO buf; if NIL, file sys uses volume buf.
     returns TPPrPort: The TPPrPort (graf port) used to spool thru. }

PROCEDURE PrCloseDoc ( pPrPort: TPPrPort );
   { Write the print file page directory.
     Close the print file.
     Make the user's saved port the current port. }

PROCEDURE PrOpenPage ( pPrPort: TPPrPort; pPageFrame: TPRect );
   { If current page is in the range of printed pages:
       Open a picture for the page
       Otherwise set a null port for absorbing an image.
     pPageFrame := PrInfo.rPage, unless you're scaling.
     Set pPageFrame to NIL unless you want to perform PicScaling on the printer.
     [The printing procs will call OpenPicture (pPageFrame^) and DrawPicture (hPic, rPage);]
     Note: Use of QuickDraw may now cause File IO errors due to our Pic spooling! }

PROCEDURE PrClosePage( pPrPort: TPPrPort );
   { Close & kill the page picture.
     Update the file page directory.
     If we allocated the TPrPort then de-allocate it. }

{  --The "Printing Application" proc: Read and band the spooled PicFile.--  }
PROCEDURE PrPicFile( hPrint:        THPrint;
                     pPrPort:       TPPrPort;
                     pIOBuf:        Ptr;
                     pDevBuf:       Ptr;
                     VAR PrStatus:  TPrStatus );
   { Read and print the spooled print file.
     The idle proc is run during Imaging and Printing. }

PROCEDURE PrPic ( hPic:          PicHandle;
                  hPrint:        THPrint;
                  pPrPort:       TPPrPort;
                  pDevBuf:       Ptr;
                  VAR PrStatus:  TPrStatus );
   { Print a memory resident picture (one page). }

{  --The .Print driver calls.--  }
PROCEDURE PrDrvrOpen;
PROCEDURE PrDrvrClose;
   { Open/Close the .Print driver in SysRes.
     ONLY used by folks doing low level stuff, not full document printing. }

PROCEDURE PrCtlCall (iWhichCtl: Integer; lParam1, lParam2, lParam3: LongInt);
   { A generalized Control proc for the Printer driver.
     The main use is for bitmap printing:
         PrCtlCall (iPrBitsCtl, pBitMap, pPortRect, lControl);
         ==
         PROCEDURE PrBits  (  pBitMap:   Ptr;         --QuickDraw bitmap
                              pPortRect: TPRect;      --a portrect. use bounds for whole bitmap
                              lControl:  LongInt );   --0=>Screen resolution/Portrait
     This dumps a bitmap/portrect to the printer.
     lControl is a device dep param; use 0 for screen res/portrait/etc.
     Each different printer will use lControl parameter differently.
     Thus PrCtlCall (iPrBitsCtl, @MyPort^.ScreenBits, @MyPort^.PortRect.Bounds,0)
     performs a screen dump of just my port's data.

     Two special control calls are included in the driver for Screen printing from the
     key board:
            PrCtlCall (iPrEvtCtl, lPrEvtAll, 0, 0);  Prints the screen
            PrCtlCall (iPrEvtCtl, lPrEvtTop, 0, 0);  Prints the top folder
     These are handled by the system for key board access but can be called by anyone
     at any time.  They can be very cheap printing for ornaments, for example!

     Another useful call is used for sending raw data to the printer:
         PrCtlCall (iPrIOCtl, pBuf, lBufCount, pIdleProc); }

{ --Semi private stuff-- }
(* The dialog customizing stuff:
FUNCTION  PrStlInit ( hPrint: THPrint ): TPPrDlg;
FUNCTION  PrJobInit ( hPrint: THPrint ): TPPrDlg;
FUNCTION  PrDlgMain ( hPrint: THPrint; pDlgInit: ProcPtr ): Boolean;
*)
PROCEDURE PrCfgDialog;
PROCEDURE PrHack ( lParam1, lParam2, lParam3: TLong );

{ ---------------------------------------------------------------------- }
{Misc Utilities}

{File Utilities: IO68K}
{FUNCTION Str80Ptr  (sName:TStr80): TPStr80;}
FUNCTION CreateFile(sName:TStr80; iVol: Integer; bVersion: SignedByte): Integer;
FUNCTION DeleteFile(sName:TStr80; iVol: Integer; bVersion: SignedByte): Integer;
FUNCTION OpenFile  (sName:TStr80; iVol: Integer; bVersion: SignedByte;
                    fTrunc: Boolean; pBuf: Ptr; VAR iRefNum: Integer):  Integer;
FUNCTION WriteBlk (iRefNum, iMode:Integer; lPos:LongInt; p:Ptr; VAR n:LongInt ):Integer;
FUNCTION ReadBlk  (iRefNum, iMode:Integer; lPos:LongInt; p:Ptr; VAR n:LongInt ):Integer;
FUNCTION CloseFile(iRefNum: Integer): Integer;

{Print time utilitys: PrPic68k}
PROCEDURE ClrBitmap (pBitmap: Ptr );
FUNCTION  fClrBits  (VAR bits: Bitmap; rCheck: Rect): Boolean;
FUNCTION  fEQBlk ( p1, p2: Ptr; lBytes: LongInt ): Boolean;

{Scc utilitys: Scc68k}
PROCEDURE PrSCCInit;
PROCEDURE PrBlockOut (pData: Ptr; iBytes: Integer; pIdleProc: ProcPtr);
PROCEDURE XPrIdle   (pIdleProc: ProcPtr);
PROCEDURE PrAbortCheck;

{Other Utilities: PrMacMisc}
FUNCTION  lMul (i1, i0: Integer): LongInt;
FUNCTION  lDiv (lTop: LongInt; iBot: Integer): LongInt;

{ ---------------------------------------------------------------------- }

IMPLEMENTATION


PROCEDURE PrOpen;                      EXTERNAL;
PROCEDURE PrClose;                     EXTERNAL;
PROCEDURE PrintDefault;                EXTERNAL;
FUNCTION  PrValidate;                  EXTERNAL;
FUNCTION  PrStlDialog;                 EXTERNAL;
FUNCTION  PrJobDialog;                 EXTERNAL;
PROCEDURE PrJobMerge;                  EXTERNAL;
FUNCTION  PrOpenDoc;                   EXTERNAL;
PROCEDURE PrCloseDoc;                  EXTERNAL;
PROCEDURE PrOpenPage;                  EXTERNAL;
PROCEDURE PrClosePage;                 EXTERNAL;
PROCEDURE PrPicFile;                   EXTERNAL;
PROCEDURE PrCfgDialog;                 EXTERNAL;
PROCEDURE PrHack;                      EXTERNAL;

PROCEDURE PrDrvrOpen;                  EXTERNAL;
PROCEDURE PrDrvrClose;                 EXTERNAL;
PROCEDURE PrCtlCall;                   EXTERNAL;
PROCEDURE PrScreen;                    EXTERNAL;
PROCEDURE PrTopFolder;                 EXTERNAL;
PROCEDURE PrCheckEvent;                EXTERNAL;

{FUNCTION Str80Ptr;                     EXTERNAL;}
FUNCTION CreateFile;                   EXTERNAL;
FUNCTION DeleteFile;                   EXTERNAL;
FUNCTION OpenFile;                     EXTERNAL;
FUNCTION WriteBlk;                     EXTERNAL;
FUNCTION ReadBlk;                      EXTERNAL;
FUNCTION CloseFile;                    EXTERNAL;

PROCEDURE ClrBitmap;                   EXTERNAL;
FUNCTION  fClrBits;                    EXTERNAL;
FUNCTION  fEQBlk;                      EXTERNAL;

FUNCTION  lMul;                        EXTERNAL;
FUNCTION  lDiv;                        EXTERNAL;

PROCEDURE PrSCCInit;                   EXTERNAL;
PROCEDURE PrBlockOut;                  EXTERNAL;
PROCEDURE XPrIdle;                     EXTERNAL;
PROCEDURE PrAbortCheck;                EXTERNAL;

PROCEDURE PrPic;                       EXTERNAL;

{ ---------------------------------------------------------------------- }
END.
reen dump of just my port's data.

     Two special control calls are included in the driver for Screen printing from the
     key board:
            PrCtlCall (iPrEvtCtl, lPrEvtAll, 0, 0);  Prints the screen
            PrCtlCall (iPrEvtCtl, lPrEvtTop, 0, 0)sumacc/ws/intrfc/memtypes   444      0     12        1164  3472707163  11020 3. "6F^5D!$^PY
UNIT MemTypes;

{  Copyright 1983 Apple Computer Inc.  }

{types which are basic to all Macintosh applications}
{RS Apr 30 84  created by taking types from quickdraw and toolintf}

INTERFACE

TYPE

  SignedByte = -128..127;    { any byte in memory }
  Byte       = 0..255;       { Unsigned byte for fontmgr }
  Ptr        = ^SignedByte;  { blind pointer }
  Handle     = ^Ptr;         { pointer to a master pointer }
  ProcPtr    = Ptr;          { pointer to a procedure }
  Fixed      = LongInt;

  Str255    =  String[255];
  StringPtr = ^Str255;
  StringHandle = ^StringPtr;

IMPLEMENTATION

END. { of UNIT }

g );

{ ---------------------------------------------------------------------- }
{Misc Utilities}

{File Utilities: IO68K}
{FUNCTION Str80Ptr  (sName:TStr80): TPStr80;}
FUNCTION CreateFile(sName:TStr80; iVol: Integer; bVersion: SignedByte): Integer;
FUNCTION DeleteFile(sName:TStr80; iVol: Integer; bVersion: SignedByte): Integer;
FUNCTION OpenFile  (sName:TStr80; iVol: Integer; bVersion: Signedsumacc/ws/intrfc/osintf   444      0     12      104321  3472707163  10516 
Unit OSINTF;

{    Copyright 1983 by Apple Computer, Inc.  All Rights Reserved.   }

{ Created 23 Nov 83 by Rony Sebok from heapZone.text and osMisc.text.}
{ Modification history:                                             }
{       12 Apr 84  JTC  Cleaned up a la Hacker.                     }

Interface

USES {$U-}
     {$U obj/MemTypes  }  MemTypes,
     {$U obj/QuickDraw }  QuickDraw;

CONST
  {for Event Manager}

  everyEvent  = -1;
  NullEvent   = 0;
  mouseDown   = 1;
  mouseUp     = 2;
  keyDown     = 3;
  keyUp       = 4;
  autoKey     = 5;
  updateEvt   = 6;
  diskEvt     = 7;
  activateEvt = 8;
  networkEvt  = 10;
  driverEvt   = 11;
  app1Evt     = 12;
  app2Evt     = 13;
  app3Evt     = 14;
  app4Evt     = 15;

  { event mask equates }
  mDownMask     = 2;
  mUpMask       = 4;
  keyDownMask   = 8;
  keyUpMask     = 16;
  autoKeyMask   = 32;
  updateMask    = 64;
  diskMask      = 128;
  activMask     = 256;
  networkMask   = 1024;
  driverMask    = 2048;
  app1Mask      = 4096;
  app2Mask      = 8192;
  app3Mask      = 16384;
  app4Mask      = -32768;

  {to decipher event message for keyDown events}
  charCodeMask = $000000FF;
  keyCodeMask = $0000FF00;


  { modifiers }
  optionKey= 2048;   { Bit 3 of high byte }
  alphaLock= 1024;   { Bit 2 }
  ShiftKey=   512;   { Bit 1 }
  CmdKey=     256;   { Bit 0 }
  BtnState=   128;   { Bit 7 of low byte is mouse button state }

  activeFlag  = 1;   { bit 0 of modifiers for activate event }
  changeFlag  = 2;   { bit 1 of modifiers for activate event }

  {error for PostEvent}
  EvtNotEnb = 1;

{for Memory Manager}
  MemFullErr = -108;     { Not enough room in heap zone }
  NilHandleErr = -109;   { Master Pointer was NIL in HandleZone or other   }
  MemWZErr   = -111;     { WhichZone failed (applied to free block)        }
  MemPurErr  = -112;     { trying to purge a locked or non-purgeable block  }
  NoErr      =  0;       { All is well }

  {file system error codes}
  DirFulErr   =    -33;     { Directory full}
  DskFulErr   =    -34;     { disk full}
  NSVErr      =    -35;     { no such volume}
  IOErr       =    -36;     { I/O error (bummers)}
  BdNamErr    =    -37;     { there may be no bad names in the final system!}
  FNOpnErr    =    -38;     { File not open}
  EOFErr      =    -39;     { End of file}
  PosErr      =    -40;     { tried to position to before start of file (r/w)}
  MFulErr     =    -41;     { memory full(open) or file won't fit (load)}
  TMFOErr     =    -42;     { too many files open}
  FNFErr      =    -43;     { File not found}

  WPrErr      =    -44;     { diskette is write protected}
  FLckdErr    =    -45;     { file is locked}
  VLckdErr    =    -46;     { volume is locked}
  FBsyErr     =    -47;     { File is busy (delete)}
  DupFNErr    =    -48;     { duplicate filename (rename)}
  OpWrErr     =    -49;     { file already open with with write permission}
  ParamErr    =    -50;     { error in user parameter list}
  RFNumErr    =    -51;     { refnum error}
  GFPErr      =    -52;     { get file position error}
  VolOffLinErr =   -53;     { volume not on line error (was Ejected)}
  PermErr     =    -54;     { permissions error (on file open)}
  VolOnLinErr =    -55;     { drive volume already on-line at MountVol}
  NSDrvErr    =    -56;     { no such drive (tried to mount a bad drive num)}
  NoMacDskErr =    -57;     { not a mac diskette (sig bytes are wrong)}
  ExtFSErr    =    -58;     { volume in question belongs to an external fs}
  FSRnErr     =    -59;     { file system rename error:}
                              {  during rename the old entry was deleted }
                              {  but could not be restored . . .}
  BadMDBErr   =    -60;     { bad master directory block}
  WrPermErr   =    -61;     { write permissions error}
  firstDskErr =    -84;     {first of the range of low-level disk errors}
  lastDskErr  =    -64;     {last of the range of low-level disk errors}


  MaxSize    = $800000;  { Max data block size is 512K bytes  }

  {finder constants}
  fHasBundle = 8192;
  fInvisible = 16384;
  fTrash = -3;
  fDesktop = -2;
  fDisk = 0;

  {io constants}

  {ioPosMode values}
  fsAtMark = 0;
  fsFromStart = 1;
  fsFromLEOF = 2;
  fsFromMark = 3;

  {ioPermission values}
  fsCurPerm = 0;
  fsRdPerm = 1;
  fsWrPerm = 2;
  fsRdWrPerm = 3;

  {refNums fro the serial ports}
  AinRefNum = -6;       {serial port A input}
  AoutRefNum = -7;      {serial port A output}
  BinRefNum = -8;       {serial port B input}
  BoutRefNum = -9;      {serial port B output}

  {baud rate constants}
  baud300 = 380;
  baud600 = 189;
  baud1200 = 94;
  baud1800 = 62;
  baud2400 = 46;
  baud3600 = 30;
  baud4800 = 22;
  baud7200 = 14;
  baud9600 = 10;
  baud19200 = 4;
  baud57600 = 0;

  {SCC channel configuration word}
  {driver reset information masks}
  stop10 = 16384;
  stop15 = -32768;
  stop20 = -16384;
  noParity = 8192;
  oddParity = 4096;
  evenParity = 12288;
  data5 = 0;
  data6 = 2048;
  data7 = 1024;
  data8 = 3072;


  {serial driver error masks}
  swOverrunErr = 0;
  parityErr = 16;
  hwOverrunErr = 32;
  framingErr = 64;

  {serial driver message constant}
  xOffWasSent = $80;

  {for application parameter}
  {constants for message returned by the finder on launch}
  appOpen = 0;
  appPrint = 1;

  {for sound driver}
  SWmode = -1;
  FTmode = 1;
  FFmode = 0;

  {for the disk driver}
  currPos = 0;
  absPos = 1;
  relPos = 3;
  rdVerify = 64;

TYPE
  {for Event Manager}
  EventRecord = RECORD
                  what:      INTEGER;
                  message:   LongInt;
                  when:      LongInt;
                  where:     Point;
                  modifiers: INTEGER;
                 END;



  Zone       = Record
                  BkLim:      Ptr;
                  PurgePtr:   Ptr;
                  HFstFree:   Ptr;
                  ZCBFree:    LongInt;
                  GZProc:     ProcPtr;
                  MoreMast:   Integer;
                  Flags:      Integer;
                  CntRel:     Integer;
                  MaxRel:     Integer;
                  CntNRel:    Integer;
                  MaxNRel:    Integer;
                  CntEmpty:   Integer;
                  CntHandles: Integer;
                  MinCBFree:  LongInt;
                  PurgeProc:  ProcPtr;
                  SparePtr:   Ptr;        { reserved for future }
                  AllocPtr:   Ptr;
                  HeapData:   Integer;
               End;
  THz        = ^Zone;        { pointer to the start of a heap zone }
  Size       = LongInt;      { size of a block in bytes }
  OsErr     = Integer;      { error code }

  QElemPtr = ^QElem;                        {ptr to generic queue element}

{Vertical Blanking Control Block Queue Element}
VBLTask = RECORD
    qLink: QElemPtr;    {link to next element}
    qType: INTEGER;     {unique ID for validity check}
    vblAddr: ProcPtr;   {address of service routine}
    vblCount: INTEGER;  {count field for timeout}
    vblPhase: INTEGER;  {phase to allow synchronization}
  END; {VBLCntrlBlk}
{VBLQElPtr = ^VBLTask;}

evQEl = RECORD
    qLink:      QElemPtr;
    qType:      INTEGER;
    evtQwhat:   INTEGER;    {this part is identical to the EventRecord as...}
    evtQmessage:LongInt;    {defined in ToolIntf}
    evtQwhen:   LongInt;
    evtQwhere:  Point;
    evtQmodifiers: INTEGER;
  END;

  {drive queue elements}
DrvQEl = RECORD
    qLink:      QElemPtr;
    qType:      INTEGER;
    dQDrive:    INTEGER;
    dQRefNum:   INTEGER;    {ref num of the drvr which handles this drive}
    dQFSID:     INTEGER;    {id of file system which handles this drive}
    dQDrvSize:  INTEGER;    {size of drive in 512-byte blocks -- not for drvs 1&2}
  END;
DrvQElPtr = ^DrvQEl;

  ParamBlkType = (IOParam,FileParam,VolumeParam,CntrlParam);


  OsType = PACKED ARRAY[1..4] OF CHAR; {same as rsrc mgr's Restype}
  FInfo = RECORD                    {record of finder info}
            fdType: OsType;         {the type of the file}
            fdCreator: OsType;      {file's creator}
            fdFlags: INTEGER;       {flags ex. hasbundle,invisible,locked, etc.}
            fdLocation: Point;      {file's location in folder}
            fdFldr: INTEGER;        {folder containing file}
          END; {FInfo}

  ParamBlockRec = RECORD
        {12 byte header used by the file and IO system}
        qLink: QElemPtr;            {queue link in header}
        qType: INTEGER;             {type byte for safety check}
        ioTrap: INTEGER;            {FS: the Trap}
        ioCmdAddr: Ptr;             {FS: address to dispatch to}

        {common header to all variants}
        ioCompletion: ProcPtr;      {completion routine addr (0 for synch calls)}
        ioResult: OsErr;            {result code}
        ioNamePtr: StringPtr;       {ptr to Vol:FileName string}
        ioVRefNum: INTEGER;         {volume refnum (DrvNum for Eject and MountVol)}

        {different components for the different type of parameter blocks}
        CASE ParamBlkType OF
        ioParam:
          (ioRefNum: INTEGER;       {refNum for I/O operation}
           ioVersNum: SignedByte;   {version number}
           ioPermssn: SignedByte;   {Open: permissions (byte)}

           ioMisc: Ptr;             {Rename: new name}
                                    {GetEOF,SetEOF: logical end of file}
                                    {Open: optional ptr to buffer}
                                    {SetFileType: new type}
           ioBuffer: Ptr;           {data buffer Ptr}
           ioReqCount: LongInt;     {requested byte count}
           ioActCount: LongInt;     {actual byte count completed}
           ioPosMode: INTEGER;      {initial file positioning}
           ioPosOffset: LongInt);   {file position offset}

        FileParam:
          (ioFRefNum: INTEGER;       {reference number}
           ioFVersNum: SignedByte;   {version number}
           filler1: SignedByte;
           ioFDirIndex: INTEGER;    {GetFileInfo directory index}
           ioFlAttrib: SignedByte;  {GetFileInfo: in-use bit=7, lock bit=0}
           ioFlVersNum: SignedByte; {file version number}
           ioFlFndrInfo: FInfo;     {user info}
           ioFlNum: LongInt;        {GetFileInfo: file number}
           ioFlStBlk: INTEGER;      {start file block (0 if none)}
           ioFlLgLen: LongInt;      {logical length (EOF)}
           ioFlPyLen: LongInt;      {physical lenght}
           ioFlRStBlk: INTEGER;     {start block rsrc fork}
           ioFlRLgLen: LongInt;     {file logical length rsrc fork}
           ioFlRPyLen: LongInt;     {file physical length rsrc fork}
           ioFlCrDat: LongInt;      {file creation date & time (32 bits in secs)}
           ioFlMdDat: LongInt);     {last modified date and time}

         VolumeParam:
           (filler2: LongInt;
            ioVolIndex: INTEGER;    {volume index number}
            ioVCrDate: LongInt;     {creation date and time}
            ioVLsBkUp: LongInt;     {last backup date and time}
            ioVAtrb: INTEGER;       {volume attrib}
            ioVNmFls: INTEGER;      {number of files in directory}
            ioVDirSt: INTEGER;      {start block of file directory}
            ioVBlLn: INTEGER;       {GetVolInfo: length of dir in blocks}
            ioVNmAlBlks: INTEGER;   {GetVolInfo: num blks (of alloc size)}
            ioVAlBlkSiz: LongInt;   {GetVolInfo: alloc blk byte size}
            ioVClpSiz: LongInt;     {GetVolInfo: bytes to allocate at a time}
            ioAlBlSt: INTEGER;      {starting disk(512-byte) block in block map}
            ioVNxtFNum: LongInt;    {GetVolInfo: next free file number}
            ioVFrBlk: INTEGER);     {GetVolInfo: # free alloc blks for this vol}

          CntrlParam:
            (filler3: INTEGER;      {refNum for I/O operation}
             CSCode: INTEGER;       {word for control status code}
             CSParam: ARRAY[0..10] OF INTEGER);  {operation-defined parameters}
      END; {ParamBlockRec}
  ParmBlkPtr = ^ParamBlockRec;

 {20 bytes of system parameter area}
  SysParmType = RECORD
          Valid: LongInt;       {high byte = validation field ($A7)}
                                {low 3 bytes = odometer}
          PortA: INTEGER;       {port A configuration}
          PortB: INTEGER;       {port B configuration}
          Alarm: LongInt;       {alarm time}
          Font: INTEGER;        {default font id}
          KbdPrint: INTEGER;    {high byte = kbd repeat}
                                    {high nibble = thresh in 4/60ths}
                                    {low nibble = rates in 2/60ths}
                                {low byte = print stuff}
          VolClik: INTEGER;     {low 3 bits of high byte = volume control}
                                {high nibble of low byte = double time in 4/60ths}
                                {low nibble of low byte = caret blink time in 4/60ths}
          Misc: INTEGER;        {EEEC EEEE PSKB FFHH}
                                    {E = extra}
                                    {P = paranoia level}
                                    {S = mouse scaling}
                                    {K = key click}
                                    {B = boot disk}
                                    {F = menu flash}
                                    {H = help level}
     END; {SysParmType}
  SysPPtr = ^SysParmType;

{volume control block data structure}
VCB = RECORD
    qLink:          QElemPtr;    {link to next element}
    qType:          INTEGER;     {not used}
    vcbFlags:       INTEGER;
    vcbSigWord:     INTEGER;
    vcbCrDate:      LongInt;
    vcbLsBkUp:      LongInt;
    vcbAtrb:        INTEGER;
    vcbNmFls:       INTEGER;
    vcbDirSt:       INTEGER;
    vcbBlLn:        INTEGER;
    vcbNmBlks:      INTEGER;
    vcbAlBlkSiz:    LongInt;
    vcbClpSIz:      LongInt;
    vcbAlBlSt:      INTEGER;
    vcbNxtFNum:     LongInt;
    vcbFreeBks:     INTEGER;
    vcbVN:          STRING[27];
    vcbDrvNum:      INTEGER;
    vcbDRefNum:     INTEGER;
    vcbFSId:        INTEGER;
    vcbVRefNum:     INTEGER;
    vcbMAdr:        Ptr;
    vcbBufAdr:      Ptr;
    vcbMLen:        INTEGER;
    vcbDirIndex:    INTEGER;
    vcbDirBlk:      INTEGER;
END;

{general queue data structure}
QHdr = RECORD
    QFlags: INTEGER;        {misc flags}
    QHead: QElemPtr;        {first elem}
    QTail: QElemPtr;        {last elem}
  END; {QHdr}
QHdrPtr = ^QHdr;
{there are currently 4 types of queues:                         }
{   VType   -   queue of Vertical Blanking Control Blocks       }
{   IOQType -   queue of I/0 queue elements                     }
{   DrvType -   queue of drivers                                }
{   EvType  -   queue of Event Records                          }
{   FSQType -   queue of VCB elements                           }
{   TimerType no longer is used.  DrvType replaces it here in enum type}
QTypes = (dummyType,vType,ioQType,drvQType,evType,fsQType);

QElem = RECORD
        CASE QTypes OF
        vType:
          (vblQelem: VBLTask);          {vertical blanking}

        ioQType:
          (ioQElem: ParamBlockRec);     {I/O parameter block}

        drvQType:
          (drvQElem: DrvQEl);           {drive}

        evType:
          (evQElem: EvQEl);             {event}

        fsQType:
          (vcbQElem: VCB);              {volume control block}

  END; {QElem}

 {device control entry}
 DCtlEntry = RECORD
               DCtlDriver: Ptr;         {ptr to ROM or handle to RAM driver}
               DCtlFlags: INTEGER;      {flags}
               DCtlQHdr: QHdr;          {driver's i/o queue}
               DCtlPosition: LongInt;   {byte pos used by read and write calls}
               DCtlStorage: Handle;     {hndl to RAM drivers private storage}
               DCtlRefNum: INTEGER;     {driver's reference number}
               DCtlCurTicks: LongInt;   {long counter for timing system task calls}
               DCtlWindow: Ptr;         {ptr to driver's window if any}
               DCtlDelay: INTEGER;      {number of ticks btwn sysTask calls}
               DCtlEMask: INTEGER;      {desk acessory event mask}
               DCtlMenu: INTEGER;       {menu ID of menu associated with driver}
             END; {DCtlEntry}
 DCtlPtr = ^DCtlEntry;
 DCtlHandle = ^DCtlPtr;

  {for Serial Driver}
SerShk = PACKED RECORD              {handshake control fields}
                  fXOn: Byte;       {XON flow control enabled flag}
                  fCTS: Byte;       {CTS flow control enabled flag}
                  xon:  Char;       {XOn character}
                  xoff: Char;       {XOff character}
                  errs: Byte;       {errors mask bits}
                  evts: Byte;       {event enable mask bits}
                  fInX: Byte;       {Input flow control enabled flag}
                  null: Byte;       {unused}
                END;

  {parameter block structure for file and IO routines}
SerStaRec = PACKED RECORD
                     cumErrs:  Byte;     {cumulative errors report}
                     XOFFSent: Byte;     {XOff Sent flag}
                     rdPend:   Byte;     {read pending flag}
                     wrPend:   Byte;     {write pending flag}
                     ctsHold:  Byte;     {CTS flow control hold flag}
                     XOFFHold: Byte;     {XOff flow control hold flag}
                   End;


  {for Sound Driver}

  {for 4-tone sound generation}
  Wave = PACKED ARRAY[0..255] OF Byte;
  WavePtr = ^Wave;
  FTSoundRec = RECORD
                  duration: INTEGER;
                  sound1Rate: LongInt;
                  sound1Phase: LongInt;
                  sound2Rate: LongInt;
                  sound2Phase: LongInt;
                  sound3Rate: LongInt;
                  sound3Phase: LongInt;
                  sound4Rate: LongInt;
                  sound4Phase: LongInt;
                  sound1Wave: WavePtr;
                  sound2Wave: WavePtr;
                  sound3Wave: WavePtr;
                  sound4Wave: WavePtr;
                END;
  FTSndRecPtr = ^FTSoundRec;

  FTSynthRec = RECORD
                 mode: INTEGER;
                 sndRec: FTSndRecPtr;
               END;
  FTSynthPtr = ^FTSynthRec;

  Tone = RECORD
           count: INTEGER;
           amplitude: INTEGER;
           duration: INTEGER;
         END;

  Tones = ARRAY[0..5000] OF Tone;

  SWSynthRec = RECORD
                 mode: INTEGER;
                 triplets: Tones;
               END;
  SWSynthPtr = ^SWSynthRec;

  freeWave = PACKED ARRAY[0..30000] OF Byte;

  FFSynthRec = RECORD
                 mode: INTEGER;
                 count: Fixed;
                 waveBytes: freeWave;
               END;

  FFSynthPtr = ^FFSynthRec;



{for date and time}
DateTimeRec = RECORD
                Year,           {1904,1905,...}
                Month,          {1,...,12 corresponding to Jan,...,Dec}
                Day,            {1,...31}
                Hour,           {0,...,23}
                Minute,         {0,...,59}
                Second,         {0,...,59}
                DayOfWeek: INTEGER; {1,...,7 corresponding to Sun,...,Sat}
              END; {DateTimeRec}

{for application parameter}
appFile = RECORD
                 vRefNum: INTEGER;
                 ftype: OsType;
                 versNum: INTEGER;   {versNum in high byte}
                 fName: str255;
               END; {appFile}

{for RAM serial driver}
SPortSel = (SPortA,SPortB);

{for disk driver}
DrvSts = RECORD
        track: INTEGER;             {current track}
        writeProt: SignedByte;      {bit 7=1 if volume is locked}
        diskInPlace: SignedByte;    {disk in place}
        installed: SignedByte;      {drive installed}
        sides: SignedByte;          {bit 7=0 if single-sided drive}
        qLink: QElemPtr;            {next queue entry}
        qType: INTEGER;             {not used}
        dqDrive: INTEGER;           {drive number}
        dqRefNum: INTEGER;          {driver reference number}
        dqFSID: INTEGER;            {file-system identifier}
        twoSideFmt: SignedByte;     {-1 if two-sided disk}
        needsFlush: SignedByte;     {reserved}
        diskErrs:   INTEGER;        {error count}
    END; {DrvSts}

{for Event Manager}
FUNCTION PostEvent(eventNum: INTEGER; eventMsg: LongInt): OsErr;
PROCEDURE FlushEvents(whichMask,stopMask: INTEGER);
PROCEDURE SetEventMask(theMask: INTEGER);
FUNCTION OSEventAvail(mask: INTEGER; VAR theEvent: EventRecord): BOOLEAN;
FUNCTION GetOSEvent(mask: INTEGER; VAR theEvent: EventRecord): BOOLEAN;

{OS utilities}
FUNCTION HandToHand(VAR theHndl: Handle): OsErr;
FUNCTION PtrToXHand(srcPtr: Ptr; dstHndl: Handle; size: LongInt): OsErr;
FUNCTION PtrToHand(srcPtr: Ptr; VAR dstHndl: Handle; size: LongInt): OsErr;
FUNCTION HandAndHand(hand1,hand2: Handle): OsErr;
FUNCTION PtrAndHand(ptr1: Ptr; hand2: Handle; size: LongInt): OsErr;
PROCEDURE SysBeep(duration: INTEGER);                               INLINE $A9C8;

{from HEAPZONE.TEXT}
PROCEDURE SetApplBase(startPtr: Ptr);
PROCEDURE InitApplZone;
PROCEDURE InitZone(pgrowZone:           ProcPtr;
                   cmoreMasters:        Integer;
                   limitPtr,startPtr : Ptr);
FUNCTION  GetZone: THz;
PROCEDURE SetZone(hz: THz);

FUNCTION  ApplicZone: THz;
FUNCTION  SystemZone: THz;

FUNCTION  CompactMem(cbNeeded: Size): Size;
PROCEDURE PurgeMem(cbNeeded: Size);
FUNCTION  FreeMem: LongInt;
PROCEDURE ResrvMem(cbNeeded: Size);
FUNCTION  MaxMem(Var grow: Size): Size;
FUNCTION  TopMem: Ptr;

PROCEDURE SetGrowZone(growZone: ProcPtr);
PROCEDURE SetApplLimit(zoneLimit: Ptr);
PROCEDURE MaxApplZone;

FUNCTION  NewPtr(byteCount: Size): Ptr;
PROCEDURE DisposPtr(p: Ptr);
FUNCTION  GetPtrSize(p: Ptr): Size;
PROCEDURE SetPtrSize(p: Ptr; newSize: Size);
FUNCTION  PtrZone(p: Ptr): THz;

FUNCTION  NewHandle(byteCount: Size): Handle;
PROCEDURE DisposHandle(h: Handle);
FUNCTION  GetHandleSize(h: Handle): Size;
PROCEDURE SetHandleSize(h: Handle; newSize: Size);
FUNCTION  HandleZone(h: Handle): THz;
FUNCTION  RecoverHandle(p: Ptr): Handle;
PROCEDURE EmptyHandle(h: Handle);
PROCEDURE ReAllocHandle(h: Handle; byteCount: Size);

PROCEDURE HLock(h: Handle);
PROCEDURE HUnLock(h: Handle);
PROCEDURE HPurge(h: Handle);
PROCEDURE HNoPurge(h: Handle);
PROCEDURE  MoreMasters;

PROCEDURE BlockMove(srcPtr, destPtr: Ptr; byteCount: Size);
FUNCTION  MemError: OsErr;

FUNCTION  GZCritical: Boolean;
FUNCTION  GZSaveHnd: Handle;


{interface for core routines pertaining to the vertical retrace mgr}
{routines defined in VBLCORE.TEXT}
FUNCTION  VInstall(VBLTaskPtr: QElemPtr): OsErr;
FUNCTION  VRemove(VBLTaskPtr: QElemPtr): OsErr;

{interface for Operating System Dispatcher}
{routines defined in DISPATCH.TEXT}
FUNCTION  GetTrapAddress(trapNum: INTEGER): LongInt;
PROCEDURE SetTrapAddress(trapAddr: LongInt; trapNum: INTEGER);

{interface for utility core routines (defined in sysutil)}
FUNCTION GetSysPPtr: SysPPtr;
FUNCTION WriteParam: OsErr;
FUNCTION  SetDateTime(time:  LongInt):OsErr;
FUNCTION  ReadDateTime(VAR time: LongInt):OsErr;
PROCEDURE GetDateTime(VAR secs: LongInt);
PROCEDURE SetTime(d: DateTimeRec);
PROCEDURE GetTime(VAR d: DateTimeRec);
PROCEDURE Date2Secs(d: DateTimeRec; VAR s: LongInt);
PROCEDUR  Secs2Date(s: LongInt; VAR d: DateTimeRec);
PROCEDURE Delay(numTicks: LongInt; VAR finalTicks: LongInt);
FUNCTION  EqualString(str1,str2: Str255; caseSens,diacSens: BOOLEAN):BOOLEAN;
PROCEDURE UprString(VAR theString: Str255; diacSens: BOOLEAN);
FUNCTION  InitUtil: OsErr;


PROCEDURE UnLoadSeg(routineAddr: Ptr);                          INLINE $A9F1;
PROCEDURE ExitToShell;                                          INLINE $A9F4;
PROCEDURE GetAppParms(VAR apName: str255; VAR apRefNum: INTEGER;
                      VAR apParam: Handle);                     INLINE $A9F5;
PROCEDURE CountAppFiles(VAR message: INTEGER; VAR count: INTEGER);
PROCEDURE GetAppFiles(index: INTEGER; VAR theFile: AppFile);
PROCEDURE ClrAppFiles(index: INTEGER);

{queue routines - part of Macintosh core Utility routines}
PROCEDURE InitQueue(qHeader: QHdrPtr);
PROCEDURE Enqueue(qElement: QElemPtr; qHeader: QHdrPtr);
FUNCTION  Dequeue(qElement: QElemPtr; qHeader: QHdrPtr): OsErr;
FUNCTION  GetFSQHdr: QHdrPtr;
FUNCTION  GetDrvQHdr: QHdrPtr;
FUNCTION  GetVCBQHdr: QHdrPtr;
FUNCTION  GetVBLQHdr: QHdrPtr;
FUNCTION  GetEvQHdr: QHdrPtr;
FUNCTION GetDCtlEntry(refNum: INTEGER): DCtlHandle;

{from MACIO.TEXT}
FUNCTION  PBOpen(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBClose(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBRead(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBWrite(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBControl(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBStatus(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBKillIO(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;

FUNCTION  PBGetVInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBGetVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBSetVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBEject(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBOffLine(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBFlushVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBCreate(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBDelete(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBOpenRF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBRename(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBGetFInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBSetFInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBSetFLock(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBRstFLock(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBSetFVers(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBAllocate(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBGetEOF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBSetEOF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBGetFPos(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBSetFPos(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBFlushFile(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
FUNCTION  PBMountVol(paramBlock: ParmBlkPtr): OsErr;
FUNCTION  PBUnMountVol(paramBlock: ParmBlkPtr): OsErr;
PROCEDURE AddDrive(drvrRefNum: INTEGER; drvNum: INTEGER; QEl: drvQElPtr);

FUNCTION  FSOpen(fileName: Str255; vRefNum: INTEGER; VAR refNum: INTEGER): OsErr;
FUNCTION  FSClose(refNum: INTEGER): OsErr;
FUNCTION  FSRead(refNum: INTEGER; VAR count: LongInt; buffPtr: Ptr): OsErr;
FUNCTION  FSWrite(refNum: INTEGER; VAR count: LongInt; buffPtr: Ptr): OsErr;
FUNCTION  Control(refNum: INTEGER; csCode: INTEGER;
                    csParamPtr: Ptr): OsErr;
FUNCTION  Status(refNum: INTEGER; csCode: INTEGER;
                   csParamPtr: Ptr): OsErr;
FUNCTION  KillIO(refNum: INTEGER): OsErr;


{-volume level calls-}
FUNCTION  GetVInfo(drvNum: INTEGER; volName: StringPtr; VAR vRefNum: INTEGER;
                 VAR FreeBytes: LongInt): OsErr;
FUNCTION  GetFInfo(fileName: Str255; vRefNum: INTEGER;
                  VAR FndrInfo: FInfo):OsErr;
FUNCTION  GetVol(volName: StringPtr; VAR vRefNum: INTEGER):OsErr;
FUNCTION  SetVol(volName: StringPtr; vRefNum: INTEGER): OsErr;
FUNCTION  UnMountVol(volName: StringPtr; vRefNum: INTEGER):OsErr;
FUNCTION  Eject(volName: StringPtr; vRefNum: INTEGER): OsErr;
FUNCTION  FlushVol(volName: StringPtr; vRefNum: INTEGER):OsErr;

{-file level calls for unopened files-}
FUNCTION  Create(fileName: Str255; vRefNum: INTEGER; creator: OSType;
                fileType: OSType):OsErr;
FUNCTION  FSDelete(fileName: Str255; vRefNum: INTEGER):OsErr;
FUNCTION  OpenRF(fileName: Str255; vRefNum: INTEGER;
                VAR refNum: INTEGER): OsErr;
FUNCTION  Rename(oldName: Str255; vRefNum: INTEGER;
                newName: Str255):OsErr;
FUNCTION  SetFInfo(fileName: Str255; vRefNum: INTEGER;
                  FndrInfo: FInfo):OsErr;
FUNCTION  SetFLock(fileName: Str255; vRefNum: INTEGER):OsErr;
FUNCTION  RstFLock(fileName: Str255; vRefNum: INTEGER):OsErr;
FUNCTION  SetFType(fileName: Str255; oldVers: SignedByte; vRefNum: INTEGER;
                    newVers: SignedByte):OsErr;
{-file level calls for opened files-}
FUNCTION  Allocate(refNum: INTEGER; VAR count: LongInt):OsErr;
FUNCTION  GetEOF(refNum: INTEGER; VAR LogEOF: LongInt):OsErr;
FUNCTION  SetEOF(refNum: INTEGER; LogEOF: LongInt):OsErr;
FUNCTION  GetFPos(refNum: INTEGER; VAR filePos: LongInt):OsErr;
FUNCTION  SetFPos(refNum: INTEGER; posMode: INTEGER; posOff: LongInt):OsErr;
FUNCTION  FlushFile(refNum: INTEGER):OsErr;

{Serial Driver Interface}
FUNCTION  DrvrInstall(name: Str255;  drvrRefNum: INTEGER): OsErr;
FUNCTION  DrvrRemove(drvrRefNum: INTEGER): OsErr;
FUNCTION  OpenDriver(name: Str255): INTEGER;
PROCEDURE CloseDriver(refNum:  Integer);

FUNCTION  SerReset(refNum: INTEGER; serConfig: INTEGER): OSErr;
FUNCTION  SerSetBuf(refNum: INTEGER; serBPtr: Ptr; serBLen: INTEGER): OSErr;
FUNCTION  SerHShake(refNum: INTEGER; flags: SerShk): OSErr;
FUNCTION  SerSetBrk(refNum: INTEGER): OSErr;
FUNCTION  SerClrBrk(refNum: INTEGER): OSErr;
FUNCTION  SerGetBuf(refNum: INTEGER; VAR count: LongInt): OSErr;
FUNCTION  SerStatus(refNum: INTEGER; VAR serSta: SerStaRec): OSErr;
FUNCTION DiskEject(drvnum: INTEGER): OSErr;
FUNCTION SetTagBuffer(buffPtr: Ptr): OSErr;
FUNCTION DriveStatus(drvNum: INTEGER; VAR status: DrvSts): OSErr;
FUNCTION  RamSDOpen(whichPort: SPortSel; rsrcType: OsType; rsrcID: INTEGER): OSErr;
PROCEDURE  RamSDClose(whichPort: SPortSel);

{for Sound Driver}
PROCEDURE SetSoundVol(level: INTEGER);
PROCEDURE GetSoundVol(VAR level: INTEGER);
PROCEDURE StartSound(synthRec: Ptr; numBytes: LongInt; CompletionRtn: ProcPtr);
PROCEDURE StopSound;
FUNCTION SoundDone: BOOLEAN;

{for the system error handler}
PROCEDURE SysError(errorCode: INTEGER);


IMPLEMENTATION
{for Event Manager}

FUNCTION PostEvent;         EXTERNAL;
PROCEDURE FlushEvents;      EXTERNAL;
PROCEDURE SetEventMask;     EXTERNAL;
FUNCTION OSEventAvail;      EXTERNAL;
FUNCTION GetOSEvent ;       EXTERNAL;

{OS utilities}
FUNCTION HandToHand; EXTERNAL;
FUNCTION PtrToXHand; EXTERNAL;
FUNCTION PtrToHand; EXTERNAL;
FUNCTION HandAndHand; EXTERNAL;
FUNCTION PtrAndHand; EXTERNAL;


{from HEAPZONE.TEXT}
PROCEDURE SetApplBase; EXTERNAL;
PROCEDURE InitApplZone; EXTERNAL;
PROCEDURE InitZone; EXTERNAL;
FUNCTION  GetZone; EXTERNAL;
PROCEDURE SetZone; EXTERNAL;

FUNCTION  ApplicZone; EXTERNAL;
FUNCTION  SystemZone; EXTERNAL;

FUNCTION  CompactMem; EXTERNAL;
PROCEDURE PurgeMem; EXTERNAL;
FUNCTION  FreeMem; EXTERNAL;
PROCEDURE ResrvMem; EXTERNAL;
FUNCTION  MaxMem; EXTERNAL;
FUNCTION  TopMem; EXTERNAL;

PROCEDURE SetGrowZone; EXTERNAL;
PROCEDURE SetApplLimit; EXTERNAL;
PROCEDURE MaxApplZone; EXTERNAL;

FUNCTION  NewPtr; EXTERNAL;
PROCEDURE DisposPtr; EXTERNAL;
FUNCTION  GetPtrSize; EXTERNAL;
PROCEDURE SetPtrSize; EXTERNAL;
FUNCTION  PtrZone; EXTERNAL;

FUNCTION  NewHandle; EXTERNAL;
PROCEDURE DisposHandle; EXTERNAL;
FUNCTION  GetHandleSize; EXTERNAL;
PROCEDURE SetHandleSize; EXTERNAL;
FUNCTION  HandleZone; EXTERNAL;
FUNCTION  RecoverHandle; EXTERNAL;
PROCEDURE EmptyHandle; EXTERNAL;
PROCEDURE ReAllocHandle; EXTERNAL;

PROCEDURE HLock; EXTERNAL;
PROCEDURE HUnLock; EXTERNAL;
PROCEDURE HPurge; EXTERNAL;
PROCEDURE HNoPurge; EXTERNAL;
PROCEDURE MoreMasters;EXTERNAL;

PROCEDURE BlockMove; EXTERNAL;
FUNCTION  MemError; EXTERNAL;

FUNCTION  GZCritical; EXTERNAL;
FUNCTION  GZSaveHnd; EXTERNAL;


{from OSMISC.TEXT}
FUNCTION  DrvrInstall;EXTERNAL;
FUNCTION  DrvrRemove;EXTERNAL;
FUNCTION  OpenDriver;EXTERNAL;
PROCEDURE CloseDriver;EXTERNAL;
FUNCTION  VInstall;EXTERNAL;
FUNCTION  VRemove;EXTERNAL;
FUNCTION  GetTrapAddress;EXTERNAL;
PROCEDURE SetTrapAddress;EXTERNAL;

FUNCTION GetSysPPtr;EXTERNAL;
FUNCTION WriteParam;EXTERNAL;
FUNCTION  SetDateTime;EXTERNAL;
FUNCTION  ReadDateTime;EXTERNAL;
PROCEDURE SetTime;EXTERNAL;
PROCEDURE GetDateTime;EXTERNAL;
PROCEDURE GetTime;EXTERNAL;
PROCEDURE Date2Secs;EXTERNAL;
PROCEDURE Secs2Date;EXTERNAL;
PROCEDURE Delay;EXTERNAL;
FUNCTION  EqualString;EXTERNAL;
PROCEDURE UprString;EXTERNAL;
FUNCTION  InitUtil;EXTERNAL;


{queue routines}
PROCEDURE InitQueue;EXTERNAL;
PROCEDURE Enqueue;EXTERNAL;
FUNCTION  Dequeue;EXTERNAL;
FUNCTION  GetFSQHdr; EXTERNAL;
FUNCTION  GetDrvQHdr; EXTERNAL;
FUNCTION  GetVCBQHdr; EXTERNAL;
FUNCTION  GetVBLQHdr; EXTERNAL;
FUNCTION  GetEvQHdr; EXTERNAL;
FUNCTION GetDCtlEntry; EXTERNAL;
{FUNCTION  GetDCtlQHdr; EXTERNAL;}


{from MACIO.TEXT}
FUNCTION  PBOpen;EXTERNAL;
FUNCTION  PBClose;EXTERNAL;
FUNCTION  PBRead;EXTERNAL;
FUNCTION  PBWrite;EXTERNAL;
FUNCTION  PBControl;EXTERNAL;
FUNCTION  PBStatus;EXTERNAL;
FUNCTION  PBKillIO;EXTERNAL;

FUNCTION  PBGetVInfo;EXTERNAL;
FUNCTION  PBGetVol;EXTERNAL;
FUNCTION  PBSetVol;EXTERNAL;
FUNCTION  PBEject;EXTERNAL;
FUNCTION  PBOffLine;EXTERNAL;
FUNCTION  PBFlushVol;EXTERNAL;
FUNCTION  PBCreate;EXTERNAL;
FUNCTION  PBDelete;EXTERNAL;
FUNCTION  PBOpenRF;EXTERNAL;
FUNCTION  PBRename;EXTERNAL;
FUNCTION  PBGetFInfo;EXTERNAL;
FUNCTION  PBSetFInfo;EXTERNAL;
FUNCTION  PBSetFLock;EXTERNAL;
FUNCTION  PBRstFLock;EXTERNAL;
FUNCTION  PBSetFVers;EXTERNAL;
FUNCTION  PBAllocate;EXTERNAL;
FUNCTION  PBGetEOF;EXTERNAL;
FUNCTION  PBSetEOF;EXTERNAL;
FUNCTION  PBGetFPos;EXTERNAL;
FUNCTION  PBSetFPos;EXTERNAL;
FUNCTION  PBFlushFile;EXTERNAL;
FUNCTION  PBMountVol;EXTERNAL;
FUNCTION  PBUnMountVol;EXTERNAL;

PROCEDURE AddDrive;EXTERNAL;

FUNCTION  FSOpen;EXTERNAL;
FUNCTION  FSClose;EXTERNAL;
FUNCTION  FSRead;EXTERNAL;
FUNCTION  FSWrite;EXTERNAL;
FUNCTION  Control;EXTERNAL;
FUNCTION  Status;EXTERNAL;
FUNCTION  KillIO;EXTERNAL;

FUNCTION  GetVInfo;EXTERNAL;
FUNCTION  GetFInfo;EXTERNAL;
FUNCTION  GetVol;EXTERNAL;
FUNCTION  SetVol;EXTERNAL;
FUNCTION  UnMountVol;EXTERNAL;
FUNCTION  Eject;EXTERNAL;
FUNCTION  FlushVol;EXTERNAL;

FUNCTION  Create;EXTERNAL;
FUNCTION  FSDelete;EXTERNAL;
FUNCTION  OpenRF;EXTERNAL;
FUNCTION  Rename;EXTERNAL;
FUNCTION  SetFInfo;EXTERNAL;
FUNCTION  SetFLock;EXTERNAL;
FUNCTION  RstFLock;EXTERNAL;
FUNCTION  SetFType;EXTERNAL;
FUNCTION  Allocate;EXTERNAL;
FUNCTION  GetEOF;EXTERNAL;
FUNCTION  SetEOF;EXTERNAL;
FUNCTION  GetFPos;EXTERNAL;
FUNCTION  SetFPos;EXTERNAL;
FUNCTION  FlushFile;EXTERNAL;
FUNCTION  SerReset;EXTERNAL;
FUNCTION  SerSetBuf;EXTERNAL;
FUNCTION  SerHShake;EXTERNAL;
FUNCTION  SerSetBrk;EXTERNAL;
FUNCTION  SerClrBrk;EXTERNAL;
FUNCTION  SerGetBuf;EXTERNAL;
FUNCTION  SerStatus;EXTERNAL;
FUNCTION DiskEject;EXTERNAL;
FUNCTION SetTagBuffer;EXTERNAL;
FUNCTION DriveStatus;EXTERNAL;
FUNCTION  RamSDOpen;EXTERNAL;
PROCEDURE  RamSDClose;EXTERNAL;
PROCEDURE SetSoundVol;EXTERNAL;
PROCEDURE GetSoundVol;EXTERNAL;
PROCEDURE StartSound;EXTERNAL;
PROCEDURE StopSound;EXTERNAL;
FUNCTION SoundDone;EXTERNAL;
PROCEDURE SWSetLevel;EXTERNAL;

PROCEDURE ClrAppFiles;EXTERNAL;
PROCEDURE CountAppFiles;EXTERNAL;
PROCEDURE GetAppFiles;EXTERNAL;

{for the system error handler}
PROCEDURE SysError; EXTERNAL;


END.



r; EXTERNAL;
FUNCTION  GetPtrSize; EXTERNAL;
PROCEDURE SetPtrSize; EXTERNAL;
FUNCTION  PtrZone; EXTERNAL;

FUNCTION  NewHandle; EXTERNAL;
PROCEDURE DisposHandle; EXTERNAL;
FUNCTION  GetHandleSize; EXTERNAL;
PROCEDURE SetHandleSize; EXTERNAL;
FUNCTION  HandleZone; EXTERNAL;
FUNCTION  RecoverHandle; EXTEsumacc/ws/intrfc/packintf   444      0     12       21302  3472707163  10770 3. "6F^5D!$^:UU.;UNIT PackIntf;

{ Jan 28, 1984.  Rony Sebok   Interface for Macintosh packages              }
{ Modification history:                                                     }
{       11 Apr 84   JTC   Modified a la Rose.                               }

{ Copyright 1982 by Apple Computer, Inc.  All Rights Reserved.              }

INTERFACE

USES    {$U-}
        {$U obj/MemTypes  }  MemTypes,
        {$U obj/QuickDraw }  QuickDraw,
        {$U Obj/OsIntf    }  OsIntf,
        {$U obj/toolIntf  }  ToolIntf;
CONST

{constants for Standard File package}
  putDlgID = -3999;     {SFPutFile dialog template ID}

  putSave = 1;          {save button}
  putCancel = 2;        {cancel button}
  putEject = 5;         {eject button}
  putDrive = 6;         {drive button}
  putName = 7;          {editTExt item for file name}

  getDlgID = -4000;     {SFGetFile dialog template ID}

  getOpen = 1;          {open button}
  getCancel = 3;        {cancel button}
  getEject = 5;         {eject button}
  getDrive = 6;         {drive button}
  getNmList = 7;        {userItem for file name list}
  getScroll = 8;        {userItem for scroll bar}



{constants for manipulation of international resources}
  {masks used for setting and testing currency format flags}
  currLeadingZ = 128;   {set if leading zero}
  currTrailingZ = 64;   {set if trailing zero}
  currNegSym = 32;      {set if minus sign for negative num, reset if parentheses}
  currSymLead = 16;     {set if currency symbol leads, reset if trails}

  {constants specifying absolute value of short date form}
  MDY = 0;              {month,day,year}
  DMY = 1;              {day,month,year}
  YMD = 2;              {year,month,day}

  {masks used for date element format flags}
  century = 128;         {set if century, reset if no century}
  mntLdingZ = 64;        {set if leading 0 for month}
  dayLdingZ = 32;        {set if leading zero for day}

  {masks used for time element format flags}
  hrLeadingZ = 128;      {set if leading zero for hours}
  minLeadingZ = 64;      {set if leading zero for minutes}
  secLeadingZ = 32;      {set if leading zero for seconds}

  {country codes for version numbers}
  verUS         = 0;
  verFrance     = 1;
  verBritain    = 2;
  verGermany    = 3;
  verItaly      = 4;
  verNetherlands   = 5;
  verBelgiumLux    = 6;
  verSweden        = 7;
  verSpain         = 8;
  verDenmark       = 9;
  verPortugal      = 10;
  verFinland       = 11;
  verNorway        = 12;
  verIsrael        = 13;
  verJapan         = 14;
  verAustralia     = 15;
  verArabia        = 16;
  verFrCanada      = 17;
  verSwissFr       = 18;
  verSwissGr       = 19;
  verGreece        = 20;
  verIceland       = 21;
  verMalta         = 22;
  verCyprus        = 23;
  verTurkey        = 24;
  verYugoslavia    = 25;


TYPE

{Standard File}
SFReply = RECORD
            good: BOOLEAN;      {ignore command if FALSE}
            copy: BOOLEAN;      {not used}
            fType: OsType;      {file type or not used}
            vRefNum: INTEGER;   {volume reference number}
            version: INTEGER;   {file's version number}
            fName: String[63];  {file name}
          END; {SFReply}
SFTypeList = ARRAY[0..3] OF OSType;


{interface for international resources}
intl0Hndl = ^intl0Ptr;
intl0Ptr = ^intl0REc;
intl0Rec = PACKED RECORD
    decimalPt: char;                {ASCII character for decimal point}
    thousSep: char;                 {ASCII character for thousand separator}
    listSep: char;                  {ASCII character for list separator}
    currSym1: char;                 {ASCII for currency symbol (3 bytes long)}
    currSym2: char;
    currSym3: char;
    currFmt: Byte;                  {currency format flags}
    dateOrder: Byte;                {short date form - DMY,YMD, or MDY}
    shrtDateFmt: Byte;              {date elements format flag}
    dateSep: char;                  {ASCII for date separator}
    timeCycle: Byte;                {indicates 12 or 24 hr cycle}
    timeFmt: Byte;                  {time elements format flags}
    mornStr: PACKED ARRAY[1..4] OF char; {ASCII for trailing string from 0:00 to 11:59}
    eveStr: PACKED ARRAY[1..4] OF char; {ASCII for trailing string from 12:00 to 23:59}
    timeSep: char;                  {ASCII for the time separator}
    time1Suff: char;                {suffix string used in 24 hr mode}
    time2Suff: char;                {8 characters long}
    time3Suff: char;
    time4Suff: char;
    time5Suff: char;
    time6Suff: char;
    time7Suff: char;
    time8Suff: char;
    metricSys: Byte;                {indicates metric or English system}
    intl0Vers: INTEGER;             {version: high byte = country, low byte = vers}
  END; {intl0Rec}

DateForm = (shortDate, longDate, abbrevDate);

intl1Hndl = ^intl1Ptr;
intl1Ptr = ^intl1REc;
intl1Rec = PACKED RECORD
    days: ARRAY[1..7] OF String[15];    {length and word for Sunday through Monday}
    months: ARRAY[1..12] OF String[15]; {length and word for January to December}
    suppressDay: Byte;                  {0 for day of week, 255 for no day of week}
    lngDateFmt: Byte;                   {expanded date format 0 or 255}
    dayLeading0: Byte;                  {255 for leading 0, 0 for no leading 0}
    abbrLen: Byte;                      {length of abbreviated names in long form}
    st0: PACKED ARRAY[1..4] OF char;           {the string st0}
    st1: PACKED ARRAY[1..4] OF char;           {the string st1}
    st2: PACKED ARRAY[1..4] OF char;           {the string st2}
    st3: PACKED ARRAY[1..4] OF char;           {the string st3}
    st4: PACKED ARRAY[1..4] OF char;           {the string st4}
    intl1Vers: INTEGER;                 {version word}
    localRtn: INTEGER;                  {routine for localizing mag comp;       }
                                        {minimal case is $4E75 for RTS, but     }
                                        {routine may be longer than one integer.}
  END; {intl1Rec}



{Standard File}
PROCEDURE SFPutFile(where: Point; prompt: Str255; origName: Str255;
                    dlgHook: ProcPtr; VAR reply: SFReply);
PROCEDURE SFPPutFile(where: Point; prompt: Str255; origName: Str255;
                     dlgHook: ProcPtr; VAR reply: SFReply; dlgID: INTEGER;
                     filterProc: ProcPtr);
PROCEDURE SFGetFile(where: Point; prompt: Str255; fileFilter: ProcPtr;
                    numTypes: INTEGER; typeList: SFTypeList; dlgHook: ProcPtr;
                    VAR reply: SFReply);
PROCEDURE SFPGetFile(where: Point; prompt: Str255; fileFilter: ProcPtr;
                     numTypes: INTEGER; typeList: SFTypeList; dlgHook: ProcPtr;
                     VAR reply: SFReply; dlgID: INTEGER; filterProc: ProcPtr);

{interface to Disk Initialization Package}
PROCEDURE DILoad;
PROCEDURE DIUnLoad;
FUNCTION DIBadMount(where: Point; evtMessage: LongInt): INTEGER;
FUNCTION DIFormat(drvNum: INTEGER): OsErr;
FUNCTION DIVerify(drvNum: INTEGER): OsErr;
FUNCTION DIZero(drvNum: INTEGER; volName: Str255): OsErr;


{interface to International Utilities}
FUNCTION  IUGetIntl(theID: INTEGER): Handle;
PROCEDURE IUSetIntl(refNum: INTEGER; theID: INTEGER; intlParam: Handle);
PROCEDURE IUDateString(dateTime: LongInt; longFlag: DateForm; VAR result: Str255);
PROCEDURE IUDatePString(dateTime: LongInt; longFlag: DateForm; VAR result: Str255;
                     intlParam: Handle);
PROCEDURE IUTimeString(dateTime: LongInt; wantSeconds: BOOLEAN; VAR result: Str255);
PROCEDURE IUTimePString(dateTime: LongInt; wantSeconds: BOOLEAN; VAR result: Str255;
                     intlParam: Handle);
FUNCTION  IUMetric: BOOLEAN;
FUNCTION  IUCompString(aStr,bStr: Str255): INTEGER;
FUNCTION  IUEqualString(aStr,bStr: Str255): INTEGER;
FUNCTION  IUMagString(aPtr,bPtr: Ptr; aLen,bLen: INTEGER): INTEGER;
FUNCTION  IUMagIDString(aPtr,bPtr: Ptr; aLen,bLen: INTEGER):INTEGER;


{interface to Binary-Decimal Conversion}

PROCEDURE StringToNum(theString: Str255; VAR theNum: LongInt);
PROCEDURE NumToString(theNum: LongInt; VAR theString: Str255);

IMPLEMENTATION

{Binary-Decimal Conversion}

PROCEDURE StringToNum;EXTERNAL;
PROCEDURE NumToString;EXTERNAL;

{Standard File}
PROCEDURE SFPutFile;EXTERNAL;
PROCEDURE SFPPutFile;EXTERNAL;
PROCEDURE SFGetFile;EXTERNAL;
PROCEDURE SFPGetFile;EXTERNAL;

{Disk Initialization}
PROCEDURE DILoad;EXTERNAL;
PROCEDURE DIUnLoad;EXTERNAL;
FUNCTION DIBadMount;EXTERNAL;
FUNCTION DIFormat;EXTERNAL;
FUNCTION DIVerify;EXTERNAL;
FUNCTION DIZero;EXTERNAL;

{interface to International Utilities}
FUNCTION IUGetIntl;EXTERNAL;
PROCEDURE IUSetIntl;EXTERNAL;
PROCEDURE IUDateString;EXTERNAL;
PROCEDURE IUDatePString;EXTERNAL;
PROCEDURE IUTimeString;EXTERNAL;
PROCEDURE IUTimePString;EXTERNAL;
FUNCTION IUMetric;EXTERNAL;
FUNCTION  IUCompString;EXTERNAL;
FUNCTION  IUEqualString;EXTERNAL;
FUNCTION IUMagString;EXTERNAL;
FUNCTION IUMagIDString;EXTERNAL;


END. { of unit }

ntl1Ptr;
intl1Ptr = ^intl1REc;
intl1Rec = PACKED RECORD
    days: ARRAY[1..7] OF String[15];    {length and word for Sunday through Monday}
    months: ARRAY[1..12] OF String[15]; {length and word for January to December}
    suppressDay: Byte;                  {0 for day of week, 255 for no day of week}
    lngDateFsumacc/ws/intrfc/quickdraw   444      0     12       41562  3472707163  11175 W^5D!r^X%"
UNIT QuickDraw;

{  Copyright 1983 Apple Computer Inc.  }
{  Written by Bill Atkinson            }

{ Quickdraw2 modified 2/13/84 by R T Martin for inline traps }

INTERFACE

USES    {$U-}
        {$U obj/MemTypes  }  MemTypes;

CONST srcCopy      = 0;  { the 16 transfer modes }
      srcOr        = 1;
      srcXor       = 2;
      srcBic       = 3;
      notSrcCopy   = 4;
      notSrcOr     = 5;
      notSrcXor    = 6;
      notSrcBic    = 7;
      patCopy      = 8;
      patOr        = 9;
      patXor       = 10;
      patBic       = 11;
      notPatCopy   = 12;
      notPatOr     = 13;
      notPatXor    = 14;
      notPatBic    = 15;

{ QuickDraw color separation constants }

      normalBit    = 0;       { normal screen mapping   }
      inverseBit   = 1;       { inverse screen mapping  }
      redBit       = 4;       { RGB additive mapping }
      greenBit     = 3;
      blueBit      = 2;
      cyanBit      = 8;       { CMYBk subtractive mapping }
      magentaBit   = 7;
      yellowBit    = 6;
      blackBit     = 5;

      blackColor   = 33;      { colors expressed in these mappings }
      whiteColor   = 30;
      redColor     = 205;
      greenColor   = 341;
      blueColor    = 409;
      cyanColor    = 273;
      magentaColor = 137;
      yellowColor  = 69;

      picLParen    = 0;       { standard picture comments }
      picRParen    = 1;


TYPE QDByte    =  SignedByte;
     QDPtr     =  Ptr;              { blind pointer }
     QDHandle  =  Handle;           { blind handle  }
     Pattern   =  PACKED ARRAY[0..7] OF 0..255;
     Bits16    =  ARRAY[0..15] OF INTEGER;
     VHSelect  =  (v,h);
     GrafVerb  =  (frame,paint,erase,invert,fill);
     StyleItem =  (bold,italic,underline,outline,shadow,condense,extend);
     Style     =  SET OF StyleItem;

     FontInfo  =  RECORD
                    ascent:  INTEGER;
                    descent: INTEGER;
                    widMax:  INTEGER;
                    leading: INTEGER;
                  END;

     Point = RECORD CASE INTEGER OF

               0: (v: INTEGER;
                   h: INTEGER);

               1: (vh: ARRAY[VHSelect] OF INTEGER);

             END;


     Rect = RECORD CASE INTEGER OF

              0: (top:      INTEGER;
                  left:     INTEGER;
                  bottom:   INTEGER;
                  right:    INTEGER);

              1: (topLeft:  Point;
                  botRight: Point);
            END;


     BitMap = RECORD
                baseAddr: Ptr;
                rowBytes: INTEGER;
                bounds:   Rect;
              END;


     Cursor = RECORD
                data:    Bits16;
                mask:    Bits16;
                hotSpot: Point;
              END;


     PenState = RECORD
                  pnLoc:   Point;
                  pnSize:  Point;
                  pnMode:  INTEGER;
                  pnPat:   Pattern;
                END;


     PolyHandle = ^PolyPtr;
     PolyPtr    = ^Polygon;
     Polygon    = RECORD
                    polySize:   INTEGER;
                    polyBBox:   Rect;
                    polyPoints: ARRAY[0..0] OF Point;
                  END;


     RgnHandle = ^RgnPtr;
     RgnPtr    = ^Region;
     Region    =  RECORD
                    rgnSize:   INTEGER;  { rgnSize = 10 for rectangular }
                    rgnBBox:   Rect;
                    { plus more data if not rectangular }
                  END;


     PicHandle = ^PicPtr;
     PicPtr    = ^Picture;
     Picture   =  RECORD
                    picSize:    INTEGER;
                    picFrame:   Rect;
                    { plus byte codes for picture content }
                  END;


     QDProcsPtr = ^QDProcs;
     QDProcs = RECORD
                 textProc:    Ptr;
                 lineProc:    Ptr;
                 rectProc:    Ptr;
                 rRectProc:   Ptr;
                 ovalProc:    Ptr;
                 arcProc:     Ptr;
                 polyProc:    Ptr;
                 rgnProc:     Ptr;
                 bitsProc:    Ptr;
                 commentProc: Ptr;
                 txMeasProc:  Ptr;
                 getPicProc:  Ptr;
                 putPicProc:  Ptr;
               END;


     GrafPtr  = ^GrafPort;
     GrafPort = RECORD
                  device:      INTEGER;
                  portBits:    BitMap;
                  portRect:    Rect;
                  visRgn:      RgnHandle;
                  clipRgn:     RgnHandle;
                  bkPat:       Pattern;
                  fillPat:     Pattern;
                  pnLoc:       Point;
                  pnSize:      Point;
                  pnMode:      INTEGER;
                  pnPat:       Pattern;
                  pnVis:       INTEGER;
                  txFont:      INTEGER;
                  txFace:      Style;
                  txMode:      INTEGER;
                  txSize:      INTEGER;
                  spExtra:     LongInt;
                  fgColor:     LongInt;
                  bkColor:     LongInt;
                  colrBit:     INTEGER;
                  patStretch:  INTEGER;
                  picSave:     Handle;
                  rgnSave:     Handle;
                  polySave:    Handle;
                  grafProcs:   QDProcsPtr;
                END;



VAR thePort:    GrafPtr;
    white:      Pattern;
    black:      Pattern;
    gray:       Pattern;
    ltGray:     Pattern;
    dkGray:     Pattern;
    arrow:      Cursor;
    screenBits: BitMap;
    randSeed:   LongInt;


{ GrafPort Routines }

PROCEDURE InitGraf   (globalPtr: Ptr);                { INLINE $A86E;}
PROCEDURE OpenPort   (port: GrafPtr);                   INLINE $A86F;
PROCEDURE InitPort   (port: GrafPtr);                   INLINE $A86D;
PROCEDURE ClosePort  (port: GrafPtr);                   INLINE $A87D;
PROCEDURE SetPort    (port: GrafPtr);                   INLINE $A873;
PROCEDURE GetPort    (VAR port: GrafPtr);               INLINE $A874;
PROCEDURE GrafDevice (device: INTEGER);                 INLINE $A872;
PROCEDURE SetPortBits(bm: BitMap);                      INLINE $A875;
PROCEDURE PortSize   (width,height: INTEGER);           INLINE $A876;
PROCEDURE MovePortTo (leftGlobal,topGlobal: INTEGER);   INLINE $A877;
PROCEDURE SetOrigin  (h,v: INTEGER);                    INLINE $A878;
PROCEDURE SetClip    (rgn: RgnHandle);                  INLINE $A879;
PROCEDURE GetClip    (rgn: RgnHandle);                  INLINE $A87A;
PROCEDURE ClipRect   (r: Rect);                         INLINE $A87B;
PROCEDURE BackPat    (pat: Pattern);                    INLINE $A87C;


{ Cursor Routines }

PROCEDURE InitCursor;                                   INLINE $A850;
PROCEDURE SetCursor(crsr: Cursor);                      INLINE $A851;
PROCEDURE HideCursor;                                   INLINE $A852;
PROCEDURE ShowCursor;                                   INLINE $A853;
PROCEDURE ObscureCursor;                                INLINE $A856;


{ Line Routines }

PROCEDURE HidePen;                                      INLINE $A896;
PROCEDURE ShowPen;                                      INLINE $A897;
PROCEDURE GetPen     (VAR pt: Point);                   INLINE $A89A;
PROCEDURE GetPenState(VAR pnState: PenState);           INLINE $A898;
PROCEDURE SetPenState(pnState: PenState);               INLINE $A899;
PROCEDURE PenSize    (width,height: INTEGER);           INLINE $A89B;
PROCEDURE PenMode    (mode: INTEGER);                   INLINE $A89C;
PROCEDURE PenPat     (pat: Pattern);                    INLINE $A89D;
PROCEDURE PenNormal;                                    INLINE $A89E;
PROCEDURE MoveTo     (h,v: INTEGER);                    INLINE $A893;
PROCEDURE Move       (dh,dv: INTEGER);                  INLINE $A894;
PROCEDURE LineTo     (h,v: INTEGER);                    INLINE $A891;
PROCEDURE Line       (dh,dv: INTEGER);                  INLINE $A892;


{ Text Routines }

PROCEDURE TextFont     (font: INTEGER);                 INLINE $A887;
PROCEDURE TextFace     (face: Style);                   INLINE $A888;
PROCEDURE TextMode     (mode: INTEGER);                 INLINE $A889;
PROCEDURE TextSize     (size: INTEGER);                 INLINE $A88A;
PROCEDURE SpaceExtra   (extra: Fixed);                  INLINE $A88E;
PROCEDURE DrawChar     (ch: char);                      INLINE $A883;
PROCEDURE DrawString   (s: Str255);                     INLINE $A884;
PROCEDURE DrawText     (textBuf: Ptr; firstByte,byteCount: INTEGER); INLINE $A885;
FUNCTION  CharWidth    (ch: CHAR): INTEGER;             INLINE $A88D;
FUNCTION  StringWidth  (s: Str255): INTEGER;            INLINE $A88C;
FUNCTION  TextWidth    (textBuf: Ptr; firstByte,byteCount: INTEGER): INTEGER;
                                                        INLINE $A886;
PROCEDURE GetFontInfo  (VAR info: FontInfo);            INLINE $A88B;


{ Point Calculations }

PROCEDURE AddPt         (src: Point; VAR dst: Point);   INLINE $A87E;
PROCEDURE SubPt         (src: Point; VAR dst: Point);   INLINE $A87F;
PROCEDURE SetPt         (VAR pt: Point; h,v: INTEGER);  INLINE $A880;
FUNCTION  EqualPt       (pt1,pt2: Point): BOOLEAN;      INLINE $A881;
PROCEDURE ScalePt       (VAR pt: Point;    fromRect,toRect: Rect);   INLINE $A8F8;
PROCEDURE MapPt         (VAR pt: Point;    fromRect,toRect: Rect);   INLINE $A8F9;
PROCEDURE LocalToGlobal (VAR pt: Point);                INLINE $A870;
PROCEDURE GlobalToLocal (VAR pt: Point);                INLINE $A871;


{ Rectangle Calculations }

PROCEDURE SetRect    (VAR r: Rect; left,top,right,bottom: INTEGER);   INLINE $A8A7;
FUNCTION  EqualRect  (rect1,rect2: Rect): BOOLEAN;      INLINE $A8A6;
FUNCTION  EmptyRect  (r: Rect): BOOLEAN;                INLINE $A8AE;
PROCEDURE OffsetRect (VAR r: Rect; dh,dv: INTEGER);     INLINE $A8A8;
PROCEDURE MapRect    (VAR r:  Rect;     fromRect,toRect: Rect); INLINE $A8FA;
PROCEDURE InsetRect  (VAR r: Rect; dh,dv: INTEGER);     INLINE $A8A9;
FUNCTION  SectRect   (src1,src2: Rect; VAR dstRect: Rect): BOOLEAN; INLINE $A8AA;
PROCEDURE UnionRect  (src1,src2: Rect; VAR dstRect: Rect); INLINE $A8AB;
FUNCTION  PtInRect   (pt: Point; r: Rect): BOOLEAN;     INLINE $A8AD;
PROCEDURE Pt2Rect    (pt1,pt2: Point; VAR dstRect: Rect); INLINE $A8AC;


{ Graphical Operations on Rectangles }

PROCEDURE FrameRect  (r: Rect);                         INLINE $A8A1;
PROCEDURE PaintRect  (r: Rect);                         INLINE $A8A2;
PROCEDURE EraseRect  (r: Rect);                         INLINE $A8A3;
PROCEDURE InvertRect (r: Rect);                         INLINE $A8A4;
PROCEDURE FillRect   (r: Rect; pat: Pattern);            INLINE $A8A5;


{ RoundRect Routines }

PROCEDURE FrameRoundRect  (r: Rect; ovWd,ovHt: INTEGER);        INLINE $A8B0;
PROCEDURE PaintRoundRect  (r: Rect; ovWd,ovHt: INTEGER);        INLINE $A8B1;
PROCEDURE EraseRoundRect  (r: Rect; ovWd,ovHt: INTEGER);        INLINE $A8B2;
PROCEDURE InvertRoundRect (r: Rect; ovWd,ovHt: INTEGER);        INLINE $A8B3;
PROCEDURE FillRoundRect   (r: Rect; ovWd,ovHt: INTEGER; pat: Pattern);
                                                                INLINE $A8B4;

{ Oval Routines }

PROCEDURE FrameOval  (r: Rect);                         INLINE $A8B7;
PROCEDURE PaintOval  (r: Rect);                         INLINE $A8B8;
PROCEDURE EraseOval  (r: Rect);                         INLINE $A8B9;
PROCEDURE InvertOval (r: Rect);                         INLINE $A8BA;
PROCEDURE FillOval   (r: Rect; pat: Pattern);           INLINE $A8BB;


{ Arc Routines }

PROCEDURE FrameArc  (r: Rect; startAngle,arcAngle: INTEGER);    INLINE $A8BE;
PROCEDURE PaintArc  (r: Rect; startAngle,arcAngle: INTEGER);    INLINE $A8BF;
PROCEDURE EraseArc  (r: Rect; startAngle,arcAngle: INTEGER);    INLINE $A8C0;
PROCEDURE InvertArc (r: Rect; startAngle,arcAngle: INTEGER);    INLINE $A8C1;
PROCEDURE FillArc   (r: Rect; startAngle,arcAngle: INTEGER; pat: Pattern); INLINE $A8C2;
PROCEDURE PtToAngle (r: Rect; pt: Point; VAR angle: INTEGER);   INLINE $A8C3;


{ Polygon Routines }

FUNCTION  OpenPoly:    PolyHandle;                              INLINE $A8CB;
PROCEDURE ClosePoly;                                            INLINE $A8CC;
PROCEDURE KillPoly    (poly: PolyHandle);                       INLINE $A8CD;
PROCEDURE OffsetPoly  (poly: PolyHandle; dh,dv: INTEGER);       INLINE $A8CE;
PROCEDURE MapPoly     (poly: PolyHandle; fromRect,toRect: Rect);INLINE $A8FC;
PROCEDURE FramePoly   (poly: PolyHandle);                       INLINE $A8C6;
PROCEDURE PaintPoly   (poly: PolyHandle);                       INLINE $A8C7;
PROCEDURE ErasePoly   (poly: PolyHandle);                       INLINE $A8C8;
PROCEDURE InvertPoly  (poly: PolyHandle);                       INLINE $A8C9;
PROCEDURE FillPoly    (poly: PolyHandle; pat: Pattern);         INLINE $A8CA;


{ Region Calculations }

FUNCTION  NewRgn:   RgnHandle;                                  INLINE $A8D8;
PROCEDURE DisposeRgn(rgn: RgnHandle);                           INLINE $A8D9;
PROCEDURE CopyRgn   (srcRgn,dstRgn: RgnHandle);                 INLINE $A8DC;
PROCEDURE SetEmptyRgn(rgn: RgnHandle);                          INLINE $A8DD;
PROCEDURE SetRectRgn(rgn: RgnHandle; left,top,right,bottom: INTEGER); INLINE $A8DE;
PROCEDURE RectRgn   (rgn: RgnHandle; r: Rect);                  INLINE $A8DF;
PROCEDURE OpenRgn;                                              INLINE $A8DA;
PROCEDURE CloseRgn  (dstRgn: RgnHandle);                        INLINE $A8DB;
PROCEDURE OffsetRgn (rgn: RgnHandle; dh,dv: INTEGER);           INLINE $A8E0;
PROCEDURE MapRgn    (rgn: RgnHandle;   fromRect,toRect: Rect);  INLINE $A8FB;
PROCEDURE InsetRgn  (rgn: RgnHandle; dh,dv: INTEGER);           INLINE $A8E1;
PROCEDURE SectRgn   (srcRgnA,srcRgnB,dstRgn: RgnHandle);        INLINE $A8E4;
PROCEDURE UnionRgn  (srcRgnA,srcRgnB,dstRgn: RgnHandle);        INLINE $A8E5;
PROCEDURE DiffRgn   (srcRgnA,srcRgnB,dstRgn: RgnHandle);        INLINE $A8E6;
PROCEDURE XorRgn    (srcRgnA,srcRgnB,dstRgn: RgnHandle);        INLINE $A8E7;
FUNCTION  EqualRgn  (rgnA,rgnB: RgnHandle): BOOLEAN;            INLINE $A8E3;
FUNCTION  EmptyRgn  (rgn: RgnHandle): BOOLEAN;                  INLINE $A8E2;
FUNCTION  PtInRgn   (pt: Point; rgn: RgnHandle): BOOLEAN;       INLINE $A8E8;
FUNCTION  RectInRgn (r: Rect; rgn: RgnHandle): BOOLEAN;         INLINE $A8E9;


{ Graphical Operations on Regions }

PROCEDURE FrameRgn  (rgn: RgnHandle);                           INLINE $A8D2;
PROCEDURE PaintRgn  (rgn: RgnHandle);                           INLINE $A8D3;
PROCEDURE EraseRgn  (rgn: RgnHandle);                           INLINE $A8D4;
PROCEDURE InvertRgn (rgn: RgnHandle);                           INLINE $A8D5;
PROCEDURE FillRgn   (rgn: RgnHandle; pat: Pattern);             INLINE $A8D6;


{ Graphical Operations on BitMaps }

PROCEDURE ScrollRect(dstRect: Rect; dh,dv: INTEGER; updateRgn: rgnHandle); INLINE $A8EF;
PROCEDURE CopyBits  (srcBits,dstBits: BitMap;
                     srcRect,dstRect: Rect;
                     mode:            INTEGER;
                     maskRgn:         RgnHandle);               INLINE $A8EC;

{ Picture Routines }

FUNCTION  OpenPicture(picFrame: Rect): PicHandle;               INLINE $A8F3;
PROCEDURE ClosePicture;         INLINE $A8F4;
PROCEDURE DrawPicture(myPicture: PicHandle; dstRect: Rect);     INLINE $A8F6;
PROCEDURE PicComment(kind,dataSize: INTEGER; dataHandle: Handle);   INLINE $A8F2;
PROCEDURE KillPicture(myPicture: PicHandle);                    INLINE $A8F5;


{  The Bottleneck Interface:   }

PROCEDURE SetStdProcs(VAR procs: QDProcs);                      INLINE $A8EA;
PROCEDURE StdText    (count: INTEGER; textAddr: Ptr; numer,denom: Point);   INLINE $A882;
PROCEDURE StdLine    (newPt: Point);                            INLINE $A890;
PROCEDURE StdRect    (verb: GrafVerb; r: Rect);                 INLINE $A8A0;
PROCEDURE StdRRect   (verb: GrafVerb; r: Rect; ovWd,ovHt: INTEGER); INLINE $A8AF;
PROCEDURE StdOval    (verb: GrafVerb; r: Rect);                 INLINE $A8B6;
PROCEDURE StdArc     (verb: GrafVerb; r: Rect; startAngle,arcAngle: INTEGER); INLINE $A8BD;
PROCEDURE StdPoly    (verb: GrafVerb; poly: PolyHandle);        INLINE $A8C5;
PROCEDURE StdRgn     (verb: GrafVerb; rgn: RgnHandle);          INLINE $A8D1;
PROCEDURE StdBits    (VAR srcBits: BitMap; VAR srcRect,dstRect: Rect;
                      mode: INTEGER; maskRgn: RgnHandle);       INLINE $A8EB;
PROCEDURE StdComment (kind,dataSize: INTEGER; dataHandle: Handle);  INLINE $A8F1;
FUNCTION  StdTxMeas  (count: INTEGER; textAddr: Ptr;
                      VAR numer,denom: Point; VAR info: FontInfo): INTEGER; INLINE $A8ED;
PROCEDURE StdGetPic  (dataPtr: Ptr; byteCount: INTEGER);      INLINE $A8EE;
PROCEDURE StdPutPic  (dataPtr: Ptr; byteCount: INTEGER);      INLINE $A8F0;


{ Misc Utility Routines }

FUNCTION  GetPixel  (h,v: INTEGER): BOOLEAN;                    INLINE $A865;
FUNCTION  Random:   INTEGER;                                    INLINE $A861;
PROCEDURE StuffHex  (thingptr: Ptr; s:Str255);                INLINE $A866;
PROCEDURE ForeColor (color: LongInt);                           INLINE $A862;
PROCEDURE BackColor (color: LongInt);                           INLINE $A863;
PROCEDURE ColorBit  (whichBit: INTEGER);                        INLINE $A864;


IMPLEMENTATION

{$I intrfc/QuickDraw2.text }


NE $A8DE;
PROCEDURE RectRgn   (rgn: RgnHandle; r: Rect);                  INLINE $A8DF;
PROCEDURE OpenRgn;                                    sumacc/ws/intrfc/quickdraw2   444      0     12        4504  3472707163  11232 W^56PH r^..YO
{ QuickDraw2.text: Implementation part of QuickDraw }

{$S Graf }

TYPE FMOutPtr = ^FMOutRec;
     FMOutrec = PACKED RECORD
                  errNum:     INTEGER;     { used only for GrafError    }
                  fontHandle: QDHandle;    { handle to font             }
                  bold:       0..255;      { how much to smear horiz    }
                  italic:     0..255;      { how much to shear          }
                  ulOffset:   0..255;      { pixels below baseline      }
                  ulShadow:   0..255;      { how big is the halo        }
                  ulThick:    0..255;      { how thick is the underline }
                  shadow:     0..255;      { 0,1,2,or 3 only            }
                  extra:   -128..127;      { extra white dots each char }
                  ascent:     0..255;      { ascent measure for font    }
                  descent:    0..255;      { descent measure for font   }
                  widMax:     0..255;      { width of widest char       }
                  leading: -128..127;      { leading between lines      }
                  unused:     0..255;
                  numer:      Point;       { use this modified scale to }
                  denom:      Point;       { draw or measure text with  }
                END;



VAR wideOpen:   RgnHandle;     { a dummy rectangular region, read-only }
    wideMaster: RgnPtr;
    wideData:   Region;
    rgnBuf:     QDHandle;      { point saving buffer for OpenRgn       }
    rgnIndex:   INTEGER;       { current bytes used in rgnBuf          }
    rgnMax:     INTEGER;       { max bytes allocated so far to rgnBuf  }
    playPic:    PicHandle;     { used by StdGetPic                     }
    playIndex:  INTEGER;       { used by StdGetPic                     }
    thePoly:    PolyHandle;    { the current polygon being defined     }
    polyMax:    INTEGER;       { max bytes allocated so far to thePoly }
    patAlign:   Point;         { to align pattern during DrawPicture   }
    fontAdj:    LongInt;       { Fixed Point to adjust for font subst. }
    fontPtr:    FMOutPtr;      { the last font used, used by DrawText  }
    fontData:   FMOutRec;


{ grafPort routines }

{ It seems you have to have at least one procedure or function defined in the
  implementation section...}

Procedure InitGraf; EXTERNAL;

END. { of UNIT }





PROCEDURE StdBits    (VAR srcBits: BitMap; VAR srcRect,dstRect: Rect;
                      mode: INTEGER; maskRgn: RgnHandle);       INLINE $A8EB;
PROCEDURE StdComment (kind,dataSize: INsumacc/ws/intrfc/sane   444      0     12       22361  3472707164  10126 
A       O9!5P:H r^{$C Copyright Apple Computer, 1982 }
{MacIntosh version.}

UNIT Sane;

    INTERFACE

        CONST

            SIGDIGLEN = 20;     { Maximum length of SigDig. }

            DECSTRLEN = 80;     { Maximum length of DecStr. }

        TYPE

            {-----------------------------------------------------------------
            ** Numeric types.
            -----------------------------------------------------------------}

                Single   = array [0..1] of integer;
                Double   = array [0..3] of integer;
                Comp     = array [0..3] of integer;
                Extended = array [0..4] of integer;

            {-----------------------------------------------------------------
            ** Decimal string type and intermediate decimal type,
            ** representing the value:
            **      (-1)^sgn * 10^exp * dig
            -----------------------------------------------------------------}

                SigDig   = string [SIGDIGLEN];
                DecStr   = string [DECSTRLEN];
                Decimal  = record
                               sgn : 0..1;    { Sign (0 for pos, 1 for neg). }
                               exp : integer; { Exponent. }
                               sig : SigDig   { String of significant digits. }
                           end;

            {-----------------------------------------------------------------
            ** Modes, flags, and selections.
            ** NOTE: the values of the style element of the DecForm record
            ** have different names from the PCS version to avoid name
            ** conflicts.
            -----------------------------------------------------------------}

                Environ   = integer;
                RoundDir  = (TONEAREST, UPWARD, DOWNWARD, TOWARDZERO);
                RelOp     = (GT, LT, GL, EQ, GE, LE, GEL, UNORD);
                            { >   <  <>  =   >=  <=  <=> }
                Exception = (INVALID, UNDERFLOW, OVERFLOW, DIVBYZERO,
                                                                     INEXACT);
                NumClass  = (SNAN, QNAN, INFINITE, ZERO, NORMAL, DENORMAL);
                DecForm   = record
                                style  : (FloatDecimal, FixedDecimal);
                                digits : integer
                            end;

        {-----------------------------------------------------------------
        ** Two address, extended-based arithmetic operations.
        -----------------------------------------------------------------}

        procedure AddS (x : Single;   var y : Extended);
        procedure AddD (x : Double;   var y : Extended);
        procedure AddC (x : Comp;     var y : Extended);
        procedure AddX (x : Extended; var y : Extended);
            { y := y + x }

        procedure SubS (x : Single;   var y : Extended);
        procedure SubD (x : Double;   var y : Extended);
        procedure SubC (x : Comp;     var y : Extended);
        procedure SubX (x : Extended; var y : Extended);
            { y := y - x }

        procedure MulS (x : Single;   var y : Extended);
        procedure MulD (x : Double;   var y : Extended);
        procedure MulC (x : Comp;     var y : Extended);
        procedure MulX (x : Extended; var y : Extended);
            { y := y * x }

        procedure DivS (x : Single;   var y : Extended);
        procedure DivD (x : Double;   var y : Extended);
        procedure DivC (x : Comp;     var y : Extended);
        procedure DivX (x : Extended; var y : Extended);
            { y := y / x }

        function  CmpX (x : Extended; r : RelOp;
                                        y : Extended) : boolean;
            { x r y }

        function  RelX (x, y : Extended) : RelOp;
            { x RelX y, where RelX in [GT, LT, EQ, UNORD] }

        {-----------------------------------------------------------------
        ** Conversions between Extended and the other numeric types,
        ** including the types integer and Longint.
        -----------------------------------------------------------------}

        procedure I2X (x : integer;  var y : Extended);
        procedure S2X (x : Single;   var y : Extended);
        procedure D2X (x : Double;   var y : Extended);
        procedure C2X (x : Comp;     var y : Extended);
        procedure X2X (x : Extended; var y : Extended);
            { y := x (arithmetic assignment) }

        procedure X2I (x : Extended; var y : integer);
        procedure X2S (x : Extended; var y : Single);
        procedure X2D (x : Extended; var y : Double);
        procedure X2C (x : Extended; var y : Comp);
            { y := x (arithmetic assignment) }

        {-----------------------------------------------------------------
        ** These conversions apply to 68K systems only.  Longint is
        ** a 32-bit two's complement integer.
        -----------------------------------------------------------------}

        procedure L2X (x : Longint;  var y : Extended);
        procedure X2L (x : Extended; var y : Longint);
            { y := x (arithmetic assignment) }

        {-----------------------------------------------------------------
        ** Conversions between the numeric types and the intermediate
        ** decimal type.
        -----------------------------------------------------------------}

        procedure S2Dec (f : DecForm; x : Single;   var y : Decimal);
        procedure D2Dec (f : DecForm; x : Double;   var y : Decimal);
        procedure C2Dec (f : DecForm; x : Comp;     var y : Decimal);
        procedure X2Dec (f : DecForm; x : Extended; var y : Decimal);
            { y := x (according to the format f) }

        procedure Dec2S (x : Decimal; var y : Single);
        procedure Dec2D (x : Decimal; var y : Double);
        procedure Dec2C (x : Decimal; var y : Comp);
        procedure Dec2X (x : Decimal; var y : Extended);
            { y := x }

        {-----------------------------------------------------------------
        ** Conversions between the numeric types and strings.
        ** (These conversions have a built-in scanner/parser to convert
        ** between the intermediate decimal type and a string.)
        -----------------------------------------------------------------}

        procedure S2Str (f : DecForm; x : Single;   var y : DecStr);
        procedure D2Str (f : DecForm; x : Double;   var y : DecStr);
        procedure C2Str (f : DecForm; x : Comp;     var y : DecStr);
        procedure X2Str (f : DecForm; x : Extended; var y : DecStr);
            { y := x (according to the format f) }

        procedure Str2S (x : DecStr; var y : Single);
        procedure Str2D (x : DecStr; var y : Double);
        procedure Str2C (x : DecStr; var y : Comp);
        procedure Str2X (x : DecStr; var y : Extended);
            { y := x }

        {-----------------------------------------------------------------
        ** Numerical 'library' procedures and functions.
        -----------------------------------------------------------------}

        procedure RemX    (x : Extended; var y : Extended;
                                                         var quo : integer);
            { new y := remainder of ((old y) / x), such that
                       |new y| <= |x| / 2;
              quo := low order seven bits of integer quotient y / x,
                     so that -127 <= quo <= 127.                     }
        procedure SqrtX   (var x : Extended);
            { x := sqrt (x) }
        procedure RintX   (var x : Extended);
            { x := rounded value of x }
        procedure NegX    (var x : Extended);
            { x := -x }
        procedure AbsX    (var x : Extended);
            { x := |x| }
        procedure CpySgnX (var x : Extended; y : Extended);
            { x := x with the sign of y }

        procedure NextS   (var x : Single;   y : Single);
        procedure NextD   (var x : Double;   y : Double);
        procedure NextX   (var x : Extended; y : Extended);
            { x := next representable value from x toward y }

        function  ClassS  (x : Single;   var sgn : integer) : NumClass;
        function  ClassD  (x : Double;   var sgn : integer) : NumClass;
        function  ClassC  (x : Comp;     var sgn : integer) : NumClass;
        function  ClassX  (x : Extended; var sgn : integer) : NumClass;
            { sgn := sign of x (0 for pos, 1 for neg) }

        procedure ScalbX (n : integer; var y : Extended);
            { y := y * 2^n }
        procedure LogbX  (var x : Extended);
            { returns unbiased exponent of x }

        {-----------------------------------------------------------------
        ** Manipulations of the static numeric state.
        -----------------------------------------------------------------}

        procedure SetRnd  (r : RoundDir);
        procedure SetEnv  (e : Environ);
        procedure ProcExit(e : Environ);

        function  GetRnd  : RoundDir;
        procedure GetEnv  (var e : Environ);
        procedure ProcEntry (var e : Environ);

        function  TestXcp (x : Exception) : boolean;
        procedure SetXcp  (x : Exception; OnOff : boolean);
        function  TestHlt (x : Exception) : boolean;
        procedure SetHlt  (x : Exception; OnOff : boolean);

    {------------------------------------------------------------------------}

    IMPLEMENTATION

        {$I SANEIMP.TEXT}

END
-----------------------}

        procedure S2Dec (f : DecForm; x : Single;   var y : Decimal);
        procedure D2Dec (f : DecForm; x : Double;   var y : Decimal);
        procedure C2Dec (f : DecForm; x : Comp;     var y : Decimal);
        procedure X2Dec (f : DecForsumacc/ws/intrfc/toolintf   444      0     12      112131  3472707164  11051 3. "6F^5D!$^q||x1UNIT ToolIntf;

{ Created 23 Nov 1983  by Rony Sebok, merged from numerous files            }
{ Modification history:                                                     }
{       10 Feb 84   RTM   First pass at inline traps                        }
{       11 Apr 84   JTC   noControl, resUser out; scrapCount, axes added    }

{ Copyright 1982, 1983, 1984 by Apple Computer, Inc.  All Rights Reserved.  }

INTERFACE

USES    {$U-}
        {$U obj/MemTypes  }  MemTypes,
        {$U obj/QuickDraw }  QuickDraw,
        {$U Obj/OsIntf    }  OsIntf;

CONST
  { for Font Manager }

  systemFont = 0;
  applFont   = 1;
  NewYork = 2;
  Geneva  = 3;
  Monaco = 4;
  Venice = 5;
  London = 6;
  Athens = 7;
  SanFran = 8;
  Toronto = 9;

  propFont = $9000;
  fixedFont = $B000;
  fontWid = $ACB0;

  {for Window Manager}

  {window messages}
  wDraw         = 0;
  wHit          = 1;
  wCalcRgns     = 2;
  wNew          = 3;
  wDispose      = 4;
  wGrow         = 5;
  wDrawGIcon    = 6;

  {types of windows}
  dialogKind  = 2;
  userKind    = 8;

  {window definition procedure IDs}
  documentProc = 0;
  dBoxProc     = 1;
  plainDBox    = 2;
  altDBoxProc  = 3;
  noGrowDocProc = 4;
  rDocProc     = 16;

  {FindWindow Result Codes}
  inDesk       = 0;
  inMenuBar    = 1;
  inSysWindow  = 2;
  inContent    = 3;
  inDrag       = 4;
  inGrow       = 5;
  inGoAway     = 6;

  {defProc hit test codes}
  wNoHit       = 0;
  wInContent   = 1;
  wInDrag      = 2;
  wInGrow      = 3;
  wInGoAway    = 4;


  {axis constraints for DragGrayRgn call}
  noConstraint = 0;
  hAxisOnly    = 1;
  vAxisOnly    = 2;

  {for TextEdit}

  teJustLeft    = 0;
  teJustRight   = -1;
  teJustCenter  = 1;


  {for Resource Manager}

  {Resource attribute byte}
  resSysRef=      128;            { Reference to system resource? }
  resSysHeap=     64;             { System or application heap?   }
  resPurgeable=   32;             { Purgeable resource?           }
  resLocked=      16;             { Load it in locked?            }
  resProtected=   8;              { Protected?                    }
  resPreload=     4;              { Load in on OpenResFile?       }
  resChanged=     2;              { Resource changed?             }

  mapReadOnly=    128;            { Resource file read-only       }
  mapCompact=     64;             { Compact resource file         }
  mapChanged=     32;             { Write map out at update       }


  resNotFound=    -192;           { Resource not found            }
  resFNotFound=   -193;           { Resource file not found       }
  addResFailed=   -194;           { AddResource failed            }
  addRefFailed=   -195;           { AddReference failed           }
  rmvResFailed=   -196;           { RmveResource failed           }
  rmvRefFailed=   -197;           { RmveReference failed          }


  {ID's for resources provided in sysResDef}

{standard cursor definitions}
iBeamCursor = 1;            {text selection cursor}
crossCursor = 2;            {for drawing graphics}
plusCursor  = 3;            {for structured selection}
watchCursor = 4;            {for indicating a long delay}

{icons}
stopIcon = 0;
noteIcon = 1;
cautionIcon = 2;

{patterns}
patternList = 0;       {ID of PAT# which contains 38 patterns}



  {for Control Manager}

  {control messages}
  drawCntl  = 0;
  testCntl  = 1;
  calcCRgns = 2;
  initCntl  = 3;
  dispCntl  = 4;
  posCntl   = 5;
  thumbCntl = 6;
  dragCntl  = 7;
  autoTrack = 8;


  {FindControl Result Codes}
  inButton     = 10;
  inCheckbox   = 11;
  inUpButton   = 20;
  inDownButton = 21;
  inPageUp     = 22;
  inPageDown   = 23;
  inThumb      = 129;

  {control definition proc ID's}
  pushButProc   = 0;
  checkBoxProc  = 1;
  radioButProc  = 2;
  scrollBarProc = 16;

  useWFont      = 8;

  {for Dialog Manager}

  userItem=     0;
  ctrlItem=     4;
    btnCtrl=    0;              { Low two bits specify what kind of control }
    chkCtrl=    1;
    radCtrl=    2;
    resCtrl=    3;

  statText=     8;              { Static text    }
  editText=     16;             { Editable text  }
  iconItem=     32;             { Icon item      }
  picItem=      64;             { Picture item   }
  itemDisable=   128;           { Disable item if set }

  OK=           1;              { OK button is first by convention }
  Cancel=       2;              { Cancel button is second by convention }


  {for Menu Manager}

  noMark      =    0;   { mark symbols for MarkItem }
  commandMark =   $11;
  checkMark   =   $12;
  diamondMark =   $13;
  appleMark   =   $14;
  TextMenuProc =  0;

  { menu defProc messages }
  mDrawMsg    = 0;
  mChooseMsg  = 1;
  mSizeMsg    = 2;


  {for Scrap Manager}

  noTypeErr = -102;

  {package manager}
  dskInit = 2;          {Disk Initializaton}
  stdFile = 3;          {Standard File}
  flPoint = 4;          {Floating-Point Arithmetic}
  trFunc = 5;           {Transcendental Functions}
  intUtil = 6;          {International Utilities}
  bdConv = 7;           {Binary/Decimal Conversion}


TYPE

  {General Utilities}

  Int64Bit =
      RECORD
          hiLong: LongInt;
          loLong: LongInt;
      END;

  CursPtr = ^Cursor;
  CursHandle = ^CursPtr;

  PatPtr = ^Pattern;
  PatHandle = ^PatPtr;


  {for Font Manager}

  FMInput = PACKED RECORD
              family:   INTEGER;
              size:     INTEGER;
              face:     Style;
              needBits: BOOLEAN;
              device:   INTEGER;
              numer:    Point;
              denom:    Point;
            END;

  FMOutPtr = ^FMOutPut;

  FMOutPut = PACKED RECORD
               errNum:     INTEGER;
               fontHandle: Handle;
               bold:       Byte;
               italic:     Byte;
               ulOffset:   Byte;
               ulShadow:   Byte;
               ulThick:    Byte;
               shadow:     Byte;
               extra:      SignedByte;
               ascent:     Byte;
               descent:    Byte;
               widMax:     Byte;
               leading:    SignedByte;
               unused:     Byte;
               numer:      Point;
               denom:      Point;
             END;


  FontRec = RECORD
              fontType: INTEGER;
              firstChar: INTEGER;
              lastChar: INTEGER;
              widMax: INTEGER;
              kernMax: INTEGER;
              nDescent: INTEGER;
              fRectMax: INTEGER;
              chHeight: INTEGER;
              owTLoc: INTEGER;
              ascent: INTEGER;
              descent: INTEGER;
              leading: INTEGER;
              rowWords: INTEGER;
             {bitImage: ARRAY[1..rowWords,1..chHeight] OF INTEGER;
              locTable: ARRAY[firstChar..lastChar+2] OF INTEGER;
              owTable: ARRAY[firstChar..lastChar+2] OF INTEGER;}
            END;

  {for Event Manager}

  {the Event Record is defined in OsIntf}

   KeyMap = ARRAY[0..3] OF LONGINT;

  {for Window Manager}

  WindowPtr    = GrafPtr;
  WindowPeek   = ^WindowRecord;
  ControlHandle = ^ControlPtr;      {for Control Manager}

  WindowRecord = RECORD
                   port:          GrafPort;
                   windowKind:    INTEGER;
                   visible:       BOOLEAN;
                   hilited:       BOOLEAN;
                   goAwayFlag:    BOOLEAN;
                   spareFlag:     BOOLEAN;
                   strucRgn:      RgnHandle;
                   contRgn:       RgnHandle;
                   updateRgn:     RgnHandle;
                   windowDefProc: Handle;
                   dataHandle:    Handle;
                   titleHandle:   StringHandle;
                   titleWidth:    INTEGER;
                   ControlList:   ControlHandle;
                   nextWindow:    WindowPeek;
                   windowPic:     PicHandle;
                   refCon:        LongInt;
                 END;


  {for TextEdit}

  TERec = RECORD
            destRect: Rect;                 {Destination rectangle}
            viewRect: Rect;                 {view rectangle}
            selRect: Rect;                  {Select rectangle}
            lineHeight: INTEGER;            {Current font lineheight}
            fontAscent: INTEGER;            {Current font ascent}
            selPoint: Point;                {Selection point(mouseLoc)}

            selStart: INTEGER;              {Selection start}
            selEnd: INTEGER;                {Selection end}

            active: INTEGER;                {<>0 if active}

            wordBreak:  ProcPtr;            {Word break routine}
            clikLoop:  ProcPtr;             {Click loop routine}

            clickTime: LONGINT;             {Time of first click}
            clickLoc: INTEGER;              {Char. location of click}

            caretTime: LONGINT;             {Time for next caret blink}
            caretState: INTEGER;            {On/active booleans}

            just: INTEGER;                  {fill style}

            TELength: INTEGER;              {Length of text below}
            hText: Handle;                  {Handle to actual text}

            recalBack: INTEGER;             {<>0 if recal in background}
            recalLines: INTEGER;            {Line being recal'ed}
            clikStuff: INTEGER;             {click stuff (internal)}

            crOnly: INTEGER;                {Set to -1 if CR line breaks only}

            txFont: INTEGER;                {Text Font}
            txFace: Style;                  {Text Face}
            txMode: INTEGER;                {Text Mode}
            txSize: INTEGER;                {Text Size}

            inPort: GrafPtr;                {Grafport}

            highHook: ProcPtr;              {Highlighting hook}
            caretHook: ProcPtr;             {Highlighting hook}

            nLines: INTEGER;                {Number of lines}
            lineStarts: ARRAY [0..16000] OF INTEGER; {Actual line starts themselves}
          END; {RECORD}
  TEPtr = ^TERec;
  TEHandle = ^TEPtr;

  CharsHandle = ^CharsPtr;
  CharsPtr = ^Chars;
  Chars = PACKED ARRAY[0..32000] OF CHAR;


  {for Resource Manager}

  ResType=PACKED ARRAY[1..4] OF CHAR;


  {for Control Manager}


  ControlPtr    = ^ControlRecord;

  ControlRecord =
     RECORD
       nextControl:        ControlHandle;
       contrlOwner:        WindowPtr;
       contrlRect:         Rect;
       contrlVis:          BOOLEAN;
       contrlHilite:       BOOLEAN;
       contrlValue:        INTEGER;
       contrlMin:          INTEGER;
       contrlMax:          INTEGER;
       contrlDefProc:      Handle;
       contrlData:         Handle;
       contrlAction:       ProcPtr;
       contrlrfCon:        LONGINT;
       contrlTitle:        Str255;
     END; {ControlRecord}


  {for Dialog Manager}

  DialogPtr=    WindowPtr;
  DialogPeek=   ^DialogRecord;
  DialogRecord= Record
                  window:      WindowRecord;
                  Items:       Handle;
                  textH:       TEHandle;
                  EditField:   Integer;
                  EditOpen:    INTEGER;
                  ADefItem:    INTEGER;
                End;

  DialogTHndl=  ^DialogTPtr;
  DialogTPtr=   ^DialogTemplate;
  DialogTemplate=RECORD
                   boundsRect:  Rect;
                   procID:      INTEGER;
                   visible:     BOOLEAN;
                   filler1:     BOOLEAN;
                   goAwayFlag:  BOOLEAN;
                   filler2:     BOOLEAN;
                   refCon:      LongInt;
                   ItemsID:     INTEGER;
                   title:       Str255;
                 END;

  StageList=    PACKED ARRAY [1..4] OF RECORD
                                         boldItem:  0..1;
                                         boxDrawn:  BOOLEAN;
                                         sound:     0..3;
                                       END;
  AlertTHndl=  ^AlertTPtr;
  AlertTPtr=   ^AlertTemplate;
  AlertTemplate=RECORD
                  boundsRect:  Rect;
                  itemsID:     INTEGER;
                  stages:      StageList;
                END;


  {for Menu Manager}

  MenuPtr = ^MenuInfo;
  MenuHandle = ^MenuPtr;
  MenuInfo = RECORD
               menuId:       INTEGER;
               menuWidth:    INTEGER;
               menuHeight:   INTEGER;
               menuProc:     Handle;
               enableFlags:  LongInt;
               menuData:     Str255;
             END;


  {for Scrap Manager}

  ScrapStuff = RECORD
      scrapSize: LONGINT;
      scrapHandle: Handle;
      scrapCount: INTEGER;
      scrapState: INTEGER;
      scrapName: StringPtr;
  END;
  pScrapStuff = ^ScrapStuff;



{General Utilities}

FUNCTION  BitAnd   (long1,long2: LongInt): LongInt;             INLINE $A858;
FUNCTION  BitOr    (long1,long2: LongInt): LongInt;             INLINE $A85B;
FUNCTION  BitXor   (long1,long2: LongInt): LongInt;             INLINE $A859;
FUNCTION  BitNot   (long: LongInt): LongInt;                    INLINE $A85A;
FUNCTION  BitShift (long: LongInt; count: INTEGER): LongInt;    INLINE $A85C;
FUNCTION  BitTst   (bytePtr: Ptr; bitNum: LongInt): BOOLEAN;    INLINE $A85D;
PROCEDURE BitSet   (bytePtr: Ptr; bitNum: LongInt);             INLINE $A85E;
PROCEDURE BitClr   (bytePtr: Ptr; bitNum: LongInt);             INLINE $A85F;
PROCEDURE LongMul  (a,b: LongInt; VAR dst: Int64Bit);           INLINE $A867;
FUNCTION  FixMul   (a,b: Fixed): Fixed;                         INLINE $A868;
FUNCTION  FixRatio (numer,denom: INTEGER): Fixed;               INLINE $A869;
FUNCTION  HiWord   (x: LongInt): INTEGER;                       INLINE $A86A;
FUNCTION  LoWord   (x: LongInt): INTEGER;                       INLINE $A86B;
FUNCTION  FixRound (x: Fixed): INTEGER;                         INLINE $A86C;
PROCEDURE PackBits   (VAR srcPtr,dstPtr: Ptr; srcBytes: INTEGER); INLINE $A8CF;
PROCEDURE UnPackBits (VAR srcPtr,dstPtr: Ptr; dstBytes: INTEGER);INLINE $A8D0;
FUNCTION SlopeFromAngle(angle: INTEGER): Fixed;                 INLINE $A8BC;
FUNCTION AngleFromSlope(slope: Fixed): INTEGER;                 INLINE $A8C4;
FUNCTION DeltaPoint(ptA,ptB: Point): LongInt;                   INLINE $A84F;


FUNCTION  NewString(theString:Str255): StringHandle;            INLINE $A906;
PROCEDURE SetString(theString:StringHandle; strNew: Str255);    INLINE $A907;
FUNCTION  GetString(stringID:  INTEGER): StringHandle;          INLINE $A9BA;
PROCEDURE GetIndString(VAR theString: str255; strListID: INTEGER;
                       index: INTEGER);

FUNCTION Munger(h: Handle; offset: LongInt; ptr1: Ptr; len1: LongInt;
                ptr2: Ptr; len2: LongInt): LongInt;             INLINE $A9E0;

FUNCTION  GetIcon(iconID:    INTEGER):  Handle;                 INLINE $A9BB;
PROCEDURE PlotIcon(theRect: Rect; theIcon: Handle);             INLINE $A94B;
FUNCTION  GetCursor (cursorID: INTEGER):  CursHandle;           INLINE $A9B9;
FUNCTION  GetPattern(patID: INTEGER):  PatHandle;               INLINE $A9B8;
FUNCTION  GetPicture(picID: INTEGER):  PicHandle;               INLINE $A9BC;
PROCEDURE GetIndPattern(VAR thePat: Pattern; patListID: INTEGER;
                       index: INTEGER);

PROCEDURE ShieldCursor(shieldRect: Rect; offsetPt: Point);      INLINE $A855;


{for Font Manager}

PROCEDURE InitFonts;                                            INLINE $A8FE;
PROCEDURE GetFontName(familyID: INTEGER; VAR theName: Str255);  INLINE $A8FF;
PROCEDURE GetFNum(theName: Str255; VAR familyID: INTEGER);      INLINE $A900;
PROCEDURE SetFontLock(lockFlag: BOOLEAN);                       INLINE $A903;
FUNCTION  FMSwapFont(inRec: FMInput): FMOutPtr;                 INLINE $A901;
FUNCTION  RealFont(famID: INTEGER; size: INTEGER): BOOLEAN;     INLINE $A902;


{for Event Manager}

FUNCTION  EventAvail(mask:INTEGER; VAR theEvent: EventRecord): BOOLEAN;
                                                                INLINE $A971;
FUNCTION  GetNextEvent(mask:INTEGER; VAR theEvent: EventRecord): BOOLEAN;
                                                                INLINE $A970;
FUNCTION  StillDown:BOOLEAN;                                    INLINE $A973;
FUNCTION  WaitMouseUp:BOOLEAN;                                  INLINE $A977;
PROCEDURE GetMouse (VAR pt: Point);                             INLINE $A972;
FUNCTION  TickCount:LongInt;                                    INLINE $A975;
FUNCTION  Button: BOOLEAN;                                      INLINE $A974;
PROCEDURE GetKeys(VAR k: keyMap);                               INLINE $A976;

FUNCTION GetDblTime: LongInt;
FUNCTION GetCaretTime: LongInt;



{for Window Manager}

PROCEDURE ClipAbove(window: WindowPeek);                        INLINE $A90B;
PROCEDURE PaintOne(window: WindowPeek; clobbered: RgnHandle);   INLINE $A90C;
PROCEDURE PaintBehind(startWindow: WindowPeek; clobbered: RgnHandle);
                                                                INLINE $A90D;
PROCEDURE SaveOld(window: WindowPeek);                          INLINE $A90E;
PROCEDURE DrawNew(window: WindowPeek; fUpdate: BOOLEAN);        INLINE $A90F;
PROCEDURE CalcVis(window: WindowPeek);                          INLINE $A909;
PROCEDURE CalcVisBehind(startWindow: WindowPeek; clobbered: RgnHandle);
                                                                INLINE $A90A;
PROCEDURE ShowHide(window: WindowPtr; showFlag: BOOLEAN);       INLINE $A908;

FUNCTION  CheckUpdate(VAR theEvent: EventRecord): BOOLEAN;      INLINE $A911;
PROCEDURE GetWMgrPort(VAR wPort: GrafPtr);                      INLINE $A910;

PROCEDURE InitWindows;                                          INLINE $A912;
FUNCTION  NewWindow(wStorage:   Ptr;
                    boundsRect: Rect;
                    title:      Str255;
                    visible:    BOOLEAN;
                    theProc:    INTEGER;
                    behind:     WindowPtr;
                    goAwayFlag: BOOLEAN;
                    refCon:     LongInt): WindowPtr;            INLINE $A913;

PROCEDURE DisposeWindow (theWindow: WindowPtr);                 INLINE $A914;
PROCEDURE CloseWindow   (theWindow: WindowPtr);                 INLINE $A92D;
PROCEDURE MoveWindow    (theWindow: WindowPtr; h,v: INTEGER; BringToFront:BOOLEAN);
                                                                INLINE $A91B;
PROCEDURE SizeWindow    (theWindow: WindowPtr; width,height: INTEGER; fUpdate: BOOLEAN);
                                                                INLINE $A91D;
FUNCTION  GrowWindow    (theWindow: windowPtr; startPt: Point; bBox: Rect): LongInt;
                                                                INLINE $A92B;
PROCEDURE DragWindow    (theWindow: WindowPtr; startPt: Point; boundsRect: Rect);
                                                                INLINE $A925;
PROCEDURE ShowWindow    (theWindow: WindowPtr);                 INLINE $A915;
PROCEDURE HideWindow    (theWindow: WindowPtr);                 INLINE $A916;
PROCEDURE SetWTitle     (theWindow: WindowPtr; title: Str255);    INLINE $A91A;
PROCEDURE GetWTitle     (theWindow: WindowPtr; VAR title: Str255); INLINE $A919;
PROCEDURE HiliteWindow  (theWindow: WindowPtr; fHiLite: BOOLEAN); INLINE $A91C;
PROCEDURE BeginUpdate   (theWindow: WindowPtr);                 INLINE $A922;
PROCEDURE EndUpdate     (theWindow: WindowPtr);                 INLINE $A923;
PROCEDURE SetWRefCon    (theWindow: WindowPtr; data: LongInt);  INLINE $A918;
FUNCTION  GetWRefCon    (theWindow: WindowPtr): LongInt;        INLINE $A917;
PROCEDURE SetWindowPic  (theWindow: WindowPtr; thePic: PicHandle); INLINE $A92E;
FUNCTION  GetWindowPic  (theWindow: WindowPtr): PicHandle;      INLINE $A92F;
PROCEDURE BringToFront  (theWindow: WindowPtr);                 INLINE $A920;
PROCEDURE SendBehind    (theWindow,behind: WindowPtr);          INLINE $A921;
FUNCTION  FrontWindow:   WindowPtr;                             INLINE $A924;
PROCEDURE SelectWindow  (theWindow: WindowPtr);                 INLINE $A91F;
FUNCTION  TrackGoAway   (theWindow: WindowPtr; thePt: Point): BOOLEAN;
                                                                INLINE $A91E;
PROCEDURE DrawGrowIcon  (theWindow: WindowPtr);                 INLINE $A904;

PROCEDURE ValidRect     (goodRect: Rect);                       INLINE $A92A;
PROCEDURE ValidRgn      (goodRgn: RgnHandle);                   INLINE $A929;
PROCEDURE InvalRect     (badRect: Rect);                        INLINE $A928;
PROCEDURE InvalRgn      (badRgn:  RgnHandle);                   INLINE $A927;
FUNCTION  FindWindow    (thePoint: Point;
                          VAR  theWindow: WindowPtr): INTEGER;  INLINE $A92C;
FUNCTION  GetNewWindow  (windowID: INTEGER; wStorage: Ptr;
                              behind: WindowPtr): WindowPtr;    INLINE $A9BD;
FUNCTION  PinRect(theRect: Rect; thePt: Point): LongInt;        INLINE $A94E;
FUNCTION  DragGrayRgn(theRgn: RgnHandle; startPt: Point; boundsRect,
                      slopRect: Rect;axis: INTEGER;
                      actionProc: ProcPtr): LongInt;            INLINE $A905;

{For TextEdit}

PROCEDURE TEActivate( h: TEHandle );                            INLINE $A9D8;
PROCEDURE TECalText( h: TEHandle );                             INLINE $A9D0;
PROCEDURE TEClick( pt: Point; extend: BOOLEAN; h: TEHandle );   INLINE $A9D4;
PROCEDURE TECopy( h: TEHandle );                                INLINE $A9D5;
PROCEDURE TECut( h: TEHandle );                                 INLINE $A9D6;
PROCEDURE TEDeActivate( h: TEHandle );                          INLINE $A9D9;
PROCEDURE TEDelete( h: TEHandle );                              INLINE $A9D7;
PROCEDURE TEDispose( h: TEHandle );                             INLINE $A9CD;
PROCEDURE TEIdle( h: TEHandle );                                INLINE $A9DA;
PROCEDURE TEInit;                                               INLINE $A9CC;
PROCEDURE TEKey( key: CHAR; h: TEHandle );                      INLINE $A9DC;
FUNCTION  TENew( dest, view: Rect ): TEHandle;                  INLINE $A9D2;
PROCEDURE TEPaste( h: TEHandle );                               INLINE $A9DB;
PROCEDURE TEScroll( dh, dv: INTEGER; h: TEHandle );             INLINE $A9DD;
PROCEDURE TESetSelect( selStart, selEnd: LONGINT; h: TEHandle  ); INLINE $A9D1;
PROCEDURE TESetText( inText: Ptr; textLength: LONGINT; h: TEHandle ); INLINE $A9CF;
PROCEDURE TEInsert( inText: Ptr; textLength: LONGINT; h: TEHandle ); INLINE $A9DE;
PROCEDURE TEUpdate( rUpdate: Rect; h: TEHandle );               INLINE $A9D3;
PROCEDURE TESetJust( just: INTEGER; h: TEHandle );              INLINE $A9DF;
FUNCTION  TEGetText( h: TEHandle ): CharsHandle;                INLINE $A9CB;

FUNCTION TEScrapHandle: Handle;
FUNCTION TEGetScrapLen: LongInt;
PROCEDURE TESetScrapLen(length: LongInt);

{Box drawing utility}
PROCEDURE TextBox( inText: Ptr; textLength: LONGINT; r: Rect; style: INTEGER );
                                                                INLINE $A9CE;


{for Resource Manager}

FUNCTION  InitResources: INTEGER;                               INLINE $A995;
PROCEDURE RsrcZoneInit;                                         INLINE $A996;
PROCEDURE CreateResFile(fileName:  Str255);                     INLINE $A9B1;
FUNCTION  OpenResFile(fileName: Str255): INTEGER;               INLINE $A997;
PROCEDURE UseResFile(refNum:  INTEGER);                         INLINE $A998;
FUNCTION  GetResFileAttrs(refNum:  INTEGER): INTEGER;           INLINE $A9F6;
PROCEDURE SetResFileAttrs(refNum:  INTEGER;  attrs:  INTEGER);  INLINE $A9F7;
PROCEDURE UpdateResFile(refNum:  INTEGER);                      INLINE $A999;
PROCEDURE CloseResFile(refNum:  INTEGER);                       INLINE $A99A;
PROCEDURE SetResPurge(install:  Boolean);                       INLINE $A993;
PROCEDURE SetResLoad(AutoLoad:  Boolean);                       INLINE $A99B;
FUNCTION  CountResources(theType:  ResType): INTEGER;           INLINE $A99C;
FUNCTION  GetIndResource(theType: ResType; index:  INTEGER): Handle;
                                                                INLINE $A99D;
FUNCTION  CountTypes:  INTEGER;                                 INLINE $A99E;
PROCEDURE GetIndType(VAR theType:  ResType; index:  INTEGER);   INLINE $A99F;
FUNCTION  UniqueID(theType:  ResType):  INTEGER;                INLINE $A9C1;
FUNCTION  GetResource(theType: ResType; ID: INTEGER): Handle;   INLINE $A9A0;
FUNCTION  GetNamedResource(theType:  ResType; name: Str255): Handle;
                                                                INLINE $A9A1;
PROCEDURE LoadResource(theResource: Handle);                    INLINE $A9A2;
PROCEDURE ReleaseResource(theResource:  Handle);                INLINE $A9A3;
PROCEDURE DetachResource(theResource:  Handle);                 INLINE $A992;
PROCEDURE ChangedResource(theResource:  Handle);                INLINE $A9AA;
PROCEDURE WriteResource(theResource:  Handle);                  INLINE $A9B0;
FUNCTION  HomeResFile(theResource: Handle): INTEGER;            INLINE $A9A4;
FUNCTION  CurResFile:  INTEGER;                                 INLINE $A994;
FUNCTION  GetResAttrs(theResource: Handle): INTEGER;            INLINE $A9A6;
PROCEDURE SetResAttrs(theResource: Handle; attrs: INTEGER);     INLINE $A9A7;
PROCEDURE GetResInfo(theResource:  Handle;
                     VAR theID:    INTEGER;
                     VAR theType:  ResType;
                     VAR name:     Str255);                     INLINE $A9A8;
PROCEDURE SetResInfo(theResource:  Handle;
                     theID:        INTEGER;
                     name:         Str255);                     INLINE $A9A9;
PROCEDURE AddResource(theResource:  Handle;
                      theType:      ResType;
                      theID:        INTEGER;
                      name:         Str255);                    INLINE $A9AB;
PROCEDURE AddReference(theResource:  Handle;
                       theID:        INTEGER;
                       name:         Str255);                   INLINE $A9AC;
PROCEDURE RmveResource(theResource:  Handle);                   INLINE $A9AD;
PROCEDURE RmveReference(theResource:  Handle);                  INLINE $A9AE;
FUNCTION SizeResource(theResource: Handle): LongInt;            INLINE $A9A5;
FUNCTION  ResError:  INTEGER;                                   INLINE $A9AF;

{for Control Manager}

FUNCTION  NewControl(curWindow:  windowPtr;
                    boundsRect: Rect;
                    title:      Str255;
                    visible:    BOOLEAN;
                    value:      INTEGER;
                    min:        INTEGER;
                    max:        INTEGER;
                    contrlProc: INTEGER;
                    refCon:     LongInt): ControlHandle;        INLINE $A954;
PROCEDURE DisposeControl (theControl: ControlHandle);           INLINE $A955;
PROCEDURE KillControls   (theWindow:  WindowPtr);               INLINE $A956;

PROCEDURE MoveControl    (theControl: ControlHandle; h,v: INTEGER); INLINE $A959;
PROCEDURE SizeControl    (theControl: ControlHandle; w,h: INTEGER); INLINE $A95C;
PROCEDURE DragControl    (theControl: ControlHandle; startPt: Point;
                          bounds: Rect; slopRect: Rect; axis:INTEGER); INLINE $A967;
PROCEDURE ShowControl    (theControl: ControlHandle);           INLINE $A957;
PROCEDURE HideControl    (theControl: ControlHandle);           INLINE $A958;
PROCEDURE SetCTitle      (theControl: ControlHandle; title: Str255); INLINE $A95F;
PROCEDURE GetCTitle      (theControl: ControlHandle; VAR title: Str255); INLINE $A95E;
PROCEDURE HiliteControl  (theControl: ControlHandle; hiliteState: INTEGER);
                                                                INLINE $A95D;
PROCEDURE SetCRefCon     (theControl: ControlHandle; data: LongInt); INLINE $A95B;
FUNCTION  GetCRefCon     (theControl: ControlHandle): LongInt;  INLINE $A95A;

PROCEDURE SetCtlValue    (theControl: ControlHandle; theValue: INTEGER); INLINE $A963;
FUNCTION  GetCtlValue    (theControl: ControlHandle): INTEGER;  INLINE $A960;

FUNCTION  GetCtlMin      (theControl: ControlHandle): INTEGER;  INLINE $A961;
FUNCTION  GetCtlMax      (theControl: ControlHandle): INTEGER;  INLINE $A962;
PROCEDURE SetCtlMin      (theControl: ControlHandle; theValue: INTEGER); INLINE $A964;
PROCEDURE SetCtlMax      (theControl: ControlHandle; theValue: INTEGER); INLINE $A965;

FUNCTION  GetCtlAction   (theControl: ControlHandle): ProcPtr;  INLINE $A96A;
PROCEDURE SetCtlAction   (theControl: ControlHandle; newProc: ProcPtr); INLINE $A96B;

FUNCTION  TestControl    (theControl: ControlHandle; thePt: Point): INTEGER;
                                                                INLINE $A966;
FUNCTION  TrackControl   (theControl:ControlHandle; thePt: Point;
                            actionProc:ProcPtr):INTEGER;        INLINE $A968;

FUNCTION  FindControl (thePoint: Point;
                       theWindow: WindowPtr;
                       VAR theControl: ControlHandle): INTEGER; INLINE $A96C;
PROCEDURE DrawControls (theWindow: WindowPtr);                  INLINE $A969;
FUNCTION  GetNewControl (controlID: INTEGER; owner: WindowPtr): ControlHandle;
                                                                INLINE $A9BE;

{for Dialog Manager}

PROCEDURE InitDialogs(restartProc: ProcPtr);                    INLINE $A97B;
FUNCTION GetNewDialog(dialogID: Integer;
                      wStorage: Ptr;
                      behind:  WindowPtr): DialogPtr;           INLINE $A97C;
FUNCTION  NewDialog(wStorage:   Ptr;
                    boundsRect: Rect;
                    title:      Str255;
                    visible:    BOOLEAN;
                    theProc:    INTEGER;
                    behind:     WindowPtr;
                    goAwayFlag: BOOLEAN;
                    refCon:     LongInt;
                    itmLstHndl: Handle): DialogPtr;             INLINE $A97D;
FUNCTION IsDialogEvent(event:   EventRecord): BOOLEAN;          INLINE $A97F;
FUNCTION DialogSelect( event:   EventRecord;
                       VAR theDialog:  DialogPtr;
                       VAR itemHit: INTEGER): BOOLEAN;          INLINE $A980;
PROCEDURE ModalDialog( filterProc: ProcPtr; VAR itemHit: INTEGER);
                                                                INLINE $A991;
PROCEDURE DrawDialog(dialog: DialogPtr);                        INLINE $A981;
PROCEDURE CloseDialog(dialog: DialogPtr);                       INLINE $A982;
PROCEDURE DisposDialog(dialog: DialogPtr);                      INLINE $A983;
FUNCTION  Alert(alertID:     Integer;
                filterProc:  ProcPtr): Integer;                 INLINE $A985;
FUNCTION  StopAlert(alertID:     Integer;
                    filterProc:  ProcPtr): Integer;             INLINE $A986;
FUNCTION  NoteAlert(alertID:     Integer;
                    filterProc:  ProcPtr): Integer;             INLINE $A987;
FUNCTION  CautionAlert(alertID:     Integer;
                       filterProc:  ProcPtr): Integer;          INLINE $A988;
PROCEDURE CouldAlert(alertID:  Integer);                        INLINE $A989;
PROCEDURE FreeAlert(alertID:   Integer);                        INLINE $A98A;
PROCEDURE CouldDialog(DlgID:  Integer);                         INLINE $A979;
PROCEDURE FreeDialog(DlgID:   Integer);                         INLINE $A97A;
PROCEDURE ParamText(cite0, cite1, cite2, cite3:  Str255);       INLINE $A98B;
PROCEDURE ErrorSound(sound: ProcPtr);                           INLINE $A98C;
PROCEDURE GetDItem(dialog:         DialogPtr;
                   itemNo:         Integer;
                   VAR kind:       Integer;
                   VAR item:       Handle;
                   VAR box:        Rect);                       INLINE $A98D;
PROCEDURE SetDItem(dialog:         DialogPtr;
                   itemNo:         Integer;
                   kind:           Integer;
                   item:           Handle;
                   box:            Rect);                       INLINE $A98E;
PROCEDURE SetIText(item:       Handle;
                   text:       Str255);                         INLINE $A98F;
PROCEDURE GetIText(item:       Handle;
                   VAR text:   Str255);                         INLINE $A990;
PROCEDURE SelIText(dialog:   DialogPtr;
                   itemNo:   Integer;
                   startSel, endSel: INTEGER );                 INLINE $A97E;

{routines designed only for use in Pascal}
FUNCTION GetAlrtStage: INTEGER;             {returns aCount}
PROCEDURE ResetAlrtStage;

PROCEDURE DlgCut(dialog: DialogPtr);
PROCEDURE DlgPaste(dialog: DialogPtr);
PROCEDURE DlgCopy(dialog: DialogPtr);
PROCEDURE DlgDelete(dialog: DialogPtr);

PROCEDURE SetDAFont(fontNum: INTEGER);

{for Desk Manager}

FUNCTION  SystemEvent(myEvent: EventRecord): BOOLEAN;           INLINE $A9B2;
PROCEDURE SystemClick(theEvent: EventRecord; theWindow: windowPtr); INLINE $A9B3;
PROCEDURE SystemTask;                                           INLINE $A9B4;
PROCEDURE SystemMenu(menuResult: LongInt);                      INLINE $A9B5;
FUNCTION  SystemEdit(editCode: INTEGER): BOOLEAN;               INLINE $A9C2;
FUNCTION  OpenDeskAcc(theAcc: Str255): INTEGER;                 INLINE $A9B6;
PROCEDURE CloseDeskAcc(refNum: INTEGER);                        INLINE $A9B7;

{for Menu Manager}

PROCEDURE InitMenus;                                            INLINE $A930;
FUNCTION  NewMenu(menuID: INTEGER; menuTitle: Str255): menuHandle; INLINE $A931;
FUNCTION  GetMenu(rsrcID:  INTEGER): MenuHandle;                INLINE $A9BF;
PROCEDURE DisposeMenu(menu: menuHandle);                        INLINE $A932;
PROCEDURE AppendMenu(menu: menuHandle; data: str255);           INLINE $A933;

PROCEDURE InsertMenu (menu: MenuHandle; beforeId: INTEGER);     INLINE $A935;
PROCEDURE DeleteMenu (menuId: INTEGER);                         INLINE $A936;
PROCEDURE DrawMenuBar;                                          INLINE $A937;
PROCEDURE ClearMenuBar;                                         INLINE $A934;

FUNCTION  GetMenuBar:Handle;                                    INLINE $A93B;
FUNCTION  GetNewMBar(menuBarID:  INTEGER): Handle;              INLINE $A9C0;
PROCEDURE SetMenuBar(menuBar: Handle);                          INLINE $A93C;

FUNCTION  MenuSelect (startPt: Point): LongInt;                 INLINE $A93D;
FUNCTION  MenuKey    (ch: CHAR): LongInt;                       INLINE $A93E;
PROCEDURE HiLiteMenu (menuId: INTEGER);                         INLINE $A938;

PROCEDURE SetItem    (menu: menuHandle; item: INTEGER; itemString: Str255);
                                                                INLINE $A947;
PROCEDURE GetItem    (menu: menuHandle; item: INTEGER; VAR itemString: Str255);
                                                                INLINE $A946;
PROCEDURE EnableItem (menu: menuHandle; item: INTEGER);         INLINE $A939;
PROCEDURE DisableItem(menu: menuHandle; item: INTEGER);         INLINE $A93A;
PROCEDURE CheckItem  (menu: menuHandle; item: INTEGER; checked: BOOLEAN);
                                                                INLINE $A945;

PROCEDURE SetItemIcon(menu: menuHandle; item: INTEGER; iconNum: Byte);
                                                                INLINE $A940;
PROCEDURE GetItemIcon(menu: menuHandle; item: INTEGER; VAR iconNum: Byte);
                                                                INLINE $A93F;
PROCEDURE SetItemStyle(menu: menuHandle; item: INTEGER; styleVal: Style);
                                                                INLINE $A942;
PROCEDURE GetItemStyle(menu: menuHandle; item: INTEGER; VAR styleVal: Style);
                                                                INLINE $A941;
PROCEDURE SetItemMark(menu: menuHandle; item: INTEGER; markChar: CHAR);
                                                                INLINE $A944;
PROCEDURE GetItemMark(menu: menuHandle; item: INTEGER; VAR markChar: CHAR);
                                                                INLINE $A943;
PROCEDURE SetMenuFlash(flashCount: INTEGER);                    INLINE $A94A;
PROCEDURE FlashMenuBar(menuID: INTEGER);                        INLINE $A94C;

FUNCTION  GetMHandle(menuID: INTEGER): menuHandle;              INLINE $A949;
FUNCTION  CountMItems(menu:  menuHandle):  INTEGER;             INLINE $A950;
PROCEDURE AddResMenu(menu: menuHandle; theType:ResType);        INLINE $A94D;
PROCEDURE InsertResMenu(menu: menuHandle; theType:ResType; afterItem: INTEGER);
                                                                INLINE $A951;
PROCEDURE CalcMenuSize(menu:menuHandle);                        INLINE $A948;

{for Scrap Manager}

FUNCTION  GetScrap( hDest: Handle; what: ResType; VAR offset: LONGINT ): LONGINT;
                                                                INLINE $A9FD;
FUNCTION  InfoScrap: pScrapStuff;                               INLINE $A9F9;
FUNCTION  LoadScrap: LONGINT;                                   INLINE $A9FA;
FUNCTION  PutScrap( length: LONGINT; what: ResType; source: Ptr  ): LONGINT;
                                                                INLINE $A9FE;
FUNCTION  UnloadScrap: LONGINT;                                 INLINE $A9FA;
FUNCTION  ZeroScrap: LONGINT;                                   INLINE $A9FC;

{package manager}
PROCEDURE InitAllPacks;                                         INLINE $A9E6;
PROCEDURE InitPack(packID: INTEGER);                            INLINE $A9E5;



IMPLEMENTATION

{for Text Edit}
FUNCTION TEScrapHndl; EXTERNAL;
FUNCTION TEGetScrapLen; EXTERNAL;
PROCEDURE TESetScrapLen; EXTERNAL;

{for Dialog Manager}
{routines designed only for use in Pascal}
FUNCTION GetAlrtStage; EXTERNAL;
PROCEDURE ResetAlrtStage; EXTERNAL;

PROCEDURE DlgCut;           EXTERNAL;
PROCEDURE DlgPaste;         EXTERNAL;
PROCEDURE DlgCopy;          EXTERNAL;
PROCEDURE DlgDelete;        EXTERNAL;

PROCEDURE SetDAFont; EXTERNAL;

{for Event Mgr}
FUNCTION GetDblTime; EXTERNAL;
FUNCTION GetCaretTime; EXTERNAL;

{for general utilities}
PROCEDURE GetIndString;EXTERNAL;
PROCEDURE GetIndPattern;EXTERNAL;


END. { of unit }
N  GetMenuBar:Handle;                                    INLINE $A93B;
FUNCTION  GetNewMBar(menuBarID:  INTEGER): Handle;              INLINE $A9C0;
PROCEDURE SetMenuBar(menuBar: Handle);                          INLINE $A93C;

FUNCTION  MenuSelect (startPt: Point): LongInt;                 INLINE $A93D;
FUNCTION  MenuKey    (ch: CHAR): LongInt;                       INLINE $A93E;
PROCEDURE HiLiteMenu (menuId: INTEGER);sumacc/ws/intrfc/macprint-   444      0     12       51652  3472707164  11077 3. "6F^5D!$^{ ---------------------------------------------------------------------- }
UNIT MacPrint;

{$U-} {Turn on/off the Lisa Libraries.}
{$X-} {Turn on/off stack expansion.}
{$R-} {Turn on/off range checking.}
{$D-} {Turn on/off debug symbols.}

INTERFACE

{ ---------------------------------------------------------------------- }

USES  {$U Obj/MemTypes  }  MemTypes,
      {$U Obj/QuickDraw }  QuickDraw,
      {$U Obj/OSIntf    }  OSIntf;

{Interface compile flags, also check CONST's}
{$SETC fWordBkOK  = TRUE }  {Turn on/off word breaking in spool file.[PfWrite]}
{$SETC fULFixOK   = TRUE }  {Turn on/off fixing UL.[PfWrite, PrBand]}

{ ---------------------------------------------------------------------- }

CONST
   iPrPgFract  = 120;            {Page scale factor. ptPgSize (below) is in units of 1/iPrPgFract }

   iPrPgFst = 1;                 {Page range constants}
   iPrPgMax = 9999;

   iIOBufBytes= 522;             {Size of file sys buf.}
   iIOBlkBytes= 512;             {Size of disk block}
   iPrRelease = 2;               {Current version number of the code.}
   iPrintX    = 19;              {Spare integers in print rec}

{The TPrint Resource type & ID's}
   lPStrType = $53545220;        {"STR ": Res type for the Pr Rsrc file name}
   iPStrRFil = $E000; {-8192}    {Str $E000 [in SysRes] is the current printer's rsrc file}
   iPStrPFil = $E001; {-8191}    {Str $E001 is the default print file name}

   lPrintType = $50524543;    {"PREC": Res type for the hPrint records}
   iPrintDef = 0;             {Default hPrint  }
   iPrintLst = 1;             {Last used hPrint}
   iPrintDrvr= 2;             {.Print's parameter record; not a Print rec}
   iMyPrDrvr = $E000; {-8192} {My copy of the above.}

{PicFile constants}
   iPfMaxPgs   = 128;
   lPfType     = $5046494C;  {"PFIL"}
   lPfSig      = $50535953;  {"PSYS"}
   iPfIcon     = 140;

   lPrType     = $4150504C;  {"APPL"}
   lPrSig      = $50535953;  {"PSYS"}
   iPrIcon     = 138;

{Driver & Resource constants}
   sPrDrvr    = '.Print';
   iPrDrvrID  = 2;         {Driver's ResID}
   iPrDrvrRef = $FFFD;     {Driver's RefNum = NOT ResID}
   iPrDrvrDev = $FD00;     {Driver's QD Dev num = RefNum in Hi Byte, variant in lo}
   iPrBitsCtl = 4;         {The Bitmap Print Proc's ctl number}
   lScreenBits= $00000000; {The Bitmap Print Proc's Screen Bitmap param}
   lPaintBits = $00000001; {The Bitmap Print Proc's Paint [sq pix] param}
   lHiScreenBits= $00000010; {The Bitmap Print Proc's Screen Bitmap param}
   lHiPaintBits = $00000011; {The Bitmap Print Proc's Paint [sq pix] param}
   iPrIOCtl   = 5;         {The Raw Byte IO Proc's ctl number}
   iPrEvtCtl  = 6;         {The PrEvent Proc's ctl number}
   lPrEvtAll  = $0002FFFD; {The PrEvent Proc's CParam for the entire screen}
   lPrEvtTop  = $0001FFFD; {The PrEvent Proc's CParam for the top folder}
   iPrDevCtl  = 7;         {The PrDevCtl Proc's ctl number}
   lPrReset   = $00010000; {The PrDevCtl Proc's CParam for reset}
   lPrPageEnd = $00020000; {The PrDevCtl Proc's CParam for end page}
   lPrLineFeed= $00030000; {The PrDevCtl Proc's CParam for paper advance}
   lPrLFSixth = $0003FFFF; {The PrDevCtl Proc's CParam for 1/6 th inch paper advance}
   lPrLFEighth= $0003FFFE; {The PrDevCtl Proc's CParam for 1/8 th inch paper advance}
   iFMgrCtl   = 8;         {The FMgr's Tail-hook Proc's ctl number}
                           { [The Pre-Hook is the status call] }
{General Dlg/Alert[=Ax] Constants:}
    iOK = 1;  iCancel = 2;
   iPrStlDlg= $E000; {-8192}
   iPrJobDlg= $E001; {-8191}
   iPrCfgDlg= $E002; {-8190}
   iPgFeedAx= $E00A; {-8182}
   iPicSizAx= $E00B; {-8181}
   iIOAbrtAx= $E00C; {-8180}

{Sys Error & Deap Shit Constants:}
   iMemFullErr = -108;
   iPrAbort    = 128;
   iPicLim     = 129;
   iPicMax     = 130;
   iIOAbort    = -27;
   iPrDeapShit = 29;


{The PrVars lo mem area:}
   pPrGlobals  = $00000944;
   bDraftLoop  = 0;
   bSpoolLoop  = 1;
   bUser1Loop  = 2;
   bUser2Loop  = 3;

{ ---------------------------------------------------------------------- }

TYPE

   TN       =  0..15;            {A Nibble}
   TStr80   =  String[80];       {A medium size string}
   TPStr80  =  ^TStr80;          {..its pointer}
   TPRect   =  ^Rect;            {A Rect Ptr}
   TPBitMap =  ^BitMap;          {A BitMap Ptr}

   TWord = PACKED RECORD      {General purpose "alias" record for a word & long.}
      CASE Integer OF
         0: ( c1, c0: Char );
         1: ( b1, b0: SignedByte );
         2: ( usb1, usb0: Byte );
         3: ( n3, n2, n1, n0: TN );
         4: ( f15, f14, f13, f12, f11, f10, f9, f8, f7, f6, f5, f4, f3, f2, f1, f0: Boolean );
         5: ( i0: Integer );
   END;
   TLong = RECORD
      CASE Integer OF
         0: ( w1, w0: TWord );
         1: ( l0: LongInt );
         2: ( p0: Ptr );
         3: ( h0: Handle );
         4: ( pt: Point );
   END;
                     {NOTE: Changes will also affect: PrEqu, TCiVars & TPfVars}
   TPrVars = RECORD  {4 longs for printing, see SysEqu for location.}
      iPrErr:     Integer;          {Current print error.  Set to iPrAbort to abort printing.}
      bDocLoop:   SignedByte;       {The Doc style: Draft, Spool, .., and ..}
                                    {Currently use low 2 bits; the upper 6 are for flags.}
      bUser1:     SignedByte;       {Spares used by the print code}
      lUser1:     TLong;
      lUser2:     TLong;
      lUser3:     TLong;
   END;
   TPPrVars = ^TPrVars;

   TPrInfo = RECORD     {Print Info Record: The parameters needed for page composition.}
      iDev:       Integer;             {Font mgr/QuickDraw device code}
      iVRes:      Integer;             {Resolution of device, in device coordinates}
      iHRes:      Integer;             {   ..note: V before H => compatable with Point.}
      rPage:      Rect;                {The page (printable) rectangle in device coordinates.}
   END;
   TPPrInfo = ^TPrInfo;

{These are types of paper feeders.}
   TFeed = ( feedCut, feedFanfold, feedMechCut, feedOther );

   TPrStl = RECORD      {Printer Style: The printer configuration and usage information.}
      wDev:       TWord;         {The device (driver) number.  Hi byte=RefNum, Lo byte=variant.}
      iPageV:     Integer;       {paper size in units of 1/iPrPgFract}
      iPageH:     Integer;       {   ..note: V before H => compatable with Point.}
      bPort:      SignedByte;    {The IO port number. Refnum?}
      feed:       TFeed;         {paper feeder type.}
   END;
   TPPrStl = ^TPrStl;

{Banding data structures.  Not of general interest to Apps.}
   TScan =                    {Band Scan direction Top-Bottom, Left-Right, etc.}
      ( scanTB,  scanBT, scanLR, scanRL );

   TPrXInfo = RECORD             {The print time eXtra information.}
      iRowBytes:  Integer;       {The Band's rowBytes.}
      iBandV:     Integer;       {Size of band, in device coordinates}
      iBandH:     Integer;       {   ..note: V before H => compatable with Point.}
      iDevBytes:  Integer;       {Size for allocation.  May be more than rBounds size!}
      iBands:     Integer;       {Number of bands per page.}

      bPatScale:  SignedByte;    {Pattern scaling}
      bULThick:   SignedByte;    {3 Underscoring parameters}
      bULOffset:  SignedByte;
      bULShadow:  SignedByte;

      scan:       TScan;         {Band scan direction}
      bXInfoX:    SignedByte;    {An eXtra byte.}
   END;
   TPPrXInfo = ^TPrXInfo;

   TPrJob = RECORD      {Print Job: Print "form" for a single print request.}
      iFstPage:   Integer;       {Page Range.}
      iLstPage:   Integer;
      iCopies:    Integer;       {No. copies.}
      bJDocLoop:  SignedByte;    {The Doc style: Draft, Spool, .., and ..}
      fFromUsr:   Boolean;       {Printing from an User's App (not PrApp) flag}
      pIdleProc:  ProcPtr;       {The Proc called while waiting on IO etc.}
      pFileName:  TPStr80;       {Spool File Name: NIL for default.}
      iFileVol:   Integer;       {Spool File vol, set to 0 initially}
      bFileVers:  SignedByte;    {Spool File version, set to 0 initially}
      bJobX:      SignedByte;    {An eXtra byte.}
   END;
   TPPrJob = ^TPrJob;

   TPrint = RECORD      {The universal 120 byte printing record}
      iPrVersion: Integer;             {Printing software version}
      PrInfo:     TPrInfo;             {the PrInfo data associated with the current style.}
      rPaper:     Rect;                {The paper rectangle [offset from rPage].}
      PrStl:      TPrStl;              {This print request's style.}
      PrInfoPT:   TPrInfo;             {Print Time Imaging metrics}
      PrXInfo:    TPrXInfo;            {Print-time (expanded) Print info record.}
      PrJob:      TPrJob;              {The Print Job request}
      PrintX:     Array[1..iPrintX]of integer;    {Spare to fill to 120 bytes!}
   END;
   TPPrint = ^TPrint;
   THPrint = ^TPPrint;

{Printing Graf Port.  All printer imaging, whether spooling, banding, etc, happens "thru" a GrafPort.}
   TPrPort =  RECORD    {This is the "PrPeek" record.}
      GPort:      GrafPort;         {The Printer's graf port.}
      GProcs:     QDProcs;          {..and its procs}

      lGParam1:   TLong;            {Some params: Our relocatable stuff etc.}
      lGParam2:   TLong;
      lGParam3:   TLong;
      lGParam4:   TLong;

      fOurPtr:    Boolean;          {Whether the PrPort allocation was done by us.}
      fOurBits:   Boolean;          {Whether the BitMap allocation was done by us.}
   END;
   TPPrPort = ^TPrPort;
   TPPort = RECORD                  {Pascal Yuk: Alias to merge a grafport & prport}
      CASE Integer OF
         0: (pGPort:   GrafPtr);
         1: (pPrPort:  TPPrPort);
   END;

   TPrStatus = RECORD      {Print Status: Print information during printing.}
      iTotPages:  Integer;             {Total pages in Print File.}
      iCurPage:   Integer;             {Current page number}
      iTotCopies: Integer;             {Total copies requested}
      iCurCopy:   Integer;             {Current copy number}
      iTotBands:  Integer;             {Total bands per page.}
      iCurBand:   Integer;             {Current band number}
      fPgDirty:   Boolean;             {True if current page has been written to.}
      fImaging:   Boolean;             {Set while in band's DrawPic call.}
      hPrint:     THPrint;             {Handle to the active Printer record}
      pPrPort:    TPPrPort;            {Ptr to the active PrPort}
      hPic:       PicHandle;           {Handle to the active Picture}
   END;
   TPPrStatus = ^TPrStatus;

{PicFile = a TPfHeader followed by n QuickDraw Pics (whose PicSize is invalid!)}
   TPfPgDir =  RECORD
      iPages:     Integer;
      lPgPos:     ARRAY [0..iPfMaxPgs] OF LongInt;
   END;
   TPPfPgDir = ^TPfPgDir;
   THPfPgDir = ^TPPfPgDir;

   TPfHeader =  RECORD     {Print File header.}
      Print:      TPrint;
      PfPgDir:    TPfPgDir;
   END;
   TPPfHeader = ^TPfHeader;
   THPfHeader = ^TPPfHeader;  {Note: Type compatable with an hPrint.}

(* This is not included here due to requiring $Use-ing the entire world!
   It's only used by those desiring to customize the print dialogs.
   TPrDlg = RECORD      {Print Dialog: The Dialog Stream object.}
      Dlg:        DialogRecord;  {The Dialog window}
      pFltrProc:  ProcPtr;       {The Filter Proc.}
      pItemProc:  ProcPtr;       {The Item evaluating proc.}
      hPrintUsr:  THPrint;       {The user's print record.}
      fDoIt:      Boolean;
      fDone:      Boolean;
      lUser1:     TLong;         {Four longs for user's to hang global data.}
      lUser2:     TLong;
      lUser3:     TLong;
      lUser4:     TLong;
   {  ...Plus more stuff needed by the particular printing dialog.}
   END;
   TPPrDlg = ^TPrDlg;      {== a dialog ptr}
*)
{ ---------------------------------------------------------------------- }

{  --Init--  }
PROCEDURE PrOpen;
   { Open the .Print driver, get the Current Printer's Rsrc file
     name from SysRes, open the resource file, and open the .Print driver
     living in SysRes.
     PrOpen MUST be called during init time. }
PROCEDURE PrClose;
   {Closes JUST the print rsrc file.  Leaves the .Print driver in SysRes open.}

{  --Print Dialogs & Default--  }
PROCEDURE PrintDefault  ( hPrint: THPrint );
   { Defaults a handle to a Default Print record.
     Note: You allocate (or fetch from file's resources..) the handle,
           I fill it.  Also, I may invoke this at odd times whenever
           I think you have an invalid Print record! }

FUNCTION  PrValidate ( hPrint: THPrint ): Boolean;
   { Checks the hPrint.  Fixes it if there has been a change in SW
     version or in the current printer. Returns fChanged.
     Note: Also updates the various parameters within the Print
           record to match the current values of the PrStl & PrJob.
           It does NOT set the fChanged result if these
           parameters changed as a result of this update. }

FUNCTION  PrStlDialog  ( hPrint: THPrint ): Boolean;
FUNCTION  PrJobDialog  ( hPrint: THPrint ): Boolean;
   { The Dialog returns the fDoIt flag:
         IF PrJobDialog(..) THEN BEGIN
            PrintMyDoc (..);
            SaveMyStl (..)
         END
             OR
         IF PrStlDialog(..) THEN SaveMyStl (..)
      NOTE: These may change the hPrint^^ if the version number
            is old or the printer is not the current one.  }
PROCEDURE PrJobMerge (hPrintSrc, hPrintDst: THPrint);
   { Merges hPrintSrc's PrJob into hPrintDst [Source/Destination].
     Allows one job dialog being applied to several docs [Finder printing] }

{  --The Document printing procs: These spool a print file.--  }
FUNCTION PrOpenDoc ( hPrint:     THPrint;
                     pPrPort:    TPPrPort;
                     pIOBuf:     Ptr ): TPPrPort;
   { Set up a graf port for Pic streaming and make it the current port.
     Init the print file page directory.
     Create and open the print file.
     hPrint: The print info.
     pPrPort: the storage to use for the TPrPort.  If NIL we allocate.
     pIOBuf: an IO buf; if NIL, file sys uses volume buf.
     returns TPPrPort: The TPPrPort (graf port) used to spool thru. }

PROCEDURE PrCloseDoc ( pPrPort: TPPrPort );
   { Write the print file page directory.
     Close the print file. }

PROCEDURE PrOpenPage ( pPrPort: TPPrPort; pPageFrame: TPRect );
   { If current page is in the range of printed pages:
       Open a picture for the page
       Otherwise set a null port for absorbing an image.
     pPageFrame := PrInfo.rPage, unless you're scaling.
     Set pPageFrame to NIL unless you want to perform PicScaling on the printer.
     [The printing procs will call OpenPicture (pPageFrame^) and DrawPicture (hPic, rPage);]
     Note: Use of QuickDraw may now cause File IO errors due to our Pic spooling! }

PROCEDURE PrClosePage( pPrPort: TPPrPort );
   { Close & kill the page picture.
     Update the file page directory.
     If we allocated the TPrPort then de-allocate it. }

{  --The "Printing Application" proc: Read and band the spooled PicFile.--  }
PROCEDURE PrPicFile( hPrint:        THPrint;
                     pPrPort:       TPPrPort;
                     pIOBuf:        Ptr;
                     pDevBuf:       Ptr;
                     VAR PrStatus:  TPrStatus );
   { Read and print the spooled print file.
     The idle proc is run during Imaging and Printing. }
(* Removed: fources assumption of use of Pic spool files!
PROCEDURE PrPic ( hPic:          PicHandle;
                  hPrint:        THPrint;
                  pPrPort:       TPPrPort;
                  pDevBuf:       Ptr;
                  VAR PrStatus:  TPrStatus );
   { Print a memory resident picture (one page). }
*)
{  --Get/Set the current Print Error--  }
FUNCTION  PrError: Integer;
PROCEDURE PrSetError ( iErr: Integer );

{  --The .Print driver calls.--  }
PROCEDURE PrDrvrOpen;
PROCEDURE PrDrvrClose;
   { Open/Close the .Print driver in SysRes.  Make it purgable or not.
     ONLY used by folks doing low level stuff, not full document printing. }

PROCEDURE PrCtlCall (iWhichCtl: Integer; lParam1, lParam2, lParam3: LongInt);
   { A generalized Control proc for the Printer driver.
     The main use is for bitmap printing:
         PrCtlCall (iPrBitsCtl, pBitMap, pPortRect, lControl);
         ==
         PROCEDURE PrBits  (  pBitMap:   Ptr;         --QuickDraw bitmap
                              pPortRect: TPRect;      --a portrect. use bounds for whole bitmap
                              lControl:  LongInt );   --0=>Screen resolution/Portrait
     This dumps a bitmap/portrect to the printer.
     lControl is a device dep param; use 0 for screen res/portrait/etc.
     Each different printer will use lControl parameter differently.
     Thus PrCtlCall (iPrBitsCtl, @MyPort^.ScreenBits, @MyPort^.PortRect.Bounds,0)
     performs a screen dump of just my port's data.

     Two special control calls are included in the driver for Screen printing from the
     key board:
            PrCtlCall (iPrEvtCtl, lPrEvtAll, 0, 0);  Prints the screen
            PrCtlCall (iPrEvtCtl, lPrEvtTop, 0, 0);  Prints the top folder
     These are handled by the system for key board access but can be called by anyone
     at any time.  They can be very cheap printing for ornaments, for example!

     Another useful call is used for sending raw data to the printer:
         PrCtlCall (iPrIOCtl, pBuf, lBufCount, pIdleProc); }

{These .Print driver calls are only available in the PrScreen module.--  }
PROCEDURE PrPurge;
PROCEDURE PrNoPurge;
FUNCTION  PrDrvrDCE:  Handle;
FUNCTION  PrDrvrVers: Integer;

{ --Semi private stuff-- }
(* The dialog customizing stuff:
FUNCTION  PrStlInit ( hPrint: THPrint ): TPPrDlg;
FUNCTION  PrJobInit ( hPrint: THPrint ): TPPrDlg;
FUNCTION  PrDlgMain ( hPrint: THPrint; pDlgInit: ProcPtr ): Boolean;
*)
PROCEDURE PrCfgDialog;
PROCEDURE PrHack ( lParam1, lParam2, lParam3: TLong );

{ ---------------------------------------------------------------------- }
{Misc Utilities}

{File Utilities: IO68K}
{FUNCTION PrStr80Ptr  (sName:TStr80): TPStr80;}
FUNCTION PrCreateFile(sName:TStr80; iVol: Integer; bVersion: SignedByte): Integer;
FUNCTION PrDeleteFile(sName:TStr80; iVol: Integer; bVersion: SignedByte): Integer;
FUNCTION PrOpenFile  (sName:TStr80; iVol: Integer; bVersion: SignedByte;
                    fTrunc: Boolean; pBuf: Ptr; VAR iRefNum: Integer):  Integer;
FUNCTION PrWriteBlk (iRefNum, iMode:Integer; lPos:LongInt; p:Ptr; lBytes:LongInt ):Integer;
FUNCTION PrReadBlk  (iRefNum, iMode:Integer; lPos:LongInt; p:Ptr; lBytes:LongInt ):Integer;
FUNCTION PrCloseFile(iRefNum: Integer): Integer;

{Scc utilitys: Scc68k}
FUNCTION  PrSCCInit  (iBaudEtc: Integer; lHndShk: LongInt): Integer;
FUNCTION  PrBlockOut (pIdleProc: ProcPtr; pData: Ptr; lBytes: LongInt): Integer;
(*FUNCTION  PrIOCheck  (lTimeOut:  LongInt; pData: Ptr; lBytes: LongInt): Integer;*)
PROCEDURE XPrIdle    (pIdleProc: ProcPtr);
PROCEDURE PrAbortCheck;

{Other Utilities: PrMacMisc}
FUNCTION  lPrMul (i1, i0: Integer): LongInt;
FUNCTION  lPrDiv (lTop: LongInt; iBot: Integer): LongInt;

{Performance tool}
Procedure SpyInit;
Procedure SpyClose;
Procedure Spy (iBucket: Integer);

{ ---------------------------------------------------------------------- }

IMPLEMENTATION


PROCEDURE PrOpen;                      EXTERNAL;
PROCEDURE PrClose;                     EXTERNAL;
PROCEDURE PrintDefault;                EXTERNAL;
FUNCTION  PrValidate;                  EXTERNAL;
FUNCTION  PrStlDialog;                 EXTERNAL;
FUNCTION  PrJobDialog;                 EXTERNAL;
PROCEDURE PrJobMerge;                  EXTERNAL;
FUNCTION  PrOpenDoc;                   EXTERNAL;
PROCEDURE PrCloseDoc;                  EXTERNAL;
PROCEDURE PrOpenPage;                  EXTERNAL;
PROCEDURE PrClosePage;                 EXTERNAL;
PROCEDURE PrPicFile;                   EXTERNAL;
PROCEDURE PrCfgDialog;                 EXTERNAL;
PROCEDURE PrHack;                      EXTERNAL;
FUNCTION  PrError;                     EXTERNAL;
PROCEDURE PrSetError;                  EXTERNAL;

PROCEDURE PrDrvrOpen;                  EXTERNAL;
PROCEDURE PrDrvrClose;                 EXTERNAL;
PROCEDURE PrPurge;                     EXTERNAL;
PROCEDURE PrNoPurge;                   EXTERNAL;
PROCEDURE PrCtlCall;                   EXTERNAL;
FUNCTION  PrDrvrDCE;                   EXTERNAL;
FUNCTION  PrDrvrVers;                  EXTERNAL;

{FUNCTION PrStr80Ptr;                     EXTERNAL;}
FUNCTION PrCreateFile;                   EXTERNAL;
FUNCTION PrDeleteFile;                   EXTERNAL;
FUNCTION PrOpenFile;                     EXTERNAL;
FUNCTION PrWriteBlk;                     EXTERNAL;
FUNCTION PrReadBlk;                      EXTERNAL;
FUNCTION PrCloseFile;                    EXTERNAL;

FUNCTION  lPrMul;                        EXTERNAL;
FUNCTION  lPrDiv;                        EXTERNAL;

FUNCTION  PrSCCInit;                   EXTERNAL;
FUNCTION  PrBlockOut;                  EXTERNAL;
(*FUNCTION  PrIOCheck;                   EXTERNAL;*)
PROCEDURE XPrIdle;                     EXTERNAL;
PROCEDURE PrAbortCheck;                EXTERNAL;

Procedure SpyInit;                     EXTERNAL;
Procedure SpyClose;                    EXTERNAL;
Procedure Spy;                         EXTERNAL;


{ ---------------------------------------------------------------------- }
END.

{Change Log

    2/ 9/84:   Removed PrPic Procedure: Assumes Pic based print file.
}
raw data to the printer:
         PrCtlCall (iPrIOCtl, pBuf, lBufCount, pIdleProc); }
sumacc/ws/local/   775      0     12           0  3472707166   6757 sumacc/ws/local/dsat0   444      0     12        7372  3472707165  10006 3. "6F^5P:H r^#;
; DS Alerts for Booting -- Resource Type DSAT, ID 0

            .INCLUDE    TlAsm/SYSEQU.TEXT
            .INCLUDE    TlAsm/SYSMACS.TEXT

             .PROC           DSAT,0

              .WORD     19                     ;number of entrys

; alert definitions

               .WORD     40,10,50,0,31,0,0      ;welcome to Mac OS
               .WORD     42,10,0,0,30,0,0       ;cant mount boot volume
               .WORD     43,10,52,0,0,0,60      ;cant find macsys.code
               .WORD     -10,10,53,0,0,0,0      ;loading Macsbug
               .WORD     -11,10,54,0,0,0,0      ;loading disassembler
               .WORD     -12,10,55,0,0,0,0      ;loading MacSys.code

; text definitions

Text0
               .WORD     50,Text2-Text0-4
               .WORD     108,192
               .ASCII    'Welcome to Macintosh.'
               .BYTE     00
               .ALIGN    2
Text2

; can't load RAM-based OS

               .WORD     52,Text3-Text2-4
               .WORD     108,130
               .ASCII    'Warning -- this start-up disk is not usable.'
               .BYTE     0
               .ALIGN    2
Text3
               .WORD     53,Text4-Text3-4
               .WORD     126,192
               .ASCII    'MacsBug installed.'
               .BYTE     0
               .ALIGN    2
Text4
               .WORD     54,Text5-Text4-4
               .WORD     146,192
               .ASCII    'Disassembler installed.'
               .BYTE     0
               .ALIGN    2
Text5
                .WORD   55,Text6-Text5-4
                .WORD   166,192
                .ASCII  ' '
                .BYTE   0
                .ALIGN  2
Text6

;
; "Mac Look" Icon for welcome message
;
               .WORD     31,136
               .WORD     89,56,121,88

               .LONG     $0007FF80
               .LONG     $00080000
               .LONG     $00087E20
               .LONG     $00080120
               .LONG     $00080120
               .LONG     $04080120
               .LONG     $0C080120
               .LONG     $08080120
               .LONG     $66080120
               .LONG     $99080120
               .LONG     $8108FE20
               .LONG     $80080020
               .LONG     $80080020
               .LONG     $4A001F20
               .LONG     $34000020
               .LONG     $00FC0020
               .LONG     $03000000
               .LONG     $0401FFF0
               .LONG     $04000008
               .LONG     $03E01FE4
               .LONG     $00100552
               .LONG     $001000A9
               .LONG     $00200001
               .LONG     $002001FE
               .LONG     $00180000
               .LONG     $00040000
               .LONG     $0000C000
               .LONG     $00012000
               .LONG     $00025000
               .LONG     $00008800
               .LONG     $00000800
               .LONG     $00001000

;
; buttonList
;
               .WORD     60,26
               .WORD     2
               .WORD     70,150,50,170,100,80
               .WORD     71,150,130,170,190,81
;
; strings
;
               .WORD     70,6
               .ASCII    'Eject '

               .WORD     71,8
               .ASCII    'Restart '
;
; procs
;
P1              .WORD   80,P2-P1-4

                 SUB     #40,SP              ; make room for pBlock
                 MOVE.L  SP,A0
                 MOVE.W  #DskRfN,IORefNum(A0); driver refnum
                 MOVE.W  #EjectCode,CSCode(A0)
                 MOVE.W  BootDrive,IODrvNum(A0)
                 _Control                    ; eject the bad diskette
                 ADD     #40,SP              ; pop off the pBlock
                 JMP     $40000A             ; go reboot


P2
                .WORD   81,P3-P2-4

                 JMP     $40000A             ; go reboot
P3

               .END


               .WORD     108,192
               .ASCII    'Welcome to Macintosh.'
               .BYTE     00
               .ALIGN    2
Text2

; can't load RAM-based OS

               .WORD     52,Text3-Text2-4
               .WORD     108,130
               sumacc/ws/local/exec   444      0     12        1052  3472707165   7704 3. "6F^5D!$^+77$EXEC
A{ssemble}LOCAL/DSAT0



A{ssemble}LOCAL/INIT0



A{ssemble}LOCAL/INIT1



A{ssemble}LOCAL/INIT2



A{ssemble}LOCAL/INTL0



A{ssemble}LOCAL/INTL1



R{un}Rmaker
LOCAL/RESDEF
R{un}Redit
M{ove}LOCAL
DSAT
0
SYSTEM
Y{es, do file update}
M{ove}LOCAL
INIT
0
SYSTEM
Y{es, do file update}
M{ove}LOCAL
INIT
1
SYSTEM
Y{es, do file update}
M{ove}LOCAL
INIT
2
SYSTEM
Y{es, do file update}
M{ove}LOCAL
INTL
0
SYSTEM
Y{es, do file update}
M{ove}LOCAL
INTL
1
SYSTEM
Y{es, do file update}
Q{uit}
R{un}MACCOM
LSYSTEM.RSRC
~$
E{ject}Q{uit}
$ENDEXEC

       ; pop off the pBlock
                 JMP     $40000A             ; go reboot


P2
                .WORD   81,P3-P2-4

                 JMP     $40000A             ; go reboot
P3

               .END


               .WORD     108,192
               .ASCII    'Welcome to Macintosh.'
               .BYTE     00
               .ALIGN    2
Text2

; can't load RAM-based OS

               .WORD     52,Text3-Text2-4
               .WORD     108,130
               sumacc/ws/local/info   444      0     12        3452  3472707165   7721 3. "6F^5D!$^//}TO        : Macintosh localizers.

FROM      : Gerard Schutten.

DATE      : July 4th, 1984.

SUBJECT   : International part of Macintosh System.Rsrc file.

The enclosed diskette contains all the text files to localize that part of the
System.Rsrc concerned with :

     a. Currency and Number formats.
     b. Time and Date formats.
     c. Boot messages (Welcome to Macintosh, etc.).
     d. Alert messages (System error ocurred, etc.).
     e. Keyboard drivers.

These are 68000 assembler source programmes contained in the files :

LOCAL/DSAT0.TEXT         (Boot messages)
LOCAL/INIT0.TEXT         (Keyboard driver)
LOCAL/INIT1.TEXT         (Numeric keyboard driver)
LOCAL/INIT2.TEXT         (Alert messages)
LOCAL/INTL0.TEXT         (Currency and Number formats)
LOCAL/INTL1.TEXT         (Time and Date formats, Sorting modification)

You have to modify part or all of these files to meet your local standards. I have
enclosed a copy of the PACKAGE manual that describes the use and formats of the
INTL resource (Number, Time and Date formats). When you have modified the sources
you can run the EXEC file LOCAL.TEXT that does the following actions :

     1. Assemble all the 68000 programmes (total of 6).
     2. Run RMAKER and create a Resource file containing these routines in
        resource data format. (The Resource Definition file is also contained
        on the diskette under LOCAL/RESDEF.TEXT).
     3. Run REDIT that will move these resources from the created Local.Rsrc to
        the System.Rsrc and replaces the old resource data.

NOTE : DO NOT FORGET TO PUT SYSTEM.RSRC ON THE PROFILE BEFORE YOU DO ALL THIS !!!

This diskette containes the routines as used for the new revision B software. You
should all have a copy of it (latest MacWrite and MacPaint).

best regards,

Gerard Schutten.



ime and Date formats, Sorting modification)

You have to modify part or all of these files to meet your local standards. I have
enclosed a copy of the PACKAGE manual that describes the use and formats of the
INTL rsumacc/ws/local/init0   444      0     12       37655  3472707165  10045 W^d5P:H r^B$$		;File KEYM1.TEXT
;_______________________________________________________________________
;
; Mac Keyboard Mapping Proc
;
; Routine:      TranKey
; Arguments:      D1 (byte input)  --  option, alpha, shift key map bits in 2,1,0
;                 $17A (byte input)--  bit #7 1 iff feature key set
;                 D2 (word input)  --  keycode (0-63)
;                 D3 (word input)  --  minus iff keyup, plus iff keydown
;                 D0 (byte output) --  ASCII code
;                 Trashes A0, A1, D1 and possibly D2.
;                 Uses A1 as pointer into DeadState throughout.
;
; Function:     TRANKEY is the default mapping procedure for turning raw
;               keycodes from the normal keyboard into ASCII codes.
;
; Modification History:
;   16 Feb 83  LAK  New today.
;   06 Aug 83  AJH  Added support for dead keys
;   08 Sep 83  AJH  Added DeadKey disable
;   21 Sep 83  AJH  Configured serial port for screen dump
;   02 Nov 83  AJH  Removed ScreenDump; generates driver event instead
;   07 Nov 83  AJH  New way to post screenDumps
;   10 Nov 83  JTC  finalize mapping; add command keys feature-{0..9};
;                   map unused keys into codes $D9-$FB
;   14 Nov 83  JTC  fix bug in check for tilde dead key (D1 s.b. D2)
;   16 Nov 83  JTC  grave-A was gotten by tilde-A keystroke, fix command key
;                   to trigger key-down.
;   18 Nov 83  AJH  removed audio feedback
;   03 Dec 83  AJH  added installation header
;   27 Dec 83  AJH/JTC  dropped fkeys through to application
;   28 Dec 83  AJH  only post fkeys if shift is down and option isn't
;_______________________________________________________________________

            .INCLUDE    Tlasm/SysEqu.Text
            .INCLUDE    Tlasm/SysMacs.Text

            .PROC   KeyM1,0

            BRA     InstallIt           ; branch to install code

; start of resident portion

TranKey
            BRA.S   Tran1               ; skip the dead key and header stuff
;
; Dead key state information is stored up front here so the Enable flag
; can be hacked from outside without much knowledge of the structure of KeyM1.
;
DeadEnable  .EQU    0                   ; boolean to enable dead keys
DeadKey     .EQU    10                  ; last dead key, zero if not dead
DeadIndex   .EQU    11                  ; dead key index, 0-4 for ' ` ^ umlaut
DeadMemories
            .WORD   $FFFF               ; Init DeadEnable to true.

            .ASCII  'KEYC'
            .WORD   1                   ; resource ID
            .WORD   1                   ; version #

            .WORD   $0000               ; Init DeadKey and DeadIndex to NULL

MapIt
            LEA     OffsetTable,A0      ; offsets into ASCII table
            MOVEQ   #$07,D0             ; mask for option/alpha/shift
            AND.W   D1,D0               ; option, alpha, shift
            ADD.W   D0,D0               ; double for byte offset
            MOVE.W  0(A0,D0.W),D0       ; offset according to shift/option/alpha
            ADD.W   D2,D0               ; offset + keycode
            MOVE.B  0(A0,D0.W),D0       ; ASCII (byte) (bits 8-31 may be trash)
            RTS

Tran1
;
; For historical reasons, the 58 key-caps on the Mac keyboard (59 on international
; keyboards) have a capricious ordering.  Keys 0-52 are the valid characters;
; 53-58 are the shift/option/feature keys.  Info about the latter keys is input in
; D1.  D2 contains the honest keycode.  Use this info to map a keycode into an
; ASCII character, with special handling for the so-called dead keys.
;
            CMP.W   #52,D2              ; is it a valid key?
            BHI.S   Return0             ; return 0 for keys above 52

            BSR.S   MapIt
;
; If shift-Feature-{0..9} return $00 ASCII code, but prime the so-called screen-dump
; bytes.
;
            TST.B   $17A                ; feature key down?
            BPL.S   CheckDead           ; skip if no Feature key
            BTST    #0,D1               ; shift key down?
            BEQ.S   CheckDead           ; shift must be down
            BTST    #2,D1               ; option key down?
            BNE.S   CheckDead           ; if so, don't post fKey

            BCLR    #0,D1               ; pretend the shift key was up
            BSR.S   MapIt               ; re-map it

            CMPI.B   #'0',D0            ; lower than '0'?
            BCS.S   CheckDead
            CMPI.B  #'9',D0
            BHI.S   CheckDead

            TST.B   D3                  ; only do for key downs
            BMI.S   CheckDead           ; plus iff key down

            TST.B   ScrDmpEnb           ; screen dump (and others) enabled?
            BEQ.S   CheckDead           ; if not, skip

            SUBI.B  #'0',D0             ; de-ASCII-fy digit
            MOVE.B  D0,ScrDmpTyp        ; post it
            ADDI.B  #'0',D0             ; re-ASCII-fy digit
Return0
            MOVEQ   #0,D0               ; don't generate anything

;
; At this point D0 has the mapped key.
; Check for dead keys now (only on key downs).
;
CheckDead
            LEA     DeadMemories,A1     ; prime A1 for future tests

            TST.B   DeadEnable(A1)      ; dead keys enabled?
            BEQ.S   DoneMap             ; if not, we're done

            TST.B   D3                  ; key down or up?
            BMI.S   DoneMap             ; no dead keys for key ups

            TST.B   D0                  ; is it null?
            BEQ.S   DoneMap             ; don't map nulls

            MOVE.B  DeadKey(A1),D2      ; was the previous character dead?
            BNE     DeadState           ; if so, skip
;
; Since grave $60, circumflex $5E, and tilde $7E are vanilla ASCII characters,
; force Option key to be depressed in order to have a dead key.
;
            BTST    #2,D1               ; was option depressed?
            BEQ.S   DoneMap             ; if not, cannot be a dead key
;
; The previous character was not a dead key, so check to see if this one is.
; Trick: if dead, the index left in D1 is the modification to x-grave to get
; relevant diacritical if x is a lower-case vowel.
;

            MOVEQ   #4,D1              ; there are 5 different diacriticals
Dead1Loop
            CMP.B   DeadTable(D1),D0   ; is it dead?
            BEQ.S   GotDead            ; if so, branch
            DBRA    D1,Dead1Loop       ; loop till done

; the new character isn't dead so just pass it back

DoneMap
            RTS

; we got a dead key so remember it but don't pass anything back

GotDead
            MOVE.B  D0,DeadKey(A1)      ; remember the dead key ASCII
            MOVE.B  D1,DeadIndex(A1)    ; remember its index, too
            MOVEQ   #0,D0               ; don't generate an event
            RTS                         ; return to keyboard driver


; the following table defines the five dead keys

DeadTable
            .BYTE   $AB                 ; acute (a cute program?)
            .BYTE   $60                 ; grave
            .BYTE   $5E                 ; circumflex
            .BYTE   $AC                 ; umlaut
            .BYTE   $7E                 ; tilde

; the following table specifies the 5 lower case vowels (handled generally)

VowelTable
            .BYTE   $61                 ; lower case a
            .BYTE   $65                 ; lower case e
            .BYTE   $69                 ; lower case i
            .BYTE   $6F                 ; lower case o
            .BYTE   $75                 ; lower case u

; we're in the dead key state so if the new character is blank or the dead key
; itself, just generate the dead key

DeadState
            CMP.B   D2,D0               ; dead key twice?
            BEQ.S   @1                  ; if so, handle as blank
            CMP.B   #$20,D0             ; is it blank?
            BNE.S   CheckVowel          ; if not, go check for lc vowel

; we're in the <diacritical> <blank> or <diacritical> twice case so
; just generate ASCII for the diacritical

@1
            MOVE    D2,D0               ; generate ASCII for the dead key
DeadDone
            CLR.B   DeadKey(A1)         ; get out of deadKey mode
            RTS                         ; return to caller

; at this point, the previous key was a dead key so check the current key (in D0)
; to see what we should generate.  First check for lower case vowels since
; they can be handled in a general way, saving table space.

CheckVowel
            CMP.B   #$7E,D2             ; was the dead key a tilde? (JTC was D1)
            BEQ.S   CheckException      ; if so, don't check for vowels

            MOVEQ   #4,D1               ; there are 5 vowels
VowelLoop
            CMP.B   VowelTable(D1),D0   ; is it a vowel?
            BEQ.S   GotVowel            ; if so, skip
            DBRA    D1,VowelLoop        ; loop till counter runs out

; it wasn't a vowel, so check the specific exception table

CheckException
            MOVEQ   #11,D1              ; exception tables have 12 entries
            MOVEQ   #-1,D2              ; make high part all ones
            MOVE.B  DeadKey(A1),D2      ; get last deadKey in a register
ExpLoop
            CMP.B   ExpTChar(D1),D0     ; does the character match?
            BNE.S   NextExp             ; if not, go examine next one
            CMP.B   ExpTDead(D1),D2     ; does the dead key match?
            BEQ.S   GotExp              ; if so, we found one
NextExp
            DBRA    D1,ExpLoop          ; loop till done

; well, no valid mappable character followed the dead key so generate an
; event for the dead key and let the keyboard driver generate one for the
; new character

            MOVE    D0,-(SP)
            MOVE.W  #KeyDwnEvt,A0       ; say it's a keyDown
            MOVE.L  D2,D0
            _PostEvent
            MOVE    (SP)+,D0            ; recall D0
GoDeadDone
            BRA     DeadDone            ; let keyboard driver take over

; we found an exception in the table so generate ASCII for it.  D1 has the index

GotExp
            MOVE.B  ExpTMap(D1),D0      ; get the ASCII
            BRA.S   GoDeadDone          ; let keyboard driver do the rest

; we got a vowel, so map it in a general way

GotVowel
            MOVE.B  VBaseMap(D1),D0     ; get ASCII base for the vowel
            ADD.B   DeadIndex(A1),D0    ; add in the diacritical index
            BRA.S   GoDeadDone          ; all done!

; tables for the 8 exception cases

ExpTChar
            .BYTE   $79                 ;lower case y (with unlaut)
            .BYTE   $41                 ;upper case A (with grave) - was acute JTC
            .BYTE   $41                 ;upper case A (with tilde)
            .BYTE   $4F                 ;upper case O (with tilde)

            .BYTE   $45                 ;upper case E (with acute)
            .BYTE   $41                 ;upper case A (with umlaut)
            .BYTE   $4F                 ;upper case O (with umlaut)
            .BYTE   $55                 ;upper case U (with umlaut)
            .BYTE   $4E                 ;upper case N (with tilde)
            .BYTE   $61                 ;lower case a (with tilde)
            .BYTE   $6F                 ;lower case o (with tilde)
            .BYTE   $6E                 ;lower case n (with tilde)

ExpTDead
            .BYTE   $AC                 ;umlaut (with y)
            .BYTE   $60                 ;grave (with A) - was acute JTC
            .BYTE   $7E                 ;tilde (with A)
            .BYTE   $7E                 ;tilde (with O)

            .BYTE   $AB                 ;acute (with E)
            .BYTE   $AC                 ;umlaut (with A)
            .BYTE   $AC                 ;umlaut (with O)
            .BYTE   $AC                 ;umlaut (with U)
            .BYTE   $7E                 ;upper case N (with N)
            .BYTE   $7E                 ;tilde (with a)
            .BYTE   $7E                 ;tilde (with o)
            .BYTE   $7E                 ;tilde (with n)

ExpTMap
            .BYTE   $D8                 ;umlaut y
            .BYTE   $CB                 ;grave A - was acute JTC
            .BYTE   $CC                 ;tilde A
            .BYTE   $CD                 ;tilde O

            .BYTE   $83                 ;acute E
            .BYTE   $80                 ;umlaut A
            .BYTE   $85                 ;umlaut O
            .BYTE   $86                 ;umlaut U
            .BYTE   $84                 ;tilde N
            .BYTE   $8B                 ;tilde a
            .BYTE   $9B                 ;tilde o
            .BYTE   $96                 ;tilde n

; table for general case vowel mapping

VBaseMap
            .BYTE   $87                 ;lower case a
            .BYTE   $8E                 ;lower case e
            .BYTE   $92                 ;lower case i
            .BYTE   $97                 ;lower case o
            .BYTE   $9C                 ;lower case u

            .BYTE   $41                 ;filler for word alignment

OffsetTable     ; offset into ASCII table for 6 keyboard interpretations

 .WORD  16+0        ; option=0, alpha=0, shift=0  --  normal
 .WORD  16+53       ; option=0, alpha=0, shift=1  --  shift
 .WORD  16+106      ; option=0, alpha=1, shift=0  --  alpha-lock
 .WORD  16+53       ; option=0, alpha=1, shift=1  --  shift
 .WORD  16+159      ; option=1, alpha=0, shift=0  --  option
 .WORD  16+212      ; option=1, alpha=0, shift=1  --  option shift
 .WORD  16+265      ; option=1, alpha=1, shift=0  --  option alpha-lock
 .WORD  16+212      ; option=1, alpha=1, shift=1  --  option shift

; U.S. keyboard layout

 .BYTE  $73,$61,$64,$66,$68,$67,$7A,$78  ; a s d f h g z x
 .BYTE  $63,$76,$00,$62,$71,$77,$65,$72  ; c v unused b q w e r
 .BYTE  $79,$74,$31,$32,$33,$34,$36,$35  ; y t 1 2 3 4 6 5
 .BYTE  $3D,$39,$37,$2D,$38,$30,$5D,$6F  ; = 9 7 - 8 0 ] o
 .BYTE  $75,$5B,$69,$70,$0D,$6C,$6A,$27  ; u [ i p RETURN l j '
 .BYTE  $6B,$3B,$5C,$2C,$2F,$6E,$6D,$2E  ; k ; \ , / n m .
 .BYTE  $09,$20,$60,$08,$03              ; TAB SPACE ` BACKSPACE ENTER

; shift

 .BYTE  $41,$53,$44,$46,$48,$47,$5A,$58  ; A S D F H G Z X
 .BYTE  $43,$56,$00,$42,$51,$57,$45,$52  ; C V UNUSED B Q W E R
 .BYTE  $59,$54,$21,$40,$23,$24,$5E,$25  ; Y T ! @ # $ ^ %
 .BYTE  $2B,$28,$26,$5F,$2A,$29,$7D,$4F  ; + ( & _ * ) } O
 .BYTE  $55,$7B,$49,$50,$0D,$4C,$4A,$22  ; U { I P RETURN L J "
 .BYTE  $4B,$3A,$7C,$3C,$3F,$4E,$4D,$3E  ; K : | < ? N M >
 .BYTE  $09,$20,$7E,$08,$03              ; TAB SPACE ` BACKSPACE ENTER

; alpha-lock

 .BYTE  $41,$53,$44,$46,$48,$47,$5A,$58  ; A S D F H G Z X
 .BYTE  $43,$56,$00,$42,$51,$57,$45,$52  ; C V UNUSED B Q W E R
 .BYTE  $59,$54,$31,$32,$33,$34,$36,$35  ; Y T 1 2 3 4 6 5
 .BYTE  $3D,$39,$37,$2D,$38,$30,$5D,$4F  ; = 9 7 - 8 0 ] O
 .BYTE  $55,$5B,$49,$50,$0D,$4C,$4A,$27  ; U [ I P RETURN L J '
 .BYTE  $4B,$3B,$5C,$2C,$2F,$4E,$4D,$2E  ; K ; \ , / N M .
 .BYTE  $09,$20,$60,$08,$03              ; TAB SPACE ` BACKSPACE ENTER

;
; In the following three tables unused keys are mapped into the unused
; character cells $D9 through $FC.  There was insufficient room for the tail
; values $FC, $FD, $FE, $FF.
;
;option

 .BYTE  $8C,$A7,$B6,$C4,$FA,$A9,$BD,$C5 ; wierd letters and symbols
 .BYTE  $8D,$C3,$00,$BA,$CF,$B7,$AB,$A8  ;
 .BYTE  $B4,$A0,$C1,$AA,$A3,$A2,$A4,$B0  ;
 .BYTE  $AD,$BB,$A6,$D0,$A5,$BC,$D4,$BF  ;
 .BYTE  $AC,$D2,$5E,$B9,$0D,$C2,$C6,$BE  ;
 .BYTE  $FB,$C9,$C7,$B2,$D6,$7E,$B5,$B3  ;
 .BYTE  $09,$CA,$60,$08,$03              ; TAB SPACE grave BACKSPACE ENTER

; option-shift

 .BYTE  $81,$EA,$EB,$EC,$EE,$ED,$F3,$F4  ; more wierd letters
 .BYTE  $82,$D7,$00,$F5,$CE,$E3,$E4,$E5  ;
 .BYTE  $E7,$E6,$DA,$DB,$DC,$DD,$DF,$DE  ;
 .BYTE  $B1,$E1,$E0,$D1,$A1,$E2,$D5,$AF  ;
 .BYTE  $E8,$D3,$E9,$B8,$0D,$F1,$EF,$AE  ;
 .BYTE  $F0,$F2,$C8,$F8,$C0,$F6,$F7,$F9  ;
 .BYTE  $09,$CA,$D9,$08,$03              ; TAB SPACE extra BACKSPACE ENTER

; option alpha-lock

 .BYTE  $81,$EA,$EB,$EC,$EE,$ED,$F3,$F4  ; still more wierd letters
 .BYTE  $82,$D7,$00,$F5,$CE,$E3,$E4,$E5  ;
 .BYTE  $E7,$E6,$C1,$AA,$A3,$A2,$A4,$B0  ;
 .BYTE  $AD,$BB,$A6,$D0,$A5,$BC,$D4,$AF  ;
 .BYTE  $E8,$D2,$E9,$B8,$0D,$F1,$EF,$AE  ;
 .BYTE  $F0,$C9,$C7,$B2,$D6,$F6,$F7,$B3  ;
 .BYTE  $09,$CA,$60,$08,$03              ; TAB SPACE grave BACKSPACE ENTER

; Installation Code

InstallIt
            LEA     TranKey,A0
            MOVE.L  A0,Key1Trans
            RTS

        .END



    .BYTE   $80                 ;umlaut A
            .BYTE   $85                 ;sumacc/ws/local/init1   444      0     12        4555  3472707166  10020 W^d5P:H r^	g;File KEYM2.TEXT
;_______________________________________________________________________
;
; Mac KeyPad Mapping Proc
;
; Modification History:
; 16 Feb 83  LAK  New today.
; 03 Dec 83  AJH  Added installation header
; 27 Jan 84  JTC  Swapped dot and comma for international.
;_______________________________________________________________________

            .INCLUDE tlAsm/SysEqu.Text

;_______________________________________________________________________
;
; Routine:      TranNumKey
; Arguments:      D1 (input)  --  option, alpha, shift key map bits in 2,1,0
;                 D2 (input)  --  keycode (0-63)
;                 D0 (output) --  ASCII code
;                 trashes A0 and D1
; Function:     TRANKEY is the default mapping procedure for turning raw
;               keycodes from the numeric keypad into ASCII codes.
;
;_______________________________________________________________________

            .PROC   KeyM2,0

            BRA     InstallIt

TranNumKey  LEA     KeyPadNormal,A0
            LSR     #1,D1               ; shift key down?
            BCC.S   Mask32
            LEA     KeyPadShift,A0      ; shifted keypad table
Mask32      AND.B   #$1F,D2             ; only 32 codes in the table
            MOVE.B  0(A0,D2),D0
            RTS

KeyPadNormal    ; keypad keycode to ASCII translation table - unshifted

 .BYTE  $00,$2E,$1D,$00         ; unused . right-cursor unused
 .BYTE  $00,$00,$1C,$1B         ; unused unused left-cursor CLEAR
 .BYTE  $1F,$00,$00,$00         ; down-cursor unused unused unused
 .BYTE  $03,$1E,$2D,$00         ; ENTER up-cursor - unused
 .BYTE  $00,$00,$30,$31         ; unused unused 0 1
 .BYTE  $32,$33,$34,$35         ; 2 3 4 5
 .BYTE  $36,$37,$00,$38         ; 6 7 unused 8
 .BYTE  $39,$00,$00,$00         ; 9 unused unused unused

KeyPadShift     ; keypad keycode to ASCII translation table - shifted

 .BYTE  $00,$2C,$2A,$00         ; unused , * unused
 .BYTE  $00,$00,$2B,$1B         ; unused unused + CLEAR
 .BYTE  $2E,$00,$00,$00         ; . unused unused unused
 .BYTE  $03,$2F,$2D,$00         ; ENTER / - unused
 .BYTE  $00,$00,$30,$31         ; unused unused 0 1
 .BYTE  $32,$33,$34,$35         ; 2 3 4 5
 .BYTE  $36,$37,$00,$38         ; 6 7 unused 8
 .BYTE  $39,$00,$00,$00         ; 9 unused unused unused

InstallIt
            LEA     TranNumKey,A0
            MOVE.L  A0,Key2Trans
            RTS


        .END



         .INCLUDE tlAsm/SysEqu.Text

;_______________________________________________________________________
;
; Routine:      TranNumKey
; Argumesumacc/ws/local/init2   444      0     12       17446  3472707166  10044 3. "6F^5PH r^&1212;File UserAlerts.Text
;
;   Standard Alerts for the production system -- Resource Type INIT, ID 2
;
;   These alerts are intended for naive users.  Programmers should use "sysAlerts"
;   instead of these "userAlerts" during development.  There is only one alert
;   here, which informs the user that she's in trouble... (plus one for the
;   final stage of booting)

;
;  last change -- tweaked disk switch alert 2/23/84 AJH
;                 Mercilessly chopped out stuff, added RESET 4/14/84 SC
;
               .INCLUDE    TlAsm/SYSEQU.TEXT
               .INCLUDE    TlAsm/SYSMACS.TEXT
               .INCLUDE    TlAsm/FSEQU.TEXT
               .INCLUDE    TlAsm/TOOLEQU.TEXT
               .INCLUDE    TlAsm/QUICKMACS.TEXT
               .INCLUDE    TlAsm/TOOLMACS.TEXT
               .INCLUDE    TlAsm/GrafTypes.Text

               .PROC       INIT,0

                BRA        InstallIt

DSStart
               .WORD     21                       ;number of entrys

; alert definitions

               .WORD     32767,10,50,0,36,94,72    ;system error

               .WORD     30,10,46,0,37,96,0         ;disk switched
               .WORD     31,10,45,0,37,0,0          ;bad disk switch

               .WORD     41,10,67,0,36,0,70        ;can't find finder
               .WORD     28,10,50,0,36,95,72       ;special case stack overflow

; text definitions

Text0
               .WORD     50,Text1-Text0-4
               .WORD     100,110
               .ASCII    'Sorry, a system error occurred.'
               .BYTE     00
               .ALIGN    2
Text1
               .WORD     67,Text2-Text1-4
               .WORD     86,130
               .ASCII    "Can't load the finder!"
               .BYTE     0
               .ALIGN    2
Text2
               .WORD     46,Text3-Text2-4
               .WORD     30,75
               .ASCII    'Please insert the disk:'
               .BYTE     0
               .ALIGN    2
Text3
Text4
;
; icons -- Susan's bomb
;
               .WORD     36,136
               .WORD     72,50,104,82

          .LONG     $00000808
          .LONG     $00000010
          .LONG     $00000420
          .LONG     $00008040
          .LONG     $00002200
          .LONG     $00000800
          .LONG     $001F002A
          .LONG     $0020C700
          .LONG     $00403800
          .LONG     $00400020
          .LONG     $00400910
          .LONG     $03F81008
          .LONG     $03F82104
          .LONG     $03F80000
          .LONG     $0FFE0100
          .LONG     $3FFF8000
          .LONG     $3FFF8000
          .LONG     $7FFFC000
          .LONG     $7FFFC000
          .LONG     $FFFDE000
          .LONG     $FFFFE000
          .LONG     $FFFEE000
          .LONG     $FFFEE000
          .LONG     $FFFEE000
          .LONG     $FFFFE000
          .LONG     $FFFDE000
          .LONG     $7FFFC000
          .LONG     $7FF7C000
          .LONG     $3FFF8000
          .LONG     $3FFF8000
          .LONG     $0FFE0000
          .LONG     $03F80000

;
; disk switched icon

           .WORD     37,136
           .Word     20,24,52,56

           .LONG    $002ADE00
           .LONG    $00800100
           .LONG    $00000080
           .LONG    $01000080
           .LONG    $000003E0
           .LONG    $010001C0
           .LONG    $00000080
           .LONG    $00000000
           .LONG    $FFF83FFC
           .LONG    $88A44452
           .LONG    $88A24451
           .LONG    $88224411
           .LONG    $8FE247F1
           .LONG    $80024001
           .LONG    $80024001
           .LONG    $9FF24FF9
           .LONG    $A00A5005
           .LONG    $A00A5005
           .LONG    $A00A5005
           .LONG    $A00A5005
           .LONG    $A00A5005
           .LONG    $A00A5005
           .LONG    $FFFE7FFF
           .LONG    $00000000
           .LONG    $01000000
           .LONG    $03800080
           .LONG    $07C00000
           .LONG    $01000080
           .LONG    $01000000
           .LONG    $00800100
           .LONG    $007B5400
           .LONG    $00000000


;
; buttonList
;
               .WORD     70,14
               .WORD     1
               .WORD     80,160,50,180,110,90


               .WORD     71,14
               .WORD     1
               .WORD     80,160,50,180,110,90


               .WORD     72,14
               .WORD     1
               .WORD     80,160,54,180,113,90


               .WORD     73,26
               .WORD     2
               .WORD     80,160,54,180,113,90
               .WORD     82
ResumeRect
               .WORD     160,129,180,189
               .WORD     92
;
; strings
;
               .WORD     80,8
               .ASCII    'Restart '

               .WORD     82
               .BYTE     0
ResumeString
               .BYTE     6
               .ASCII    'Resume'

;
; procs
;
P1              .WORD   90,P2-P1-4

; reboot the system

                 RESET

P2
                .WORD   92,P3-P2-4

                MOVE.L   CurrentA5,A5
                MOVE.L   CurStackBase,A7
                MOVE.L   RestProc,A0
                JMP      (A0)                ; restart
P3

; print the ID of the DS alert
; also, plot a grayed out resume button if saveProc = NIL

P4
               .WORD     94,P5-P4-4
P4A
               BSR.S     PlotGrayBut

               MOVE.L    #$00A40180,-(SP)    ;push location
               _MoveTo                       ;move the pen

               PEA       IDString
               _DrawString

               MOVEQ     #0,D3
               MOVE.W    DSErrCode,D3
               DIVU      #10,D3              ;divide by 10
               BSR.S     OutChar             ;out high char
               SWAP      D3                  ;get low char
OutChar
               OR.W      #$30,D3             ;turn into ASCII
               MOVE.W    D3,-(SP)            ;push it
               _DrawChar
               RTS

PlotGrayBut
               TST.L    RestProc             ;got a restart proc?
               BNE.S    @1                   ;if so, skip...

; plot a grayed out resume button

               MOVE.L   ResumeRect,-(SP)     ;push topLeft of rect
               ADD.L    #$000E0003,(SP)      ;offset for drawing
               _MoveTo                       ;move the pen

               PEA      ResumeString         ;push the string
               _DrawString                   ;draw it

               PEA      ResumeRect           ;push the rect
               MOVE.L   (SP),-(SP)           ;copy it
               MOVE.L   (SP),-(SP)           ;and copy again
               MOVE.L   (SP),-(SP)           ;and copy again
               MOVE.L   #$00100010,-(SP)     ;push rounding factor
               _FrameRoundRect               ;frame it

               MOVE.L    #$00030003,-(SP)
               _InsetRect

               MOVE.L    (A5),A0
               PEA       Gray(A0)
               _PenPat
               MOVE      #patBIC,-(SP)
               _PenMode

               _PaintRect
               _PenNormal

               MOVE.L     #$FFFDFFFD,-(SP)           ;push it
               _InsetRect
@1
               RTS
IDString
               .BYTE     5
               .ASCII    'ID = '

P5
               .WORD     95,P6-P5-4

               MOVE.L    (SP)+,A0            ;get return address
               MOVE.L    CurStackBase,SP     ;reset the stack
               MOVE.L    A0,-(SP)            ;restore return address
               BRA.S     P4A                 ;go print the ID
P6
               .WORD     96,P7-P6-4

               MOVE.L    #$0033004B,-(SP)    ;push pen position
               _MoveTo                       ;position the pen

               MOVE.L    ReqstVol,A1         ;get VCB ptr
               PEA       VCBVN(A1)           ;push ptr to volume name
               _DrawString

               RTS
P7

InstallIt
                LEA     DSStart,A0
                MOVE.L  A0,DSAlertTab
                RTS

               .END


$03800080
           .LONG    $07C00000
           .LONG    $01000080
           .LONG    $01000000
           .LONG    $00800100
           .LONG    $007B5400
           .LONG    $00000000


;
; buttonList
;
         sumacc/ws/local/intl0   444      0     12        6224  3472707166  10015 3. "6F^5D!$^G//;   INTL,0  Source for International time and date formats, currency symbols
;   and sorting orders.
;
;   Prepared by Kent Edquist and the GEA marketing team.
;
                    .PROC     INTL,0

IntlDecPoint
                    .ASCII    ','            ;decimal point character
IntlThouSep
                    .ASCII    ' '            ;thousands separator character
IntlListSep
                    .ASCII    ';'            ;list separator character
IntlCurSym
                    .ASCII    '$'            ;currency symbol
                    .BYTE     0,0            ;filler
IntlCurFmt
;
;   Flag to set currency symbol before or after the amount.
;   Set it to $D0 (D,zero) to have it before the amount.
;   Set it to $E0 (E,zero) to have it behind the amount.
;
                    .BYTE     $D0            ;currency format flag

IntlDateOrder
;
;   Flag to set the short date format.
;   Set it to 0 (zero) to have the mm/dd/yy format (month/day/year).
;   Set it to 1 (one) to have the dd/mm/yy format.
;   Set it to 2 (two) to have the yy/mm/dd format.
;
                    .BYTE     2              ;order for short form dates
IntlLdZeroFlag
;
;   Flag to set a leading zero before the day number in the short date format.
;   Set it to $E0 (E,zero) to have a leading zero.
;   Set it to 0 (zero) to remove a leading zero.
;

                    .BYTE     $E0            ;leading zero flags for days
IntlDSep
                    .ASCII    '-'            ;seperator character for short dates

IntlTimeMode
;
;   Flag to set 12 or 24 hours mode for time format.
;   Set it to 0 (zero) for 24 hour format (will use 24 hour suffix).
;   Set it to 255 or $FF for 12 hour format (will use AM and PM suffixes).
;
                    .BYTE     0              ;12 or 24 hour time mode flag
IntlTLZFlags
;
;   Flag to set a leading zero before the hour in the time format.
;   Set it to 255 or $FF to have a leading zero.
;   Set it to $60 (sixty) to remove a leading zero.
;
                    .BYTE     $FF            ;time leading zero flags
IntlAMSuffix
;
;   AM and PM suffix strings use 4 bytes.
;   These are only used in 12 hour mode.
;   Fill with zero bytes when shorter strings are used or not used at all.
;
                    .BYTE     0,0
                    .BYTE     0,0            ;suffix string for AM times
IntlPMSuffix
                    .BYTE     0,0
                    .BYTE     0,0            ;suffix string for PM times
IntlTSep
                    .ASCII    ':'            ;time separator character
Intl24Suffix
;
;   Suffix string of 8 bytes when using 24 hour mode.
;   Fill with zero bytes when shorter string is used or no string is used.
;
                    .BYTE     0,0,0,0
                    .BYTE     0,0,0,0        ;suffix for 24 hr mode

IntlMetric
;
;   Flag for English or Metric ruler in applications.
;   Set it to 255 or $FF to have a Metric system.
;   Set it to 0 (zero) to have an English system.
;
                    .BYTE     $FF            ;boolean for Metric
Intl0Version
;
;   Do not change the following version word.
;   Restricted to be used by APPLE only.
;
                    .WORD     0              ;version word

                    .END
amount.
;   Set it to $D0 (D,zero) to have it before the amount.
;   Set it to $E0 (E,zero) to have it behind the amount.
;
                    .BYTE     $D0            ;currency format flag

IntlDateOrder
;
;   Flag to set the short date format.
;   Set it to 0 (zero) to have the mm/dd/yy format (month/day/year).
;   Set it to 1 (one) to have the dd/mm/yy formasumacc/ws/local/intl1   444      0     12       13762  3472707166  10043 3. "6F^5D!$^H	#	#;   INTL,1 Source for International Date and time formats.
;
;   Prepared by Kent Edquist and the GEA Marketing team.
;
;   The strings for the day and month names can be up to 15 characters.
;   They take all 16 bytes room. 1 byte for length declaration followed by
;   the string. Strings will be filled up with zero bytes to create
;   a total of 16 bytes.
;
                    .PROC     INTL,0

IntlSunday
                    .BYTE     6
                    .ASCII    'Sunday'            ;string for Sunday
                    .ALIGN    16
IntlMonday
                    .BYTE     6
                    .ASCII    'Monday'            ;string for Monday
                    .ALIGN    16
IntlTuesday
                    .BYTE     7
                    .ASCII    'Tuesday'           ;string for Tuesday
                    .ALIGN    16
IntlWednesday
                    .BYTE     9
                    .ASCII    'Wednesday'         ;string for Wednesday
                    .ALIGN    16
IntlThursday
                    .BYTE     8
                    .ASCII    'Thursday'          ;string for Thursday
                    .ALIGN    16
IntlFriday
                    .BYTE     6
                    .ASCII    'Friday'            ;string for Friday
                    .ALIGN    16
IntlSaturday
                    .BYTE     8
                    .ASCII    'Saturday'          ;string for Saturday
                    .ALIGN    16

IntlJanuary
                    .BYTE     7
                    .ASCII    'January'           ;string for January
                    .ALIGN    16
IntlFebruary
                    .BYTE     8
                    .ASCII    'February'          ;string for February
                    .ALIGN    16
IntlMarch
                    .BYTE     5
                    .ASCII    'March'             ;string for March
                    .ALIGN    16
IntlApril
                    .BYTE     5
                    .ASCII    'April'             ;string for April
                    .ALIGN    16
IntlMay
                    .BYTE     3
                    .ASCII    'May'               ;string for May
                    .ALIGN    16
IntlJune
                    .BYTE     4
                    .ASCII    'June'              ;string for June
                    .ALIGN    16
IntlJuly
                    .BYTE     4
                    .ASCII    'July'              ;string for July
                    .ALIGN    16
IntlAugust
                    .BYTE     6
                    .ASCII    'August'            ;string for August
                    .ALIGN    16
IntlSeptember
                    .BYTE     9
                    .ASCII    'September'         ;string for September
                    .ALIGN    16
IntlOctober
                    .BYTE     7
                    .ASCII    'October'           ;string for October
                    .ALIGN    16
IntlNovember
                    .BYTE     8
                    .ASCII    'November'          ;string for November
                    .ALIGN    16
IntlDecember
                    .BYTE     8
                    .ASCII    'December'          ;string for December
                    .ALIGN    16

IntlDaySupress
;
;   Flag to have dayname string in the long date format.
;   Set it to 0 (zero) to show dayname in longdate.
;   Set it to 255 or $FF to supress dayname in longdate.
;
                    .BYTE     0         ;boolean for supressing day of week
IntlLongOrder
;
;   Flag for longdate format.
;   Set it to 0 (zero) for <dayname day# month year>
;   Set it to 255 or $FF for <dayname month day# year>
;   NOTE : These formats will still be affected by seperators and leading
;          zero supressing.
;
                    .BYTE     0         ;boolean for selecting order
IntlLDayLZFlag
;
;   Flag to supress leading zero in day number (day#) in longdate format.
;   Set it to 0 (zero) to remove a leading zero in day#.
;   Set it to 255 or $FF to have leading zero in day#.
;
                    .BYTE     0         ;boolean for day# leading zeros
IntlMonLen
;
;   String truncation of dayname and monthname in medium date format.
;   Used when files are shown by date, size, kind or name in a window.
;
                    .BYTE     3         ;string length for medium date

IntlStr1
;
;   Prefix string of maximal 4 bytes to put before a longdate format.
;   Fill up with zero bytes till the length of 4 is reached.
;
                    .BYTE     0,0       ;long date prefix string
                    .BYTE     0,0
;
;   First extension string of maximal 4 bytes in longdate.
;   Is inserted after the first string in longdate format.
;   Fill up with zero bytes till the length of 4 is reached.
;
IntlStr2
                    .ASCII    ' '      ;first extension string in longdate
                    .BYTE     0,0,0
;
;   Second extension string of maximal 4 bytes in longdate.
;   Is inserted after the second string in longdate format.
;   Fill up with zero bytes till the length of 4 is reached.
;
IntlStr3
                    .ASCII    ' '       ;second extension string in longdate
                    .BYTE     0,0,0
;
;   Third extension string of maximal 4 bytes in longdate.
;   Is inserted after the third string in longdate format.
;   Fill up with zero bytes till the length of 4 is reached.
;
IntlStr4
                    .ASCII    ' '       ;third extension string in longdate
                    .BYTE     0,0,0
IntlStr5
;
;   Fourth extension string of maximal 4 bytes in longdate.
;   Is inserted after the fourth string in longdate format.
;   Fill up with zero bytes till the length of 4 is reached.
;
                    .ASCII    ' '       ;fourth extension string in longdate
                    .BYTE     0,0,0

Intl1Version
;
;   Do not change the following version word.
;   Restricted to be used by APPLE only.
;
                    .WORD     1         ;version word

IntlMagTable
;
;   Subroutine to setup magnitude for sorting routine.
;
;   Do not change the following instruction.
;
                     RTS                ;string magnitude compare tables

                    .END

E.L   #$001000sumacc/ws/local/resdef   444      0     12         657  3472707167  10224 3. "6F^5D!$^

)*    Resource definition file for localization of :
*
*    1. Bootalerts             :   DSAT  0.
*    2. Useralerts             :   INIT  2.
*    3. Keyboard driver        :   INIT  0 and 1.
*    4. International formats  :   INTL  0 and 1.
*
Local.Rsrc

type DSAT
Local/DSAT0,0 (80)

type INIT = PACK
Local/INIT0,0 (80)
Local/INIT1,1 (80)
Local/INIT2,2 (80)

type INTL = PACK
Local/INTL0,0 (80)
Local/INTL1,1 (80)
string for November
                    .ALIGN    16
IntlDecember
               sumacc/ws/defprocs/   775      0     12           0  3472707170   7465 sumacc/ws/defprocs/butcdef   444      0     12       50241  3472707167  11135 3. "6F^5PH r^E1!1!O;
;File ButCDef.TEXT
;--------------------------------------------------------------------------
;
;  Standard Button Definition Procedure for the
;       MacIntosh Control Manager
;
;  written by Andy Hertzfeld  August, 1982
;
;  (c) 1982 by Apple Computer, Inc.  All rights reserved.
;
;    This file contains the control definition procedures
;    that define the standard "button" type controls.  These
;    include PushButtons, CheckBoxes, and a checkBox variant called
;    RadioButton
;
;  Modification History:
;
;    22-Aug-82  AJH  Added clipping, centering to PushButProc
;    25-Aug-82  AJH  Fixed corner-clobber bug in pushButProc
;    29-Aug-82  AJH  Added "255" hiliting,
;    29-Sep-82  AJH  Added CheckBox control definition procedure
;    03-Oct-82  AJH  Fixed bug in scrollBar positioning -- wasn't ctl relative
;    05-Oct-82  AJH  Fixed checkBox flashing, added code saving optimizations
;    10-Oct-82  AJH  Converted for QuickDraw Trap Interface
;    17-Oct-82  AJH  Made controlProcs preserve A1
;    14-Nov-82  AJH  Improved PushButton roundness scaling; removed box in arrowBits
;    16-Nov-82  AJH  Made branch tables offset based
;    28-Dec-82  AJH  Put button definitions in their own file
;    11-Mar-83  AJH  fixed up check box drawing
;    27-Mar-83  AJH  made it respect initial clip in button drawing
;    01-Apr-83  AJH  made it use hardwired gray
;    04-Apr-83  AJH  made it force size 12 for text
;    07-Jun-83  AJH  fixed scrambling bug, changed check draw for new QuickDraw
;    29-Aug-83  AJH  fixed scrambling bug in CalcPBut
;    27-Sep-83  AJH  made variants > 7 not force the system font
;    12-Oct-83  AJH  changed button disabling
;    17-Oct-83  AJH  back to "gray-out" button disabling
;    31-Dec-83  AJH  made text of checkBox/radioButttons grayed out if disabled
;
;----------------------------------------------------------------------------

                .INCLUDE  TlAsm/SYSEQU.TEXT
                .INCLUDE  TlAsm/SYSMACS.TEXT
                .INCLUDE  TlAsm/GRAFEQU.TEXT
                .INCLUDE  TlAsm/GRAFTYPES.TEXT
                .INCLUDE  TlAsm/TOOLEQU.TEXT
                .INCLUDE  TlAsm/RESEQU.TEXT
                .INCLUDE  TlAsm/QuickMacs.TEXT
                .INCLUDE  TlAsm/ToolMacs.TEXT
;
                .PROC     BDEF,0

;
; FUNCTION PushButProc( selector:   INTEGER;
;                       theControl: ControlHandle;
;                       message:    INTEGER;
;                       param:      LongInt): LongInt;
;
;   PushButProc is the control definition procedure for simple pushButtons, one of the
; standard control types supported by the user interface toolBox. mon
;
SavePen         .EQU    -20
IndicatorRect   .EQU    -30
;
                BRA.S    @0                     ;skip header

; standard header

                .WORD    0                      ;flags
                .ASCII   'CDEF'
                .WORD    0
                .WORD    1                      ;version #
@0
                LINK    A6,#-30                 ;set up a stack frame to address parameters
                MOVEM.L D3-D7/A1-A4,-(SP)       ;save work registers
;
; buttons only handle messages 0,1 and 2
;
               CMP      #3,12(A6)               ;inspect message value
               BGE.S    DoneP1                  ;if >2, nothing to do
;
; save the penState and set it our way
;
                PEA     SavePen(A6)             ;push pointer to savePenState
                _GetPenState                    ;remember current penState
                _PenNormal                      ;set the pen the way we want it
;
; fetch the parameters into registers
;
                LEA     8(A6),A0                ;get ptr to first parameter
                MOVE.L  (A0)+,D3                ;get param in D3
                MOVE.W  (A0)+,D0                ;get message
                MOVE.L  (A0)+,A3                ;get the control handle
                MOVE.W  (A0)+,D6                ;get selection index
                MOVE.W  D6,D7                   ;remember raw selection code
                AND     #7,D6                   ;strip high part of selection code

                CLR.L   (A0)                    ;clear out function result
                MOVE.L  (A3),A0                 ;get control pointer in A0
;
; case out on the message number
;
                ADD     D0,D0                   ;double for word index
                LEA     GoPushBut,A1            ;get table address
                ADD     0(A1,D0),A1             ;compute dispatch address
                JSR     (A1)                    ;dispatch to appropriate routine
;
; restore original pen state
;
                PEA     SavePen(A6)             ;push savePenState
                _SetPenState                    ;restore original pen state
;
; we're done -- restore registers and return to caller
;
DoneP1
                MOVEM.L (SP)+,D3-D7/A1-A4       ;restore work registers
                UNLK    A6                      ;unlink stack frame
TenBytExit      MOVE.L  (SP)+,A0                ;get return address
                ADD     #12,SP                  ;strip parameters
                JMP     (A0)                    ;return to caller
;
; PushButProc dispatch table -- entries must be long branches!
;
GoPushBut
                .WORD   DrawPBut-GoPushBut      ;draw is message 0
                .WORD   HitPBut-GoPushBut       ;hit test is message 1
                .WORD   CalcPBut-GoPushBut      ;calc regions is message 2

ButStub         RTS
;
;  DrawPBut draws the pushButton
;
DrawPBut
                TST.B   ContrlVis(A0)           ;is it visible?
                BEQ.S   ButStub                 ;if not, we're done
;
; calculate roundness as function of rectangle size
;
                BSR     RoundCalc               ;compute roundNess factor in D4
;
; erase the bounding rectangle (if necessary)
;
                LEA     ContrlRect(A0),A4       ;get pointer to bounding rect
                TST.B   D6                      ;is it a pushButton?
                BEQ.S   EraseCBound             ;push buttons are always erased
                TST.B   D3                      ;draw all?
                BNE.S   SkipCErase              ;if not, don't bother to erase
;
EraseCBound
                MOVE.L  A4,-(SP)                ;push rect
                MOVE.L  D4,-(SP)                ;push rounding factor
                _EraseRoundRect                 ;paint it the background color
;
;  save the current font and force the system font
;
SkipCErase
                MOVE.L  LGlobals(A5),A0         ;get LisaGrafGlobals base
                MOVE.L  ThePort(A0),A0          ;get current port
                MOVE.L  txFont(A0),D3           ;remember the font,face
                MOVE    D7,D0                   ;save selection code
                MOVE.W  txSize(A0),D7           ;remember the size

                SUBQ    #8,D0                   ;was code 8 or greater?
                BGE.S   @1                      ;if so, use window's font

                CLR.L   txFont(A0)              ;force system font, normal face
                MOVE    #12,TxSize(A0)          ;force size = 12
@1
                MOVE.L  ClipRgn(A0),-(SP)       ;push the current clipRgn handle
;
; save old clip region and clip to the bounding rectangle sected with oldClip
;
                CLR.L    -(SP)                  ;make space for region handle
                _NewRgn                         ;allocate a region
                MOVE.L  (SP),A2                 ;remember region but leave on stack
                _GetClip                        ;remember the current clipRgn
                MOVE.L   (A3),A0                ;get control pointer
                PEA      ContrlRect(A0)         ;push pointer to its bounding rect
                _ClipRect                       ;make that the clipping region

                MOVE.L   A2,-(SP)               ;push the old ClipRgn
                MOVE.L   4(SP),-(SP)            ;the answer goes into current clip
                _SectRgn                        ;intersect new and old
;
; get a pointer to the title string and push it
;
                MOVE.L  (A3),A0                 ;get control pointer
                PEA     ContrlTitle(A0)         ;point to title string
;
; position the pen to center the string in its rectangle
;
                CLR.W   -(SP)                   ;make room for function result
                PEA     ContrlTitle(A0)         ;point to title string
                _StringWidth                    ;Get width of string
                MOVE.W  (SP)+, D0               ;String width in D0
;
                MOVE.L  (A3),A0                 ;handle -> pointer
                LEA     ContrlRect(A0),A4       ;set up pointer to bounding rect

                TST     D6                      ;is it a checkBox?
                BNE     PosCheck                ;checkBoxes center differently
;
                MOVE    RIGHT(A4),D1            ;get right coordinate
                SUB     LEFT(A4),D1             ;get width of button
                SUB     D0,D1                   ;get buttonWidth -stringWidth
                ASR     #1,D1                   ;divide by 2
                ADD     LEFT(A4),D1             ;add to left for starting X
;
DrawBTitle
                MOVE.W  D1, -(SP)               ;push left coordinate
;
                MOVE.W  Bottom(A4), D0          ;Get bottom coordinate
                MOVE    D0,D1                   ;remember in D1
                SUB.W   Top(A4),D0              ;get height
                SUB     #16,D0                  ;subtract 16
                ASR     #1,D0                   ;divide by 2
                SUB     D0,D1                   ;compute centered baseline
                SUBQ    #4,D1                   ;leave 4 for descenders
                MOVE.W  D1, -(SP)               ;Push it
                MOVE.W  D1,D5                   ;remember y position
                _MoveTo                         ;Move the pen there
                _DrawString                     ;draw it
;
; restore original font, face and size
;
                MOVE.L  LGlobals(A5),A0         ;get LisaGrafGlobals base
                MOVE.L  ThePort(A0),A0          ;get current port
                MOVE.L  D3,txFont(A0)           ;restore the font,face
                MOVE.W  D7,TxSize(A0)           ;restore the size

                TST     D6                      ;is it a checkBox?
                BNE     PlotCheck               ;if so, go draw it
;
                MOVE.L  A4,-(SP)                ;push the rectangle pointer
                MOVE.L  D4,-(SP)                ;push rounding factor
                _FrameRoundRect                 ;frame the button
;
; hilite the button if necessary
;
                MOVE.L  (A3),A0                 ;get control pointer
                MOVE.B  ContrlHilite(A0),D0     ;is it hilited?
                BEQ.S   DoneDrwBut              ;if not, we're done
;
                CMP.B   #$FE,D0                 ;is it the special hilite state?
                BHS.S   SpecialHilite           ;if so, go do it
;
                MOVE.L  A4,-(SP)                ;push rectangle
                MOVE.L  D4,-(SP)                ;push rounding factor
                _InverRoundRect                 ;hilite by inverting
;
; restore original clipping region and we're done
;
DoneDrwBut
                _PenNormal                      ;set the pen back to normal
                MOVE.L  A2,-(SP)                ;push old clip region
                _SetClip                        ;restore it
                MOVE.L  A2,-(SP)                ;dispose of temporary region
                _DisposRgn                      ;de-allocate it
                RTS                             ;all done!
;
; SpecialHilite handles drawing the disabled button

SpecialHilite
               BSR.S    DisableText
               BRA.S    DoneDrwBut
DisableText
               MOVE.L    A4,-(SP)                 ;push rectangle
               MOVE.L    #$00010003,-(SP)
               _InsetRect

               MOVE.L    A4,-(SP)

               MOVE.L    (A5),A0
               PEA       Gray(A0)
               _PenPat
               MOVE      #patBIC,-(SP)
               _PenMode

               _PaintRect                       ;gray it out
               _PenNormal

               MOVE.L    A4,-(SP)
               MOVE.L    #$FFFFFFFD,-(SP)
               _InsetRect

               RTS
;
; PosCheck does horizontal position for check box buttons.  It computes the position
; in D1 and dives back into common code
;
PosCheck
                MOVE.W  Left(A4),D1             ;get the left edge
                ADD.W   #18,D1                  ;leave room for check box
                BRA.S   DrawBTitle              ;back to common code
;
; RoundCalc calculates the rounding factor in D4 based on the control's rect
;
RoundCalc
                TST     D6                      ;is it a checkBox?
                BNE.S   CheckRound              ;if so, special case it
;
                MOVE.W  ContrlRect+Bottom(A0),D4 ;get bottom coordinate
                SUB.W   ContrlRect+Top(A0),D4   ;figure out vertical height
                LSR     #1,D4                   ;scale it down by a factor of 2
                MOVE    D4,D0                   ;fill both halves with it
                SWAP    D4                      ;get in high part
                MOVE    D0,D4                   ;and in low part
                RTS
;
CheckRound      MOVEQ   #0,D4                   ;checkBoxes are square!
                RTS
;
; HitPBut handles the button hit-test
;
HitPBut
                MOVE.B  ContrlHilite(A0),D0     ;get hiliteState
                ADDQ.B  #1,D0                   ;is it 255?
                BEQ.S   @1                      ;if so, skip
                ADDQ.B  #1,D0                   ;how about 254?
                BEQ.S   Return254               ;if so, we're done
;
                CLR.W   -(SP)                   ;make room for function result
                MOVE.L  D3,-(SP)                ;push the point
                PEA     ContrlRect(A0)          ;push address of rect
                _PtInRect                       ;in the rectangle?
                TST.B   (SP)+                   ;examine result
                BEQ.S   @1                      ;if not, we're done
                MOVE    #inButton,22(A6)        ;return that it was
                TST     D6                      ;a checkBox?
                BEQ.S   @1                      ;if not, we're done
                ADDQ    #1,22(A6)               ;if so, flag it
@1              RTS

Return254
                MOVE    #254,22(A6)             ;indicate its 254-disabled
                RTS
;
; CalcPBut returns the bounding region of the button
;
CalcPBut
                TST     D6                      ;is it a checkBox?
                BNE.S   CalcSquare              ;check box bounds are just rects
;
                BSR.S   RoundCalc               ;calculate rounding factor
                _HidePen                        ;dont draw anything
                _OpenRgn

                BSET     #7,(A3)                ;lock it down

                MOVE.L   (A3),A0                ;get pointer to control
                PEA     ContrlRect(A0)          ;push rectangle pointer
                MOVE.L  D4,-(SP)                ;push rounding factor
                _FrameRoundRect                 ;frame the button

                MOVE.L  D3,-(SP)                ;push the region
                _CloseRgn                       ;make the rounded rectangular region
                _ShowPen

                BCLR    #7,(A3)                 ;unlock the control
;
; set the pattern for indicator dragging
;
DragGray
                MOVE.L  (A5),A0                 ;get qDraw globals
                LEA     Gray(A0),A0             ;point to gray pattern
                MOVE.L  (A0)+,DragPattern       ;move in the 1st half
                MOVE.L  (A0),DragPattern+4      ;move in the 2nd half
                RTS                             ;all done!
;
CalcSquare
                MOVE.L  D3,-(SP)                ;push the region
                PEA     ContrlRect(A0)          ;push the rectangle pointer
                _RectRgn                        ;make a rectangulare region
                BRA.S   DragGray                ;all done -- go set drag pattern
;
; PlotCheck takes care of drawing the actual check box of the check box button.  It
; figures out where to draw the box, draws it, and then checks it or not based on
; the current value and hilite state of the button
;
PlotCheck
                SUBQ    #8,SP                   ;allocate a rectangle on the stack
                ADDQ    #2,D5                   ;bump down a little
                MOVE    D5,Bottom(SP)           ;set up the bottom
                SUB     #12,D5                  ;compute the top
                MOVE    D5,Top(SP)              ;set up the top
                MOVE    Left(A4),D5             ;get left edge of boundsRect
                ADDQ    #2,D5                   ;indent 2 pixels
                MOVE    D5,Left(SP)             ;that's the left of the checkRect
                ADD     #12,D5                  ;compute right edge
                MOVE    D5,Right(SP)            ;update the right edge
;
; erase the check box
;
                MOVE.L  SP,-(SP)                ;push rectangle pointer
                _EraseRect                      ;erase it
;
; OK, now we must fill in the checkBox rectangle based on the value and hilite state
; of the control
;
                MOVE.L  (A3),A0                 ;get control handle
                MOVE.W  ContrlValue(A0),D5      ;get the value
                MOVE.B  ContrlHilite(A0),D0     ;is it hilited?
                BEQ.S   FrameCheck              ;if not, skip
;
; its hilited so up the penSize to indicate its hilited
;
                CMP.B   #$FE,D0                 ;disabled?
                BLO.S   SkipDis                 ;if so, skip doubling
;
                BSR     DisableText

                BRA.S    FrameCheck

SkipDis
                MOVE.L  #$00020002,-(SP)
                _PenSize                        ;up the penSize
FrameCheck
                MOVE.L  SP,-(SP)                ;push the rectangle

                CMP.W   #2,D6                   ;test for radio button
                BEQ.S   @1                      ;if its a radio button, go do it
                _FrameRect                      ;frame it
                BRA.S    @2
@1
                _FrameOval
@2
                _PenNormal
;
; now we can draw the check if we're supposed to
;
                LSR     #1,D5                   ;check out the low bit of D5
                BCC.S   DonePCheck              ;if its off, we're done
;
                CMP.W   #2,D6                   ;test for radio button
                BEQ.S   DrawRButton             ;if its a radio button, go do it
;
                MOVE.L  SP,-(SP)                ;push the rectangle pointer
                MOVE.L  OneOne,-(SP)            ;push the inset factor
                _InsetRect                      ;inset the rectangle

                MOVE.L  TopLeft(SP),-(SP)       ;push top left
                _MoveTo                         ;move to it
                MOVE.L  BotRight(SP),-(SP)      ;push bottom right
                _LineTo                         ;draw one line of the cross
;
                MOVE    Right(SP),-(SP)         ;push right
                MOVE    Top+2(SP),-(SP)         ;push top
                SUBQ    #1,(SP)                 ;bias the top
                _MoveTo                         ;move to it
                MOVE    Left(SP),-(SP)          ;push left
                SUBQ    #1,(SP)                 ;bias the left
                MOVE    Bottom+2(SP),-(SP)      ;push bottom
                _LineTo                         ;draw the line
                BRA.S   DonePCheck
;
;  draw the radio button check mark -- a little circle
;
DrawRButton
                MOVE.L  SP,-(SP)                ;push pointer to rect
                MOVE.L  #$00030003,-(SP)        ;push inset factor
                _InsetRect                      ;inset it
                MOVE.L  SP,-(SP)                ;push rect again
                _PaintOval                      ;draw the circle?
;
DonePCheck
                ADDQ    #8,SP                   ;pop off the rectangle
                BRA     DoneDrwBut              ;all done!

               .END
l check box of the check box button.  It
; figures out where to draw the box, draws it, and then checks it or not based on
; the current value and hilite state of the button
;
PlotCheck
                SUBQ    #8,SP                   ;allocate a rectangle on the stack
                ADDQ    #2,D5                   ;bump down a little
              sumacc/ws/defprocs/mdef   444      0     12       54045  3472707170  10434 3. "6F^5PH r^!!N/;File mDefProc.Text
;------------------------------------------------------------
;
;  Standard Menu Definition Procedure for Text Menus
;
;       written by Andy Hertzfeld   July 1982
;
;     Here is the default menu definition procedure for text menus.  It knows how to
;  draw a text menu, or select from within a text menu.  It is always called from the
;  window manager port with clipping set to the menuRect.
;
;  MODIFICATION HISTORY:
;
;    27-Dec-82  AJH  Broke off into separate file for resources
;    28-Jan-83  AJH  made "GrayRect" use FillRect and a hardwired gray
;    17-Mar-83  AJH  Fixed 4 pixel choosing offset
;    17-Mar-83  AJH  no more forcing bold
;    28-Apr-83  AJH  added "calcMenuSize" message
;    30-Oct-83  AJH  changed disabling
;    06-Nov-83  AJH  back to old disabling; special-cased "-" item
;    13-Feb-84  AJH  speeded up CalcMenuSize message (linear instead of N squared)
;
;---------------------------------------------------------------


                .INCLUDE  TlAsm/SYSEQU.TEXT
                .INCLUDE  TlAsm/SYSMACS.TEXT
                .INCLUDE  TlAsm/GrafTypes.TEXT
                .INCLUDE  TlAsm/ToolEqu.TEXT
                .INCLUDE  TlAsm/ResEqu.Text
                .INCLUDE  TlAsm/QuickMacs.TEXT
                .INCLUDE  TlAsm/ToolMacs.TEXT

                .PROC   MDEF,0

;
; PROCEDURE TextMenuProc(message: INTEGER,menuHandle,menuRect,point,VAR whichItem:INTEGER);
;

;
; Stack Frame Definition for TextMenuProc
;
MWHICHITEM      .EQU    8
MPOINT          .EQU    MWHICHITEM+4
MMENURECT       .EQU    MPOINT+4
MMENUHANDLE     .EQU    MMENURECT+4
MMESSAGE        .EQU    MMENUHANDLE+4
;
                BRA.S    @0

; standard header

               .WORD    0                       ;flags word
               .ASCII   'MDEF'                  ;type
               .WORD    0                       ;ID
               .WORD    2                       ;version

@0
                LINK    A6,#0                   ;set up a stack frame
                MOVEM.L D3-D7/A2-A4,-(SP)       ;save a whole bunch of work registers
                MOVE.L  MMENUHANDLE(A6),A3      ;keep menuHandle in A3
;
                MOVE    MMESSAGE(A6),D0         ;draw or choose or calc?
                BEQ     DRAWMPROC               ;if zero, go draw it
                SUBQ    #1,D0                   ;is it choose?
                BNE     DoCalcMsg               ;if not, go calculate its size
;
; the message was "choose" so examine the mouse position and hilite the appropriate item
;
                MOVE.L  MWHICHITEM(A6),A4       ;get pointer to whichItem
                MOVE.W  (A4),D3                 ;remember oldWhichItem
                CLR     (A4)                    ;set whichItem to zero
;
; if the point isn't in the menuRect, things are easy so test it
;
                CLR.W   -(SP)                   ;make from for PtInRect result
                MOVE.L  MPOINT(A6),-(SP)        ;push the point
                MOVE.L  MMENURECT(A6),-(SP)     ;push the rect
                _PtInRect                       ;test if the point is in the rect
                TST.B   (SP)+                   ;was it?
                BEQ.S   NOITEMSEL               ;if not, don't bother checking for the item
;
; the point is in the menu, so waltz through the itemList keeping track of vertical
; position seeing which item its in.  In the following loop, D4 holds the item number
; while D2 has the cumulative vertical space
;
                MOVEQ   #1,D4                   ;start with 1st item
                MOVEQ   #20,D2                  ;menuBar ends at 19, so start at 20
;
MSELOOP         MOVE.L  (A3),A0                 ;get menuPtr
                MOVE    D4,D0                   ;get item number
                BSR     GETITEMRECORD           ;look it up
                BEQ.S   NOITEMSEL               ;if so, nothing selected
;
                ADD     #16,D2                  ;bump vertical by itemSize
                TST.B   ITEMICON(A1)            ;does it have an icon?
                BEQ.S   @1                      ;skip if it doesn't
                ADD     #20,D2                  ;icon entries 36 high
@1              CMP     MPOINT+V(A6),D2         ;compare with mouse point
                BGT.S   GOTSEL                  ;when D2 is bigger, we found it
;
; we didn't reach it yet, so keep stepping down till we do
;
NEXTMSEL        ADDQ    #1,D4                   ;bump to next item
                BRA.S   MSELOOP                 ;loop till we find it
;
; we found it so update whichItem.  First we better make sure its enabled
;
GOTSEL          BSR.S   ENABLETEST              ;make sure whole menu is enabled
                BEQ.S   NOITEMSEL               ;if not, no selection
;
                MOVE    D4,(A4)
;
; see if whichItem changed; if it has, unselect the old item and select the new one
;
NOITEMSEL       CMP     (A4),D3                 ;have they changed?
                BEQ.S   DONEMPROC               ;if not, we're all done
;
                MOVE    D3,D0                   ;unhilite old item
                BSR.S   INVERTITEM              ;do it
                MOVE    (A4),D0                 ;hilite new item
                BSR.S   INVERTITEM              ;do it
;
DONEMPROC       MOVEM.L (SP)+,D3-D7/A2-A4       ;restore work registers
                UNLK    A6                      ;unbuild the stack frame
;
                MOVE.L  (SP)+,A0
                ADD     #18,SP                  ;strip parameters
                JMP     (A0)                    ;return to caller
;
; EnableTest is a utility which tests if an item is enabled.  It expects a menuHandle
; in A3 and the item number in D4.  It returns the result in the Z-flag
;
ENABLETEST      MOVE.L  (A3),A0                 ;get menu pointer
                MOVE.L  MENUENABLE(A0),D0       ;get enable flags
                BTST    D4,D0                   ;is item enabled?
                BEQ.S   ETDONE                  ;if not, return 0
                BTST    #0,D0                   ;test menu bit
ETDONE          RTS                             ;return to caller

;
; InvertItem is an internal utility that hilites/unHilites an item.  The item number is
; passed in D0.  It also assumes A3 has the menuHandle.  If the high bit of D0
; is set, bit-clear with gray instead of inverting the item.
;
INVERTITEM      MOVEM.L D3-D4,-(SP)             ;save work registers
                MOVE    D0,D3                   ;keep item number in safe place
                BEQ.S   INVERTDONE              ;if zero, ignore
                MOVEQ   #20,D2                  ;D2 hold the vertical position
                MOVEQ   #1,D4                   ;D4 hold item index
;
IILOOP          MOVE    D4,D0                   ;get item
                MOVE.L  (A3),A0                 ;get menuPtr
                BSR     GETITEMRECORD           ;look it up
                MOVEQ    #16,D0                 ;its at least 16 long
                TST.B   ITEMICON(A1)            ;does it have an icon?
                BEQ.S   @1                      ;skip if it doesn't
                MOVEQ   #36,D0                  ;icon items are 36 high
;
@1              CMP.B   D3,D4                   ;found the item we want yet?
                BEQ.S   GOINVERT                ;if so, go invert it
                ADD     D0,D2                   ;add total to cumulative v position
                ADDQ    #1,D4                   ;bump to next position
                BRA.S   IILOOP                  ;loop till we find it
;
; its time to invert the item.  The menuRect contains the horizontal bounds, D2 contains
; the top of the vertical, D0 has the vertical size
;
GOINVERT        MOVE.B  1(A0),D1                ;remember 1st char of item
                LEA     TEMPRECT,A0             ;get pointer to temporary rectangle
                MOVE.L  MMENURECT(A6),A1        ;point to menuRect
                MOVE.L  (A1)+,(A0)              ;copy menuRect into tempRect
                MOVE.L  (A1),4(A0)
                MOVE    D2,TOP(A0)              ;D2 has the top coordinate
                ADD     D0,D2                   ;add in the height
                MOVE    D2,BOTTOM(A0)           ;set up the bottom
;
                TST.W   D3                      ;invert or bit clear?
                BMI.S   GOBITCLEAR              ;hi bit set so go bit clear
;
                MOVE.L  A0,-(SP)                ;push a pointer to the rectangle
                _InverRect                      ;invert it

INVERTDONE      MOVEM.L (SP)+,D3-D4             ;recover work regs
                RTS
;
GOBITCLEAR      CMP.B    #$2D,D1                ;is it the dash?
                BEQ.S     InvertDone            ;if so, don't hilite

                BSR     GRAYRECT                ;bit clear tempRect with gray
                BRA.S   INVERTDONE              ;all done!
;
; here is the part of the TextMenuProc that draws the menu.  For most of this routine,
; A3 holds the menuHandle, D4 is the item counter and D3 holds the cumulative
; vertical position
;
DRAWMPROC       MOVEQ   #1,D4                   ;start with item 1
                MOVEQ   #32,D3                  ;baseline of 1st item is 12 + 20
                MOVE.L  MMENURECT(A6),A0        ;get menuRect pointer
                MOVE.W  LEFT(A0),D5             ;get left edge
                MOVE.W  RIGHT(A0),D6            ;get right edge, too
;
DRAW1MLOOP      MOVE    D4,D0                   ;get item number in D0
                MOVE.L  (A3),A0                 ;get menu pointer
                BSR     GETITEMRECORD           ;look it up
                BEQ.S   DONEMPROC               ;if null item, all done
                MOVE.L  A0,A2                   ;keep string pointer in A2
                MOVE.L  A1,A4                   ;keep properties in A4
;
; draw the mark
;
                TST.B   ITEMMARK(A4)            ;does it have a mark?
                BEQ.S   CHKDRAWICON             ;if not, skip
;
                MOVE    D5,-(SP)                ;push menuRect.left
                ADDQ    #2,(SP)                 ;move in two pixels
                MOVE    D3,-(SP)                ;push v position
                TST.B   ITEMICON(A4)            ;does it have an icon
                BEQ.S   @1                      ;if not, skip
                ADDQ    #8,(SP)                 ;offset checkmark position
@1              _MoveTo                         ;position pen
                CLR     D0                      ;clear out high part
                MOVE.B  ITEMMARK(A4),D0         ;get the mark character
                MOVE.W  D0,-(SP)                ;push it
                _DrawChar
;
; if its an icon item, bump baseLine by 8 and draw the icon
;
CHKDRAWICON     MOVE.W   #$0100,D0              ;menu icons are 256-511
                MOVE.B  ITEMICON(A4),D0         ;does it have an icon?
                BEQ.S   DRAWITEXT               ;if not, skip
;
                ADDQ    #8,D3                   ;bump baseLine
;
; draw the icon
;
                LEA     TEMPRECT,A0             ;get pointer to rectangle
                MOVE.L  A0,-(SP)                ;push rect for plotIcon call
                MOVE    D3,(A0)                 ;push top
                SUB     #18,(A0)+               ;adjust top
                MOVE    D5,(A0)                 ;push left
                ADD     #12,(A0)+               ;dont forget indent
                MOVE.L  -4(A0),(A0)             ;copy bottom right
                ADD     #32,(A0)+               ;bottom := top + 32
                ADD     #32,(A0)                ;right  := left + 32

;
                CLR.L   -(SP)                   ;make room for function result
                MOVE.L  #IconRType,-(SP)        ;push the resource type
                MOVE    D0,-(SP)                ;push icon number
                _GetResource                    ;get the icon handle
                _PlotIcon                       ;plot the icon
                ADD     #40,D5                  ;indent past icon
;
; draw the text of the item
;
DRAWITEXT       CLR     D0                      ;clear it out
                MOVE.B  ITEMSTYLE(A4),D0        ;push the style parameter
                MOVE.W  D0,-(SP)                ;push style parameter

@1              _TextFace                       ;get into that face

                CMP.B    #$2D,1(A2)             ;first char a dash?
                BEQ.S    DrawDash               ;if so, handle specially

                MOVE    D5,-(SP)                ;push the x position
                ADD     #12,(SP)                ;don't forget indent
                MOVE    D3,-(SP)                ;push y position
                _MoveTo                         ;position pen

                MOVE.L  A2,-(SP)                ;push string pointer
                _DrawString                     ;draw it

                CLR     -(SP)                   ;push empty set
                _TextFace                       ;restore textface to normal
;
; draw apple character
;
                TST.B   ITEMCMD(A4)             ;is there one?
                BEQ.S   NXTDRAWITEM             ;if not, skip

@4              MOVE    D6,-(SP)                ;push right edge
                SUB     #24,(SP)                ;leave some room
                MOVE.W  D3,-(SP)                ;push vertical position
                _MoveTo                         ;position pen
                MOVE.W  #APPLEMARK,-(SP)        ;push apple character
                _DrawChar                       ;draw the character
                CLR     D0                      ;clear high part
                MOVE.B  ITEMCMD(A4),D0          ;get command character
                MOVE.W  D0,-(SP)                ;push command char
                _DrawChar                       ;draw it

                CLR.W     -(SP)                  ;push normal style
                _TextFace                        ;restore normal textFace
;
; if the item is disabled, gray it out
;
NXTDRAWITEM     BSR     ENABLETEST              ;is it enabled?
                BNE.S   NXTDRAW1                ;branch if it is
                MOVE    D4,D0                   ;get item
                OR      #$8000,D0               ;set high bit
                BSR     INVERTITEM              ;bit clear item with gray
;
; we're done with this item so bump to the next one
;
NXTDRAW1        TST.B   ITEMICON(A4)            ;does it have an icon?
                BEQ.S   @1                      ;skip if it doesnt
                SUB     #40,D5                  ;re-adjust D5
                ADD     #12,D3                  ;bump an extra 12 (36 total) for icon
;
@1              ADD     #16,D3                  ;bump 16 for item
                ADDQ    #1,D4                   ;bump to next item
                BRA.S   DRAW1MLOOP              ;loop till done

; handle the case of a dash item by drawing a line

DrawDash
                MOVE.L   (A5),A0                  ;get QuickDraw globals
                PEA      Gray(A0)                 ;set pattern to gray
                _PenPat

                MOVE.W   D5,-(SP)                 ;push x position
                MOVE.W   D3,-(SP)                 ;push y position
                SUBQ     #6,(SP)                  ;center it
                _MoveTo

                MOVE.W   D6,-(SP)                 ;push right edge
                MOVE     D3,-(SP)                 ;push y
                SUBQ     #6,(SP)                  ;center it
                _LineTo                           ;draw the line

                _PenNormal                        ;pen back to normal
                BRA.S    NxtDraw1                 ;dive back into mainstream

;
;  GetItemRecord is the main utility used for accessing the menu item data structure.
;  It has a register interface to save code.  On entry, A0 points to a menuInfo block,
;  while D0 has the item number of interest.  On exit, A0 points to the item string
;  of interest while A1 points to that item's attribute byte list.  If the item can't
;  be found, A0 and A1 both return NIL.
;
GETITEMRECORD   TST     D0                      ;make sure item number is valid
                BLE.S   NOITEM                  ;if its not, don't bother
;
                MOVEQ   #0,D1                   ;clear D1 for byte arithmetic
                LEA     MENUDATA(A0),A1         ;get menuData handle
                MOVE.B  (A1)+,D1                ;get title length
                ADD     D1,A1                   ;skip over title string
;
; here is the item search loop.  A1 points to the beginning of the next item.
;
GETILOOP        SUBQ    #1,D0                   ;is this the one we're looking for?
                BEQ.S   GOTITEM                 ;if so, we got it
                MOVE.B  (A1)+,D1                ;get length of current item
                BEQ.S   NOITEM                  ;length zero marks end of list
;
                ADDQ    #4,D1                   ;there are 4 bytes of item properties
                ADD     D1,A1                   ;bump to next item
                BRA.S   GETILOOP                ;loop till done
;
;  the item couldn't be found so return NIL
;
NOITEM          SUB.L   A0,A0                   ;zero A0
                MOVE.L  A0,A1                   ;and A1 too
                MOVE.L  A0,D0                   ;and set the z-flag
                RTS                             ;return to caller
;
; we found the item so return a pointer to it in A0 and a pointer to the item properties
; in A1
;
GOTITEM         TST.B   (A1)                    ;is this the NIL item?
                BEQ.S   NOITEM                  ;if so, we really didn't get one
;
                MOVE.L  A1,A0                   ;A0 points to item string
                MOVE.B  (A1)+,D1                ;get length
                ADD     D1,A1                   ;bump to item properties
                RTS                             ;return to caller

; Calculate the menu size for the given text menu.  The handle is in A3.

DoCalcMsg
                SUBQ     #4,SP
                MOVE.L   SP,-(SP)               ;point to top of stack
                _GetPort                        ;get the current port

                MOVE.L   WmgrPort,-(SP)         ;push the wmgr port
                _SetPort                        ;set it

;
                MOVEQ   #0,D6                   ;set initial <height,width> to 0
                MOVEQ   #1,D0                   ;find item 1
                MOVE.L  (A3),A0                 ;point to the menuRecord
                BSR.S   GetItemRecord           ;point to first item
                MOVE.L  A0,A4                   ;keep pointer in A4
;
; here is the main loop of calcMenuSize.  Process each item one at a time, keeping the
; height and maximum width in D6
;
CMLOOP
                MOVEQ   #0,D7                   ;set "extra" width to zero

                MOVE.L  (A3),A0                 ;handle -> pointer
                MOVEQ   #0,D0                   ;clear out high part
                MOVE.B  (A4),D0                 ;get length of item
                BEQ.S   CMDONE                  ;if zero, we're done with this menu
                LEA     1(A4,D0),A1             ;point A1 at the properties
;
; handle the vertical
;
                MOVEQ   #16,D0                  ;most of the time the item is 16 tall
                TST.B   ITEMICON(A1)            ;is there an icon for this item?
                BEQ.S   @1                      ;if not, don't adjust height

                MOVEQ   #40,D7                  ;add 40 to width for icons
                MOVEQ   #36,D0                  ;icon entries are 36 tall

@1              SWAP    D0                      ;get vertical into high word
                ADD.L   D0,D6                   ;increment vertical height
;
; handle the horizontal
;
                TST.B   ITEMCMD(A1)             ;is there a mark?
                BEQ.S   @2                      ;if not, skip
                ADD     #32,D7                  ;add 32 dots extra for commandChar
;
@2
                MOVEQ   #0,D1                   ;clear out high byte
                MOVE.B  ITEMSTYLE(A1),D1        ;get style setting

@3              MOVE.W  D1,-(SP)                ;push the style
                _TextFace                       ;tell LisaGraf about new style
                CLR     -(SP)                   ;make room for stringWidth result
                MOVE.L  A4,-(SP)                ;move string pointer
                _StringWidth                    ;find out the width
                ADD.W    (SP)+,D7               ;add width to extra
                CMP     D7,D6                   ;compare with maxWidth
                BGE.S   CALCNEXT                ;if max is bigger, go process next one
                MOVE    D7,D6                   ;this one was the biggest
;
; go process next item; loop till we get a null one
;
CALCNEXT
                MOVEQ   #0,D0                   ;zero high part
                MOVE.B  (A4),D0                 ;get the length of current item
                LEA     5(A4,D0),A4             ;point to the next item
                BRA.S   CMLOOP                  ;loop till done
;
;  we've scanned all the items update menuHeight and menuWidth
;
CMDONE          ADD.W   #16,D6                  ;leave left and right margin

                MOVE.L  (A3),A0                 ;get menu pointer
                MOVE.W  D6,MENUWIDTH(A0)        ;update menu width
                SWAP    D6
                MOVE.W  D6,MENUHEIGHT(A0)       ;update menu height
;
                CLR.W   -(SP)                   ;better restore style to normal
                _TextFace                       ;set the style

                _SetPort                        ;restore original grafPort

                BRA     DoneMProc               ;all done!

;
;  GrayRect is a utility that bit-clears the current "tempRect" with gray
;
GRAYRECT
                MOVE.L   A0,-(SP)
                MOVE.L   (A5),A0                ;get QuickDraw globals
                PEA      Gray(A0)               ;psuh gray
                _PenPat                         ;set pen to it
                MOVE    #PatBIC,-(SP)           ;push patBIC penMode
                _PenMode                        ;set penMode
                _PaintRect                      ;or on the dim pattern

                _PenNormal

                RTS


               .END


                 ;set initial <height,width> to 0
                MOVEQ   #1,D0                   ;find item 1
                MOVE.L  (A3),A0                 ;point to the menuRecord
                BSR.S   GetItemRecord           ;point to first item
                MOVE.L  A0,A4                   ;keep pointer in A4
;
; here is the main loop of calcMenuSize.  Process each item one at a time, keeping the
; height and maximum width in D6
;
CMLOOP
                MOVEQ  sumacc/ws/defprocs/rdocwdef   444      0     12       54401  3472707170  11312 W^5H rd^&"!"!M;
;File RDocProc.TEXT
;-------------------------------------------------------
;
;  Rounded Corner Window Definition Routine "RDocProc"
;
;  written by Andy Hertzfeld  Aug 4, 1982
;
;  (c) 1982 by Apple Computer, Inc.  All rights reserved.
;
;    This file contains the window definition procedure
;  "RDocProc", a standard Mac window type similar to the
;  "DocumentProc" included in the ROM.  It is indentical if
;  the refCon is zero, otherwise the roundness of the corners
;  is specified using the high 2 bytes of the window
;  refCon.  It is intended to be linked with applications or
;  desk ornaments.
;
;  Modification History:
;
;   16-OCt-82  AJH  Converted to QuickDraw Trap Interface
;   15-Nov-82  AJH  Added GoAway button, made content rectangular
;   02-Jan-83  AJH  Made it a "WDEF" resource
;   07-Mar-83  AJH  Made it dispose the title region (bug fix)
;   17-Mar-83  AJH  Fixed D4 trash bug
;   27-Apr-83  AJH  only plot, hit-test goAway if window is active
;   20-Aug-83  AJH  made it get roundness from selector instead of refCon
;   18-Oct-83  AJH  made it ignore unwanted messages; new hiliting
;
;------------------------------------------------------------------
;
                .INCLUDE  TlAsm/SysEqu.Text
                .INCLUDE  TlAsm/TOOLEQU.TEXT
                .INCLUDE  TlAsm/GRAFTYPES.TEXT
                .INCLUDE  TlAsm/QuickMacs.TEXT

                .FUNC   RDocPRoc,4
;
;  FUNCTION   RDocProc(    selector: INTEGER
;                          window: WindowPtr,
;                          message: INTEGER;
;                          parameter: LongInt): LongInt
;
                BRA.S   @0

; standard header

                .WORD   0                       ;flags word
                .ASCII  'WDEF'                  ;type
                .WORD   1                       ;ID
                .WORD   1                       ;version

@0
                LINK    A6,#0                   ;set up a stack frame to address parameters
                MOVEM.L D3-D5/A3-A4,-(SP)       ;save work registers
;
; fetch the parameters into registers
;
                LEA     8(A6),A0                ;get ptr to first parameter
                MOVE.L  (A0)+,D3                ;get param in D3
                MOVE.W  (A0)+,D0                ;get message
                MOVE.L  (A0)+,A3                ;get the window pointer
                MOVE.W  (A0)+,D5                ;get the selector
                LSR     #1,D5                   ;only use 8 alternatives
                ASL     #2,D5                   ;quadruple for long index
                CLR.L   (A0)                    ;clear out function result
;
; case out on the message number
;
                CMP     #3,D0                   ;is it one we deal with?
                BGE.S   @1                      ;if not, skip

                ASL     #2,D0                   ;quadruple for long index
                JSR     GODOCPROC(D0)           ;dispatch to appropriate routine
;
; we're done -- restore registers and return to caller
;

@1              MOVEM.L (SP)+,D3-D5/A3-A4       ;restore work registers
                UNLK    A6                      ;unlink stack frame
                MOVE.L  (SP)+,A0
                ADD     #12,SP                  ;strip parameters
                JMP     (A0)                    ;return to caller
;
; DocumentProc dispatch table -- entries must be long branches!
;
GODOCPROC
                BRA     DRAWDOC                 ;draw is message 0
                BRA     HITDOC                  ;hit test is message 1
                BRA     CALCDOC                 ;calc test is message 2

DoneDoc         RTS                             ;nor does it need dispose call
;
;  DrawDoc -- draw the document window.   The windowPtr is in A3
;
DrawDoc
                TST.B   WVISIBLE(A3)             ;is it visible?
                BEQ.S   DoneDoc                  ;if not, don't do anything
;
; see if its a EORGoAway call and special case it
;
                CMP     #wInGoAway,D3            ;is it a goAway call?
                BEQ     EorGoAway                ;if so, go handle it
;
;
; derive the titleBar rectangle from the structRgn and keep it in TempRect
;
                LEA     TEMPRECT,A0             ;get pointer to tempRect
                MOVE.L  STRUCTRGN(A3),A1        ;get structure region handle
                MOVE.L  (A1),A1                 ;get strucRgn pointer
                ADDQ    #RGNBBOX,A1             ;point A1 at the bounding box
                MOVE.L  (A1)+,(A0)+             ;copy bounding box into tempRect
                MOVE.L  (A1),(A0)
;
;  make bottom := top + 20
;
                MOVE    -4(A0),D0               ;get top
                ADD     #20,D0                  ;compute top+20
                MOVE    D0,(A0)                 ;update bottom
;
;
; handle the case of non-rectangular titleBar -- we must allocate a region
;
                CLR.L   -(SP)                   ;make space for function result
                _NewRgn                         ;allocate a region

                MOVE.L  (SP),A4                 ;keep it in A4 -- and don't pop it off
                PEA     TEMPRECT                ;tempRect defines the bounding rect
                BSR     GetRadPoint             ;get the radius point in D0
                MOVE.L  D0,-(SP)                ;push the radius factor
                ST      -(SP)                   ;topRound is true
                CLR     -(SP)                   ;botRound is false
                BSR     MakeRoundRgn            ;make the region
;
                MOVE.L  A4,-(SP)                ;push the region
                _FrameRgn                       ;frame it
                MOVE.L  A4,-(SP)                ;push it again
                MOVE.L  OneOne,-(SP)            ;inset by 1
                _InsetRgn                       ;inset it
                MOVE.L  A4,-(SP)                ;push for erase
                _EraseRgn                       ;erase it
;
; hilite the title bar by filling it with specified pattern
;
DrawTheTitle
                BSR     DoTitleString           ;draw the centered Title
;
; plot the goAway button, if necessary
;
                TST.B   WGoAway(A3)             ;is the a goaway button?
                BEQ.S   DoHilite                ;if not, skip
;
                TST.B   WHilited(A3)            ;only plot goAway if hilited
                BEQ.S   DoHilite                ;if not, don't plot goAway

                BSR.S   BuildTBarRect
                LEA     GoAwaySymbol,A1         ;get the goAway symbol

@1              MOVEQ   #0,D1                   ;plot in srcCopy mode
                BSR     PlotGoAway
DoHilite
                TST.B   WHILITED(A3)            ;is it hilited?
                BEQ.S   DisposIt                ;if not, skip

                SUBQ    #1,TempRect+Bottom      ;adjust bottom
                PEA     TEMPRECT                ;push the title rect
                _InverRect
DisposIt
                MOVE.L  A4,-(SP)                ;push the region handle
                _DisposRgn                      ;deallocate it
;
; frame the body of the window
;
DrawFrame
                MOVE.L  STRUCTRGN(A3),-(SP)     ;push the structure
                _FrameRgn                       ;frame the body
                RTS

;
; BuildTBarRect builds a rectangle enclosing the titleBar in TempRect
;
BuildTBarRect
                LEA     TEMPRECT,A0             ;get pointer to tempRect
                MOVE.L  STRUCTRGN(A3),A1        ;get structure region handle
                MOVE.L  (A1),A1                 ;get strucRgn pointer
                ADDQ    #RGNBBOX,A1             ;point A1 at the bounding box
                MOVE.L  (A1)+,(A0)              ;copy bounding box into tempRect
                MOVE.L  (A1),4(A0)
;
;  make bottom := top + 20
;
                MOVE    Top(A0),D0              ;get top
                ADD     #20,D0                  ;compute top+20
                MOVE    D0,Bottom(A0)           ;update bottom
                SUBQ    #1,Right(A0)            ;inset right
                RTS                             ;return to caller
;
; EORGoAway hilites/unhilites the goAway button.  It falls through into PlotGoAway
;
EorGoAway
                BSR.S   BuildTBarRect           ;build the bounding rect
                LEA     GoAwaySymbol,A1         ;get the bitMap
                ADD.W   #32,A1                  ;bump to the EOR Mask
                MOVEQ   #2,D1                   ;set EOR as the plot mode
;
; PlotGoAway plots the goAway button.  A1 holds the symbol, D1 the plotting mode
;
PlotGoAway
                LEA     TempRect,A0             ;get pointer to tempRect
                MOVE    Left(A0),D0             ;get left edge
                ADDQ    #8,D0                   ;leave some margin
                MOVE    D0,Left(A0)             ;update left
                ADD     #16,D0
                MOVE    D0,Right(A0)            ;update right
;
                MOVE    D1,D0                   ;set plotting mode
                ADDQ    #2,TempRect+Top         ;adjust for 16 by 16
                SUBQ    #2,TempRect+Bottom      ;fix bottom, too
                MOVE.L  #$00100010,D1
                BSR     PlotSymbol              ;plot it in tempRect
                BSR.S   BuildTBarRect           ;rebuild tempRect
                RTS

;
;  PlotSymbol -- plot the little 16 by 16 symbol bitmap pointed to by A1 into the rectangle
;  pointed held in TempRect. D0 holds the mode.
;
PlotSymbol
                LEA     IconBitMap,A0           ;get pointer to source bitmap
                MOVE.L  A1,(A0)                 ;update base address of bitMap
                MOVE    #2,4(A0)                ;update rowBytes
                MOVE.L  #$00100010,10(A0)       ;adjust boundsRect
;
; push parameters for CopyBits call to transfer arrow bitMap
;
                MOVE.L  A0,-(SP)                ;push pointer source bitmap
                MOVE.L  LGLOBALS(A5),A1         ;get lisaGraf global baseaddress
                MOVE.L  THEPORT(A1),A1          ;get thePort
                PEA     PORTBITS(A1)            ;that's the destination bitmap
;
                PEA     BOUNDS(A0)              ;boundsRect of bitmap is source
                PEA     TempRect                ;tempRect is the destination
                MOVE.W  D0,-(SP)                ;theMode is in D0
                CLR.L   -(SP)                   ;no mask region
;
; transfer the bitMap (stretching as necessary...)
;
                _CopyBits                       ;let Bill stretch those bits
                RTS                             ;return to caller
;
; DoTitleString is the common code that draws the title centered in tempRect
;
DoTitleString
                BSR     BuildTBarRect           ;calculate title bar rect
;
; compute indent factor based on GoAwayButton state
;
@1              MOVE.W  TempRect+Right,D3       ;get right
                SUB.W   TempRect+Left,D3        ;compute width

                SUB.W   WTITLEWIDTH(A3),D3      ;compute extra x
                ASR.W   #1,D3                   ;divide by 2
;
; if there's a goAway button, make sure the margin is at least 28 pixels
;
                TST.B   WGoAway(A3)             ;is there a go away button
                BEQ.S   @2                      ;skip if there's not

                TST     D3                      ;is it negative?
                BMI.S   @3                      ;if so, pin at 28
                CMP.W   #28,D3                  ;if goAway button, must have some margin
                BGT.S   @2
@3              MOVEQ   #28,D3

@2              ADD     TempRect+Left,D3        ;compute x position
                MOVE.W  D3,-(SP)                ;and push for MoveTo

                MOVE    TempRect+Bottom,-(SP)   ;push bottom
                SUBQ    #6,(SP)                 ;leave room for descenders
                _MoveTo

; draw the string

                MOVE.L  WTITLEHANDLE(A3),A0     ;get titleHandle
                MOVE.L  (A0),-(SP)              ;push title pointer
                _DrawString                     ;draw it
DoneDString
                RTS                             ;all done drawing title...

;
;  GetRadPoint returns the radius in D0 of the round rect parameter defined
; by the selector parameter
;
GetRadPoint
                MOVE.L  RadiusTable(D5),D0
                RTS

RadiusTable
                .LONG   $00100010               ;(16,16)
                .LONG   $00040004               ;(4,4)
                .LONG   $00060006               ;(6,6)
                .LONG   $00080008               ;(8,8)
                .LONG   $000A000A               ;(10,10)
                .LONG   $000C000C               ;(12,12)
                .LONG   $00140014               ;(20,20)
                .LONG   $00180018               ;(24,24)
;
;  MakeRoundRegion -- makes a round region given a bounding rectandle and a radius
;  value.  Also, half round regions (top round, bottom square) are supported
;  by the topRound,botRound booleans
;
;     MakeRoundRegion( theRgn:RegionHandle
;                     theRect:           Rect
;                     xRad,yRad:         INTEGER
;                     topRound,botRound: BOOLEAN)
;
MakeRoundRgn
                LINK    A6,#0                   ;set up stack frame
                MOVE.L  A3,-(SP)                ;save work registers
                TST.L   8(A6)                   ;are flags both false?
                BEQ.S   PlainRect               ;if so, its just a rectangle
                TST.L   12(A6)                  ;is radius factor 0?
                BNE.S   ComplexRect             ;if not, its a round one
;
; optimize for the rectangular case
;
PlainRect
                MOVE.L  20(A6),-(SP)            ;push region handle
                MOVE.L  16(A6),-(SP)            ;push  rectangle pointer
                _RectRgn                        ;make a rectangular region
                BRA.S   MMRDone                 ;all done!
;
; make a region with top and bottom corners rounded
;
ComplexRect
                _HidePen                        ;hide the pen
                _OpenRgn                        ;start recording the region
;
                MOVE.L  16(A6),-(SP)            ;push the rectangle pointer
                MOVE.L  12(A6),-(SP)            ;push the radius point
                _FrameRoundRect                 ;define the region
                MOVE.L  20(A6),-(SP)            ;push region handle
                _CloseRgn                       ;assign roundRect region
;
                _ShowPen                        ;enable drawing again
;
; now square up either the top or bottom of the region (or neither)
;
                MOVE.L  16(A6),A0               ;get rectangle pointer
                TST.W   8(A6)                   ;examine 'botRound' flag
                BNE.S   CheckTRound             ;if true, see if top needs squaring
                MOVE    BOTTOM(A0),D1           ;get bottom y coordinate
                MOVE    D1,D0
                SUBQ    #8,D0                   ;compute top
                BRA.S   SquareIt
;
CheckTRound
                TST.W   10(A6)                  ;examine 'topRound' flag
                BNE.S   MMRDone                 ;if that true, we're done
                MOVE    Top(A0),D0              ;get top y coordinate
                MOVE    D0,D1
                ADDQ    #8,D1                   ;get bottom
;
; here we build a rect in ToolScratch that has the same X as tempRect, but centered
; around the top or bottom
;
SquareIt
                LEA     ToolScratch,A1            ;get pointer to dest Rect
                MOVE    D0,(A1)+                  ;update top
                MOVE    Left(A0),(A1)+            ;copy left
                MOVE    D1,(A1)+                  ;update bottom
                MOVE    Right(A0),(A1)            ;copy right
;
; now make a region out of that rectangle
;
                CLR.L   -(SP)                   ;make space for result
                _NewRgn                         ;allocate a new region
                MOVE.L  (SP),A3                 ;keep a copy in A3
                PEA     ToolScratch             ;push the rectangle pointer
                _RectRgn                        ;make the rectangular region
;
; now union with the parameter region to square up the edges
;
                MOVE.L  20(A6),-(SP)            ;push destination region
                MOVE.L  A3,-(SP)                ;push square region
                MOVE.L  20(A6),-(SP)            ;dest gets the result
                _UnionRgn
;
; all done -- deallocate the temporary region
;
                MOVE.L  A3,-(SP)
                _DisposRgn
;
MMRDone
                MOVE.L  (SP)+,A3                ;restore work reg
                UNLK    A6                      ;unlink stack frame
                MOVE.L  (SP)+,A0                ;get return address
                ADD     #16,SP                  ;strip parameters
                JMP     (A0)                    ;all done!

; HitDoc -- perform a hit test on the document.  On entry, D3 contains the mousePoint
; in global coordinates while A3 holds the window pointer
;
HitDoc
                MOVEQ   #16,D4                  ;keep 16 in a register to save code
                CLR.W   -(SP)                   ;make room for function result
                MOVE.L  D3,-(SP)                ;push the mouse point
                MOVE.L  CONTRGN(A3),-(SP)       ;push content region handle
                _PtInRgn                        ;is the point in the content region?
                TST.B   (SP)+                   ;well, is it?
                BEQ.S   NotInContent            ;if not, go check out drag region

; the point is in the content region so return a '1'

justContent
                MOVEQ   #wInContent,D0          ;return in content
                BRA.S   DoneHitDoc              ;go store function result and return

; its not in the content -- see if its in the dragRgn (content extended by titleBar)

NotInContent

                CLR.W   -(SP)
                MOVE.L  D3,-(SP)
                MOVE.L  StructRgn(A3),-(SP)
                _PtInRgn
                TST.B   (SP)+
                BEQ.S   DoneHit1

                CLR.W   -(SP)                   ;make room for function result
                MOVE.L  D3,-(SP)                ;push the mouse point
                MOVE.L  ContRgn(A3),A4          ;get content region handle
                MOVE.L  (A4),A4                 ;get region ptr
                ADDQ    #RgnBBox,A4             ;get bounding box ptr
                SUB     #20,Top(A4)             ;make it 20 higher
                MOVE.L  A4,-(SP)                ;push the rect
                _PtInRect                       ;is the point in the title bar?
                ADD     #20,Top(A4)             ;fix up content bounds

                TST.B   (SP)+                   ;examine result
                BEQ.S   DoneHit1                ;if not, return 0 (do nothing)

; see if its in leftmost 16 of drag, which is the goAway button

                TST.B   WGoAway(A3)             ;is there a goAway button?
                BEQ.S   ItsInDrag               ;if not, skip
                TST.B   WHilited(A3)            ;only draw it for the active one
                BEQ.S   ItsInDrag

                MOVE    D3,D0                   ;get mousePt
                ADD     PortBounds+Left(A3),D0  ;convert to local
                SUB     PortRect+Left(A3),D0    ;compensate for origin
                CMP     #18,D0                  ;is it too far right?
                BGT.S   ItsInDrag               ;if so, its in drag
                SUBQ    #8,D0                   ;it must be at least 8
                BMI.S   ItsInDrag

; its in the goAway button so signal it

                MOVEQ   #wInGoAway,D0
                BRA.S   DoneHitDoc

ItsInDrag
                MOVEQ   #wInDrag,D0             ;flag in drag region
DoneHitDoc
                MOVE.L  D0,20(A6)               ;update function result
DoneHit1        RTS


; CalcDoc  -- calculate the structure and content regions for the window pointed
; to by A3.

CalcDoc
                LEA     TEMPRECT,A0             ;get a pointer to the work rectangle
                MOVE.L  A0,-(SP)                ;push for later offset
                MOVE.L  PORTRECT(A3),(A0)+      ;copy topLeft of portRect
                MOVE.L  PORTRECT+4(A3),(A0)     ;copy botLeft of portRect

; offset it to global coordinates

                MOVE.L  PORTBOUNDS(A3),-(SP)    ;push topLeft of port.portBits.bounds
                NEG     2(SP)                   ;negate offset
                NEG     (SP)
                _OffsetRect                     ;offset tempRect to global coordinates

; make the content region square for fast updating

                MOVE.L  CONTRGN(A3),A0          ;A0 holds the content region
                CLR     D1                      ;topround is false
                BSR.S   GOMAKERGN               ;go make the region into content region


; now do the structure region.  First correct the bounding rectangle (tempRect) for
; structure instead of content

                PEA     TEMPRECT                ;push a pointer to the rect
                MOVE.L  MinusOne,-(SP)          ;make 1 pixel bigger, all around
                _InsetRect                      ;make it bigger
                SUB     #19,TempRect+Top        ;make top 19 pixels higher
                MOVEQ   #1,D1                   ;topRound is true
                MOVE.L  STRUCTRGN(A3),A0        ;A0 holds the structRgn pointer

GoMakeRgn
                MOVE.L  A0,-(SP)                ;push the region handle
                PEA     TEMPRECT                ;push bounding rectangle pointer
                BSR     GETRADPOINT             ;get the radius factor
                MOVE.L  D0,-(SP)                ;push it
                MOVE.W  D1,-(SP)                ;topRound is in D1
                ST      -(SP)                   ;so is botRound
                BSR     MakeRoundRegion         ;go make the region

; all done with CalcDocRgns

                RTS

;
; BitMap for default GoAway button

GoAwaySymbol
                .WORD   $0000,$0000,$7FF0,$4010
                .WORD   $4010,$4010,$4010,$4010
                .WORD   $4010,$4010,$4010,$4010
                .WORD   $7FF0,$0000,$0000,$0000

;  Mask for goAway button

                .WORD   $0000,$0000,$7FF0,$4110
                .WORD   $4930,$4550,$4010,$5C60
                .WORD   $4010,$4550,$4930,$4110
                .WORD   $7FF0,$0000,$0000,$0000
;

                .END
;


    ;get bounding box ptr
                SUB     #20,Top(A4)             ;make it 20 higher
                MOVE.L  A4,-(SP)                ;push the rect
                _PtInRect                       ;is the point in the title bar?
                ADDsumacc/ws/defprocs/sbarcdef   444      0     12      105772  3472707170  11316 3. "6F^5P:H r^#<#<H;
;File SBarCDef.TEXT
;--------------------------------------------------------------------------
;
;  Standard ScrollBar Dial Definition Procedure for the
;       MacIntosh Control Manager
;
;  written by Andy Hertzfeld  August, 1982
;
;  (c) 1982 by Apple Computer, Inc.  All rights reserved.
;
;    This file contains the control definition procedure
;    that defines scrollBar-type dials.
;
;  Modification History:
;
;    29-Aug-82  AJH  Added "255" hiliting, non-rectangular indicators
;                    to ScrollBarProc
;    31-Aug-82  AJH  Added hysterisis to scrollBar, ronding to value calculations
;    19-Sep-82  AJH  Re-arranged ScrollBar proc, removed DragThumb
;    03-Oct-82  AJH  Fixed bug in scrollBar positioning -- wasn't ctl relative
;    10-Oct-82  AJH  Converted for QuickDraw Trap Interface
;    17-Oct-82  AJH  Made controlProcs preserve A1
;    07-Nov-82  AJH  Made wide scrollBars look better
;    11-Nov-82  AJH  fixed thumb scaling problem in CalcIBox (subtract min)
;    14-Nov-82  AJH  removed box in arrowBits
;    16-Nov-82  AJH  Made branch tables offset based
;    28-Dec-82  AJH  Put scrollBar definition proc in its own file
;    30-Dec-82  AJH  Changed hystersis for thumbDrag to 24 pixels
;    30-Jul-83  SC   Variant 1 for microsoft - no grey or elevator (Yuck)
;    04-Sep-83  AJH  Made it respond to message 8 (just a stub)
;    08-Oct-83  AJH  Changed rounding to fix "off by 1" bug
;    10-Nov-83  AJH  Changed disabling -- don't fill with gray
;    11-Nov-83  AJH  Made it redraw all if disabled
;    27-Dec-83  AJH  Made min=max act disabled; added "254" hiliting
;    13-Apr-84  SC   Replaced _EraseRgn with _FillRgn,white
;
;----------------------------------------------------------------------------

                .INCLUDE  TlAsm/SYSEQU.TEXT
                .INCLUDE  TlAsm/SYSMACS.TEXT
                .INCLUDE  TlAsm/GRAFEQU.TEXT
                .INCLUDE  TlAsm/GRAFTYPES.TEXT
                .INCLUDE  TlAsm/TOOLEQU.TEXT
                .INCLUDE  TlAsm/RESEQU.TEXT
                .INCLUDE  TlAsm/QuickMacs.TEXT
                .INCLUDE  TlAsm/ToolMacs.TEXT
;
                .PROC     SDEF,0
;
; FUNCTION ScrollBarProc( theControl: ControlHandle;
;                         message:    INTEGER;
;                         param:      LongInt): LongInt;
;
;  Here is the dispatch table for the scrollBar definition procedure, which implements
;  semi-Lisa style scrollBar type controls for the Mac toolBox.  It shares a common
;  dispatcher with the pushButton proc (see above)
;
;
SavePen         .EQU    -20
IndicatorRect   .EQU    -30
;
                BRA.S    @0

                .WORD    0
                .ASCII   'CDEF'
                .WORD    1
                .WORD    1                      ;version #
@0
                LINK    A6,#-30                 ;set up a stack frame to address parameters
                MOVEM.L D3-D6/A1-A4,-(SP)       ;save work registers
;
; save the penState and set it our way
;
                PEA     SavePen(A6)             ;push pointer to savePenState
                _GetPenState                    ;remember current penState
                _PenNormal                      ;set the pen the way we want it
;
; fetch the parameters into registers
;
                LEA     8(A6),A0                ;get ptr to first parameter
                MOVE.L  (A0)+,D3                ;get param in D3
                MOVE.W  (A0)+,D0                ;get message
                MOVE.L  (A0)+,A3                ;get the control handle
                MOVE.W  (A0)+,D6                ;get selection index
                CLR.L   (A0)                    ;clear out function result
                MOVE.L  (A3),A0                 ;get control pointer in A0
;
; case out on the message number
;
                ADD     D0,D0                   ;double for word index
                LEA     GoScrollBar,A1          ;get table address
                ADD     0(A1,D0),A1             ;compute dispatch address
                JSR     (A1)                    ;dispatch to appropriate routine
;
; restore original pen state
;
                PEA     SavePen(A6)             ;push savePenState
                _SetPenState                    ;restore original pen state
;
; we're done -- restore registers and return to caller
;
                MOVEM.L (SP)+,D3-D6/A1-A4       ;restore work registers
                UNLK    A6                      ;unlink stack frame
TenBytExit      MOVE.L  (SP)+,A0                ;get return address
                ADD     #12,SP                  ;strip parameters
                JMP     (A0)                    ;return to caller

GoScrollBar
                .WORD   DrawSBar-GoScrollBar    ;draw is message 0
                .WORD   HitSBar-GoScrollBar     ;hit test is message 1
                .WORD   CalcSBar-GoScrollBar    ;calc regions is message 2
                .WORD   InitSBar-GoScrollBar    ;allocate indicator region (3)
                .WORD   DispSBar-GoScrollBar    ;de-allocate indicator region (4)
                .WORD   MoveSBar-GoScrollBar    ;message 5 is move indicator call (5)
                .WORD   ThumbSBar-GoScrollBar   ;message 6 is thumb dragging
                .WORD   StubSBar-GoScrollBar    ;no custom dragging (7)
                .WORD   StubSBar-GoScrollBar    ;no built-in action proc
;
;  16 wide by 16 high little bitMaps used for scrollBar arrows
;
;   (the comments as to which are left/right or up/down may lie)
;

;
; Left Arrow BitMap
;
LArrowData
                .WORD   $FFFF,$8081,$80C1,$80A1,$8F91,$8809,$8805,$8803
                .WORD   $8805,$8809,$8F91,$80A1,$80C1,$8081,$8001,$FFFF
LArrowMask
                .WORD   $FFFF,$8081,$80C1,$80E1,$8FF1,$8FF9,$8FFD,$8FFF
                .WORD   $8FFD,$8FF9,$8FF1,$80E1,$80C1,$8081,$8001,$FFFF

;
;  Right Arrow BitMap
;
RArrowData
                .WORD   $FFFF,$8101,$8301,$8501,$89F1,$9011,$A011,$C011
                .WORD   $A011,$9011,$89F1,$8501,$8301,$8101,$8001,$FFFF
RArrowMask
                .WORD   $FFFF,$8101,$8301,$8701,$8FF1,$9FF1,$BFF1,$FFF1
                .WORD   $BFF1,$9FF1,$8FF1,$8701,$8301,$8101,$8001,$FFFF

;
; Up Arrow BitMap
;
UArrowData
                .WORD   $FFFF,$8001,$8001,$8FE1,$8821,$8821,$8821,$F83D
                .WORD   $A009,$9011,$8821,$8441,$8281,$8101,$8001,$FFFF
UArrowMask
                .WORD   $FFFF,$8001,$8001,$8FE1,$8FE1,$8FE1,$8FE1,$FFFD
                .WORD   $BFF9,$9FF1,$8FE1,$87C1,$8381,$8101,$8001,$FFFF
;
; Down Arrow BitMap
;
DArrowData
                .WORD   $FFFF,$8001,$8101,$8281,$8441,$8821,$9011,$A009
                .WORD   $F83D,$8821,$8821,$8821,$8FE1,$8001,$8001,$FFFF
DArrowMask
                .WORD   $FFFF,$8001,$8101,$8381,$87C1,$8FE1,$9FF1,$BFF9
                .WORD   $FFFD,$8FE1,$8FE1,$8FE1,$8FE1,$8001,$8001,$FFFF
;
; DrawSBar draws a scroll bar as specified by the controlHandle in A3. D3 has the
; desired "hilite" area code.
;
DrawSBar
;
; Figure out if the scroll bar is horizontal or vertical and handle each
; case separately. see if its more horizontal or vertical -- A0 points to the
; rect to be tested.  D0 returns 0 to select vertical and two to select horizontal.
; After we know which axis, draw the arrows.
;
                TST.B   ContrlVis(A0)           ;is it visible?
                BEQ     StubSBar                ;if not, don't draw

; if it was disabled, draw the whole thing

                CMP.B   #$FF,D3                 ;disabled part code?
                BNE.S   @0                      ;if not, skip
                MOVEQ   #0,D3                   ;if so, draw all
@0
                MOVE.B  ContrlHilite(A0),D4     ;get current hilite in register
                BSR     GetTCtlRect             ;copy the control rect into tempRect
                BSR     TestHV                  ;get horizontal/vertical index in D0
;
; adjust for 1st arrow (if we're supposed to)
;
                MOVE.W  Top(A1,D0),D1           ;get vertical coordinate
                ADD     D2,D1                   ;compute bottom
                MOVE.W  D1,Bottom(A1,D0)        ;update bottom
                LEA     RArrowData,A1           ;point to right arrow bitMap
                MOVEQ   #inUpButton,D1          ;signal 1st arrow
;
                MOVEM   D0/D2,-(SP)             ;remember hv selector
;
                BSR.S   ShouldIDraw             ;test hilite to see if we should draw
                BNE.S   SkipUp
                BSR     DrawArrowBox            ;draw the arrow box
;
; now do the other arrow
;
SkipUp
                BSR     GetTCtlRect             ;copy bounding rect into tempRect
                MOVEM   (SP)+,D0/D2             ;restore hv selector
;
; adjust rect for 2nd arrow
;
                MOVE    Bottom(A1,D0),D1        ;get bottom coordinate
                SUB     D2,D1                   ;compute top
                MOVE    D1,Top(A1,D0)           ;adjust box top
                LEA     LArrowData,A1           ;point to 1st set of bitMaps
                MOVEQ   #inDownButton,D1        ;signal in 2nd arrow
;
                BSR.S   ShouldIDraw             ;dont't draw if we done have to
                BNE.S   SkipDown
                BSR     DrawArrowBox            ;draw the arrow box

;
; paint the body of the scrollBar light gray
;
SkipDown
;
                CMP     #1,D6                   ;flavor one has no grey
                BEQ     FrameCtl

                MOVE.W  #inThumb,D1             ;get thumb part code
                BSR.S   ShouldIDraw             ;draw it?
                BNE     FrameCtl                ;if not, skip

                ;CMP     #inThumb,D3             ;if we're just drawing, just remove it
                ;BEQ.S   GrayIndicator           ;dont do the whole rect

                BSR     GetTCtlRect             ;get control bounding rectangle
                MOVE.L  A1,-(SP)                ;push tempRect
                BSR     GetLtGray               ;get pointer to light gray pattern
                MOVE.L  A0,-(SP)                ;push it
;
                BSR.S   IsDisabled              ;is it disabled?
                BNE.S   @0                      ;if not, skip

                MOVE.L  (A5),A0                 ;get grafGlobals
                LEA     White(A0),A0            ;get address of white pattern
                MOVE.L  A0,(SP)                 ;use it
@0
                LEA     TempRect,A1             ;get tempRect pointer back
                MOVE.L  A1,A0                   ;put in A0 for TestHV
                BSR.S   TestHV                  ;get h/v index
                SWAP    D2                      ;get width in high part
                MOVE.W  #1,D2                   ;get 1 in low part
                TST.W   D0                      ;which dimension?
                BEQ.S   @1                      ;skip correction if vertical

                SWAP    D2
;
@1              MOVE.L  A1,-(SP)                ;push a pointer to the rectangle
                MOVE.L  D2,-(SP)                ;push inset factor
;
                _InsetRect                      ;inset it appropriately
                _FillRect                       ;paint the body gray
                BRA.S   DoIndicator             ;go plot the indicator
;
; Utility ShouldIDraw -- to test when to skip drawing a part of the scrollBar.
; On entry, D3 has parameter indicating part that needs drawing while D1 holds
; the part we are about to draw.  If D3 is zero, always draw it.  Otherwise,
; draw only if it matches.  Returning 0 in the Z-flag means you should draw
;
ShouldIDraw
                TST     D3                      ;examine the parameter
                BEQ.S   StubSBar                ;its zero so don't test further
                CMP     D1,D3                   ;the right part
StubSBar        RTS                             ;the z-flag has the answer

; IsDisabled is a utility to check to see if a scrollBar is disabled or not.
; It returns with the z-flag set if it is disabled

IsDisabled
                MOVE.L  (A3),A0                 ;get sBar pointer
                MOVE.B  ContrlHilite(A0),D0     ;get the hilite parameter

                ADDQ.B  #1,D0                   ;was it 255?
                BEQ.S   @0                      ;if so, its disabled
                ADDQ.B  #1,D0                   ;how about 254?
                BEQ.S   @0                      ;if so, its disabled also

                MOVE.W  ContrlMin(A0),D0        ;get the min
                CMP.W   ContrlMax(A0),D0        ;same as the max?
 @0
                RTS                             ;return to caller with z-flag result

;
;  We're just changing the indicator so gray it out.
;
;GrayIndicator
                ;BSR.S   IsDisabled
                ;BEQ.S   FrameCtl                ;if so, skip

                ;MOVE.L  ContrlData(A0),-(SP)    ;push handle to indicator region
                ;BSR     GetLtGray               ;get pointer to light gray
                ;MOVE.L  A0,-(SP)                ;push light gray
                ;_FillRgn                        ;erase the indicator
;
; Check the hilite state.  If the control is inactive (hilite = 255), don't draw
; the indicator at all.
;
DoIndicator
                BSR     CalcIBox                ;calculate the indicator box
                BSR.S   IsDisabled
                BEQ.S   FrameCtl                ;if so, skip

                MOVE.L  ContrlData(A0),-(SP)    ;push indicator region handle
                MOVE.L  (SP),-(SP)              ;we need it again
                MOVE.L  GrafGlobals(A5),A0      ; our erase rect
                PEA     white(A0)
                _FillRgn                        ;paint it white
                _FrameRgn                       ;and frame it
;
; frame the whole rect
;
FrameCtl
                MOVE.L  (A3),A0
                PEA     ContrlRect(A0)          ;push pointer to scrollBar rect
                _FrameRect                      ;frame it
;
; all done drawing the scroll bar
;
                RTS

;
; TestHV is a utility that determines if the rectangle pointed to by A0 is more horizontal
; or vertical.  Return 0 in D0 if its more vertical and 2 if its more horizontal.
; This routine trashes D1.  The result is also reflected in the condition code.
; It also returns the width/height of the minor dimension in D2.
;
TestHV
                MOVE    Bottom(A0),D0
                SUB     Top(A0),D0              ;get height
                MOVE    Right(A0),D1
                SUB     Left(A0),D1             ;get width

                CMP     D0,D1                   ;compare width and height
                BGT.S   @1                      ;branch it width is greater

                MOVE    D1,D2                   ;horizontal in D2
                MOVEQ   #0,D0                   ;signal its vertical
                RTS

@1              MOVE    D0,D2                   ;vertical in D2
                MOVEQ   #2,D0                   ;signal its horizontal
                RTS
;
;  DrawArrowBox is a routine that clears and frames an arrow box and then blits
;  across the appropriate arrow (looks at hilite state).  On entry, TempRect has the
;  box for the arrow, D0 has h/v selector, D1 has left/right selector,A1 points to the
;  arrow bitMap, A3 has the control handle.
;
DrawArrowBox
                MOVE.L  (A3),A0                 ;get the control pointer
                CMP.B   ContrlHilite(A0),D1     ;should it be hilited?
                BNE.S   @1                      ;if not, skip
                ADD     #32,A1                  ;if so, bump to hilite mask
;
; adjust bitMap for vertical or horizontal arrows
;
@1              TST     D0
                BNE.S   @2
                ADD     #128,A1                 ;bump to horizontal
;
; plot the arrow
;
@2              CLR     D0                      ;mode is srcCopy
                BSR.S   PlotSymbol              ;plot the bitmap in the tempRect box
;
; Now frame the box and we're done!
;
                PEA     TempRect                ;push the rectangle
                _FrameRect                      ;frame it and we're done
SBarStub
                RTS
;
;  PlotSymbol -- plot the little 16 by 16 symbol bitmap pointed to by A1 into the rectangle
;  pointed held in TempRect. D0 holds the mode.
;
PlotSymbol
                LEA     IconBitMap,A0           ;get pointer to source bitmap
                MOVE.L  A1,(A0)+                ;update base address of bitMap
                MOVE    #2,(A0)+                ;update rowBytes
                CLR.L   (A0)+                   ;topLeft is zero, zero
                MOVE.L  #$00100010,(A0)         ;adjust boundsRect
;
; push parameters for CopyBits call to transfer arrow bitMap
;
                PEA     IconBitMap              ;push pointer source bitmap
                MOVE.L  (SP),A0                 ;remember in A0, too
                MOVE.L  LGLOBALS(A5),A1         ;get lisaGraf global baseaddress
                MOVE.L  THEPORT(A1),A1          ;get thePort
                PEA     PORTBITS(A1)            ;that's the destination bitmap
;
                PEA     BOUNDS(A0)              ;boundsRect of bitmap is source
                PEA     TempRect                ;tempRect is the destination
                MOVE.W  D0,-(SP)                ;theMode is in D0
                CLR.L   -(SP)                   ;no mask region
;
; transfer the bitMap (stretching as necessary...)
;
                _CopyBits                       ;let Bill stretch those bits
                RTS                             ;return to caller
;
; CalcIBox is the crucial routine that computes the position of the top/left of the
; thumb by scaling the control's value according to its range and the screen area.
; Return the rectangle in IndicatorRect(A6).  It expects that A3 will hold the
; control handle as usual
;
CalcIBox
                MOVE    D3,-(SP)                ;preserve D3
                LEA     IndicatorRect(A6),A1    ;get address of indicator rectangle
                BSR.S   GetCtlRect              ;first set it to control bounding rect
;
                MOVEQ   #0,D1                   ;clear out high part of D1
                MOVE.L  (A3),A0                 ;get pointer to control
                LEA     ContrlRect(A0),A0       ;get pointer to the bounding rectangle
                BSR.S   TestHV                  ;get h/V selector index in D0
                MOVE    D2,D3                   ;keep minor dimension in D3
;
; compute control screen area in relevant dimension
;
                MOVE    Bottom(A0,D0),D1        ;get logical "bottom"
                SUB     Top(A0,D0),D1           ;compute "height"
                SUB     D2,D1                   ;discount arrow box
                SUB     D2,D1                   ;discount other one, too
                SUB     D2,D1                   ;and the indicator
;
; compute "screenSize times value"
;
                MOVE.L  (A3),A0                 ;get control pointer
                MOVE.W  ContrlValue(A0),D2      ;get current value
                SUB.W   ContrlMin(A0),D2        ;get delta from min
                MULU    D2,D1                   ;compute value*screensize
;
; compute size of logical space
;
                MOVE    ContrlMax(A0),D2        ;get max
                SUB     ContrlMin(A0),D2        ;compute size of space
                BEQ.S   Scale0                  ;dont divide by 0
;
; perform the scaling
;
                DIVU    D2,D1                   ;compute where iBox should go
                BSR     RoundOff                ;round off D1
                ADD     D3,D1                   ;skip over arrow box
;
; update indicator rect to correct position
;
UpdateIRect
                LEA     IndicatorRect(A6),A1    ;get pointer to rect
                ADD     Top(A1,D0),D1           ;compute the logical "top"
                MOVE    D1,Top(A1,D0)           ;update it
                ADD     D3,D1                   ;bump to "bottom"
                MOVE    D1,Bottom(A1,D0)        ;update "bottom"
;
                EOR     #2,D0                   ;flip to minor dimension
                ADDQ    #1,Top(A1,D0)           ;inset logical "left"
                SUBQ    #1,Bottom(A1,D0)        ;inset logical "right"
;
; set up the indicator region
;
                MOVE.L  ContrlData(A0),-(SP)    ;push indicator region handle
                MOVE.L  A1,-(SP)                ;push rect ptr
                _RectRgn                        ;make a rectangular region
;
CalcIDone       MOVE    (SP)+,D3                ;restore D3
                RTS
;
; if min = max, pin at top
;
Scale0          MOVE    D3,D1
                BRA.S   UpdateIRect
;
; GetCtlRect is a code saving utility that copies the bounding rectangle of the control
; whose handle is in A3 into the rectangle pointed to by A1.  This routine blows
; A0 but preserves A1. GetTCtlRect is an alternative entry used to save code
;
GetTCtlRect     LEA     TempRect,A1
GetCtlRect      MOVE.L  (A3),A0                 ;get pointer to control
                LEA     ContrlRect(A0),A0       ;get pointer to bounding rect
                MOVE.L  (A0),(A1)               ;copy topLeft
                MOVE.L  4(A0),4(A1)             ;copy botRight
NoSBarHit
                RTS
;
; HitSBar is the hit test routine for the scroll bar definition routine.  It classifies
; the position of the mouse passed in D3
;
HitSBar
                CMP.B   #254,ContrlHilite(A0)   ;254 hilited?
                BEQ.S   Return254

                BSR     IsDisabled              ;is it otherwise disabled?
                BEQ.S   NoSBarHit               ;if so, return 0

                LEA     ContrlRect(A0),A4       ;keep rect pointer in A4
                CLR.W   -(SP)                   ;make room for function result
                MOVE.L  D3,-(SP)                ;push the point
                MOVE.L  A4,-(SP)                ;push address of rect
                _PtInRect                       ;in the rectangle?
                TST.B   (SP)+                   ;examine result
                BEQ.S   NoSBarHit               ;if not, we're done
;
; its in the rect, so classify if in upButton,downButton,pageUp,pageDown or thumb
;
                BSR.S   NormalizePt             ;swap relevant coordinate into low part
;                                               ;and set up D0,D2
; see if its in the top button
;
@1              MOVE    D3,D1                   ;get copy of mousePoint
                SUB     0(A4,D0),D1             ;subtract rectangle top
                CMP     D2,D1                   ;is it within width of the top?
                BGT.S   @2                      ;it not, go check bottom
                MOVEQ   #inUpButton,D0          ;classify it
                BRA.S   UpdateResult            ;all done
;
; see if its in the bottom button
;
@2              MOVE    4(A4,D0),D1             ;get bottom
                SUB     D3,D1                   ;get distance from bottom
                CMP     D2,D1                   ;is it in it?
                BGT.S   CheckInd                ;if not, go check indicator
;
                MOVEQ   #inDownButton,D0
UpdateResult
                MOVE    D0,22(A6)               ;return result
                RTS
Return254
                MOVE    #254,D0
                BRA.S   UpdateResult
;
; its not in either button so it must be the thumb or one of the page areas.  Check
; for the thumb first
;
CheckInd
                CMP      #1,D6                  ; for flavor one don't test
                BEQ.S    NoSBarHit

                BSR     CalcIBox                ;calculate the indicator rectangle
                BSR.S   NormalizePt             ;restore back to normal point
                CLR.W   -(SP)                   ;make space for boolean result
                MOVE.L  D3,-(SP)                ;push the point
                MOVE.L  (A3),A0
                MOVE.L  ContrlData(A0),-(SP)    ;push the indicator region
                _PtInRgn                        ;is the mouse in the indicator?
                TST.B   (SP)+                   ;(..the suspense builds...)
                BEQ.S   CheckPage               ;branch if its not in the indicator
;
; its in the thumb so report that to the application
;
                MOVE    #inThumb,D0             ;get result
                BRA.S   UpdateResult            ;all done -- go update result

;
; it must be in one of the two page areas.  Determine which one by looking at the
; midPoint of the indicator's bounding rectangle.
;
CheckPage
                BSR.S   NormalizePt             ;normalize (get interesting low word)
                MOVE.L  (A3),A0                 ;get control pointer
                MOVE.L  ContrlData(A0),A0       ;get region handle
                MOVE.L  (A0),A0                 ;get region pointer
                LEA     RgnBBox(A0),A0          ;point to the region bounding box
;
; determine midpoint
;
                MOVE    Bottom(A0,D0),D1        ;get logical bottom
                SUB     Top(A0,D0),D1           ;get logical height
                LSR     #1,D1                   ;divide by 2
                ADD     Top(A0,D0),D1           ;add to get the midpoint
;
; at this point, D1 has the midpoint in the important dimension.  Compare with the
; mouse point to decide if its page up or down.
;
                CMP     D1,D3                   ;compare mousePt with midPoint
                BLT.S   PageItUp                ;if above its the logical "top"
                MOVEQ   #inPageDown,D0          ;set result code
                BRA.S   UpdateResult            ;all done -- go update result
PageItUp        MOVEQ   #inPageUp,D0            ;set result code
                BRA.S   updateResult            ;all done
;
; NormalizePt takes a rect pointer in A4 and a point in D3 and swaps the points
; coordinates according to the relevant dimensions
;
NormalizePt
                MOVE.L  A4,A0                   ;get rect pointer in A0
                BSR     TestHV                  ;get horizontal vertical offset
                BNE.S   @1                      ;if horizontal, skip
                SWAP    D3                      ;its vertical so get y in low part
@1              RTS                             ;all done

;
; CalcSBar returns the bounding region of the scroll bar.  D3 holds the region parameter.
; If the high bit of D3 is set, return the indicator region, other return the entire
; bounding region
;
CalcSBar
                TST.L   D3                      ;indicator or body?
                BMI.S   GetIndRgn               ;if negative, go get indicator
                MOVE.L  D3,-(SP)                ;push the region handle
                PEA     ContrlRect(A0)          ;push rectangle pointer
                _RectRgn                        ;return a rectangular region
                RTS                             ;all done!
;
; the indicator region was requested so copy the one in the dataHandle
;
GetIndRgn
                BSR     CalcIBox                ;calculate indicator region
                MOVE.L  (A3),A0                 ;get pointer to control
                MOVE.L  ContrlData(A0),-(SP)    ;push indicator region
                MOVE.L  D3,-(SP)                ;push result region
                CLR.B   (SP)                    ;clear out high byte
                _CopyRgn                        ;clone the region
;
; set the pattern for dragging
;
                BSR.S   GetLtGray               ;get pointer to light gray
                MOVE.L  (A0)+,DragPattern       ;update the drag pattern
                MOVE.L  (A0),DragPattern+4      ;update the drag pattern
                RTS
;
; GetLtGray is a short utility that get a pointer to a lightGray pattern from
; the resource manager.
;
GetLtGray
               SUBQ     #4,SP                   ;make room for result
               MOVE.W   #SBarPatID,-(SP)        ;push resource ID
               _GetPattern                      ;get the pattern
               MOVE.L    (SP)+,A0               ;get pattern handle
               MOVE.L    (A0),A0                ;get pattern ptr
               RTS

;
;  handle the "position yourself" message by calling figuring out the new value and
;  calling SetCtlValue.  D3 holds the amount to move by.
;
MoveSBar
                MOVE.L  ContrlData(A0),A0       ;get handle of indicator region
                MOVE.L  (A0),A0                 ;get a pointer to it
                LEA     RgnBBox(A0),A4          ;get pointer to the bounding rect
;
; figure out new position by adding topLeft of current position to offset
;
                ADD     Left(A4),D3             ;add the x coordinates
                SWAP    D3                      ;get y in low word
                ADD     Top(A4),D3              ;add the y coordinates
;
; select the relevant dimension and get it into the low word of D3
;
                MOVE.L  (A3),A0                 ;get the control pointer
                LEA     ContrlRect(A0),A0       ;get the bounding rectangle
                BSR     TestHV                  ;get h/v index
                BEQ.S   @1                      ;if its y, we're cool
                SWAP    D3                      ;get x into D3
;
; determine amount of screen area devoted to the scrollBar
;
@1              SUB     Top(A0,D0),D3           ;make size ctl-relative
                SUB     D2,D3                   ;subtract arrow offset
;
                MOVE    Bottom(A0,D0),D1        ;get logical bottom
                SUB     Top(A0,D0),D1           ;compute logical height

                SUB     D2,D1                   ;compute active area
                SUB     D2,D1
                SUB     D2,D1
                MOVE    D1,D2                   ;get answer in D2
;
; compute range of logical values: controlMax - controlMin
;
                MOVE.L  (A3),A0                 ;get control pointer
                MOVE    ContrlMax(A0),D1        ;get max value
                SUB     ContrlMin(A0),D1        ;compute range
;
; compute position*logical range/physical range
;
                MULU    D3,D1                   ;D3 has current position
                DIVU    D2,D1                   ;divide by physical range
                BSR.S   RoundOff                ;round to nearest integer
;
; at this point D1 has the value so set it, after offsetting by the minimum
;
                ADD.W   ContrlMin(A0),D1        ;offset by minimum
                MOVE.L  A3,-(SP)                ;push control handle
                MOVE.W  D1,-(SP)                ;push the new value
                _SetCtlValue                    ;go set the new value
                RTS                             ;all done!
;
; InitSBar gets called when the scroll bar is allocated.  It allocates an empty region
; to use as the indicator region
;
InitSBar        SUBQ    #4,SP
                _NewRgn                         ;get a new region on the stack top
                MOVE.L  (A3),A0                 ;get control pointer
                MOVE.L  (SP)+,ContrlData(A0)    ;remember new region in control data
                RTS
;
; DispSBar de-allocates the region used for the indicator
;
DispSBar        MOVE.L  ContrlData(A0),A0       ;get handle of indicator region
                _DisposHandle                   ;dispose of it
                RTS
;
; Utility RoundOff -- RoundOff the number in D1 to the nearest integer.  The remainder
; from dividing by D2 is in the high part of the word.
;
RoundOff        MOVE.W  D0,-(SP)                ;preserve D0
                MOVE    D2,D0                   ;get old divisor
                LSR     #1,D0                   ;divide by 2
                SWAP    D1                      ;get remainder
                CMP     D0,D1                   ;compare remainder with 1/2 divisor
                BLE.S   TruncateIt              ;if smaller, we're done
                SWAP    D1                      ;get normal D1 back
                ADDQ    #1,D1                   ;round up
;
RoundDone
                MOVE.W  (SP)+,D0                ;restore D0
                RTS
;
;  no need to round up so just truncate it
;
TruncateIt
                SWAP    D1                      ;restore quotient
                BRA.S   RoundDone               ;all done with roundOff

;
; ThumbSBar receives the "drag thumb message for the scroll bar.  On entry, D3 points
; to a structure that contains the starting point, it returns with pointers to
; the bounds and slopRect and the axis parameter
;
; Local Variable Equates
;
BRect           .EQU    0                     ;boundsRect
SRect           .EQU    8                     ;slopRect
TAxis           .EQU    16                     ;axis
;
ThumbSBar
                MOVE.L  D3,A4                   ;keep pointer to parameter block
                MOVE.L  (A4),D3                 ;get the mouse point
;
                LEA     BRect(A4),A2            ;get pointer to boundsRect
                MOVE.L  A2,A1                   ;get pointer in A1
                BSR     GetCtlRect              ;copy control bounds rect
;
                MOVE.L  A2,A0                   ;point to boundsRect
                BSR     TestHV                  ;get h/v selector in D0
                MOVE    D2,-(SP)                ;preserve D2
                SWAP    D2
                MOVE.W  #$FFE8,D2               ;get inset factor (24 pixels hyst)
                MOVE    D0,D4                   ;keep selector in D4
                BEQ.S   @1                      ;if vertical, we're cool
                SWAP    D2                      ;adjust inset factor
                BRA.S   @2
;
@1              SWAP    D3                      ;adjust mouse pt
;
@2              MOVE.L  A2,-(SP)                ;push pointer to rectangle
                MOVE.L  D2,-(SP)                ;push inset factor
                _InsetRect                      ;go inset it
;
; build the slopRect by insetting the boundsRect
;
                LEA     SRect(A4),A0            ;get slopRect pointer
                MOVE.L  (A4),(A0)               ;copy boundsRect into slopRect
                MOVE.L  4(A4),4(A0)             ;copy botRight, too
;
                MOVE.L  #$FF800000,D0           ;get inset factor (assume vertical)
                TST     D4                      ;which dimension
                BEQ.S   @3                      ;if vertical, we're cool
                SWAP    D0
;
@3              MOVE.L  A0,-(SP)                ;push slopRect pointer
                MOVE.L  D0,-(SP)                ;push inset factor
                _InsetRect                      ;inset it
;
; now further adjust the boundsRect depending where the mousePt is relative to the
; indicator box.
;
                MOVE.L  (A3),A0                 ;get control pointer
                MOVE.L  ContrlData(A0),A0       ;get region handle
                MOVE.L  (A0),A0                 ;get region pointer
                SUB     RgnBBox(A0,D4),D3       ;subtract relevant coordinate
                ADD     D3,Top(A2,D4)           ;offset logical top
;
; fix up logical bottom, too
;
                MOVE    (SP)+,D2                ;get back D2
                SUBQ    #1,D2
                SUB     D2,Bottom(A2,D4)
                ADD     D3,Bottom(A2,D4)        ;subtract (15-number) from bottom
;
; now set up axis parameter
;
                LSR     #1,D4                   ;divide by 2
                EOR     #1,D4                   ;flip the sense
                ADDQ    #1,D4                   ;add increment
                MOVE    D4,TAxis(A4)            ;to derive axis parameter
                RTS


               .END
      sumacc/ws/defprocs/wdef   444      0     12       75450  3472707171  10452 W^5P:H r^&47!7!N^;
;File wProcAsm.TEXT
;--------------------------------------------------------------------------
;
;  Window Definition Routine for the
;       MacIntosh Window Manager
;
;  written by Andy Hertzfeld  Aug 4, 1982
;
;  (c) 1982 by Apple Computer, Inc.  All rights reserved.
;
;    This file contains the window definition procedure
;  "DocumentProc", the standard Mac window type.  It is
;  a rectangular window with a title bar.  It is assembled
;  part of the window manager.
;
;  Modification History:
;
;    21-Aug-82  AJH  Made DocumentProc support rectangular windows only
;    30-Aug-82  AJH  Added growIcon hit detection, fixed hit to exclude perimeter drag
;    07-Sep-82  AJH  Added handler for grow message
;    12-Sep-82  AJH  Made it so proc doesn't have to calcRgns when not visible
;    20-Sep-82  AJH  Added go-away button drawing and hit-testing
;    25-Sep-82  AJH  Added cheap dialogBox window definition proc
;    28-Sep-82  AJH  New GoAway button; restructured goAway drawing
;    05-Oct-82  AJH  Removed Init message to save code
;    06-Oct-82  AJH  Fixed dialogBox dragRgn bug
;    10-Oct-82  AJH  Converted to QuickDraw trap interface
;    16-Oct-82  AJH  Fixed GoAway hit-test origin bug
;    17-OCt-82  AJH  Made both windowProcs preserve A1
;    07-Nov-82  AJH  Changed DocumentProc hiliting to Lisa way
;    14-Nov-82  AJH  Improved shape of Grow outline ala Lisa
;    16-Nov-82  AJH  Made branch table offset-based to save space
;    16-Nov-82  AJH  Special-cased hiliting of small windows
;    20-Dec-82  AJH  Changed title bar to 20 pixels tall
;    24-Dec-82  AJH  Made wProcAsm a separate assembly
;    17-Mar-83  AJH  Added third variant -- shadowless dBoxProc
;    27-Apr-83  AJH  only plot, hit-test goAway if window is active
;    25-Jul-83  SC   Fixed third variant -- frame was incorrect, see DrawDBox
;    06-Aug-83  AJH  changed hiliting to use pattern
;    09-Aug-83  AJH  added draw grow icon message receiver
;    20-Aug-83  AJH  made it only hit-test or draws goAway if window is active
;    29-Oct-83  AJH  new dBox border
;    10-Nov-83  AJH  added variant 4 -- just like variant 0, but no inGrow
;    24-Dec-83  AJH  fixed structRgn calc bug in variant 1
;    24-Feb-84  AJH  fixed hit-testing of go-away -- was off by 2
;
;----------------------------------------------------------------------------

                .INCLUDE  TlAsm/SYSEQU.TEXT
                .INCLUDE  TlAsm/SYSMACS.TEXT
                .INCLUDE  TlAsm/GRAFEQU.TEXT
                .INCLUDE  TlAsm/GRAFTYPES.TEXT
                .INCLUDE  TlAsm/TOOLEQU.TEXT
                .INCLUDE  TlAsm/QuickMacs.TEXT
                .INCLUDE  TlAsm/ToolMacs.TEXT
;
                .PROC     WDEF,0

;
;  FUNCTION   DocumentProc(selector: INTEGER;
;                          window: WindowPtr,
;                          message: INTEGER;
;                          parameter: LongInt): LongInt
;
DocumentProc
                BRA.S   DP1
;
; standard header
;
                .WORD   0                       ;flags word
                .ASCII  'WDEF'                  ;resource type
                .WORD   0                       ;resource ID
                .WORD   2                       ;version number

DP1
                LINK    A6,#0                   ;set up a stack frame to address parameters
                MOVEM.L D3-D6/A1/A3-A4,-(SP)    ;save work registers
;
; fetch the parameters into registers
;
                LEA     8(A6),A0                ;get ptr to first parameter
                MOVE.L  (A0)+,D3                ;get param in D3
                MOVE.W  (A0)+,D0                ;get message
                MOVE.L  (A0)+,A3                ;get the window pointer
                MOVE.W  (A0)+,D5                ;get the selector integer
                MOVE    D5,D6                   ;keep copy in D6
                AND     #3,D5                   ;ignore "inGrow" variant
                CLR.L   (A0)                    ;clear out function result
;
; case out on the message number
;
                ADD     D0,D0                   ;double for word index
                LEA     GoDocProc,A0            ;get jump table address
                ADD.W   GODOCPROC(D0),A0        ;compute dispatch address
                JSR     (A0)
;
; we're done -- restore registers and return to caller
;
                MOVEM.L (SP)+,D3-D6/A1/A3-A4    ;restore work registers
                UNLK    A6                      ;unlink stack frame
                MOVE.L  (SP)+,A0                ;get return address
                ADD     #12,SP                  ;strip parameters
                JMP     (A0)                    ;return to caller
;
; DocumentProc dispatch table -- entries must be long branches!
;
GODOCPROC
                .WORD   DrawDoc-GoDocProc       ;draw is message 0
                .WORD   HitDoc-GoDocProc        ;hit test is message 1
                .WORD   CalcDoc-GoDocProc       ;calc test is message 2
                .WORD   DoneDoc-GoDocProc       ;it doesn't need init
                .WORD   DoneDoc-GoDocProc       ;it doesn't need dispose
                .WORD   GrowDoc-GoDocProc       ;grow message is #5
                .WORD   DrawGIcon-GoDocProc     ;draw grow icon is #6
;
;  DrawDoc -- draw the document window.   The windowPtr is in A3
;
DrawDoc
                TST.B   WVISIBLE(A3)             ;is it visible?
                BEQ     DoneDoc                  ;if not, don't do anything
;
; see if its a EORGoAway call and special case it
;
                CMP     #wInGoAway,D3            ;is it a goAway call?
                BEQ     EorGoAway                ;if so, go handle it
;
                _PenNormal                       ;we want the normal pen
                TST.W   D5                       ;test dialogBox flag
                BNE     DrawDBox                 ;dBox window has no title bar
;
; derive the titleBar rectangle from the structRgn and keep it in TempRect
;
                BSR     BuildTBarRect
;
; draw the title bar
;
                PEA     TEMPRECT                ;tempRect bounds the title bar
                MOVE.L  (SP),-(SP)              ;make another copy of tempRect pointer
                MOVE.L  (SP),-(SP)              ;and yet another
                _FrameRect                      ;frame the title bar
                MOVE.L  OneOne,-(SP)            ;push inset factor
                _InsetRect
                _EraseRect                      ;clear the inside
;
; hilite the title bar by filling it with specified pattern
;
CheckHilite
                TST.B   WHILITED(A3)            ;is it hilited?
                BEQ.S   DrawTheTitle            ;if not, just draw the title

                PEA     TEMPRECT                ;push the title rect
                MOVE.L  (SP),-(SP)              ;push a second copy

                MOVE.L  #$00030001,-(SP)
                _InsetRect                      ;inset it some

                MOVE.L  (A5),A0                 ;get grafGlobals
                MOVE.L  TempRect,D0             ;get topLeft
                AND.L   #$00070007,D0           ;only use mod 8
                MOVE.L  D0,PatAlign(A0)         ;get up patAlign

                PEA     HilitePattern           ;push the pattern address
                _FillRect                       ;fill the titleBar with the pattern
;
                MOVE.L  (A5),A0
                CLR.L   PatAlign(A0)
DrawTheTitle
                BSR     DoTitleString           ;draw the centered Title
;
; plot the goAway button, if necessary
;
                TST.B   WGoAway(A3)             ;is the a goaway button?
                BEQ.S   DrawBody                ;if not, skip
;
                TST.B   WHilited(A3)            ;only plot goAway if hilited
                BEQ.S   DrawBody                ;if not, don't plot goAway

                BSR     BuildTBarRect
                LEA     GoAwayData,A1           ;get the goAway symbol
                MOVEQ   #srcCopy,D1             ;plot in srcCopy mode
                BSR     PlotGoAway
DrawBody
                MOVE.L  OneOne,D4               ;constant for shadowing
;
; frame the body of the window
;
DrawFrame
                MOVE.L  STRUCTRGN(A3),A0        ;get region handle
                MOVE.L  (A0),A0                 ;get region ptr
                LEA     RGNBBOX(A0),A4          ;point A4 at the bounding box
                SUB     D4,Bottom(A4)           ;inset the bottom (ignore shadow)
                SUB     D4,Right(A4)            ;inset the right to ignore shadow
                MOVE.L  A4,-(SP)                ;push bounding box
                _FrameRect                      ;frame the body
;
; draw the drop shadow (for variant 0 and 3)
;
                CMP     #3,D5                   ;variant 3?
                BEQ.S   @3                      ;if so, paint it

                TST.W   D5                      ;variant 0?
                BNE.S   @1                      ;if not, skip
@3
                BSR     PaintDropShadow         ;paint the drop shadow
;
; draw fancy for dialog box ( only for variant 1)
;
@1
                CMP     #1,D5                   ;dialog box?
                BNE.S   @2                      ;if not, skip

                MOVE.L  (A4),TempRect           ;copy bounds into tempRect
                MOVE.L  4(A4),TempRect+4

                PEA     TempRect
                MOVE.L  (SP),-(SP)              ;copy it
                MOVE.L  (SP),-(SP)
                MOVE.L  OneOne,-(SP)
                _InsetRect                      ;inset it

                MOVE.L  #$000A000A,-(SP)        ;set pen size
                _PenSize
                MOVE.L  (A5),A0
                PEA     White(A0)
                _PenPat
                _FrameRect

                MOVE.L  (A5),A0
                PEA     Black(A0)
                _PenPat

                MOVE.L  #$00020002,-(SP)        ;push inset factor
                MOVE.L  #$00020002,-(SP)        ;push new pen size
                _PenSize                        ;set new pen size
                _InsetRect
                PEA     TempRect
                _FrameRect                      ;and frame it

                _PenNormal

@2              ADD     D4,Bottom(A4)
                ADD     D4,Right(A4)
DoneDoc
                RTS

HilitePattern
                .WORD   $FF00,$FF00,$FF00,$FF00
;
; BuildTBarRect builds a rectangle enclosing the titleBar in TempRect
;
BuildTBarRect
                LEA     TEMPRECT,A0             ;get pointer to tempRect
                MOVE.L  STRUCTRGN(A3),A1        ;get structure region handle
                MOVE.L  (A1),A1                 ;get strucRgn pointer
                ADDQ    #RGNBBOX,A1             ;point A1 at the bounding box
                MOVE.L  (A1)+,(A0)              ;copy bounding box into tempRect
                MOVE.L  (A1),4(A0)
;
;  make bottom := top + 19
;
                MOVE    Top(A0),D0              ;get top
                ADD     #19,D0                  ;compute top+19
                MOVE    D0,Bottom(A0)           ;update bottom
                SUBQ    #1,Right(A0)            ;inset right
                RTS                             ;return to caller
;
; EORGoAway hilites/unhilites the goAway button.  It falls through into PlotGoAway
;
EorGoAway
                BSR.S   BuildTBarRect           ;build the bounding rect
                LEA     GoAwayData,A1           ;get the bitMap
                ADD.W   #32,A1                  ;bump to the EOR Mask
                MOVEQ   #2,D1                   ;set EOR as the plot mode
;
; PlotGoAway plots the goAway button.  A1 holds the symbol, D1 the plotting mode
;
PlotGoAway
                LEA     TempRect,A0             ;get pointer to tempRect
                MOVE    Left(A0),D0             ;get left edge
                ADDQ    #7,D0                   ;leave some margin
                MOVE    D0,Left(A0)             ;update left
                ADD     #16,D0
                MOVE    D0,Right(A0)            ;update right
;
                MOVE    D1,D0                   ;set plotting mode
                ADDQ    #2,TempRect+Top
                SUBQ    #1,TempRect+Bottom
                MOVE.L  #$00100010,D1
                BSR     PlotSymbol              ;plot it in tempRect
                BSR.S   BuildTBarRect           ;rebuild tempRect
                RTS

;
; DialogBoxes have no title bar and extra shadow
;
DrawDBox
                MOVE.L  #$00020002,D4           ;get shadow factor
                CMP.W   #3,D5                   ;does it have shadow?
                BEQ.S   DrawFrame               ;if so, we're cool
                MOVEQ   #0,D4                   ;otherwise no shadow
                BRA.S   DrawFrame               ;go draw it
;
; DoTitleString is the common code that draws the title centered in tempRect.  Warning --
; it trashes D3.
;
DoTitleString
                BSR     BuildTBarRect           ;calculate title bar rect
;
; compute indent factor based on GoAwayButton state
;
@1              MOVE.W  TempRect+Right,D3       ;get right
                SUB.W   TempRect+Left,D3        ;compute width
;
                SUB.W   WTITLEWIDTH(A3),D3      ;compute extra x
                ASR.W   #1,D3                   ;divide by 2
;
; if there's a goAway button, make sure the margin is at least 32pixels
;
                TST.B   WGoAway(A3)             ;is there a go away button
                BEQ.S   @2                      ;skip if there's not
                TST     D3                      ;is it negative?
                BMI.S   @3                      ;if so, pin at 32
                CMP.W   #32,D3                  ;if goAway button, must have some margin
                BGT.S   @2
@3              MOVEQ   #32,D3
;
@2              ADD     TempRect+Left,D3        ;compute x position
                MOVE.W  D3,-(SP)                ;and push for MoveTo
;
                MOVE    TempRect+Bottom,-(SP)   ;push bottom
                SUBQ    #5,(SP)                 ;leave room for descenders
                _MoveTo

; clear it out if it was hilited

                TST.B   WHilited(A3)            ;was it hilited?
                BEQ.S   @4                      ;if not, skip

                SUBQ    #6,D3                   ;indent to the left
                MOVE    D3,TempRect+Left
                ADD.W   WTitleWidth(A3),D3      ;add in the length
                ADD     #12,D3                  ;indent on right
                MOVE    D3,TempRect+Right
                SUBQ    #2,TempRect+Bottom      ;protect bottom line (in business)
                PEA     TempRect
                _EraseRect                      ;erase it
;
; draw the string
;
@4
                MOVE.L  WTITLEHANDLE(A3),A0     ;get titleHandle
                MOVE.L  (A0),-(SP)              ;push title pointer
                _DrawString                     ;draw it
;
DoneDString
                RTS                             ;all done drawing title...

;
; BitMap for default GoAway button
;
GoAwayData
                .WORD   $0000,$0000,$BFFB,$2008
                .WORD   $A00B,$2008,$A00B,$2008
                .WORD   $A00B,$2008,$A00B,$2008
                .WORD   $BFFB,$0000,$0000,$0000

;  Mask for goAway button
;
                ;.WORD   $0000,$0000,$FFF4,$4110
                ;.WORD   $C934,$4550,$C014,$5C60
                ;.WORD   $C014,$4550,$C934,$4110
                ;.WORD   $FFF4,$0000,$0000,$0000

;                .WORD   $0000,$0000,$0000,$0118
;                .WORD   $093C,$0558,$001C,$1C68
;                .WORD   $001C,$0558,$093C,$0118
;                .WORD   $0000,$0000,$0000,$0000

                .WORD   $0000,$0000,$0000,$0100
                .WORD   $0920,$0540,$0000,$1C70
                .WORD   $0000,$0540,$0920,$0100
                .WORD   $0000,$0000,$0000,$0000

;
;
; HitDoc -- perform a hit test on the document.  On entry, D3 contains the mousePoint
; in global coordinates while A3 holds the window pointer
;
HitDoc
                MOVEQ   #16,D4                  ;keep 16 in a register to save code
                CLR.W   -(SP)                   ;make room for function result
                MOVE.L  D3,-(SP)                ;push the mouse point
                MOVE.L  CONTRGN(A3),-(SP)       ;push content region handle
                _PtInRgn                        ;is the point in the content region?
                TST.B   (SP)+                   ;well, is it?
                BEQ.S   NotInContent            ;if not, go check out drag region
;
; its in the content region -- see if its in the grow icon area
;
                TST.W   D5                      ;is it a dialogBox?
                BNE.S   justContent             ;if so, its only in the content
                SUBQ    #3,D6                   ;inGrow enabled?
                BGT.S   justContent             ;if not, skip

                TST.B   WHilited(A3)            ;is it active?
                BEQ.S   justContent             ;if not, it cant be in grow
;
                MOVE.L  ContRgn(A3),A0          ;get region handle
                MOVE.L  (A0),A0                 ;get region ptr
                MOVE.L  RgnBBox+botRight(A0),D0 ;get bottom left of content
;
; first consider the x coordinate
;
                SUB     D4,D0                   ;offset x by 16
                CMP     D0,D3                   ;if <, just in content
                BLT.S   justContent
;
; its within range on x so try y
;
                SWAP    D0
                SUB     D4,D0                   ;check out y dimension
                SWAP    D3
                CMP     D0,D3                   ;compare y coordinates
                BLT.S   justContent
;
                MOVEQ   #wInGrow,D0             ;flag in grow Icon
                BRA.S   DoneHitDoc
;
; the point is in the content region so return a '1'
;
justContent
                MOVEQ   #wInContent,D0          ;return in content
                BRA.S   DoneHitDoc              ;go store function result and return
;
; its not in the content -- see if its in the dragRgn (content extended by titleBar)
;
NotInContent
;
                TST     D5                      ;is it a dialogBox?
                BNE.S   DoneHit1                ;dBoxes have no drag region
;
                CLR.W   -(SP)                   ;make room for function result
                MOVE.L  D3,-(SP)                ;push the mouse point
                MOVE.L  ContRgn(A3),A4          ;get content region handle
                MOVE.L  (A4),A4                 ;get region ptr
                ADDQ    #RgnBBox,A4             ;get bounding box ptr
                SUB     #19,Top(A4)             ;make it 19 higher
                MOVE.L  A4,-(SP)                ;push the rect
                _PtInRect                       ;is the point in the title bar?
                ADD     #19,Top(A4)             ;fix up content bounds
;
                TST.B   (SP)+                   ;examine result
                BEQ.S   DoneHit1                ;if not, return 0 (do nothing)
;
; see if its in leftmost 16 of drag, which is the goAway button
;
                TST.B   WHilited(A3)            ;is it hilited?
                BEQ.S   ItsInDrag               ;if not, can't be in GoAway

                TST.B   WGoAway(A3)             ;is there a goAway button?
                BEQ.S   ItsInDrag               ;if not, skip
                MOVE    D3,D0                   ;get mousePt
                ADD     PortBounds+Left(A3),D0  ;convert to local
                SUB     PortRect+Left(A3),D0    ;compensate for origin
                CMP     #18,D0                  ;is it too far right?
                BGT.S   ItsInDrag               ;if so, its in drag
                SUBQ    #8,D0                   ;it must be at least 6
                BMI.S   ItsInDrag
;
; its in the goAway button so signal it
;
                MOVEQ   #wInGoAway,D0
                BRA.S   DoneHitDoc
;
ItsInDrag
                MOVEQ   #wInDrag,D0             ;flag in drag region
DoneHitDoc
                MOVE.L  D0,20(A6)               ;update function result
DoneHit1        RTS

;
; CalcDoc  -- calculate the structure and content regions for the window pointed
; to by A3.
;
CalcDoc
                LEA     TEMPRECT,A0             ;get a pointer to the work rectangle
                MOVE.L  A0,-(SP)                ;push for later offset
                MOVE.L  PORTRECT(A3),(A0)+      ;copy topLeft of portRect
                MOVE.L  PORTRECT+4(A3),(A0)     ;copy botLeft of portRect
;
; offset it to global coordinates
;
                MOVE.L  PORTBOUNDS(A3),-(SP)    ;push topLeft of port.portBits.bounds
                NEG     0(SP)                   ;negate offset
                NEG     2(SP)                   ;both words
                _OffsetRect                     ;offset tempRect to global coordinates
;
;  make the rectangular content region
;
                MOVE.L  CONTRGN(A3),-(SP)       ;content region gets the esult
                PEA     TempRect                ;tempRect is the rectangle
                _RectRgn                        ;go make the region into content region
;
; now do the structure region.  First correct the bounding rectangle (tempRect) for
; structure instead of content
;
                MOVE.L  #$00020002,D4           ;get the shadow factor for DBox
                MOVE.L  STRUCTRGN(A3),-(SP)     ;push the structRgn for later
                PEA     TEMPRECT                ;push a pointer to the rect
                MOVE.L  (SP),-(SP)              ;make two copies
                MOVE.L  MinusOne,-(SP)          ;make 1 pixel bigger, all around
                _InsetRect                      ;make it bigger

                TST.W   D5                      ;is it dBox?
                BNE.S   DoDBoxCalc              ;skip if it is

                SUB     #18,TempRect+Top        ;make top 18 pixels higher
                LSR.L   #1,D4                   ;adjust shadow factor
CalcCommon
                _RectRgn                        ;RectRgn(structRgn,tempRect)
;
; now add in the 1 or 2 pixel drop shadow (if necessary)
;
                TST     D5
                BEQ.S   @1                      ;if so, it has shadow

                CMP     #3,D5                   ;is it variant 3?
                BNE.S   NoDropShadow            ;if not, no shadow
@1
                CLR.L   -(SP)                   ;make space for result
                _NewRgn                         ;allocate new region

                MOVE.L  (SP),A4                 ;remember it
                PEA     TempRect                ;push tempRect
                MOVE.L  (SP),-(SP)              ;save another copy
                MOVE.L  D4,-(SP)                ;push shadow factor
                _OffsetRect                     ;offset it
                _RectRgn
;
                MOVE.L  StructRgn(A3),-(SP)
                MOVE.L  A4,-(SP)                ;offset region
                MOVE.L  StructRgn(A3),-(SP)     ;structure gets the result
                _UnionRgn                       ;add it in
;
                MOVE.L  A4,-(SP)                ;we're done with it so
                _DisposRgn                      ;dispose of it
;
; all done with CalcDocRgns
;
NoDropShadow
                RTS

DoDBoxCalc
                CMP     #1,D5                   ;is it variant 1?
                BNE.S   CalcCommon

                PEA     TempRect                ;push our rectangle
                MOVE.L  #$FFF9FFF9,-(SP)        ;push (-7,-7)
                _InsetRect                      ;inset it
                BRA.S   CalcCommon              ;use common code for the rest

;
; GrowDoc handles the grow message by drawing a grow outline based on the rectangle
; passed in D3
;
GrowDoc
;
; first make it one pixel bigger to jibe with the structure
;
                MOVE.L  D3,-(SP)                ;push the rect
                MOVE.L  MinusOne,-(SP)          ;push (-1,-1)
                _InsetRect
                MOVE.L  D3,A0                   ;get rect ptr
                SUB     #18,Top(A0)             ;make it higher
;
                MOVE.L  D3,-(SP)                ;push the rectangle
                _FrameRect                      ;frame it
                MOVE.L  D3,A3                   ;keep rectangle pointer in A-reg
;
;  now that the rectangle is drawn, draw the lower horizontal line
;
                MOVE.W  Left(A3),-(SP)          ;push left
                MOVE.W  (SP),-(SP)              ;save for upper line
                MOVE.W  Bottom(A3),-(SP)        ;push bottom
                SUB     #16,(SP)                ;really 16 pixels above bottom
                MOVE.L  (SP),-(SP)              ;make a copy of this point
                _MoveTo                         ;move to it
                MOVE.W  Right(A3),2(SP)         ;now go to the right edge
                _LineTo                         ;draw the horizontal line
;
; draw the upper horizontal line
;
                MOVE.W  Top(A3),-(SP)           ;push top
                ADD     #18,(SP)                ;really 18 pixels below top
                MOVE.L  (SP),-(SP)              ;make a copy of this point
                _MoveTo                         ;move to it
                MOVE.W  Right(A3),2(SP)         ;now go to the right edge
                _LineTo                         ;draw the horizontal line
;
; draw the vertical line
;
                MOVE.W  Right(A3),-(SP)         ;push right
                SUB     #16,(SP)                ;really want right - 16
                MOVE.W  Top(A3),-(SP)           ;push top
                ADD     #18,(SP)                ;really want top + 18
                MOVE.L  (SP),-(SP)              ;make a copy of this point
                _MoveTo                         ;and move to it
                MOVE.W  Bottom(A3),(SP)         ;now go to bottom edge
                _LineTo                         ;draw the vertical line
;
; restore the rect back to how it was when we got it
;
                MOVE.L  D3,-(SP)                ;push the rect
                MOVE.L  OneOne,-(SP)            ;push (1,1)
                _InsetRect
                MOVE.L  D3,A0                   ;get it in an A-reg
                ADD     #18,Top(A0)             ;fix up the top
;
                RTS                             ;all done!
;
;  Utility PaintDropShadow -- drop shadows the rectangle in A4, by the amount in D4
;
PaintDropShadow
                MOVE.L  D4,-(SP)                ;push shadow factor
                _PenSize                        ;make penSize = shadow factor
;
                MOVE    RIGHT(A4),D0            ;get right of menuRect
                MOVE    D0,-(SP)                ;push right
                MOVE    TOP(A4),-(SP)           ;push top
                ADD     D4,(SP)                 ;want top+shadow
                MOVE    D0,-(SP)                ;push right
                MOVE    BOTTOM(A4),D0           ;get bottom
                MOVE    D0,-(SP)                ;push bottom
                MOVE    LEFT(A4),-(SP)          ;push left
                ADD     D4,(SP)                 ;want left+shadow
                MOVE    D0,-(SP)                ;push bottom
;
                _MoveTo                         ;MoveTo(left+shadow,bottom)
                _LineTo                         ;LineTo(right,bottom)
                _LineTo                         ;LineTo(right,top+shadow)
;
                _PenNormal                      ;restore normal pen
                RTS

;
;  PlotSymbol -- plot the little 16 by 16 symbol bitmap pointed to by A1 into the rectangle
;  pointed held in TempRect. D0 holds the mode.
;
PlotSymbol
                LEA     IconBitMap,A0           ;get pointer to source bitmap
                MOVE.L  A1,(A0)+                ;update base address of bitMap
                MOVE    #2,(A0)+                ;update rowBytes
                CLR.L   (A0)+                   ;topLeft is zero, zero
                MOVE.L  D1,(A0)                 ;adjust boundsRect
;
; push parameters for CopyBits call to transfer arrow bitMap
;
                PEA     IconBitMap              ;push pointer source bitmap
                MOVE.L  (SP),A0                 ;remember in A0, too
                MOVE.L  LGLOBALS(A5),A1         ;get lisaGraf global baseaddress
                MOVE.L  THEPORT(A1),A1          ;get thePort
                PEA     PORTBITS(A1)            ;that's the destination bitmap
;
                PEA     BOUNDS(A0)              ;boundsRect of bitmap is source
                PEA     TempRect                ;tempRect is the destination
                MOVE.W  D0,-(SP)                ;theMode is in D0
                CLR.L   -(SP)                   ;no mask region
;
; transfer the bitMap (stretching as necessary...)
;
                _CopyBits                       ;let Bill stretch those bits

                RTS                             ;return to caller


;  Draw the grow icon.  First make this window the current grafPort

DrawGIcon
                MOVE.L  A3,-(SP)                ;push it
                _SetPort                        ;make that the port
;
;  compute the grow icon rectangle in tempRect
;
                LEA     TempRect,A4             ;get pointer to tempRect
                MOVE.L  PortRect+4(A3),4(A4)    ;copy in botRight of tempRect
                MOVE.L  4(A4),(A4)              ;into the topLeft, too
                SUB.W   #15, Top(A4)            ;subtract from Top
                SUB.W   #15,Left(A4)            ;and left, too
;
; plot the grow icon
;
                TST.B   WHilited(A3)            ;is it hilited?
                BEQ.S   ClearGoAway             ;if not, go clear it

                LEA     GrowBits,A1             ;get pointer to the bits
                MOVEQ   #0,D0                   ;use srcCopy
                MOVE.L  #$00100010,D1
                BSR     PlotSymbol              ;plot it
;
; plot the  boundary lines
;
PlotBoundary
                MOVE.W  Left(A4),-(SP)          ;push tempRect.left
                MOVE.W  (SP),-(SP)              ;copy it again for later
                MOVE    PortRect+Top(A3),-(SP)  ;push portRect.top
                _MoveTo                         ;move to it
                MOVE    PortRect+Bottom(A3),-(SP) ;push portRect.bottom
                _LineTo                         ;draw the vertical line
;
; now draw the horizontal line
;
                MOVE.W  PortRect+Left(A3),-(SP) ;push portRect.left
                MOVE.W  Top(A4),-(SP)           ;push tempRect.top
                _MoveTo
                MOVE.W  PortRect+right(A3),-(SP) ;push portRect.right
                MOVE.W  Top(A4),-(SP)           ;push tempRect.top
                _LineTo
;
; all done with DrawDocGrow
;
DoneDDG
                RTS
ClearGoAway
                PEA     TempRect
                _EraseRect
                BRA.S   PlotBoundary

;
; BitMap for GrowIcon
;
GrowBits
                .WORD   $0000,$0000,$0000,$1FE0
                .WORD   $1020,$103E,$1022,$1022
                .WORD   $1022,$1022,$1FE2,$0402
                .WORD   $0402,$0402,$07FE,$0000

                ;.WORD   $0000,$0000,$3E00,$2200
                ;.WORD   $2FC0,$2840,$3840,$09FC
                ;.WORD   $0904,$0F04,$0104,$0104
                ;.WORD   $0104,$01FC,$0000,$0000
;

                .END

                _LineTo                         ;LineTo(right,bottom)
                _LineTo                         ;LineTo(right,top+shadow)
;
                _PenNormal                      ;restore normal pen
  sumacc/ws/example/   775      0     12           0  3472707176   7321 sumacc/ws/example/adeskacc   444      0     12       47445  3472707171  11114 W^5P-H r H r^BBF;----------------------------------------------------------------
;  Example desk accessory
;
;  Desk Accessory for displaying the heap.
;  Written by Jerome Coonen  29 July 83.
;  Based on the great-great-grandson of the canonical
;  Papa Hertzfeld ornament.
;
;    Modification History:
;
;-----------------------------------------------------------------

                .INCLUDE        tlasm/SYSEQU.TEXT
                .INCLUDE        tlasm/GRAFEQU.TEXT
                .INCLUDE        tlasm/SYSMACS.TEXT
                .INCLUDE        tlasm/GrafTypes.Text
                .INCLUDE        tlasm/ToolEqu.Text
                .INCLUDE        tlasm/QuickMacs.TEXT
                .INCLUDE        tlasm/ToolMacs.Text
                .INCLUDE        tlasm/ResEqu.Text
                .INCLUDE        tlasm/HeapDefs.Text

                .PROC           Uriah

cMenuID         .EQU    -666    ; a random resource ID
cSizeRecord     .EQU    100     ; random size of ornament storage
cMenuHandle     .EQU    0       ; offset in orn storage for menu handle
cUseHeap        .EQU    4       ; set to heap to display
cAutoUpdate     .EQU    8       ; boolean -- update every 10 seconds?


OrnEntry
                .WORD           $2400           ; ctl-enable = needsTime
                .WORD           300             ; take a hit every 5 seconds
                .WORD           $0002           ; mouse down
                .WORD           cMenuID         ;

; Entry point offset table

                .WORD   OrnOpen   - OrnEntry    ; open routine
                .WORD   OrnDone   - OrnEntry    ; prime
                .WORD   OrnCtl    - OrnEntry    ; control
                .WORD   OrnDone   - OrnEntry    ; status
                .WORD   OrnClose  - OrnEntry    ; close


OrnTitle        .BYTE   11                      ; length of string
                .ASCII  'Uriah Heap '           ; title

; Open Routine -- allocate a window, initialize the count, allocate menu

OrnOpen
                MOVEM.L A3-A4,-(SP)             ;preserve regs
                MOVE.L  A1,A4                   ;keep DCE ptr in A4

                TST.L   DCtlWindow(A1)          ;already have a window?
                BNE     GotAWindow              ;if so, don't make a new one
;
; now allocate the new window
;
                CLR.L   -(SP)                   ; make room for the result
                CLR.L   -(SP)                   ; allocate on heap
                PEA     cBounds                 ; push the boundsRect
                PEA     OrnTitle                ; push the title
                CLR.L   -(SP)                   ; invisible/use defProc 0
                MOVEQ   #-1,D0                  ; get -1
                MOVE.L  D0,-(SP)                ; behind = -1
                MOVE    #$0100,-(SP)            ; yes, we have a goAway
                CLR.L   -(SP)                   ; refCon is zero
                _NewWindow                      ; allocate a new window
                MOVE.L  (SP)+,A0                ; get the windowPtr
                MOVE.L  A0,DCtlWindow(A4)       ; save in the DCE
                MOVE    DCtlRefNum(A4),windowKind(A0) ; mark as system window
;
; Font stuff, as though we were going to write in the window.
;
                MOVE    #4,TxFont(A0)           ; use Gacha
                MOVE    #10,TxSize(A0)          ; size 10
                MOVE    #srcCopy,TxMode(A0)
;
; Get a relocatable block for static values.
;
                MOVE.L  #cSizeRecord,D0         ; Get the local storage
                _NewHandle
                MOVE.L  A0,DCtlStorage(A4)      ; save the storage handle away
;
; Allocate the menu.  Initialize the check-off menu items.
;
                SUBQ    #4,SP                   ; make room for menu handle
                MOVE.W  #cMenuID,-(SP)          ; push menu ID
                PEA     cMenuTitle              ; Allocate the menu
                _NewMenu
                MOVE.L  (SP)+,A2                ; save menu handle in temp.

                MOVE.L  DCtlStorage(A4),A3      ; Get the storage handle
                MOVE.L  (A3),A3                 ; dereference it

                MOVE.L  A2,cMenuHandle(A3)      ; salt menu handle away in storage
                MOVE.L  ApplZone,cUseHeap(A3)   ; set so application heap shown
                MOVE.B  #$01,cAutoUpdate(A3)    ; do automatic updating

                MOVE.L  A2,-(SP)
                PEA     cMenuItems              ; Set the items
                _AppendMenu

                MOVE.L  A2,-(SP)                ; get the menu handle
                MOVE    #2,-(SP)                ; application heap
                MOVE.B  #1,-(SP)                ; push the boolean
                _CheckItem

                MOVE.L  A2,-(SP)                ; get the menu handle
                MOVE    #4,-(SP)                ; auto update
                MOVE.B  #1,-(SP)                ; push the boolean
                _CheckItem
GotAWindow
                MOVEM.L  (SP)+,A3-A4            ;restore regs
OrnDone
                MOVEQ   #0,D0                   ;no error
                RTS                             ;all done with open
;
; Close Routine -- to close the ornament, we dispose the window and menu
;
OrnClose
                MOVE.L  A4,-(SP)                ; save A4
                MOVE.L  A1,A4                   ; save A1=DCE from Pascal routine
                MOVE.L  DCtlWindow(A4),-(SP)    ; push the window
                CLR.L   DCtlWindow(A4)          ; we no longer have a window
                _DisposWindow                   ; dispose it

                BSR     CloseStorage            ; allocate the menu, etc.

                MOVE.L  DCtlStorage(A4),A0      ; Delete the storage area
                _DisposHandle

                MOVE.L  (SP)+,A4                ; restore sole saved register
                BRA.S   OrnDone                 ; all done with close

; OrnCtl handles the control messages, which are the heart of the driver.  We case out on
; the "opCode" field, which is 64 for "SendEvent", 65 for "Run", 66 for "Cursor",
; and 67 for "Menu".  Ignore messages less than 64 or greater than 67.

OrnCtl
                MOVEM.L A2-A4,-(SP)             ; preserve A3 and A4
                MOVE.L  A1,A4                   ; keep DCE ptr in A4
                MOVE    CSCode(A0),D0           ; get the control opCode
                SUB     #64,D0                  ; compare message with 64
                BMI.S   CtlDone                 ; < 64 -- just ignore
                BEQ     DoCtlEvent              ; = 64 --  it's an event
                SUBQ.W  #2,D0                   ; compare message with 66
                BMI.S   DoRun                   ; = 65 -- run request
                BEQ     DoCtlCursor             ; = 66 -- cursor
                SUBQ.W  #1,D0                   ; compare message with 67
                BEQ.S   DoMenu                  ; = 67 -- menu request
                BRA.S   CtlDone                 ; > 67 -- ignore

;------------------------------------------------
;
DoRun
                MOVE.L      DCtlStorage(A4),A3  ; get the heap
                MOVE.L      (A3),A3             ; dereference it
                TST.B       cAutoUpdate(A3)
                BEQ.S       @1

                BSR     DrawWindow              ; then fall through...
@1

;------------------------------------------------
;
CtlDone
                MOVE.L  A4,A1                   ; return DCE ptr to A1
                MOVEM.L  (SP)+,A2-A4            ; A3 and A4
                MOVEQ   #0,D0                   ; no error
                RTS                             ; bye-bye

;------------------------------------------------
;
DoMenu
                MOVE.L  DCtlStorage(A4),A3      ; get orn storage handle
                MOVE.L  (A3),A3                 ; dereference it

                MOVE    CSParam+2(A0),D0        ; Get the menuItem

                SUBQ    #1,D0                   ; See if item 1
                BEQ.S   SetSysHeap
                SUBQ    #1,D0                   ; See if item 2
                BEQ.S   SetAppHeap
                SUBQ.W  #2,D0                   ; Can't be 3
                BEQ.S   SetAutoUpdate
                SUBQ.W  #1,D0
                BEQ.S   HandUpdate
                BRA.S   CtlDone

SetSysHeap
                MOVE.L  SysZone,cUseHeap(A3)     ; set so sys heap shown
                MOVE.B  #00,D0                   ; not the application
                BRA.S   ToggleHeap

SetAppHeap
                MOVE.L  ApplZone,cUseHeap(A3)    ; set so application heap shown
                MOVE.B  #01,D0                   ; the application

ToggleHeap
                MOVE.B  D0,-(SP)
                MOVE.B  #2,D1
                BSR.S   MarkIt
                MOVE.B  (SP)+,D0
                EOR.B   #01,D0                   ; flip it
                MOVE.B  #1,D1                    ;
                BSR.S   MarkIt
;
; Erase the display window before drawing other window.
;
                MOVEA.L DCtlWindow(A4),A0       ; get port
                PEA     portRect(A0)            ; push rect for EraseRect
                PEA     (A0)                    ; push the window for SetPort
                _SetPort                        ; make it the port
                _EraseRect
                BSR     DrawWindow

                BRA.S   CtlDone

;------------------------------------------------
; D0 contains boolean true or false
; D1 contains item number
; A3 contains local storage
;
markIt
                MOVE.L  cMenuHandle(A3),-(SP)   ; get the menu handle
                MOVE    D1,-(SP)                ; push the item
                MOVE.B  D0,-(SP)                ; push the boolean
                _CheckItem
                RTS

;-------------------------------------------------
; Flip auto-update boolean
;
SetAutoUpdate
                MOVE.B      cAutoUpdate(A3),D0  ; get auto flag
                EORI.B      #1,D0               ; toggle it
                MOVE.B      D0,cAutoUpdate(A3)  ; replace

;-------------------------------------------------
; Common menu update code
;
MarkMenu
            MOVE.W          CSParam+2(A0),D1    ; item number
            BSR.S           MarkIt
            BRA.S           CtlDone

;-------------------------------------------------
; Just redraw the window
;
HandUpdate
                BSR     DrawWindow
                BRA.S   CtlDone
;
; DoCtlCursor might be used to change the cursor shape when over our window
; and back to the arrow when it's not.
;
DoCtlCursor
                BRA.S   CtlDone                 ;all done
;
; DoCtlEvent handles the events received by the memWindow ornament.  It handles
; mouse down, keyDown and update events
;
DoCtlEvent
                MOVE.L  A3,-(SP)                ;save registers
                MOVE.L  CSParam(A0),A3          ;get the event pointer
                MOVE.W  EvtNum(A3),D0           ;get the event number

; case out on the event number.  We handle events 1 (mouse down), and
; 6 (update event),

                CMP     #8,D0                   ;is it an activate?
                BEQ     DoTheActivate           ;if so, go handle it

                SUBQ    #1,D0                   ;is it mouse down?
                BEQ.S   ItsMouseDown            ;branch if it is
                SUBQ    #2,D0                   ;is it key down?
                BEQ.S   ItsKeyDown              ;branch to handle keyDown
                SUBQ    #3,D0                   ;is it an update?
                BEQ.S   ItsUpdate               ;if so, handle it

; its not an event we handle so ignore it

CtlEvtDone      MOVE.L  (SP)+,A3                ;restore registers
                BRA     CtlDone

; ignore keyDowns for now

ItsKeyDown
                BRA.S   CtlEvtDone              ;all done

; handle the update event by redrawing the contents of the window

ItsUpdate
                MOVE.L  EvtMessage(A3),-(SP)    ;push the window ptr
                MOVE.L  (SP),-(SP)              ;push it again
                _BeginUpdate                    ;set vis to update
                BSR     DrawWindow              ;draw it
                _EndUpdate
                BRA.S   CtlEvtDone

; handle the mouseDown by calling FindControl and tracking the control if its in one

ItsMouseDown
                BRA     CtlEvtDone              ;all done!

; DoTheActivate either puts shows or hides the scroll bar, depending on
; the state of the activate bit.

DoTheActivate
                BTST    #0,EvtMeta+1(A3)        ; activate or de-activate?
                BEQ.S   TakeItDown              ; if deactivate, take it down

; show the menu

                MOVE.L  DCtlStorage(A4),A3      ; Insert the menu item
                MOVE.L  (A3),A3                 ; dereference it
                MOVE.L  cMenuHandle(A3),-(SP)   ;
                CLR.W   -(SP)                   ; on the end
                _InsertMenu
                _DrawMenuBar                    ; Display it

                BRA     CtlEvtDone              ; all done
;
; hide the menu
;
TakeItDown
                MOVE.W  #cMenuID,-(SP)          ; Delete the menu from bar
                _DeleteMenu
                _DrawMenuBar                    ; Redisplay it

                BRA     CtlEvtDone
;
; CloseStorage deallocates the menu and sets up local memory
;
CloseStorage
                MOVE.W  #cMenuID,-(SP)          ; Delete the menu from bar
                _DeleteMenu
                _DrawMenuBar                    ; Redisplay it

                MOVE.L  DCtlStorage(A4),A0      ; Delete the menu data
                MOVE.L  (A0),A0
                MOVE.L  cMenuHandle(A0),A0      ; get handle in A0
                _DisposHandle

                RTS
;
; DrawWindow scans the heap and redraws the window.
;
DrawWindow
            MOVEM.L D3-D6/A2-A3,-(SP)           ; save work regs

            MOVE.L  DCtlWindow(A4),-(SP)        ; push the window ptr twice for
            MOVE.L  (SP),-(SP)                  ; SizeWindow and setport
;
; Initialize the topLeft pointer (D6) to 0,0.
; Then work down and to the right.
;
            MOVEQ       #0,D6

            MOVE.L      DCtlStorage(A4),A3      ; get the heap
            MOVE.L      (A3),A3                 ; dereference it

            MOVE.L      cUseHeap(A3),A3         ; get zone ptr
;
; Size the window by computing the heap extent and dividing by 260 to get
; the number of columns of pixels.  Force width up to a multiple of 8 and
; require a minimum.
;
            LEA         HeapData(A3),A1         ; ptr to first block
            MOVE.L      A1,D1
            MOVE.L      BkLim(A3),D0            ; ptr beyond last usable block
            AND.L       maskBC,D1
            AND.L       maskBC,D0
            SUB.L       D1,D0                   ; size of heap in bytes
            DIVU        #260,D0                 ; number of pixel columns

            LSR.L       #3,D0                   ; divide by eight...
            ADDQ.L      #1,D0                   ; round up...
            LSL.L       #3,D0                   ; and multiply by eight

            CMPI.W      #152,D0                 ; a reasonable minimum
            BHS.S       @2
            MOVE.W      #152,D0
@2
            MOVE.W      D0,-(SP)                ; width
            MOVE.W      #260,-(SP)              ; fixed height
            MOVE.B      #0,-(SP)                ; FALSE, no update
            _SizeWindow

            _SetPort                            ; make it the port
            LEA         HeapData(A3),A0         ; ptr to first block, for loop
Continue
;
; Compute the next pointer right away.  For the purposes of displaying even
; blocks of 8 bytes, round the first pointer down to nearest 8-byte block.
;
            MOVE.L      tagBC(A0),D0            ; size/tag
            MOVE.L      handle(A0),D1           ; handle
            MOVE.L      D0,D2
            ANDI.L      #BCMask,D0              ; block size in bytes
            MOVEA.L     D0,A2
            ADDA.L      A0,A2                   ; ptr to next block

            MOVE.L      A0,D0
            ANDI.L      #$FFFFFFF8,D0           ; kill low 3 bits
            SUB.L       A2,D0
            NEG.L       D0
            LSR.L       #3,D0                   ; number of indicator lines

;
; Now set up the pen pattern in A0 for call to display routine.
;
            MOVEA.L     0(A5),A1               ; get global ptr for graphics
            LEA         white(A1),A0           ; pen pattern for nonrelocatable
            AND.L       #TagMask,D2
            BEQ.S       FreeBlock
            BGT.S       GotBlock
;
; Classify the relocatable blocks as
;   (1) unlocked and not purged
;   (2) locked
;   (3) purged
;
            LEA         dkGray(A1),A0           ; assume (1) unlk and not prgbl
            MOVE.B      0(A3,D1),D1             ; master ptr, if relocatable
            BMI.S       LockedBlock
            ADD.B       D1,D1                   ; get purgeable bit in sign
            BPL.S       GotBlock

            LEA         PurgeablePat,A0         ; purgeable relocatable
            BRA.S       GotBlock
LockedBlock
            LEA         ltGray(A1),A0           ; locked relocatable block
            BRA.S       GotBlock
FreeBlock
            LEA         black(A1),A0            ; free block
GotBlock
            BSR.S       ShowLines

            MOVEA.L     A2,A0                   ; get next block pointer
            CMP.L       bkLim(A3),A0            ; see if at end
            BNE         Continue

            MOVEM.L     (SP)+,D3-D6/A2-A3
            RTS

;------------------------------------------------
; Display D0.W lines of pattern (A0)
; D6 is the current topLeft pointer, which is updated
; after each block is displayed.
;
ShowLines
            MOVE.W      D0,D3                   ; safe place for index
            PEA         (A0)
            _PenPat                             ; pen pattern for PaintRect
ShQuickEntry
            MOVE.L      D6,D0                   ; top/left
            MOVE.L      D6,D1                   ; will be bottom/right
            ADDQ.W      #8,D1                   ; right := left + 8
            SWAP        D1                      ; align bottom in low word
            ADD.W       D3,D1                   ; tentative bottom
            CMPI.W      #260,D1                 ; farther down than 260?
            BHS.S       ShTwoBlocks

            SWAP        D1                      ; align bottom/right
            MOVE.L      D1,D6                   ; new top/left
            SUBQ.W      #8,D6                   ; convert top/right to top/left
            BRA.S       PaintTheRect            ; Easy case -- paint and go
;
; If there is a spillover, just paint the rest of this column
; and fake another call to routine.
;
ShTwoBlocks
            SUBI.W      #260,D1                 ; what's left after this column
            MOVE.W      D1,D3                   ; the next count
            MOVE.W      #260,D1                 ; set bottom to the real bottom
            SWAP        D1                      ; align bottom/right
            MOVEQ       #0,D6                   ; next top will be zero
            MOVE.W      D1,D6                   ; this right will be next left
            BSR.S       PaintTheRect
            BRA.S       ShQuickEntry

;------------------------------------------------
; D0 = top/left
; D1 = bottom/right
;
PaintTheRect
            MOVEM.L     D0-D1,-(SP)             ; push rect value
            PEA         (SP)
            _PaintRect
            ADDQ.L      #8,SP                   ; kill rect value
            RTS

FreePat         .WORD   $FFFF, $FFFF, $FFFF, $FFFF
RelPat          .WORD   $AAAA, $AAAA, $AAAA, $AAAA
NonRelPat       .WORD   $0000, $0000, $0000, $0000
PurgeablePat    .WORD   $E7E7, $E7E7, $E7E7, $E7E7
LockedPat       .WORD   $BDBD, $BDBD, $BDBD, $BDBD

cMenuTitle      .BYTE   6
                .ASCII  'Uriah '
cMenuItems      .BYTE   52
                .ASCII  'System;Application;-------'    ; 26 each
                .ASCII  ';Auto-Refresh;Hand-Refresh'

cBounds         .WORD   42,0,302,200

                .END

   MOVE.L      A0,D0
            ANDI.L      #$FFFFFFF8,D0           ; kill low 3 bits
            SUB.L       A2,D0
            NEG.L       D0
            LSR.L       #3,D0                   ; number of indicator linessumacc/ws/example/adeskaccr   444      0     12         443  3472707171  11221 3. "6F^5D!$^DDF*example/adeskaccr.text --- resource definition file for adeskacc
*To create and install this desk accessory, exec the file example/execdeskacc,
*then use Resource Mover to copy & paste DRVR resource into system

example/adeskacc.rsrc

type DRVR
   example/adeskacc!Uriah,25

Block
            BGT.S       GotBlock
;
; Classify the relocatable blocks as
;   (1) unlocked and not purged
;   (2) locked
;   (3) purged
;
            LEA         dkGray(A1),A0           ; assume (1) unlk and not prgblsumacc/ws/example/boxes   444      0     12       15100  3472707171  10455 5
^;{$X-}
PROGRAM Boxes;

   USES {$U-}
      {$U obj/Memtypes   } Memtypes,
      {$U obj/QuickDraw  } QuickDraw,
      {$U obj/OSIntf     } OSIntf,
      {$U obj/ToolIntf   } ToolIntf,
      {$U obj/Sane       } Sane,
      {$U obj/Elems      } Elems,
      {$U obj/Graf3D     } Graf3D;

   CONST
      boxCount = 15;

   TYPE
      Box3D = RECORD
                 pt1: Point3D;
                 pt2: Point3D;
                 dist: extended;
              END;

   VAR
      myPort: GrafPtr;
      myPort3D: Port3DPtr;
      boxArray: ARRAY [0..boxCount] OF Box3D;
      nBoxes: INTEGER;
      i: INTEGER;
      etop,ebottom,eleft,eright,temp: extended;

   PROCEDURE Distance(pt1,pt2: Point3D; VAR result: extended);

      VAR
         dx,dy,dz: extended;

      BEGIN
         dx := pt2.X; { dx:=pt2.X - pt1.X; }
         SubX(pt1.X,dx);

         dy := pt2.Y; { dy:=pt2.Y - pt1.Y; }
         SubX(pt1.Y,dy);

         dz := pt2.Z; { dz:=pt2.Z - pt1.Z; }
         SubX(pt1.Z,dz);

         MulX(dx,dx); { result:=SQRT(dx*dx + dy*dy + dz*dz); }
         MulX(dy,dy);
         MulX(dz,dz);
         AddX(dx,dy);
         AddX(dy,dz);
         SqrtX(dz);
         result := dz
      END;

   PROCEDURE DrawBrick(pt1,pt2: Point3D);
   { draws a 3D brick with shaded faces. }
   { only shades correctly in one direction }

      VAR
         tempRgn: RgnHandle;

      BEGIN
         tempRgn := NewRgn;
         OpenRgn;
         MoveTo3D(pt1.X,pt1.Y,pt1.Z); { front face, y=y1 }
         LineTo3D(pt1.X,pt1.Y,pt2.Z);
         LineTo3D(pt2.X,pt1.Y,pt2.Z);
         LineTo3D(pt2.X,pt1.Y,pt1.Z);
         LineTo3D(pt1.X,pt1.Y,pt1.Z);
         CloseRgn(tempRgn);
         FillRgn(tempRgn,white);

         OpenRgn;
         MoveTo3D(pt1.X,pt1.Y,pt2.Z); { top face, z=z2 }
         LineTo3D(pt1.X,pt2.Y,pt2.Z);
         LineTo3D(pt2.X,pt2.Y,pt2.Z);
         LineTo3D(pt2.X,pt1.Y,pt2.Z);
         LineTo3D(pt1.X,pt1.Y,pt2.Z);
         CloseRgn(tempRgn);
         FillRgn(tempRgn,gray);

         OpenRgn;
         MoveTo3D(pt2.X,pt1.Y,pt1.Z); { right face, x=x2 }
         LineTo3D(pt2.X,pt1.Y,pt2.Z);
         LineTo3D(pt2.X,pt2.Y,pt2.Z);
         LineTo3D(pt2.X,pt2.Y,pt1.Z);
         LineTo3D(pt2.X,pt1.Y,pt1.Z);
         CloseRgn(tempRgn);
         FillRgn(tempRgn,black);

         PenPat(white);
         MoveTo3D(pt2.X,pt2.Y,pt2.Z); { outline right }
         LineTo3D(pt2.X,pt2.Y,pt1.Z);
         LineTo3D(pt2.X,pt1.Y,pt1.Z);
         PenNormal;

         DisposeRgn(tempRgn);
      END;

   PROCEDURE MakeBox;

      VAR
         myBox: Box3D;
         i,j,h,v: INTEGER;
         p1,p2: Point3D;
         myRect: Rect;
         testRect: Rect;
         temp: extended;

      BEGIN
         I2X(Random,p1.X); {p1.x:=Random mod 70 -15;}
         I2X(140,temp);
         RemX(temp,p1.X,i);
         I2X(15,temp);
         SubX(temp,p1.X);

         I2X(Random,p1.Y); {p1.y:=Random mod 70 -10;}
         I2X(140,temp);
         RemX(temp,p1.Y,i);
         I2X(10,temp);
         SubX(temp,p1.Y);

         I2X(0,p1.Z); {p1.z:=0.0;}

         I2X(Random,p2.X); {p2.x:=p1.x + 10 + ABS(Random) MOD 30; }
         I2X(60,temp);
         RemX(temp,p2.X,i);
         AbsX(p2.X);
         I2X(10,temp);
         AddX(temp,p2.X);
         AddX(p1.X,p2.X);

         I2X(Random,p2.Y); {p2.y:=p1.y + 10 + ABS(Random) MOD 45; }
         I2X(90,temp);
         RemX(temp,p2.Y,i);
         AbsX(p2.Y);
         I2X(10,temp);
         AddX(temp,p2.Y);
         AddX(p1.Y,p2.Y);

         I2X(Random,p2.Z); {p2.z:=p1.z + 10 + ABS(Random) MOD 35; }
         I2X(70,temp);
         RemX(temp,p2.Z,i);
         AbsX(p2.Z);
         I2X(10,temp);
         AddX(temp,p2.Z);
         AddX(p1.Z,p2.Z);

         { reject box if it intersects one already in list }
         WITH myRect DO
            BEGIN {
                 SetRect(myRect,ROUND(p1.x),ROUND(p1.y),ROUND(p2.x),ROUND(p2.y));
                   }
            X2I(p1.X,left);
            X2I(p1.Y,top);
            X2I(p2.X,right);
            X2I(p2.Y,bottom)
            END;
         FOR i := 0 TO nBoxes-1 DO
            BEGIN
            WITH boxArray[i],testRect DO
               BEGIN { SetRect(myRect,ROUND(pt1.x),ROUND(pt1.y) }
               X2I(pt1.X,left); { ,ROUND(pt2.x),ROUND(pt2.y)); }
               X2I(pt1.Y,top);
               X2I(pt2.X,right);
               X2I(pt2.Y,bottom)
               END;
            IF SectRect(myRect,testRect,testRect) THEN EXIT(MakeBox)
            END;

         myBox.pt1 := p1;
         myBox.pt2 := p2;

         { calc midpoint of box and its distance from the eye }

         AddX(p2.X,p1.X); { p1.x:=(p1.x + p2.x)/2.0; }
         I2X(2,temp);
         DivX(temp,p1.X);

         AddX(p2.Y,p1.Y); { p1.y:=(p1.y + p2.y)/2.0; }
         I2X(2,temp);
         DivX(temp,p1.Y);

         AddX(p2.Z,p1.Z); { p1.z:=(p1.z + p2.z)/2.0; }
         I2X(2,temp);
         DivX(temp,p1.Z);

         Transform(p1,p2);
         Distance(p2,myPort3D^.eye,myBox.dist); { distance to eye }

         i := 0;

         boxArray[nBoxes].dist := myBox.dist; { sentinel }

         WHILE CmpX(myBox.dist,GT,boxArray[i].dist) { myBox.dist >
                                                     boxArray[i].dist }
               DO
            i := i+1; { insert in order of dist }
         FOR j := nBoxes DOWNTO i+1 DO boxArray[j] := boxArray[j-1];
         boxArray[i] := myBox;
         nBoxes := nBoxes+1;
      END;

   BEGIN { main program }

      InitGraf(@thePort);

      HideCursor;
      NEW(myPort); OpenPort(myPort);
      NEW(myPort3D); Open3DPort(myPort3D);

      ViewPort(myPort^.portRect); { put the image in this rect }
      I2X(-100,eleft);
      I2X(75,etop);
      I2X(100,eright);
      I2X(-75,ebottom);
      LookAt(eleft,etop,eright,ebottom); { aim the camera into 3D space }
      I2X(30,temp);
      ViewAngle(temp); { choose lens focal length }
      Identity;
      I2X(20,temp);
      Roll(temp);
      I2X(70,temp);
      Pitch(temp); { roll and pitch the plane }

      REPEAT

         nBoxes := 0;
         REPEAT
            MakeBox
         UNTIL nBoxes=boxCount;

         PenPat(white);
         BackPat(black);
         EraseRect(myPort^.portRect);

         FOR i := -10 TO 10 DO
            BEGIN
            I2X(i*10,eleft);
            I2X(-100,etop);
            I2X(0,temp);
            MoveTo3D(eleft,etop,temp);
            I2X(100,ebottom);
            LineTo3D(eleft,ebottom,temp);
            END;

         FOR i := -10 TO 10 DO
            BEGIN
            I2X(i*10,eleft);
            MoveTo3D(etop,eleft,temp);
            LineTo3D(ebottom,eleft,temp);
            END;

         FOR i := nBoxes-1 DOWNTO 0 DO DrawBrick(boxArray[i].pt1,boxArray[i].pt2);

      UNTIL button
   END.
         testRect: Rect;
         temp: extended;

      BEGIN
         I2X(Random,p1.X); {p1.x:=Random mod 70 -15;}
         I2X(140,temp);
         RemX(temp,p1.X,i);
         I2X(15,temp);
         SubX(temp,p1.X);

         I2X(Random,p1.Y); {p1.y:=Random mod 70 -10;}
         I2X(140,temp);
         RemX(temp,p1.Y,i);
         I2X(10,temp);
         SubX(temp,p1.Y);

         I2X(0,p1.Z); {p1.z:=0.0;}

         I2X(Random,p2.X); {p2.x:=p1.sumacc/ws/example/boxesr   444      0     12          77  3472707172  10567 3. "6F^5D!$^


uexample/boxes.rsrc

Type CODE
example/boxesl,0

         testRect: Rect;
         temp: extended;

      BEGIN
         I2X(Random,p1.X); {p1.x:=Random mod 70 -15;}
         I2X(140,temp);
         RemX(temp,p1.X,i);
         I2X(15,temp);
         SubX(temp,p1.X);

         I2X(Random,p1.Y); {p1.y:=Random mod 70 -10;}
         I2X(140,temp);
         RemX(temp,p1.Y,i);
         I2X(10,temp);
         SubX(temp,p1.Y);

         I2X(0,p1.Z); {p1.z:=0.0;}

         I2X(Random,p2.X); {p2.x:=p1.sumacc/ws/example/boxesx   444      0     12         614  3472707172  10612 3. "6F^5D!$^
$EXEC
PExample/boxes


g$M+
Example/boxes

l?
+X

Example/boxes
obj/macpaslib
obj/sane
obj/saneasm
obj/elems
obj/elemsasm
obj/quickdraw
obj/graf3d
obj/tooltraps
obj/ostraps


Example/boxesl
Rrmaker
Example/boxesr
R{un}MacCom
FYLexample/boxes.RSRC
boxes
APPL{set type to APPL}
{set creator to ????}
N{o bundle bit}QFDExample/boxes.i
ydExample/boxes.obj
ydExample/boxl.obj
yq
$ENDEXEC
  I2X(10,temp);
         SubX(temp,p1.Y);

         I2X(0,p1.Z); {p1.z:=0.0;}

         I2X(Random,p2.X); {p2.x:=p1.sumacc/ws/example/edit   444      0     12       10656  3472707172  10276 5^))9{$X-}
PROGRAM Edit;

  { Edit -- A small sample application written in Pascal }
  {         by Macintosh Technical Support       }
  {SK 6/18 Added Memtypes, if GetNextEvent, EraseRect in update event,
   fixed for new Edit menu  }

  {This program is a sample.  Don't use it as a skeleton or template; instead,
   understand each line and redo it yourself, only better!}

   USES {$U-}
      {$U Obj/Memtypes    } Memtypes,
      {$U Obj/QuickDraw   } QuickDraw,
      {$U Obj/OSIntf      } OSIntf,
      {$U Obj/ToolIntf    } ToolIntf;

   CONST
      lastMenu = 3; { number of menus }
      appleMenu = 1; { menu ID for desk accessory menu }
      fileMenu = 256; { menu ID for File menu }
      editMenu = 257; { menu ID for Edit menu }

   VAR
      myMenus: ARRAY [1..lastMenu] OF MenuHandle;
      screenRect,dragRect,pRect: Rect;
      doneFlag,temp: BOOLEAN;
      myEvent: EventRecord;
      code,refNum: INTEGER;
      wRecord: WindowRecord;
      myWindow,whichWindow: WindowPtr;
      theMenu,theItem: INTEGER;
      hTE: TEHandle;

   PROCEDURE SetUpMenus;
   { Once-only initialization for menus }

      VAR
         i: INTEGER;

      BEGIN
         InitMenus; { initialize Menu Manager }
         myMenus[1] := GetMenu(appleMenu);
         AddResMenu(myMenus[1],'DRVR'); { desk accessories }
         myMenus[2] := GetMenu(fileMenu);
         myMenus[3] := GetMenu(editMenu);
         FOR i := 1 TO lastMenu DO InsertMenu(myMenus[i],0);
         DrawMenuBar;
      END; { of SetUpMenus }

   PROCEDURE DoCommand(mResult: LongInt);

      VAR
         name: STR255;

      BEGIN
         theMenu := HiWord(mResult); theItem := LoWord(mResult);
         CASE theMenu OF

            appleMenu:
               BEGIN
               GetItem(myMenus[1],theItem,name);
               refNum := OpenDeskAcc(name);
               END;

            fileMenu: doneFlag := TRUE; { Quit }

            editMenu:
               IF NOT SystemEdit(theItem-1) THEN
                  BEGIN
                  SetPort(myWindow);
                  CASE theItem OF

                     3: TECut(hTE);

                     4: TECopy(hTE);

                     5: TEPaste(hTE);

                  END; { of item case }
               END; { of editMenu }

         END; { of menu case }
         HiliteMenu(0);

      END; { of DoCommand }

   BEGIN { main program }
      InitGraf(@thePort);
      InitFonts;
      FlushEvents(everyEvent,0);
      InitWindows;
      SetUpMenus;
      TEInit;
      InitDialogs(NIL);
      InitCursor;

      screenRect := screenBits.bounds;
      SetRect(dragRect,4,24,screenRect.right-4,screenRect.bottom-4);
      doneFlag := FALSE;

      myWindow := GetNewWindow(256,@wRecord,POINTER(-1));
      SetPort(myWindow);

      pRect := thePort^.portRect;
      InsetRect(pRect,4,0);
      hTE := TENew(pRect,pRect);
      REPEAT
         SystemTask;
         TEIdle(hTE);
         if GetNextEvent(everyEvent,myEvent) then
         CASE myEvent.what OF

            mouseDown:
               BEGIN
               code := FindWindow(myEvent.where,whichWindow);
               CASE code OF

                  inMenuBar: DoCommand(MenuSelect(myEvent.where));

                  inSysWindow: SystemClick(myEvent,whichWindow);

                  inDrag: DragWindow(whichWindow,myEvent.where,dragRect);

                  inGrow,inContent:
                     BEGIN
                     IF whichWindow<>FrontWindow THEN
                        SelectWindow(whichWindow)
                     ELSE
                        BEGIN
                        GlobalToLocal(myEvent.where);
                        TEClick(myEvent.where,(BitAnd (myEvent.modifiers,512) <> 0)
                                ,hTE);
                        END;
                     END;

               END; { of code case }
               END; { of mouseDown }

            keyDown,autoKey:
                TEKey(CHR(myEvent.message MOD 256),hTE);

            activateEvt:
               IF ODD(myEvent.modifiers) { window is becoming active }
                  THEN
                     TEActivate(hTE)
                  ELSE
                     TEDeactivate(hTE);

            updateEvt:
               BEGIN
               SetPort(myWindow);
               BeginUpdate(myWindow);
               EraseRect (thePort^.visRgn^^.rgnBBox);
               TEUpdate(thePort^.portRect,hTE);
               EndUpdate(myWindow);
               END; { of updateEvt }

         END; { of event case }

      UNTIL doneFlag;
   END.
TIL nBoxes=boxCount;

         PenPat(white);
         BackPat(black);
         Ersumacc/ws/example/editr   444      0     12         717  3472707172  10415 3. "6F^5D!$^778*  EditR -- Resource input for small sample application
*                Written by Macintosh Technical Support
* SK 6/18  Made Edit menu items standard, added menu 1
*
Example/Edit.Rsrc

Type MENU
  ,1
  \14

  ,256
  File
    Quit

  ,257
  Edit
    Undo
    (-
    Cut
    Copy
    Paste

Type WIND
  ,256
  A Sample
  50 40 300 450
  Visible NoGoAway
  0
  0

Type EDIT = STR
,0
Edit Version 1.0    - 12 December 83

Type CODE
 Example/editL,0
 END; { of SetUpMenus }

   PROCEDURE DoCommand(msumacc/ws/example/exec   444      0     12       11062  3472707172  10265 3. "6F^56D!$^huu4$EXEC
${ This single exec file can generate a Macintosh resource file from most of the    }
${ example source files.  The source can be Pascal, or assembly, or both.  The      }
${ naming convention is that assembly files have 'ASM' appended to the file name,   }
${ and resource files have an added 'R', although this can easily be changed below. }
${
${ The exec file is run by typing 'R' from the command line, then typing a line of  }
${ of the form:                                                                     }
$
${         <Sample/Exec[([pascal_source], [assembler_source], [resource_file],      }
${                       [source_volume], [library_volume])]                        }
$
${ Each of the elements in the square brackets are optional.  The default values are}
$
${ Defaults:    pascal_source    =   'example/file'                                                    }
${              assembler_source =   pascal_source'ASM'                                             }
${              resource_file    =   pascal_source'R'                                                }
${              source_volume    =   prefix volume                                                 }
${              library_volume   =   prefix volume                                                }
$
${ This will work for Edit, File, Grow and most other examples.           }
${ It will not work for RAM Disk, Boxes, and ADeskAcc               }
${ (Use Ramdisk/exec, example/boxesx)                    }
$
$DEFAULT %0 TO 'Example/File'       {Set the file name defaults.}
$DEFAULT %1 TO CONCAT(%0, 'Asm')
$DEFAULT %2 TO CONCAT(%0, 'R')
$
$IF %3 <> '' THEN                   {If a source volume is specified, }
    $SET %8 TO CONCAT('-', %3, '-') {set '%8' to the name of the source volume}
$ELSE
    $SET %8 TO ''                   {otherwise use the prefix volume }
$ENDIF
$IF %4 <> '' THEN                   {If a library volume is specified, }
    $SET %7 TO CONCAT('-', %4, '-') {set '%7' to the name of the library volume}
$ELSE
    $SET %7 TO ''
$ENDIF
$
$
$SET %9 TO 'F'                      {Start out assuming there is no file to assemble}
$IF EXISTS(CONCAT(%8, %1, '.TEXT')) THEN            {If a text ASM file exists, }
    $IF NOT(EXISTS(CONCAT(%8, %1, '.OBJ'))) THEN    {and if no code file exists,}
        $SET %9 TO 'T'                              {then assemble it           }
    $ELSEIF NEWER(CONCAT(%8, %1, '.TEXT'), CONCAT(%8, %1, '.OBJ')) THEN
        $SET %9 TO 'T'     {Otherwise assemble if the text is newer than the code  }
    $ENDIF
$ENDIF
$
$IF %9 = 'T' THEN                   {Assemble if the assembly file is true}
    $WRITELN CONCAT('Assemble: ', %8, %1, '.TEXT')   {a debugging statement}
A{ssemble}%8%1                      {&8 is the volume prefix, and &1 is the file name}
                                    {this blank line is for the listing file}
                                    {this blank line is for the default output file}
$ENDIF
$
$
$SET %9 TO 'F'                      {Assume there is no Pascal program}
$IF EXISTS(CONCAT(%8, %0, '.TEXT')) THEN
    $IF NOT(EXISTS(CONCAT(%8, %0, '.OBJ'))) THEN
        $SET %9 TO 'T'
    $ELSEIF NEWER(CONCAT(%8, %0, '.TEXT'), CONCAT(%8, %0, '.OBJ')) THEN
        $SET %9 TO 'T'
    $ENDIF
$ENDIF
$
$IF %9 = 'T' THEN
$WRITELN CONCAT('Compile: ', %8, %0, '.TEXT')
P{ascal}%8%0

reuse
G{enerate}$M+
reuse
%8%0
$ENDIF
$
$
$SET %6 TO ''
$SET %9 TO 'F'
$IF EXISTS(CONCAT(%8, %0, '.TEXT')) THEN
    $SET %6 TO CONCAT(%8, %0, '.OBJ')
    $IF EXISTS(CONCAT(%8, %0, 'L.OBJ')) THEN
        $IF NEWER(CONCAT(%8, %0, '.TEXT'), CONCAT(%8, %0, 'L.OBJ')) THEN
            $SET %9 TO 'T'
        $ENDIF
    $ELSE
        $SET %9 TO 'T'
    $ENDIF
$ENDIF
$
$IF %9 = 'F' THEN
    $IF EXISTS(CONCAT(%8, %1, '.TEXT')) THEN
        $IF %6 = '' THEN
            $SET %6 TO CONCAT(%8, %1, '.OBJ')
        $ENDIF
        $IF EXISTS(CONCAT(%8, %0, 'L.OBJ')) THEN
            $IF NEWER(CONCAT(%8, %1, '.TEXT'), CONCAT(%8, %0, 'L.OBJ')) THEN
                $SET %9 TO 'T'
            $ENDIF
        $ELSE
            $SET %9 TO 'T'
        $ENDIF
    $ENDIF
$ENDIF
$
$
$IF %9 = 'T' THEN
L{ink}%6
%7obj/quickDraw
%7obj/tooltraps
%7obj/ostraps
%7obj/prlink
%7obj/packtraps
%7obj/macpaslib
%7obj/sane
%7obj/saneasm
%7obj/elems
%7obj/elemsasm
    $IF EXISTS(CONCAT(%8, %1, '.TEXT')) THEN
        $IF CONCAT(%8, %1, '.OBJ') <> %6 THEN
%8%1.obj
        $ENDIF
    $ENDIF


%8%0L.OBJ
$ENDIF
$
$
R{un}%7RMaker
%8%2
$
$
R{un}%7MacCom
R{emove example/}Y
FYL%8%0.RSRC
%0.RSRC
APPL{set type to APPL}
{set creator to ????}
N{o bundle bit}E{ject}QF{iler}D{elete}reuse.I
Y{es}Q{uit}
$ENDEXEC
lts.}
$DEFAULT %1 TO CONCAT(%0, 'Asm')
$DEFAULT %2 TO CONCAT(%0, 'R')
$
$IF %3 <> '' THEN                   {If a source volume is specified, }
    $SET %8 TO CONCAT('-', %3, '-') {set '%8' to the name of the source volume}
$ELSE
    $SET %8 TO ''                   {otherwise use the prefix volume }
$ENDIF
$IF %4 <> '' THEN                   {If a library volume is specified, }
    $SET %7 TO CONCAT('-', %4, '-') {set '%7' to the name of the library volume}
sumacc/ws/example/file   444      0     12      212146  3472707173  10307 3. "6F^5D!$^**{ File -- Example code for printing, reading and writing files, and Text Edit }
{      -- by Cary Clark, Macintosh Technical Support }

PROGRAM MyFile;
{ Please read 'more about File,' included on the MacStuff 1 disk. }

{$DECL BUG}
{$SETC BUG := 0}
{One good way of debugging code is to write status information to one of the
 serial ports.  Even while debugging code which uses one of the ports, the other
 can be used for transmitting information to an external terminal.

 In this program, the compile time variable BUG is set to either -1, 0 or 1
 according to the extent of the debugging information required.  Since compile
 time variables or constants are used, setting a single flag should cause the
 resulting program to have no more code than is required by the debugging level
 requested.

 If BUG is set equal to -1, then no debugging information appears;  this is as you
 would want the end user to see your product.

 BUG set to 0 provides an additional menu bar called 'debug' that can display the
 amount of memory available, compact memory, and discard segments and resources
 resident in memory.  You can do something similar to display some debugging
 information on the Mac itself if you do not have a terminal, but the penalty here
 is that you may spend much of your time debugging the code which is intended to
 debug some other part of the program.  Obviously, creating and maintaining a
 window on a screen full of other windows in untested code is a difficult thing to
 do.

 BUG set to 1 adds an additional item to the 'debug' menu that writes various runtime
 information to an external terminal.  This is the preferred method of debugging,
 since it does not interfere with the Macintosh display.  Even if you do not have
 a separate terminal, you can use the LISA terminal program to act as one.  Since
 writing a lot of debugging information to a serial port can slow the program down,
 I would recommend a way of turning the information on and off.  In this program,
 the variable DEBUG is set to true or false in the beginning of one of the first
 procedures executed, SETUP, to provide debugging information.  The DEBUG variable
 may also be set by the bottom item on the rightmost menu.}

{$U-} {Turn off the Lisa Libraries.  This is required by Workshop.}
{$X-} {Turn off stack expansion.  This is a Lisa concept, not needed on Mac.}
{$R-} {Turn off range checking.}

{$IFC BUG > -1}
   {$D+} {Put the procedures name just after it in the code, to help in debugging}
{$ELSEC}
   {$D-} {Do not include the procedure name in the 'production' code}
{$ENDC}
{$L-} {don't list the interfaces}
USES
   {$U Obj/MemTypes    } MemTypes,
   {$U Obj/QuickDraw   } QuickDraw,
   {$U Obj/OSIntf      } OSIntf,
   {$U Obj/ToolIntf    } ToolIntf,
   {$U Obj/PackIntf    } PackIntf,
   {$U Obj/MacPrint    } MacPrint;
{$L+} {just list the program}

CONST
   appleMenu = 1;
   FileMenu = 2;
   EditMenu = 3;
   DebugMenu = 4;

{These constants are declared for this application to distinguish between the
 various types of windows that it can create.  The number is stored in the window
 field windowkind.}
   MyDocument = 8;
   Clipboard = 9;
   FreeMemory = 10;

{$IFC BUG = -1}
   lastMenu = 3;      { number of menus w/o debug}
{$ELSEC}
   lastMenu = 4;      { number of menus w/ debug}
{$ENDC}
   lf = CHR(10);      { At present, information written to the external terminal
                        needs its own linefeed.}
{$IFC BUG < 1}
   debug = FALSE;     { compiler will discard code after 'If debug ...'}
{$ENDC}

TYPE
   ProcOrFunc = (proc, func, neither);
   edset = set of 1..9;
   LomemPtr = ^LongInt;
   MyData = RECORD {each document window keeps a handle to this in WRefCon}
              TERecord: TEHandle;     {the text associated with this document}
              FileVolume: INTEGER;    {which volume, if loaded from disk}
              changed: BOOLEAN;       {the document is 'dirty'}
              titled:  BOOLEAN;       {the document has never been saved to disk}
            END;
   MyDataPtr = ^MyData;
   MyDataHandle = ^MyDataPtr;

{ <<< this little beauty does a form feed when you print this out.
       Copy and Paste it to move it to your source code}
{Here are a ton of global variables.  This is not a good programming example.
 You professionals, of course, will keep the number of globals in your own
 programs to a much smaller number than shown here.}

{these first six values are changed as windows are activated}
VAR
   MyWindow: WindowPtr;
   MyPeek: WindowPeek;            {MyPeek is the same as MyWindow}
   WindowData: MyDataHandle;      {this record is pointed to by the WRefCon.}
   hTE:  TEHandle;                {The active text edit handle}
   vScroll:  ControlHandle;       {The active vertical scroll bar.}
   whichpart: INTEGER;            {The last button pressed}
   topline:  INTEGER;             {the value of VScroll, also the visible top line.}

   printhdl: THPrint;             {initialized in SetUp, used by MyPrint}
   myMenus: ARRAY
     [1..lastMenu] OF MenuHandle; {Handles to all of the menus}
   growRect,                      {contains how big and small the window can grow}
   dragRect:  Rect;               {contains where the window can be dragged}
   tempwindow: WindowPtr;         {window referenced by GetNextEvent (bad pgmming.)}
   theChar:  CHAR;                {keyboard input goes here}
   myPoint: Point;                {the point where an event took place}
   lastCount: INTEGER;            {last scrap count, to see if it has changed}
   lastPaste: INTEGER;            {the scrap value when the last paste was made}
   doneFlag:  BOOLEAN;            {set when the user quits the program}
   myEvent:  EventRecord;         {returned by GetNextEvent}
   scrapwind:  WindowPtr;         {the ClipBoard window, which contains the scrap}
   iBeamHdl:  CursHandle;         {the text editing cursor}
   watchHdl:  CursHandle;         {the wait cursor}
   windownum: LongInt;            {the # of untitled windows opened}
   windowpos: LongInt;            {the # of windows opened}
   MyFileTypes: SFTypeList;       {same as txtfile, in a format for Standard File}
   firstchar: INTEGER;            {position of first character on top visible line}
   printflag: BOOLEAN;            {the user selected 'Print' from the File menu}
   finderprint: BOOLEAN;          {the user selected 'Print' from the Finder}
   Dlogptr: DialogPtr;            {the dialog box used when printing from Finder}
   printing: BOOLEAN;             {printing is currently in progress}
   printport: grafptr;            {port preserved during background printing}
   numfiles: INTEGER;             {number of files selected in finder}
   applLimit,                     {a pointer to the bottom of the stack area}
   heapend: LomemPtr;             {a pointer to the end of the application heap}
   dummy: Handle;                 {a temporary handle used to grow the heap}
 {$IFC BUG > -1}
   FreeWind:  WindowPtr;          {the free memory window}
   oldmem: LongInt;               {the last amount of free memory}
 {$ENDC}

 {$IFC BUG = 1}
   debug: BOOLEAN;
 {$ENDC}
   debugger: text;                {the external terminal file}

{------------------------------------------------------------------------------------}
PROCEDURE AutoScroll;                          EXTERNAL;
{This assembly routine is called by the innerds of TextEdit when the user drags
 a selection range outside of the current window.}

FUNCTION NewPtrClear (byteCount: Size): Ptr;   EXTERNAL;
{The NewPtr and NewHandle traps have a bit that clears the memory reserved
 by the call when set.  This assembly sets that bit for the NewPtr trap.}


PROCEDURE MainEventLoop;                       FORWARD;
{This is declared forward so the printing can take the main event loop as a procedure
 to execute while it is idleing}

FUNCTION MyGrowZone (cbNeeded: Size) : Size;   FORWARD;
{This is declared forward so that it can be resident in the blank segment, which is
 always loaded, and still be referenced by the SetUp procedure}

{$S Utilities}
{------------------------------------------------------------------------------------}
PROCEDURE DebugInProc (prockind: ProcOrFunc; where: str255; location: ptr);
{This procedure writes the executing routine's name and location in memory on the
 external terminal.  The location is especially important in a program like this
 that has segments.}
BEGIN
{$IFC BUG = 1}
  Write (debugger, 'in ');
  IF prockind = proc THEN Write (debugger, 'Procedure ');
  IF prockind = func THEN Write (debugger, 'Function ');
  Writeln (debugger, where, ' @ ', ORD4(location), lf)
{$ENDC}
END;

{------------------------------------------------------------------------------------}
PROCEDURE SetScrollMax;
Var cr : INTEGER;
    return : char;
    max: INTEGER;
BEGIN
{This adjusts the scroll value so that the scroll bar range is not allowed to exceed
 the end of the text.  Also, the scroll bar is disabled if the max is set equal to
 the min, which is zero.  The formula for determining the range is somewhat complex.
 Sorry.}
  IF debug THEN debuginproc (proc, 'SetScrollMax', @SetScrollMax);
  WITH hTE^^, hTE^^.viewrect DO
  BEGIN
    cr := 0;
    return := CHR(13);
    IF teLength > 0 THEN
      IF Munger (htext, teLength-1, Pointer(ORD4(@return)+1), 1, NIL, 1) > 0
      THEN cr := 1;
    max := nLines + cr - (bottom - top+1) DIV lineHeight;
    IF max < 0 THEN max := 0;
    SetCtlMax (VScroll, max);
    IF debug THEN Writeln (debugger, 'vscrollmax =', max,lf);
    topline := -destrect.top DIV lineheight;
    SetCtlValue (vscroll, topline);
    IF debug THEN Writeln (debugger, 'topline =',topline,lf)
  END;
END;

{------------------------------------------------------------------------------------}
PROCEDURE ScrollText (showcaret: BOOLEAN);
{called to either show the caret after an action like 'Copy';
 also called to adjust the text within the window after the window is resized.  The
 same formula used in SetScrollMax is used here as well.  Don't worry about how this
 works, too much.  This possibly could be made much simpler.}
Var bottomline, viewlines, SelLine, scrlAmount, numlines, blanklines, newtop
     ,return: INTEGER;
BEGIN
  IF debug THEN DebugInProc (proc, 'ScrollText', @ScrollText);
  WITH hTE^^ DO
  BEGIN
    scrlAmount := 0;
    numlines := nlines;  {if the last character is a carriage return, add 1 to numlines}
    return := $0D00;
    IF teLength > 0 THEN
      IF Munger (htext, teLength-1, @return, 1, NIL, 1) > 0
      THEN numlines := numlines + 1;
    WITH HTE^^.viewrect DO
     viewlines := (bottom - top+1) DIV lineHeight;  {don't count partial lines}
    topline := -destrect.top DIV lineheight;
    bottomline := topline + viewlines - 1;
    IF showcaret
    THEN
    BEGIN
      selLine := 0;
      WHILE (selLine+1 < nlines) AND (selstart >=linestarts[selLine+1]) DO
       selLine := selLine + 1;
     {if selstart = selend is @ a cr, then add 1 to selstline}
      IF (selstart = selend) AND (selstart > 0) THEN
      IF Munger (htext, selstart-1, Pointer(ORD4(@return)+1), 1, NIL, 1) = selstart-1
      THEN selLine := selLine + 1;
      IF debug THEN
      BEGIN
        Write (debugger, 'selstart=',selstart:5,'; selLine=',selLine:5);
        IF selstart > 0 THEN
      END;
      IF SelLine > bottomline THEN
      BEGIN
        scrlAmount :=  bottomline - SelLine;
        IF numlines - SelLine > viewlines DIV 2
        THEN scrlAmount := scrlAmount - viewlines DIV 2
        ELSE ScrlAMount := ScrlAmount - numlines + SelLine + 1
      END;
      IF SelLine < topline THEN
      BEGIN
        scrlAmount := topline - SelLine;
        IF selLine  > viewlines DIV 2
        THEN scrlAmount := scrlAmount + viewlines DIV 2
        ELSE ScrlAMount := ScrlAmount + selLine
      END
    END;
    IF scrlAmount = 0 THEN
    BEGIN
      blanklines := viewlines - numlines + topline;
      IF blanklines < 0 THEN blanklines := 0;
      IF (blanklines > 0) AND (topline > 0) THEN
      BEGIN
        scrlAmount := blanklines;
        IF scrlAmount > topline THEN scrlAmount := topline
      END;
      IF NOT showcaret THEN
      BEGIN
        newtop := 0;
        WHILE (newtop+1 < nlines) AND (firstchar >= linestarts[newtop+1]) DO
         newtop := newtop + 1;
        IF (newtop <> topline) AND (ABS(newtop - topline) > ABS(scrlAmount)) THEN
         scrlAmount := topline - newtop
      END
    END;
    IF debug THEN
    BEGIN
      Write (debugger, 'newtop=',newtop:4,'; blanklines=',blanklines:4);
      Writeln (debugger, '; newtop - topline=',newtop - topline,lf)
    END;
    IF scrlamount <> 0 THEN
    BEGIN
      IF selstart = selend THEN TEDeactivate (hTE);
      TEScroll (0, scrlAmount * lineheight, hTE);
      IF selstart = selend THEN TEActivate (hTE)
    END;
    IF debug THEN Writeln (debugger, 'scrlAmount=',scrlAmount:4,lf);
    SetScrollMax
  END
END;

{------------------------------------------------------------------------------------}
PROCEDURE ToggleScrap;
Var temppeek: windowPeek;
    getwhich: INTEGER;
    showhidestr: Str255;
BEGIN
{The clipboard comes and goes, here.  The last item in the editmenu is alternately
 made to read, 'Show Clipboard' and 'Hide Clipboard'.}
  IF debug THEN DebugInProc (proc, 'ToggleScrap', @ToggleScrap);
  IF ScrapWind = NIL THEN {make it appear}
  BEGIN
    scrapwind := GetNewWindow (257, NIL, Pointer (-1));
    Temppeek := windowPeek (scrapwind);
    Temppeek^.windowkind := Clipboard;
    SetPort (scrapwind);
    InvalRect (scrapwind^.Portrect);
    GetWhich := 5 {hide clipboard}
  END
  ELSE    {make it disappear}
  BEGIN
    DisposeWindow (scrapwind);
    Scrapwind := NIL;
    GetWhich := 4 {show clipboard}
  END;
  GetIndString (showhidestr, 256, getwhich);
  SetItem (myMenus[EditMenu], 9, showhidestr);
END;

{$IFC BUG > -1}
{------------------------------------------------------------------------------------}
PROCEDURE ToggleFree;
Var temppeek: windowpeek;
    getwhich: INTEGER;
    showhidestr: Str255;
BEGIN
{just about the same as ToggleClipboard, above.  This is just for debugging fun.}
  IF debug THEN DebugInProc (proc, 'ToggleFree', @ToggleFree);
  IF FreeWind = NIL THEN {make it appear}
  BEGIN
    Freewind := GetNewWindow (258, NIL, Pointer (-1));
    Temppeek := windowPeek (Freewind);
    Temppeek^.windowkind := FreeMemory;
    SetPort (Freewind);
    InvalRect (Freewind^.Portrect);
    GetWhich := 3;
  END
  ELSE    {make it disappear}
  BEGIN
    DisposeWindow (Freewind);
    Freewind := NIL;
    GetWhich := 2
  END;
  GetIndString (showhidestr, 257, getwhich);
  SetItem (myMenus[DebugMenu], 1, showhidestr);
END;
{$ENDC}

{------------------------------------------------------------------------------------}
PROCEDURE SetViewRect;
BEGIN
{text edit's view rect is inset in the content of the window, to prevent it from
 running into the lefthand side or the scroll bar.}
  IF debug THEN DebugInProc (proc, 'SetViewRect', @SetViewRect);
  WITH hTE^^.viewrect DO
  BEGIN
    hTE^^.viewrect := MyWindow^.portRect;
    left  :=  left +4;
    right := right -15
  END
END;

{------------------------------------------------------------------------------------}
PROCEDURE MoveScrollBar;
BEGIN
{When the window is resized, the scroll bar needs to be stretched to fit.}
  IF debug THEN DebugInProc (proc, 'MoveScrollBar', @MoveScrollBar);
  WITH MyWindow^.portRect DO
  BEGIN
    HideControl(vScroll);
    MoveControl(vScroll,right-15,top-1);
    SizeControl(vScroll,16,bottom-top-13);
    ShowControl(vScroll)
  END
END;

{------------------------------------------------------------------------------------}
PROCEDURE GrowWnd;
{ Handles growing and sizing the window and manipulating the update region. }
VAR longStuff: RECORD CASE INTEGER OF
      1 : (longResult : LONGINT);        {Information returned by MenuSelect}
      2 : (height,                       {Which menu was selected}
           width : INTEGER)              {Which item within the menu}
    END;
    height, width, newvert, oldstart:  INTEGER;
    tRect, oldportrect: Rect;
BEGIN
  IF debug THEN DebugInProc (proc, 'GrowWnd', @GrowWnd);
  WITH longStuff DO
  BEGIN
    longResult := GrowWindow(MyWindow,myEvent.where,growRect);
    IF longResult = 0 THEN EXIT(GrowWnd);
    Setcursor (watchhdl^^); {because the word wrap could take a second or two}
    SizeWindow(MyWindow,width,height,TRUE);  { Now draw the newly sized window. }
    InvalRect (MyWindow^.portrect);
    IF MyPeek^.windowkind = MyDocument THEN {it's not the clipboard}
    BEGIN
      MoveScrollBar;
      WITH MyWindow^.portRect DO
      BEGIN
        width := right-left-19;
        height := bottom-top
      END;
      WITH HTE^^ DO
      BEGIN
        destrect.right := destrect.left + width;
        viewrect.right := viewrect.left + width;
        viewrect.bottom := viewrect.top + height;
        firstchar := hTE^^.linestarts [topline];
        TECalText (hTE); {re-wrap the text to fit the new screen.}
        {if the rectangle is grown such that there is now blank space on the bottom
        of the screen, backpedal the screen to fill it back up, if there is enough
        scrolled off the screen to do so.  Otherwise, the first character in the top line on
        the screen should continue to be somewhere on the top line after resizing}
        ScrollText (FALSE);
      END
    END
  END
END;     { of GrowWnd }

{------------------------------------------------------------------------------------}
PROCEDURE MyActivate;
VAR tRect : rect;
BEGIN
{activate events occur when one window appears in front of another.  This takes care
 of hiliting the scroll bar and deactivating the insertion caret or the text
 selection.}
  IF debug THEN DebugInProc (proc, 'MyActivate', @MyActivate);
  MyWindow := windowPtr (MyEvent.message);
  MyPeek := windowPeek (MyWindow);
  IF MyPeek^.windowkind in [MyDocument,Clipboard] THEN
  BEGIN {redraw the scrollbar area, if a document or the clipboard}
    SetPort (MyWindow);
    tRect := MyWindow^.portRect;
    tRect.left := tRect.right-16;
    InvalRect(tRect)
  END;
  IF MyPeek^.windowkind = MyDocument THEN
  BEGIN {make global variables point to the information associated with this window}
    WindowData := MyDataHandle (GetWRefCon (MyWindow));
    VScroll := ControlHandle (MyPeek^.ControlList);
    hTE := WindowData^^.TERecord;
    IF ODD (myEvent.modifiers)
    THEN
    BEGIN {this window is now top most}
      TEActivate(hTE);
      ShowControl (VScroll);
      topline := GetCtlValue (VScroll)
    END
    ELSE
    BEGIN {this window is no longer top most}
      HideControl (VScroll);
      TEDeactivate(hTE);
      hTE := NIL {a document is no longer on top}
    END
  END
END;    { of activateEvt }

{------------------------------------------------------------------------------------}
PROCEDURE DialogueDeactivate;
var temprect: rect;
BEGIN
{This routine takes care of cases where, for instance, a modal dialog is about to
 pop up in front of all the other windows.  Since the Dialog Manager handles all
 activate events for you, you do not get a chance to 'turn off' the controls associated
 with the window.  This routine is called just before the dialog box makes its
 appearance, and takes care of the hiliting as if an activate event had occured.}
  IF debug THEN DebugInProc (proc, 'DialogueDeactivate', @DialogueDeactivate);
  IF hTE <> NIL THEN {for documents, only}
  BEGIN
    TEDeactivate(hTE);
    HideControl (VScroll);
    SetCursor (arrow)
  END;
  IF (frontwindow <> NIL) AND (Mypeek^.windowkind IN [MyDocument, Clipboard]) THEN
  BEGIN {this is a little kludgy, but it works.}
    Mypeek^.hilited := FALSE; {DrawGrowIcon will now unhilite.}
    temprect := MyWindow^.PortRect;
    temprect.left := temprect.right - 15;
    Cliprect (temprect); {clipaway the horizontal scrollbar part}
    DrawGrowIcon (MyWindow);
    Cliprect (MyWindow^.PortRect);
    Mypeek^.hilited := TRUE {fix things back}
  END
END;

{$S READFILE}
{------------------------------------------------------------------------------------}
Function ReadFile (VrefNo: INTEGER; FName : str255) : BOOLEAN;
Var refNo, io : INTEGER;
    logEOF: LongInt;
    errin: str255;

{------------------------------------------------------------------------------------}
  Procedure DiskRErr (io : INTEGER);
  Var str: str255;
      readfromstr, loadedstr, str1: Str255;
      dummy: INTEGER;
  BEGIN
{A generic error is reported to the user if something goes wrong.  Amazingly little can
 go wrong, since the user does not get the chance to do things like type file names,
 remove the disk himself, and so on.  About the only error that could happen is:

 an error occured while reading the disk (damaged media or hardware)

 Can you think of anything else?  A similar routine further down handles
 writing to disk.  Note that in both reading and writing, the entire file is handled
 by a single read/write call, and no 'disk buffer' needs to be specified by the
 programmer.}

    IF debug THEN
    BEGIN
      DebugInProc (func, 'DiskRErr', @DiskRErr);
      Writeln (debugger, errin, ' err = ', io, lf)
    END;
    GetIndString (readfromstr, 256, 9); {this says 'reading from'}
    GetIndString (loadedstr ,256, 11); {this says 'loaded'}
    IF io = IOErr
    THEN GetIndString (str, 256, 21)  {this says 'IO error'}
    ELSE
    BEGIN
      NumToString (io, str1);
      GetIndString (str, 256, 22); {this is the generic 'ID ='}
      str := Concat (str, str1)
    END;
    Paramtext (readfromstr, FName, loadedstr, str);
    SetCursor (arrow);
    dummy := StopAlert (256, NIL); {discribe error to user in generic way.}
    Exit (readfile)
  END;

BEGIN
  IF debug THEN
  BEGIN
    DebugInProc (func, 'ReadFile', @ReadFile);
    writeln (debugger, 'volume = ', vrefno, '; file = ', fname, lf)
  END;
  SetCursor (watchHdl^^);
  ReadFile := FALSE;
  io := FSOpen (Fname, VRefNo, RefNo);
{$IFC BUG = 1} {these debugging statements are for the external terminal, only}
  errin := 'FSOpen';
{$ENDC}
  IF io <> 0 THEN DiskRErr (io);
  io := GetEOF (RefNo, logEOF);
{$IFC BUG = 1}
  errin := 'GetEOF';
{$ENDC}
  IF io <> 0 THEN DiskRErr (io);
  {add code here:  if file is too large, then notify user and truncate}
  SetHandleSize (hTE^^.hText, logEOF);
  IF debug THEN IF memerror<>0 THEN Writeln (debugger, 'memerr = ',memerror:4);
  io := FSRead (refNo, logEOF, hTE^^.hText^);
{$IFC BUG = 1}
  errin := 'FSRead';
{$ENDC}
  IF io <> 0 THEN DiskRErr (io);
  io := FSClose (refNo);
{$IFC BUG = 1}
    errin := 'FSClose';
{$ENDC}
  IF io <> 0 THEN DiskRErr (io);
  hTE^^.teLength := logEOF;
  IF NOT finderprint THEN {if printing from the finder, no window or editing
   information is needed}
  BEGIN
    TESetSelect (0,0,hTE);
    TECalText (hTE);
    Invalrect (hTE^^.viewrect);
    SetScrollMax;
    WindowData^^.titled := TRUE;
    WindowData^^.changed := FALSE;
    WindowData^^.FileVolume := VRefNo
  END;
  ReadFile := TRUE {everything worked out OK}
END;

{------------------------------------------------------------------------------------}
PROCEDURE MakeAWindow (str : str255; disk : BOOLEAN);
Var bounds: rect;
BEGIN
{A window is created here, and all associated data structures are linked to it}
  IF debug THEN DebugInProc (proc, 'MakeAWindow', @MakeAWindow);
  windowpos := windowpos + 1; {this position it is created to on the screen}
  bounds.left := windowpos MOD 16 * 20 + 5;
  bounds.top := windowpos MOD 11 * 20 + 45;
  bounds.right := bounds.left + 200;
  bounds.bottom := bounds.top + 100;
  MyWindow := NewWindow(NIL, bounds, str, TRUE, 0, Pointer(-1), TRUE, 0);
  SetPort (MyWindow);
  Mypeek := windowPeek (MyWindow);
  TextFont (applFont);
  DrawChar (' '); SetFontLock (TRUE);
  Mypeek^.windowkind := MyDocument; {a number > 8 identifies the type of window}
  hTE := TENew(MyWindow^.portRect, MyWindow^.portRect);
  WindowData := MyDataHandle (NewHandle (8)); {1 handle, an integer, and 2 booleans}
  SetWRefCon (MyWindow, ORD(WindowData));
  WindowData^^.TERecord := hTE;
  SetViewRect;
  hTE^^.destrect := hTE^^.viewrect;
  WindowData^^.changed := FALSE;
  WindowData^^.titled := FALSE;
  vScroll := GetNewControl(256,MyWindow);
  MoveScrollBar;
  topline := 0;
  hTE^^.clikLoop := ORD(@AutoScroll)
END;

{------------------------------------------------------------------------------------}
PROCEDURE MyGetFile;
Var reply: SFReply;
    wher: point;
    temprect: rect;
    tempport:grafptr;
    copyIt, foundIt : BOOLEAN;    {if the name is already in use, this will be true}
    temppeek: Windowpeek;
    tempstr, oldfname: str255;
    str: str255;
    tempdata: MyDataHandle;
BEGIN
{This calls Standard File to allow the user to choose the document on disk that she
 wishes to edit.}
  IF debug THEN DebugInProc (proc, 'MyGetFile', @MyGetFile);
  wher.h := 90;
  wher.v := 100;
  DialogueDeactivate;
  SFGetFile (wher, '', NIL, 1, MyFileTypes, NIL, reply);
  WITH Reply DO
  IF good THEN
  BEGIN
    {check to see if this name already resides on a document window.  If so, change
     the title to 'Copy of ' and remember to check it as untitled? after the readfile}
    foundit := FALSE;
    oldfname := fname;
    REPEAT
      temppeek := windowPeek(Frontwindow);
      copyIt := FALSE;
      IF temppeek <> NIL THEN
      REPEAT
        GetWTitle (windowPtr (temppeek), tempstr);
        IF tempstr = fname THEN
        BEGIN
          tempdata := MyDataHandle(temppeek^.refCon);
          IF tempdata^^.FileVolume = vrefnum THEN
          BEGIN
            copyIt := TRUE;
            foundIt := TRUE
          END
        END;
        temppeek := temppeek^.nextwindow
      UNTIL (temppeek = NIL) OR copyIt;
      GetIndString (str, 256, 16);{copy of}
      IF copyIt THEN fname := Concat (str,fname);
    UNTIL NOT copyIt;
    IF foundIt THEN
    BEGIN
      Paramtext (fname,'','','');
      copyIt := (NoteAlert (258, NIL) = OK)
    END;
    IF NOT foundIt OR copyIt THEN
    BEGIN
      MakeAWindow (fname, TRUE);
      IF ReadFile (vrefnum, oldfname)
      THEN
      BEGIN
        IF foundIt THEN windowdata^^.titled := FALSE
      END
      ELSE
      BEGIN
        TEDispose (hTE);
        hTE := NIL;
        DisposHandle (Handle (WindowData));
        IF debug THEN Writeln (debugger, 'dispose WindowData; memerr = ', MemError, lf);
        DisposeWindow (MyWindow)
      END
    END
  END
END;

{------------------------------------------------------------------------------------}
PROCEDURE OpenAWindow;
VAR s: str255;
    untitled: Str255;
BEGIN
{this creates a new window that is untitled and empty.}
  IF debug THEN DebugInProc (proc, 'OpenAWindow', @OpenAWindow);
  {see if enough mem exists to open a window}
  NumToString(windownum, s);
  windownum := windownum + 1;
  GetIndStr (untitled, 256, 1);
  MakeAWindow (Concat (untitled, s), FALSE);
END;

{$S WRITFILE}
{------------------------------------------------------------------------------------}
FUNCTION WriteFile (vRefNo: INTEGER; fName : str255) : BOOLEAN;
var refNo, io : INTEGER;
    txtlength : longint;
    errin : str255;

{------------------------------------------------------------------------------------}
  PROCEDURE DiskWErr (io : INTEGER);
  Var str:str255;
      writetostr, savedstr, str1: Str255;
      dummy, errstr: INTEGER;
  BEGIN
  {This is just about the same as DiskRErr (read).  Since a few more errors can
   happen during a write, the structure is just a little different}
    IF debug THEN
    BEGIN
      DebugInProc (proc, 'DiskWErr', @DiskWErr);
      Writeln (debugger, errin, ' err = ', io, lf)
    END;
    GetIndString (writetostr,256,10);{read resource for writeto}
    GetIndString (savedstr,256,12);{read resource for saved}
    errstr := 0;
    Case io of
      DskFulErr : errstr := 17;
      DirFulErr : errstr := 18;
      FLckdErr : errstr := 19;
      VLckdErr, WPrErr : errstr := 20;
      IOErr : errstr := 21;
      OTHERWISE
      BEGIN
        NumToString (io, str);
        GetIndStr (str1,256,22);{ID = }
        str := Concat (str1,str)
      END
    END;
    IF errstr <> 0 THEN GetIndStr (str,256,errstr);
    Paramtext (writetostr,FName,savedstr,str);
    SetCursor (arrow);
    dummy := StopAlert (256, NIL);
    io := FSClose (refNo);
    Exit (writefile)
  END;

BEGIN
{this isn't very different from read file.  The only complication is finding out
 if the file exists.  If it doesn't, create it.  Also, assign the information that
 the finder needs to properly associate it with this application.}
  IF debug THEN DebugInProc (proc, 'WriteFile', @WriteFile);
  SetCursor (watchHdl^^);
  WriteFile := FALSE;
  io := FSOpen(FName, VRefNo, refNo);
{$IFC BUG = 1}
  errin := 'FSOpen'; {once again, these only benefit the external debugger.}
{$ENDC}
  IF debug THEN Writeln (debugger, 'file RefNum =', refNo, lf);
  IF io = {file not found Err} -43 THEN
  BEGIN
    io := Create (FName,VRefNo,'CARY','TEXT');
{$IFC BUG = 1}
    errin := 'Create';
{$ENDC}
    IF io <> 0 THEN DiskWErr (io);
    io := FSOpen(FName, VRefNo, refNo);
{$IFC BUG = 1}
    errin := 'FSOpen';
{$ENDC}
    IF debug THEN Writeln (debugger, 'file RefNum = ', refNo, lf);
    IF io <> 0 THEN DiskWErr (io)
  END {Create}
  ELSE IF io <> 0 THEN DiskWErr (io);
  WITH hTE^^ DO
  BEGIN
    txtLength := teLength;
    io := FSWrite (refNo, txtLength, hText^);
  END;
{$IFC BUG = 1}
  errin := 'FSWrite';
{$ENDC}
  IF io <> 0 THEN DiskWErr (io);
  io := SetEOF (refNo, txtlength);
{$IFC BUG = 1}
  errin := 'SetEOF';
{$ENDC}
 IF io <> 0 THEN DiskWErr (io);
  io := FSClose (refNo);
{$IFC BUG = 1}
  errin := 'FSClose';
{$ENDC}
  IF io <> 0 THEN DiskWErr (io);
  io := FlushVol (NIL, VrefNo); {this is important; without it, if the program died
  (not possible as a result of a programming mistake, of course), the directory
   information on the disk would not be accurate.}
{$IFC BUG = 1}
  errin := 'FlushVol';
{$ENDC}
  IF io <> 0 THEN DiskWErr (io);
  IF not windowdata^^.titled THEN
  BEGIN
    SetWTitle(MyWindow, FName);
    WindowData^^.filevolume := VRefNo
  END;
  WindowData^^.titled := TRUE;
  WindowData^^.changed := FALSE;
  WriteFile := TRUE {everything is OK.}
END;

{------------------------------------------------------------------------------------}
FUNCTION MyPutFile (Filename: str255): BOOLEAN;
Var reply: SFReply;
    wher: point;
    Namestr: Str255;
    temprect: rect;
    tempport:grafptr;
BEGIN
{The user can select the name of the file that they wish to save the document with.}
  IF debug THEN DebugInProc (func, 'MyPutFile', @MyPutFile);
  MyPutFile := FALSE;
  GetIndStrList (namestr,256,2);
  wher.h := 100;
  wher.v := 100;
  DialogueDeactivate;
  SFPutFile (wher, Namestr, Filename, NIL, reply);
  WITH Reply DO
  BEGIN
    IF debug THEN Writeln (debugger, 'reply.good = ', good, lf);
    IF good THEN MyPutFile := WriteFile (vrefnum, fname)
  END;
  IF debug THEN Writeln (debugger, 'release reserror = ', reserror, lf)
END;

{------------------------------------------------------------------------------------}
PROCEDURE CloseAWindow;
VAR itemhit: INTEGER;
    DBoxPtr: DialogPtr;
    str,str1: str255;
    Goodwrite: BOOLEAN;
    temprect: rect;
    NamePtr: ^Str255;
    typ: INTEGER;
    itemhdl: handle;
    box:rect;
BEGIN
{All sorts of windows can be closed through this single routine, which is accessed
 by the user through the go-away box on the window, or the Close item in the File
 menu, or by quitting the program.}
  IF debug THEN DebugInProc (proc, 'CloseAWindow', @CloseAWindow);
  MyPeek := windowPeek (FrontWindow);
  Case Mypeek^.windowkind of
  MyDocument :
  BEGIN
    GetWTitle (MyWindow, str);
    itemhit := 0;
    IF WindowData^^.changed THEN {give the user the chance to save his data before
     you throw it away.}
    BEGIN
      DialogueDeactivate;
      IF doneflag THEN
      BEGIN
        GetIndStr (str1,256,8);
        IF debug THEN Writeln (debugger, 'err = ', Reserror, lf);
      END
      ELSE str1 := '';
      Paramtext (str,str1,'','');
      ItemHit := CautionAlert (259, NIL)
    END;
    IF debug THEN Writeln (debugger, 'itemhit = ', itemhit, lf);
    Goodwrite := FALSE;
    IF NOT windowdata^^.titled THEN str := '';
    IF itemhit = OK {save} THEN
      IF WindowData^^.titled
      THEN GoodWrite := WriteFile (WindowData^^.FileVolume, str)
      ELSE Goodwrite := MyPutFile (str);
    IF GoodWrite OR (itemhit IN [0, 3] {discard}) THEN
    BEGIN
      TEDispose (hTE);
      hTE := NIL;
      DisposHandle (Handle (WindowData));
      DisposeWindow (MyWindow)
    END;
    IF itemhit = Cancel THEN doneflag := FALSE
  END;
  Clipboard : ToggleScrap;
{$IFC BUG > -1}
  FreeMemory: ToggleFree;
{$ENDC}
    OTHERWISE CloseDeskAcc (MyPeek^.windowkind) {can't be anything else}
  END {Case}
END;

{$S AboutMyPgm}
{------------------------------------------------------------------------------------}
PROCEDURE AboutMyEditor;
const mousekey = mDownMask+keyDownMask;
var str1hdl: stringHandle;
    str2: Str255;
    MyWindow:  WindowPtr;
    width, height, counter, strwidth, strdepth, factor, remainder, adjust: INTEGER;
    newcount: longint;
    txtinfo: fontinfo;
    temprect, trect1: rect;
    offscreen, tempbits: bitmap;
    sz: size;
BEGIN
{this bit of fluff shows an inadequate method of telling the user something about
 my program, but it was fun to do.}
  IF debug THEN DebugInProc (proc, 'AboutMyEditor', @AboutMyEditor);
  DialogueDeactivate;
  str1hdl := stringHandle(GetResource('CARY',0)); IF debug THEN Writeln (debugger, 'err = ', Reserror, lf);
  GetIndStr (str2,256,3); IF debug THEN Writeln (debugger, 'err = ', Reserror, lf);
  HLock (Handle(str1hdl));
  MyWindow := GetNewWindow (256, NIL, Pointer (-1));
  SetPort (MyWindow);
  TextFont (NewYork);
  TextSize (12);
  GetFontInfo (TxtInfo);
  width := MyWindow^.portrect.right - MyWindow^.portrect.left;
  height := MyWindow^.portrect.bottom - MyWindow^.portrect.top;
  strwidth := StringWidth (str1hdl^^);
  IF StringWidth (str2) > strwidth THEN strwidth := StringWidth (str2);
  WITH TxtInfo DO
  BEGIN
    strdepth := ascent*2+descent*2+leading+1;
    WITH offscreen DO
    BEGIN
      rowbytes := (strwidth + 15) DIV 16 * 2;{rowbytes needs to be even}
      SetRect (bounds, 0,0,strwidth,strdepth);
      baseaddr := NewPtrClear (rowbytes * strdepth);
      IF debug THEN Writeln (debugger, 'err = ', Memerror, lf);
    END;
    tempbits := MyWindow^.portbits;
    SetPortBits (offscreen);
    MoveTo ((strwidth - StringWidth (str1hdl^^)) DIV 2, ascent);
    DrawString (str1hdl^^);
    MoveTo ((strwidth - StringWidth (str2)) DIV 2, strdepth-descent);
    DrawString (str2)
  END;
  HUnlock (Handle (str1hdl));
  SetPortBits (tempbits);
  factor := strwidth DIV strdepth;
  remainder := strwidth MOD strdepth;
  SetRect (trect1, (width - remainder) DIV 2 - factor, height DIV 2 - 1,
    (width + remainder) DIV 2 + factor, height DIV 2 + 1);
  counter := 1;
  REPEAT
    SystemTask;
    CopyBits (offscreen, MyWindow^.portbits, offscreen.bounds, trect1, srcCopy, NIL);
    InsetRect (trect1, -factor, -1);
    counter := counter + 2;
  UNTIL EventAvail (mousekey, MyEvent) OR (counter >= strdepth);

  newcount := TickCount + 300; {5 seconds}
  REPEAT
    SystemTask
  UNTIL EventAvail (mousekey, MyEvent) OR (TickCount > newcount);

  temprect := offscreen.bounds;
  OffsetRect (temprect, (width-strwidth) DIV 2, (height-strdepth) DIV 2);
  trect1 := offscreen.bounds;
  WITH MyWindow^, temprect DO
  WHILE NOT EventAvail(mousekey,MyEvent) AND
    (trect1.right-factor * 2> trect1.left) DO
  BEGIN
    SystemTask; {the clock still ticks!}
    factor := trect1.right DIV strdepth;
    IF left > 0 THEN InsetRect (temprect, -factor, -2)
    ELSE IF top > 0 THEN
    BEGIN
      InsetRect (trect1, factor, 0);
      InsetRect (temprect, 0, -2)
    END ELSE InsetRect (trect1, factor, 2);
    CopyBits (offscreen, portbits, trect1, temprect, srcCopy, NIL);
  END;
  DisposPtr(offscreen.baseaddr);
  IF debug THEN Writeln (debugger, 'err = ', Memerror, lf);
  DisposeWindow (MyWindow)
END;

{$S MyPrint }
{------------------------------------------------------------------------------------}
PROCEDURE CheckButton;
var bool : BOOLEAN;
    item : INTEGER;
BEGIN
  bool := GetNextEvent (mDownMask+keyDownMask, MyEvent);
  item := 0;
  IF (myEvent.what = keydown) AND (BitAnd (myEvent.message, 255) = 13)
  THEN item := 1
  ELSE
  IF IsDialogEvent (myEvent) THEN bool := DialogSelect (myEvent, dlogptr, item);
  IF item = 1 THEN PrSetError (iPrAbort);
END;

{------------------------------------------------------------------------------------}
PROCEDURE MyPrint(finderFile:INTEGER; filename: str255);
Const bottommargin = 20;      {amount of space on the margins of the page in pixels}
      leftmargin = 30;
      rightmargin = 10;

Var MyPPort: TPPrPort;
    txt: handle;
    txtptr: ptr;
    pglen,  start, finish, counter, count2, loop, io, numpages: INTEGER;
    temprect, tmprect2, pagerect: rect;
    status: TPrStatus;
    userOK, canceldialog: BOOLEAN;
    s: string[1];
    str: str255;
    numToGo, numdone: str255;
    temp: str255;
    MyLngth: array [1..99] of INTEGER;
BEGIN
{For heavyweight programmers only. All modes of printing are handled by Macprint.  The
 only things you have to do are:
   image each page, using QuickDraw (or something that uses QuickDraw);
   Do it once for the number of copies the user specified in draft mode only.

   You do not have to worry with:
     copies in normal or high res.
     which pages the user chose to print.
     tall, wide, etc.

  Remember, these Page Setup dialog is printer specific.  It will not always be the
  same, so don't write any code around it.

  The reason this program is heavily segmented is that printing normal or high-res
  on line takes gobs of memory (in this example, up to 25K.)  You may minimize the
  by omitting 1 line below and creating a spooled file instead.

  The finderprint boolean determines whether printing is has been selected while the
  user is running the application, or whether it was selected from the finder.  In the
  application, printing is done in the background.  From the finder, a simple dialog
  is presented instead.  Because printing takes a large amount of memory, up to 25K,
  background printing is only possible if the memory required by the foreground
  process can be kept to a minimum.  Since this program does not yet have strong
  memory full checking, you should set the debugging compile time variable DEBUG
  to -1, and remove MacsBug from the Mac disk, to give the program a realistic amount
  of free memory.  MacsBug, when active, can use up to 16K.

  Printing is not re-entrant.  If your main program loop is the print idle proc,
  as below, disable the Page Setup item and change 'Print' to 'Stop Printing'
  in the File menu.}

  IF debug THEN DebugInProc (proc, 'MyPrint', @MyPrint);
  printflag := FALSE;
  IF debug THEN
   writeln (debugger, 'finderPrint =', finderprint, '; finderFile =', finderfile, lf);
  userOK := TRUE;
  IF finderfile = 1 THEN
  BEGIN
    SetCursor (arrow);
    userOK :=  PrJobDialog (PrintHdl)
  END;
  IF userOK THEN
  BEGIN
    {try to see if enough memory exists to
          1) duplicate the text portion of the te record
          2) allow the printing pieces to be resident
          3) allow the largest possible segment to be loaded by the main event loop
          if so, allow the printing to go on in the background.
          Otherwise, put up the 'press a button to cancel' dialog}
    SetCursor (watchhdl^^);
    IF NOT finderprint THEN numfiles := 1;
    canceldialog := finderprint;
    IF NOT canceldialog THEN
    BEGIN
      txt := NewHandle (hte^^.telength+16000);
      {this calculation should be made considering:
          the current font size
          the printing mode (draft, normal, hires)
          the textstyle overhead, if any
          blank segment overhead
          largest segment + largest local data
          global data overhead ---  16000 is a crude, unprofessional approximation}
      IF txt = NIL THEN canceldialog := TRUE
      ELSE
      BEGIN
        disposHandle (txt);
        txt := hte^^.hText;
        ResrvMem (hte^^.teLength);
        io := HandToHand (txt);
      END
    END;
    IF canceldialog THEN
    BEGIN
      NumToString (finderFile, numToGo);
      NumToString (numfiles, numdone);
      Paramtext (filename,numToGo,numdone,'');
      dlogptr := GetNewDialog (257, NIL, Pointer(-1));
      DrawDialog (dlogptr);
      printHdl^^.prJob.pIdleProc := @CheckButton;
      txt := hte^^.hText
    END
    ELSE
    BEGIN
      GetIndStr (temp,256,15); {change to 'Stop Printing'}
      SetItem (myMenus[fileMenu], 8, temp);
      printing := TRUE;
      printHdl^^.prJob.pIdleProc := @MainEventLoop;
      GetPort (printport); {get the port to be restored at the top of the
       main event loop}
    END;
    {for now, approximate a full page}
    MyPPort := PrOpenDoc (PrintHdl, NIL, NIL);
    WITH hTE^^, printhdl^^.prinfo DO
    BEGIN
      pagerect := rpage;
      pagerect.left := pagerect.left + leftmargin;
      pagerect.right := pagerect.right - rightmargin;
      pagerect.bottom := pagerect.bottom - bottommargin
      - (pagerect.bottom - bottommargin) MOD lineheight {get rid of partial line};
      temprect := destrect;
      destrect := pagerect;
      TECalText (hTE)
    END;  {TECalText could cause the memory manager to move the hTE and PrintHdl
     handles.  So, the 'WITH' statement is required below; the alternative would
     be to use 1 'WITH' and 'HLock' the handles.  Note that 'WITH' is much more
     than a lexical convenience.  It actually causes the compiler to optimize code
     about the fields of hTE^^ and printhdl^^.prinfo}
    WITH hTE^^, printhdl^^.prinfo DO
    BEGIN
      tmprect2 := viewrect;
      pglen := (rpage.bottom - rpage.top - bottommargin) DIV lineheight;
      finish := nlines;
      start := 0;
      counter := 1;
      WHILE start < finish DO
      BEGIN
        IF finish - start > pglen
        THEN MyLngth[counter] := linestarts[start + pglen] - linestarts[start]
        ELSE MyLngth[counter] := teLength - linestarts[start];
IF debug THEN
BEGIN
  Writeln (debugger,'MyLngth[',counter:1,'] = ', MyLngth[counter]:5, '; start = ', start:5, '; pglen = ', pglen:5, lf);
  Writeln (debugger, 'finish = ', finish:5, '; teLength = ', teLength:5, '; ORD(txt) = ', ord4(txt),lf)
END;
        start := start + pglen;
        counter := counter + 1;
      END; {While start < finish}
      numpages := counter - 1;
      IF NOT finderprint THEN
      BEGIN
        destrect := temprect;
        TECalText (hTE)
      END
    END;
    IF debug THEN Writeln (debugger,'BJDocLoop = ', PrintHdl^^.prjob.BJDocLoop,lf);
    IF PrintHdl^^.prjob.BJDocLoop = BSpoolLoop
    THEN loop := 1
    ELSE loop := PrintHdl^^.prjob.iCopies;
    SetPort (GrafPtr(MyPPort));
    TextFont (applFont);
    DrawChar (' '); SetFontLock (TRUE);
    IF PrintHdl^^.prjob.BJDocLoop <> BSpoolLoop THEN SetCursor (arrow);
    FOR counter := 1 to loop DO
    BEGIN
      Hlock (txt);
      txtptr := txt^;
      FOR count2 := 1 to numpages DO
      BEGIN {if background printing, duplicate txt handle before starting}
        PrOpenPage (MyPPort, NIL);
        TextBox (txtptr, MyLngth[count2], pagerect, teJustLeft);
        PrClosePage (MyPPort);
        txtptr := Pointer (ORD4(txtptr) + MyLngth[count2]);
        start := start + pglen
      END; {For count2}
      HUnlock (txt);
    END; {For counter}
    PrCloseDoc (MyPPort);
    IF PrintHdl^^.prjob.BJDocLoop = BSpoolLoop THEN
    BEGIN
       SetCursor (arrow);
       PRPicFile (Printhdl, NIL, NIL, NIL, status) {omit this for spooled files.}
    END;
    IF canceldialog THEN DisposDialog (dlogptr)
    ELSE
    BEGIN
      disposHandle (txt);
      printing := FALSE;
      GetIndString (temp,256,14); {change to 'Print'}
      SetItem (myMenus[fileMenu], 8, temp);
      SetPort (printport)
    END
  END
END;

{$S EditMenu}
{------------------------------------------------------------------------------------}
Procedure EditMain (theItem: INTEGER; commandkey : BOOLEAN);
const undo = 1;
      cut = 3;
      kopy = 4;     {'Copy' is a Pascal string function}
      paste = 5;
      clear = 6;
      selectAll = 7;
      clipbored = 9; {'ClipBoard' is already used as a windowkind constant}

VAR DeskAccUp , dummy: BOOLEAN;
    Dscrap: PScrapStuff;
    off: LongInt;
    ticks: LongInt;
    tempport: grafptr;
    box: rect;
    itemhdl, hdl: handle;
    typ, io, tempstart, tempend: INTEGER;
    tempptr: ptr;
    TextLength: INTEGER;
    Ptr2ScrapLength: LomemPtr;
    topwindow: WindowPeek;
BEGIN
{Since the Edit menu does so much, it has been broken up into a separate procedure.
 It does not yet support undo, but does support Cutting, Copying and Pasting between
 the Desk Scrap and the TextEdit Scrap.}
  DeskAccUp := FALSE;
  IF (theItem < selectAll) and NOT CommandKey THEN DeskAccUp := SystemEdit(theItem-1);
  topwindow := WindowPeek(FrontWindow);
  IF (theItem > Clear) OR NOT DeskAccUp THEN
  BEGIN
    IF theItem in [cut, kopy] THEN
    BEGIN
       tempend := hTE^^.selend;
       tempstart := hte^^.selstart
    END;
    IF debug THEN Writeln (debugger, 'not system edit', lf);
    { Delay so menu title will stay lit a little only if Command key }
    { equivalent was typed. }
    IF commandkey THEN
    BEGIN
      ticks := TickCount + 10;
      REPEAT UNTIL ticks <= TickCount
    END;
{** see if enough memory exists for move}
    CASE theItem OF
    undo:  ; { no Undo/Z in this example }
    cut:  TECut(hTE);                    { Cut/X }
    kopy:  TECopy(hTE);                  { Copy/C }
    paste:
      BEGIN                        { Paste/V }
        DScrap := InfoScrap;
        IF DScrap^.scrapState <> LastPaste THEN
        BEGIN
          LastPaste := DScrap^.scrapState;
          io := GetScrap (NIL, 'TEXT', off);
          IF debug THEN Writeln (debugger, 'io = ', io);
          IF io > 0 THEN {**?? enough space to paste}
          BEGIN
            io := GetScrap (TEScrapHandle, 'TEXT', off);
            Ptr2ScrapLength := LomemPtr ($AB0);
            Ptr2ScrapLength^ := BitShift (io, 16);{***???***}
          END
        END;
        TEPaste(hTE);
      END;
    clear:  TEDelete(hTE);                    { Clear }
    selectall:  TeSetSelect(0,65535,hTE);     { Select All/A }
    clipbored:  ToggleScrap                   { Show, Hide Clipboard }
    END;    { of item case }
    IF theItem in [cut,kopy] THEN
    BEGIN
      io := ZeroScrap;
      IF debug THEN Writeln (debugger, 'zero scrap err =', io, lf);
      TextLength := GetHandleSize (TEScrapHandle);
      IF debug THEN
Writeln (debugger, 'TEScrapHandle @',ORD4(TEScrapHandle^),'; TextLength = ',textlength,lf);
      Hlock (TEScrapHandle);
      io := PutScrap (TextLength, 'TEXT', TEScrapHandle^);
      IF debug THEN Writeln (debugger, 'put scrap err =', io, lf);
      HUnlock (TEScrapHandle)
    END;
    IF theItem in [cut,clear,paste] THEN Windowdata^^.changed := TRUE;
    IF (theItem in [cut..clear]) THEN ScrollText (TRUE)
  END {not systemedit}
END;  { of editMain }

{$S Command }
{------------------------------------------------------------------------------------}
PROCEDURE MyDisable;
  const newitem = 1;
        openitem = 2;
        closeitem = 3;
        saveitem = 4;
        saveasitem = 5;
        revertitem = 6;
        pagesetupitem = 7;
        printitem = 8;
        quititem = 9;

        undoitem = 1;
        cutitem = 3;
        copyitem = 4;
        pasteitem = 5;
        clearitem = 6;
        selectallitem = 7;
        clipboreditem = 9;

var counter: INTEGER;
    DScrap: PScrapStuff;
    temppeek: windowpeek;
    stycount: styleitem;
    off : LongInt;

{------------------------------------------------------------------------------------}
  PROCEDURE KillFE (fileitems, edititems : edset);
  var counter : INTEGER;
  BEGIN
{This guy disables the items in the File and Edit menus.  This approach has a real
 disadvantage:  If an entire menu should be disabled at some given time, there is
 no convenient way to do a DrawMenuBar here to disable the item in the bar itself.}
    IF debug THEN
    BEGIN
      DebugInProc (proc, 'KillFE', @KillFE);
      Write (debugger, 'file:');
      FOR counter := newitem to quititem DO
       IF counter in fileitems THEN Write (debugger, counter:2, ',');
      Write (debugger, ';  edit:');
      FOR counter := undoitem to clipboreditem DO
       IF counter in edititems THEN Write (debugger, counter:2, ',');
      Writeln (debugger, lf)
    END;
    FOR counter := 1 to 9 DO
    BEGIN
      IF counter in fileitems THEN DisableItem (myMenus[FileMenu], counter);
      IF counter in edititems THEN DisableItem (myMenus[EditMenu], counter);
    END
  END;

BEGIN
{This part goes through all of the applicable elements of the frontmost window, if any
 and from that decides what operations are allowable at this time.}
  IF debug THEN DebugInProc (proc, 'MyDisable', @MyDisable);
  FOR counter := 1 to 9 DO
  BEGIN
    EnableItem (myMenus[FileMenu], counter);
    IF counter in [UndoItem,CutItem..SelectAllItem,ClipboredItem]
      THEN EnableItem (myMenus[EditMenu], counter)
  END;
  IF printing THEN KillFE ([PageSetupItem],[]); {page setup, if printing}
  IF Frontwindow = Nil
  THEN KillFE ([CloseItem..PrintItem],[UndoItem..SelectAllItem])
  ELSE
  BEGIN
    Mypeek := windowPeek (FrontWindow);
    Case Mypeek^.windowkind of
    MyDocument:  BEGIN
          KillFE ([], [UndoItem]);
          IF NOT WindowData^^.titled THEN KillFE ([SaveItem,RevertItem], []);
          IF NOT WindowData^^.changed THEN KillFE ([SaveItem,RevertItem], []);
          IF hTE^^.teLength = 0 THEN
            KillFE ([SaveItem,SaveAsItem,PageSetupItem,PrintItem], [SelectAllItem]);
          IF hTE^^.selstart = hTE^^.selend THEN
            KillFE ([], [CutItem,CopyItem,ClearItem]);
          IF GetScrap (NIL, 'TEXT', off) = noTypeErr THEN KillFE ([], [PasteItem]);
        END;
    Clipboard,FreeMemory:  KillFE ([SaveItem..PrintItem], [UndoItem, CutItem..SelectAllItem]);
      OTHERWISE KillFE ([SaveItem..PrintItem], [SelectAllItem]) {system window}
    END {Case}
  END;
  IF printing THEN EnableItem (MyMenus[filemenu], PrintItem) {stop printing}
END;

{------------------------------------------------------------------------------------}
PROCEDURE DoCommand (commandkey: BOOLEAN);
VAR name, s, str: str255;
    bstr: string[5];
    dummy: size;
    err : BOOLEAN;
    num, refnum, theMenu, theItem: INTEGER;
    tempPeek: WindowPeek;
    mresult, ticks: longint;
    dipeek: DialogPeek;
    box: rect;
    itemhdl: handle;
    typ: INTEGER;
    menuStuff: RECORD CASE INTEGER OF
      1 : (menuResult : LONGINT);        {Information returned by MenuSelect}
      2 : (theMenu,                      {Which menu was selected}
           theItem : INTEGER)            {Which item within the menu}
    END;
BEGIN
{This handles the actions that are initiated through the Menu Manager}
  IF debug THEN DebugInProc (proc, 'DoCommand', @DoCommand);
  MyDisable;
  WITH menuStuff DO
  BEGIN
    IF Commandkey
    THEN menuResult := MenuKey(theChar)
    ELSE menuResult := MenuSelect (myEvent.where);
    CASE theMenu OF
      appleMenu:  {enough memory to allow desk accessory to open}
      BEGIN
        IF theItem = 1
        THEN AboutMyEditor
        ELSE
        BEGIN
          GetItem(myMenus[appleMenu],theItem,name);
          refNum := OpenDeskAcc(name)
        END
      END;
      FileMenu:
      BEGIN
        IF FrontWindow <> NIL THEN
         IF MyPeek^.WindowKind = MyDocument THEN
           IF windowdata^^.titled
           THEN GetWTitle (FrontWindow, str)
           ELSE str := '';
        Case TheItem of
          1:  OpenAWindow;                { New }
          2:  MyGetFile;                  { Open }
          3:  CloseAWindow;               { Close }
          4:  err :=                      { Save }
                WriteFile (windowdata^^.FileVolume, str);
          5:  err := MyPutFile (str);     { Save As }
          6:  BEGIN                       { Revert to Saved }
                IF CautionAlert(257, NIL)=OK THEN
                  err := ReadFile (windowdata^^.FileVolume, str);
                ScrollText (FALSE)  {which is the user interfacy thing to do?
                                     display the top of the file, or display
                                     the position in the file the user was looking @
                                     when he said revert.  Should I also maintain the
                                     flashing caret position?}
              END;
          7:  BEGIN
                PrOpen;
                IF PrStlDialog (PrintHdl)   { Page Setup }
                THEN ;
                PrClose
              END;
                {eventually, store info in document resource fork}
          8:  IF NOT printing             { Print }
              THEN Printflag := TRUE
              ELSE PrSetError(iPrAbort);
          9:  doneFlag := TRUE;           { Quit }
        END
      END;
    EditMenu: EditMain (theItem, commandkey);

  {$IFC BUG > -1}
    100:
      Case theItem OF
      1:  ToggleFree;
      2:  dummy := MaxMem (dummy);
  {$IFC BUG = 1}
      3:  BEGIN
            debug := NOT debug;
            CheckItem (MyMenus[DebugMenu], 3, debug)
          END
  {$ENDC}
      END  { of debug }
  {$ENDC}

    END;    { of menu case }
    HiliteMenu(0)
  END
END;  { of DoCommand }

{------------------------------------------------------------------------------------}
PROCEDURE DrawWindow;
VAR tempPort : GrafPtr;
    tempscrap: handle;
    scraplength, off: longint;
    temprect, rectToErase: rect;
    str: str255;
    tempPeek: WindowPeek;
    whichwindow: windowptr;
    temphTE: TEHandle;
    tempdata: mydatahandle;
BEGIN
{ Draws the content region of the given window, after erasing whatever
  was there before. }
  IF debug THEN DebugInProc (proc, 'DrawWindow', @DrawWindow);
  WhichWindow := WindowPtr (MyEvent.message);
  BeginUpdate(WhichWindow);
  GetPort (tempPort);
  SetPort (WhichWindow);
  tempPeek := WindowPeek (WhichWindow);
  Case tempPeek^.windowkind of
  MyDocument :
    BEGIN
      temprect := WhichWindow^.portrect;
      tempData := MyDataHandle (GetWRefCon (WhichWindow));
      temphTE := tempData^^.TERecord;
      IF tempPeek^.hilited THEN temprect.top := temprect.bottom - 15;
      temprect.left := temprect.right - 15;
      ClipRect (temprect);
      DrawGrowIcon(WhichWindow);
      Cliprect (WhichWindow^.portrect);
      DrawControls (WhichWindow);
      {this only erases the window past the end of text, if any}
      WITH temphTE^^ DO
      IF nlines - topline < (viewrect.bottom - viewrect.top + lineheight)
       DIV lineheight THEN
      BEGIN
        rectToErase := viewrect;
        rectToErase.top := (nlines - topline) * lineheight;
        EraseRect (rectToErase)
      END;
      TEUpdate(WhichWindow^.visRgn^^.rgnBBox, temphTE)
    END;
  ClipBoard :
  BEGIN
    tempscrap := NewHandle (0);
    ScrapLength := GetScrap (tempscrap, 'TEXT', off);
    EraseRect (WhichWindow^.portrect);
    temprect := Whichwindow^.portrect;
    temprect.left := temprect.left + 4;
    temprect.right := temprect.right-15;
    IF ScrapLength > 0 THEN
    BEGIN
      HLock (tempScrap);
      Textbox (tempscrap^, scrapLength, temprect, teJustLeft);
      HUnlock (tempScrap)
    END;
    DisposHandle (tempscrap);
    temprect := WhichWindow^.portrect;
    temprect.left := temprect.right - 15;
    ClipRect (temprect);
    DrawGrowIcon (WhichWindow);
    ClipRect (whichwindow^.portrect)
  END;
{$IFC BUG > -1}
  FreeMemory:
    BEGIN
      EraseRect(whichwindow^.portrect);
      MoveTo (5, 12);
      Write (FreeMem);
    END;
{$ENDC}
  END; {Case}
  SetPort (tempPort);
  EndUpdate(WhichWindow)
END;    { of DrawWindow }

{$S CONTROL}
{------------------------------------------------------------------------------------}
PROCEDURE ScrollBits;
VAR oldvert: INTEGER;
BEGIN
{If the visible information has changed, scroll the window here.}
  IF debug THEN DebugInProc (proc, 'ScrollBits', @ScrollBits);
  oldvert := topline;
  topline := GetCtlValue(vScroll);
  TEScroll (0, (oldvert - topline)*hTE^^.lineheight, hTE)
END;

{------------------------------------------------------------------------------------}
PROCEDURE TrackScroll(theControl: ControlHandle; partCode: INTEGER);
{This routine adjusts the value of the scrollbar.}
Var amount, StartValue : INTEGER;
    up : BOOLEAN;
BEGIN
  up := partcode IN [inUpButton, inPageUp]; {TRUE if scrolling page up}
  StartValue := GetCtlValue (theControl);  {the initial control value}
  IF {the scrollbar value is decreased, and it is not already at the minimum}
     ((up AND (StartValue > GetCtlMin (theControl)))
  OR {the scrollbar value is increased, and it is not already at the maximum}
     ((NOT up) AND (StartValue < GetCtlMax (theControl))))
  AND {to prevent tracking as the page up or down area disappears}
     (whichpart = partCode)
  THEN
  BEGIN
    IF up THEN amount := -1 ELSE amount := 1;  {set the direction}
    IF partCode IN [inPageUp, inPageDown] THEN {change the movement to a full page}
    WITH HTE^^.viewrect DO
      amount := amount * (bottom - top) DIV hTE^^.lineheight;
    SetCtlValue(theControl, StartValue+amount);
    ScrollBits
  END
END; {of TrackScroll}

{------------------------------------------------------------------------------------}
PROCEDURE MyControls;
Var t, code: INTEGER;
    AControl: ControlHandle;
    dummy: INTEGER;
BEGIN  {controls}
{This routine handles the scrollbar}
  IF debug THEN DebugInProc (proc, 'MyControls', @MyControls);
  whichPart := FindControl (MyPoint, MyWindow, AControl);
IF debug THEN Writeln (debugger, 'whichpart = ', whichpart, lf);
IF debug THEN Writeln (debugger, 'ORD( AControl = ', ORD ( AControl), lf);
  {adjust scrollbar range}
  IF AControl <> NIL THEN
  BEGIN
    VScroll := AControl;
    IF whichPart = inThumb THEN
    BEGIN
      dummy := TrackControl (VScroll, MyPoint, NIL);
      ScrollBits
    END {of whichpart}
    ELSE dummy := TrackControl (VScroll, MyPoint, @TrackScroll)
  END {AControl <> NIL}
END; {controls}

{$S Initial }
{------------------------------------------------------------------------------------}
PROCEDURE SetUp;
VAR counter, vRefNum : INTEGER;
    DScrap : PScrapStuff;
    hdl, hAppparms : handle;
    off : longint;
    apName : Str255;
    NameHdl : Handle;
    strhdl : StringHandle;
    dummyrect : rect;
    dummy : BOOLEAN;
    FinderFile : INTEGER;
    myport : GrafPtr;
    message : INTEGER;
    document : appFile;
    temprgn: rgnhandle;
    extdebug: Str255;

BEGIN
{Initialization for a variety of things is done here.  This code is 'discarded'
 after it is executed by an UnLoadSeg.  Another good way of initializing a large
 number of variables would be to create a custom resource which contains initial
 values for all globals.  Then, if the globals are fields in a handle, a single
 'GetResource' would initialize all fields.}
  InitFonts;                  {I need fonts}
  FlushEvents(everyEvent,0);  {start with a clean slate}
  TEInit;                     {I need TextEdit}
  InitDialogs(NIL);           {and I need dialogs, even when printing from Finder}
  PrintHdl := THPrint (NewHandle (SizeOf(TPrint)));
  PrOpen;
  PrintDefault (PrintHdl);
  getAppParms(apName,vRefNum,hAppParms);
  {** one day, get file info for apName, to use folder info as appropriate}
  iBeamHdl := GetCursor(IBeamCursor);
  HNoPurge (Handle(iBeamHdl));{???}
  watchHdl := GetCursor(WatchCursor);
  HNoPurge (Handle(watchHdl));{???}
  CountAppFiles(message, numfiles);
  IF debug THEN Writeln (debugger, 'numfiles=',numfiles,lf);
  finderprint := (message = 1);
  IF finderprint {User selected 'print' from the Finder} THEN
  BEGIN
    GetWMgrPort (myPort);
    SetPort (myPort);
    temprgn := NewRgn;
    GetClip (temprgn);
    dummyrect := screenbits.bounds;
    dummyrect.bottom := dummyrect.top + 16;
    ClipRect (dummyrect);
    TextBox (pointer(ORD(@apName)+1),ORD(Length(apName)),dummyrect,teJustCenter);
    SetClip (temprgn);
    DisposeRgn (temprgn);
    FOR FinderFile := 1 to numfiles DO
    BEGIN
      GetAppFiles(FinderFile, document);
      WITH document DO
      IF ftype = 'TEXT' THEN
      BEGIN
        dummyrect := screenbits.bounds;
        dummyrect.bottom := dummyrect.top + 16;
        InsetRect (dummyrect,10,2);
        SetPort (myPort);                   {to allow text measure in TeCalText}
        hTE := TENew(dummyrect, dummyrect);
        dummy := ReadFile (vRefNum, fName); {assume that page setup is read in as well}
        Unloadseg (@ReadFile);
        MyPrint(FinderFile, fName);
        SetCursor (watchhdl^^);
        TEDispose (hTE); {dispose of text edit stuff}
        ClrAppFiles (FinderFile)
      END
    END;
    hTE := NIL;
    PrClose
  END
  ELSE
  BEGIN
    PrClose;
    InitMenus;   { initialize Menu Manager }
    myMenus[appleMenu] := GetMenu(appleMenu);
    AddResMenu(myMenus[1],'DRVR');    { desk accessories }
    FOR counter := FileMenu to EditMenu DO myMenus[counter] := GetMenu(counter);
  {$IFC BUG > -1}
    myMenus[DebugMenu] := GetMenu(100);       { temporary debug menu }
  {$ENDC}
  {$IFC BUG = 1}
    GetIndStr (extdebug,257,1);
    AppendMenu (myMenus[DebugMenu], extdebug);
    CheckItem (MyMenus[DebugMenu], 3, debug);
  {$ENDC}
    FOR counter:=1 TO lastMenu DO InsertMenu(myMenus[counter],0);
    DrawMenuBar;
    dragRect := screenbits.bounds;
    dragrect.top := dragrect.top + 20; {leave room for menu bar}
    growRect := dragRect;
    InsetRect (dragrect, 4, 4); {leave some of dragged rectangle on screen}
    growrect.left := {replace this with the max font width + constant} 80;
    growrect.top := 80 {18 + 16*3 + slop?};
    doneFlag := FALSE;
    printflag := FALSE;
    printing := FALSE;
    windownum := 1;
    windowpos := 0;
    MyFileTypes[0] := 'TEXT';
    DScrap := InfoScrap;
    LastCount := DScrap^.scrapCount - 1;
    LastPaste := LastCount;
    Scrapwind := NIL;
    FOR counter := 1 to numfiles DO
    BEGIN
      GetAppFiles (counter, document);
      WITH document DO
      IF ftype = 'TEXT' THEN
      BEGIN
        MakeAWindow (fName, TRUE); {**could async open while this is going on}
        IF counter < numfiles THEN DialogueDeactivate;
        IF NOT ReadFile (vRefNum, fName) THEN
        BEGIN
          TEDispose (hTE);
          hTE := NIL;
          DisposHandle (Handle (WindowData));
          DisposeWindow (MyWindow)
        END
      END
    END;
    IF Frontwindow = NIL THEN OpenaWindow;
  {$IFC BUG > -1}
    Freewind := NIL
  {$ENDC}
  END
END;    { of SetUp}

{$S          }
{------------------------------------------------------------------------------------}
PROCEDURE CursorAdjust;
VAR mousePt:  Point;
    tempport: grafptr;
    temppeek: Windowpeek;
BEGIN
{ Take care of application tasks which should be executed when the machine has
  nothing else to do, like changing the cursor from an arrow to an I-Beam when it
  is over text that can be edited. }
{$IFC BUG >-1}
{ If the amount of free memory is being displayed in its own window, and if it has
  changed, then create an update event so that the correct value will be displayed.}
  IF (FreeWind <> NIL)
  AND (FreeMem <> OldMem) THEN
  BEGIN
    OldMem := FreeMem;
    GetPort (tempport);
    SetPort (FreeWind);
    InvalRect (FreeWind^.portrect);
    SetPort (tempport)
  END;
{$ENDC}
  GetMouse(mousePt); {where the cursor is, currently (local to the topmost window)}
  IF hTE <> NIL {if text edit is currently active, (document window is topmost)}
  THEN
  BEGIN
    TEIdle (hTE);
    IF (PtInRect(mousePt, hTE^^.viewrect)) {In the text edit viewrect area,}
    THEN SetCursor(iBeamHdl^^)             { make the cursor an I-beam.}
    ELSE SetCursor(arrow)
  END
  ELSE
  BEGIN
    {let desk accessories set their own?}
    temppeek := windowPeek(FrontWindow);
    IF temppeek = NIL THEN SetCursor (arrow)
    ELSE IF temppeek^.windowkind > 1 THEN SetCursor (Arrow)
  END
END;

{------------------------------------------------------------------------------------}
FUNCTION MyGrowZone;
BEGIN
{This function is called by the memory manager whenever more memory is requested than
 available.  The only time you'll see it in this program is when it initally runs
 (which is normal) and when it is not checking memory availability when it should.
 Your program should not rely on resolving memory problems here, because it could be
 called by the ROM, where, at present, insufficient memory cases are not always
 handled gracefully.}
  IF GZCritical THEN
  BEGIN
    IF debug THEN Writeln (debugger, 'myGrow cbneeded = ', cbneeded, lf);
    {Make all data stuctures, including user data, that can be safely released,
     purgable.  If the user has data in memory that has not yet been saved, and if
     you were not expecting this routine to be called, then the call came from ROM
     and is important to give the user the chance to save their work.  Even if
     their data is successfully saved, it is likely that the program will have to
     restart or quit to the Finder.}
    {could unload segment EditMain and others?  Zero scrap?}
    SetFontLock (FALSE); {at least let go of the application font}
  END;
  MyGrowZone := 0 {for now, the memory requests fails unconditionally}
END;

{------------------------------------------------------------------------------------}
PROCEDURE MainEventLoop;
Var code: INTEGER;                 {the type of mousedown event}
    dummy: BOOLEAN;
    str : str255;
    tempport : Grafptr;
    DScrap: PScrapstuff;
BEGIN
{This event loop handles most of the communications between this program and events
taking place in the outside world.  This procedure is also called as the printer
idle procedure so that the program appears to be doing background printing.}

  IF printing THEN
  BEGIN
    getport (tempport);
    setport (printport)
  END;
  REPEAT
    CursorAdjust;
    SystemTask;
{See if a desk accessory has changed the scrap.  If so, create an update event to
 redraw the clipboard.}
    DScrap := InfoScrap;
    IF (DScrap^.scrapCount <> LastCount) AND (ScrapWind <> NIL) THEN
    BEGIN
      LastCount := DScrap^.scrapCount;
      Getport (tempport);
      Setport (scrapwind);
      InvalRect (scrapwind^.portrect);
      Setport (tempport)
    END;
    IF printflag THEN
    BEGIN
      GetWTitle (MyWindow, str);
      PrOpen;
      Myprint(1, str); {number of files to print, what to call it}
      PrClose
    END;
    IF GetNextEvent(everyEvent,myEvent) THEN
    CASE myEvent.what OF
    mouseDown:
      BEGIN
        code := FindWindow(myEvent.where,tempWindow);

        CASE code OF
          inMenuBar: DoCommand(FALSE);
          inSysWindow: SystemClick(myEvent,tempWindow);
          inDrag: DragWindow(tempWindow,myEvent.where,dragRect);
          inGoAway: IF TrackGoAway(tempWindow,myEvent.where) THEN CloseAWindow;
          inGrow: IF Mypeek^.windowkind in [MyDocument,Clipboard] THEN GrowWnd;

          inContent:
            BEGIN
              IF tempWindow <> FrontWindow
              THEN  SelectWindow (tempWindow)
              ELSE
              IF hTE <> NIL THEN
              BEGIN
                MyPoint := MyEvent.where;
                GlobalToLocal (MyPoint);
                IF PtInRect (MyPoint, hTE^^.viewrect)
                THEN
                BEGIN
                  IF debug THEN Writeln (debugger, 'point in HTE viewrect', lf);
                  IF (BitAnd (myEvent.modifiers, ShiftKey) <> 0 ) { Shift key pressed }
                  THEN TEClick (MyPoint, TRUE, hTE)
                  ELSE TEClick (MyPoint, FALSE, hTE);
                END
                ELSE MyControls
              END { hTE <> NIL }
            END { in Content }
          END { of code case }
        END; { of mouseDown }

      keyDown, autoKey:
        BEGIN
          theChar := CHR(BitAnd(myEvent.message,255)); { Mac characters use 8 bits }
          IF BitAnd(myEvent.modifiers,CmdKey) <> 0     { Command key pressed }
          THEN DoCommand(TRUE)
          ELSE IF hTE <> NIL THEN
          BEGIN
            TEKey(theChar,hTE);
            windowdata^^.changed := TRUE;
            ScrollText (TRUE);
          END
        END;    { of keyDown }

      activateEvt: MyActivate;
      updateEvt: DrawWindow;
    END         { of event case }
    ELSE
      IF (Myevent.what = nullEvent) AND doneflag AND (FrontWindow <> NIL)
      THEN CloseAWindow;
    UnloadSeg (@ScrollText);     {segment Utilities}
    UnloadSeg (@ReadFile);       {segment ReadFile}
    UnloadSeg (@WriteFile);      {segment WritFile}
    UnloadSeg (@AboutMyEditor);  {segment AboutMyPgm}
    UnloadSeg (@DoCommand);      {segment DoCommand}
    UnloadSeg (@EditMain);       {segment EditMenu}
    UnloadSeg (@MyControls);     {segment Control}
    IF NOT printing THEN UnloadSeg (@MyPrint);
  UNTIL (doneFlag AND (FrontWindow = NIL)) OR Printing;
  IF doneFlag AND (FrontWindow = NIL) THEN
  BEGIN
    ClearMenuBar;  {prevent the user from doing anything until printing is through}
    DrawMenuBar;
    SetCursor (watchhdl^^)
  END;
  IF printing THEN
  BEGIN
    getport (printport);
    setport (tempport)
  END
END;

BEGIN    { main program }
{Some things need to be set up outside of the initialization segment, to allow the
 nonrelocatable objects that they create to be located as low in memory as possible.}
{$IFC BUG = 1}   {This code is only included for external terminal debugging}
  debug := FALSE;{if you want debugging on as soon as the program starts, set it here}
  Reset (debugger, '.BOUT'); {the serial port not used for downloading from Lisa}
{$ENDC}

  IF debug THEN
  BEGIN
    Writeln (debugger, lf, lf);
    DebugInProc (proc, 'SetUp', @Setup)
  END;

{The program only executes the code when it is first run, but it could have gotten
 here in two ways.  The user may have opened the application or one of its
 documents, or the user may have chosen to print a document.  In any case, some
 common initialization is needed.}

  SetGrowZone (@MyGrowZone);  {just in case something goes wrong..}
{The application needs to grow the heap to the maximum size, but does not want to
 purge any of the preloaded resources.  This also is an example of how to
 examine low memory locations from Pascal.}
  applLimit := LomemPtr($130);
  heapEnd := LomemPtr($114);
  dummy := NewHandle (applLimit^-heapEnd^-1024);
  DisposHandle (dummy);
  MoreMasters; MoreMasters; MoreMasters;
  InitGraf(@thePort);         {I need QuickDraw}
  InitWindows;                {I need windows}

  SetUp;
  UnloadSeg (@Setup);
  IF NOT finderprint THEN MainEventLoop;
  SetCursor (watchHdl^^);
END.
wn:
      BEGIN
        code := FindWindow(myEvent.where,tempWindow);

        CASE code OF
          inMenuBar: DoCommand(FALSE);
          inSysWindow: SystemClick(myEvent,tempWindow);
          inDrag: DragWindow(tempWindow,myEvent.where,dragRect);
          inGoAway: IF TrackGoAway(tempWindow,myEvent.where) THEN CloseAWindow;
          inGrow: IF Mypeek^.windowkind in [MyDocument,Clipboard] THEN GrowWndsumacc/ws/example/fileasm   444      0     12       11015  3472707173  10760 3. "6F^5D!$^N^'^'                                                                            ;    Example/FileAsm
;    an example of how to call assembly from Pascal, and Pascal from assembly
;
;  MODIFICATION HISTORY
;
;     06-Feb-84  CRC  New Today
;     26-Jun-84  CRC  Changed to use AutoScroll to use Pascal proc TrackScroll
;                     NewPtrClear stolen from Rony Sebok's "NewPtr" in OSTraps
;
;-----------------------------------------------------------------------------------
;
;     Procedure AutoScroll;
;
; The location of this procedure is passed to TextEdit in the clikLoop field.
; It is called by TextEdit when the user drags a selection range outside of the
; viewrect.  This calls the pascal procedures TrackScroll to cause the screen to
; scroll, if possible, and the selection range to be extended.
;
;-----------------------------------------------------------------------------------
;
                .NOLIST
                .INCLUDE TlAsm/GrafTypes.Text
                .INCLUDE TlAsm/QuickMacs.Text
                .INCLUDE TlAsm/SysEqu.Text
                .INCLUDE TlAsm/SysMacs.Text
                .INCLUDE TlAsm/ToolEqu.Text
                .INCLUDE TlAsm/ToolMacs.Text
                .LIST

                .PROC    AutoScroll,0

;offsets for Pascal globals

MyWindow        .EQU     -4                       ;offset for current application window
VScroll         .EQU     -20                      ;the window's vertical scroll bar
whichPart       .EQU     -22                      ;the last button pushed
                .REF     TrackScroll

;Get the mouse location to see if scrolling is required
                PEA     temppoint
                _GetMouse                         ;get local mouse point to D0
                MOVE.W  temppoint,D0

;Check if we're in the text rect.  TextEdit passes the currently edited record in A3.
                LEA     Condition,A0              ;a place to store the condition code
                CMP.W   TEViewRect+Top(A3),D0     ;compare with the viewrect top
                BLT.S   OutOfRect                 ;branch if mouse moves above top
                CMP.W   TEViewRect+Bottom(A3),D0  ;is mouse below the bottom?
                BLE.S   NoMove                    ;no, don't scroll.

;TextEdit sets the clip region to the viewrect.  To allow the scrollbar to be redrawn,
;the clip is set to the entire window.
OutOfRect       MOVE    SR,(A0)                   ;save whether outside top, bottom
                MOVE.L  MyWindow(A5),A0           ;global MyWindowPtr
                PEA     PortRect(A0)              ;global MyWindowPtr^.portrect
                _ClipRect                         ;set the application's clip
                MOVE.L  VScroll(A5),-(SP)         ;push handle for scroll, below
;now scroll up or down
                MOVE    Condition,CCR             ;get back top or bottom condition
                BLT.S   OffTop

;We're off the bottom.  Act as if the user is pressing scrollbar's down arrow
                MOVE.W  #inDownButton,-(SP)       ;scroll down.
                BRA.S   OT2                       ;go scroll it

;We're off the top.  Do a scroll Up.
OffTop          MOVE.W  #inUpButton,-(SP)         ;Scroll up.
OT2             MOVE.W  (SP), whichPart(A5)       ;satisfy TrackScroll condition
                JSR     TrackScroll               ;Pascal routine.
                PEA     TEViewRect(A3)
                _ClipRect                         ;restore TextEdit's clip region

;a non-zero code returned in DO tells TextEdit to stay in the TEClick routine.
NoMove          MOVEQ   #-1,D0                    ;return non-zero to stay in TEClick
                RTS

Condition
temppoint       .LONG   0

;-----------------------------------------------------------------------------------
;
; Function NewPtrClear(byteCount: Size): Ptr;
;
; Returns a pointer to a newly allocated non-relocatable block of memory byteCount
; bytes long.  NewPtr will set the area of memory reserved by it to zero if the
; 'clear' bit in the NewPtr trap is set.  NewHandle has a 'clear' bit as well.
;
;-----------------------------------------------------------------------------------

                .FUNC   NewPtrClear
                .REF    SaveRetA1

                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,D0        ;get the byte count
                _NewPtr ,CLEAR          ;ask OS to do request
                Move.L  A0,(SP)         ;return result ptr on stack
                JMP     SaveRetA1       ;save result code and return via A1

                .END
               .INCLUDE TlAsm/SysEqu.Text
                .INCLUDE TlAsm/SysMacs.Text
                .INCLUDE TlAsm/ToolEqu.Text
                .INCLUDE TlAsm/ToolMacs.Text
                .LIST

                .PROC    AutoScroll,0

;offsets for Pascal globals

MyWindow        .EQU     -4                       ;offset for current application window
VScroll         .EQU     -20                      ;the window's vertical scroll bar
whichPart       .EQU     -22                      ;the last sumacc/ws/example/filer   444      0     12       10310  3472707173  10436 3. "6F^5D!$^C*  FileResDef -- Resource input for sample application named File
*                Written by Macintosh User Education

Example/File.Rsrc

Type CARY = STR
,0 (32)
File, by Cary Clark   Version 1.0    July 3, 1984

Type FREF
,128
APPL 0
,129
TEXT 1

Type BNDL
,128
CARY 0
2
ICN# 2
0 128
1 129
FREF 2
0 128
1 129

Type ICN#
,128
2
00000000
00000000
00000000
00020000
00050000
00088038
00104044
00202082
00401102
00800A82
01000544
02000AA8
04001550
08002AA0
10005540
2000AAA0
40001510
80010A08
40000410
20030820
1003A040
08038080
04000100
02000200
01000400
00800800
00401000
00202000
00104000
00088000
00050000
00020000
00000000
00000000
00000000
00020000
00070000
000F8038
001FC07C
003FE0FE
007FF1FE
00FFFBFE
01FFFFFC
03FFFFF8
07FFFFF0
0FFFFFE0
1FFFFFC0
3FFFFFE0
7FFFFFF0
FFFFFFF8
7FFFFFF0
3FFFFFE0
1FFFFFC0
0FFFFF80
07FFFF00
03FFFE00
01FFFC00
00FFF800
007FF000
003FE000
001FC000
000F8000
00070000
00020000
,129
2
0FFFF800
08000400
08000600
08000500
08000480
08000438
08000444
08000682
08000102
08000282
08000544
08000AA8
08001550
08002AA0
08005550
0800AA90
08001510
08010A10
08000410
08030810
0803A010
08038010
08000010
08000010
08000010
08000010
08000010
08000010
08000010
08000010
08000010
0FFFFFF0
0FFFF800
0FFFFC00
0FFFFE00
0FFFFF00
0FFFFF80
0FFFFFF8
0FFFFFFC
0FFFFFFE
0FFFFFFE
0FFFFFFE
0FFFFFFC
0FFFFFF8
0FFFFFF0
0FFFFFE0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0
0FFFFFF0



Type MENU
  ,1 (4)
  \14
    About File
    (-

  ,2 (4)
  File
    New
    Open
    Close
    Save
    Save As
    Revert to Saved
    Page Setup
    Print
    Quit

  ,3 (4)
  Edit
    Undo/Z
    (-
    Cut/X
    Copy/C
    Paste/V
    Clear
    Select All/A
    (-
    Show Clipboard

  ,100 (4)
  Debug
    Show FreeMem
    Compact Memory

* document window
Type WIND
  ,256 (32)
x
  50 30 158 482
  Visible NoGoAway
  2
  0

  ,257 (32)
Clipboard
  262 4 337 446
  Visible GoAway
  0
  0

  ,258 (32)
FreeMem
  320 442 339 511
  Visible NoGoAway
  0
  0

* vertical scroll bar
Type CNTL
  ,256 (4)
x
  -1 395 236 411
  invisible
  16
  0
  0 0 0

Type DITL
  ,256 (32)
  4
    BtnItem Enabled
    65 13 85 83
Yes

    BtnItem Enabled
    95 300 115 370
Cancel

    BtnItem Enabled
    95 13 115 83
No

    StatText Disabled
    8 60 60 370
Do you want to save changes made to '^0'^1?

  ,257 (32)
  3

    BtnItem Enabled
    90 267 110 337
OK

    StatText Disabled
    10 60 70 350
An error occured while ^0 the disk.  The file '^1' was not ^2.

    StatText Disabled
    90 10 110 260
^3

  ,258 (32)
  3

    BtnItem Enabled
    62 300 82 370
Cancel

    StatText Disabled
    5 10 60 370
The document '^0' is being spooled to disk and printed.

    StatText Disabled
    62 10 82 270
^1 of ^2.

  ,259 (32)
  3

    BtnItem Enabled
    90 13 110 83
OK

    BtnItem Enabled
    90 267 110 337
Cancel

    StatText Disabled
    10 60 70 350
Are you sure you want to go back to the old version of this file?  You will lose any changes that you have made.

  ,260 (32)
  3

    BtnItem Enabled
    90 13 110 83
OK

    BtnItem Enabled
    90 267 110 337
Cancel

    StatText Disabled
    10 60 70 350
A file by that name is already open.  '^0' will be opened instead.

Type DLOG
* this is the 'press cancel to stop printing' dialog
  ,257 (32)
  40 66 125 446
  Visible 1 NoGoAway 0
  258

Type ALRT
* a stop alert - an error occured while reading or writing the disk
  ,256 (32)
  60 81 180 431
  257
  5555

* a caution alert - a file is changed and 'Revert to Saved' is chosen
  ,257 (32)
  60 81 180 431
  259
  CCCC

* a note alert - the file selected is already on the desktop
  ,258 (32)
  60 81 180 431
  260
  CCCC

* a caution alert - the file is being closed, but has not yet been saved
  ,259 (32)
  60 66 180 446
  256
  4444

 Type STR#
  ,256 (36)
Untitled-
Save this document as:
This example was written to demonstrate the Macintosh User Interface.
Show Clipboard
Hide Clipboard
-6
-7
 before quitting
reading from
writing to
loaded
saved
-13
Print
Stop Printing
Copy of\20
This disk is full.
The disk directory is full.
This file
The disk is locked.
The disk is unreadable.
ID =\20

  ,257 (36)
External Debugger
Show FreeMem
Hide FreeMem

Type CODE
  Example/fileL,0
            ;no, don't scroll.

;TextEdit sets the clip region to the viewrect.  To allow the scrollbar to be redrawn,
;the clip is set to the entire window.
OutOfRect       MOVE    SR,(A0)                   ;save whether outside top, bottom
                MOVE.L  MyWindow(A5),A0           ;global MyWindowPtr
sumacc/ws/example/grow   444      0     12       27307  3472707173  10331 5"S@nHnHz^
{$X-}
PROGRAM Grow;

  { Grow -- Scroll bars and a resizable window added to Edit }
  {         by Cary Clark, Macintosh Technical Support       }
  { SK 6/23  Added if GetNextEvent, SetPort in update event }

  {This program is a sample.  Don't use it as a skeleton or template; instead,
   understand each line and redo it yourself, only better!}
  { Note: you can now find a much better way to do scrolling in
    Example/Scroll.text}


   USES {$U-}
      {$U Obj/Memtypes    } Memtypes,
      {$U Obj/QuickDraw   } QuickDraw,
      {$U Obj/OSIntf      } OSIntf,
      {$U Obj/ToolIntf    } ToolIntf;

   CONST
      lastMenu = 3; { number of menus }
      appleMenu = 1; { menu ID for desk accessory menu }
      fileMenu = 256; { menu ID for File menu }
      editMenu = 257; { menu ID for Edit menu }

   VAR
      myMenus: ARRAY [1..lastMenu] OF MenuHandle;
      growRect,dragRect,pRect,tRect: Rect;
      doneFlag,temp: BOOLEAN;
      myEvent: EventRecord;
      code,refNum,MyControl,t: INTEGER;
      wRecord: WindowRecord;
      theWindow,whichWindow: WindowPtr;
      theMenu,theItem: INTEGER;
      theChar: CHAR;
      ticks: LongInt;
      hTE: TEHandle;
      hCurs: CursHandle;
      iBeam: Cursor;
      hScroll,vScroll,whichControl: ControlHandle;
      TheOrigin: point;
      savePort: GrafPtr;

   PROCEDURE SetUpMenus;
   { Once-only initialization for menus }

      VAR
         i: INTEGER;

      BEGIN
         InitMenus; { initialize Menu Manager }
         myMenus[1] := GetMenu(appleMenu);
         AddResMenu(myMenus[1],'DRVR'); { desk accessories }
         myMenus[2] := GetMenu(fileMenu);
         myMenus[3] := GetMenu(editMenu);
         FOR i := 1 TO lastMenu DO InsertMenu(myMenus[i],0);
         DrawMenuBar;
      END; { of SetUpMenus }

   PROCEDURE CursorAdjust;
   { Makes cursor be I-beam inside the (active) application window's }
   { content region (except for size box and scroll bar areas). }

      VAR
         mousePt: point;

      BEGIN
         GetMouse(mousePt);
         IF theWindow=FrontWindow THEN
            BEGIN
            IF (PtInRect(mousePt,pRect)) THEN
               SetCursor(iBeam)
            ELSE
               SetCursor(arrow);
            END;
      END;

   PROCEDURE DoCommand(mResult: LongInt);

      VAR
         name: STR255;

      BEGIN
         theMenu := HiWord(mResult); theItem := LoWord(mResult);
         CASE theMenu OF

            appleMenu:
               BEGIN
               GetItem(myMenus[1],theItem,name);
               refNum := OpenDeskAcc(name);
               END;

            fileMenu: doneFlag := TRUE; { Quit }

            editMenu:
               BEGIN
               IF NOT SystemEdit(theItem-1) THEN
                  BEGIN
                  SetPort(theWindow);
                  ClipRect(pRect);

               { Delay so menu title will stay lit a little while if Command key }
                  { equivalent was typed. }
                  if myEvent.what <> mouseDown
                     then Delay (30, ticks);

                  CASE theItem OF

                     3: TECut(hTE);

                     4: TECopy(hTE);

                     5: TEPaste(hTE);

                  END; { of item case }
                  END;
               END; { of editMenu }

         END; { of menu case }
         HiliteMenu(0);

      END; { of DoCommand }

   PROCEDURE MoveScrollBars;

      BEGIN
         WITH theWindow^.portRect DO
            BEGIN
            HideControl(vScroll);
            MoveControl(vScroll,right-15,top-1);
            SizeControl(vScroll,16,bottom-top-13);
            ShowControl(vScroll);
            HideControl(hScroll);
            MoveControl(hScroll,left-1,bottom-15);
            SizeControl(hScroll,right-left-13,16);
            ShowControl(hScroll)
            END
      END;

   PROCEDURE ResizePRect;

      BEGIN
         pRect := thePort^.portRect;
         pRect.left := pRect.left+4; pRect.right := pRect.right-15;
         pRect.bottom := pRect.bottom-15
      END;

   PROCEDURE GrowWnd(whichWindow: WindowPtr);
   { Handles growing and sizing the window and manipulating }
   { the update region. }

      VAR
         longResult: LongInt;
         height,width: INTEGER;
         tRect: Rect;

      BEGIN
         longResult := GrowWindow(whichWindow,myEvent.where,growRect);
         IF longResult=0 THEN EXIT(GrowWnd);
         height := HiWord(longResult); width := LoWord(longResult);

         { Add the old "scroll bar area" to the update region so it will }
         { be redrawn (for when the window is enlarged). }
         tRect := whichWindow^.portRect; tRect.left := tRect.right-16;
         InvalRect(tRect);
         tRect := whichWindow^.portRect; tRect.top := tRect.bottom-16;
         InvalRect(tRect);

         { Now draw the newly sized window. }
         SizeWindow(whichWindow,width,height,TRUE);
         MoveScrollBars;
         ResizePRect;

         { Adjust the view rectangle for TextEdit. }
         hTE^^.viewRect := pRect;

         { Add the new "scroll bar area" to the update region so it will }
         { be redrawn (for when the window is made smaller). }
         tRect := whichWindow^.portRect; tRect.left := tRect.right-16;
         InvalRect(tRect);
         tRect := whichWindow^.portRect; tRect.top := tRect.bottom-16;
         InvalRect(tRect);
      END; { of GrowWnd }

   PROCEDURE DrawWindow(whichWindow: WindowPtr);
   { Draws the content region of the given window, after erasing whatever }
   { was there before. }

      VAR
         i: INTEGER;

      BEGIN
         ClipRect(whichWindow^.portRect);
         EraseRect(whichWindow^.portRect);
         DrawGrowIcon(whichWindow);
         DrawControls(whichWindow);
         TEUpdate(pRect,hTE)
      END; { of DrawWindow }

   PROCEDURE ScrollBits;

      VAR
         oldOrigin: point;
         dh,dv: INTEGER;

      BEGIN
         WITH theWindow^ DO
            BEGIN
            oldOrigin := TheOrigin;
            TheOrigin.h := 4*GetCtlValue(hScroll);
            TheOrigin.v := 4*GetCtlValue(vScroll);
            dh := oldOrigin.h-TheOrigin.h;
            dv := oldOrigin.v-TheOrigin.v;
            TEScroll(dh,dv,hTE)
            END
      END;

   PROCEDURE ScrollUp(whichControl: ControlHandle; theCode: INTEGER);

      BEGIN
         IF theCode=inUpButton THEN
            BEGIN
            SetCtlValue(whichControl,GetCtlValue(whichControl)-1);
            ScrollBits
            END
      END;

   PROCEDURE ScrollDown(whichControl: ControlHandle; theCode: INTEGER);

      BEGIN
         IF theCode=inDownButton THEN
            BEGIN
            SetCtlValue(whichControl,GetCtlValue(whichControl)+1);
            ScrollBits
            END
      END;

   PROCEDURE PageScroll(code,amount: INTEGER);

      VAR
         myPt: point;

      BEGIN
         REPEAT
            GetMouse(myPt);
            IF TestControl(whichControl,myPt)=code THEN
               BEGIN
               SetCtlValue(whichControl,GetCtlValue(whichControl)+amount);
               ScrollBits
               END
         UNTIL NOT StillDown;
      END;

   BEGIN { main program }
      InitGraf(@thePort);
      InitFonts;
      FlushEvents(everyEvent,0);
      InitWindows;
      SetUpMenus;
      TEInit;
      InitDialogs(NIL);
      SetCursor(arrow);
      SetRect(dragRect,4,24,508,338);
      SetRect(growRect,100,60,512,302);
      doneFlag := FALSE;

      theWindow := GetNewWindow(256,@wRecord,POINTER(-1));
      SetPort(theWindow);
      theWindow^.txFont := 2;

      ResizePRect;
      hTE := TENew(pRect,pRect);
      hCurs := GetCursor (iBeamCursor);  iBeam := hCurs^^;

      vScroll := GetNewControl(256,theWindow);
      hScroll := GetNewControl(257,theWindow);
      TheOrigin.h := 0; TheOrigin.v := 0;

      REPEAT
         CursorAdjust;
         SystemTask;
         TEIdle(hTE);
         if GetNextEvent(everyEvent,myEvent) then
         CASE myEvent.what OF

            mouseDown:
               BEGIN
               code := FindWindow(myEvent.where,whichWindow);
               CASE code OF

                  inMenuBar: DoCommand(MenuSelect(myEvent.where));

                  inSysWindow: SystemClick(myEvent,whichWindow);

                  inDrag: DragWindow(whichWindow,myEvent.where,dragRect);

                  inGoAway:
                     IF TrackGoAway(whichWindow,myEvent.where) THEN
                        doneFlag := TRUE;

                  inGrow:
                     IF whichWindow=FrontWindow THEN
                        GrowWnd(whichWindow)
                     ELSE
                        SelectWindow(whichWindow);

                  inContent:
                     BEGIN
                     IF whichWindow<>FrontWindow THEN
                        SelectWindow(whichWindow)
                     ELSE
                        BEGIN {front}
                        GlobalToLocal(myEvent.where);
                        IF PtInRect(myEvent.where,pRect) THEN
                           IF BitAnd(myEvent.modifiers,512)<>0 { Shift key pressed
                                 }
                              THEN
                              TEClick(myEvent.where,TRUE,hTE)
                           ELSE
                              TEClick(myEvent.where,FALSE,hTE)
                        ELSE
                           BEGIN {controls}
                           MyControl := FindControl(myEvent.where,whichWindow,
                                                    whichControl);
                           CASE MyControl OF
                              inUpButton:
                                 t := TrackControl(whichControl,myEvent.where,
                                                   @ScrollUp);
                              inDownButton:
                                 t := TrackControl(whichControl,myEvent.where,
                                                   @ScrollDown);
                              inPageUP: PageScroll(MyControl,-10);
                              inPageDown: PageScroll(MyControl,10);
                              inThumb:
                                 BEGIN
                                 t := TrackControl(whichControl,myEvent.where,
                                      NIL);
                                 ScrollBits
                                 END
                           END {Case MyControl}
                           END {controls}
                        END {front}
                     END {in Content}
               END { of code case }
               END; { of mouseDown }

            keyDown,autoKey:
               BEGIN
               IF theWindow=FrontWindow THEN
                  BEGIN
                  theChar := CHR(myEvent.message MOD 256);
                  IF BitAnd(myEvent.modifiers,256)<>0 { Command key pressed }
                     THEN
                     DoCommand(MenuKey(theChar))
                  ELSE
                     TEKey(theChar,hTE)
                  END
               END; { of keyDown }

            activateEvt:
               BEGIN
               DrawGrowIcon(theWindow);
               IF ODD(myEvent.modifiers) THEN { window is becoming active }
                  BEGIN
                  SetPort (theWindow);
                  TEActivate(hTE);
                  ShowControl(vScroll);
                  ShowControl(hScroll)
                  END
               ELSE
                  BEGIN
                  TEDeactivate(hTE);
                  HideControl(vScroll);
                  HideControl(hScroll)
                  END
               END; { of activateEvt }

            updateEvt:
               BEGIN
               GetPort (savePort);
               SetPort (theWindow);
               BeginUpdate(theWindow);
               DrawWindow(theWindow);
               EndUpdate(theWindow);
               SetPort (savePort);
               END { of updateEvt }

         END { of event case }

      UNTIL doneFlag
   END.
 if GetNextEvent(everyEvent,myEvent) then
         CASE myEvent.what OF

            mouseDown:
               BEGIN
               code := FindWindow(myEvent.where,whichWindow);
               CASE code OF

                  inMenuBar: DoCommand(MenuSelect(myEvent.where));

                  inSysWindow: Systemsumacc/ws/example/growr   444      0     12        1216  3472707174  10463 3. "6F^5D!$^?9*  GrowResDef -- Resource input for sample application named Grow
*                Written by Macintosh Technical Support
*  6/23 SK  Added menu 1, standard edit menu, removed i-beam cursor

example/Grow.Rsrc

Type MENU
  ,1
  \14

  ,256
  File
    Quit

  ,257
  Edit
    Undo/Z
    (-
    Cut/X
    Copy/C
    Paste/V

Type WIND
  ,256
  A Sample
  50 40 300 450
  Visible GoAway
  0
  0

Type CNTL
  ,256
  vertical scroll bar
  -1 395 236 411
  Visible
  16
  0
  0 0 50

  ,257
  horizontal scroll bar
  235 -1 251 396
  Visible
  16
  0
  0 0 50

Type GROW= STR
,0
Grow Version 1.0    - January 8, 1984


Type CODE
  Example/growL,0
3 SK  Added menu 1, standard edit menu, removed i-beam cursor

example/Grow.Rsrc

Type MENU
  ,1
  \14

  ,256
  File
    Quit

  ,257
  Edit
    Undo/Z
    (-
    Cut/X
    Copy/C
    Paste/V

Type WIND
  ,256
  A Sample
  50 40 300 450
  Visible GoAway
  0
  0

Type CNTL
  ,256
  vertical scroll bar
  -1 395 236 411
  Visible
  16
  0
  0 0 50

  ,257
  horizontal ssumacc/ws/example/modal   444      0     12       26625  3472707174  10452 5ht^XX
Td.8~.8'F'.
.
F'xJh:>:>'F'$Intrfc/ToolIntf.TextxxNJIntrfc/ToolIntf.TextTextxtFJ" .
8.
:HH'@]8`H'F)@l%L:@#'J'
OSERRS.ERR6:":"9)e noI{$X-}
{$U-}
{$R-} {To avoid bug in range checking of MacPasLib}

{Scott Knaster    Macintosh Technical Support     5/10/84}

program modal;

   uses
      {$U Obj/Memtypes    } Memtypes,
      {$U Obj/QuickDraw   } QuickDraw,
      {$U Obj/OSIntf      } OSIntf,
      {$U Obj/ToolIntf    } ToolIntf,
      {$U Obj/PackIntf    } PackIntf;

   const
      numItems = 16;
      numRadGroups = 2;
      numChks = 1;
      OKBtn = OK;          {OK and Cancel constants defined by Dialog Mgr;}
      cancelBtn = Cancel;
      stopChk = 14;
      textItem = 6;        {item number for editable text item}
      btnOff = 0;
      btnOn = 1;
      noWrap = -1;


   {I have radio buttons handled as sets.  Don't do it this way!  A much better way is
    to put the default setting and the "group" number in the control's refCon field.  Then, when a
    radio button is turned on, the code will walk through the control list (probably with GetDItem)
    , check each control to make sure it's a radio button, and turn it off if its group was hit. }


    var
 {  Note that for both radio buttons and check boxes, I don't need to keep a "nowOn" field - the
    Control's value field works fine.}
      radSet : packed array [1..numRadGroups] of packed record
                                                defaultOn, nowOn : 0..255;
                                                btns : set of 1..numItems;
                                                        end; {record}
      chkBoxes : packed array [1..numChks] of packed record
                                                default : btnOff..btnOn;
                                                btn : 1..numItems;
                                              end;

      index : integer;
      debug : text;
      theDialog : DialogPtr;{pointer to dialog record - returned by GetNewDialog}
      itemHit : integer;   {item where event occurred - returned by ModalDialog}
      {the next three things are returned by GetDItem :}
      theType : integer;   {gives the type of the item requested}
      theTextHdl, theOkHdl, itemHdl, radHdl : handle;    {gives a handle to the item}
      txtBox, OKbox, itemBox, radBox : Rect;    {gives the display rectangle of the item}
      theText : str255;    {text of the edit item - returned by GetIText}
      iBeamHdl : CursHandle; {handle to the special cursor}
      theDlogPeek : DialogPeek; {also a pointer to a dialog record - this type
                                  of pointer is required to set up the editable
                                  text for no word wrap}
      wasDown : boolean;   {used to obscure cursor after a click in the text}
      teHdl : teHandle;
      paperDef : integer;


   function theFilter (theDialog : DialogPtr; var theEvent : EventRecord;
                    var item : integer) : boolean;
   {This function is called by ModalDialog for every event that occurs while it's
    in control.  It's used to perform special filtering (hence the clever name)
    of events before letting ModalDialog take over.  For example, we use it to
    change the cursor to an I-beam when it's on editable text and to obscure
    (hide) the I-beam cursor after the user clicks in editable text (a la Lisa).
    We must also tell ModalDialog that a press of Return or Enter by the user
    should be treated the same as if he had clicked on the OK button
    (per user interface standards).}

   const
     crCode = 13;      {ASCII code generated by Return and Enter keys.  Note that}
     enterCode = 3;    {this is good for any keyboard, no matter how it's mapped
                         or what language the user speaks (keypad too)}

   var
      mouseLoc : Point;
      finalTicks : longint;

   begin
      itemHit := 0;        {We return these two values.  Initialize them.}
      theFilter := false;

      {Frill: When you click in editable text and start typing, TextEdit calls
       ObscureCursor, which hides the cursor until you move the mouse again.
       This keeps the cursor from getting in your way while you type.  Lisa
       editing adds a nice touch:  the cursor is obscured as soon as you click,
       before you start typing.  This stuff does the same thing.
       It would be nice if we could just wait for a MouseUp event in the text,
       but TextEdit "eats" the MouseUp event when it calls WaitMouseUp instead
       of StillDown; so, we do it this way.}

      if wasDown and not StillDown
         then begin
                 ObscureCursor;    {User clicked in editable text}
                 wasDown := false; {Reset "mouse down" flag}
              end;

      case theEvent.what of
         nullEvent : begin  {Nothing is going on, so fix the cursor}
                        GetMouse (mouseLoc);
                        if PtInRect (mouseLoc, txtBox) {box is TextEdit's box}
                           then SetCursor (iBeamHdl^^)
                           else SetCursor (arrow);       {make sure it's an arrow}
                     end;

         mouseDown : begin
                GlobalToLocal (theEvent.where); {because PtInRect wants it that way}
                if PtInRect (theEvent.where, txtBox)    {Set mouse down flag}
                                   then wasDown := true;{if mouse down in text box}
                LocalToGlobal (theEvent.where); {because Dlog Mgr wants it that way}
                     end;

         keyDown, autoKey :
                  begin
                     if (theEvent.message mod 256) in [crCode, enterCode]
                     then           {user pressed Return or Enter}
                        begin
                           GetDItem (theDialog, OKbtn, theType, theOkHdl, OKbox);
                           HiliteControl (ControlHandle (theOkHdl),
                                          btnOn); {make it look...}
                           Delay (3, finalTicks); {...like the OK button was hit}
                           theFilter := true;   {dialog is over}
                           itemHit := OKBtn;    {simulate user hitting OK}
                     end
                  end
      end  {case theEvent.what}
   end; {function theFilter}


begin {main program}
   InitGraf (@thePort);          {the big five inits}
   InitFonts;
   InitWindows;
   TEInit;
   InitDialogs (nil);

   reset (debug, '.bout');

   iBeamHdl := GetCursor (iBeamCursor); {load special cursor}
   wasDown := false;                {just initializing here}

   {The next chunk of code is used to set up the radio button and check box
    data structures.  It should be done during initialization of the program.
    Since the settings must exist between incarnations of the dialog box,
    these variables must not be local to the procedure that puts up the box.}

   radSet [1].btns := [8, 9];
   radSet [1].defaultOn := 8;
   radSet [1].nowOn := radSet [1].defaultOn;

   radSet [2].btns := [11, 12, 13];
   radSet [2].defaultOn := 12;
   radSet [2].nowOn := radSet [2].defaultOn;

   chkBoxes [1].btn := stopChk;
   chkBoxes [1].default := btnOn;     {default 'Stop printing' check box to on}

   {The following loop actually does the dialog.  It should be called each
    time you want the dialog to happen.}

      repeat
         FlushEvents (everyEvent, 0); {this throws out leftover clicks, keys}
         theDialog := GetNewDialog (1000, nil, pointer (-1));
               {this "draws" the dialog box (but it's invisible)}

         for index := 1 to numRadGroups do   {initialize default radio buttons}
            begin
               GetDItem (theDialog, radSet [index].defaultOn, theType, itemHdl, itemBox);
               SetCtlValue (ControlHandle (itemHdl), btnOn);
            end;

         for index := 1 to numChks do  {Initialize default check boxes}
            begin
               GetDItem (theDialog, chkBoxes [index].btn, theType, itemHdl, itemBox);
               SetCtlValue (ControlHandle (itemHdl), chkBoxes [index].default);
                     {set default value of check box}
            end;

         GetDItem (theDialog, textItem, theType, theTextHdl, txtBox);
            {this tells us three things: (1), theTextHdl is a handle to the editable
             text, which we need to find out the text later; (2), txtBox tells us
             where the text is, so we can change the pointer to an I-beam when
             it moves over the text; and (3), theType tells us the type of the
             item, which in this case we already know is editable text}

         theDlogPeek := DialogPeek (theDialog);  {get peek-type pointer to dialog...}
         theDlogPeek^.textH^^.crOnly := noWrap;   {...so we can turn off word wrap}
         SetPort (theDialog);       {this makes later GlobalToLocal calls work right}
         ShowWindow (theDialog);    {here I am!}
         InitCursor;                {we're ready, show an arrow}

            repeat
               ModalDialog (@theFilter,itemHit); {calls theFilter for every event}
               GetDItem (theDialog, itemHit, theType, itemHdl, itemBox);
                     {find out what was hit}
                case theType of
                   chkCtrl + ctrlItem : {check box was hit; toggle its state}
                      SetCtlValue (ControlHandle (itemHdl),
                      BitXor (GetCtlValue (ControlHandle (itemHdl)), 1));
                   radCtrl + ctrlItem : begin  {radio button was hit}
                      index := 1;
                      while not (itemHit in radSet [index].btns)
                        do index := index + 1; {find out which set
                                                of buttons was hit}
                      GetDItem (theDialog, radSet [index].nowOn, theType,
                                radHdl, radBox);  {get handle to button now on}
                      SetCtlValue (ControlHandle (radHdl), btnOff); {old button off}
                      SetCtlValue (ControlHandle (itemHdl), btnOn); {new button on}
                      radSet [index].nowOn := itemHit; {update data structure}
                                        end; {radCtrl case}

                end; {case theType}

            until itemHit in [OKBtn, cancelBtn];
               {dialog ends when user hits a button (or presses Return or Enter,
                which theFilter makes look like a hit on the OK button)}

         if itemHit = cancelBtn
            then begin {Revert radio buttons to their
                        settings before dialog was
                        called.}
                     for index := 1 to numRadGroups do
                       radSet [index].nowOn := radSet [index].defaultOn;
   {Note that I don't have to revert the checkboxes, since their "default"
    field has not been changed.}
                 end
            else begin  {Update default settings}
                     for index := 1 to numRadGroups do
                       radSet [index].defaultOn := radSet [index].nowOn;
                     for index := 1 to numChks do
                        begin
                           GetDItem (theDialog, chkBoxes [index].btn, theType,
                                     itemHdl, itemBox);
                           chkBoxes [index].default :=
                                  GetCtlValue (ControlHandle (itemHdl));
                        end
                 end;

         GetIText (theTextHdl, theText); {this tells us the text that the user entered}
         {do something with it - what?}
      until  theText = 'quit';   {all done if user typed 'quit'}

end.
 for index := 1 to numRadGroups do   {initialize default radio buttons}
            begin
               Gesumacc/ws/example/modalr   444      0     12        2634  3472707174  10606 3. "6F^5ND!$^*  resource definition file for modal.text

example/modal.rsrc

Type DLOG
   ,1000
   33 110 333 390
   Invisible 1 NoGoAway 0
   1000

Type DITL
   ,1000
   16

   BtnItem Enabled
   15 196 35 254
OK

   BtnItem Enabled
   45 196 65 254
Cancel

   IconItem Disabled
   10 10 42 42
   1000

   StatText Disabled
   20 50 40 180
Print the document

   StatText Disabled
   75 10 95 50
Title:

   EditText Enabled
   77 60 92 225


   StatText Disabled
   102 10 122 100
Paper size:

   RadioItem Enabled
   126 18 141 140
8 1/2" by 11"

   RadioItem Enabled
   126 160 141 270
8 1/2" by 14"

   StatText Disabled
   151 10 171 100
Print Quality:

   RadioItem Enabled
   175 18 195 75
High

   RadioItem Enabled
   175 105 195 183
Standard

   RadioItem Enabled
   175 200 195 260
Draft

   ChkItem Enabled
   205 10 220 235
Stop printing after each page

   UserItem Disabled
   235 62 255 210

   StatText Disabled
   265 68 285 250
Progress of Printing


Type ICON
   ,1000
   0000 0000
   0000 0000
   03FF FFC0
   0600 0060
   0D11 1130
   1844 4458
   1111 1108
   1000 0008
   1000 0008
   1FFF FFF8
   0000 0000
   1FFF FFF8
   0000 0000
   3BBB BBB8
   6EEE EEEE
   0000 0000
   3FFF FFFC
   2000 0004
   3FFF FFFC
   0000 0000
   7FFF FFFE
   7FFF FFFE
   0000 0000
   1FFF FFF8
   1000 0008
   1444 4448
   1000 0008
   1911 1118
   0C00 0030
   0600 0060
   03FF FFC0
   0000 0000

Type CODE
   example/modall,0
know is editable text}

         theDlogPeek := DialogPeek (theDialog);  {get peek-type pointer to dsumacc/ws/example/picscrap   444      0     12        3334  3472707174  11132 3. "6F^50^)0
,	d,:dxtRc.Te"jFc.Text>xtTz>YYRR@T  T*\Mv{$U-}
{$X-}
program scrap;

{Scott Knaster, Macintosh Tech Support, 6/4/84
 Displays the PICT scrap.  Clever part is extracting original frameRect from
 the picture.
 Some things to do:  add desk accessory support & edit menu; use WindowPic field }

   uses
      {$U Obj/Memtypes    } Memtypes,
      {$U Obj/QuickDraw   } QuickDraw,
      {$U Obj/OSIntf      } OSIntf,
      {$U Obj/ToolIntf    } ToolIntf,
      {$U Obj/PackIntf    } PackIntf;

   var
     theWindow : WindowPtr;
     theScrap : Handle;
     thePict : PicHandle;
     rectPtr : ^Rect;
     offset, result : longint;
     theFrame : Rect;

begin
   InitGraf (@thePort);          {standard initialization stuff}
   InitFonts;
   InitWindows;
   TEInit;
   InitDialogs (nil);

   theWindow := GetNewWindow (256, nil, pointer (-1));
   SetPort (theWindow);

   theScrap := NewHandle (0);
   result := GetScrap (theScrap, 'PICT', offset);
   InitCursor;
   if result < 0    {error code returned}
      then begin
         MoveTo (5, 50);
         DrawString ('Nothing of type PICT in scrap');
           end
      else begin    {got something}
         thePict := PicHandle (theScrap);
              {extract the original frame}
         theFrame := thePict^^.picFrame;
              {Move the frame down and to the right a little}
         OffsetRect (theFrame, -theFrame.left + 15, -theFrame.top + 20);

         HLock (Handle (thePict));
          {"Always lock a picHandle before doing DrawPicture." - C. Clark, 1984}
         DrawPicture (thePict, theFrame);
         HUnlock (Handle (thePict));
           end;
   MoveTo (130, 230);
   TextFace ([bold]);
   DrawString ('Press mouse button to exit');

   repeat until button;
end.
}
   InitFonts;
   InitWindows;
   TEInit;
   InitDialogs (nil);

   theWindow := GetNewWindow (256, nil, pointer (-1));
   SetPort (theWindow);

   theScrap := NewHandle (0);
   result := GetScrap (theScrap, 'PICT', offset);
   InitCursor;
   if result < 0    {error code returned}
      thesumacc/ws/example/picscrapr   444      0     12         216  3472707174  11270 3. "6F^56D!$^Qexample/picscrap.Rsrc

Type WIND
  ,256
Desk Scrap
  50 40 300 450
  Visible NoGoAway
  0
  0

Type CODE
   example/picscrapl,0
      thePict := PicHandle (theScrap);
              {extract the original frame}
         theFrame := thePict^^.picFrame;
              {Move the frame down and to the right a little}
         OffsetRect (theFrame, -theFrame.left + 15, -theFrame.top + 20);

         HLock (Handle (thePict));
          {"Always lock a picHandle before doing DrawPicture." - C. Clark, 1sumacc/ws/example/qdsample   444      0     12       47406  3472707174  11164 58?^2a<.<5Lb{$X-}
PROGRAM QDSample;

  { QDSample -- Macintosh adaptation of Lisa QuickDraw example. }
  { by Paul Zemlin, Macintosh Technical Support                 }

   USES {$U-}
      {$U Obj/Memtypes    } Memtypes,
      {$U Obj/QuickDraw   } QuickDraw,
      {$U Obj/OSIntf      } OSIntf,
      {$U Obj/ToolIntf    } ToolIntf;

TYPE  IconData = ARRAY[0..95] OF INTEGER;

   CONST
      lastMenu = 2;   { number of menus }
      appleMenu = 1;  { menu ID for desk accessory menu }
      fileMenu = 256; { menu ID for File menu }

   VAR
      myMenus                           : ARRAY [1..lastMenu] OF MenuHandle;
      dragRect ,prect, growrect         : Rect;
      doneFlag,temp                     : BOOLEAN;
      myEvent                           : EventRecord;
      code, refNum, MyControl,t         : INTEGER;
      theMenu, theItem, whichIcon       : INTEGER;
      scale                             : INTEGER;
      wRecord                           : WindowRecord;
      theWindow, whichWindow            : WindowPtr;
      icons                             : ARRAY[0..5] OF IconData;
      hScroll, vScroll, whichControl    : ControlHandle;
      theOrigin                         : Point;
      theUpdateRgn                      : RgnHandle;


   PROCEDURE InitIcons;
   { Manually stuff some icons.  Normally we would read them from a file }
   BEGIN
     { Lisa }
     StuffHex(@icons[0, 0],'000000000000000000000000000000000000001FFFFFFFFC');
     StuffHex(@icons[0,12],'00600000000601800000000B0600000000130FFFFFFFFFA3');
     StuffHex(@icons[0,24],'18000000004311FFFFF00023120000080F231200000BF923');
     StuffHex(@icons[0,36],'120000080F23120000080023120000080023120000080F23');
     StuffHex(@icons[0,48],'1200000BF923120000080F2312000008002311FFFFF00023');
     StuffHex(@icons[0,60],'08000000004307FFFFFFFFA30100000000260FFFFFFFFE2C');
     StuffHex(@icons[0,72],'18000000013832AAAAA8A9F0655555515380C2AAAA82A580');
     StuffHex(@icons[0,84],'800000000980FFFFFFFFF300800000001600FFFFFFFFFC00');

     { Printer }
     StuffHex(@icons[1, 0],'000000000000000000000000000000000000000000000000');
     StuffHex(@icons[1,12],'00000000000000007FFFFF00000080000280000111514440');
     StuffHex(@icons[1,24],'0002000008400004454510400004000017C00004A5151000');
     StuffHex(@icons[1,36],'0004000010000004A54510000004000017FE00F4A5151003');
     StuffHex(@icons[1,48],'0184000013870327FFFFF10F06400000021B0CFFFFFFFC37');
     StuffHex(@icons[1,60],'18000000006B3000000000D77FFFFFFFFFABC00000000356');
     StuffHex(@icons[1,72],'8000000001AC87F000000158841000CCC1B087F000CCC160');
     StuffHex(@icons[1,84],'8000000001C0C000000003807FFFFFFFFF0007800001E000');

     { Trash Can }
     StuffHex(@icons[2, 0],'000001FC000000000E0600000000300300000000C0918000');
     StuffHex(@icons[2,12],'00013849800000026C4980000004C0930000000861260000');
     StuffHex(@icons[2,24],'0010064FE0000031199830000020E6301800002418E00800');
     StuffHex(@icons[2,36],'0033E3801C0000180E002C00000FF801CC0000047FFE0C00');
     StuffHex(@icons[2,48],'000500004C000005259A4C000005250A4C00000525FA4C00');
     StuffHex(@icons[2,60],'000524024C00000524924C00600524924C0090E524924C7C');
     StuffHex(@icons[2,72],'932524924C82A44524924D01C88524924CF10C4524924C09');
     StuffHex(@icons[2,84],'0784249258E70003049233100000E000E40800001FFFC3F0');

     { tray }
     StuffHex(@icons[3, 0],'000000000000000000000000000000000000000000000000');
     StuffHex(@icons[3,12],'0000000000000000000000000000000000000007FFFFFFF0');
     StuffHex(@icons[3,24],'000E00000018001A00000038003600000078006A000000D8');
     StuffHex(@icons[3,36],'00D7FFFFFFB801AC000003580358000006B807FC000FFD58');
     StuffHex(@icons[3,48],'040600180AB80403FFF00D58040000000AB8040000000D58');
     StuffHex(@icons[3,60],'040000000AB807FFFFFFFD5806AC00000AB8055800000D58');
     StuffHex(@icons[3,72],'06B000000AB807FC000FFD70040600180AE00403FFF00DC0');
     StuffHex(@icons[3,84],'040000000B80040000000F00040000000E0007FFFFFFFC00');

     { File Cabinet }
     StuffHex(@icons[4, 0],'0007FFFFFC00000800000C00001000001C00002000003400');
     StuffHex(@icons[4,12],'004000006C0000FFFFFFD40000800000AC0000BFFFFED400');
     StuffHex(@icons[4,24],'00A00002AC0000A07F02D40000A04102AC0000A07F02D400');
     StuffHex(@icons[4,36],'00A00002AC0000A08082D40000A0FF82AC0000A00002D400');
     StuffHex(@icons[4,48],'00A00002AC0000BFFFFED40000800000AC0000BFFFFED400');
     StuffHex(@icons[4,60],'00A00002AC0000A07F02D40000A04102AC0000A07F02D400');
     StuffHex(@icons[4,72],'00A00002AC0000A08082D40000A0FF82AC0000A00002D800');
     StuffHex(@icons[4,84],'00A00002B00000BFFFFEE00000800000C00000FFFFFF8000');

     { drawer }
     StuffHex(@icons[5, 0],'000000000000000000000000000000000000000000000000');
     StuffHex(@icons[5,12],'000000000000000000000000000000000000000000000000');
     StuffHex(@icons[5,24],'000000000000000000000000000000000000000000000000');
     StuffHex(@icons[5,36],'00000000000000000000000000000000000000001FFFFFF0');
     StuffHex(@icons[5,48],'0000380000300000680000700000D80000D0003FFFFFF1B0');
     StuffHex(@icons[5,60],'0020000013500020000016B000201FE01D50002010201AB0');
     StuffHex(@icons[5,72],'00201FE01560002000001AC0002000001580002020101B00');
     StuffHex(@icons[5,84],'00203FF01600002000001C00002000001800003FFFFFF000');

   END;


   PROCEDURE DrawIcon(whichIcon,h,v: INTEGER);  {DrawAnIcon => DrawIcon}
   VAR
       srcBits           : BitMap;
       srcRect, dstRect  : Rect;

   BEGIN
     srcBits.baseAddr:=@icons[whichIcon];
     srcBits.rowBytes:=6;
     SetRect(srcBits.bounds,0,0,48,32);
     srcRect:=srcBits.bounds;
     dstRect:=srcRect;
     OffsetRect(dstRect,h,v);
     CopyBits(srcBits,theWindow^.portBits,srcRect,dstRect,srcOr,Nil);
   END;


   PROCEDURE DrawStuff;
   VAR i: INTEGER;
       tempRect   : Rect;
       myPoly     : PolyHandle;
       myRgn      : RgnHandle;
       myPattern  : Pattern;

   BEGIN

     StuffHex(@myPattern,'8040200002040800');

     { draw two horizontal lines across the top }
     MoveTo(0,18);
     LineTo(719,18);
     MoveTo(0,20);
     LineTo(719,20);

     { draw divider lines }
     MoveTo(0,134);
     LineTo(719,134);
     MoveTo(0,248);
     LineTo(719,248);
     MoveTo(240,21);
     LineTo(240,363);
     MoveTo(480,21);
     LineTo(480,363);

     { draw title }
     TextFont(0);
     MoveTo(210,14);
     DrawString('Look what you can draw with QuickDraw');



     {---------  draw text samples --------- }

     MoveTo(80,34);  DrawString('Text');

     TextFace([bold]);
     MoveTo(70,55);  DrawString('Bold');

     TextFace([italic]);
     MoveTo(70,70); DrawString('Italic');

     TextFace([underline]);
     MoveTo(70,85); DrawString('Underline');

     TextFace([outline]);
     MoveTo(70,100); DrawString('Outline');

     TextFace([shadow]);
     MoveTo(70,115); DrawString('Shadow');

     TextFace([]);   { restore to normal }



     { --------- draw line samples --------- }

     MoveTo(330,34);  DrawString('Lines');

     MoveTo(280,25);  Line(160,40);

     PenSize(3,2);
     MoveTo(280,35);  Line(160,40);

     PenSize(6,4);
     MoveTo(280,46);  Line(160,40);

     PenSize(12,8);
     PenPat(gray);
     MoveTo(280,61); Line(160,40);

     PenSize(15,10);
     PenPat(myPattern);
     MoveTo(280,80); Line(160,40);
     PenNormal;



     { --------- draw rectangle samples --------- }

     MoveTo(560,34);  DrawString('Rectangles');

     SetRect(tempRect,510,40,570,70);
     FrameRect(tempRect);

     OffsetRect(tempRect,25,15);
     PenSize(3,2);
     EraseRect(tempRect);
     FrameRect(tempRect);

     OffsetRect(tempRect,25,15);
     PaintRect(tempRect);

     OffsetRect(tempRect,25,15);
     PenNormal;
     FillRect(tempRect,gray);
     FrameRect(tempRect);

     OffsetRect(tempRect,25,15);
     FillRect(tempRect,myPattern);
     FrameRect(tempRect);


     { --------- draw roundRect samples --------- }

     MoveTo(70,148);  DrawString('RoundRects');

     SetRect(tempRect,30,150,90,180);
     FrameRoundRect(tempRect,30,20);

     OffsetRect(tempRect,25,15);
     PenSize(3,2);
     EraseRoundRect(tempRect,30,20);
     FrameRoundRect(tempRect,30,20);

     OffsetRect(tempRect,25,15);
     PaintRoundRect(tempRect,30,20);

     OffsetRect(tempRect,25,15);
     PenNormal;
     FillRoundRect(tempRect,30,20,gray);
     FrameRoundRect(tempRect,30,20);

     OffsetRect(tempRect,25,15);
     FillRoundRect(tempRect,30,20,myPattern);
     FrameRoundRect(tempRect,30,20);


     { --------- draw bitmap samples --------- }

     MoveTo(320,148);  DrawString('BitMaps');

     DrawIcon(0,266,156);
     DrawIcon(1,336,156);
     DrawIcon(2,406,156);
     DrawIcon(3,266,196);
     DrawIcon(4,336,196);
     DrawIcon(5,406,196);


     { --------- draw ARC samples --------- }

     MoveTo(570,148);  DrawString('Arcs');

     SetRect(tempRect,520,153,655,243);
     FillArc(tempRect,135,65,dkGray);
     FillArc(tempRect,200,130,myPattern);
     FillArc(tempRect,330,75,gray);
     FrameArc(tempRect,135,270);
     OffsetRect(tempRect,20,0);
     PaintArc(tempRect,45,90);


     { --------- draw polygon samples --------- }

     MoveTo(80,262);  DrawString('Polygons');

     myPoly:=OpenPoly;
       MoveTo(30,290);
       LineTo(30,280);
       LineTo(50,265);
       LineTo(90,265);
       LineTo(80,280);
       LineTo(95,290);
       LineTo(30,290);
     ClosePoly;       { end of definition }

     FramePoly(myPoly);

     OffsetPoly(myPoly,25,15);
     PenSize(3,2);
     ErasePoly(myPoly);
     FramePoly(myPoly);

     OffsetPoly(myPoly,25,15);
     PaintPoly(myPoly);

     OffsetPoly(myPoly,25,15);
     PenNormal;
     FillPoly(myPoly,gray);
     FramePoly(myPoly);

     OffsetPoly(myPoly,25,15);
     FillPoly(myPoly,myPattern);
     FramePoly(myPoly);

     KillPoly(myPoly);


     { --------- demonstrate regions --------- }

     MoveTo(320,262);  DrawString('Regions');

     myRgn:=NewRgn;
     OpenRgn;
       ShowPen;

       SetRect(tempRect,260,270,460,350);
       FrameRoundRect(tempRect,24,16);

       MoveTo(275,335);  { define triangular hole }
       LineTo(325,285);
       LineTo(375,335);
       LineTo(275,335);

       SetRect(tempRect,365,277,445,325);   { oval hole }
       FrameOval(tempRect);

       HidePen;
     CloseRgn(myRgn);       { end of definition }
     DisposeRgn(myRgn);


     { --------- draw oval samples --------- }

     MoveTo(580,262);  DrawString('Ovals');

     SetRect(tempRect,510,264,570,294);
     FrameOval(tempRect);

     OffsetRect(tempRect,25,15);
     PenSize(3,2);
     EraseOval(tempRect);
     FrameOval(tempRect);

     OffsetRect(tempRect,25,15);
     PaintOval(tempRect);

     OffsetRect(tempRect,25,15);
     PenNormal;
     FillOval(tempRect,gray);
     FrameOval(tempRect);

     OffsetRect(tempRect,25,15);
     FillOval(tempRect,myPattern);
     FrameOval(tempRect);

   END;  { DrawStuff }


   PROCEDURE MoveScrollBars;

      BEGIN
         WITH theWindow^.portRect DO
            BEGIN
            HideControl(vScroll);
            MoveControl(vScroll,right-15,top-1);
            SizeControl(vScroll,16,bottom-top-13);
            ShowControl(vScroll);
            HideControl(hScroll);
            MoveControl(hScroll,left-1,bottom-15);
            SizeControl(hScroll,right-left-13,16);
            ShowControl(hScroll)
            END
      END;

   PROCEDURE ResizePRect;

   { pRect is the window's content region, minus the scroll bars }

      BEGIN
         pRect := thePort^.portRect;
         pRect.right := pRect.right-15;
         pRect.bottom := pRect.bottom-15
      END;

   PROCEDURE GrowWnd (whichWindow: WindowPtr);

   { Handles growing and sizing the window and manipulating }
   { the update region. }

      VAR
         longResult: LongInt;
         height,width: INTEGER;
         tRect: Rect;

      BEGIN
         longResult := GrowWindow(whichWindow,myEvent.where,growRect);
         IF longResult=0 THEN EXIT(GrowWnd);
         height := HiWord(longResult); width := LoWord(longResult);

         { Add the old "scroll bar area" to the update region so it will }
         { be redrawn (for when the window is enlarged). }
         tRect := whichWindow^.portRect;
         tRect.left := tRect.right - 16;
         InvalRect(tRect);
         tRect := whichWindow^.portRect;
         tRect.top := tRect.bottom - 16;
         InvalRect(tRect);


         { Now draw the newly sized window. }
         SizeWindow(whichWindow,width,height,TRUE);
         MoveScrollBars;
         ResizePRect;

         { Add the new "scroll bar area" to the update region so it will }
         { be redrawn (for when the window is made smaller). }
         tRect := whichWindow^.portRect; tRect.left := tRect.right-16;
         InvalRect(tRect);
         tRect := whichWindow^.portRect; tRect.top := tRect.bottom-16;
         InvalRect(tRect);
      END; { of GrowWnd }

   PROCEDURE DrawWindow(whichWindow: WindowPtr);
   { Draws the content region of theWindow }

      VAR
         tRect    : Rect;

      BEGIN

         ClipRect (theWindow^.portRect);
         DrawGrowIcon(theWindow);
         IF theWindow = FrontWindow THEN DrawControls(theWindow);

         { Now set up a clip area which excludes the scroll bars }


         tRect := theWindow^.portRect;
         tRect.bottom := tRect.bottom - 16;
         tRect.right := tRect.right - 16;

         {Now compensate for any scrolling which has been done }

         OffsetRect (tRect, theOrigin.h, theOrigin.v);
         ClipRect (tRect);

         { Change the origin to compensate for any scrolling which has been done }

         SetOrigin (theOrigin.h, theOrigin.v);
         DrawStuff;
         SetOrigin (0, 0);
         ClipRect (theWindow^.portRect);  { Reset the clip area }
       END; { of DrawWindow }

   PROCEDURE ScrollBits;

      VAR
         oldOrigin   : point;
         dh,dv       : INTEGER;
         tRect       : Rect;

      BEGIN
            oldOrigin := theOrigin;
            theOrigin.h := 4 * GetCtlValue(hScroll);
            theOrigin.v := 4 * GetCtlValue(vScroll);
            dh := oldOrigin.h - theOrigin.h;
            dv := oldOrigin.v - theOrigin.v;
            theUpdateRgn := NewRgn;
            ScrollRect (pRect, dh, dv, theUpdateRgn);

            { Have scrolled in junk...need to redraw }

            SetOrigin (theOrigin.h, theOrigin.v);
            OffsetRect (theUpdateRgn^^.rgnBBox, theOrigin.h, theOrigin.v);
            ClipRect (theUpdateRgn^^.rgnBBox);
            DrawStuff;
            DisposeRgn (theUpdateRgn);
            SetOrigin (0, 0);
            ClipRect (theWindow^.portRect);
      END;

   PROCEDURE ScrollUp(whichControl: ControlHandle; theCode: INTEGER);

      BEGIN
         IF theCode=inUpButton THEN
            BEGIN
            SetCtlValue(whichControl,GetCtlValue(whichControl)-1);
            ScrollBits
            END
      END;

   PROCEDURE ScrollDown(whichControl: ControlHandle; theCode: INTEGER);

      BEGIN
         IF theCode=inDownButton THEN
            BEGIN
            SetCtlValue(whichControl,GetCtlValue(whichControl)+1);
            ScrollBits
            END
      END;

   PROCEDURE PageScroll(code,amount: INTEGER);

      VAR
         myPt: point;

      BEGIN
         REPEAT
            GetMouse(myPt);
            IF TestControl(whichControl,myPt)=code THEN
               BEGIN
               SetCtlValue(whichControl,GetCtlValue(whichControl)+amount);
               ScrollBits
               END
         UNTIL NOT StillDown;
      END;

   PROCEDURE SetUpMenus;
   { Once-only initialization for menus }

      VAR
         i: INTEGER;

      BEGIN
         InitMenus; { initialize Menu Manager }
         myMenus[1] := GetMenu(appleMenu);
         AddResMenu(myMenus[1],'DRVR'); { desk accessories }
         myMenus[2] := GetMenu(fileMenu);
         FOR i := 1 TO lastMenu DO InsertMenu(myMenus[i],0);
         DrawMenuBar;
      END; { of SetUpMenus }


   PROCEDURE DoCommand(mResult: LongInt);

      VAR
         name: STR255;

      BEGIN
         theMenu := HiWord(mResult); theItem := LoWord(mResult);
         CASE theMenu OF

            appleMenu:
               BEGIN
               GetItem(myMenus[1],theItem,name);
               refNum := OpenDeskAcc(name);
               END;

            fileMenu: doneFlag := TRUE; { Quit }


         END; { of menu case }

         HiliteMenu(0);

      END; { of DoCommand }

   BEGIN { main program }
      InitGraf(@thePort);
      InitFonts;
      FlushEvents(everyEvent,0);
      InitWindows;
      SetUpMenus;
      InitDialogs(NIL);
      SetCursor(arrow);
      SetRect(dragRect,4,24,508,338);
      SetRect(growRect,100,60,512,302);
      doneFlag := FALSE;
      InitCursor;
      InitIcons;

      theWindow := GetNewWindow(256,@wRecord,POINTER(-1));
      SetPort(theWindow);
      theWindow^.txFont := 2;

      ResizePRect;

      vScroll := GetNewControl(256,theWindow);
      hScroll := GetNewControl(257,theWindow);
      theOrigin.h := 0; theOrigin.v := 0;


      REPEAT
         SystemTask;
         temp := GetNextEvent(everyEvent,myEvent);
         CASE myEvent.what OF

            mouseDown:
               BEGIN
               code := FindWindow(myEvent.where,whichWindow);
               CASE code OF

                  inMenuBar: DoCommand(MenuSelect(myEvent.where));

                  inSysWindow: SystemClick(myEvent,whichWindow);

                  inDrag: DragWindow(whichWindow,myEvent.where,dragRect);

                  inGoAway:
                     IF TrackGoAway(whichWindow,myEvent.where) THEN
                        doneFlag := TRUE;

                  inGrow:
                     IF whichWindow=FrontWindow THEN
                        GrowWnd(whichWindow)
                     ELSE
                        SelectWindow(whichWindow);

                  inContent:
                     BEGIN
                     IF whichWindow<>FrontWindow THEN
                        SelectWindow(whichWindow)
                     ELSE
                        BEGIN {front}
                        GlobalToLocal(myEvent.where);
                        IF  NOT PtInRect(myEvent.where,pRect) THEN
                           BEGIN {controls}
                           MyControl := FindControl(myEvent.where,whichWindow,
                                                    whichControl);
                           CASE MyControl OF
                              inUpButton:
                                 t := TrackControl(whichControl,myEvent.where,
                                                   @ScrollUp);
                              inDownButton:
                                 t := TrackControl(whichControl,myEvent.where,
                                                   @ScrollDown);
                              inPageUP: PageScroll(MyControl,-10);
                              inPageDown: PageScroll(MyControl,10);
                              inThumb:
                                 BEGIN
                                 t := TrackControl(whichControl,myEvent.where,
                                      NIL);
                                 ScrollBits
                                 END
                           END {Case MyControl}
                           END {controls}
                        END {front}
                     END {in Content}
               END; { of code case }
               END; { of mouseDown }

            activateEvt:
               BEGIN
               SetPort (theWindow);
               DrawGrowIcon(theWindow);
               IF ODD(myEvent.modifiers) THEN { window is becoming active }
                  BEGIN
                  ShowControl(vScroll);
                  ShowControl(hScroll);
                  END
               ELSE
                  BEGIN
                  HideControl(vScroll);
                  HideControl(hScroll)
                  END
               END; { of activateEvt }

            updateEvt:
               BEGIN
               BeginUpdate(theWindow);
               EraseRect (theWindow^.portRect);
               DrawWindow(theWindow);
               EndUpdate(theWindow);
               END { of updateEvt }

         END { of event case }

      UNTIL doneFlag
   END.
:
               BEGIN
               GetItem(myMenus[1],theItem,name);
               refNum := OpenDeskAcc(name);
               END;

            fileMenu: doneFlag := TRUE; { Quit }


         END; { of menu case }

         HiliteMenu(0);

     sumacc/ws/example/qdsampler   444      0     12         742  3472707175  11277 3. "6F^5D!$^K*  QDsampleR -- Resource input for sample application named QDSample
*                Written by Macintosh Technical Support

Example/QDSample.Rsrc

Type MENU
  ,1
  \14

  ,256
  File
    Quit

 Type WIND
  ,256
  QuickDraw Example
  50 40 300 450
  Visible GoAway
  0
  0

Type CNTL
  ,256
  vertical scroll bar
  -1 395 236 411
  Visible
  16
  0
  0 0 50

  ,257
  horizontal scroll bar
  235 -1 251 396
  Visible
  16
  0
  0 0 50

Type CODE
  Example/QDSampleL,0
                 inUpButton:
 sumacc/ws/example/scroll   444      0     12       35306  3472707175  10651 3. "6F^5D!$^Y,,{$X-}
{$R-}
PROGRAM Scroll;
{------------------------------------------------------------------------------------
     This is a simple program to demonstrate how to use scroll bars.
     You can scroll text or graphics or both.
     You can scroll horizontally or vertically.
     By Cary Clark, Macintosh Technical Support         Apple Computer Inc., 1984
 ------------------------------------------------------------------------------------}

USES
      {$U-}
      {$U Obj/MemTypes  } MemTypes,
      {$U Obj/QuickDraw } QuickDraw,
      {$U Obj/OSIntf    } OSIntf,
      {$U Obj/ToolIntf  } ToolIntf;

CONST
      Horizontal = 1;    {These are the choices in the menu 'Scroll Bar'}
      Vertical = 2;
      TextItem = 4;
      Graphics = 5;

      FileMenu = 1;      {Resource numbers and position in the Menu bar}
      ScrollMenu = 2;

      NumOfRects = 30;   {quantity of rectangles and strings to scroll around}
      NumOfStrings = 55;

TYPE
      MyRectData = Array [1..NumOfRects] of Rect; {Graphics structure;     }
      MyRectPtr = ^MyRectData;                    {  an array of rectangles}
      MyRectHdl = ^MyRectPtr;

VAR
      hTE:  TEHandle;                {TextEdit handle}
      hScroll,                       {Horizontal scroll bar}
      vScroll:  ControlHandle;       {Vertical scroll bar}
      MyWindow: WindowPtr;           {Document window}
      hdlScrollMenu: MenuHandle;     {Handle to the menu items}
      MyRect: MyRectHdl;             {Handle to array of rectangles}
      originalPart: INTEGER;         {1st part of the scroll bar hit}
      PageCorner,                    {Location of the upper left hand page corner}
      EventPoint: Point;             {Where an event took place}
      MyViewRect: Rect;              {display rectangle containing scrollable data}
      doneFlag,                      {Set TRUE when the user selects 'Quit'}
      showText,                      {Set TRUE when text can be scrolled}
      showGraphics : BOOLEAN;        {Set TRUE when graphics can be scrolled}

{------------------------------------------------------------------------------------}
PROCEDURE SetUpData;

{This procedure initializes two data structures; a TextEdit record and an array of
 rectangles.  Initially, only text and the vertical scrollbar will be displayed.}

Var MyString : StringHandle; {Temporary container for a string in the resource fork}
    counter : INTEGER;       {Counters must be local to the procedure}
    destRect : rect;         {Rectangle containing the larger-than-the-screen page}
BEGIN
{The TextEdit record is initialized by reading in a string from the application's
resource fork and then inserting it a number of times into the TextEdit record.}
  MyString := GetString (256); {Get some text to play around with}

{Set the view as the portrect less the vertical scrollbar area.  The TextEdit
destRect will be set to the current window width plus an arbitrary value.}
  MyViewRect := MyWindow^.portrect;
  destRect := MyViewRect;
  destRect.right := destRect.right + 300;
  PageCorner.h := -destRect.left;
  PageCorner.v := -destRect.top;
  MyViewRect.right := MyViewRect.right - 16; {16 = width of scrollbar}
  hTE := TENew (destRect, MyViewRect);

  HLock (Pointer (MyString));  {Can't move if we are going to point to the text}
  For counter := 1 to NumOfStrings DO {Create a TextEdit record full of the string}
    TEInsert (Pointer(Ord4(MyString^)+1),{move past the string's length byte}
              Length(MyString^^), hTE);
  HUnLock (Pointer (MyString));{Free to move again}

{Now, create a structure of rectangles.}
  MyRect := Pointer( NewHandle (Sizeof (MyRectData))); {240 bytes }
  For counter := 1 to NumOfRects DO
    SetRect (MyRect^^[counter], counter*23, counter*20, counter*23+50, counter*20+50);

  showtext := TRUE;
  showgraphics := FALSE;
  ShowWindow (MyWindow); {Display the window and the text it contains}

  VScroll := GetNewControl (256, MyWindow); {vertical scrollbar}
  HScroll := GetNewControl (257, MyWindow); {horizontal scrollbar, not shown}

  CheckItem (hdlScrollMenu, vertical, TRUE);
  CheckItem (hdlScrollMenu, textItem, TRUE)
END; {of SetUpData}


{------------------------------------------------------------------------------------}
PROCEDURE GrafUpdate(whatpart : rect);
{This is roughly the equivalent of what TEUpdate does with text.  The upper left hand
corner of the page is moved up and to the left to simulate a view further down and
to the right.  To more accurately resemble a Toolbox routine like TEUpdate, this
procedure should also preserve the current clip region and origin.}
var count : INTEGER;
    dummyRect : rect;
BEGIN
  SetOrigin (PageCorner.h, PageCorner.v); {negative moves the origin left, up}
  OffsetRect (whatpart, PageCorner.h, PageCorner.v); {also move the update rectangle}
  ClipRect (whatpart); {only redraw the portion that the user requests}
  FOR count := 1 to NumOfRects DO
{Redraw the object if it intersects the update rectangle}
    IF SectRect (MyRect^^[count], whatpart, dummyRect)
    THEN FrameRect(MyRect^^[count]);
  SetOrigin (0,0); {reset the origin back to the upper left hand corner}
  ClipRect (MyWindow^.PortRect); {reset the clip region to the entire window}
END; {of GrafUpdate}

{------------------------------------------------------------------------------------}
PROCEDURE ScrollBits;
{This routine scrolls horizontally and vertically both graphics and text.  If you are
 only scrolling text, only the TEScroll is required.  If you are only scrolling
 graphics, then only the ScrollRect and GrafUpDate is needed.}

VAR vChange, hChange, vScrollValue, hScrollValue: INTEGER;
    AnUpdateRgn: RgnHandle;

BEGIN
  vScrollValue := GetCtlValue (vScroll); {these values will be used a lot so they are}
  hScrollValue := GetCtlValue (hScroll); {read into local (temporary) variables}

{find the vertical and horizontal change}
  vChange := PageCorner.v - vScrollValue; {the vertical difference}
  hChange := PageCorner.h - hScrollValue; {the horizontal difference}

{record the values for next time}
  PageCorner.v := vScrollValue;
  PageCorner.h := hScrollValue;

{for pure text, only a TEScroll is required}
  IF showText AND NOT showGraphics THEN TEScroll (hChange, vChange, hTE);

{For graphics, a ScrollRect will move the visible bits on the screen.  The
 region returned by ScrollRect indicates what part of the window needs to
 be updated.}
  IF showGraphics THEN
  BEGIN
    AnUpdateRgn := NewRgn;
    ScrollRect (MyViewRect, hChange, vChange, AnUpdateRgn);

{This draws the new text.  The clipping is necessary because normally
 TextEdit redraws the entire character height and perhaps only a partial
 character scroll was done.  Since TextEdit erases before it draws, the text,
 if any, is drawn before the graphics.}
    IF showText THEN WITH hTE^^.destrect DO
    BEGIN
      left := -hScrollValue;
      top := -vScrollValue;
      ClipRect (AnUpdateRgn^^.rgnbbox);
      TEUpdate (AnUpdateRgn^^.rgnbbox, hTE);
      ClipRect (MyWindow^.portrect)
    END; {of showText}

    GrafUpdate (AnUpdateRgn^^.rgnbbox);  {This fills in the newly exposed region}
    DisposeRgn (AnUpdateRgn)
  END {of showGraphics}
END; {of ScrollBits}

{------------------------------------------------------------------------------------}
PROCEDURE TrackScroll(theControl: ControlHandle; partCode: INTEGER);
{This routine adjusts the value of the scrollbar.  A reasonable change would
 be to adjust the minimum scroll amount to equal the text's lineheight.}
Var amount, StartValue : INTEGER;
    up : BOOLEAN;
BEGIN
  up := partcode IN [inUpButton, inPageUp]; {TRUE if scrolling page up}
  StartValue := GetCtlValue (theControl);  {the initial control value}

  IF {the scrollbar value is decreased, and it is not already at the minimum}
     ((up AND (StartValue > GetCtlMin (theControl)))
  OR {the scrollbar value is increased, and it is not already at the maximum}
     ((NOT up) AND (StartValue < GetCtlMax (theControl))))
  AND {to prevent tracking as the page up or down area disappears}
     (originalPart = partCode)
  THEN
  BEGIN
    IF up THEN amount := -1 ELSE amount := 1;  {set the direction}
    IF partCode IN [inPageUp, inPageDown] THEN
    BEGIN
      {change the movement to a full page}
      WITH MyViewRect DO
      IF theControl = VScroll
      THEN amount := amount * (bottom - top)
      ELSE amount := amount * (right - left)
    END; {of partCode}
    SetCtlValue(theControl, StartValue+amount);
    ScrollBits
  END
END; {of TrackScroll}

{------------------------------------------------------------------------------------}
PROCEDURE MyControls;  {respond to a mouse down event in one of the controls}
Var dummy: INTEGER;
    theControl: ControlHandle;
BEGIN
  originalPart := FindControl (EventPoint, MyWindow, theControl); {returns control and part}
  IF originalPart = inThumb THEN
  BEGIN
    {Thumb is tracked until it is released; then the bits are scrolled}
    dummy := TrackControl (theControl, EventPoint, NIL);
    ScrollBits
  END {of whichpart}
  {for the arrows and the page changes, scroll while the mouse is held down}
  ELSE dummy := TrackControl (theControl, EventPoint, @TrackScroll)
END; {of Mycontrols}

{------------------------------------------------------------------------------------}
PROCEDURE MainEventLoop; {respond to menu selections, the scrollbars, and update events}
VAR myEvent: EventRecord;                {All of the information about the event}
    menuStuff: RECORD CASE INTEGER OF
      1 : (menuResult : LONGINT);        {Information returned by MenuSelect}
      2 : (theMenu,                      {Which menu was selected}
           theItem : INTEGER)            {Which item within the menu}
    END; {of menuStuff}
    checked : BOOLEAN;                   {Is the menu item checked}
    MarkChar : Char;                     {The checkmark character}
    tempWindow: WindowPtr;
    tempRect : Rect;

BEGIN
  REPEAT
    checked := GetNextEvent(everyEvent,myEvent); {checked here is ignored}
    CASE myEvent.what OF
    mouseDown:
      BEGIN {the user pressed or is holding the mouse button down}
        CASE FindWindow(myEvent.where,tempWindow) OF

          inMenuBar: WITH menuStuff DO
          BEGIN {the mouseDown was in the menu bar}
            menuResult := MenuSelect (myEvent.where);
            CASE theMenu OF
              FileMenu: doneFlag := TRUE;    { Quit }
              ScrollMenu:
              BEGIN
{The items in the menu are used to keep track of the user has chosen thus far. These
 lines toggle the checkmark in the menu and leave the result in the variable checked.}
                GetItemMark (hdlScrollMenu, theItem, markChar);
                checked := markChar <> Chr(checkmark);
                CheckItem (hdlScrollMenu, theItem, checked);

{Any selection will cause some part of the screen to be redrawn.  The selection that
the user makes causes some part of the screen to become invalid.}
                IF (theItem = textItem) OR (theItem = graphicsItem)
                THEN InvalRect(MyViewRect);

                CASE theItem OF

                  horizontal:
                  BEGIN
                    InvalRect (HScroll^^.contrlrect);
                    IF checked THEN
                    BEGIN
                      ShowControl(HScroll);
                      MyViewRect.bottom := HScroll^^.contrlrect.top
                    END {checked}
                    ELSE
                    BEGIN {not checked}
                      HideControl(HScroll);
                      MyViewRect.bottom := HScroll^^.contrlrect.bottom
                    END {not checked}
                  END; {horizontal}

                  vertical:
                  BEGIN
                    InvalRect (VScroll^^.contrlrect);
                    IF checked THEN
                    BEGIN
                      ShowControl(VScroll);
                      MyViewRect.right := VScroll^^.contrlrect.left
                    END {checked}
                    ELSE
                    BEGIN {not checked}
                      HideControl(VScroll);
                      MyViewRect.right := VScroll^^.contrlrect.right
                    END {not checked}
                  END; {vertical}

                  textItem: WITH hTE^^.destrect DO
{since we have dereferenced the destrect, no calls in the scope of this WITH should
 cause a memory compaction}
                  BEGIN
                    showText := checked;
                    IF checked then
                    BEGIN
                      top := -GetCtlValue(vScroll);
                      left := -GetCtlValue(hScroll);
                    END {of checked}
                  END; {of textItem}

                  GraphicsItem: showGraphics := checked;

                END; {of CASE}
              If showText THEN hTE^^.viewrect := MyViewRect
              END {of inMenuBar}
            END; {of FindWindow CASE}
            HiliteMenu(0)
          END; {of mouseDown}

        inContent:
{The rectangles making up the controls are the part of the window outside the 'view'}
          BEGIN
            EventPoint := MyEvent.where;
            GlobalToLocal (EventPoint);
            IF NOT PtInRect (EventPoint, MyViewrect) THEN MyControls
          END {in Content}
        END {of CASE}
      END; {of mouseDown}

    updateEvent:
{In response to InvalRects, the appropriate text or graphics is erased and redrawn.
 The BeginUpdate causes the VisRgn to be replaced by the intersection of the VisRgn
 and the UpdateRgn.}
      BEGIN
        BeginUpdate (MyWindow);
        EraseRect (MyViewRect); {start with a clean slate}
        IF showText THEN TEUpdate (MyWindow^.VisRgn^^.Rgnbbox, hTE);
{Call GrafUpdate with the intersection, if any, of the VisRgn and the view}
        IF showGraphics AND SectRect (MyWindow^.VisRgn^^.Rgnbbox, MyViewRect,
          tempRect) THEN GrafUpdate (tempRect);
        EndUpdate (MyWindow)
      END {of updateEvent}

    END {of event CASE}
  UNTIL doneflag
END;

{------------------------------------------------------------------------------------}
BEGIN
  InitGraf (@ThePort); {initialize QuickDraw}
  InitWindows;         {initialize Window Manager; clear desktop and menubar}
  InitFonts;           {initialize Font Manager}
  FlushEvents (everyEvent, 0); {throw away any stray events}
  TEInit;              {initialize TextEdit}
  InitMenus;           {initialize Menu Manager}
  hdlScrollMenu := GetMenu(FileMenu); {(hdlScrollMenu is ignored)}
  InsertMenu (hdlScrollMenu,0);
  hdlScrollMenu := GetMenu(ScrollMenu);
  InsertMenu (hdlScrollMenu,0);
  DrawMenuBar;
  DoneFlag := FALSE;   {user 'Quit' flag}
  MyWindow := GetNewWindow (256, NIL, Pointer (-1)); {get window to work within}
  SetPort (MyWindow);  {point to window}
  TextFont (applFont); {select default application font}
  SetUpData;           {initialize user data and controls}
  InitCursor;          {change the watch into an arrow}
  MainEventLoop        {handle events until we are through}
END.
 screen to become invalid.}
                IF (theItem = textItem) OR (theItem = graphicsItem)
                THEN InvalRect(MyViewRect);

                CASE theItem OF

                  horizontal:
                  BEGIN
                    InvalRect (HScroll^^.contrlrect);
                    IF checked Tsumacc/ws/example/scrollr   444      0     12        1376  3472707175  11013 3. "6F^5D!$^%BBScroll.Rsrc

*    This is the resource file for Scroll, a simple program to demonstrate
*    the use of scroll bars.

Type SCRL = STR
  ,256
Scroll       by Cary Clark, Macintosh Technical Support      V7/5   Apple, 1984

Type MENU
  ,1(4)
  File
    Quit

  ,2(4)
  Scroll Bar
    Horizontal
    Vertical
    (-
    Text
    Graphics

* a document window
Type WIND
  ,256(4)
A Scrolling Example
  40 20 339 480
  Invisible NoGoAway
  0
  0

* the vertical scroll bar
Type CNTL
  ,256(4)
x
  -1 445 285 461
  Visible
  16
  0
  0 0 400

* the horizontal scroll bar
  ,257(4)
x
  284 -1 300 446
  Invisible
  16
  0
  0 0 300

Type Str
 ,256(4)
  Please refer to the Control Manager manual for more information about scroll bars.

Type Code
ScrollL,0


  File
    Quit

  ,2(4)
  Scroll Bar
    Horizontal
    Vertical
    (-
    Text
    Graphics

* a document window
Type WIND
  ,256(4)
A Scrolling Example
  40 20 339 480
  Invisible NoGoAway
  0
  0

* the vertical scroll bar
Type CNTL
  ,256(4)
x
  -1 44sumacc/ws/example/showpaint   444      0     12        5146  3472707175  11346 3. "6F^5D!$^22
{$X-}
{$U-}
program showPaint;

{Scott Knaster   Macintosh Tech Support   5/84
 Displays the upper-left corner of a MacPaint document on the screen.
 Based on Bill Atkinson's document
 Note: screen sizes are hard-coded for 512 by 342 }

{Small and slow version.
 This version saves memory by doing a CopyBits for each line individually, so
 it's much slower than the all-at-once method.
 You can speed it up by making the constant srcBlocks larger, but every srcBlock
 costs you 512 bytes.
 Ultra-fast, pig version which reads in the whole picture (needs 24K) then does
 CopyBits is available from Macintosh Tech Support                 }

   uses
      {$U obj/memtypes}    memtypes,
      {$U obj/quickdraw}   quickdraw,
      {$U obj/osintf}      osintf,
      {$U obj/toolintf}    toolintf;

   const
      srcBlocks = 2; {Make this number larger to speed things up.  Uses 512 bytes
                      for each number increased.}
      headerSize = 512;

   type
      diskBlock = packed array [1..512] of QDbyte;

   var
      srcBuf : array [1..srcBlocks] of diskBlock;
      theBits : packed array [1..72] of byte;
      srcPtr, dstPtr : Ptr;
      dstBits : bitmap;
      error : OSErr;
      refNum, scanline, srcSize : integer;
      count : longint;
      aPort : GrafPort;
      debug : text;
      showRect, lineRect : Rect;

begin
   InitGraf (@thePort);
   FlushEvents (everyEvent, 0);
   InitCursor;
   OpenPort (@aPort);

   srcSize := srcBlocks * 512;

   srcPtr := @srcBuf;

   dstBits.rowBytes := 72;
   dstBits.baseAddr := @theBits;
   SetRect (dstBits.bounds, 0, 0, 576, 1);
   dstPtr := pointer (dstBits.baseAddr);

   error := FSOpen ('macPic', 0, refNum);

   {skip the header}
   count := headerSize;
   error := FSRead (refNum, count, @srcBuf);

   {prime srcBuf}
   count := srcSize;
   error := FSRead (refNum, count, @srcBuf);
   SetRect (lineRect, 0, 0, 512, 1);
   SetRect (showRect, 0, 0, 512, 1);
   count := count - 512;

   {unpack each scanline into dstBits, reading more source as needed}
   for scanline := 1 to 342 do
      begin
         UnpackBits (srcPtr, dstPtr, 72);
         CopyBits (dstBits, screenBits, lineRect, showRect,
             srcCopy, nil);
         dstPtr := pointer (dstBits.baseAddr);
         OffsetRect (showRect, 0, 1);
         if ord (srcPtr) > (ord (@srcBuf) + srcSize - 512)
            then begin
                  srcBuf [1] := srcBuf [srcBlocks];
                  error := FSRead (refNum, count, @srcBuf [2]);
                  srcPtr := pointer (ord (srcPtr) + 512 - srcSize);
                 end;
      end;
   error := FSClose (refnum);
   repeat until button;
end.

hange the watch into an arrow}
  MainEventLoop        {handle events until we are through}
END.
 screen to become invalid.}
                IF (theItem = textItem) OR (theItem = graphicsItem)
                THEN InvalRect(MyViewRect);

                CASE theItem OF

                  horizontal:
                  BEGIN
                    InvalRect (HScroll^^.contrlrect);
                    IF checked Tsumacc/ws/example/showpaintr   444      0     12         157  3472707175  11505 3. "6F^5D!$^T*  example/showpaintR -- Resource file

example/showPaint.Rsrc

Type CODE
   example/showpaintl,0
er-left corner of a MacPaint document on the screen.
 Based on Bill Atkinson's document
 Note: screen sizes are hard-coded for 512 by 342 }

{Small and slow version.
 This version saves memory by doing a CopyBits for each line individually, so
 it's much slower than the all-at-once method.
 You can speed it up by making the constant srcBlocks larger, but every srcBlock
 costs you 512 bytes.
 Ultra-sumacc/ws/example/soundlab   444      0     12       42562  3472707175  11164 56                                                                                                          N1N^!wn .S-@ALCR 0 <-@Bn-|AB1/.HnL/.BHnHn?.<Nj nJPn|%-n=|=nBn`-nH nHBXRni
0.no/.?.?<NlVddSTXTX2-CI"jLxx2-CISTAR^dSTART.TEXTTRZN^O`O`XX0T{$R-}
{$X-}
PROGRAM SoundDemo;

  {  Program to play with the new proto sound }
  {  written by Andy Hertzfeld  Oct 3, 1982   }

  {  modified for 4 voice ROM sound       -- Nov 2, 1982  }
  {  for ROM 4T                           -- Jun 18, 1983 }
  {  made to run under ToolBox, OSInterfc -- Jan 8, 1983  }
  {  changes for new interfaces           -- Jun 26, 1984 }

  {  Historical note:  since this program was written a long, long time ago,
     please note that the programming style is a little strange in places. }

   USES {$U-}
      {$U Obj/Memtypes    } Memtypes,
      {$U Obj/QuickDraw   } QuickDraw,
      {$U Obj/OSIntf      } OSIntf,
      {$U Obj/ToolIntf    } ToolIntf,
      {$U Obj/Sane        } SANE,
      {$U Obj/Elems       } Elems;

   VAR
      tempRect: Rect;
      mousePt,myPt: Point;
      myEvent: EventRecord;
      theFolder: WindowPtr;
      doneFlag: Boolean;
      theMenu,theItem: INTEGER;
      code: INTEGER;
      whichWindow: WindowPtr;
      whichControl: ControlHandle;
      folRect: Rect;
      mBox: Rect;
      dial1,dial2,dial3,dial4: ControlHandle;
      dialV: ControlHandle;
      fullRect: Rect;

      UserVol:  Integer;
      soundTblPtr: FTSynthPtr;
      MySoundRec: FTSoundRec;    {fixed size, so no reason to allocate on heap}
      MySynthRec:  FTSynthRec;   {fixed size, so no reason to allocate on heap}
      wave1,wave2,wave3,wave4, sinWave: Wave;
      t,I: INTEGER;
      waveWindow,topWindow: WindowPtr;
      whichWave: INTEGER;
      myMenu,menu2,menu3,deskMenu: MenuHandle;
      mResult: LongInt;
      title1,title2,title3,title4: Str255;
      offSwitch: Boolean;
      myString: Str255;
      refNum: INTEGER;

   PROCEDURE SetUpMenus;
   {once only initialization for menus}

      VAR
         I: INTEGER;
         menuFile: Text;
         drvrType: ResType;

      BEGIN
         InitMenus; {initialize Unit Menus}
         drvrType := 'DRVR';

         myMenu := GetMenu(256);
         menu2 := GetMenu(257);
         menu3 := GetMenu(258);
         deskMenu := GetMenu(1);

         AddResMenu(deskMenu,drvrType);

         InsertMenu(deskMenu,0);
         InsertMenu(myMenu,0);
         InsertMenu(menu2,0);
         InsertMenu(menu3,0);
         DrawMenuBar;
      END;

   PROCEDURE MakeTheFolder;
   { set up and draw one folder }

      VAR
         tempRect: Rect;
         folName: Str255;
         tempPt: Point;

      BEGIN
         theFolder := GetNewWindow(1,NIL,NIL);

         waveWindow := GetNewWindow(2,NIL,theFolder);
         topWindow := theFolder;
      END;

   PROCEDURE MakeTheDials;

      VAR
         tempRect: Rect;

      BEGIN
         SetRect(mBox,120,30,280,46);
         dial1 := NewControl(theFolder,mBox,' ',TRUE,0,0,8191,ScrollBarProc,1);
         SetRect(mBox,120,60,280,76);
         dial2 := NewControl(theFolder,mBox,' ',TRUE,0,0,8191,ScrollBarProc,2);
         SetRect(mBox,120,90,280,106);
         dial3 := NewControl(theFolder,mBox,' ',TRUE,0,0,8191,ScrollBarProc,3);
         SetRect(mBox,120,120,280,136);
         dial4 := NewControl(theFolder,mBox,' ',TRUE,0,0,8191,ScrollBarProc,4);

         SetRect(mBox,76,160,256,192);
         dialV := NewControl(theFolder,mBox,' ',TRUE,7,0,7,ScrollBarProc,5);
      END;

   PROCEDURE LabelControls;

      BEGIN
         MoveTo(30,42);
         DrawString('Channel A');

         MoveTo(30,72);
         DrawString('Channel B');

         MoveTo(30,102);
         DrawString('Channel C');

         MoveTo(30,132);
         DrawString('Channel D');

         MoveTo(140,208);
         DrawString('Volume');
      END;

   PROCEDURE Triangle(VAR theWave: Wave);
   { make a simple triangle wave }

      VAR
         I: INTEGER;

      BEGIN
         FOR I := 0 TO 127 DO
            BEGIN
            theWave[I] := 2*I;
            theWave[255-I] := 2*I;
            END;
      END;

   FUNCTION sineval (period:  INTEGER):  INTEGER;
   CONST        Increment = 3.14159*2/256; {2 pi = waveform period; 256 samples}
   VAR          newval, holder:  extended;

   BEGIN
      I2X (period, newval);
      S2X (Single(Increment), holder);
      MulX (holder, newval);
      SinX (newval);
      I2X (128, holder);
      MulX (holder, newval);
      AddX (holder, newval);
      X2I (newval, period);
      sineval := period;
   END;



   PROCEDURE buildSinWave;


   VAR   Index :  Integer;

      BEGIN
         SetRnd (Downward);
         For Index := 0 to 255 DO
            BEGIN
               SinWave[Index] := sineval (Index);
            END;
      END;

   PROCEDURE mysine(VAR sine: Wave);

   BEGIN
      Sine := sinWave;
   END;

   PROCEDURE Square(VAR theWave: Wave);
   { make a simple square wave }

      VAR
         I: INTEGER;

      BEGIN
         FOR I := 0 TO 127 DO
            BEGIN
            theWave[I] := ord (255); { ord() is needed because of compiler bug,
                                       fixed in version 3.0 }
            theWave[255-I] :=  0;
            END;
      END;

   PROCEDURE CopyWave(VAR src,dst: Wave);

      VAR
         I: INTEGER;

      BEGIN
         FOR I := 0 TO 255 DO dst[I] := src[I];
      END;

   PROCEDURE InitSTab;

      VAR
         l: LongInt;

      BEGIN
         WITH soundTblPtr^.sndRec^ DO
            BEGIN
            duration := 8192;
            l := 256;
            sound1Rate := l*GetCtlValue(dial1);
            sound1Phase := 0;

            sound2Rate := l*GetCtlValue(dial2);
            sound2Phase := 0;

            sound3Rate := l*GetCtlValue(dial3);
            sound3Phase := 0;

            sound4Rate := l*GetCtlValue(dial4);
            sound4Phase := 0;

            sound1Wave := @wave1;
            sound2Wave := @wave2;
            sound3Wave := @wave3;
            sound4Wave := @wave4;
            END
      END;

   PROCEDURE SetPitch(voiceIndex: INTEGER; pitch: INTEGER);

      VAR
         l: LongInt;

      BEGIN
         l := 256;
         WITH soundTblPtr^.sndRec^ DO
            BEGIN
            CASE voiceIndex OF
               1: sound1Rate := l*pitch;
               2: sound2Rate := l*pitch;
               3: sound3Rate := l*pitch;
               4: sound4Rate := l*pitch
            END
            END
      END;

   PROCEDURE BumpDial(whichControl: ControlHandle; amount: INTEGER);

      VAR
         v: INTEGER;

      BEGIN
         v := GetCtlValue(whichControl)+amount;
         SetCtlValue(whichControl,v);

         If whichControl = dial1 THEN
            SetPitch(1,v)
         ELSE If whichControl = dial2 THEN
            SetPitch(2,v)
         ELSE If whichControl = dial3 THEN
            SetPitch(3,v)
         ELSE If whichControl = dial4 THEN
            SetPitch(4,v)
         ELSE
            BEGIN
               If v < 0 then v := 0
               Else If v > 7 then v := 7;
               SetsoundVol(v)
            END
      END;

   PROCEDURE ScrollUp(whichControl: ControlHandle; theCode: INTEGER);

      BEGIN
         IF theCode=inUpButton THEN BumpDial(whichControl,-1);
      END;

   PROCEDURE ScrollDown(whichControl: ControlHandle; theCode: INTEGER);

      BEGIN
         IF theCode=inDownButton THEN BumpDial(whichControl,1);
      END;

   PROCEDURE PageUp(whichControl: ControlHandle; theCode: INTEGER);

      BEGIN
         IF theCode=inPageUp THEN
            IF whichControl<>dialV THEN
               BumpDial(whichControl,-200)
            ELSE
               BumpDial(whichControl,-1)
      END;

   PROCEDURE PageDown(whichControl: ControlHandle; theCode: INTEGER);

      BEGIN
         IF theCode=inPageDown THEN
            IF whichControl<>dialV THEN
               BumpDial(whichControl,200)
            ELSE
               BumpDial(whichControl,1);
      END;

   PROCEDURE DrawTheWave(theWave: Wave);

      VAR
         I,J: INTEGER;

      BEGIN
         EraseRect(thePort^.portRect);
         FOR I := 0 TO 255 DO
            BEGIN
            J := 255-theWave[I];
            SetRect(tempRect,I,J,I+1,J+1);
            PaintRect(tempRect);
            END;
      END;

   PROCEDURE DrawWaveFolder;

      BEGIN
         SetPort(waveWindow);
         CASE whichWave OF
         1:
            DrawTheWave(wave1);
         2:
            DrawTheWave(wave2);
         3:
            DrawTheWave(wave3);
         4: DrawTheWave(wave4)
         END    {case}
      END;

   PROCEDURE SetNewPt(VAR theWave: Wave; myPt: Point);

      VAR
         h,v,J: INTEGER;

      BEGIN
         h := myPt.h; v := myPt.v;

         IF (h<0) OR (h>255) THEN EXIT(SetNewPt);
         IF (v<0) OR (v>255) THEN EXIT(SetNewPt);

         IF v=theWave[h] THEN EXIT(SetNewPt);

         J := 255-theWave[h];
         SetRect(tempRect,h,J,h+1,J+1);
         EraseRect(tempRect);

         tempRect.top := v; tempRect.bottom := tempRect.top+1;
         PaintRect(tempRect);

         theWave[h] :=  255-v;

      END;

   PROCEDURE EditTheWave(VAR theWave: Wave);

      VAR
         lastX,lastY: INTEGER;
         I: INTEGER;
         thePt: Point;

      BEGIN
         GetMouse(myPt);
         lastX := myPt.h; lastY := myPt.v;
         WHILE StillDown DO
            BEGIN
            GetMouse(myPt);
            IF myPt.h=lastX THEN
               SetNewPt(theWave,myPt)
            ELSE IF myPt.h<lastX THEN
               BEGIN
               I := lastX-1;
               REPEAT
                  thePt.h := I;
                  thePt.v := lastY;
                  SetNewPt(theWave,thePt);
                  I := I-1;
               UNTIL I<myPt.h;
               END
            ELSE
               BEGIN
               I := lastX+1;
               REPEAT
                  thePt.h := I;
                  thePt.v := lastY;
                  SetNewPt(theWave,thePt);
                  I := I+1;
               UNTIL I>myPt.h;
               END;
            lastX := myPt.h; lastY := myPt.v;
            END;
      END;

   PROCEDURE EditWaveForm;

      BEGIN
         SetPort(waveWindow);
         CASE whichWave OF
         1:
            EditTheWave(wave1);
         2:
            EditTheWave(wave2);
         3:
            EditTheWave(wave3);
         4: EditTheWave(wave4)
         END    {case}
      END;

   PROCEDURE ChangeTheWave(which: INTEGER; VAR theWave: Wave);

      BEGIN
         CASE which OF
         1:
            Triangle(theWave);
         2:
            Square(theWave);
         3:
            mysine(theWave);
         4:
            CopyWave(wave1,theWave);
         5:
            CopyWave(wave2,theWave);
         6:
            CopyWave(wave3,theWave);
         7: CopyWave(wave4,theWave)
         END;   {case}

         DrawWaveFolder;
      END;

   PROCEDURE ChangeWave(which: INTEGER);

      BEGIN
         CASE whichWave OF
         1:
            ChangeTheWave(which,wave1);
         2:
            ChangeTheWave(which,wave2);
         3:
            ChangeTheWave(which,wave3);
         4: ChangeTheWave(which,wave4)
         END    {case}
      END;

   PROCEDURE InitWave;

      BEGIN
         Triangle(wave1);
         Square(wave2);
         mysine(wave3);
         Triangle(wave4);
      END;

   BEGIN
      InitGraf(@thePort);
      InitFonts;
      FlushEvents(everyEvent,0);

      InitWindows;
      SetUpMenus;
      SetRect(fullRect,0,20,512,342);

      title1 := 'Channel A WaveForm';
      title2 := 'Channel B WaveForm';
      title3 := 'Channel C WaveForm';
      title4 := 'Channel D WaveForm';
      buildSinWave;
      MakeTheFolder;

      SetPort(theFolder);
      MakeTheDials;
      LabelControls;
      GetSoundVol (UserVol);  {save and restore--hope user doesn't use control panel}

      doneFlag := FALSE;
      SoundTblPtr := @MySynthRec;
      SoundTblPtr^.mode := ftMode;
      SoundTblPtr^.sndRec := @MySoundRec;
      InitWave;
      DrawWaveFolder;
      SetsoundVol(0);   {minimize pop}
      InitSTab;
      StartSound(Pointer(soundTblPtr),SizeOf (FTSynthRec),NIL);
      SetsoundVol(7);
      offSwitch := FALSE;

      whichWave := 1;
      CheckItem(myMenu,1,TRUE);
      InitCursor;

      REPEAT
         SystemTask;

         soundTblPtr^.sndRec^.duration := 8192;
         IF GetNextEvent(everyEvent,myEvent) THEN
            CASE myEvent.what OF

               mouseDown:
                  BEGIN
                  code := FindWindow(myEvent.where,whichWindow);
                  myPt := myEvent.where;
                  WITH whichWindow^.portBits.bounds DO
                     BEGIN
                     myPt.h := myPt.h+left;
                     myPt.v := myPt.v+top;
                     END;

                  Case code of
                  inMenuBar:
                     BEGIN
                     theMenu := 0; theItem := 0;  {???}
                     mResult := MenuSelect(myEvent.where);
                     theMenu := HiWord(mResult); theItem := LoWord(mResult);

                     IF (theItem>0) THEN
                        CASE theMenu OF
                        256:
                           BEGIN
                           CheckItem(myMenu,whichWave,FALSE);
                           CheckItem(myMenu,theItem,TRUE);
                           IF whichWave<>theItem THEN
                              BEGIN
                              CASE theItem OF
                              1:
                                 SetWTitle(waveWindow,title1);
                              2:
                                 SetWTitle(waveWindow,title2);
                              3:
                                 SetWTitle(waveWindow,title3);
                              4: SetWTitle(waveWindow,title4)
                              END;         {case}
                              whichWave := theItem;
                              DrawWaveFolder;
                              END
                           END;
                        257:
                           ChangeWave(theItem);
                        258:
                           IF offSwitch THEN
                              BEGIN
                              StartSound(Pointer(soundTblPtr),
                                         SizeOf (FTSynthRec),NIL);
                              offSwitch := FALSE;
                              SetItem(menu3,1,'Sound Off');
                              END
                           ELSE
                              BEGIN
                              GetSoundVol (I);
                              SetSoundVol (0); {minimize pop}
                              StopSound;
                              SetSoundVol (I); {restore volume}
                              offSwitch := TRUE;
                              SetItem(menu3,1,'Sound On');
                              END;
                        1:
                           BEGIN
                           GetItem(deskMenu,theItem,myString);
                           refNum := OpenDeskAcc(myString)
                           END
                        END;  {case}

                     HiLiteMenu(0);
                     END; { onMenuBar }

                  inDesk:
                     BEGIN
                     END;
                  inDrag:
                     DragWindow(whichWindow,myEvent.where,fullRect);
                  inGoAway:
                     BEGIN
                     IF TrackGoAway(whichWindow,myEvent.where) THEN
                        doneFlag := TRUE;
                     END;
                  inSysWindow:
                     SystemClick(myEvent,whichWindow);
                  inContent:
                     BEGIN
                     IF topWindow<>whichWindow THEN
                        BEGIN
                        SelectWindow(whichWindow);
                        topWindow := whichWindow;
                        END
                     ELSE IF whichWindow=waveWindow THEN
                        EditWaveForm
                     ELSE
                        BEGIN
                        code := FindControl(myPt,whichWindow,whichControl);
                        CASE code OF
                        inUpButton:
                           t := TrackControl(whichControl,myPt,@ScrollUp);
                        inDownButton:
                           t := TrackControl(whichControl,myPt,@ScrollDown);
                        inPageUp:
                           t := TrackControl(whichControl,myPt,@PageUp);
                        inPageDown:
                           t := TrackControl(whichControl,myPt,@PageDown);
                        inThumb:
                           BEGIN
                           code := TrackControl(whichControl,myPt,NIL);
                           BumpDial(whichControl,0);
                           END
                        END              {case}

                        END
                     END
                  END    {of case code}

               END; { of button down }

               updateEvt:
                  BEGIN
                  whichWindow := WindowPtr(myEvent.message);
                  SetPort(whichWindow);
                  BeginUpdate(whichWindow);

                  IF whichWindow=waveWindow THEN
                     DrawWaveFolder
                  ELSE
                     BEGIN
                     DrawControls(whichWindow);
                     LabelControls;
                     END;

                  EndUpdate(whichWindow);
                  END; {of update event}

               OTHERWISE
                  BEGIN
                  END;

            END; { of event case }

      UNTIL doneFlag;
      SetSoundVol (0);
      StopSound;
      SetSoundVol (UserVol);
   END.
            SetWTitle(waveWindow,title3);
                              4: SetWTitle(waveWindow,title4)
                              END;    sumacc/ws/example/soundlabr   444      0     12        1145  3472707176  11317 3. "6F^9D!$^EFPelectWindow(whichWindow);RFFFF`D`Z$lFPFPaa.FFx`|a.Lode := FindContrFaLa.,FF$6LL88`xLL88,FFF|`6$`$L~xyUHH"N"W*
*  Resource Definition File for Sound Demo
*
*

Example/SoundLab.Rsrc

Type MENU
  ,1
  \14

  ,256
  Channel
    Channel A
    Channel B
    Channel C
    Channel D

  ,257
  WaveForm
    Triangle
    Square
    Sine
    Channel A
    Channel B
    Channel C
    Channel D

   ,258
   On/Off
     Sound Off

Type WIND
  ,1
  Mac Sound Lab
  40 40 280 340
  Visible GoAway
  0
  1

  ,2
  Channel A WaveForm
  100 100 356 356
  Visible GoAway
  0
  3


Type CODE
  example/soundlabL,0



8,FFF|`6$`$L~xyUHH"N"W*
*  Resource Definition File for Sound Demo
*
*

Example/SoundLab.Rsrc

Type MENU
  ,1
  \14

  ,256
  Channel
    Channel A
    Channel B
    Channel C
    Channel D

  ,257
  WaveForm
    Triangle
    Square
    Sine
    Channel A
    Channel B
    Channel C
    Channel D

   ,258
   On/Off
     Sound Off

Type WIND
  ,1
  Mac Sound Lab
  40 40 280 340
  Visible GoAway
  0
  1

  ,2
sumacc/ws/example/zoomrect   444      0     12        3536  3472707176  11176 

PROCEDURE ZoomRect(VAR smallRect,bigRect: Rect; zoomUp: BOOLEAN);

{ Given two rectangles in global coords, interpolate one into the other, }
{ making a zooming rectangle image on the screen.  The rectangles and the }
{ screen image are not altered }

CONST zoomSteps = 16;
VAR rect1,rect2,rect3,rect4: Rect;
    i,j: INTEGER;
    savePort: GrafPtr;
    fract,factor,one: Fixed;   { reals are too slow }

   FUNCTION Blend(smallCoord,bigCoord: INTEGER): INTEGER;
   VAR smallFix,bigFix,tempFix: Fixed;
   BEGIN
     smallFix:=one * smallCoord;     { scale up to fixed point }
     bigFix  :=one * bigCoord;
     tempFix :=FixMul(fract,bigFix) + FixMul(one-fract,smallFix);
     Blend   :=FixRound(tempFix);
   END;

BEGIN
  GetPort(savePort);
  SetPort(deskPort);
  PenPat(gray);
  PenMode(notPatXor);

  one:=65536;   { fixed point 'const' }
  IF zoomUp
  THEN
    BEGIN
      rect1:=smallRect;
      factor:=FixRatio(6,5);        { make bigger each time }
      fract:=FixRatio(541,10000);   { 5/6 ^16 = 0.540877 }
    END
  ELSE
    BEGIN
      rect1:=bigRect;
      factor:=FixRatio(5,6);        { make smaller each time }
      fract:=one;                   { start full size }
    END;

  rect2:=rect1;
  rect3:=rect1;
  FrameRect(rect1);   { draw initial image }

  FOR i:=1 TO zoomSteps DO
    BEGIN
      rect4.left   :=Blend(smallRect.left,bigRect.left);
      rect4.right  :=Blend(smallRect.right,bigRect.right);
      rect4.top    :=Blend(smallRect.top,bigRect.top);
      rect4.bottom :=Blend(smallRect.bottom,bigRect.bottom);

      FrameRect(rect4);  { draw newest }
      FrameRect(rect1);  { erase oldest }
      rect1:=rect2;
      rect2:=rect3;
      rect3:=rect4;

      fract:=FixMul(fract,factor);  { bump interpolation fraction }
    END;
  FrameRect(rect1);  { erase final image }
  FrameRect(rect2);
  FrameRect(rect3);
  PenNormal;
  SetPort(savePort);
END;
de := TrackControl(whichControl,myPt,NIL);
                           BumpDial(whichControl,0);
                           END
                        END        sumacc/ws/tlasm/   775      0     12           0  3472707202   6774 sumacc/ws/tlasm/fsequ   444      0     12       23301  3472707176  10154 O5PH r^OO; File: FSEqu.Text
;_______________________________________________________________________
;
; External Routines:    none
;
; Internal Routines:    none
;
; Function:     This file contains all file system equates.  Currently
;               contains equates which will go into SYSEQU.TEXT
;
; Modification History:
;  22 Dec 82  LAK  I modify this file every day.
;  08 Feb 83  LAK  Pared down RgSvArea to 56 bytes from 64; added FSTemp4
;                   for Rename.
;  14 Feb 83  LAK  Changed VCB dir wr prot to attributes word.
;  30 May 83  LAK  Added FrcSync flag, DiskSwitch, ExtFS, FSQueue, CmdDone
;                   hook vectors.
;  05 Jan 83  LAK  Switched equates for BufFlags and BufFBlk to correspond
;                   with reality as perceived by the ROM.
;  10 Jan 83  LAK  Added FSClrWdLen -- length of fs globals cleared by boot blocks
;                  since DiskSwitched hook will eventually be installed by ROM
;_______________________________________________________________________

; (c) 1983 Apple Computer, Inc.
;
;  File System Equates
;
;  General system equates:

BtsPrBlk    .EQU    12          ; twelve bits per block in the volume map.
StrtDir     .EQU    2           ; directory master block is block 2
BufSiz      .EQU    512         ; standard file system buffer size in bytes
HdrSiz      .EQU    10          ; size of header prefixed to buffer
BufModBit   .EQU    7           ; dirty bit in high byte of buf tag word
BufFNum     .EQU    -10         ; offset from buf start to file number longword
BufFlags    .EQU    -6          ; offset from buf start to file flags word
BufFBlk     .EQU    -4          ; offset from buf start to file block word
BufTag      .EQU    -2          ; offset from buf start to tag word

SigWord     .EQU    $D2D7       ; signature bytes expected on start block

; fixed location labels: (equivalent of zero page)

CkdDB       .EQU    FileVars        ; (2) used when searching the directory
NxtDB       .EQU    CkdDB+2
MaxDB       .EQU    NxtDB+2
FlushOnly   .EQU    MaxDB+2         ; (1) flag used by UnMountVol,FlushVol,
RegRsrc     .EQU    FlushOnly+1     ; (1) flag used by OpenRF, FileOpen
FLckUnlck   .EQU    RegRsrc+1       ; (1) flag used by SetFilLock,RstFilLock
FrcSync     .EQU    FLckUnlck+1     ; (1) when set, all fs calls are sync'ed
NewMount    .EQU    FrcSync+1       ; (1) used by MountVol to flag new mounts

DrMstrBlk   .EQU    NewMount+2      ; master directory block in a volume
FCBSPtr     .EQU    DrMstrBlk+2     ; ptr to FCBs
DefVCBPtr   .EQU    FCBSPtr+4       ; pointer to default VCB
VCBQHdr     .EQU    DefVCBPtr+4     ; VCB queue header

FSQHdr      .EQU    VCBQHdr+QHeadSize ; file system queue header (10 bytes)
FSBusy      .EQU    FSQHdr+QFlags   ; non-zero when the file system is busy
FSQHead     .EQU    FSQHdr+QHead    ; ptr to 1st queued cmd: 0 when queue empty
FSQTail     .EQU    FSQHdr+QTail    ; ptr to last queue element

RgSvArea    .EQU    FSQHdr+QHeadSize ; reg save during async calls.
ErCode      .EQU    RgSvArea+56     ; use this loc to report errors during async
                                    ;  routines
Params      .EQU    ErCode+2        ; 50 bytes long. For I/O parameter blocks.
FSTemp8     .EQU    Params+IOQElSize; used by rename
FSTemp4     .EQU    FSTemp8+8       ; used by rename, ckfilmod

FSQueueHook .EQU    FSTemp4+4       ; hook to capture all FS calls
ExtFSHook   .EQU    FSQueueHook+4   ; command done hook
DskSwtchHook .EQU   ExtFSHook+4     ; hook for disk-switch dialog
ReqstVol    .EQU    DskSwtchHook+4  ; ptr to VCB of off-line or ext fs volume

toExtFS     .EQU    ReqstVol+4      ; hook for external file systems
FSVarEnd    .EQU    toExtFS+4       ; end of file system variables
FSVarLth    .EQU    FSVarEnd-FileVars
FSClrWDLen  .EQU    FSQueueHook-FileVars ;length to clear in boot blocks

;  Directory master block entries: (Prefix DR)

DrSigWord   .EQU    0           ; signature word
DrCrDate    .EQU    2           ; Creation date.
DrLsBkUp    .EQU    6           ; last backup date
DrAtrb      .EQU    10          ; volume attributes. bit 15=write(locked=1)
DrNmFls     .EQU    12          ; number files in directory
DrDirSt     .EQU    14          ; start dir (512-byte) block on diskette
DrBlLn      .EQU    16          ; length of dir in (512-byte) blocks
DrNmAlBlks  .EQU    18          ; number of blocks (of alloc size) this volume
DrAlBlkSiz  .EQU    20          ; min num of bytes to allocate (must be 512 mult)
DrClpSiz    .EQU    24          ; num of bytes to try to alloc as a clump
DrAlBlSt    .EQU    28          ; starting diskette (512-byte) block in block map
DrNxtFNum   .EQU    30          ; next free file number
DrFreeBks   .EQU    34          ; number of free blocks on this volume
DrVN        .EQU    36          ; volume name (including name length)
MPTblStr    .EQU    64          ; byte start position of map table within
                                ;  master dir block

; Volume Control Block equates: (prefix: VCB)

VCBDirty    .EQU    15          ; flags dirty bit (tst.w tests,clr.b clears)
VCBWrProt   .EQU    7           ; attrib write-protected bit (tst.b ATRB+1 tests)
VCBFlags    .EQU    6           ; flags word is first word after header

; first 66 bytes of VCB come directly from the directory master block

VCBDInfoSt  .EQU    8           ; leave room for 6-byte queue header
VCBDILen    .EQU    64          ; len of VCB data from master directory

VCBSigWord  .EQU    8           ; signature word
VCBCrDate   .EQU    10          ; Creation date.
VCBLsBkUp   .EQU    14          ; last backup date
VCBAtrb     .EQU    18          ; volume attributes. bit 15 = vol lock (1=locked)
                                ;                    bit 7 = wr protect
                                ;                    bit 6 = busy (1=busy)
                                ;                    bits 0-2 = consistency prob
VCBNmFls    .EQU    20          ; number files in dir  (low byte)
VCBDirSt    .EQU    22          ; start dir (512-byte) block on diskette
VCBBlLn     .EQU    24          ; length of dir in (512-byte) blocks
VCBNmBlks   .EQU    26          ; number of blocks (of alloc size) this device
VCBNmAlBlks .EQU    26          ; (alternate label for a while)
VCBAlBlkSiz .EQU    28          ; num of bytes in an allocation block
VCBClpSiz   .EQU    32          ; num of bytes to try to alloc as a clump
VCBAlBlSt   .EQU    36          ; starting diskette (512-byte) block in block map
VCBNxtFNum  .EQU    38          ; next free file number
VCBFreeBks  .EQU    42          ; number of free blocks on this volume
VCBVN       .EQU    44          ; volume name (including name length byte)
VCBMaxNam   .EQU    27          ; 27 byte max name length

; next 6 fields should be kept together

VCBDrvNum   .EQU    72          ; drive number for this VCB
VCBDRefNum  .EQU    74          ; driver refnum for this VCB
VCBFSID     .EQU    76          ; ID of file system handling this volume
VCBVRefNum  .EQU    78          ; unique refnum for this VCB
VCBMAdr     .EQU    80          ; volume map address
VCBBufAdr   .EQU    84          ; volume buffer address
VCBMLen     .EQU    88          ; length of volume map

VCBDirIndex .EQU    90          ; directory index, block number used for
VCBDirBlk   .EQU    92          ;  GetFileInfo searches by index

VCBLength   .EQU    94          ; VCB byte length

;  File Entry equates: (prefix: Fl)
; (delete indication may be needed; for now just check VCB del fnum . . .)

FlWrtFlag   .EQU    0           ; write-allowed bit in flags byte (0 if allowed)
FlTypMask   .EQU    $FE         ; (user file-type in bits 1-7)

FlFlags     .EQU    0           ; bit 7=1 (used), bit 0=file lock flag
FlTyp       .EQU    1           ; file type (used as a name extension)
FlUsrWds    .EQU    2           ; user words for file. (16 bytes)
FlFlNum     .EQU    18          ; file number

FlStBlk     .EQU    22          ; Start file block (alloc blk size)(0000 if none)
FlLgLen     .EQU    24          ; File logical length in bytes (EOF)
FlPyLen     .EQU    28          ; File physical length in bytes

FlRStBlk    .EQU    32          ; Start file block, resource fork (0000 if none)
FlRLgLen    .EQU    34          ; File logical length (EOF), resource fork
FlRPyLen    .EQU    38          ; File physical length, resource fork

FlCrDat     .EQU    42          ; File creation date & time (32 bits in seconds)
FlMdDat     .EQU    46          ; last modification date & time (32 bits in seconds)
FlNam       .EQU    50          ; file name, starting with length byte
FlNTLen     .EQU    50          ; length of each file entry, excluding name

; File Control Block equates: (prefix: FCB)

FCBModBit   .EQU    7           ; dirty bit for FCB entry in FCBMdRByt
FCBRscBit   .EQU    1           ; 1 if this is resource part (in FCBMdRByt)
FCBFlgRBit  .EQU    9           ; resource bit in FCBFlags (word)
FCBFlgWBit  .EQU    8           ; write permissions bit in FCBFlags (word)
FCBWrtBit   .EQU    0           ; write permissions bit in FCBTypByt (1 if ok)
WrRsMask    .EQU    $0300       ; rsrc/reg, write permissions mask

FCBFlNm     .EQU    0           ; FCB file number. Non-zero marks FCB used.
FCBFlags    .EQU    4           ; FCB flags
FCBMdRByt   .EQU    4           ;  mod, write permissions, resource byte
FCBTypByt   .EQU    5           ;  type byte

FCBSBlk     .EQU    6           ; File start block (in alloc size blks)
FCBEOF      .EQU    8           ; logical length or EOF in bytes
FCBPLen     .EQU    12          ; Physical file length in bytes
FCBCrPs     .EQU    16          ; current position within file.
FCBVPtr     .EQU    20          ; Absolute pointer to the corresponding VCB
FCBBfAdr    .EQU    24          ; file's buffer address.
FCBFlPos    .EQU    28          ; directory block this file is in
FCBEntLen   .EQU    30          ; each FCB is this long.


 busy (1=busy)
                                ;                    bits 0-2 = consistency prob
VCBNmFls    .EQU    20          ; number files in dir  (low byte)
VCBDirSt    .EQU    22          ; start dir (512-byte) block on diskette
VCBBlLn     .EQU    24          ; length of dir in (512-byte) blocks
VCBNmBlks   .EQsumacc/ws/tlasm/grafequ   444      0     12       10123  3472707176  10461 W^I'4PH r^FTTEn;-----------------------------------------------------------------
; File GRAFEQU.TEXT - Macintosh graphics equates file.
;
; Written by Bud Tribble        26-May-81
;
; All system graphic routines include this equate file.
;
;   MODIFICATION HISTORY:
;
;   BLT  2-Oct-81    For new LisaGraf
;   AJH  31-Oct-81   Moved variables down to make room for driver variables
;   alo  05-Feb-82   Lisagraf vars moved down to $800 for more system globals
;   AJH  06-Jul-82   Added stuff for ObscureCursor
;   LAK  26-Jul-82   Added JUPDATEPROC pointer to update event generator
;   LAK  05-Sep-82   Added MaxX and MaxY equates
;   AJH  15-Sep-82   Modified for new cursor interface
;   LAK  16-Oct-82   updated for 512 dots
;   AJH  20-Nov-82   added JournalFlag, font manager jump vectors
;   AJH  02-Jan-83   added JournalHook
;   SC   21-Jan-83   font scaling/coupling stuff
;   SC   02-Jun-83   Added 3 vars for jerky cursors
;   SC   23-Jan-83   changed JournalHook to journalRef
;   AJH  11-Aug-83   added MScaleThresh, MScaleFactor
;   LAK  13-Aug-83   changed above two to MScaleTbl, added MScaleOld
;   LAK  18-Aug-83   changed above two to CrsrThresh and CrsrQuad.
;                    moved JCrsrTask here from Sysequ.
;   LAK  20-Aug-83   Removed CrsrQuad.
;-----------------------------------------------------------------

;-----------------------------------------------------------------
; System Constants
;-----------------------------------------------------------------

SCRNROWB        .EQU    64
MaxX            .EQU    512
MaxY            .EQU    342
SCRNBYTES       .EQU    SCRNROWB*MaxY

;-----------------------------------------------------------------
;
; System Graphic Jump Vectors - Long pointers to
;                    system routine entry points.
;
GRAFBEGIN       .EQU    $800                    ;GRAF GLOBAL AREA
;
JHIDECURSOR     .EQU    GRAFBEGIN
JSHOWCURSOR     .EQU    JHIDECURSOR+4
JSHIELDCURSOR   .EQU    JSHOWCURSOR+4
JSCRNADDR       .EQU    JSHIELDCURSOR+4
JSCRNSIZE       .EQU    JSCRNADDR+4
JINITCRSR       .EQU    JSCRNSIZE+4
JSETCRSR        .EQU    JINITCRSR+4
JCRSROBSCURE    .EQU    JSETCRSR+4
JUPDATEPROC     .EQU    JCRSROBSCURE+4
LGRAFJUMP       .EQU    JUPDATEPROC+4          ;LAST VECTOR LOCATION
;
; System Graphic variables
;
GRAFVAR         .EQU    LGRAFJUMP       ;SYSTEM GRAPHIC VARIABLE AREA
SCRNBASE        .EQU    GRAFVAR         ;POINTER TO BASE OF SCREEN
MTEMP           .EQU    SCRNBASE+4      ;POINT, TEMPORARY MOUSE COORDS
RawMouse        .EQU    MTEMP+4         ; raw mouse coordinates (un-jerked)
MOUSE           .EQU    RawMouse+4      ;POINT, MOUSE COORDS USED BY CURSOR
CRSRPIN         .EQU    MOUSE+4         ;RECT, CURSOR PIN LIMITS
CRSRRECT        .EQU    CRSRPIN+8       ;RECT, CURSOR HIT RECTANGLE
THECRSR         .EQU    CRSRRECT+8      ;68 BYTES. CURSOR DATA, MASK, HOTSPOT
CRSRADDR        .EQU    THECRSR+68      ;LONG, ADDR OF DATA UNDER CURSOR
CRSRSAVE        .EQU    CRSRADDR+4      ;16 LONGS, DATA UNDER CURSOR
CRSRVIS         .EQU    CRSRSAVE+64     ;BYTE, CURSOR VISIBLE FLAG
CRSRBUSY        .EQU    CRSRVIS+1       ;BYTE, CURSOR LOCK-OUT FLAG
CRSRNEW         .EQU    CRSRBUSY+1      ;BYTE, CURSOR CHANGED FLAG
CRSRCOUPLE      .EQU    CRSRNEW+1       ;BYTE, CURSOR coupled flag
CRSRSTATE       .EQU    CRSRCOUPLE+1    ;WORD, FOR NESTED CURSOR CALLS
CRSROBSCURE     .EQU    CRSRSTATE+2     ;byte semaphore for obscure cursor
CRSRSCALE       .EQU    CRSROBSCURE+1   ;byte cursor scale flag

MouseMask       .EQU    CRSRSCALE+3     ; V-H mask for ANDing with mouse coordinates
MouseOffset     .EQU    MouseMask+4     ; V-H offset for adding after anding above

JournalFlag     .EQU    MouseOffset+4   ;flag for journaling
JSwapFont       .EQU    JournalFlag+2   ;jump entry for FMSwapFont
JFontInfo       .EQU    JSwapFont+4     ;jump entry for FMFontMetrics
JournalRef      .EQU    JFontInfo+4     ;hook for journalling

CrsrThresh      .EQU    JournalRef+4    ;threshold for mouse scaling
JCrsrTask       .EQU    CrsrThresh+2    ;address of CrsrVBLTask

; NOTE -- JCrsrTask and CrsrThresh must be right before GrafEnd!

GRAFEND         .EQU    JCrsrTask+4     ;end of graphics globals

te max name length

; next 6 fields should be kept together

VCBDrvNum   .EQU    72          ; drive number for this VCB
VCBDRefNum  .EQU    74          ; driver refnum for this VCB
VCBFSID     .EQU    76          ; ID of file system handling this volume
VCBVRefNum  .EQU    78          ; unique refnum for this VCB
VCBMAdr     .EQU    80          ; volume map address
VCBBufAdr   .EQU    84          ; volume buffer address
VCBMsumacc/ws/tlasm/packequ   444      0     12       12101  3472707177  10457 3. "6F^5D!$^x; File: PackEqu
;
;    This file contains all the equates needed for packages
;_______________________________________________________________________
;
;
; Modification History:
;  3 Mar 84  RS  Created on this date
;_______________________________________________________________________

; (c) 1983 Apple Computer, Inc.
;
;  Package Equates
;

dskInit   .EQU      2         ;Disk Initialization
stdFile   .EQU      3         ;Standard File
flPoint   .EQU      4         ;Floating-Point Arithmetic
trFunc    .EQU      5         ;Transcendental Functions
intUtil   .EQU      6         ;International Utilities
bdConv    .EQU      7         ;Binary/Decimal Conversion

;equates for STANDARD FILE PACKAGE
putDlgID  .EQU      -3999     ;SFPutFile dialog template ID

putSave   .EQU      1         ;save button
putCancel .EQU      2         ;cancel button
putEject  .EQU      5         ;eject button
putDrive  .EQU      6         ;drive button
putName   .EQU      7         ;editTExt item for file name

getDlgID  .EQU      -4000     ;SFGetFile dialog template ID

getOpen   .EQU      1         ;open button
getCancel .EQU      3         ;cancel button
getEject  .EQU      5         ;eject button
getDrive  .EQU      6         ;drive button
getNmList .EQU      7         ;userItem for file name list
getScroll .EQU      8         ;userItem for scroll bar

;reply record data structure
rGood     .EQU      0         ;ignore command if FALSE
rType     .EQU      2         ;file type
rVolume   .EQU      6         ;volume reference number
rVersion  .EQU      8         ;file's version number
rName     .EQU      10        ;file name

;routine selectors
SFPutFile      .EQU      1
SFPPutFile     .EQU      3
SFGetFile      .EQU      2
SFPGetFile     .EQU      4

;equates for DISK INITIALIZATION PACKAGE

;routine selectors
DILoad         .EQU      2
DIUnload       .EQU      4
DIBadMount     .EQU      0
DIFormat       .EQU      6
DIVerify       .EQU      8
DIZero         .EQU      10

;result codes are defined in sysequ

;equates for INTERNATIONAL PACKAGE

;routine selectors
IUGetIntl      .EQU      6
IUSetIntl      .EQU      8
IUDateString   .EQU      0
IUDatePString  .EQU      14
IUTimeString   .EQU      2
IUTimePString  .EQU      16
IUMetric       .EQU      4
IUMagString    .EQU      10
IUMagIDString  .EQU      12


;data structures for International Utilities
;international 0 record

decimalPt .EQU 0              ;ASCII character for decimal point
thousSep  .EQU 1              ;ASCII character for thousand separator
listSep   .EQU 2              ;ASCII character for list separator
currSym   .EQU 3              ;ASCII for currency symbol (3 bytes long)
currFmt   .EQU 6              ;currency format flags
dateOrder .EQU 7              ;short date form - DMY,YMD, or MDY
shrtDateFmt .EQU 8            ;date elements format flag
dateSep   .EQU 9              ;ASCII for date separator
timecycle .EQU 10             ;indicates 12 or 24 hr cycle
timeFmt   .EQU 11             ;time elements format flags
mornStr   .EQU 12             ;ASCII for trailing string from 0:00 to 11:59
eveStr    .EQU 16             ;ASCII for trailing string from 12:00 to 23:59
timeSep   .EQU 20             ;ASCII for the time separator
timeSuff  .EQU 21             ;suffix string used in 24 hr mode
metricSys .EQU 29             ;indicates metric or English system
intl0Vers .EQU 30             ;version: high byte = country. low byte = vers


;International 1 record
days           .EQU 0
months         .EQU 112
suppressDay    .EQU 304
lngDateFmt     .EQU 305
dayLeading0    .EQU 306
abbrLen        .EQU 307
st0            .EQU 308
st1            .EQU 312
st2            .EQU 316
st3            .EQU 320
st4            .EQU 324
intl1Vers      .EQU 328
localRtn       .EQU 330


;constants for manipulation of international resources}
;way to specify desired date format
shortDate      .EQU 0
longDate       .EQU 1
abbrevDate     .EQU 2

;masks used for setting and testing currency format flags
currLeadingZ   .EQU 128       ;set if leading zero
currTrailingZ  .EQU 64        ;set if trailing zero
currNegSym     .EQU 32        ;set if minus sign for negative num, reset if parentheses}
currSymLead    .EQU 16        ;set if currency symbol leads, reset if trails}

;constants specifying absolute value of short date form
MDY       .EQU 0              ;month,day,year
DMY       .EQU 1              ;day,month,year
YMD       .EQU 2              ;year,month,day

;masks used for date element format flags
century      .EQU 128       ;set if century, reset if no century
mntLdingZ    .EQU 64        ;set if leading 0 for month
dayLdingZ    .EQU 32        ;set if leading zero for day

;masks used for time element format flags
hrLeadingZ     .EQU 128     ;set if leading zero for hours
minLeadingZ    .EQU 64      ;set if leading zero for minutes
secLeadingZ    .EQU 32      ;set if leading zero for seconds

;country codes for version numbers
verUS          .EQU 0
verFrance      .EQU 1
verBritain     .EQU 2
verGermany     .EQU 3
verItaly       .EQU 4



;equates for BINARY-DECIMAL CONVERSION PACKAGE

;routine selectors
NumToString    .EQU      0
StringToNum    .EQU      1




      1         ;open button
getCancel .EQU      3         ;cancel button
getEject  .EQU      5         ;eject button
getDrive  .EQU      6         ;drive button
getNmList .EQU      7         ;userItem for file name list
getScroll .EQU      8         ;userItem for scroll bar

;reply record data structure
rGood     .EQU      0         ;ignore command if FALSE
rType     .EQU      2         ;file type
rVolume   .EQU      6         ;volume referensumacc/ws/tlasm/graftypes   444      0     12       30611  3472707177  11040 W^5PH r^zA
;-----------------------------------------------------------------
;
;  -->  GRAFTYPES.TEXT
;
;  QUICKDRAW TYPE DECLARATIONS, USED BY ALL GRAPHICS ROUTINES
;
SYMBOLS         .EQU    0
FORMAC          .EQU    1

NIL             .EQU    0                       ;IMPLEMENTATION VALUE OF NIL


;-----------------------------------------------
;
;  QuickDraw VERBS:
;
FRAME           .EQU    0
PAINT           .EQU    1
ERASE           .EQU    2
INVERT          .EQU    3
FILL            .EQU    4


;-----------------------------------------------
;
;  QuickDraw transfer MODES:
;
srcCopy         .EQU    0
srcOr           .EQU    1
srcXor          .EQU    2
srcBic          .EQU    3
notSrcCopy      .EQU    4
notSrcOr        .EQU    5
notSrcXor       .EQU    6
notSrcBic       .EQU    7
patCopy         .EQU    8
patOr           .EQU    9
patXor          .EQU    10
patBic          .EQU    11
notPatCopy      .EQU    12
notPatOr        .EQU    13
notPatXor       .EQU    14
notPatBic       .EQU    15


;-----------------------------------------------
;
;  QuickDraw Color Separation:
;
normalBit       .EQU    0                       ;normal screen mapping
inverseBit      .EQU    1                       ;inverse screen mapping
redBit          .EQU    4                       ;RGB additive mapping
greenBit        .EQU    3                       ;for photos from screen
blueBit         .EQU    2
cyanBit         .EQU    8                       ;CMYBk subtractive mapping
magentaBit      .EQU    7                       ;for ink jet printer
yellowBit       .EQU    6
blackBit        .EQU    5

blackColor      .EQU    33
whiteColor      .EQU    30
redColor        .EQU    205
greenColor      .EQU    341
blueColor       .EQU    409
cyanColor       .EQU    273
magentaColor    .EQU    137
yellowColor     .EQU    69



;-----------------------------------------------
;
;  OFFSETS WITHIN A POINT:
;
V               .EQU    0                       ;WORD
H               .EQU    2                       ;WORD


;-----------------------------------------------
;
;  OFFSETS WITHIN A RECT:
;
TOPLEFT         .EQU   0                        ;POINT
BOTRIGHT        .EQU   4                        ;POINT

TOP             .EQU   0                        ;INTEGER
LEFT            .EQU   2                        ;INTEGER
BOTTOM          .EQU   4                        ;INTEGER
RIGHT           .EQU   6                        ;INTEGER


;-----------------------------------------------
;
;  OFFSETS WITHIN A BITMAP:
;
BASEADDR        .EQU    0                       ;LONG
ROWBYTES        .EQU    4                       ;WORD
BOUNDS          .EQU    6                       ;RECT


;-----------------------------------------------
;
;  OFFSETS WITHIN A CURSOR:
;
DATA            .EQU    0                       ;16 WORDS
MASK            .EQU    32                      ;16 WORDS
HOTSPOT         .EQU    64                      ;POINT



;-----------------------------------------------
;
;  OFFSETS WITHIN A POLYGON:
;
POLYSIZE        .EQU    0                       ;WORD, TOTAL BYTES
POLYBBOX        .EQU    2                       ;RECT
POLYPOINTS      .EQU    10                      ;ARRAY[0..0] OF Point


;-----------------------------------------------
;
;  OFFSETS WITHIN A REGION:
;
RGNSIZE         .EQU    0                       ;WORD, TOTAL BYTES
RGNBBOX         .EQU    2                       ;RECT
RGNDATA         .EQU    10                      ;START OF RGN DATA


;-----------------------------------------------
;
;  OFFSETS WITHIN A PICTURE:
;
PICSIZE         .EQU    0                       ;WORD, TOTAL BYTES
PICFRAME        .EQU    2                       ;RECT
PICDATA         .EQU    10                      ;START OF BYTE CODES


;-----------------------------------------------
;
;  OFFSETS WITHIN QDProcs RECORD:
;
textProc        .EQU    0                       ;PROCPTR
lineProc        .EQU    textProc+4              ;PROCPTR
rectProc        .EQU    lineProc+4              ;PROCPTR
rRectProc       .EQU    rectProc+4              ;PROCPTR
ovalProc        .EQU    rRectProc+4             ;PROCPTR
arcProc         .EQU    ovalProc+4              ;PROCPTR
polyProc        .EQU    arcProc+4               ;PROCPTR
rgnProc         .EQU    polyProc+4              ;PROCPTR
bitsProc        .EQU    rgnProc+4               ;PROCPTR
commentProc     .EQU    bitsProc+4              ;PROCPTR
txMeasProc      .EQU    commentProc+4           ;PROCPTR
getPicProc      .EQU    txMeasProc+4            ;PROCPTR
putPicProc      .EQU    getPicProc+4            ;PROCPTR



;-----------------------------------------------
;
;  OFFSETS WITHIN A GRAFPORT:
;
device          .EQU    0                       ;WORD
portBits        .EQU    device+2                ;BITMAP
portRect        .EQU    portBits+14             ;RECT
visRgn          .EQU    portRect+8              ;RGNPTR
clipRgn         .EQU    visRgn+4                ;RGNPTR
bkPat           .EQU    clipRgn+4               ;PATTERN
fillPat         .EQU    bkPat+8                 ;PATTERN
pnLoc           .EQU    fillPat+8               ;POINT
pnSize          .EQU    pnLoc+4                 ;POINT
pnMode          .EQU    pnSize+4                ;WORD
pnPat           .EQU    pnMode+2                ;PATTERN
pnVis           .EQU    pnPat+8                 ;WORD
txFont          .EQU    pnVis+2                 ;WORD
txFace          .EQU    txFont+2                ;WORD
txMode          .EQU    txFace+2                ;WORD
txSize          .EQU    txMode+2                ;WORD
spExtra         .EQU    txSize+2                ;Fixed Point
fgColor         .EQU    spExtra+4               ;LONG
bkColor         .EQU    fgColor+4               ;LONG
colrBit         .EQU    bkColor+4               ;WORD
patStretch      .EQU    colrBit+2               ;WORD
picSave         .EQU    patStretch+2            ;handle
rgnSave         .EQU    picSave+4               ;handle
polySave        .EQU    rgnSave+4               ;handle
grafProcs       .EQU    polySave+4              ;Pointer
PORTREC         .EQU    grafProcs+4             ;SIZE OF A GRAFPORT
PORTBOUNDS      .EQU    PORTBITS+BOUNDS


;-----------------------------------------------------
;
;  OFFSETS IN A REGION STATE RECORD:
;
RGNPTR          .EQU    0                       ;LONG
DATAPTR         .EQU    RGNPTR+4                ;LONG
SCANBUF         .EQU    DATAPTR+4               ;LONG
SCANSIZE        .EQU    SCANBUF+4               ;WORD
THISV           .EQU    SCANSIZE+2              ;WORD
NEXTV           .EQU    THISV+2                 ;WORD
MINH            .EQU    NEXTV+2                 ;WORD
MAXH            .EQU    MINH+2                  ;WORD
LEFTH           .EQU    MAXH+2                  ;WORD
RGNREC          .EQU    LEFTH+2                 ;SIZE OF A REGION RECORD


;-----------------------------------------------------
;
;  Offsets in a PicSave record:
;
thePic          .EQU    0                       ;PICHANDLE
picMax          .EQU    thePic+4                ;INTEGER
picClipRgn      .EQU    picMax+2                ;RgnHandle
picBkPat        .EQU    picClipRgn+4            ;Pattern
picTxFont       .EQU    picBkPat+8              ;WORD
picTxFace       .EQU    picTxFont+2             ;Style
picTxMode       .EQU    picTxFace+2             ;WORD
picTxSize       .EQU    picTxMode+2             ;WORD
picSpExtra      .EQU    picTxSize+2             ;Fixed Point
picTxNumer      .EQU    picSpExtra+4            ;Point
picTxDenom      .EQU    picTxNumer+4            ;Point
picTxLoc        .EQU    picTxDenom+4            ;Point
picPnLoc        .EQU    picTxLoc+4              ;Point
picPnSize       .EQU    picPnLoc+4              ;Point
picPnMode       .EQU    picPnSize+4             ;WORD
picPnPat        .EQU    picPnMode+2             ;Pattern
picFillPat      .EQU    picPnPat+8              ;Pattern
picTheRect      .EQU    picFillPat+8            ;Rect
picOvSize       .EQU    picTheRect+8            ;Point
picOrigin       .EQU    picOvSize+4             ;Point
picFgColor      .EQU    picOrigin+4             ;Long
picBkColor      .EQU    picFgColor+4            ;Long

picSaveRec      .EQU    picBkColor+4            ;total size in bytes


;-----------------------------------------------------
;
;  QuickDraw GLOBAL VARIABLES:
;
;  52(A5) CONTAINS A POINTER TO THEPORT.
;  ALL OTHER GLOBAL VARIABLES ARE EXPRESSED RELATIVE TO THEPORT.
;
        .IF FORMAC
GRAFGLOBALS     .EQU    0                       ;A5 OFFSET TO GLOBALPTR
        .ELSE
GRAFGLOBALS     .EQU    52                      ;A5 OFFSET TO GLOBALPTR
        .ENDC


;-----------------------------------------------------------
;
;  QuickDraw PUBLIC GLOBAL VARIABLES:
;
thePort         .EQU    0                       ;GrafPtr
white           .EQU    thePort-8               ;Pattern
black           .EQU    white-8                 ;Pattern
gray            .EQU    black-8                 ;Pattern
ltGray          .EQU    gray-8                  ;Pattern
dkGray          .EQU    ltGray-8                ;Pattern
arrow           .EQU    dkGray-68               ;Cursor
screenBits      .EQU    arrow-14                ;BitMap
randSeed        .EQU    screenBits-4            ;LONGINT


;------------------------------------------------------------
;
;  QuickDraw private global variables:
;
wideOpen        .EQU    randSeed-4              ;RgnHandle
wideMaster      .EQU    wideOpen-4              ;RgnPtr
wideData        .EQU    wideMaster-10           ;Fake Region
rgnBuf          .EQU    wideData-4              ;PointsHandle
rgnIndex        .EQU    rgnBuf-2                ;INTEGER
rgnMax          .EQU    rgnIndex-2              ;INTEGER
playPic         .EQU    rgnMax-4                ;Long
playIndex       .EQU    playPic-2               ;INTEGER;
thePoly         .EQU    playIndex-4             ;POLYHANDLE
polyMax         .EQU    thePoly-2               ;INTEGER
patAlign        .EQU    polyMax-4               ;Point
fontAdj         .EQU    patAlign-4              ;Fixed Point
fontPtr         .EQU    fontAdj-4               ;long, ^FMOutput record
fontData        .EQU    fontPtr-26              ;FMOutput record
lastGrafGlob    .EQU    fontData
grafSize        .EQU    4-lastGrafGlob          ;total size in bytes



        .MACRO  UNLINK
;--------------------------------------------------------------
;
;  UNLINK A6, STRIP PARAMETERS, AND RETURN.
;  IF SYMBOLS=TRUE, THEN ALSO PUT ASCII FOR PROCEDURE IDENTIFIER.
;
;  FIRST PARAM IS NUMBER OF BYTES OF STACK BIAS.
;  SECOND PARAM IS PROCEDURE IDENTIFIER.
;
        UNLK    A6                              ;RELEASE LOCAL VARIABLES

        .IF     %1=0                            ;NO PARAMETERS ?
        RTS                                     ;THEN JUST RTS

        .ELSE
        .IF     %1=4                            ;4 BYTES OF PARAMS ?
        MOVE.L  (SP)+,(SP)                      ;YES, STRIP AND ADJUST RET ADDR
        RTS

        .ELSE                                   ;NOT 0 OR 4 BYTES OF PARAMS
        MOVE.L  (SP)+,A0                        ;POP RETURN ADDR INTO A0
        ADD     #%1,SP                          ;STRIP PARAMETERS
        JMP     (A0)                            ;JUMP THRU A0 TO RETURN
        .ENDC
        .ENDC

        .IF SYMBOLS                             ;DO WE WANT SYMBOLS ?
        .ASCII  %2                              ;YES, PUT PROCEDURE IDENTIFIER
        .ENDC

        .ENDM



        .MACRO  FAKEHEAD
;--------------------------------------------------------------
;
;   FAKEHEAD, (no params)
;
;   Puts in a LINKA6 NOP to fake out the debugger's symbol mechanism.
;
        .IF SYMBOLS
        LINK    A6,#0                           ;DO THE LINK
        MOVE.L  (SP)+,A6                        ;UNDO THE LINK
        .ENDC
        .ENDM



        .MACRO  FAKETAIL
;--------------------------------------------------------------
;
;   FAKETAIL, 'ProcName'
;
;  Fake out the debugger's symbol mechanism.
;  Put FAKETAIL,'ProcName' after executable code.
;
        .IF SYMBOLS
        UNLK    A6                              ;RELEASE LOCAL VARIABLES
        RTS                                     ;THEN JUST RTS
        .ASCII  %1                              ;YES, PUT PROCEDURE IDENTIFIER
        .ENDC
        .ENDM


        .MACRO  CHECKSTACK
;--------------------------------------------------------------
;
;   CHECKSTACK byteCount
;
;  Does a TST.W to expand the stack if not enough room.
;  Does nothing on the Mac version.
;  NOTE: %1 param should be an even negative number.
;
SLOP    .EQU    256
        .IF FORMAC=0
        TST.W   %1-SLOP(SP)                        ;EXPAND STACK
        .ENDC
        .ENDM




        .ENDC


;-----------------------------------------------------------
;
;  QuickDraw PUBLIC GLOBAL VARIABLES:
;
sumacc/ws/tlasm/heapdefs   444      0     12       15635  3472707177  10624 5HH r^EKRKR;----------------------------------------------------------------------
; HeapDefs  - Definitions for Macintosh Assembly Language Memory Manager.
;
; Supports multiple heap zones with mixed relocatable and non-relocatable
; storage blocks.
;
; Reorganized from code designed and written by Bud Tribble, 27-Nov-81,
;   and maintained and modified by Angeline Lo, Larry Kenyon,
;   and Andy Hertzfeld.
;
; Modification History:
; 17 Feb 83  LAK  added dfltStackSize for defltApplLimit.
; 20 Mar 83  MPH  changed memory size constants to support 512 K byte
;                 machine; added PtrMask and HandleMask to allow garbage
;                 in high byte of ptrs or handles passed to memory manager;
;                 removed "checking" conditional from ChkZone macro.
; 29 Mar 83  MPH  added purgeProc and moverelProc entries to zone object.
; 10 Jun 83  MPH  Removed Definition of Nil, use Nil from GrafTypes.
; 17 Jun 83  MPH  Removed moveRelProc from Heap object, inserted spare.
; 21 Jun 83  MPH  Put FreeList code under assembly switch: FList.
; 18 Jul 83  LAK  Removed FreeList stuff completely; removed TLock, TPurge;
;                  removed Trap macro and check hook offsets.
; 30 Jul 83  LAK  Added equates for PurgePtr and AllocPtr.  Also added equates
;                  for Flags byte: FNSelCompct,FNoRvrAlloc,FNSelPurge,FRelAtEnd.
; 12 Aug 83  LAK  Added ClearBit equate.
;----------------------------------------------------------------------


; These constants control conditional assembly.
Checking        .Equ    0               ;check arguments and data structures
Statistics      .Equ    0               ;gather statistics on usage
Robust          .Equ    0               ;enables super-robust internal checks
CountMPs        .Equ    0               ;enables counting of master pointers

DfltFlags       .Equ    0               ;Checking is on when zone is init'd


;
; Constants:
;
MinFree         .EQU    12              ;12 byte minimum block size
TagMask         .EQU    $C0000000       ;Mask for the 2-bit Tag Field
BCOffMask       .EQU    $0F000000       ;Mask for the 4 bit Byte Count offset
BCMask          .EQU    $00FFFFFF       ;Mask for the 24 bit Byte Count
PtrMask         .EQU    $00FFFFFF       ;Mask pointer to low 24 bits
HandleMask      .EQU    $00FFFFFF       ;Mask handle to low 24 bits
FreeTag         .EQU    $0              ;Tag for Free block
NRelTag         .EQU    $40000000       ;Tag for Non-Relocatable block
RelTag          .EQU    $80000000       ;Tag for Relocatable block
MaxSize         .EQU    $800000         ;Max data block size is 512K bytes
MinAddr         .EQU    $0              ;Min legal address
MaxAddr         .EQU    $800000         ;Max legal address for 512K machine
MaxMasters      .EQU    $1000           ;Ridiculously large allocation chunk size
dfltMasters     .EQU    32              ;Default to 32 master pointers
dfltStackSize   .EQU    $00002000       ;8K size for stack
mnStackSize     .EQU    $00000400       ;1K minimum size for stack
;
;       Block Types
;
tybkMask        .EQU    3       ;Mask for block type
tybkFree        .EQU    0       ;Free Block
tybkNRel        .EQU    1       ;Non-Relocatable
tybkRel         .EQU    2       ;Relocatable
;
; Heap Zone Offsets:
;
BkLim           .EQU    0       ;Long, last block in zone
PurgePtr        .EQU    4       ;Long, roving purge pointer.
HFstFree        .EQU    8       ;Long, first free handle
ZCBFree         .EQU    12      ;Long, # of free bytes in zone
GZProc          .EQU    16      ;Long, pointer to grow zone procedure
MAllocCnt       .EQU    20      ;Word, # of master to allocate
Flags           .EQU    22      ;Word, Flags
FOnCheck        .EQU    0       ;Turn On Checking
FChecking       .EQU    1       ;Checking on
FGZAlways       .EQU    2       ;Set to 1 to force user GZ calls in noncrit cases
FNGZResrv       .EQU    3       ;Set to 1 to prevent GZ reservMem calls
FNSelCompct     .EQU    4       ;Use non-selective compact algorithm when 1.
FNoRvrAlloc     .EQU    5       ;Don't use rover allocation scheme when 1.
FNSelPurge      .EQU    6       ;Use non-selective purge algorithm when 1.
FRelAtEnd       .EQU    7       ;MakeBk packs rels at end of free bk when 1.

cntRel          .EQU    24      ;Word, # of allocated relocatable blocks
maxRel          .EQU    26      ;Word, max # of allocated rel. blocks.
cntNRel         .EQU    28      ;Word, # of allocated non-rel. blocks.
maxNRel         .EQU    30      ;Word, max # of allocated non-rel. blocks.
cntEmpty        .EQU    32      ;Word, # of empty handles
cntHandles      .EQU    34      ;Word, # of total handles
minCBFree       .EQU    36      ;Long, min # of bytes free.
purgeProc       .EQU    40      ;Long, pointer to purge warning procedure
spare1          .EQU    44      ;Long, unused spare.
AllocPtr        .EQU    48      ;Long, roving allocation pointer.
HeapData        .EQU    52      ;Start of heap zone data


MinZone         .Equ    HeapData+<4*MinFree>+<8*dfltMasters>
;                               ;Minimum size for Applic. Zone


;
; Block Offsets
;
TagBC           .EQU    0       ;Long, Tag and Byte Count field
Handle          .EQU    4       ;Long, handle to current data block
BlkData         .EQU    8       ;All Block Data Starts Here


;
; Heap Zone Default Sizes
;

SysZoneSize     .EQU    $4000   ;16 K byte static sysZone size
AppZoneSize     .EQU    $1800   ;6 K byte static appZone size


;
; Structure of InitZone argument table.
;

StartPtr        .EQU    0       ;Start address for zone.
LimitPtr        .EQU    4       ;Limit address for zone.
CMoreMasters    .EQU    8       ;Number of masters to allocate at time.
PGrowZone       .EQU    10      ;Points to the growZone procedure.

;
; Bit offset for system trap special functions
;
TSysOrCurZone   .EQU    10      ; Bit set implies System Zone
                                ;   bit clear implies Current Zone
ClearBit        .EQU    9       ; Bit set means clear allocated memory.

;----------------------------------------------------------------------
; Macros
;

                .MACRO  GetZ            ;Get theZone into a register
                  MOVE.L  theZone,%1
                .ENDM

                .MACRO  SetZ            ;Set theZone with a register's value
                  MOVE.L  %1,theZone
                .ENDM

                .macro  Equal
                  .if   Checking
                  Move.L        %1,-(SP)
                  Move.L        %2,-(SP)
                  JSR           EqualCheck
                  .endc
                .endm

                .macro  Even
                  .if     Checking
                  MOVE.L        %1,-(SP)
                  JSR           EvenCheck
                  .endc
                .endm

                .macro  Range
                  .if     Checking
                  MOVE.L        %1,-(SP)
                  MOVE.L        %2,-(SP)
                  MOVE.L        %3,-(SP)
                  JSR           RangeCheck
                  .endc
                .endm

Size     .EQU    $00000400       ;1K minimum size for stack
;
;       Block Types
;
tybkMask       sumacc/ws/tlasm/mocpaslib   444      0     12        1141  3472707177  10761 3. "6F^5D!$^; This mockup of the Pascal library MACPASLIB allows an assembly program to
; run standalone without the overhead of the normal Pascal library.  This may
; either be included in the program source or linked with the assembled program.
          .PROC     MOCPASLIB
          .DEF      %_BEGIN
          .DEF      %_END
          .DEF      %_Term
          .DEF      %_INIT

%_BEGIN:
          CLR.L   $10(SP)
%_END:
          RTS

%_Term
          MOVE.L  (SP)+,A0
          LINK    A5,#0
          JMP     (A0)

%_INIT:
          MOVE.L  (SP)+,A0
          UNLK    A5
          JMP     (A0)
.END
.MACRO  SetZ            ;Set theZone with a register's value
                  MOVE.L  %1,theZone
                .ENDM

                .macro  Equal
                  .if   Checking
                  Move.L        %1,-(SP)
                  Move.L        %2,-(SP)
                  JSR           EqualCheck
                  .endc
                .endm

                .macro  Even
                  .if     Checsumacc/ws/tlasm/packmacs   444      0     12        5420  3472707177  10576 3. "6F^5D!$^p~!~!
; File: PackMacs.Text
;_______________________________________________________________________
;
; PackMacs.Text - macros for the packages
;
; created by RS   5-30-84
;
;
;macro for package invocation
;
;   first arg is routine selector, second is the trap

        .MACRO  _PackCall
        MOVE.W    %1,-(SP)
        %2
        .ENDM


;_______________________________________________________________________
;
; Disk Initialization
;
;_______________________________________________________________________


          .MACRO _DILoad
          _PackCall #DILoad,_Pack2
          .ENDM

          .MACRO _DIUnLoad
          _PackCall #DIUnLoad,_Pack2
          .ENDM

          .MACRO _DIBadMount
          _PackCall #DIBadMount,_Pack2
          .ENDM

          .MACRO _DIFormat
          _PackCall #DIFormat,_Pack2
          .ENDM

          .MACRO _DIVerify
          _PackCall #DIVerify,_Pack2
          .ENDM

          .MACRO _DIZero
          _PackCall #DIZero,_Pack2
          .ENDM

;_______________________________________________________________________
;
; Standard File
;
;_______________________________________________________________________

          .MACRO _SFPutFile
          _PackCall #SFPutFile,_Pack3
          .ENDM

          .MACRO _SFPPutFile
          _PackCall #SFPPutFile,_Pack3
          .ENDM

          .MACRO _SFGetFile
          _PackCall #SFGetFile,_Pack3
          .ENDM

          .MACRO _SFPGetFile
          _PackCall #SFPGetFile,_Pack3
          .ENDM


;_______________________________________________________________________
;
; Interational Utilities
;
;_______________________________________________________________________

          .MACRO _IUGetIntl
          _PackCall #IUGetIntl,_Pack6
          .ENDM

          .MACRO _IUSetIntl
          _PackCall #IUSetIntl,_Pack6
          .ENDM

          .MACRO _IUDateString
          _PackCall #IUDateString,_Pack6
          .ENDM

          .MACRO _IUDatePString
          _PackCall #IUDatePString,_Pack6
          .ENDM

          .MACRO _IUTimeString
          _PackCall #IUTimeString,_Pack6
          .ENDM

          .MACRO _IUTimePString
          _PackCall #IUTimePString,_Pack6
          .ENDM

          .MACRO _IUMetric
          _PackCall #IUMetric,_Pack6
          .ENDM

          .MACRO _IUMagString
          _PackCall #IUMagString,_Pack6
          .ENDM

          .MACRO _IUMagIDString
          _PackCall #IUMagIDString,_Pack6
          .ENDM


;_______________________________________________________________________
;
; Binary-Decimal Conversion
;_______________________________________________________________________


          .MACRO _StringToNum
          _PackCall #StringToNum,_Pack7
          .ENDM

          .MACRO _NumToString
          _PackCall #NumToString,_Pack7
          .ENDM



crit cases
FNGZResrv       .EQU    3       ;Set to 1 to prevent GZ reservMem calls
FNSelCompct     .EQU    4       ;Use non-selective compact algorithm when 1.
FNoRvrAlloc     .EQU    5       ;Don't use rover allocation scheme when 1.
FNSelsumacc/ws/tlasm/prequ   444      0     12       31514  3472707200  10156 W^65D!l D!l^AAG;-------------------------------------------------------------------------------
;       These are the definitions for the Print code
;-------------------------------------------------------------------------------
fPrDbgOK        .EQU    1               ;Debug enable
iPrDeapShit     .EQU    29              ;Printcode DeapShit
iPrAbort        .EQU    128             ;Abort
iPrRelease      .EQU    2               ;Current version number of the code.

;-------------------------------------------------------------------------------
;       These are misc Alert & Dialog constants
;-------------------------------------------------------------------------------
iOK             .EQU    1               ; OK Button
iCancel         .EQU    2               ; Cancel Button
iPrStlDlg       .EQU    $E000           ; {-8192} Style Dialog
iPrJobDlg       .EQU    $E001           ; {-8191} Job Dialog
iPrCfgDlg       .EQU    $E002           ; {-8190} Configuration Dialog
iPgFeedAx       .EQU    $E00A           ; {-8182} Page Feed Dialog
iPicSizAx       .EQU    $E00B           ; {-8181} Pic Size Alert
iIOAbrtAx       .EQU    $E00C           ; {-8180} IO Timeout Alert
;-------------------------------------------------------------------------------
; The Private Print Globals; 16 bytes located at [SysEqu] PrintVars
;-------------------------------------------------------------------------------
iPrErr          .EQU    0               ;Current print error.  Set to iPrAbort to abort printing.
bDocLoop        .EQU    iPrErr+2        ;The Doc style: Draft, Spool, .., and ..
                                        ;Currently use low 2 bits; the upper 6 are for flags.
bUser1          .EQU    bDocLoop+1
lUser1          .EQU    bUser1+1
lUser2          .EQU    lUser1+4
lUser3          .EQU    lUser2+4
iPrVarSize      .EQU    lUser3+4        ;The PrVar's size.[16]

bDraftLoop      .EQU    0               ;The DocLoop types
bSpoolLoop      .EQU    1
bUser1Loop      .EQU    2
bUser2Loop      .EQU    3
;-------------------------------------------------------------------------------
; These are the PrDrvr constants.
;-------------------------------------------------------------------------------
iPrDrvrID       .EQU            2               ;Driver's ResID
iPrDrvrRef      .EQU            $FFFD           ;Driver's RefNum = NOT ResID
iPrDrvrDev      .EQU            $FD00           ;Driver's QD Dev num = RefNum in Hi Byte, variant in lo
iPrBitsCtl      .EQU            4               ;The Bitmap Print Proc's ctl number
lScreenBits     .EQU            $00000000       ;The Bitmap Print Proc's Screen Bitmap param
lPaintBits      .EQU            $00000001       ;The Bitmap Print Proc's Paint [sq pix] param
iPrIOCtl        .EQU            5               ;The Raw Byte IO Proc's ctl number
iPrEvtCtl       .EQU            6               ;The PrEvent Proc's ctl number
lPrEvtAll       .EQU            $00FFFFFD       ;The PrEvent Proc's CParam for the entire screen
lPrEvtTop       .EQU            $00FEFFFD       ;The PrEvent Proc's CParam for the top folder
iPrDevCtl       .EQU            7               ;The PrDevCtl Proc's ctl number
iPrReset        .EQU            1               ;The PrDevCtl Proc's CParam for reset
iPrPageEnd      .EQU            2               ;The PrDevCtl Proc's CParam for end page
iPrLineFeed     .EQU            3               ;The PrDevCtl Proc's CParam for paper advance
lPrLFSixth      .EQU           -1               ;The PrDevCtl Proc's CParam for 1/6 th inch paper advance
lPrLFEighth     .EQU           -2               ;The PrDevCtl Proc's CParam for 1/8 th inch paper advance
iFMgrCtl        .EQU            8               ;The FMgr's Tail-hook ctl call
iFMgrStat       .EQU            8               ;The FMgr's Pre-hook status call

;-------------------------------------------------------------------------------
; Various Resource Types & ID's
;-------------------------------------------------------------------------------
lPStrType       .EQU   $53545220        ;"STR ": Res type for the Pr Rsrc file name
iPStrRFil       .EQU   $E000            ;Str -8192 is in SysRes & names the current printer

lPrintType      .EQU   $50524543        ;"PREC": Res type for the hPrint records
iPrintDef       .EQU   0                ;Default hPrint
iPrintLst       .EQU   1                ;Last used hPrint
iPrintDrvr      .EQU   2                ;.Print's parameter record; not a Print rec

lPfType         .EQU   $5046494C        ;"PFIL"
lPfSig          .EQU   $50535953        ;"PSYS"
iPfIcon         .EQU   140              ;

lPrType         .EQU   $4150504C        ;"APPL"
lPrSig          .EQU   $50535953        ;"PSYS"
iPrIcon         .EQU   138              ;

;-------------------------------------------------------------------------------
; The Printing data structures
;-------------------------------------------------------------------------------
;Print Info Record: The parameters needed for page composition.
;-------------------------------------------------------------------------------
iDev            .EQU    0         ;Font mgr/QuickDraw device code
iVRes           .EQU    iDev+2    ;Resolution of device, in device coordinates.
iHRes           .EQU    iVRes+2   ;   ..note: V before H => compatable with Point.
rPage           .EQU    iHRes+2   ;The page (printable) rectangle in device coordinates.
iPrInfoSize     .EQU    rPage+8   ;The PrInfo size.[14]

;-------------------------------------------------------------------------------
;Printer Style: The printer configuration and usage information.
;-------------------------------------------------------------------------------
wDev            .EQU    0         ;The drvr number.  Hi byte=RefNum, Lo byte=variant.
iPageV          .EQU    wDev+2    ;paper size in units of 1/iPrPgFract
iPageH          .EQU    iPageV+2  ;   ..note: V before H => compatable with Point.
bPort           .EQU    iPageH+2  ;The IO port number.
feed            .EQU    bPort+1   ;paper feeder type.
iPrStlSize      .EQU    feed+1    ;The PrStl size.[8]

;-------------------------------------------------------------------------------
;Print eXtra Info: The print time eXtra information.
;-------------------------------------------------------------------------------
iRowBytes       .EQU    0               ;The Band's rowBytes.
iBandV          .EQU    iRowBytes+2     ;Size of band, in device coordinates
iBandH          .EQU    iBandV+2        ;   ..note: V before H => compatable with Point.
iDevBytes       .EQU    iBandH+2        ;Size for allocation.  May be more than rBounds size!
iBands          .EQU    iDevBytes+2     ;Number of bands per page.
bPatScale       .EQU    iBands+2        ;Pattern scaling
bULThick        .EQU    bPatScale+1     ;3 Underscoring parameters
bULOffset       .EQU    bULThick+1
bULShadow       .EQU    bULOffset+1
scan            .EQU    bULShadow+1     ;Band scan direction
bXInfoX         .EQU    scan+1          ;An eXtra byte.
iPrXInfoSize    .EQU    bXInfoX+1       ;The PrXInfo size.[16]

;-------------------------------------------------------------------------------
;Print Job: Print "form" for a single print request.
;-------------------------------------------------------------------------------
iFstPage        .EQU    0               ;Page Range.
iLstPage        .EQU    iFstPage+2
iCopies         .EQU    iLstPage+2      ;No. copies.
bJDocLoop       .EQU    iCopies+2       ;Draft quality print flag
fFromApp        .EQU    bJDocLoop+1     ;Printing from an App (not PrApp) flag
pIdleProc       .EQU    fFromApp+1      ;The Proc called while waiting on IO etc.
pFileName       .EQU    pIdleProc+4     ;Spool File Name: NIL for default.
iFileVol        .EQU    pFileName+4     ;Spool File vol, set to 0 initially.
bFileVers       .EQU    iFileVol+2      ;Spool File version, set to 0 initially.
bJobX           .EQU    bFileVers+1     ;An eXtra byte.
iPrJobSize      .EQU    bJobX+1         ;The PrJob size.[20]

;-------------------------------------------------------------------------------
;The universal 120 byte printing record
;-------------------------------------------------------------------------------
iPrVersion      .EQU    0                       ;Printing software version
PrInfo          .EQU    iPrVersion+2            ;the PrInfo data associated with the current style.
rPaper          .EQU    PrInfo  + iPrInfoSize   ;The paper rectangle [offset from rPage].
PrStl           .EQU    rPaper  + 8             ;This print request's style.
PrInfoPT        .EQU    PrStl   + iPrStlSize    ;Print Time Imaging metrics
PrXInfo         .EQU    PrInfoPT+ iPrInfoSize   ;Print-time (expanded) Print info record.
PrJob           .EQU    PrXInfo + iPrXInfoSize  ;The Print Job request
iPrintSize      .EQU    120                     ;The Print record size.[120]

;-------------------------------------------------------------------------------
;Print Port: A graf port, its procs, plus some extra.
;-------------------------------------------------------------------------------
GPort           .EQU    0               ;The Printer's graf port.
GProcs          .EQU    108             ;..and its procs
lGParam1        .EQU    GProcs+13*4     ;Some params: Our relocatable stuff etc.
lGParam2        .EQU    lGParam1+4
lGParam3        .EQU    lGParam2+4
lGParam4        .EQU    lGParam3+4

fOurPtr         .EQU    lGParam4+4      ;Whether the PrPort allocation was done by us.
fOurBits        .EQU    fOurPtr+1       ;Whether the BitMap allocation was done by us.
iPrPortSize     .EQU    fOurBits+1      ;The PrPort size.[178]

;-------------------------------------------------------------------------------
;Print Status: Runtime status for PrPicFile & PrPic procs.
;-------------------------------------------------------------------------------
iTotPages       .EQU    0               ;Total pages in Print File.
iCurPage        .EQU    iTotPages+2     ;Current page number
iTotCopies      .EQU    iCurPage+2      ;Total copies requested
iCurCopy        .EQU    iTotCopies+2    ;Current copy number
iTotBands       .EQU    iCurCopy+2      ;Total bands per page.
iCurBand        .EQU    iTotBands+2     ;Current band number
fPgDirty        .EQU    iCurBand+2      ;True if current page has been written to.
fImaging        .EQU    fPgDirty+1      ;Set while in band's DrawPic call.
hPrint          .EQU    fImaging+1      ;Handle to the active Printer record
pPrPort         .EQU    hPrint+4        ;Ptr to the active PrPort
hPic            .EQU    pPrPort+4       ;Handle to the active Picture
iPrStatSize     .EQU    hPic+4          ;The PrStatus size.[26]

;-------------------------------------------------------------------------------
; These are the constants for using resources to swap in the non-driver
; print code.  Three numbers are needed:
;       ResType
;       ResID
;       Offset into the seg's jump table
;
; The offset is really a formatted Long that contains three fields:
;       Frame Size; Unlock flag; Offset into the seg's jump table
; We could use the topmost byte for further stuff: a stack adjust for
; storing the registers needed by the link code so that it would be re-entrant.
;-------------------------------------------------------------------------------

lPDefType        .EQU   $50444546       ;Pr Resource TYPE: "PDEF"

iPrDraftID       .EQU   0               ;Pr Draft Resource ID
iPrSpoolID       .EQU   1               ;Pr Spool Resource ID
iPrUser1ID       .EQU   2               ;Pr Spare1 Resource ID
iPrUser2ID       .EQU   3               ;Pr Spare2 Resource ID
lOpenDoc         .EQU   $000C0000           ;PrOpenDoc JumpTable offset
lCloseDoc        .EQU   $00048004           ;PrCloseDoc JumpTable offset
lOpenPage        .EQU   $00080008           ;PrOpenPage JumpTable offset
lClosePage       .EQU   $0004000C           ;PrClosePage JumpTable offset

iPrDlgsID        .EQU   4               ;Pr Dialogs Resource ID
lDefault         .EQU   $00048000           ;PrintDefault JumpTable offset
lStlDialog       .EQU   $00048004           ;PrStlDialog JumpTable offset
lJobDialog       .EQU   $00048008           ;PrJobDialog JumpTable offset
lStlInit         .EQU   $0004000C           ;PrStlInit JumpTable offset
lJobInit         .EQU   $00040010           ;PrJobInit JumpTable offset
lDlgMain         .EQU   $00088014           ;PrDlgMain JumpTable offset
lPrValidate      .EQU   $00048018           ;PrintValidate JumpTable offset
lPrJobMerge      .EQU   $0008801C           ;PrintValidate JumpTable offset

iPrPicID         .EQU   5               ;Pic Printing Resource ID
lPrPicFile       .EQU   $00148000           ;PrPicFile JumpTable offset
;lPrPic           .EQU   $00148004           ;PrPic JumpTable offset

iCfgDlgID        .EQU   6               ;Configuration proc Resource ID
lCfgDialog       .EQU   $00008000           ;PrCfgDialog JumpTable offset

iPrHackID        .EQU   7               ;The "Oops, I Forgot" Resource ID
lPrHack          .EQU   $000C8000           ;PrHack JumpTable offset

;-------------------------------------------------------------------------------


-------------------------------
GPort           .EQU    0               ;The Printer's graf port.
GProcs          .EQU    108             ;..and its procs
lGParam1        .EQU    Gsumacc/ws/tlasm/quickmacs   444      0     12       34346  3472707200  11010 5PH r^((;File QuickMacs.Text
;------------------------------------------------
;
;  QuickDraw Assembly Language Interface
;
;    These macros expand into toolBox traps allowing
;  a convenient, symbolic QuickDraw interface for the
;  assembly language programmer.
;
;  Version for ROM 2.0 --      Februrary 10, 1983
;  updated for ROM 2.4 --      Mar 16, 1983
;  regenerated for ROM 4.0 --  June 3, 1983
;
;------------------------------------------------


                .MACRO  _InitCurs
                .WORD  $A850
                .ENDM

                .MACRO  _SetCurso
                .WORD  $A851
                .ENDM

                .MACRO  _HideCurs
                .WORD  $A852
                .ENDM

                .MACRO  _ShowCurs
                .WORD  $A853
                .ENDM

                .MACRO  _ShieldCu
                .WORD  $A855
                .ENDM

                .MACRO  _ObscureC
                .WORD  $A856
                .ENDM

                .MACRO  _BitAnd
                .WORD  $A858
                .ENDM

                .MACRO  _BitXOr
                .WORD  $A859
                .ENDM

                .MACRO  _BitNot
                .WORD  $A85A
                .ENDM

                .MACRO  _BitOr
                .WORD  $A85B
                .ENDM

                .MACRO  _BitShift
                .WORD  $A85C
                .ENDM

                .MACRO  _BitTst
                .WORD  $A85D
                .ENDM

                .MACRO  _BitSet
                .WORD  $A85E
                .ENDM

                .MACRO  _BitClr
                .WORD  $A85F
                .ENDM

                .MACRO  _Random
                .WORD  $A861
                .ENDM

                .MACRO  _ForeColo
                .WORD  $A862
                .ENDM

                .MACRO  _BackColo
                .WORD  $A863
                .ENDM

                .MACRO  _ColorBit
                .WORD  $A864
                .ENDM

                .MACRO  _GetPixel
                .WORD  $A865
                .ENDM

                .MACRO  _StuffHex
                .WORD  $A866
                .ENDM

                .MACRO  _LongMul
                .WORD  $A867
                .ENDM

                .MACRO  _FixMul
                .WORD  $A868
                .ENDM

                .MACRO  _FixRatio
                .WORD  $A869
                .ENDM

                .MACRO  _HiWord
                .WORD  $A86A
                .ENDM

                .MACRO  _LoWord
                .WORD  $A86B
                .ENDM

                .MACRO  _FixRound
                .WORD  $A86C
                .ENDM

                .MACRO  _InitPort
                .WORD  $A86D
                .ENDM

                .MACRO  _InitGraf
                .WORD  $A86E
                .ENDM

                .MACRO  _OpenPort
                .WORD  $A86F
                .ENDM

                .MACRO  _LocalToG
                .WORD  $A870
                .ENDM

                .MACRO  _GlobalTo
                .WORD  $A871
                .ENDM

                .MACRO  _GrafDevi
                .WORD  $A872
                .ENDM

                .MACRO  _SetPort
                .WORD  $A873
                .ENDM

                .MACRO  _GetPort
                .WORD  $A874
                .ENDM

                .MACRO  _SetPBits
                .WORD  $A875
                .ENDM

                .MACRO  _PortSize
                .WORD  $A876
                .ENDM

                .MACRO  _MovePort
                .WORD  $A877
                .ENDM

                .MACRO  _SetOrigi
                .WORD  $A878
                .ENDM

                .MACRO  _SetClip
                .WORD  $A879
                .ENDM

                .MACRO  _GetClip
                .WORD  $A87A
                .ENDM

                .MACRO  _ClipRect
                .WORD  $A87B
                .ENDM

                .MACRO  _BackPat
                .WORD  $A87C
                .ENDM

                .MACRO  _ClosePor
                .WORD  $A87D
                .ENDM

                .MACRO  _AddPt
                .WORD  $A87E
                .ENDM

                .MACRO  _SubPt
                .WORD  $A87F
                .ENDM

                .MACRO  _SetPt
                .WORD  $A880
                .ENDM

                .MACRO  _EqualPt
                .WORD  $A881
                .ENDM

                .MACRO  _StdText
                .WORD  $A882
                .ENDM

                .MACRO  _DrawChar
                .WORD  $A883
                .ENDM

                .MACRO  _DrawStri
                .WORD  $A884
                .ENDM

                .MACRO  _DrawText
                .WORD  $A885
                .ENDM

                .MACRO  _TextWidt
                .WORD  $A886
                .ENDM

                .MACRO  _TextFont
                .WORD  $A887
                .ENDM

                .MACRO  _TextFace
                .WORD  $A888
                .ENDM

                .MACRO  _TextMode
                .WORD  $A889
                .ENDM

                .MACRO  _TextSize
                .WORD  $A88A
                .ENDM

                .MACRO  _GetFontI
                .WORD  $A88B
                .ENDM

                .MACRO  _StringWi
                .WORD  $A88C
                .ENDM

                .MACRO  _CharWidt
                .WORD  $A88D
                .ENDM

                .MACRO  _SpaceExt
                .WORD  $A88E
                .ENDM

                .MACRO  _StdLine
                .WORD  $A890
                .ENDM

                .MACRO  _LineTo
                .WORD  $A891
                .ENDM

                .MACRO  _Line
                .WORD  $A892
                .ENDM

                .MACRO  _MoveTo
                .WORD  $A893
                .ENDM

                .MACRO  _Move
                .WORD  $A894
                .ENDM

                .MACRO  _Moov
                .WORD  $A894
                .ENDM

                .MACRO  _HidePen
                .WORD  $A896
                .ENDM

                .MACRO  _ShowPen
                .WORD  $A897
                .ENDM

                .MACRO  _GetPenSt
                .WORD  $A898
                .ENDM

                .MACRO  _SetPenSt
                .WORD  $A899
                .ENDM

                .MACRO  _GetPen
                .WORD  $A89A
                .ENDM

                .MACRO  _PenSize
                .WORD  $A89B
                .ENDM

                .MACRO  _PenMode
                .WORD  $A89C
                .ENDM

                .MACRO  _PenPat
                .WORD  $A89D
                .ENDM

                .MACRO  _PenNorma
                .WORD  $A89E
                .ENDM

                .MACRO  _StdRect
                .WORD  $A8A0
                .ENDM

                .MACRO  _FrameRec
                .WORD  $A8A1
                .ENDM

                .MACRO  _PaintRec
                .WORD  $A8A2
                .ENDM

                .MACRO  _EraseRec
                .WORD  $A8A3
                .ENDM

                .MACRO  _InverRe
                .WORD  $A8A4
                .ENDM

                .MACRO  _FillRect
                .WORD  $A8A5
                .ENDM

                .MACRO  _EqualRec
                .WORD  $A8A6
                .ENDM

                .MACRO  _SetRect
                .WORD  $A8A7
                .ENDM

                .MACRO  _OffSetRe
                .WORD  $A8A8
                .ENDM

                .MACRO  _InSetRec
                .WORD  $A8A9
                .ENDM

                .MACRO  _SectRect
                .WORD  $A8AA
                .ENDM

                .MACRO  _UnionRec
                .WORD  $A8AB
                .ENDM

                .MACRO  _Pt2Rect
                .WORD  $A8AC
                .ENDM

                .MACRO  _PtInRect
                .WORD  $A8AD
                .ENDM

                .MACRO  _EmptyRec
                .WORD  $A8AE
                .ENDM

                .MACRO  _StdRRect
                .WORD  $A8AF
                .ENDM

                .MACRO  _FrameRou
                .WORD  $A8B0
                .ENDM

                .MACRO  _PaintRou
                .WORD  $A8B1
                .ENDM

                .MACRO  _EraseRou
                .WORD  $A8B2
                .ENDM

                .MACRO  _InverRo
                .WORD  $A8B3
                .ENDM

                .MACRO  _FillRoun
                .WORD  $A8B4
                .ENDM

                .MACRO  _StdOval
                .WORD  $A8B6
                .ENDM

                .MACRO  _FrameOva
                .WORD  $A8B7
                .ENDM

                .MACRO  _PaintOva
                .WORD  $A8B8
                .ENDM

                .MACRO  _EraseOva
                .WORD  $A8B9
                .ENDM

                .MACRO  _InvertOv
                .WORD  $A8BA
                .ENDM

                .MACRO  _FillOval
                .WORD  $A8BB
                .ENDM

                .MACRO  _SlopeFromAngle
                .WORD  $A8BC
                .ENDM

                .MACRO  _StdArc
                .WORD  $A8BD
                .ENDM

                .MACRO  _FrameArc
                .WORD  $A8BE
                .ENDM

                .MACRO  _PaintArc
                .WORD  $A8BF
                .ENDM

                .MACRO  _EraseArc
                .WORD  $A8C0
                .ENDM

                .MACRO  _InvertAr
                .WORD  $A8C1
                .ENDM

                .MACRO  _FillArc
                .WORD  $A8C2
                .ENDM

                .MACRO  _PtToAngl
                .WORD  $A8C3
                .ENDM

                .MACRO  _AngleFromSlope
                .WORD  $A8C4
                .ENDM

                .MACRO  _StdPoly
                .WORD  $A8C5
                .ENDM

                .MACRO  _FramePol
                .WORD  $A8C6
                .ENDM

                .MACRO  _PaintPol
                .WORD  $A8C7
                .ENDM

                .MACRO  _ErasePol
                .WORD  $A8C8
                .ENDM

                .MACRO  _InvertPo
                .WORD  $A8C9
                .ENDM

                .MACRO  _FillPoly
                .WORD  $A8CA
                .ENDM

                .MACRO  _OpenPoly
                .WORD  $A8CB
                .ENDM

                .MACRO  _ClosePgon
                .WORD  $A8CC
                .ENDM

                .MACRO  _KillPoly
                .WORD  $A8CD
                .ENDM

                .MACRO  _OffSetPo
                .WORD  $A8CE
                .ENDM

                .MACRO  _PackBits
                .WORD  $A8CF
                .ENDM

                .MACRO  _UnpackBi
                .WORD  $A8D0
                .ENDM

                .MACRO  _StdRgn
                .WORD  $A8D1
                .ENDM

                .MACRO  _FrameRgn
                .WORD  $A8D2
                .ENDM

                .MACRO  _PaintRgn
                .WORD  $A8D3
                .ENDM

                .MACRO  _EraseRgn
                .WORD  $A8D4
                .ENDM

                .MACRO  _InverRgn
                .WORD  $A8D5
                .ENDM

                .MACRO  _FillRgn
                .WORD  $A8D6
                .ENDM

                .MACRO  _NewRgn
                .WORD  $A8D8
                .ENDM

                .MACRO  _DisposRgn
                .WORD  $A8D9
                .ENDM

                .MACRO  _OpenRgn
                .WORD  $A8DA
                .ENDM

                .MACRO  _CloseRgn
                .WORD  $A8DB
                .ENDM

                .MACRO  _CopyRgn
                .WORD  $A8DC
                .ENDM

                .MACRO  _SetEmpty
                .WORD  $A8DD
                .ENDM

                .MACRO  _SetRecRgn
                .WORD  $A8DE
                .ENDM

                .MACRO  _RectRgn
                .WORD  $A8DF
                .ENDM

                .MACRO  _OfSetRgn
                .WORD  $A8E0
                .ENDM

                .MACRO  _InSetRgn
                .WORD  $A8E1
                .ENDM

                .MACRO  _EmptyRgn
                .WORD  $A8E2
                .ENDM

                .MACRO  _EqualRgn
                .WORD  $A8E3
                .ENDM

                .MACRO  _SectRgn
                .WORD  $A8E4
                .ENDM

                .MACRO  _UnionRgn
                .WORD  $A8E5
                .ENDM

                .MACRO  _DiffRgn
                .WORD  $A8E6
                .ENDM

                .MACRO  _XOrRgn
                .WORD  $A8E7
                .ENDM

                .MACRO  _PtInRgn
                .WORD  $A8E8
                .ENDM

                .MACRO  _RectInRg
                .WORD  $A8E9
                .ENDM

                .MACRO  _StdBits
                .WORD  $A8EB
                .ENDM

                .MACRO  _CopyBits
                .WORD  $A8EC
                .ENDM

                .MACRO  _ScrollRe
                .WORD  $A8EF
                .ENDM

                .MACRO  _SetStdPr
                .WORD  $A8EA
                .ENDM

                .MACRO  _StdTxMea
                .WORD  $A8ED
                .ENDM

                .MACRO  _StdGetPi
                .WORD  $A8EE
                .ENDM

                .MACRO  _StdPutPi
                .WORD  $A8F0
                .ENDM

                .MACRO  _StdComme
                .WORD  $A8F1
                .ENDM

                .MACRO  _PicComme
                .WORD  $A8F2
                .ENDM

                .MACRO  _OpenPict
                .WORD  $A8F3
                .ENDM

                .MACRO  _ClosePic
                .WORD  $A8F4
                .ENDM

                .MACRO  _KillPict
                .WORD  $A8F5
                .ENDM

                .MACRO  _DrawPict
                .WORD  $A8F6
                .ENDM

                .MACRO  _ScalePt
                .WORD  $A8F8
                .ENDM

                .MACRO  _MapPt
                .WORD  $A8F9
                .ENDM

                .MACRO  _MapRect
                .WORD  $A8FA
                .ENDM

                .MACRO  _MapRgn
                .WORD  $A8FB
                .ENDM

                .MACRO  _MapPoly
                .WORD  $A8FC
                .ENDM

   .MACRO  _OpenPoly
                .WORD  $A8CB
                .ENDM

                .MACRO  _ClosePgon
                .WORD  $A8CC
                .ENDM

                .MACRO  _KillPoly
                .WORD  $A8CD
                .ENDM

                .MACRO  _OffSetPo
  sumacc/ws/tlasm/resequ   444      0     12       15021  3472707200  10321 3. "6F^4D!$^XQ;File ResEqu.TEXT
;-----------------------------------------------------
;
;    Standard System Resource Type and ID Definitions
;
;       written by Andy Hertzfeld  28-Dec-82
;
;    Here are the standard resources defined by the system,
;  listed by their type class.
;
;
;  Modification History:
;
;   AJH  06-Mar-83   Added FWID resource class
;   BLH  06-Mar-83   Added Keymap resource class and standard resources
;   AJH  03-Jun-83   KEYM -> KEYC
;   AJH  07-Jul-83   Made it consistent with documentation
;   AJH  05-Sep-83   Added TextRType
;
;------------------------------------------------------


;------------------------------------------------
;
;   TYPE "PAT " -- Standard Pattern Definitions
;     (also "PAT#")
;
;------------------------------------------------

PatRType        .EQU    $50415420               ;"PAT " resource type
PatLRType       .EQU    $50415423               ;"PAT#" resource type

; patterns 0-15 are a gray scale

WhitePat        .EQU    0                       ;white is pattern 0
LtGrayPat       .EQU    4                       ;light gray
GrayPat         .EQU    8                       ;50-50 gray is 8
DkGrayPat       .EQU    12                      ;dark gray
BlackPat        .EQU    15                      ;black is pattern 15

DeskPatID       .EQU    16                      ;desk pattern is pattern 16
SBarPatID       .EQU    17                      ;scrollBar pattern is 17


;------------------------------------------------
;
;   TYPE "PICT" and "TEXT" -- Standard Scrap Types
;
;------------------------------------------------

PicRType        .EQU    $50494354       ;"PICT" -- Picture resource type
TextRType       .EQU    $54455854       ;"TEXT" -- Text resource type



;------------------------------------------------
;
;   TYPE "ICON" -- Standard Icon Definitions
;
;------------------------------------------------

IconRType       .EQU    $49434F4E       ;"ICON" -- resource class

; standard system-defined icons

StopIcon        .EQU    0               ;Stop icon
NoteIcon        .EQU    1               ;Note icon
CtnIcon         .EQU    2               ;Caution icon

;------------------------------------------------
;
;   TYPES "WDEF,MDEF,CDEF"
;
;     --  ToolBox Object Definition Procedures
;
;------------------------------------------------

WDefRType       .EQU    $57444546       ;"WDEF" -- reosurce class
MDefRType       .EQU    $4D444546       ;"MDEF" -- resource type
CDefRType       .EQU    $43444546       ;"CDEF"--resource class

; standard window definition procedures

DocumentProc   .EQU      0              ;standard document
DBoxProc       .EQU      1              ;dialog box (document without titleBar)
RDocProc       .EQU     16              ;document with rounded corners

; standard menu definition procedures

TextMenuProc   .EQU      0              ;the one we know and love
PatMenuProc    .EQU      1              ;menu for displaying patterns

; standard control definition procedures

PushButProc    .EQU      0              ;standard rounded-corner pushButtons
CheckBoxProc   .EQU      1              ;standard check-box type buttons
RadioButProc   .EQU      2              ;almost the same as checkBox (different check)
ScrollBarProc  .EQU      16             ;standard scrollBar


;------------------------------------------------
;
;   TYPE "FONT" -- Standard Font Definitions
;
;------------------------------------------------

FontRType       .EQU    $464F4E54       ;"FONT" -- resource class
FWidRType       .EQU    $46574944       ;"FWID" -- just like font with null strike

; here are a few standard font ID's.  These are just the most common, for
; a complete choice, include "MoreFonts.TEXT"


Cream10        .EQU      0              ;ROM font
StdFont        .EQU      1              ;one maps into application standard font


;------------------------------------------------
;
;   TYPE "DRVR" -- Standard Driver Definitions
;
;------------------------------------------------

DrvrRType      .EQU      $44525652      ;"DRVR" -- resource type

;
; drivers are referenced by name, so there are no standard
; resource IDs for them.
;

;------------------------------------------------
;
;   TYPE "KEYC" -- Standard Keyboard Mapping Procs
;
;------------------------------------------------

KeyCType        .EQU      $4B455943      ;"KEYC" -- resource type

;Standard keyboard drivers

StdKbd         .EQU      0              ;Standard keyboard driver

;------------------------------------------------
;
;   TYPE "CURS" -- Standard Cursor Definitions
;
;------------------------------------------------

CursRType      .EQU      $43555253      ;"CURS" -- resource type

; standard cursor definitions

ArrowCursor    .EQU      0              ;slanted arrow
IBeamCursor    .EQU      1              ;text selection cursor
CrossCursor    .EQU      2              ;for structured selection
PlusCursor     .EQU      3              ;for drawing graphics
HourCursor     .EQU      4              ;for indicating a long delay

;------------------------------------------------
;
;   TYPE "STR " -- Standard String (BuzzWord) Definitions
;
;------------------------------------------------

StringRType    .EQU      $53545220      ;"STR " -- resource class

; standard strings (none are currently defined)


;-----------------------------------------------------
;
;   TYPEs "WIND,MENU,CNTL,MBAR"  --  Standard ToolBox Objects
;
;-----------------------------------------------------

WindRType       .EQU    $57494E44       ;"WIND" -- resource type
MenuRType       .EQU    $4D454E55       ;"MENU" -- resource type
MBarRType       .EQU    $4D424152       ;"MBAR" -- resource type
CtrlRType       .EQU    $434E544C       ;"CNTL" -- resource type

; no standard windows or menus are defined yet

; Standard Control Definitions

OKButton       .EQU      1              ;OK button
CancelButton   .EQU      2              ;Cancel button

;----------------------------------------------------------
;
;   TYPE "CODE" -- Code Segments
;
;----------------------------------------------------------

CodeRType      .EQU      $434F4445      ;"CODE" for code segments (programs!)

;----------------------------------------------------------
;
;   TYPE "ALRT,DLOG,DITL" -- Alert and Dialog Definitions
;
;----------------------------------------------------------

AlertType       .EQU    $414C5254       ;"ALRT" -- resource class
DilogType       .EQU    $444C4F47       ;"DLOG" -- resource class
ItmLstType      .EQU    $4449544C       ;"DITL" -- dialog item list

; standard system alerts (none are defined yet)

; standard system dialogs (none are defined yet)





ntProc   .EQU      0              ;standard document
DBoxProc       .EQU      1              ;dialog box (document without titleBar)
RDocProc       .EQU     16              ;document with rounded corners

; standard menu definition procedures

TextMenuProc   .EQU      0              ;the one we know and love
PatMenuProc    .EQU      1              ;menu for displaying patterns

; standard control definition procedures

PushButProc    .EQU      0              ;standard rounded-corner pushButsumacc/ws/tlasm/sanemacs   444      0     12       57147  3472707200  10626 A       7O^4PH r@^;-----------------------------------------------------------
;
;  These macros give assembly language access to the Mac
;  floating-point arithmetic routines.  The arithmetic has
;  just one entry point.  It is typically accessed through
;  the tooltrap _FP68K, although a custom version of the
;  package may be linked as an object file, in which case
;  the entry point is the label %FP68K.
;
;  All calls to the arithmetic take the form:
;       PEA     <source address>
;       PEA     <destination address>
;       MOVE.W  <opcode>,-(SP)
;       _FP68K
;
;  All operands are passed by address.  The <opcode> word
;  specifies the instruction analogously to a 68000 machine
;  instruction.  Depending on the instruction, there may be
;  from one to three operand addresses passed.
;
;  This definition file specifies details of the <opcode>
;  word and the floating point state word, and defines
;  some handy macros.
;
;  Modification history:
;       29AUG82: WRITTEN BY JEROME COONEN
;       13OCT82: FB___ CONSTRANTS ADDED (JTC)
;       28DEC82: LOGB, SCALB ADDED, INF MODES OUT (JTC).
;       29APR83: ABS, NEG, CPYSGN, CLASS ADDED (JTC).
;       03MAY83: NEXT, SETXCP ADDED (JTC).
;       28MAY83: ELEMENTARY FUNCTIONS ADDED (JTC).
;       04JUL83: SHORT BRANCHES, TRIG AND RAND ADDED (JTC).
;       01NOV83: PRECISION CONTROL MADE A MODE (JTC).
;
;-----------------------------------------------------------


;-----------------------------------------------------------
; This constant determines whether the floating point unit
; is accessed via the system dispatcher after an A-line
; trap, or through a direct subroutine call to a  custom
; version of the package linked directly to the application.
;-----------------------------------------------------------
ATRAP           .EQU    1       ;0 for JSR and 1 for A-line
BTRAP           .EQU    1       ;0 for JSR and 1 for A-line

        .MACRO  JSRFP
        .IF     ATRAP
        _FP68K
        .ELSE
        .REF    FP68K
        JSR     FP68K
        .ENDC
        .ENDM

        .MACRO  JSRELEMS
        .IF     BTRAP
        _ELEMS68K
        .ELSE
        .REF    ELEMS68K
        JSR     ELEMS68K
        .ENDC
        .ENDM


;-----------------------------------------------------------
; OPERATION MASKS: bits $001F of the operation word
; determine the operation.  There are two rough classes of
; operations:  even numbered opcodes are the usual
; arithmetic operations and odd numbered opcodes are non-
; arithmetic or utility operations.
;-----------------------------------------------------------
FOADD           .EQU    $0000
FOSUB           .EQU    $0002
FOMUL           .EQU    $0004
FODIV           .EQU    $0006
FOCMP           .EQU    $0008
FOCPX           .EQU    $000A
FOREM           .EQU    $000C
FOZ2X           .EQU    $000E
FOX2Z           .EQU    $0010
FOSQRT          .EQU    $0012
FORTI           .EQU    $0014
FOTTI           .EQU    $0016
FOSCALB         .EQU    $0018
FOLOGB          .EQU    $001A
FOCLASS         .EQU    $001C
; UNDEFINED     .EQU    $001E

FOSETENV        .EQU    $0001
FOGETENV        .EQU    $0003
FOSETTV         .EQU    $0005
FOGETTV         .EQU    $0007
FOD2B           .EQU    $0009
FOB2D           .EQU    $000B
FONEG           .EQU    $000D
FOABS           .EQU    $000F
FOCPYSGNX       .EQU    $0011
FONEXT          .EQU    $0013
FOSETXCP        .EQU    $0015
FOPROCENTRY     .EQU    $0017
FOPROCEXIT      .EQU    $0019
FOTESTXCP       .EQU    $001B
; UNDEFINED     .EQU    $001D
; UNDEFINED     .EQU    $001F


;-----------------------------------------------------------
; OPERAND FORMAT MASKS: bits $3800 determine the format of
; any non-extended operand.
;-----------------------------------------------------------
FFEXT           .EQU    $0000   ; extended -- 80-bit float
FFDBL           .EQU    $0800   ; double   -- 64-bit float
FFSGL           .EQU    $1000   ; single   -- 32-bit float
FFINT           .EQU    $2000   ; integer  -- 16-bit integer
FFLNG           .EQU    $2800   ; long int -- 32-bit integer
FFCOMP          .EQU    $3000   ; accounting -- 64-bit int


;-----------------------------------------------------------
; Bit indexes for error and halt bits and rounding modes in
; the state word.  The word is broken down as:
;
;       $8000 -- unused
;
;       $6000 -- rounding modes
;                $0000 -- to nearest
;                $2000 -- toward +infinity
;                $4000 -- toward -infinity
;                $6000 -- toward zero
;
;       $1F00 -- error flags
;                $1000 -- inexact
;                $0800 -- division by zero
;                $0400 -- overflow
;                $0200 -- underflow
;                $0100 -- invalid operation
;
;       $0080 -- result of last rounding
;                $0000 -- rounded down in magnitude
;                $0080 -- rounded up in magnitude
;
;       $0060 -- precision control
;                $0000 -- extended
;                $0020 -- double
;                $0040 -- single
;                $0060 -- ILLEGAL
;
;       $001F -- halt enables, corresponding to error flags
;
; The bit indexes are based on the byte halves of the state
; word.
;-----------------------------------------------------------
FBINVALID       .EQU    0       ; invalid operation
FBUFLOW         .EQU    1       ; underflow
FBOFLOW         .EQU    2       ; overflow
FBDIVZER        .EQU    3       ; division by zero
FBINEXACT       .EQU    4       ; inexact
FBRNDLO         .EQU    5       ; low bit of rounding mode
FBRNDHI         .EQU    6       ; high bit of rounding mode
FBLSTRND        .EQU    7       ; last round result bit
FBDBL           .EQU    5       ; double precision control
FBSGL           .EQU    6       ; single precision control


;-----------------------------------------------------------
; FLOATING CONDITIONAL BRANCHES: floating point comparisons
; set the CPU condition code register (the CCR) as follows:
;       relation        X N Z V C
;       -------------------------
;         equal         0 0 1 0 0
;       less than       1 1 0 0 1
;       greater than    0 0 0 0 0
;        unordered      0 0 0 1 0
; The macros below define a set of so-called floating
; branches to spare the programmer repeated refernces to the
; the table above.
;-----------------------------------------------------------
        .MACRO  FBEQ
        BEQ     %1
        .ENDM

        .MACRO  FBLT
        BCS     %1
        .ENDM

        .MACRO  FBLE
        BLS     %1
        .ENDM

        .MACRO  FBGT
        BGT     %1
        .ENDM

        .MACRO  FBGE
        BGE     %1
        .ENDM

        .MACRO  FBULT
        BLT     %1
        .ENDM

        .MACRO  FBULE
        BLE     %1
        .ENDM

        .MACRO  FBUGT
        BHI     %1
        .ENDM

        .MACRO  FBUGE
        BCC     %1
        .ENDM

        .MACRO  FBU
        BVS     %1
        .ENDM

        .MACRO  FBO
        BVC     %1
        .ENDM

        .MACRO  FBNE
        BNE     %1
        .ENDM

        .MACRO  FBUE
        BEQ     %1
        BVS     %1
        .ENDM

        .MACRO  FBLG
        BNE     %1
        BVC     %1
        .ENDM

; Short branch versions.

        .MACRO  FBEQS
        BEQ.S   %1
        .ENDM

        .MACRO  FBLTS
        BCS.S     %1
        .ENDM

        .MACRO  FBLES
        BLS.S     %1
        .ENDM

        .MACRO  FBGTS
        BGT.S     %1
        .ENDM

        .MACRO  FBGES
        BGE.S     %1
        .ENDM

        .MACRO  FBULTS
        BLT.S     %1
        .ENDM

        .MACRO  FBULES
        BLE.S     %1
        .ENDM

        .MACRO  FBUGTS
        BHI.S     %1
        .ENDM

        .MACRO  FBUGES
        BCC.S     %1
        .ENDM

        .MACRO  FBUS
        BVS.S     %1
        .ENDM

        .MACRO  FBOS
        BVC.S     %1
        .ENDM

        .MACRO  FBNES
        BNE.S     %1
        .ENDM

        .MACRO  FBUES
        BEQ.S     %1
        BVS.S     %1
        .ENDM

        .MACRO  FBLGS
        BNE.S     %1
        BVC.S     %1
        .ENDM


;-----------------------------------------------------------
; OPERATION MACROS:
;       THESE MACROS REQUIRE THAT THE OPERANDS' ADDRESSES
;       FIRST BE PUSHED ON THE STACK.  THE MACROS CANNOT
;       THEMSELVES PUSH THE ADDRESSES SINCE THE ADDRESSES
;       MAY BE SP-RELATIVE, IN WHICH CASE THEY REQUIRE
;       PROGRAMMER CARE.
; OPERATION MACROS: operand addresses should already be on
; the stack, with the destination address on top.  The
; suffix X, D, S, or C determines the format of the source
; operand -- extended, double, single, or computational
; respectively; the destination operand is always extended.
;-----------------------------------------------------------


;-----------------------------------------------------------
; Addition.
;-----------------------------------------------------------
        .MACRO  FADDX
        MOVE.W  #FFEXT+FOADD,-(SP)
        JSRFP
        .ENDM

        .MACRO  FADDD
        MOVE.W  #FFDBL+FOADD,-(SP)
        JSRFP
        .ENDM

        .MACRO  FADDS
        MOVE.W  #FFSGL+FOADD,-(SP)
        JSRFP
        .ENDM

        .MACRO  FADDC
        MOVE.W  #FFCOMP+FOADD,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Subtraction.
;-----------------------------------------------------------
        .MACRO  FSUBX
        MOVE.W  #FFEXT+FOSUB,-(SP)
        JSRFP
        .ENDM

        .MACRO  FSUBD
        MOVE.W  #FFDBL+FOSUB,-(SP)
        JSRFP
        .ENDM

        .MACRO  FSUBS
        MOVE.W  #FFSGL+FOSUB,-(SP)
        JSRFP
        .ENDM

        .MACRO  FSUBC
        MOVE.W  #FFCOMP+FOSUB,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Multiplication.
;-----------------------------------------------------------
        .MACRO  FMULX
        MOVE.W  #FFEXT+FOMUL,-(SP)
        JSRFP
        .ENDM

        .MACRO  FMULD
        MOVE.W  #FFDBL+FOMUL,-(SP)
        JSRFP
        .ENDM

        .MACRO  FMULS
        MOVE.W  #FFSGL+FOMUL,-(SP)
        JSRFP
        .ENDM

        .MACRO  FMULC
        MOVE.W  #FFCOMP+FOMUL,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Division.
;-----------------------------------------------------------
        .MACRO  FDIVX
        MOVE.W  #FFEXT+FODIV,-(SP)
        JSRFP
        .ENDM

        .MACRO  FDIVD
        MOVE.W  #FFDBL+FODIV,-(SP)
        JSRFP
        .ENDM

        .MACRO  FDIVS
        MOVE.W  #FFSGL+FODIV,-(SP)
        JSRFP
        .ENDM

        .MACRO  FDIVC
        MOVE.W  #FFCOMP+FODIV,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Compare, signaling no exceptions.
;-----------------------------------------------------------
        .MACRO  FCMPX
        MOVE.W  #FFEXT+FOCMP,-(SP)
        JSRFP
        .ENDM

        .MACRO  FCMPD
        MOVE.W  #FFDBL+FOCMP,-(SP)
        JSRFP
        .ENDM

        .MACRO  FCMPS
        MOVE.W  #FFSGL+FOCMP,-(SP)
        JSRFP
        .ENDM

        .MACRO  FCMPC
        MOVE.W  #FFCOMP+FOCMP,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Compare, signaling invalid operation if the two operands
; are unordered.
;-----------------------------------------------------------
        .MACRO  FCPXX
        MOVE.W  #FFEXT+FOCPX,-(SP)
        JSRFP
        .ENDM

        .MACRO  FCPXD
        MOVE.W  #FFDBL+FOCPX,-(SP)
        JSRFP
        .ENDM

        .MACRO  FCPXS
        MOVE.W  #FFSGL+FOCPX,-(SP)
        JSRFP
        .ENDM

        .MACRO  FCPXC
        MOVE.W  #FFCOMP+FOCPX,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Remainder.  The remainder is placed in the destination,
; and the low bits of the integer quotient are placed in
; the low word of register D0.
;-----------------------------------------------------------
        .MACRO  FREMX
        MOVE.W  #FFEXT+FOREM,-(SP)
        JSRFP
        .ENDM

        .MACRO  FREMD
        MOVE.W  #FFDBL+FOREM,-(SP)
        JSRFP
        .ENDM

        .MACRO  FREMS
        MOVE.W  #FFSGL+FOREM,-(SP)
        JSRFP
        .ENDM

        .MACRO  FREMC
        MOVE.W  #FFCOMP+FOREM,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Compare the source operand to the extended format and
; place in the destination.
;-----------------------------------------------------------
        .MACRO  FX2X
        MOVE.W  #FFEXT+FOZ2X,-(SP)
        JSRFP
        .ENDM

        .MACRO  FD2X
        MOVE.W  #FFDBL+FOZ2X,-(SP)
        JSRFP
        .ENDM

        .MACRO  FS2X
        MOVE.W  #FFSGL+FOZ2X,-(SP)
        JSRFP
        .ENDM

        .MACRO  FI2X                    ; 16-bit integer
        MOVE.W  #FFINT+FOZ2X,-(SP)
        JSRFP
        .ENDM

        .MACRO  FL2X                    ; 32-bit integer
        MOVE.W  #FFLNG+FOZ2X,-(SP)
        JSRFP
        .ENDM

        .MACRO  FC2X
        MOVE.W  #FFCOMP+FOZ2X,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Convert the extended source operand to the specified
; format and place in the destination.
;-----------------------------------------------------------
        .MACRO  FX2D
        MOVE.W  #FFDBL+FOX2Z,-(SP)
        JSRFP
        .ENDM

        .MACRO  FX2S
        MOVE.W  #FFSGL+FOX2Z,-(SP)
        JSRFP
        .ENDM

        .MACRO  FX2I                    ; 16-bit integer
        MOVE.W  #FFINT+FOX2Z,-(SP)
        JSRFP
        .ENDM

        .MACRO  FX2L                    ; 32-bit integer
        MOVE.W  #FFLNG+FOX2Z,-(SP)
        JSRFP
        .ENDM

        .MACRO  FX2C
        MOVE.W  #FFCOMP+FOX2Z,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Miscellaneous operations applying only to extended
; operands.  The input operand is overwritten with the
; computed result.
;-----------------------------------------------------------

; Square root.
        .MACRO  FSQRTX
        MOVE.W  #FOSQRT,-(SP)
        JSRFP
        .ENDM

; Round to integer, according to the current rounding mode.
        .MACRO  FRINTX
        MOVE.W  #FORTI,-(SP)
        JSRFP
        .ENDM

; Round to integer, forcing rounding toward zero.
        .MACRO  FTINTX
        MOVE.W  #FOTTI,-(SP)
        JSRFP
        .ENDM

; Set the destination to the product:
;  (destination) * 2^(source)
; where the source operand is a 16-bit integer.
        .MACRO  FSCALBX
        MOVE.W  #FFINT+FOSCALB,-(SP)
        JSRFP
        .ENDM

; Replace the destination with its exponent, converted to
; the extended format.
        .MACRO  FLOGBX
        MOVE.W  #FOLOGB,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Non-arithmetic sign operations on extended operands.
;-----------------------------------------------------------

; Negate.
        .MACRO  FNEGX
        MOVE.W  #FONEG,-(SP)
        JSRFP
        .ENDM

; Absolute value.
        .MACRO  FABSX
        MOVE.W  #FOABS,-(SP)
        JSRFP
        .ENDM

; Copy the sign of the destination operand onto the sign of
; the source operand.  Note that the source operand is
; modified.
        .MACRO  FCPYSGNX
        MOVE.W  #FOCPYSGN,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; The nextafter operation replaces the source operand with
; its nearest representable neighbor in the direction of the
; destination operand.  Note that both operands are of the
; the same format, as specified by the usual suffix.
;-----------------------------------------------------------
        .MACRO  FNEXTS
        MOVE.W  #FFSGL+FONEXT,-(SP)
        JSRFP
        .ENDM

        .MACRO  FNEXTD
        MOVE.W  #FFDBL+FONEXT,-(SP)
        JSRFP
        .ENDM

        .MACRO  FNEXTX
        MOVE.W  #FFEXT+FONEXT,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; The classify operation places an integer in the
; destination.  The sign of the integer is the sign of the
; source.  The magnitude is determined by the value of the
; source, as indicated by the equates.
;-----------------------------------------------------------
FCSNAN          .EQU    1       ; signaling NAN
FCQNAN          .EQU    2       ; quiet NAN
FCINF           .EQU    3       ; infinity
FCZERO          .EQU    4       ; zero
FCNORM          .EQU    5       ; normal number
FCDENORM        .EQU    6       ; denormal number

        .MACRO  FCLASSS
        MOVE.W  #FFSGL+FOCLASS,-(SP)
        JSRFP
        .ENDM

        .MACRO  FCLASSD
        MOVE.W  #FFDBL+FOCLASS,-(SP)
        JSRFP
        .ENDM

        .MACRO  FCLASSX
        MOVE.W  #FFEXT+FOCLASS,-(SP)
        JSRFP
        .ENDM

        .MACRO  FCLASSC
        MOVE.W  #FFCOMP+FOCLASS,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; These four operations give access to the floating point
; state (or environment) word and the halt vector address.
; The sole input operand is a pointer to the word or address
; to be placed into the arithmetic state area or read from
; it.
;-----------------------------------------------------------
        .MACRO  FGETENV
        MOVE.W  #FOGETENV,-(SP)
        JSRFP
        .ENDM

        .MACRO  FSETENV
        MOVE.W  #FOSETENV,-(SP)
        JSRFP
        .ENDM

        .MACRO  FGETTV
        MOVE.W  #FOGETTV,-(SP)
        JSRFP
        .ENDM

        .MACRO  FSETTV
        MOVE.W  #FOSETTV,-(SP)
        JSRFP
        .ENDM

;-----------------------------------------------------------
; Both FPROCENTRY and FPROCEXIT have one operand -- a
; pointer to a word.  The entry procedure saves the current
; floating point state in that word and resets the state
; to 0, that is all modes to default, flags and halts to
; OFF.  The exit procedure performs the sequence:
;       1. Save current error flags in a temporary.
;       2. Restore the state saved at the address given by
;               the parameter.
;       3. Signal the exceptions flagged in the temporary,
;               halting if so specified by the newly
;               restored state word.
; These routines serve to handle the state word dynamically
; across subroutine calls.
;-----------------------------------------------------------
        .MACRO  FPROCENTRY
        MOVE.W  #FOPROCENTRY,-(SP)
        JSRFP
        .ENDM

        .MACRO  FPROCEXIT
        MOVE.W  #FOPROCEXIT,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; FSETXCP is a null arithmetic operation which stimulates
; the indicated exception.  It may be used by library
; routines intended to behave like elementary operations.
; The operand is a pointer to an integer taking any value
; between FBINVALID and FBINEXACT.
; FTESTXCP tests the flag indicated by the integer pointed
; to by the input address.  The integer is replaced by a
; Pascal boolean (word $0000=false, $0100=true)
;-----------------------------------------------------------
        .MACRO  FSETXCP
        MOVE.W  #FOSETXCP,-(SP)
        JSRFP
        .ENDM

        .MACRO  FTESTXCP
        MOVE.W  #FOTESTXCP,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; WARNING: PASCAL ENUMERATED TYPES, LIKE THOSE OF THE
; DECIMAL RECORD, ARE STORED IN THE HIGH-ORDER BYTE OF THE
; ALLOCATED WORD, IF POSSIBLE.  THUS THE SIGN HAS THE
; INTEGER VALUE 0 FOR PLUS AND 256 (RATHER THAN 1)
; FOR MINUS.
; BINARY-DECIMAL CONVERSION:  The next routines convert
; between a canonical decimal format and the binary format
; specified.  The decimal format is defined in Pascal as
;
;   CONST
;       SIGDIGLEN = 20;
;
;   TYPE
;       SigDig  = string [SIGDIGLEN];
;       Decimal = record
;                     sgn : 0..1;
;                     exp : integer;
;                     sig : SigDig
;                 end;
;
; Note that Lisa Pascal stores the sgn in the high-order
; byte of the allotted word, so the two legal word values
; of sgn are 0 and 256.
;-----------------------------------------------------------


;-----------------------------------------------------------
; Decimal to binary conversion is governed by a format
; record defined in Pascal as:
;
;   TYPE
;       DecForm = record
;                     style  : (FloatDecimal, FixedDecimal);
;                     digits : integer
;                 end;
;
; Note again that the style field is stored in the high-
; order byte of the allotted word.
;
; These are the only operations with three operands.  The
; pointer to the format record is deepest in the stack,
; then the source pointer, and finally the destination
; pointer.
;-----------------------------------------------------------
        .MACRO  FDEC2X
        MOVE.W  #FFEXT+FOD2B,-(SP)
        JSRFP
        .ENDM

        .MACRO  FDEC2D
        MOVE.W  #FFDBL+FOD2B,-(SP)
        JSRFP
        .ENDM

        .MACRO  FDEC2S
        MOVE.W  #FFSGL+FOD2B,-(SP)
        JSRFP
        .ENDM

        .MACRO  FDEC2C
        MOVE.W  #FFCOMP+FOD2B,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Binary to decimal conversion.
;-----------------------------------------------------------
        .MACRO  FX2DEC
        MOVE.W  #FFEXT+FOB2D,-(SP)
        JSRFP
        .ENDM

        .MACRO  FD2DEC
        MOVE.W  #FFDBL+FOB2D,-(SP)
        JSRFP
        .ENDM

        .MACRO  FS2DEC
        MOVE.W  #FFSGL+FOB2D,-(SP)
        JSRFP
        .ENDM

        .MACRO  FC2DEC
        MOVE.W  #FFCOMP+FOB2D,-(SP)
        JSRFP
        .ENDM


;-----------------------------------------------------------
; Equates and macros for elementary functions.
;-----------------------------------------------------------
FOLNX           .EQU    $0000
FOLOG2X         .EQU    $0002
FOLN1X          .EQU    $0004
FOLOG21X        .EQU    $0006

FOEXPX          .EQU    $0008
FOEXP2X         .EQU    $000A
FOEXP1X         .EQU    $000C
FOEXP21X        .EQU    $000E

FOXPWRI         .EQU    $8010
FOXPWRY         .EQU    $8012
FOCOMPOUNDX     .EQU    $C014
FOANNUITYX      .EQU    $C016

FOSINX          .EQU    $0018
FOCOSX          .EQU    $001A
FOTANX          .EQU    $001C
FOATANX         .EQU    $001E
FORANDOMX       .EQU    $0020

        .MACRO  FLNX
        MOVE.W  #FOLNX,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FLOG2X
        MOVE.W  #FOLOG2X,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FLN1X
        MOVE.W  #FOLN1X,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FLOG21X
        MOVE.W  #FOLOG21X,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FEXPX
        MOVE.W  #FOEXPX,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FEXP2X
        MOVE.W  #FOEXP2X,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FEXP1X
        MOVE.W  #FOEXP1X,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FEXP21X
        MOVE.W  #FOEXP21X,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FXPWRI
        MOVE.W  #FOXPWRI,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FXPWRY
        MOVE.W  #FOXPWRY,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FCOMPOUNDX
        MOVE.W  #FOCOMPOUNDX,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FANNUITYX
        MOVE.W  #FOANNUITYX,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FSINX
        MOVE.W  #FOSINX,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FCOSX
        MOVE.W  #FOCOSX,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FTANX
        MOVE.W  #FOTANX,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FATANX
        MOVE.W  #FOATANX,-(SP)
        JSRELEMS
        .ENDM

        .MACRO  FRANDOMX
        MOVE.W  #FORANDOMX,-(SP)
        JSRELEMS
        .ENDM
;-----------------------------------------------------------
;-----------------------------------------------------------
;-----------------------------------------------------------
;-----------------------------------------------------------

; Note that Lisa Pascal stores the sgn in the high-order
; byte of the allotted word, so the two legal word values
; of sgn are 0 and 256.
;-----------------------------------------------------------


;-----------------------------------------------------------
; Decimal to binary conversion is governed by a format
; record defined in Pascal as:
;
;   TYPE
;       DecForm = record
;                     stsumacc/ws/tlasm/sysequ   444      0     12      121270  3472707201  10373 W^wd5P:H r^b}c8c8; File SYSEQU.TEXT - Macintosh system equates file.
;_______________________________________________________________________
;
;
; WRITTEN BY:  Bud Tribble        6-May-81
;
; All system routines include this equate file.
;
;   MODIFICATION HISTORY:
;
;      Integrate Lisagraf                              --  alo 23-Dec-81
;      Configured for Alpha release (one heap)         --  alo  5-Feb-82
;      Moved Lisagraf variables up to allow more room  --  alo 10-Feb-82
;      Added system base date & time variables         --  alo 13-Feb-82
;      Allowed 20 bytes for system parameter ram area  --  alo  1-Mar-82
;      Added ptr for SYSOUTFIB,SYSINFIB,SYSREFNUM(macpaslib)
;                                                      --  alo 1-Apr-82
;      Added SCC hardware addresses; removed 6551 stuff;
;      pulled MBSTATE and MBTICKS from kbd driver vars --  LAK 10-May-82
;      added SCC write reg 5 globals; clock-keyboard
;      synchronization flags . . .                     --  LAK 27-May-82
;      got rid of VBL queue element "mode" word        --  LAK 04-Jun-82
;      changed KEYREPCOUNT to KEYREPTIME; added
;      procedural interface variables for key mapping  --  LAK 07-Jun-82
;      updated for 512-dots                            --  LAK 26-Aug-82
;      changed VIA addresses for timing problem        --  LAK 17-Sep-82
;      changed IWM addresses for better margin         --  LAK 23-Sep-82
;      updated to 384 current version (0.5D)           --  LAK 10-Oct-82
;      added FSInitDbg for Filler1 (sysinit, debug)    --  LAK 19-Oct-82
;      added TagData field for twiggy driver           --  LAK 01-Nov-82
;      added DrvInstalled field for twiggy driver;
;       changed WarmCold to TwiggyVars                 --  LAK 02-Nov-82
;      removed DrvInstalled field; removed FIB pointers,
;       and changed start of system heap; changed loader
;       variable area                                  --  LAK 18 Nov 82
;      added a compare string jump vector              --  LAK 10 Dec 82
;      changed driver definitons, etc.                 --  LAK 17 Dec 82
;      added VIA equates                               --  LAK 03 Jan 83
;      added new i/o param blk equates for new fs      --  LAK 17 Jan 83
;      added storage manager error codes               --  LAK 04 Feb 83
;      add disk cal switch error code                  --  LAK 05 Feb 83
;      added keyboard task vector in $124 (KybdTask);
;       broke error codes out into SysErr.Text
;       added LoadTrap lomem var                       --  LAK 16 Feb 83
;      put dispatch table where macsbug globals used
;       to be and moved down toolbox vars.             --  LAK 18 Feb 83
;      Added DSAlertTab pointer                        --  AJH 29 Mar 83
;      Added BootDrive field                           --  AJH 04 Apr 83
;      Added PollStack, PollProc, DskErr, DskRtnAdr    --  LAK 11 Apr 83
;      Added SonyVars,PWMBuf2                          --  LAK 17 Apr 83
;      Changed screen, PWM address for 512K proto      --  AJH 01 May 83
;      Added Resource def                              --  BJH 09 May 83
;      Added PWMValue                                  --  LAK 09 May 83
;      Added Heap check hooks                          --  MPH 10 May 83
;      Changed SCC addresses (high bits on)            --  LAK 25 May 83
;      Added DQFSID,
;       Stretched KeyPadMap to 8 bytes                 --  LAK 01 Jun 83
;      Added Mask constant, changed Heap check hooks   --  MPH 02 Jun 83
;      Added equates for MinStack, DefltStack for memory
;       manager; moved UnitEntries equate to StartInit;
;       added UnitNtryCnt lomem var instead.           --  LAK 16 Jun 83
;      Added "NoQueue" bit definition                  --  AJH 23 Jun 83
;      Added "CurIOTrap" (replacing "Filler3" )        --  AJH 26 Jun 83
;      Added "forTwiggy" conditional assembly switch   --  AJH 27 Jun 83
;      Cleaned up: changed unused vars to Fillerx equates;
;       changed ARdCmd,AWrCmd,ACtlCmd,AStsCmd to match
;       trap numbers . . .                             --  LAK 15 Jul 83
;      Added mmInOK for memory manager checking.       --  LAK 24 Jul 83
;      Added mmDefFlags for memory manager zone init.  --  LAK 31 Jul 83
;      Added DskVerify for disk driver verify/read flag
;        in place of DskDump                           --  LAK 06 Aug 83
;      Removed DNeedsStorage equate (no longer used)   --  LAK 08 Aug 83
;      Added Loader global definitions, no more SPBot  --  AJH 11 Aug 83
;      Added IWM lomem variable . . .                  --  LAK 15 Aug 83
;      Added EvtBufCnt, JCrsrTask, moved FinderName    --  LAK 17 Aug 83
;      Moved JCrsrTask to GrafEqu.                     --  LAK 18 Aug 83
;      Added scrap vars to $960  .                     --  SC  18 Aug 83
;      Added StkLowPt var for useful measurements.     --  LAK 19 Aug 83
;      Added DoubleTime and CaretTime                  --  SC  19 Aug 83
;      Added SPClikCaret to parameter ram              --  SC  19 Aug 83
;      Folded SPKbd stuff in parameter ram             --  SC  19 Aug 83
;      Corrected ROM size counts (RomBSize, RomWSize)  --  AJH 22 Aug 83
;      Added keyClick bit in parameter ram             --  AJH 11 Sep 83
;      Added GrowZone handle/pointer warnings          --  SC  12 Sep 83
;      Added Resource Manager equates                  --  BLH 22 Sep 83
;      Added 16 bytes of printing globals              --  AJH 30 Sep 83
;      Added desk ornament message equates,changed events  AJH 08 Oct 83
;      Added DQDrvSize                                 --  LAK 02 Nov 83
;      Added equates for JGNEFilter, ScrDmpEnb, ScrDmpType LAK 09 Nov 83
;      Added ScreenRow                              -- AJH/WDA 10 Nov 83
;      Added equates for DSAlertRect, DSDrawProc,
;        EjectNotify, CoreEditVars, QDExist,
;        WWExist and JShell                            --  LAK 16 Nov 83
;      Added equate for AlarmState                     --  LAK 22 Nov 83
;      Added equate for InitApplZone notify proc       --  LAK 06 Dec 83
;      Added equates for screen vertical, horiz res    --  LAK 19 Dec 83
;      Added NeedsGoodBye                              --  AJH 03 Jan 84
;      Added SysVersion                                --  AJH 06 Jan 84
;      Added DSWndUpdate, SEvtEnb flags                --  LAK 11 Jan 84
;      Added FontFlag for font manager bug fix         --  AJH 12 Jan 84
;______________________________________________________________________

;_______________________________________________________________________
;
;                   System Low Memory Layout
;
;        0000-00FF     Exception Vectors defined by the hardware
;        0100-0340     System Communications Area
;        0340-03FF     File System globals (172 bytes used)
;        0400-07FF     system core routine/LisaGraf/ToolBox dispatch table
;        0800-08FF     Mouse/Cursor low-memory globals
;        0900-097F     more os stuff
;        0980-0AFF     toolbox variables
;        0B00-XXXX     Start of system heap
;
;    Some other important system data structures are allocated on the heap
;
;_______________________________________________________________________

; conditional assembly switch to select Twiggy or Sony

forTwiggy   .EQU    0

;_______________________________________________________________________
;
; System Constants
;_______________________________________________________________________

; Device Equates

;   note -- all screen and sound addresses are for the 512K Mac,
;   which will also work for the 128K machine since the address
;   space wraps

ScreenLow       .EQU    $0007A700           ; top of screen screen address
SoundLow        .EQU    $0007FD00           ; low sound buffer address
PWMBuffer       .EQU    $0007FD01           ; PWM bytes are low bytes
SndBufWLen      .EQU    $0172               ; sound/disk buffer word length
OvlyRAM         .EQU    $00600000           ; low RAM address when overlay is on
OvlyScreen      .EQU    $0067A700           ; top of screen with overlay

ROMStart        .EQU    $00400000           ; starting address of ROM code
ROMWSize        .EQU    $00008000           ; 32768 words in present ROM
ROMBSize        .EQU    $00010000           ; 65536 bytes in present ROM
MemLSize        .EQU    $00008000           ; memory contains 32K long words
MemWSize        .EQU    $00010000           ; 64K words
MemBSize        .EQU    $00020000           ; and 128K bytes
LineLen         .EQU    $40                 ; horizontal screen line has 64 bytes

; VIA (6522)
; Absolute Addresses

VBase           .EQU    $EFE1FE             ; base address
AVBufB          .EQU    VBase               ; buffer B
AVBufA          .EQU    $EFFFFE             ; buffer A
AVBufM          .EQU    AVBufB              ; buffer with mouse button bit
AVIFR           .EQU    $EFFBFE             ; interrupt flag register
AVIER           .EQU    $EFFDFE             ; interrupt enable register

; Offsets

VBufB           .EQU    512*0               ; BUFFER B
VBufAH          .EQU    512*1               ; buffer a (with handshake) [ Dont use! ]
VDIRB           .EQU    512*2               ; DIRECTION B
VDIRA           .EQU    512*3               ; DIRECTION A
VT1C            .EQU    512*4               ; TIMER 1 COUNTER (L.O.)
VT1CH           .EQU    512*5               ; timer 1 counter (high order)
VT1L            .EQU    512*6               ; TIMER 1 LATCH (L.O.)
VT1LH           .EQU    512*7               ; timer 1 latch (high order)
VT2C            .EQU    512*8               ; TIMER 2 LATCH (L.O.)
VT2CH           .EQU    512*9               ; timer 2 counter (high order)
VSR             .EQU    512*10              ; SHIFT REGISTER
VACR            .EQU    512*11              ; AUX. CONTROL REG.
VPCR            .EQU    512*12              ; PERIPH. CONTROL REG.
VIFR            .EQU    512*13              ; INT. FLAG REG.
VIER            .EQU    512*14              ; INT. ENABLE REG.
VBufA           .EQU    512*15              ; BUFFER A

VBufD           .EQU    VBufA               ; disk head select buffer

; Buffer A:

VAOut           .EQU    $7F                 ; VBufA output bits
VAInit          .EQU    $7B                 ; VBufA initial values med. volume
VSound          .EQU    $07                 ; sound volume bits
VSndPg2         .EQU    3                   ; select sound page 2 if 0
VOverlay        .EQU    4                   ; overlay bit (overlay when 1)
VHeadSel        .EQU    5
VPage2          .EQU    6                   ; select video page 2 if 0
VSCCWrReq       .EQU    7                   ; SCC write/request line

; Buffer B:

VBOut           .EQU    $87                 ; VBufB output bits
VBInit          .EQU    $07                 ; VBufB initial values
RTCData         .EQU    0
RTCClk          .EQU    1
RTCEnb          .EQU    2                   ; enabled when 0
VSW             .EQU    3                   ; mouse switch (0 when down)
VX2             .EQU    4                   ; mouse X level
VY2             .EQU    5                   ; mouse Y level
VH4             .EQU    6                   ; horizontal sync
VSndEnb         .EQU    7                   ; /sound enable (reset when 1)

; note: CA1 = VSync
;       CA2 = 1 sec clock
;       CB1,CB2 are keyboard interface.

;_______________________________________________________________________
;
; SCC SERIAL CHIP ADDRESSES

SCCRBase        .EQU    $9FFFF8             ; SCC base read address
SCCWBase        .EQU    $BFFFF9             ; SCC base write address

AData           .EQU    6                   ; offset for A channel data
ACtl            .EQU    2                   ; offset for A channel control
BData           .EQU    4                   ; offset for B channel data
BCtl            .EQU    0                   ; offset for B channel control

SCCData         .EQU    4                   ; general offset for data from control
SCCWrite        .EQU    $200001             ; general offset for write from read

RxBF            .EQU    0                   ; SCC receive buffer full
TxBE            .EQU    2                   ; SCC transmit buffer empty

;_______________________________________________________________________
;
; DISK ADDRESS

DBase           .EQU    $DFE1FF             ; disk address base
DPh0L           .EQU    DBase               ; phase 0 low
DPh0H           .EQU    $DFE3FF             ; phase 0 high
DMtrOff         .EQU    $DFF1FF             ; IWM Motor off
DMtrOn          .EQU    $DFF3FF             ; IWM Motor on
DiskQ6L         .EQU    $DFF9FF             ; shift register
DiskQ6H         .EQU    $DFFBFF
DiskQ7L         .EQU    $DFFDFF
DiskQ7H         .EQU    $DFFFFF

Ph0L            .EQU    512*0               ; disk address offsets from base
Ph0H            .EQU    512*1
Ph1L            .EQU    512*2
Ph1H            .EQU    512*3
Ph2L            .EQU    512*4
Ph2H            .EQU    512*5
Ph3L            .EQU    512*6
Ph3H            .EQU    512*7

MtrOff          .EQU    512*8
MtrOn           .EQU    512*9
IntDrive        .EQU    512*10              ; enable internal drive address
ExtDrive        .EQU    512*11              ; enable external drive address
Q6L             .EQU    512*12
Q6H             .EQU    512*13
Q7L             .EQU    512*14
Q7H             .EQU    512*15

;_______________________________________________________________________
;
;  Interrupt Auto-vector and Exception Definitions
;_______________________________________________________________________

LINE1010        .EQU    $28                 ; 1010 emulator trap (system routines)
LINE1111        .EQU    $2C                 ; 1111 emulator trap (reserved)
AUTOINT1        .EQU    $64                 ; level 1 auto-vector
AUTOINT2        .EQU    $68                 ; level 2 auto-vector
AUTOINT3        .EQU    $6C                 ; level 3 auto-vector
AUTOINT4        .EQU    $70                 ; level 4 auto-vector
AUTOINT5        .EQU    $74                 ; level 5 auto-vector
AUTOINT6        .EQU    $78                 ; level 6 auto-vector
AUTOINT7        .EQU    $7C                 ; level 7 auto-vector

;_______________________________________________________________________
;
; SYSCOM Equates (System Communication Area)
;_______________________________________________________________________

SysCom          .EQU    $100            ; start of system communication area

; SYSTEM LOCATIONS

MonkeyLives     .EQU    $100            ; monkey lives if >= 0
ScrVRes         .EQU    $102            ; screen vertical resolution (dots/inch)
ScrHRes         .EQU    $104            ; screen horizontal resolution (dots/inch)
ScreenRow       .EQU    $106            ; rowBytes of Mac screen
MemTop          .EQU    $108            ; Ptr to top of memory
BufPtr          .EQU    $10C            ; Ptr to bottom of code buffer
StkLowPt        .EQU    $110            ; Lowest stack as measured in VBL task
HeapEnd         .EQU    $114            ; Ptr to end of heap
TheZone         .EQU    $118            ; Ptr to current heap zone
UTableBase      .EQU    $11C            ; Ptr to unit I/O table
MacJmp          .EQU    $120            ; Ptr to MACSBUG jumptable

DskRtnAdr       .EQU    $124            ; temp for disk driver
TwiggyVars      .EQU    $128            ; Ptr to twiggy driver locals
DskVerify       .EQU    $12C            ; used by sony driver for read/verify
LoadTrap        .EQU    $12D            ; set to non-zero to trap before pgm strt
mmInOK          .EQU    $12E            ; non-zero when initial mem mngr cks ok
DskWr11         .EQU    $12F            ; try 1-1 disk writes when non-zero
ApplLimit       .EQU    $130            ;

SonyVars        .EQU    ApplLimit+4     ; pointer to 3-1/2 disk driver vars
PWMValue        .EQU    SonyVars+4      ; current PWM value
PollStack       .EQU    PWMValue+2      ; SCC poll data start stack location
PollProc        .EQU    PollStack+4     ; proc which handles SCC poll data
DskErr          .EQU    PollProc+4      ; disk routine result code

SysEvtMask      .EQU    DskErr+2        ; System event mask
SysEvtBuf       .EQU    SysEvtMask+2    ; Ptr to system event queue element buffer
EventQueue      .EQU    SysEvtBuf+4     ; 5 words, event queue header
EvtBufCnt       .EQU    EventQueue+10   ; max number of events in SysEvtBuf - 1

RndSeed         .EQU    EvtBufCnt+2
SysVersion      .EQU    RndSeed+4       ; version # of RAM-based system
SEvtEnb         .EQU    SysVersion+2    ; 1 byte: 0 disables SysEvent calls from GNE
DSWndUpdate     .EQU    SEvtEnb+1       ; 1 byte: 0 flags GNE to paintBehind DS AlertRect
FontFlag        .EQU    DSWndUpdate+1   ; boolean for font manager bug
Filler3         .EQU    FontFlag+1      ; 1 byte of filler

VBLQueue        .EQU    Filler3+1       ; 5 words, VBL queue header
Ticks           .EQU    VBLQueue+10     ; Tick count, time since boot in 1/60 increments
MBTicks         .EQU    Ticks+4         ; tick count when mouse button last changed
MBState         .EQU    MBTicks+4       ; current mouse button state
Tocks           .EQU    MBState+1       ; Lisa sub-tick count

KeyMap          .EQU    MBState+2       ; 2 longs, a bitmap of the keyboard
KeypadMap       .EQU    KeyMap+8        ; 1 long, a bitmap for numeric pad-18bits
KeyLast         .EQU    KeypadMap+8     ; lo byte: ASCII for last valid keycode
                                        ; hi byte: last valid keycode
                                        ; these are 0 when no key is down
KeyTime         .EQU    KeyLast+2       ; long tickcount when KEYLAST was rec'd
KeyRepTime      .EQU    KeyTime+4       ; long tickcount when key was last repeated
KeyThresh       .EQU    KeyRepTime+4    ; word containing threshold for repeat
KeyRepThresh    .EQU    KeyThresh+2     ; word containing repeat speed

Lvl1DT          .EQU    KeyRepThresh+2  ; Interrupt level 1 dispatch table
Lvl2DT          .EQU    Lvl1DT+32       ; Interrupt level 2 dispatch table

UnitNtryCnt     .EQU    Lvl2DT+32       ; count of entries in unit table
VIA             .EQU    UnitNtryCnt+2   ; VIA base address (use low memory addresses)
SCCRd           .EQU    VIA+4           ; SCC base read address (to save code space)
SCCWr           .EQU    SCCRd+4         ; SCC base write address
IWM             .EQU    SCCWr+4         ; IWM base address

GetParam        .EQU    IWM+4           ; Parameter blk for reading sys parameter area

SysParam        .EQU    GetParam+20     ; 20 bytes of system parameter area
SPValid         .EQU    SysParam        ; byte 1  = validation field ($A7)
SPOdometer      .EQU    SPValid+1       ;    2-4  = odometer
SPPortA         .EQU    SPOdometer+3    ;    5-6  = SCC port A configuration
SPPortB         .EQU    SPPortA+2       ;    7-8  = SCC port B configuration
SPAlarm         .EQU    SPPortB+2       ;    9-12 = alarm time
SPFont          .EQU    SPAlarm+4       ;   13-14 = default font id
SPKbd           .EQU    SPFont+2        ;      15 = kbd repeat thresh in 4/60ths(4)
                                        ;           kbd repeat rates in 2/60ths(4)
SPPrint         .EQU    SPKbd+1         ;      16 = print stuff
SPVolCtl        .EQU    SPPrint+1       ;      17 = volume control (low 3 bits)
SPClikCaret     .EQU    SPVolCtl+1      ;      18 = double time in 4/60ths(4)
                                        ;           caret blink time in 4/60ths(4)
SPMisc1         .EQU    SPClikCaret+1   ;      19 = english/metric (1),
                                        ;           extra (2),
                                        ;           country code (5)
SPMisc2         .EQU    SPMisc1+1       ;      20 = paranoia level (1), mouse
                                        ;           scaling(1), keyClick (1), boot
                                        ;           disk (1), menu flash (2), help
                                        ;           level (2)
Time            .EQU    SysParam+20     ; clock time when last read (extrapolated)
BootDrive       .EQU    Time+4          ; drive number of boot drive

JShell          .EQU    Time+6          ; used by journaling shell . . .
Filler3A        .EQU    JShell+2        ; used by standard file

KbdVars         .EQU    Filler3A+2      ; Keyboard manager variables (4 bytes)
JKybdTask       .EQU    KbdVars+4       ; keyboard VBL task hook
KbdType         .EQU    JKybdTask+4     ; high byte holds keyboard model number
AlarmState      .EQU    KbdType+1       ; Bit7=parity, Bit6=beeped, Bit0=1=enabled

CurIOTrap       .EQU    KbdType+2       ; trap the caused current IO transaction

DiskVars        .EQU    CurIOTrap+2     ; Disk driver variables (62 bytes)

SdVolume        .EQU    DiskVars+62     ; Global volume control (1 byte)
SdEnable        .EQU    SdVolume+1      ; byte to enable 4 voice engine
SoundVars       .EQU    SdEnable+1      ; Sound driver variables (really only 20 bytes)

SoundPtr        .EQU    SoundVars       ;pointer to 4VE sound definition table
SoundBase       .EQU    SoundPtr+4      ;base address of sound bitMap
SoundVBL        .EQU    SoundBase+4     ;vertical retrace control element
SoundDCE        .EQU    SoundVBL+16     ;pointer to sound driver DCE
SoundActive     .EQU    SoundDCE+4      ;boolean specifying if sound is enabled
SoundLevel      .EQU    SoundActive+1   ;byte specifying current level in buffer
CurPitch        .EQU    SoundLevel+1    ;word holding current pitch value

SoundLast       .EQU    CurPitch+2      ;address past last sound variable

ScreenVars      .EQU    SoundVars+48    ; Screen driver variables

JGNEFilter      .EQU    ScreenVars+8    ; GetNextEvent filter proc

Key1Trans       .EQU    JGNEFilter+4    ; pointer to procedure handling keyboard
                                        ;  key translation
Key2Trans       .EQU    Key1Trans+4     ; pointer to procedure handling numeric
                                        ;  keypad key translation
SysZone         .EQU    Key2Trans+4     ; pointer to system heap zone
ApplZone        .EQU    SysZone+4       ; pointer to application heap zone
ROMBase         .EQU    ApplZone+4      ; start of ROM addresses (jump table?)
RAMBase         .EQU    ROMBase+4       ; start of RAM addresses
BasicGlob       .EQU    RAMBase+4       ; pointer to Basic globals
DSAlertTab      .EQU    BasicGlob+4     ; pointer to deep shit alerts
ExtStsDT        .EQU    DSAlertTab+4    ; SCC ext/sts secondary dispatch table
SCCASts         .EQU    ExtStsDT+16     ; SCC read reg 0 last ext/sts rupt - A
SCCBSts         .EQU    SCCASts+1       ; SCC read reg 0 last ext/sts rupt - B
SerialVars      .EQU    SCCBSts+1       ; async driver variables
FinderName      .EQU    SerialVars+16   ; 16 byte name of Finder
doubleTime      .EQU    FinderName+16   ; double click time(Set up by boot blocks)
caretTime       .EQU    doubleTime+4    ; caret blink time
ScrDmpEnb       .EQU    caretTime+4     ; screen dump enabled when non-zero
ScrDmpType      .EQU    ScrDmpEnb+1     ; FF dumps screen, FE dumps front window
TagData         .EQU    ScrDmpType+1    ; sector tag info for twiggy drivers
DrvQHdr         .EQU    TagData+14      ; queue header of drive numbers in system
PWMBuf2         .EQU    DrvQHdr+10      ; pointer to PWM buffer 1 (or 2 if sound
                                        ;  buffer 2 is being used)
HpChk           .EQU    PWMBuf2+4       ; Points to heap check RAM code
MaskBC          .EQU    HpChk+4         ; Memory Manager Byte Count Mask
MaskHandle      .EQU    MaskBC          ; Memory Manager Handle Mask
MaskPtr         .EQU    MaskBC          ; Memory Manager Pointer Mask
MinStack        .EQU    MaskBC+4        ; min stack size (1024) used in InitApplZone
DefltStack      .EQU    MinStack+4      ; default size of stack (for growing AZone)
mmDefFlags      .EQU    DefltStack+4    ; default zone flags
GZRootHnd       .EQU    mmDefFlags+2    ; root handle for GrowZone
GZRootPtr       .EQU    GZRootHnd+4     ; root pointer for GrowZone
GZMoveHnd       .EQU    GZRootPtr+4     ; moving handle for GrowZone
DSDrawProc      .EQU    GZMoveHnd+4     ; alternate deepshit box draw proc
EjectNotify     .EQU    DSDrawProc+4    ; proc to call and notify upon ejects
IAZNotify       .EQU    EjectNotify+4   ; proc to call and notify upon world swaps
endofvars       .EQU    IAZNotify+4     ; end of final defined vars

;_______________________________________________________________________
;
; The File System local variables are kept from $340 to $3FF
;_______________________________________________________________________

FileVars    .EQU    $340                ;
DSAlertRect .EQU    $3F8                ; rectangle for disk-switch alert

;_______________________________________________________________________
;
;   System Core Routine Dispatch Table resides from $400-$7FF.  The user
;   can intercept any core routine by changing these pointers.
;_______________________________________________________________________

DispatchTab     .EQU    $400

;_______________________________________________________________________
;
;    The cursor jump table interface and cursor state variables start at $800
;    For their definitions, see the file "GRAFEQU.TEXT". Starting at $8FC and
;    working down we have addresses of OS routines which are not accessed
;    through traps.
;_______________________________________________________________________

WWExist         .EQU    $8F2            ; zero when window manager is initialized
QDExist         .EQU    $8F3            ; zero when quickdraw is initialized
JFetch          .EQU    $8F4            ; fetch a byte routine for I/O drivers
JStash          .EQU    $8F8            ; stash a byte routine for I/O drivers
JIODone         .EQU    $8FC            ; IODone entry location


LoadVars        .EQU    $900            ; loader variables

; low-memory Loader globals

CurApRefNum    .EQU      LoadVars            ; refNum of current resFile
LaunchFlag     .EQU      CurApRefNum+2       ; boolean to distinguish launch/chain
CurrentA5      .EQU      LaunchFlag+2        ; current value of A5
CurStackBase   .EQU      CurrentA5+4         ; current stack base
LoadFiller     .EQU      CurStackBase+4      ; empty for now...
CurApName      .EQU      LoadFiller+4        ; place to save name of application
SaveSegHandle  .EQU      CurApName+32        ; place to save seg 0 handle
CurJTOffset    .EQU      SaveSegHandle+4     ; word for current jump table offset
CurPageOption  .EQU      CurJTOffset+2       ; current page 2 configuration word
LoaderPBlock   .EQU      CurPageOption+4     ; param block for internal ExitToShell
LastLGlobal    .EQU      LoaderPBlock+10     ; address past last loader global

PrintVars      .EQU      LastLGlobal         ; 16 bytes for Owen
LastPGlobal    .EQU      PrintVars+16        ; address of last global
CoreEditVars   .EQU      LastPGlobal         ; 12 bytes for core edit

; Low memory vars for the scrap manager

scrapVars   .EQU        $960

scrapInfo   .EQU        scrapVars               ; scrap info
scrapHandle .EQU        scrapInfo+4             ; handle to memory scrap
scrapCount  .EQU        scrapHandle+4           ; validation byte
scrapState  .EQU        scrapCount+2            ; state of scrap defined below
scrapName   .EQU        scrapState+2            ; pointer to scrap name
scrapTag    .EQU        scrapName+4             ; actual name goes here
scrapEnd    .EQU        scrapTag+16             ; end of scrap vars


ToolVars        .EQU    $980            ; toolbox variables

;_______________________________________________________________________
;
; Finally, we have the start of the heap.  Note that some important system
; tables are kept on the heap.
;
;_______________________________________________________________________

HeapStart       .EQU    $0B00           ; start of the heap

;_______________________________________________________________________
;
; System Data Structures
;
;_______________________________________________________________________

Lock            .EQU    7           ; lock bit in a master pointer
Purge           .EQU    6           ; bit for purgeable/unpurgeable
Resource        .EQU    5           ; bit to flag a resource handle

; Queue Header Definition

QHeadSize       .EQU    10          ; A queue header is 10 bytes long

QFlags          .EQU    0           ; misc. flags
QHead           .EQU    2           ; 32-bit ptr to first element
QTail           .EQU    6           ; 32-bit ptr to last element
QInUse          .EQU    7           ; queue-in-use flag bit

; Queue Element Type Definitions

VType           .EQU    1           ; VBL queue element is type 1
IOQType         .EQU    2           ; I/O queue element is type 2
TimerType       .EQU    3           ; timer queue element is type 3
EvType          .EQU    4           ; event queue element is type 4
FSQType         .EQU    5           ; File System VCB element

; General Purpose Queue Element Definition

QLink           .EQU    0           ; link to next queue element
QType           .EQU    4           ; queue element type

; Drive queue element offsets

DQElLnth    .EQU    12              ; drive queue element length including hdr
;change to 14 except for sony driver!
DQDrive     .EQU    6               ; drive number
DQRefNum    .EQU    8               ; driver refnum
DQFSID      .EQU    10              ; file system handling this drive
DQDrvSize   .EQU    12              ; number of blocks this drive

; Unit Table Definition -- there is one entry in the unit table for each
; logical driver.  The number of entries is hardwired to 16.  Each entry consists
; of one 32-bit memory handle; the first entry corresponds to RefNum -1, the
; last to RefNum -32.  The Unit Table is made during sysInit time and is
; allocated from permanent system memory; lo-memory location UTableBase points
; to the table. UnitNtryCnt is initialized to UnitEntries by StartInit: all
; other code should use this low mem variable.

; Device Control Entry Definition: for each Unit Table Entry, one driver may be
; installed.  If the driver is installed, the corresponding memory handle in the
; unit table will be the handle of a Device Control Entry.

DCtlEntrySize   .EQU    40          ; each entry is 40 bytes long

DCtlDriver      .EQU    0           ; offset of pointer to driver
DCtlFlags       .EQU    4           ; offset of flags word
DCtlQueue       .EQU    6           ; offset of queue header
DCtlQHead       .EQU    8           ; offset of queue first-element pointer
DCtlQTail       .EQU    12          ; offset of queue last-element pointer
DCtlPosition    .EQU    16          ; offset of longword position pointer
DCtlStorage     .EQU    20          ; handle of driver's private storage
DCtlRefNum      .EQU    24          ; refNum of this driver
DCtlCurTicks    .EQU    26          ; long counter for timing systemTask calls
DCtlWindow      .EQU    30          ; pointer to driver's window (if any)
DCtlDelay       .EQU    34          ; word for number of ticks between sysTask calls
DCtlEMask       .EQU    36          ; word for desk ornament event mask
DCtlMenu        .EQU    38          ; word for menu associated with driver

; Vertical Blanking Control Block Queue Element

VBLINK          .EQU    0           ; LINK TO NEXT ELEMENT
VBLTYPE         .EQU    4           ; UNIQUE ID FOR VALIDITY CHECK
VBLADDR         .EQU    6           ; ADDRESS OF SERVICE ROUTINE
VBLCOUNT        .EQU    10          ; COUNT FIELD FOR TIMEOUT
VBLPHASE        .EQU    12          ; PHASE TO ALLOW SYNCHRONIZATION
;
INVBL           .EQU    6           ; bit index for "in VBL" flag


; Driver Format Definitions

DrvrFlags       .EQU     0          ; various flags and permissions
DrvrDelay       .EQU     2          ; word indicating # of ticks between systask calls
DrvrEMask       .EQU     4          ; word indicating what events to accept
DrvrMenu        .EQU     6          ; word indicating driver menu ID
DrvrOpen        .EQU     8          ; word offset to open routine
DrvrPrime       .EQU    10          ; word offset to prime routine
DrvrCtl         .EQU    12          ; word offset to control routine
DrvrStatus      .EQU    14          ; word offset to status routine
DrvrClose       .EQU    16          ; word offset to warmstart reset routine
DrvrName        .EQU    18          ; length byte and name of driver

; Driver Flags Word Bit Field Definitions

DReadEnable     .EQU    0           ; driver enabled for read operations
DWritEnable     .EQU    1           ; driver enabled for writing
DCtlEnable      .EQU    2           ; driver enabled for control operations
DStatEnable     .EQU    3           ; driver enabled for status operations
DNeedGoodBye    .EQU    4           ; driver needs a "goodbye kiss"
DNeedTime       .EQU    5           ; driver needs "main thread" time
DNeedLock       .EQU    6           ; driver needs to be accessed at interrupt level

; Run-Time Flags (in DCtlFlags+1)

DOpened         .EQU    5           ; flag to mark driver 'Open'
DRAMBased       .EQU    6           ; 1=RAM-based Driver, 0=ROM-based
DrvrActive      .EQU    7           ; flag to mark the driver active

; Desk Ornament Message Definitions

accEvent        .EQU    64          ; feedEvent message
accRun          .EQU    65          ; SystemTask "run" message
accCursor       .EQU    66          ; cursor message for topMost window
accMenu         .EQU    67          ; menu message
accCut          .EQU    68          ; cut message from system edit
accCopy         .EQU    69          ; copy message from system edit
accPaste        .EQU    70          ; paste message from system edit
accUndo         .EQU    71          ; undo message from system edit
accClear        .EQU    72          ; clear message from system edit


;  General system equates:

IOQElSize   .EQU    50          ; length of I/O parameter block

IOLink      .EQU    0           ; queue link in header
IOType      .EQU    4           ; type byte for safety check
IOTrap      .EQU    6           ; FS: the Trap
IOCmdAddr   .EQU    8           ; FS: address to dispatch to

IOCompletion .EQU   12          ; long pointer to completion routine
IOResult    .EQU    16          ; IO result code (=D0 if sync call)

IOFileName  .EQU    18          ; file name pointer
IOVRefNum   .EQU    22          ; volume refnum
IODrvNum    .EQU    IOVRefNum   ; (used for Eject and MountVol)
IORefNum    .EQU    24          ; reference number for I/O operation

IOFileType  .EQU    26          ; specified along with FileName (byte)
IOPermssn   .EQU    27          ; Open: permissions (byte)

IONewName   .EQU    28          ; Rename: new name pointer (4)
IOLEOF      .EQU    28          ; GetEOF,SetEOF: logical end-of-file (4)
IOOwnBuf    .EQU    28          ; Open: optional ptr to locked 522-byte buffer
IONewType   .EQU    28          ; SetFileType: new type byte (1)

IOBuffer    .EQU    32          ; data buffer pointer
IOByteCount .EQU    36          ; requested byte count
IOReqCount  .EQU    36          ; (equate used by file system Allocate)
IONumDone   .EQU    40          ; actual byte count completed
IOActCount  .EQU    40          ; (equate used by file system Allocate)

IOPosMode   .EQU    44          ; initial file positioning mode, eol char
IOPosOffset .EQU    46          ; file position offset (long word)

NoQueueBit  .EQU    9           ; tells I/O system not to queue the request
AsynTrpBit  .EQU    10          ; bit in high byte of trap specifying async

; equates specific to  GetFileInfo,SetFileInfo

IOFQElSize  .EQU    80          ; File command parameter block byte length
                                ; 1st 28 bytes are the same as the general block
IOFDirIndex .EQU    28          ; GetFileInfo - directory index
IOFlAttrib  .EQU    30          ; GetFileInfo - in-use bit=7, lock bit=0
IOFFlType   .EQU    31          ;  file type
IOFlUsrWds  .EQU    32          ; Get, SetFileInfo - user info (16 bytes)
IOFFlNum    .EQU    48          ; GetFileInfo - file number

IOFlStBlk   .EQU    52          ; GetFileInfo - Start file block (0000 if none)
IOFlLgLen   .EQU    54          ;  File logical length (EOF)
IOFlPyLen   .EQU    58          ;  File physical length in bytes.
IOFlRStBlk  .EQU    62          ;  Start file block, resource fork (0000 if none)
IOFlRLgLen  .EQU    64          ;  File logical length (EOF), resource fork
IOFlRPyLen  .EQU    68          ;  File physical length, resource fork

IOFlCrDat   .EQU    72          ;  File creation date & time (32 bits in seconds)
IOFlMdDat   .EQU    76          ;  last modification date & time (32 bits in seconds)

; equates specific to GetVolInfo,GetVolume,SetVolume,MountVol,UnmountVol,Eject

IOVQElSize  .EQU    64          ; Volume command parameter block byte length
IOVDrvNum   .EQU    IOVRefNum   ; 1st 28 bytes are the same as the general block
IOVNPtr     .EQU    IOFileName
IOVolIndex  .EQU    28          ; GetVol: volume index number

IOVCrDate   .EQU    30          ; GetVolInfo: creation date & time
IOVLsBkUp   .EQU    34          ; GetVolInfo: last backup date & time
IOVAtrb     .EQU    38          ; GetVolInfo: Volume attributes
IOVNmFls    .EQU    40          ; GetVolInfo: # files in directory
IOVDirSt    .EQU    42          ; GetVolInfo: start block of file dir
IOVBlLn     .EQU    44          ; GetVolInfo: length of dir in blocks
IOVNmAlBlks .EQU    46          ; GetVolInfo: num blks (of alloc size) this dev
IOVAlBlkSiz .EQU    48          ; GetVolInfo: alloc blk byte size
IOVClpSiz   .EQU    52          ; GetVolInfo: bytes to try to allocate at a time
IOAlBlSt    .EQU    56          ; starting diskette (512-byte) block in block map
IOVNxtFNum  .EQU    58          ; GetVolInfo: next free file number
IOVFrBlk    .EQU    62          ; GetVolInfo: word of # free alloc blks for this vol

; I/O Command Equates for I/O Queue Elements (match trap numbers)

ARdCmd      .EQU    2           ; read command
AWrCmd      .EQU    3           ; write command
ACtlCmd     .EQU    4           ; control command
AStsCmd     .EQU    5           ; status command

; special offsets for the control and status core routines

CSCode      .EQU   26           ; a word for the control/status code
CSParam     .EQU   28           ; operation-defined parameters (20-bytes max)

; System Event Definitions

NullEvt         .EQU    0           ; event 0 is the null event
MButDwnEvt      .EQU    1           ; mouse button down is event 1
MButUpEvt       .EQU    2           ; mouse button up is event 2
KeyDwnEvt       .EQU    3           ; key down is event 3
KeyUpEvt        .EQU    4           ; key up is event 4
AutoKeyEvt      .EQU    5           ; auto-repeated key is event 5
UpdatEvt        .EQU    6           ; update event
DiskInsertEvt   .EQU    7           ; disk-inserted event
ActivateEvt     .EQU    8           ; activate/deactive event
AbortEvt        .EQU    9           ; abort?
NetWorkEvt      .EQU    10          ; network event
ReserveEvt      .EQU    10          ; reserved for system use
IODrvrEvt       .EQU    11          ; driver-defined event

App1Evt         .EQU    12          ; application defined events
App2Evt         .EQU    13
App3Evt         .EQU    14
App4Evt         .EQU    15

; Event Record Definition

EvtMax          .EQU    30          ; maximum number of events in buffer
EvtBlkSize      .EQU    16          ; size in bytes of the event record
EvtQBlkSize     .EQU    EvtBlkSize+6; size of event record counting queue info

EvtNum          .EQU    0           ; word containing ID number of event
EvtMessage      .EQU    2           ; longword containing event-defined msg
EvtTicks        .EQU    6           ; longword holding TICKS when event occured
EvtMouse        .EQU    10          ; longword holding mouse pos when event occured
EvtMeta         .EQU    14          ; byte containing meta key flags
EvtMBut         .EQU    15          ; byte indicating state of mouse button

; system device constants

DskRfN      .EQU    $FFFB   ; disk's reference number

; Control Call Codes

EjectCode   .EQU    7       ; control call eject code
KillCode    .EQU    1       ; KillIO code

; Status Call Codes

DrvStsCode  .EQU    8       ; status call code for drive status

; Resource Manager Equates

; High bits of the Locn long-word--the resource attributes:
; (Code optimization used frequently is a TST.B RAttr(A2) instead
; of BTST #ResSysRef, RAttr(A2).  This saves a lot of bytes
; in RMgr)

ResSysRef       .EQU    7               ; reference to system/local reference
ResSysHeap      .EQU    6               ; In system/in application heap
ResPurgeable    .EQU    5               ; Purgeable/not purgeable
ResLocked       .EQU    4               ; Locked/not locked
ResProtected    .EQU    3               ; Protected/not protected
ResPreload      .EQU    2               ; Read in on openResource?
ResChanged      .EQU    1               ; Existing resource changed since last update
ResUser         .EQU    0               ; User defined resource attribute.

; When reading/writing, clear resChanged bit.

RCBMask         .EQU    $FD             ; ResChanged, byte mask AND.

; MAttr map attributes and masks

MapReadOnly     .EQU    7               ; is this file read-only?
MapCompact      .EQU    6               ; Is a compact necessary?
MapChanged      .EQU    5               ; Is it necessary to write map?

MCCMask         .EQU    $60             ; MapCompact + MapChanged
MChMask         .EQU    $20             ; MapChanged
MCoMask         .EQU    $40             ; MapCompact



       ; GetVolInfo: alloc blk byte size
IOVClpSiz   .EQU    52          ; GetVolInfo: bytes to try to allocate at a time
IOAlBlSt    .EQU    56          ; starting diskette (512-byte) block in block map
IOVNxtFNum  .EQU    58          ; GetVolInfo: next free file number
IOVFrBlk    .EQU    62          ; GetVolInfo: word of # sumacc/ws/tlasm/syserr   444      0     12       23037  3472707201  10353 3. "6F^4P:H r^33X; File SysErr.Text - Macintosh system error equates file.
;_________________________________________________________________
;
;
; All system routines reporting errors include this equate file.
;
; Modification History:
; 16 Feb 83  LAK  Broke out from SysEqu.Text
; 22 Feb 83  LAK  Added equates from SysUtil and Events.
; 10 May 83  MPH  Added new memory manager error codes.
; 07 Jun 83  LAK  Adjusted error codes for file system
; 15 Jun 83  AJH  Added Deep Shit Error Definitions
; 23 Jun 83  LAK  Added initIWMErr for sony driver.
; 18 Jul 83  LAK  Added more memory manager deep shit errors.
; 11 Aug 83  LAK  Added more disk driver error codes.
; 17 Aug 83  LAK  Added file system deep shit error code.
; 18 Aug 83  SC   Added scrap manager error codes.
; 19 Aug 83  LAK  Added stackinheap deep shit code.
; 21 Aug 83  LAK  Added SpdAdjErr, SeekErr, and SectNFErr for disk driver.
;                 Removed BadNybErr; moved clock/pram error codes up by 4.
; 23 Aug 83  LAK  Added NotOpenErr for drivers.
; 27 Aug 83  AJH  added memFull deep shit alert
; 06 Sep 83  AJH  added DSBadLaunch
; 22 Sep 83  BLH  Added Resource Mgr errors
; 10 Oct 83  LAK  Added NoErr equate
; 13 Oct 83  LAK  added NoErr, DSReInsert equates, DSNotThe1
;_________________________________________________________________

; General System Errors (VBL Mgr, Queueing, Etc.)

NoErr       .EQU     0      ; success is absence of errors
QErr        .EQU    -1      ; queue element not found during deletion
VTypErr     .EQU    -2      ; invalid queue element
CorErr      .EQU    -3      ; core routine number out of range
UnimpErr    .EQU    -4      ; unimplemented core routine

; I/O System Errors

ControlErr  .EQU    -17
StatusErr   .EQU    -18
ReadErr     .EQU    -19
WritErr     .EQU    -20
BadUnitErr  .EQU    -21
UnitEmptyErr .EQU   -22
OpenErr     .EQU    -23
ClosErr     .EQU    -24
DRemovErr   .EQU    -25     ; tried to remove an open driver
DInstErr    .EQU    -26     ; DrvrInstall couldn't find driver in resources
AbortErr    .EQU    -27     ; IO call aborted by KillIO
NotOpenErr  .EQU    -28     ; Couldn't rd/wr/ctl/sts cause driver not opened

;  File System error codes:

DirFulErr   .EQU    -33     ; Directory full
DskFulErr   .EQU    -34     ; disk full
NSVErr      .EQU    -35     ; no such volume
IOErr       .EQU    -36     ; I/O error (bummers)
BdNamErr    .EQU    -37     ; there may be no bad names in the final system!
FNOpnErr    .EQU    -38     ; File not open
EOFErr      .EQU    -39     ; End of file
PosErr      .EQU    -40     ; tried to position to before start of file (r/w)
MFulErr     .EQU    -41     ; memory full(open) or file won't fit (load)
TMFOErr     .EQU    -42     ; too many files open
FNFErr      .EQU    -43     ; File not found

WPrErr      .EQU    -44     ; diskette is write protected
FLckdErr    .EQU    -45     ; file is locked
VLckdErr    .EQU    -46     ; volume is locked
FBsyErr     .EQU    -47     ; File is busy (delete)
DupFNErr    .EQU    -48     ; duplicate filename (rename)
OpWrErr     .EQU    -49     ; file already open with with write permission
ParamErr    .EQU    -50     ; error in user parameter list
RFNumErr    .EQU    -51     ; refnum error
GFPErr      .EQU    -52     ; get file position error
VolOffLinErr .EQU   -53     ; volume not on line error (was Ejected)
PermErr     .EQU    -54     ; permissions error (on file open)
VolOnLinErr .EQU    -55     ; drive volume already on-line at MountVol
NSDrvErr    .EQU    -56     ; no such drive (tried to mount a bad drive num)
NoMacDskErr .EQU    -57     ; not a mac diskette (sig bytes are wrong)
ExtFSErr    .EQU    -58     ; volume in question belongs to an external fs
FSDSErr     .EQU    -59     ; file system deep s--t error:
                            ;  during rename the old entry was deleted but could
                            ;   not be restored . . .
BadMDBErr   .EQU    -60     ; bad master directory block
WrPermErr   .EQU    -61     ; write permissions error

; Disk, Serial Ports, Clock Specific Errors

NoDriveErr  .EQU    -64     ; drive not installed
OffLinErr   .EQU    -65     ; r/w requested for an off-line drive

NoNybErr    .EQU    -66     ; couldn't find 5 nybbles in 200 tries
NoAdrMkErr  .EQU    -67     ; couldn't find valid addr mark
DataVerErr  .EQU    -68     ; read verify compare failed
BadCkSmErr  .EQU    -69     ; addr mark checksum didn't check
BadBtSlpErr .EQU    -70     ; bad addr mark bit slip nibbles
NoDtaMkErr  .EQU    -71     ; couldn't find a data mark header
BadDCkSum   .EQU    -72     ; bad data mark checksum
BadDBtSlp   .EQU    -73     ; bad data mark bit slip nibbles
WrUnderRun  .EQU    -74     ; write underrun occurred

CantStepErr .EQU    -75     ; step handshake failed
Tk0BadErr   .EQU    -76     ; track 0 detect doesn't change
InitIWMErr  .EQU    -77     ; unable to initialize IWM
TwoSideErr  .EQU    -78     ; tried to read 2nd side on a 1-sided drive
SpdAdjErr   .EQU    -79     ; unable to correctly adjust disk speed
SeekErr     .EQU    -80     ; track number wrong on address mark
SectNFErr   .EQU    -81     ; sector number never found on a track

ClkRdErr    .EQU    -85     ; unable to read same clock value twice
ClkWrErr    .EQU    -86     ; time written did not verify
PRWrErr     .EQU    -87     ; parameter ram written didn't read-verify
PRInitErr   .EQU    -88     ; InitUtil found the parameter ram uninitialized

RcvrErr     .EQU    -89     ; SCC receiver error (framing, parity, OR)
BreakRecd   .EQU    -90     ; Break received (SCC)

; Storage allocator error codes

MemFullErr  .EQU    -108    ; Not enough room in heap zone
NilHandleErr .EQU   -109    ; Handle was NIL in HandleZone or other;
memWZErr    .EQU    -111    ; WhichZone failed (applied to free block);
memPurErr   .EQU    -112    ; trying to purge a locked or non-purgable block;

memAdrErr   .EQU    -110    ; address was odd, or out of range;
memAZErr    .EQU    -113    ; Address in zone check failed;
memPCErr    .EQU    -114    ; Pointer Check failed;
memBCErr    .EQU    -115    ; Block Check failed;
memSCErr    .EQU    -116    ; Size Check failed;

; Resource Manager error codes (other than I/O errors)

ResNotFound     .EQU    -192            ; Resource not found
ResFNotFound    .EQU    -193            ; Resource file not found
AddResFailed    .EQU    -194            ; AddResource failed
AddRefFailed    .EQU    -195            ; AddReference failed
RmvResFailed    .EQU    -196            ; RmveResource failed
RmvRefFailed    .EQU    -197            ; RmveReference failed

; Scrap Manager error codes

noScrapErr  .EQU    -100    ; No scrap exists error
noTypeErr   .EQU    -102    ; No object of that type in scrap


; Application Error Codes
;
;  errors -1024 to -4095 are reserved for use by the current application


;  Deep Shit Alert ID definitions

DSSysErr     .EQU   32767   ; general system error
DSBusError   .EQU   1       ; bus error
DSAddressErr .EQU   2       ; address error
DSIllInstErr .EQU   3       ; illegal instruction error
DSZeroDivErr .EQU   4       ; zero divide error
DSChkErr     .EQU   5       ; check trap error
DSOvFlowErr  .EQU   6       ; overflow trap error
DSPrivErr    .EQU   7       ; privelege violation error
DSTraceErr   .EQU   8       ; trace mode error
DSLineAErr   .EQU   9       ; line 1010 trap error
DSLineFErr   .EQU  10       ; line 1111 trap error
DSMiscErr    .EQU  11       ; miscellaneous hardware exception error
DSCoreErr    .EQU  12       ; unimplemented core routine error
DSIrqErr     .EQU  13       ; uninstalled interrupt error

DSIOCoreErr  .EQU  14       ; IO Core Error
DSLoadErr    .EQU  15       ; Segment Loader Error
DSFPErr      .EQU  16       ; Floating point error

DSNoPackErr  .EQU  17       ; package 0 not present
DSNoPk1      .EQU  18       ; package 1 not present
DSNoPk2      .EQU  19       ; package 2 not present
DSNoPk3      .EQU  20       ; package 3 not present
DSNoPk4      .EQU  21       ; package 4 not present
DSNoPk5      .EQU  22       ; package 5 not present
DSNoPk6      .EQU  23       ; package 6 not present
DSNoPk7      .EQU  24       ; package 7 not present

DSMemFullErr .EQU  25       ; out of memory!
DSBadLaunch  .EQU  26       ; can't launch file

DSStknHeap   .EQU  28       ; stack has moved into application heap
DSFSErr      .EQU  27       ; file system map has been trashed
DSReInsert   .EQU  30       ; request user to reinsert off-line volume
DSNotThe1    .EQU  31       ; not the disk I wanted

; Storage allocator trouble codes (deep shit IDs)

MemTrbBase  .EQU    32              ; Memory Manager Trouble Code base.
mtSetLog    .EQU    MemTrbBase      ; Set Logical Size Error.
mtAdjFre    .EQU    MemTrbBase+1    ; Adjust Free Error.
mtAdjCnt    .EQU    MemTrbBase+2    ; Adjust Counters Error.
mtMkeBkf    .EQU    MemTrbBase+3    ; Make Block Free Error.
mtSetSiz    .EQU    MemTrbBase+4    ; Set Size Error.
mtInitMem   .EQU    MemTrbBase+5    ; Initialize Memory Manager Error.
mtBCerr     .EQU    MemTrbBase+6    ;
mtCZerr     .EQU    MemTrbBase+7    ;
mtCZ1err    .EQU    MemTrbBase+8    ;
mtCZ2err    .EQU    MemTrbBase+9    ;
mtCZ3err    .EQU    MemTrbBase+10   ;
mtEqCerr    .EQU    MemTrbBase+11   ;
mtEvCerr    .EQU    MemTrbBase+12   ;
mtHCerr     .EQU    MemTrbBase+13   ;
mtPCerr     .EQU    MemTrbBase+14   ;
mtSCerr     .EQU    MemTrbBase+15   ;
mtRC1err    .EQU    MemTrbBase+16   ;
mtRC2err    .EQU    MemTrbBase+17   ;
mtSABerr    .EQU    MemTrbBase+18   ;
mtACerr     .EQU    MemTrbBase+19   ;
mtIZCerr    .EQU    MemTrbBase+20   ;
mtPrCerr    .EQU    MemTrbBase+21   ;

; some miscellaneous result codes

EvtNotEnb   .EQU      1     ; event not enabled at PostEvent
NoEvtAvail  .EQU     -1     ; no event available (GetOSEvent,OSEventAvail)

Handle was NIL in HandleZone or other;
memWZErr    .EQU    -111    ; WhichZone failed (applied to free block);
memPurErr   .EQU    -112    ; trying to purge a locked or non-purgable block;

memAdrErr   .EQU    -110    ; address was odd, or out of range;
memAZErr    .EQU    -113    ; Address in zone check failed;
memPCErr    .EQU    -114    ; Pointer Check failed;
memBCErr    .EQU    -115    ; Block Check failed;
memSCErr    .EQU    -116    ; Size Check failed;

; Resource Manasumacc/ws/tlasm/sysmacs   444      0     12       31375  3472707202  10513 W^x4PH r^r{%{%X; File: SysMacs.Text
;_______________________________________________________________________
;
; SysMacs.Text - System macros include file.  All system components
;                should include this file of standard system macros.
;
; Written by:  Bud Tribble    28-Oct-81
;
; Modification History:
;
; AJH   30-Oct-81       - changed MOVE.L to LEA in "__CORE" macro
; AJH   02-Nov-81       - deleted SEEK and old memory management macros
; AJH   15-Nov-81       - added ASYNC option
; alo    2-Feb-82       - added some utility core routines
; LAK   05-Sep-82       - added DrvrInstall, DrvrRemove
; LAK   07-Sep-82       - added 5 object manager core routines
; MPH   29-Oct-82       - added System/Current option to mem man. macros.
; LAK   23 Dec 82       - removed object manager calls; added new file system
;                          traps (_UnMountVol,_MountVol,_FlushVol,_FlushFile,
;                          _OpenRF) and options (FilNam,FilNum);
;                          removed file system traps _ReadLabel,_WriteLabel.
; LAK  12 Jan 83  added CmpString, GetTrapAddr, SetTrapAddr macros
; LAK  18 Jan 83  added SetFilLock, RstFilLock, SetFilType macros
; LAK  21 Jan 83  made consistent with Andy's SysMacs
; MPH   2 Feb 83  reorganized macros to add new memory manager calls,
;                  remove SetHLock, SetHPurge
; LAK   4 Feb 83  added Delay (again) and AddDrive macros. Changed
;                  Exit to LoadFile.
; LAK   9 Feb 83  added SetGrowZone, CompactMem, PurgeMem
; LAK  10 Feb 83  added RDrvrInstall
; LAK  22 Feb 83  trap 63 is now InitUtil.
; AJH  12 Apr 83  Added REGS to GetTrapAddr
; LAK  03 Jun 83  Removed NOSAVE option (no longer used); added SetAppBase.
; LAK  16 Jun 83  Fixed macros for FreeMem, MaxMem, DisposPtr, SetPtrSize,
;                  GetPtrSize, DisposHandle, SetHandleSize, GetHandleSize,
;                  ReAllocHandle, EmptyHandle, SetApplLimit, HeapValidate,
;                  CompactMem, and PurgeMem to reflect correct options, reg save.
; SC   23 Jun 83  Added IMMED option for control calls.
; LAK  06 Aug 83  Added ResrvMem trap in place of HeapValidate; CompactMem,
;                  FreeMem, PurgeMem, and MaxMem traps adjusted for ,SYS
;                  option.
; LAK  12 Aug 83  Added ,CLEAR option for memory manager; added ,CASE and
;                  ,MARKS for string compares.
; LAK  11 Sep 83  Made CompactMem, FreeMem, PurgeMem, and ResrvMem use SAVE
;                  instead of REGS.
; LAK  16 Nov 83  Added OffLine trap for file system.
; LAK  30 Nov 83  Added MoreMasters call for memory manager.
;_______________________________________________________________________

; Misc. system macros


                .MACRO  __CORE
                .IF     '%1' <> ''
                LEA     %1,A0
                .ENDC

                .IF     '%3' = ''
                .WORD   $A000+%2
                .ENDC

                .IF     '%3' = 'REGS'
                .WORD   $A100+%2
                .ENDC

                .IF     '%3' = 'ASYNC'
                .WORD   $A400+%2
                .ENDC

                .IF     '%3' = 'SYS'
                .WORD   $A400+%2
                .ENDC

                .IF     '%3' = 'IMMED'
                .WORD   $A200+%2
                .ENDC

                .ENDM


                .MACRO  __MCore
                .IF     '%1' <> ''
                LEA     %1,A0
                .ENDC

                .IF     '%3' = ''
                .WORD   $A000+%2
                .ENDC

                .IF     '%3' = 'SAVE'
                        .IF     '%4' = 'SYS'
                                .WORD   $A400+%2
                                .ELSE
                                .WORD   $A000+%2
                        .ENDC
                .ENDC

                .IF     '%3' = 'REGS'
                        .IF     '%4' = 'SYS'
                                .IF     '%5' = 'CLEAR'
                                .WORD   $A700+%2
                                .ELSE
                                .WORD   $A500+%2
                                .ENDC
                        .ELSE
                                .IF     '%4' = 'CLEAR'
                                .WORD   $A300+%2
                                .ELSE
                                .WORD   $A100+%2
                                .ENDC
                        .ENDC
                .ENDC

                .ENDM

;
; International string comparisons have two boolean parameters:
;       bit  9 = 0 if and only if diacritical marks are significant
;       bit 10 = 0 if and only if case is insignificant
;
                .MACRO  __StrCore
                .IF     '%1' <> ''
                        LEA     %1,A0
                .ENDC

                .IF     '%3' = ''
                        .WORD   $A000+%2
                .ENDC

                .IF     '%3' = 'MARKS'
                        .IF     '%4' = 'CASE'
                                .WORD   $A600+%2
                        .ELSE
                                .WORD   $A200+%2
                        .ENDC
                .ENDC

                .IF     '%3' = 'CASE'
                        .WORD   $A400+%2
                .ENDC

                .ENDM


;_______________________________________________________________________
;
; Core routine system macros
;
;_______________________________________________________________________


; First we have the I/O core routine macros.  These are also used by
; the file system.

                .MACRO  _Open
                __CORE  %1,0,%2
                .ENDM

                .MACRO  _Close
                __CORE  %1,1,%2
                .ENDM

                .MACRO  _Read
                __CORE  %1,2,%2
                .ENDM

                .MACRO  _Write
                __CORE  %1,3,%2
                .ENDM

                .MACRO  _Control
                __CORE  %1,4,%2
                .ENDM

                .MACRO  _Status
                __CORE  %1,5,%2
                .ENDM

                .MACRO  _KillIO
                __CORE  %1,6,%2
                .ENDM


; other file system calls go here

                .MACRO  _GetVolInfo
                __CORE  %1,7,%2
                .ENDM

                .MACRO  _Create
                __CORE  %1,8,%2
                .ENDM

                .MACRO  _Delete
                __CORE  %1,9,%2
                .ENDM

                .MACRO  _OpenRF
                __CORE  %1,10,%2
                .ENDM

                .MACRO  _ReName
                __CORE  %1,11,%2
                .ENDM

                .MACRO  _GetFileInfo
                __CORE  %1,12,%2
                .ENDM

                .MACRO  _SetFileInfo
                __CORE  %1,13,%2
                .ENDM

                .MACRO  _UnMountVol
                __CORE  %1,14
                .ENDM

                .MACRO  _MountVol
                __CORE  %1,15
                .ENDM

                .MACRO  _Allocate
                __CORE  %1,16,%2
                .ENDM

                .MACRO  _GetEOF
                __CORE  %1,17,%2
                .ENDM

                .MACRO  _SetEOF
                __CORE  %1,18,%2
                .ENDM

                .MACRO  _FlushVol
                __CORE  %1,19,%2
                .ENDM

                .MACRO  _GetVol
                __CORE  %1,20,%2
                .ENDM

                .MACRO  _SetVol
                __CORE  %1,21,%2
                .ENDM

                .MACRO  _InitQueue
                __CORE  %1,22
                .ENDM

                .MACRO  _Eject
                __CORE  %1,23,%2
                .ENDM

                .MACRO  _GetFPos
                __CORE  %1,24,%2
                .ENDM

; Here are the storage manager core routine macros

                .MACRO  _InitZone
                __CORE  %1,25
                .ENDM

                .MACRO  _GetZone
                __CORE  %1,26,REGS
                .ENDM

                .MACRO  _SetZone
                __CORE  %1,27
                .ENDM

                .MACRO  _FreeMem
                __MCORE %1,28,SAVE,%2
                .ENDM

                .MACRO  _MaxMem
                __MCORE %1,29,REGS,%2
                .ENDM

                .MACRO  _NewPtr
                __MCORE %1,30,REGS,%2,%3
                .ENDM

                .MACRO  _DisposPtr
                __CORE  %1,31
                .ENDM

                .MACRO  _SetPtrSize
                __CORE  %1,32
                .ENDM

                .MACRO  _GetPtrSize
                __CORE  %1,33
                .ENDM

                .MACRO  _NewHandle
                __MCORE %1,34,REGS,%2,%3
                .ENDM

                .MACRO  _DisposHandle
                __CORE  %1,35
                .ENDM

                .MACRO  _SetHandleSize
                __CORE  %1,36
                .ENDM

                .MACRO  _GetHandleSize
                __CORE  %1,37
                .ENDM

                .MACRO  _HandleZone
                __CORE  %1,38,REGS
                .ENDM

                .MACRO  _ReAllocHandle
                __CORE  %1,39
                .ENDM

                .MACRO  _RecoverHandle
                __MCORE %1,40,REGS,%2,%3
                .ENDM

                .MACRO  _HLock
                __CORE  %1,41
                .ENDM

                .MACRO  _HUnLock
                __CORE  %1,42
                .ENDM

                .MACRO  _EmptyHandle
                __CORE  %1,43
                .ENDM

                .MACRO  _InitApplZone
                __CORE  %1,44
                .ENDM

                .MACRO  _SetApplLimit
                __CORE  %1,45
                .ENDM

                .MACRO  _BlockMove
                __CORE  %1,46
                .ENDM

; Here are the event manager macros

                .MACRO  _PostEvent
                __CORE  %1,47
                .ENDM

                .MACRO  _OSEventAvail
                __CORE  %1,48
                .ENDM

                .MACRO  _GetOSEvent
                __CORE  %1,49
                .ENDM

                .MACRO  _FlushEvents
                __CORE  %1,50
                .ENDM

; Here are the utility core routine macros

                .MACRO  _VInstall
                __CORE  %1,51
                .ENDM

                .MACRO  _VRemove
                __CORE  %1,52
                .ENDM

                .MACRO  _Offline
                __CORE  %1,53,%2
                .ENDM

                .MACRO  _MoreMasters
                __CORE  %1,54
                .ENDM

                .MACRO  _ReadParam
                __CORE  %1,55
                .ENDM

                .MACRO  _WriteParam
                __CORE  %1,56
                .ENDM

                .MACRO  _ReadDateTime
                __CORE  %1,57
                .ENDM

                .MACRO  _SetDateTime
                __CORE  %1,58
                .ENDM

                .MACRO  _Delay
                __CORE  %1,59
                .ENDM

                .MACRO  _CmpString
                __StrCore  %1,60
                .ENDM

                .MACRO  _DrvrInstall
                __CORE  %1,61
                .ENDM

                .MACRO  _DrvrRemove
                __CORE  %1,62
                .ENDM

                .MACRO  _InitUtil
                __CORE  %1,63
                .ENDM

                .MACRO  _ResrvMem
                __MCORE %1,64,SAVE,%2
                .ENDM

                .MACRO  _SetFilLock
                __CORE  %1,65,%2
                .ENDM

                .MACRO  _RstFilLock
                __CORE  %1,66,%2
                .ENDM

                .MACRO  _SetFilType
                __CORE  %1,67,%2
                .ENDM

                .MACRO  _SetFPos
                __CORE  %1,68,%2
                .ENDM

                .MACRO  _FlushFil
                __CORE  %1,69,%2
                .ENDM

                .MACRO  _GetTrapAddress
                __CORE  %1,70,REGS
                .ENDM

                .MACRO  _SetTrapAddress
                __CORE  %1,71
                .ENDM

                .MACRO  _PtrZone
                __CORE  %1,72,REGS
                .ENDM

                .MACRO  _HPurge
                __CORE  %1,73
                .ENDM

                .MACRO  _HNoPurge
                __CORE  %1,74
                .ENDM

                .MACRO  _SetGrowZone
                __CORE  %1,75
                .ENDM

                .MACRO  _CompactMem
                __MCORE %1,76,SAVE,%2
                .ENDM

                .MACRO  _PurgeMem
                __MCORE %1,77,SAVE,%2
                .ENDM

                .MACRO  _AddDrive
                __CORE  %1,78
                .ENDM

                .MACRO  _RDrvrInstall
                __CORE  %1,79
                .ENDM

                .MACRO  _UprString
                __StrCore  %1,84
                .ENDM

                .MACRO  _SetAppBase
                __CORE  %1,87
                .ENDM

      __CORE  %1,37
                .ENDM

                .MACRO  _HandleZone
                __CORE  %1,38,REGS
                .ENDM

                .MACRO  _ReAllocHandle
                __CORE  %1,39
                .ENDM

                .MACRO  _Recovsumacc/ws/tlasm/toolequ   444      0     12       65624  3472707202  10525 3. "6F^4D!$^9`9;;File TOOLEQU.TEXT
;--------------------------------------------------------------------------------
;
;  User Interface ToolBox Equate File
;
;     This file contains global variable and data structure
;  definitions for the MacIntosh User Interface ToolBox.
;  It is included with all toolBox source files and
;  possibly with some application programs.
;
;  written by Andy Hertzfeld    May 5, 1982
;
;  MODIFICATION HISTORY:
;
;     AJH  23-May-82    Added window stuff
;     AJH  22-Jun-82    Added icon stuff
;     AJH  27-Jun-82    Added menu stuff
;     AJH  31-Jul-82    Added control stuff; changed menu data structures
;     AJH  10-Aug-82    Got rid of scrapWindow
;     AJH  29-Aug-82    Added DragPattern,IShapeHook to globals, dragMsg to controls
;     AJH  06-Sep-82    Added growWindow message
;     AJH  12-Sep-82    Got rid of Alert and Dialog Window; added OneOne, MinusOne
;     AJH  14-Sep-82    Changed for new font manager
;     AJH  20-Sep-82    Added "goAway" boolean to windows; added symbolPtr globals
;     BLH  24-Sep-82    Added alert, dialog globals and data structures
;     AJH  05-Oct-82    Added ContrlAction field to control data structure
;     BLH   7-Oct-82    Added indirect globals--took main globals out of low mem
;     AJH  12-Oct-82    Switched over to new font manager globals; grafport now 64 bytes
;     AJH  16-Nov-82    Added TaskLock for desk manager
;     AJH  21-Nov-82    LGlobals,GPortSize change for ROM 1.8
;     BLH  17-Dec-82    Changed Dialog, Resource constants and globals
;     BLH  19-Dec-82    Changed names for Resource upheaval
;     AJH  19-Dec-82    Added CurActive,CurDeactive,deskHook globals
;     AJH  24-Dec-82    Made defProcs defHandles, other data structure changes
;     AJH  28-Dec-82    Broke off resource type and ID defs into separate file
;     AJH  05-Jan-83    moved global base to $E80; put dialog stuff at end
;     AJH  24-Jan-83    replaced MICONLIST with MBARENABLE
;     BLH   5-Feb-83    Removed alertWindow, DialogWindow globals.  Changed
;                       Dialog data structure defs.
;     AJH   5-Feb-83    added MicroSoft bytes, other changes
;     AJH   6-Feb-83    globals for scaling font manager
;     AJH  12-Feb-83    got rid of checkFlag, made curDragAction 4 bytes long
;     AJH   6-Mar-83    added GotStrike field for fontMgr (used byte from defSize)
;     AJH   7-Mar-83    added scaleDisable
;     AJH   5-Apr-83    added GhostWindow field in MicroSoft globals
;     BLH  20-Apr-83    Changed alert and dialog templates. Removed AlertKind.
;     SC   20-Apr-83    Added journal stuff at end
;     SC   09-May-83    Added text edit defs, changed dialogs
;     AJH  10-May-83    Added CloseOrnHook, FPAddress
;     AJH  25-May-83    Added AppPacks table
;     AJH  31-May-83    Changed size of grafPort for new QuickDraw, Added SysResName
;     AJH  02-Jun-83    Changed PicScrap to theScrap
;     AJH  08-Jun-83    Added AppParmHandle
;     AJH  14-Jun-83    Added DSErrCode
;     SC   23-Jun-83    Removed systemKind (it's now any negative number)
;     AJH  05-Jul-83    Made it match the documentation
;     SC   05-Aug-83    New TE record
;     AJH  05-Aug-83    Added WGIconMsg to window defProc messages
;     BLH  06-Aug-83    Added ResErrProc at end of tool globals.  Made LastMap
;                       a temporary filler.
;     SC   15-Aug-83    Dropped scrapInfo, theScrap
;     AJH  28-Aug-83    Changed AppleMark, CheckMark to final values
;     AJH  29-Aug-83    added "trackCtl" message
;     BLH   6-Sep-83    added ResReadOnly global, replacing RFiller.
;     SC    9-Sep-83    added teWdBreak for european stuff.
;     AJH  12-Sep-83    added CurDeKind
;
;-----------------------------------------------------------------------------------

;
; Important Constants
;
SCREENWIDTH     .EQU    512
SCREENHEIGHT    .EQU    342
SCREENRADIUS    .EQU    $00100010       ;rounded corners for desk area
GPORTSIZE       .EQU    108             ;a grafPort is 108 bytes
;

;------------------------------------------------------------
;
; ToolBox Global Variables (kept in low memory)
;
;   This section contains global variables for the font manager,
; the window manager and the menu manager
;
;------------------------------------------------------------

TOOLGBASE       .EQU       $980  ;ToolVars     ;base address of toolbox globals
LGLOBALS        .EQU       0            ;QuickDraw globals accessed 0(A5)

;----------------------------
;
; Font Manager Globals
;
;----------------------------
;
RomFont0       .EQU      ToolGBase      ;handle to ROM-based system font
ApFontID       .EQU      RomFont0+4     ;family ID of standard application font
GotStrike      .EQU      ApFontID+2     ;boolean indicating if we've got the strike
FMDefaultSize  .EQU      GotStrike+1    ;byte holding default size

CurFMInput     .EQU      FMDefaultSize+1 ;QuickDraw FMInput Record
CurFMFamily    .EQU      CurFMInput     ;current font family
CurFMSize      .EQU      CurFMFamily+2  ;current font size
CurFMFace      .EQU      CurFMSize+2    ;current font face
CurFMNeedBits  .EQU      CurFMFace+1    ;boolean specifying whether it needs strike
CurFMDevice    .EQU      CurFMNeedBits+1 ;current font device
CurFMNumer     .EQU      CurFMDevice+2  ;current numerator of scale factor
CurFMDenom     .EQU      CurFMNumer+4   ;current denominator of scale factor

FMgrOutRec     .EQU      CurFMDenom+4   ;QuickDraw FontOutput Record
FOutError      .EQU      FMgrOutRec     ;error code
FOutFontHandle .EQU      FOutError+2    ;handle to font bits
FOutBold       .EQU      FOutFontHandle+4 ;bolding factor
FOutItalic     .EQU      FOutBold+1     ;italic factor
FOutULOffset   .EQU      FOutItalic+1   ;underline offset
FOutULShadow   .EQU      FOutULOffset+1 ;underline halo
FOutULThick    .EQU      FOutULShadow+1 ;underline thickness
FOutShadow     .EQU      FOutULThick+1  ;shadow factor
FOutExtra      .EQU      FOutShadow+1   ;extra horizontal width
FOutAscent     .EQU      FOutExtra+1    ;height above baseline
FOutDescent    .EQU      FOutAscent+1   ;height below baseline
FOutWidMax     .EQU      FOutDescent+1  ;maximum width of character
FOutLeading    .EQU      FOutWidMax+1   ;space between lines
FOutUnused     .EQU      FOutLeading+1  ;unused byte (must have even number)
FOutNumer      .EQU      FOutUnused+1   ;point for numerators of scale factor
FOutDenom      .EQU      FOutNumer+4    ;point for denominators of scale factor

FMDotsPerInch  .EQU      FOutDenom+4     ;h,v dotsPerInch of current device
FMStyleTab     .EQU      FMDotsPerInch+4 ;style heuristic table supplied by device
ToolScratch    .EQU      FMStyleTab+24   ;8 byte scratch area

;----------------------------
;
; Window Manager Globals
;
;----------------------------
;
WINDOWLIST      .EQU    TOOLSCRATCH+8   ;Z-ordered list of windows (nearest first)
SAVEUPDATE      .EQU    WINDOWLIST+4    ;boolean enabling update accumulation
PAINTWHITE      .EQU    SAVEUPDATE+2    ;boolean enabling erasing newly drawn windows
WMGRPORT        .EQU    PAINTWHITE+2    ;grafPort used by window manager
DESKPORT        .EQU    WMGRPORT+4      ;wide open port for use by applications
;
OLDSTRUCTURE    .EQU    DESKPORT+4      ;handle to saved structure region
OLDCONTENT      .EQU    OLDSTRUCTURE+4  ;handle to saved content region
GRAYRGN         .EQU    OLDCONTENT+4    ;handle of rounded gray desk region
SAVEVISRGN      .EQU    GRAYRGN+4       ;handle of temporarily saved vis region
DRAGHOOK        .EQU    SAVEVISRGN+4    ;proc ptr to allow user control during dragging
TEMPRECT        .EQU    DRAGHOOK+4      ;rectangle used as scratch by toolbox
ONEONE          .EQU    TempRect+8      ;long constant $00010001
MINUSONE        .EQU    OneOne+4        ;long constant $FFFFFFFF

;-----------------------------------------------
;
; General purpose bitMap for plotting bitMaps
;
;-----------------------------------------------

ICONBITMAP      .EQU    MinusOne+8      ;bitmap used for plotting things

;----------------------------
;
; Menu Manager Globals
;
;----------------------------

MENULIST        .EQU    ICONBITMAP+14   ;pointer to current menuBar list structure
MBARENABLE      .EQU    MENULIST+4      ;word for enabling menuBar for deskOrns
CurDeKind       .EQU    MBARENABLE+2    ;kind of deactivated window
MENUFLASH       .EQU    CurDeKind+2     ;integer holding flash feedback count
THEMENU         .EQU    MENUFLASH+2     ;integer holding ID of hilited menu
SAVEDHANDLE     .EQU    THEMENU+2       ;handle of saved menuBits
MRMACHOOK       .EQU    SAVEDHANDLE+4   ;hook for Mr. MacIntosh
MENUHOOK        .EQU    MRMACHOOK+4     ;hook for user control during menuSelect

;  Control Manager Globals

DragPattern     .EQU    MenuHook+4      ;pattern DragTheRgn uses
DeskPattern     .EQU    DragPattern+8   ;pattern to paint the desk with
DragFlag        .EQU    DeskPattern+8   ;implicit parameter to DragControl, 1 word
CurDragAction   .EQU    DragFlag+2      ;implicit actionProc parameter

;  Floating Point Package Globals

FPState         .EQU    CurDragAction+4  ;6 bytes of floating point state


;-----------------------------
;
; Resource Manager Globals
;
;-----------------------------

TopMapHndl      .EQU    FPState+6       ;Handle to topmost map of list
SysMapHndl      .EQU    TopMapHndl+4    ;Handle to system map
SysMap          .EQU    SysMapHndl+4    ;reference number of system map
CurMap          .EQU    SysMap+2        ;reference number of current map
ResReadOnly     .EQU    CurMap+2        ;ReadOnly flag
ResLoad         .EQU    ResReadOnly+2   ;Auto-load feature
ResErr          .EQU    ResLoad+2       ;Resource error code


;-------------------------------
;
;  Misc ToolBox Globals
;
;-------------------------------

TaskLock        .EQU    ResErr+2        ;flag to prevent re-entering SystemTask
FScaleDisable   .EQU    TaskLock+1      ;flag to disable font scaling
CurActivate     .EQU    FScaleDisable+1 ;window to receive activate event
CurDeactive     .EQU    CurActivate+4   ;window to receive deactivate event
DeskHook        .EQU    CurDeactive+4   ;hook for painting the desk

teDoText        .EQU    DeskHook+4      ;Text edit private hook
teRecal         .EQU    teDoText+4      ; ""

MicroSoft       .EQU    teRecal+4       ;12 bytes for our friends in Seattle
GhostWindow     .EQU    MicroSoft+12    ;window that FrontWindow ignores
CloseOrnHook    .EQU    GhostWindow+4   ;hook for closing desk ornaments

;--------------------------------------------------------------
;
;    Alert/Dialog Manager Globals
;
;--------------------------------------------------------------

RestProc        .EQU    CloseOrnHook+4  ;Address of Restart failsafe procedure
SaveProc        .EQU    RestProc+4      ;Address of Save failsafe procedure
SaveSP          .EQU    SaveProc+4      ;Safe SP for restart or save
ANumber         .EQU    SaveSP+4        ;Which alert is active?
ACount          .EQU    ANumber+2       ;How many times this alert called?
DABeeper        .EQU    ACount+2        ;Beep routine
DAStrings       .EQU    DABeeper+4      ;string parameters for substutution


;--------------------------------------------------------------
;
;    TextEdit Globals
;
;--------------------------------------------------------------

TEScrpLength    .EQU    DAStrings+16
TEScrpHandle    .EQU    TEScrpLength+4

; application package dispatch table -- 8 longWords

AppPacks        .EQU    TEScrpHandle+4  ;handle to math code

; Misc stuff (last minute additions)

SysResName      .EQU    AppPacks+32     ;name of system.rsrc
AppParmHandle   .EQU    SysResName+20   ;handle to hold application parameters
DSErrCode       .EQU    AppParmHandle+4 ;last deep shit alert ID
ResErrProc      .EQU    DSErrCode+2     ;Resource error proc.
teWdBreak       .EQU    ResErrProc+4    ;default word break routine
dlgFont         .EQU    teWdBreak+4     ;default dialog font
LastTGLobal     .EQU    dlgFont+2       ;address of last global

;---------------------------------------------------
;
; ToolBox Data Structure Definitions
;
;   This section contains data structure definitions
; for the font manager, the window manager
; and the menu manager.
;
;---------------------------------------------------

;---------------------------------------
;
;   Font Manager Data Structures
;
;---------------------------------------

SYSFONT         .EQU    0               ;system font is font ID 0
APPLFONT        .EQU    1               ;application font is font ID 1

; Font Manager Input Record Offsets

FMInFamily     .EQU      0              ;offset to family
FMInSize       .EQU      2              ;offset to size
FMInFace       .EQU      4              ;offset to face
FMInNeedBits   .EQU      5              ;offset to needBits boolean
FMInDevice     .EQU      6              ;offset to device number
FMInNumer      .EQU      8              ;offset to numerator of scale
FMInDenom      .EQU      12             ;offset to denominator of scale

;
; Kerned Strike Font Header Data Structure
;
FFORMAT         .EQU    0               ;format of font
FMINCHAR        .EQU    2               ;lowest character in font
FMAXCHAR        .EQU    4               ;highest character in font
FMAXWD          .EQU    6               ;maximum width of characters
FBBOX           .EQU    8               ;left side of bounding box
FBBOY           .EQU    10              ;top of bounding box
FBBDX           .EQU    12              ;width of bounding box
FBBDY           .EQU    14              ;height of bounding box
FLENGTH         .EQU    16              ;length of font
FASCENT         .EQU    18              ;ascent above baseline
FDESCENT        .EQU    20              ;descent below baseline
FLEADING        .EQU    22              ;space between lines
FRASTER         .EQU    24              ;offset to actual bits?
;
; Definitions for Font Style Bits (in standard style byte, bits 0-6)
;
BOLDBIT         .EQU    0
ITALICBIT       .EQU    1
ULINEBIT        .EQU    2
OUTLINEBIT      .EQU    3
SHADOWBIT       .EQU    4
CondenseBit     .EQU    5
ExtendBit       .EQU    6

; Font Manager Defined control/status codes

FMgrCtl1       .EQU      8              ;printer drivers support ctl/status 8

;---------------------------------------
;
;   Window Manager Data Structures
;
;---------------------------------------
;
; Window Kind Constants
;
;                                       ;system windows are negative include desk ornaments, etc.
DialogKind      .EQU    2               ;Dialog windows
USERKIND        .EQU    8               ;this and above numbers are for user

;
; Window Definition Procedure Messages
;
WDRAWMSG        .EQU    0               ;draw yourself
WHITMSG         .EQU    1               ;hit test
WCALCRGNMSG     .EQU    2               ;recalculate your regions
WINITMSG        .EQU    3               ;initialize yourself
WDISPOSEMSG     .EQU    4               ;dispose any private data
WGROWMSG        .EQU    5               ;drag out grow outline
WGIconMsg       .EQU    6               ;draw the grow icon
;
; Window Hit-Test Codes
;
wNoHit          .EQU    0               ;not in window at all
wInContent      .EQU    1               ;in content area of window
wInDrag         .EQU    2               ;in drag area of window
wInGrow         .EQU    3               ;in grow area of window
wInGoAway       .EQU    4               ;in go away area of window
;
; Window Data Structure Definition
;
WINDOWPORT      .EQU    0               ;GrafPort Data Structure
WINDOWKIND      .EQU    GPORTSIZE       ;integer -- logical type of window
WVISIBLE        .EQU    WINDOWKIND+2    ;boolean (1 byte) -- visible flag
WHILITED        .EQU    WVISIBLE+1      ;boolean (1 byte) -- select (hilite) flag
WGoAway         .EQU    WHilited+1      ;boolean (1 byte) -- has go away button
WSpare          .EQU    WGoAway+1       ;spare byte reserved for future expansion
STRUCTRGN       .EQU    WSpare+1        ;handle to structure region of window
CONTRGN         .EQU    STRUCTRGN+4     ;handle to content region of window
UPDATERGN       .EQU    CONTRGN+4       ;handle to update region of window
WINDOWDEF       .EQU    UPDATERGN+4     ;handle to window definition procedure
WDATAHANDLE     .EQU    WINDOWDEF+4     ;handle  to window proc-defined data
WTITLEHANDLE    .EQU    WDATAHANDLE+4   ;handle to title string
WTITLEWIDTH     .EQU    WTITLEHANDLE+4  ;width in pixels of title string (integer)
WCONTROLLIST    .EQU    WTITLEWIDTH+2   ;handle to list of controls of this window
NEXTWINDOW      .EQU    WCONTROLLIST+4  ;pointer to next window in z-ordered list
WINDOWPIC       .EQU    NEXTWINDOW+4    ;picture handle for updates
WREFCON         .EQU    WINDOWPIC+4     ;long integer defined by application
;
WINDOWSIZE      .EQU    WREFCON+4       ;size of window data structure

;--------------------------------------------------
;
;  Menu Manager Data Structure Definitions
;
;--------------------------------------------------

MAXMENU         .EQU    96              ;a maximum of 16*6 menus in menuBar
MLISTSIZE       .EQU    102             ;a menu list is 102 bytes long
;
; Menu Definition Procedure Messages
;
MDRAWMSG        .EQU    0               ;draw yourself
MCHOOSEMSG      .EQU    1               ;select an item
MSizeMsg        .EQU    2               ;calculate your size
;
;  Character Definitions for MenuMarks and other special characters
;
NOMARK          .EQU    0
APPLEMARK       .EQU    17
CHECKMARK       .EQU    18

;
; MenuList Data Structure Definition -- one per menuBar
;
LASTMENU        .EQU    0               ;number of menus in this menuList
LASTRIGHT       .EQU    2               ;coordinate of 1st free point in menuBar
MENUOH          .EQU    0               ;menu handle
MENULEFT        .EQU    4               ;coordinate of left edge of menu
;
; MenuInfoBlk Data Structure -- one per menu
;
MENUID          .EQU    0               ;16 bit integer unique for each menuBar
MENUWIDTH       .EQU    2               ;16 bit integer indicating menu width
MENUHEIGTH      .EQU    4               ;16 bit integer indicating menu height
MenuDefHandle   .EQU    6               ;handle to menu definition proc
MENUENABLE      .EQU    10              ;longword of enable flags, one bit/item
MENUDATA        .EQU    14              ;menu item string
;
MENUBLKSIZE     .EQU    14              ;size of a menu block is 14 bytes plus
                                        ;the dataString
;
; MenuString Data Structure -- one per item
;
ITEMICON        .EQU    0               ;offset to icon byte
ITEMCMD         .EQU    1               ;offset to apple (command key) byte
ITEMMARK        .EQU    2               ;offset to checkmark character byte
ITEMSTYLE       .EQU    3               ;offset to style byte

;------------------------------------------------------------------
;
;  Control Manager (button and dial) manager data structures
;
;------------------------------------------------------------------

;
; Control Definition Procedure Messages
;
DrawCtlMsg      .EQU    0               ;draw message
HitCtlMsg       .EQU    1               ;hit test message
CalcCtlMsg      .EQU    2               ;calc region message
NewCtlMsg       .EQU    3               ;init message
DispCtlMsg      .EQU    4               ;dispose any private data message
PosCtlMsg       .EQU    5               ;adjust indicator position message
ThumbCtlMsg     .EQU    6               ;calculate rectangles for thumb dragging
DragCtlMsg      .EQU    7               ;custom drag message
TrackCtlMsg     .EQU    8               ;track yourself message
;
;  FindWindow classification codes
;
inDesk          .EQU    0               ;not in any window
inMenuBar       .EQU    1               ;in the menu bar
inSysWindow     .EQU    2               ;in a system window
inContent       .EQU    3               ;in content area of user window
inDrag          .EQU    4               ;in drag area of user window
inGrow          .EQU    5               ;in grow area of user window
inGoAway        .EQU    6               ;in go away area of user window
;
inButton        .EQU   10               ;in a push button
inCheckBox      .EQU   11               ;in a checkBox button
;
inUpButton      .EQU   20               ;in up button area of a dial
inDownButton    .EQU   21               ;in down button area of a dial
inPageUp        .EQU   22               ;in page up (gray) area of a dial
inPageDown      .EQU   23               ;in page down (gray) area of a dial
;
inThumb         .EQU   129              ;in thumb area of a dial
;

NEXTCONTROL     .EQU    0               ;handle to next control in the list
CONTRLOWNER     .EQU    NEXTCONTRL+4    ;windowPtr to owning window
CONTRLRECT      .EQU    CONTRLOWNER+4   ;bounding rectangle of control
CONTRLVIS       .EQU    CONTRLRECT+8    ;one byte boolean indicating visible state
CONTRLHILITE    .EQU    CONTRLVIS+1     ;one byte field indicating hilite state
CONTRLVALUE     .EQU    CONTRLHILITE+1  ;integer holding current value of control
CONTRLMIN       .EQU    CONTRLVALUE+2   ;integer holding minimum value of control
CONTRLMAX       .EQU    CONTRLMIN+2     ;integer holding maximum value of control
CONTRLDefHandle .EQU    CONTRLMAX+2     ;handle to control definition procedure
CONTRLDATA      .EQU    CONTRLDefHand+4 ;pointer to data handle for definition proc
ContrlAction    .EQU    ContrlData+4    ;pointer to local actionProc
CONTRLRFCON     .EQU    ContrlAction+4  ;longword refcon defined by application
CONTRLTITLE     .EQU    CONTRLRFCON+4   ;handle to title string (or string itself)

CONTRLSIZE      .EQU    CONTRLTITLE     ;size of control data structure - title


;------------------------------------------------
;
; Alert Box Manager Data Structure Definitions
;
;------------------------------------------------

;Dialog record

DBounds         .EQU    0               ;Dialog bounds rectangle
DVisible        .EQU    DBounds+8       ;Visible flag
DWindProc       .EQU    DVisible+2      ;Window proc ID
DGoAway         .EQU    DWindProc+2     ;Go away flag
DRefCon         .EQU    DGoAway+2       ;Reference constant
DItems          .EQU    DRefCon+4       ;Item list ID and handle
DTitle          .EQU    DItems+2        ;Dialog window title

;Alert record

ABounds         .EQU    0               ;Alert box height and width
AItems          .EQU    ABounds+8       ;Item list ID
AStages         .EQU    AItems+2        ;Stages word

;Window subclass DialogWindow

Items           .EQU    WindowSize      ;Item list
teHandle        .EQU    Items+4         ;handle to TextEdit object
EditField       .EQU    teHandle+4      ;current field being edited
EditOpen        .EQU    EditField+2     ;Is editting open?
ADefItem        .EQU    EditOpen+2      ;default item for alerts
DWindLen        .EQU    ADefItem+2      ;Dialog window length

;stage definition--packed 2 to a byte, 4 stages in a word

volBits         .EQU    3               ;Low 2 bits are volume (0..3)
alBit           .EQU    4               ;alert bit (put up box this time?)
OKDismissal     .EQU    8               ;bit for OK/Cancel default in each stage
                                        ;(not necessarily different for each
                                        ; stage, but saves a byte)

;------------------------------------------------
;
; DialogList Data Structure Definitions
;
;------------------------------------------------

DlgMaxIndex     .EQU    0               ;Maximum index (=items-1) stored here

;In each item

ItmHndl         .EQU    0               ;Handle to the item
ItmRect         .EQU    ItmHndl+4       ;Bounding rect of item
ItmType         .EQU    ItmRect+8       ;item type
ItmData         .EQU    ItmType+1       ;item string, must be even length


;------------------------------------------------------------------
;
; ToolBox Error Codes (passed through GrafError)
;
;------------------------------------------------------------------

FontDecError    .EQU    -64             ;error during font declaration
FontNotDeclared .EQU    -65             ;font not declared
FontSubErr      .EQU    -66             ;font substitution occured
;

;------------------------------------------------------------------
;
;    Equates for journal interface control call
;
;------------------------------------------------------------------

JPlayCtl        .EQU    16                      ; playBack call
JRecordCtl      .EQU    17                      ; record call
JRefNum         .EQU    -2                      ; refNum of journal
jcTickCount     .EQU    0                       ; journal code for TickCount
jcGetMouse      .EQU    1                       ; journal code for GetMouse
jcButton        .EQU    2                       ; journal code for Button
jcGetKeys       .EQU    3                       ; journal code for GetKeys
jcEvent         .EQU    4                       ; journal code for GetNextEvent(Avail)

;------------------------------------------------------------------
;
; Record for Text Edit object
;
;------------------------------------------------------------------

teDestRect  .EQU        0                       ; 0 Destination rectangle (keep together)
teViewRect  .EQU        teDestRect+8            ; 8 View rectangle rectangle

teSelRect   .EQU        teViewRect+8            ; 10 Select rectangle
teLineHite  .EQU        teSelRect+8             ; 18 Current font lineheight
teAscent    .EQU        teLineHite+2            ; 1A Current font ascent
teSelPoint  .EQU        teAscent+2              ; 1C Selection point(mouseLoc)

teSelStart  .EQU        teSelPoint+4            ; 20 selection start (KEEP together)
teSelEnd    .EQU        teSelStart+2            ; 22 selection end

teActive    .EQU        teSelEnd+2              ; 24 ST if active

teWordBreak .EQU        teActive+2              ; 26 Word break routine
teClikProc  .EQU        teWordBreak+4           ; 2A Click loop routine

teClikTime  .EQU        teClikProc+4            ; 2E Time of last click
teClikLoc   .EQU        teClikTime+4            ; 32 location of double click

teCarTime   .EQU        teClikLoc+2             ; 33 Time for next caret toggle
teCarOn     .EQU        teCarTime+4             ; 38 Is caret on?
teCarAct    .EQU        teCarOn+1               ; 39 Is caret active?
teStyle     .EQU        teCarAct+1              ; 3A fill style

teLength    .EQU        teStyle+2               ; 3C Length of text below {Must stay together}
teTextH     .EQU        teLength+2              ; 40 text handle goes here

teRecBack   .EQU        teTextH+4               ; 42 set true if backgnd recal
teRecLine   .EQU        teRecBack+2             ; 44 current recal line
teLftClick  .EQU        teRecLine+2             ; 46 ST if click was to left
teLftCaret  .EQU        teLftClick+1            ; 47 ST if caret was to left

teCROnly    .EQU        teLftCaret+1            ; 48 ST if CR only for line breaks

teFontStuff .EQU        teCROnly+2              ; 50 space for font specifier
teGrafPort  .EQU        teFontStuff+8           ; 52 grafport for editting

teHiHook    .EQU        teGrafPort+4            ; 56 Hook for hilite routine
teCarHook   .EQU        teHiHook+4              ; 5A Hook for hilite routine

teNLines    .EQU        teCarHook+4             ; 5E number of lines (must keep together)
teLines     .EQU        teNLines+2              ; 62 line starts(array of words)

TERecSize   .EQU        teLines+8               ; 6A BASE size of a record



-------------------------------

DlgMaxIndex     .EQU    0               ;Maximum index (=items-1) stored hesumacc/ws/tlasm/toolmacs   444      0     12       54340  3472707202  10647 5P:H r^;File ToolMacs.Text
;-----------------------------------------------------
;
;  User Interface ToolBox Assembly Language Interface
;
;    These macros expand into toolBox traps allowing
;  a convenient, symbolic ToolBox interface for the
;  assembly lanaguage programmer.
;
;  Version for ROM 2.0 --     Februrary 10, 1983
;  regenerated for ROM 4.0 -- June 3, 1983
;  changed AlertSound to ErrorSound
;  added InsertResMenu, OpenDeskAcc -- June 13, 1983
;  added UniqueID, CloseDeskAcc,SystemEdit,LBin2Dec,LDec2Bin
;        Secs2Date,Date2Secs; removed sound traps -- July 2, 1983
;  added TEGetText, TESetJust and TEInsert - august 4
;  added SysBeep, DrawGrow - august 6
;  added HandAndHand, PtrAndHand - august 6
;  Removed EndSubResource.  Changed BeginSubResource to HomeResFile.
;  added GetFinderInfo and SetFinderInfo - august 6
;  added DragGrayRgn - august 11
;  Removed GetFinderInfo and SetFinderInfo (august 18?)
;  Added scrap macros
;  Added resource set/getresfileattr
;  Added EnQueue, DeQueue (19-Dec-83, LAK)
;  Added CouldDialog, FreeDialog, SizeRsrc (12-Jan-84, LAK)
;
;-----------------------------------------------------


                .MACRO  _InitFont
                .WORD  $A8FE
                .ENDM

                .MACRO  _GetFName
                .WORD  $A8FF
                .ENDM

                .MACRO  _GetFNum
                .WORD  $A900
                .ENDM

                .MACRO  _FMSwapFo
                .WORD  $A901
                .ENDM

                .MACRO  _RealFont
                .WORD  $A902
                .ENDM

                .MACRO  _SetFontL
                .WORD  $A903
                .ENDM

                .MACRO  _DrawGrow
                .WORD  $A904
                .ENDM

                .MACRO  _DragGrayRgn
                .WORD  $A905
                .ENDM

                .MACRO  _NewStrin
                .WORD  $A906
                .ENDM

                .MACRO  _SetStrin
                .WORD  $A907
                .ENDM

                .MACRO  _ShowHide
                .WORD  $A908
                .ENDM

                .MACRO  _CalcVis
                .WORD  $A909
                .ENDM

                .MACRO  _CalcVBehind
                .WORD  $A90A
                .ENDM

                .MACRO  _ClipAbov
                .WORD  $A90B
                .ENDM

                .MACRO  _PaintOne
                .WORD  $A90C
                .ENDM

                .MACRO  _PaintBeh
                .WORD  $A90D
                .ENDM

                .MACRO  _SaveOld
                .WORD  $A90E
                .ENDM

                .MACRO  _DrawNew
                .WORD  $A90F
                .ENDM

                .MACRO  _GetWMgrP
                .WORD  $A910
                .ENDM

                .MACRO  _CheckUpD
                .WORD  $A911
                .ENDM

                .MACRO  _InitWind
                .WORD  $A912
                .ENDM

                .MACRO  _NewWindo
                .WORD  $A913
                .ENDM

                .MACRO  _DisposWindow
                .WORD  $A914
                .ENDM

                .MACRO  _ShowWind
                .WORD  $A915
                .ENDM

                .MACRO  _HideWind
                .WORD  $A916
                .ENDM

                .MACRO  _GetWRefC
                .WORD  $A917
                .ENDM

                .MACRO  _SetWRefC
                .WORD  $A918
                .ENDM

                .MACRO  _GetWTitl
                .WORD  $A919
                .ENDM

                .MACRO  _SetWTitl
                .WORD  $A91A
                .ENDM

                .MACRO  _MoveWind
                .WORD  $A91B
                .ENDM

                .MACRO  _HiliteWi
                .WORD  $A91C
                .ENDM

                .MACRO  _SizeWind
                .WORD  $A91D
                .ENDM

                .MACRO  _TrackGoA
                .WORD  $A91E
                .ENDM

                .MACRO  _SelectWi
                .WORD  $A91F
                .ENDM

                .MACRO  _BringToF
                .WORD  $A920
                .ENDM

                .MACRO  _SendBehi
                .WORD  $A921
                .ENDM

                .MACRO  _BeginUpD
                .WORD  $A922
                .ENDM

                .MACRO  _EndUpDat
                .WORD  $A923
                .ENDM

                .MACRO  _FrontWin
                .WORD  $A924
                .ENDM

                .MACRO  _DragWind
                .WORD  $A925
                .ENDM

                .MACRO  _DragTheR
                .WORD  $A926
                .ENDM

                .MACRO  _InvalRgn
                .WORD  $A927
                .ENDM

                .MACRO  _InvalRec
                .WORD  $A928
                .ENDM

                .MACRO  _ValidRgn
                .WORD  $A929
                .ENDM

                .MACRO  _ValidRec
                .WORD  $A92A
                .ENDM

                .MACRO  _GrowWind
                .WORD  $A92B
                .ENDM

                .MACRO  _FindWind
                .WORD  $A92C
                .ENDM

                .MACRO  _CloseWin
                .WORD  $A92D
                .ENDM

                .MACRO  _SetWindo
                .WORD  $A92E
                .ENDM

                .MACRO  _GetWindo
                .WORD  $A92F
                .ENDM

                .MACRO  _InitMenu
                .WORD  $A930
                .ENDM

                .MACRO  _NewMenu
                .WORD  $A931
                .ENDM

                .MACRO  _DisposMenu
                .WORD  $A932
                .ENDM

                .MACRO  _AppendMe
                .WORD  $A933
                .ENDM

                .MACRO  _ClearMen
                .WORD  $A934
                .ENDM

                .MACRO  _InsertMe
                .WORD  $A935
                .ENDM

                .MACRO  _DeleteMe
                .WORD  $A936
                .ENDM

                .MACRO  _DrawMenu
                .WORD  $A937
                .ENDM

                .MACRO  _HiliteMe
                .WORD  $A938
                .ENDM

                .MACRO  _EnableIt
                .WORD  $A939
                .ENDM

                .MACRO  _DisableI
                .WORD  $A93A
                .ENDM

                .MACRO  _GetMenuB
                .WORD  $A93B
                .ENDM

                .MACRO  _SetMenuB
                .WORD  $A93C
                .ENDM

                .MACRO  _MenuSele
                .WORD  $A93D
                .ENDM

                .MACRO  _MenuKey
                .WORD  $A93E
                .ENDM

                .MACRO  _GetItmIcon
                .WORD  $A93F
                .ENDM

                .MACRO  _SetItmIcon
                .WORD  $A940
                .ENDM

                .MACRO  _GetItmStyle
                .WORD  $A941
                .ENDM

                .MACRO  _SetItmStyle
                .WORD  $A942
                .ENDM

                .MACRO  _GetItmMark
                .WORD  $A943
                .ENDM

                .MACRO  _SetItmMark
                .WORD  $A944
                .ENDM

                .MACRO  _CheckIte
                .WORD  $A945
                .ENDM

                .MACRO  _GetItem
                .WORD  $A946
                .ENDM

                .MACRO  _SetItem
                .WORD  $A947
                .ENDM

                .MACRO  _CalcMenu
                .WORD  $A948
                .ENDM

                .MACRO  _GetMHand
                .WORD  $A949
                .ENDM

                .MACRO  _SetMFlash
                .WORD  $A94A
                .ENDM

                .MACRO  _PlotIcon
                .WORD  $A94B
                .ENDM

                .MACRO  _FlashMen
                .WORD  $A94C
                .ENDM

                .MACRO  _AddResMe
                .WORD  $A94D
                .ENDM

                .MACRO  _CountMIt
                .WORD  $A950
                .ENDM

                .MACRO  _InsertResMenu
                .WORD  $A951
                .ENDM

                .MACRO  _PinRect
                .WORD  $A94E
                .ENDM

                .MACRO  _DeltaPoi
                .WORD  $A94F
                .ENDM

                .MACRO  _NewContr
                .WORD  $A954
                .ENDM

                .MACRO  _DisposControl
                .WORD  $A955
                .ENDM

                .MACRO  _KillCont
                .WORD  $A956
                .ENDM

                .MACRO  _ShowCont
                .WORD  $A957
                .ENDM

                .MACRO  _HideCont
                .WORD  $A958
                .ENDM

                .MACRO  _MoveCont
                .WORD  $A959
                .ENDM

                .MACRO  _GetCRefC
                .WORD  $A95A
                .ENDM

                .MACRO  _SetCRefC
                .WORD  $A95B
                .ENDM

                .MACRO  _SizeCont
                .WORD  $A95C
                .ENDM

                .MACRO  _HiliteCo
                .WORD  $A95D
                .ENDM

                .MACRO  _GetCTitl
                .WORD  $A95E
                .ENDM

                .MACRO  _SetCTitl
                .WORD  $A95F
                .ENDM

                .MACRO  _GetCtlVa
                .WORD  $A960
                .ENDM

                .MACRO  _GetMinCtl
                .WORD  $A961
                .ENDM

                .MACRO  _GetMaxCtl
                .WORD  $A962
                .ENDM

                .MACRO  _SetCtlVa
                .WORD  $A963
                .ENDM

                .MACRO  _SetMinCtl
                .WORD  $A964
                .ENDM

                .MACRO  _SetMaxCtl
                .WORD  $A965
                .ENDM

                .MACRO  _TestCont
                .WORD  $A966
                .ENDM

                .MACRO  _DragCont
                .WORD  $A967
                .ENDM

                .MACRO  _TrackCon
                .WORD  $A968
                .ENDM

                .MACRO  _DrawCont
                .WORD  $A969
                .ENDM

                .MACRO  _GetCtlAc
                .WORD  $A96A
                .ENDM

                .MACRO  _SetCtlAc
                .WORD  $A96B
                .ENDM

                .MACRO  _FindCont
                .WORD  $A96C
                .ENDM

                .MACRO  _DeQueue
                .WORD  $A96E
                .ENDM

                .MACRO  _EnQueue
                .WORD  $A96F
                .ENDM

                .MACRO  _GetNextE
                .WORD  $A970
                .ENDM

                .MACRO  _EventAva
                .WORD  $A971
                .ENDM

                .MACRO  _GetMouse
                .WORD  $A972
                .ENDM

                .MACRO  _StillDow
                .WORD  $A973
                .ENDM

                .MACRO  _Button
                .WORD  $A974
                .ENDM

                .MACRO  _TickCoun
                .WORD  $A975
                .ENDM

                .MACRO  _GetKeys
                .WORD  $A976
                .ENDM

                .MACRO  _WaitMous
                .WORD  $A977
                .ENDM

                .MACRO  _CouldDialog
                .WORD  $A979
                .ENDM

                .MACRO  _FreeDialog
                .WORD  $A97A
                .ENDM

                .MACRO  _InitDial
                .WORD  $A97B
                .ENDM

                .MACRO  _GetNewDi
                .WORD  $A97C
                .ENDM

                .MACRO  _NewDialo
                .WORD  $A97D
                .ENDM

                .MACRO  _SelIText
                .WORD  $A97E
                .ENDM

                .MACRO  _IsDialog
                .WORD  $A97F
                .ENDM

                .MACRO  _DialogSe
                .WORD  $A980
                .ENDM

                .MACRO  _DrawDial
                .WORD  $A981
                .ENDM

                .MACRO  _CloseDia
                .WORD  $A982
                .ENDM

                .MACRO  _DisposDi
                .WORD  $A983
                .ENDM

                .MACRO  _Alert
                .WORD  $A985
                .ENDM

                .MACRO  _StopAler
                .WORD  $A986
                .ENDM

                .MACRO  _NoteAler
                .WORD  $A987
                .ENDM

                .MACRO  _CautionA
                .WORD  $A988
                .ENDM

                .MACRO  _CouldAle
                .WORD  $A989
                .ENDM

                .MACRO  _FreeAler
                .WORD  $A98A
                .ENDM

                .MACRO  _ParamTex
                .WORD  $A98B
                .ENDM

                .MACRO  _ErrorSou
                .WORD  $A98C
                .ENDM

                .MACRO  _GetDItem
                .WORD  $A98D
                .ENDM

                .MACRO  _SetDItem
                .WORD  $A98E
                .ENDM

                .MACRO  _SetIText
                .WORD  $A98F
                .ENDM

                .MACRO  _GetIText
                .WORD  $A990
                .ENDM

                .MACRO  _ModalDia
                .WORD  $A991
                .ENDM

                .MACRO  _DetachRe
                .WORD  $A992
                .ENDM

                .MACRO  _SetResPu
                .WORD  $A993
                .ENDM

                .MACRO  _CurResFi
                .WORD  $A994
                .ENDM

                .MACRO  _InitReso
                .WORD  $A995
                .ENDM

                .MACRO  _RsrcZone
                .WORD  $A996
                .ENDM

                .MACRO  _OpenResF
                .WORD  $A997
                .ENDM

                .MACRO  _UseResFi
                .WORD  $A998
                .ENDM

                .MACRO  _UpdateRe
                .WORD  $A999
                .ENDM

                .MACRO  _CloseRes
                .WORD  $A99A
                .ENDM

                .MACRO  _SetResLo
                .WORD  $A99B
                .ENDM

                .MACRO  _CountRes
                .WORD  $A99C
                .ENDM

                .MACRO  _GetIndRe
                .WORD  $A99D
                .ENDM

                .MACRO  _CountTyp
                .WORD  $A99E
                .ENDM

                .MACRO  _GetIndTy
                .WORD  $A99F
                .ENDM

                .MACRO  _GetResou
                .WORD  $A9A0
                .ENDM

                .MACRO  _GetNamed
                .WORD  $A9A1
                .ENDM

                .MACRO  _LoadReso
                .WORD  $A9A2
                .ENDM

                .MACRO  _ReleaseR
                .WORD  $A9A3
                .ENDM

                .MACRO  _HomeResF
                .WORD  $A9A4
                .ENDM

                .MACRO  _SizeRsrc
                .WORD  $A9A5
                .ENDM

                .MACRO  _GetResAt
                .WORD  $A9A6
                .ENDM

                .MACRO  _SetResAt
                .WORD  $A9A7
                .ENDM

                .MACRO  _GetResIn
                .WORD  $A9A8
                .ENDM

                .MACRO  _SetResIn
                .WORD  $A9A9
                .ENDM

                .MACRO  _ChangedR
                .WORD  $A9AA
                .ENDM

                .MACRO  _AddResou
                .WORD  $A9AB
                .ENDM

                .MACRO  _AddRefer
                .WORD  $A9AC
                .ENDM

                .MACRO  _RmveReso
                .WORD  $A9AD
                .ENDM

                .MACRO  _RmveRefe
                .WORD  $A9AE
                .ENDM

                .MACRO  _ResError
                .WORD  $A9AF
                .ENDM

                .MACRO  _WriteRes
                .WORD  $A9B0
                .ENDM

                .MACRO  _CreateRe
                .WORD  $A9B1
                .ENDM

                .MACRO  _SystemEv
                .WORD  $A9B2
                .ENDM

                .MACRO  _SystemCl
                .WORD  $A9B3
                .ENDM

                .MACRO  _SystemTa
                .WORD  $A9B4
                .ENDM

                .MACRO  _SystemMe
                .WORD  $A9B5
                .ENDM

                .MACRO  _OpenDeskAcc
                .WORD  $A9B6
                .ENDM

                .MACRO  _CloseDeskAcc
                .WORD  $A9B7
                .ENDM

                .MACRO  _GetPatte
                .WORD  $A9B8
                .ENDM

                .MACRO  _GetCurso
                .WORD  $A9B9
                .ENDM

                .MACRO  _GetStrin
                .WORD  $A9BA
                .ENDM

                .MACRO  _GetIcon
                .WORD  $A9BB
                .ENDM

                .MACRO  _GetPictu
                .WORD  $A9BC
                .ENDM

                .MACRO  _GetNewWi
                .WORD  $A9BD
                .ENDM

                .MACRO  _GetNewCo
                .WORD  $A9BE
                .ENDM

                .MACRO  _GetRMenu
                .WORD  $A9BF
                .ENDM

                .MACRO  _GetNewMB
                .WORD  $A9C0
                .ENDM

                .MACRO  _UniqueID
                .WORD   $A9C1
                .ENDM

                .MACRO  _SysEdit
                .WORD   $A9C2
                .ENDM

                .MACRO  _LBin2Dec
                .WORD   $A9C4
                .ENDM

                .MACRO  _LDec2Bin
                .WORD   $A9C5
                .ENDM

                .MACRO  _Secs2Date
                .WORD   $A9C6
                .ENDM

                .MACRO  _Date2Secs
                .WORD   $A9C7
                .ENDM

                .MACRO  _SysBeep
                .WORD  $A9C8
                .ENDM

                .MACRO  _SysError
                .WORD  $A9C9
                .ENDM

                .MACRO  _PutIcon
                .WORD  $A9CA
                .ENDM

                .MACRO  _TEGetText
                .WORD  $A9CB
                .ENDM

                .MACRO  _TEInit
                .WORD  $A9CC
                .ENDM

                .MACRO  _TEDispos
                .WORD  $A9CD
                .ENDM

                .MACRO  _TextBox
                .WORD  $A9CE
                .ENDM

                .MACRO  _TESetText
                .WORD  $A9CF
                .ENDM

                .MACRO  _TECalTex
                .WORD  $A9D0
                .ENDM

                .MACRO  _TESetSel
                .WORD  $A9D1
                .ENDM

                .MACRO  _TENew
                .WORD  $A9D2
                .ENDM

                .MACRO  _TEUpdate
                .WORD  $A9D3
                .ENDM

                .MACRO  _TEClick
                .WORD  $A9D4
                .ENDM

                .MACRO  _TECopy
                .WORD  $A9D5
                .ENDM

                .MACRO  _TECut
                .WORD  $A9D6
                .ENDM

                .MACRO  _TEDelete
                .WORD  $A9D7
                .ENDM

                .MACRO  _TEActiva
                .WORD  $A9D8
                .ENDM

                .MACRO  _TEDeacti
                .WORD  $A9D9
                .ENDM

                .MACRO  _TEIdle
                .WORD  $A9DA
                .ENDM

                .MACRO  _TEPaste
                .WORD  $A9DB
                .ENDM

                .MACRO  _TEKey
                .WORD  $A9DC
                .ENDM

                .MACRO  _TEScroll
                .WORD  $A9DD
                .ENDM

                .MACRO  _TEInsert
                .WORD  $A9DE
                .ENDM

                .MACRO  _TESetJust
                .WORD  $A9DF
                .ENDM

                .MACRO  _Munger
                .WORD  $A9E0
                .ENDM

                .MACRO  _HandToHa
                .WORD  $A9E1
                .ENDM

                .MACRO  _PtrToXHa
                .WORD  $A9E2
                .ENDM

                .MACRO  _PtrToHan
                .WORD  $A9E3
                .ENDM

                .MACRO  _HandAndH
                .WORD  $A9E4
                .ENDM

                .MACRO  _InitPack
                .WORD  $A9E5
                .ENDM

                .MACRO  _InitMath
                .WORD  $A9E6
                .ENDM

                .MACRO  _Pack0
                .WORD  $A9E7
                .ENDM

                .MACRO  _Pack1
                .WORD  $A9E8
                .ENDM

                .MACRO  _Pack2
                .WORD  $A9E9
                .ENDM

                .MACRO  _Pack3
                .WORD  $A9EA
                .ENDM

                .MACRO  _FP68K          ;same as Pack4
                .WORD  $A9EB
                .ENDM

                .MACRO  _Pack4
                .WORD  $A9EB
                .ENDM

                .MACRO  _Pack5
                .WORD  $A9EC
                .ENDM

                .MACRO  _Pack6
                .WORD  $A9ED
                .ENDM

                .MACRO  _Pack7
                .WORD  $A9EE
                .ENDM

                .MACRO  _PtrAndHa
                .WORD  $A9EF
                .ENDM

                .MACRO  _LoadSeg
                .WORD  $A9F0
                .ENDM

                .MACRO  _UnLoadSe
                .WORD  $A9F1
                .ENDM

                .MACRO  _Launch
                .WORD  $A9F2
                .ENDM

                .MACRO  _Chain
                .WORD  $A9F3
                .ENDM

                .MACRO  _ExitToSh
                .WORD  $A9F4
                .ENDM

                .MACRO  _GetAppPa
                .WORD  $A9F5
                .ENDM


                .MACRO _GetResFil
                .WORD  $A9F6
                .ENDM

                .MACRO _SetResFil
                .WORD  $A9F7
                .ENDM

                .MACRO _InfoScra
                .WORD  $A9F9
                .ENDM

                .MACRO _UnlodeSc
                .WORD  $A9FA
                .ENDM

                .MACRO _LodeScra
                .WORD  $A9FB
                .ENDM

                .MACRO _ZeroScra
                .WORD  $A9FC
                .ENDM

                .MACRO _GetScrap
                .WORD  $A9FD
                .ENDM

                .MACRO _PutScrap
                .WORD  $A9FE
                .ENDM


            .MACRO  _TESetText
                .WORD  $A9CF
                .ENDM

                .MACRO  _TECalTex
                .WORD  $A9D0
                .ENDM

                .MACRO  _TESetSel
                .WORD  $A9D1
                .ENDM

                .MACRO  _TENew
  sumacc/ws/traps/   775      0     12           0  3472707204   7007 sumacc/ws/traps/ostraps   444      0     12      333617  3472707204  10563 3. "6F^5D!$^			f .NOLIST

; File OsTraps.text
;
;  implements the interface for register based traps.
;  created 23-Nov-83 by Rony Sebok to contain the contents of
;  MemTraps.text and MacMisc.text
;   Modification history:
;       12 Apr 84  JTC  Hacked up -- get it?
;
; from MemTraps.text
;--------------------------------------------------------
;
;  Memory Manager Traps -- implement "Unit HeapZone"
;  (needed by QuickDraw Pascal clients) by trapping
;  to the Mac OS.
;
;  written by Andy Hertzfeld  May 5,1982
;  radically revised by Martin Haeberli  Spring, 1983
;  distorted to reality by Larry Kenyon, 24 September 1983
;
;  Modification History:
;  MPH  25 April 83     Added error code returns to
;                       HLock, HUnLock, HPurge, HNoPurge.
;                       Added entry points for
;                       ApplicZone, SystemZone.
;  LAK  25 Sept 83      Updated to reflect 7.0 version memory manager
;                       and generally reorganized.
;  LAK  26 Sept 83      Added GZCritical and GZSaveHnd.
;  RS   21 Nov  83      changed .DEFs to .PROC or .FUNC so linker would be able
;                       to throw out those routines not used by the pascal prog
;--------------------------------------------------------

                .NoList
                .INCLUDE tlasm/SysEqu.Text
                .INCLUDE tlasm/SysErr.Text
                .INCLUDE tlasm/SysMacs.Text
                .INCLUDE tlasm/GrafEqu.Text
                .INCLUDE tlasm/ToolEqu.Text
                .INCLUDE tlasm/ToolMacs.Text
                .INCLUDE tlasm/FSEqu.Text
                .INCLUDE tlasm/HeapDefs.text
                .List


                .MACRO OsCall
                Move.L  (SP)+,A1        ;get return address
                Move.W  (SP)+,D0        ;Get ASync flag.
                Move.L  (SP)+,A0        ;get param pointer.
                BNE.S   @1

                %1                      ;tell OS to do it Synchronously
                BrA.S   @2

@1              %1      ,ASYNC          ;Tell OS to do it Asynchronously
@2              Move.W  D0,(SP)         ;save result
                Jmp     (A1)            ;return to caller
                .ENDM


;----------------------------------------------------------------------
;
; Procedure SetApplBase;
;
; Initialize the Application Zone while growing the System zone.
;
; Arguments:
;       A0 - ptr to new application zone base.
;
; Registers:
;       D0 - result code from SetApplBase (always 0)
;
                .PROC SetApplBase
                .REF    SaveRetA1
;
                Move.L  (SP)+,A1        ;return address
                Move.L  (SP)+,A0        ;startPtr
                _SetApplBase            ;ask OS to do request
                JMP   SaveRetA1       ;save 0 result code and return via A1


;----------------------------------------------------------------------
;
; Procedure InitApplZone;
;
; Initialize the Application Zone
;
; Arguments:
;       None
;
; Registers:
;       D0 - result code from InitApplZone
;
                .PROC InitApplZone
                .REF    Save
;
                _InitApplZone           ;ask OS to do request
                JMP   Save


;----------------------------------------------------------------------
;
; Procedure InitZone(growProc:           ProcPtr;
;                    moreMasters:        Integer;
;                    limitPtr,startPtr : Ptr);
; Creates and initializes a fresh zone from unstructured storage
;
; Arguments:
;       growProc:       points to grow procedure for this zone
;       moreMasters:    number of master pointers to create at a time
;       limitPtr:       points one past last byte of raw storage
;       startPtr:       points to first byte of raw storage
;
; Registers:
;       D0 - result code from InitApplZone
;
                .PROC InitZone
                .REF    SaveRetA1
;
                MOVE.L  (SP)+,A1        ;return address
                Move.L  SP,A0           ;stack parameters form req blk
                _InitZone
                Add     #14,SP          ;strip parameters
                JMP   SaveRetA1       ;save 0 result code and return via A1



;----------------------------------------------------------------------
;
; Function GetZone: THz;
;
; Returns value of theZone
;
; Arguments:
;       None
;
; Result:
;                       current value of theZone pointer
;
; Registers:
;       A1 -            holds return address
;
                .FUNC GetZone
                .REF    Save

                _GetZone                ;ask OS to do request
                Move.L  A0,4(SP)        ;save result
                JMP   Save            ;Set error code and return


;----------------------------------------------------------------------
;
; Procedure SetZone(hz: THz);
;
; Sets theZone to hz
;
; Arguments:
;       hz:             holds new value for theZone
;
; Registers:
;       A2 -            holds return address
;
                .PROC SetZone
                .REF    SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;zone pointer
                _SetZone                ;ask OS to do request
                JMP   SaveRetA1       ;save 0 result code and return via A1



;----------------------------------------------------------------------
;
; Function ApplicZone: THz;
;
; Returns value of ApplZone
;
; Arguments:
;       None
;
; Result:
;                       current value of ApplZone pointer
;
; Registers:
;       A1 -            holds return address
;
                .FUNC ApplicZone
                .REF    Save0

                Move.L  ApplZone,4(SP)
                JMP   Save0           ;Set error code 0 and return



;----------------------------------------------------------------------
;
; Function SystemZone: THz;
;
; Returns value of SysZone
;
; Arguments:
;       None
;
; Result:
;                       current value of SysZone pointer
;
; Registers:
;       A1 -            holds return address
;
                .FUNC SystemZone
                .REF    Save0

                Move.L  SysZone,4(SP)
                JMP   Save0           ;Set error code and return


;----------------------------------------------------------------------
;
; Function CompactMem(cbNeeded: Size): Size;
;
; Compact the heap until a free block with cbNeeded bytes is found or
; until the end of the zone is reached.  Returns cbFound, the size of
; the largest block found.
;
; Arguments:
;       cbNeeded:       size of block needed
;
; Result:
;                       size of largest block found, in bytes
;
; Registers:
;       D0 - number of bytes needed/number of bytes in biggest block
;
                .FUNC CompactMem
                .DEF    Save0RetA1

                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,D0        ;get cbNeeded
                _CompactMem             ;tell OS to do it
                Move.L  D0,(SP)         ;save result
                BrA.S   Save0RetA1      ;set 0 result code and return via A1


;----------------------------------------------------------------------
;
; Procedures Save, Save0, Save0RetA1, SaveRetA1;
;
; Saves D0 into ErrorCode. Alternately sets D0 to 0 first. Alternately returns
; via A1.  A1 is destroyed in any case . . .
;
; Arguments:
;       D0:             Error code to be saved in ErrorCode
;
; Result:
;       None
;
; Registers:
;       A1 - points to ErrorCode
;
                .DEF    ErrorCode
                .DEF    SaveRetA1
                .DEF    Save
                .DEF    Save0


ErrorCode
               .Word   0


Save0RetA1
                MoveQ   #0,D0           ;this entry zeroes result, returns via A1

SaveRetA1
                Move.L  A1,-(SP)        ;A1 has return address

Save
                LEA     ErrorCode,A1    ;points to LastPH save location
                Move.W  D0,(A1)         ;save error

                RTS                     ;Return

Save0
                MoveQ   #0,D0           ;this entry zeroes the result
                BrA     Save



;----------------------------------------------------------------------
;
; Procedure PurgeMem(cbNeeded: Size);
;
; Purge purgeable blocks in the heap until a free block of cbNeeded bytes
; is found, or until the end of the zone is reached.
;
; Arguments:
;       cbNeeded:       size of block needed
;
; Result:
;
; Registers:
;       A1 - return address
;       D0 - number of bytes needed/error code
;
                .PROC PurgeMem
                .REF    SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,D0        ;get cbNeeded
                _PurgeMem               ;tell OS to do it
                JMP     SaveRetA1       ;save result code and return via A1


;----------------------------------------------------------------------
;
; Function FreeMem: LongInt;
;
; Returns number of free bytes in the current zone
;
; Arguments:
;       None
;
; Result:
;                       number of free bytes in the current zone
;
; Registers:
;       D0 -            holds result value
;
                .FUNC FreeMem
                .REF    Save0

                _FreeMem                ;ask OS to do request
                Move.L  D0,4(SP)        ;save result
                JMP     Save0           ;set 0 error code and return



;----------------------------------------------------------------------
;
; Procedure ResrvMem(cbNeeded: Size);
;
; Purge purgeable blocks in the heap until a free block of cbNeeded bytes
; is found, or until the end of the zone is reached.
;
; Arguments:
;       cbNeeded:       size of block needed
;
; Result:
;
; Registers:
;       A1 - return address
;       D0 - number of bytes needed/error code
;
                .PROC ResrvMem
                .REF    SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,D0        ;get cbNeeded
                _ResrvMem               ;tell OS to do it
                JMP     SaveRetA1       ;save result code and return via A1




;----------------------------------------------------------------------
;
; Function MaxMem(VAR grow: Size): Size;
;
; Return the size of the maximum block which may be allocated without
; growing the zone.  Also return the maximum number of bytes by which the
; zone may be grown.
;
; Arguments:
;       None
;
; Result:
;                       size of largest available block in bytes
;       grow:           maximum growth allowed in current zone
;
; Registers:
;       A0 - grow/pointer to VAR grow
;       A1 - return address
;       D0 - number of bytes in largest free block
;
                .FUNC MaxMem

                .REF    Save0RetA1

                Move.L  (SP)+,A1        ;get return address
                _MaxMem                 ;let OS do it
                Move.L  A0,D1           ;max growth allowed
                Move.L  (SP)+,A0        ;get the pointer to VAR grow
                Move.L  D1,(A0)
                Move.L  D0,(SP)         ;save result
                JMP     Save0RetA1      ;set 0 result code and return via A1



;----------------------------------------------------------------------
;
; Function TopMem: Ptr;
;
; Returns the address of the byte after the last byte of real memory.
;
; Arguments:
;       None
;
; Result:
;       Ptr:            Address of byte just following last byte of
;                         real memory
;
; Registers:
;       D0 - result code
;
                .FUNC TopMem
                .REF    Save0

                Move.L  MemTop,4(SP)    ;set function result
                JMP     Save0           ;set result and return



;----------------------------------------------------------------------
;
; Procedure SetGrowZone(growZone: ProcPtr);
;
; Sets the current heap zone's GrowZone procedure to growZone
;
; Arguments:
;       growZone:       new value for this zone's GrowZone proc
;
; Registers:
;       A1 -            holds return address
;
                .PROC SetGrowZone
                .REF    SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;Procedure pointer
                _SetGrowZone            ;ask OS to do request
                JMP     SaveRetA1       ;save result code and return via A1



;----------------------------------------------------------------------
;
; Procedure SetApplLimit(zoneLimit: Ptr);
;
; Sets the application zone's limit to zoneLimit
;
; Arguments:
;       zoneLimit:      new value for application zone limit
;
; Registers:
;       A2 -            holds return address
;
                .PROC SetApplLimit
                .REF    SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;zone pointer
                _SetApplLimit           ;ask OS to do request
                JMP     SaveRetA1       ;save 0 result code and return via A1


;PROCEDURE MaxApplZone;
;
;grows the application zone to as large as allowable (by applLimit)

                .PROC MaxApplZone

                MOVE.L  ApplLimit,A0
                LEA     HeapEnd,A1
                MOVE.L  A0,D0
                SUB.L   (A1),D0                 ;bytes to grow
                MOVEQ   #MinFree,D2
                CMP.L   D2,D0
                BCS.S   @1                      ;br if no room to grow

                MOVE.L  (A1),A1                 ;point to current limit blk
                MOVE.L  A0,HeapEnd              ;set HeapEnd=ApplLimit
                MOVE.L  D0,(A1)                 ;inc size of current limit blk
                CLR.B   (A1)                    ;just to be sure

                MOVE.L  ApplZone,A1             ;adjust heap zone header
                MOVE.L  A0,(A1)                 ;new limit block (bklim)
                MOVE.L  D2,(A0)                 ;limit block size is always min
                ADD.L   D0,ZCBFree(A1)          ;increase free count

@1              RTS



;----------------------------------------------------------------------
;
; Function NewPtr(byteCount: Size): Ptr;
;
; Returns a pointer to a newly allocated non-relocatable block of
; memory byteCount bytes long.
;
; Arguments:
;       byteCount:      number of bytes needed
;
; Result:
;                       pointer to new block, or NIL, if not enough room
;
; Registers:
;       A0 - points to new block, or NIL
;       A1 - return address
;       D0 - number of bytes needed/error code
;
                .FUNC NewPtr
                .REF    SaveRetA1

                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,D0        ;get the byte count
                _NewPtr                 ;ask OS to do request
                Move.L  A0,(SP)         ;return result ptr on stack
               JMP     SaveRetA1       ;save result code and return via A1



;----------------------------------------------------------------------
;
; Procedure DisposPtr(p: Ptr);
;
; Releases the block pointed to by p.
;
; Arguments:
;       p:              pointer to block to be freed
;
; Result:
;       None
;
; Registers:
;       A0 - points to block to be freed
;       A1 - return address
;       D0 - error code
;
                .PROC DisposPtr
                .REF  SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get parameter
                _DisposPtr              ;let OS do work
                JMP     SaveRetA1       ;save result code and return via A1



;----------------------------------------------------------------------
;
; Function GetPtrSize(p: Ptr): Size;
;
; Returns number of bytes in the non-relocatable block pointed to by p.
;
; Arguments:
;       p:              points to non-relocatable block
;
; Result:
;                       number of bytes in block
;
; Registers:
;       A0 -            points to block
;       A1 -            holds return address
;       D0 -            number of bytes in block
;
                .FUNC GetPtrSize
                .REF  SaveRetA1
                .REF  Save0RetA1

                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get the pointer
                _GetPtrSize             ;let OS do it
                Move.L  D0,(SP)         ;return result on stack
                BPl.S   @1              ;true sizes are positive
                Clr.L   (SP)            ;return 0 on errors
                JMP     SaveRetA1       ;and set error code

@1              JMP     Save0RetA1        ;set 0 result code and return via A1


;----------------------------------------------------------------------
;
; Procedure SetPtrSize(p: Ptr; newSize: Size);
;
; Sets the size of the non-relocatable block pointed to by p to newSize
; bytes.
;
; Arguments:
;       p:              points to non-relocatable block
;       newSize:        number of bytes needed in block
;
; Result:
;       None
;
; Registers:
;       A0 -            points to block
;       A1 -            holds return address
;       D0 -            number of bytes needed/error code
;
                .PROC SetPtrSize
                .REF SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,D0        ;get the new size
                Move.L  (SP)+,A0        ;get the pointer
                _SetPtrSize             ;let OS do it
                JMP     SaveRetA1       ;save result code and return via A1



;----------------------------------------------------------------------
;
; Function  PtrZone(p: Ptr): THz;
;
; Recovers the reference to the heap zone object, given a pointer to
; a block.
;
; Arguments:
;       p:              points to non-relocatable block
;
; Result:
;                       pointer to the zone object for the zone
;                       containing the referenced block.
;
; Registers:
;       A0 -            points to block/points to block's zone object
;       A1 -            holds return address
;       D0 -            error code
;
                .FUNC PtrZone
                .REF SaveRetA1

                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get the pointer
                _PtrZone                ;let OS do it
                Move.L  A0,(SP)         ;save zone object pointer
                JMP     SaveRetA1       ;save result code and return via A1



;----------------------------------------------------------------------
;
; Function  NewHandle(byteCount: Size): Handle;
;
; Returns a handle to a newly allocated relocatable block
; byteCount bytes long.
;
; Arguments:
;       byteCount:      number of bytes needed
;
; Result:
;                       handle to new block, or NIL, if not enough room
;
; Registers:
;       A0 - handle for new block, or NIL
;       A1 - return address
;       D0 - number of bytes needed/error code
;
                .FUNC NewHandle
                .REF SaveRetA1

                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,D0        ;get the byte count
                _NewHandle              ;ask OS to do request
                Move.L  A0,(SP)         ;return result handle on stack
                JMP     SaveRetA1       ;save result code and return via A1


;----------------------------------------------------------------------
;
; Procedure DisposHandle(h: Handle);
;
; Releases the block referenced by h.
;
; Arguments:
;       h:              handle for the block to be freed
;
; Result:
;       None
;
; Registers:
;       A0 - handle for block to be freed
;       A1 - return address
;       D0 - error code
;
                .PROC DisposHandle
                .REF SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get handle
                _DisposHandle           ;let OS do work
               JMP     SaveRetA1        ;save result code and return via A1



;----------------------------------------------------------------------
;
; Function  GetHandleSize(h: Handle): Size;
;
; Returns number of bytes in the relocatable block referenced by h.
;
; Arguments:
;       h:              handle for relocatable block
;
; Result:
;                       number of bytes in block
;
; Registers:
;       A0 -            points to block
;       A1 -            holds return address
;       D0 -            number of bytes in block
;
                .FUNC GetHandleSize
                .REF SaveRetA1
                .REF Save0RetA1

                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get the handle
                _GetHandleSize          ;let OS do it
                Move.L  D0,(SP)         ;return result on stack
                BPl.S   @1              ;real sizes are positive
                Clr.L   (SP)            ;on errors, return 0
                JMP     SaveRetA1       ;and set error code correctly

@1              JMP     Save0RetA1      ;if result is a size, set 0 result code


;----------------------------------------------------------------------
;
; Procedure SetHandleSize(h: Handle; newSize: Size);
;
; Sets the size of the relocatable block referred to by h to newSize
; bytes.
;
; Arguments:
;       h:              refers to relocatable block
;       newSize:        number of bytes needed in block
;
; Result:
;       None
;
; Registers:
;       A0 -            points to block
;       A1 -            holds return address
;       D0 -            number of bytes needed/error code
;
                .PROC SetHandleSize
                .REF  SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,D0        ;get the new size
                Move.L  (SP)+,A0        ;get the handle
                _SetHandleSize          ;let OS do it
                JMP     SaveRetA1       ;save result code and return via A1



;----------------------------------------------------------------------
;
; Function  HandleZone(h: Handle): THz;
;
; Recovers the reference to the heap zone object, given a handle for
; a block.
;
; Arguments:
;       h:              refers to relocatable block
;
; Result:
;                       pointer to the zone object for the zone
;                       containing the referenced block.
;
; Registers:
;       A0 -            handle for block/points to block's zone object
;       A1 -            holds return address
;       D0 -            error code
;
                .FUNC HandleZone
                .REF  SaveRetA1

                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get the handle
                _HandleZone             ;let OS do it
                Move.L  A0,(SP)         ;save zone object pointer
                JMP     SaveRetA1       ;save result code and return via A1


;----------------------------------------------------------------------
;
; Function  RecoverHandle(p: Ptr): Handle;
;
; Recovers the handle for a relocatable block, given a pointer to the
; relocatable block.  theZone must be set to reflect the zone containing
; this relocatable block.
;
; Arguments:
;       rp:             points to relocatable block
;
; Result:
;                       handle for the referenced block.
;
; Registers:
;       A0 -            pointer to relocatable block/handle for block
;       A1 -            holds return address
;       D0 -            error code
;
                .FUNC RecoverHandle
                .REF  Save0RetA1

                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get the reloc block pointer
                _RecoverHandle          ;let OS do it
                Move.L  A0,(SP)         ;save handle for block
                JMP     Save0RetA1      ;save result code and return via A1
                                        ;(OS fails to set D0 for this call so
                                        ; we unconditionally set result to 0)


;----------------------------------------------------------------------
;
; Procedure EmptyHandle(h: Handle);
;
; Explicitly purges the relocatable block referred to by h.
;
; Arguments:
;       h:              refers to relocatable block
;
; Result:
;       None
;
; Registers:
;       A0 -            handle for block
;       A1 -            holds return address
;       D0 -            error code
;
                .PROC EmptyHandle
                .REF  SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get the handle
                _EmptyHandle            ;let OS do it
                JMP     SaveRetA1       ;save result code and return via A1



;----------------------------------------------------------------------
;
; Procedure ReAllocHandle(h: Handle; byteCount: Size);
;
; Allocates a relocatable block, using an existing handle.
; If the handle is not already empty, the handle is emptied first,
; then allocated.
;
; Arguments:
;       h:              refers to relocatable block
;       byteCount:      number of bytes needed in the new block
;
; Result:
;       None
;
; Registers:
;       A0 -            handle for block/points to block's zone object
;       A1 -            holds return address
;       D0 -            new block size/error code
;
                .PROC ReAllocHandle
                .REF  SaveRetA1
;
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,D0        ;get the new size
                Move.L  (SP)+,A0        ;get the handle
                _ReAllocHandle          ;let OS do it
                JMP     SaveRetA1       ;save result code and return via A1



;----------------------------------------------------------------------
;
; Procedure HLock(h: Handle);
; Procedure HUnLock(h: Handle);
; Procedure HPurge(h: Handle);
; Procedure HNoPurge(h: Handle);
;
; These procedure are used to change the lock and purge attributes of
; the relocatable block referred to by h.
;
; Arguments:
;       h:              handle for relocatable block
;
; Registers:
;       A0 -            handle for relocatable block
;       A1 -            holds return address
;
                .PROC HLock
                .REF  SaveRetA1
;
                Move.L  (SP)+,A1        ;return address
                Move.L  (SP)+,A0        ;handle for block
                _HLock                  ;let OS to do it.
                JMP     SaveRetA1       ;save result code and return via A1

                .PROC HUnLock
                .REF  SaveRetA1
;
                Move.L  (SP)+,A1        ;return address
                Move.L  (SP)+,A0        ;handle for block
                _HUnLock                ;let OS to do it.
                JMP     SaveRetA1       ;save result code and return via A1

                .PROC HPurge
                .REF  SaveRetA1
;
                Move.L  (SP)+,A1        ;return address
                Move.L  (SP)+,A0        ;handle for block
                _HPurge                 ;let OS to do it.
                JMP     SaveRetA1       ;save result code and return via A1

                .PROC HNoPurge
                .REF  SaveRetA1
;
                Move.L  (SP)+,A1        ;return address
                Move.L  (SP)+,A0        ;handle for block
                _HNoPurge               ;let OS to do it.
                JMP     SaveRetA1       ;save result code and return via A1


;
;PROCEDURE MoreMasters;
;

           .PROC MoreMasters
           .REF Save

           _MoreMasters
           JMP  Save


;----------------------------------------------------------------------
;
; Procedure BlockMove(srcPtr, destPtr: Ptr; byteCount: Size);
;
; Marks the relocatable block referred to by h as not purgeable.
;
; Arguments:
;       srcPtr:         source pointer
;       destPtr:        destination pointer
;       byteCount:      bytecount for move
;
; Registers:
;       A0 -            source pointer
;       A1 -            destination pointer
;       D0 -            bytecount for move
;       D1 -            holds return address
;
                .PROC BlockMove
                .REF  SaveRetA1
;
                Move.L  (SP)+,D1        ;return address
                Move.L  (SP)+,D0        ;byte count
                Move.L  (SP)+,A1        ;destination ptr
                Move.L  (SP)+,A0        ;source ptr
                _BlockMove              ;let OS to do it.
                Move.L  D1,A1           ;return address
                JMP     SaveRetA1       ;save result code and return via A1



;----------------------------------------------------------------------
;
; Function MemError: OsErr;
;
; Returns the error observed by the most recent memory manager call.
;
; Arguments:
;       None
;
; Registers:
;
                .FUNC MemError
                .REF    ErrorCode

                Move.W  ErrorCode,4(SP) ;last error
                RTS


;----------------------------------------------------------------------
;
; Function  GZCritical: BOOLEAN;
; Function  GZSaveHnd: Handle;
;
; These routines are provided to help Pascal GrowZone functions make
; decisions.
;
; Arguments:
;       None
;
; Registers:
;
                .FUNC GZSaveHnd

                Move.L  GZRootHnd,4(SP) ;handle which should not be touched
                RTS

                .FUNC GZCritical
                Move.L  (SP)+,A1        ;return address
                Clr.W   (SP)            ;assume non-critical
                Move.L  GZMoveHnd,D0
                BEq.S   CritCase
                Cmp.L   GZRootHnd,D0
                BNE.S   NonCrit
CritCase
                Move.W  #$0100,(SP)     ;return true

NonCrit         Jmp     (A1)

;
; from MACMISC.TEXT
;  Miscellanous MacIntosh Interface Routines
;  this version for Traps based system
;  It also includes storTraps
;
;
;  written by Andy Hertzfeld  16-Oct-82
;
;  Modification History
;
;    25-Jan-83  AJH  Modified for new file/IO system
;    12-Jun-83  AJH  Added OpenDeskAcc
;
;------------------------------------------------


;
;FUNCTION VInstall(VBLBlockPtr: VBLCBPtr): OsErr;
;

            .FUNC VInstall

            MOVE.L  (SP)+,A1                ;get the return address
            MOVE.L  (SP)+,A0                ;addr of vertical retrace control blk
            MOVE.L  A1,-(SP)                ;restore return address

            _VInstall
            MOVE.W  D0,4(SP)                ;return error

            RTS

;
;FUNCTION VRemove(VBLBlockPtr: VBLCBPtr): OsErr;
;

            .FUNC VRemove

            MOVE.L  (SP)+,A1                ;get the return address
            MOVE.L  (SP)+,A0                ;addr of vertical retrace control blk
            MOVE.L  A1,-(SP)                ;restore return address

            _VRemove
            MOVE.W  D0,4(SP)                ;return error

            RTS

;
;FUNCTION DrvrInstall(name: OsStr255;  drvrRefNum: INTEGER): OsErr;
; InstallDriver installs a driver of the specified name, into the specified
; unit.
;
                .PROC   DrvrInstall,2

                MOVE.W  4(SP),D0        ;get unit number
                MOVE.L  6(SP),A0        ;get the fileName ptr
                _DrvrInstall            ;install it

                MOVE.L  (SP)+,A0        ;get return address
                ADDQ    #6,SP           ;strip parameters
                MOVE.W  D0,(SP)         ;return error
                JMP     (A0)            ;return to caller

;
;FUNCTION DrvrRemove(drvrRefNum: INTEGER): OsErr;
;

                .PROC   DrvrRemove,2

                MOVE.W  4(SP),D0        ;get driver refNum
                _DrvrRemove             ;remove it

                MOVE.L  (SP)+,A0        ;get return address
                ADDQ    #2,SP           ;strip parameters
                MOVE.W  D0,(SP)         ;return error
                JMP     (A0)            ;return to caller

;
; FUNCTION OpenDriver(driverName: OsStr255): INTEGER;
;
;   OpenDriver opens the driver of a given name, returning its refNum
;
                .FUNC   OpenDriver,1

                MOVE.L  4(SP),A0           ;get a pointer to the name
                MOVEQ   #<IOQELSIZE/2>-1,D0
@1              CLR.W   -(SP)
                DBRA    D0,@1

                MOVE.L  A0,IOFileName(SP)  ;set up name
                CLR.B   IOPermssn(SP)      ; open for read/write
                MOVE.L  SP,A0           ;point to it
                _Open                   ;open the driver
                BNE.S   BadOpen         ;if an error, don't return refNum

                MOVE.W  IORefNum(SP),D0        ;get the refNum
DoneOpen
                ADD     #IOQELSIZE,SP          ;pop off command buffer
                MOVE    D0,8(SP)               ;return the refNum

                MOVE.L  (SP)+,(SP)      ;strip return address
                RTS
BadOpen
                MOVEQ   #0,D0
                BRA.S   DoneOpen
;
; PROCEDURE CloseDriver(refNum: INTEGER);
;
;   CloseDriver closes the driver with the specified refNum
;
                .PROC   CloseDriver,1

                MOVE.W  4(SP),D0                ;get the refNum
                SUB     #30,SP                  ;get space for param block
                MOVE.W  D0,IORefNum(SP)         ;set up refNum
                MOVE.L  SP,A0
                _Close                          ;close it!
                ADD     #30,SP                  ;pop off param block

                MOVE.L  (SP)+,A0
                ADDQ    #2,SP
                JMP     (A0)

;
;FUNCTION  SerReset(refNum: INTEGER; serConfig: INTEGER): OSErr;
;

        .FUNC   SerReset

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  10(A6),IORefNum(A0)     ; refnum
        MOVE.W  #8,CSCode(A0)           ; code for Reset
        MOVE.W  8(A6),CSParam(A0)       ;the configuration

        _Control
        MOVE    D0,12(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ    #4,SP                   ; fix up stack
        JMP     (A1)

;
;FUNCTION  SerSetBuf(refNum: INTEGER; serBPtr: Ptr; serBLen: INTEGER): OSErr;
;
        .FUNC   SerSetBuf

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  14(A6),IORefNum(A0)     ; refnum
        MOVE.W  #9,CSCode(A0)           ; code for Set buffer
        MOVE.L  10(A6),CSParam(A0)      ;the ptr to the buffer
        MOVE.W  8(A6),CSParam+4(A0)     ;the buffer length

        _Control
        MOVE    D0,16(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ    #8,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION  SerHShake(refNum: INTEGER; flags: SerShk): OSErr;
;
        .FUNC   SerHShake

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  12(A6),IORefNum(A0)     ; refnum
        MOVE.W  #10,CSCode(A0)          ; code for setting handshake options
        MOVE.L  8(A6),A1                ;ptr to flags record
        MOVE.L  (A1)+,CSParam(A0)       ;copy the first 4 bytes
        MOVE.L  (A1),CSParam+4(A0)      ;copy the second 4 bytes

        _Control
        MOVE    D0,14(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ    #6,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION  SerSetBrk(refNum: INTEGER): OSErr;
;
        .FUNC   SerSetBrk
        .DEF    SetClr

        MOVE.W  #12,D0

SetClr
        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  8(A6),IORefNum(A0)      ; refnum
        MOVE.W  D0,CSCode(A0)          ; code for setting break

        _Control
        MOVE    D0,10(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ    #2,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION  SerClrBrk(refNum: INTEGER): OSErr;
;
        .FUNC   SerClrBrk
        .REF    SetClr

        MOVE.W  #11,D0                  ;cscode for clearing break
        JMP     SetClr                  ;got to common set/clr break code


;
;FUNCTION  SerGetBuf(refNum: INTEGER; VAR count: LongInt): OSErr;
;
        .FUNC SerGetBuf

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  12(A6),IORefNum(A0)     ; refnum
        MOVE.W  #2,CSCode(A0)           ; cscode for get buf
        _Status
        MOVE    D0,14(A6)               ; return the result code
        MOVE.L  8(A6),A1                ; ptr to where to put count
        MOVE.L  CSParam(A0),(A1)        ;return the count

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ    #6,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION  SerStatus(refNum: INTEGER; VAR serSta: SerStaRec): OSErr;
;

        .FUNC SerStatus

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  12(A6),IORefNum(A0)     ; refnum
        MOVE.W  #8,CSCode(A0)           ; cscode for get buf
        _Status
        MOVE    D0,14(A6)               ; return the result code
        MOVE.L  8(A6),A1                ; ptr to where to put the status bytes
        MOVE.L  CSParam(A0),(A1)+       ;return the first 4 bytes
        MOVE.W  CSParam+4(A0),(A1)      ;return the next 2 bytes

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ    #6,SP                   ; fix up stack
        JMP     (A1)


;FUNCTION DiskEject(drvnum: INTEGER): OSErr;
;

        .FUNC   DiskEject

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  #DskRfN,IORefNum(A0)    ; refnum of the Sony Disk
        MOVE.W  #EjectCode,CSCode(A0)   ; code for Eject
        MOVE.W  8(A6),IODrvNum(A0)       ;the drvNum of drv to be eject

        _Control
        MOVE    D0,10(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ    #2,SP                   ; fix up stack
        JMP     (A1)

;FUNCTION SetTagBuffer(buffPtr: Ptr): OSErr;
;

        .FUNC   SetTagBuffer

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  #DskRfN,IORefNum(A0)    ; refnum of the Sony Disk
        MOVE.W  #TgBuffCode,CSCode(A0)  ; code for SetTagBuffer
        MOVE.L  8(A6),CSParam(A0)       ;CSParam is the buffptr

        _Control
        MOVE    D0,12(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ    #4,SP                   ; fix up stack
        JMP     (A1)

;FUNCTION DriveStatus(drvNum: INTEGER; VAR status: DrvSts): OSErr;
;

        .FUNC   DriveStatus

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  #DskRfN,IORefNum(A0)    ; refnum of the Sony Disk
        MOVE.W  #drvStsCode,CSCode(A0)  ; code for SetTagBuffer
        MOVE.W  12(A6),IODrvNum(A0)     ;the drvNum of drv to be ejected

        _Status
        MOVE    D0,14(A6)               ; return the result code
        MOVE.L  8(A6),A1                ; ptr to where to put the status bytes
        LEA     CSParam(A0),A0          ;ptr from where to get status bytes
        MOVE.L  #22,D0                  ;number of bytes to move
        _BlockMove

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ    #6,SP                   ; fix up stack
        JMP     (A1)

;
;FUNCTION  RamSDOpen(whichPort: SPortSel; rsrcType: OsType; rsrcID: INTEGER): OSErr;
;PROCEDURE  RamSDClose(whichPort: SPortSel);
;
;RamSDOpen - loads and installs the RAM serial driver
; the serial driver is in the application's resource file with type rsrcType
; and ID rsrcID
;whichPort is either SPortA or SPort
;

                    .FUNC RamSDOpen
                    .DEF RamSDClose

            LINK        A6,#-IOQELSIZE          ;make room for command block
            MOVEM.L     D2-D7/A2-A4,-(SP)       ;save regs
            CLR.W       16(A6)                  ;assume no error

            ;get the handle/ptr to the driver and lock it
            ;don't bother if it is already loaded
            MOVE.L      RSDHndl,D4          ;drvr or 0 if not loaded
            BNE.S       haveD               ;it's already in
            SUBQ        #4,SP               ;save space for handle
            MOVE.L      10(A6),-(SP)        ;push type
            MOVE.W      8(A6),-(SP)         ;push ID number
            _GetResource
            MOVE.L      (SP),D3             ;did it get the handle?
            BEQ         badRamSD            ;no, error
            _DetachResource                 ;make it my handle
            MOVE.L      D3,A3               ;handle to the RAM driver
            BSET        #Lock,(A3)          ;lock it
            LEA         RSDHndl,A0          ;ptr to where I save the handle
            MOVE.L      A3,(A0)             ;save the handle for later disposal

haveD       MOVE.L      RSDHndl,A3          ;get the handle to the driver
            MOVE.L      (A3),A3             ;ptr to the driver

            ;now close the appropriate ROM driver  (both the in and the out
            ;drivers should be closed)
            LEA         -IOQELSIZE(A6),A0   ;get back the ptr to the param blk
            MOVE.B      14(A6),D1           ;the value of whichPort
            BSR         clsPorts

            ;now install the RAM drivers into the unit table
            ;and preserve the interrupt vectors
            ;don't do this, however, if they are already installed for this port
            ;first save away the old interrupt vectors
            BSR         InitIruptPtrs       ;sets cc non-zero if already installed
            BNE.S       nowOp               ;don't reInstall, go to open
            MOVE.L      (A2)+,(A1)+         ;save away the ext/stat vector
            MOVEQ       #16,D0              ;copy over 16 bytes of the lvl2DT
            _BlockMove

            ;now save the old drivers (both in and out)
            ;and install the new ones (both in and out)
            TST.B       D1                  ;which port is it, A or B?
            BEQ.S       sdrA
            LEA         drvBIn,A2           ;ptr to where to save the drv to
            MOVE.W      DrvBNums,D0         ;refNum used for offset into UTable
            MOVE.L      #48,D1              ;offset within driver of the code
            BRA.S       doSdr

sdrA        LEA         drvAIn,A2           ;ptr to where to save the drv to
            MOVE.W      DrvANums,D0         ;refNum used for offset into UTable
            CLR.L       D1                  ;0 offset into drvr

doSdr       ADDQ.W      #1,D0               ;get the offset into the unit table
            NEG.W       D0
            ASL.W       #2,D0               ;multiply by 4 to get offset
            MOVE.L      UTableBase,A0       ;ptr to the unit table
            MOVEQ       #1,D3               ;do the following twice
instLoop    MOVE.L      0(A0,D0),A1         ;handle to device control entry
            MOVE.L      (A1),A1             ;ptr to DCE
            MOVE.L      dCtlDriver(A1),(A2)+ ;save away the driver ptr
            MOVE.L      A3,D2               ;ptr to the new driver
            ADD.L       D1,D2               ;add in the offset to the approp dev
            AND.L       #$00FFFFFF,D2       ;get rid of protect bits
            MOVE.L      D2,dCtlDriver(A1)   ;stuff in the new driver
            ADDQ.W      #4,D0               ;go onto the next (ie to output port)
            ADD.L       #24,D1              ;jump offset in driver
            DBRA        D3,instLoop         ;install the out port, then quit.

            ;now open both drivers and we are done!
nowOp       MOVEQ       #1,D2               ;want to do this twice
            LEA         -IOQELSIZE(A6),A0   ;ptr to param blk
            TST.B       14(A6)              ;which port?
            BEQ.S       AName               ;port A
            LEA         drvBNames,A1        ;ptr to names: bIn and bOut
            BRA.S       doNames

AName       LEA         drvANames,A1        ;ptr to names for portA in and out
doNames     MOVE.L      A1,IOFileName(A0)   ;stuff ptr to name
            CLR.W       IODrvNum(A0)
            CLR.B       IOPermssn(A0)       ; open for read/write
            _Open
            BNE.S       badRamSD
            CLR.W       D1
            MOVE.B      (A1)+,D1            ;the length of this string
            ADD.W       D1,A1               ;skip to next name
            DBRA        D2,doNames

okRamSD     MOVEM.L     (SP)+,D2-D7/A2-A4       ; restore those regs
            UNLK        A6

            MOVE.L      (SP)+,A0                ; get rts
            ADDQ        #8,SP
            JMP         (A0)

badRamSD    MOVE.W      #OpenErr,16(A6)
            BRA         okRamSD


;PROCEDURE  RamSDClose(whichPort: SPortSel);
;RamSDClose - closes the drivers (both in and out) for the port indicated by
;             whichPort.  It disposes of the RAM serial driver if it is no
;             longer needed (ie the other port is not open)
RamSDClose
            LINK        A6,#-IOQELSIZE      ;space for the parm block
            MOVEM.L     D2-D7/A2-A4,-(SP)   ;save regs

            ;first close the in and out drivers for this port
            LEA         -IOQELSIZE(A6),A0   ;get back the ptr to the param blk
            MOVE.B      8(A6),D1           ;the value of whichPort
            BSR         clsPorts

            ;now uninstall the RAM driver and restore interrupts of the old driver
            ;obviously don't uninstall if it is already uninstalled
            ;stuff the old driver back into the unit table
            TST.B       D1                  ;see which port it is
            BEQ.S       rstA
            MOVE.B      instB,D0            ;see if it is currently installed
            BEQ.S       clDone              ;if not, just quit
            LEA         drvBIn,A0           ;where to retrieve drvr from
            MOVE.W      drvBNums,D0         ;the drvr refNum
            BRA.S       rstEither

rstA        MOVE.B      instA,D0            ;see if portA driver is installed
            BEQ.S       clDone              ;not, so just quit
            LEA         drvAIn,A0           ;where to retrieve drvr from
            MOVE.W      drvANums,D0         ;the drvr refNum

rstEither   MOVE.L      UTableBase,A1       ;ptr to the unit table
            MOVEQ       #1,D3               ;loop around twice
            ADDQ.W      #1,D0               ;get the offset into the unit table
            NEG         D0
            ASL.W       #2,D0               ;offset for longs
rstLoop
            MOVE.L      0(A1,D0),A2         ;DCE handle
            MOVE.L      (A2),A2             ;DCE ptr
            MOVE.L      (A0)+,dCtlDriver(A2) ;put the saved drvr back
            ADDQ.W      #4,D0                ;move on to next entry
            DBRA        D3,rstLoop

            ;now restore the interrupt vectors
            BSR         InitIruptPtrs       ;sets cc non-zero if already installed
            MOVE.L      (A1)+,(A2)          ;restore extStsDT vector
            EXG         A0,A1               ;from saved to DT
            MOVEQ       #16,D0              ;number of bytes to copy
            _BlockMove

            ;now indicate the driver is no longer installed and
            ;dispose of it if it is not needed for the other port
            LEA         instA,A0
            LEA         instB,A1
            TST.B       D1                  ;see which port
            BEQ.S       itsA                ;it is port A
            EXG         A0,A1               ;its b, switch the flags

itsA        CLR.B       (A0)                ;indicate it is no longer installed
                                            ;for this port
            TST.B       (A1)                ;see if installed for the other
            BNE.S       clDone              ;yes, so all done
            MOVE.L      RSDHndl,A0          ;the handle to the driver
            _DisposHandle                   ;dispose of it
            LEA         RSDHndl,A0          ;ptr to the place the handle is stored
            CLR.L       (A0)                ;indicate no longer loaded

clDone      MOVEM.L     (SP)+,D2-D7/A2-A4   ;get back the regs
            UNLK        A6
            MOVE.L      (SP)+,A0
            ADDQ        #2,SP
            JMP         (A0)


;procedures used by RamSDOpen and Close

;clsPorts closes both the in and out driver of a serial port
;D1 is 0 if PortA desired and nonzero for PortB
;A1 pts to refNums of the in and out drivers for the desired port
;A0 pts to the parameter block

clsPorts    TST.B       D1                  ;portA or portB?
            BEQ.S       cPortA
            LEA         drvBNums,A1         ;portB, so get relevant refNums
            BRA.S       cPorts
cPortA      LEA         drvANums,A1         ;portA, so get relevant refNums
cPorts      MOVE.W      (A1)+,IORefNum(A0)  ;set up the parameter block
            _Close                          ;close the in driver
            MOVE.W      (A1),IORefNum(A0)   ;refNum of out driver
            _Close                          ;close it also
            RTS                             ;and return

;InitIruptPtrs initializes A2 to pt to the entry in the External/Status
;interrupt vector table that needs to be preserved for the particular port
;and A0 to pt to the block of 4 ptrs from the secondary interrupt vector table
;that must be preserved
;A1 is set to pt to the place to which these vectors are saved
;expects D1 to be whichPort (0 if portA, nonzero if portB)

InitIruptPtrs
            MOVE.L      A4,-(SP)            ;preserve reg
            MOVE.W      #0,D0               ;assume all ok
            LEA         ExtStsDT,A2         ;ptr to external/status interrupt vectors
            LEA         lvl2DT,A0           ;ptr to secondary irupt vectors
            TST.B       D1                  ;portA or portB?
            BEQ.S       saveA               ;portA
            LEA         instB,A4            ;installed flag for port B
            LEA         savedBIrupt,A1      ;portB, so pt to that area
            BRA.S       initIok

saveA       LEA         instA,A4            ;installed flag
            LEA         savedAIrupt,A1
            ADDQ.L      #8,A2               ;ptr t0 chan A nonmouse irupt vector
            ADD.L       #16,A0              ;ptr to chan A irupt vectors

initIok     MOVE.B      (A4),D0             ;previously installed?
            BSET        #0,(A4)             ;indicate it is now installed
            TST.W       D0                  ;indicate back up if installed
            MOVE.L      (SP)+,A4
            RTS


;globals used by RamSDOpen and RamSDClose
;
;drive names and numbers:
drvANames   .BYTE   4
            .ASCII  '.AIn'
            .BYTE   5
            .ASCII  '.AOut'
drvBNames   .BYTE   4
            .ASCII  '.BIn'
            .BYTE   5
            .ASCII  '.BOut'

drvANums    .WORD   -6          ;for AIn
            .WORD   -7          ;for AOut
drvBNums    .WORD   -8          ;for BIn
            .WORD   -9          ;for BOut

;saved interrupt vectors
;vectors saved for portA are ExtStsDT+8 (the third long in the External/Status
;Interrupt Vector Table) and the last four longs in the Secondary Interrupt
;Vector Table (ie lvl2DT+16, lvl2DT+20, lvl2DT+24, lvl2DT+28).
;vectors saved for portB are ExtStsDT (the first long in the External/Status
;Interrupt Vector Table) and the first four longs in the Secondary Interrupt
;Vector Table (ie lvl2DT+0, lvl2DT+4, lvl2DT+8, lvl2DT+12).

savedAIrupt     .BLOCK  20
savedBIrupt     .BLOCK  20

;saved ROM drivers.  when the RAM driver is installed, the ptrs to the ROM
;driver are saved here and then restored back into the device control entry
;when the RAM driver is closed.
drvAIn      .LONG
drvAOUt     .LONG
drvBIn      .LONG
drvBOut     .LONG

;saved RAM driver handle
RSDHndl     .LONG       0           ;init 0 indicates not currently loaded

;flags indicating the state of the world
;instA and instB indicate if the RAM serial driver has been installed for each port
;if both become uninstalled then the handle is disposed
instA       .BYTE   0
instB       .BYTE   0

;
;FUNCTION GetTrapAddress(trapNum: INTEGER): LongInt;
;

            .FUNC GetTrapAddress

            MOVE.L  (SP)+,A1            ;return address
            MOVE.W  (SP)+,D0            ;trap word
            MOVE.L  A1,-(SP)            ;restore return address
            _GetTrapAddress
            MOVE.L  A0,4(SP)            ;return corresponding address
            RTS
;
;PROCEDURE SetTrapAddress(trapAddr: LongInt; trapNum: INTEGER);
;
            .FUNC SetTrapAddress

            MOVE.L  (SP)+,A1            ;return address
            MOVE.W  (SP)+,D0            ;trap number
            MOVE.L  (SP)+,A0            ;address
            MOVE.L  A1,-(SP)            ;restore return address
            _SetTrapAddress
            RTS

;
;FUNCTION GetSysPPtr: SysPPtr;
;

            .FUNC   GetSysPPtr

            MOVE.L  #SysParam,4(SP)     ;get the address
            RTS


;
;FUNCTION WriteParam: OsErr;
;

            .FUNC WriteParam
            LEA     SysParam,A0             ;pointer to buffer to write to c chip
            MOVEQ   #-1,D0                  ;write out all 20 bytes
            _WriteParam
            MOVE.W  D0,4(SP)                ;return error
            RTS

;
;FUNCTION ReadDateTime(VAR time: LongInt):OsErr;
;

                .PROC   ReadDateTime,1

                MOVE.L  (SP)+,A1                ;get the return address
                MOVE.L  (SP)+,A0                ;get the parameter
                MOVE.L  A1,-(SP)                ;restore return address

                _ReadDateTime
                MOVE.W  D0,4(SP)                ;return error

                RTS

;
;PROCEDURE GetDateTime(VAR secs: LongInt);
;
;justs returns the value of the global variable Time

                .PROC   GetDateTime,1

                MOVE.L  (SP)+,A1                ;get the return address
                MOVE.L  (SP)+,A0                ;get the parameter
                MOVE.L  Time,(A0)
                JMP     (A1)

;
; FUNCTION SetDateTime(time: LongInt):OsErr;
;
;  Sets the hardware calendar/clock to the specified date/time.
;
                .PROC   SetDateTime,1

                MOVE.L  (SP)+,A0                ;get the return address
                MOVE.L  (SP)+,D0                ;get the parameter
                MOVE.L  A0,-(SP)                ;restore return address

                _SetDateTime
                MOVE.W  D0,4(SP)                ;return error

                RTS

;
;PROCEDURE SetTime(d: DateArray);
;
;Converts a date (encoded as an array of integers) to the numver of seconds
;elapsed since 00:00am, 1 Jan 1904, and stores in clock chip.

            .PROC   SetTime,1

            MOVEA.L 4(SP),A0        ;date
            _Date2Secs              ;D0 = seconds since 1904
            _SetDateTime            ;clock = seconds since 1904
            MOVEM.L (SP)+,A0-A1     ;A0=ret, A1=date
            JMP     (A0)            ;return

;
;PROCEDURE GetTime(VAR d: DateTimeRec);
;
; Reads the time from the clock as the number of seconds elapsed since 00:00am,
;1 Jan 1904, and returns the date encoded as an array of integers.

        .PROC       GetTime,1
                    MOVEQ #0,D0
                    MOVEA.L 4(SP),A0        ;ptr to date time rec
;                    _ReadDateTime
;                    MOVE.L (A0),D0
                    MOVE.L  Time,D0         ;get time from low memory
                    _Secs2Date
                    MOVE.L (A7)+,(A7)
                    RTS

;
;PROCEDURE Date2Secs(d: DateArray; VAR s: LongInt);
;
;Converts a date (encoded as an array of integers) to the number of seconds
;elapsed since 00:00am, 1 Jan 1904

        .PROC   Date2Secs,2

        MOVEA.L 8(SP),A0        ;A0=date
        _Date2Secs              ;D0=seconds elapsed
        MOVEM.L (SP)+,D1/A0-A1  ;D1=ret, A0=intptr, A1=date
        MOVE.L  D0,(A0)         ;deliver result
        MOVEA.L D1,A0           ;ret addr
        JMP     (A0)

;
;PROCEDUR Secs2Date(s: LongInt; VAR d: DateArray);
;
;Turns s, the number of seconds elapsed since 00:00am, 1Jand 1904, into an
;array of date values

        .PROC   Secs2Date,2
        MOVEM.L (SP)+,D0/A0-A1      ;D0=ret, A0=date, A1=s
        MOVE.L  D0,-(SP)            ;restore return addr
        MOVE.L  A1,D0               ;place D0=s
        _Secs2Date                  ;convert D0 to A0
        RTS


;
;PROCEDURE Delay(numTicks: LongInt; VAR finalTicks: LongInt);
;                .MACRO  _Delay

                .PROC Delay

                MOVE.L  (SP)+,D0                ;get the return address
                MOVE.L  (SP)+,A1                ;ptr to where to return result
                MOVE.L  (SP)+,A0                ;numTicks
                MOVE.L  D0,-(SP)                ;restore return address

                _Delay
                MOVE.L  D0,(A1)                ;return value of ticks after delay

                RTS


;
; PROCEDURE SysBeep(duration: INTEGER);
;Jul 13, 1984   changed this to be inline
;
;                .PROC   SysBeep,1
;
;                MOVE.W  4(SP),-(SP)             ;push duration
;                _SysBeep                        ;make the sound
;                MOVE.L  (SP)+,A0
;                ADD     #2,SP
;                JMP     (A0)


;
;FUNCTION EqualString(str1,str2: OsStr255; caseSens,diacSens: BOOLEAN):BOOLEAN;
;

                .FUNC   EqualString
                LINK      A6, #0                   ; allocate stack frame

                MOVE.L  16(A6),A0       ;ptr to str1
                MOVE.L  12(A6),A1       ;ptr to str2
                MOVEQ   #0,D0
                MOVE.B  (A0)+,D0        ;str1 length
                SWAP    D0
                MOVE.B  (A1)+,D0        ;str2 length

                ;depending on value of booleans, make proper call
                TST.B   8(A6)           ;value of diacSens
                BEQ.S   @2              ;strip diacriticals
                TST.B   10(A6)          ;value of caseSens
                BEQ.S   @1              ;ignore case
                _CmpString  ,CASE       ;both diacritical and case sensitive
                BRA.S   strDone

@1              _CmpString              ;diacritical sensitive,map to upper case
                BRA.S   strDone

                ;strip diacriticals
@2              TST.B   10(A6)          ;case sensitive?
                BEQ.S   @3
                _CmpString  ,MARKS,CASE ;ignore diacrits, case sensitive
                BRA.S   strDone

@3              _CmpString  ,MARKS      ;ignore diacrits and map to upper case

strDone         EORI.B  #1,D0           ;take opposite of what cmpString returns
                MOVE.B  D0,20(A6)       ;return result

                UNLK       A6           ; restore stack
                MOVE.L     (SP)+,A0     ; rtn addr
                ADD.L      #12,SP       ; pop args
                JMP        (A0)

;
;PROCEDURE UprString(VAR theString: OsStr255; diacSens: BOOLEAN);
;

                .PROC UprString

                MOVE.L  (SP)+,A1        ;get the return address
                MOVE.B  (SP)+,D1        ;diacritical sensitivity bool
                MOVE.L  (SP)+,A0        ;ptr to string to canonize
                MOVEQ   #0,D0
                MOVE.B  (A0)+,D0        ;string length
                MOVE.L  A1,-(SP)        ;restore return address

                ;decide which flavor of uprString to call and call it
                TST.B   D1
                BEQ.S   @1              ;ignore diacriticals
                _UprString              ;keep diacriticals
                BRA.S   @2

@1              _UprString  ,MARKS

@2              RTS

;
;FUNCTION InitUtil: OsErr;
;

            .FUNC InitUtil

            _InitUtil
            MOVE.W  D0,4(SP)                ;return error

            RTS

;queue routines
;
; PROCEDURE InitQueue(qHeader: QHdrPtr);
;

                .PROC InitQueue

                MOVE.L  (SP)+,A0        ;return address
                MOVE.L  (SP)+,A1        ;queue header ptr
                _InitQueue
                JMP     (A0)            ;return

;
;PROCEDURE Enqueue(qElement: QElemPtr; qHeader: QHdrPtr);
;
;adds qElement (A0) to queue with qHeader (A1)

        .PROC   Enqueue

        MOVE.L  4(SP),A1            ;ptr to QHeader
        MOVE.L  8(SP),A0            ;ptr ot qElem to be added
        _EnQueue
        MOVE.L  (SP)+,A0            ;return address
        ADDQ    #8,SP               ;pop off params
        JMP     (A0)                ;return

;FUNCTION Dequeue(qElement: QElemPtr; qHeader: QHdrPtr): OsErr;
;
        .PROC   Dequeue

        MOVE.L  4(SP),A1            ;ptr to QHeader
        MOVE.L  8(SP),A0            ;ptr ot qElem to be added
        _DeQueue
        MOVE.W  D0,12(SP)           ;return error
        MOVE.L  (SP)+,A0            ;return address
        ADDQ    #8,SP               ;pop off params
        JMP     (A0)                ;return

;FUNCTION GetFSQHdr: QHdrPtr;
;
        .PROC   GetFSQHdr

        MOVE.L     #FSQHdr,4(SP)
        RTS

;FUNCTION  GetDrvQHdr: QHdrPtr;
;
        .PROC   GetDrvQHdr

        MOVE.L     #DrvQHdr,4(SP)
        RTS

;FUNCTION  GetVCBQHdr: QHdrPtr;
;
        .PROC   GetVCBQHdr

        MOVE.L     #VCBQHdr,4(SP)
        RTS

;FUNCTION  GetVBLQHdr: QHdrPtr;
;
        .PROC   GetVBLQHdr

        MOVE.L     #VBLQueue,4(SP)
        RTS

;FUNCTION  GetEvQHdr: QHdrPtr;
;
        .PROC   GetEvQHdr

        MOVE.L  #EventQueue,4(SP)
        RTS


;FUNCTION GetDCtlEntry(refNum: INTEGER): DCtlHandle;
; does status 1 call to get the DCEHandle

        .FUNC GetDCtlEntry

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  8(A6),IORefNum(A0)      ; drive number
        MOVE.W  #1,CSCode(A0)           ;code to get DCE handle
        _Status
        MOVE.L  CSParam(A0),10(A6)      ;return the DCE Handle

        UNLK    A6
        MOVE.L  (SP)+,A0                ; return address
        ADDQ    #2,SP                  ; fix up stack
        JMP     (A0)




;
; from IOTRAPS.TEXT -- Mac OS IO Interface routines for Pascal
;
; Argument- A0: param: Points to Parameter block.
;
; Results-  D0: ec: error code.
;               <0: OS Call failed.
;                0: All is well.
; Registers- D0: ec:     error code
;            A0: param:  Paramater list address.
;            A1: ra:     Return Address.
;
; Written By:   Martin P. Haeberli      June 3, 1983
;
; Modification History:
;  01 Jun 83    M Haeberli      Cleaned up comments and code.
;  26 Aug 83    M Haeberli      Added InstallDriver, OpenDriver,
;                                 CloseDriver.
;  29 Nov 83    R Sebok         created Macro OSCall
;                               added interface glue for file system routines


; interface routines expecting a parameter block ptr as argument
; hence the prefix PB
;
; Function PBOpen(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; Function PBClose(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; Function PBRead(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; Function PBWrite(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; Function PBControl(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; Function PBStatus(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; Function PBKillIO(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
;
                .PROC PBOpen
                OsCall _Open

                .PROC PBClose
                OsCall _Close

                .PROC PBRead
                OsCall _Read

                .PROC PBWrite
                OsCall _Write

                .PROC PBControl
                OsCall _Control

                .PROC PBStatus
                OsCall _Status

                .PROC PBKillIO
                OsCall _KillIO

; FUNCTION PBGetVInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBGetVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBSetVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBEject(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBOffLine(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBFlushVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBCreate(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBDelete(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBOpenRF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBRename(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBGetFInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBSetFInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBSetFLock(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBRstFLock(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBSetFVers(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBAllocate(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBGetEOF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBSetEOF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBGetFPos(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBSetFPos(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;
; FUNCTION PBFlushFile(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr;

                .PROC PBGetVInfo
                OsCall _GetVolInfo

                .PROC PBGetVol
                OsCall _GetVol

                .PROC PBSetVol
                OsCall _SetVol

                .PROC PBEject
                OsCall _Eject

                .PROC PBOffLine
                OsCall _OffLine

                .PROC PBFlushVol
                OsCall _FlushVol

                .PROC PBCreate
                OsCall _Create

                .PROC PBDelete
                OsCall _Delete

                .PROC PBOpenRF
                OsCall _OpenRF

                .PROC PBRename
                OsCall _ReName

                .PROC PBGetFInfo
                OsCall _GetFileInfo

                .PROC PBSetFInfo
                OsCall _SetFileInfo

                .PROC PBSetFLock
                OsCall _SetFilLock

                .PROC PBRstFLock
                OsCall _RstFilLock

                .PROC PBSetFVers
                OsCall _SetFilType

                .PROC PBAllocate
                OsCall _Allocate

                .PROC PBGetEOF
                OsCall _GetEOF

                .PROC PBSetEOF
                OsCall _SetEOF

                .PROC PBGetFPos
                OsCall _GetFPos

                .PROC PBSetFPos
                OsCall _SetFPos

                .PROC PBFlushFile
                OsCall _FlushFil

; MountVolume and UnMountVolume calls can only be made synchronously
; FUNCTION PBMountVol(paramBlock: ParmBlkPtr): OsErr;
; FUNCTION PBUnMountVol(paramBlock: ParmBlkPtr): OsErr;

                .PROC PBMountVol
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get param pointer.
                _MountVol               ;tell OS to do it Synchronously
                Move.W  D0,(SP)         ;save result
                Jmp     (A1)            ;return to caller

                .PROC PBUnMountVol
                Move.L  (SP)+,A1        ;get return address
                Move.L  (SP)+,A0        ;get param pointer.
                _UnMountVol             ;tell OS to do it Synchronously
                Move.W  D0,(SP)         ;save result
                Jmp     (A1)            ;return to caller


; interface for file system and IO procedures and functions which do not require
; a parameter block
;
; PROCEDURE AddDrive(drvrRefNum: INTEGER; drvNum: INTEGER; QEl: drvQElPtr);

                .PROC AddDrive
                MOVE.L  (SP)+,A1        ;get return address
                MOVE.L  (SP)+,A0        ;ptr to memory for queue element
                MOVE.W  (SP)+,D0        ;drive number
                SWAP    D0              ;put it in high word
                MOVE.W  (SP)+,D0        ;driver ref num
                _AddDrive
                JMP     (A1)

;simple interface to IO routines which does not require caller to set up the
;parameter block
;
;FUNCTION FSOpen(fileName: OsStr255; versNum: SignedByte; vRefNum: INTEGER;
;                  VAR refNum: INTEGER): OsErr;
;
        .FUNC FSOpen

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  14(A6),IOFileName(A0)   ; set ptr to filename
        MOVE.W  12(A6),IODrvNum(A0)     ; drive number
        CLR.B   IOFileType(A0)          ; file type
        CLR.B   IOPermssn(A0)           ; open for read/write
        CLR.L   IOOwnBuf(A0)            ; use system buffer

        _OPEN

        MOVE.L  8(A6),A1                ; return the refnum
        MOVE    IORefNum(A0),(A1)
        MOVE    D0,18(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A0                ; return address
        ADD.L   #10,SP                  ; fix up stack
        JMP     (A0)

;
;FUNCTION FSClose(refNum: INTEGER): OsErr;
;

        .FUNC FSClose

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block
        MOVE    8(A6),IORefNum(A0)      ; get the refnum param
        _CLOSE
        MOVE    D0,10(A6)               ; return the result code
        UNLK    A6
        MOVE.L  (SP)+,A0                ; return address
        ADDQ.L  #2,SP                   ; fix up stack
        JMP     (A0)

;
;FUNCTION FSRead(refNum: INTEGER; VAR count: LongInt; buffPtr: Ptr): OsErr;
;
;FUNCTION FSWrite(refNum: INTEGER; VAR count: LongInt; buffPtr: Ptr): OsErr;
;
;

        .FUNC FSRead
        .DEF  FSWrite

        SF      D1                      ; set up read
        BRA.S   DoBlk

FSWrite
        ST      D1                      ; set up write

DoBlk
        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  8(A6),IOBuffer(A0)      ; buffer address
        MOVE.W  16(A6),IORefNum(A0)     ; refnum
        MOVE.L  12(A6),A1               ; address of the count
        MOVE.L  (A1),IOByteCount(A0)    ; read count
        CLR.W   IOPosMode(A0)           ; no special mode
        CLR.L   IOPosOffset(A0)         ; clear offset

        TST.B   D1                      ; look for read or write
        BNE.S   @1
        _READ
        BRA.S   @2
@1      _WRITE
@2
        MOVE    D0,18(A6)               ; return the result code

        MOVE.L  12(A6),A1               ; address of the count
        MOVE.L  IONumDone(A0),(A1)      ; return count read

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADD.L   #10,SP                  ; fix up stack
        JMP     (A1)

;FUNCTION Control(refNum: INTEGER; csCode: INTEGER;
;                    VAR csParamPtr: Ptr): OsErr;

        .FUNC Control

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  14(A6),IORefNum(A0)     ; refnum
        MOVE.W  12(A6),CSCode(A0)       ; the control operation to be performed
        TST.L   8(A6)                   ; see if there is a parameter block
        BEQ.S   @1                      ; if not, don't bother copying one
        LEA     CSParam(A0),A1          ; dest address of op specific params
        MOVE.L  8(A6),A0                ; src address of op specific params
        MOVEQ   #22,D0                  ; max number of bytes to be moved
        _BlockMove                      ; copy the op specific params
        LEA     -IOQELSIZE(A6),A0       ; put cmd block addr back into A0

@1      _CONTROL
        MOVE    D0,16(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADD.L   #8,SP                   ; fix up stack
        JMP     (A1)

;
;FUNCTION Status(refNum: INTEGER; csCode: INTEGER;
;                   csParamPtr: Ptr): OsErr;

        .FUNC Status                    ;analogous to MacControl but returns
                                        ;opParams rather than expecting it as arg

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  14(A6),IORefNum(A0)     ; refnum
        MOVE.W  12(A6),CSCode(A0)       ; the control operation to be performed
        _STATUS
        MOVE    D0,16(A6)               ; return the result code
        LEA     CSParam-IOQELSIZE(A6),A0 ;ptr to the status information
        MOVE.L  8(A6),A1                ; ptr to where to put this information
        MOVEQ   #22,D0                  ; max number of bytes to be moved
        _BlockMove                      ; copy the op specific params

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADD.L   #8,SP                   ; fix up stack
        JMP     (A1)

;
;FUNCTION KillIO(refNum: INTEGER): OsErr;
;
        .FUNC   KillIO

         LINK    A6,#-32                 ;get space for control p-block
         LEA     -32(A6),A0              ;point A0 at the block
         MOVE.W  8(A6),IORefNum(A0)      ; refnum
         _KillIO                         ; make the control call
         MOVE    D0,10(A6)               ; return the result code

         UNLK    A6
         MOVE.L  (SP)+,A1                ; return address
         ADD.L   #2,SP                   ; fix up stack
         JMP     (A1)

;
;FUNCTON GetVInfo(drvNum: INTEGER; volName: OsStrPtr; VAR vRefNum: INTEGER;
;                 VAR FreeBytes: LongInt): OsErr;
;

        .FUNC GetVInfo

         LINK   A6,#-IOVQElSize         ; get space for control p-block
         LEA    -IOVQElSize(A6),A0      ; point A0 at the block
         MOVE.L 16(A6),IOVNPtr(A0)      ; volume name pointer
         MOVE.W 20(A6),IOVDrvNum(A0)    ; drive number
         CLR.W  IOVolIndex(A0)          ; no volume queue index
         _GetVolInfo                    ; make the control call
         MOVE   D0,22(A6)               ; return the result code
         MOVE.L 12(A6),A1               ; pointer to vRefNum
         MOVE.W IOVRefNum(A0),(A1)      ; return volume ref num

         ;now calculate the number of free bytes on the volume by multiplying
         ;allocation block size * free allocation blocks
         ;would ideally like to multiply long * integer but since MULU only
         ;multiplies two ints, to allow for a larger than 16 bit allocation
         ;block size we shift it right by 9 (since we know it to be a multiple
         ;of 512 and then shift the result back.
         MOVE.L IOVAlBlkSiz(A0),D0      ;num bytes in an allocation block
         ASR.L  #8,D0                   ;shift over by 8
         ASR.L  #1,D0                   ;and one more
         MULU   IOVFrBlk(A0),D0         ;multiply by number of free blocks
         ASL.L  #1,D0                   ;shift back to the left
         ASL.L  #8,D0
         MOVE.L 8(A6),A1                ;pointer to free bytes
         MOVE.L D0,(A1)                 ;return the value


         UNLK    A6
         MOVE.L  (SP)+,A1                ; return address
         ADD.L  #14,SP                   ; fix up stack
         JMP     (A1)


;
;FUNCTION GetFInfo(fileName: OsStr255; versNum: SignedByte; vRefNum: INTEGER;
;                  VAR FndrInfo: FInfo):OsErr;
;
        .FUNC   GetFInfo


        LINK     A6,#-IOFQELSIZE         ; make room on stack for cmd block
        LEA     -IOFQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  14(A6),IOFileName(A0)    ; set ptr to filename
        MOVE.W  12(A6),IOVRefNum(A0)     ; set volume ref num
        CLR.B   IOFileType(A0)           ; (version field)
        CLR.W   IOFDirIndex(A0)          ;clear directory index

        _GetFileInfo                     ;get the info
        MOVE    D0,18(A6)                ; return the result code

        ;transfer the user defined finder info words (16 bytes) into result
        LEA     IOFlUsrWds(A0),A0       ;where to copy from
        MOVE.L  8(A6),A1                ;where to copy to
        MOVE    #16,D0                  ; 16 bytes of information
        _BlockMove

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADD.L  #10,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION GetVol(volName: OsStrPtr; VAR vRefNum: INTEGER):OsErr;
;
;
        .FUNC   GetVol

         LINK   A6,#-IOVQElSize         ; get space for control p-block
         LEA    -IOVQElSize(A6),A0      ; point A0 at the block
         MOVE.L 12(A6),IOVNPtr(A0)      ; pointer to volume name pointer
         _GetVol                        ; make the control call
         MOVE   D0,16(A6)               ; return the result code
         MOVE.L 8(A6),A1                ; pointer to drive number
         MOVE.W IOVRefNum(A0),(A1)      ; return drive number

         UNLK    A6
         MOVE.L  (SP)+,A1                ; return address
         ADDQ.L  #8,SP                   ; fix up stack
         JMP     (A1)

;
;FUNCTION SetVolume(VolName: OsStrPtr; vRefNum: INTEGER): OsErr;
;

        .FUNC   SetVol

         LINK   A6,#-IOVQElSize          ;get space for control p-block
         LEA    -IOVQElSize(A6),A0      ; point A0 at the block
         MOVE.L 10(A6),IOVNPtr(A0)      ; ptr to desired volume name
         MOVE.W 8(A6),IOVRefNum(A0)     ; desired default drive number
         _SetVol                        ; make the control call
         MOVE   D0,14(A6)               ; return the result code

         UNLK    A6
         MOVE.L  (SP)+,A1                ; return address
         ADDQ.L  #6,SP                   ; fix up stack
         JMP     (A1)
;
;FUNCTION MountVol(DrvNum: INTEGER; VAR vRefNum):OsErr;
;
;
;        .FUNC   MountVol
;
;         LINK   A6,#-IOVQElSize          ;get space for control p-block
;         LEA    -IOVQElSize(A6),A0      ; point A0 at the block
;         MOVE.W 12(A6),IOVDrvNum(A0)     ; drive to be mounted
;         _MountVol                      ; make the control call
;         MOVE   D0,14(A6)               ; return the result code
;         MOVE.L 8(A6),A1
;         MOVE.W IOVRefNum(A0),(A1)      ; return volume reference number
;
;         UNLK    A6
;         MOVE.L  (SP)+,A1                ; return address
;         ADDQ.L  #6,SP                   ; fix up stack
;         JMP     (A1)

;
;FUNCTION UnMountVol(VolName: OsStrPtr; vRefNum: INTEGER):OsErr;
;

        .FUNC   UnMountVol

         LINK   A6,#-IOVQElSize         ;get space for control p-block
         LEA    -IOVQElSize(A6),A0      ; point A0 at the block
         MOVE.W 8(A6),IOVRefNum(A0)     ; drive to be unmounted
         MOVE.L 10(A6),IOVNPtr(A0)      ; volume name pointer
         _UnMountVol
         MOVE   D0,14(A6)               ; return the result code

         UNLK    A6
         MOVE.L  (SP)+,A1                ; return address
         ADDQ.L  #6,SP                   ; fix up stack
         JMP     (A1)

;
;FUNCTION Eject(VolName: OsStrPtr; vRefNum: INTEGER): OsErr;
;

        .FUNC   Eject

         LINK   A6,#-IOVQElSize         ; get space for control p-block
         LEA    -IOVQElSize(A6),A0      ; point A0 at the block
         MOVE.W 8(A6),IOVRefNum(A0)     ; drive to be unmounted
         MOVE.L 10(A6),IOVNPtr(A0)      ; volume name pointer
         _Eject
         MOVE   D0,14(A6)               ; return the result code

         UNLK    A6
         MOVE.L  (SP)+,A1                ; return address
         ADDQ.L  #6,SP                   ; fix up stack
         JMP     (A1)

;
;FUNCTION OffLine(VolName: OsStrPtr; vRefNum: INTEGER): OsErr;
; removed 12 Apr 84
;
;       .FUNC   OffLine
;
;        LINK   A6,#-IOVQElSize         ; get space for control p-block
;        LEA    -IOVQElSize(A6),A0      ; point A0 at the block
;        MOVE.W 8(A6),IOVRefNum(A0)     ; drive to be unmounted
;        MOVE.L 10(A6),IOVNPtr(A0)      ; volume name pointer
;        _OffLine
;        MOVE   D0,14(A6)               ; return the result code
;
;        UNLK    A6
;        MOVE.L  (SP)+,A1                ; return address
;        ADDQ.L  #6,SP                   ; fix up stack
;        JMP     (A1)

;
;FUNCTION FlushVolume(VolName: OsStrPtr; vRefNum: INTEGER):OsErr;
;

        .FUNC   FlushVol

         LINK   A6,#-IOVQElSize         ; get space for control p-block
         LEA    -IOVQElSize(A6),A0      ; point A0 at the block
         MOVE.W 8(A6),IOVRefNum(A0)     ; drive to be unmounted
         MOVE.L 10(A6),IOVNPtr(A0)      ; volume name pointer
         _FlushVol
         MOVE   D0,14(A6)               ; return the result code

         UNLK    A6
         MOVE.L  (SP)+,A1                ; return address
         ADDQ.L  #6,SP                   ; fix up stack
         JMP     (A1)

;
;FUNCTION Create(fileName: OsStr255; vRefNum: INTEGER; creator: OSType;
;                fileType: OSType):OsErr;

        .FUNC Create


        LINK     A6,#-IOFQELSIZE        ; make room on stack for cmd block
        LEA     -IOFQELSIZE(A6),A0      ; address of cmd block

        MOVE.L  18(A6),IOFileName(A0)    ; set ptr to filename
        MOVE.W  16(A6),IOVRefNum(A0)      ; set volume ref num
        CLR.B   IOFileType(A0)           ; clear type, permissions (version field)

        _Create
        TST.W   D0                      ;error?
        BNE.S   crDone                  ;yes, don't bother setting type

        CLR.W   IOFDirIndex(A0)          ;clear directory index
        _GetFileInfo                     ;get the previous info

        ;transfer the user defined finder info words (16 bytes)
        MOVE.L  A0,D0                   ;save ptr to param block
        LEA     IOFlUsrWds(A0),A1       ;where to copy user words
        MOVE.L  8(A6),(A1)+             ;enter in the new file type
        MOVE.L  12(A6),(A1)             ;enter in the new file creator
        _SetFileInfo

crDone
        MOVE    D0,22(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADD.L   #14,SP                  ; fix up stack
        JMP     (A1)


;
;FUNCTION FSDelete(fileName: OsStr255; vRefNum: INTEGER):OsErr;
;

        .FUNC FSDelete

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  10(A6),IOFileName(A0)    ; set ptr to filename
        MOVE.W  8(A6),IOVRefNum(A0)      ; set volume ref num
        CLR.B   IOFileType(A0)           ; clear type, permissions (version field)

        _Delete
        MOVE    D0,14(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ.L  #6,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION OpenRF(fileName: OsStr255; vRefNum: INTEGER;VAR refNum: INTEGER): OsErr;
;
;

        .FUNC OpenRF

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  14(A6),IOFileName(A0)    ; set ptr to filename
        MOVE.W  12(A6),IOVRefNum(A0)     ; set volume ref num
        CLR.B   IOFileType(A0)           ; clear type, permissions (version field)
        CLR.B   IOPermssn(A0)           ; open for read/write
        CLR.L   IOOwnBuf(A0)            ; use system buffer

        _OpenRF
        MOVE    D0,18(A6)               ; return the result code
        MOVE.L  8(A6),A1                ;ptr to refNum
        MOVE.W  IORefNum(A0),(A1)       ; return the refNum

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADD.L  #10,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION Rename(oldName: OsStr255; vRefNum: INTEGER;
;                newName: OsStr255):OsErr;
;
        .FUNC Rename

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  14(A6),IOFileName(A0)    ; set ptr to filename
        MOVE.W  12(A6),IOVRefNum(A0)     ; set volume ref num
        CLR.B   IOFileType(A0)           ; clear type, permissions (version field)
        MOVE.L  8(A6),IONewName(A0)      ;new name to give to file

        _ReName
        MOVE    D0,18(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADD.L  #10,SP                   ; fix up stack
        JMP     (A1)

;
;FUNCTION SetFInfo(fileName: OsStr255; vRefNum; INTEGER;
;                  FndrInfo: FInfo):OsErr;
;
        .FUNC SetFInfo

        LINK     A6,#-IOFQELSIZE         ; make room on stack for cmd block
        LEA     -IOFQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  14(A6),IOFileName(A0)    ; set ptr to filename
        MOVE.W  12(A6),IOVRefNum(A0)     ; set volume ref num
        CLR.B   IOFileType(A0)           ; (version field)
        CLR.W   IOFDirIndex(A0)          ;clear directory index

        _GetFileInfo                     ;get the previous info

        ;transfer the user defined finder info words (16 bytes)
        LEA     IOFlUsrWds(A0),A1       ;where to copy user words
        MOVE.L  8(A6),A0                ;where the user words are now
        MOVE    #16,D0                  ; 16 bytes of information
        _BlockMove
        LEA     -IOFQELSIZE(A6),A0      ;restore A0

        _SetFileInfo
        MOVE    D0,18(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADD.L  #10,SP                  ; fix up stack
        JMP     (A1)

;
;FUNCTION SetFLock(fileName: OsStr255; vRefNum: INTEGER):OsErr;
;
;
        .FUNC SetFLock

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  10(A6),IOFileName(A0)    ; set ptr to filename
        MOVE.W  8(A6),IOVRefNum(A0)      ; set volume ref num
        CLR.B   IOFileType(A0)           ; clear type, permissions (version field)

        _SetFilLock
        MOVE    D0,14(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ.L  #6,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION RstFLock(fileName: OsStr255;  vRefNum: INTEGER):OsErr;
;
;
        .FUNC RstFLock

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  10(A6),IOFileName(A0)    ; set ptr to filename
        MOVE.W  8(A6),IOVRefNum(A0)      ; set volume ref num
        CLR.B   IOFileType(A0)           ; clear type, permissions (version field)

        _RstFilLock
        MOVE    D0,14(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ.L  #6,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION SetFType(fileName: OsStr255; oldVers: SignedByte; vRefNum: INTEGER;
;                    newVers: SignedByte):OsErr;
;
        .FUNC SetFType

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  16(A6),IOFileName(A0)    ; set ptr to filename
        MOVE.W  10(A6),IOVRefNum(A0)      ; set volume ref num
        MOVE.B  12(A6),IOFileType(A0)    ; clear type, permissions (version field)
        MOVE.B  8(A6),IONewType(A0)      ;the new type (version field)

        _SetFilType
        MOVE    D0,16(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADD.L   #12,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION Allocate(refNum: INTEGER; VAR count: LongInt):OsErr;
;

        .FUNC Allocate

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.L  8(A6),A1                ;ptr to requested byte count
        MOVE.L  (A1),IOReqCount(A0)     ;
        MOVE.W  12(A6),IORefNum(A0)     ; set refnum

        _Allocate
        MOVE    D0,14(A6)               ; return the result code
        MOVE.L  IOActCount(A0),(A1)     ; return actual byte count

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ.L  #6,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION GetEOF(refNum: INTEGER; VAR LogEOF: LongInt):OsErr;
;
        .FUNC GetEOF

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  12(A6),IORefNum(A0)     ; set refnum

        _GetEOF
        MOVE    D0,14(A6)               ; return the result code
        MOVE.L  8(A6),A1                ;ptr to logical length variable
        MOVE.L  IOLEOF(A0),(A1)         ;return logical end of file

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ.L  #6,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION SetEOF(refNum: INTEGER; LogEOF: LongInt):OsErr;
;
        .FUNC SetEOF

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  12(A6),IORefNum(A0)     ; set refnum
        MOVE.L  8(A6),IOLEOF(A0)        ; the desired end of file

        _SetEOF
        MOVE    D0,14(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ.L  #6,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION GetFPos(refNum: INTEGER; VAR filePos: LongInt):OsErr;
;
        .FUNC GetFPos

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  12(A6),IORefNum(A0)     ; set refnum

        _GetFPos
        MOVE    D0,14(A6)               ; return the result code
        MOVE.L  8(A6),A1                ;ptr to logical length variable
        MOVE.L  IOPosOffset(A0),(A1)    ;return logical end of file

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ.L  #6,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION SetFPos(refNum: INTEGER; posMode: INTEGER; posOff: LongInt):OsErr;
;
        .FUNC SetFPos

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  14(A6),IORefNum(A0)     ; set refnum
        MOVE.W  12(A6),IOPosMode(A0)    ; positioning information
        MOVE.L  8(A6),IOPosOffset(A0)   ; new file position

        _SetFPos
        MOVE    D0,16(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ.L  #8,SP                   ; fix up stack
        JMP     (A1)


;
;FUNCTION FlushFile(refNum: INTEGER):OsErr;
;

        .FUNC FlushFile

        LINK     A6,#-IOQELSIZE         ; make room on stack for cmd block
        LEA     -IOQELSIZE(A6),A0       ; address of cmd block

        MOVE.W  8(A6),IORefNum(A0)      ; set refnum

        _FlushFil
        MOVE    D0,10(A6)               ; return the result code

        UNLK    A6
        MOVE.L  (SP)+,A1                ; return address
        ADDQ.L  #2,SP                   ; fix up stack
        JMP     (A1)

;The following are the implementation of the event mgr routines that are
;register based as oposed to stack based
;They are included here because they are OSTraps, however the interfaces for
;them are in toolIntf
;
;  FUNCTION PostEvent(eventNum: INTEGER; eventMsg: LongInt): OsErr;
;
                .PROC   PostEvent,2
;
                MOVE.L  (SP)+,A1        ;A1 is return address
                MOVE.L  (SP)+,D0        ;32-bit quantity defined by the event
                MOVE.W  (SP)+,A0        ;word of event number
                MOVE.L  A1,-(SP)        ;
                _POSTEVENT
                MOVE.W  D0,4(SP)        ;return 0=event posted; 1=not posted
                RTS
;
; procedure FlushEvents(evtMasks: LongInt);
;
                .PROC   FLUSHEVENTS ,1
                MOVE.L  (SP)+,A1        ;pop return address
                MOVE.L  (SP)+,D0        ;pop long word of event masks
                MOVE.L  A1,-(SP)
                _FlushEvents
                RTS

;
; procedure SetEventMask;
;
                .PROC   SETEVENTMASK,1
;
                MOVE.L  (SP)+,A1
                MOVE    (SP)+,SYSEVTMASK        ;get the mask
                JMP     (A1)                  ; return to caller

;
;FUNCTION OSEventAvail(mask: INTEGER; VAR theEvent: EventRecord): BOOLEAN;
;

                .FUNC OSEventAvail

                MOVE.L  (SP)+,A1            ;return address
                MOVE.L  (SP)+,A0            ;user event record
                MOVE.W  (SP)+,D0            ;event mask (set of events desired)
                MOVE.L  A1,-(SP)            ;push return address
                _OSEventAvail
                TST     D0
                BEQ.S   @1                  ;non-null event returned

                CLR.B   4(SP)               ;null event returned
                BRA.S   @2

@1              MOVE.B  #1,4(SP)            ;non-null event returned
@2              RTS

;
;FUNCTION GetOSEvent(mask: INTEGER; VAR theEvent: EventRecord): BOOLEAN;
;

                .FUNC GetOSEvent

                MOVE.L  (SP)+,A1            ;return address
                MOVE.L  (SP)+,A0            ;user event record
                MOVE.W  (SP)+,D0            ;event mask (set of events desired)
                MOVE.L  A1,-(SP)            ;push return address
                _GetOSEvent
                TST     D0
                BEQ.S   @1                  ;non-null event returned

                CLR.B   4(SP)               ;null event returned
                BRA.S   @2

@1              MOVE.B  #1,4(SP)            ;non-null event returned
@2              RTS



; Sound Manager interface implementation
;
; PROCEDURE SetSoundVol(level: INTEGER);
;
                .PROC   SetSoundVol,1

; the following is how you would ideally like to do this (ie with an immediate
; control call) but since there is a problem with immediate control calls, I have
; just taken the sound driver volume routine and put it here
;                MOVE.L  (SP)+,A0                ;get return address
;                MOVE.W  (SP)+,D0                ;get the volume
;                MOVE.L  A0,-(SP)                ;replace return address
;
;                LINK    A6,#-32                 ;get some space for the control p-block
;                LEA     -32(A6),A0              ;point A0 at the block
;                MOVE.W  #-4,IORefNum(A0)        ;set up the sound driver refNum
;                MOVE.W  #2,CSCode(A0)           ;set up the control "opCode"
;                MOVE.W  D0,CSParam(A0)          ;set up event ptr as parameter
;                _Control  ,IMMED                ;make the control call
;
;                UNLK    A6                      ;de-allocate parameter block
;                RTS

;this is from the sound driver:
                MOVE.L  (SP)+,A0            ;get the return address
                MOVE.W  (SP)+,D0            ;get the volume level
                MOVE.L  A0,-(SP)            ;put return addr back on
                CMP.B   #$FF,$400009        ;are we running on a Lisa?
                BEQ.S   LisaSound

                ;this is for the Mac
                MOVE    SR,-(SP)            ;save current status
                ORI     #$0300,SR           ;only debug interrupts allowed
                MOVE.B  AVBufA,D1           ;get VIA port byte
                AND     #$00F8,D1           ;clear low 3 bits
                AND     #7,D0               ;only use low 3 bits
                MOVE.B  D0,SDVolume         ;update low memory variable
                OR      D0,D1               ;combine them
                MOVE.B  D1,AVBufA           ;store it back
                RTE                         ;restore interrupts and return

                ;this is for the Lisa
LisaSound       AND.W   #7,D0               ;low 3 bits specify sound
                MOVE.B  D0,SDVolume         ;update low memory variable
                LSL.W   #1,D0               ;shift into position
                MOVE.B  $FCDD81,D1          ;read from port B (VIA2+PORTB2)
                AND.B   #$F1,D1             ;clear out bits 1 to 3
                OR.B    D0,D1
                MOVE.B  D1,$FCDD81
                RTS


;
; PROCEDURE GetSoundVol(VAR level: INTEGER);
; actually, sound is a byte.
;
                .PROC   GetSoundVol,1

                MOVE.L  (SP)+,A0                ;get return address
                MOVE.L  (SP)+,A1                ;ptr to result
                CLR.B   (A1)+                   ;clear high byte
                MOVE.B  SDVolume,(A1)           ;return volume level in low byte
                JMP     (A0)

;
;PROCEDURE StartSound(synthRec: Ptr; numBytes: LongInt; CompletionRtn: ProcPtr);
;
;
                .PROC   StartSound,1
                .DEF    myPBlock
                .DEF    SndQueue
                .DEF    MyCompletion

;set up the parameter block if it is free, otherwise queue up the request
;note that synchronous calls do not get queued up.  We just loop around
;until all pending calls are done and then make the call.  This is because
;you cannot start up a syncronous call in a VBL task
               LEA      myPBlock,A0             ;
               TST.W    IOResult(A0)            ;IOResult is 0 if blk is free
               BEQ.S    blkFree

                ;parameter block is not free, queue this request up if it is
                ;asynchronous. If it is syncronous, loop until everything
                ;else is done and then start it up
               MOVE.L   4(SP),D1                ;the completion rtn
               BTST     #0,D1                   ;-1 for asynch otherwise synch
               BNE.S    sndWait                 ;it is synchronous

                MOVE.L  SndQueue,D0             ;is there a handle?
                BNE.S   isQ                     ;yes, just add on another entry
                _NewHandle                      ;no, make a zero length handle
                LEA     SndQueue,A1             ;ptr to soundqueue handle location
                MOVE.L  A0,(A1)                 ;save hndl in SndQueue
                BEQ.S   ssdone                  ;not enough memory, just quit

isQ             MOVE.L  SndQueue,A0             ;get the handle
                _GetHandleSize                  ;find out it's size
                MOVE.L  D0,D1                   ;save the size
                ADD     #12,D0                  ;make room for the next entry
                _SetHandleSize                  ;make it bigger
                TST     D0
                BNE.S   ssdone                  ;quit if couldn't do it
                MOVE.L  (A0),A1                 ;ptr to the queue
                ADD.L   D1,A1                   ;add in offset to end of prev data
                LEA     4(SP),A0                ;ptr to the args
                MOVEQ   #12,D0                  ;number of bytes to copy
                _BlockMove
                BRA.S   ssdone                  ;done queueing up, exit

sndWait         MOVE.W  IOResult(A0),D0         ;see if sound is done yet
                BGT.S   sndWait                 ;nope, loop on.

blkFree
               MOVE.L   8(SP),IOByteCount(A0)   ;numbytes
               MOVE.L   12(SP),IOBuffer(A0)     ;the synthesizer rec
               MOVE.W   #-4,IORefNum(A0)        ;sound driver refNum
               CLR.L    IOCompletion(A0)        ;
               MOVE.L   4(SP),D1                ;the completion rtn
               BTST     #0,D1                   ;-1 for asynch otherwise synch
               BEQ.S    doAsync
               _Write                           ;synchronous write
               BRA.S    ssDone

doAsync        MOVE.L   D1,IOOwnBuf(A0)         ;save their compl rtn in ownBuff
               LEA      myCompletion,A1         ;my completion routine
               MOVE.L   A1,IOCompletion(A0)
               _Write   ,ASYNC                  ;asynchronous write

ssDone         MOVE.L   (SP)+,A1
               ADD      #12,SP
               JMP      (A1)


;the completion routine that gets called when an asynchronous call is through
;note: only asynchronous calls are queued up
myCompletion
                MOVEM.L D0-D2/A0-A2,-(SP)   ;preserve the regs
                LEA     myPBlock,A0         ;the parameter block
                MOVE.L  IOOwnBuf(A0),D1     ;address of their completion rtn
                BEQ.S   noCompl             ;NIL completion routine
                MOVE.L  D1,A1               ;the completion routine
                JSR     (A1)                ;go to it

noCompl         LEA     SndQueue,A1         ;ptr to sndqueue handle
                TST.L   (A1)                ;is there a pending sound call?
                BEQ.S   myCdone             ;no queue, just return

                ;there is a pending call, copy the parameters into the parm blk
                LEA     myPBlock,A2         ;the parameter block
                MOVE.L  SndQueue,A0         ;sndQueue handle
                _GetHandleSize              ;put the size of the handle in D0
                MOVE.L  (A0),A0             ;deref it
                MOVE.L  A0,A1               ;make a copy of it
                MOVE.L  (A0)+,IOOwnBuf(A2)  ;their completion routine
                MOVE.L  (A0)+,IOByteCount(A2) ;numBytes
                MOVE.L  (A0)+,IOBuffer(A2)  ;the synthesizer rec
                MOVE.W  #-4,IORefNum(A2)    ;sound driver refNum

                ;now remove the parameters from the queue
                SUB     #12,D0              ;was the handle only 12 bytes?
                BEQ.S   dspQ                ;yes, just dispose of the handle
                MOVE.L  D0,D1               ;save the new size
                _BlockMove                  ;shift the bytes up in the queue
                MOVE.L  SndQueue,A0         ;get the handle again
                MOVE.L  D1,D0               ;get back the new size
                _SetHandleSize              ;shrink the handle
                BRA.S   complSS             ;now start the sound

dspQ            MOVE.L  SndQueue,A0         ;get the handle
                _DisposHandle               ;dispose it
                LEA     SndQueue,A0
                CLR.L   (A0)                ;clear out the queue handle

;set up my completion routine and make the write call
complSS         LEA     myPBlock,A0         ;get ptr to param block
                LEA     myCompletion,A1     ;this completion routine
                MOVE.L  A1,IOCompletion(A0) ;stuff it
                _Write  ,ASYNC              ;start asyncronous write and return


myCdone         MOVEM.L (SP)+,D0-D2/A0-A2   ;restore regs
                RTS

;global parameter block set up for the user. This allows for general
;async sound driver calls without the user worrying about memory allocation.
;if more than one sound driver call is pending at one time, a handle is created
;which contains a queue of the outstanding calls.   These are posted as soon
;as the current calls is completed.
myPBlock        .BLOCK  16          ;50 bytes total, init ioresult to be NIL
                .WORD   0
                .BLOCK  32

SndQueue        .LONG   0           ;queue of all pending sound calls beyond the
                                    ;two queued in the 2 parameter blocks above.

;
;FUNCTION SoundDone: BOOLEAN;
;
;
                .FUNC   SoundDone
                .REF    myPBlock

               LEA      myPBlock,A0             ;get current paramter block
               CLR.W    4(SP)                   ;assume false
               TST.W    IOResult(A0)            ;see if io is done
               BNE.S    sdEnd
               ADD.B    #1,4(SP)                ;yes it's done
sdEnd          RTS


;
; PROCEDURE StopSound;
;
                .PROC   StopSound,1
                .REF    SndQueue
                .REF    myPBlock

                LINK    A6,#-32                 ;get some space for the control p-block
                LEA     -32(A6),A0              ;point A0 at the block
                MOVE.W  #-4,IORefNum(A0)        ;set up the sound driver refNum
;               MOVE.W  #1,CSCode(A0)           ;set up the control "opCode"
                _KillIO ,IMMED                  ;make the control call
                LEA     myPBlock,A0             ;get my parmeter block
                CLR.W   IOResult(A0)            ;clear the abort error

                ;now dispose of any pending write calls
                ;note: I do not call the completion routines of these
                ;calls as the normal Killio would I just dequeue them
                MOVE.L  SndQueue,D0             ;the snd queue handle
                BEQ.S   killDone
                MOVE.L  D0,A0                   ;get the handle
                _DisposHandle                   ;dispose it
                LEA     SndQueue,A0
                CLR.L   (A0)                    ;clear out the queue handle
;
killDone        UNLK    A6                      ;de-allocate parameter block
                RTS

;
; PROCEDURE SWSetLevel(ampl: INTEGER);
; useful if you want to set the level during an asynchronous square wave
; the problem is that the completion routine of the write is executed when
; this setLevel call is done as opposed to when the write is done.  Hence,
; it turns out not to be very useful.  People should use SetSoundVol instead
;
;                .PROC   SWSetLevel,1
;
;                LINK    A6,#-50                 ;get some space for the control p-block
;                LEA     -50(A6),A0              ;point A0 at the block
;                MOVE.W  #-4,IORefNum(A0)        ;set up the sound driver refNum
;                MOVE.W  #3,CSCode(A0)           ;set up the control "opCode"
;                MOVE.W  8(A6),CSParam(A0)       ;set up the amplitude
;                _Control   ,IMMED               ;make the control call
;
;                UNLK    A6                      ;de-allocate parameter block
;                MOVE.L  (SP)+,A0
;                ADDQ    #2,SP
;                JMP     (A0)


;
;PROCEDURE CountAppFiles(VAR message: INTEGER; VAR count: INTEGER);
;

        .PROC CountAppFiles

        MOVE.L  4(SP),A1
        CLR     (A1)                        ;set default count to 0
        MOVE.L  AppParmHandle,A0            ;the app parm handle
        _GetHandleSize                      ;are we real
        BLE.S   CountEnd
        MOVE.L  (A0),A0                     ;deref appParm Handle
        MOVE.L  8(SP),A1                    ;ptr to message
        MOVE.W  (A0)+,(A1)                  ;return the message
        MOVE.L  4(SP),A1
        MOVE.W  (A0),(A1)                   ;return the count

CountEnd
        MOVE.L  (SP)+,A0                    ;return addr
        ADDQ    #8,SP
        JMP     (A0)


;
;PROCEDURE GetAppFiles(index: INTEGER; VAR theFile: AppFile);
;
; fType is set to all 0's if no next file was found or there is no file list

;AppFile = RECORD
;                 vRefNum: INTEGER;
;                 ftype: OsType;
;                 versNum: INTEGER;   {versNum in high byte}
;                 fName: str255;
;               END; {appFile}


;appParm has format:  message (0/1) for load or print   (2 bytes)
;                     # of entries                      (2 bytes)
;   for each entry:   volume refNum                     (2 bytes)
;                     type                              (4 bytes)
;                     version                           (2 bytes)
;                     name- padded to even

            .FUNC   GetAppFiles

            MOVEM.L     A2-A3,-(SP)
            MOVE.L      4+8(SP),A1          ;ptr to fileListElem
            CLR.L       2(A1)               ;assume failure
            MOVE.L      AppParmHandle,A0    ;get the application parameter handle
            _GetHandleSize                  ;are we real?
            BLE.S       getEnd
            MOVE.L      (A0),A2             ;deref appParm Handle
            ADDQ        #2,A2               ;skip the msg
            MOVE        8+8(SP),D1          ;which entry to go to
            CMP         (A2)+,D1            ;see if index within limit
            BGT.S       getEnd
            SUBQ        #1,D1               ;make index zero based

getLoop     BLT.S       getEnd              ;are we done?
            MOVE.L      A2,A0               ;where to copy from
            MOVEQ       #2,D0
            ADD.B       8(A0),D0            ;length of string
            AND         #$FFFE,D0           ;evenize it
            ADD         #8,D0               ;also move refnum,type,versNum
            ADD         D0,A2               ;move to next
            _BlockMove
            SUBQ        #1,D1
            BRA.S       getLoop

getEnd      MOVEM.L     (SP)+,A2-A3         ;save regs
            MOVE.L      (SP)+,A0
            ADDQ        #6,SP               ;pop args
            JMP         (A0)

;
;PROCEDURE ClrAppFiles(index: INTEGER);
;

            .PROC   ClrAppFiles

            MOVE.L      AppParmHandle,A0    ;get the application parameter handle
            _GetHandleSize                  ;are we real?
            BLE.S       clrEnd
            MOVE.L      (A0),A0             ;deref appParm Handle
            ADDQ        #2,A0               ;skip the msg

            MOVE        4(SP),D1            ;which entry to go to
            CMP         (A0)+,D1            ;see if index within limit
            BGT.S       clrEnd
            SUBQ        #1,D1               ;make index zero based

clrLoop     BLT.S       clrEnd              ;are we done?
            BEQ.S       ClrType
            MOVEQ       #2,D0
            ADD.B       8(A0),D0            ;length of string
            AND         #$FFFE,D0           ;evenize it
            ADD         #8,D0               ;also move refnum,type,versNum
            ADD         D0,A0               ;move to next
            SUBQ        #1,D1
            BRA.S       clrLoop

ClrType     CLR.L       2(A0)
clrEnd
            MOVE.L      (SP)+,A0
            ADDQ        #2,SP               ;pop args
            JMP         (A0)


;implementation for system error handler  (ie. deep shit manager)
;

; PROCEDURE SysError(errorCode: INTEGER);
;
;   invoke the deep shit manager with the specified error code
;

              .PROC SysError


               MOVE.L    (SP)+,A0       ;get return address
               MOVE.W    (SP)+,D0       ;get error code
               _SysError                ;invoke deeep shit
               .WORD     $A9FF          ;don't come back!

              .END

MOVE.L  8(SP),A1                    ;ptr to message
        MOVE.W  (A0)+,(A1)                  ;return the messasumacc/ws/traps/packtraps   444      0     12       20062  3472707204  11023 3. "6F^5D!$^
*N .NOLIST
;
; File packTraps.text
;
; implementation for the interface to packages
;

; MATH PACKAGE

                .NoList
                .INCLUDE tlasm/SysEqu.Text
                .INCLUDE tlasm/SysErr.Text
                .INCLUDE tlasm/SysMacs.Text
                .INCLUDE tlasm/GrafEqu.Text
                .INCLUDE tlasm/ToolEqu.Text
                .INCLUDE tlasm/ToolMacs.Text
                .List

;
;macro for package invocation
;
;   first arg is routine selector, second is the trap

        .MACRO  PackCall
        MOVE.W    %1,-(SP)
        %2
        .ENDM

;
;PROCEDURE SFPutFile(where: Point; prompt: Str255; origName: Str255;
;                    dlgHook: ProcPtr; VAR reply: SFReply);
;

                .PROC SFPutFile
                .DEF    goPack

                MOVEQ       #1,D2       ;stuff the opcode

goPack          MOVE.L      (SP)+,A0    ;get user's rts
                MOVE.W      D2,-(SP)    ;the routine selector
                MOVE.L      A0,-(SP)    ;push the rts back on
                .WORD       $ADEA       ;_Pack3 w/autoPop
                ;never gets here

;PROCEDURE SFPPutFile(where: Point; prompt: Str255; origName: Str255;
;                     dlgHook: ProcPtr; VAR reply: SFReply; dlgID: INTEGER;
;                     filterProc: ProcPtr);
;

                .PROC   SFPPutFile
                .REF    goPack

                MOVEQ       #3,D2
                JMP         goPack
;
;PROCEDURE SFGetFile(where: Point; prompt: Str255; fileFilter: ProcPtr;
;                    numTypes: INTEGER; typeList: SFListPtr; dlgHook: ProcPtr;
;                    VAR reply: SFReply);
;
                .PROC   SFGetFile
                .REF    goPack

                MOVEQ       #2,D2
                JMP         goPack
;
;PROCEDURE SFPGetFile(where: Point; prompt: Str255; fileFilter: ProcPtr;
;                     numTypes: INTEGER; typeList: SFListPtr; dlgHook: ProcPtr;
;                     VAR reply: SFReply; dlgID: INTEGER; filterProc: ProcPtr);
;

                .PROC   SFPGetFile
                .REF    goPack

                MOVEQ       #4,D2
                JMP         goPack


;
;PROCEDURE DILoad;
;

                .PROC DILoad
                .DEF    goDI

                MOVEQ       #2,D2       ;stuff the opcode

goDI            MOVE.L      (SP)+,A0    ;get user's rts
                MOVE.W      D2,-(SP)    ;the routine selector
                MOVE.L      A0,-(SP)    ;push the rts back on
                .WORD       $ADE9       ;_Pack2 w/autoPop
                ;never gets here


;
;PROCEDURE DIUnLoad;
;
                .PROC   DIUnLoad
                .REF    goDI

                MOVEQ       #4,D2
                JMP         goDI

;
;FUNCTION DIBadMount(where: Point; evtMessage: LongInt): OsErr;
;
                .PROC   DIBadMount
                .REF    goDI

                MOVEQ       #0,D2
                JMP         goDI


;
;FUNCTION DIFormat(drvNum: INTEGER): OsErr;
;
                .PROC   DIFormat
                .REF    goDI

                MOVEQ       #6,D2
                JMP         goDI


;
;FUNCTION DIVerify(drvNum: INTEGER): OsErr;
;
                .PROC   DIVerify
                .REF    goDI

                MOVE.W      #8,D2
                JMP         goDI


;
;FUNCTION DIZero(drvNum: INTEGER; volName: str255): OsErr;
;
                .PROC   DIZero
                .REF    goDI

                MOVE.W      #10,D2
                JMP         goDI

;
;implementation of interface to International Utilities
;
;
;FUNCTION IUGetIntl(theID: INTEGER): Handle;
;

                .PROC IUGetIntl
                .DEF  goINTL

                MOVEQ       #6,D2       ;stuff the opcode

goINTL          MOVE.L      (SP)+,A0    ;get user's rts
                MOVE.W      D2,-(SP)    ;the routine selector
                MOVE.L      A0,-(SP)    ;push the rts back on
                .WORD       $ADED       ;_Pack6 w/autoPop
                ;never gets here

;
;PROCEDURE IUSetIntl(refNum: INTEGER; theID: INTEGER; intlParam: Handle);
;

                .PROC   IUSetIntl
                .REF    goINTL

                MOVEQ       #8,D2
                JMP         goINTL


;
;PROCEDURE IUDateStr(dateTime: LongInt; longFlag: INTEGER; VAR result: Str255);
;

                .PROC   IUDateStr
                .REF    goINTL

                MOVEQ       #0,D2
                JMP         goINTL


;
;PROCEDURE IUDatePStr(dateTime: LongInt; longFlag: INTEGER; VAR result: Str255;
;                     intlParam: Handle);
;

                .PROC   IUDatePStr
                .REF    goINTL

                MOVEQ       #14,D2
                JMP         goINTL


;
;PROCEDURE IUTimeStr(dateTime: LongInt; wantSeconds: BOOLEAN; VAR result: Str255);
;

                .PROC   IUTimeStr
                .REF    goINTL

                MOVEQ       #2,D2
                JMP         goINTL


;
;PROCEDURE IUTimePStr(dateTime: LongInt; wantSeconds: BOOLEAN; VAR result: Str255;
;                     intlParam: Handle);
;

                .PROC   IUTimePStr
                .REF    goINTL

                MOVEQ       #16,D2
                JMP         goINTL


;
;FUNCTION IUMetric: BOOLEAN;
;

                .PROC   IUMetric
                .REF    goINTL

                MOVEQ       #4,D2
                JMP         goINTL


;
;FUNCTION IUMagString(aPtr,bPtr: Ptr; aLen,bLen: INTEGER): INTEGER;
;

                .PROC   IUMagStr
                .REF    goMag

                MOVE.W  #10,D2          ;the routine selector
                JMP     goMag

;
;FUNCTION IUMagIDStr(aPtr,bPtr: Ptr; aLen,bLen: INTEGER):INTEGER;
;

                .PROC   IUMagIDStr
                .DEF    goMag

                MOVE.W      #12,D2      ;the routine selector
goMag           MOVE.L      (SP)+,A0    ;get user's rts
                MOVE.W      D2,-(SP)    ;the routine selector
                MOVE.L      A0,-(SP)    ;push the rts back on
                .WORD       $ADED       ;_Pack6 w/autoPop
                ;never gets here

;
;FUNCTION IUCompString(aStr,bStr: Str255): INTEGER;
;
                .PROC   IUCompString
                .REF    goPMag

                MOVE.W  #10,D2          ;the routine selector
                JMP     goPMag

;
;FUNCTION IUEqualString(aStr,bStr: Str255): INTEGER;
;
                .PROC   IUEqualString
                .DEF    goPMag

                MOVE.W  #12,D2          ;the routine selector

goPMag          ;first readjust the stack so that it follows Jerome's
                ;string passing convention and not Pascals
                ;Jerome expectes

                MOVE.L      4(SP),A1    ;ptr to bStr
                MOVE.L      8(SP),A0    ;ptr to aStr
                CLR.W       D0
                CLR.W       D1
                MOVE.B      (A0)+,D0    ;aLen
                MOVE.B      (A1)+,D1    ;bLen
                MOVE.L      A0,8(SP)    ;first arg is ptr to aStr
                MOVE.L      A1,4(SP)    ;second arg is ptr to bStr
                MOVE.L      (SP)+,A0    ;the return addr
                MOVE.W      D0,-(SP)    ;third arg is aLen
                MOVE.W      D1,-(SP)    ;fourth arg is bLen
                MOVE.W      D2,-(SP)    ;the routine selector
                MOVE.L      A0,-(SP)    ;push the rts back on
                .WORD       $ADED       ;_Pack6 w/autoPop
                ;never gets here


;
; PROCEDURE StringToNum(theString: Str255; VAR theNum: LongInt);
;
;   convert a string into a number using Jerome's routine
;
                .PROC StringToNum
                .REF    Exit8

               MOVE.L       8(SP),A0
               PackCall     #1,_Pack7      ;LDec2Bin
               MOVE.L       4(SP),A0
               MOVE.L       D0,(A0)
               JMP          Exit8


;
; PROCEDURE NumToString(theNum: LongInt; VAR theString: Str255);
;
;   convert a number to a string using anonymous routine
;
                .PROC NumToString
                .DEF    Exit8

               MOVE.L    4(SP),A0
               MOVE.L    8(SP),D0
               PackCall     #0,_Pack7       ;LBin2Dec

Exit8          MOVE.L    (SP)+,A0
               ADDQ      #8,SP
               JMP       (A0)



              .END

   MOVEQ       #8,D2
                JMP         goINTL


;
;PROCEDURE IUDateStr(dateTime: LongInt; longFlag: INTEGER; VAR result: Str255);
;

                .PROC   IUDateStr
                .REF    goINTL

                MOVEQ       #0,D2
                JMP         goINTL


;
;PROCEDURE IUDatePStr(dateTime: LongInt; longFlag: INTEGER; VAR result: Str255;
;                     intlParam: Handle);
;

                .PROC   IUDatePStr
                .REFsumacc/ws/traps/tooltraps   444      0     12       32036  3472707204  11066 5PH r^X{{w;ToolTraps.Text
;--------------------------------------------------------------------
;
;   ToolTraps is the Pascal/QuickDraw-ToolBox trap interface.
;   It defines all the names declared external in the interface
;   code, and implements them by trapping with the "auto-pop" bit
;   set to remove the extra return address on the stack
;   before dispatching.  Most of this file was generated by the
;   program "MakeTTraps".
;
;         "written" by Andy Hertzfeld    31-Oct-82
;
;   MODIFICATION HISTORY:
;
;     21-Nov-82  AJH  regenerated for ROM 1.8
;     01-Dec-82  AJH  changes for ROM 1.9
;     13-Feb-83  AJH  regenerated for ROM 2.0
;     16-Mar-83  AJH  updated for ROM 2.4
;     20-Apr-83  BLH  Changed dialog proc names for ROM 3.0
;      4-May-83  BLH  Added new resource procs for ROM 3.0
;     28-May-83  SC   Added text edit stuff and changed dialog
;     03-Jun-83  AJH  Regenerated for ROM 4.0
;     08-Jun-83  SC   Changed AlertSound to ErrorSound
;     13-Jun-83  AJH  Added InsertResMenu, OpenDeskAcc
;     04-Aug-83  SC   Added TEInsert, TEGetText, TESetJust
;     04-Aug-83  SC   Added SystemBeep, DrawGrow
;     06-Aug-83  SC   Added HandAndHand, PtrAndHand
;     06-Aug-83  BLH  Removed EndSubResource.  Changed BeginSubResource to
;                      HomeResFile.  Added GetFinderInfo, SetFinderInfo
;                      at the end.
;     12-Aug-83  AJH  Added DragGrayRgn
;     16-Aug-83  SC   Added scrap stuff
;     18-Aug-83  BLH  Removed GetFinderInfo, SetFinderInfo.
;      2-Sep-83  SC   Removed Bytes stuff (It should be an OS).
;     21-Nov-83  RS   changed .DEFs to .PROC and .FUNC so linker could know to
;                     remove those procedures not used by the pascal program
;
;     30-Dec-83  RS&AH   Added SizeResource
;
;     14-Feb-84  RTM  Ripped out stuff for inline traps
;
;--------------------------------------------------------------------
                .NoList
                .INCLUDE tlasm/ToolMacs.Text
                .INCLUDE tlasm/ToolEqu.Text
                .INCLUDE tlasm/SysMacs.Text
                .INCLUDE tlasm/SysEqu.Text
                .List

;

; Important note- The Pascal compiler requires at least one procedure or function
;       reference in the implementation section of a unit. For Quickdraw, we
;       leave InitGraf in the implementation section. (RTM)

                .PROC   InitGraf
                .WORD   $AC6E

                .PROC   PackBits
                .WORD   $ACCF

                .PROC   UnpackBi
                .WORD   $ACD0

; .PROC is used below for both procedures and functions since the linker does
; not check proc vs. func and it was just easier to replace .DEFs globally - RS

                .PROC   DragGrayRgn                     ; ??
                .WORD   $AD05

;                .PROC    LBin2Dec
;                .WORD   $ADC4

;                .PROC    LDec2Bin
;                .WORD   $ADC5

                .PROC   SystemEr
                .WORD   $ADC9

                .PROC   PutIcon
                .WORD   $ADCA

                .PROC   Pack0
                .WORD   $ADE7

                .PROC   Pack1
                .WORD   $ADE8

                .PROC   Pack2
                .WORD   $ADE9

                .PROC   Pack3
                .WORD   $ADEA

                .PROC   FP68K
                .WORD   $ADEB

                .PROC   Pack4
                .WORD   $ADEB

                .PROC   Pack5
                .WORD   $ADEC

                .PROC   Pack6
                .WORD   $ADED

                .PROC   Pack7
                .WORD   $ADEE

                .PROC   Launch
                .WORD   $ADF2

                .PROC   Chain
                .WORD   $ADF3

;
;FUNCTION HandToHand(VAR theHndl: Handle): OsErr;
;
; clones handle in A0 returning the new handle in A0

                .PROC   HandToHand

                MOVE.L  4(SP),A0                ;ptr to handle
                MOVE.L  (A0),A0                 ;the Handle
                _HandToHa
                MOVE.L  4(SP),A1                ;ptr to handle to be returned
                MOVE.L  A0,(A1)                 ;return the new handle
                MOVE    D0,8(SP)                ;return error
                MOVE.L  (SP)+,(SP)              ;pop off the return addr
                RTS


;
;FUNCTION PtrToXHand(srcPtr: Ptr; dstHndl: Handle; size: LongInt): OsErr;
;
; copies size bytes from the srcPtr into the existing handle

                .PROC   PtrToXHand

                MOVE.L  (SP)+,D1                ;save return address
                MOVE.L  (SP)+,D0                ;the size
                MOVE.L  (SP)+,A1                ;existing handle
                MOVE.L  (SP)+,A1                ;srcPtr
                MOVE.L  D1,-(SP)                ;restore return address
                _PtrToXHa
                MOVE.W  D0,4(SP)                ;error code
                RTS                             ;return
;
;FUNCTION PtrToHand(srcPtr: Ptr; VAR dstHndl: Handle; size: LongInt): OsErr;
;
; makes a handle and copies size bytes of the handle into it

                .PROC   PtrToHand

                MOVE.L  12(SP),A0               ;src pointer
                MOVE.L  4(SP),D0                ;size
                _PtrToHan                       ;make a new handle and copy ptr in
                MOVE.W  D0,16(SP)               ;error code
                MOVE.L  8(SP),A1                ;address of handle
                MOVE.L  A0,(A1)                 ;return new handle
                MOVE.L  (SP)+,A0                ;return addr
                ADD     #12,SP                  ;pop off args
                JMP     (A0)                    ;return
;
;FUNCTION HandAndHand(hand1,hand2: Handle): OsErr;
;
; concatenates hand1 onto the end of hand2

                .PROC   HandAndHand

                MOVE.L  8(SP),A0                ;source handle
                MOVE.L  4(SP),A1                ;other source handle
                _HandAndH                       ;concats hndl in A0 to H in A1
                MOVE    D0,12(SP)
                MOVE.L  (SP)+,A0                ;return addr
                ADDQ    #8,SP                   ;pop off args
                JMP     (A0)                    ;return
;
;FUNCTION PtrAndHand(ptr1: Ptr; hand2: Handle; size: LongInt): OsErr;
;
; concatenates ptr1 onto the end of hand2

                .PROC   PtrAndHand

                MOVE.L  4(SP),D0                ;length of ptr
                MOVE.L  8(SP),A1                ;handle
                MOVE.L  12(SP),A0               ;ptr
                _PtrAndHa                       ;concat ptr to handle
                MOVE    D0,16(SP)               ;return error
                MOVE.L  (SP)+,A0                ;return addr
                ADD     #12,SP
                JMP     (A0)

;
;FUNCTION GetAlrtStage: INTEGER;             {returns aCount}
;

                .PROC   GetAlrtStage

                MOVE.W  ACount,4(SP)            ;return the alertCount
                RTS


;
;PROCEDURE ResetAlrtStage;
;

                .PROC   ResetAlrtStage

                MOVE.W  #0,ACount
                RTS

;
;PROCEDURE DlgCut(dialog: DialogPtr);
;PROCEDURE DlgPaste(dialog: DialogPtr);
;PROCEDURE DlgCopy(dialog: DialogPtr);
;PROCEDURE DlgDelete(dialog: DialogPtr);
;

        .PROC   DlgPaste
        .DEF    DlgCut
        .DEF    DlgCopy
        .DEF    DlgDelete

                BSR.S   StdCheck
                _TEPaste

adios           MOVE.L  (SP)+,(SP)              ;pop return/argument
                RTS

DlgCut          BSR.S   StdCheck
                _TECut
                BRA.S   adios

DlgCopy         BSR.S   StdCheck
                _TECopy
                BRA.S   adios

DlgDelete       BSR.S StdCheck
                _TEDelete
                BRA.S   adios

StdCheck        MOVE.L  8(SP),A0                ;get dialog ptr
                TST     EditField(A0)           ;see if edit is open
                BMI.S   noDice
                MOVE.L  (SP)+,A1                ;pop return for stdcheck
                MOVE.L  TEHandle(A0),-(SP)      ;pass text edit handle
                JMP     (A1)

noDice          MOVEM.L (SP)+,D0/A0-A1          ;get real return addr
                JMP     (A0)                    ;return

;
;PROCEDURE SetDAFont(fontNum: INTEGER);
;

                .PROC   SetDAFont

                MOVE.L  (SP)+,A0                ;return addr
                MOVE.W  (SP)+,dlgFont           ;set new dlg font
                JMP     (A0)


;
;FUNCTION TEScrapHndl: Handle;

                .PROC TEScrapHndl

                MOVE.L  TEScrpHandle,4(SP)
                RTS

;
; FUNCTION TEGetScrapLen: LongInt;

                .PROC TEGetScrapLen

                CLR.L   4(SP)
                MOVE.W  TEScrpLength,6(SP)
                RTS

;
; FUNCTION TESetScrapLen(length: LongInt);

                .PROC TESetScrapLen

                MOVE.W  6(SP),TEScrpLength      ;low order word of longInt is len
                MOVE.L  (SP)+,(SP)              ;pop arg
                RTS

;
; FUNCTION GetDblTime: LongInt;

                .FUNC GetDblTime

                MOVE.L doubleTime,4(SP)
                RTS

;
; FUNCTION GetCaretTime: LongInt;

                .FUNC GetCaretTime

                MOVE.L  caretTime,4(SP)
                RTS

;PROCEDURE GetIndString(VAR theString: str255; strListID: INTEGER;
;                       index: INTEGER);
;
;gets the STR# resource with ID strListID and returns in theString the index-th
;string in the string list.

                .PROC GetIndString

                LINK    A6,#0

                ;get the string list
                SUBQ    #4,SP                   ;room for result handle
                MOVE.L  #'STR#',-(SP)           ;theType
                MOVE.W  10(A6),-(SP)            ;strListID
                _GetResource
                MOVE.L  12(A6),A1               ;ptr to where to return the str
                CLR.B   (A1)                    ;assume empty
                MOVE.L  (SP)+,D0                ;handle to string list
                BEQ.S   gsret                   ;if empty, just quit
                MOVE.L  D0,A0                   ;get handle in A0
                MOVE.L  (A0),A0                 ;deref it
                MOVE.W  (A0)+,D0                ;get the number of strings
                MOVE.W  8(A6),D1                ;the index
                CMP.W   D0,D1                   ;is index larger than count?
                BGT.S   gsret                   ;yes, just quit
                MOVEQ   #0,D0                   ;will keep track of length of strs

gsLoop          SUBQ.W  #1,D1                   ;decrement the index
                BEQ.S   gsCopy                  ;found the one we are looking for
                MOVE.B  (A0)+,D0                ;get length of this one
                ADD.L   D0,A0                   ;skip over this string
                BRA.S   gsLoop                  ;and go on to next

gsCopy          MOVE.B  (A0),D0                 ;get the length of this string
                ADDQ    #1,D0                   ;add one for the length byte
                _BlockMove                      ;copy it into the string

gsret           UNLK    A6
                MOVE.L  (SP)+,A0                ;return addr
                ADDQ.L  #8,SP                   ;pop off parms
                JMP     (A0)                    ;return


;PROCEDURE GetIndPattern(VAR thePat: Pattern; patListID: INTEGER;index: INTEGER)
;
;gets PAT# resource with ID patListID and stuffs into thePat the index-th
;pattern in the list.

                .PROC GetIndPattern

                LINK    A6,#0

                ;get the string list
                SUBQ    #4,SP                   ;room for result handle
                MOVE.L  #'PAT#',-(SP)           ;theType
                MOVE.W  10(A6),-(SP)            ;patListID
                _GetResource
                MOVE.L  12(A6),A1               ;ptr to where to return the pat
                MOVE.L  (SP)+,D0                ;handle to string list
                BEQ.S   gpret                   ;if empty, just quit
                MOVE.L  D0,A0                   ;get handle in A0
                MOVE.L  (A0),A0                 ;deref it
                MOVE.W  (A0)+,D0                ;get the number of patterns
                MOVE.W  8(A6),D1                ;the index
                BLE.S   gpret                   ;no such thing as negative index
                CMP.W   D0,D1                   ;is index larger than count?
                BGT.S   gpret                   ;yes, just quit

gpLoop          SUBQ.W  #1,D1                   ;decrement the index
                BEQ.S   gpCopy                  ;found the one we are looking for
                ADDQ    #8,A0                   ;skip over the pattern
                BRA.S   gpLoop                  ;and go on to next

gpCopy          MOVEQ   #8,D0                   ;a pattern is 8 bytes
                _BlockMove                      ;copy it into the string

gpret           UNLK    A6
                MOVE.L  (SP)+,A0                ;return addr
                ADDQ.L  #8,SP                   ;pop off parms
                JMP     (A0)                    ;return

                .END
N GetCaretTime: LongInt;

                .FUNC GetCaretTime

                MOVE.L  caretTime,4(SP)
                RTS

;PROCEDURE GetIndString(VAR theString: str255; strListID: INTEGER;
;                       index: INTEGER);
;
;gets the STR# resource with ID strListID and returns in theString the index-th
;string in the string list.

                .PROC GetIndString

                LINK    A6,#0

                ;get the string list
                SUBQ    #4,SP       sumacc/ws/applec/   775      0     12           0  3472707205   7123 sumacc/ws/applec/events   444      0     12        7166  3472707205  10445 
EVENTS                           C Interface                             EVENTS

NAME
      events -- event manager

SYNOPSIS
      #include "c/include/types.h"
      #include "c/include/quickdraw.h"
      #include "c/include/events.h"

      /* Event Types */
      
      #define  everyEvent      (-1)
      #define  nullEvent         0
      #define  mouseDown         1
      #define  mouseUp           2
      #define  keyDown           3
      #define  keyUp             4
      #define  autoKey           5
      #define  updateEvt         6
      #define  diskEvt           7
      #define  activateEvt       8
      #define  abortEvt          9
      #define  reserveEvt       10
      #define  driverEvt        11
      #define  app1Evt          12
      #define  app2Evt          13
      #define  app3Evt          14
      #define  app4Evt          15
      
      /* Event Masks */
      
      #define  nullMask          1
      #define  mDownMask         2
      #define  mUpMask           4
      #define  keyDownMask       8
      #define  keyUpMask        16
      #define  autoKeyMask      32
      #define  updateMask       64
      #define  diskMask        128
      #define  activMask       256
      #define  abortMask       512
      #define  reserveMask    1024
      #define  driverMask     2048
      #define  app1Mask       4096
      #define  app2Mask       8192
      #define  app3Mask      16384
      #define  app4Mask    (-32768)
                                   
      /* Modifiers */

      #define  optionKey      2048
      #define  alphaLock      1024
      #define  shiftKey        512
      #define  cmdKey          256
      #define  btnState        128
      
      #define  charCodeMask  0x000000FF
      #define  keyCodeMask   0x0000FF00

      #define  activeFlag        1 
      #define  changeFlag        2 

      
      typedef struct {
         short what;
         int   message;
         int   when;
         Point where;
         short modifiers;
         } EventRecord;

      typedef int KeyMap[4];


      /* Accessing Events */
      
      pascal Boolean GetNextEvent(eventMask,theEvent)
         short eventMask;
         EventRecord *theEvent;
      pascal Boolean EventAvail(eventMask,theEvent)
         short eventMask;
         EventRecord *theEvent;
      
      
      /* Posting and Removing Events */
      
      short PostEvent(eventCode,eventMsg)
         short eventCode;
         int eventMsg;
      FlushEvents(eventMask,stopMask)
         short eventMask;
         short stopMask;
      
      
      /* Reading the Mouse */
      
      pascal void GetMouse(mouseLoc)
         Point *mouseLoc;
      pascal Boolean Button()
      pascal Boolean StillDown()
      pascal Boolean WaitMouseUp()
      
      
      /* Reading the Keyboard and Keypad */
      
      pascal void GetKeys(theKeys)
         KeyMap *theKeys;
      

      /* Miscellaneous Utilities */
      
      SetEventMask(theMask)
         short theMask;
      pascal int TickCount()
                        
      
      /* OS Events */
  
      Boolean OSEventAvail(mask,theEvent)
         short mask;
         EventRecord *theEvent;
      Boolean GetOSEvent(mask,theEvent)
         short mask;
         EventRecord *theEvent;


DESCRIPTION
      The event manager provides access to the Macintosh keyboard, keypad and
      mouse.

      For more detailed information see the "Event Manager" section of the
      "Inside Macintosh" documentation.

AUTHOR
      C Interface by Rick Meyers
      Copyright 1984 Apple Computer Inc.

BUGS  
      The bit positions within KeyMap aren't obvious and should be documented.
      No trap number for SetEventMask.
     256
      #define  btnState        128
      
      #define  charCodeMask  0x000000FF
      #define  keyCodeMask   0x0000FF00

      #define  activeFlag        1 
      #define  changeFlag        2 

      
      typedef struct {
         short what;
         int   message;
         int   when;
         Point where;
         short modifiers;
         } EventRecord;

      typedef int Kesumacc/ws/applec/fonts   444      0     12       10014  3472707205  10274 
FONTS                            C Interface                              FONTS

NAME
      fonts -- font manager

SYNOPSIS
      #include "c/include/types.h"
      #include "c/include/quickdraw.h"
      #include "c/include/fonts.h"

      #define  systemFont  0
      #define  applFont    1
      #define  newYork     2
      #define  geneva      3
      #define  monaco      4
      #define  venice      5
      #define  london      6
      #define  athens      7
      #define  sanFran     8
      #define  toronto     9
      
      #define  propFont    0x9000
      #define  fixedFont   0xB000
      #define  fontWid     0xACB0


      typedef struct {
         short         family;         /* e.g. Century  */
         short         size;           /* e.g. 12 Point */
         Style         face;           /* e.g. bold | underline   */
         Boolean       needBits;       /* bits or just measurement */
         short         device;         /* always 0 for display */
         Point         numer;          /* current drawing scale */
         Point         denom;          /* current drawing scale */
         } FMInput;
      
      typedef struct {
         short         errNum;         /* not used */
         Handle        fontHandle;     /* Handle to font */
         unsigned char boldPixels;     /* pixels of horizontal smear */
         unsigned char italicPixels;   /* pixels of horizontal shear */
         unsigned char ulOffset;       /* pixels below baseline */
         unsigned char ulShadow;       /* pixels in halo */
         unsigned char ulThick;        /* thickness of underline */
         unsigned char shadowPixels;   /* pixels to shadow (0 .. 3) */
         char          extra;          /* extra white pixels/char */
         unsigned char ascent;         /* ascent */
         unsigned char descent;        /* descent */
         unsigned char widMax;         /* maximum character width */
         char          leading;        /* leading between lines */
         char          unused;         /* not used */
         Point         numer;          /* current drawing scale */
         Point         denom;          /* current drawing scale */
         } FMOutput, *FMOutPtr;

      typedef struct {
         short         fontType;       /* font type */
         short         firstChar;      /* ASCII code of first character */
         short         lastChar;       /* ASCII code of last character */
         short         widMax;         /* maximum character width */
         short         kernMax;        /* maximum character kern */
         short         nDescent;       /* negative of descent */
         short         fRectMax;       /* width of font rectangle */
         short         chHeight;       /* character height */
         short         owTLoc;         /* offset to offset/width table */
         short         ascent;         /* ascent */
         short         descent;        /* descent */
         short         leading;        /* leading */
         short         rowWords;       /* row width of bit image / 2 */
         /*
         short         bitImage[(rowWords-1)+1][(chHeight-1)+1];
         short         locTable[(lastChar+2-firstChar)+1];
         short         owTable[(lastChar+2-firstChar)+1];
         */
         } FontRec;
      

      pascal void InitFonts()
      GetFontName(fontNum,theName)
         short fontNum;
         char *theName;
      GetFNum(fontName,theNum)
         char *fontName;
         short *theNum;
      pascal Boolean RealFont(fontNum,size)
         short fontNum;
         short size;
      pascal void SetFontLock(lockFlag)
         Boolean lockFlag;
      pascal FMOutPtr SwapFont(inRec)
         FMInput *inRec;



DESCRIPTION
      The font manager supports the use of the character fonts used to draw
      text with QuickDraw.

      For more detailed information see the "Font Manager" section of the
      "Inside Macintosh" documentation.

AUTHOR
      C Interface by Rick Meyers
      Copyright 1984 Apple Computer Inc.

BUGS
      Check on multidimensional arrays in C and Pascal.
      UNLK    A6
                MOVE.L  (SP)+,A0                ;return addr
                ADDQ.L  #8,SP                   ;pop off parms
                JMP     (A0)                    ;return


;PROCEDURE GetIndPattern(VAR thePat: Pattern; patListID: INTEGER;index: INTEGER)
;
;gets PAT# resource with ID patListID and stuffs into thePat the index-th
;pattern in the list.

                .PROC GetIndPattern

                LINK    A6,#0

                ;get the string list
                sumacc/ws/applec/memory   444      0     12        7504  3472707205  10445 
MEMORY                           C Interface                             MEMORY

NAME
      memory -- memory manager

SYNOPSIS
      #include "c/include/types.h"
      #include "c/include/memory.h"

      #define noErr            0   /* no error */
      #define memFullErr   (-108)  /* not enough room in Zone */
      #define nilHandleErr (-109)  /* nil master pointer */
      #define memWZErr     (-111)  /* attempt to operate on a free block */
      #define memPurErr    (-112)  /* attempt to purge a locked block */

      #define maxSize   0x800000   /* max data block size is 512K bytes */

      typedef struct {
         Ptr      bkLim;
         Ptr      purgePtr;
         Ptr      hFstFree;
         int      zCBFree;
         int      (*gZProc)();
         short    moreMast;
         short    flags;
         short    cntRel;
         short    maxRel;
         short    cntNRel;
         short    maxNRel;
         short    cntEmpty;
         short    cntHandles;
         int      minCBFree;
         int      (*purgeProc)();
         Ptr      sparePtr;
         Ptr      allocPtr;
         short    heapData;
         } Zone,*THz;

                        
      /* Initialization */

      InitApplZone()
      SetApplBase(startPtr)
         Ptr startPtr;
      InitZone(growProc,MoreMasters,limitPtr,startPtr)
         int (*growProc)();
         short MoreMasters;
         Ptr limitPtr,startPtr;
      SetApplLimit(zoneLimit)
         Ptr zoneLimit;
      MaxApplZone();
      MoreMasters();

      /* Heap Zone Access */

      THz GetZone()
      SetZone(hz)
         THz hz;
      THz ApplicZone()
      THz SystemZone()

      /* Relocatable Blocks */
      
      Handle NewHandle(byteCount)
         int byteCount; 
      DisposHandle(h)
         Handle h;
      int GetHandleSize(h)
         Handle h;
      SetHandleSize(h,newSize)
         Handle h;
         int newSize;
      THz HandleZone(h)
         Handle h;
      Handle RecoverHandle(p)
         Ptr p;
      ReallocHandle(h,byteCount)
         Handle h;
         int byteCount;
      
      /* Non-Relocatable Blocks */
      
      Ptr NewPtr(byteCount)
         int byteCount;
      DisposPtr(p)
         Ptr p; 
      int GetPtrSize(p)
         Ptr p;
      SetPtrSize(p,newSize)
         Ptr p;
         int newSize;
      THz PtrZone(p)
         Ptr p;
      
      /* Freeing Space */
      
      int FreeMem()
      int MaxMem(grow)
         int *grow;
      int CompactMem(cbNeeded)
         int cbNeeded;
      ResrvMem(cbNeeded)
         int cbNeeded;
      PurgeMem(cbNeeded)
         int cbNeeded;
      EmptyHandle(h)
         Handle h;
      
      /* Lock and Purge */
       
      HLock(h)
         Handle h;
      HUnLock(h)
         Handle h;
      HPurge(h)
         Handle h;
      HNoPurge(h)
         Handle h;
      
      /* Grow Zone */
      
      SetGrowZone(growZone)
         int (*growZone)(); 
      Boolean GZCritical()
      Handle CZSaveHnd()
      
      /* Heap Utilities */
      
      BlockMove(srcPtr,destPtr,byteCount)
         Ptr srcPtr, destPtr;
         int byteCount;
      Ptr TopMem()
      short MemError()


DESCRIPTION
      The memory manager provides dynamic allocation of both relocatable and
      non-relocatable memory space within system and application heaps.

      For more detailed information see the "Memory Manager" section of the
      "Inside Macintosh" documentation.

AUTHOR
      C Interface by Rick Meyers and Dan Smith
      Copyright 1984 Apple Computer Inc.

BUGS
      Untested:
         InitApplZone    requires funky code since it deletes code in app heap
         MoreMasters     not documented
         SetApplBase     same problem as InitApplZone
         SetApplLimit    on my 512K Mac applLimit is already at max?
         MaxApplZone     not documented
      
       Added getApplLimit() function to determine SetApplLimit problem.
     ;handle to string list
                BEQ.S   gpret                   ;if empty, just quit
                MOVE.L  D0,A0                   ;get handle in A0
                MOVE.L  (sumacc/ws/applec/quickdraw   444      0     12       40515  3472707205  11146 
QUICKDRAW                         C Interface                          QUICKDRAW

NAME
      quickdraw -- QuickDraw graphics

SYNOPSIS 
      #include "c/include/types.h"
      #include "c/include/quickdraw.h"

      /* 16 Transfer Modes */
      
      #define  srcCopy       0
      #define  srcOr         1
      #define  srcXor        2
      #define  srcBic        3
      #define  notSrcCopy    4
      #define  notSrcOr      5
      #define  notSrcXor     6
      #define  notSrcBic     7
      #define  patCopy       8
      #define  patOr         9
      #define  patXor        10
      #define  patBic        11
      #define  notPatCopy    12
      #define  notPatOr      13
      #define  notPatXor     14
      #define  notPatBic     15
      
      /* QuickDraw Color Separation Constants */
      
      #define  normalBit     0
      #define  inverseBit    1
      #define  redBit        4      /* RGB Additive Mapping */
      #define  greenBit      3
      #define  blueBit       2
      #define  cyanBit       8      /* CMYBk Subtractive Mapping */
      #define  magentaBit    7
      #define  yellowBit     6
      #define  blackBit      5
      #define  blackColor    33     /* Colors Expressed in these Mappings */
      #define  whiteColor    30 
      #define  redColor      205
      #define  greenColor    341
      #define  blueColor     409
      #define  cyanColor     273
      #define  magentaColor  137
      #define  yellowColor   69
      
      /* Picture Comments */
      
      #define  picLParen     0
      #define  picRParen     1
      
      /* Type Style Constants */
            
      #define  normal        0x00
      #define  bold          0x01
      #define  italic        0x02
      #define  underline     0x04
      #define  outline       0x08
      #define  shadow        0x10
      #define  condense      0x20
      #define  expand        0x40


      /* Types */
      
      typedef  unsigned char Pattern[8];
      typedef  enum {frame,paint,erase,invert,fill} GrafVerb;
      typedef  short Style;
      
      typedef  struct {
         short    ascent;
         short    descent;
         short    maxWidth;
         short    leading;
         } FontInfo;
      
      typedef struct {
         short    v;
         short    h;
         } Point; 
      
      typedef struct {
         short    top;
         short    left;
         short    bottom;
         short    right;
         } Rect;

      typedef struct {
         Ptr      baseAddr;
         short    rowBytes;
         Rect     bounds;
         } BitMap;

      typedef struct {
         short    data[16];
         short    mask[16];
         Point    hotSpot;
         } Cursor;
      
      typedef struct {
         Point    pnLoc;
         Point    pnSize;
         short    pnMode;
         Pattern  pnPat;
         } PenState;
      
      typedef struct {
         short    rgnSize;
         Rect     rgnBBox;
         /* plus more data if not rectangular */
         } Region, *RgnPtr, **RgnHandle;
      
      typedef struct {
         short    picSize;
         Rect     picFrame;
         /* plus Picture contents */
         } Picture, *PicPtr, **PicHandle;
      
      typedef struct {
         short    polySize;
         Rect     polyBBox;
         Point    polyPoints[1];
         } Polygon, *PolyPtr, **PolyHandle;
      
      typedef struct {
         int      (*textProc)();
         int      (*lineProc)();
         int      (*rectProc)();
         int      (*rRectProc)();
         int      (*ovalProc)();
         int      (*arcProc)();
         int      (*polyProc)();
         int      (*rgnProc)();
         int      (*bitsProc)();
         int      (*commentProc)();
         short    (*txMeasProc)();
         int      (*getPicProc)();
         int      (*putPicProc)();
         } QDProcs, *QDProcsPtr;
      
      typedef struct {
         short       device;
         BitMap      portBits;
         Rect        portRect;
         RgnHandle   visRgn;
         RgnHandle   clipRgn;
         Pattern     bkPat;
         Pattern     fillPat;
         Point       pnLoc;
         Point       pnSize;
         short       pnMode;
         Pattern     pnPat;
         short       pnVis;
         short       txFont;
         Style       txFace;
         short       txMode;
         short       txSize;
         int         spExtra;
         int         fgColor;
         int         bkColor;
         short       colrBit;
         short       patStretch;
         PicHandle   picSave;
         RgnHandle   rgnSave;
         PolyHandle  polySave;
         QDProcsPtr  grafProcs;
         } GrafPort, *GrafPtr;
      

      /* External Variable Declarations */
                                           
      extern struct {
         char      private[78]; 
         int       randSeed;
         BitMap    screenBits;
         Cursor    arrow;
         Pattern   dkGray;
         Pattern   ltGray;
         Pattern   gray;
         Pattern   black;
         Pattern   white;
         GrafPtr   thePort;
         } qd;


      /* GrafPort Routines */
      
      pascal void InitGraf(globalPtr)
         Ptr globalPtr;
      pascal void OpenPort(port)
         GrafPtr port;
      pascal void InitPort(port)
         GrafPtr port;
      pascal void ClosePort(port)
         GrafPtr port;
      pascal void SetPort(port)
         GrafPtr port;
      pascal void GetPort(port)
         GrafPtr *port;
      pascal void GrafDevice(device)
         short device;
      pascal void SetPortBits(bm)
         BitMap *bm;
      pascal void PortSize(width,height)
         short width,height;
      pascal void MovePortTo(leftGlobal,rightGlobal)
         short leftGlobal,rightGlobal;
      pascal void SetOrigin(h,v)
         short h,v;
      pascal void SetClip(rgn)
         RgnHandle rgn;
      pascal void GetClip(rgn)
         RgnHandle rgn;
      pascal void ClipRect(r)
         Rect *r;
      pascal void BackPat(pat)
         Pattern *pat;
       

      /* Cursor Routines */

      pascal void InitCursor()
      pascal void SetCursor(crsr)
         Cursor *crsr;
      pascal void HideCursor()
      pascal void ShowCursor()
      pascal void ObscureCursor()


      /* Line Routines */
          
      pascal void HidePen()
      pascal void ShowPen()
      pascal void GetPen(pt)
         Point *pt;
      pascal void GetPenState(pnState)
         PenState *pnState;
      pascal void SetPenState(pnState)
         PenState *pnState;
      pascal void PenSize(width,height)
         short width,height;
      pascal void PenMode(mode)
         short mode;
      pascal void PenPat(pat)
         Pattern *pat;
      pascal void PenNormal()
      pascal void MoveTo(h,v)
         short h,v;
      pascal void Move(dh,dv)
         short dh,dv;
      pascal void LineTo(h,v)
         short h,v;
      pascal void Line(dh,dv)
         short dh,dv;
      
      
      /* Text Routines */
      
      pascal void TextFont(font)
         short font;
      pascal void TextFace(face)
         Style face;
      pascal void TextMode(mode)
         short mode;
      pascal void TextSize(size)
         short size;
      pascal void SpaceExtra(extra)
         int extra;
      pascal void DrawChar(ch)
         short ch;
      DrawString(s)
         char *s; 
      pascal void DrawText(textBuf,firstByte,byteCount)
         Ptr textBuf;
         short firstByte,byteCount;
      pascal short CharWidth(ch)
         short ch;
      short StringWidth(s)
         char *s;
      pascal short TextWidth(textBuf,firstByte,byteCount)
         Ptr textBuf;
         short firstByte,byteCount;
      pascal void GetFontInfo(info)
         FontInfo *info; 
 
         
      /* Drawing in Color */

      pascal void ForeColor(color)
         int color;
      pascal void BackColor(color)
         int color;
      pascal void ColorBit(whichBit)
         short whichBit;


      /* Rectangle Calculations */ 
      
      pascal void SetRect(r,left,top,right,bottom)
         Rect *r;
         short left,top,right,bottom;
      pascal void OffsetRect(r,dh,dv)
         Rect *r;
         short dh,dv;
      pascal void InsetRect(r,dh,dv)
         Rect *r;
         short dh,dv;
      pascal Boolean SectRect(src1,src2,dstRect)
         Rect *src1,*src2,*dstRect;
      pascal void UnionRect(src1,src2,dstRect)
         Rect *src1,*src2,*dstRect;
      Boolean PtInRect(pt,r)
         Point *pt;
         Rect *r;
      Pt2Rect(pt1,pt2,dstRect)
         Point *pt1, *pt2;
         Rect *dstRect;
      PtToAngle(r,pt,angle)
         Rect *r;
         Point *pt;
         short *angle;
      pascal Boolean EqualRect(rect1,rect2)
         Rect *rect1,*rect2;
      pascal Boolean EmptyRect(r)
         Rect *r;
      
      
      /* Graphical Operations on Rectangles */ 
      
      pascal void FrameRect(r)
         Rect *r;
      pascal void PaintRect(r)
         Rect *r;
      pascal void EraseRect(r)
         Rect *r;
      pascal void InvertRect(r)
         Rect *r;
      pascal void FillRect(r,pat)
         Rect *r;
         Pattern *pat;
      
      
      /* Oval Routines */
      
      pascal void FrameOval(r)
         Rect *r;
      pascal void PaintOval(r)
         Rect *r;
      pascal void EraseOval(r)
         Rect *r;
      pascal void InvertOval(r)
         Rect *r;
      pascal void FillOval(r,pat)
         Rect *r;
         Pattern *pat;
      
      
      /* RoundRect Routines */ 
      
      pascal void FrameRoundRect(r,ovWd,ovHt)
         Rect *r;
         short ovWd,ovHt;
      pascal void PaintRoundRect(r,ovWd,ovHt)
         Rect *r;
         short ovWd,ovHt;
      pascal void EraseRoundRect(r,ovWd,ovHt)
         Rect *r;
         short ovWd,ovHt;
      pascal void InvertRoundRect(r,ovWd,ovHt)
         Rect *r;
         short ovWd,ovHt;
      pascal void FillRoundRect(r,ovWd,ovHt,pat)
         Rect *r;
         short ovWd,ovHt;
         Pattern *pat;
      
      
      /* Arc Routines */
      
      pascal void FrameArc(r,startAngle,arcAngle)
         Rect *r;
         short startAngle,arcAngle;
      pascal void PaintArc(r,startAngle,arcAngle)
         Rect *r;
         short startAngle,arcAngle;
      pascal void EraseArc(r,startAngle,arcAngle)
         Rect *r;
         short startAngle,arcAngle;
      pascal void InvertArc(r,startAngle,arcAngle)
         Rect *r;
         short startAngle,arcAngle;
      pascal void FillArc(r,startAngle,arcAngle,pat)
         Rect *r;
         short startAngle,arcAngle;
         Pattern *pat;
      
      
      /* Region Calculations */
      
      pascal RgnHandle NewRgn()
      pascal void DisposeRgn(rgn)
         RgnHandle rgn;
      pascal void CopyRgn(srcRgn,dstRgn)
         RgnHandle srcRgn,dstRgn;
      pascal void SetEmptyRgn(rgn)
         RgnHandle rgn;
      pascal void SetRectRgn(rgn,left,top,right,bottom)
         RgnHandle rgn;
         short left,top,right,bottom;
      pascal void RectRgn(rgn,r)
         RgnHandle rgn;
         Rect *r;
      pascal void OpenRgn()
      pascal void CloseRgn(dstRgn)
         RgnHandle dstRgn;
      pascal void OffsetRgn(rgn,dh,dv)
         RgnHandle rgn;
         short dh,dv;
      pascal void InsetRgn(rgn,dh,dv)
         RgnHandle rgn;
         short dh,dv;
      pascal void SectRgn(srcRgnA,srcRgnB,dstRgn)
         RgnHandle srcRgnA,srcRgnB,dstRgn;
      pascal void UnionRgn(srcRgnA,srcRgnB,dstRgn)
         RgnHandle srcRgnA,srcRgnB,dstRgn;
      pascal void DiffRgn(srcRgnA,srcRgnB,dstRgn) 
         RgnHandle srcRgnA,srcRgnB,dstRgn;
      pascal void XorRgn(srcRgnA,srcRgnB,dstRgn) 
         RgnHandle srcRgnA,srcRgnB,dstRgn;
      Boolean PtInRgn(pt,rgn)
         Point *pt;
         RgnHandle rgn;
      pascal Boolean RectInRgn(r,rgn)
         Rect *r;
         RgnHandle rgn;
      pascal Boolean EqualRgn(rgnA,rgnB)
         RgnHandle rgnA,rgnB;
      pascal Boolean EmptyRgn(rgn)
         RgnHandle rgn;
                        
      
      /* Graphical Operations on Regions */ 
      
      pascal void FrameRgn(rgn)
         RgnHandle rgn;
      pascal void PaintRgn(rgn)
         RgnHandle rgn;
      pascal void EraseRgn(rgn)
         RgnHandle rgn;
      pascal void InvertRgn(rgn)
         RgnHandle rgn;
      pascal void FillRgn(rgn,pat)
         RgnHandle rgn;
         Pattern *pat;
      
      
      /* Graphical Operations on BitMaps */
      
      pascal void ScrollRect(dstRect,dh,dv,updateRgn)
         Rect *dstRect;
         short dh,dv;
         RgnHandle updateRgn;
      pascal void CopyBits(srcBits,dstBits,srcRect,dstRect,mode,maskRgn) 
         BitMap *srcBits,*dstBits;   
         Rect *srcRect,*dstRect;   
         short mode;         
         RgnHandle maskRgn;
      
      
      /* Picture Routines */
      
      pascal PicHandle OpenPicture(picFrame)
         Rect *picFrame;
      pascal void PicComment(kind,dataSize,dataHandle)  
         short kind,dataSize;
         Handle dataHandle;
      pascal void ClosePicture()
      pascal void DrawPicture(myPicture,dstRect)
         PicHandle myPicture;
         Rect *dstRect;
      pascal void KillPicture(myPicture)
         PicHandle myPicture;
      
      
      /* Polygon Calculations */
      
      pascal PolyHandle OpenPoly()
      pascal void ClosePoly()
      pascal void KillPoly(poly)
         PolyHandle poly;
      pascal void OffsetPoly(poly,dh,dv)
         PolyHandle poly; short dh,dv;

      
      /* Graphical Operations on Polygons */

      pascal void FramePoly(poly)
         PolyHandle poly;
      pascal void PaintPoly(poly)
         PolyHandle poly;
      pascal void ErasePoly(poly)
         PolyHandle poly;
      pascal void InvertPoly(poly)
         PolyHandle poly;
      pascal void FillPoly(poly,pat)
         PolyHandle poly; Pattern *pat;
      
      
      /* Point Calculations */
      
      AddPt(src,dst)
         Point *src,*dst;
      SubPt(src,dst)
         Point *src,*dst;
      pascal void SetPt(pt,h,v)
         Point *pt;
         short h,v;
      Boolean EqualPt(pt1,pt2)
         Point *pt1, *pt2;
      pascal void LocalToGlobal(pt)
         Point *pt;
      pascal void GlobalToLocal(pt)
         Point *pt;
      
      
      /* Misc Utility Routines */
      
      pascal short Random()
      pascal Boolean GetPixel(h,v)
         short h,v;
      StuffHex(thingPtr,s)
         Ptr thingPtr;
         char *s;
      pascal void ScalePt(pt,fromRect,toRect)
         Point *pt;
         Rect *fromRect,*toRect;
      pascal void MapPt(pt,fromRect,toRect)
         Point *pt;
         Rect *fromRect,*toRect;
      pascal void MapRect(r,fromRect,toRect)
         Rect *r,*fromRect,*toRect;
      pascal void MapRgn(rgn,fromRect,toRect)
         RgnHandle rgn;
         Rect *fromRect,*toRect;
      pascal void MapPoly(poly,fromRect,toRect)
         PolyHandle poly;
         Rect *fromRect,*toRect;
      
      
      /* Bottleneck Interface */   
      
      pascal void SetStdProcs(procs)
         QDProcsPtr procs;
      StdText(count,textAddr,numer,denom)
         short count;
         Ptr textAddr;
         Point *numer, *denom;
      StdLine(newPt)
         Point *newPt;
      pascal void StdRect(verb,r)
         GrafVerb verb;
         Rect *r;
      pascal void StdRRect(verb,r,ovWd,ovHt)
         GrafVerb verb;
         Rect *r;
         short ovWd,ovHt;
      pascal void StdOval(verb,r)
         GrafVerb verb;
         Rect *r;
      pascal void StdArc(verb,r,startAngle,arcAngle)
         GrafVerb verb;
         Rect *r;
         short startAngle,arcAngle;
      pascal void StdPoly(verb,poly)
         GrafVerb verb;
         PolyHandle poly;
      pascal void StdRgn(verb,rgn)
         GrafVerb verb;
         RgnHandle rgn;
      pascal void StdBits(srcBits,srcRect,dstRect,mode,maskRgn)
         BitMap *srcBits;
         Rect *srcRect,*dstRect;  
         short mode;
         RgnHandle maskRgn;
      pascal void StdComment(kind,dataSize,dataHandle)
         short kind,dataSize;
         Handle dataHandle;
      pascal short StdTxMeas(count,textAddr,numer,denom,info)
         short count;
         Ptr textAddr;     
         Point *numer,*denom;
         FontInfo *info;
      pascal void StdGetPic(dataPtr,byteCount)
         Ptr dataPtr;
         short byteCount;
      pascal void StdPutPic(dataPtr,byteCount)
         Ptr dataPtr;
         short byteCount;
      
      
DESCRIPTION
      QuickDraw is the Macintosh graphics package.  

      For more detailed information see the "QuickDraw" section of the
      "Inside Macintosh" documentation.

AUTHOR
      Quickdraw by Bill Atkinson
      C Interface by Rick Meyers
      Copyright 1984 Apple Computer Inc.

BUGS
      Capture procs are not yet implemented.
        Rect *srcRect,*dstRect;   
         short mode;         
         RgnHandle maskRgn;
      
      
      /* Picture Routines */
      
      pascal PicHandle OpenPicture(psumacc/ws/applec/resources   444      0     12       11711  3472707205  11162 
RESOURCES                        C Interface                          RESOURCES

NAME
      resources -- resource manager

SYNOPSIS
      #include "c/include/types.h"
      #include "c/include/resources.h"


      /* Resource Attributes */

      #define resSysRef        128        /* Reference to system resource? */
      #define resSysHeap        64        /* System or application heap?   */
      #define resPurgeable      32        /* Purgeable resource?           */
      #define resLocked         16        /* Load it in locked?            */
      #define resProtected       8        /* Protected?                    */
      #define resPreload         4        /* Load in on OpenResFile?       */
      #define resChanged         2        /* Resource changed?             */
      #define resUser            1        /* User-definable attribute      */
      
      /* Resource File Attributes */

      #define mapReadOnly      128        /* Resource file read-only       */
      #define mapCompact        64        /* Compact resource file         */
      #define mapChanged        32        /* Write map out at update       */
               
      /* Error Numbers */
    
      #define resNotFound    (-192)       /* Resource not found            */
      #define resFNotFound   (-193)       /* Resource file not found       */
      #define addResFailed   (-194)       /* AddResource failed            */
      #define addRefFailed   (-195)       /* AddReference failed           */
      #define rmvResFailed   (-196)       /* RmveResource failed           */
      #define rmvRefFailed   (-197)       /* RmveReference failed          */
       
      typedef int ResType;

      
      /* Initialization */

      pascal short InitResources()
      pascal void RsrcZoneInit()


      /* Opening and Closing Resource Files */

      CreateResFile(fileName)
         char *fileName;
      short OpenResFile(fileName)
         char *fileName;
      pascal void CloseResFile(refNum)
         short refNum;

      
      /* Errors */

      pascal short ResError()


      /* Setting the Current Resource File */

      pascal short CurResFile()
      pascal short HomeResFile(theResource)
         Handle theResource;
      pascal void UseResFile(refNum)
         short refNum;


      /*  Getting Resource Types */

      pascal short CountTypes()
      pascal void GetIndType(theType,index)
         ResType *theType;
         short index;


      /* Getting and Displosing of Resources */

      pascal void SetResLoad(autoLoad)
         Boolean autoLoad;
      pascal short CountResources(theType)
         ResType theType;
      pascal Handle GetIndResource(theType,index)
         ResType theType;
         short index;
      pascal Handle GetResource(theType,theId)
         ResType theType;
         short theId;
      Handle GetNamedResource(theType,name)
         ResType theType;
         char *name;
      pascal void LoadResource(theResource)
         Handle theResource;
      pascal void ReleaseResource(theResource) 
         Handle theResource;
      pascal void DetachResource(theResource)
         Handle theResource;


      /* Getting Resource Information */

      pascal short UniqueId(theType)
         ResType theType;
      GetResInfo(theResource,theId,theType,name)
         Handle theResource;
         short *theId;
         ResType *theType;
         char *name;
      pascal short GetResAttrs(theResource)
         Handle theResource;
      pascal int SizeResource(theResource)
         Handle theResource;
  

      /* Modifing Resources */

      SetResInfo(theResource,theId,name)
         Handle theResource;
         short theId;
         char *name;
      pascal void SetResAttrs(theResource,attrs)
         Handle theResource;
         short attrs;
      pascal void ChangedResource(theResource)
         Handle theResource;
      AddResource(theResource,theType,theId,name)
         Handle theResource;
         ResType theType;
         short theId;
         char *name;
      pascal void RmveResource(theResource)
         Handle theResource;
      AddReference(theResource,theId,name)
         Handle theResource;
         short theId;
         char *name;
      pascal void RmveReference(theResource)
         Handle theResource;
      pascal void UpdateResFile(refNum)
         short refNum;
      pascal void WriteResource(theResource)
         Handle theResource;
      pascal void SetResPurge(install)
         Boolean install;

      /* Advanced Routines */

      pascal short GetResFileAttrs(refNum)
         short refNum;
      pascal void SetResFileAttrs(refNum,attrs)
         short refNum;
         short attrs;
      

DESCRIPTION
      The resource manager provides access to Macintosh resource files.
      Note that ResType may be specified as a character literal (e.g. 'MENU').

      For more detailed information see the "Resource Manager" section of the
      "Inside Macintosh" documentation.

AUTHOR
      C Interface by Rick Meyers
      Copyright 1984 Apple Computer Inc.

BUGS 

(refNum)
         short refNum;

      
      /* Errorssumacc/ws/applec/types   444      0     12        1103  3472707206  10267 
TYPES                             C Interface                              TYPES

NAME
      types -- common defines and types

SYNOPSIS
      #include "c/include/types.h"

      #define nil 0
      #define NULL 0

      typedef enum {false,true} Boolean;
      typedef char *Ptr;
      typedef Ptr *Handle;
      typedef int Fixed;
      typedef char Str255[256];


DESCRIPTION
      These defines and types are shared by several Macintosh libraries.
      
AUTHOR
      C Interfaces by Rick Meyers
      Copyright 1984 Apple Computer Inc.

BUGS
      Is Str255 used anywhere?
heResource;
         short theId;
         char *name;
      pascal void SetResAttrs(theResource,attrs)
         Handle theResource;
         short attrs;
      pascal void ChangedResource(theResource)
         Handle theResource;
      AddResource(theResource,theType,theId,name)
         Handle theResource;
         ResType theType;
         short theId;
         char *name;
      pascal void RmveResource(theResource)
         Handle theRessumacc/ws/un   555      0     12         106  3472707176   6274 #!/bin/sh
for i in $*
do
echo -n $i:
read name
unlisa <$i >$name
done
      TYPES

NAME
      types -- common defines and types

SYNOPSIS
      #include "c/include/types.h"

      #define nil 0
      #define NULL 0

      typedef enum {false,true} Boolean;
      typedef char *Ptr;
      typedef Ptr *Handle;
      typedef int Fixed;
      typedef char Str255[256];


DESCRIPTION
      These defines and types are shared by several Macintosh libraries.
      
AUTHOR
      C Interfaces by Rick Meyers
      Copyrsumacc/cc41/   755      0     12           0  3472711322   5751 sumacc/cc41/libc.a   644      0     12      253672  3472711313   7170 !<arch>
clrerr.b        406162685   11    21    100664  118       `
 6NVÿüHî ÿü*nmÿÏLî ÿüN^Nu _S1_F1"clearerr.L18fgetc.b         406162738   11    21    100664  203       `
@cNVHî nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹XN^Nu _filbuf_S10.L10000<.L10001_F1"fgetc<.L186
fgets.b         406162742   11    21    100664  299       `
l—NVÿôHî0€ÿô*n(nS®o4S•m -R­ @H€HÀ€ÿ`
HUN¹X.m
Ç‡
fÆJ‡l¹îfB€``¶B .Lî0€ÿôN^Nub.L17 _filbuf€0_S14.L10000Z.L21\.L22L.L20>.L10001_F1"fgets.L198
fprintf.b       406162760   11    21    100664  205       `
@eNVHî/.Hn/.N¹ßü n0(HÀ€ gpÿ`B€N^Nu_S18.L10000"fprintf _doprnt:.L10001_F1:.L18
fputc.b         406162764   11    21    100664  211       `
HcNVHî nSm . nR¨"(S A€H€HÀ`/. ./N¹PN^Nu_S10.L10000"fputc _flsbufB.L10001_F1B.L18<
fputs.b         406162768   11    21    100664  281       `
TNVÿðHî0Àÿð*n(n`*S”m ",R¬ A€H€HÀ`HT /N¹P.H€HÀ,fÌ Lî0ÀÿðN^NuÀ0_S1..L10000H.L20 _flsbuf"fputs>.L20000<.L10001_F1.L20001>.L19J.L186
gets.b          406162777   11    21    100664  334       `
p–(NVÿøHî €ÿø*nS¹m 9R¹ @H€HÀ€ÿ`/<N¹X.€
gJ‡mÇ`¼J‡l
»îfB€`B .Lî €ÿøN^Nu _filbuf€ _S12.L10000"gets`.L22R.L21.L20@.L10001_F1f.L18 _iob+½
‹°
+½
‹°
4:getw.b          406162781   11    21    100664  315       `
|NVÿøHî €ÿø*nS•m -R­ @H€HÀ€ÿ`
HUN¹X.0-HÀ€gpÿ`*S•m -R­ @H€HÀ€ÿ`
HUN¹Xက‡Lî €ÿøN^Nu _filbuf€ _S1*.L10000H.L20n.L10003"getw4.L10001_F1d.L10002r.L18.h
puts.b          406162785   11    21    100664  473       `
ÙPNVÿøHî €ÿø*n`4 "9R¹ A€H€HÀ`S¹lÞ/< /N¹PH€HÀ.fÜS¹m 9R¹ @¼
H€HÀ`/</<
N¹PLî €ÿøN^Nu€ _S12.L10000N.L20 _flsbuf„.L10003*.L20002"putsD.L20000D.L10001_F1p.L10002.L20001D.L19„.L18 _iob‹°K½K½,‹°4>K½P‹°XK½^‹°r~
putw.b          406162789   11    21    100664  290       `
p‚NVÿøHî €ÿø..*nS•m "-R­ A€H€HÀ`HU /N¹PS•m à€"-R­ A€H€HÀ`HU à€/N¹PLî €ÿøN^Nu€ _S1,.L10000 _flsbuff.L10003:.L10001_F1"putwV.L10002f.L184`scanf.b         406162793   11    21    100664  462       `
œò NVHîHn/./<N¹ßüN^NuNVHîHn/./.N¹ßüN^NuNVÿìHî ÿì*n=|Aÿü-Mÿø-MÿôB®ÿð`R®ÿðJføHn/.HnÿðN¹ßüLî ÿìN^Nu_S1"Nsscanf.L23x.L25t.L24J.L21 _doscan _S3"(fscanft.L20000_F1_S2_F2"scanfp.L20001_F3$.L18 _iob‹°@†doscan.b        406162735   11    21    100664  5060      `
t€ø	¸NVÿÜHî0€ÿÜ*n(nB®ÿüB®ÿìH€HÀ.€g0€	g”€
gŠ€ g€€%g* nSmÎ nR¨ (S€ @H€HÀ€ÿ`ºH€HÀ.€%gÆB®ÿð‡*g
 LXŒ-Hÿð`H€HÀ.B®ÿø-|ÿè`.‡9n./<
/.ÿøN¹PЇ€0-@ÿøH€HÀ.‡0lÊJ®ÿøf-|u0ÿø‡lfH€HÀ.-|ÿè`(‡hfB®ÿèH€HÀ.`‡[f
HUa¤X*@ € @H€HÀ€g € .-|ÿèJ‡fpÿ`øHnÿì/./.ÿè/.ÿø//.ÿðaèßüJ€g
J®ÿðgR®ÿüJ®ÿìgþtJ®ÿüf¬pÿ`´`þb/.N¹X`$ nSmê nR¨ (S€ @H€HÀ€ÿ-@ÿô€ gÐ€	gÈ€
gÀ®ÿÿÿÿÿôgþ/./.ÿôN¹P`ýô/.N¹X-@ÿô°‡gýÞ€ÿÿÿÿfpÿ`/./.ÿôN¹P .ÿü``ý¸`ý´Lî0€ÿÜN^NuNVÿœHî Àÿœ®cg®sg
®[f0/./././.J®g n `B€/a¶ßü`¢B®ÿ¨B®ÿ¬B®ÿ¸®eg
®ff-|ÿ¸|
®of|`®xf|AîÿÀ*HB®ÿ¼B®ÿ´ nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹X.€ gÄ‡	g¼‡
f`²‡-fBR®ÿ´Ç nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹X.S®`î‡+fäS® nSl¸/.N¹X`Ä‡am‡fo‡AmÎ‡FnÄR®ÿ¬†f .ÿ¨ç€`†
f .ÿ¨å€Ð®ÿ¨ã€` .ÿ¨é€-@ÿ¨-Gÿ°‡0m‡9n‡0`‡am‡fn‡W`‡7ß®ÿ¨..ÿ°Ç nSm, nR¨ (S€ @H€HÀ€ÿ.S®m2‡0m
‡9oÿJ†gÿ‡.fH†
fJ®ÿ¸f2J®ÿ´g
 .ÿ¨D€-@ÿ¨‡ÿÿÿÿgÌ/./N¹P nB`¾R®ÿ¬`ÿf‡eg‡Ef¶J®ÿ¼f°†
f¨J®ÿ¸g¢J®ÿ¬f`šR®ÿ¼Ç nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹X.‡+gþö‡-gþì‡0mÿD‡9oþØ`ÿ6`þÐ`ÿ./.N¹X`þä n ¼J®gAîÿÀ»ÈfB€`’B .ÿ¸é€€®€b0Ð@0;NûZff&&&&&&&&&&&&&**@p`HHnÿÀN¹X n P €`æHnÿÀN¹X n P €!A`Ì n P0®ÿª`À n P ®ÿ¨`´Lî ÀÿœN^NuNVÿìHî8€ÿì*n(n nB&M®cf®u0f-|B®ÿü®sf-|ÿüS”m ,R¬ @H€HÀ€ÿ`
HTN¹X.€t @H€HÀÀ®ÿüg‡ÿÿÿÿf¼-|ÿü®cfB®ÿü`d`¢®[fX-|ÿü`N €t @H€HÀÀ®ÿüf@»ügÇS®o0S”m ,R¬ @H€HÀ€ÿ`
HTN¹X.‡ÿÿÿÿfª‡ÿÿÿÿgJ®oHT/N¹P nB`
 n ¼»üg»Ëg®cgBp`B€Lî8€ÿìN^NuNVÿôHî Àÿô*nB†^fR†RB‡‡€l>J†g €t @ÿý` €t @R‡`Ò €t @ÿýR‡J‡fS`*H€HÀ.€€]gJ†gÎ €t @`Ì 
Lî ÀÿôN^Nu6.L130æ.L10032è.L88n.L79.L10020"t_instr$.L52R.L30>.L131~.L10034€.L111˜.L20006ê.L10010š.L10007 _filbufr.L42¢.L31€0_S1€.L110.L106 fltusedæ.L93
.L83Â.L73°.L10000ª.L32.L63æ.L332.L20018¸.L10019h.L23d.L22d.L25h.L21î.L34Œ.L29|.L28Z.L27".L26.L24À.L105^.L98 .L44ü.L35#t_sctab_F4¼.L89ž.L20004.L36(.L10005R.L54b.L20016.L74ž.L10017.L64¶.L45>.L37À.L104¨.L84,.L38"_doscan€8_S3 atof".L94’.L20009`.L55È.L46>.L39&.L129‚.L20014ª.L10015h.L128>.L127ª.L103.L65ì.L20002È.L47º.L10003".L126^.L99¸.L100294.L75J.L56 _ctype_.L125 .L10027Æ.L90Š.L20012N.L10013È.L48ø.L124Ò.L102j.L10025>.L85–.L20007¸.L10008>.L123".L10023j.L66j.L57".L122Ü.L10031".L95.L20010h.L80ì.L10021h.L10011².L10001æ.L20000j.L120ö.L121t.L10033ø.L101*.L76$_F14.L20019Ì.L119.L100v.L70Ü.L20005´.L674.L10006Ð.L118Ú.L91¤.L86"Ü_getccl´.L117€.L20017.L10018Ê.L59À _S2n.L814.L77¢.L1168.L96 .L68d.L20015Ø.L710.L20003Ì.L10016d_F2ì.L10004ª.L115 ungetc€.L109v.L87È.L50X.L114.L92 .L69†.L20013P.L78ž.L10014ò.L61.L82”.L20008¬.L10028º.L10009À _S4R.L113.L108v.L10026 .L72.L51È.L10002"r_innum>.L40¸.L20001R.L97<.L10024Ž.L20011B.L10012 lmulˆ.L112.L107_F3Ô.L10030Ø.L10022.L62h.L41¬ÌSBÀ.TH¤Òúp²>(>>à	ê	6xœ			*	\filbuf.b        406162750   11    21    100664  1661      `
H0upNVÿüHî ÿü*n0-HÀ€fpÿ`¢0-HÀ€@g.pÿ`Žm` 0-HÀ€gê-H€HÀ€H+@J­gÚ+m0-HÀ€gp` <//-aBP*€S•l•ÿÿÿÿfm`m B•pÿ` mH€HÀ€ÿR­Lî ÿüN^NuNVÿèHî0ðÿè*n..(MB…B„`JN¹€
f|
/N¹XÆ
g*H€HÀ€gvnò€g€g
`úpÿ`/< N¹XSŒS…gÞS…SŒ	f(|HU/<\N¹P`º/<`N¹X`¨(MB…/<d`èBSŒS…HU/<j`ÆUŒS…B„J…gJ„g g	fRŒ`l	f,	g fBSŒ S…J€fèHU/<nN¹P`¸`Ô gR„SŒS…/<rN¹X`š`€gÿn€g€€gÿ R…°‡mþ° Lî0ðÿèN^Nu
%s  XXX

%s
%s ¬.L520.L30„.L20006x.L42:.L31 _S1"_filbuf|.L10000.L63À.L53.L33"Ìx_read<.L29¨.L28¢.L27®.L26d.L23^.L216.L24^.L22".L20\.L44.L35Ä.L54r.L200044.L36†.L45.L64.L378.L38 emt_putcharÄ.L55`.L46>.L390.L20002Ö.L10003Š.L47ö.L56 emt_getchard.L48~.L20007Ê.L57–.L49‚.L10001^.L20000_F1â.L58l.L20005ô.L59ð0_S2n.L60è.L20003_F2j.L50þ.L61À.L10002¦.L51L.L40>.L20001H.L19r.L62 printfT.L41Â.L18	V&êF‰°h=n‰°z=€‰°‰° ‰°æ=쉰=

setbuf.b        406162797   11    21    100664  232       `
XhNVÿüHî ÿü*nJ­g0-HÀ€g/-N¹Xmÿó+nfm`+mB•Lî ÿüN^Nu _S1J.L22D.L21"setbuf_F1 free..L19L.L18(sprintf.b       406162801   11    21    100664  273       `
luNVÿðHîÿð=|Bÿü-nÿô-|ÿÿðHnÿðHn/.N¹ßüS®ÿðm .ÿôR®ÿô @BH€HÀ`Hnÿð/<N¹P .N^Nu_S1P.L10000 _flsbuf _doprntb.L10001_F1"sprintff.L18,\
ungetc.b        406162810   11    21    100664  252       `
dxNVÿüHî ÿü*n®ÿÿÿÿfpÿ`>0-HÀ€g
 -°­b -°­fJ•fR­R•S­ m®B€`pÿLî ÿüN^Nu _S14.L10000F.L22X.L21F.L20_F1"ungetc.L19Z.L18abs.b           406162815   11    21    100664  130       `
$>NVHîJ®l
 .D€-@ .N^Nu_S1.L13.L12_F1"absatof.b          406162830   11    21    100664  1894      `
àXðNVÿÔHî àÿÔ*nB†B…-yÿø-yÿü-y ÿð-y$ÿô-|ÿè-|ÿäH€HÀ.€ gð‡-f
-|ÿÿÿÿÿè`z‡+grS`n/9ä/9à/.ÿü/.ÿøN¹lP €0/N¹X///.ÿü/.ÿø/9,/9(N¹ßü//N¹ßü-@ÿø-Aÿü`R†H€HÀ. € @H€HÀ€fÿr‡.f’H€HÀ. € @H€HÀ€gp/9ä/9à/.ÿü/.ÿøN¹lÄ €0/N¹X///.ÿü/.ÿø/94/90N¹ßü//N¹ßü-@ÿø-AÿüS†`ÿr‡Eg‡efpH€HÀ.€+g2‡-f
-|ÿÿÿÿÿä` S`/<
/N¹P"0Ð*H€HÀ. € @H€HÀ€fÄJ®ÿäl D€*Ü…-FÿìJ†l D€,B‡`4 €g" 瀀è @/(/HnÿðN¹ßüâ†J†g
R‡‡mÄJ®ÿìl/.ÿô/.ÿðHnÿøN¹`/.ÿô/.ÿðHnÿøN¹ßü/.ÿì/.ÿü/.ÿøN¹ßü-@ÿø-AÿüJ®ÿèl//N¹P` .ÿø".ÿüLî àÿÔN^Nu\€A BÈE@I¾¼ SÉ¿enSü²ï`@€B B š.L30.L17.L42
.L31à _S1 fltusedÖ.L15ª.L10000š.L32#èexp5#àtwoe56(.L43–.L330.L34.L26Þ.L22Þ.L24Þ.L29(.L28Ü.L27l.L23Þ.L25d.L21R.L20^.L44.L35,.L20004º.L36 fnegh.L45ì.L37Ì.L38`.L46ì.L39"atofX.L47Ð.L20002 _ctype_^.L48 ldexp‚.L49p.L20000 fadd,_F1”.L20005 fcmp afdiv`.L20003š.L50 floatÎ.L51ì.L20001ì.L40 lmul fmulB.L19 afmul.L41 .L18‰°‰°‰°$‰°,‰°r‰°x-†1˜‰°¬‰°²6¸*È%ê%‰°,‰°2-@1R‰°f‰°l6r*‚5Ú%ø	<8N.|8'¨Æatoi.b          406162820   11    21    100664  458       `
„NVÿôHî Àÿô*nB‡B†`RH€HÀ€	gð€ gè€+g
€-f,R†R`&9n&/<
/N¹PHHÁЀ0.0lÔJ†g D€` Lî ÀÿôN^Nu.L17h.L16À _S1x.L10000.L15h.L14n.L23h.L22<.L20>.L21.L13z.L12B.L20002z.L10001.L20000_F1"atoih.L20001 lmul.L19.L18Ratol.b          406162835   11    21    100664  470       `
NVÿôHî €ÿô*nB®ÿüB‡`RH€HÀ€	gð€ gè€+g
€-f0R‡R`*9n*/<
/.ÿüN¹PHHÁЀ0-@ÿü0lÐJ‡g .ÿüD€` .ÿüLî €ÿôN^Nu.L17n.L16€ _S1€.L10000.L15n.L14t.L23n.L22>.L20@.L21.L13„.L12"atolD.L20002„.L10001.L20000_F1n.L20001 lmul.L19.L18Vblt.b           406162837   11    21    100664  216       `
¬ o"o €"	²€g
"/`r"/J€gD€T€°l^’€S€ÙS€lÿú €ÿÿÿügF’€ä€€m.Hç>LÙ|þHÐ|þÑü0€€lÿäLß|þJ€gS€ ÙS€lÿúJgSÙSlÿú /Nu"bltclear.b         406162839   11    21    100664  240       `
¬"/ /glÒ€ AgB S€gZ"ÿÿÿg4àHçÿ~/"|xLÑ|ÿ"@Hàÿ~Hàÿ~Hàÿ~Hàÿ~HàÿS—nè"Lß~ÿ"ÿÿÿügB YnúJ€gB S€núNuxzeros"clearˆ°2crypt.b         406162865   11    21    100664  6536      `
Ø´lpNVÿìHîàÿìB‡`J €X @H€HÀS€Ð® @ €Ð"@ €t @H€HÀS€Ð® @ €ì"@R‡‡m®B‡‡l$B…`v9ÐH€HÀ-@ÿüB†` €Ñ @ €Ð"@R††màîÿÿë9ìH€HÀ-@ÿüB†` €í @ €ì"@R††màîÿÿR… € @H€HÀº€mÿvB††l‚/<0/N¹P€І-@ÿø €  @H€HÀ€Ï @"nÿø/<0/N¹P€І€-@ÿø €¸ @H€HÀ€Ï @"nÿøR†`ÿxR‡`þÖLîàÿìN^NuNVÿèHîäÿèB†`& €Ø @H€HÀS€Ð® @ €
ˆ"@R††@mÒB®ÿø`J®gp®ÿø-@ÿü`-nÿøÿüB†` €
¨ @ €
È"@R†† màB†`P/<0/.ÿüN¹P€І @H€HÀ" AHHÁ
§ AHHÁ± € @R††0m¨B†`/</N¹P. € @H€HÀë€"	 AHHÁçÐ"
 AHHÁåÐ" AHHÁãÐ" AHHÁB‚å¡Ð"íhÒ€ €
 @H€HÀé€Ò€ AH€HÀ* å€. 怀"
è A€ 䀀"
é A€  "
ê A€ Bâ €"
ë A€R††mþöB†`> €
ˆ @H€HÀ"
h AHHÁ
ç AHHÁ³€"
¨ A€R†† mºB†† l €
È @ €
ˆ"@R†`ÞR®ÿø®ÿømýÚB†`6 €
ˆ @H€HÀ. €
¨ @ €
ˆ"@ €
¨ @‡R†† mÂB††@l& € @H€HÀ€
‡ @ .І"@R†`ÒLîäÿèN^NuNVÿìHîàÿìB‡` €8 @BR‡‡BmêB‡`8‡@l>B†`p†"à¡ €8 @R†R‡†mÚR‡R® nH€HÀ*fº/<8aû
XB‡` €8 @BR‡‡BmêB‡` €8 @ €"@R‡‡0màB‡`Ü nH€HÀ*R® €z @……Zo]……9o_…….B††l˜ ì €g„/</N¹PІ€ @H€HÀ-@ÿü/</N¹PІ€-@ÿø/</N¹PІ€  @"nÿø/</N¹PІ€ -@ÿø @®ÿÿR†`ÿbR‡‡mÿB‡`/</<8aûdPR‡‡mäB‡`\B…B†`&ã…/</N¹PІ€8 @H€HÀŠ€R††mÒ….…9o^……Zo\… €| @…R‡‡mœ €| @BJ9{f
ùz{ <zLîàÿìN^Nu:2*"
<4,$>6.&@80( 91)!	;3+#=5-%
?7/'(08@ '/7?&.6>%-
5=$,4<#+3;"*
2:!)	1991)!	:2*"
;3+#<4,$?7/'>6.&=5-%


)4%/7(3-!0,1'8"5.*2$  		


 

	

	
	
	

	



	

	

	
	

	

	


	
	


	
	


	

	

	

	
	

	

	
	

	


	

	


	

	

	

		



	
 	
.L20031Ü.L88v.L79Ê.L52ü.L30:.L111>.L20033æ.L20006æ.L31à_S1 PC2_CtPC1_DB.L110&.L20035.L106Ò.L938.L83ô.L73˜.L32L.L20037j.L63Ô.L53¢.L33F.L20039ø.L20018Ž.L27ˆ.L26ä.L29š.L34Ž.L22b.L28`.L24V.L23X.L25ØIP.L1058.L98Ò.L35¸PC2_Dî.L89Ì.L54Ü.L36Ô.L20004KSÒ.L74È.L20016t.L648eÔ.L37n.L104z.L84è
f‚.L38
.L94à_S3ô.L55¦.L20009ˆ.L39shifts|.L20014d.L103l.L65š.L200020.L99.L20028<.L75.L56à.L20026à.L90l.L20012.L102Ò.L20024š.L85p.L20007œ.L20022z.L66ø.L570.L20030.L95H.L80>.L20020.L20010X.L20000È.L120".L101.L20032F.L76_F1ÐC”.L119:.L20034î.L58Ü.L20019È
tempLEìDr.L20036.L100Ð.L70†.L67¼.L20005FP¢.L20038Š.L118Î.L91¤.L86r.L117Š.L20017ô.L59ä_S2>.L77ˆ
Lz.L116.L96|.L68.L60È.L71z.L20015_F2‚.L20003p.L115"€crypt"˜encrypth
P8.L109œ.L87preS¨
RhS"setkey¢.L114þ.L20029Ú.L92r.L78Æ.L69.L20013.L61Î.L82¨.L20027Ì.L20008ª.L113.L108´.L20025v.L51ð.L72þ.L40.L20001..L97Ž.L20023ø.L20011 lmulXPC1_C .L112v.L107_F3.L20021.L62		*	6	N‰°r	†	‰°¦‰°¬	À	ʉ°à	ê–		(	6–L	T	h	v	ª	Â	ü	–(	0	B	P	b–„		¢	¶	Ê	Þ	ö		.	D	Z	r	Ž	ž	¬	¾	Þ	è			(	4	T	b	’	Ɖ°ð			&	R–˜	¢–¼	Æ–Ø	â–ø	‰°.–X	b	˜	®©f¸‰°À‰°Ä‰°Êctype_.b        406162869   11    21    100664  180       `
„                            #_ctype_index.b         406162882   11    21    100664  179       `
,gNVÿøHî €ÿø*n.°f 
`JfòB€Lî €ÿøN^Nu.L16€ _S1.L15.L14 .L13".L12_F1"index
qsort.b         406162891   11    21    100664  1345      `
,PNVHî#î,#î0/./.N¹PЮ//.aPN^NuNVÿàHî0€ÿà.90 .®-@ÿì°‡cT ã€//.ÿìN¹P//N¹P-@ÿìЮ-@ÿø-@ÿô*n .‡(@`Ÿ®ÿø/.ÿøHUaP»îÿødˆ/.ÿøHU y,NP-@ÿðgÒJ®ÿðm\`h»îÿøfHHTß®ÿô/.ÿôHUaßüß®ÿø*nÿø`BHT/.ÿô y,NP-@ÿðf$HTß®ÿô/.ÿôa¢P`HTHUa–P™ÇÛÇ`ÿ|J®ÿðnš™Ç¹îÿôb¸»îÿøfL .ÿø®".’®ÿô°m/. .ÿôЇ/aþÖP-nÿø`þÚ/.ÿø/.aþ¾P .ÿôЇ-@`þ¾HUŸ®ÿø/.ÿøHTaLßüŸ®ÿô(nÿô`þüLî0€ÿàN^NuNVÿðHî0€ÿð-y0ÿü*n(nÔÇS®ÿüfôLî0€ÿðN^NuNVÿìHî8ÿì-y0ÿø*n(n&nH€HÀ-@ÿüÓÔîÿÿS®ÿøfèLî8ÿìN^Nu.L30L.L17.L42Ð.L20006°.L16 ulmul_S1.L32t.L338.L14°.L20Œ.L34>.L278.L228.L256.L290.L28È.L238.L26ª.L21à.L35_F4à.L36*.L20004Ú.L37"qsortÔ.L38 .L39€0_S3êqstexc8.L20002<qs1ª.L20000ºqsexc uldiv_F1*.L20005€0_S20qsesö.L20003 _F2,qscmp .L408_S4š.L20001¬.L19 lmul.L41_F3^.L18‰°‰°$‰°H"j.v‰°º‰°þ‰°Æ‰°ö
rand.b          406162895   11    21    100664  276       `
P€ NVHî#îPN^NuNVHî/<AÆNm/9PN¹P€09#ÀPrâ €ÿN^Nu_S1J.L15"rand.L13Prandx_F1_S2_F2"srand lmul‰°‰°(	.‰°<rindex.b        406162898   11    21    100664  184       `
0hNVÿôHî0€ÿô*n.(|°f(MJfô Lî0€ÿôN^Nu .L16€0_S1.L15 .L14$.L13&.L12_F1"rindexsetjmp.b        406162900   11    21    100664  99        `
$ o —HèüüB€Nu o /Lèüü.Nu"longjmp"setjmp
strcat.b        406162903   11    21    100664  180       `
,hNVÿôHî8ÿô*n(n&MJfüSÜfü Lî8ÿôN^Nu.L168_S1"strcat.L15.L14.L13 .L12_F1strcatn.b       406162907   11    21    100664  210       `
<vNVÿðHî8€ÿð*n(n..&MJfüSÜgS‡løSB ``îLî8€ÿðN^Nu..L17*.L16€8_S1.L15"strcatn.L14.L130.L12_F1strcmp.b        406162911   11    21    100664  199       `
<kNVÿøHî0ÿø*n(n`JfB€`°gòH€HÀSŒHHÁLî0ÿøN^Nu0_S1.L15".L14.L132.L12.L20000_F1"strcmp
strcmpn.b       406162914   11    21    100664  276       `
H¬NVÿôHî0€ÿô*n(n..`B€`"°fJgòS‡lòJ‡mêH€HÀSŒHHÁLî0€ÿôN^Nu€0_S1..L10000&.L15*.L14&.L13>.L12&.L20002>.L10001.L20000"strcmpn_F1.L20001strcpy.b        406162917   11    21    100664  146       `
$NNVÿôHî8ÿô*n(n&MÜfü Lî8ÿôN^Nu8_S1.L14.L13.L12_F1"strcpystrcpyn.b       406162921   11    21    100664  291       `
@ÃNVÿðHî8€ÿð*n(n&MB‡`Üg`BR‡¾®mö`R‡¾®mæ Lî8€ÿðN^Nu .L17*.L16€8_S1,.L152.L14*.L134.L12"strcpyn,.L20002 .L20000_F1.L20003.L20001(.L18
strncat.b       406162927   11    21    100664  210       `
<vNVÿðHî8€ÿð*n(n..&MJfüSÜgS‡løSB ``îLî8€ÿðN^Nu..L17*.L16€8_S1.L15.L14.L130.L12_F1"strncatstrncmp.b       406162931   11    21    100664  276       `
H¬NVÿôHî0€ÿô*n(n..`B€`"°fJgòS‡lòJ‡mêH€HÀSŒHHÁLî0€ÿôN^Nu€0_S1..L10000&.L15*.L14&.L13>.L12&.L20002>.L10001.L20000_F1"strncmp.L20001strncpy.b       406162937   11    21    100664  291       `
@ÃNVÿðHî8€ÿð*n(n&MB‡`Üg`BR‡¾®mö`R‡¾®mæ Lî8€ÿðN^Nu .L17*.L16€8_S1,.L152.L14*.L134.L12"strncpy,.L20002 .L20000_F1.L20003.L20001(.L18
swab.b          406162941   11    21    100664  209       `
PYNVÿôHî0€ÿô*n(n../</N¹P.S‡m0HÀá€2HÁàÿÐ8ÀT`âLî0€ÿôN^Nu€0_S1F.L14"swab(.L13F.L12_F1 ldiv 
abort.b         406162943   11    21    100664  54        `
NAB€Nu"abortaldiv.b         406162944   11    21    100664  208       `
ŒNVHç<*< n lD€D…&".lDD…(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚ J…lD€ €Lß<N^Nu ulmul"aldiv+²lalmul.b         406162946   11    21    100664  130       `
TNVHç8(< n$lD‚D„&.lDƒD„B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐJ„lD€ €LßN^Nu"almulalrem.b         406162948   11    21    100664  212       `
NVHç8(< n lD€D„$".lDlB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€J„lD€ €LßN^Nu ulmul"alrem+²nauldiv.b        406162950   11    21    100664  185       `
tNVHç8 n &".(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚  €LßN^Nu ulmul"auldiv+²Z
aulmul.b        406162952   11    21    100664  99        `
4NVHç0 n$&.B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐ €LßN^Nu"aulmul
aulrem.b        406162953   11    21    100664  185       `
tNVHç0 n $".lB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€ €LßN^Nu ulmul"aulrem+²Z
chrtab.b        406163071   11    21    100664  1583      `
$$~$$~$$>A@>A>ab#C8DH00IFF9         I**I~ @$BBBBBB$8D @@|~D8$D~|@@XdB$<B@XdBBB$~   "A">AAAA>"AAA#   @ @  @$B<BAMSQQQI&"AAAAAA~AAA~AAAA~>A@@@@@@A>~AAAAAAAA~~@@@x@@@@@@@|@@@@@>A@@OAAAA>AAAA~AAAAADD8ABDHPpHDBA@@@@@@@@@AcUIAAAAAAAaQIECAAAA>AAAAAAAA>~AAA~@@@@@>AAAAAAYE>~AAA~DBAAA>A@@>A>AAAAAAAAA>AAAAAAA"AAAAIIUcAAAA""AAAA" @@@ 88"ÿ <>BB>@@@@|BBBB|<B@@B<>BBBB><B|@B<~>BBBB>B>@@@@|BBBBB(@@@@FHPpHFvIIIII@|BBBBB<BBBB<|BBBB|@@@@>BBBB>\b@@@@>@<B<~BBBBB=AAA"IIIII6B$$BBBB" @~ ~ *~~~~~~~~~~#chrtab
ddtinit.b       406163117   11    21    100664  101       `
5NVHîN^Nu_S1
.L12_F1"ddtinit
exit.b          406163074   11    21    100664  110       `
2NVÿüHî€ÿü..NNLî€ÿüN^Nu€_S1.L12"exit_F1getenv.b        406163109   11    21    100664  804       `
ŒD NVÿüHîÿü-|Œÿü`0 nÿü//.a0PJ€f/.N¹X nÿü"Ò€R `X®ÿüJ®ÿüfÊB€N^NuNVHî`  .R® @".R® A°gp`
 nJfØB€N^NuTk{„PATH=/usr/sun/bootfileHOME=/mnt/guestTERM=sunUSER=guestL.L17_S1„.L15{.L14„.L26|.L27†.L24|.L25@.L22D.L20k.L13T.L12#Œenvp"getenv"Pstrpref\.L20002D.L20000_F1_S2 strlen_F2.L20001J.L19@.L18‰°,iîiîiîiîstrlen.b        406162924   11    21    100664  178       `
$nNVÿøHî €ÿø*nB‡`R‡Jfú Lî €ÿøN^Nu€ _S1.L14.L13.L12.L20000_F1"strlen.L20001signal.b        406163115   11    21    100664  436       `
T@NVHîN^NuNVHîN^NuNVHîN^NuNVHîN^NuNVHîN^NuNVHîN^Nu&.L16_S1.L14P.L22B.L20_S6
.L12_F4"sighold_S3_F5"	*sigignore_S5_F1_F6"signal_S2"8sigrelse_F2"Fsigpause_S4"sigset4.L18_F3stubs.b         408926823   121   21    100644  515       `
h<(NVHî/./<hN¹PN^NuNVHî/<ŽaÎXN^NuNVHî/<“a¶XN^NuNVHî/<™ažXN^NuThe routine %s is not implemented!!!
timeftimelocaltimeŽ.L174.L16_S1h.L14d.L22™.L23“.L20.L12_F4"8ftime_S3_F1"
noSuchProc" time_S2_F2_S4"	PlocaltimeL.L19_F3 printf‰°‰°,‰°D‰°\
printf.b        406163081   11    21    100664  233       `
@qNVHî/<Hn/.N¹ßü09HÀ€ gpÿ`B€N^Nu_S18.L10000 _doprnt:.L10001_F1:.L18 _iob"printf‹°‹°&
doprnt.b        406162709   11    21    100664  3119      `
ô«hNVÿ4Hî<üÿ4*n(n&nAîÿt$H`œÇ`–%fôAîÿtµÈg(HS/<Aîÿt 
ˆ/HnÿtN¹ßüAîÿt$HB.ÿhB„| ÿi-fR.ÿhR0f|0ÿiR*g2B…H€HÀ€0,m2†	n*/<
/N¹PІ*`Ò`RH€HÀ€0,*B.ÿg†0†.fR*g<B„` †	n(R.ÿg/<
/N¹PІ(H€HÀ€0,lІ0`RH€HÀ,R.ÿg( €egFnP€Ogön€%gd€Dgê€Lgx€Ug˜€XgÊ€cg€dgº€og¦n€fgT€ggâ€lg(€rg0€sgö€ug4€xgh`ÞH€HÀ€dgZ€ogH€ug
€xg>S$v
J‚fJ„fü0Aîÿj-HÿüJ‚gZ//N¹P,†
l&p0`$v$`Èv`øv
J”lü- D€$`²`¬$`¬pWІ nÿü€R®ÿü//N¹P$`¢Aîÿj .ÿü°ˆc¸S®ÿü nÿüÐ`æ LXŒ-HÿüB††l˜ .ÿüR®ÿü @ÐfSŠR†`â-\ÿüf-|ôÿü,f,<ÿ$nÿüJgjS†mdRŠ`ð`\(T*\`ÆJ.ÿgfxHnÿøHnÿô//,/N¹ßü-@ÿüPŒJ®ÿøgü-,.ÿônü0` nÿüÐR®ÿüS†nò,gü. .ÿôD€-@ÿôoS†m
ü0S®ÿônòJ†oÖS†mÐ nÿüÐR®ÿü`î`ØJ.ÿgfx`R„HnÿøHnÿô//,/N¹ßü-@ÿüPŒJ®ÿøgü- nÿü0fR®ÿô nÿüÐR®ÿüü.,`
 nÿüÐR®ÿüS†nòüeS®ÿôJ®ÿômü+`ü- .ÿôD€-@ÿô/<
 .ÿô/N¹P€0À/<
 .ÿô/N¹P€0ÀAîÿt-Hÿü 
®ÿü"’€,lB†J.ÿhf D€,.ÿiH€HÀ/HS/ 
®ÿü//.ÿüN¹ßü`ûŠJ.ÿgfxHR//,/N¹ßüPŒJfüSŠ`Šü%fûhAîÿtµÈg"HS/<Aîÿt 
ˆ/HnÿtN¹ßüLî<üÿ4N^Nu(null)X.L79.L52î.L88Š.L30æ.L111 fcvt<.L42¸.L31&.L20006ü<_S1 fltusedØ.L110Š.L106D.L93ô.L83^.L10000–.L73Ì.L32\.L63ä.L43.L530.L33À.L22Ú.L24 .L34º.L29‚.L28t.L27\.L25,.L23º.L21f.L98<.L44€.L105.L35â.L20004<.L54ö.L89.L36º.L74.L64<.L450.L37@.L104 ecvtÖ.L84Ú.L38D.L94B.L46>.L20009<.L552.L39 _stroutl.L103.L65B.L47.L20002@.L75X.L99
.L56þ.L90F.L48ê.L124@.L102æ.L85.L20007"_doprntB.L57.L66¶.L123F.L49º.L20000d.L80@.L95`.L10001f.L122~.L101 .L76 uldiv¶.L120Ž.L121Ì_F1².L119B.L58º.L20005f.L100l.L67|.L70®.L118*.L91ê.L86F.L59º.L77¾.L81–.L1166.L96|.L68F.L60 ulrem@.L71è.L20003 gcvtŽ.L115Æ.L109Ú.L87X.L50.L1146.L92H.L78H.L61.L69Ì.L82.L20008ú.L113¸.L108@.L72.L51Þ.L40 .L20001L.L97 lmulê.L18â.L112Œ.L107Z.L62Þ.L414Lx¬xþb(Nr‰°Æ,žNb24€e¢4à
gcvt.b          406162773   11    21    100664  972       `
`4NVÿìHî0€ÿìHnÿüHnÿø/././.N¹ßü*@(nJ®ÿügü- .S€.` 
Ї @0f
S®S‡J‡nêJ®ÿøm .ÿø®€nJ®ÿølv®ÿÿÿýÿøllS®ÿøÝü.~`ÝR‡¾®möüeJ®ÿøl .ÿøD€-@ÿøü-`ü+/<
/.ÿøN¹P€0À/<
/.ÿøN¹P€0À`ZJ®ÿøn0gü.J®ÿøl
R®ÿøü0`ð~`ݾ®ÿøfü.R‡¾®oì .°®ÿøm`ü0 .R®°®ÿømîü.,.ÿÿfSŒB .Lî0€ÿìN^Nu$.L30V.L174.L20006.L31Z.L16€0_S1 fltused.L32€.L10000T.L15F.L33:.L14V.L134.L34.L29.L28ü.L26ü.L27.L25F.L24¶.L23².L22˜.L20’.L21B.L35P.L36.L20004 ecvt’.L200020.L20007p.L10001V.L20000_F1.L20005 ldivŽ.L20003 lrem"gcvtD.L20001.L19ì.L18 "Â$Üstrout.b        406162807   11    21    100664  616       `
  NVÿôHî0€ÿô*n..(nJ®lˆ-f<®0f2S”mH€HÀ",R¬ A€H€HÀ`HTH€HÀ/N¹PS‡S”m .",R¬ A€H€HÀ`HT ./N¹PR®`„HTH€HÀ/N¹PS‡m2S”mæH€HÀ",R¬ A€H€HÀ`ÞHT ./N¹PS®J®gS”mâ .",R¬ A€H€HÀ`ÚLî0€ÿôN^NuÖ.L10007€0_S1L.L10000ü.L26Ú.L24Ú.L25¤.L20 _flsbuf`.L21¤.L23¤.L10005"_stroutŒ.L10003^.L10001_F1Æ.L10006’.L10004|.L10002.L19ü.L18X†žÐflsbuf.b        406162757   11    21    100664  1036      `
´0NVÿäHî8àÿä*n0-HÀ€f pÿ`˜(m¹üf>»üNqm0-HÀ€gØnÿÿ|..ÿÿH€HÀ/N¹XB•`<`Ê -Œ.,o +LB…&Lº‡lH€HÀ/N¹XR…`è*¼ÿî+L¼‡g
m pÿ` .Lî8àÿäN^NuNVÿôHî0€ÿô*n0-HÀ€€f8(m¹üg, -Œ.o"+L*¼ S‡J€g LRŒHPN¹X`èB€Lî0€ÿôN^NuNVÿüHî ÿü*|»ùdHUaXÛü`êLî ÿüN^NuNVÿøHî €ÿø*n~ÿ0-HÀ€g*0-HÀ€@fHUaÿ:X.0-HÀ€gB­mÿ€B• Lî €ÿøN^Nu _lastbuf€.L308.L42´.L31à8_S1.L33.L34˜.L29”.L28˜.L27j.L26¦.L24<.L20l.L25".L22<.L21"_flsbufª.L44.L35_F4.L36 .L45N.L38 .L46 _S3"Âfflush"(_cleanup"Xfclose6.L20000_F1€0_S2 putchar_F2€ _S4F.L40N.L41_F3 _iob¸.L18Kº%0`Ž‹°%4Kº:data.b          406162690   11    21    100664  440       `
D<@#@_lastbuf _sobuf _sibuf#_iobkîkîiî@ecvt.b          406162879   11    21    100664  2179      `
4 ˆNVHî/</././././.a:ßüN^NuNVHî/</././././.a
ßüN^NuNVÿäHî0€ÿäJ®lB®®Om-|NB‡ nB*|4/9ˆ/9„/./.N¹l" n ¼/./.N¹P-@-AHnÿø/./.N¹ßü-@-A(|„/9/9Œ/.ÿü/.ÿøN¹gò(|„/9˜/9”/.ÿü/.ÿøN¹g–Hnÿø/9 /9œ/.ÿü/.ÿøN¹ßü//N¹ßü-@ÿð-Aÿô/9°/9¬/9¨/9¤/.ÿô/.ÿðN¹ßü//N¹ßü//N¹P€0SŒ€R‡`ÿP¹ü„dÜ`ô .€4(@J®fÙÇ n ‡¹ü4dxB94` /9¸/9´/./.N¹o¸/9À/9¼/./.N¹ßü-@ÿð-Aÿô/9È/9Ä//N¹lÿx-nÿð-nÿôS‡`®»Ìb^»ü„dV/9Ð/9ÌHnN¹ßüHnÿð/./.N¹ßü-@-A/.ÿô/.ÿðN¹P€0À`ž¹ü„eB9ƒ`>*LZ`0SŒR`*¼0¹ü4bî¼1 nRJ®f»ü4c¼0R9nÐB <4Lî0€ÿäN^NuB =õÂ\(õÃB B @€B ¬.L304.L17*.L16t.L42Î.L31"0fcvt_S1Ú.L32\.L15 fltusedÖ.L43Ú.L33Ú.L34Î.L26¤.L29œ.L28”.L27.L25.L23Œ.L24Ò.L21„.L22†.L20,.L13Ì.L44´.L35".L36æ.L45Ú.L37 fneg¼.L38"ecvt.L46Ä.L39€0_S3".L47ò.L20002þ.L48 fdiv fix`cvt.L49 modf.L20000 fadd_F1_S2 fcmp$.L20003_F2.L50.L51ì.L20001î.L40 fmult.L19 afmult.L41_F3‰°‰°–‰°œ/ªÄ*à‰°ô‰°ú‰°/‰°‰°‰°$/2‰°@‰°F&T*d‰°x‰°~‰°„‰°Š,˜6¨'¸IºÐ	àIºö‰îþ‰°‰°/‰°$‰°*68‰°L‰°R/\Iºz‰°‚‰°ˆ8’*ª'ÆIºØ‰îàIºøIº‰°&
lmul.b          406162968   11    21    100664  125       `
P
NVHç8(<$.lD‚D„&.lDƒD„B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐJ„lD€LßN^Nu"lmul
uldiv.b         406162973   11    21    100664  184       `
tNVHç8 .&".(lH@€ÿÿ€Á40€ÁH@0H@`6â€â€ÿÿÿÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚ LßN^Nu ulmul"uldiv+²\ulrem.b         406162976   11    21    100664  180       `
pNVHç0 .$".lB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€LßN^Nu ulmul"ulrem+²Xtermbas.b       406163096   11    21    100664  1677      `
Ì€IÀNVHî nJg R® @H€HÀ/N¹X`ÞN^NuNVHî`"€cgF€hgD€vgF/<:a¤X/<÷ašXB¹ÌN¹€€?fº/<`ÐR¹ÌR¹Ì``ÄN^NuNVHî/<N¹XN^NuNVHî 9Ì€g€g
€g`Ha¸ 9̀Р@H€HÀ/N¹X .€ /N¹X .€ /N¹XN^NuNVHîaÿb 9Ìå€€Ô @ Ю @H€HÀ/N¹XN^NuNVHîaÿ( 9Ì€à @H€HÀ/N¹XN^NuNVHîaþø 9Ì€ä @H€HÀ/N¹XN^NuÿÿÿÿYYaèíòJJKKABCDABCD;<=>
Supply terminal type (hit ? for help)
 v=vt52, h=h-19, c=concept Unknown type."	ºcursorpos˜.L30"jclearscreen,.L42z.L31_S1ò.L16‚.L32í.L15Æ.L53â.L43.L33è.L14#Ðcursmoš.L27÷.L28š.L25Š.L34^.L26,.L22,.L20
.L21_S6Ê.L44.L35_F4–.L36 getcharä.L45T.L37#Ôcursdi:.L38ä.L46_S3ä.L47\.L20002_F5#äcleolf.L49^.L20000_S5_F1#Ìtermtype_F6"žesc_char_S2"	0queryterm putchar"	šclearlineZ.L20003_F2_S7_F7"
0cursorstep#àcleos–.L51_S4¶.L40<.L20001"putstr_F3/$‰°V‰°`	îjp‰°„鼌鼒/°‰°Æ‰°è	î/þ//&‰°@	H/`‰°z	€/‰°ª	°/Àiîiîiî
getchar.b       406163077   11    21    100664  133       `
INVHîN¹N^Nu_S1.L12"getchar emt_getchar_F1
putchar.b       406163085   11    21    100664  153       `
(INVÿüHî€ÿü.H€HÀ/N¹XLî€ÿüN^Nu€_S1.L12 emt_putchar_F1"putchar
emtgetchar.b    406162986   11    21    100664  142       `
JNVHî/<N¹XN^Nu_S1.L12 emt_call"emt_getchar_F1emtputchar.b    406162991   11    21    100664  154       `
(JNVHî.H€HÀ//<N¹PN^Nu_S1".L12 emt_call"emt_putchar_F1fbmode.b        406163033   11    21    100664  141       `
 ENVHî/./<N¹PN^Nu_S1.L12 emt_call_F1"fbmode
getconfig.b     406163029   11    21    100664  144       `
LNVHî/<N¹XN^Nu_S1.L12 emt_call_F1"
emt_getconfiggetcontext.b    406162995   11    21    100664  145       `
MNVHî/<ÿÿÿýN¹XN^Nu_S1.L12 emt_call"emt_getcontext_F1
getmemsize.b    406162999   11    21    100664  145       `
MNVHî/<N¹XN^Nu_S1.L12 emt_call_F1"emt_getmemsize
getsegmap.b     406163003   11    21    100664  156       `
(LNVHî/././<ÿÿÿþN¹ßüN^Nu_S1$.L12 emt_call"
emt_getsegmap_F1mayget.b        406163050   11    21    100664  275       `
T‡NVHîySu@f/<N¹X`*/<N¹XJ€fpÿ`/<N¹X€N^Nu:.L16_S1$.L13N.L12 emt_call linereadyrx_F1"
emt_mayget lineget,B
mayput.b        406163055   11    21    100664  291       `
d‡NVHîySu@f.H€HÀ//<	N¹P`0/<N¹XJ€fpÿ`.H€HÀ//<N¹PB€N^NuD.L16_S1 lineput linereadytx..L13^.L12 emt_call"
emt_mayput_F1&6V
ttyio.b         406163105   11    21    100664  1402      `
NVHî#îtN^NuNVÿüHî ÿü*| Jg .倀` @`êLî ÿüN^NuNVHî .倀` @¼(N^NuNVHî .倀` @H€HÀN^NuNVHî .倀` @®N^NuNVHî .倀` @H€HÀ€N^NuNVHî .倀` @H€HÀ€N^NuNVÿøHî0ÿø . Ю*@ .倀`(@®.•Lî0ÿøN^NuNVÿøHî0ÿø . Ю*@ .倀`(@®.FÁ•Lî0ÿøN^NuNVHî/</</.aÿbßüN^NuNVHî/</</.aÿzßüN^NuNVHî/</</.aÿßüN^NuNVHî/</</.aÿ*ßüN^NuDáê..L30&.L17_F13_S12_F11_S10<.L16_S1p.L320_S9_F8"Ðlinereadytx"ˆlineput"	Êlinearmtxž.L34"	zlinearmrxô.L28Ì.L26¤.L24„.L22b.L20.L13_S6Æ.L36"ølineset_F4"¨linereadyrxî.L38_S3_F9"¢linedisarmrx"	8lineclear_F50_S8# NECinit"òlinedisarmtx_S13_F12_S11_F10_S5_F1_F6 _S2"flineget_F2_S7"Flineresettxint_F7.L40_S4"lineservice"	linereset_F3<.L18#wreg1‰°"	
	Jsetcontext.b    406163007   11    21    100664  149       `
 MNVHî/./<ÿÿÿüN¹PN^Nu_S1.L12 emt_call_F1"emt_setcontext
setecho.b       406163011   11    21    100664  142       `
 FNVHî/./<N¹PN^Nu_S1.L12 emt_call_F1"setechosetsegmap.b     406163015   11    21    100664  160       `
,LNVHî/./././<ÿÿÿÿN¹ßüN^Nu_S1"
emt_setsegmap(.L12 emt_call_F1ticks.b         406163019   11    21    100664  140       `
HNVHî/<N¹XN^Nu_S1.L12 emt_call"	emt_ticks_F1version.b       406163024   11    21    100664  142       `
JNVHî/<N¹XN^Nu_S1"emt_version.L12 emt_call_F1emtcall.b       406162981   11    21    100664  122       `
$6NVHî/./././.NOPN^Nu_S1.L12"emt_call_F1asin.b          406163126   11    21    100664  1502      `
4XÚXNVÿðHîÿð-y<ÿø-y@ÿü/9H/9D/./.N¹l(/./.N¹P-@-A-yLÿø-yPÿü/9X/9T/./.N¹o#ü! 9\"9``ü/./././.N¹ßü///9h/9dN¹ßü//N¹P-@ÿð-Aÿô/9p/9l/./.N¹oF/././.ÿô/.ÿðN¹ßü//N¹P///98/94N¹ßü`(/.ÿô/.ÿð/./.N¹ßü//N¹P-@ÿð-Aÿô/.ÿô/.ÿð/.ÿü/.ÿøN¹ßüN^NuNVHî/9x/9t/./.N¹l/./.N¹P-@-A/9€/9|/./.N¹o#ü! 9„"9ˆ`*/./.aýòP///98/94N¹ßüN^Nu@ÉÚ¢!hÂ@€À€@€@€@3333333@€Ð.L30<.L17t.L31Ž.L16_S1.L32 fltused|.L33..L29„.L34r.L27B.L25l.L26d.L24\.L23”.L21T.L22L.L20 sqrt fneg4pio2"’acos"asin fdivn.L20000_F1 fsub_S2 fcmp atan_F2j.L20001 fmulD.L19^.L18 errno‰°‰°‰°‰°"0@‰°P‰°X‰°`‰°ft‹°#€‰°†‰°Œ ¦‰°¶‰°¼ÂÒ‰°â‰°èö‰°*‰°06Td „‰°ž‰°¤²Â‰°Ò‰°Øæ‹°#ò‰°ø‰°þ‰°‰°$atan.b          406163138   11    21    100664  3277      `
 °HNVHî/9/9/./.N¹o/./.a2`$/./.N¹P//aP//N¹PN^NuNVHî/./././.N¹ßü/././/N¹f</9/9/./.N¹m 9°"9´`œ/9´/9°`„/9$/9 /./.N¹lò/9,/9(/./.N¹mn/./././.N¹P//N¹ßü//a&P///9´/9°/9´/9°N¹ßü//N¹ßü`ä/./././.N¹ßü//aÄP///9´/9°/9´/9°N¹P//N¹ßü//N¹`/94/90/./.N¹o$/./././.N¹ßü//aB`:/./././.N¹P//N¹ßü//aP//N¹PN^NuNVHî/9¬/9¨/./.N¹l/./.aâP`Ø/9¤/9 /./.N¹oB/././9</98N¹ßü//a˜P///9´/9°N¹`r/9L/9H/./.N¹ßü///9D/9@/./.N¹ßü//N¹ßü//a"P///9¼/9¸N¹ßüN^NuNVÿðHîÿð/./././.N¹ßü-@ÿø-Aÿü/9ä/9à///9Ü/9Ø///9Ô/9Ð///9Ì/9È///9Ä/9ÀN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿð-Aÿô/9/9/.ÿü/.ÿø/9/9/.ÿü/.ÿø/9ü/9ø/.ÿü/.ÿø/9ô/9ð/.ÿü/.ÿø/9ì/9è/.ÿü/.ÿøN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü///.ÿô/.ÿðN¹ßü-@ÿð-Aÿô/././/N¹ßüN^NuA‚y™üï2?ÔÌÏçy’@ÉÚ¢!hÂ@IÚ¢!hÂB:¨Iùv‚D†6v1T÷‡E ðr¤O
EÞ‹R
E`2Mf·CkÓð´KEûã\QÂEÐYòW…Fõ\*~E`2Mf·@€@€@€^.L31_S1Ô.L32 fltusedš.L43Ä.L33Øatanp1.L34Z.L264.L28.L29ø.L44â.L35¸pio4_F4j.L20004 .L36atanq0¨sq2m18.L45"txatan|.L37 fnegÈatanp3°pio2(.L38 sq2p1@.L46_S3".L39H.L47V.L20002øatanq2š.L48 fdiv"^atan2X.L20000"bsatan fadd_F1àatanp0 fsubèatanq4_S2Ðatanp2 fcmp"atanr.L20003_F2atanq1Àatanp4_S4\.L200010.L40 fmulp.L41_F3ðatanq3‰°‰°- >T&z-’‰°š‰° -®‰°¶‰°¼‰°Æ‰°Ì‰°Ö‰°Ü-ꉰô‰°ú- ",‰°F‰°L‰°R‰°X&^)n"Ž‰°¨‰°®‰°´‰°ºÀ)Ì&܉°ä‰°ê-ø"4"@X‰°n‰°t-‚‰°œ‰°¢-°‰°À‰°Æ"̉°æ‰°ì)ò‰°ú‰°&‰°‰°$)2"B‰°Z‰°`&f6‰°¤‰°ª‰°´‰°º‰°Ä‰°Ê‰°Ô‰°Ú‰°ä‰°ê6ð&6& 60&@6P&`‰°t‰°z‰°ˆ‰°Ž‰°œ‰°¢‰°°‰°¶‰°Ä‰°Ê&Ø6è&ø6&6(&86H&X"p6
fabs.b          406163203   11    21    100664  266       `
Lv NVHî/9P/9L/./.N¹l/./.N¹P-@-A .".N^Nu_S1 fltusedL.L14>.L13F.L12 fneg_F1 fcmp"fabs‰°‰° 0hypot.b         406163144   11    21    100664  929       `
x(9¨NVÿøHîÿø/9|/9x/./.N¹l/./.N¹P-@-A/9„/9€/./.N¹l/./.N¹P-@-A/./././.N¹o$-nÿø-nÿü-n-n-nÿø-nÿü/9Œ/9ˆ/./.N¹f 9"9”`t/./.HnN¹ßü/./././.N¹ßü///9œ/9˜N¹ßü//N¹P///./.N¹ßüN^NuNVHî/./././.aþ”ßüN^Nu@€€.L17r.L16_S1 fltusedx.L15>.L14t.L24˜.L22L.L13.L21ˆ.L20 sqrt fneg"hypot fadd_F1_S2 fcmp_F2 afdiv"Pcabs fmulØ.L19®.L18‰°‰° 0‰°@‰°FTd„‰°°‰°¶ĉ°Ì‰°Ò扰‰°.B
jn.b            406163158   11    21    100664  3024      `
dXìNVÿÔHîÿÔJ®l" .D€-@/./.N¹P-@-AJ®f$/./.N¹`/./.N¹P`N®gâ/9h/9d/./.N¹f 9l"9p`/./.N¹P".²€nê/./.N¹P-@ÿô-Aÿø/./.N¹P-@ÿì-Aÿð-|ÿü`–-nÿìÿä-nÿðÿè/.ÿø/.ÿô/.ÿð/.ÿì/././.ÿüN¹X///9x/9tN¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿì-Aÿð-nÿäÿô-nÿèÿøR®ÿü .ÿü°®mÿb .ÿì".ÿð`/./././.N¹ßü-@ÿÜ-Aÿà-y|ÿÔ-y€ÿØ .€-@ÿü`d/.ÿØ/.ÿÔ/.ÿüN¹X///9ˆ/9„N¹ßü//N¹ßü///.ÿà/.ÿÜN¹ßü-@ÿÔ-AÿØS®ÿü .ÿü°®n’/.ÿØ/.ÿÔ/.N¹X///9/9ŒN¹ßü//N¹ßü///./.N¹ßü-@ÿÔ-AÿØ-@ÿô-Aÿø-y”ÿì-y˜ÿð .S€-@ÿü`–-nÿìÿä-nÿðÿè/.ÿø/.ÿô/.ÿð/.ÿì/././.ÿüN¹X///9 /9œN¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿì-Aÿð-nÿäÿô-nÿèÿøS®ÿüJ®ÿünÿf/.ÿð/.ÿì/./.N¹P///.ÿØ/.ÿÔN¹ßü//N¹ßüN^NuNVÿàHîÿà/9¨/9¤/./.N¹n#ü! 9¬"9°`v-|ÿøJ®l* .D€-@/</N¹P€f-|ÿÿÿÿÿøJ®f/./.N¹P`$®f/./.N¹P//`æ/./.N¹P-@ÿð-Aÿô/./.N¹P-@ÿè-Aÿì-|ÿü`–-nÿèÿà-nÿìÿä/.ÿô/.ÿð/.ÿì/.ÿè/././.ÿüN¹X///9¸/9´N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿè-Aÿì-nÿàÿð-nÿäÿôR®ÿü .ÿü°®mÿb/.ÿì/.ÿè/.ÿøN¹X//N¹ßüN^NuAAA@€AÿÿÿþÿÿÿþAˆ.L52¨.L42V.L20006_S1 y1`.L73 fltusedh.L63|.L532.L43\.L44`.L20004t.L54H.L20016,.L74`.L64f.L45 fneg0.L20009 y0|.L55’.L46P.L20014œ.L65<.L20002d.L47 j0<.L758.L56T.L20012 fdivl.L48 fixV.L20007`.L66F.L57¬.L49œ.L20010|.L200000.L76,_F1<.L58 fsub$.L70ì.L67Ì.L20005D.L20017_S2„.L59 j1´.L77 fcmp¤.L68"¬ynŒ.L60"jnN.L20015$.L71 _F2Ø.L20003 lrem”.L50R.L20013¬.L69”.L61 floatH.L20008>.L72x.L51è.L20001Z.L20011 fmul\.L62 errno$B1R‰°h‰°n3|‰°„‰°Š œ¶1ÎA‰°‰°$G*:GJ*ZG¦‰°º‰°ÂA扰ò‰°øGþ*&AT‰°`‰°fGl*|”‰°°‰°¸Aö‰°‰°GG.*>zGŽž‰°¸‰°¾3Ì‹°I؉°Þ‰°ä<4Rj‚AƉ°Ò‰°ØGÞîGþ*AJGVj0.b            406163175   11    21    100664  4501      `
Tˆ˜NVÿäHîÿä/9	h/9	d/./.N¹l/./.N¹P-@-A/9	p/9	l/./.N¹oÞ/./.aŒP/9`/9\/./.N¹ßü-@ÿð-Aÿô//N¹P///9/9N¹ßü///.ÿô/.ÿðN¹P///9/9N¹ßü//N¹ßü///././9X/9TN¹ßü//N¹P//N¹`/./././.N¹ßü-@ÿø-Aÿü-y	tÿð-y	xÿô-y	|ÿè-y	€ÿì-|ÿä`– .ÿä瀀d @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀¬ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßüN^NuNVÿäHîÿäB¹/9	ˆ/9	„/./.N¹n#ü! 9	Œ"9	`f/9	˜/9	”/./.N¹oÞ/./.a@P/9`/9\/./.N¹ßü-@ÿð-Aÿô//N¹P///9/9N¹ßü///.ÿô/.ÿðN¹P///9/9N¹ßü//N¹ßü///././9X/9TN¹ßü//N¹P//N¹`f/./././.N¹ßü-@ÿø-Aÿü-y	œÿð-y	 ÿô-y	¤ÿè-y	¨ÿì-|ÿä`– .ÿäç€€Ô @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀	 @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/./.N¹P///./.aûrP///9X/9TN¹ßü//N¹ßü///.ÿì/.ÿè/.ÿô/.ÿðN¹ßü//N¹ßüN^NuNVÿäHîÿä/./././.N¹ßü///9	°/9	¬N¹ßü-@ÿø-Aÿü-y	´ÿð-y	¸ÿô-y	¼ÿè-y	Àÿì-|ÿä`– .ÿä瀀ô @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀, @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü#À#Á-y	Äÿð-y	Èÿô-y	Ìÿè-y	Ðÿì-|ÿä`– .ÿä瀀d @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀œ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü///././9	Ø/9	ÔN¹ßü//N¹ßü#À#ÁN^Nu@"ùƒnND@IÚ¢!hÂbÕø
Ä%0áÌ3îbþ_±#BPp)ªÜòð,Z«µyY£9#ÕëO™1´¹gQºÌ?ÐëÍ_Í‚Îíù#õGÑÓ¼µ.KàbÕø
Ä%0_–®ÉlÑ[ÖéÍ&-âÆWÍ#Cøê×´S‘m“9Œ>O½z½1a Jˆ`ɦö0Eªb	p›çÆ@€K¤˜š*ðï^L<-`ħ5L_qtà}UJö:C¯µ·I_©Ï
lFTYÒ-®+K¤˜š*ðï^L<D†:U>õL“ÑöJ÷3Viš8IXn’‰Þ2F#{67êá³@€Æy	à²[–¯Ç"5ªþÄeǼC箯ÛÆßLy»‘ÄbCX,ËFHÁœcïüÅiåIy	à²[–¯J"Ç–ÈlçJ2µÐ“CI]T…ÒÇ)Guc‘R4Ä-DÌb¿q–ëë@€à¾ÖçÐâadŒ„›{ß‘¢¤±ÏT\ô\&À+*äÙ»l¾ƒt¸/V;¡WÿÒÊ.\¥~Ma¥Áª
#×È!šZßìë|b¡œX£ý_h¹ÔZ»/§[ªIûïìuW¦¨räµSs\Wª@n¸O
*Ÿ GÁ4JtŽjB¸'ûE N}µ¹Õ@€BÿÿÿþÿÿÿþBC€BÔ	.L88¼	.L79ü.L20006_S1Ôj0p4Ä	.L83d.L73 fltused$.L63 sqrt\pio4Ô.L20004@.L54p.L74.L64 fneg	j0q4dj0p3Ì	.L84X.L20009_S3"Dy0>.L55 log pzeroî.L65:.L20002"j0h.L75d	.L56œj0q3 fdivôj0p2è.L85h.L20007 sinTtpiŠ.L668.L57ø.L80.L20000P.L76 faddòasympt_F1,j0q2 fsubl	.L58è.L20005”	.L70„	.L67dj0p1ô.L86_S2.L81¬	.L77 fcmp¬j0q1Œ	.L68t	.L60h.L20003œ	.L71_F2 qzeroì.L87´	.L78„.L69|	.L61ì.L20008ü.L82 cos¤	.L72ˆ.L20001 fmul_F3.L62 errno‰°‰°8 0‰°@‰°F8T‰°l‰°r.€#˜‹°?¤‹°?ªI°FÈ‹°Ô‹°ÚIà.ð‰°‰°	$I0IJ‰°^‰°f‰°n‰°v	I®*¾	ØIö*6‹îLP‰°V‰°\8j‹°Lv‰°|‰°‚‰°Œ‰°’8 ‰°¸‰°¾.ÌFä‹°?ð‹°?öIü#‹° ‹°&I,*<‰°T‰°Z`	pI|I–‰°ª‰°²‰°º‰°Â	ÜIú*
	$IB*Rz‰°˜‰°žI¤I´Ô*äI‰°‰°$*‰°>‰°F‰°N‰°V	pIŽ*ž	¸IÖ*æ‹°"‹°(‰°.‰°6‰°>‰°F	`I~*Ž	¨IÆ*Ö‰°‰°$*I:‹°?F‹°?L
j1.b            406163193   11    21    100664  4982      `
TÈ"NVÿÜHîÿÜ-nÿà-nÿä/9
ˆ/9
„/.ÿä/.ÿàN¹l/.ÿä/.ÿàN¹P-@ÿà-Aÿä/9
/9
Œ/.ÿä/.ÿàN¹oD/.ÿä/.ÿàa~P/9p/9l/9
˜/9
”N¹ßü///.ÿä/.ÿàN¹ßü-@ÿð-Aÿô//N¹P///9`/9\N¹ßü///.ÿô/.ÿðN¹P///9X/9TN¹ßü//N¹ßü///.ÿä/.ÿà/9h/9dN¹ßü//N¹P//N¹ßü-@ÿð-Aÿô/9
 /9
œ/./.N¹l/.ÿô/.ÿðN¹P-@ÿð-Aÿô .ÿð".ÿô`"/.ÿä/.ÿà/.ÿä/.ÿàN¹ßü-@ÿø-Aÿü-y
¤ÿð-y
¨ÿô-y
¬ÿè-y
°ÿì-|ÿÜ`– .ÿÜ瀀t @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿÜ瀀¼ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿÜJ®ÿÜlÿf/.ÿì/.ÿè/.ÿô/.ÿð/./.N¹ßü//N¹ßüN^NuNVÿÜHîÿÜB¹-nÿà-nÿä/9
¸/9
´/.ÿä/.ÿàN¹n#ü! 9
¼"9
À`Î/9
È/9
Ä/.ÿä/.ÿàN¹oú/.ÿä/.ÿàa¨P/9p/9l/9
Ð/9
ÌN¹ßü///.ÿä/.ÿàN¹ßü-@ÿð-Aÿô//N¹P///9`/9\N¹ßü///.ÿô/.ÿðN¹P///9X/9TN¹ßü//N¹ßü///.ÿä/.ÿà/9h/9dN¹ßü//N¹P//N¹`²/.ÿä/.ÿà/.ÿä/.ÿàN¹ßü-@ÿø-Aÿü-y
Ôÿð-y
Øÿô-y
Üÿè-y
àÿì-|	ÿÜ`– .ÿÜ瀀	ä @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿÜ瀀
4 @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿÜJ®ÿÜlÿf/.ÿä/.ÿà/9
è/9
äN¹ßü///.ÿä/.ÿàN¹P///.ÿä/.ÿàaúœP//N¹ßü//N¹ßü///9h/9dN¹ßü///.ÿì/.ÿè/.ÿô/.ÿð/.ÿä/.ÿàN¹ßü//N¹ßü//N¹ßüN^NuNVÿäHîÿä/./././.N¹ßü///9
ð/9
ìN¹ßü-@ÿø-Aÿü-y
ôÿð-y
øÿô-y
üÿè-yÿì-|ÿä`– .ÿä瀀	 @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀	< @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü#ÀT#ÁX-yÿð-yÿô-yÿè-yÿì-|ÿä`– .ÿä瀀	t @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀	¬ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü///././9/9N¹ßü//N¹ßü#À\#Á`N^Nu@"ùƒnND@IÚ¢!hÂbü)Aëág|5ïlÌÊ_–€F=çNÛÿ6]	X„FÕk׺ÅÔšúî0PKqÒM<?ËM“°pRF(ÑöŸ²VFc|)Aë`$	Ís©\XnùÄRϱX=SsÃH¼Sô-åÂQ‡ªOq¹QioH<J·SÂŽžOEÈÝÏs0™ó@€Ë‡^[¢2×Ì´æLįËÉ„Ú)°vʹúJÏ8`ÈÖ€{ÅÉs»Œàîݡ^[¢2×Ì•,cÒÀÅËÈ÷öõžC´Ê¸Œ
–6ÈÑîFŵàMUƒ®_@€HÄéÕ:xžH¦L”‘hHAkWWG|†—Q·EÕLƒ¸Å_C
?Au/J-Mö)JÞV„WJ­F%[Y2IÃtÍòBb.H:ОrEWõÀóØô@€æ¨ÊävžRCe³ñ Á{»ãƒp7>X`˜-i‡Æ‚ÌÝ.›CYY˜SOØZÕ7'nÌœÜPXî0$¾™Ë¶¾)¨Vg×;â‚9;9d“S
ÃE¸`Í![…’Q\À?h[]aX‡\{ÖTˆoE¾‡O†ŒÉêVÁJ¾Ô–
Ê”EÉ‹ŽóU@€BA@ÿÿÿþÿÿÿþBA@@€C€B.L88.L79f.L20006_S1t	p3tp1.L93ô
.L83Ä
.L73"Îy1 fltused¤
.L63<	q2 sqrt4
q4lpio4.L89æ.L20004Ê.L54Ì
.L74¬
.L64 fnegü
.L84_S3J.L55 logTpzero.L20002Š.L65Ô
.L75„
.L56æ.L90 fdivê.L20007ö.L85 sindtpi–.L66ª.L57ä
.L80Ž.L20000Ü
.L76 faddðasympt$_F1ä	p4	p2 fsubŒ
.L58¼q1ú.L20005´
.L70Ž.L67ò.L91.L86¬	q3_S2"j1N.L81.L77 fcmpì.L68”
.L60†.L20003¼
.L71$_F2\qzeroú.L87ê.L92".L78 .L69ž.L61V.L20008ì
.L82 cos6.L72ú.L20001 fmul_F3œ
.L62 errno‰°‰°<,<‰°L‰°R<`‰°x‰°~‰°„‰°ŠM/¨#À‰°Ì‰°ÒMØJð‰°ü‰°M/‰°0‰°6 <
LMX‰°l‰°r<€M¼‰°Ð‰°Ø‰°à‰°è	M *0	JMh*xM° À‹îPÚ‰°ì‰°ò<‹°P‰°‰°‰°"‰°(<6‰°N‰°T‰°Z‰°`Mf/~J–‰°¢‰°¨M®#Ɖ°Ò‰°ØMÞ*‰° 
"M.MH‰°\‰°d‰°l‰°t	ŽM¬*¼	ÖMô*‰°,‰°2 8PMn/~‰°Ž‰°”MšM Ò*âM‰°‰°" (‰°<‰°D‰°L‰°T	nMŒ*œ	¶MÔ*ä ‰° ‰°&‰°,‰°4‰°<‰°D	^M|*Œ	¦MÄ*Ô ‰°‰°" (M8‰°D‰°Jpow.b           406163199   11    21    100664  917       `
d()ÀNVÿôHîÿô/9h/9d/./.N¹nî/9p/9l/./.N¹f./9x/9t/./.N¹oê 9|"9€`ð/./.N¹P-@ÿô/./.N¹P".ÿô²€f¬/./.N¹P//N¹P///./.N¹ßü//N¹P-@ÿø-Aÿü .ÿô€g//.ÿøN¹P-@ÿø-Aÿü .ÿø".ÿü`L/./.N¹P///./.N¹ßü//N¹P`#ü! 9„"9ˆN^Nud.L17.L16_S1 fltused`.L15„.L26
.L25 .L24|.L23b.L20J.L22t.L21 fneg exp log fix_F1 fcmp"pow fmull.L19r.L18 errno‰°‰° ‰°*‰°0>‰°F‰°LZ‰°d‰°j|ª¶Ê
Úü2
B‹°P‰°V‰°\
log.b           406163213   11    21    100664  2113      `
xNVÿÜHîÿÜ/9Ì/9È/./.N¹n#ü! 9Ð"9Ô`üHnÿÜ/./.N¹ßü-@ÿø-Aÿü`2/9Ü/9Ø/.ÿü/.ÿøN¹ßü-@ÿø-Aÿü .ÿÜS€-@ÿÜ/9ä/9à/.ÿü/.ÿøN¹m²/9Œ/9ˆ/.ÿü/.ÿøN¹l2/.ÿü/.ÿø/9ì/9èN¹ßü-@ÿø-Aÿü .ÿÜS€-@ÿÜ/9ü/9ø/.ÿü/.ÿøN¹ßü///9ô/9ð/.ÿü/.ÿøN¹ßü//N¹ßü-@ÿð-Aÿô////N¹ßü-@ÿè-Aÿì/9”/9///9œ/9˜///9¤/9 ///9¬/9¨N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿà-Aÿä/9´/9°/.ÿì/.ÿè/9¼/9¸/.ÿì/.ÿè/9Ä/9À/.ÿì/.ÿè/9/9N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü///.ÿä/.ÿàN¹ßü-@ÿà-Aÿä/9|/9x/.ÿÜN¹X//N¹ßü///.ÿô/.ÿð/.ÿä/.ÿàN¹ßü//N¹ßü-@ÿà-AÿäN^NuNVHî/9„/9€/./.aü¢P//N¹ßüN^Nu@1r÷ÑÏzA]ݪ¨¬@5ó3ùÞeÂÀlŽB÷¨‰#‰™"Â3ûh’@±?טÃG˜eÂ@lŽB›Ù½,$l“çdr!ÿÿÿþÿÿÿþA@A@€@€@€:.L52xlog2_S1°q0¨p3˜p1 fltusedø.L63@.L53Àq2">log10È.L54€ln10.L64Ð.L55"logr.L65”.L56 fdiv°.L57ˆsqrto2”.L20000 fadd frexp$_F1 p2p0 fsubà.L58¸q1_S2Ø.L59 fcmpþ.L60_F2 floatè.L61b.L20001 fmulð.L62 errno‰°‰°  ‹°(,‰°2‰°8N‰°d‰°j&x‰°–‰°œ ª‰°²‰°¸ Ɖ°Ö‰°Ü&≰‰°‰°$‰°*8H&d‰°x‰°~‰°ˆ‰°Ž‰°˜‰°ž‰°¨‰°®&´Ä&Ôä&ô‰°‰°‰°,‰°2‰°@‰°F‰°T‰°Z&`p&€& °È‰°Ü‰°â#ì&ø&(‰°J‰°Ph
sin.b           406163223   11    21    100664  2416      `
p€8(NVHî/9Ä/9À/./.N¹l/./.N¹P-@-A/</./.a.ßüN^NuNVHî/</./.a
ßüN^NuNVÿÄHîÿÄ-nÿà-nÿä/9Ì/9È/.ÿä/.ÿàN¹l"/.ÿä/.ÿàN¹P-@ÿà-Aÿä .T€-@/9t/9p/.ÿä/.ÿàN¹ßü-@ÿà-Aÿä/9Ô/9Ð/.ÿä/.ÿàN¹oÈHnÿø/.ÿä/.ÿàN¹ßü-@ÿØ-AÿÜ/.N¹X///.ÿü/.ÿøN¹ßü-@ÿø-AÿüHnÿð/.ÿü/.ÿø/9Ü/9ØN¹ßü//N¹ßü/.ÿô/.ÿð/9ä/9àN¹ßü///.ÿü/.ÿøN¹ßü//N¹P`L/.ÿä/.ÿàN¹P-@ÿÔ/N¹X///.ÿä/.ÿàN¹ßü-@ÿØ-AÿÜ .ЮÿÔ€-@ .€g(/.ÿÜ/.ÿØ/9ì/9èN¹ßü-@ÿØ-AÿÜ®o/.ÿÜ/.ÿØN¹P-@ÿØ-AÿÜ/.ÿÜ/.ÿØ/.ÿÜ/.ÿØN¹ßü-@ÿè-Aÿì/.ÿÜ/.ÿØ/9|/9x///9„/9€///9Œ/9ˆ///9”/9///9œ/9˜N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿÌ-AÿÐ/9¤/9 /.ÿì/.ÿè/9¬/9¨/.ÿì/.ÿè/9´/9°/.ÿì/.ÿè/9¼/9¸/.ÿì/.ÿèN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿÄ-AÿÈ///.ÿÐ/.ÿÌN¹ßüN^Nu@"ùƒnNDLO2Xúê»Ë–Øx3©‰ŸIÖäᶔTÂÇX]
1ªDøñ!û†LçΧ%îdIÇNg5 &GÜbhqÌD§K-Ÿá?Gÿø?€A€@€Ð.L30È.L31_S1 q0p3€p1Ü.L32 fltusedÐ.L33°q2j.L28Ø.L34x.L27T.L22>.L24À.L25à.L35,.L36`.L37 fnegè.L38‚.L39_S3 fdiv fix"Xsin modf(.L20000 fadd_F1˜p4ˆp2xp0 fsub¨q1¸q3_S2 fcmp_F2 float"|sinus"cosptwoopi fmul<_F3‰°‰°% 0‰°”‰°š%¨¸‰°Ò‰°Ø+扰ú‰°%$'<P‰°p‰°v+|Œ‰° ‰°¦+¬!ÄÔæ'ô!‰°B‰°H!Nt+”‰°°‰°¶‰°À‰°Æ‰°Ð‰°Ö‰°à‰°æ‰°ð‰°ö+ü+,+<L+\l+|‰°‰°–‰°¤‰°ª‰°¸‰°¾‰°Ì‰°Òà+ð+ +0@`sqrt.b          406163231   11    21    100664  1686      `
pX^PNVÿèHîÿè/9t/9p/./.N¹n6/9|/9x/./.N¹l
#ü! 9€"9„`Hnÿì/./.N¹ßü-@ÿø-Aÿü` /9Œ/9ˆHnÿøN¹ßüS®ÿì/9”/9/.ÿü/.ÿøN¹mÄ .ÿì€g /9œ/9˜HnÿøN¹ßüS®ÿì/.ÿü/.ÿø/9¬/9¨N¹ßü///9¤/9 N¹ßü-@ÿð-Aÿô®<ÿìo&/9´/9°HnÿðN¹ßü®<ÿì`Ð®ÿÿÿÄÿìl&/9¼/9¸HnÿðN¹ßü®<ÿì`ÐJ®ÿìm0/</.ÿìN¹Prá¡/N¹X//HnÿðN¹`2/< .ÿìD€/N¹Prá¡/N¹X//HnÿðN¹ßüB®ÿè`\/.ÿô/.ÿð/./.N¹ßü///.ÿô/.ÿðN¹ßü///9Ä/9ÀN¹ßü-@ÿð-AÿôR®ÿè®ÿèoš .ÿð".ÿôN^NuA@A@@€O€O€@°.L30L.L17Z.L31p.L16_S1 fltusedŠ.L32\.L15¸.L33l.L14À.L34Z.L29*.L28¨.L27 .L26˜.L25æ.L24º.L21.L22ˆ.L23ž.L20ø.L35"sqrtV.L36þ.L20004d.L37Z.L38À.L39ò.L20002 fdivž.L20000 fadd frexp_F1 ldiv fcmpZ.L20003 afdiv float~.L20001 fmul€.L19 afmulx.L18 errno‰°‰°# ‰°(‰°.#<‹°,H‰°N‰°T j‰°€‰°†*‰° ‰°¦#´‰°È‰°Î*؉°ð‰°öü‰°‰°(‰°6‰°<*F‰°f‰°l%v"œ&ª*º"Ð&Þ%î(‰°8‰°>(Dldiv.b          406162967   11    21    100664  203       `
ˆNVHç<*< .lD€D…&".lDD…(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿ€ÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚ J…lD€Lß<N^Nu ulmul"ldiv+²j
tan.b           406163241   11    21    100664  2412      `
 d@NVÿÐHîÿÐB®ÿÔ-yPÿø-yTÿü/9\/9X/./.N¹l(/./.N¹P-@-A-y`ÿø-ydÿü/9/9/./.N¹ßü-@-AHnÿè/./.N¹ßü-@ÿà-Aÿä/.ÿì/.ÿèN¹P-@ÿÐ/</N¹P€bÐ@0;NûÌ:nˆ/.ÿä/.ÿà/.ÿä/.ÿàN¹ßü-@ÿØ-AÿÜ/.ÿä/.ÿà/9/9///9/9///9$/9 ///9,/9(///94/90N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿð-Aÿô/9</98/.ÿÜ/.ÿØ/9D/9@/.ÿÜ/.ÿØ/9L/9H/.ÿÜ/.ÿØ/9l/9hN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü///.ÿô/.ÿðN¹ßü-@ÿð-Aÿô®ÿÔf$/9t/9p/.ÿô/.ÿðN¹fÞ#ü"/9|/9x/.ÿü/.ÿøN¹o¨ 9€"9„`ê/.ÿä/.ÿà/9Œ/9ˆN¹ßü-@ÿà-Aÿä-|ÿÔ`ýœ/.ÿü/.ÿøN¹P-@ÿø-Aÿü`Ú/.ÿä/.ÿà/9”/9N¹ßü-@ÿà-Aÿä/.ÿü/.ÿøN¹P-@ÿø-Aÿü`ý>`ý: 9˜"9œ`D/.ÿô/.ÿð/9¤/9 N¹ßü-@ÿð-Aÿô/.ÿô/.ÿð/.ÿü/.ÿøN¹ßüN^Nu@¢ùƒnNDÇL0Ï‚ÖÁ‚Eƒÿ y+VÂx™
ì=>0yêÂe9Áj¯ú6Çý矗¿¢F”îÊÌÄ€ÙX(ç@€À€@€ÿÿþÿÿÿþ@€@€ÿÿÿþÿÿÿþ@€_S18q0(p3p1 fltused€.L73.L63P.L53Hq2b.L54˜.L74¬.L64 fnegX.L55"tanè.L65 .L75`.L56 fdiv fixà.L66è.L57 modfB.L20000 fadd0_F10p4 p2p0 fsubÎ.L58@q1p.L70h.L67invpi.L59 fcmpˆ.L60æ.L68°.L71 lrem¾.L69N.L61.L51x.L72 fmulh.L62 errno‰°‰°‰° ‰°&$4D‰°T‰°\‰°d‰°j-x˜´(È-ú‰°‰°‰°&‰°,‰°6‰°<‰°F‰°L‰°V‰°\-br-‚’-¢²-ÂÒ-≰ö‰°ü‰°
‰°‰°‰°$‰°2‰°8->N-^n-~Ž¦‰°Æ‰°Ì$Ú‹°/艰ô$‰°‰°‰°$‰°*0X‰°r‰°x~š‰°²‰°¸‰°È‰°ÎÔ-ølrem.b          406162971   11    21    100664  207       `
ŒNVHç8(< .lD€D„$".lDlB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€J„lD€LßN^Nu ulmul"lrem+²l
ulmul.b         406162975   11    21    100664  94        `
0NVHç0$.&.B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐLßN^Nu"ulmultanh.b          406163245   11    21    100664  618       `
Ô ÞxNVÿøHîÿø-yÔÿø-yØÿü/9à/9Ü/./.N¹l(/./.N¹P-@-A-yäÿø-yèÿü/9ð/9ì/./.N¹o
 .ÿø".ÿü`L/./.N¹P///./.N¹P///.ÿü/.ÿøN¹ßü//N¹ßüN^Nu@€À€B¨Ü.L17^.L16_S1 fltusedÔ.L15Ð.L14ì.L20 fneg cosh fdiv_F1 sinh fcmp"tanh fmul„.L19ä.L18‰°‰°‰°‰°"0@‰°P‰°X‰°`‰°ftŽ¢¶	Æsinh.b          406163253   11    21    100664  2274      `
À€J8NVÿìHî€ÿì~/9ü/9ø/./.N¹l/./.N¹P-@-A~ÿ/9/9/./.N¹oP/9/9/./.N¹P//N¹ßü-@ÿø-AÿüJ‡o`D/.ÿü/.ÿøN¹P`0/9/9/./.N¹ox/9/9/./.N¹P//N¹P///./.N¹P//N¹ßü///N¹X//N¹ßü//N¹`–/./././.N¹ßü-@ÿð-Aÿô/././9Ä/9À///9Ì/9È///9Ô/9Ð///9Ü/9ØN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿø-Aÿü/9ä/9à/.ÿô/.ÿð/9ì/9è/.ÿô/.ÿð/9ô/9ð/.ÿô/.ÿðN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//HnÿøN¹ßü/.ÿü/.ÿø/N¹X//N¹ßüLî€ÿìN^NuNVHî/9$/9 /./.N¹l/./.N¹P-@-A/9,/9(/./.N¹o/94/90/./.N¹P`L/9</98/./.N¹P//N¹P///./.N¹P//N¹ßü//N¹ßüN^NuÊþõÓ%Úyȯœ\0.‘kÆ4ãa¶ÑoØÂÒqïB ;ÈÊþõÓ%ÚyGm¼±õt
Ä-­Ïæ€ØB¨A@AB¨AAº.L31€_S1àq0Øp3Èp1$.L32 fltused .L33ðq2^.L34.L29B.L27.L28Ü.L20š.L26.L25®.L23.L24B.L21ø.L22(.L35ª.L200040.L368.L37 fneg exp®.L20002"æcosh fdivÖ.L20000 fadd_F1Ðp2Àp0 fsubèq1_S2 fcmp"sinh¬.L20003_F2 afdiv float´.L20001 fmul‰°‰°%"2‰°D‰°J%X‰°`‰°ft€¤‰°°‰°¶%ĉ°Ì‰°Òàì"*,*:,T‰°p‰°v‰°€‰°†‰°‰°–‰° ‰°¦,¬¼,ÌÜ,ìü,‰° ‰°&‰°4‰°:‰°H‰°N\,l|,Œœ)°*Æ,Ò‰°ò‰°ø%‰°&‰°,%:‰°B‰°HV‰°`‰°ft€” °exp.b           406163261   11    21    100664  1855      `
ôxÓàNVÿÜHîÿÜ/9@/9</./.N¹f 9D"9H`¼/98/94N¹P///./.N¹l 9L"9P`„/98/94/./.N¹o#ü" 9T"9X`N/9(/9$HnN¹ßü/./.N¹P//N¹P-@ÿÜ/9`/9\/.ÿÜN¹X///./.N¹ßü//N¹ßü-@ÿø-Aÿü////N¹ßü-@ÿà-Aÿä/.ÿü/.ÿø/9ø/9ô///9/9ü///9/9N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿð-Aÿô/9/9/.ÿä/.ÿà/9/9/.ÿä/.ÿà/9 /9/.ÿä/.ÿà/9h/9dN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿè-Aÿì/.ÿÜ/.ÿô/.ÿð//N¹ßü///.ÿô/.ÿð/.ÿì/.ÿèN¹ßü///90/9,N¹ßü//N¹ßü//N¹ßüN^NuJýôÆÙúGìñ‚S¯ïCruœ‡Ø%K·0@¸q9iI ¤ÛàEÚ©4¿ÁÅ»@¸ª;)\ñ@µó3ùÞeG@@€ÿÿþÿÿÿþ@@€6.L52_S1 fltusedexpq1<.L53,sqrt2D.L54expp2 fnegn.L55"expL.L56 fdivexpq2 ldexp fix¤.L574maxf fadd$_F1 fsubT.L58ôexpp0$log2e\.L59 fcmpd.L60expq0 floatüexpp1ð.L51 fmul floor afmul errno‰°‰° ‰°(‰°.‰°8‰°>DX‰°`‰°f‰°p‰°v„‹°"‰°–‰°œ‰°¦‰°¬!¶ ÊÖ‰°â‰°èò2‰°N‰°T‰°^‰°d‰°n‰°tzŠšªº‰°Î‰°Ô‰°â‰°è‰°ö‰°ü‰°
‰°&6FVfŠª‰°º‰°ÀÆÖæ
floor.b         406163266   11    21    100664  692       `
øxNVÿøHîÿø/9/9/./.N¹lŒ/./.N¹P-@-AHn/./.N¹ßü-@ÿø-Aÿü/9/9/.ÿü/.ÿøN¹g/9 /9HnN¹ßü/./.N¹P-@-A`Hn/./.N¹ßü .".N^NuNVHî/./.N¹P//aÿ
P//N¹PN^Nu@€.L17˜.L16_S1 fltused.L15².L14.L21Ò.L13 fneg afadd"Öceil modf_F1_S2 fcmp_F2Ê.L19"floor.L18‰°‰° 2N‰°b‰°hv‰°~‰°„	Ž¢Àêfloat.b         406162965   11    21    100664  2994      `
T$ú BPJ€l0¼!A"ÿÿ€!AH@î€@ÿfBB¨B¨Nu@€1@NuB€0(@€fBNuJPg@H@ï€"(fB€Nuÿÿ€"(NuN¹ÑhN¹¶Nup"(f"(fB@Nu@ S@ãdÿúP@NuB$(&(2kfNuâ‚â“SAfÿø‚ÿÿÿ`ãƒã’RAfÿø!B!CNu"|`J@f( .". IN¹ .". |TN¹Nu .". IN¹ n " |TN¹NuNuNV |T ."."nN¹0(HÀ"€BhN¹DN^NuNV |T .".N¹ .ÑhN¹DN^NuNVHç8 .". |TN¹"|`28(n3|ÿ€ I`j3DBhD8m#h#h1|ÿ€ I`BpøN¹¶B€ãƒã’ã‘ãSDfÿô!C!B#A#@N¹~Qh IN¹N¹¶"nN¹D"À" |TN¹DLßN^NuNVHç0 .". |TN¹JhnB€`$pøN¹¶2(B€ãƒã’ãSAfÿöJPgD€LßN^NuNVHç0 |TB¨BP .kj1|ÿ€` 0¼D€!@N¹N¹¶@81@N¹DLßN^NuNVB@N¹ôN¹æN^NuNVB@N¹ô
QN¹æN^NuNVB@N¹ô
QN¹æJ€N^NuNVpN¹ôN¹æ n À N^NuNVpN¹ô
QN¹æ n À N^NuNVpN¹ôB¨N¹æ n €N^NuNVpN¹ôB¨
QN¹æ n €N^NuHç00(2)Ak IN¹¶"|TÑh`D@N¹¶ÑhJPgDƒ@‚ )")JQgD@€ÖÕ€J‚lDƒ@‚P`P!B!CN¹~N¹DLßNuNV". .k€€`€ÿÿÿN^NuNVB@N¹ôN¹ÞN^NuNVpN¹ôN¹Þ n À N^NuNVpN¹ôN¹Þ n €N^NuHç< 0±X0ÑXB‚BƒB…xP‰$|l02!ÂÀÖÕ…SDfÿò$Ä$Â$ƒB‚BƒxUˆTŠ0 2ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒB‚BƒxU‰TŠ02!ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒUˆTŠ0 2ÂÀÓ¢RŠÚÚÚÚÚÚÚÚQˆYˆN¹~N¹DLß<NuNVB€N¹ôN¹àN^NuNVpN¹ôN¹à n À N^NuNVpN¹ôN¹à n €N^NuHç>0±X0‘X f‚À"$&B„B…|:`SFg0Düã•ã”ã“ã’–•€lÿèSFgã…ã”ã“ã’ÖÕ€lÿÒ`ÿèYˆ Ä …QˆN¹~N¹DLß|Nu"LfltusedTafloatàdivPadde¸fixehb_manl8diveJmodfellsumXa_manh"jfnegfloate@l3dsúl1ds"€afsubêshifteVa_exptæadd"fdiv"Âafsubf"bafadd`bfloat"lfix"€ldexpDitoe`b_sign"ªmodfôgetargsdb_manhMANH"¢afaddf"fadd"Nfrexp",fsubEXPTSIGNoffsetetoiôokTa_sign"Ffcmpbb_expt\a_manl"¦afdivÞmulthmultel2ds¶shift"Äafdivf~normal"Âafmulf"ÀfloatMANL"Žfmul"¤afmul(²€(²Š‰°ö(²‰°(² (²2‰°@(²F‰°T(²f(²x‰°†(²”(²¢‰°¼(²Â‰°È(²(²4(²@(²F(²P‰°Z(²`‰°~(²„(²š‰°Ê(²ö(²ü(²
(²(²$(²4(²>(²N(²X(²j(²p(²ˆ(²’(²ª(²´(²Ê(²Ø(²ü‰°(²(²Z(²`(²–(²œ(²¬(²²(²Ê(²Ð‰°ö(²€(²†(²˜(²ž(²®(²´(²Ì(²Ò(²B(²Hò2‰°N‰°T‰°^‰°d‰°nsumacc/cc41/as68   755      0     12      153441  3472711314   6616 ˆ,ü!èÂ^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPï؇ûï
ÝPûï耼ݬݬûï
ÕP1‰1‘ûïr_ûïÕP5ûïÖmÕP*ûï/FÕPûï,8ÕPûïQÕP	ÝûïTMÀï2²ï™±Ðï7²PÐ Ðï¬QР¡Ðï¬PÑïq± Ðïg± Õï#‡1oÿÕï´ˆÎPÔPÝPûï"€Â$^Ðïű­Üß­àûï%[ÕP1áßï`‡ß­àûï2^ÕPûïÑaÝûïŒVÝóßï:‡ß­àûï^ÕPÝßï+‡ß­àûïò]ÕPÔßï‡ß­àûïÞ]ÕPݳûï¿	Ýûïü?ÔPßïõ†ß­àûï±]ÕPוï/±Øßï݆߭àûï•]ÕP0ûï®ÕP¹ûï[Þïa°PÐïâ°Q‘A`,ÖïÕ°ÐPЭÜïÉ°òÕïö…×ïî…	Ý#ûïQÞïñ…PÐïÖ…Q•A`ÔPÐPöPÝûïI?Ñï°…Ýûï_Ö•ïv°ÔPûïÞï—…QÐï|…RöPBaÞïu…PÐïj…SBaC`Þïr…PÐïW…Q•A`ÔPÐPöPï#°ÝûïÊ>ЬPÑPÑP=ÑPfÝPßﶅûïägÔPyÞï…PÐï…QÞï…RÐïó„SA`Cb@Þïé„PÐïÞ„Q•A`ÔPÐPÞïß„QÐïÄ„RöPBaÞïË„PÐï°„QöA`Þ﹄PÐïž„Q•A`†ÐPöPïn¯Ýûï>Â0^ß­Øûï©XÕPÝûïhÔPß­ØûïÓ[ûï.YÞPÐï¯Q‘A`,Öï¯ûï
Y”­×ßïå„ß­Øûïx[öP­×ßïÒ„ß­Øûïb[ÕPJß­Øûï0XÕPÝ…ß­ØûïþgÐP­Ðá ÐPÔPöP­Ö•­×˜­ÖP•­×ÔPÐP˜PPßïÞ­ûïÓ:ÐïÙ­­øÔ­ü_x­üPÝà,ˆß­ØûïåZÕPCÕ­øx­üPá@ÐPÕ­øx­üPà@éÕ­ø1ïþx­üPà@ïrƒÓ1ÞþÖ­üx­üPÕà,ˆ”1ÂþßïÔ„ßï‚«ûïmݬݬßïo«ûïôlûï™lЬ[Ñï ‰‘ï’„W)ö ×ïu„Ð[ïr„Öïd„ÔZÑJï©­[
ÕïW„ÜÖZÑZïO„áÐïG„PÐ[@ï‚­Öï8„Ñï6‰Õï „ݬûïsÿÿÿ×ï„Öï„Wï„ß寧ûï•ïш
Ýïñ­ûïÕïȃ	ÕïăÝﻃÝﱃßï҃ݬûïõk‘ï—ˆÝßïòƒÝ¬ûïÖkÔ[(ÐKïǬPÝ@ﻂÝK︬ßïڃݬûï¬kÖ[Ñ[ï[ƒÏÂ^ÕïIƒ•ï(ˆöïˆÞïà©ï;­Ýûï;”ïˆÂ^Ь[ûïBVÞPÐï#¬Q˜A`~ûï•7ÕP
Ô«Ô«ÐPÝ[ûï~ÕP1¦1#1ÑP%1Ù1ïÑP!1d˜­ï~ßïB‡ûïÓýÿÿÝûïúýÿÿ1ì‘kï‘­ðéÕ«Õ­ôßÕ­ôЭô«À­ø«˜­ñPÊûÿÿÿP˜«QÈPQöQ«0‘k³‘­ð­Õ­ôÕ«£Ð­ôPЫQÑ ¡”Ô«ˆ«­ø«ûï^UÞᆰPÐï?«QA`­ï˜­ï~ûï¬6ÕP1ÿ‘­ï(÷‘­ï>‘­ï<Öï«Ðï	«P@ïyª­ïßï=†˜­ï~ûï¼WÕP13Öïáªß­ðûïUÕPÔP˜­ïPÑP/"1ðÑP*1ÄþÕ«1çþÕ­ôøÄ­ø«1RÿÕ«1ÒþÕ­ôøÆ­ø«1=ÿÕ«1½þÕ­ôøÒ­øPÊP«1%ÿÕ«1¥þÕ­ôøÈ­ø«1ÿÕ«1þÕ­ôøЫPÇ­øPQÄ­øQÃQP«1îþÕ«1nþÕ­ôøx­ø««1×þÕ«1WþÕ­ôøέøPxP««1½þÕ«1=þÕ­ôøx«PÉ­øP«1¢þÑP&1]ÿ1þÑP-1_þ1þÑP+1þ1öýÑP>£ÑP<…1çýÑP^1Tÿ1ØýÝ
1æýÂ^Ô­øÔ­üx­øPï¬QÉQP­øxÿ¬¬ò­üäЭøPÂ8^Ь[ûï„SÞïä¨PÐïe©Q‘A`+ÖïX©Ý[ûïÍÿÿÿÞïÀ¨PÐïA©Q‘A`-1†Öï1©Ý[ûï¦ÿÿÿÕPÔPÕ«	ÝûïKûÿÿΫ«WÖï©Ý[ûï{ÿÿÿÕPÕÕ«	Ýûï#ûÿÿÝ«ûï3ÿÿÿÐP«&ÖïÕ¨Ý[ûïJÿÿÿÕP¤Õ«	ÝûïòúÿÿÒ««ÐPÞï#¨PÐ廊Q‘A`!‘Þï¨PÐï¨Q‘A`~­ß­àûïêQÕP1à‘­à0‘­à9ß­àûïKU‘`$1€ß­àûï›aÐP­Ìè •ï„	ÝûïnúÿÿЭÌPá Р«ЭÌPà 	ÝûïLúÿÿÔ«ЭÌPá ök1MÿЭÌPá Õ 	РPá ÔPЭÌPÐP«ö
k1$ÿÝ[Ýïƒ-Öïɧ߭àûï+QÕPÝûïêùÿÿ1‹þÝ[ЭØPÝ@ïö‚ß­àûïÌÔ­Ø#Þï§PÐï…§QÞï΂RЭØS‘A`Cb£Ö­ØÞ﹂PЭØQ•A`ÍÞïѦPÐïR§Q‘A`'Ý[ÝÝ[ÝûïTÞ﫦PÐï,§Q‘A`"àÞï—¦PÐï§Q‘A`[>Öï
§Ý[ûïÁúÿÿöP­ßÞïo¦PÐïð¦Q‘A`]Öïâ¦	Ý	ûïùÿÿ˜­ßPÝ	1ÿÂ^Ô­üݬûïjSݬûïšSÐP[‘`.Ð
¬”k‘¼0ЬP‘ xЬÀ¬Ь[eÑZ01‰Ð¬PÑP1‚ÑPsÑP
dÑPÑZa%ÑZfÂWZÑZÿÿÿÿÝûïmøÿÿÔPÑZ919Ŭ­üPÁZP­üÖ[˜kZ–ЬPЭü ЬPÔ ö
¼ÐPÑZ9
Â0Z°ÑZ7öÎZ¦ÑZ2öêÖïÞ¥Ô[ÔZx[PïYQÉQP[ÖZÑZ¬9Þï5¥PÐﶥQ‘A`
%Þï!¥PÐQ‘A`ûïÐPYÖPµÔPЬPÐ[ ЬPÔ ÐPÂ^Þïã¤PÐïd¥QA`­ÿ‘­ÿ\1²ÖïN¥ÐïH¥P@︤­ÿÞZ‘j­ÿÖï)¥ÖZ˜jPÀZ•jçÔ[”­ÿÞPÐï
¥Q‘A`0EÞïu¤PÐïö¤Q‘A`71Þïa¤PÐïâ¤Q˜­ÿRxRR˜A`PÀRPÂ0PöP­ÿÖïŤÖ[Ñ[§Õ[˜­ÿPÞï'¤PÐ﨤QA`­ÿ‘­ÿ ‘­ÿ~‘­ÿ	
Ýûï¾öÿÿÎPÖï|¤ÀÂ$^Ѭßï[†ûïdfÝûï§rݬûïÔZÖZÐï1†PÐ@¼PJ`Jïb¥çßïE†Ðï†PÝ@¼ßûïìOßï*†ßûïWcÐP­ü1Œßï†ÐïÚ…PÝ@¼ßï_¥ûï²Oßï÷…ßïL¥ûïcÐP­ü[ßïà…ÐPÝ@¼ßï(¥ûï{OßïÃ…ßï¥ûïæbÐP­ü$ßï¥ß礪ûïyeÝûï¼qÖïT…ݬûï&Ý­üûïòßï’…ßï4¤ûï%rßßï!¤ûïöqßï‚…ßï¤ûïobÐP­üÝPûïªßïð£ßïZ…ûï÷dßïh…ßï¤ßï¤ûï´NßïU…ßïn¤ûïbÐPdßïX¤ßï5…LßïK…ßïԣ߭ÜûïtNßï;…ÕïR~	ÐïJ~PÞ­ÜPÝPûïÎaÐPïW£ß­Üßï
…ûïadÔP•ï~¢•ï(~ßï…ßïn£ßï¤ûïNßïö„ßïí£ûïvaÐPïÿ£ßï×£ßïÖ„£Ýïé£ûïðoûïÝ\ßïØ„ûï2[ÐPïó¡ÐïÕ› Ðïå¡PРûïU"ûïÐPÔZFÝûï÷pÐP[xZPÐฎ«xZPÐ༎«ÖZÝ«ûïàMÐPYxPPÐà ±kÐ[Iï> xZPÕฎ®ÐPò
ï5}Ý[ßï9„ûïMóÿÿÐï}PЬ@ï…¢ÐïƒPÐ@¼P‘`-1*ÐïƒPÁ@¼[Öïû‚1–ÑPe1ÑPg1¹ÑPl1›ÑPo1ªÑPpKÑPs1ƒ˜k~ßïƒûï·b=ÑPd öïm|‘«0'‘«9!Ö[˜kPÂ0PöPïR|öïQ|öïD|Ö[•k19ÿ˜kPÑPL®ÐïI‚PÐ@¼ï|Öï9‚öï|Ìöï|Ãöï|ºöï|Ðï‚PÕ@¼¦ßïƒÐïþPÖï÷Ý@¼ßïÅ¡ûïÐK€Â^Ðï埭øßïÍ¡ûïBIÕP ßAûïuLßﯡûïz	ÐP­üЭø犯ÐPéïŸ	Ý+ûïÎñÿÿöÔ[”KïÖžò[õßï|¡ûï‘*ÐPﮡЭüPРPÏPÂH=PV\ou`hp17°¸À ¨N×±ÁŽ–n÷vÿF϶?†®7¦/Vßfï6¿É~Ñ^çž'Õ6HRâôú‘¡©%%-5=EMU]emu}…åíŽs}ðÀàè°.þ&lÈØštО°àèðÈÐØ|Ž˜ÀÐØèðõý{ *ñÉ4>H¢¸¾†††\º"øFOX+4=ÑéÙX²½Ó‘
 œ+§ÿÈô†	ÄÖÜ{Ž”x€ˆÞéap	áR\f‡Ýûïðÿÿ˜ïÁŸ~ßïûï!QÝûïz,˜ï¤Ÿï«ÔPÝpNûï
ÆÝqNïÝsNçÝuNßÝvN×ÝwNÏÝÝ@ûï¤ÝÝ@@íÝÝ€@ãÝÝDÙÝÝ@DÏÝÝ€DÅÝÝF»ÝÝ@F±ÝÝ€F§ÝÝJÝÝ@J“ÝÝ€J‰ÝÝÀJ1~ÿÝÝH1sÿÝÝÀP1hÿÝÝÀQ1]ÿÝÝÀR1RÿÝÝÀS1GÿÝÝÀT1<ÿÝÝÀU11ÿÝÝÀV1&ÿÝÝÀW1ÿÝÝÀX1ÿÝÝÀY1ÿÝÝÀZ1úþÝÝÀ[1ïþÝÝÀ\1äþÝÝÀ]1ÙþÝÝÀ^1ÎþÝÝÀ_1ÃþÝÝBûï·1GþÝÝ@BìÝÝ€BâÝ@Hûï!1#þÝÀNîÝ€NæÝÝûïË1þÝÝ0ìÝÝ âÝÝÝÝ€ûï1×ýÝÝèÝÝâÝÝÝÝØÝÝìÝÝæÝÝÝÝ°ºÝÝìÝÝæÝÝÝ
ݱœÝÝìÝÝæÝÝÝÝÀ1}ÿÝÝëÝÝåÝÝÝÝÐ1^ÿÝÝëÝÝåÝÝÝPÝP1?ÿÝÝëÝÝåÝÝÝQÝQ1 ÿÝÝëÝÝåÝÀNÝ`ûïw1ßüÝbûïU
1ÏüÝdîÝfæÝhÞÝjÖÝlÎÝnÆÝ€NÝa¨Ýc°Ýe¨Ýg Ýi˜ÝkÝmˆÝo€Ý`ûï±
1IüÝbîÝdæÝfÞÝhÖÝjÎÝlÆÝn¾Ýa¶Ýc®Ýe¦ÝgžÝi–ÝkŽÝm†Ýo1}ÿÝ`ûï®
1ÀûÝbîÝdæÝfÞÝhÖÝjÎÝlÆÝn¾Ýa¶Ýc®Ýe¦ÝgžÝi–ÝkŽÝm†Ýo1}ÿÝÁûïë17ûÝîÝÑæÝ@ÑÞÝ€ÑÖÝ‘ÎÝ@‘ÆÝ€‘¾ÝàûïÕ
1ïúÝ@àîÝ€àæÝáÞÝ@áÖÝ€áÎÝàÆÝHà¾Ýˆà¶Ýá®ÝHá¦ÝˆážÝà–ÝXàŽÝ˜à†Ýá1}ÿÝXá1tÿݘá1kÿÝà1bÿÝPà1YÿÝà1PÿÝá1GÿÝPá1>ÿÝá15ÿÝÝ@Hûïx1úÝÝ€HìÝÝÀHâÝÝXNØݱûï1îùÝH±î݈±æÝ@ûïÂ
1ÎùÝ€îÝÀæÝâÝ€AûïV1ªùÝÀîÝÀ€æÝÀÁÞÝÀÀÖÝÈTûï*1zùÝÈUîÝÈWæÝÈQÞÝÈ\ÖÝÈ^ÎÝÈRÆÝÈ_¾ÝÈS¶ÝÈ]®ÝÈ[¦ÝÈVžÝÈZ–ÝÈPŽÝÈX†ÝÈY1}ÿÝÁûï51ñøÝÝÀAûïQ1ßøÝPNûï¡1ÏøÝ€Hûï1¿øÝÀHîÝûï‡1§øÝHîÝpûïe1øÝrNûïÝ1øÝ@Nûï
1oøݬûïŽBxPPÐà ±[ݬÝ«ûï¨BÕPÐk[Õ[èÐ[PÂ^Þïý—[Þï˜ZЫ­üЪ­øÑï%˜Ý1,‘k1˜Ý­üûïSÕPïÝZûïfÕP}ÝZûï}ÕPpÐïw|P2À@`ÝÝZTÝ­øûï)ÕPUÝ[ûï,ÕPHÐïJ|P2ÀD`'Ý­øûïðÕP1Ý[ûïÕP$Ðï!|P2ÀF`ÝÝ[ûïJ1“‘j‘jÁ‘k1	Ý­üûï‰ÕPï‘jÝ­øûïJÕP	Ýûï9çÿÿï­øPÈhNP1ÃÝ­øûïOÕP1Æ‘kÝ­üûï
ÕP	Ýûïüæÿÿï­üPÈ`NP1†ÝZûïSÕP1ÝZûïgÕPðÐïa{PÔ`ݬÝ[ûïŒÐïL{PÐ`­ðÔ`ݬÝZûïsÐï3{Pï`PöP­÷Ðï#{Pï`PöP­ö˜­÷Px	PPȬP˜­öQxQQÈQPÈ­ðPÐïøzQÐPax‘j1)ÿݬÝ[ûïvÕP1Sÿ‘jFÝ­øûï4ÕP8Õ¬3Ѭ20P2 PâPï­øQx	QQÈQPÐï–zQÐPaݬ1sþÐï†zPÔ`Ý
ûïâåÿÿÂ^Þï•[Þ秊ZЫ­üЪ­øx¬PȬPÐïLzQÐPaÑﲕ	Ýûïžåÿÿ‘k	1x¬PȬPÐïzQÐPaÕ¬fÑ«Õ«	ÝûïjåÿÿÑ«Ô­üï­üPx	PPÐïéyQÈPaÝZûïØÕPݬÝZûïdÕPݬÝZûïö	Ý
ûïåÿÿЬPÑPÑP	ÑP#ÝZûï„ÒP­ðÝZûïSË­ðP­ô2ÐP;ÝZûïaÒP­ðÝZûïºÐP­ìÝZûï#Ê­ðPÉ­ìP­ôÕ­ô!ѬÃÐPÝPÝ[ûï EݬÝZûïVx¬PȬPÐïyQÐPa‘kKÝ«ûï{ÕP=ЬPÑP°1›ÑP±1”ÝZûïÌÒP­ðÝZûïéË­ðP­ôÕ­ôS‘j1·Ýªûï(ÕPïЬPÑPÑP°ÑP±sÑPÐoݬÝ[ûïjšÀP1•ï«Px	PPâPÐïQxQÈPa1"ÿÔ­ôˆÝZûï8ÒP­ðÝZûï1iÿïªPx	PPÐïxQÈPaݬÝ[1íþÔ­ô
Ý[ûïÚÐP­ôÕ­ôÍ‘j17þÝ­øûïSÕPïÕ¬êѬ1iÿ2ÀPÐP­ðЬPÑPÑP°ÑPÐ1ðýï­øPx	PPȬPÈ­ðPÐï’wQÐPa1sÿÞï²’[Ðï{wPЬ`Ñïà’	ÝûïÌâÿÿÝ[ûï3ÕPÝ[ûïJÕPݬÝ[ûïx
	Ý
ûï›âÿÿÂ^ÞïW’[Ы­üÑï‹’Ýg‘k-Ý­üûï½ÕPÐïûvP2üF`ÐïïvPÔ €ï’<ÐïÜvPЬ`Ý[ûï¦ÕPÝ[ûï½ÕPݬÝ[ûïë	Ý
ûïâÿÿÞïÌ‘[Ðï•vPЬ`Ñïú‘	ÝûïæáÿÿÝ[ûï±ÕP
ÝÝ[ûï 	Ý
ûïÃáÿÿÐïRvPЬ`Õï·‘	Ýûï¤áÿÿÂ^Ô­üÞï\‘[Ðï%vPЬ`ÑÝD‘kÝ;Õ«ЫPÑ ï%‰Ý$ÁPÃP«­üÑ­üÿ
Ñ­ü€ÿÿ	Ýûï0áÿÿЭü«Ô«ÝÝ[ûï­AÂ^Ô­üÞïÖ[ÐïŸuPЬ`Ñï‘ÝD‘kÝ;Õ«ЫPÑ Ý$ÁïŽPÃP«­üÑ­ü
Ñ­ü€ÿÿÿ	ÝûïªàÿÿÕ­üš­üPÐï3uQÈPa!ѬaÐïuP2qN`	ÝûïtàÿÿÂ^Ô­üÞï,[ÑïeÝûïQàÿÿ1É‘k

ݬûï3þÿÿ1·ÁïmPÃP«­üà«àÑïÏiLÝÝÿÝ€ÿÿÝûï‹CÝPÝÝ€ÿÿÿÝûïtCÝPÁï!~ÝÝ[ûïÑBöPï–OЫPÑ 1zÿÑ­ü€ÿÿóÑ­üÿéÑ­ü
Ñ­ü€ÿÿÿݬûïïýÿÿ
ݬûïiþÿÿÂ^Ô­üÞï>[ÑïwÝûïcßÿÿ1Αk

ݬûïÁ1¼ÁïŒPÃP«­üà«àÑïáhLÝÝÿÝ€ÿÿÝûïBÝPÝÝ€ÿÿÿÝûï†BÝPÁï3Œ~ÝÝ[ûïãAöP﨎TÕ«†Ð«PÑ 1uÿÑ­ü€ÿÿóÑ­üÿéÑ­ü
Ñ­ü€ÿÿÿݬûïüüÿÿ
ݬûïvýÿÿͬPÐïsQÐPaÐï
sP2úN öï'ŽÝßï'Žûïè>Â^ÞïŽ[ÞïŽZЫ­üЪ­øÐïËrPЬ`Ñï0ŽÝ1€ÑPtw˜kPÑPñ‘jjÝ­üûïÕP\Ý­øûïÕPNx	­øPÈ­üPÐïyrQÈPaBÝ­üûïÕ
ÕP+Ý­øûïÇ
ÕPï­øPï­üQx	QQÈQPÈPÀ‘jÇÝ
ûï™ÝÿÿÂ^ÞïU[Þï^ZÐïrPЬ`Ñï|	ÝûïhÝÿÿݬÝ[ûï.Ъ­ü‘j$Ý­üûïL
ÕPï­üPx	PPÐïÌqQÈPa	Ý
ûï%ÝÿÿÂ^ÞïáŒ[ÞïêŒZÐï£qPЬ`Ñï?ÐïqPÈÀ`Ý[ûï¤
ÕPÝ[ûïm
ÕP
ÝÝ[ûïœ	Ý
ûï¿ÜÿÿÑïÀŒíЫ­üЪ­ø‘k	N‘jIÝ­øûï±	ÕP;Õ«Ñ«	ÝûïÜÿÿÑ­üÔ­üï­üPx	PPï­øQÈQPÐïõpQÈPa‘k‹Ý­üûïc	ÕP1zÿ‘jøÝ­øûïM	ÕPêï­üPx	PPï­øQÈQPÈ P´ÞïÖ‹[Þïß‹ZÐï˜pPЬ`Ñïý‹Ý1†‘kzÝ«ûïøÕPlÝZûïA	ÕP_ÝZûïX	ÕPRx	«PâPÐïIpQÈPa0ÝZûï	ÕP5ÝZûï)	ÕP(Ðï#pPâ`ÝÝ[ûï<ÝÝZûïB‘k	¾Ý
ûï`ÛÿÿÂ^Þï‹[Þï$‹ZÐïÝoPЬ`Ъ­üÑï=‹	Ýûï)ÛÿÿÝ[ûïÕP4‘j/Ý­üûï'ÕP!ï­üPx	PPÐï‘oQÈPaÝÝ[ûï¼	Ý
ûïßÚÿÿÂ^Þ[Þ金ZЫ­üЪ­øÐïSoPЬ`Ñ︊ÝG‘k@Ý­üûïžÕP2‘j-Ý­øûï‹ÕPï­øPx	PPï­üQÈQPÐïoQÈPa	Ý
ûï[ÚÿÿÂ^Ô­üÞïŠ[ÞïŠZЫ­øÐïÑnPЬ`Ñï6ŠÝûï"ÚÿÿX‘kSÝ­øûï+ÕPEÐïŸnPÈ­ø`Áï3‡PÃPª­üx­üPxðPPÑP­ü	ÝûïÛÙÿÿÐïmnPЭü öÂ^Þ[ÞZЫ­üЪ­øÐï;nPЬ`Ñï ‰Ý1Ú‘k1БjøÝ­üûï“ÕPsÝ­øûï…ÕPex	­üPâPÈ­øPJÝ­øûïRÕPVï­üPx	PPÈHPï­øQ Ý­øûïAÕP=x	­øPȈPï­üQÈQPÐï mQÈPaSÝ­üûïüÕPœÝ­üûïîÕPµÝ­üûïöÕPÝ­øûïÒÕPx	­üPȈPƒÝÝ
ûï¯ØÿÿÂ^Þïkˆ[Ы­üÑ	Ýûï‹Øÿÿ‘k	Ý
ûï}ØÿÿѬÝ­üûï‡ÕPլݭüûï^ÕP	ÝûïMØÿÿï­üPȬPÐïÕlQÐPaÂ^Þïõ‡[Þïþ‡ZÑï'ˆ	ÝûïØÿÿ‘k‘j		Ý
ûïØÿÿЫ­üÝ­üûïõÕP	Ýûïä×ÿÿï­üPȬPÐïllQÐPaÝÝZûïU8Þ[Þï‡ZÐïFlPЬ`Ñ難	Ýûï—×ÿÿ‘k	XÝZûï]ÕP‘jFÝÝ[ûï8ÝÝZ,Ý[ûï:ÕP‘k(ÐïïkPâ
`ÝÝZûï×7ÝÝ[ûï‘j	ÆÝ
ûï,×ÿÿÂ^Þïç†[Þïð†ZЫ­üЪ­øÐïŸkPЬ`Ñï‡	ÝûïðÖÿÿ‘k1¤Ý­üûïøÕPï‘j˜ª~ûïÎÕP	Ý
ûï½Öÿÿx	­üPÈ€PïªQÈQPÐï:kQÈPaÝÝZKÝ­øûï¨ÕPK‘k˜«~ûï~ÕP	Ý
ûïmÖÿÿx	­øPâPï«QÈQPÐïíjQÈPaÝÝ[ûïÖ6‘j§Ý
ûï6ÖÿÿÂ^Þïñ…[Þïú…ZЪ­üÑ«
Ñ«€ÿÿÿ	ÝûïÿÕÿÿï­üPx	PPȬPš«QÈQPÐï|jQÐPaÑïâ…	ÝûïÎÕÿÿ‘k	‘jÝ­üûïÔÕP	Ý
ûï­ÕÿÿÞïl…[Ðï5jPЬ`Ñïš…	Ýûï†Õÿÿ‘k		Ý
ûïxÕÿÿÝÝ[ûïý5Þï,…[Ñïe…	ÝûïQÕÿÿ‘k		Ý
ûïCÕÿÿï«PȬPÐïËiQÐPaÂ^Ь[Ы­ü˜kPÏP	5„§ÀÙ'rŽßï?‚ßï•iûïÂÔÿÿÐï‚iPÈ«`Ý­üûïÞÕPæÝ­üûïæÕPØÝ­üûïÕPÝ­üûïÕPÐï>iPÈ<`»Ýûï—Ôÿÿ°Ý­üûïÕPçï«PÈPÐïiQÈPaÝ­üûïlÕPÄï«PÈPÛÝ­üûïSÕP«ï­üPÈ P˜«~ûï9ÕP!ï«PÈ(PÐïºhQÈPaÝÝ[ûï£41+ÿ˜«~ûïEÕP1^ÿÐïhPÈ:`Ô˜«~ûïëÕPï«PÈ0PÐïlhQÈPaÝ[ûïY§˜«~ûïúÕP1ÿÐïEhPÈ;`×Ðï9hPÈ8`1|ÿÐï,hPÈ9`Ý1oÿÐïhPÈ<`ѬÐPÐPÝP1RÿÂ^Ь[Ô­üÝ«ûï\ÕPÝ«ûïdÕPx«­ü	Ýûï5Óÿÿ‘«â­üÑ«€ÿÿÿÑ«€
š«PÈP­ü	ÝûïÓÿÿЭü«ѬѬÐPÔPÕ¬ѬÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPЬ[˜kPÑPÝ«ûï|ÿÿÿÕPÔPÐPЬ[˜kPÑPÑP˜«~ûïŽÿÿÿÕPÔPÐPЬ[˜kPÑPÔPÐPЬ[˜kPÏPÐPÔPÂ^Ь[Ы­ü‘k Ý­üûï9ÿÿÿÕPÝ­üûï;ÿÿÿÕPÐPÔPЬ[ЬZ‘kÕZÝ«ûï·þÿÿÕPÔPÐPÔ[ÔKïƒò [õÂ(^Ñï9[•ï÷gÝûï	ûïÌß­àûï›(ÕP
Ð(ï@1=ÝûïdNÐPZß­àûï
:ÐPªß­àûïY+ÐP­ÜxPPÐàø¶ªÔªÐjÔªЭÜPÐZ@ïƒÐZïÔï§ÔYÔ­ØÑ­Ø1«ûïÈ(Þï(~PÐï©~Q‘A`,Öïœ~ûï§(Þï~PÐïˆ~Q‘A`?ЭØPÈ@ïšeªÖïn~ß­àûïÐ'ÕPNÁYµPЭØQÐPAïè€Þ­à[ÑYOkIï€Ö[ÖY•kç”Iïr€ÖYÑYPYÝ ûï¸ÐÿÿЭØïæ€ÔjÞïz}PÐïû}Q˜A`~ûï[(ÕPÐ!ï~Ýïú}ûïÐÿÿÝûï–ÝÝZûïÖ­Ø1öþÂ0^ÝûïúLЬQÐP¡С­ÜÔ­Ø”ïüdûï*ß­àûïó&ÕP+ßïieß­àûï*ÕPßï\eß­àûïï)ÕP&Ö­ØÔïR}ѬxÝ­Üßï»|ûïLÐP­Ü1»ßï(eß­àûïµ)ÕPßïeß­àûï¡)ÕPµ×­Ø°ÝûïÇÑ­ÔÝ­ÜßïôdûïøÐP­ÜÑ­Ð1ЭÔXЭÐЭЭÔß­àûïÓÐP­ÐÑP¾Ý­Üß­àûï=)Ñ­ÐÐ"ï¼|Ýï¶|ûïËÎÿÿÝ­Üß­àûï”ÐP­ÜѭЦÝûï91ÖþÂ$^Ô­üÖ­üûïX)Ýûïß­Üûï³%ßïHdß­ÜûïÇ(ÕPÏßï;dß­Üûï³(ÕP»ßï-dß­ÜûïŸ(ÕPßïdß­Üûï‹(ÕP–×­ü‘Ь[ЬZÔYÖY•Iï=cõÑYƒjIï(cÖZÖY•jç”Iïcݬûï•(‘`
0ßïcûï›6ÐP«”ïóbÝûïÒJÐPkÐkPÔ Ô»ÐkPÐ[PÂ^ݬûï?ÐP­øÑP	ÑPï/~ÝßïicûïJÍÿÿÁ€­øPöP­þ”­ÿݬß­þûï5ÿÿÿЬ[ÔZÝJï¯}Ý[ûïš'ÕPÁZPÖZÑZïÔ}ÜÔPÂ^Ь[Þï[zPÐïÜzQA`­ÿÔZ‘­ÿ ‘­ÿ	"­ÿJkÖï½zÐï·zP@ï'z­ÿÖZÑZÒÕZ”JkÔPÝ[ûïÿ#ÕPÝ[ûïbÿÿÿÕPÐPÐP‘­ÿ
‘­ÿÖïhz­ÿk”«ÐP‘­ÿ'ÖïQz­ÿk”«ÐP‘­ÿ ‘­ÿ~
Öï3zÐP­ÿk”«Öï"zž®À^Ðïz­üß­Ìûït#ÕP+ß­ÌûïÎÐP­ÄÑïÒU>•ï‘b*1ЭüïÙyÐPÝûïrÌÿÿÑ­ìP	Ý ûïñËÿÿÝûïxÔPÑïÇ`ÏÝœûïãHÖï±`Ðï«`QÐPAï"}ÐAï}[ЭÄkЭÄPРË”Ð˘ԭìÔ­øÑ­øÑ­ìP…Á[PÀ­ìPЭøQÐPA«Tûïy#Þï«xPÐï,yQA`­Ë˜­ËPÑP<5ÑP\1ŠÑP^1úÖïÿxÐïùxP@ïix­É­É­Êö<­Éö>­Ê̘߭­Ê~˜­É~ûïX#ÕPÝ!ûïùÊÿÿ1òþÔ­ðÞ­ÌPЭðQ•A`Ñ­ìPÐPÔPЭìQÖ­ìöPA«1âÖ­ðÌÖïxß­Ìûïã!ÕPcß­Ìûïµ1ÐP­Àá ß­ÌЭÀPÝ ûïÙ	Ýûï|ÊÿÿÔ­ðÞ­ÌPЭðQ•A`Ñ­ìPÐPÔPЭìQÖ­ìöPA«kÖ­ðÏÝ1Cÿ‘­Ë M‘­Ë,G‘­Ë	A˜­Ë~ûïZ"ÕP2Ñ­ìO(Á[PЭìQ­ËA`Ö­ìÖïÊwÐïÄwP@ï4w­Ë­Á[PЭìQ”A`Ö­ìÖ­ø1CþÂ8^Õï¹^”ï­^˜ï§^Pöïž^Ðïœ^PÐ@ï{­ôЭôPÐÀ”­ðÕ½ð=ЭôP×À˜нôPЭôQРÁ”Ðïa^PÝ@ïÙzûïêG×ïL^ûïÿÿÿЭðPР­ìÔ[ÔZ
ö­øJï„vÖZÖ[•K½ì1¨ÑZƒô˜K½ìPšP­øÑ­ø€Îíø­üЭüPÁT­ôQxPPÀPQÐa­è•½èAнôPx­üQÒQQËQ P.ß­ÈÐïˆ^PÖï^ÝPûïß­ÈßïÒ^ûï„"Þ­È­èÔY•I½è1fÿÑZƒôI½èJïÕuÖZÖYÞ”JïÈuûï#%ЭôPÐPQÐДÁ”ÐPÂ^ÝûïðÑïR1ûïqÕP1ˆÐïpu­ô~ÝûïGEÐP­øÔ ЭøPÔ ЭøPÔ нøЭøPÔ ÝÝ­øûïøÿÿÝœûïEÖïÜ\ÐïÖ\QÐPAïMyÐAïFy­üЭø½üЭøPЭüQРÁ”ЭüPЭôÀ˜ûïGûï
ùÿÿÂ^Ь[שּׂôÐZÇ­ôPxPPÃP­ôPÀ0PöPJ­ù×ZÇ­ôPÐP­ôÕP	ÙÖZJ­ù‹ÑZô”kÂ^ݬûïy!xPPÐàø¶­ü#ЭüPÝ ݬûïŽ!ÕPЭüPЭüPР­üÕ­üØÔPÂ^ûïêÐïÒt­øÔ­üÞï?tPÐïÀtQ˜A`~ûï ÕP!ЬPÀ¬ÝPûïûÖ­üûï§Ñ­üÂЭøï‡tЭüPÞïê\[‘¬kÐPÖ[•kðÔPÂ,^ûïjÞïÊsPÐïKtQ˜A`~ûï«ÕPÔPÐZÔ­øÐï,t­ôUÕ­ø×­øE‘­ÿ<‘­ÿ{ß­Ô˜­ÿPÁP~˜­ÿ~ûï…&‘­ÿ'Эø‘­ÿ"Эø‘­ÿ,ÖZÖïÓsÞïEsPÐïÆsQA`­ÿ˜­ÿ~ûï!ÕP‰Ð­ôï©sÐZPÂ^ЬPÔ ЬQР¡ЬPö¡ ЬQ ¡¡¼ÞïêrPÐïksQ‘A`#GÖï^sݬûïÇÿÿÕP‘¼	ÝûïxÅÿÿö	¼ûïG1–1ÖÑP1ÄÑP
ݬûïÓÆÿÿÕPÓ×ïsÞïyrPÐïúrQ˜A`PÖïïrÑPL!ÑPWÑPlÑPwö¼)ö¼#‘¼ö¼cÑP+1uÿ‘¼ö¼Ðï–rPÖïr@ïr­ÿ]˜­ÿPÑP-Ê‘¼ö¼Òݬûï>ÕPÄÑP(ì19ÿÑP,1Gÿ1.ÿÑP@…ÑP:12ÿ1ÿÑP|1ÿ1	ÿЬ[‘kBö««Ý[ûïÍÅÿÿÕP0ûïÞïtqPÐïõqQ˜A`PÖïêqÑP)ökÐPÑP,ÔPЫ«Ý[ûïˆÅÿÿÕPë‘kæÐï¹qPÖï²q‘@ï#q:ÏÞïqPÐï›qQ˜A`PÖïqÑPL!ÑPWÑPlÑPw“ˆ«ˆ«ûïmÐïUqPÖïNq‘@ï¿p)1hÿök1YÿÂ^ÕïMÕïýGûï ÄÿÿÑïùL1×ÿÉrÐïÁrPРQÖ öïqaÝïªrÝïqûï%=×ÿ—r#•ïëWÐ*PÐ PÐïrQСRÖ¡öPbÝïlr•ïÂWÐ*PÐ PÝPûïÛ<ÝïMrßïÿoûïl/•ï9LÕïIGûïìÃÿÿ•ïY	•ïqpÕï(G•ïðX•ï\W	•ïåX•ïKWÐ*PÐ PÝPÝïekßïÇXÝïùpûï./ѬÅï¡XPÁP~IÝÝï’XÝïˆXïïPo~ûï¦ÝûïaÝxïjX~Ýï_Xïï'o~ûï}Ýûï8Õ¬^•ïDXVÔ[Ñ[eÇïƒqPÑ[Pxï"XPÁP~)ÝxïX~ÝïXx[PÀï-VPï`~ûïÝûïÙÖ[¬xïàWPÀPÅP~ûï¿Ýûï¶ÕïöEÝÝÝ
ÝïèEûï×	Ýûï×ÿàoÐïØoPРQÖ ïÂEaÝïÁo˜ï³E~ûï;ÝûïTÝï¤oßï.nûï›-ßï!nû`-×ÿoÐïwoPРQÖ ö
a˜aPÝïaoÝ
ûï¸:Ь[ÔZ,×ÿFoÐï>oPРQÖ ö aÝï+oÝ ûï‚:ÖZÑZ[ÏÂ^Ð[שּׁǬ¬PĬPÃP¬ZÕ¬À¬ZÑZ
Á0ZPÁ7ZPöPK­ðǬ¬PÐP¬×[׬ÕPÕ¬Õ[¶Ð PöPK­ð×[׬Õ¬!Õ[Õ¬åÐ0PãÐï›nPРQÖ K­ðaò[×ÿƒnàÝï{n˜K­ð~ûïÏ9ßÂ$^Ñï]I
Ýûï5üÿÿ•ïV	Ýûï#üÿÿ”­ß1
ß­àûïûö­ßßïúUß­àûïÇÕP¬ïÔU1¿ßïßUß­àûï¨ÕP¬ï¶U1 ßïÄUß­àûï‰ÕP¬ï˜U1ßï¨Uß­àûïjÕP
¬ïzUcßïUß­àûïLÕP
¬ï]UEßïrUß­àûï.ÕP
¬ï@U'ßïXUß­àûïÕP
¬ï#U	Ý%ûï¿ÿÿûïtÞïÔkPÐïUlQ‘A`,ÖïHlß­àûïªÕP1âþ•­ß¬ïÒTÂ^ïéG­ïÞ­÷[Ðïl­ðÝ[ûïrÕP3Ý[ûï©‘k.ßïæTÝ[ûïuÕPEûï1“ЭðïÏkÐPéï5k	Ý+ûïó½ÿÿÝûïÒléïk	Ý+ûïؽÿÿÝã•ï®k1sßïˆTÝ[ûïÕP³ßï{TÝ[ûïÿÕP»ßïnTÝ[ûïìÕPÝ›ûïíëÿÿûïõÿÿÔPßïJTÝ[ûïÂÕPÚßï>TÝ[ûï¯ÕPÐßï1TÝ[ûïœÕPÝÝûßïTÝ[ûïzÕPâßï
TÝ[ûïgÕPÝÝÝûïZ1{ÿßïéSÝ[ûï@ÕPÝßïÜSÝ[ûï-ÕPÎßïÏSÝ[ûïÕPÝÝûïõüÿÿ12ÿßï²SÝ[ûï÷ÕPáßï¦SÝ[ûïäÕP
ûï;1ÿßïSÝ[ûïÇÕP!Ýï-dÝï)dûïÂÝûïÝøÿÿ1ÎþßïbSÝ[ûï“ÕPÔßïUSÝ[ûï€ÕPÝïîc¿ßï?SÝ[ûïeÕP
ûïò1ƒþßï)SÝ[ûïHÕP
ûï1fþßïSÝ[ûï+ÕP
ûï|1IþßïüRÝ[ûïÕP ÝTÝPÝEûï_1þßïÐRÝ[ûïÛÕPÕßïÅRÝ[ûïÈÕPÊßï¹RÝ[ûïµÕP
ûï
1Óýßï¢RÝ[ûï˜ÕP
ûï‡1¶ýßïŒRÝ[ûï{ÕP1
ýûïÍ1–ýÝûï—÷ÿÿ‘ï•DÝïÀhßïXRûï·*Ñï‘D:ûï}»ÿÿ•ïiD
ßï5jûïÊ7•ïPDûïiûïxöï¥=Ýï*jûïY6ßïRßï÷iûï¨'ÐPï	j0ßïáißïòQûï<ºÿÿÐïDPÝ@ïtiûï6×ï÷CÕïñCÝÝïÉiûï¤Æÿÿûï—óÿÿÕP#ßïQgûïFôÿÿÕPÐïHgï«löïÈPûï×ÞïRZÔ[ݪÝZûïÀPªÖ[ÀZÑ[ïžaâÐïžaPÁ PËPï˜gÐïŽaPÁ PËPïˆgÐï~aPÁ PËPïxgûïk$ûïðûï‹ûï.Õï>Ýï
>ßïQûï5¹ÿÿûïÊ%ûïÔï^bÔïà=ÔïÞ=Ôïà=ÖïâBÑïÜBÔ[Ñ[ïä`>Å[PÔà0Ö[éÐïÖ`PÔ ÐïÐ`PÐïÍf ÁïÉfïÀfPÐï¹`QÐP¡ÐïºfïkßïóPûï8	‘ïZBÝïiBßïtPûï|( ^ß­àûïÓÕPPß­àûï¥ÐP[ûïaÞïÁePÐïBfQ‘A`,Öï5fßïeûï„òÿÿÕPÕï‚eÝ
ûïK¸ÿÿÝûïÒôÿÿÐïke«Ô«Ð#«‡ÔZÔ[Ñ[ïÏj2ÐKïÊjYÑKïÂjïéePÕZ7ßï)eûïòÿÿÕP$Ð
ïÓeÝûïvôÿÿÐïePÑ ïš_ÜÖZÕïödãÐïòdïõdnÐZPÖZÕPßïÔdûïÉñÿÿÕP²ÐïËd©Õï¿d
Ðï·dPРPÔPÐP©á©Ýûïp·ÿÿ!Õï”dÐïŒdPË PÐPÐP©Ö[1ÿéïxdÖïqd”ïKdÝßïCdûïÈÝûï«óÿÿÂ^Ь[Þï!d­øÑ[ÐPÐPÐPï×NûïPðÿÿÐP­üÔZ1ßïdûïúðÿÿ‘ïøc
Ôïócö
ïècÔïêcÝ
ûﱶÿÿ9ÕïÕc1Å[ZPÁïÕcP~Ñ[ÔP
Ñ[ÐPÐPÝPßï¥cûïbÑ[xðï™cPЭøQÐPaЭøPÐï‡c ЭøPÐïyc`Ñ[Ý[Ý­øûïÛÝ[Ý­øûïWÑïÏ?;•ï¢?3Ñ[Ýxðï9c~ûï¯Ýïï'c~ÝÝïcûï“ÖZÑZ­ü1÷þÑï€?ÝûïXòÿÿ$•ïH?
ÝÝûïaÕïK:ûïî¶ÿÿÅ[­üPÐPïbcÂ^ûïb
ÞïÂbPÐïCcQA`­ÿ˜­ÿ~ûïž
ÕP
ÝûïíñÿÿÖïcÐï3MÐï-MïeÔZ#Ð[P˜­ÿQÑPQ?ûï½ÿÿÐP[3Ý[ûï“ÖZÞïWbPÐïØbQ˜A`[Ý[ûï6
ÕP¾Ñ[|µÐ[P˜­ÿQÑPQ	Ýûïà´ÿÿÕ¬Õ[ÝûïBÖZÑïr>ÝûïJñÿÿ$•ï:>
ÝÝûïSÕï=9ûïàµÿÿÐZïYbЬ[ö[ï—aÝßïaûïÑï>•ïé=ÝÝ[ûï•ïºJÕ¬Åï LïLPÑP1K•ïLs•ïIÐ*PÐ PÝPÝï]ßïðKÝï²bûïç ÝÝï_JÝïUJïïa~ûïsóÿÿÝûï.óÿÿÝxï7J~Ýï,JÝïö`ûïMóÿÿÝÅïJPÁP~ûïúòÿÿ•ïzK	•ïJÔ[1ªÝÅïîIïaK~ÝïÞIÝKïGfûïþòÿÿ×ÿbÐï
bPРQÖ KïSfaÝïòa˜KïCf~ûïC-ÑïK,×ÿÔaÐïÌaPРQÖ ö a-Ýï¹aÝ ûï-ÑïÜJßïàJÝï™aûïÎÖ[Ñ[ïµJ1JÿÅï²Jï¥J[Áï+I~ûïòÿÿÖ[Ñ[êÝûïòÿÿÕïA7ÝÝÝ
Ýï37ûï"òÿÿ	ÝûïÛñÿÿ×ÿ+aÐï#aPРQÖ ï
7aÝïa˜ïþ6~ûï^,ÝûïŸñÿÿ•ïJ!–ïJßïq_ßï!JÝïÕ`ûï
-×ÿÆ`Ðï¾`PРQÖ ö
a˜aPÝï¨`Ý
ûïÿ+ÔïÅIÔïƒ6Õ¬,Ðï´IPЬ@ï¦dÞïÐdPÐïIQïÎdA`ÖïŽIÕ¬”ï‡IÔï…IÂ^Ь[Ô­üßï¶^ûï«ëÿÿÕPÕï©^Ðï¥^Z
Å[Zï6_ÐïE_Ýï?_ûïT±ÿÿÔYÝ[ß­üûïèÖYÑYZíÝûïÄíÿÿÂ$^”­Þ­Þ­ßß­àûïOÐPZ)ÞïP^PÐïÑ^Q˜A`~ûï1	ÕPÝûïð°ÿÿ1&ÕZ
ÞïI[1ÔZß­àÅZPÝà(ûïÕPÖZÑZïzXÝÅZPž@ïÍH[ÑZïeX)ö­ßÖïYXß­àûïYÐPkÔ«Ы«Ы«Ы«ûïMÞï­]PÐï.^Q‘A`,Öï!^ß­àûïƒÕP#Þï…]PÐï^Q˜A`~ûïfÕPPö­ÞJß­àûï–
ßïLXß­àûïf
ÕPS•­ßHà«Cö­ÞûïÏÞï/]PÐï°]Q‘A`,1kÿ•­Þ	Ýûï>°ÿÿÝ[ûï3ÝûïNìÿÿÈ«»ßïéWß­àûïÿ	ÕP£•­ß髚ȫ˜Ь[Ð[ïKWЫï·\ÐïU]PÐ[ ÝkûïÐPZÈCªÐïWªÔªÐZïöaÂ$^ß­àûïqÕP1¹ß­àûï¤	”­ß”­Þßï\Wß­àûïn	ÕP”­ÞßïGWß­àûïU	ÕPö­Þö­ß”­Ýûï¿Þï\PÐï \Q‘A`,Öï“\•­ßß­àûïðÕP>Ô[Ñ[/ß­àÅ[PÝàܬûïõÕPOÅ[PÐàà¬Z•­Þ'ÐZïŠ7Ñ[–­Ý•­Ý	Ý
ûïl®ÿÿÝûïóêÿÿÐZïÃDÅ[PÐàä¬ï¸DÈÖ[Â0^”­×Ñïä7+Ýö­×•­×Ðï\Ýïÿ[ûï®ÿÿÝûï›êÿÿûïÝÞï=[PÐï¾[QA`­Þ˜­Þ~ûïÕP°Öï£[Ô­Ð,‘­ÿ­Þ2Ñ­Ð,˜­ÿ~ûïòÕPÞ­ßPЭÐQ­ÿA`Ö­ÐûïõµÿÿöP­ÿÇ‘­ÿ­ÞÐïs[Ýïm[ûï‚­ÿÿ1RÿÞ­ßPЭÐQ”A`Öï6[ßï«Uß­ßûï~ÐP­Ø1$ÿÝPûﶹÿÿ1ÿ×ïPVÑïæ6
Ýûï¾éÿÿÕï¯6ßïdUÝïÉ[ûïþÂ$^ûïÞÑïª61—Þï2ZPÐï³ZQ‘A`,Öï¦Zûï±ß­àûïÕP(ÞïZPÐï„ZQ˜A`~ûïäÕPKÝûÿÿ@ß­àûï«ÐP­ÜÔ ЭÜPÈ ûï[Þï»YPÐï<ZQ˜A`~ûïœÕP1iÿÝûïèèÿÿÂ4^ûï$Ñïð51åÞïxYPÐïùYQ‘A`,ÖïìYûï÷ß­àûïGÕP)ÞïIYPÐïÊYQ˜A`~ûï*ÕP±Ýûïé«ÿÿ1ß­àûïðÐP­ÌÔ ЭÌPÈ… ûïœÐï„YPÖï}Y‘@ïîX,	Ý
ûÿÿß­Ðûï ­ÿÿ‘­Ð	ÝûÿÿЭÌPЭؠûïSÞï³XPÐï4YQ˜A`~ûï”ÕP1ÿÝûïàçÿÿÂ4^•ïÓ4ßïÚSßï,Zß­àûïÌßïÉSß­àûï:ÐP­Ìß­àßï²SûïÐÔ­ÜЭÜPÐ@ï
^ZtЪ[Óp[dݪßïŸSÝ­Ìûï¾ݪßï”SÝ­Ìûï«á[˜EPÐ PÝPá[Ð P˜UPÝPßïiSÝ­Ìûï}ßï_SÝ­ÌûïmÐjZÕZˆÖ­ÜÑ­Ü 1nÿÝ­Ìûï"&Ýß­àßïBSß­àßï4Sßï Sß­ÐûïìÝûïã)žÎLÿ^ÑïÕ31LûïöÐïÞWPÖï×W‘@ïHW"Ýûïü©ÿÿ1"Ô­ÔÑ­Ô„IÞï&WPÐï§WQ‘A`
ÓÞïWPÐï“WQ‘A`¿ûï²ÿÿöP­ÓÖP°‘­Ó"rÞÍOÿPЭÔQ”A`Ô­ÔÑ­Ô
qÞïÔVPÐïUWQ˜A`~ûïµÕPTûïPÞï°VPÐï1WQ‘A`,Öï$Wßï~VûïsãÿÿЭÔPÐïuV@­ØÖ­ÔÞÍOÿPЭÔQ­ÓA`Ö­Ô13ÿ‘¬E	Ýûï©ÿÿÝ­üÝ­øÝ­ôÝ­ðÝ­ìÝ­èÝ­äÝ­àÝ­ÜÝ­ØßÍOÿ‘¬T	Þï:TPÐï‘WPÝPûïÃÝûï^åÿÿÂ^Ь[ÖïƒVÞïõUPÐïvVQA`­ÿ‘­ÿ á‘­ÿ	ÛÔZÞïÔUPÐïUVQA`­ÿ‘­ÿ0‘­ÿ9/‘­ÿa‘­ÿz!‘­ÿA‘­ÿZ‘­ÿ_‘­ÿ.‘­ÿ$ÑZ Ýûï>¨ÿÿ×Z”JkÐZP­ÿJkÖïòUÖZŒÂ^ÖïáUÞïSUPÐïÔUQA`­ÿ‘­ÿ á‘­ÿ	ÛûïÉÿÿÿÞï)UPÐïªUQ‘A`,ÖïUûï¨ÿÿÿÞïÐP[‘¬kÐPÖ[•kðÔPÂ^ÞïãTPÐïdUQA`­ÿ‘­ÿ¬ÔPÔ[Эø˜­ÿ~ûï¯ÿÿÿÕPèÖï9UÐï3UP@ï£TK¼K¼­ÿ‘­ÿ¬õ­øÖïU”K¼Ð[P‘­ÿ¬Ö­øÖ[Ñ[ ªŸÂ^Ь[ûïøþÿÿÞïXTPÐïÙTQA`­ÿ‘­ÿ("Ý[Ý)Ý(Ý[Ý>Ý<
Ý[˜­ÿ~˜­ÿ~ûï6ÿÿÿ‘­ÿ<à‘­ÿ"â‘­ÿ^1Öï’TÐïŒTP@ïüS­ÿ˜­ÿ~ûïãþÿÿÕP¶ÝûÿÿÔPÔZ1‘­ÿ	1˜­ÿ~ûï¾þÿÿÕP"­ÿ‹ÖïDTÐï>TP@ï®S­ÿÖZ‘­ÿ É”kÐZPЬ[ЬZÖ[ÖZjk÷ЬZÖ[ÖZjk÷ЬPÔ[Ö[•K¼øÔZÑ[J¼K¼Ö[ÖZ•J¼ê”K¼ЬPÔ[Ö[•K¼øÐ[P”¼ݬݬûïªÿÿÿЬ[ÔZÔYéYÐPÐP˜IkQxPQPÀPZÖY•IkãÅZZPï
PPЬ[ЬZ•kÐPÖ[ÖZ‘kjïÔPЬ[‘kA	‘kZˆ kÖ[•këЬ[‘¬kÐPÖ[•kðÔPЬ[Ö[•kú×[Ð[PÂ^ïÃ.­ÿ‘­ÿ
ßï5NûïæûïµÕïõ9ûï(ÛÿÿÕP1¿ÐïŸ.PÐ@ïT­ø×½ø>Ý­øûïv@Ñ­øï\T1ØÕ[	Ý[ûï¤ÿÿ×½ø1€Ð­øPРQÖ šaPzЭøPРQÖ šaPÐP[ÖP¹Ðï7.PÝ@ïŸSûï> Õï&.ûïïêÿÿ×ï.1iÿÝûï]¤ÿÿßï…MßïyMßï‹QûïæýÿÿÖïNMÐPÝ­øûïÈÐP[Ñ[*	öï9”ïý8×½øЭøPРQÖ šaP
Ý­øûï’ÐP[ÔZ6Ñ[CÑZ„:×½øЭøPРQÖ šaP
Ý­øûï^ÐP[ÖPÖZö[JïõP‘JïîP
¸”JïåPÑZ„ö
JïÓPÝûïø£ÿÿÖï”L‘­ÿ1=ÿßïµPÝïLßï˜Lûï.1!ÿÔïQÔïüUÔïê'Ôï(Qö ïå'ö ïJV”ïÈVÔïöPÔïäRÔïNPÐïHPPöPï8PÔï6P”ï.PßïPLßï‚RûïÐPï€Vßï6LßïfRûïïÐPïhVßïPRßïLûÿÿßï'LßïŸQßïYVûï<üÿÿßïLßïFVûï§ÐPï$Vßï0VßïõKûï;¢ÿÿßïLßïWQßï1VûïôûÿÿßïôKßïVûï_ÐPïàUßïVßïÔKûïó¡ÿÿ2ïŠTÐïäOïƒTÐïÝOï|TÐïÖOïuTÝÁ ïdTPÁïaTP~Ýï}Uûï*ÝïpUûïE
ÐPïFTÐïlUï?TÐïeUï8T•ïf8	Ðï:TPÔPÐPï"TÝÝÝï(UûïÕÝïUÝÝ ßïåSûï´ÝÝ ÝïUûï­ÝÁ ïÈS~ÝïíTûï–ÔïìTÔïêTÂ^Ðï±S­üÐïÑTï¤SÐïÊTïSÝï³TûïÆÝïªTûï¹ßï½Jßï§TûïÐP[ßï•Tßï¡Jûï  ÿÿßïºJßïœTûïÝ
ÐPZßïŠTßïžJûïu ÿÿÐï;TYÝÁ ï	SPÀïSPÁïSP~ÝYûïÌÔ­øP×i%×kЫPÖ«š`P	Ý[ûïòЩQÖ©öPa$ÝY×kЫPÖ«š`P	Ý[ûïËÝPûï:Ö­øÑ­øïËS¦Ô­øP×i%×jЪPÖªš`P	ÝZûï“ЩQÖ©öPa$ÝY×jЪPÖªš`P	ÝZûïlÝPûïÛÖ­øÑ­øïpS¦ÝÝÝYûïÝYÝÝ ßïRûïäÝ[ûïSßïGSûïŒÝZûï=ßïQSûïvÂ^Ь[˜ï!OPxÿPZЫY˜PPÁï„LP~ݬÝ[ûï*Ы­üЬPÑP@ÑP#ÑPxð­üPxZQÀï­3QÐPaÖZ€ïÈNxZPÀï–3PЭü`€ï²NÊÐï‚3­ø˜ï¢NPö­ü@½ø–ï•N­ž®˜^Ь[Þ­›ZÔYÐYXHkI­›ÖXÖYHkI­›ÖXÖYÀXÑY¬ãxÿ¬Yé¬"ݬßï¥HûïVžÿÿj­ÿªjÖZ­ÿjÖZÐYP×YÕPçݬß­›ûïЬ[Ñïü'Ñï
Fï	FÝïÕQÝݬÝ[ûïqÝïÄQéÑïàEïãEëÂ^ЬPÕ ÑïÃEïÂEIÝï–Qݬݬݬß­øûï?ÀPï„Q&ÝïxQÃïšK¬~ݬݬß­øûïÀPï`QÑïmEïpEÌÂ^Ь[ЬPРYЩZÑï1'r´«à©á©ðk÷©«9ÑZï*Eðk)ÑZïEðkÑZïEðk	Ýûï0ÿÿЬ«ð¬kðkݬÝÝÝ[ûïV
ÐPЬPá Ý(ûïÐP[ÖP
ßï*GûﳜÿÿÐïJ«Ðï™D«ЬPР«ЬPР«Ь«Ь« ά«Ь«$ЬPР«ÞïÚFZ
ÐjPÑ« ÐjZÕjïÐjkÐ[jЫPÝûï‡ÐP[ÖP
ßï¼Fûï/œÿÿЬ«Ь«Ь«Á\Z
ÐjPѬ ÐjZÕjïÐjkÐ[jÐjPÂ^Ðï_F[ЫZÑ«ªáª	ЫPÀ «Ðk[Õ[àÔ­üÐï3F[5Ý[ûïÑëPYÝYÝ[ûï%ЭüÕY
ßï@Fûï’›ÿÿÐk[Õ[ÇÕ­ü¶Â^Ь[ЬPÀ[ ЬPÝ Ý ûïºÐ¬QÀ¡PÐP­üÐï¼EZ]ÑZ¬TЬPЪQÑ ¡EÕªÁª ªPÑP­ü
Ñ­üª Â[ªÕªѪ ­üÁª ªPÑ­üPÀ[ªѪ ­üÀ[ª ÐjZÕZŸЬ[ЫPá ЫPÑ« ЫPЫ$ZѪ«Ñ«ªЪPÐjZÕZæÙЬ[ÐïEZÔYÑ[ªѬªЪ$PàªPÀPYÐjZÕZßÐYPÐïÖD[ÐkZÝ«$ûïÝ[ûïÐZ[Õ[ãÔï°DЬ[ÐkZÝ[ûïÞÐZ[Õ[íÁ\~ݬݬûïÂ^ÝûïÓ	ÐPZÝûïÇ	ÐPYÕZÑZÝZûï²	ÐPZÑPïÕYÑYÝYûï˜	ÐPYÑPïÝûï*Ýûï!ß­øûïƒ	ÐP[1Ý­øûïb	ЬQÐP¡Ýûïôß­øûïV	ÐP[cЬPЭü ÝݬûïœÐP[Iûï ÐP[ÖP;ЬPÐ[`0Ð[Ð[PÖ[ÝPûï£Ñ[íݬݬûï½
Ýï?MûïXÔ[ÝûïyÝûïpÝßïÌCûï‘ÝYûïµÝYûïOÝûïFÝZûïšÝZûï4Ð[PÂ$^Ь[
ßïŸCû落ÿÿßï¨CÝ[ûïéÕP
ßï—Cûÿÿ‘ïB"	Ý[ßïŠCûïhÝ[ûïEóÿÿÐP­Ü‘`$”½ÜÐï)KPÝ Ý[ß­àûïòÿÿÞ­à[Ý[ûïˆòÿÿÐPYxPPÐà ¸Z-Ý[ݪûï òÿÿÕP‘ïÒ!	
ßï2CûïúÐZPÐjZÕZÏûï6ÐPZÝ[ûïÚÐPªÔªÔªÔªÔªÐIïKjÐZIïKÐIïKPÐïž^[SÝÀûïâÐPZÝßïÅBûÿÿÖïhB‘ïB!ÝïYBßï¼BûïdÝZûïÐPïH^ÐÿB^ï=^ Ð[PÔZšÇ[Å[PÀ¬PÐZ`Å[PÁ¬PZ×[Õ[æÐZPßïFKûïÉÿÿÿÐPïø]Â^ÁïçAïÞA­üЬ[!ÐïÔAPÖïÍAÐïÃAQk@aЭüPÖ[Ñï³AÒÝûï÷ÐPï”AÔï’AÖïAݬûïÿÿÿÂ(^ÐïD­ü”­Û”­Ú˜­ÚïUI1–­Û”­ÙûïsîÿÿÞïÓCPÐïTDQA`­Ø‘­Ø:	‘­Ø=1ÕïI‘­Ø:ÐPÐPöP­Ú–­ÛÖïD‘­Ü0/‘­Ü9)ß­Üûïððÿÿ‘`$ÐPÔPöP­Ù
Ýûï#–ÿÿÐPß­Üûï)ýÿÿÐP[Ñï¸0‘­Ú*á«ÐïÛCÈ«•­Ùâ«Ðï§=«ÐïC«•­Ù
‘­ÚÐ[ïoHá«	Ýûï'–ÿÿÑï_H
ÐïVHPÐ[@ïQHÖïGH	Ýûïþ•ÿÿÐïRC­üß­Üûï²ìÿÿÕP1Ñþ•­Û)Þï¬BPÐï-CQ˜A`~ûïíÿÿÕPÝûïÜÑÿÿÔPЭüï	C‘­Ú1ÿûïÝÿÿãÂ^Ô­üÞï8H[1†ÐkZz|•ï¯
ӪȪԪݪݪûïúÿÿÀPªѪï³<
Àï¯BªѪï£<ÁïŸBï–BPÀPªÑZï–B
ÓpªÎªЭüªÖ­üÐjZÕZ„À[Ñ[ ¸1nÿÂ^Ô­üÞï’G[1ÐÐkZ1¾1ÂѪÿÿÿÿ1«àª”­ô4Ѫï<ö­ô$Ѫï<ö­ôѪïü;ö­ôö­ô᪈ ­ôЪ­øЪYÝYûïaöP­õݬÝÝß­ôûï6ÝYßï"?ݬûïÊ×¼ЬPРQÖ ”aݬÝûïÎ
˜­õPÀ	PÀP­üÐjZÕZ1>ÿÀ[Ñ[ ¸1$ÿЭüPÞï¤F[ÐkZâªÐjZÕZôÀ[Ñ[ ¸ãÔP¼ï(éQÔPЬ[ЬZ!×jЪPÖªöX`˜`PÝZÝXûï2
ÐPY˜‹XÚÐYPݬÁ\~ݬûï+ЬPá ÎPÔP¼!ï¸Ь[Þï>XÑXïJ?ÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûïÁÝ‘kalÕYÐPÐPÝPݬûïÏÐPZ<ÑïHF3ݶݬûï}ÐPZÕYÕZÝZûïmÝݬûï‘ÐPZÕZ)ÝÝÝZûïÕYÐPÔPÝPݬûïdÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ïˆÂ^ЬPª ЬPè 1ÐѬsÕ nà iмZЬ­üÕ¬Ýݘ ~ûïÿÐP­øÃPZPÀP­üÂZ¬ЬPà )ÕZ%Ñ­üZÐPQá PÑ­üPÐQPÀ­ü ­ü¼ÔPï¬[Ô[ЬPá ÐPQР¡ЬPª ݬÃ[¬~ЬP˜ ~ûïÐP­üÔ¼Õ[h×¼	ЬPÖ ZݬûïbNЬP³ BÝPûïõЬPá Ô¼ЬPª ЬPÐPQР¡ݬݬЬP˜ ~ûïÐP­üÑ­üÿÿÿÿÎPÔPˆ@¬¼)ï'¼*ïЬRÐP‚ÐQbÔPßï|;Á\~ݬûïHáïs;ÎPÔPÂ^Ь[ЬZÔ­üÕ¬05Ь­ø×jЪPÖªš`P	ÝZûïoÐPYöY‹×­øÚÖ­üÑ­ü¬ËЭüPÂ^Ь[ЬZÔ­üÕ¬.3ЬY×jЪPÖª‹`ÝZ˜‹~ûï“	×Yààª
Ö­üÑ­ü¬ÍЭüPЬ[á«¨«è«ÎPà«÷ÝûïQÐP«¨«Õ«á«ߘ«Pž@ïæ_«ç¨«Ñ[H°áïb:
ßïO:ûï:
á«ÐP2PÝPÝ«˜«~ûï]ÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«Ь[ÔZÖZ•‹úÐZPÝï€ݬݬûï¼;ïB¼ï4	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûïuÐPYj˜ï1~ûïòÕPâ«ÞïWN«ÞïON«á«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûï
ÐPYÐZ«Ôkná«1mÿЫZ3Ñ[X°1xÿÝûï+ÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûï¤ÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûï8ÑPY¨ «ÎPÔPÞïœ/[Ý[ûïÀ[Ñ[ïÆ0ëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûïYÕPÎZá«
Ý«ûﳌ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼Ь[ЬZ‘kŠ•‹÷ÔP˜kP˜zQÂQP¼ï„ÔPÂ^ß­úݬûïxÕPÔPÐP¼ïT¼ïDЬ[ЬZÐ[Y•‹ü×[Š‹ûÐYPЬ[ЬZÐ[YŠ‹ûÐYPݬÝ	tݬûïݬÝtݬûï¼6ïÔ¼
ïÄÔPÕïÀS.ÉèÕï²SÉäÕïªSÞï¤Sï§SÞï•Sï˜SÝÁ¬~ûï*ÐPYÐïS[Ôï†Sék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïBS	Ñ[äÕÔPñï4S¬ÿÁYPÆPxPïSÝûïbÐPZxïSPÀZPÑPZÀxïøR~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿÕRÁïÎRPÑZPÈÿÁRxïÂRPÀZPÃPjÐjï«RÉäÕÿŸR1ÿxYPÁ[PïŒRÑZï…RÐÿ}Rï€RÐkÿqRÉïjRkÁ[PЬ[Ð[ZÂZÐZïQRËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐï±Q@j‘Áï<-¬~ÝÐ\SÐ^\¼ïwÐï!-PÀ£ï-¼ï[Ьï-ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÕ¬ÐQ¼¼ïÐPï4ÎP̈ψшÔˆ׈Úˆ܈߈âˆäˆ.endc.ift.iff.iftf.if.iifIftf called with bad option: %ddfndfeqznenzgtggeltlle Š=ŠFŠ]ŠoŠ‡ŠŸŠ°ŠÀŠÑŠâŠïŠ‹‹6‹F‹U‹h‹x‹ˆ‹œ‹«‹Ë‹æ‹÷‹Œ,ŒEŒSŒoŒ‡ŒŸŒ¹ŒÈŒáŒøŒ7eˆ©Ä×óý Assembler Error-- 

	%d Error(s) and %d Warning(s)
	 #	Description of Error(s)


    Err_load=%d
	%d	%s
~|^`s.error.c R1.3 on 1/3/80<unused>Missing .end statementInvalid characterMultiply defined symbolSymbol storage exceededOffset too largeSymbol too longUndefined symbolInvalid constantInvalid termInvalid operatorNon-relocatable expressionWrong type for instructionInvalid operandInvalid symbolInvalid assignmentToo many labelsInvalid op-codeInvalid entry pointInvalid stringBad filename or too many levelsWarning--attribute ignored.Error statementToo many levels: statement ignoredInvalid conditionWrong number of operandsLine too longInvalid register expressionInvalid machine addressUnimplemented directiveCannot open inserted fileInvalid stringToo many macro argumentsInvalid macro argumentInvalid formal argumentInappropriate .endc statement; ignoredWarning--relative address may be out of rangeWarning--invalid argument; ignoredInvalid instruction vector indexInvalid instruction vectorInvalid macro nameUnable to expand time macroBad csectOdd addresstŽ
+-*/&!^<>%/^%n
t	fr
bOperators[] and Evaluate() incompaitible for: %c
~|^`s.eval.c R1.8 on 1/7/80ÿÿÿÿø•ý•––––––$–	*–
0–5–:–
?–D–I–N–S–X–]–a–f–k–p–t–y–}–‚–†–‹––”– ˜–!–"¡–#¦–$ª–%¯–&³–'¸–(¼–)Á–*Å–+Ê–,Ζ-Ó–.×–/Ü–0á–1å–2ê–3ï–4ó–5ø–6ü–7—8—9
—:—;—<—=—>#—?)—@/—A5—B:—C?—DD—EH—FM—GR—HW—I\—Ja—Kf—Lk—Mp—Nu—Oz—P~—Qƒ—Rˆ—S—T’—U——Vœ—W¡—X¥—Yª—Z¯—[´—\¸—]¼—^À—_Ä—`È—aÌ—bЗcÔ—dØ—eÜ—fà—gä—hè—iì—jð—kô—lø—mü—n˜o˜p˜q˜r˜s˜t˜u$˜v)˜w.˜x5˜y<˜zC˜{J˜|P˜}U˜~Z˜_˜€d˜i˜‚n˜ƒt˜„z˜…€˜†„˜‡‰˜ˆŽ˜‰“˜Š—˜‹›˜ŒŸ˜£˜‘©˜’®˜“³˜”¸˜•½˜–˜—ǘ˜Í˜™Ó˜šÙ˜›ß˜œå˜ë˜žï˜Ÿó˜ ÷˜¡ü˜¢™£™¤™¥™¦™§™¨™©™ª™«#™¬'™­+™®/™¯2™°7™±<™²A™³F™´L™µR™¶X™·^™¸d™¹j™ºn™»r™¼w™½{™¾€™¿†™À‹™Á™Â•™Ãusage:	as68 [-godspel] sourcefilename
.sr.a68rrCan't open source file: %s.s
/usr/sun/lib/a68.hdrrCan't open header file %s
.tempwCan't create output file: %s
.listwCan't create listing file: %s
.bwCan't create output file: %s
.Source stack overflow: %dUnknown option  '%c' ignored.
abcdaddbaddwaddladdqbaddqwaddqladdxbaddxwaddxlandbandwandlaslbaslwasllasrbasrwasrlbccbccsbchgbclrbcsbcssbeqbeqsbgebgesbgtbgtsbhibhisbleblesblsblssbltbltsbmibmisbnebnesbplbplsbrabrasbsetbsrbsrsbtstbvcbvcsbvsbvsschkclrbclrwclrlcmpbcmpwcmplcmpmbcmpmwcmpmldbccdbcsdbeqdbfdbradbgedbgtdbhidbledblsdbltdbmidbnedbpldbtdbvcdbvsdivsdivueorbeorweorlexgextwextljbsrjccjcsjeqjgejgtjhijlejlsjltjmijmpjnejpljrajsrjvcjvslealinklslblslwlslllsrblsrwlsrlmovbmovwmovlmovemwmovemlmovepwmoveplmoveqmulsmulunbcdnegbnegwneglnegxbnegxwnegxlnopnotbnotwnotlorborworlpearesetrolbrolwrollrorbrorwrorlroxlbroxlwroxllroxrbroxrwroxrlrtertrrtssbcdsccscsseqsfsgesgtshisleslssltsmisnesplststopsubbsubwsublsubqbsubqwsubqlsubxbsubxwsubxlsvcsvsswaptastraptrapvtstbtstwtstlunlkÌ™ ²Unrecognized address mode in line %s~|^`s.ins.c R1.2 on 6/27/80 ›ÿÿÿÿ @€ @€.macro.rept.endm.endr'.macro.rept.endm.endrInvalid formal parameterpassed to Load_Arg$~|^`s.mac.c R1.2 on 12/5/79L›
|,:()@]~|^`s.oper.c R1.2 on 12/17/79¤›%4d%c   binbexmdmcmecndld~|^`s.print.c R1.5 on 1/22/80.end.long.word.byte.macro.rept.ascii.asciz.blkb.blkw.blkl.list.nlist.insrt.text.data.bss.globl.comm.radix.typef.printf.error.page.defrs.even
   End: Position=%d, rCannot reopen temporary file %s%d errors in descriptor file

   Start_Pass: Pass=%d
%4d%c       %s~|^`s.ps1.c R1.9 on 12/18/79P­m­s­y­((<P~­„­†­
Ž­
‘­•­˜­Ÿ­absextoutinr
~|^`s.ps2.c R1.4 on 12/13/79.text.data.bssoctal8decimal10hex16binary2ô­.symwCan't open symbol file: %s
%-10s  %O %c%c
/usr/bin/sortsort-o~|^`s.ps3.c R1.6 on 5/19/80@®
|Entering Read_Line
.end
%d: %s~|^`s.random.c R1.3 on 11/8/79waopen on output file %s failed.rtmprwopen on output file %s failed.dtmprwopen on output file %s failedrcannot reopen text relocation file %srcannot reopen data relocation file %sPut_Words given odd nbytes=%d
”¯sdi storage exceeded
sdi bound list storage exceeded
Pathological sdi
~|^`s.sdi.c R1.7 on 6/27/80/dev/nullÐËLookup of null symbol Bad Symbol
      Lookup: S=%s, found
Symbol storage exceeded
--sym heap allocated, #%d --%sÐÑÐш±üÕ—r<Ø&X-à3`39ì=@˜AH¨FMðMShSYøW_<\hbnügt@¯y´jl‡ qبq–¼qžfôq¨~r±(r¹ÅHsÁXsÉL tϸtÖÔtß~ütæf uïœdvø$xvÏv	œv¬vf#y *–,1´,:LB\K»|RŒYœbœ¸k!Ðr»üz‚ƒ‚Œ7H„“ÏŒ„š€´„¡Ì„©Ü„²  ¸¾~<ÄrˆÍ	˱Ú	8 ±è	S ²î	¸0²÷¯´Žý	Z@²	—H²	¬Ð²	CÔ²	yز	yܲ$	Yà²+oˆ1˜X7‰Î_BfH*DnO
¨FW[°8^|àkÖðMu	>ä²~Š̬‰
 ‰‘	°è²™þˆ¥´ˆ°$ˆ¾<\Éÿ`_Î]
Ô€ÐÚtPÞe˜AêØ„õ¡â\›v%,ˆðØ%f1ô€_8˜l@4,?MœèˆT÷ìˆ`¤‰j;¨‰t	_ì²}	™ð²‡|¬‰‘È°‰™.H°Ÿ¤ôq¨Ø q¯±ª¿ˆÐÏØŽ×	À¸³à5œŽé8Tö€Žü쎹ŽÚ Ž‚$Ž(†4Ž4c>ÁN>H¿N	RÆž_Z"	_ƒº_f¨Žp}{ê‡pZ
’	ÎÀ³š	9´¡”Ž­–˜Ž·û ŽÃx¤ŽÌ§¬Ž×	m ´åP°Ží	WP´ø	Zp´	7´	혴	˸´"£¸Ž,ëÀ”3Ôt;	œD,ª^Lt(rSmr`!¸hœœpÆ€xºm‚¡`3ŽÏ•«‚d,_£ëœ™¨	ßÀ´²	¼È´¿ ™Æ		дÐ	1µØJ’åÆì=ù#6fÆF#\"$n"@ü"$(È->(5€–$= „%Eøf#MIì#U]²&]8ä'g<Z,oI**xäò(€ûª)ˆ„®*’ÌB+šp'£ØÐ,¬PD-¶hÞ-ÀÿÔ.Ç’\/Ðìœ/Ö]X2Ýœx2è.œ2òåh2ùÇÚ/U82S2×83x3 ”˜e)k"2/ðÆ29^Ü2DÊŠhOëügXx&aµH2hvš1o	µ{	$°µƒ	„ȵŒ	éh¶•	ùp¶ž[ð™®	Ž°¶¶	׸¶ÀÑè™Å}ì™Ð	pø¶Þô™è³x›ð³p3þB4š÷b6Òm!<]-¡59Mà6F$Þ7Rq^7\µ¬7iy¸štª¤=E]œZ]—ûZ=¡ø,;²yˆƒ¸Ô^ÀeªaÌÊš<ÒÇ<›Ø7l>æ°ª@ñ(l›ø6p›	[t›	g	³¼q	C®%	žD/	ÈbD7	âLE>	&ЬJ	|Ô¬V	Êجa		4x·i		e˜·v	íÄ›	LöI†	tOŽ	hS•	ÈÂVœ	,tU§	`øW®	m²X´	¦¼U»	ÒZÄ	‰ÀWÊ	ûZLÑ	ŠÀM×	u‚ß	ˆºYë	êÐcô	AÚh
I(	
a0j
Ȭ
ÀÚo'
…fj1
Ðb=
~²KI
î†KP
·tqV
	°·c
ÑØLk
	Þ´·x
	7¸·„
´¬fŽ
Ïàœ“
	¤à·œ
	9¸¦
<䜰
蜻
aìœÇ
ôfÐ
>¶PØ
|Pâ
	õ¸ì
Ð$ñ
:ÖSø
¨ܬÒ¤­	2 ¸6´jÔ´„$E®,\®:ÿÚ]FÖ_N_T	à¸^þ ug	¤¸m	Œ¨¸s	~¬¸z	þ°¸	"´¸‰	¿¸¸‘	^À¸™	^มeXs¨i€p³[Nu»XhgļD¯Îfîi׬Tià–jè@Èjðâ©tõ;Lü»¸tr
¨q„xv	—¹Â|$	†¹.	¨ÈË8ú¼¯H	wÐËPáÀ¯Y»įcTȯm,uj"m‚Ë’mŒ$dv”Ü„›~2x¤´ˆ±®/HsµÅœv¼LJ€ÄX tÊNütÑŒ×Ðvß•Ì„æ3\î	
ÐÍö–¤€
	ÚÐÑ
¼æ
Ð
Ο
Œ„ 
ÅH„&
7¤ƒ/
	ÌüÕ4
Óu„9
crt0.oas.ocond.oerror.oeval.oinit.oins.omac.ooper.oprint.ops.ops1.ops2.ops3.orandom.orel.osdi.o_sdispawn.osym.oabort.ofork.ofputs.ofprintf.oaccess.ofopen.ocreat.ofseek.odup.opipe.oprintf.ordwr.ofilbuf.ostrlen.oexecv.oexecve.olseek.odoprnt.oflsbuf.oexit.odata.ostrcmp.oclose.oisatty.oopen.oread.ostrcat.ostrcpy.ostty.oioctl.ounlink.omalloc.osbrk.oudiv.owait.owrite.ocerror.o_exitstart_main_environ_ins_example_ins_hash_tab_Code_Operand_Pass_Dot_Line_Position_BC_tsize_dsize_bsize_Done_Init_Read_Line_Cond_Label_Pseudo_Macro_Instruction_ByteWord_Dot_bkt_Cur_csect_Errors_Ignore_Cond_level_Condition_Subcondition_Get_Token_seq_Endc_Iftf_If_Print_Line_Eval_Cond_Non_Blank_Prog_Warning_cond_table_Sys_Error_Prog_Error_Lower_Lookup_Get_Operand_error_E_messages_Warnings_Err_code_E_pass1_Err_list_Err_load_E_warn__iob_fprintf_abort_Error_Describe_Error_Endprint_O_list_listout_O_debug_Print_Error_eval_In_radix_Operators_Prefix_tab_Radix_tab_Escape_tab_Evaluate_Op_Delim_Get_Term_member_rev_lastc_O_global_Num_Value_Char_Value_Grab_Char_header_Title_O_listname_O_symtab_O_ext_only_O_print_O_outfile_Source_stack_Ss_top_File_name_Temp_name_Temp_file_Rel_name_Rel_file_op_codes_canum_printf_Options_Concat_fopen_Push_Source_strcpy_strcat_fclose_Sym_Init_Init_Macro_d_ins_malloc_Hash_ins_Mnemonic_Code_length_WCode_operands_numops_Get_Ins_Bkt_Scan_Operand_Field_Put_Words_no_op_one_op_clr_op_ctrl_op_move_op_two_op_jbrnch_cbrnch_branch_brnchs_regmem_shift_op_reg_op_postinc_bit_op_memreg_regbrnch_exg_op_addr_op_link_op_movem_op_movep_op_moveq_stop_op_trap_srreg_data_addr_alt_addr_ccreg_eaddr_uspreg_areg_adrbyte_sr_addr_rel_val_dreg_mem_addr_ctrl_addr_sdi_bound_makesdi_baround_pcreg_index_M_defining__M_bkt__M_call__M_line_M_stack_Top_of_M_stack_CM_top_CM_tests_mac_Expanding_Mac_hash_tab_typ_mask_Lflags_Define_Macro_MLHold_Print_Macro_Store_String_Line_Delim_Load_Macro_Load_String_Get_Mtoken_Load_Arg_Form_Arg_No_ACS_count_Get_Mac_Bkt_Skip_Comma_Enclosed_octalize_Read_Macro_Line_free_append_Start_Line_Rept_oper_Num_Operands_Get_Defer_print_L_radix_L_ndigits__flsbuf_fputs_Line_no_Print_No_Space__NList_Text_csect_Data_csect_Bss_csect_filhdr_Entry_point_EntryFlag_End_Asciiz_Blkbw_Insrt_New_Csect_Globl_Comm_Radix_EPrintf_Page_Defrs_Even_unlink_Pr_Sym_Tab_Fix_Rel_sdi_resolve_Csects_sdi_inc_Csect_load_Sym_Fix_sdi_free_Rel_Header_Start_Pass_Ehead_Perm_Last_symbol_Equals_Label_count_Label_list_Put_Text_ps1_Ext_buf_Ext_mark_Ext_load_Extension_Ext_nbytes_Put_Rel_Extend_LoadChar_Rel_mark_ps2_Csect_radix_tab_ps3_sym_hash_tab_spawnl_wait_random_Line_end_tab_Get_String_Length_Copy_Rel_flag__filbuf_tout_dout_rtout_rdout_rtsize_rdsize_rtname_rdname_fseek_Sym_Write_fwrite_rel_cmd_sdi_list_sdi_len_longsdi_b_free_spawnv_dup_close_pipe_access_fork_execv_errno_open_sym_heap_sym_free_Sym_heap_count_Cblock_Ccblock_Cb_nextc_Cb_count_strcmp_get_sym_bkt_sym_link_strlencerror__doprnt__lastbuf_creat_lseek_fflush_dup2_fread_read_execve_write_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brkug	¤¸m	Œ¨¸s	~¬¸z	þ°¸	"´¸‰	¿¸¸‘	^À¸™	^มeXs¨i€p³[Nu»XhgļD¯Îfîi׬Tià–jè@Èjðâ©tõsumacc/cc41/c268   755      0     12       43553  3472711314   6501 0@ðÂ^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØ/ûï
ÝPûï<)¼Â^ѬЬPРP‘`+
׬À¬Öï§9Ô­üѬЬPРP‘`-
׬À¬Ö­üѬBßï1ЬPÝ ûïÝÐPïâ<0ЬPÝ ßïõ0ßïÁ3ûï–Ýûï­(Þï‰3ï°<ѬBßïÙ0ЬPÝ ûïŠÐPï“<0ЬPÝ ßï·0ßïn3ûïCÝûïZ(ÞïF3ïa<Ôï8ÔZûZïÂûïWÐPYûï]Ô[Ð[ï´8ûï%Õï«8
ßïk0ûï<ûï	ûï¢Ö[Õï‚8ÓÕï~8
ßïG0ûïûï
Õïb8
ßï40ûïóûï¬
ÕïB8ŒûïùÕPÝûïþÝïª;ûï¹&Ñ[ZÐ[ZÕY1BÿÝïŽ;ûï&Õ­ü1€ÝZßïØ/ßïa2ûï6Ýï 7ßïÎ/ßïH2ûïÝï“7ßïÈ/ßï/2ûïÝï~7ßïÅ/ßï2ûïëÝïi7ßï½/ßïý1ûïÒÝïT7ßï¹/ßïä1ûï¹Ýï?7ßï°/ßïË1ûï Ýï*7ßï¨/ßï²1ûï‡Ýïù6ßï¥/ßï™1ûïnÝïÜ6ßï /ßï€1ûïUÝïã6ßï /ßïg1ûï<ÝïÎ6ßïš/ßïN1ûï#Ýï½6ßï•/ßï51ûï
Ýï 6ßï™/ßï1ûïñÝï“6ßï•/ßï1ûïØßïö0ûï%Ýûïâ%Â^Þï6Zûï‡ÐPYïY­üšYYÐYPÑP1ÑPøÑPóÑPsÑP%1ŒûïÐP[öYkö­ü«Ô«ÝïÐ5ûïËÐP«)ÑY$žÔP‘ï–1LDßï1ûïˆÐP«ökÔ«Ô«ÐZ«Ð[ªÐ[ZÔ«ÑYÁÐPûï¯ÐP[‘ïP1.²ökÔ«ßïA1ûïŽÐP[ö%k”«‘ÿI5.CÐï@5P‘ L5Àï15Ýï+5ûïÐP«‘ÿ501zÿ‘ÿ59ôÖï5ã”k•ûï.ÐP[öYkö­ü«‘ÿç4. ÐïÞ4P‘ LÁP~ûï¯ÐP«1'ÿ‘ÿ¾4p1ÞþÐï±4P‘ cï‘ @èÔ«ö«««k1,ÿÞïj0[ÔY1ÕYÑZ:”‹ÐPÑZ
Ñ[ 5Ø”‹ûïõÑZ	ÖYöZ‹×ÿ8Ðï
8PРQÖ ˜aPšPP
Ýïô7ûï9ÐPZÖP”‹Ð$PЬ[ÔZÑY9Å
ZPÀYPÃ0PZ˜‹YÑY0è•{‘k-ÔPÐZPÂ^ÐïÃ3[1˜ÑP$MÝ«ßï$-ÝïŽ7ûïS1\ÑPáÑPÖÝ«ßï-Ýïj7ûï/Õ¬×Ý«ûï1)˜«YÑYdÑYe	ÑYf”«Þï¥)ZÕj1–˜«PxPP˜kQÈPQѪQ1‘k‘kÁj~ßï’,Ýjßï,Ýïæ6ûï«ÑYdßïu,ÝïÊ6ûïÑYeßï[,Ýï®6ûïsÑYfßïA,Ýï’6ûïW‘k%Ý«ßï(,1æþÀZ1LÿÕ«Ý«ßï,Ýï`6ûï%Õ¬,1óþ‘k‘kÝ«ßïõ+1§þßïó+Ýï/6ûïôЫ­üÕ¬ÐïL2«Ð[ïC2Эü[Õ[1€þ˜kPÑP1vþÕ«%Ý«ßï«+Ýïå5ûïªÕ¬
Ý«ûï‹ßïŒ+’Ь[Ý[ûïÃÐPYÔPÝÁY~ûï&ÐPZÝ[ÝZûïø!ÐZPÞï([L˜iPxPP˜©QÀQQÀQP˜©QÀQPïPPÇ9PQÄ9QÃQPQÞAïn4ZÑZ„=Þï\4ZÕŠìÐ[zÀ[ÐkY¯Â^Þï/=Y”©©©©iÞï,-ZÖZ‘j	ù‘j ô
‘j ‘j	Š‰•jÖZ‘j	ù‘j ôÐZï1˜ïÝ<PxPP˜ïÓ<QÀQQÀQP˜ïÇ<QÀQPïPPÇ9PQÄ9QÃQPQÞAïº3­ü{ÐkYÞï<Z‘j‰	•Š÷ЫP×Y‘jb•ª•i
Ád«P‘jw•ª•i
Áe«P‘jl•ª•i
Áf«PÀ­üÑ­ü„=Þï=3­üнü[1|ÿÞï,,ïG0ÔPÞï,<YÔ‰ÑY¬GõÐï0[)‘k Ç«PÄPÃP«PÐ[@ïó;Ô«Ы[Õ[ÓÐïÖ/[~‘k
‘k‘k%kÔ«Ç«PÄPÃP«PÐ@ï±;ZÑ«ªÐï•/Z‘jÑ«ªЪZÕZìÕZ!ÝZûï©
РXÑXZШ«ÐXZÐZ«ÖªЫ[Õ[1{ÿÐïH/['ЫZ‘kÕ«ÕZ•j‘j%	Ý[ûïU
ÐZ[Õ[ÕÔïp/Ðï
/[Õ[1³‘k
‘k‘k%JÕ«EÝ«ûï
ÐPZ‘j3Õª.Ñ«ª'Öïê.Ъ«Ý«ûïï	ЪPÖ Ъ«Öï	/‘kdЫY‘i[ЫZЪZ‘j÷ÑZYIÝ«ûï³	Щ«Щ«ЩPÐ[ Щ«˜«P@ïM&«Ðïm.©ÐYïd.Öï¦.ÖïŒ.‘kx‘ks1ב»o‘»i‘»c‘»$]•»X‘»!R‘»"LÖïd.Öï*.ЫPÕ ЫPÝ ûï	ЫYЫPР«ЫPÐ[ Ðïä-©ÐYïÛ-Õ«‹Ð«ZÕZE‘j@Ñ«ZVЫPЫ ЫPЫ Ðï«-«Ð[ï¢-Ы[ÝZûï±Öï×-Öï¡-Ý[ûïÝ[ûïÕÐP[Ы[1LþЪZ•Â^Ô­üЬ[ЫZ0ÔPÝZûïLÐPYök”«ÐY«Щ«Ô«Ö­üÖïJ-Öïl-Ы[ЪZ‘jõÝZÝ[ûïØÕPÑ[Z°Ð­üPЬZ‘jH‘º>ûïÐP[ökÐï¼$«Öï´$Ô«Ô«Ð«Ъ«ÐZ«ЪPÐ[ Ð[ªÐ[PЪZÖªÐZPÂ^Ь[‘k1ÄЫZM1»‘jO‘»òЪZÐZYЭôЩYáÑY[Ü×­ôבiëЫPÑ© àЫ[1€Ð¬PЪZq‘jõ‘j¬ÐªZЫYY‘i‘iKÑ[YNÖï9,ÖïW,ЫPÐZ ЫPÐY ЪPЩ ЩPЪ ЫªЫ©Ý«ûïõÐZPЩYÕY£Ð[PÑ[Y1oÿЬ[Ý[ûï¸þÿÿÐP­ø˜©P@ï}#©Ý©ûïµЪPÐ[ ЩPÐ[ ЫPÐZ ЫPÐY Ы­üЪ«ЭüªЫ­üЩ«Эü©Ý«ûïUþÿÿÐPZЪ©ÐZ©Ý­øûïWЭøPÕ ×ïH+ÖïR+Öïh+ÐYPÐïü*[9‘k0ЫZ*Ѫ$ЫY‘iÑ©ZÝYÝ[ûïЩYÕYâЫ[Õ[ÃЬ[ЬZSÝ[ûïÁýÿÿÐPYЪPЪ ЪPЪ ÐZXЪZÐï›*¨ÐXï’*ݪûï¤ЩªÐYªÖïÁ*Öï«*Ы[‘kõЪZÝZÝ[ûï'ÕPÂ<^Ðï1*[Õ[1HÕï‡*=ÔYÅ!YP•@ïˆ*Å!YPŸ@ï{*ÝYßï‡$ûïü
ÖYÑYÒßï{$ûïè
˜kPÏP)é”òòòòWÂÂ~~ÂòòòòÂò˜òòòòòòòòòòòòW1›‘«d1<‘«eöÝ[ûïßïÉ+ßï¢+ûï+ÕP.ßï‘+ûï8ÐPYJßï +ûïXÐP­ôÑYP4‘».ЫPЫ ЫPЫ Ðï')«Ð[ï)Öï()Ы[1Éþ‘k&
ÝÝÝ[ûïÍßï#+ûïüÐPYßï4+ûïìÐP­üßï#+ûï¹ÕY.Õ­üÅ!YPŸ@ï)ßïß*Ý­üûï+"ßïî*ÝYíÕ­üßßïß*ßï¸*ûï	
ßï«*ûïø1_ÿÝ[ûïßï³*ûïI”ï+1@ÿÝ[ûïãÝÝÝ[ûïßïf*ûï³ÅÝ[ûï ßïN*ûï‘k·ßï<*ûïÐPYßï{"ÝYûïw”ßï*ßïg"ûïd	1~ÿÝ[ûïLÝÝÝ[ûï—ßïí)ûï:•ïà)1™þßïg*ßïÏ)ûïX	ÕPæЫPЫ ЫPЫ Ð[­øЫ[ЭøPÐïv' Эøïl'Öï¦'Öï¨'1EþÝ[ûïè‘«e1Ы­ø‘½øò‘»ìЫP‘ âЭøP‘ e×ßïŸ!ßïB)ûïËÕPÀßïR)ûï
ÐPY®ÑY©Ý­øûï€ßïk!ßï
)ûï“ÕP1“ßï)ûïÏÐP­ôÑYP}Ðï¶&«ЭøPÐ[ Эøï¤&Ы[ö+k”«Õ«Ý«ÝYßï!ß­Æûï|Ý«ÝYßï!ß­ÆûïeÔ«ß­ÆûïbôÿÿÐP«ЭøPР­øЭøPÐ[ Эø«1ÙþÝ[ûïÊßïZ(ûï§ßïn(ûïšÝÝÝ[ûïÝ1«ýÝ[ûïgûï\1áüÂ^ÔXÔ­üÐïÐ%[
ÖXÐX«Ы[Õ[òÐï¹%[~ЫZ‘kr‘jmÕ«hÕªcЪPàª~ûïaÐP­øЫPà«~ûïLÑP­ø7Ñ«ª0˜«P@ïP«ЪYЫªÐY«ЪXЫªÐX«Öï~%Ö­üÐZ[Õ[1{ÿЭüPÕ¬άPЬPЬ[ЬZ‘kj‘«ªÔP•k‘kô‘k ïЫYЪXÕYÕXÐPÕY×ÕXÓ‘iˆΕ‰÷éЬ[	‘kЫ[Õ[óÐ[PÐï¾$[Ыï³$”«Ð[PÝÝûïñÔ[Å![P”@ïí$ò[ñ”ïó&”ï='Å!¬Pž@ïÎ$[Ð[YЬZÝZûïßÕPj‹‘Š,ö”{Ô[Å![Pž@ï›$Z‘ŠaÁ(¬P˜jQÑQPÅ![P”@ï|$Ö[Ñ[ÏЬ[Ý[ûï‡Ý[ûï
ÐPZÅ!ZP”@ïL$ÑZÝZûï”ÿÿÿÅ!ZP”@ï1$Ý[ûï¤ÐPZç‘‹a5‘k00‘‹5+‘k@%ÔZÅ!ZP‘@ï$#Å!ZP”@ïò#”ïü%òZÝЬPР[Þï¤%Z‹Šû”ï¹%ЬYЩ[Þï†%Z‘k,‹Š•kô”ŠÞï%Z”j‘‹,‘k ‘k	Ö[ò‹Šû•¼&Ô[ݬÅ![PŸ@ïm#ûïÄÕPÐ[PÖ[Ñ[ÜÎPЬ[‘kd‘«0‘«7
•«˜«PÂ0P‘ka‘«0‘«5
•«˜«PÂ(PÎPÞïŠ"ZÐï‡"[Ñ«Zûï×Ð[ZЫ[Õ[èЬ[Ð[Z•kÔP•Šü‘ªþ+‘ªþ-í‘‹a&‘k0!‘k5˜kPÂ(PÐPYÄ!P”@ï›"ÝYûïèýÿÿÐPÂ^Õ¬ßïm$ûïóþÿÿÐP­üέüßï5$ûïÜþÿÿÐP[Õ­ü1ÝÞï$YÞïÚ/Z‰Šû•ï)$Þïú/Zö,ŠÞï$Y‰Šû”ïâ/Õ[8Ñ[Õ¬aï—/Á([Pdï‰/Á0[PöPï/”ïz/ÖïŽ!Õ­ü;Ñ­üÕ¬aïŽ/Á(­üP
dï/Á0­üPöPït/”ïo/ÖïN!ßï`/ßï&/ûïCßï/ûï(ïÿÿЬQÐP¡Â$^Õïõ ÎYÐïé [\‘k 
‘k!‘k"I˜kPÑPYÕ«9‘» ‘»!‘»"'ЫPЫ ЫPЫ Ðï¸ «Ð[ï¯ Ð«[˜kYЫ[Õ[ Â^ЫZÝZûï§ûÿÿÐPZ‘j
\ÝZûïìüÿÿßïÝûïçûÿÿÝûï‚ÐPYÝûïvÐP­ü"ÝZûï×üÿÿÝûï^ÐP­üÝûïQÐPY‘º‘jÒЪZÝ­üÝY˜ª~ûï{ÕP'Öï/ ÖïA Ý«ûïûÿÿЪ«Ъ«ЫPÖ ÐZÅ!¬Pž@ï' [‘k#Ð[PÝ[ûïÂüÿÿÐP¬×Zוkåßï"Ý[ûïUÕPÒÞï%"PÂ^Ь[ЬZ‘‹#‘Š#ÔPÔY‘j9Ä
Y˜ŠPÂ0PÀPY‘j0êÐY­üÔY‘k9Ä
Y˜‹PÂ0PÀPY‘k0ê‘k+Ö[‘j+ÖZ‘‹j²•Š÷ÐY[ЭüZЬPÏP	#0=JWdq~‹‰Ñ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPЬ[ЬZ‘j#Ý[ûïuÕPÞïÆ Y‹‰ûÞïâ YŠ‰ûÂ^Ь­üЬ­øЭüPÖ­ü‘`½øÔPЭøPÖ­ø•`åÐPЬ[Ý[ûïÕP”ï» Þï´ Z‹ŠûЬ[‘k*‘k(‘k-	‘«(ÔP•‹ü×[‘{+ò‘k)‘{5èÐPÔPĬ¬ݬûï#ÐP[ÔPÐ[ZÝÁ¬~ûïzÐPYÔŠôYûÐ[Pݬûï\ݬÁ\~ݬûïЬPá ÎPÔPЬ[ÞïÔXÑXï
ÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûï¥Ý‘kalÕYÐPÐPÝPݬûï³ÐPZ<Ñï„ 3ݶݬûï}ÐPZÕYÕZÝZûïQÝݬûïuÐPZÕZ)ÝÝÝZûïYÕYÐPÔPÝPݬûïHÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ïDßï¸Á\~ݬûïÈáï¯ÎPÔPЬ[á«¨«è«ÎPà«÷ÝûïEÐP«¨«Õ«á«ߘ«Pž@ïú)«ç¨«Ñ[X4áïB
ßï/ûï^
á«ÐP2PÝPÝ«˜«~ûïaÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«Ь[ÔZÖZ•‹úÐZP¼ï4Â^™B­üЬ­ô2ÿ­ðß­ðÁ\~ݬûï¨×­ðЭôPÖ­ô”`ß­ðÝûïrЬP	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûï-ÐPYj˜ïÀ~ûïÒÕPâ«ÞïëÞﻫá«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûïÅÐPYÐZ«Ôkná«1mÿЫZ3Ñ[h41xÿÝûïûÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûï\ÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûïðÑPY¨ «ÎPÔPÞïX[Ý[ûïÀ[Ñ[ï‚ëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûï9ÕPÎZá«
Ý«ûïO³Œ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼¼ï\ÔPÂ^ß­úݬûïxÕPÔPÐP¼ï,¼ïЬ[ЬZÐ[Y•‹ü×[Š‹ûÐYPЬ[ЬZÐ[YŠ‹ûÐYPݬÝ	tݬûïݬÝtݬûï¼6ï¬Õïà.É,HïÒÉ(HïÊÞïÄïÇÞïµï¸ÝÁ¬~ûï*ÐPYÐï¡[Ôï¦ék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïb	Ñ[(HÔPñïT¬ÿÁYPÆPxPï;ÝûïbÐPZxï(PÀZPÑPZÀxï~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿõÁïîPÑZPÈÿáxïâPÀZPÃPjÐjïËÉ(Hÿ¿1ÿxYPÁ[Pï¬ÑZï¥Ðÿï Ðkÿ‘ÉïŠkÁ[PЬ[Ð[ZÂZÐZïqËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐïÑ@j‘Áï(	¬~ÝÐ\SÐ^\¼ï_Ðï
	PÀ£ï	¼ïCЬïïÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPïÎPP3T3X3\3`3d3h3l3p3t3x3	|3€3‡3%3‘3•3	™3
ž3£3§3
«3¯3³3·3»3¿3Ã3Ç3Ë3Ï3Ò3Ö3'Û3(à3)å3*ê3+î3ò3ö3ú34&444 4!4"!4#'4$	 NrC2: can't find %s
wC2: can't create %s
iterate
comjump
rmove
%d iterations
%d jumps to jumps
%d inst. after jumps
%d jumps to .+2
%d redundant labels
%d cross-jumps
%d code motions
%d branches reversed
%d redundant moves
%d simplified addresses
%d loops inverted
%d redundant jumps
%d common seqs before jmp's
%d skips over jumps
%d redundant tst's
.L%d:
%s:
	j%s	%sbwl	.L%d
	%s
	.L%d

%s
brabeqbneblebgebltbgtbcsbhiblsbccjmp.globl.longmovclrnotaddqsubqnegtstasrasllsrlslextcmpaddsubandoreormulsmuludivsdivudbfjsrleapeamovemmoveqlinkunlk.text.data.bss.even.end%d: %s -
#0#0#-1#1d%d,%sd%d,.L%d#0AA˜5@H—r<hØ&yT0~x8Ř@¨I~ÐRœ”[$¨c¸mfvfl'yt)†–€)´€)•)ž»°)¥À)¬Ð)µœì)¾!*Å»0*Í@*Ö7l,ÝÏ°,ä€Ø,ìè,õ t)û~<r00	— 5	n 9$	¡¼9/	ŒÀ96	’Ä9=	lÈ9E	wÌ9M	Ð9U	{Ô9[	èØ9b	XÜ9j	¢à9q	Àä9y	šè9	ì9Š	
ð9‘	œô9˜	Îø9ž	>ü9¥	¸:«		:´ð 1¹	å:À	:Ç	“:Î	°:Öú”1Ý	·:ã	[(<ë	pP<ó	Ýx<ú	 <	»„=
	gˆ=tx.X4 ¤T)øø2”9$¤Bš|	L¨T'Œ
]%g” p9hw¿Ä˜Ö‡Lž(›.˜¯ö¡Â§‰¤¯ïV·þÐÀûDÇ$”Ïk×!ì)ßžÜçŠØï’Vöñ
*À	ŸŠÐê€P!(v)b”3ÅÆ: ŠD`¤J<SÒ>[•:cô2kF¸t¬ }³x‚SnˆÙØ–œÐ)ž.à§s.°4̹õ¤À«@*È°,Íy¬+Ó~† Ü´˜5æ.˜í;€)ô°)ú	—Œ=ƨè,œÀ)fl'–Ø,%3)-	
=5–ø(?)G	ÚAO»*U*[0*bÁl,h7È+q	Ì@HvÏ™,{crt0.oo0.oo1.oabort.ocalloc.ofprintf.ofopen.ocreat.oprintf.ofilbuf.ostrlen.olseek.osprintf.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostrcat.ostrcpy.ostty.oioctl.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_optab_line_first_freenodes_curlp_nbrbr_nsaddr_redunm_iaftbr_njp1_nrlab_nxjump_ncmot_nrevbr_loopiv_nredunj_nskip_ncomj_nsob_nrtst_nlit_nchange_isn_debug_lasta_lastr_firstr_revbr_regs_conloc_conval_ccloc_ophash_infile_outfile_fopen__iob_fprintf_opsetup_input_movedat_refcount_printf_iterate_clearreg_comjump_rmove_jumpsw_output_fflush_getline_getnode_copy_getnum_oplook__filbuf_cfree_strlen_calloc_strcpy_nonlab_decref_xjump_codemove_insertl_equop_backjmp_dualop_equstr_findrand_isreg_repladdr_dest_savereg_setcon_source_singop_sprintf_redunbr_abs_areg_check_abort_strcat_findcon_compare_natural_setcc_mallocudiv_free__doprnt__lastbuf_creat_close_open_errno_lseekcerror_read__flsbuf_write_isatty__sobuf__cleanup_fclose__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brkbcsbhiblsbccjmp.globl.longmovclrnotaddqsubqnegtstasrasllsrlslextcmpaddsubandoreormulsmuludivsdivudbfjsrleapeamovemsumacc/cc41/a68.hdr   644      0     12        1373  3472711314   7140 | Pre-Assembly Code

| The remainder of this file consists of statements that are 
| interpreted before every 68000 program.

| Define Register Names

.defrs	d0, 0., d1, 1., d2, 2., d3, 3.
.defrs  d4, 4., d5, 5., d6, 6., d7, 7.
.defrs	a0, 8., a1, 9., a2, 10., a3, 11.
.defrs	a4, 12., a5, 13., a6, 14., a7, 15.
.defrs	sp, 15., pc, 16., cc, 17., sr, 18., usp, 19.
| Next line is for 68010. --TPM
.defrs  sfc, 20., dfc, 21., vbr 22.

| Set Input and Output Radices

.radix	in, decimal
.radix	out, hex

| Define registers for movem
| D3 means just d3, D3+A2 means d3 and a2, A2-D3 means a1,a0,d7,...,d4,d3

D0	=	/1
D1	=	/2
D2	=	/4
D3	=	/8
D4	=	/10
D5	=	/20
D6	=	/40
D7	=	/80
A0	=	/100
A1	=	/200
A2	=	/400
A3	=	/800
A4	=	/1000
A5	=	/2000
A6	=	/4000
A7	=	/8000
ALL	=	0
˜5@Hsumacc/cc41/Makefile   644      0     12         314  3472711315   7456 DP=/usr/stanford/bin
DL=/usr/sun/lib
PRGS=cc68 as68 c268 ccom68 ld68 lorder68 nm68 pr68 rl68 size68
LIBS=a68.hdr libc.a

install: cc68
	cp $(PRGS) $(DP)
	cp $(LIBS) $(DL)

cc68:	cc68.o
	cc -o cc68 cc68.o
 d5, 5., d6, 6., d7, 7.
.defrs	a0, 8., a1, 9., a2, 10., a3, 11.
.defrs	a4, 12., a5, 13., a6, 14., a7, 15.
.defrs	sp, 15., pc, 16., cc, 17., sr, 18., usp, 19.
| Next line is for 68010. --TPM
.defrs  sfc, 20., dfc, 21., vbr 22.

| Set Input and Output Radices

.radix	in, decimal
.radix	out, hex

| Define regisumacc/cc41/ccom68   755      0     12      277621  3472711316   7145 ô` Â^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØóûï•ÝPûïÜî¼ݬݬݬÝÝÝ!ûïjnÝÝÝÝݬݬûïQnÐP[ЬPÑP4ÑP
ÑP6ÑPH
ßïžûï³ÙÐ[PݬûïÅgÐP«ìЬ«åÑïPÏ
ßïpûï|ÙÐïPPЬ@ïüOÖïòOÑï4œq
ßïUûïHÙÐï¢pÿÀïÐï”pÿÀïü
Ðï†pÿñ
Àïê
Ðïxpÿß
ÀïØ
ÔïbpÂïÇ
ÐïÁ
PÐ`ïMpÂï²
Ðï¬
PÒ¬QËQï0pQÉQ`ï'pÂï
ÐïŠ
PÐ`ïpÂï{
Ðïu
PÐ`ïõoݬûïúsÐP¬Ѽßï£ßï¸ûïØÑïÒoÄqåÑïÅo”y
ßï£ûïAØЬPРÿ¥oûïdyÐï˜oQÐP¡ÝPûï6yÀïƒoݬûïÙxïkoPÕàÈqßïaßïuûï×ÑïJoÄqåûïyxï1oQÐPáÈqÝPûïÐxÑïo”y
ßïDûï–×ÃÄqïûnPÇPïînÐïìnPΠÀïàn€Â^ÁïÎnP~@ïÒn[Ð[WÃï¿nX7Ð[Y'Ñi©ÁYWÐi­üÐgiЭügЩ­øЧ©Эø§ÀYÑYXÔÐWXÐ[WÑ[XÄÁ[ZÑjªøÐj­øÝ­øßï´ûïžÖÀZÑZïUnÙÃ[ïLnPÇP~Ã[~ûïÜ}Ã[PÐPï1n€žÎÌþ^´ÍÎþÎï†Ôï„´ï‚ÞÍÒþZÞïÛuYÀZÞmPÑZPßï_ûïx8ÐP°ÍÎþjÀYÐïôLi2ÍÎþP°@ï«ùÍÌþ±ÍÌþü1ŒÕï"ûïÐPïÔï
2ÍÌþPÀïÿP÷PÍÌþ[±ÍÌþ•R2ÍÌþP°@ï*ðÍÌþ2ÍÌþP2@ïçþPÑPïË-ÎïÂÐïhLïgL°ÍÌþÍÎþµï²17ÿ·ï§1.ÿ2ÍÎþP°@ïÍÌþ±ÍÌþþÿWÕï~ûïwÐPïnÔïfÞïDïXÀX±hÿÿö±¨ÍÎþîÀXµh2hPÑPï:í°¨ÍÌþÔPµÍÌþ2ï)PÏP$77­2ÍÌþP2@ï¸üPÀPPÂPZÐY[2ÍÌþP2@ï¢üPxPPÂPYÁYPÐ`ïK°ÍÌþÍÐþ2ÍÌþP°@ïûÍÌþ2ÍÌþP2@ï•úP2jQÀQPÖP÷PÍÒþ±ÍÒþ•)2ÍÒþP°@ïâîÍÎþ2ÍÎþP2ÍÌþQÎQQ2@ï—ýPÑPQ2ÍÌþP2@ïIúP°@ï±îÍÎþ2ÍÐþPÏP®_üüðo6ëýiwëýðoëýëý”4ëý±¨ÈîëýøëýëýDQq‘ëýëý—£D¯¾Ýëýëýäø€ž©ëý¶>N[d~†>N[d†‘ÈÏööëýëýžëýëý0HXaëýëýëýkwëýëýëýëýëý‘›êAëýXNl±j¹	4	_	
ëýëýëýëý_
Œ
™
±
ü
1_÷pÐäëýëýƒ
A
ÿƒ



ƒ
A
/
•
©
ƒ
ƒ
½
½
½
½
½
½
½
½
É
à
ƒ
ëýè
ú
ú
>Eiu­²ÊØç@Ð;†Ebkƒ>[d†‹1Šüßïûï
5Öïé÷ïæ`2jP2@ïFöPÀP÷PÍÌþ4±ÍÌþ•+2ÍÌþP2@ïöìP±@ïºû2ÍÌþP°@ïÝìÍÎþ1!ü2jP°@ïùõÍÌþÂZÂYÞÍÔþPÑZP–1üÕïiõÎï`1üÔïtÔït1àûÑïtÐPÐPÝPÝkÝ«üûï…DÝPûïB%1µûÕïés
ßï8ûï6ÒÕïØsÈïÓs˜a»ôûï)-1‚ûÔï²s˜a»ø1tûÐï§s1jûûïñuÝûïzr1WûÝÝÝûïÐ÷ÿÿÐPïaHÔïss1:ûÝÝÝûï³÷ÿÿÐPïDH1#ûÝÐkPÝ ЫøPÝ ûïõBЫøQÐP¡˜a»1ýúÐkï,s1óúÝÐkPÝ ЫüPÝ ûïÅBЫüQÎÐkPÝ ЫüPÝ ЫøPÝ ûï¤BЫøQÐP¡˜a»Ð»»ü1§úÝ«ðûïã/1mÿÝÝkûï.ÐPï¦GÐïÈrïÇr1zúÝÝÿÿÿÿûïÙ.ÐPï‚GÐï§r1ZúÝÝkâÝkûï‡.1HúÐkïrÝ«øêÝ«üÝkûï¬-1ÿÝkÝÿÿÿÿûïŒ.ÐPï5GÔï[r1úÝ«üÝkâÔï7rÔïEr˜a»ü1óùÑï#rÔïrnÐï*êPÖï#êÝPßïsÿßïµVûïbÚÝïðqÝßï Vûï§!ÝPûïÔGÝPÝÝûï5öÿÿÝPÝkûïNBÝPûï#ßï)ÿûï|ÐÔï¸q1fþÝï›qÝkÝ«üûïBÝPûïÚ"1ÅþЫøïcF1BùÝïrqÝkÝ«ðÕàïtq
ßïÿûïdÏÕk	Ñk@ßïÿûïJÏÐkÉ@k~Ý«øÝ«ôûï²AÝPûïo"ÔïýE1Üøàïq
ßïÕþûïÏÝ«øÝÿÿÿÿÝkßïqûï>ÈÝÝkÝ
ûï@õÿÿ1pýÝÝ«øÝHéÝÝ«øÝ6àÕ«ü
ßïžþûï}ÏÝ«üÝ«ôâÝkÝݾЫüï{E1ZøÕïŽp
ßï‰þûï‰ÎÝÝ«øÝÝûïÕôÿÿÝPÝHûïÆôÿÿ1þÝÝ«üÜÐï_pÅ«üP•@ïgp1øÅ«üPÐ à|1õ÷Ýkûï”01…ýÝïpÝkÝ«üûï›@ÐPkÝPûïU!ÐkPÝ ûï31»÷ÝkÝ«üûïs@ÝPûï?1£÷ÝïÓoûïC1ÄûÝkûï8ûïá61€÷Ýkûïû71t÷ûïI;1j÷ßïÅýûïeÎ1Z÷ûï½:1P÷×ï„oÑï~oÔïuoÝïooûïtFÂï•ÿÐïÿPÐ`ï‡Âï€ÿÐïzÿPÐ`ïv1÷Ñï5oûï{)Öï%oÑïSÿ¤q
ßï]ýûïgÍÐï=ÿ4ÿÀï-ÿÐï'ÿ"ÿÀïÿ1ªöÝ«üûï¤f1öÑ«üÿÿÿÿóÝ«üûï;nÐïÀn1öÝïsdûï<mÝïbdûïnàï\dàïTd	ÐïŒnÔï„nÝûïÛóÿÿ1:öÝï.dûïßmáï$dÐï\nÝ«èûïÊZÝPÝÝ«øÝLûïÞGÝPÝmûïÏGÝPûïìeÝïØcûïm„ÝïÍcûï~máïÃcÐïûmÕ«ø
Ý«øûï²eÝ«ôûïnlÝï”cûïImàïŽc´áï†c18ÿ1,ÿÕï¹m
Ýïicûï6lÝ«üûïmûïƒôÿÿÝïKcûïmàïEcàï=cÐïumÝ1îþÑï"cÿÿÿÿßïµûûï\ËÕïNm
ÝïþbûïËkÈïøbÕïJýOÔï*m1éôÑïÝbÿÿÿÿßïzûûïË
ÝïÁbûïŠkÈï·bÈïòlÝïýûïmkÕïÛl©ßïJûûï–ËšÐïüïûÝÝÝûïRFÐPWѧ ÅïÞPÝà|ßï"ûûï”ÊЧPïPPÊPï§QÉQP§Ý«üÝWÝ$ûï	FÐPWݧûïH̘agÝݧÝlûïæEÝPûïdÈï:lÝï\üûïµj1öþÝÝÝ4ÝÝÝaûïÙ^ÐPWЫüï@Ðï:§ÝÝWûï=Îï+PÅïQ÷Pá |ÅïPÝà|1âþÝÝÝ4ÝÝÝaûï}^ÐPWЫü§ÝÝWûïì1ÖüÝ«üûïWñÿÿ1ÉüÐï‰kûïÒñÿÿÈï;a1:óûïeðÿÿÕïkk
ßïúûï&ÊûïãjÐPïaûïÕjÐPïü`ûïÇjÐPï@ÝP1_üûï´jÐPïÿ?ÝPûïŽWÝPÝ«üÝmûï¤DÝPûïÁb11üÕïòjûïwjÐPïÂ?ÝPûïeiÎï°?Ý«ø1üûûï·ïÿÿÕï½j
ßïùûïxÉÑ»üЫüPÕ ÐïX`ûïjÐPïF`ÝPûïõiÐïzjûïjÐPï$`Ñï&`
Ý«üûïEÊ1òÝï`ûïÁVÝPÝ«üÝmûï×CÝP1MûÕ«ôÝ«ôûïéaÕïj
ßïõøûïÖÈûïùîÿÿûïŒiÐPï³_ûï~iÐPï¡_ûïpiÐPï»>ÝPûïFiÐïËiÕ«ü1mÿÈï|_1{ñûï¦îÿÿûï9iÐPï\_ÝÝÝÝÝ«üûï¾[ÝPÝlûï#CÝPûï@aûïiÐPïL>ÝPûïïgûïðÿÿ1)üÐï[iï.>ÔïPi1öÝkûï:\ÐPï>Ыüï5i1ìðÐ;«ü~ÑïNõ`sÑïCõUhÑï8õJÑï/õATÑï$õ	ÑïõBÑïõ$Ñï	õÑïõÑï÷ô	ÑïîôÕïÙø
ßï§÷ûïpÇÝkÝ«øÝ«üûï7B1)õÑï¾ô£ÑïµôܘÑïªôÑï¡ôÈ„ÝkÝ«ôÁ«ø~ÂÝkÝ«øÝûïòAÝPÝ«ðÝ«ßïj÷”Ýûï°TÝPÝ«üÝk‘ÝÝkÁ«ü~†ÐkPËÏÿÿÿ PÑP ÐkPËÏÿÿÿ PÑP0ÓßïE÷ûï¿ÆÐkïÎ<1­ïÝÝk1CÿÝûïSTÝPÝkÑ«üNÐPÐ	PÝP1"ÿÝkûï+^1IôÝkÝ«øÝoûïBAÐPï{<˜a°˜aÿn<Ðïh<PРï_<1>ïÝ«ü¹ÝÝ«üÝ«ôÝûïAÝPÝ
1ÁþÝÝ«üÝH1³þÝ«üÝ«øÝF1¤þÑ«üD-Ý«øûï0SÕP
ßï‘öûï#ÅÝÝ«øÝûï¯@ÐP«øÐkï@ýÝÝÝûï—@ÝPÝ«øÝE1KþÐkïýÕïØfXÅïýPÕà|HÅïÿüPÝà|ßïKöûïyÅÝÝÝÝÝÝaûïbYÐPWÐïËü§ÝÝWûïÎÝÝÝûï@ÐPïN;Îï¨üPÅkQ÷Pá |1îÝûïÈRÐPï);Ðï‡ü Ðï;P2@ ÕkÔÝûïsÐï;QÐP¡Ðïö:PС 1ÏíÝÝÝûï ?ÐPïÙ:pï;ü 1°íûï±+1yòÝkÝ«üûï^6ÐPï±:Ðÿª:1ŽóÝÿÿÿÿ1õÝÝÿÿÿÿÝÝûï
êÿÿÝP1ÐôÝÝ«ô1ÈôÅ«üPÕà|*ÝÝÝ$ÝÝÝaûïDXÐPWЫü§ÝÝWûï³Ыüï›ûÝÝÝûïò>ÐPï+:Îï…ûPÅïyûQ1ÖþЬ[á[ ï[~ßï£õßïåIûïzÍÞïØIPÐKï;õPÂ^Ô­üûïÕÂÐPï‚.Ð[1þÐK¼Z‘j-ÖZ‘jXpÐK¼P‘`-1ÝЭüPÖ­üÑPÑPìÑ­üvÞï<8PtÑPe\ÑPi+ÑPtBÑPxÖï›ôÑPdËÖï2ûÖï.ûÖZ•jt˜jPÑPb×ÖïÎæÖïÒÞÖïÎÖÞïÖ7PÝPÑ­ü	Þï;÷PÞï4÷PÝPÝK¼ûïpÆÕP ÝK¼ßï÷ßï¬7ûïaÇÝûï×Ö[Ñ[¬1ùþݬݬûï¨qÔ[Å[PÐà|ò@[íûïLûïÇÂûïtÄÐïãùÔï…8Ðï†8Ð ï‡8Ð ïˆ8˜@ï„8Ð ïu8Ðïf8Ðïƒ8Ðï€8Ð ï}8Ð ïz8Ðï38ÐïHcûïÙêÿÿûïš#ÕïÐPÔPÝPûï°eÕïxÐPÔPЬ[2¬PÁZQ2Aï‹+RÈPR÷RAï+˜‹ZàЬ[ЬZÐï`+Yö[i×ï^6ÐïZ6PÖïS6š`P
ßïD6ûïÉÐP[Á[PÒZQ2@ï,+PÊQP
ÑY{D¹ÖY²ßï6Ý[ûïjÖÁYPÐPï÷*”`ÝßïŽõûïIÿÿÿÝßïµõûï:ÿÿÿÝßï±õûï+ÿÿÿÝßï¹õûïÿÿÿÝßï±õûï
ÿÿÿ¨ ï+ÔZÞïóJï¢+ó€ZìÞïó[À[2kPÖPÐ[@ï+µkìÞïsõY˜‰PÖPÞïåò@ïc+•iëÞïŠõY˜‰PÖPÞïÏò@ïE+•iëÞïvõY˜‰PÖPÞï¹ò@ï'+•iëûïúÔY×ï5Ðï5PÖïý4š`P
ßïî4ûïGÈÐP[ÑPïé,8Ð[PÑPÿÿÿÿÑP
XÑP\d1ôxZPÈïh÷P1ßïóôûï¿Ñï©,"1fÕïÁù1+Õ¬	ÑY¬1…ÝûïÙ'1yßïÄôûïÛ¾Öï÷º×ïW4ÐïS4PÖïL4š`P
ßï=4ûï–ÇÐP[ÑP61Ø1ÑP21Ë1èÑP01¾1¬ÑP
1:Öï®ö1íþÐ
Z1.ÐZ1(Ð	Z1"ÐZ1ßïÝ3ûï6ÇÐP[Á[P³@ïÇ(SxZPÃ0[QÉQPZ×ï³3Ðï¯3PÖï¨3š`P
ßï™3ûïòÆÐP[Á[P³@ïƒ(xZPÃ0[QÉQPZ1®ßïl3Ý[ûïÃÓ1œÑP11ŽÑP3øÃ0[Z×ïI31aÿÐïB3PÖï;3š`P1[ÿÑP4ÙÒÑP5ÒYÑPn1ÿ#ÑPb1ÿÑP78­ÑPf-ÐZ+ÑPt1÷þÑPrÐ
ZÑPv1áþÐ[ZÐZZÑïÊ*'˜ZZÕY1óýÐZPÐPï[õ?ÕïÏ÷+Õ¬ÑY¬ÝZûïí%!ÑY¬ßïöòû﮽ÝYšZ~ûïÊaÖY1SýÐYPÖYÝPÝûïµaÝYÝÿÿÿÿûï¦aÐï3PÐY@ï‹38ÕY
ßïÎòûï–¼ÑYÕï­îÕï¡îÑY
ßïÀòûïo¼
ÑP
FÑP*I×ïä1Ðïà1PÖïÙ1š`P
ßïÊ1ûï#ÅÐP[ÑPÿÿÿÿÃßï›òûï ¼ÖïSô·×ï›1Ðï—1PÖï1š`P
ßï1ûïÚÄÐP[ÑP/ßïk1Ý[ûïÂÑ1uÿÂ^×ïS1ÐïO1PÖïH1š`P
ßï91ûï’ÄÐP[ÖPxPPÐàŒEZ2ªPÏPGX&R_j‰ãñ›G]­ü(-nÁÿMÝ[ßï°òûï«»ßïÇòûïž»1zÿÝ[ßïÄñûï:»ßÞï´!ï¯%ÝÝ[ûï4úÿÿûï¹ÐP[Ð[PÕ[1<ÿáï
]˜@PÓïü\ÐPÔPÝPßïg!ûï
ÝPûïÃ2ÐP­üÅPPž@ïØ\Y‘©
0Õï¿\(Ðï³\ï²\2©~2©~Ý©ûïÜàÿÿÐPïi1Ð!Péï\	Ðï„\PÔPÐPï|\ЭüïD1ÐPÔï¢òÞïà ïÛ$ÝÝ[ûï`ùÿÿ×ïÒ/ÐïÎ/PÖïÇ/š`P
ßï¸/ûïÃÐP[ÑP.1ÔÑPE1ÑPXÑPeëÑPx1r‘ïn 0•ïf 
ßï~ðûïÔ¹ÝÝ[ûïÛøÿÿÞïG XGxï÷ñïòñ˜hPá@ï¨.˜hPÂ0P˜hPá@ï”.˜hPÂ7P
˜hPÂWPÀPï¹ñÖX•hµÓÿÿï¨ñ1iÐï401eÐïã.PÖïÜ.š`P1jÝÝ[ûïOøÿÿ×ïÁ.Ðï½.PÖï¶.š`P
ßï§.ûïÂÐP[ÑPe	Ñ[Ed×ï….Ðï.PÖïz.š`P
ßïk.ûïÄÁÐP[ÑP+Ñ[-eÿG#ÖïA#ßïA.Ý[ûï˜Î˜e[ÝÝ[ûï±÷ÿÿßï!.Ý[ûïxÎßï
ûïhßï.Ý[ûï[Αïí0+ÞïåX•h1åþxï‘ðïŒð˜hPÂ0PÀPïðÖXÜÞï¹XÅ
ïkðP˜hQÀQPÃ0Pï\ðÖX•häËÿïKð­ø
Ñ­ø€ÿÿ1—þÔïÌ.×ïz-1þßïo-ûïÈÀÐP[ÑPL	Ñ[l	Ðï˜.ßïD-Ý[ûï›ÍÐP×ï1-Ðï--PÖï&-š`P
ßï-ûïpÀÐP[Á[P³@ï"!ßïù,Ý[ûïPÍÞïâïÝ!ÝÝ.1þÐïSYßïÑ,Ý[ûï(Í2ªï.2ªPÐ"ïÀ$ÐPÐ'ïµ$ÔïWïÝûïˆ÷ÿÿÔïà-1VÿÔXÑXF×ï€,Ðï|,PÖïu,š`P
ßïf,ûï¿¿ÐP­øÑP`ÑP
6ßïuíûﶶ”Hï1ÑX
ßïtíûï¶ßï‰íûï¶1}ÿö­øHïÖX1zÿ×ï,Ðïÿ+PÖïø+š`P
ßïé+ûïB¿ÐP[ÑP*1ÿûïØùÿÿ1túÖïwîûï¦1dú×ï·+Ðï³+PÖï¬+š`P
ßï+ûïö¾ÐP[ÑP=1´þ˜QïÏ,ÐP×ïy+Ðïu+PÖïn+š`P
ßï_+û︾ÐP[ÑP-˜Oï”,ÐPÑ[>1eþÐï±W˜Eïy,Ð P×ï#+Ðï+PÖï+š`P
ßï	+ûïb¾ÐP[ÑP+1 þ˜Nï;,¥×ïç*Ðïã*PÖïÜ*š`P
ßïÍ*ûï&¾ÐP[ÑP&1äýÐï,Ðïú+P×ï¦*Ðï¢*PÖï›*š`P
ßïŒ*ûïå½ÐP[ÑP|1ŸýÐï»+¹×ïg*Ðïc*PÖï\*š`P
ßïM*û尿ÐP[ÑP<˜@ï‚+ÐPÑ[=1Sý˜Rïn+ÐP×ï*Ðï*PÖï
*š`P
ßïþ)ûïW½ÐP[ÑP>
˜Bï3+¯Ñ[=1ý˜Tï!+±×ïÍ)ÐïÉ)PÖïÂ)š`P
ßï³)ûï½ÐP[ÑP='1‹ÑP+(1aÑP&1ž1IÑP%1ˆ1¦ü˜PïÁ*1ïýÐï·*ÐPÐ	ï¬*×ïZ)ÐïV)PÖïO)š`P
ßï@)ûÐP[ÖPÀPP³#à„D
ßï¤êûïU´ßï)Ý[ûïlÉŸÐïO*¡Ð=ïF*Ð?ï=*„Ðï4*1zÿÐï**1pÿÐï *1fÿ×ïË(ÐïÇ(PÖïÀ(š`P
ßï±(ûï
¼ÐP[ÑP<Ý[ßïFêûï	³˜Aï×)1ÿ×ï‚(Ðï~(PÖïw(š`P
ßïh(ûïÁ»ÐP[ÑP>Ý[ßï
êûïÀ²˜CïŽ)1ÔþÑP*1-ÿ1]ûÑP/1+ÿÑP-1»þ1HûÑP<1Fÿ1=ûÑP^1-ÿÑP>1vÿ1$ûÑP|1
ÿ1û˜ïÜZàJïP'ÎPÐZPÏPa0€…Š”™ñÿžñÿñÿ£ñÿñÿñÿñÿñÿ¨­²¸¾ÄÁÔ[~KïæYÐiP˜`PÑPZ¬ÝißïvûïÇÕP#2©PÏPj‘¡­¿Ïßßïméûï²ÀYºÐ[­Ð[¨Ð[£Ð	[žÐ[™Ð[”Ð[Ð[ŠÐ[…Ð[€Ð[1zÿÐÿÐ[1nÿÐ[1hÿÐïsSïrS2©~Ý2©~ûï×ÿÿÐPï*(Ð!P2©ï(Ðï(P2©ï(Ð"PÐï3SÐïü'Ð#PÐï!SÐïê'ìÐïSÐ1ïÚ'ºÐïýãÞïwïrÝÝ ûï÷ïÿÿ×ïi&Ðïe&PÖï^&š`P
ßïO&û塀ÑP(BÞï5ï0ÝÝ ûïµïÿÿ×ï'&Ðï#&PÖï&š`P
ßï
&ûïf¹ÑP"Gßïüçûïj°1ÔÑ[
ëÑ[ÿÿÿÿâ×ïí%Ðïé%PÖïâ%ö[`ßïÓ%Ý[ûïBÃ×ï´%Ðï°%PÖï©%š`P
ßïš%ûïó¸ÐP[ÑP"šÞï}ïxÝÝ ûïýîÿÿ×ïo%Ðïk%PÖïd%š`P
ßïU%û﮸ÑP)1Eÿ×ïP%ÐïL%PÖïE%ö
`ßï6%Ý
ûï¥ÂÔP×ï%Ðï%PÖï%š`P
ßïø$ûïQ¸ÐP[ÑP#Ñ[ÿÿÿÿßïÚ$Ý[ûï1ÅÞïÂï½ÝÝ ûïBîÿÿÔZ×ï²$4ßïª$ûï¸5ÐïŸ$PÖï˜$š`PpÅ
ZPÀ[PÃ0PZ×ï~$ÌÐïz$PÖïs$š`PÐP[àKïÖ#ÑßïZ$Ý[ûï±ÄÐZïúæÞï<ï7ÝÝ ûï¼íÿÿ×ï.$‹ßï&$ûï·ÐP[ÑP
1üþÞï2àY/ö[i×ï$Ðïþ#PÖï÷#š`P
ßïè#ûïA·ÐP[ÖYÑ[
Ì”i1ºþЬ[Ý[ûï'¸ÁPZÑZïÌ>2ïÁÑZïºÐZï±Ýï«ûïhÄÐPï™ÕP
ßï¦åûï@®ÝZÝ[Ýï~ûïß·Ðïq[ÀZïiÂZïfÐ[PÂ^ЬYÔZxZP˜‰QÁPQZ•iñïZPÇõPQÄõQÃQP­øЬYÞï'­ü1©Õ½ü5ÝõÝûï~±ÐPX
ßï.åûשּׂÐX½üÁÔXPЭüQÐP¡x­øPÁ½üP[ÐZÕk!ЭüPÑ ÷LÖ ÝYûïÓþÿÿÐPkÐkP‘»iÝYÝkûï)ÂÕPçxZPÀP[ÀZЭüPÑ[ ÂÔ[ÑZõ¢À­üÑ­üŒH1Jÿßïªäûï­Â0^Õ¬Ѭ¼
Ѭ|@
ßïcåûïà¬Ð¬PР­ü
ßïVåûïȬÅ­üPž@ï|N[Õï!åIÝ­üÝkßï8åûЬPÝ ûï3¯Ýï1NЬPÝ Ý ݬûïéèÿÿÝPßïåûïR³Ý¬ݬûï÷ЬPР­øÝ­øݬûï?!ÐP¬Ы­ô˜«	­äÕïŸälßïçäûï³Ý­øûﺮݬûï€èÿÿÝPßïÒäûïé²ßïËäûïܲݭôûݭä2«~2«~˜«~ûïDèÿÿÝPßï®äûﭲѭô •«KÕ­ô	Ñ­ô1ïÑïJM4Ñ­ô.ЬPÏP&&&&&&&à¬Ýkßïsäûï«ÕïÕã
ßï¼äûïB²Õ­øÝkßï¹äûïôªÐ­ø«ö¬«öïÚL«	2'Ø«÷ïã«Ѭ
Ѭ	Ѭ1÷ï—!«ÝûïhÑÿÿÝÿÿÿÿûï[ÑÿÿÝûïRÑÿÿÝ­üûïHÑÿÿ1ùÝÝï¬~Ý[ûï¢Ý­üûïš1Ñ­ø­ô172«­ìЬPР­èЭø­à/ЭèPЭìQÐ@ï!Aï!Ö­ìÖ­èxþ­àPÊPï­àQÉQP­àÓ0­àBËÏÿÿÿ­àPÑP0ØЭìPÕ@ïà °Ð­èPÕ@ïÓ ¸Ð­ìPЭèQÑ@ï Aï¼ ¡1«Ñ­àÑ­à	Ñ­à
 ЬP2«QÑQ Ѭ
ѬѬy˜«­ðÕïVâÝ­ðûïNæÿÿÝPßïóâûï·°á¬"ÝÝï¬~Ý[ûïÕP7Ý­üûïƒЬPÏP$¢Ö$¶ì]$×]×'<׌/ѬѬà¬1àˆ «
ÃïµãPÞ@ïUá­ÜÕ½Ü1³Å½ÜP‘@ïK
îŽÜP‘@ïøJߎÜPá@ïêJÐk­ØŽÜPÐà|­ÔÑ­Ø­Ô1]­ܫЭðPÏP+%zÿ+zÿzÿzÿzÿzÿzÿzÿzÿ+zÿzÿ+%1UÿÕ­äøÑ­ðÑ­ðêÕï\Jâö«ËÏÿÿÿ­øPÑP Эüï|àÑ­ðÑ­ð»Ñ­ð´ö«Ý«ûï–IÑ­ð¬žÑ­ðÑ­ð‘Ñ­ðŠö«ËÏÿÿÿ­øPÑP Эüï$àÑ­ð¬1½þßïëIÝ[ûï"ÕPêѬ1jþÔïÏI1aþÑ­ð¬1ŽþÐï¼IPÖïµIÑ«PêÝ­üûïÇ1nþÑ­ð÷ö«ËÏÿÿÿ­øPÑP ЭüïªßÑ­ð¬Õ2«PÕ@ïGÈÑ­ðÑ­ð»ÝkßïÑàûïF§ß­üûïžÐP[1üÑï&I­äDѬ>Ѭ8Ѭ2ѬÑ­ä&Ý[ûïi!ÐP­üЬPЭü Å­üPž@ïþH[1ËûÝkßïyàûï٦ѬËÏÿÿÿ­øPÑP ЭüïïÞï­øPÑP
ÑP	ÑP
ЬP÷ «
ï­øP÷P«ЬP÷ «á¬1öûЬPÏPC¡TäTww²""²""¡"Ó¡ÕïßÝ«2«~2«~ßï
àûïq­ßïZÞÝ[ûïqÎûï¦GÐP«ËÏÿÿÿ­øPÑP µÐ­üï6Þ«ûïƒGÐP«ö«	Ѭ–ÝûïÀFÝ«ûïHGûïYGÐP«”«	1pÿßïËGÝ[ûïѬ17ûÔï³G1.ûÐïªG«Öï¢G1ûËÏÿÿÿ­øPÑPOxøï­ÝPÁP«ÂïœÝËÿï‘ÝPËÿï	àQÑPQjšïýßïøßËÿïiÝPJšï`Ý«šïXÝP×PËÿïJÝQÉQPïAÝšï;ÝPšï¸ßQÑPQÊÿï§ßšïÝPÈPï™ßÑï×F1„þˆ«
1}þÑïvß–
ßï³Þûï
¥Ðï\ßPЬ@ïúÜÖïLßÑï¾Öÿÿÿÿûï"FÔï‚Fûï¦ÔïiFÎï–ÖÐïÖï<Ðï<ï<Ôï<Õï¤øDÑïpÖp
ßïFÞûÕïÖÞ
ßï>Þûïo¤ÕïÕ;
ßï?ÞûïZ¤Þï$:ï'ÖÔï¡ÞÔïÜ2ïÜÐïÜïÞÐïÐEÔïŽ;Þï”;ï‡;Ýûï˜D˜@ï^ÞÑïhÜ
ßïÞÝûïÔªÔ[1‡ÐKïàÛZ{ÅZPž@ï’EYÑï7Ü(ÝZÝißï´ÝûݩûïM¦ßï§Ýûѩ)ÝÝÝÝÝÝaûïõ7ÐPXÐZ¨Ý	ÝXûïeöÿÿßïÇÝÝYûïZÖ[Ñ[ï±Ý1mÿûïåOÝûïÎCÝûï£CÖï-ÛÝï‡Ýßï)ÛûïpEÔïtÝŬPž@ïÌD[ЫPÏP
2˜ Ðï—Dï–D2«~ÝÝ«ûïÂÈÿÿÝÝÝÝÝÝaûï,7ÐPZЬªá¬ÐP
á¬Ð	PÐ
PÐPªá¬Ð
P
á¬ÐPÐPÝPÝZûïiõÿÿ†á¬1~ÿᬕ1vÿÓ¬Œ1mÿÝÝÝÝÝÝaûï³6ÐP[Ь«Õ¬ÝÝ[ûïõÿÿÝïÐCûïóüÿÿÝï³CûïæüÿÿÝï¾CûïÙüÿÿÔï±CЬï¡CÝÝÝÝÝÝaûïL6ÐP[Ь«Ñï|CÐïbCЫլ<Ý
/Ñï_CÐïECÐ	«Õ¬ÝÐï1CÐ
«Õ¬ÝÝ[ûïqôÿÿЫ¬ݬûïHüÿÿլŬP÷ïFÙà |ÃïªÛPÀÂ^Á¬PÐ@ï?ÙZ7Ðï­üÝûï“ÇÿÿÝÿÿÿÿûï†ÇÿÿÝûï}ÇÿÿÎï÷Ø~ûïoÇÿÿÅZP2à|­üÕï_Ù*Ý­üÕZ
ÅZPÐà|PÞïøÚPÝPßïÐÚûﯧáïpBÐPáïcBÐ	PÐ
PÐP­øЬPÐ@ï›ØïFBÐï@Bï?BÁPPÐ@ï€ØïBÁ­üPÐïü@ïúÐYÔ­ðЭð­ôÁ¬Z1ËÐJïPØWÝWûï®ÆÿÿÕW	ÑW@
ßïWÚûï, ÅWPž@ïáA[Ñ­ø
Ñ«­ðЫ­ðÑ«­ôЫ­ô÷­ü«m2«~Ý«ûïwÐPXá«ï«V2«~2«~Ý«ûïÐPVÕVÝkßï÷Ùûï' ÑVïfAÐVï]AÇXYPÄXPÃPYP
ÇXYPÖPÅXPYÖZÑZïÝÙ1)ÿÝÿÿÿÿûïÛÅÿÿÇYï$APÄYPÃPïAPÇYïAPÖPÅYPïAÑ­ø
7ЭìÝ­ìÝÝ­ìûïmÐPïä@Ý­ìÝ­ìûï©ÐPYÁ­üPÐY@ïŸÕïÁ@
ßïdÙû羽ЭüPÐï¨@@ïzÁ­üPÐY@ïmÁ¬PÁ­üQÐ@ïÌÖAïVÑï,×1ŠÁ­üPÝ@ï>Á­üPÝ@ï2Á­üPÝ@ï&ЭüPÝ@ïÁP~Á­ü~Á­ü~Ý­üßïìØû	ïU¥Á­üPÐ@ïñZ%ÝJïçÅJïßPÝà|ßïÞØûï#¥ÖZÕJïÂÒÁ¬PÐ@ï$Öï×?ЬïoØÝ­üÝÝ­øûïøÃÿÿݬûï¨ûïýøÿÿŬPÐà|PÑP@ÑPÑP6ÑP ŬPÝà|ßïeØûï`ŬPŸ@ïf?ûï±ÐP¬Å¬PÐà|ŬPö	@ïJ?ݬûïRøÿÿЬ[ЬZ(Ñ[#Ñ[Ñ[Ñ[Ñ[Ñ[

Ý[ûïBÔYÑP0ÀYÑY3Ð[PÃY QïYQPPÊÏÿÿÿPÑPàÑPÑP ÑßïÛ×ûïÐPï[PÏP
+óÿóÿóÿóÿóÿóÿ+óÿóÿóÿÕÁZPÐ@ï\PÐPÂ^ЭøÔ­üЬPíü Qï­üQPPÊÏÿÿÿPÑP2ÑPÑP ßï†×ûx­øPÑP0ЬPÄ@ï­øÖ¬À­üÑ­ü©Ð¬PÕ@ïèßïg×ûï÷›Ð PЬPÅ­ø@ïÈPÂ^ÑïÖ¬Ñï„Ö¬
ßï:×ûïœÐïmÖ­üÇ ­üPxPPÃP­üPÇ ­üPÖPxP­üÑ­ü¬ÃïBÖ¬[Ý[ûïàIÃï/Ö­ü[Ý[ûïÍIÃïÖ¬PÇ P[Ý[ûï±@ÃïÖ¬[Ý[ûï¥IÑïõÕ¬
ßïÊÖûÂ^Ðï×Õ­üǬ­üPĬPÃP­üPǬ­üPÖPŬP­üÝ­üûïÿÿÿÑï®ÓݬßïÖûï¢Å¬Pž@ïß<[˜«ïÂ
Ñï°<	Ñï§<Ðï©
Ðï£
PÏPFGGFÔï8ÕÔïBÓÔïp
Ýï&Õ2«~2«~Ý«ݬûïKËÏÿÿÿ«PÑP0ÐPÐPÐPïÓÝPûï;2«~Ý«ûïýÿÿÝPûïÖ:Ý[ûï«>‰ÕïÊÒݬݬݬݬݬßï©Õûï$¡ÕïÞ	
ÞïnïÑ	À$ïÈ	ÐïÂ	PÔ Ðï¸	PЬ Ðï¬	PЬ Ðï 	PЬ Ðï”	PЬ Ðïˆ	PÔ ѬÁ¬PÐ@ïZPÔPÐïg	QÐP¡Ðï\	PЬ  ËÏÿÿÿ¬PÑP0.ݬÁ¬~ЬPïPPÊPï¬QÉQP~ûïµüÿÿÐPÿ	/ŬPá@ï-;ŬP˜@ï ;PïPPÎPÿóÔÿëÑïé	Ñïà!ËÏÿÿÿ¬PÑP0Ѭ
ßï—ÔûリËÏÿÿÿ¬PÑP0ЬPïPPÊPï¬QÉQP¬Ö¬1…þѬPÐïPРPÐ@ï]¬Å¬Pž@ï:[‘«à«
ßïSÔû輦Ы¬2«¬2«¬À«¬1/þÑï2Ñï)1ÐïPÑ Ñ |ÑïŒHoÐïùPËÏÿÿÿ ðPÑP0ZÐï£ÒûïÐïÖPÝ  ûïíûÿÿÃ$ïÄPÑPŒHÐï´PРìPÐ@ïPÔPÝPûïØÿÿûï1ÔPÕïŽ	ÝûïYüÿÿÕïu9ÐPÐPÝPûïH8ÐPZûïê8ÐP[ÝPûïÄ8Ôï
ÒÝûï¿×ÿÿÕï79	ÐïÐPÐZPÝPûï8ÝÝÝûï·ÐPYÎ[©ÐYPݬûïx%ÐP[ÝÝ[ûï>DÝ[ûïÕ˜ûïè€Õï ÏÝïŒÑßïåÒûïžÐïÁPÑP1©ÑPøÑPóÞï<ïŸÐï™PР[РZРYРXËÏÿÿÿ[PÑP0qÐJï\
WÝÿmûï@ûÿÿÇÿ`ïÑXÑWXÝYÝZÝ[ûïÚùÿÿÝPûïaúÿÿÐWXÕWÑWX
ßï_Òûï,–ÕX
ßïdÒûïß–ÐXJïõ!Ñ[Ñ[	2ÝYÝZÝ[ûï…ùÿÿÝPûïúÿÿÔï”ÐÝûïµúÿÿÔï‘ÐÔïÓÑXÉßï#Òûï•ЀЬ[Õï²1¤Ñï§	ÑïžßïÒûï•Îï‡1{Ñï~	Ñïu=ûï·9ÐïaPРï”ÍÝ[ÝÝÝûïéÝPÝ:ûïÞÐP[Ý[ûïø.Õ[ÕïòÍßïºÑûï•1ÑïÖÍÝ[ßïªÑûï<œÐïöPРWРYРXÕÿã	ÎÿÛZÝXÝYÝWûï]øÿÿÐPZÐïÂPÝ  ûïÙøÿÿÝ[ÝXÝYÝWÝÝÝûïl)ÝPÝ:ûï7ÐP[˜a»Ы«Ô«Ý«ûïG0ÐP«Ñ»˜a»ЫPР«˜nkÑZ #Ñ»ßïÑûïO”;ÝZÝ«ûï‡A-Ñ»ÝZЫPp ~ûïúAÝZÝ[ûïß/ÝPûï\BûïÝ[ûïè•Â^ÑïïŒHÐïáPÕ Öï¡ÌÂ$ïÎÐïÈPР[Ñ[PÖ РZÐJï˜
X¸ÅXPž@ïº5­üЭüPÐï–QÁ¡  ~ЭüP2 ~ЭüP2 ~ЭüPÝ ÝXûïeùÿÿËÏÿÿÿ[PÑP01iÿÐïXPÖ РYÐïJPРPÑY@ï%

Ñï5ŒHÍÐÿ(­øÐï PÅ­øYQÁQ  ~ÐïPÝ Á ~ÐïPРPïPPÊPÐïíQï¡QÉQP~ÐïÜPÝ 1_ÿÂ^ÐïÉ­ü Ðï¿PÕ 
ßï}Ïûï²’Â$ï¥ÑH-Ðï’PР[Ñ[
ËÏÿÿÿ[PÑP0ÏÐïuPÕ ªÐ ЭüïcÕï"ËÝïÍßï Ïûï…™ÕïË×ïËÂ$ï/Ñï)ŒHÐïPÕ àÔ ûïþÿÿЬ[ЬZÐjYÇ[YPÄ[PÃPYP
Ç[YPÖPÅ[PYÃYïsýPÑP¬ÑïÚ3ßï¿ÎßïÐÎûï’Á¬YjÐYP€Â^Ь[ЬZ2«~Ý«ûïwôÿÿÐPYÐjXÐX­ü2«~2«~Ý«ûïõÿÿÐPW‘«@ÃXïýüPÑPW
ßï€ÎûﮑÁWX­üÇY­üPÄYPÃP­üPÇY­üPÖPÅYP­üέüX:‘«	‘«ÑW ß­üÝÝ ûïÿÿÿÐPXÃW­üXß­üÝYÝWûïïþÿÿÐPX‘«Ñ«'ØÿÿÐX«ЭüjÔPÑX«óÐPÂ^Ь[Õ¬
ЬPРPЫPÐPXÕ¬}ЬPРPÏP¨°µw¨°µÕ¬1˜ßï´ÍûïwÐZ1•ÇZït2PÄZPÃPïi2PÇZï_2PÖPÅZPïT2Õ¬
ßï–Íûï8ÔPЫP…Õ¬
ЬPРP2«PÐP­üÁPPÐ@ïïZЭüPÐ@ïãY"ÐZÐZYÐZöÐZ
Ý«ûïr5ÐPZÐ YѬYßïÍûïÉÐY¬Õ¬1LÿÇZïÀ1PÄZPÃPïµ1PÀ¬PÑPY'ÇZï¤1PÄZPÃPï™1PÇZï1PÖPÅZPï„1Õ¬*Ãïy1ïøúPÑP¬
ßïÄÌûï¨À¬ïX11ÿѬ Ñ«ïG1É@¬P˜«QÑQPÐPÐï)1«Ãï!1ï úPÑP¬
ßï€ÌûïPÀ¬ï1ÐX«Ý[ûï41®þÔZÐïÎ0[?ÑïÉ0Ð[1Õï»0Õï¿0ßïDÌûïûï«=ÐP[Ñ[ÐZÝ[ݬûïÔáÿÿÑ[Ñ[ЬPÝ ûï‚óÿÿûï‰÷ÿÿÕZЬPÝ ûïi=Â^Ь­ôЬ­øЬ­üЭèÔ­ðЭìÔ[Ñ[aÐK­ôPÏP9K=K=K/ßï¤ËûïŽÐPÑ­èéЭèÖ[µÑ­ìÛÐK­ô­ìîÕ­ðÎÐK­ô­ðáÕ­ðЭðÑ­ìЭì­ðÑ­è6Á
­ðPÑ­ðÑ­èšÑ­ì”Ñ­ìÐPÐPÑ­ðÂÑ­ì¼1vÿЭðPѼ!
ßï&Ëûï½Õ¬ÔPÑïÆÝßï&ݬûïhЬPЬQР¡ЬPÐï ݬûï‘ЬPЬQР¡ЬPР[РZ1ËÏÿÿÿ[PÑP0ÐZPÖZÝ@ïÓû盧ÿÿï[PÊPï[QÉQP[Ó0[ÊЬPÝ ûïœ;ЬQÐP¡ЬPï PÐP[ÑPÑ[	
Ñ[
ЬPÐ[ ЬPЬ[ÐkZ˜akÑZË«PxPPÈPï«QÉQPXÑZHÀXÑZ6À XЫPРY˜a»ЫPÐX Ý«ûï¢ÿÿÿÑZ6	ÝYûïâ²ÿÿЫPР«ЫPР«€Ь[ЫYËÏÿÿÿYPÐPW!ïYPÊPïYQÉQPZÐWXËÏÿÿÿZPÐPW>Õ¬ÑïÄ-
ÓïÆ-Ð	¬Ѭ	Ѭ1™ÑïŸ-ôÑYFÐY1…ÑX0
ÑW ßïNÉÑX ÑW0ÑW ßïUÉûïm‹ÔYïZPÊPïZQ1nÿËÏÿÿÿYPÑP0Ö« Y0ËÏÿÿÿYPÑP #ßï2Éûïð‹ËYPxPPÈPïYQÈQPÐPYÕï-0ËÏÿÿÿYPÑP #ßï ÉûïôŠËYPxPPÈPïYQÈQPÐPYÐY«Ь[ÐPÑ[ÐPÑ[ÐPÐ[PÕ¬=áïª,Ь/áïœ,Ь!Õïƒ,ЬÑïu,Ð	¬Ð¬ËÏÿÿÿ¬PÑP =ЬPÏP155$5$$$$$$$55$$55ßï~Èûï+ŠÐ¬á¬àï,
ßïƒÈûï
ŠÐ¬PЬPÏPÖóÿóÿfóÿÖÖEèóÿ5óÿóÿýóÿUýóÿݬßïÉûïŠàïÆ+¶ßïAȧàï¶+¦ßï?È—Óï¦+•ßï<ȆÕïŠ+ßï:Èûï…‰Ñïu+NÐ	PËÏÿÿÿ¬PÑPïïÁPÑP×ݬûïF6ÕPÉ1>ÿšïsÁPÑPºÝ¬ûï)6ÕP¬1!ÿÐPÑï+ðßïæÇ1ÿÑï+1ÿþßïßÇ1ïþËÏÿÿÿ¬PÑP 	ßïÖÇ1ØþЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑP ËÏÿÿÿ¬PÑP0ËÏÿÿÿ¬PÑP1›þßï´Ç1‹þÂ^м[Å[Pž@ïœ*Z)ò@[Ô[Þï‰*ZÀZÑ[¼
ßï©ÇûﰈѪÑö!ª
Ðj­üżPÐà|­øżPÐà|jÕïïÀÝ[ݼÝ­øßïwÇûïTÐ[¼ÐZPÂ^ÑïÅÀÝï*Ýïþ)ݬݬßïiÇûïÔ­üЬ­üÇ@­üPÄ@PÂP­üЭü­ôÅ­ôPž@ïÊ)YÑ©ö¬©
ЬiÔ©”©ЭüP˜©
PʼÿÿÿPÑP¬Ði[ЬZÑ[ZÞò@­üÔ­üÞï€)YÀYÑ­ü­ôªßïÇû驪›Ь[˜«
P˼ÿÿÿP~Ýkûï%ÿÿÿÄPž@ï?)ZժЪÐZPÑZ[÷ѪñÀZÑZéÞï)Zà€Ðï0¿Xûïz+Þïú(Z	ѪÀZÑZîßïˆÆûï‡ÐZ[Ñ«ÔW1·2«ïê¾Îïâ¾ïݾ˜«	PÑP¬tÕ«‘«ѬÐX﻾ÝkßïFÆûïr†	Ý[ûï÷*Õï¿#˜«	~˜«
~Ã|[PÇP~ÝkßïÆûïvá«
	Ý[ûïBЫÐW$ÕW Ý[ûïÆþÿÿÐPYÑP[Ý[ÝYûï/ЫÀ[Ñ[Þï([Ñ[Z1#ÿÐXï¾ûïl*Â^Ь[ЬZЪ«ª«ª	«	Ъ«ª
«
°ª«°ª«°ª«ÐjkЬ[Á[ZÀZÑZÞï'ZÑZ[
ßï{ÅûeѪÕÝ[ÝZûï„ÿÿÿˆ«
˜«
PʾÿÿÿPÈPöPª
Õï\·ÝkßïOÅûïñ…Õïå½%Ã|ZPÇP~Ã|[PÇP~ßïDÅûï:ŒÃ|ZPÆPÐPï$½Ь[˜«
P˾ÿÿÿPYÐ[ZÑZ|	Þï¼ZÂZÑZ[G˜ª
PʾÿÿÿPÑPYÖÑkjÑŠª
Õï\½%Ã|[PÇP~Ã|ZPÇP~ßïÍÄûﱋßïÜÄûﻄÀÂ$^Ь[ЬZÕïÍÄÝZÝ[ЬPÝ@ïDôßïÊÄûïo‹Ð¬PËñÿÿÿ@ïçõVÑVWÑkRÑP
*ÑPLÑPM1èÕï¶
ßï™Äû﯄Ý[ݬÝ[ûï[ÕP
1¾Ñkr««Ð[PѬ
ìѬ0Ñk+˜ak˜ajÕ«ݪûЪPݪûïw…ЪPѬѬ
Ñk1´ÑjøÑV1"ÑkøÑjóЬPÑPS11¶ÑP1€8ÑP1‹ÑPöÑP}1ÑPu1	ÑPmÑPf1úÑPI1òÑPBRÑP>KÑP<D1ØÑP@81ÌÑPQÑPP1µÑPRôÕïÜ´
ßïvÃûïsƒÝZݬÝ[ûï
ÕP͘aj1ÊþÑPWÉ!ÑPU¾ÑPT³]ÑPV¨RÑPYÑPX>ÑPm3…ÑV,ÑkÑk"ÑjÑjЬPÑPiÑPdÑP_ÑP<ZÝÝÝÝZÝ[ݬûïÈÐPYÝYûï8ÐPWáWÝ©ûïãÕP
ßïÌÂûïÖàW1ŠÝ©ûïÐP©1ŒÑkn««ÑjnªªÐkЫЫ«˜ajЬPÑPÑPÑPÑP<1gÿ`ª«1«ýbª«1£ýdª«1›ýqªïÝÁßï7ÂûïP1ýfª«1yýèWÐVPÑP1hÿÑP^áWѬoÕï8³	ÝYûï{á
WÝÝÝÝ©ûï%ÐP©áWÝÝÝÝ©ûï
ÐP©ÓW1áWЩPÝ©ûïÐP©1ôþЩPÐPXШ©Ш©Ш©áWÝÝYûïæÐPYá	WÝÝYûïÐÐPYáWÝYûïÐPYá
WÝYûï¬ÐPYàW1šÐ©[ЩZЬPÑP@1±1‡ÑP1û1ÑP11¿ÑP1Û1‹ÑP1—Åï=¸Pž@ï"­üЭüPÕ mݽüßïýÀûïäЩЩ©Щ©Ð︩ԩÝÝYûïÓÿÿáWÝYûïKÐPYÝYûïƒ)ÐPYÕïÀÝßïFÝYûï«ÐYPЭüPР©ЭüP2 ©ЭüP2 ©Ô©Ðï™·©Ñ©›2@©ЭüPР©Ô©Ð
©Ði€ÐiÐ2©Ô©Î©Ðï
ö©Ð©1cÿԩԩЩԩЩ1OÿЪ­ð!Å­ðPÀ|PÐP­ü‘ ‘ à ßïÀûïÚ~1OÅ­ðPà@ïæ 1®Ñ«Ñ«ñÁ«PêÁ«PÐ@ï‰õ­àЭàPÐ@ï|õ­ÜUÅ­ÜPÐà|­èÅ­ðPÐà|­ìÑï4·Ý­èÝ­ìß﬿ûïš…Å­ÜPá@ïo 4Ñ­ì­è-ЭܭðЭðªÕ­Ü1±Å­ðPÝà|ßï}¿ûï!~1–Ö­à1sÿÑ«,Ñ«&Å­ðPá@ï 	ßïd¿1ÿßï—¿ûï¬~^Á«­ìß﮿ûï#~GЫPïPPÊPï«QÉQP~ЭìPÝ@ïôÝ­ðûïÕPÅ­ðPÝà|ßï‚¿ûïL~ÝYûïõ	ÐPY1¹ýßï‘¿ûïl}1©ý˜akÐkiЫYË«PxPPÈPï«QÉQP©Ы©Ы©1zýÐkPÑPÔÑP
ÄÑP0ÑP;ªÝÝ«Ýûï¯øÿÿÐP­ø˜akÐkiÝ­øÝ«Ý;ûï•øÿÿ1yÿÝЫPÝ Ýûï€øÿÿÐP­øÝЫPÝ ÝûïjøÿÿÐP­ô˜a»лkÐkiÝ­øÝ­ôÝûïKøÿÿÝPݫݦÐ
iÐ[©Ô©1ÛüÑ«ªößïé¾1ÿÑPԩЩ1¼üÑPÜݬßï¿ûï¹|1¤üÑP
èÑk˜akÐkiЫYËÏÿÿÿ«PÑP
ßïE¾ûï4|ЫPïPPÊP1ÓþÑP$¢ÑP:¢Ñ«ª
ßïD¾ûï|ÝÝZÝûï’÷ÿÿÐPZЪ­ìЪ­èЪ­äÝ­äÝ­èÝ­ìÝZÝ[ÝbûïÐP[Ѭ$1ÿ˜aiÐ[Y1öûÑPE1›ü^ÑPBGÑPA1ÿЩPÝ ЩPÝ ЩPÝ ûïßÿÿÑP 1­ûÝÝÝÝ©ûïƒÐP©1–ûÑPC¼1ÓþÑPH"1ÑPF1¹þÝ©ûïúÐPZÐZ©ËÏÿÿÿ«PÑP
ßûï{ЫPïPPÊPï«QÉQP©ËÏÿÿÿ©PÑP 
ßï_½ûïÒzЩPïPPÊPï©QÉQP©Ы©Ы©Ñk>Ñ»8ЫPÕ /ЫPÑ @!ЫPÅ P˜@ï™­ðÑ­ðÑ­ðÀiÑ©	Ñ©	1ŸúÀiË©PxPPÈPï©QÉQP©ÝÝYÝ
1:ýÑPo1þ1¶ýЬ[Ñk8 Ý«ûïëÿÿÿÐP«Ý«ûïÝÿÿÿÐP«Ð[PÑ«Ñ«	:Ý«Ý«Ý«ÝÝ[ÝcûïŸÐP[ÝÝ«ÝûïdõÿÿÐP«Ý[ûï™#'Ñ«Ñ«Ñ«Ñ«
žÝÝÝÝ[ûïº
ÐP[ŠÂ^ÑïA²ݬݬŬPÝà|ßï¼ûЬ­ü1¥ßï
¼ûïKyÔPÑ­ø¬1·Å­øPÐà|PÑPrѬqÕï?«iÅ­øPÝà|Å­øP2à|PÖPÝ@ïáïݬûïgÿÿÿÕP;Å­øPÐà|P‘`$•Å¬PÝà|Å­øPÝà|ßכּûïy4ÑP	‰Ö­üЭüPÐ@ïŠï­ø1VÿÑ­ø@1Lÿßïf»ûïÙxÐPÂ^Ь[ЬZЪ­ôÑ«Ñ«ѪѪÐPÔPÐP­øÕP,ѬRѬSѬT
ѬUÀ¬Ñ«@
Ѫ@ÔPѪ@ѬíÑ«@ѬѬ×ЬPÑPR1è1ÌÑP<X1ˆÑPG1iÑP61!ÑPŸÀ­ô«Ñ«@Ъ«Ъ«
ßï’ºûï€wÐP­ô«õÄ­ô«îÕ­ôÜÆ­ô«âÕ­ôßïpºÎЫPÇ­ôPQÄ­ôQÃQP«ÁÒ­ôPÊP«·È­ô«°Ì­ô«©Ð­ô­üx­ü««›Ð­ô­üέüPxP««ŠÎ««ƒÒ««1{ÿÕ«aÐP^Ñ«­ôôSÑ«­ôëJÑ«­ôâAÑ«­ôÙ8íô«P0Ííô«P&Ãíô«P¹Ã­ô«P¯Ñ«­ô	¦Ñ«­ôŸÔPÐP«1ÿÑP
1zÿ1xþÑP18ÿ1mþÑP@1AÿÑP>1þþ1TþÑPB16ÿ1EþÑP1ÿÃÑP1ÿ10þÑPL12ÿµÑPP1zÿÑPM1ÿ1þÑPQ1fÿ1öýÑPV10ÿ,ÑPT1ÿÑPS1æþ1ËýÑPU1éþ1¼ýÑPX1ÿÑPW1Þþ1ŸýÑPY1íþ1ýÀЬ[ЫPРYЫPРXÑY
ÑX
sÐkPÓ@ï/ç ÑkPÑkQßïz¸ûïLuÑY
ÑX
ЫPЫQÑ ¡ÑX
лPÓ@ïâæÐkPÝ@ïåßïP¸ûïÊuËÏÿÿÿYPÑP
ËÏÿÿÿYPÑP0ЫZЫZËÏÿÿÿªPÑP&ËÏÿÿÿªPÑP0ÑjÕª1ûÝ[ßï¸1éЫPРWЫPРVÑYXЫPЫQÑ ¡Ý[ßïø·ûï¾ËÏÿÿÿYPÑP0ËÏÿÿÿYPÑP1ËÏÿÿÿXPÑP0
ËÏÿÿÿXPÑPvËÏÿÿÿYPÑP0&ËÏÿÿÿXPÑP0ÑGïëFïýê
Ý[ßïš·ŽËÏÿÿÿYPÑP0ÖWËÏÿÿÿXPÑP0ÖVxþYPÊPïYQÉQPYxþXPÊPïXQÉQPX1/ÿÝ[ßïX·ûïž®œ^Ь[ÐkPÝ@ïªãݬßï;·ß­œûïó}ß­œûïOtÂ^Ь[ЫPÅ Pž@ïƒZ˜a»˜akÝ«ûï§ÐP[ËÏÿÿÿ«PÑPЫ˪PxPPÈPïªQÉQP­ü2ª­ø2ª­ôÝ­ôÝ­øÝ­üÝ[ûï;ÐP[Ъ­è˜ª­ðá­ð;ЪPÏPÖáìÖáìßûï&sÇ­ì­èPÅ­ìP­èÕ­èDÝ­ôÝ­øÝ­üÝÝÝÝ­ôÝ­øÝ­üÝ­èûïÏÝPûï¾ÝPÝ[ÝûïOÝPûï^ÐP[ÝÝ[Ý
ûïîÿÿÐP[á­ð;2ª~ÝݪÝÝ[ÝgûïÐP[Ç­ìªPÄ­ìPÃPªPxPPï­ðQÉQP«Ý[ûïЭìЭô1FÿЭìЭô1;ÿЭìЭô10ÿЬ[ÑP^aÑP_<ÑPgЫ[ÐkPÑP'ÑP
ÔÑ»bÐPÑ»fòÑ»dèËÏÿÿÿ«PÑP0ÚËÏÿÿÿ«PÑP ÌÔPÝÝÝÝÝÝûï=ÐP[Ñ«€ÿÿÿѫЫѫ€ÿÿÑ«ÿÐ«Ð«Ь«2@«Ý[ûïЬ[Ý«Ý«Ý«Ý[ûï
ÝPûï5ЬPËÏÿÿÿ PÑPßï¿´ûïåpÐ PЬPÝ Ý РPïPPÊPЬQï¡QÉQP~ûïBÔÿÿЬ[ѬЫPЫPÐPZÝÝÝѬЫPЫPÝPûïLÿÿÿÝPÝZÝjûï'ÐPYÝYûï3ÐPYѬÐY«ÐY«Ð[PЬ[ï«PÐPZÑP
ÑZkЫPÑ@ïúæÐZ)ЫPÑ@ïçæ ÐZЫPÑ@ïÔæÐZÐZÝZûï´ÐPZÐZ«Ë«PÈZPÐP«ÑkÑZ	ЫЫ«Ь[ËÏÿÿÿ«PÑP0(ЫPïPPÊPï«QÉQP«Ö«ÝÝ[ÝûïëÿÿËÏÿÿÿ«PÑP äÐ[PЬ[ÐkPÑPvÑPP<ÑPQ3ÑPR.ÑPS%ÑPTÑPUÝkßï³ûïgoÐ[PЫPÑ 
ЫPÑ ЫPÑ ÞЫPÑ ÔÀkÏÝÝÝÝ«ûï¬ýÿÿÝPÝ[Ýkûï‡ÝPûï–Â$^Ь[Ðk­ðЫPР­üЭü­ôЫPР­øЫPР­èЫPР­ìЫPР­àЫPР­äЭðPÑP1ˆÑP1­ÑP$.ÑP:)ÑPo ËÏÿÿÿ­üPÑP1˜Ð­ø­ôЭì­èЭä­àÝ­àÝ­èÝ­ôÝ«ûï<ÐP«Ý­àÝ­èÝ­ôÝ«ûï%ÐP«Ñ­ðЭô«Эè«Эà«Ý[ûï¹Ý«ûïÌüÿÿÐP­ÜÝ«ûï¾üÿÿÑP­Ü•ßï±±ûï±m†Ñ­ü­ø÷ßï·±èËÏÿÿÿ­øPÑP1fÿÝ­àÝ­ôûï^ÐÿÿÐP­ÜÝ­äÝ­øûïMÐÿÿÑP­ÜÙЭø­ô15ÿÀÂ^Ь[ÐkVЫPРZЫPРYÕZÕYÑVo
ßïW±ûï(mÔ­üÑZÑZЭüÂ
ZÑYÑYЭüÂ
YÓFï½Þ1ÐZPÏP%>A3ÐX.ÑYÐPÐPÐPXÐYXÑZßÑZÚÑYÕÑYÐÐXÓFïkÞ
ЫPРWÐZXÕ­üÑXÑXÁ
XPÐXPÐPWÑXZÝWÝÝWÝ«ûïÐP«ÑXY	ÑVoÝWÝÝWÝ«ûïnÐP«ÓFïþÝЫPР«ЫPР«ЫPР«ÓFï×ÝЫÐW«Ô«ÐX«ÕÝWÝYÝFïñÛÝZÝ[ßï-°ûïsÐ[PЬ[Ñ«
Ñk	Ý[ûï„ûÿÿѬ«Ь«Ь«Ð[PÓ0¬ݬݬݬÝÝ[ÝiûïOÑk4ѬѬ(ÐkÑ«Ñ«n««Ь«Ы«Ý[ûï.ݬݬݬÝÝ[ÝhªЬ[ЬZûïilÐPYЬiÐ[©ÐZ©Ь©Ь©Ь©ÐYPÂ^Ь[ÑkßïY¯ûïíjЭüЫ­üÑ­ü«
ßïL¯ûïÎjÝ[ûï«lЭüPÔ[мXËñÿÿÿHïnÜPÑP1ÑP1ÿÐXPÏPm****vWhW0FH*NQ=NQNQ©½CCÜÜÜÜÜÜÜÜÜÜÜöÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜCÜö©FHNQS?S?Ü·*Ü*ÜÜÜC8WW\\\\\\ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ4CCÝHï¯ÙßïB®ûï iÐPЬPРPÝ ûï”ÐPYÐY[ЬPРPÝ ûï|ÐPZÒZPÊP[1Ëþ2PáZ¨ÐPèZùŸ2PÔPá[’Ð Pè[ù‰é[†2 PàZáY2Pá[š Pá[2Pà[öáZЬPÑ°2$PáY¸Ð¬PÑ°®2DPáY2PÐP2Pà[£à[…á[2PéZ
áY2
@PáZ	éY2 Pà[1ìþ2Pá[2EPÑXoÕZÐ$Pá[˜dPàZáY2GPÕ[ÁáZ2BPá[³˜fPé[«2DPá[¡˜`Pè[ø1…þà[ñáZõéYò2D"Pá[2‚PàYÞá[1ÍþáZ	éY2"PèZ1LþáYù2APЬPÏP FBQQQQUUMMIIQQQQBBBBBBBBBBBBBBBBFÐPÔPÐ PÐPÐPÐPÂ^Ь[Ý«Ý«Ý«ûïËÿÿÇP­üÝ[ûïQiÕ­ü
ßï"¬ûïhÝ­üûïÁõÿÿЬ[Á¬¼м¼ßï¬ûïhn¬ѬéÕ¬
ßïî«ûïLnÐkPËñÿÿÿ@ïÅØZÐkPÝ@ïúÖÝ[ßïÊ«ûï#nÑZ Ý«ßᆱûïnÝ«ßﱫûïþmÝ«ûï¬iÝ«Ý«ßûïámßï;ÜûïÞzÂ^Ь[ÑkIÝûï]Ýûï2ûïùÐP­üÝPûïÒÝ@p«~ûï%Ô«έüPÐP«Ð«ÐkЬ[ÕᆭÝßïÜþÿÿÝ[ûïAhÕïßï
«ûïÐfÐïÿÝ[ûïÀÐP[ßï[ÿÿÿÝ[ûïlhÝûï½Ý[ûï†Ý[ûïµg ^Ь[ÐkPËñÿÿÿ@ïx×ZÐkPÑP;ÑP6ÑP^1ÛÑPb1—ÑPcôÑPdëÑPf|1¾Ñ«@QÞïoª«"Å«PÝà|ûïúÐPYÝYûï°hÐP«2 «ÑZ
Ý«ûïYÿÿÿÑZ
Ý«ûïJÿÿÿÕ«´Î«~ßïªß­àûï\oß­à²Ð«PÝ ЫPÝ ÝûïnÈÿÿÀPÇP«ЫPÝ Ýûï¦ÇÿÿÆPÐP«…Ý«Ý«ûïn_ÞïÁ©«1mÿѼ81ЬPÝ ûïêÿÿÿЬQÐP¡ЬPÝ ûïÔÿÿÿЬQÐP¡ЬPЬPËÏÿÿÿ PÑPÝݬÝ
ûïçßÿÿÐP¬ÚݬûïÂ^Ь[ï«PÐP­ôÑP
ÑP	Ý[ûïÚóÿÿÕï&©Ð[PÐkZËñÿÿÿJï½ÕYÑYçÑYÝ«ûïªÿÿÿÐP«Ý«ûïœÿÿÿÐP«ÐZPÑPQ1²1iÑPB1ÑP	1Ã1æÑP1¶1ÎÑP‰1—Ý[ûïg
Ý«ûïÚþÿÿÐP«1kÿÑ»
ßûï¸cÝ«ûï@ÕPÜлЫPЫ ЫPЫ ЫPЫ ˜akЫPÑ»®Ð»ÐÝ«ûï€ÕP1ÿЫPΠPЫQÐP¡ÐkÐkZÝ«ûïYÕPÑ»Ñ»Ы­üЫ«Эü«Ñ»Z3Ы­ðЫ­üЭüPР­ìР­èÐP«ЭüPЭð ЭüPЭì Эè«ÑZDÑ»>Ñ»8ЫPÑ°.ЫPÝ ÝÝ«ûïëéÿÿÕPЫP˜a°˜a»ЫPР«Ñ»'Ñ»Z!ЫPÑ°ЫPÝ ÝZÝ«ûï§éÿÿÕP¼Ñ»?Ñ»9Ý«ÝZÝ«ûïˆéÿÿÕP&˜a»Ý«Ý«Ý«Ý«ûïöÿÿÐP«˜akÝ«1NþÑZÑZ
ÑZÑZÝ«ûï(ÕP	ЫPÕ ¯ÑZGÝ«ûïÕP9ЫPÝ ûïÈÐP­ø%ÕP„˜@kÐkZЫPРЫQР¡ЫPЭø ÑZ1SýÝ«ûï½ÕPïЫPÕ æЫPΠPЫQÐP¡ÐkÐkZ1#ýÝ«ûïÕPïЫPÑ 1ÿ1ýÑ»÷Ы­üЫ«Эü«ÃPkP2@ï	¦k1ÝüÝ«ûïGÕPïЫPÕ 1Ëþ1ÀüÑP1¢ý1µüÑP
1‹ýÑP1´ý1 üÑP1©ý1•üÑP³ÑP¬ÑP1ý1|üÑP1…ý1qüÑPI1éüÑP<18ÿ1XüÑPP1Gÿ1IüÑPX18ÿQÑPUò&ÑPSçÑPRÜ1üÑPT1ÿ1
üÑPW1ùþ1ùûÑPV1èþ1êûÑPh1XüÑPY1Ëþ1ÍûÑPi1;ü1¾ûլìPÒPPËP¬PÎPÔ[	xÿ¬¬Ö[ѬñÐ[PѼЬPÑ @ÐPÔPѬï–‘ÕÝß﨤	ݬß﨤ûï‚fƬÕï|¤Ѭ
ßï¤ûï_fѬï\¤ЬPÐïO¤[ЬïF¤Ð¬PÏP77TTaßïz¤ûï5_Ð[PÞïsÔï¤ßï:¤ûïfâÞïYÔïø£Ñ[ÒÑ[Íßï¤ÚÐï(ÒïÛ£¸ß朗ݬßï0¤Ýï¿£ûïàcÖﶣÐï°£PÂ^Õï—£1âÅPž@ï[[Ýïhûï©ÿÿÿûï¼ÿÿÿÐPïSûï®ÿÿÿÐPZßïÍ£ûïPeÝZßïË£ûïAe2«~2«~ЫPïPPÊPï«QÉQP~ûïnÁÿÿÇP­üÇ­üY
ßï£ûïeÐYP×YÕPêá­ü
ßï“£ûïèdé­ü
ßï“£ûï×dÝZßï•£ûïÈdÝ­üÝZßï“£ûï¶dÔï°¢Ýï–ûïïýÿÿûï,Â^Ýûï.þÿÿÅï}•Pž@ïUÿYÝYûïÑЩZxþZPÊPïZQÉQPZÑZÑZ	ÐPÔPÐPïF¢ûïþÿÿÐPï$ÕïzÐ7ûïwþÿÿÐP­ôÝPßï£ûïdßï£ûï	dÝ­ôßï£ûïùcÝï•ßï"£ûïæcÝïð”Ýïê”ßï£ûïÍcÔïИ@­üÔ[1ªÅK¼Pž@ïˆþY‘©wЩZö	©2'Ø©ß­üÝYûïŸÊÿÿÑ©Ñ©b­ûÑ©Ñ©
w­ûl­ûÝJïù¦Ç©~˜­û~ßﮢûïGcxZPÈPïŒÏÐZ©ö©ß­üÝYûï6ÊÿÿÕP
ßï¢ûï-\Ö[Ñ[¬1MÿÇ­ü~Ýï”ßïy¢ûïòbÇ ïדPxPPÃPïË“PÇ ïÁ“PÖPxPﶓÝï´“Ý望ûïÛЬ[‘«Ýkûï
ÝPßï¢ûï~b‘«‘«	Ý«ûïœüÿÿÝkûïÑ	ÝPßïí¡ûïNbשּׁլ
Õ¬WßïСBÕ¬ßïÅ¡ßïÅ¡Ýï ûï=`ݬßﱡÝï ûï'`ѬßÝïíŸûï`Â^Õ¬Ð[×[
ßïv¡ûïÁaó¬[îЬ­üx­üPÀPï'•ßïZ¡ûïaZÐPÝßïø‹ßïI¡ßïèÏûï_Â^ÐZ+ÐJ¼P‘`-ÐJ¼P‘ XÐJ¼P‘ pÐï…ÍÖZÑZ¬ÏÝï?Ÿûïx_ÝÝûïdÑPßï ÝûïýcÝÝûïòcÑPßïÝûïÞcÝÝûïÓcÑPßïâÝûï¿cßïž ÝïÏžûïˆ_ÐPïýÌÕP
ßï‚ ûï¸YݬݬûïO–ÿÿÐP­üÝïÕÌßït Ýïžûï–]ÐPï»ÌÕPZ×ÿ±ÌÐï©ÌPРQÖ šaP
Ýï–ÌûïóaÐP[ÖP8×ï–ÎÐï’ÎPÖï‹Îö[`·ßï|ÎÝ[ûïëk¦ßïþŸûïYÝïžûïçnЭüPÝïúûïÓnÝûïºmÀЬ[x¬PÀ[Pë`X1ŬPÑXPóѬíÕ«ЫPûïìùÿÿÐPWÕ«*ßï’Ÿûï‰_Ý«ßûïy_ßûïl_ÝXßïvŸûï]_ÝWßïuŸûïN_ßïsŸûïA_ßïsŸûï4_ßï|Ÿûï'_ûïnùÿÿÐPVÝPßïuŸûï_ÐZЫY×Y2ÝVxZPÀ[PÑY`ÐZPÖZxPPÀ[PРPÐWPÝPßïBŸûïÑ^ÖYÑZ¬ÆÕ«	ÝWûïïøÿÿÝݬÝÝ[ûïЬ[Õ¬ݬßïŸûï^ì¬PÑP1‰Ã¬¬PxÿPPÁ¬PZßïëžûïb^xZPÀ[PÝ`ßïÝžûïL^xZPÀ[PÝ ßïÉžûï5^ûï|øÿÿÐPYÝPßï¿žûï^ÝÃZ~ݬÝ[ûïbÿÿÿÝYݬÁZ~Ý[ûïPÿÿÿXЬZ×Z:ßïžûïá]xZPÀ[PÝ`ßïžûïË]xZPÀ[PÝ ßïmžûï´]ñ¬Z¿ÿÕ«
Ý«ûïêöÿÿЬ[Ý[ݬÝݬÝÝÝûï	ëÿÿÝPÝoûïÐÑÿÿÐP[˜a»˜akЫP€Â^мYÐYPÑPh1™1ÁÑPT1å1¡ÑPR1Ô1ÑPЬPÕ 
Ñ @ЬPЬPÅ Pž@ïÊ÷[˜«PÏPâÿfâÿffâÿÎÝÝÝÝÝÝ^ûïHêÿÿÐPZÔª‘«ÐPÐPªÝÝÝݬÝZÝEûïêÿÿÝPûïÆáÿÿÐP¬1|ÿ•«	øЬPÔ ΫPЬQÐP¡1aÿ˜^¼ЬPÔ ЬPЫ 1IÿЬPРPËÏÿÿÿ PÑPЬPРPËÏÿÿÿ PÑPÑÀ¼1ÿЬPРPРWÑWÑW
ÑWÑW
ЬPÑ°˜h¼1äþЬPÐPQСQР¡ЬPÐPQСQР¡ЬPÐPQСQР¡˜a¼ЬPРPЬPÑ Ñ ÐPÔPÐPXЬPРPÑ ЬPРPÑ ÐPÔPÐPWÑXW1^þЬPРXРPРWЬPÑ°]РPР­üÐXPÏP'G9?ЬPРPÐX 1Yÿ˜­üPЬQСQÐP¡ßš­üPìï­üPä2­üPÞЬPÑ°Á1ÚýЬPÑ°ÝßûïàS˜a¼ЬPÝ Ý ÑYjÐPÐ<PÝPûïÿÎÿÿÑPS1Bþ1ˆýÑPU13þ1yýÑPj–ÑPi1Lþ1_ýÑPk1yÿ1PýÐPÔï8‹ЬPÏP((((((ËÏÿÿÿ¬PÑPÐPÔPÝûï9áÿÿÐP[Ǭ«Ð[PЬ[Áï|Ù¬PÑP 
ßzûïëRx¬P×PÒPPËP«Pì QÂïMÙQxQPPÈPïEÙÀ¬ï9ÙÀ¬ï)ïï+Ù~ßûï…YxïÙïÙÂïÙÑïÙÎÁ\PÐP[Ѭ@:ï«Px«QÊÿÿQÈQPÝPïkPxkQÊÿÿQÉQP~ßï&šûïY!ïkPxkQÊÿÿQÉQP~ßïšûïúXÀ¬ïnŒݬûïXÀ¬ïXŒÕ¬À¬ï^ØÀ¬ï>Œ)ïïPØ~ßïÍ™ûïªXxï;Øï6ØÂï+ØÑï%ØÎÔ[¼KïØÖ¬Ö[•¼í”KïØÞïØPï¬PÑP
ÑPЬPˬPÉP¬ïˬPÉP¬ãÐPÂ^ŬPž@ïõò[Ýkûï‡ÿÿÿÝPßï2™ûïX2«~2«~Ý«ûïD´ÿÿÐP­üÇP~ßï™ûïÝWßï™ûïÐWѬlѬL
Ñﶈ€ÐPÔPݬûïÈWpPÐPÕï ¤ݬûïoêÿÿݬûï#ûï‡DÔYÐ[ÐK¼Z‘j-yÐYÖ[Ñ[¬ëûïÊRûïÏ?ÐYP1¬ÑPa6uÑPX1ƒÖZ•jú×Z61¢ÑPlÌÖïSà ÖÖï¡Öï¢Öï7ÃÖZÖZ•j„˜jPÑPs¸‘ªpßÖïî¡ßÖïò—×ÑPeÖïÙ—ÆÑPt­˜j~ßïI˜ûïžO«ÑPr‚ãÑPoÚÖïú—ÑPu§¾ÑPx¾Ö1rÿÕïšÂßﮀÝï4‡ûïÐïk—ï‚ÂÕïT—ÝßïlݬûïîPݬûïè*ÔïLÂݬûï°ÝÝݬûïHJûïMNЬï—Ðï—ï#ÂЬï#ÂÑï—ïÀ†Ðïì–ïÂÐï­†ïä–ÔïÚ–ÑïΖïéÁÐïÁ–ïÜÁûï±ÇïËÁPxPPÃPï¿ÁPÇïµÁPÖPxPïªÁûïëЬ[Ý[ûï?ÕPóÔïíÁÝ[ûï¸ÝÝ[ûï»ÔZÝÝJï|Áûï§ÖZÑZï¼ÁåЬ[ÐkZËñÿÿÿJïc¿YÑYÔPÑYÝ«ûïÓÿÿÿÐZPÑPíÑPèÑPãÑP;!Ý«ûï±ÿÿÿÕPÝ«ûï£ÿÿÿÕP'ÐP$Ý«ûïBÿÿÿЫXÝ«Ý[ûïøK˜ahÐPÔPЬ[ÐkZËñÿÿÿJï×¾YÐZPÑPKYÑP;<ÑPÑPÑPøÑPFïÑY
Ý«ûï©ÿÿÿÑY
Ý«ûïšÿÿÿÑPHÇÍÑPIͺÑPd±lÑPNÑPL¬™ÑPO¡Ý[ûï|)ÕP”ÑïrÀ‹Ý[ûïpKÐï`ÀQÐPAïÀÖïQÀЫX˜a»ÝXÝ[ûïýJ˜ahÑPmŸ1FÿÑPfô1)ÿݬûï„Ôï°¿Õïv”ßï•ûï/SÝßïݬûïNݬûïŸÕïy¿Ýïu¿Ýïk¿ûᄁݬݬûï¯Â^á¬TѬ€ßï«”ßï©”ß璉ûï·R*Ѭ€ßѬ€ÝË€¬~ßûï‹RÔ­øÔ­ü9x­üPÒPPËP¬P'Õ­ø
ßïa”ûïaRÖ­øЭüPÝ@ûïLRÖ­üЭüPÕ@ºÂ^Ь­øûï]ݬûïYЬPÝ ÝPûïe.Õ9ݬßïù“ûï÷QÝ­øûïÿÿÿßïî“ûïàQÝßï2ݬûï´Lм[ËñÿÿÿKïF¼ZÐ[YÐYPÑPK131ÑÑP;1&1£ÑP11ÑP1ä1	Р­ð1Ý­øݬûïÆ!ÐP­ø1ÃмPÝ@ï ºßûïcJÝÝ­ôûïéýÿÿЬPЭðQР¡Ý­øÝ­ðûïÏýÿÿÝ­ðݬûï H˜a½ðè¬1JÝÝݬûïfEÑPX~ÑPHuÑPFBhÑPI7]ÑPlT!ÑPdIÑPL<ÑPf1ÑPm(Ý­øݬûïõ9ÐPYÑP1qÿÑY1ÿþЬPР­ôÑZ1æþÔ­ðÕïî‘Eݬßï^’ûïLPݬûïZýÿÿßïS’ûï5PÝ­øûïCýÿÿÝIïì¸ßïA’ûïPÐYPÑPN1©1ÛÑP1•1pÑP
1Ú1CÑP11.ÑP1qþÑ[^ôÝݬ1´ЬPР¬Ð¬Ь­øûïÞݬûïÚЬPÝ ÝPûïæ+ËP¬~ݬûïµ4ÕP1gýЭðPР[Ý[ÝÿÿÿÿÝ­ôûïg˜a½ð˜a¼ûïé2ÐPYÝPÝÿÿÿÿÝ­ôûï@ЬPЭðQСQР¡ÝЭðPÝ ûï½ûÿÿЭðPРPÉ PЭðQСQÐP¡ÝÝЭðPÝ ûïLCÝIûïw2ÐP­üÝPÝûïÝYûïo2ÝЭðPÝ ûïYûÿÿÝ­üûïU2˜^¼ЬPÔ ЭðPРPЬQР¡ЭðPРPЬQР¡ЭðPÝ ûïI1Nýûïÿ1ÐPYÝPÝÿÿÿÿݬûïV˜`¼ЬPÐY Ýݬûï÷ûÿÿ1ýѽô
Ý­øЭôPÝ ûï¡,1^þÝ
Ý­ôûïÎûÿÿ1OþßïIûï¾FЬPÔ ˜K¼м[Ý­øݬûïàÕP1Àü1müЬPÔ ˜H¼м[Ý­øݬûï¹ÕP1™ü1FüЬPÔ ˜f¼м[Ý­øݬûï~ÕP1rü1üѬÝЬPÝ ûï2ûÿÿ1þÝ­øЬP1>ÿÝ­øݬûï6,ÕP1•ýé¬ѼNÐPÐ	PÐP¼1xýݬûïöDÐP­ôÝÝЬPÝ ûïvAЬPЭô ѼNÐPÐ	PÐP½ôѼNÐP«ÐP¦Ý­øݬûït-ÕP1ý1aûÝ­øݬûï=.ÕP1úüݬûïxDÐP­ðÐ:¼ÝÝЬPÝ ûïô@ЬPЭð ݬûï³ЬPÝ ÝPûï¿(ÕïóÝßï³ݬûï5GÝЭðPÝ ûïúÿÿÝÝ­ð1(þÝ­øݬûï-ÕP1mü1½úÝ­øݬûï7+ÕP1VüÐ[PÑP<5ÑPÑP
ÑP1‰úÁ[¼1.üÑPó1yúÑPëöÑPä1júÑP@ØÑP>Ñ1WúÑPBÅ1KúÑP‰1CúÑP1NüÑP
1þ1.úÑP1#ý1#úÑPH1ªý$ÑP;1%úÑP:1/ÿ1úÑPF1Žý1ñùÑPK1QýÑPI1Jý1ÔùÑPL1Åü1ÅùÑPg1îü,ÑPd1lýÑPb1%þ1šùÑPf1Hý1‹ùÑPm1mûÑPl1û1nùÑPn1Àü1_ùѼaݬݬûïâ/ÕPݬݬûïú3ÐPYÑPݬݬûïÕP1Áú1ùЬ[ÐkZËñÿÿÿJïç´PÐPYÑYÐZPÑPI1ô1ÍÑP.gÑP'XÑP
1ÿлPÓ@林ïÝ
Ý«ûïÅ1âÝ«ûïXЫPÑ ïȶÐ[ï[¶2ïV¶Ý«ûïðÑPÈ1§ÑPFx8ÑP;íÝ«ûï
ЫPÑ ï}¶Ð[ï¶2ï¶Ý«ûïÿÿÿÑPHYÑPKPÖïB¶HÑPfï4ÑPL1wÿÖÑPd&Ý«ûïÔþÿÿÝZÝ«ûïÖï¶ÑPmÌÑYŒÐ»PÓ@ÝZÝ«ûïÁÑ«ïÕµ	Ý[ûï$Ý«ûï|þÿÿ1RÿЬ[ÐkPÑPÑPÑPÑPLÝ[ûïNþÿÿÝ«ûïÝ«ûïÁÿÿÿЬ[ÐkPÑPFMÑPHDÑPI;ÑPK2ÑPd)ÑPf ÐkPËñÿÿÿ@ïæ²PÑP"ÑPÑPÖïµÝ«ûïÿÿÿЫ[Ь[Ñk8ݬÝ«ûïèÿÿÿЫ[ѬF
ѬdÔïÊ´Ý[ûïýÿÿÎZм[Ð[PÑPRv1±ÑP;1F1xÑP1Š1`ÑP1VÑP1õÝ Ý¬ûïLôÿÿÕ¬ÝIݬÝQûïOÕ¬15ÝIݬÕ¬1ÔP1Õ¬ÃP[PÐ@ï鈼м[Ь¬Î¬ЬPÑ°1ÃРPÕ ôЬPРPРP•`äÐ[PÏPP	111111”w1Ñ[Y˜QP˜PPÐP¼ÐP[ЬPаPÓ@ï\±Ý
ЬPÝ ûïlóÿÿÝ Ð¬PÝ ûï\óÿÿÝIݬÝ[ûïh=Ý Ð¬PÝ ûï8óÿÿÝIݬÝÚÝ Ð¬PÝ ЬPЬ Ý Ý¬ûïóÿÿÕ¬ÝIݬÝûïÝÝݬûï¤:Õ¬	ûïÏ)ЬPÐPZÝZÝÿÿÿÿЬPÝ ûïþÿÿݬݬЬPÝ ûïþÿÿÕ¬	ÝZûïž)˜a¼Õ¬	ûï|)ЬPÐPZÝÿÿÿÿÝZЬPÝ ûïÉýÿÿݬݬЬPÝ ûïµýÿÿÕ¬¶«Ý¬ݬЬPÝ ûïšýÿÿžÝЬPÝ ûï&òÿÿ˜a¼ݬݬЬPÝ ûïoýÿÿÕ¬	ûïö(ЬPÐPYÕ¬	ûïá(ЬPÐPXûïÑ(ÐPZÝPÝÿÿÿÿЬPÝ ûï$ýÿÿÝYÝXЬPРPÝ ûïýÿÿÝZûï©(ݬݬЬPРPÝ ûïíüÿÿÕ¬	ÝXûïƒ(Õ¬	ÝYûïu(ЬP˜a°1ËþЬPÑ 1þüÑ ÷Õ РP•`Õ¬1£þÝIݬÕ¬1þÝIݬÝûï41{þ˜PPÝP1þÑP1pþ1§üÑPP1àüÑPL1™þ1ŠüÑPQ1Ãü1{üÑPV1´ü&ÑPTòÑPSç1VüÑPU1ü1GüÑPX1€üÑPWò1-üÑPY1fü1üÖï°Ðï°PÑP¬

ßï†ûï¿<Á¬¼м¼ßï#†ûïŠC¬ѬéЬP׬ÕP
ßï†ûïhCмPÝ@ï%¬ݬßïí…ûïMCмPÑPdÑP_ÑP^?ÑP_MÑPb]ÑPcTÑPdKÑPfBhßïÀ…ûïúB1ÌЬPРPÝ@ßï‚…:ßï~…ûïÓBݬûï(ЬPÝ ßï`…ûï³BЬPÝ ßïU…ûïŸBßïR…ûï’BЬPÝ ûï<>ßï:…ûïwBЬPÑ  1_ÿá ßï!…ßï!…ûïLBЬPË PÝ@ïÔ…ßï…ûï+BЬPÝ ßïõ„ûïB€мPËþÿÿÿ@PÐP¼Ô¼Õ¬1IѼgóݬûïÒ	ÕPЬPРXïXZxúXYÁZYPÑPÐPÐ PÐPï%®ÑPÐ
PÐPÐPWÃZï®PÃYPYЬPРPÐW Ð¼ûï‚;ЬQÐP¡ЬPаЬPРP2  ЬPРPÐW ЬPРPРЬPРPÔ ЬPРPÞï„ ЬPРPxZ  ЬPРP× ÕYeûï
;ÐP[˜Bk2 «ÐW«ЬPР«ûïì:ÐP«Ð»ЫP2  ЫPÐW ЫPÔ ЫPÐY ЫPÞï—ƒ ЬPÐ[ ÀÂ^Ь[Ñk
1ÑЫ­üѽü^ЭüPР­øРYРX}ѽüѽüЭüPРWРVѽü	ѽü1‡ÑføÑg^yݦûïÑPjЦ­øѽüέøPÐP­øЧYÀ§­øЦX•hѽü•·•hЧXÝXÝ­øÝYÝ«ûï»ÕP˜_kÐY«Эø«ÐX«Ý­üûïu:Ýßï¦ýÿÿݬûï˜:ßïÿÿÿݬûïê:ßïݬûïÚ:ݬݬßﶅûï{?Ь[ÔYÔZÑZé[ÖYxÿ[[ÖZÕ[ëÐYPÂ^Ðï­«­üÆ­üÇ­üPÀPPÃP­üPÇ­üPÖPÁPP­üÊÃÿÿïm«Ýïg«ûï–ÿÿÿxPPÀP­üÝïîißïD…ûïõ>Õï?«Ýï7«Ýïñoßï)…ûïÔ>ßï4…ûïÇ>ßï1…ûïº>Ý­üÝïÁoßï!…ûï¤>ÝïîªÝï¨oßï…ûï‹>ÝïÅÝïoßï…ûïr>Ôï¬Õï’ˆÔßïð„ûïQ>ÞïŒ[1Ñk¬(Ý«ßïß„ûï/>ѬF
ßïË„ûï>À[ÕkËЬPÝ@ïͦßï­„ûï7ÀЬPÑPO1@1/ÑPI1„1òÑPB1Ò1ÒÑP01¨ÑP-1qßï…ûï¶6ЬPаPÑPsÑP)ÑP^<ÑP_\ßïW„ûï„6ЬPРPvßï„ûïU=ЬPÝ ûïï
ßï„ûï9=ЬPÝ ûïáßïòƒûï=ßïæƒûï=ЬPÝ ûï¸ßïÒƒÕЬPРPЬPР[Ñ[Ñ[ßïЃ±Ñ[Ñ[
ßïÀƒŸßﺃ—ÝIûïO ÐP[ÝPÝûïiЬPÝ ûïC Ý1ݬûï)РZxZPÝàÐ$ßïqƒûïl<xZPÈPﱨÝ[ûï ЬPРݬЬPÝ ݼûïßï<ƒûï-<ÀïB€Ñï<€ï[Ðï/€ïNÔï#€ЬPРPÒ PЬQСQÐP¡ÝRݬûïp(ÝPûïíЬPРPÒ PЬQСQÐP¡ЬPРPΠPЬQСQÐP¡ÝRݬûï&(ÝPûï£ЬPРPΠP´Ð¬PР[Р¬мPÑPÑP^GÑP_?ЬPÑ Ñ 
Ñ[Ñ[ÐPÔPÑ[Ñ[ÐPÐPЬQÀP¡ßï‚1hýßï/‚ûï4ѼbЬPÝ ßï‚ûïâ:
ßï‚ûïë3ѼbЬPРYРX!Ѽc
ЬPРX
ßïæûï±3ÑhÐh%Ñh^˜_hÑh_
ßïÁûï‚3ЬPРWÀW¨ÀW©NÑWÐPÐPÐPVÂV¨ÑV	Þï‘PÞï’PÝPÝÝXûïÞ$ÂV©ßï„ÝÝYûïÉ$ÂVWÕW®ÑhÐh1]üÑh_ô˜^h1MüÑPC1Bü11üÑPM1þÑPL1Vü1üÑPN1÷ü1üÑPT1'þ,ÑPR1œüÑPP1[ý1ÚûÑPS1§þ1ËûÑPW1jþÑPU1Oþ1®ûÑP~1Gý1ŸûѬEÁ¬PÝ@ïÒ|Á¬PÝ@ïÆ|ß豈ûï9Á¬PxPPÈPï]¥Á¬PxPPÈPïM¥ЬPÝ@ïŽ|ЬPÝ@ïƒ|ßïn€ûïÚ8x¬PÈPï¥x¬PÈPï¥ïï¥Zšï¥ï¥Ñï¥
Áï¥PÐPÐPï]¥ÕïÃy ÁïºyPÑPïF¥Áï©yPÐPï5¥Ð[Ñ[ï+¥ÐPÐPÐPKï%|ñ[áÿÐ[Ñ[ZÐPÐPÁ[QÐPAï|ñ[áÿѬÐPÐPÐPÔPѬѬ^Ѭ
Ѭ_ÐPѬ
ЬPÝ ûïdÕPÐPÔPЬ[ÐkZÑZÑZ^ÑZ	ÑZ_ÐPÑZ
Ý«ûï ÑPÐPÔPЬ[Ñk
Ы[Ñk^	Ñk_ЫPÓ@ï!{ÐPÔPÑkÑkÐPÔPËÏÿÿÿ¬PÑPÔPЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑPѬÐPÔPЬPÏP*8Âÿ8FÂÿÂÿÂÿÂÿ*8¦Ñ¬ÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPЬ[Ñk^Ñ«
Ñ«ÐPÔPЬ[ÐkZÝ[ûïÌÿÿÿÕP2PÑZN?Ý«ûï¯ÿÿÿÕP1Ñ»+ЫPРP•`ЫPÝ ЫPÝ ûïâþÿÿÕP2PÔPݬßï‹}ûïê5Ь[ÐkPÑPÑP^ßïk}ûïÜ.Ý[ûïbЫPÝ@ïJyßïE}ûï¡5x«PÈPïå¡ßï;}ûï.Â^Ѽg	ЬPР¬ЬPР­üмPÑP.ÑP=ÑP^CÑP_mßï
}ûïN.ЬPЭü ЬPÀ ݬûïÂâßïÈ|ûï5åЬPÁ PÝ@ï•xßï«|ûïì4ЬPÁ PxPPÈPï(¡ Ð¬PÀ ЬPÑ РP•`
ßïq|ûï9.ЬPРPÝ@ï<xßïb|ûï“4ЬPx PÈPïÓ ЬPÕ РP•`šßï8|ûïe4ݬûïßï#|ûïN41ÿÂ^Ь[ÑkgЫ[ÐkPÑPtÑP+ÑP
11ÑP^hÑP_1ßï|ûï-Ý«ûïÒûÿÿÑP(Ы­üxà««ßïÁ{ûïÔ3Ý[ûïsЭü«ßï§{ûï¸3Ý[ûïWЫPÝ@ï?wßï‡{ûï–3x«PÈPïÚŸÑ«@ЫP•`
ßïb{ûïø,ßïb{ûïa3Ý«ßïW{ûïQ3ßïM{ûïD3ЫPÝ@ïÔvßï6{ûï+3x«PÈPïoŸÕ«ЫP•`#ßï{ûï3Ý[ûï¤ßï{ûïï2ÝÝ[ûïÕPÝ«ûï‡þÿÿßï×zûïÄ2iЫXШY˜_kЩ«Щ«Щ«Щ«ÑhN!Ý[ûïFþÿÿßï˜zûïƒ2ШP «ßï‚zûïk2Ý[ûïþÿÿÝXûï-Ь[ЫP•`Ý«ßïcz)Õ«Ý«ßïVzÝ«ßïNzûï2Ý«ßïBzûï2Ь[ݬÝ[ûïЬ[Õ«Ý«ûïÐPZÔZÕ«
Ý«ûï“Ý«Ý»ûïÀùÿÿÕPÝÝ«ûïtßÿÿ˜HkÝÝ[ûïÐPYÝZûïÑYÐPÔPЬ[Ç[PÂPïuÑ[Â[Ð[PÑP&Ý[Ñ[	ÞïyPÞïŠyPÝPßïoyûï91Â^Õ¬ݬßïkyûï11<ѬYЬPÝ@ïΙßïQyûï*1ÐïÈPÑPAÑPC1üÃP¬PÄPž@ï?u[ûï_ÐP­üÑïC	ÞïyPÞïyPÝPÝ ÝïhûïIÕkݬÃPkPÝ@ïÇtûïp0À[ÕkÝ­üÃPkPÝ@ï§tûïP0Ñï"C	Þï¾xPÞïÁxPÝPÝ ÝïýœûïÞݬÀ[ÃPkPÝ@ï]tûï0Ý­üûï¬ÝÝÝïÆœûïS$Ô|ÔﳜѬFÃP¬P2@ï¤m¬ݬÃP¬PÝ@ïÿsûï¨/»Ñ¬@ÔPÓ¬ÐPà¬мPÓ@ïš2P2@PÔP€Ь[ÐkXÑX
ЫPРPЫPÐPWÑXh
Ý[ûï'Þï tYÑXiÑW©ÀYÕiîÓHïš™3лPÑPvÑP
aÑP^11ÑP_1„ßïzwûïõ'ÐkPËñÿÿÿ@ïV™PÑP1fûïÂ(ÐPZÐ8j2 ªÐªЫªЫª1F˜a»ЫPР«´Ð»ЫPË PxPPÈPЫQï¡QÈQPЫQÐP¡‰˜^»ЫPË PxPPÈPЫQï¡QÈQPЫQÐP¡ЫPÕ Ëûï0(ÐPZÐj2 ªЫPРªЫªûï(ÐPªÐºЪP2  ЪPРЪPРP”`ЫPЪQР¡ЪPÔ ЫPÔ ÐZ«1èþûïÂ'ÐPZÃkjЫªЫªûïª'ÐPªЫªÐ:kÐZ«ЪZлjЫPРªЫPРªЫPРªЫPРªÝ«ûïøýÿÿЫZ˜FkÐZ«ûïP'ÐPZÐZ«Ðj2 ªÁ «PÊPxPPÈPÁ «QïQQÈQPÐPªЩªÔªÔªÂ^Ь[ЫYЫPРXÑYÑYÐPÔPÐP­üÑXÑXÐPÔPÐP­øÑ­üPлPÓ@ïG—˜FkЫ«ûï°&ÐPZÐZ«Ðj2 ªÁ «PÊPxPPÈPÁ «QïQQÉQPªÕ­ü	Þï"uPÞïuPÐPªÔªÔªЬ[ÑkhÑ«ЫPÑ ÐPÔPЬ[ÑkhÑ«ЫPÑ ÐPÔPЬ[ÑkzÑ«tÝ«ûï™ÿÿÿÕPfÝ«ûï‹ÿÿÿÕP.Ñ»RЫPРP•`FЫPÑ €ÿÿ8ЫPÑ ÿ*ЫZЪ«˜ajÑ»
ЫPР
ЫZЪ«˜ajÐkPÓ@ï
–hÑkP	ÑkQVЫZѪѪFЫZѪѪ6Ý«ûïÿÿÿÕP(Ý«ûïþþÿÿÕPЫZЪ«˜ajЫZЪ«˜ajЬ[ßïøþÿÿÝ[ûïI&ßï“ûÿÿÝ[ûï:&Ý[ûï#ëÿÿÔïÿnЬ[ЬPÑPd€"ÑPe€>ÑPf€SßïpsûïÈ#ÔPÑkøЫP•`ðÑ«€ÿÿÿæÑ«ÜÐPÑkÓЫP•`ËÕ«ÆÑ«ÿàºÑkµÐ«P•`­Ñ«§Ñ«ÅŸЬ[Ý«Ý»ûï7òÿÿЬ[ÑkN&Ñ»^ЫPÝ ЫPÝ ûïâòÿÿÕPÔPЫ[Ñk
Ы[ÑkÑk_	Ñk^ÐPÔPЬ[ÐkZÓJïM”1ЫPЫQÑ ¡Ñ»
XЫPÕ ЫP(ЫPÕ 1Ыï÷•ЫPаPÑP
3ЫPРPРïØ•2ïÓ•ßï”sûïm"ðÑ»gÀЫï­•ÓЫPЫQÑ ¡ç›Ñ¬€ÿÿѬÿ•¼Ѭ	ѬÔPÐPЬ[ЫZЫPÏP
 6I 6ÐZPé¬øÕZôÑkïÐZÐZ«æá¬áÑk
ÜÕZØÐZçá¬ÎÕZÛÈÀÂ^Ь[ÐkZËñÿÿÿJï
“YÝ«ûïWðÿÿÐPVÔ«ÑYѫЫÑY1–ÐZPÑP
ÑPH	ÑPfÐï	•«Ý«ûïÈñÿÿÕPЫPÑ VÐVP1ЫPРP1ÑWVê<ÑXVãÐXP1ñÁVXPÑPWÐWPÁVXPÑPï±”
Ðï©”P1ÌÁVXPÑPW1¼ÐWP1ºÐ«PРXЫPРWÑZ:1ÑZF1`ÿÑZdôÑZb“ÓJï
’ЫPÝ ûïUïÿÿÐPVÝÝ«ûïfþÿÿÐPXÝÝ«ûïWþÿÿÐPWÁVWPÑXPÁVWPÐXPÁVXQÑWQÁVXQÐWQÑPQÁVWPÑXP1ÿÁVWPÁVXPÑWP1DÿÁVXPÐP«ÓJï„‘1õÐZPÑPBÑP	=ÑP8ÑP3ÑP.ÑPNØÑPOÏÝÝ«ûï½ýÿÿÐPWZÕXBÐV«1ªÑ«Ñ«ËÏÿÿÿ«PÑPÊÕX1€þÕW1€þÁXVPÑWP1°þÁXVP1iÿÁVPÑXPÁVP\ÐXPWÕXÁVVPÑWPGÁVVPDÁVXPÁVQÀVQÑPQ	ÁVPÀVPÁVXPÑWPÁVXPÁVQÀVQÑPQ	ÁVPÀVP	ÁVXPÐWPÐP«ÐZPÑPqÑPlÑPgÑPbÑP;]ÑZ<
ÑZ>ÑZÑ«
Ñ«Ðï•’VÑZÑZ
ÑZÑZ1æÑ»^ЫPРPÓ@ïoiáÑXW#1ÂÑXWÐWPÐXPÑPV1WýÑXW1£ý1iýЫPР­øЫPР­üÑ­üÑ­øjÑ­üÑ­üÑ­øXÑ­øRËÏÿÿÿ­øPÑPDÑ­øÑ­ø0Ñ­üÑ­üÑ»
ÕX<Ñ»
6Ñ»
.Ñ»
ÕX
"ÕXÕWÐX­ðÐWXЭðWЫ­ôЫ«Эô«ÝÝ«ûï»ûÿÿÐPWÑVX1®ü1ŽüÁVVPÁWVQÑXQÁWVQÐXQÁXVRÑWRÁXVRÐWRÑQRÁWVQÑXQÁWVQÐXQÁXVQÑWQÁXVQÐWQÑPQKÁWVPÑXPÁWVPÐXPÁXVQÑWQÁXVQÐWQÑPQÁWVPÑXP1üÁWVP1ýÁXVPÑWP1’ý1?üÁVVP1øüЬ[Ñkg
ЫPЫ Ы[Ñk
Ы[Ñk
	Ь«Ы[ÑkÑ»	Ь«Ы[ݬÝ[ûïÀЬ[ÕïÎmݬÝ[ßïèmûïŠ#2 WЬ«å¬ЬXÐkZËñÿÿÿJïðPÐPVЫYÑYÑY7ÑZl2XÖïnmÑVÝXÝ«ûï‡ÿÿÿÑVÝWÝ«ûïvÿÿÿÐZPÑPP1ã18ÑP>!1ÑP1Ì1ßÑP71ÍÑP£ÝÝ«ûï+ÿÿÿÑïŸzÝ š2 XЬW1vÿÑï‚
2X2 W1`ÿЫP2 ÝÝ«ûïˆþÿÿÑïRÝ Ý«ûïÅþÿÿЫP2 ÝÝ«ûïSþÿÿÑï2P2PЫQÐP¡ÝÐ2 X1ãþ2X1ÛþÑPë1ÓþÑP<1(ÿÑP:1?ÿ1¾þÑP=1@ÿ1³þÑPF¿ÑP?1*ÿ1þÑPL©1‘þÑPT&ÑPR’ÑPQ‡1oþÑPS1xÿ1`þÑPb1iÿÑPU1[ÿ1CþÑPl1Tÿ14þЬ[Ñk
Ы[ÑkÑk;Ñ»5ЫPРP•`)ЫPÑ €ÿÿЫPÑ ÿ
ÝÝ«ûïéÎÿÿÝÝ[òÔPЬ[Ñk
+ЫZÑZ"ÑZÑZÝ«ûïŠêÿÿÑPÐPÔPЬ[ЫZЫYЫPÕ ^ÐkPÓ@ïB‹4Ñi
&Ñ© Ý©ûï?êÿÿÑP
Ý©ûïÿÿÿ1/Ý1Ñi^1ЩPÓ@ïHdïÔPÐkPÓ@ïäŠ1£Ñª©4ÝZûï1ÿÿÿÕPݪ§Ñj^ЪPÓ@ïdÝÝZ1·ÝYûïýþÿÿÕP1rÿÑi^1sÿЩPÓ@ïÐc1bÿÝZûïÐþÿÿÕPŸÑj^²ÐªPÓ@ï©c¤ÐkPÝ@ßï#jûïÌÑj^ЪPÓ@ï{cѪ©ÝZûïwþÿÿÕP1_ÿ1@ÿÑi^ЩPÓ@ïJc1ÿþÝÝYûï$ÍÿÿÐPЬ[Ñ»^2ÝÝ« Ñk_+Ñk

ßï±iûï@ÝÝ«ûïâÌÿÿÐPЫ[ÑkÌÔPЬ[ЫPÕ bÑ»^XÑ»
ЫP>ÝÊÝ«ûïÌÿÿ6ÝÝ«ûïýÕP,ЫPЫPÑ°
&ЫPРPÝ ûï)ýÿÿÐPÑ»
ÀÑ»gÐÑ»^Ý
œÔP€Ь[ЫPРZЫPРYÐkPÑP=11ÑP1êÑP	
ZÑP1Ñ»^óÕZïÝÝ«ûïçËÿÿÐPÑ»^ÔPÑ»^ÈÑ»ÓЫPÑ ÉЫPÑ ¿1ÇÑP1¦1¼Ð«XÑhgШXÑh
µÝ¨ûïZçÿÿÑP¢Ý[ûï~ÐPWÐ:kÝÝÝ«ûïÐW«ѸN1«Ð§XÑhgШXѸN1 ßïðg1ÑP1ÿ4ÑP/1ÿÑPA1%ÿÑP?Ñ»^1ÿÑPC1ÿÕY1‘ÕZ16ÿÑ»
ЫPÝ ûïŠûÿÿ1ÜþÑ»g1ÿЫPÑ°
óЫPРPÒѸ	
ßïngûïáШP˜a°˜a¸ШPР¨Ý[ûïãÜÿÿÝ«Ý[ûïóøÿÿÝݧûïWÊÿÿÝÝW1bþÑ»
Ñ»^ЫP1iÿÑ»^1KÿÝ
16þÐïŒfPÖï…fݬßïófûï>Ь[Ý«ûïîÿÿÿ˜akЫ[Ñk8éÑkc1ªÐ«ZÑ»
˜akЫ[Ðk>Ð
kÝ[ûï(ÜÿÿÑk_)Ý«ûïeúÿÿÝ[ûïÜÿÿÑk_
ßïxfûïÔÀZ«=ÑZÐPÐPÐPYÂY«ÑY	ÞïXfPÞï\fPÝPÝÝ[ûï8ÂYZÕZ¿ÝÝÝ[ûïÐÝ Ý[ûïÉÿÿЬ[ÔZÑk8Ý«ûïéÿÿÿÐPZЫ[Ñ«Ñ«ÇZPÀPPÃPZP
ÇZPÖPÁPPZÁZPÑkc!Ç«ZPÄ«PÃPZPÇ«ZPÖPÅ«PZÁ«ZPÇZPÀPPÃPZP
ÇZPÖPÁPPZÁZPм[ÕïðeÝ[ݬݬßïìeûï¥à¬1†Ð¬PÑP€ÑP€	ÑP€YÑ[ЬPРP•`ÔPЬPÕ Ѭ€ÐPЬPÑ 
Ѭ€èЬPÑ ÿÿÿÿÄѬ€Ð¸Ý¬ݬûï6ïÿÿ謼á¬ݬûï’âÿÿÕP©á¬Ñ[	Ñ[_ЬPè ¾Ð[PÑP=ÑPBÑP
1.ÑP^1ÁÑP_1ÑP`1ŸÑPg13ÿË¿ÿÿÿ¬Pš€ZÒZPËP¬Pá¬áЬPÝ ûïºáÿÿÕPÏЬPР[ï[ï=†xú[ï8†Áï2†ï)†PÑPÐ
ï$†Ðï­…Ðï†Ð ï…Ãïÿ…ï’…Pxú[QÃQPïð…1¶þËßÿÿÿ¬PЬPРPÓ@ïÏ\ÐPÐPÐPZЬPРPÓ@ï²\1?ÿЬPРPÑ@徭ëÑZÐPÐPÈPZ1ÿËÿýÿÿ¬PЬPÝ ûï0âÿÿÒ¬QÊQPá¬ÐPÕï³cݬݬßïÇcûïfËÏÿÿÿ¬PÑP>á¬9ЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑP0Ûˬ~ݬûïÿÿÿï¬PѬP
Ë¿ÿÿÿ¬Pá¬ÔPЬPÏP
%9ku//õÿõÿWMCa×ï¬PËýÿÿÿ¬PËÿßÿÿ¬PËûÿÿÿ¬PËÿýÿÿ¬PËÿþÿÿ¬PËÿÿÿ¬PËÿûÿÿ¬PË÷ÿÿÿ¬PËïÿÿÿ¬PËßÿÿÿ¬PÞïvk[Ñ«	Ð[ïv„À$[Ñkaáßï¥bûïKÔZÑkZ1‚Ð[JïO„ÖZÑZptÕJï•ìÞïk[ÑkaÔÑkÃÃkPÐ@ï¿aYáY$ÑZ²ÑZ­ÑZ_¤ÝÝZûï¾ÞÿÿÕP“ÉYPÒPPËPJï3PÑPYéÀ$[œûïÉÒÿÿѬ@	Ðï­ƒ[@мPÐ@遼[2Ñk¼)lѼfѼ`Ѽ_VݬݼûïGÞÿÿÕPEÀ$[Ñka1ìÑk¹ÃkPÐ@ïú`YàY­Ð¼PÉYQÒQQËQ@PÑPY»Ò¬PËP«P°ÝLݬûïwÐPZÝ«ÝZûïûÿÿÕPÝ«ݪûï9ýÿÿÕP1yÿÝRݬûï@ÐPZÝ«ÝZûï×úÿÿÕPÚÝ«ݪûïýÿÿÕPÉá«ЫPÝ[ݬûïÕP¯Ý« ݬݬûïݬÝ«ݬûï¸	2P2PÂ^Ь[Ôïq`•k1¿˜kPÏPA~!H44|4žc44ÉÉ444‰b™444¬k×ïIƒÐïEƒPÖï>ƒk`Ö[žßï-ƒ˜k~ûï› êÐïö_áÖ[˜k~ݬûï³ÖÿÿÐé¬ÌÖ[‘k
ùÃÝïpßï`ûÝï_ßïò_éÑïU
˜wP˜lPÝPßïØ_ÌЭüxï,­ü­ü×­üxï#­ü­ü‘kMЭüPÒ­üPÝPûï*Þÿÿ1LÿЬPÝ ßï•_†Ý¼Ö[˜k~ûïµÕÿÿ1+ÿÖ[˜k~ݬûï…Р­üï­ü­üÝ­üßï`_1MÿÖ[˜k~ݬûï^ÝPûïÛÝÿÿ1éþÖ[˜k~ݬûïCÝPûïÞÿÿ1ÎþÖ[˜k~ݬûï(ÝPûïCßÿÿ1³þÖ[˜k~ݬûï
ÝPûïîÝÿÿ1˜þЬPÑP1,ÑP2'ÑP3"ÑPL*ÑPRFÝPßïÄ^ûïPÃ1¬PxPPÀ$PPмPËñÿÿÿ@ïž}PÑPЬPЬPРPмPËñÿÿÿ@ïy}PÑPЬPЬPРPÎï+‚Ðï%‚ï‚Ôï‚Ðï‚PÐPï‚Ô[ÔKï“ÓKïVÕïëÐ[ïæÐ[ïÛÓKï_VÕïÓÐ[ïÎÐ[ïÃÖ[Ñ[²ЬPР[ÔZCxZP˜^à$Pï[~ݬûïÕxZQÐPá@PxZPÔà<PxZPÞïÊ]à4P×[ÖZÓ[I¶xZP˜^à$PËÿÿÿ[~ݬûïˆxZQÐPá@PxZPÔà<PxZPÞï~]à4PÂ[ÖZÓ0[´Ó[1œxZP˜_à$PxZPÐà@PѼdѼcѼf
ѼbЬPx PÀPÇ P~Ëÿðÿÿ[PÇP~ûïdxZQÐPá<PxZPÞïç\à4PxZPxýà<PPxZQÐPá<PÖZÔYÊIïð}òYðÔYxYPÕà@PÔPÖYÑYZêÐPx¬PÀPï8}Ѭ(Çï+}PxPPÃPï}PÇï}PÖPxPï
}Ñï}ï}Ðï÷|ïö|ÃïÐQïç|PÑPïÇQÃï»QïÒ|ïµQÎïÇ|PмPÓ@ïÚz$ݬûï>ØÿÿÐP[Ý[ݬݬûïªÕPÐ[PЬPË [Ñ[ Ý[ݬÝPûï~ÕPÔÓ¬1ÐïL[Ñ[ï@`ÓKïÂSÝ[ݬݬûïKÕP¡Ö[ÖÓð¬5Ðï[×[ ÓKïŒSÝ[ݬݬûïÕP1hÿñïê~[ÖÿÎPЬPÓ@ïXS
ßï'[ûï…ЬPÑ@ïJ|ÔPÓ¬ЬPÓ@ï&SéÓð¬ЬPÓ@ïSÑЬPÝ ûï×ÿÿÑP1¨è¬·Á¬PÓ@ïåR¨Á¬PÑ@ïã{™Ð¬PÕ@ïÕ{
ÁPPÕ@ïÈ{GÁ¬PÕ@ïº{ݬݬݬûïlÕP%ЬPÕ@ï™{1MÿݬÁP~ݬûïGÕPèЬPÈ@ïo{Á¬PÈ@ï^{ÐPЬPÕ@ïO{ãݬÝPݬûïÓD¬ݬÝLݬûï-ÕPÐPÓˆ¬ݬÝRݬûïÕPÛÔPݬݬûï‹úÿÿÐP¬Ѽ
Р¬Ѽ_GЬPÑ €&ï P×PѬPЬPï PѬPÐPÔPЬPѬ ÐPÔPѼ^àЬPѬ Ý ûïZÕÿÿÑPЬPÁ PѬPÐPÔPЬ[ЫZÑk^Ý«/Ñk_/ÑZ€ÝïZPÃP~ûïÝïZ~ÝÝZûïÕï˜X$ݬûïØÔÿÿÝPЬPÝ@ï‡Pßï¼XûïÞЬPÓ@ï®POô@ï±y
ßï¯XûïÓݬûï‘ÔÿÿÑP+é¬
ßï¢Xûï³Á¬Pô@ïwy
ßï•Xûï™ÕïX$ݬûïLÔÿÿÝPЬPÝ@ïûOßïyXûïRЬPÓ@ï"PÖ@ï%yݬûïÔÿÿÑP,Á¬PÓ@ïýOÁ¬PÖ@ïûxé¬
ßï?XûïÕ¬ßïdXßïbXûïäѬèÔZÔ[1x[PÒPPËP¬P!ÕZ
ßï7Xûï´ÖZÝKïCWûï¤Ö[ÕKï3WÆ ^Õï!W>ݬßïXûï{ݬûïqÿÿÿßï÷Wûïdݬûïr¸ÿÿßïãWûïMѬѼaÕ¬ßïÏýÿÿݬûïkмPÓ@ï›uûï~Õ¬é¬ݬûï£á¬#á¬ݬû`¼ЬPÔ ЬPÔ Þ­ì[é¬ÝLݬûïH÷ÿÿÐP‹á¬ÝRݬûï0÷ÿÿÐP‹á¬Þï€y‹á¬Þï”y‹á¬Þï¨y‹Þ­ìPÑ[P
ßïûVûïyÔkÞïyN­è1Ò½èPËP¬P"Þ­ì[ЭèPÝ ÝZûïlïÿÿÕPÀ[ÐkZäÀ­èÕ½èÊßï¼Vûï*Ѽc	ЬPР¬ЬPРªÝZûï¿ÐPZݬûïŒÐj¼ЬPЪ ЬPЪ ЬPЪ ˜ajмPÑP^
ÑP_1˜ЬPà ЬPË PÐPYá
YЬPÑY nÕIï[vÝ ûïGÑÿÿÑPÁYPÕ@ï?v
ßïVûï`ЬPÝ ÝYûï¸üÿÿЬPÝ Ý ûïüÿÿЬPÝ Ý ÝYûïÊÏÿÿЬPÐY ЬPÑ €Yï PÃP­äЬPï ­àЭäPÑ@ïÅu
Ó@ï®LЭàPÑ@ï­u1ÿÓ@ï“LóßïvUûïÀ1ÿЬPРPÑ@ï~uëЬPРPÓ@ï_LÙßï_UÊм¼ЬPЬQР¡ЬPЬQР¡ЬPЬQР¡ЬPЬQР¡ЬPЬQР¡Ь[Ý[ûï#ÐPZÝPûï›ÿÿÿЫYÑk^Ý«/Ñk_/ÑY€ÝïYPÃP~ûï]ûÿÿÝïY~ÝÝYûïIûÿÿÐjPËñÿÿÿ@ïBrPÑPÑPÐZPÝ«ûïsÿÿÿÐPªÝ«ûïeÿÿÿÐPªÞÔ[ÓKï\KÕKï_t
ßïpTûï€ò[ÜÂ^ЭüÔ[x­ü­üÖ[Õ­üóÃ[PxP­øЭøPÖïNTÝuûï“¥ÿÿݬݬßï‰uûï>ßïÈYßïvuûï+ÑïT
ßï®YûïÝcûïG¥ÿÿÕïïSÑïçSßïY2ßï¶Yßï$uûïÙݬݬݬݬßïuûïÀßï›Yßïøtûï­ÝûÿÿÝwûïÕ¤ÿÿßïpYßïËtûï€ݬݬݬßïµtûïjßïQYßï¢tûïWÂ^Þï§9­ü	˜a½üÀ ­üÑ­ü\@íÞïŠ9ï]uÂ^ÐïQu­øÑ­ø\@Þïg9PßïñXûïçþÿÿÁ ­øPÐP­üÑP­øãѽüaÐPïuÑ­ü\@¾Á ­üPÓÂ^Õï­R2Þï9­üѽüaÝ­üßï´XûïƒþÿÿÀ ­üÑ­ü\@Øûï,ÿÿÿѼaßïݬûï€Õ¬ßï|Xûï:þÿÿ˜a¼Â^Ь[ÑPÝ­üݬÝ«ûïßÿÿÿЫ[Эø¬Ô­øЭø­üß­øß­üݬÝ[û¼ÐkPËñÿÿÿ@ïRoPÑPµÐ«[Эü¬ÉЬ[ÐkPËñÿÿÿ@ï+oZÑZ
ݬÝ«ûïØÿÿÿÑZ
ݬÝ«ûïÆÿÿÿÝ[û¼ÞïŽQ[ÐkPЫ@ïçnÁ[PÐkQÐPAïmÀ[ÕkÞ'ßïXAßïX9ЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑPËËÏÿÿÿ¬PÑP ßïÎWûïô¾ËÏÿÿÿ¬PÑP0¨Ð¬PÝ@ï©Ußï°WûïÌЬ[Ý[ûïoÐPZÁZïIsPÑPUÀïXVÑïRVì3
ßïmWûïžüÿÿÔïsÕÿ2V&Ýûï“ÐPY
ßï^WûïqüÿÿÐYÿ
VÝ[ÁïârÿýUPÐPYÝPûï”ÁZPÀPïÅrÐYPĬ¬ݬûï?ÐP[ÔPÐ[ZÝÁ¬~ûï–ÐPYÔŠôYûÐ[PݬûïxЬ[ЬZ‘«+ÐPÔPÐPXÝZûïC‘kw+ݶݬûï—ÐPYÕX1ÕYùÝYûïœÝ‘kalÕXÐPÐPÝPݬûïªÐPY<ÑïËy3ݶݬûï@ÐPYÕXÕYÝYûïHÝݬûïlÐPYÕY)ÝÝÝYûï ÕXÐPÔPÝPݬûï?ÐPYÕYÔPÔjöYªÕXâª‘kr¨ª¨ªÐZPݬÁ\~ݬûï³ЬPá ÎPÔPûï»ÐPZЬ[•‹ü×[Ý
ÝZûïÀ0PöPkÝ
ÝZûïÐPZ‘{XÛÖ[˜aYÑYzÞïoPöYkÖYÝݬûï	ÖPÚЬP¼!ïЬ[ÞïtoXÑXïªpÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûïÙÝ‘kalÕYÐPÐPÝPݬûïçÐPZ<Ñïx3ݶݬûï}ÐPZÕYÕZÝZûï…Ýݬûï©ÐPZÕZ)ÝÝÝZûï]ÕYÐPÔPÝPݬûï|ÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ïÔßïXnÁ\~ݬûïÜáïOnÎPÔPPÀÔSЬRÔUš‚T‘ Tø‘T‘T
î‘+T‘-TˆSš‚T|P‘T04‘T9/ÑQÌÌÌyPVyPPÀVPØWQÂ0TÀTPØQÖUáS×Uš‚TÇ‘T.ãSòÔV‘Te‘TE[š‚T‘T+‘T-ˆSš‚T‘T0‘T9ÑVÌÌÌêÞFfV>F¤ÐVßáSÎVVÀVUÑUœÿÿÿÐœÿÿÿUÑUdÐdU}PP1ÔRÕU#ÑQ™™™	yÿPPÖRîyPVÀVPØWQÖRõUß=;ÕQ
yPPÂRyPP×RáQöÐQVÔW{VQWÁPVØW{
VPVÀPPÑVÖP×RòUÖáQyÿPPÖRyPPœÿPPnPVnQPdï‘þÿÿP`VPáSrPPÝRpP~ûïÆЬ[á«¨«è«ÎPà«÷ÝûïM
ÐP«¨«Õ«á«ߘ«Pž@嶺稫Ñ[„OáïZl
ßïGlûïê
á«ÐP2PÝPÝ«˜«~ûï
ÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«p¬PïPRÀ¬RÑR
ðRP|Ppï¨kPá¬rPPÐ"ï¸tЬ[ÔZÖZ•‹úÐZPЬ[ЬZÐ[XÔYŠ‹ÖYÑY¬ó”‹ò¬YùÐXP¼0ïмïÀ¼¼ÐQPÂ^™B­üЬ­ô2ÿ­ðß­ðÁ\~ݬûï¨×­ðЭôPÖ­ô”`ß­ðÝûïrЬP	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûï©ÐPYj˜ïLb~ûïòÕPâ«Þï7k«Þï/k«á«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûïAÐPYÐZ«Ôkná«1mÿЫZ3Ñ[”O1xÿÝûïwÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûïØÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûïlÑPY¨ «ÎPÔPÞïä`[Ý[ûïÀ[Ñ[ïbëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûïYÕPÎZá«
Ý«ûï˳Œ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼Ь[ЬZ‘kŠ•‹÷ÔP˜kP˜zQÂQP¼ï¸ÔPÂ^ß­úݬûï\ÕPÔPÐP¼ïˆ¼ïxЬ[ЬZÐ[YŠ‹ûÐYPݬÝ	tݬûïݬÝtݬûï¼6ï$Ь[ѬÿÿÿÿÎPé«Ñ««Ñ««êÕkæÖ«Ök׫ЫPö¬`ÔP¼
ïÔÔPЬPЬRÑRÔQ{RPRPÔPÑPRÂRPÕï„t.ÉìdïvtÉèdïntÞïhtïktÞïYtï\tÝÁ¬~ûï*ÐPYÐïEt[ÔïJték$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZït	Ñ[èdÔPñïøs¬ÿÁYPÆPxPïßsÝûïbÐPZxïÌsPÀZPÑPZÀxï¼s~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿ™sÁï’sPÑZPÈÿ…sxï†sPÀZPÃPjÐjïosÉèdÿcs1ÿxYPÁ[PïPsÑZïIsÐÿAsïDsÐkÿ5sÉï.skÁ[PЬ[Ð[ZÂZÐZïsËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐïur@j‘Áï8^¬~ÝÐ\SÐ^\¼ï_Ðï^PÀ£ï^¼ïCЬïÿ]ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPï‘eÎPÿÿÿÿ29þÿÿÿ8L9Lþÿÿÿ8K9KþÿIÿÿ8O9OþÿJÿÿ 4)þÿ'ÿÿ"4!þÿå]‚‘d;ãMbùYWXP8aNfæO
	_.\3B0RQ$ïðôKøíîõö÷ûúScT/länñšÉáj*ƒ$#-’–»Ji
Š‹ŒŽgÆ[5F9ÅšeG›žþp™¢£¤¦¨ª¬®¯±³µ¶·¸¹m(*ƒœ0½ºI1&Ÿ¼ '’&E0D'¿1Û“†Ûˆ0Aý91ÕÌ^͘Î!ÏÊЉÑ%Ò‡ÓùYWXÙƒPÀHNÖÈO×@ß&ÝÞÄàâÚ(*ÄRQü“^ïðôøíîõö÷ûúSÚTl—bñ
Ãa	ÃÜ—
	ÿ4	6
	`òl !#"
c/w¾<o",' t-uCówsky^hz„{2~|}qxsvtu=,wÇZ)+7:t¡uË?w>%y.sz{r~€|}qxsv•U
ìêëtéuçèwy+z{r~€|}qxsvtuwy)z{r~€|}qxsvtuòwtuw(ysvzr{€~$|}qxsvtuwyz{~|}qxsvtru€wyz{~|}qxsvr€tuwr€tqusvwyz{~|}qxsvtuwyz{~Ô|}qxsvØr€tutwuywzy{r~€|}qxsvqxsvtuwyÁz{r~€|}qxsvtuwyz{~|}qxsvr€VYWXPNOVYWXPN€ORQRQSTVYWX´PSNTOVYWX²PNORQRQSTVYWX°PSNTOVYWX­PNORQRQSTVYWX«PSNTOVYWX©PNORQRQSTVYWX§PSNTOVYWX¥PNORQtuwyRQ{STqxsvST…VYWXPNOVYWXPNORQ
RQSTVYWXSTLVYWXPNOVYWXRQPNORQSTRQtSuT”wVYWXPSNTOqxsvtuwyRQz{~|}qxsvtSuwyz{|qxsvtuwyz{qxsvüüÿüüüüøãüìüü{(w$üZüíí mëÿüÑüøæøü!üüüü’imZb`2üüüŒSÐüüüü*ü1üÞÿüÞüüKüüü"üü9–~6ÃËüüütø0üUüüëüëp!üüZüüüü–üü]P*÷êÄ·ü–üü ü~~~~~~ËZ¿ü/–üüüüüüüüüç«–ü>ü,^w_6––oüˆücÇ¿üüü––––––––üülüø~8ügc–üüöÿüüéüµµµµµ!ƒüóÿµ¹¶üª¤¸Eüü5žüüßüüÙƒ~üüüüÐüüüü¸üüü•µüü’nJüüüüüü&îÿüüz&xwusrqponmFlkj6mih\WVT$S
QONKJH#GE:	830/  ##%%%&		''))

**,,"-"...011/////3344((++225!6$$$$$$$$$$$$$$$$$7778

üÿÿåÿäÿðÿñÿÚÿïÿ"!íÿîÿöÿ#÷ÿ19ãÿèÿÑÿ2õÿçÿÏÿïÿÚÿ!4498âÿ26çÿèÿçÿèÿÒÿ326Îÿ:2ïÿ!ÖÿÔÿïÿÙÿ×ÿÐÿáÿàÿ37þÿÈÿ333837þÿôÿ4òÿ02êÿÕÿ9Þÿéÿçÿ2Øÿ8:ÑÿèÿßÿñÿÊÿ47ôÿ78:ÍÿÌÿôÿËÿ46 2òÿòÿòÿòÿòÿòÿ2ìÿôÿïÿ3æÿôÿ25Ôÿ8þÿ5×ÿþÿÞÿÛÿôÿôÿôÿ:ôÿ:ôÿ:ôÿ:ôÿ:ôÿôÿ:ôÿ:ôÿ:ôÿôÿôÿôÿôÿØÿ8Íÿôÿìÿ33ëÿ283Óÿþÿ9ñÿÝÿôÿôÿôÿôÿôÿôÿôÿôÿ5ÌÿØÿ73òÿ63ëÿëÿôÿéÿ9ãÿÜÿ5ôÿßÿüÿýÿûÿùÿúÿøÿ)*$%9Éÿ&+,-(/.ôÿ57þÿ399ÜÿÜÿÜÿÜÿóÿôÿÜÿ999ôÿ95Üÿ2222ôÿ72'+399ôÿôÿóÿôÿ32Üÿ3393ôÿóÿ399þÿ( þÿFþÿXþÿ9þÿþÿGw5;ACEwYBV*-T"$<=:?@67M•£¤¥¦W,.1w49UwHL	\>xD8TPRZ–±—˜™š›œ© {°&+/w3#%
}~€‚ƒ„…†‡ˆ‰“”UT¢§¨©©¡2
‹ŒŽŠ‘NQŸžwª¬|0[^zjq£’S­¯]_`aydefgklmznp®shio«crtzvub@(#)yaccpar	4.1	(Berkeley)	2/11/83ÿÿÿÿbad bdtydimension table overflowwhiles, fors, etc. too deeply nestednon-constant case expressioncase not in switchswitch table overflowduplicate default in switchdefault not inside switchswitch table overflowduplicate case in switch, %dyacc stack overflowsyntax errorfunction level error$%dFAKEstructure typed union member must be namedfield outside of structureillegal field sizefield outside of structurezero or negative subscriptfunction declaration in bad contextold-fashioned initialization: use =nesting too deepillegal breakillegal continuestatement not reachedvoid function %s cannot return valueloop not entered at toploop not entered at toploop not entered at topprecedence confusion possible: parenthesize!old-fashioned assignment operator& before array or function: ignoredstructure reference must be addressableundeclared initializer name %sÿÿÿÿp€†‹’™¢©¯¶ºÀÇËÑÙáçëôFIELD[%d]SNULLAUTOEXTERNSTATICREGISTEREXTDEFLABELULABELMOSPARAMSTNAMEMOUUNAMETYPEDEFFORTRANENAMEMOEUFORTRANUSTATIC$_0 
"'`(2)3{4}5[6]7*?:+	-
/<%>&|^!L~M,88;9. D<
S>U=::ÿÿøü)/*!.),,3'81=-AGO%T&W[`$gp(w~0…‹’
š£©®+´rwccom:can't open %s
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890123456789abcdefABCDEF 	
01234567abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789	
unexpected EOFnewline in string or char constantnon-null byte ignored in string initializerempty character constanttoo many characters in character constantunexpected EOFillegal character: %03o (octal)illegal hex constantnewline in BCD constantBCD constant exceeds 6 charactersgcos BCD constant illegalambiguous assignment: assignment op taken=<%c illegal=>%c illegalyylex error, character %03o (octal)out of switch in yylexbad asm constructionbad AR_?? actionRan out of memory (savestr)ran out of memory (hash)ran out of hash tablesasmautobreakcharcasecontinuedoubledefaultdoexternelseenumforfloatfortrangotoifintlongreturnregisterswitchstructsizeofshortstatictypedefunsignedunionvoidwhiledefid calltyreducedefid( %s (%d), , %s, (%d,%d) ), level %d
	modified to , %s
	previous def'n: , %s, (%d,%d) ), level %d
declared argument %s is missing	previous class: %s
redeclaration of: %sredeclaration of %s	new entry made
void type for %s	dimoff, sizoff, offset: %d, %d, %d
parameter stack overflowbcsave errorparameter reset errorswitch errordclargs()
	%s (%d) 
dclstruct( %s ), szindex = %d
??gummy structure memberillegal zero sized structure member: %szero sized structure	dimtab[%d,%d,%d,%d] = %d,%d,%d,%d
	member %s(%d)
redeclaration of formal parameter, %scompiler takes alignment of functioncompiler takes size of functionunknown sizeinitialization alignment errorinoff errorbeginit(), curid = %d
instk((%d, %o,%d,%d, %d)
no automatic aggregate initializationinsane structure member listendinit(), inoff = %d
too many initializersempty array declarationbad scalar initializationcannot initialize extern or union} expecteddoinit(%o)
illegal initializationillegal {irbrace(): paramno = %d on entry
too many local variablesStructure too largetoo many local variablesillegal field typefield too bigzero size fieldstructure too largestructure too largenidcl errorillegal type combinationtymerge: arg 1array of functions is illegalfunction returns illegal typea function is declared as an argumentfunction illegal in structure or unionfunction has illegal storage classillegal use of fieldillegal classillegal classillegal classillegal register declarationillegal classillegal classfortran declaration must apply to functionfortran function has wrong typeillegal class: %dSymbol table full	nonunique entry for %s from %d to %d
lookup( %.8s, %d ), stwart=%d, instruct=%d
symbol table fullsymbol table full%s undefinedremoving %s from stab[ %d], flags %o level %d
symbol table full%s redefinition hides earlier one	%d hidden in %d
unhide uncovered %d from %d
unhide failsbuildtree( %s, %o, %o )
constant argument to NOTconstant in conditional contextdivision by 0.illegal lhs of assignment operator%s undefinedmember of structure or union requiredmember %s==%s?
illegal member use: %snonunique name demands struct/union or struct/union pointerstruct/union or struct/union pointer requiredundefined structure or unionillegal member use: %sillegal indirectionunacceptable operand of &assignment of different structurestype clash in conditionalillegal functionillegal functionother code %dchkstr( %s(%d), %d )
undefined structure or uniongummy structureillegal member use: perhaps %s.%s?division by 0division by 0illegal comparison of enumsenumeration type clash, operator %spointer/integerstructure pointerarray sizepointerillegal %s combination, op %sundefined bit field typepointer requiredillegal oconvert: %dillegal pointer subtractionillegal types in :void type illegal in expressiontymatch(%o): %o %s %o => %o
constant expectedconstant too big for cross-compileroperands of %s have incompatible typessizeof returns 0	    %o) %s, %d, %d, , %d, %d
statement not reached.L%dPQTURSXYVW& error”O
ø!	bra	.L%d
	bra	.L%d
	.even
	.text
	.data
locctr: STAB unusedillegal location counter.L%d:
	movl	d0,a0
	movl	#.L%d,a1
	movl	a0@+,a1@+
	movw	a0@+,a1@+
	movb	a0@+,a1@+
	movl	#.L%d,d0
	.bss
	.even
.L%d:
	.=.+%d.
	.text
	movl	#.L%d,a0
	jbsr	mcount
	.data
.L%d:	.long 0
	.text
	link	a6,#-_F%d
	moveml	#_S%d,a6@(-_F%d)
	mov%c	a6@(%d),%s
bad argument| A%d = %d
	.globl	%s
%s:

	.byte	,%d
	.long	0
illegal field type%s, line %d: wCannot open temp filerLost temp file	subl	#%d,d0
	cmpl	#%d,d0
	bhi	.L%d
	addw	d0,d0
	movw	pc@(6,d0:w),d0
	jmp	pc@(2,d0:w)
.L%d = .
	.word	.L%d-.L%d
.L%d:	cmpl	#%d,d0
	beq	.L%d
	bgt	.L%d
	cmpl	#%d,d0
	beq	.L%d
/tmp/pcXXXXXXbad conversionincode: field > int	.word	%d
	.long	%d, %d
	.long	%d
	.word	%d
	.comm	%s,%d
ÿÿÿÿ$$#$*$0$7$;$A$F$K$Q$X$`$g$n$QPUTSRYXWVbad option: %cstore called on:
SZEROSONESMONESPECIAL+%d|order( %o,  )
order( %o,  ), cookie , rewrite %s
no table entry for op %sillegal initializationexpression causes compiler loop: try simplifying	    %o) %s %s  size=%d align=%d, , NOPREFMUSTDO PREF %s, SU= %d
SANYSAREGSTAREGSBREGSTBREGSCCSNAMESCONSFLDSOREGSTARNMSTARREGINTEMPFORARGSWADD*	*****=*?*A*C"*ÿÿÿÿ%*&*)*,*/*2*5*8*;*>*A*D*G*J*M*P*S*
Ê  @V*a*l*w*‚**˜*£*®*¹*QPQQSUVSUWUSXUSYWYVWYWYWXYWYÄ*<É*>Î*Ó*=Ù*?ß*å*<ë*>ñ*÷*=þ*?++++<+
 +
%+*+	0+6+=<+B+	I+P+=W+|	line %d, file %s
.L%d:	moveml	a6@(-_F%d),#%d
	unlk	a6
	rts
_F%d = %d
_S%d = %d
| M%d = %d
	.globl	fltused
%sfno hoptab for %s	jbsr		jbsr	@	movl	,a0
	jbsr	a0@bad subroutine namebwl	clrl	%s
sp@-Illegal ZT type conversionIllegal ZU%dNot a structureSTASG badSTASG-r	movw	AR,	movl	AR,AR
illegal zzzcode	movl	%s,%s
	movl	%s,%s
%d%sillegal conputinsput#%sbad arg temp%s@()illegal upper address##%sbad arg tempa6@(%d)%s@()@+-illegal address%d%s%s+%d	%s	#%d,sp
addqladdl	bra	.L%d
bad conditional branch: %s	cmp	AL,AR
	tst	AR
	cmp	UL,UR
	tst	UR
Bad address for hard opsfloatfixbad special shapeaddsuborandeormuldivdivslsrd0d1d2d3d4d5d6d7a0a1a2a3a4a5a6sp	beq	.L%d
	bne	.L%d
	ble	.L%d
	blt	.L%d
	bge	.L%d
	bgt	.L%d
	bls	.L%d
	bcs	.L%d
	bcc	.L%d
	bhi	.L%d
lmulldivlremalmulaldivalremulmululdivulremaulmulauldivaulremfaddfsubfmulfdivfnegfnegafaddafsubafmulafdivafaddfafsubfafmulfafdivf'store finds both sides trivialrallo( %o, %o )
setbin can't deal with %sbad setstrbad incr rewrite bad -= rewrite.L%d:
stuck starg	movl	AR,Z-
	movw	AR,Z-
 !@A€ @tshape( %o, %o), op = %d
ttype( %o, %o )
bad setrew%d%d%c%d%dbad getlr: %c†-Œ-“-™-Ÿ-usable asked about nontemp registerrfree( %s ), size %d
register overfreedillegal freeregister overfreedrbusy( %s ), size %d
illegal register pair freedRLEFTRRIGHTRESC1RESC2RESC3RNULLRNOP|reclaim( %o, ,  )
illegal reclaimcannot reclaimfaulty register movepotential register overwritepotential register overwriteregister allocation errorNAMESTRING^REG_OREGICONFCON`CCODES
U-
U*U&HUCALLKUFCALLL!M~lFORCEnINIThSCONViPCONV+h+=i!-(	-=)!*	*=	)&h&=i ?:&&||8,;,OP:=	</ˆ	=/=‰)>%ˆ?%=‰ @<<A<<=	0B>>C>>=	0|h|=i ^H^=I N++	O--	E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN	 oCAST	 %GOTObSTASG	cSTARGdSTCALLfUSTCALLÿÿÿÿ›4¡4¦4«4±4µ4º4À4Ç4Í4Õ4Ü4â4è4ï4ø4þ45œPL3
too many errorscannot recover from earlier errors: goodbye!
compiler error: 
warning: 
out of tree space; simplify expressionwasted space: %ofreeing blank tree!undeffargcharshortintlongfloatdoublestrtyuniontyenumtymoetyucharushortunsignedulong??PTR FTN ARY %sout of temporary string spaceout of memory (tstr):#Â
×€LF:#Â
 €WF:#Çd€ÇjF:#Â
×Ê
×xF:Â
 Ê
 †F:Â
Ê
 ŸF:	ÇÊ
ǬF:€ºF:ÇF:Ê
!G
&Ç	jGÊ
yG Â
×zG Ç…G&€Ç	“G&d€Ç	žG&Ê
Ç	¬GÊ
 	ºGÊ
	ÓG8Ê
ÇàG Ê
ÇîG ŠüGÊ
HÊ
 H D8H Ê
DDH Ê
QH Ê
	jH Ê
	ŒH Ê
€	·H Ê
ÙH Ê
 ïH ÇÊ
ÇI Ê
I B
Ç€Ç(I Ê
 Ê
 8I`ŽI
ÇžIMÇ©INÂ
Çf€Ç´IOÂ
Çf€ÇÑINÂ
Ç€ÇîIOÂ
Ç€Ç
JNÇf€Ç&JOÇf€ÇCJNÇ€Ç`JOÇ€Ç|J@e€P˜J @e€©J@e€P¹J @e€ÊJ"Â
Çf€ÇÚJ(Çf€ÇéJ"ÇÊ
ÇøJÇÊ
ÇK"Â
ÇÇK	"Â
Çf€Ç"K	(Çf€Ç1K	"ÇÊ
Ç@K	ÇÊ
ÇNK	"Â
ÇÇ\K"Â
Ç€ÇjK"Â
ÇÇxK"ÇÂ
džK"Â
ǀǓK"Â
ÇÇ K"Â
­K"Â
ºK"Â
ÇKÂ
ÔK€Â
ÿK="Â
/L="Â
EL="Â
bL=Â
L=€Â
ªL?Â
ÚL?Â
ùL?Â
M?Â
EM?€Â
yM"f€Ç²M"@€ÇÀM"ÇÊM"€f€ÇØM"Ê
€ÇæM"€ÇðMHÈþMhDDNhÇ€NhDNhD#Nh$NhD.NhDANh€ÇKNhDZNhÊ
FƒkNhÊ
 nNhÊ
 	oNh Ê
 …Nb@ˆ›Nb@žNb@ˆ¡Nn€D°Nn€»Nn€ÆN
@
ÑNN@NÒNO@NÓN:@:ÔNb@bÕN
@ÖN ×N@LØN;@;ÙNn@nÚN@
ÛN
@ÜN@ÝNaaaaaaaaÞN	clrZB	AL
	clrl	AL
	clrl	UL
	moveq	AR,AL
	movZB	AR,AL
	movl	AR,AL
	movl	UR,UL
	movl	AR,AL
	movZB	AR,AL
	andY	#N,AL
F	movl	AR,sp@-
	movl	#H,A1
	lslY	A1,AR
	andY	#M,AR
	andY	#N,AL
	orY	AR,AL
F	movl	sp@+,AR
	movZB	AR,A1
	movl	#H,A2
	lslY	A2,A1
	andY	#M,A1
	andY	#N,AL
	orY	A1,AL
	movZB	AL@,A1
	tstZB	AR
	cmpZB	#0,AR
	clrZB	A1
	moveq	AR,A1
	movZB	AR,A1
	movl	AR,A1
	movl	UR,U1
	movl	AR,A1
	movZB	AR,A1
	movZB	AR,A1
	extl	AR
	movl	AR,A1
	movl	AR,A1
	movl	AR,A1
	movl	UR,U1
	pea	AR@
ZP	movl	AR,Z-
	movw	AR,A1
	movl	A1,Z-
	clrl	A1
	movw	AR,A1
	movl	A1,Z-
	movb	AR,A1
	extw	A1
	extl	A1
	movl	A1,Z-
	clrl	A1
	movb	AR,A1
	movl	A1,Z-
	clrl	Z-
	movl	AR,Z-
	movl	UR,Z-
	movl	AR,Z-
	cmpZL	AR,AL
ZI	cmpZL	AR,AL
ZI	cmpZL	AR,AL
ZI	movl	UR,Z-
	movl	AR,Z-
	movl	UL,Z-
	movl	AL,Z-
	jbsr	fcmp
	addl	#16,sp
	tstl	d0
Z0ZI	moveq	#1,A1
ZN	negZB	AL
	notZB	AL
F	movZB	AL,A1
	addqZB	AR,AL
F	movZB	AL,A1
	subqZB	AR,AL
F	movZB	AL,A1
	addZB	AR,AL
F	movZB	AL,A1
	subZB	AR,AL
F	movZB	AL,A1
	addqZB	AR,AL
F	movZB	AL,A1
	subqZB	AR,AL
F	movZB	AL,A1
	addZB	AR,AL
F	movZB	AL,A1
	subZB	AR,AL
	lea	AL@(ZO),A1
	pea	AL@(ZO)
ZP	lea	AL@(ZM),A1
	pea	AL@(ZM)
ZP	addqZB	AR,AL
	addqZB	AR,AL
	addZB	AR,AL
	addZB	AR,AL
	addZB	AR,AL
	subqZB	AR,AL
	subqZB	AR,AL
	subZB	AR,AL
	subZB	AR,AL
	subZB	AR,AL
	eorZB	AR,AL
	eorZB	AR,AL
	OIZB	AR,AL
	OIZB	AR,AL
	OIZB	AR,AL
	muls	AR,AL
	mulu	AR,AL
	mulu	AR,AL
	extw	AL
	movb	AR,A1
	extw	A1
	muls	A1,AL
	andw	#255,AL
	clrw	A1
	movb	AR,A1
	muls	A1,AL
	extl	AL
	divs	AR,AL
	andl	#65535,AL
	divu	AR,AL
	andl	#65535,AL
	divu	AR,AL
	extw	AL
	movb	AR,A1
	extw	A1
	divs	A1,AL
	andw	#255,AL
	clrw	A1
	movb	AR,A1
	divs	A1,AL
	extl	AL
	divs	AR,AL
	swap	AL
	andl	#65535,AL
	divu	AR,AL
	swap	AL
	andl	#65535,AL
	divu	AR,AL
	swap	AL
	extw	AL
	movb	AR,A1
	extw	A1
	divs	A1,AL
	swap	AL
	andw	#255,AL
	clrw	A1
	movb	AR,A1
	divs	A1,AL
	swap	AL
	aOIZB	AR,AL
	aOIw	AL
	aOIZB	AR,AL
	lOIZB	AR,AL
	lOIw	AL
	lOIZB	AR,AL
ZC
	andl	#255,AL
	andl	#65535,AL
	extw	AL
	extw	AL
	extl	AL
	extl	AL
	andl	#255,AL
	andl	#65535,AL
ZT	movl	AL,A1
	clrl	U1
	clrl	Z-
	movl	AL,Z-
ZSZSZS	movl	AR,A1
	.long	CL
	.word	CL
	.byte	CL
help; I'm in trouble
/                           AAAAAABBBBBB ÿÿÿÿÿÿÿ¤\¤\ÄPe—r<ô¤`#3¼;(DðK@-R”UZTub€zi˜ƒqÈ`wÌ`}ȉ†¤¡趗lÆŸ,§XήÔÙ¶Þ¾ÞÇyTÞÑÅ`ßÛ~„ßäÿôßíàõÅ$áý4á~\á
xäâÇä✨ã'xèã0$üã:Í(äC8äKHäTÌXä^f ägfípyïw– ï~´ ï‡@ïPpï¦ï¯!¨ï¶»Ôï¾äïÇA$ðÐ4ðק\ðà7ˆòçÏÌòî€ôòöóÿ ï~Ärô	2ÌP$ L3-üì36	"ÐP>	dÔPEÇ<K¾nRSVXLÚ`:lhfÌ´n	¹ØPv	ÜP~…è†á$Ž	p–	6¬qž	ª°q§	D´q°	*¸qµ%T¾¸Ç#¾uÎBúÙÖ	"¼qÛ	€ÄqâN‚{ê~h{òàÛùêDdš
`Þëôlô ú˜ý([üÿ/p5Ô;%8BœI	D”yN¨$VŸ(_ë,j²\u“Œ~pF<‡P&Ž	;ì{˜	àð{ +zL©Ú@-°	Ìô{¹	´ø{ÂîZ5ÊD~ÒÖzÚžKáøü8ìÖ27õ	ü{ÿ	@|t$8"ò7	F|"FXä+D²+4˜èQ<‚¾ÚD	Þ|JË$IRé^<ZŒ?cŽKj·"Or`:Dz<Cƒ•’GŒÕ G•püRž	<$§	~(¯ç@6¸ºs¿ø€zdz”UÒ/Û® ã	Ø,ë	=0ó		4û§ nWòn
-Þhr¼ög"	8+Ј2	J<8 ¾A@ÿ¨H	§DO	åLY	ý¤b	¨j	’¬s	’°zë‚	´Š	«¼Ý—­ž¯¼§ûü°	T|@¸	ö|D¿kðÇ	ç„DÏhÔÙ×	½ˆEÞ.„Oäk¸ì¼ô+tük€‹„6TÞ¤`ßȉ&ðˆ.*
Û5¾Ü=€T<F™P.Om‚~Y‚âbjË
r	ÈŒExþäâAäï‰	ŒG’Kj*›Jr¢9èB«{è~³ûŒº÷Ã)˜'Êd6,ÐÇøNÙð‰ä ïìfíõ	”Gþ	Ò˜G	†œG$èã«\ðÍüã'lÞ/	;ŒH8	ñôI>4áFìÜNŸæMW{DOa&5hëDHpa\Q{c^T«’{‰_˜Û‘å䆚¼´z¤Kš|¬zÖ<´y†=»#ŠÂ>ËíZˆÔ;TÜÎ>æOÀî	7øIödÄÿÃê?‘’~¬@‡èúE7̇(Dˆ/bêG6Už= ‰EK‰NάrVƒÜ]fMg+î†oŸ¨Rwå†~~»Š~†<UŽª$T˜Ž~Ÿ	äüI¥	s¼K«pxa³Ò:oºëDjÄúbdÌÒFiÕ˜lÞBkçj’jñÖƒùl`	lpf	‰Î_	3>f	ò(‡ 	Òh(	9ôh/	¾i9	‹8ÛA	çrK	L>îS	.bs\		|Üc	õ¨‰j	a,tr	ý¨ˆz	jÝ€	´Ô‡	žŽ	¥Tu—	èŸ	ÃÞ†¨	Ì`z¯	V.z·		ï|MÀ	0È	*4Ð		g€MÙ	h8â	—<ë	–@ó	®Ä‹û		µ„M
ÄÐ$
“\‹
1¢
‰D%
x„ß-
¸(ä5
2B<
tàC
u$ðK
[Œ‚V
H˜ƒ\
Íf‰f
ndál
GêŠw
	šˆM
	mŒM†
	÷M
l"™
7p"¢
t"ª
	i”M²
	˜Mº
	/œMÃ
	ß MÌ
	e¤MÕ
œx"Þ
|"ç
	|¨Mï
ÒXÎö
ÊÉþ
+È,˜d+7l,Kh, ËÄ"(ô¤¡0XŽ9ò¶Cûö‹J)œÕS±¨Ù[»t¨d	ͬMn	GüMtþà¡{‚DŒƒƒÐŒ‹îÞ“±¼Øš¤ü¶£Ùªã„"²àn¡¹zÀ–ÀñúŽÇLŽÏ	uNÙ	iNà¶hèÇŠ½ïoŽ±ù{–ÊclÆÄ@™ºÔÄ¸ü¯!äÄ*2¾¿3Ö:¯<^&¯F—ÀO ÚÁWyºÂ`Ï(ÂhÂXÀpæƱ|“趄^ˆ˜Ž£H˜˜‘™ ê^·¨ðÈ"°¸ꬸVŸ¾Æ&©Æ¹Š Í3©Óé¸Ûxš¸ã$t$ì…º¡õ.x$ý™`+
›ä¢
m%
	cN 
	ñN(
àP%.
y>£7
3Ü®=
ZÆÍD
ˆL«L
ðËT
:ê§[
T%d
¯,©m
ÿ2©v
=Ъ~
ïx©‡
!©

ª•
W®ªŸ
s8Ǥ
` «¯
աǦ
;ÞÅ¿
øÄÈ
¨²¯Ñ
é„%Ý
¬%è
Î$&ð
%̱ù
R$´dÖ´âü´Ú"µ!°R¶*84¸/R4½7äÀ@Kh+I	TNP	MNX	ÝN\	•Nb¨Èi	…\Nr	/dNy²H5€+p,ˆQÒÎŽ	¿$P”	„Pš	›ˆP 	ŒP¦	œP¬èÐе¼NпHªÑÇñàÒЇ,Ó؆ÖÓßì(Ôæü4Õï	Õ”Pù©þÛÏT.		VœP!ï€Ìò üDÞ'zÈñ-ºî5/$á<;@ïCÂpïI	›œXPÅ8äW~&æ`qHäh¨4ðmÿôßuó|´ÄP†|¨ã€ï“ÌM䜕ôò£4Pï«	
¤X³–˜î½	Ú¤\Å»¾ï˨ïÑÔïØÁˆòÞ@äñç	Íeìϵòñcrt0.ocgram.o_fake_fakename_yaccpar_sccsidxdefs.o_ccnamesscan.opftn.otrees.ooptim.ocode.olocal.o_inwd_wordreader.olocal2.oorder.omatch.o_mamaskallo.ocomm1.otable.ocalloc.ofreopen.ofprintf.omktemp.oaccess.ofopen.ocreat.oprintf.oatof.octype_.ofilbuf.oldexp.ostrlen.ostrncpy.osignal.olseek.ogetpid.osprintf.odoprnt.oflsbuf.oexit.odata.ostrcmp.oclose.oisatty.oopen.oread.ostrcpy.ostty.oioctl.oungetc.ounlink.ourem.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_tstrused_tstrbuf_curtstr_yylval_yyval_mkty_block_bdty_cerror_bcon_dstash_curdim_dimtab_savebc_psavbc_asavbc_brklab_contlab_flostat_swx_resetbc_addcase_optim_uerror_swp_swtab_getlab_deflab_tfree_adddef_swstart_swend_yyexca_yyact_yypact_yypgo_yyr1_yyr2_yychk_yydef_yyv_yychar_yynerrs_yyerrflag_genswitch_yyparse_yyerror_yylex_curclass_blevel_tymerge_defid_reached_retstat_ftnend_bccode_locctr_types_dclstruct_rstruct_instruct_stwart_bstruct_moedef_strucoff_sprintf_savestr_lookup_werror_stab_falloc_ftnarg_beginit_nidcl_uclass_doinit_endinit_irbrace_ilbrace_clearst_autooff_regvar_dclargs_ecomp_branch_buildtree_brkflag_retlab_curftn_idname_lineno_makety_icons_hflag_doszof_notlval_lastcon_ctype_dcon_getstr_ftitle_ftnno_paramstk_paramno_argoff_minrvar_inoff_xdebug_strflg_node_cflag_pflag_scnames_asm_esc_yytext_lxgcp_mainp1_lxmask_caloff_offsz__iob_ddebug_idebug_bdebug_tdebug_edebug_freopen_fprintf_p2init_lxinit_tinit_mkdope_yyaccpt_nerrors_ejobcode_lxenter_lxmore_lxdope_lxcp__filbuf_ungetc_lxmatch_lxtitle_lxstr_putbyte_bycode_lxcom_lxrdope_lxres_hash__ctype__isitfloat_strcmp__flsbuf_savetab_saveleft_htab_strlen_malloc_strncpy_calloc_instack_pstk_printf_tprint_fixtype_fixclass_psave_oalloc_mknonuniq_hide_efcode_tcheck_cendarg_defalign_bfcode_talign_tsize_fldal_inforce_vfdzero_zecode_vfdalign_ibseen_iclass_ilocctr_instk_defnam_incode_gotscal_fincode_cinit_upoff_fldty_noinit_commdec_eprint_fwalk_tyreduce_cisreg_relook_aobeg_aocode_unhide_movestab_aoend_opst_dope_conval_opact_pconvert_chkpun_convert_tymatch_ptmatch_oconvert_clocal_chkstr_stref_strargs_combo_offcon_bpsize_psize_econvert_talloc_moditype_fflush_prtdcon_walkf_ecode_p2tree_exname_tstr_rbusy_oflag_fortarg_revrel_andable_nncon_ispow2_proflag_proflg_strftn_tmpfile_outfile_lastloc_crslab_p2bend_usedregs_rnames_p2bbeg_where_tmpname_mktemp_signal_dexit_fopen_unlink_genbinary_cast_isitlong_atof_p2compile_nrecur_lflag_nospflag_e2debug_x2debug_udebug_tmpoff_maxoff_maxtreg_stotree_stocook_baseoff_maxtemp_fldtyp_allo0_setrew_rdebug_radebug_t2debug_sdebug_odebug_lineid_e2print_myreader_delay_reclaim_allchk_setregs_deltrees_deli_eobl2_delay1_delay2_codgen_ncopy_deltest_tcopy_cnames_canon_store_order_prcook_callflag_fregs_rcount_rallo_nextcook_match_tshape_cbranch_get2lab_cbgen_def2lab_offstar_gencall_genscall_setincr_setstr_setasop_setasg_setbin_lastchance_stoasg_markcall_constore_stoarg_mkadrs_negrel_adrput_ffld_rewfld_oreg2_szty_notoff_sucomp_maxtoff_cntbits_ioptab_fltused_hopcode_rstatus_brnode_brcase_toff_zzzcode_acon_getlr_conput_expand_rmove_respref_callreg_shltype_shumul_flshape_shtemp_spsz_indexreg_adrcon_insput_upput_argsize_genargs_popargs_ccbranches_lbranches_opfunc_hardops_hardconv_shortconv_floatconv_optim2_special_zum_mkrall_niceuty_crs2lab_fldsz_fldshf_ty_busy_ttype_rwtable_opptr_table_rtyflg_allo_resc_maxa_mina_maxb_minb_freereg_freetemp_usable_shareit_ushare_recl2_rfree_rwprint_lastfree_tfree1_indope_itstrbuf_strcpyudiv_cfree_free_fclose_creat_close_open_errno_lseek__doprnt_getpidurem_accesscerror__lastbuf_ldexp_read_getppid_write_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brkeìϵòñcrt0.ocgram.o_fake_fakename_yaccpar_sccsidxdefs.o_ccnamesscan.opftn.otrees.ooptim.sumacc/cc41/ddt68   755      0     12          44  3472711316   6656 dlx /usr/sun/src/cmd/ddt68/ddt68.dl
c_psavbc_asavbc_brklab_contlab_flostat_swx_resetbc_addcase_optim_uerror_swp_swtab_getlab_deflab_tfree_adddef_swstart_swend_yyexca_yyact_yypact_yypgo_yyr1_yyr2_yychk_yydef_yyv_yychar_yynerrs_yyerrflag_genswitch_yyparse_yyerror_yylex_curclass_blevel_tymerge_defid_reached_retstat_ftnend_bccode_locctr_types_dclstruct_rstruct_instruct_stwart_bstruct_moedef_strucoff_sprintf_savestr_lookup_werror_stab_falloc_ftnarg_beginsumacc/cc41/dl68   755      0     12       32064  3472711316   6571 $¬'ìÂ^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØ#ûïMÝPûï ¼Â^˜¬PïPPöP­ÿ˜¬PïPPöP­þ‘­ÿ		˜­ÿPÀ7P˜­ÿPÀ0PöP­ÿ‘­þ		˜­þPÀ7P˜­þPÀ0PöP­þ˜­þ~˜­ÿ~ßï—#Ýï±&ûïÚЬPïPPЬQïQQÊÿÿÿQÈQPx¬QÊÿÿÿQÈQPx¬QÈQP˜¬PÀPï‰&˜P~ûïCÿÿÿݬßï4#ÝïI&ûïrÔï`&ѬѬ˜¬PÁP~ûï¯ÿÿÿxð¬P˜P~˜¬PÁP~ûï•ÿÿÿxø¬P˜P~ûï…ÿÿÿ˜¬~ûïzÿÿÿЬP׬ÕP%šïÿ%PÒP~ûï¸þÿÿßï³"ÝïÄ%ûïíЬPÖ¬˜`~½Â^Ô­ü>íü¬PÑP íü¬PÐ PÐP­øݬÝPݬ˜ï."~ûïÿÿÿÀ­ø¬À­ø¬À ­üÑ­ü¬»Â(^Ô­ülíü¬PÑP íü¬PÐ PÐP­øݬÝÝPß­Øûï÷ÑPßï"ßïÎ#ûïCÝûïݬÝ­øؘ߭ï«!~ûï™þÿÿÀ­ø¬À ­üÑ­ü¬‘¬a‘¬z	˜¬P P/‘¬A
‘¬Z˜¬P‘¬0‘¬9_Ð.PÐ$PÂ^Ь­èÔ­ä1—ݬÝÝß­øûïCÕP1ŒÀ­ä­èЭèP­ø ЭèP­ù Ý­üûï¤ýÿÿЭèQÐP¡À­èÀ­èÖ­ä×¼ЬPРQÖ ˜aPšPP
ݬûï}öP½èÑÝ­èûïqÀ­èPÁP­èé­è”½èÀ­èÑ­äïÕ#1\ÿì­èPÐP¼Â^Ô­ô1ËݬÝÝß­øûïˆÕP1ÑÔ­ð5ݬûïöP­ïQÑ­ðK˜­ï~ûï­þÿÿÅ­ôQÀ¬QЭðRöPBaÖ­ð×¼ÆЬPРQÖ ˜aPšPP½Å­ôPÀ¬PЭðQö A`Ö­ðÑ­ðæ&×¼ЬPРQÖ ˜aPšPP
ݬûïöP­ï•­ïÕÝ­üûïjüÿÿÅ­ôQÀ¬QÐP¡Ö­ô‘ï´mšÅP2UPÑ­ôP1ÿÅ­ô¼ЬPžÎìß^2­øѬßï¶ßïm!ûïâÝûï­Ð­ô1äЭôPÐ@¼P‘`-1»Ð­ôPÐ@¼P˜ PÑPTÑPoOÑPscÑPv*1œÐ­ôPÖ­ôÑP¬ðß­øßï`ЭôPÝ@¼ûïÔuЭôPÐ@¼P ïÝbЭôPÖ­ôÑP¬UЭôPÝ@¼ßïÄ>ЭôPÐ@¼P˜ PÂ0PöPïŸЭôPÐ@¼P˜ PÂ0PöPïŒЭôPÝ@¼ßïÌ!ûï=Ö­ôÑ­ô¬1ÿßïÊßï¬!ûïõÐPï–!Qßï°ßï!ûïåßï¡ßï}!ûïÆÐPïg!"ßïg!ßïßï ûï€ÝûïK•ïý@ßïrßïïûï€ÐPï%!/ßïÙßïRßïÅûï:ÝûïÞïïô Ýïê ÝÝ ßïÀ ûï©ÑP"ßïÖ ßïßïzûïïÝûïºÑïŒ "ßï§ ßïßïKûïÀÝûï‹Эø­üÝï\ Ý­øÝïo ûïûÿÿÀïF ­øÝÁ ï; ~ÝïP ûïÑÝï+ Ý­øÝï: ûï×úÿÿÀï ­øÝÁ ï PÁï P~Ýï ûï”Õïö1
‘ï·mZßÍôïÝïíßï(ûïLûÿÿÝÍôïûï1ùÿÿÐPÍðïÀﶭøÝ­øÝßÍðï˜ïm~ûï[ùÿÿÀ­øÝÍôïÝ­øßïÐ'1ŸßÍôïÝï“ßÍðßûï´ûÿÿÐPÍìßÝÍôï‘ï5m2ºPÐðPÝPÝÍìßûï®ùÿÿ‘ïm2ºPÐðPÝPûï•øÿÿÐPÍìï‘ïêm2ºPÐðPÁÍôïP~ûïkøÿÿÐPÍðïÝÝpßÍìïûïKùÿÿÕïí	ÐïåPЭüPÝPÝݘïŽ~ûïxøÿÿݬÁ\~ݬûïÓ
ЬPá ÎPÔPЬ[Þï4XÑXïjÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûïYÝ‘kalÕYÐPÐPÝPݬûïgÐPZ<ÑïD3ݶݬûï}ÐPZÕYÕZÝZûïÝݬûï)ÐPZÕZ)ÝÝÝZûïUÕYÐPÔPÝPݬûïüÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ï8Â^ЬPª ЬPè 1ÐѬsÕ nà iмZЬ­üÕ¬Ýݘ ~ûï·
ÐP­øÃPZPÀP­üÂZ¬ЬPà )ÕZ%Ñ­üZÐPQá PÑ­üPÐQPÀ­ü ­ü¼ÔPï¬[Ô[ЬPá ÐPQР¡ЬPª ݬÃ[¬~ЬP˜ ~ûï9
ÐP­üÔ¼Õ[h×¼	ЬPÖ ZݬûïþNЬP³ BÝPûï­ЬPá Ô¼ЬPª ЬPÐPQР¡ݬݬЬP˜ ~ûïÊ	ÐP­üÑ­üÿÿÿÿÎPÔPÂ^Ь[ЬZÔ­üÕ¬05Ь­ø×jЪPÖªš`P	ÝZûïgÐPYöY‹×­øÚÖ­üÑ­ü¬ËЭüPÂ^Ь[ЬZÔ­üÕ¬.3ЬY×jЪPÖª‹`ÝZ˜‹~ûï§×Yààª
Ö­üÑ­ü¬ÍЭüPÁ\~ݬßïûïJÁ\~ݬݬûï5Â^Ь[™A­üÐ[­øÐ[­ôÔ­ðÖ­ð•‹ùÁ\~ݬß­ðûïÂ^Ь[ЬZÔ­üÔ­ì1)ЬPРQÖ šaP1L˜‹YÑY%1/Ô­ðÑY*	ÐZ­ðÀZ˜‹YÔ­øЭèÅ
­øPÀYPÃ0P­ø˜‹YàIïÒçÕ­ø20u­øÑYlЭèԭ蘋YÑYhïÑY[Ý[ûïÐP[áIï‰À YЭèÕYÎPß­ìݬÝ­èÝ­øÝYÝ­ðûïÂÕPÕ­ðÖ­üÕ­ìVÕ­üЭüPÎP×¼ЬPРQÖ šaP
ݬûïÐP­ôÑP ØÑP	ÓÑP
ÎÑPÿÿÿÿݬÝPûïÁ˜‹YÐYPÑPJÑP	©ÑP
¤ÑP ŸÑP%1Æþ×¼1­þݬûï%ÐP­ôÑPYÃÑPÿÿÿÿ14ÿݬÝPûïlЭüPž®¨^ѬcѬs
Ѭ[#ݬݬݬݬÕ¬мPÔPÝPûï´Ô­¨Ô­¬Ô­¸Ñ¬e
ѬfЭ¸Ð
YѬoÐY
ѬxÐYÞ­À[Ô­¼Ô­´×¼ЬPРQÖ šaP
ݬûïNÐPZÑP ÙÑZ	ÔÑZ
ÏÑZ-.Ö­´öZ‹×¼ЬPРQÖ šaP
ݬûïÐPZ׬1ÕÑZ+ø׬×¼1´Ý¬ûïï1µÑZa	ÑZfÑZA1³ÑZFôÖ­¬ÑYx­¨­¨ÑY
x­¨PÀ­¨PÁPP­¨x­¨­¨ÐZ­°áJï/Â0ZÑZaÑZf	ÂWZÂ7ZÀZ­¨Ð­°ZÑY
1§Õ­¸øÖ­¬öZ‹×¼1LÿЬPРQÖ šaPÐPZ׬~áJïÈ1^ÿÑY1/ÿÑZ.¶ÑZe	ÑZESÕ­¼NÑY
IÕ­¸DÕ­¬?Ö­¼öZ‹×¼ЬPРQÖ šaP
ݬûïËÐPZÑZ+1pÿÑZ-øÑZ0ÑZ9îÕ­´έ¨­¨ÑZÿÿÿÿݬÝZûïúԼмլ	Þ­ÀPÑ[PÔP”‹x­¸PȬPÏPPZZ&&&&&&&&&&&&&**=ÐPß­ÀûïµмRvPbéß­Àûï¢мRpPbÖмP÷­¨`ÌмPЭ¨`ÂÂ^Ь[ЬZÔ¼Ð[XѬcѬ0uЬÔ­üѬsЭü×jЪPÖªš`P	ÝZûï¯ÐPYÒ­üQ˜@ïÁPÊQP	ÑYÿÿÿÿÊЭüѬcÔ­üIѬ[?Эü9Ò­üP˜Iï„QÊPQ1Õ[öY‹×¬%×jЪPÖªš`P	ÝZûï9ÐPYÑYÿÿÿÿ¾ÑYÿÿÿÿÕ¬ÝZÝYûï|ԼмÕ[Ñ[XѬc”‹ÐPÔPЬ[ÔY‘k^ÖYÖ[ÔZÕY
ŠJïîˆJïäò€Z☋ZïZPÑP]ÕY
ˆJï¿ŠJïµÖZÕ×[Ð[PPÀÔSЬRÔUš‚T‘ Tø‘T‘T
î‘+T‘-TˆSš‚T|P‘T04‘T9/ÑQÌÌÌyPVyPPÀVPØWQÂ0TÀTPØQÖUáS×Uš‚TÇ‘T.ãSòÔV‘Te‘TE[š‚T‘T+‘T-ˆSš‚T‘T0‘T9ÑVÌÌÌêÞFfV>F¤ÐVßáSÎVVÀVUÑUœÿÿÿÐœÿÿÿUÑUdÐdU}PP1ÔRÕU#ÑQ™™™	yÿPPÖRîyPVÀVPØWQÖRõUß=;ÕQ
yPPÂRyPP×RáQöÐQVÔW{VQWÁPVØW{
VPVÀPPÑVÖP×RòUÖáQyÿPPÖRyPPœÿPPnPVnQPdï‘þÿÿP`VPáSrPPÝRpP~ûïÆЬ[á«¨«è«ÎPà«÷Ýûï}ÐP«¨«Õ«á«ߘ«Pž@ïz;«ç¨«Ñ[è%áïæ
ßïÓûïV
á«ÐP2PÝPÝ«˜«~ûïYÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«p¬PïPRÀ¬RÑR
ðRP|Ppï4Pá¬rPPÐ"ïÀЬ[ÔZÖZ•‹úÐZP¼ï,	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûïmÐPYj˜ïl~ûïÒÕPâ«ÞïÏ	«ÞïÇ	«á«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûïÐPYÐZ«Ôkná«1mÿЫZ3Ñ[ø%1xÿÝûï;ÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûïœÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûï0ÑPY¨ «ÎPÔPÞï[Ý[ûïÀ[Ñ[ï.ëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûï9ÕPÎZá«
Ý«ûﳌ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼¼ïœÔPÂ^ß­úݬûïxÕPÔPÐP¼ïl¼ï\Ь[ЬZÐ[Y•‹ü×[Š‹ûÐYPЬ[ЬZÐ[YŠ‹ûÐYPݬÝ	tݬûïݬÝtݬûï¼6ïìЬ[ѬÿÿÿÿÎPé«Ñ««Ñ««êÕkæÖ«Ök׫ЫPö¬`ÔPÕï(/.ɘOï/É”Oï/Þï/ï/Þïý.ï/ÝÁ¬~ûï*ÐPYÐïé.[Ôïî.ék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïª.	Ñ[”OÔPñïœ.¬ÿÁYPÆPxPïƒ.ÝûïbÐPZxïp.PÀZPÑPZÀxï`.~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿ=.Áï6.PÑZPÈÿ).xï*.PÀZPÃPjÐjï.É”Oÿ.1ÿxYPÁ[Pïô-ÑZïí-Ðÿå-ïè-ÐkÿÙ-ÉïÒ-kÁ[PЬ[Ð[ZÂZÐZï¹-ËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐï-@j‘Á~ÝÐ\SÐ^\¼ï_ÐïyPÀ£ïp¼ïCЬï[ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPïiÎP%c%cS%d
Read error
Usage: dl68 infile [ > outfile ]
%xr.68rdl68: Can't open %s
wdl68: Can't open %s
dl68: %s wrong format
dl68: %s not proper b.out file
                           AAAAAABBBBBB ÿÿÿÿÿÿÿ€+€+('¬O—r<„~¨$ÅÈ	,Ø	4L ;fÄC$Ln4Sx¼\Ǽeœ€mxÀv$Ô~ä‡fPyX—–dž´d¦t¯»”¶¤½´ÆœÐÏ!èÖ» Þ$ çAd ð7"÷ÏÔ"þ€ü"# X~|!r$*	40'2Á$9¾$?
$F	»P'N	gT'W	ÝX'cÃ$p0$v|<~¤„‡q¬	7x'š.â¤Xú»R¤ÃBôËN Ò.è%Ø[rà’¼èþ¼ñ$ÀùL|ð!Ðt¨œ´eØ	&~j/´('9.È	@;dG”M	—|'TÅÔ[#bL‚j[rrfP{²Ä‚:$‹xÜ“ÆÜ$›Ç\%¤Î­™¾
µA$ ½°¸Ån<Ëx€Ò«d Úœ¤à•ü"ç3tï	
€'÷–Üþ	yÐ!	Ú€+»þè#Œ *€Ô"/Á"58ì!>	̬OCϽ"Hcrt0.odl68.ofprintf.ofopen.ocreat.ofseek.ordwr.oscanf.odoscan.oatof.octype_.ofilbuf.oldexp.ostrlen.olseek.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostrcat.ostrcpy.ostty.oioctl.oungetc.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_filhdr_Sdata_Send_vflag_infile_outfile_infilename_outfilename_syms_puthex_fprintf_reverse_checksum_checkout_print_exormacs_record_outbuf_outbin_fread__iob_macify_rbuild__filbuf_strlen_build_sscanf_strcpy_fopen_strcat_fseek__doprnt__lastbuf_creat_close_open_errno_lseekcerror_fflush_fwrite__flsbuf_scanf__doscan_fscanf__sctab__ctype___getccl__innum_ungetc__instr_atof_ldexp_malloc_read_write_isatty__sobuf__cleanup_fclose_free__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brkÎPé«Ñ««Ñ««êÕkæÖ«Ök׫ЫPö¬`ÔPÕï(/.ɘOï/É”Oï/Þï/ï/Þïý.ï/ÝÁ¬~ûï*ÐPYÐïé.[Ôïî.ék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïª.	Ñ[”OÔPñïœ.¬ÿÁYPÆPxPïƒ.ÝûïbÐPZxïp.PÀZPÑPZÀxï`.~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿ=.Áï6.PÑZPÈÿ).xï*.PÀZPÃPjÐjï.É”Oÿ.1ÿxYPÁ[Pïô-ÑZïí-Ðÿå-ïè-ÐkÿÙ-ÉïÒ-kÁ[PЬ[Ð[ZÂZÐZï¹-ËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿsumacc/cc41/fddt68   755      0     12      122701  3472711317   7132 0ˆOÂ^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØ/ûï¯ÝPûï+¼ݬûïøòݬûïpòݬûïþò8Ь[•k/×ïp:Ðïl:PÖïe:‹`˜`PÝô:˜‹~ûï(ÍÆ‘¬a‘¬z˜¬P PöP¬˜¬Pߘ¬PøÕ¬Ѭ2¬PÐPéa2ï/~ݬûïÅ*÷P­þ2ï{/~ݬûïH-ÐP¬
ݬûïÆÿÿÿªÿ­þ±­þ	Ð7PÐ0P<­þQÀPQ÷Q­þ<­þ~ûïšÂ^š9Ôï;Ðï;Þïå:ï;ݬûïpÿÿÿÝûïeÝd<ûïÎþÿÿÅX‘ïR/d
Þï :­üÞïÖ:­üÔï¾:Ðï»:Þï‰:ï´:Ý­üݬûï§ÝûïÝd<ûïoþÿÿÂ^£Ь[‹­ÿ
‘¬­ÿÐPíÔPÂ^à1“´¼˜¬~ûïoþÿÿöP¬‘¬0´­þp±ï>.
)2ï5.PÀ/P˜¬QÑQP´­þ÷­þ˜¬PÂ0P÷P¼>‘¬9÷­þ˜¬PÂ0P÷P¼'2ïõ-PÀ6P˜¬QÑQP´­þ÷­þ˜¬PÂ7P÷P¼2­þPÂ^1gÿEÔ[Ã]PÝPЬPÖ¬`­ÿ˜­ÿ~ûï@ÿÿÿÕPÐ[P2ï™-QÄQP2­üQÀQPÐP[ÇÐ[¼˜­ÿPÂ^¶Mм[ЬPÑ[ ;ЬZÐ[Y÷
­þµ­þ•j
‘i •iÐ[P‘Š‰·­þÞµ­þÐ[PÀ[»ÔPÂ^®9Ь[ЬPРQÀ ÐQZÐZY÷
­þµ­þ•k‹‰”‰·­þëЬªÐZPÂ^Â17Ь[Ã]PÐPZ×ï7Ðï7PÖï7˜`PÊÿÿÿP
Ýä:ûïLöP­ÿÐP­äÝï
-Ý­äûïþÿÿÕP˜­ÿ~ûï¿üÿÿöPŠ¦‘­ÿÃ]PÐPZ”jÃ]PÃPZPÔk1­uïÁ,öïþ7Ý\<Ã]PÝPûï½þÿÿÐPY
dïš,Ýœ<Ã]PÝPûï›þÿÿÐPYÕY7©
ïÄ7©ï¾7“€ï¶7“ï«7йkuïO,Щk+”ï7”ï‹7Ý[Ã]PÝPûïôýÿÿÕPö*­ÿ”ïb7Ôk˜­ÿPÂ^1Ãþ1Œ‘ï,d
ÞïS7­üÞï‰7­üÝ­üݬûï&ÐP[Õ[«
ï!7«ï7”ï7”ï
7•ï«+
ï£+ï¢+ •ï’+
ïŠ+ï+ïÛ6ï€+Šøïx+Â^1nÿ^˜¬P#÷­þL÷­þF÷­þ@÷­þ:÷­þ4´­þ/ÑPcÔÑPhÑÑPiÚÑPlËÑPw¼Ì2­þPÂ^
Ь[Ë[Pôݬ2¬PÐ@ïŠ*Pû`êݬݬ2¬PÐ@ï‰*Pû`çЬ[ЬZÁZ[Pð€TЬ[ЬZÔYÝ[ûïÿÿÿÐPWöï‹*/ÐXÑX$ÂWÝWûïÛÐPY•ï6	ÑYXÐWPÖX×ÐZÃZ[Pªݬ2¬PÐ@ï*Pû`ê1“”ïy5Ôïw5ÝL<ûïÐüÿÿöP­ûÝï *˜­û~ûïûÿÿÕP[Ã]PÝPûïªüÿÿöP­ú˜­ûP(È­üï253À­üï(5)­üï5Эüï5ÑP+ÝÑP-âÑP|Åá­ú­û˜­ûPÂ^1gÿW´ïê4ûïQÿÿÿöP­ÿ‘­ÿ:¶ïÓ4×ï[3ÐïW3PÖïP3˜`PÊÿÿÿP
Ýä:ûï‹öP­ÿÀ˜­ÿPÂ^¤)•ï|4Õïx4	Óïo4ÔPÐïd4¼ÐPÕ@ݬûïôýÿÿÐP¬ݬûïTxPPÐP­üݬ<ûïOøÿÿÝd<ûïBøÿÿЭüPÂ^»1§Ý¬ûï]ùÿÿ×ï£2ÐïŸ2PÖï˜2ö `˜`PÝô:Ý ûïÑ ‘ï(D×ïn2ݬûï°Ðï`2QÖïY2öPaݬûï”ÐP­üÝô:Ý­üûï† ݬûïtÊÿÿÿPÐP­üÝ­üûï…øÿÿÐPÂ^1SÿݬݬûïƒÐPìhݬûïàüÿÿÐP¬ݬûï†øÿÿ×ïÌ1ÐïÈ1PÖïÁ1ö `˜`PÝô:Ý ûïúݬûïtÊÿÿPÐP­üÝ­üûïû÷ÿÿÐPÂ^“ݬݬûï•ÐPìaݬûïVüÿÿÐP¬ݬûïü÷ÿÿ×ïB1Ðï>1PÖï71ö `˜`PÝô:Ý ûïpݬûïŠÐP­üÝ­üûïx÷ÿÿÐPÂ^šݬݬûï­ÐPì1ü”­þ”­û”ï-&•­þ1ç•­û
ÝX2ûï5öÿÿ”ï
2ûïýÿÿöP­ÿÝ\2˜­ÿ~ûï«÷ÿÿÕP:­ÿïå1×ïs0Ðïo0PÖïh0˜`PÊÿÿÿP
Ýä:ûï£öP­ÿ˜­ÿP1ºÝo2ûïÁõÿÿ1[•­ûY•ï‰1Ýï…1Ýï3&˜ï)&~ûïCûÿÿ÷P­ö‘­ÿ/2­ö~Ýï&ûïFûÿÿ2­ö~Ýïþ%ûïGûÿÿÐPïð%•ï01Ðï,1ïÛ%ÝïÕ%ûïÂùÿÿÝïØ%ûï3õÿÿÝï»%˜ï±%~ûï±úÿÿ÷P­ö×ï—/Ðï“/PÖïŒ/ö `˜`PÝô:Ý ûïÅö­û1…•­û%•ï³0Ýï¯0Ýï]%˜ïS%~ûïmúÿÿ”­û”ïB%1R•ï…0Ðï0ïÌ$1<•ïo0Ðïk0ïZ0ûï×úÿÿöP­ÿ‘­ÿ>•ïK0ÐïG0ï:0ûï³úÿÿöP­ÿ‘­ÿ?1†þ•ï$0Ðï 0­ä˜ï0~ûïPùÿÿöP­ã‘­ãö­ãÐïð/­ðÑ­ðïê/XÝ­ð˜­ã~ûï@úÿÿÐP­èÒï($PËP­èPÒï$QËQ­äQÑPQÝ­ð˜­ã~ûïkùÿÿ÷P­ôÝïm$ûïÈóÿÿ2­ôPÀP­ðž1XÝï/ûïôÿÿÐP­ì‘ï‚/i
÷­ìïº#‘ïn/o
÷­ìïª#1±ý1ÝïP/ûïeôÿÿ1	±ïJ/	Þïß#[ÞïÚ#[˜ï+/~ûï_øÿÿöPk1Ü1ÙÐïø.ïë.°ïñ.ïä.Ðïê.ï9#ö­þ1±ÑP?1¸þJÑP/1Dý ÑP
1þÑP
1þ1ýÑP*1ý1ýÑP=1\ÿÑP<1/þ1ýüÑP>1Hþ1òüÑPr1ùþ,ÑPm1ñýÑP\1Úü1ÇüÑPq1Mÿ1¸üÑP1;ÿ1§üÑPt1ýþ1˜ü1•ü1ü ^1þûR•ï0$I”ï($Þïâ"ï%.Þï×"[•kÀ[÷Ð[ï.ÐïØ-ïÛ-°ïÑ-ïÔ-Ðï&"ïÍ-¬ûïÿÿÿûïŽûÿÿï1ŒÃï	&¬PÀ PÐP­øÝÝ­øÝï\.ûïQЬïU.ÐïO.PÐPïC.ÝÝœ2Ýï-.ûï®ÐP­üÕ­ü
À­üï."ݬݬÝ 4Ý;ûïzÝûï-ЭüPÂ^1nÿÑïâ-¬ѬïÒ-ÐPÔPâ:‘ï¸!d˜¼PݬûïÁÿÿÿÕP
ݬûïÿÿÿÃï™-¬P˜@ï#PÄC‘ïx!d¬¼1ݬûïÿÿÿÕP
ݬûïÙþÿÿÃïW-¬P¬@ïÛ"öïH-»I‘ï.!d°¼­þ2ݬûïWÿÿÿxPP÷P­þÁ¬PÝPûïAÿÿÿÊÿÿÿP2­þQÈPQ÷Q­þ2­þPÂ^²H‘ïÜ d°¬¼62¬PxøPP˜PPÝPݬûï7ÿÿÿ2¬PÊÿÿÿP˜PPÝPÁ¬PÝPûïÿÿÿ¶B‘ïŽ dм­ü+ݬûïAÿÿÿxPPÐP­üÁ¬PÝPûï+ÿÿÿÊÿÿPÈP­üЭüPÂ^¹C‘ïB dЬ¼1xð¬P2PPÝPݬûï<ÿÿÿËÿÿ¬P2PPÝPÁ¬PÝPûï ÿÿÿ»5ЬPïPPЬQïQQÊÿÿÿQÈQPx¬QÊÿÿÿQÈQPx¬QÈQPÉ1[Ý­üÝÏ4ݬûïRÐP­üݬÝÑ4Ý;ûïÝûïÅÝÁ ïd+PÀïa+PÝPÝ­üûïÐÝïV+ûï[ÐPïð*Ðïê*PÐP­äÝ­üÝÝÃ]PÝPûïÍ
ÕP1¹Ô­ì×½üЭüPРQÖ ˜aPÊÿÿÿP
Ý­üûïAöP­ë"Ñ­ì
˜­ë~ûïÄîÿÿЭäQЭìRöPBaÖ­ì²Ñ­ì
ЭäPЭìQö A`Ö­ìé•­ë,×½üЭüPРQÖ ˜aPÊÿÿÿP
Ý­üûï×
öP­ëÏЭäPЭø ЭäP” ЭäQ ¡
À­ä1,ÿЭäï
*Ý­üûïKÂ^1Ÿþ°ï4*ï-*ÝïÛÝûïÚãûïÓÿÿÿÝûïfí1Ѭ"ЬPÝ`Ýì4Ý;ûï‚
Ýûï5ÝЬPÝ ûïaÐPïâ)ÑPÿÿÿÿ#ЬPÝ Ý5Ý;ûï?
ÝûïòÝ Ýä<Ýï¨)ûï)ÐP­üÕ­ü#ЬPÝ Ý5Ý;ûïþ	Ýûï±ÑïO)#ЬPÝ Ý.5Ý;ûïÎ	ÝûïÝï#)ÝQ5ûïžÝï)Ýa5ûï‹Ýï)Ýq5ûïxÝïö(Ý€5ûïeÝïç(ݘ5ûïRÝïØ(ݳ5ûï?ÝïÉ(ÝÎ5ûï,Ðï¶(ïM ÕïŸ(ЬPÝ ûïÙüÿÿÔï3(Ðï-(PÐPï!(ÝûïØÕPOÝïÝûï°ïC(ï@(ЭøÑ­ø ÝÆÝ­øûï4Ö­øå¨ï(ÝïÆÝûïÅûï”ùÿÿûï¿ýÿÿÝâ5ûï€ëÿÿÂ^1êýUÐïŽ'PР,[‘¬	Ö[Á[PÆPxPPÐP[Ðïk'PР(QÖ (Ðï]'P¬A`‘A`*”ï['ÐïE'PÐ[ ,©;Ь[Ñ[ï[PÝPûïåÿÿÿÊðÿÿÿ[Ñ[	Ð7PÐ0PÀ[P˜PPÝPûïfÿÿÿÃFЬ[ÐZÕZ:Ð[PÃZ QïZQPPÊðÿÿÿPöP­ÿ‘­ÿ	Ð7PÐ0P˜­ÿQÀPQÝQûïÿÿÿÂZÂÂ^µ2Ь[ЬZ<ªPÌ[P2ªQÒQQÊQP˜jPÀZPÖPÊPÐPZÛÐZPÌ1½³¬)<¬PïPP÷P¬<¬PïPP÷P¬<¬PïPP÷P¬ѵ¬1…<¬P×P<¬QÌPQÒQP<¬QÊPQ˜QPÐïº&QÐPA¼Öï®&³¬)<¬PïPP÷P¬<¬PïPP÷P¬<¬PïPP÷P¬Ñ<¬PïPP÷P¬<¬PïPP÷P¬<¬PïPP÷P¬1Dÿ1@ÿ1,Ь[“¬6“¬•ïE&(Ðï5&PÀï-&ÝPûï°øÿÿÐï&QÐPAkÖï&“¬=“¬•ï	&/Ðïù%PÀïñ%ÝPûïùÿÿÐïÚ%QÐPAkÖïÏ%ÀïÐ%“¬KÝïÄ%ûïIøÿÿxøPPÐïª%QÐPAkÖïŸ%Ðï¡%PÀï™%ÝPûï’÷ÿÿÐï‚%QÐPAkÖïw%“¬öïz%“ ¬öïo%“@¬öïc%“€¬(ÐïJ%PÀïB%ÝPûïÅ÷ÿÿÐï+%QÐPAkÖï %1Ñþ&Ь[Ð
Z‘k •kÐZP×ZÕP˜‹~ûï¹üÿÿâØFЬ[ÔXмZЬPÑZ ÑXª
Ѫ[ÐZYЪXÀZÞÕXÃX[PÑPèÐYPÔP¸MЬ[ݬÝ[ûï ÿÿÿÐPZÕZ(ÝZûïdÿÿÿѪ[Ý+ûï5üÿÿê[PÝPûï)èÿÿ	Ý[ûïèÿÿÐZP±/Ô[ÐZÐZP×ZÕPx[PËþÿÿÿ¬QÈQPÐP[xÿ¬¬ÛÐ[PÏ1†”ï#$”ï$öïn#”ï$Ðïþ#ïý#Ýïó#ûïxöÿÿÕP3Ðïâ#PÀïÚ#ÝPûï]öÿÿÐP­üÝ=Ýä5Ý­üûï'”ï#•ï
#Áï¤#PÐPï˜#Â^1tÿdݬ<¬~ûï(üÿÿÐP­üÔïl#ݬЭüP< ~ЭüP< ~<¬~ûï8üÿÿݬЭüP˜ ~ûïìüÿÿݬ˜½üPÀ­üPÝPÁ­üPÝPûïÂ^—18Ѭ¬1-•¼ЬPÖ¬˜`~ûï¹úÿÿ1˜¼PxüPPÊøÿÿÿPÐ@¼[Þï[ ­üÞïX ­øa­÷˜¼PÊðÿÿÿPÖ¬1´Ñ[€€­÷xü[PÊøÿÿÿPÀ0PÝPûïVúÿÿÝ:ûïMúÿÿÓ[˜lP˜wPÝPûï5úÿÿ1€­÷˜­÷~ûï#úÿÿËøÿÿÿ[PÀ0PÝPûïúÿÿ1gËøÿÿÿ[PxPPxý[QÈQPÐP[Ý,=Ý8:2[PÝPûï‘þÿÿ15˜ï$"PÀP[˜K½ü~ûïÄùÿÿÑ[öï"1Õ[Ð[Õ[Ý-ûï¡ùÿÿÎ[PÝPûï—åÿÿ1íÝœ<Ý[ûïýÿÿ1ÛÝ[ûïcýÿÿÐP[Ý[ûïÇùÿÿ1ÃÕ[
˜¼PÀP¬Ö¬1¯Ð[P×[ÕPЬPÖ¬‘`,ò瑼,‘¼)ЬPÖ¬˜`~ûïùÿÿáЬPÖ¬‘`)ògЭøPx[Q˜A`~ûïùøÿÿx[PÁP­øP˜ ~ûïåøÿÿ>Ýœ<Áï!PÀ[PÝPûïaüÿÿ"ÏPHþ‘þ•þ·þÎþéþÿÿ1ÿCÿOÿ[ÿoÿ·ÿàÿ1ÉýÂ^1Âý1	ЬïÑ Ôï_ ÐïY PÐPï	 ÐïN ÐïH PÐPïøÞïÆïñÝœ<Ýï‘ ûïÞûÿÿÐïØPÑ ,	Ý	ûï0øÿÿÝ	ûï'øÿÿûïBüÿÿÝûïøÿÿÞïÁï¤ÝïN ûï[øÿÿÝ	ûïö÷ÿÿÐï8 PÀï0 ÝPûï¯òÿÿÐP­üÝ­üûïoøÿÿÝ ûïÈ÷ÿÿÑï
 ï ÅÐïMPÑ , Ý	ûï¥÷ÿÿèÝûïš÷ÿÿìïÖPÆPÂ^1ñþúïÚÿÑݬÁ\~ݬûïßЬPá ÎPÔPЬ[Þï0YÑYïfÔPÀY“©ë‘kwݶݬûïvR‘ka@Ýݬûï†
ÐPZÑïS!ݶݬûïDÐPZÕZÝÝÝZûïØÝݬûïF
ÐPZÕZƒÔiöZ©
‘krˆ©ˆ©ÐYP¼ïDÂ^ЬPŠ ЬPè 1²Ñ¬nÕ ià dмZЬ­üÕ¬Ýݘ 
~ûïSÐP­øÃPZPÀP­üÂZ¬ÕZ)Ñ­üZ#ЬPÐPQá PÑ­üPÐQPÀ­ü ­ü¼ÔPï¬[Ô[ݬÃ[¬~ЬP˜ 
~ûïóÐP­üÔ¼Õ[E×¼	ЬPÖ 7ݬûï+ЬPá "ÝPûï(ݬݬЬP˜ 
~ûï§ÐP­üÑ­üÿÿÿÿÎPÔPßï|Á\~ݬûïðáïsÎPÔPÂ^Ь[ЬZÔ­üÕ¬05Ь­ø×jЪPÖªš`P	ÝZûïoÐPYöY‹×­øÚÖ­üÑ­ü¬ËЭüPÂ^Ь[ЬZÔ­üÕ¬.3ЬY×jЪPÖª‹`ÝZ˜‹~ûï'	×Yààª
Ö­üÑ­ü¬ÍЭüPЬ[è«ÎPà«÷Ýûï¢ÐP«ˆ«Õ«á«ߘ«
Pž@ïß&«çˆ«Ы«Ñ[ä:áïf
ßïSûïÄ	á«ÐP2PÝPÝ«˜«
~ûïÅ
ÐPkôkÑkÿÿÿÿˆ«ˆ «Ôk1aÿš»PÖ«¼0ï¬
¼ïœ
	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT3šR•BcH»Ý­üÝRûïÕPã­ðÖ­ðºžïÒþÿÿS}½üTàTÉÀP­ð/PacTeÜR}T½üÂP­ðàRôP±ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q0 ÿÐQ[áRî•‹ÎÐ^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1ÿ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0WýÃXYP7ÂXYÐXP0HýáR×PšR}½üTôT0ýëR…Ö­ð}T½üÜÐYP1tý1oý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0øüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1›rUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0€qPUÖRÐR­øÎRRÑR
dïßUÂRÀ	R^tPTUPUùP	®ø	®®tï´UPUùP®ÐXWŸï þÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«
~ûïÐPYj˜ï|~ûïÏÕPˆ€«ÞïÀ«Þ︫á«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«
~ûï¶ÐPYÐZ«Ôkná«1mÿЫZ3Ñ[ô:1xÿÝûïìÐPZÐZ«ˆ«ƒˆ«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«
~ûïMÐPY2ÿkö¬ŠÐZ«ÑXYˆ «1ïþЬPЬ[˜«PÊùÿÿÿPÑP@ЫZ:ÃZ«Y3ÐZ«“„«ÔP2PÐPkÝYÝZ˜«
~ûïãÑPYˆ «ÎPÔPÞï[Ý[ûïÀ[Ñ[ï@ëЬ[ÎZ“«<à«7Ý[ûïgÿÿÿÐPZ˜«
~ûï9ÕPÎZá«
Ý«ûïC“Œ«Ô«Šÿ«ÔkÐZPûï}ÿÿÿ¼¼ïPÔPÂ^ß­úݬûïDÕPÔPÐP¼ï ¼ïݬÝ	tݬûïݬÝtݬûï¼6ïÔЬPЬRÑRÔQ{RPRPÔPÑPRÂRPÕïh.ÉtGïZÉpGïRÞïLïOÞï=ï@ÝÁ¬~ûï*ÐPYÐï)[Ôï.ék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïê	Ñ[pGÔPñïܬÿÁYPÆPxPïÃÝûïbÐPZxï°PÀZPÑPZÀxï ~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿ}ÁïvPÑZPÈÿixïjPÀZPÃPjÐjïSÉpGÿG1ÿxYPÁ[Pï4ÑZï-Ðÿ%ï(ÐkÿÉïkÁ[PЬ[Ð[ZÂZÐZïùËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐïY@j‘Áïô
¬~ÝÐ\SÐ^\¼ï_ÐïÙ
PÀ£ïÐ
¼ïCЬï»
ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPï¥ÎP0ÿÿÿÿò<<		òòx	îîx	ú	x	x	N<<N`NNut2ƒ22$d0€T0$d1€X0$d2€\0$d3€`0$d4€d0$d5€h0$d6€l0$d7€p0$a0€t0$a1€x0$a2€|0$a3€€0$a4€„0$a5€ˆ0$a6€Œ0$a7€0$pc€,<$sr€0<.€1
./qgpxbr=*t\<>?m

?+- |

/=\<>?

*/=\<>?
Ü<ÆUnexpected error or eof at pc %ld ( = 0x%lx )
rCan't open symbol file %s
usage: %s filename
Can't open %s
Unexpected eof or error on %s
%s doesn't look like a .out file 
text size: %ld
data size: %ld
bss size: %ld
symbol table size: %ld
text relocation size: %ld
data relocation size: %ld
entry point: 0x%lx

)€¿ñ|œor,and,*,*,*,eor,*,*) #/ª,Œccr,sr)  €ÿ œbtst,bchg,bclr,bset) #¨,„&Àñ œor,and,sub,add,,eor,cmp,)l #§,„&ñ ¬or,and,sub,add,,eor,cmp,)• #·,„A8ñÌ	movep• «‚@(Ç)«,«÷±«ûñ 	œbtst,bchg,bclr,bset) ¡,„ ð (movl „,“À (mov¬,b,,w) „,“Àÿà@move sr,„ 
ÿ @negx• „ ÿ Bclr• „ÿ Dneg• „ÀÿàDmove „,ccrÀÿàFmove „,sr ÿ Fnot• „Àÿ Hnbcd „øÿDHswap  Àÿ`Hpea „ @¸ÿÄHext• À¸ÿäHmovem• /ª,‚@- À€ûàLmovem• «/¹«,«ú„«û ÀÿàJtas „ ÿ Jtst• „
ðÿHNtrap #ˆ øÿTNlink ‚,#— øÿ\Nunlk ‚ðÿlNmove ›‚›	,›ûusp›ù€ÿÿrNstop #/Š&øÿtNŒreset,nop,,rte,*,rts,trapv,rtr) €ÿàNœjsr,jmp) „ 
Àñ Ichk „,‘ 
 ÀñàIlea „,’ 
øðÌXdb ,® 
ÀðàXs „ð Y¬addq,subq)• #¶,„ 
ÿðhb ž
ð€hb Žñ€xmoveq #‡,‘ø±ɬsbcd,abcd) ,‘ ø±ɬsbcd,abcd) ‚@-,’@- À°àɼdiv,mul)œu,s) „,¡° ÉÌor,and)• «„«,«û±«û @À°àÙ¼sub,add)• „,¢8±„Ù¼subx,addx)• ,¡8±ŒÙ¼subx,addx)• ‚@-,¢@-° ÙÌsub,add)• «„«,«û±«û@Àðà¹cmp• „,¢ñ ¸cmp• „,¡8ñŒ¹cmp• ‚@+,¢@+ñ ¹eor• ¡,„
øñDÉexg ,‘ 
øñLÉexg ‚,’ 
øñŒÉexg ‚,‘ Àøàå¬as,ls,rox,ro)œr,l)w „ ð”éœas,ls,rox,ro)¼r,l)¥ #Æ,  ð´éœas,ls,rox,ro)¼r,l)¥ Á,€* 8 8‚ 8‚@	8‚@+ 	8$‚@- 8,‚@(—) 
84‚@(§,) ?8‡ ?9‡ ?:pc@(‡)?;pc@(—,€)?<#‡ * bwl*rasrhilscccsneeqvcvsplmigeltgtle\C\C$<ˆG—<d<`!þ&`+`1`7`
= 8BþG`2K`(OþS`,Wþ[`2``
e`k`qþw`}þƒ`‰þ —þŸ`¢þ¥`­þµ`»þÁ Æþ0Ë Ðþ0Õ Úþ0ß ã è î 8ñþô úþ  þ þ þ 4&þ- 4þ; BþI PþW ^þe lþs xþ} † Ž • œþ£ ª t²þº tÂþÊ tÓþÜ ä í ô þ  
þ   ! * /$s<7 Ds>:$tNB DtPE$u`M DubP Zþd 8lþt$•r~@ D–tD—zD˜­„$ž° DŸ²D ´D¡ÍD¢Ò‘$¨Ö˜ D©ØD¬ÚD­ÚD®ßD¯ßš$µâ£ ©þD¶äD·æD¸ñD¹öDºöD»ú¯$Áþ¶ ½þDÂDÃÄ€
ÆþDÄDÅÀÆDÆDÇ8DÈ>DÉWDÊbà&È$ÐhÑ ØþDÑjDÒlDÓrDÔyDÕ„DÖŽD×—Dؤß$Þ¨é ìþDߪDà¬ï€õþDá¬û@þþDâ¬Dã¬ÀpDä¶Då¾DæÀDçÈDèÎDéÕDêàDëíDìöDíàÇ$ó
@  DôDõ€DöD÷ÀÖDøDù#Dú(àì$. ! #þD0D3%€+þD3D3À÷D6DEDED	ND
YDoDqD
qDuD€D€DˆDˆDŒD—D—D¯D±D±DµDÀDÀDÅà‰1$"Ì8 ? EþD$ÎD%ÐK€D&ÐM€OþD'ÐQ@SþD(ÒD)ÒÀ–D*òD+òD,	D-D.D/àØU$6] d jþD8D9p@xþD:ÀâD;,€@
D<0„@	D=3‰€‹þD>3D?3À÷D@<DA<DB@DCIDDMDETDFYDGbà&DHgDIjà.$Pp”@› ¢ ¨þ® ´þDSrDTxº@
½þDU‡À@	DVŠÅ€ÇþDWŠDXŠÀNDY“DZ“D[—D\šD]œD^žD_£D`¨Da¬àpÉ$i²Ð@Ùþâ ëþDj´Dk»ô€ö€2Dl»ý@
DmÂ@		þDnÂDoÂDpÂDqÂÀ†DrDs*Dt*Du,Dv,Dw6Dx6Dy8Dz8D{;D|;D}CD~JDJD€JDJD‚bDƒbD„jD…jD†jD‡jDˆjD‰‚DŠ‚D‹†DŒ†D†DŽŽD–D©D‘©D’­D“µD”µD•»D–»D—½D˜½D™ÃDšÉD›ÜDœÜDàDžæDŸèD èD¡èD¢èD£íà±$¬ô D­öD®ù€#þD¯ù)@,þD°ùD±ùÀ½D²D³D´
DµD¶%D·)D¸)D¹1Dº9D»9D¼;D½;D¾AD¿GDÀGDÁODÂZDÃdDÄoDÅqDÆ|DÇ„àH/$ÎŒ9 DÏŽDÐ;€BþDÑÀTDÒ–DÓ–DÔšDÕœDÖœD× DØ¢DÙ¢DÚ¦DÛ¨DܨDݬDÞ®Dß®Dà²Dá´Dâ´Dã·Dä¹DåèDæíà±I$ìôQ@TþW ZþDíöDîüDï]$õe jþo D÷DøDùt$ÿ| þ† ‹ þD D"D8•$
<œ@Ÿ@
£þ§ ª ®þD>D
HDM²$P¹@¼@
ÀþÄ Ç ËþDRD\Ï@	ÖþÝ@ßþD^á@åþDjDjÀ.DsDsD{D{DŠD ›D!ŸD"¢D#¢D$§àké$*ªö ûþ D,¬D-®D.Á$5ÄD5ÆD6É
€þD7É€€D8ÉD9ÉÀD:ÏD;ÕD<ÕD=æD>ûD?ûD@DADBDCDD&DE0DF:DGODHTDIVDJ[à$$MbDMdDNf+€DOfDPfÀ*DQlDRwDS}DT}DUƒDVµDW·DX¼à€-$^Â3 RD_ÄD`ÆDaÎDbÎDcßDdßDeâDfâDgêDhêDiî9$pòA DqôDröD€KþDsöDtöÀºDuDvDw#Dx0Dy5àùR$€<Z D>D‚ADƒKD„wD…ÂD†ãD‡ç]$îe h qþDðDòD‘ÿD’	z$˜	‚ D™	Dš
	D›	Dœ"	DN	Džm	DŸq	…$¥x	  ™þD§z	D¨|	D©‰	Dª	¢$±	ª D²’	D³”	D´¢	Dµ¬	D¶Ø	D·ð	D¸ô	­$¾ú	µ ¸þ» ÄþDÀü	DÁþ	DÂ
DÃ
Í$C
DC
DD
Õ€×€Ú€DE
à€
çþî€òþDF
ö€DG
û€þDH
€
þ€þDI
'€DJ
DK
Àá	DL#
DM+
DN+
DO=
DPC
DQN
DRc
DSc
DTk
DU
DV
DW¤
DX¤
DY¤
DZ¤
D[¤
D\±
D]´
D^´
D_´
D`¹
Da¹
Dbß
Dcß
DdDeDfDgDh%Di%Dj2Dk?DlWDmƒDn‡DoŠDpŠDqŠDrDsDt±Du´Dv´DwºDx½Dy½DzÐD{ÓD|ÓD}æD~ñD÷D€÷D÷D‚÷Dƒ
D„D…D†D‡DˆD‰DŠ.D‹@DŒJD\DŽ\DnD‹D‘‹D’D“ªD”ªD•´D·D÷DÄÈDÅÚDÆîDÇóDÈöDÉöDÊ
DË
DÌ
2@DÍ
ÀÊDÎ
DÏ
DÐ
DÑ
DÒ0
àôDÓ0
DÔ3
DÕ3
DÖ3
D×6
DØ6
DÙA
DÚL
DÛW
DÜ[
DÝ^
DÞDßàÖ
= C$÷D÷DøL@OþDùDúÀâ
Dû&Dü&Dý,Dþ7DÿGDNDNDNDNDYDdDoD
oDoDoà3R$rDtDvD(vD)vD*}D+„D,„D-„D.„D/„DA„DB„VBˆ_dˆh`oþv`|þ‚`ˆþŽ`”þš` þ¦`­þ´`»þÂ`ÈþÎ`Ô`Ûþâ`êþò`÷þü`þ````
 8"þ'`/`7`@`H`O`V`^`g`p`y`‚`‹`•`Ÿ`¨`°`¹þÂ ËþÔ Þþè ïþö ”þ  þ `2#`
(`.`4þ:`@þF`LþR Zþb 2g mþs | … Ž •þœ$1ˆ£ D2ŠD3¦€­þD4´€¸þD5D6ÀD7D8¯D9ÅD:âD;çD<ïD=ñD>ñD?ñD@
DADBDCà¼$G  DH"DI$DJ<DK?Å$OBÌ DPDDQFDRPDSPDTUDUUDVcDWmDXÏ$^‚Ö Ù D`„Da†DbDcDd•De•Df•Dg—Dh—Di¥Dj¯DkÁDlÈDmÈÞ$pÌå DqÎDrÐè€íþDsÐÀHDtÚDuÚDvßDwßDxáDyáDzóD{D|D}àò$ƒù ü 	þD… D†"D‡,Dˆ,D‰1DŠ1D‹3DŒ3DKDŽiDi	$“l
	 D”nD•p	€	þD–pÀèD—zD˜zD™DšD›DœD“Dž¬DŸ¬D ±à)	$¦¸#	 &	 +	þD¨ºD©¼DªÆD«ÆD¬ËD­ËD®ÍD¯ÍD°âD±þD²þ0	$´8	 =	þDµD¶D·D¸D¹Dº:B	$½>K	 D¾@D¿CT	€Z	þDÀC`	€b	þDÁCd	€j	þp	€v	þDÂC|	€DÃC~	€	þDÄCDÅCÀ»DÆ\DÇ\DÈrDÉ{DÊ{D˘D̘DÍ·DηDÏÒDÐÒDÑÕDÒDÓ#DÔ)DÕ:DÖkD×tDØ„DÙˆDÚ‹DÛ“DÜà„	$â¤Dâ¦Dã¨Dä³DåÂ	$éÆ•	 ›	þDêÈDëÊDìÑDíÚ¡	$ðÞ¦	 «	þ°	 RDòàDóãµ	€»	þDôãDõãÀ[DöéD÷éDøDùDúDû+Dü+DýEDþNDÿNDgDlDlD†DDDœDœD¶D	¿D
¿DÒDåD
øDDD1DDDODWDeDgD{D{D{D{DˆDˆÁ	€Å	þDˆDˆÀD—D¢D ¬D!ÁD"ÈD#×àOD$×D%ÞD&åD'òàjÉ	üÓ	düÝ	`2á	`(å	þé	`,í	þñ	`2ö	`
û	`
`
þ
`
þ
`
þ%
 -
þ5
`8
þ;
`C
þK
`Q
þW
 4^
þe
 4k
þq
 w
þ}
 „
þ‹
 
þ“
 —
þ›
 ¤
 ª
 ®
 µ
 º
þ0¿
 Ä
þ0É
 Î
þ0Ó
$,ü×
 D-þD.Ù
@Þ
þD/D0ÀD1D2#D3ID4TàXã
$BXç
@é
þë
 í
þDCZDD`DEsDFzDG–ï
$Nšô
@ö
þø
 ú
þDOœDP¢ü
@
þ
þDQ¢€DR¢DS¢À¦DT©DU©DVÀDWÞDXãàç`	``
þ`
$þ,$–ê3@8þ=@
AþE JþO SþD—ìD˜öD™öDšöD›DœDDžW$©"\ 
aþf 
nþv 
{þ€ …þD«$D¬'D­'D®'D¯VD°^D±ŠD²àD³ãŠ$µè’@—þœ ž £þD·êD¸ñD¹-DºpD»ÁD¼ÎD½ÛD¾éD¿¨$Ʋ@´ DÇDÈ$¶@
¸þDÉ'DÊ'À+DËEàIº$ÒHÁ@ÃþÅ ÇþÉ ÏþDÔJDÕPÕ@
Ýþå@	êþDÖPï@ùþD×RDØRÀVDÙ`DÚlDÛlDÜoDÝsDÞsDß‘à•$æ”@þ þ þDè–Déœ @
"þDê«À¯Dë¯Dì¯Dí¸Dî¾Dï¾DðÇDñÕDòÕDóÕDôàDõäàè$$ùè( *þDúêDûì,@.þDüî0@
2þDýñÀõDþúDÿúD
DDDà4 <: <@$ D  D!#D")D#/D$6D%<D&GD'XD(‰D)‹D*‘D+™D,¨D-¨F$6°P 
UþZ ^ cþD7²D8´h€lþD9ÆÀÊD:ÌD;êD<üD=àp$Dv z ~ ƒþDE DF#DG-DHCDIFDJFˆ@ŠþDK[Œ€DLc€DMk“€	DNpÀtDODP¯DQÊDRÎDSðDTDU"DVGDWNDXjDY|DZˆD[”D\¨D]ÁD^àD_ðD`Da5DbWà[DcZ•$lbš ¢þDmdDngDooDpƒDq˜Dr£Ds¶DtÕDuÜDvåDwðDxýDyDzD{+D|4D}AD~YDbD€oª€x®„¸~¨ÀÅXÈhÐLpÙ~˜àf< éœð ò!ú!
fH)
y@+
–L+
´L+"
\++
»|+2
Œ+9
œ+@
»È+H
Ø+O
§,X
7,._
Ïp.f
€˜.n
¨.w
 @+}
ƒ
~Þ‰
r0’
°0–
þL0
CP0¥
	÷,<ª
	0<¯
	é2<´
1T0¼
	u4<Ä
	Š8<Ì
	ˆ<<Ô
Ì”0Ü
Œ˜0ä
œ0ê
	p@<ô
	ØD<ý
	éH<	1L<
	fP< 0Îò'W<0Ò	9u	BC¼0K´x	T9î]Wú	f»Ø0p¥NyQ<‚y`‹	‘R<”	T<žkô0¦¡ø0±­ü0¸	cV<¿Ú1Ľ1É
1Ó+1Ýp1ãEBë™Ìómlû	µ\<?1÷r.ä: fH))Æ°5[Ö=âG<þO§Ø+T€p.Yü^ýhh	d<n	/”<t-¨	¡œ<ˆ
”’Ü
™•. ‰Ì¨±Up¹¥²Áþ< Ê?ôÕ6HÝÝŒè¶ôñqúà<RPIb	V¤< ª.IÄ6Qb>ÂE	¬<Ke‚S[¸c
lnT2sÿ}Är‚	ñÜ<ŒR”2—	â<Ÿ@˜2«`Æ´	4ä<¼Hœ2Â	E=É	¿=Ó	S=Ý	‡=çÎœ4ï@ˆ÷Å!þœŒ+¤„
j q7>'t¨.eh5«,=N˜Dè*L¤Vœ+\Â|+bpj3\+r»²+x¸ð €	›=ˆ	,=	+8=–	U<=ž	ï@=£	D=¨	ÇH=²	#J=·	`L=¿ÛXÄìšÊêÒF"ØLèá
ìèñä5øð8:ÿÊÁ°^	'T=!©x*´ƒ3~v"<´$<F.XM	—T?T¨.[Ll*c[êk•˜.r	
\?z–Æ*„;L+‹yl-‘	Þ\C™È+ Á,.¦7ˆ-¯	̈G´ÏY.¹crt0.oexitddt.oddt.c_cnt_cnt_ptr_base_flag_file_iob_iobbufpntpntcolcolnametypeflagsvaluevaluestartstartlimitlimitusrsymsusrsymspcpcoldinstoldinstcountcountbfr1bfr1bfr2bfr2cbfpcbfpbpttrctlegalbpbpcbptrcbptrssflagopcopcosrosroasoassvregssvregsquitpcquitpcquitsrquitsrquitspquitspiradixiradixoradixoradixmaskmasklowlimithilimitgotargcomargcomargcompfxdspdatadspdatadepdatadepdatagetldatagetldatasymtypesymflagstomodetmptomodedtypeescnoescnodotdassymtermsargtermscrlflgetbpcpclgetwpcpclgetlpcpcddtsymdefddtsymdefddtsymsddtsymsputstringspspforceuppercmacifycsetradixvaluevaluenumoutnumbernumberccprintnumnumbernumberprintadrspcpctabletablespsponeofstringcstringmisdigcddvalidvalidgetnumstringvaluevaluecddnnfindsymstringtabletablecurrentcurrentsymnameiiaddsymstringstringvaluevaluetabletablespspnameiigetsymsymvaluesymvaluesymvaluesymvaluecsymbolsptrsymadrsymadrsettomodepctabletablespspgettomodectotypetotypewordadrpcpcpcpcdisplaytypetypeadrsdeposittypetypeadrsdatadatainc_pcpcincincpcincincdec_pcpcdecdecpcdecdecnwordsnwordsiiposposgetsearchvaltypetypepcgetargsymvaluesymvaluecnxdelgetcomcsetpcpcptrdspsymbpcnbytesnbytesdspbytepcputbytepclongdatalongdatadspwordpcputwordpclongdatalongdatadsplongpcputlongpcpclongdatalongdatacomloopcgolopennbytesnbytesincincadrstemptemptesttestsearchvaluesearchvaluesearchmodetomodeadrsfirstonceonlyspspddtfddt68.ofddt68.cfmagicfmagictsizetsizedsizedsizebsizebsizessizessizertsizertsizerdsizerdsizeentryentrystypesvaluesvaluersymbolrsymbolrposrpos_cnt_cnt_ptr_base_flag_file_iob_iobt_intrct_quitct_startct_stopct_eofct_brkct_suspct_dsuspct_rprntct_flushct_werasct_lnextcsg_ispeedsg_ospeedsg_erasesg_killsg_flagssg_flagsttystatettystatettystatepttystatepoflagsoflagscleanupptrcleanupptrdasfilhdrfilhdrnametypeflagsvaluevaluestartstartlimitlimitusrsymsusrsymsfbfrifileifilebfrendpcbfrbegpcbfrchngeoriginorigingetbfrpcncharsncharsfpcfpcinbfrpcgetbpcpcputbpcpcdatagetwpcpcwordwordputwpcpcdatadatagetlpcpclwordlwordputlpcpcdatadatareverselwrdlwrdreadsymsfilenamesfilesfilesssymnosymnochrnochrnocspspresetttycleanupsignosignomainargcargcargvnchrsnchrssigsigdasmsub.odasmsub.cbufpntpntcolcolnametypeflagsvaluevaluestartstartlimitlimitusrsymsusrsymspcpcoldinstoldinstcountcountopargsopargseargseargsargnoargnonwordsnwordsmpcmpcspcspclongflaglegalsymsizmodbfr1bfr1bfr2bfr2cbfpcbfpputclcollcolhexnnnnwhexnnnniiclengthmodifiermaskmaskpatternpatternlocatecodecodetabtabcodecodetabtabbinditemitempatternpatternmaskmaskargsargsbindmodargsargsmargsargsputsymbolcciisymbolnnnntabletablecurrentcurrentbestbestbestvaluebestvaluesymbolicvvvvtabletableeerevyyzznnoptabeatabinstrtranslateitemitemtabargsargsententsubstcodlimargsargsvvsizccrdasmaddressaddress-lgfprintf.ofopen.ocreat.ofseek.oprintf.ordwr.ofilbuf.osignal.olseek.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.ourem.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_bp_cbptr_ssflag_opc_osr_oas_svregs_quitpc_quitsr_quitsp_iradix_oradix_mask_lowlimit_hilimit_gotarg_comarg_compfx_dspdata_dspsymb_dspbyte_dspword_dsplong_depdata_putword_putbyte_putlong_getldata_lgetwpc_lgetbpc_lgetlpc_symtype_symflags_tomode_tmptomode_dtype_escno_dot_das_symterms_argterms_crlf_getbpc_getwpc_getlpc_ddtsymdef_ddtsyms_putstring__iob__flsbuf_forceupper_macify_setradix_numouturemudiv_put_printnum_bfr1_cbfp_printadrs_usrsyms_symbolic_oneof_isdig_getnum_findsym_addsym_getsym__filbuf_settomode_symbol_gettomode_wordadr_display_deposit_inc_pc_dec_pc_dasm_legal_getsearchval_getarg_getcom_setpc_bfr2_putbpc_putwpc_putlpc_comloop_first_onceonly_ddt_ttystate_ttystatep_oflags_cleanupptr_cleanup_filhdr_fbfr_ifile_bfrendpc_bfrbegpc_bfrchnge_origin_getbfr_lseek_read_fprintf_inbfr_reverse_readsyms_fopen_fseek_malloc_fread_fclose_resettty_stty_open_printf_isatty_gtty_signal_opargs_eargs_argno_nwords_mpc_spc_longflag_sym_sizmod_hex_whex_locate_bind_bindmod_putsymbol_rev_optab_eatab_instr_translate_subst__dbargs__dbsubc__dbsubn__doprnt__lastbuf_creat_errnocerror_fflush_fwrite_write__sobuf__cleanup_close_free__sibuf_ioctl_sbrk_realloc_end_brkbernumberccprintnumnumbernumberprintadrspcpctabletabsumacc/cc41/ld68   755      0     12       54056  3472711317   6577 <ð	Â^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØ;ûï
ÝPûï„5¼Â^2ïRBݬݬûïyÐïsC­üнüï'AÝï!AûïFЭüPР­üÕ­üÝûï½ûïò
Ðï8C­üнüïì@Ýïæ@ûï
ЭüPР­üÕ­üÝûïþÝûïí4Ðï«@8Ðï£@PÐ@¼P‘`-ݬݬûïyÐïƒ@PÝ@¼ûïÖïq@Ñïk@¬¾Â^ÝÝûïÐP­üЬ½üЭüPÔ ÕïŒB
Эüï‚B!ÐïzB­ø	ЭøPР­øЭøPÕ îЭü Â^Ðï@PÁ@¼­ü1F˜­ûPÏPB6€nnnnnnnnnnnnnäTnnnÜnnnnnnnnnnnÏ/nnnnn½n{n'ìôn¡nú˜­û~Ýï :1³Öïo?Ñïi?¬1–Ðï\?PÐ@¼ïæ91™ÖïI?ÑïC?¬sÐï9?PÝ@¼ûï/ÝPûïV1kò¬ï?˜­û~Ýï²9ûïÛÐïÿ>PÝ@¼ûïõÝPûïÐïÐAïo91&ÖïÖ>ÑïÐ>¬˜­û~Ýïf9ûï1Ðï²>PÝ@¼ûïÐPïÏ?1æÖï–>Ñï>¬ÀÐï†>PÝ@¼ûï$ÐPï‹?1ºò¬ïh>˜­û~Ýï9ûï*ÐïN>PÝ@¼ûïìÐPï_?ÖïE?}Ðï->PÝ@¼ûï»ýÿÿÖ­üЭüP•`õ^Öï?VÖï?NÖïþ>FÖïú>Öïä>8˜½üï~8Ö­ü+Öïã>#Öïo8Öï×>Öï×>Þïïº8ЭüPÖ­ü`­û1ªýÂ^Ь[ЬZ‹­ÿŠ­þ‘­ÿA‘­ÿZ€ ­ÿ‘­þA‘­þZ€ ­þ‚­þ­ÿ˜­ÿP•­þÃÔPÂ^Ô­üy‘¼0‘¼9x­üP˜¼QÀQPÃ0P­üW‘¼a‘¼fx­üP˜¼QÀQPÃWP­ü2‘¼A‘¼Fx­üP˜¼QÀQPÃ7P­ü˜¼~ßïå7ûïªÖ¬•¼‚ЭüPÂ^Ь[Ô­üÝ[ûïYÑP7ÑP!<arLÝï§<ÝïI7ûï˜ÝïŒ<ûï_0Ýïƒ<ûïR0ÝÝÝïm<ûïÂÝÝûï'ÇÝÝûïÐP­ôÔ Ô½ôÕïº6Ðï¶6PЭô Эôï¨6Эôïš6Ðï”6ï“6ЭüÝÝÝï<ûïZÝïø;ÝÝ<ßï>>ûï³ÕP1NÿÐïÚ;Pà ñÀ<­üÝßïì6ßï>ûï;%ÕPXÝÝ­üûïwÕPHÝÝûï\ÐP­ðÔ Эü½ðÕÿ
6Ðï6PЭð Эðïø5Эðïî5Ðïè5ÿß5ß­øßï‹6ßïÐ=ûïåÁ­øPÊPÀP­üÝÝ­ü1*ÿÂ^Ь­üݬûï–ÐïB<ïU<Àï;<ïN<Àï4<ïG<Ô­ðÔïî:ÐïÜ=­ôÁ ï{=PÀïx=PÀP­üÝÝ­üÝïÐ:ûï%Áïc=­ü­øûï¼ÀP­üûïÀP­ðÑ­ü­øãÕ¬Õ­ðFÀï$=ï³;Àï=ï¬;Àï=ï¥;Àïg:ï5Àï=ï—;Àï=ï;ÐPÑï6=­ô×ï,=Ðï&=PÄPÔð˜DÞÔPÂ^˜ïÏ<­ü˜ïÈ<­øÕï;ï­üPÑP
ÑPÑP1‰á­üKûïûï,ÝPûïÕPiÐï·<[àkYáïs<V‘ïl< PÑïg<«CÐï]<«9Õï:1Õï‹:ÐïG<P‘`.‘ LÁ	ï7<PÀPïk9“kªÔPÕ«	‘ï<"ïï<köï
<«Ðïú;«ÐPÂ^ЭüЭøßïe4ûï$ÝPûïKßïV4ûïÝPûï5ßïG4ûïøÝPûïÔï:Õïé9ÕïÙ9aÝ"Ýïû9ßï4ûïÄÝPûï…Ý#Ýïá9ßï4ûï¦ÝPûïgÝ$ÝïÇ9ßïê3ûïˆÝPûïIûïXïïš9PÀPï’9Õïü29Áÿïk9PËÿPï^9Áïl9ïS9PÀÿPËÿPïC9ÁïK9ï29ï19ïï=9PÀPï59Áï/9ï9ï9Áï'9ï9ï	9Ôïk2Ôïù8ЭøÕïÛ82ßï13ßï#3ûïêÐPï£8ßï3Ýïi2ûïrÔ­øÞï™:[SÝ[ûïÁÕ­øBÕïŠ8:Ý«Ý«ЭüPÖ­üÇPQxQQÃQPQ	ÞïÐ2PÞïÎ2PÝPÝï98ûïNÀ[Åï(:PÀˆDPÑ[P™Àï]8ïT8Â^ÔïK8Þï:[,‘k $Ы­üÁ­üPËP­üÐï&8«ö%kÀ­üï8À[ÅïÇ9PÀˆDPÑ[PÀЬ[Á	«PÀPïV1˜kPÏP 
OYcmÕïœ7Õïœ7ïÕ«êÕï1
ßï2ûï Öïþ0Ý«ßïø1ûï
½Àïr7«³Àïl7«©Àïj7«Ÿö$kÀïa7«’Ь[‘k Õ«Ýï'6Ý«ÝïÎ0ûï߬kЬ«Õï”02ï8	2ïv8Ðï7ïo8Ðï7ïh8Ðïú6ïa8Õï»6	Ðïï6PÔPÐPïO8Õï¡6	ÐïÙ6PÔPÐPï98Õï‹6ÔPÐï0PÐPï8Õïý/%ßïø0ûï`
ÕPßïî0ûïO
ÐPïÖ/ÕïÐ/)‘ÿÈ/"Ýïï/ûïüÐï°/PРïÇ7Ðï'6ïº7ßï¥0Ýï’/ûï'ÐPïÐ5Ýï|/Ýï¦/ûïåßïx0Ýïc/ûïøÐPï¥5
Ýï/ûï¼ÝÁ ïA7~Ýï†5ûïûÕï•51¥ßï/0Ýï/ûï­ÐPï^5
Ýï6/ûïqÝÁ ïö6PÀïó6PÁïô6P~Ýï05ûï¡ßïâ/ÝïÉ.ûï^ÐPï5
Ýïç.ûï"ÝÁ ï§6PÀï¤6PÀï¥6PÁï¢6P~ÝïÞ4ûïKÝïÅ4ÝÝ ßïo6ûïöÂ^Ô­üݬûïfÑP1ÑP!<arJßïQ/ûïÑÝïŸ3ûïr'Ýï–3ûïe'Ýï„3ÝÝ ßï
6ûïÃÝûïdÃÐÿÞ-­øAнø­üÝÝ­üÝïN3ûï£ÝïA3ÝÝ ßïÇ5ûï€Ý­üûï ЭøPР­øÕ­øºÐïŽ-PРï…-1aÿÂ^Ь­üÔ­ôݬûïeÐïý3ï$4Àïö3ï4Àïó3ï4Á ï[5PÀïX5PÀP­üÝÝ­üÝï°2ûïÁïC5­ü­ø1ñï­ðPÑPEÑP@ÑP;1ÙûïƒÀP­üò@­ô
Ýï2-ûïi
ûït˜ï5­ðÕïF3°à­ð5Õï13¸Õï-3Ðïé4P‘`.‘ Lyûïg	ÝPûïB
gûïU	ÐP[Ýï2Ýï²4ÝïÀ,ûïóíôPÐ[@ïØ´‘ïŠ4 ,‘ï4k
Ñï|4«ÝïÆ1Ýïp4Ýïj,ûï{Ñ­ü­ø1ÿÝÁ ¬~Ýï”1ûïéÝÁ ¬PÀï4PÀï4PÁï4P~Ýïn1ûï¿Ýï4Ýïë3Ýïe2Ýï/2Ýï!2ûï ÝÁ ¬PÁïÅ3P~Ýï)1ûï~ÝÁ ¬PÀï©3PÀï¦3PÀï§3PÁï¤3P~Ýïü0ûïMÝï“3Ýï}3Ýïû1ÝïÁ1Ýï³1ûï.ÀïZ3ïÕ1ÀïS3ïÎ1ÀïH3ïÇ1ÀïA3ïÀ1Â^Ô­èǬ­ì1MÑ­è¬
ßïB,ûï¥Ýïw0ÝÝß­øûïµï­øPÏPV`oFzÑP1•ÑP1“ÝïC0Ýï+ûï41Ýï-0Ýïó*ûï1ß­øûïñÐP­ð.Ðï1­ð$Ãï‰2ï1­ðÁï~2ïu2PÃPïù0­ðá­ø
Á¬­üPÂP­ðï­øPÑP1iÿЭô
ЭôЭôÑ­ü¬1uÿݬÝ­ðÝ­ôÝ­üÝ­èûï
ÐP­èÕï|0>à­ø9À¬­üï­øPÑP2­úPÐ@ïV²PРPÔP÷P­úݬÝÝß­øûï^ЭìP×­ìÕP1¥þíè¬~ݬÝï#/ûïÆ
Â^Ь[µ«±«@2«PÐ@ïñ±ZÝïø.ÝïÖ)ûï³	Ô­üЭüPЪ­ü˜jPïPPÏP7
")0ݪÝï¿.Ýï¡)ûïz	ÈðkÁðkºðk³Õï‰/ËájÇðk Â^Ô­üѬ¬Ýïs.ÝïY)ûï.	ЬPì¬~ݬÝïJ.ûïí	Ô[T×ÿ9.Ðï1.PРQÖ ˜aPšPP
Ýï.ûï|ÐPZÖPÝï.Ýï©(ûï	x­üPšZQÉQP­üÖ[Ñ[¬¦À¬­üì[2x[PÎPPxP­üPšPZ×¼ЬPРQÖ öZaݬÝZûïÕ×[Õ[ÊÁ¬¬PÂ^Ь[ЬZÁZ[PÆPÄPÐàŒDYÖ[Å[PÑàŒDYï×ZÅZPÑYàŒDñÑ[ZRÅ[PÅZQÑàŒDáŒD=Å[PÀˆDP(`­èÅZPÀˆDPÅ[QÀˆDQ(`aÞ­èPÅZQÀˆDQ(`aÑ[ZÖ[×ZÑ[Z1zÿѬZÁ¬~ÝZݬûïAÿÿÿÑ[¬Á¬~ݬÝ[ûï*ÿÿÿÝÁ ïá-PÁïÞ-P~Ýï†-ûïÿ
Õï­-ÝÃï~/~ÝûïìþÿÿÕï‚-1áÞïw/[1ÀÝïI-ÝÝÝ[ûï~ЫZ
ßï6(ûïyЫY@Ðï-PРQÖ ‰a-‘i Ý«ßï(ûïK×ÿõ,ÐÝïí,˜‰~ûï3ÐZP×ZÕPÊ×ÿÔ,ÐïÌ,PРQÖ ”aÝïº,ÝûïÐï«,Pá ÝïS&Ýï•&ûï¼À[Åï˜.PÀˆDPÑ[P1)ÿÝïr,ûïiÝïi,ûï\Õïx,ÝïX,ûïGÝïO,ûï:Â^Ь[”ïŸ-Ð[ïP+ÔïB+‘k-1W‘«lö•«Þï8'[ßï5'ßï“+ûïàßï+'ßï€+ûï±Þïs+ïþ*Á[~ßïd+ûïQÁïç*P~ûï¢ßïö&ÝïÒ*ûïsÑïQ%mcÞïÙ&ï·*Á[~Áï¬*~ûïdßïÞ&Ýï˜*ûï5Ýï‹*ûï¤ÐPïu*ÝPûï@Ýïl*Ýïb*ûïÑïá$xcÞï&ïG*Á[~Áï<*~ûïôßï’&Ýï(*ûïÅÝï*ûï4ÐPï*ÝPûïÐÝïü)Ýïò)ûï¯Ýïå)ßïç)ûïœßïÚ)ûï/ÐP­øÑP5ÞïÃ)PЭøQ‘A`bÞï±)PЭøQ‘A`aÞïž)PЭøQ‘A`.&ßïò%ßï‰)ûï"Ýbßïv)ûïÕïY)/ßïÆ%ßï[)ûïpÐPï=)Ýï=)Ýï$ûï.ßï™%ßï,)ûïAÐPï)Ýï)ÝïÜ#ûïÿÝïó(ÝÝß­üûï5ÝÝÝïÛ(ûï0Ñ­ü
Ñ­ü!<arЭüPÔPÝïf+ûïÐ`PÔ[Ô[ЬX˜ˆPÊ ÿÿÿPx[QÁQP[•hêï[PÇÿPQÄÿQÃQPQÁQ[Ð[YHÝï+ÐKïB+PÝ ûÿG#ÐPZÐKï++Pà`(Ö[Ñ[ Ô[Ñ[Y
Ýïþ"ûïÕKï+¯x[PÀxDPЬï°*ݬûïZÐPï£*ö ï*ÔïŽ*ûïÿÿÿÂ^Ь[1ÑÝïv*ûïÿÿÿÐP­üÑï™*ÿ
Ýï„"ûïŸÅï~*Pž@ïŠ*[Ð[ïj*Õ½ü
ßïð#ûïœÐ[½üÁï!*~ÝûïÐP«
Ýï3"ûïNÝïú)Ý«ûï•»
ßïº#ûïRÐïÜ)«ö««ïÃ)kÐïÀ)«Эü«Ðïë)«Öïã)ÐPÐ[ïÔ)ÔP˜ï)PÑP*ÑP1ÑP8ÑP ?ÑP"ÑP#ÑP$$áPö!ïa)Àïê'ïY)Àïâ'ïM)ÀïÚ'ïA)ÝݬÝï}&ûïÒÝïp&ÝÝ ßïö(ûï¯Ñïé(ÝïT&Ýïú ûïEÁïÌ(PËP[Ð[ïÀ(Î[ïi'Áï¶(PËPZÁZ[PÎPïV'Áï£(PÊPÐPï˜(Ýïò%ÝÝßï˜(ûï­ÐïÛ%Pá Ýï×%Ýïq ûïÈÔZÑZ2×ÿµ%Ðï­%PРQÖ ˜aPšPP
Ýï—%ûïø
ÐP[ÖPÝï‹%Ýï% ûï|ÖZ²ö[Jï2(òÐZï(Ýïa%Ýï; ûïÞï(ïù'Á	ZP”ï0(ÁZPßïÉ!ûïÅݬݬݬݬݬݬûï¬ßïª!ûïŸݬݬݬݬݬݬûï¯ÿÿÿÝûï
ݬݬݬݬݬݬûï‰ÿÿÿûïݬݬݬݬûïgŬ¬QÑPQЬPá Ýïˆ$Ýï"ûïyÿÿÿЬPá Ýïl$Ýï
ûï]ÿÿÿÂ^Ь­ü1’ßïë ûïfÿÿÿ1‚×¼ЬPРQÖ ˜aPšPP
ݬûï}ÐP[ÖP8ЬPá Ýï$Ýï¡ûïøþÿÿЬPá Ýïë#Ýï‰ûïÜþÿÿ×¼ЬPРQÖ ö[aݬÝ[ûïáЭüP×­üÕP1pÿÔPÂ^Ь[Ô­üÔZ‘k96Å
­üP˜‹QÀPQÃ0Q­üÖZÖ[Ö[˜kPÑP	öÑP ñÑP+èÑP-á‘k0ÅÕZέüPЭüPĬ¬ݬûïÐP[ÔPÐ[ZÝÁ¬~ûïæÐPYÔŠôYûÐ[PݬûïÈݬÁ\~ݬûï+ЬPá ÎPÔPЬ[ÞïÈ#XÑXïþ$ÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûïÑÝ‘kalÕYÐPÐPÝPݬûïßÐPZ<Ñï#3ݶݬûï}ÐPZÕYÕZÝZûï}Ýݬûï¡ÐPZÕZ)ÝÝÝZûï­ÕYÐPÔPÝPݬûïtÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ï°Â^ЬPª ЬPè 1ÐѬsÕ nà iмZЬ­üÕ¬Ýݘ ~ûïÐP­øÃPZPÀP­üÂZ¬ЬPà )ÕZ%Ñ­üZÐPQá PÑ­üPÐQPÀ­ü ­ü¼ÔPï¬[Ô[ЬPá ÐPQР¡ЬPª ݬÃ[¬~ЬP˜ ~ûï‘
ÐP­üÔ¼Õ[h×¼	ЬPÖ Zݬûï&	NЬP³ BÝPûïЬPá Ô¼ЬPª ЬPÐPQР¡ݬݬЬP˜ ~ûï"
ÐP­üÑ­üÿÿÿÿÎPÔPßïd!Á\~ݬûïŒáï[!ÎPÔPÂ^Ь[ЬZÔ­üÕ¬05Ь­ø×jЪPÖªš`P	ÝZûïgÐPYöY‹×­øÚÖ­üÑ­ü¬ËЭüPÂ^Ь[ЬZÔ­üÕ¬.3ЬY×jЪPÖª‹`ÝZ˜‹~ûï××Yààª
Ö­üÑ­ü¬ÍЭüPÁ\~ݬßï ûïJÁ\~ݬݬûï5Â^Ь[™A­üÐ[­øÐ[­ôÔ­ðÖ­ð•‹ùÁ\~ݬß­ðûïÂ^Ь[ЬZÔ­üÔ­ì1)ЬPРQÖ šaP1L˜‹YÑY%1/Ô­ðÑY*	ÐZ­ðÀZ˜‹YÔ­øЭèÅ
­øPÀYPÃ0P­ø˜‹YàIï>çÕ­ø20u­øÑYlЭèԭ蘋YÑYhïÑY[Ý[ûïÐP[áIïõÀ YЭèÕYÎPß­ìݬÝ­èÝ­øÝYÝ­ðûïÂÕPÕ­ðÖ­üÕ­ìVÕ­üЭüPÎP×¼ЬPРQÖ šaP
ݬûïÐP­ôÑP ØÑP	ÓÑP
ÎÑPÿÿÿÿݬÝPûYÐYPÑPJÑP	©ÑP
¤ÑP ŸÑP%1Æþ×¼1­þݬûï%ÐP­ôÑPYÃÑPÿÿÿÿ14ÿݬÝPûï¼ЭüPž®¨^ѬcѬs
Ѭ[#ݬݬݬݬÕ¬мPÔPÝPûï´Ô­¨Ô­¬Ô­¸Ñ¬e
ѬfЭ¸Ð
YѬoÐY
ѬxÐYÞ­À[Ô­¼Ô­´×¼ЬPРQÖ šaP
ݬûïNÐPZÑP ÙÑZ	ÔÑZ
ÏÑZ-.Ö­´öZ‹×¼ЬPРQÖ šaP
ݬûïÐPZ׬1ÕÑZ+ø׬×¼1´Ý¬ûïï1µÑZa	ÑZfÑZA1³ÑZFôÖ­¬ÑYx­¨­¨ÑY
x­¨PÀ­¨PÁPP­¨x­¨­¨ÐZ­°áJï›Â0ZÑZaÑZf	ÂWZÂ7ZÀZ­¨Ð­°ZÑY
1§Õ­¸øÖ­¬öZ‹×¼1LÿЬPРQÖ šaPÐPZ׬~áJï41^ÿÑY1/ÿÑZ.¶ÑZe	ÑZESÕ­¼NÑY
IÕ­¸DÕ­¬?Ö­¼öZ‹×¼ЬPРQÖ šaP
ݬûïËÐPZÑZ+1pÿÑZ-øÑZ0ÑZ9îÕ­´έ¨­¨ÑZÿÿÿÿݬÝZûïJԼмլ	Þ­ÀPÑ[PÔP”‹x­¸PȬPÏPPZZ&&&&&&&&&&&&&**=ÐPß­ÀûïµмRvPbéß­Àûï¢мRpPbÖмP÷­¨`ÌмPЭ¨`ÂÂ^Ь[ЬZÔ¼Ð[XѬcѬ0uЬÔ­üѬsЭü×jЪPÖªš`P	ÝZûï¯ÐPYÒ­üQ˜@ï-PÊQP	ÑYÿÿÿÿÊЭüѬcÔ­üIѬ[?Эü9Ò­üP˜IïðQÊPQ1Õ[öY‹×¬%×jЪPÖªš`P	ÝZûï9ÐPYÑYÿÿÿÿ¾ÑYÿÿÿÿÕ¬ÝZÝYûïÌԼмÕ[Ñ[XѬc”‹ÐPÔPЬ[ÔY‘k^ÖYÖ[ÔZÕY
ŠJïZˆJïPò€Z☋ZïZPÑP]ÕY
ˆJï+ŠJï!ÖZÕ×[Ð[PPÀÔSЬRÔUš‚T‘ Tø‘T‘T
î‘+T‘-TˆSš‚T|P‘T04‘T9/ÑQÌÌÌyPVyPPÀVPØWQÂ0TÀTPØQÖUáS×Uš‚TÇ‘T.ãSòÔV‘Te‘TE[š‚T‘T+‘T-ˆSš‚T‘T0‘T9ÑVÌÌÌêÞFfV>F¤ÐVßáSÎVVÀVUÑUœÿÿÿÐœÿÿÿUÑUdÐdU}PP1ÔRÕU#ÑQ™™™	yÿPPÖRîyPVÀVPØWQÖRõUß=;ÕQ
yPPÂRyPP×RáQöÐQVÔW{VQWÁPVØW{
VPVÀPPÑVÖP×RòUÖáQyÿPPÖRyPPœÿPPnPVnQPdï‘þÿÿP`VPáSrPPÝRpP~ûïÆЬ[á«¨«è«ÎPà«÷ÝûïÍÐP«¨«Õ«á«ߘ«Pž@ïž «ç¨«Ñ[ˆBáïR
ßï?ûï†
á«ÐP2PÝPÝ«˜«~ûï©ÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«p¬PïPRÀ¬RÑR
ðRP|Ppï Pá¬rPPÐ"ïäЬ[ÔZÖZ•‹úÐZPЬ[ЬZЬY×Y‘kŠ•‹óÔPÕYÔP	˜kP˜zQÂQP¼ïL	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûïÐPYj˜ï¨~ûïòÕPâ«ÞïëÞﻫá«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûï%ÐPYÐZ«Ôkná«1mÿЫZ3Ñ[˜B1xÿÝûï[ÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûï¼ÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûïPÑPY¨ «ÎPÔPÞï@
[Ý[ûïÀ[Ñ[ïjëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûïYÕPÎZá«
Ý«ûﯳŒ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼Ь[ЬZ‘kŠ•‹÷ÔP˜kP˜zQÂQP¼ïœÔPÂ^ß­úݬûïxÕPÔPÐP¼ïl¼ï\Ь[ЬZÐ[Y•‹ü×[Š‹ûÐYPЬ[ЬZÐ[YŠ‹ûÐYPݬÝ	tݬûïݬÝtݬûï¼6ïìЬ[ѬÿÿÿÿÎPé«Ñ««Ñ««êÕkæÖ«Ök׫ЫPö¬`ÔPÕïü.ÉðJïîÉìJïæÞïàïãÞïÑïÔÝÁ¬~ûï*ÐPYÐï½[ÔïÂék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZï~	Ñ[ìJÔPñïp¬ÿÁYPÆPxPïWÝûïbÐPZxïDPÀZPÑPZÀxï4~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿÁï
PÑZPÈÿýxïþPÀZPÃPjÐjïçÉìJÿÛ1ÿxYPÁ[PïÈÑZïÁÐÿ¹ï¼Ðkÿ­Éï¦kÁ[PЬ[Ð[ZÂZÐZïËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐïí@j‘Áï°
¬~ÝÐ\SÐ^\¼ï_Ðï•
PÀ£ïŒ
¼ïCЬïw
ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPï=	ÎPH>N>|>•>®>Ä>Ü>ÿ>%?=?S?m?ƒ?³?à?@-@?@S@i@“@Ô@å@ ANAÈ5atox: illegal hex argument (%c)__.SYMDEF       %d_etext_edata_end_etext_edata_endsym.outwlist.out%s %x	%s %x
Undefined:
%s
_start_startwaaabad file type on second passrelocation after end of segmentzero length symbolbad character in symbol %s-la/usr/sun/lib/lib.a/usr/sun/dm/lib/libxxxxxxxxxxxxxxx.a/usr/sun/xlib/libxxxxxxxxxxxxxxx.a.rrhash table conflictnull symbol enteredld68: 
bad count to dcopyb.outmissing argument following command option -%cunrecognized option: -%cpremature end of file %sread error on file %sunknown type of file %sunknown type of file %s in readhdrmultiply defined symbol %s in file %sentry point not in textcannot create file %scannot reopen output filelocal symbol overflowinternal error - undefined symbol %s in file %sformat error in file %s, bad relocation sizeformat error in file %s, relocation outside of segmenterror writing file %sfile %s not foundhash table overflowsymbol table overflowformat error in file %s, null symbol nameformat error in file %s, invalid symbol id in relocation command%s references %sformat error in file %s, bad address in relocation commandbad header in archive %s, ARFMAG is 0x%x 0x%xunknown archive magic, 0x%x 0x%x 0x%x 0x%x                           AAAAAABBBBBB ÿÿÿÿÿÿÿØFØFÈCK—r<äØìtH(y2~´:ÅÔBäJL,!S~T!Zfø!bX"knh(rxð){Çð)„œ´*Œxô*•$+Ÿ¾8+§H+°f´3¹y¼5À–È5Ç´È5Ðè5Øø5á»6è(6ï86øœT6!l6»˜6¨6Aè6"79)ÏX90€€989A ¼5GM~<Sr<\	ÐCe	ÜØCmÄ<v¤<Z<‰	4D‘	8D™	¦PD¢	XˆDª	ÑpD³	btD½	xDÅ	–€ÄÌ	³€AÒÖ<ؾ<á	1„Aéß<ô	êˆAú	\ŒA	A	ß”A	A˜A!	AB,	dB2	ŒhB8	ŽlB?	ŽpBF	ÌtBL	-xBS	-|BZ	Ý€Ba	Í„Bh	݈Bo
<v	íŒB}	mB„ <‹	Í”B’	½˜B™	<œB¢	Ú B«	0¤B´	Z¨B½	š¬BÆ	y°BÍ	y´BÔ	Y¸BÛ	i¼Bâ	!ÀBê	¿ÄBòi$<ù	rÈB	òÌB	âÐBw(<x,<y0<z4<{8<"W<<'|@<+}D</~H<3L<7P<<T<A X<F!\<K"`<P#d<U$h<Z%l<_&p<d't<i)x<n*|<s+€<x,„<}öˆ<‡È5oЙE¼£ÇH«ø„µM²
¿FÄÊ£rÕAÝkHåd†îp¶õœXütì€. àg*
Ž$b5,eä3]T:NT!A¾+J$"Ràþ[¥ŽcÙ^iÉ s˜Ò{%Pƒbf
‹t´’Ú¼
˜¤¡,!©[¦!±Ð´¹.ØÀ^‚ÇÛêÐ’nØdà2çþð)ðf´3ù,ì"T6œ86$ô*dæ!Øä(«è60€X95û€<yT8B‚Î,K.ˆBQ´ÈC[/Ôb;è5iÂ6o	—ÔBvÅ8+}9„Læ4Œ²ø!“:X"œx"¤Æ|A¬ÇüAµ(¾™ò#ÆB¨6ΰì&Önp(Üx´*ãœ(6é•€9ð3ø5ø	
ØB–@5
	ÚØF»‚6l6Œ˜6%Á9+7p84	ÌK9ÏA9>crt0.old.oabort.oatol.ocalloc.ofprintf.ofopen.ocreat.ofseek.oprintf.ordwr.oscanf.odoscan.oatof.octype_.ofilbuf.oldexp.ostrlen.ostrncmp.olseek.odoprnt.oflsbuf.oexit.odata.ostrcmp.oclose.oisatty.oopen.oread.ostrcat.ostrcpy.ostty.oioctl.oungetc.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_arglist_archdr_arclist_arclast_arcelast_filhdr_cursym_csymbuf_symtab_lastsym_symindex_hshtab_local_nloc_nund_entrypt_argnum_ofilename_text_rtext_filename_mfilename_tfilename_xfilename_tout_dout_trout_drout_Lout_xflag_Xflag_Sflag_rflag_sflag_vflag_dflag_Lflag_nflag_Bflag_qflag_torigin_dorigin_doffset_borigin_corigin_tsize_dsize_bsize_csize_rtsize_rdsize_ssize_ctrel_cdrel_cbrel_e1_e2_e3_e4_e5_e5a_e6_e7_e8_e9_e10_e11_e12_e13_e14_e15_e16_e17_e18_e19_e20_e21_e22_e23_mystrcmp_strcmp_procargs_load1arg_middle_setupout_load2arg_finishout_procflags_newarg_calloc_slookup_enter_error_atol_atox_foldstrcmp_getfile_fatal_fclose_fseek_load1_fread_strncmp_sscanf_readhdr_getsym_sym1_symreloc_lookup_ldrsym_common_fopen_sym2_fprintf_printf_fwrite_bletch_dread_load2_load2td_relext_relcmd_dcopy__filbuf__flsbuf_sym_sort_strcpy_strcat_strlen_hash_abort_mallocudiv_cfree_free__doprnt__iob__lastbuf_creat_close_open_errno_lseekcerror_fflush_scanf__doscan_fscanf__sctab__ctype___getccl__innum_ungetc__instr_atof_ldexp_read_write_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brktH(y2~´:ÅÔBäJL,!S~T!Zfø!bX"knh(rxð){Çð)„œ´*Œxô*•$+Ÿ¾8+§H+°f´3¹y¼5À–È5Ç´È5Ðè5Øø5á»6è(6ï86øœT6!l6»˜6¨6Aè6"79)ÏX90€€989A ¼5GM~<Srsumacc/cc41/lorder68   755      0     12         643  3472711320   7412 #! /bin/sh
trap "rm -f $$sym?ef; exit" 0 1 2 13 15
case $# in
0)	echo usage: lorder68 file ...
	exit ;;
1)	case $1 in
	*.b)	set $1 $1
	esac
esac
nm68 -g -f  $* | sed '
	/^$/d
	/:$/{
		/\.b:/!d
		s/://
		h
		s/.*/& &/
		p
		d
	}
	/[TD] /{
		s/.* //
		G
		s/\n/ /
		w '$$symdef'
		d
	}
	s/.* //
	G
	s/\n/ /
	w '$$symref'
	d
'
sort $$symdef -o $$symdef
sort $$symref -o $$symref
join $$symref $$symdef | sed 's/[^ ]* *//'
+€<x,„<}öˆ<‡È5oЙE¼£ÇH«ø„sumacc/cc41/cc68.c   644      0     12       36531  3472711320   6773 /*
 * cc68 - front end for MC68000 C compiler
 *
 * Jeffrey Mogul @ Stanford	February 10 1981
 * 	- hacked up from cc.c
 *
 * V. Pratt March 1981
 * 	-v (version), -d (dl68), -r (rev68) options
 *
 * Bill Nowicki February 1982
 *	- Changed exec's with full pathnames to use search path
 *	- "-ifilename" option added to substitute file for crt0.b
 *	- Merged Pratt's "single module" check of Januray 1982
 *	- Merged in Mogul's undocumented .ls hack
 *	- Merged in Pratt's "-u" hack
 *
 * March 1982 (jcm, vrp, win)
 *	- Fixed bug regarding linking a single .b file
 *	- Removed Jeff's ANNOYING #ifdef
 *	- Added -vL for LucasFilms "temporary" kludge
 *	- files with no suffix assumed to be b.out format
 *	- Changed back to absolute path names (sigh)
 *
 * November 1982 (win)
 *	- Added -V option for V environment: -T 10000, -iteamroot.b, -lV
 *	- Added /usr/local/include to include path
 *
 * June 1983 (Per Bothner)
 *	- -V option now also does -DVsystem
 *
 * July 1983 (win)
 *	- Added -vx option to use experimental versions
 *
 * January 21 1984 (Marvin M. Theimer)
 *	- Changed DIRSIZ to MAXNAMLEN for 4.2 directory names.
 *	- Changed /usr/local to /usr/stanford (WIN)
 *
 * May 1984 (croft)
 *	- added "-m" switch for Macintosh environment
 */

/* #define	BSD42	1 */

#include <sys/types.h>
#include <stdio.h>
#include <ctype.h>
#include <signal.h>

#ifdef BSD42
#include <sys/dir.h>
#else
#include <dir.h>
#define	MAXNAMLEN DIRSIZ
#endif


# define LucasKludge "/mnt/lunix/bin/"
# define BinDirectory "/usr/stanford/bin/"

char	*cpp = "/lib/cpp";	/* C preprocessor */
char	*ccom = "ccom68";	/* Johnson's portable C compiler */
char	*c2 = "c268";		/* Terman's .s->.s optimizer */
char	*as = "as68";		/* Patrick's 68k assembler */
char	*ld = "ld68";		/* 68k link editor */
char	*dl = "dl68";		/* MACSBUG downloader */
char	*rev = "rev68";		/* Pratt's .b 68k reformatter */
				/* run-time start-up */
char	*crt0 = "/usr/sun/lib/crtsun.b";
char	*macroot = "/usr/sun/lib/crtmac.b";
char	*teamroot = "/usr/sun/lib/teamroot.b";
char	*xteamroot = "/usr/sun/xlib/teamroot.b";
char	*sunincludes = "-I/usr/sun/include";
char	*sunxincludes = "-I/usr/sun/xinclude";
char	*localincludes = "-I/usr/stanford/include";
char	*dmincludes = "-I/usr/sun/dm/include";
char	*defines = "-DMC68000";	/* tell cpp this is a 68000 */

char	tmp0[30];		/* big enough for /tmp/ctm%05.5d */
char	*tmp1, *tmp2, *tmp3, *tmp4, *tmp5;
char	*infile=0, *outfile=0;
char	*savestr(), *strspl(), *setsuf(), *setlongsuf();
char	*type;
int	idexit();
char	**av, **clist, **llist, **flist, **ulist, **plist;
int	cflag=0, 	/* skip link editing, result is filename.b */
	dflag=0,	/* 1 -> apply dl68 to yield filename.d */
	eflag=0, 	/* error flag; records errors */
	gflag=0, 	/* 1 -> ccom68 generates info for sdb68 (nonexistent)*/
	lflag=0,	/* 1 -> as68 generates listing */
	oflag=0, 	/* optimization flag; 1 -> invoke o68 */
	pflag=0,	/* 1 -> don't delete temporary files */
	rflag=0,	/* 1 -> apply rev68 to yield filename.r */
	Rflag=0,	/* 1 -> ld68 preserves relocation bits */
	sflag=0,  	/* 1 -> skip assembly, result is filename.s */
	wflag=0,  	/* -w flag passed to ccom68 */
	zflag=0,	/* print exec() trace */
	exflag=0, 	/* 1 -> only apply cpp, result to stdout */
	noxflag=0,	/* 1 -> -x flag off -> output local symbols */
	Vflag=0,	/* 1 -> V kernel environment */
	mflag=0,	/* 1 -> Macintosh environment */
	proflag=0;	/* profile flag: generate jbsr mcount for each fctn */
int	
	exfail;
char	*chpass=0,
	*version=0,	/* version: -vm, -v1, -v2, ... */
	*Torg=0,	/* Text origin */
	*entrypt=0,	/* entry point */
	*npassname=0;

int	nc=0, 	/* no of programs for ccom */
	nl=0, 	/* no of .b inputs for ld (including libraries) */
	nm=0,	/* no of modules (excluding libraries) */
	nf=0,	/* no of flags for ld68 */
	nu=0,	/* no of files of unknown type */
	np=0, 	/* no of args for cpp */
	na=0;	/* no of args to each callsys */

#define	cunlink(s)	if (s&&!zflag) unlink(s)

main(argc, argv)
	char **argv;
{
	char *t;
	char *assource;
	int i, j, c;

	/* ld currently adds upto 5 args; 20 is room to spare */
	/* [Does this apply to ld68?  - pratt] */
	av = (char **)calloc(argc+20, sizeof (char **));
	clist = (char **)calloc(argc, sizeof (char **));
	llist = (char **)calloc(argc, sizeof (char **));
	flist = (char **)calloc(argc, sizeof (char **));
	ulist = (char **)calloc(argc, sizeof (char **));
	plist = (char **)calloc(argc, sizeof (char **));
	for (i = 1; i < argc; i++) {
		if (*argv[i] == '-') switch (argv[i][1]) {

		case '-':	/* negate some default */
			switch(argv[i][2]) 
			  {
				case 'x':
					noxflag++;
					break;
		    	  }
			break;

		case 'S':
			sflag++;
			cflag++;
			break;

		case 'e':
			if (++i < argc)
				entrypt = argv[i];
			break;
		case 'o':
			if (++i < argc) {
				outfile = argv[i];
				switch (getsuf(outfile)) {

				case 'c':
					error("-o would overwrite %s",
					    outfile);
					exit(8);
				}
			}
			break;
		case 'T':
			if (++i < argc) 
				Torg = argv[i];
			break;
		case 'u':
			if (++i < argc) {
				llist[nl++] = "-u";
				llist[nl++] = argv[i];
			}
			break;
		case 'O':
			oflag++;
			break;
		case 'p':
			proflag++;
			break;
		case 'g':
			gflag++;
			break;
		case 'L':			/* WIN */
			lflag++;
			break;
		case 'w':
			wflag++;
			break;
		case 'E':
			exflag++;
		case 'P':
			pflag++;
			if (argv[i][1]=='P')
				fprintf(stderr,
	"cc68: warning: -P option obsolete; you should use -E instead\n");
			plist[np++] = argv[i];
			break;
		case 'c':
			cflag++;
			break;
		case 'd':
			dflag++;
			break;
		case 'r':
			rflag++;
			break;
		case 'R':
			Rflag++;
			break;
		case 'D':
		case 'I':
		case 'U':
		case 'C':
			plist[np++] = argv[i];
			break;
		case 't':
			if (chpass)
				error("-t overwrites earlier option", 0);
			chpass = argv[i]+2;
			if (chpass[0]==0)
				chpass = "012p";
			break;
		case 'B':
			if (npassname)
				error("-B overwrites earlier option", 0);
			npassname = argv[i]+2;
			if (npassname[0]==0)
				npassname = "/usr/c/o";
			break;
		case 'l':
			llist[nl++] = argv[i];/* NOT flist, order matters! */
			break;
		case 'v':
			version = argv[i];
			break;
		case 'i':
			crt0 = argv[i]+2;
			break;
		case 'z':	/* trace exec() calls */
			zflag++;
			break;
		case 'V':	/* V environment */
			crt0 = (version && version[2]=='x') ? 
				xteamroot : teamroot;
			Torg = "10000";
			Vflag++;
			break;
		case 'm':	/* Macintosh environment */
			crt0 = macroot;
			Torg = "0";
			entrypt = "_start";
			mflag++;
			Rflag++;
			break;
		default:
			flist[nf++] = argv[i];
			break;
		}
		else {			/* not a flag */
			t = argv[i];
			c = getsuf(t);
			if (c=='c' || c=='s' || exflag) {
				clist[nc++] = t;
				t = setsuf(t, 'b');
				c = 'b';
			}
			if (c=='a' || c=='b') 
			  {
				if (nodup(llist, t))
				  {
					llist[nl++] = t;
					nm++;	/* count programs */
				  }
			  }
			else if (!strcmp(t,"b.out") || !index(t,'.') )
				infile = t;
			else {
				ulist[nu++] = t; /* Unrecognized suffix */
				nm++;
			}
		}
	}	/* End of loop to process arguments */
	for (i=0; i<nu; i++) {
		if (exflag||sflag||cflag) {
			clist[nc++] = ulist[i];
			type = "C code (type .c)";
		}
		else if (dflag||rflag) {
			infile = ulist[i];
			type = "b.out format";
		} 
		else {
			llist[nl++] = ulist[i];
		       	type = "relocatable binary (type .b)";
		}

		fprintf(stderr,
		       "cc68: warning: %s has unrecognized suffix, taken to be %s\n",
		       infile,type);
	}
	if (version && version[2]=='m') crt0 = "/usr/sun/lib/crt0.b";
	if (version && version[2]=='x') crt0 = xteamroot;
	if (!nl && !infile) {
		fprintf(stderr,"cc68: no input specified\n");
		exit(8);
	}
	if ((eflag||sflag||cflag) && (dflag || rflag)) {
		fprintf(stderr,"cc68: warning: -E,-S,-c disable -d,-r\n");
		dflag = 0;
		rflag = 0;
	}
	if (gflag) {
		if (oflag)
			fprintf(stderr, "cc68: warning: -g disables -O\n");
		oflag = 0;
	}
	if (npassname && chpass ==0)
		chpass = "012p";
	if (chpass && npassname==0)
		npassname = "/usr/new";
	if (chpass)
	for (t=chpass; *t; t++) {
		switch (*t) {

		case '0':
			ccom = strspl(npassname, "ccom");
			continue;
		case '2':
			c2 = strspl(npassname, "c2");
			continue;
		case 'p':
			cpp = strspl(npassname, "cpp");
			continue;
		}
	}
	if (proflag)
		crt0 = "/usr/sun/lib/mcrt0.b";
	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
		signal(SIGINT, idexit);
	if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
		signal(SIGTERM, idexit);
	if (pflag==0)
		sprintf(tmp0, "/tmp/ctm%05.5d", getpid());
	tmp1 = strspl(tmp0, "1");
	if (nc==0)
		goto nocom;
	tmp2 = strspl(tmp0, "2");
	tmp3 = strspl(tmp0, "3");
	if (pflag==0)
		tmp4 = strspl(tmp0, "4");
	if (oflag)
		tmp5 = strspl(tmp0, "5");
	for (i=0; i<nc; i++) {
		if (nc > 1) {
			printf("%s:\n", clist[i]);
			fflush(stdout);
		}
		if (getsuf(clist[i]) == 's') {
			assource = clist[i];
			goto assemble;		/* thereby skipping ccom68 */
		} else
			assource = tmp3;
		if (pflag)
			tmp4 = setsuf(clist[i], 'i');
		av[0] = "cpp"; av[1] = clist[i]; av[2] = exflag ? "-" : tmp4;
		na = 3;
		for (j = 0; j < np; j++)
			av[na++] = plist[j];
		if (version)
			if (strcmp(version,"-vx") == 0)
				av[na++] = sunxincludes;
		if (version)
			if (strcmp(version,"-vm") == 0)
				av[na++] = dmincludes;
		av[na++]=sunincludes;
		av[na++]=localincludes;
		av[na++]=defines;
		if (Vflag)
			av[na++] = "-DVsystem";
		av[na++] = 0;
		if (callsys(cpp, av)) {
			exfail++;
			eflag++;
		}
		if (pflag || exfail) {
			cflag++;
			continue;
		}
		if (sflag)
			assource = tmp3 = setsuf(clist[i], 's');
		av[0] = "ccom"; av[1] = tmp4; av[2] = oflag?tmp5:tmp3; na = 3;
		if (proflag)
			av[na++] = "-XP";
		if (gflag)
			av[na++] = "-Xg";
		if (wflag)
			av[na++] = "-w";
		av[na] = 0;
/*		if (callsys(ccom, av)) {
			cflag++;
			eflag++;
			continue;
		} */
		{ /* this is a hack.  */
		char command[100];
		sprintf(command,"%s <%s >%s",ccom,av[1],av[2]);
		if (zflag) printf( "\t%s\n", command );
		if(system(command)) {
		    eflag++;
		    continue;
		    }
		}
		if (oflag) {
			av[0] = "c2"; av[1] = tmp5; av[2] = tmp3; av[3] = 0;
			if (callsys(c2, av)) {
				unlink(tmp3);
				tmp3 = assource = tmp5;
			} else
				unlink(tmp5);
		}
		if (sflag)
			continue;
	assemble:
		cunlink(tmp1); cunlink(tmp2); cunlink(tmp4);
		na = 0;
		av[na++] = "as68"; 
		av[na++] = "-o"; 
		if (cflag && nc == 1 && outfile)
			av[na++] = outfile;
		else av[na++] = setsuf(clist[i], 'b');
		av[na++] = "-g";	/* permits undefined symbols in as68 */
		if (lflag) {
			av[na++] = "-L";
			av[na++] = setlongsuf(clist[i], "ls");
		}
		av[na++] = assource;
		av[na] = 0;
		if (callsys(as, av) > 1) {
			cflag++;
			eflag++;
			continue;
		}
	}		/* End of loop to produce .b files */

nocom:			/* link edit files in llist[0:nl-1] */
	if (cflag==0 && nl!=0) {
		na = 0;
		av[na++] = "ld";
		av[na++] = "-X";
		if (Rflag)
			av[na++] = "-r";
		if (mflag)
			av[na++] = "-d";
		if (version)
			av[na++] = version;
		if (entrypt) {
			av[na++] = "-e";
			av[na++] = entrypt;
		}
		if (Torg) {
			av[na++] = "-T";
			av[na++] = Torg;
		}
		av[na++] = crt0;	/* startup */
		if (dflag || rflag) {	/* if dl or rev then just output to */
			av[na++] = "-o";/* temporary file */
			av[na++] = infile = tmp1;
		}
		else if (outfile) {	/* else if outfile exists then */
			av[na++] = "-o";/* output to it.  Default is b.out */
			av[na++] = outfile;
		}
		for (i=0; i<nf; i++)	/* supply all flags */
			av[na++] = flist[i];
		for (i=0; i<nl; i++)	/* supply all .b arguments */
			av[na++] = llist[i];
		if (gflag)
			av[na++] = "-lg";
		if (mflag)
			av[na++] = "-lmac";
		if (Vflag)
			av[na++] = "-lV";
		else
			av[na++] = "-lc";	/* libc.a only if not V */
		if (!noxflag)	       /* add -x by default unless --x given */
			av[na++] = "-x";
		av[na++] = 0;			/* argument delimiter */
		eflag |= callsys(ld, av);	/* invoke ld68 */

		if (nc==1 && nm==1 && eflag==0)
		    /*
		     * If we have only one module AND it was compiled
		     * (as opposed to just linked) then remove the .b file.
		     */
			unlink(setsuf(clist[0], 'b'));
	}

dnload:
	if (dflag && eflag==0) {
		na = 0;
		av[na++] = "dl";
		av[na++] = infile;
		if (version)
			av[na++] = version;
		if (Torg) {
			av[na++] = "-T";
			av[na++] = Torg;
		}
		av[na++] = "-o";
		av[na++] = outfile?	outfile:
			   nl?		strspl(setsuf(llist[0],'d'),"l"):
			   		"d.out";
		av[na++] = 0;
		eflag |= callsys(dl, av);	/* invoke dl68 */
	}

reverse:

	if (rflag && eflag==0) {
		na = 0;
		av[na++] = "rev";
		av[na++] = infile;
		av[na++] = outfile && !dflag?	outfile:
			   nl?			setsuf(llist[0],'r'):
			   			"r.out";
		av[na++] = 0;
		eflag |= callsys(rev, av);
	}

	dexit();
}

idexit()
{

	eflag = 100;
	dexit();
}

dexit()
{

	if (!pflag) {
		cunlink(tmp1);
		cunlink(tmp2);
		if (sflag==0)
			cunlink(tmp3);
		cunlink(tmp4);
		cunlink(tmp5);
	}
	exit(eflag);
}

error(s, x)
	char *s, *x;
{
	FILE *diag = exflag ? stderr : stdout;

	fprintf(diag, "cc68: ");
	fprintf(diag, s, x);
	putc('\n', diag);
	exfail++;
	cflag++;
	eflag++;
}

getsuf(as)
char as[];
{
	register int c;
	register char *s;
	register int t;

	s = as;
	c = 0;
	while (t = *s++)
		if (t=='/')
			c = 0;
		else
			c++;
	s -= 3;
	if (c <= MAXNAMLEN && c > 2 && *s++ == '.')
		return (*s);
	return (0);
}

char *
setsuf(as, ch)
	char *as;
{
	register char *s, *s1;

	s = s1 = savestr(as);
	while (*s)
		if (*s++ == '/')
			s1 = s;
	s[-1] = ch;
	return (s1);
}

char *
setlongsuf(as, suff)
char *as;
char *suff;
{
	register char *s, *s1;
	register int suflen = strlen(suff);

	s = s1 = savestr(as);
	while (*s)
		if (*s++ == '/')
			s1 = s;
	s[-1] = 0;
	if (strlen(s1) > (MAXNAMLEN - suflen)) {
		s[-suflen] = 0;
		s[-(suflen-1)] = '.';
	}
	return(strspl(s1,suff));
}


callsys(f, v)
	char *f, **v;
{
	int t, status;
	char cmd[256];
	
	if (version && version[2]=='L' && *f!='/')
	  {
	  	/*
		 * We substitute the LucasFilms versions of the loader,
		 * compiler, assembler, etc. if the -vL option was set,
		 * and we have an unqualified pathname.
		 */
	    strcpy( cmd, LucasKludge);
	    strcat( cmd, f);
	  }
	 else if (*f!='/')
	   {
	       /*
	        * add the binary directory at the begining if not
		* already specified, so you can have other versions
		* in your path without screwing up.
		*/
	    strcpy( cmd, BinDirectory);
	    strcat( cmd, f);
	   }
	 else strcpy( cmd, f);

	if (zflag) 
	  {
	  	/*
		 * print out a trace of all commands executed
		 */
	    char **arg = v+1;
	    printf( "\t%s ", cmd);
	    while (*arg) printf( "%s ", *arg++);
	    printf("\n");
	  }
	t = vfork();
	if (t == -1) {
		printf("No more processes\n");
		return (100);
	}
	if (t == 0) {
		execvp( cmd, v);
		printf("Can't find %s\n", cmd);
		fflush(stdout);
		_exit(100);
	}
	while (t != wait(&status))
		;
	if ((t=(status&0377)) != 0 && t!=14) {
		if (t!=2) {
			printf("Fatal error in %s\n", cmd);
			eflag = 8;
		}
		dexit();
	}
	return ((status>>8) & 0377);
}

nodup(l, os)
	char **l, *os;
{
	register char *t, *s;
	register int c;

	s = os;
	if (getsuf(s) != 'b')
		return (1);
	while (t = *l++) {
		while (c = *s++)
			if (c != *t++)
				break;
		if (*t==0 && c==0)
			return (0);
		s = os;
	}
	return (1);
}

#define	NSAVETAB	1024
char	*savetab;
int	saveleft;

char *
savestr(cp)
	register char *cp;
{
	register int len;

	len = strlen(cp) + 1;
	if (len > saveleft) {
		saveleft = NSAVETAB;
		if (len > saveleft)
			saveleft = len;
		savetab = (char *)malloc(saveleft);
		if (savetab == 0) {
			fprintf(stderr, "ran out of memory (savestr)\n");
			exit(1);
		}
	}
	strncpy(savetab, cp, len);
	cp = savetab;
	savetab += len;
	saveleft -= len;
	return (cp);
}

char *
strspl(left, right)
	char *left, *right;
{
	char buf[BUFSIZ];

	strcpy(buf, left);
	strcat(buf, right);
	return (savestr(buf));
}

ibc.a only if not V */
		if (!noxflag)	       /* add -x by default unless --x given */
			av[na++] = "-x";
		av[na++] = 0;			/* argument delimiter */
		eflag |= callsysumacc/cc41/nm68   755      0     12       35236  3472711320   6603 $´Â^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØ#ûï
ÝPûï4¼ݬݬûï1ûïûïëûïºÐPïë'éûïTÝûïñÐïË'EÐïÃ'PÐ@¼P‘`-ݬݬÐï¬'PÁ@¼~ûï&Ðï–'PÝ@¼ûïÖï„'Ñï~'¬±Â^1gÑPOLwÑPcê–ï#1é1­ÑPfj–ï#–ï#1Ì–ïê"1Öïõ"1º–ïð"1±Ý¬ûï—ÐPïè"ÑPd–ïÐ"1ÑPg¸˜­ÿ~ÝïÎ"ûïq1qÿÑPh]ÔÑPnÔ–ïz"P˜­ÿPÑPo1Wÿ–ïj"1bÿÑPu1qÿÑPr1Zÿ—ÑPpŽ1:ÿÑPx‚–ïD"ЬPÖ¬`­ÿ£ßïj"ßï$%ûï©ݬݬݬݬݬݬßï%ûïŠßï?"ßïò$ûïwݬݬݬݬݬݬûïÿÿÿÝûï
Â^•ï­!S•ï™!	Þïò!PÞïì!PÐP­ü•ï!	ÞïÜ!PÔPÐP­øÝÝPÝ­üßïÉ!Ýï}!Ýïw!ûï‚Â^ÝûïlÐP­üЬ½üЭüPÔ Õï!
Эüï!!Ðï!­ø	ЭøPР­øЭøPÕ îЭü Â^ÕïÝ ÔPÐïÒ ­üЭüPРïÄ Ð½üPÂ^ß­ôûïgÕP
Ýïý ûïØþÿÿûï3ÐP­ü}ÕP
Ýïç ûïºþÿÿÝûïëÝ­ôûïÕP
Ýï¿ ûï–þÿÿÝ­ôûïÆÝ­øûï¼ݬ(ݬ$ݬ ݬݬݬݬݬݬݬû
ïÓÝïm ûïPþÿÿ9ÝûïÝ­øûïªÑP
ÝïR ûï)þÿÿÝ­ôûïYÝ­øûïO¼¼Ö¬Ö¬‘¼ Ö¬ž®ˆ^•ïÂÝïú#ßï ûïqßï Ýïá#ûï²ÐPï×#BÝïË#Ýï±,ÑPRÑPIÑP	@ÑP!<ar^ÝPÝï‡ûï2ýÿÿÝï#ÝÝ ßï‹#ûï$Ðï~#PÑP¥ÝÁ ïo#PÁïl#P~ûïµÝïM#ûïЭÀÝÝÝï7#ûï4Ýï*#ÝÝ<ß­ÄûïÄÕPÅÐï#Pà ¹ß­Šß­ÄûïÑþÿÿÝïù"ÝÝ ßï÷"ûïÀ<­Àß­ŠÁ ­ÀPÀïâ"PÁïß"P~ûï(ß­¼ßïëß­ôûï+Á­¼PÊPÀP­ÀÝÝ­À1bÿž®¼^ÝݬÝï"ûïŠÔ­ð1¸Ýïz"ÝÝß­øûïÐïf"Pá ÝïV"ÝïTûïëûÿÿÞ­¾[Q×ÿA"Ðï9"PРQÖ šaP
Ýï&"ûïc
ÐPZÑPÿÿÿÿÝï	"ÝïûïžûÿÿÕZöZkÖ[Þ­ïPÑ[P¦”k•ï•$‘­¾~
‘­¾_1ùÞ­¾YÞ­¿PÐPXˆ‰ûö y•ïmá­øÝ•ïx“­øÏ•ïn“­øÁï­øPÏPy€‡Ž•ß­¾˜­ø~ÝïeûïûÿÿÀï@­ü•ï (ÝïT!ßïƒûïËÕ¬ݬßïrûï¶à­øˆ ­÷•ïû5ß­¾˜­÷~Ý­üßïN3U­÷žA­÷—T­÷D­÷‰B­÷‚ß­¾˜­÷~Ý­üßï%ûïYß­¾ûï
À	PÀP­ðÑ­ðïØ 1;þ¼ï@éQÔPݬÁ\~ݬûï·ЬPá ÎPÔPЬ[ÔZÔY‘k94Å
ZP˜‹QÀPQÃ0QZÖYÖ[Ö[˜kPÑP	öÑP ñÑP+èÑP-á‘k0ÇÕYÎZPÐZPЬ[ÞïÐXÑXï ÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûïéÝ‘kalÕYÐPÐPÝPݬûï÷ÐPZ<ÑïÄ3ݶݬûï}ÐPZÕYÕZÝZûï•Ýݬûï¹ÐPZÕZ)ÝÝÝZûïåÕYÐPÔPÝPݬûïŒÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ï”Â^ЬPª ЬPè 1ÐѬsÕ nà iмZЬ­üÕ¬Ýݘ ~ûïGÐP­øÃPZPÀP­üÂZ¬ЬPà )ÕZ%Ñ­üZÐPQá PÑ­üPÐQPÀ­ü ­ü¼ÔPï¬[Ô[ЬPá ÐPQР¡ЬPª ݬÃ[¬~ЬP˜ ~ûïÉ
ÐP­üÔ¼Õ[h×¼	ЬPÖ ZݬûïZ	NЬP³ BÝPûï=ЬPá Ô¼ЬPª ЬPÐPQР¡ݬݬЬP˜ ~ûïZ
ÐP­üÑ­üÿÿÿÿÎPÔPˆ@¬¼)ï3¼*ï$ЬRÐP‚ÐQbÔPßï8Á\~ݬûïáï/ÎPÔPÂ^Ь[ЬZÔ­üÕ¬05Ь­ø×jЪPÖªš`P	ÝZûïgÐPYöY‹×­øÚÖ­üÑ­ü¬ËЭüPÂ^Ь[ЬZÔ­üÕ¬.3ЬY×jЪPÖª‹`ÝZ˜‹~ûïÛ×Yààª
Ö­üÑ­ü¬ÍЭüPÁ\~ݬßïUûïJÁ\~ݬݬûï5Â^Ь[™A­üÐ[­øÐ[­ôÔ­ðÖ­ð•‹ùÁ\~ݬß­ðûïÂ^Ь[ЬZÔ­üÔ­ì1)ЬPРQÖ šaP1L˜‹YÑY%1/Ô­ðÑY*	ÐZ­ðÀZ˜‹YÔ­øЭèÅ
­øPÀYPÃ0P­ø˜‹YàIïçÕ­ø20u­øÑYlЭèԭ蘋YÑYhïÑY[Ý[ûïÐP[áIïÉÀ YЭèÕYÎPß­ìݬÝ­èÝ­øÝYÝ­ðûïÂÕPÕ­ðÖ­üÕ­ìVÕ­üЭüPÎP×¼ЬPРQÖ šaP
ݬûïÐP­ôÑP ØÑP	ÓÑP
ÎÑPÿÿÿÿݬÝPûïÁ˜‹YÐYPÑPJÑP	©ÑP
¤ÑP ŸÑP%1Æþ×¼1­þݬûï%ÐP­ôÑPYÃÑPÿÿÿÿ14ÿݬÝPûïlЭüPž®¨^ѬcѬs
Ѭ[#ݬݬݬݬÕ¬мPÔPÝPûï´Ô­¨Ô­¬Ô­¸Ñ¬e
ѬfЭ¸Ð
YѬoÐY
ѬxÐYÞ­À[Ô­¼Ô­´×¼ЬPРQÖ šaP
ݬûïNÐPZÑP ÙÑZ	ÔÑZ
ÏÑZ-.Ö­´öZ‹×¼ЬPРQÖ šaP
ݬûïÐPZ׬1ÕÑZ+ø׬×¼1´Ý¬ûïï1µÑZa	ÑZfÑZA1³ÑZFôÖ­¬ÑYx­¨­¨ÑY
x­¨PÀ­¨PÁPP­¨x­¨­¨ÐZ­°áJïoÂ0ZÑZaÑZf	ÂWZÂ7ZÀZ­¨Ð­°ZÑY
1§Õ­¸øÖ­¬öZ‹×¼1LÿЬPРQÖ šaPÐPZ׬~áJï1^ÿÑY1/ÿÑZ.¶ÑZe	ÑZESÕ­¼NÑY
IÕ­¸DÕ­¬?Ö­¼öZ‹×¼ЬPРQÖ šaP
ݬûïËÐPZÑZ+1pÿÑZ-øÑZ0ÑZ9îÕ­´έ¨­¨ÑZÿÿÿÿݬÝZûïúԼмլ	Þ­ÀPÑ[PÔP”‹x­¸PȬPÏPPZZ&&&&&&&&&&&&&**=ÐPß­ÀûïµмRvPbéß­Àûï¢мRpPbÖмP÷­¨`ÌмPЭ¨`ÂÂ^Ь[ЬZÔ¼Ð[XѬcѬ0uЬÔ­üѬsЭü×jЪPÖªš`P	ÝZûï¯ÐPYÒ­üQ˜@ïPÊQP	ÑYÿÿÿÿÊЭüѬcÔ­üIѬ[?Эü9Ò­üP˜IïÄQÊPQ1Õ[öY‹×¬%×jЪPÖªš`P	ÝZûï9ÐPYÑYÿÿÿÿ¾ÑYÿÿÿÿÕ¬ÝZÝYûï|ԼмÕ[Ñ[XѬc”‹ÐPÔPЬ[ÔY‘k^ÖYÖ[ÔZÕY
ŠJï.ˆJï$ò€Z☋ZïZPÑP]ÕY
ˆJïÿŠJïõÖZÕ×[Ð[PPÀÔSЬRÔUš‚T‘ Tø‘T‘T
î‘+T‘-TˆSš‚T|P‘T04‘T9/ÑQÌÌÌyPVyPPÀVPØWQÂ0TÀTPØQÖUáS×Uš‚TÇ‘T.ãSòÔV‘Te‘TE[š‚T‘T+‘T-ˆSš‚T‘T0‘T9ÑVÌÌÌêÞFfV>F¤ÐVßáSÎVVÀVUÑUœÿÿÿÐœÿÿÿUÑUdÐdU}PP1ÔRÕU#ÑQ™™™	yÿPPÖRîyPVÀVPØWQÖRõUß=;ÕQ
yPPÂRyPP×RáQöÐQVÔW{VQWÁPVØW{
VPVÀPPÑVÖP×RòUÖáQyÿPPÖRyPPœÿPPnPVnQPdï‘þÿÿP`VPáSrPPÝRpP~ûïÆЬ[á«¨«è«ÎPà«÷Ýûï}ÐP«¨«Õ«á«ߘ«Pž@稫Ñ['áï&
ßïûïŠ
á«ÐP2PÝPÝ«˜«~ûïÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«p¬PïPRÀ¬RÑR
ðRP|PpïtPá¬rPPÐ"ïäЬ[ÔZÖZ•‹úÐZPŸ¬ݬûïÝï4ݬݬûï¼;ï¼ïø
	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûï9ÐPYj˜ïx	~ûïÒÕPâ«ÞïÃ
«Þï»
«á«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûïÑÐPYÐZ«Ôkná«1mÿЫZ3Ñ['1xÿÝûïÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûïhÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûïüÑPY¨ «ÎPÔPÞï[Ý[ûïÀ[Ñ[ï:	ëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûï9ÕPÎZá«
Ý«ûï[³Œ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼¼ïhÔPÂ^ß­úݬûïDÕPÔPÐP¼ï8¼ï(ݬÝ	tݬûïݬÝtݬûï¼6ïìЬ[ѬÿÿÿÿÎPé«Ñ««Ñ««êÕkæÖ«Ök׫ЫPö¬`ÔPÕïP.É 0ïBÉœ0ï:Þï4ï7Þï%ï(ÝÁ¬~ûï*ÐPYÐï[Ôïék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïÒ	Ñ[œ0ÔPñïĬÿÁYPÆPxPï«ÝûïbÐPZxï˜PÀZPÑPZÀxïˆ~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿeÁï^PÑZPÈÿQxïRPÀZPÃPjÐjï;Éœ0ÿ/1ÿxYPÁ[PïÑZïÐÿ
ïÐkÿÉïúkÁ[PЬ[Ð[ZÂZÐZïáËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐïA@j‘ÁïÔ¬~ÝÐ\SÐ^\¼ï_Ðï¹PÀ£ï°¼ïCЬï›ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPïÎP¬$º$á$ù$%(%J%j%‰%›%À%Ì%ï%nm68: 
+0+2-r-t 
%s:
r%d%s:%s:%06X %c %s
%08O %c %s
/usr/bin/sortfilename required following -%c optionunrecognized option: %cfile %s not foundunrecognized magic number %Ounrecognized type %o on symbol %scould not reopen pipe as stdoutcould not reopen pipe as stdincould not exec %sfile %s format error, unexpected eofpipe faileddup failed or returned wrong valuefork failed                           AAAAAABBBBBB ÿÿÿÿÿÿÿˆ,ˆ,H(´0—r< ´#~Ø*q,2ÅL	:\	BL¤
H¼
OØ
X~_f¤gpnwxœ€Çœ‰œ`‘x š$´¢„ĪÏܳè»øÄfdÍylÔ–xÛ´xãˆì»¨ó¸úÈ»ô	 AD 7p""Ï´")€Ü"1ì": l@F~<Lr$U	1P(]\$g	T(q	»X(y	4`(Ý$ˆ$$–
$$¤­$«Í $²ý$$¹í($À-,$Ç$0$Ï#4$Ùw8$Ýx<$áy@$åzD$é{H$í|L$ñ}P$õ~T$ùX$ý\$`$ d$o|"dÅF#-`Æ6£ØAyÊJqØPœöW.']¤´f
>m£Fw«D »¼
… ‹;x’â­
—z´žó*«Ø
³t,ºNÁðºÆÎe\	ÕÐÝþœæ$ îì"õ‚~þ´H(.L	¨	—€(Åè#L–+X¤
1[R9fdB²¤I:Rx¼ZÆü%bÇ|&k®t™ž
|A „°˜Œn’x`™œ¸Ÿ„ĦÏÜ®•Ü"µ3ˆ½	
ˆ(Å–ðÏy°!Õ	Úˆ,ݼÞãÈéŒôð€´"õÁp"û7Ì!	Ì´0	Ï"crt0.onm68.ofork.ofprintf.oatoi.ofopen.ocreat.ofseek.odup.opipe.oprintf.ordwr.oscanf.odoscan.oatof.octype_.ofilbuf.oldexp.ostrlen.oexecl.oexecv.oexecve.olseek.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.oungetc.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_argnum_namelist_filename_infile_filhdr_cflag_gflag_nflag_fflag_oflag_pflag_rflag_uflag_dflag_hflag_offset_sortname_e1_e2_e3_e4_e5_e6_e7_e8_e9_e10_e11_e12_procargs_startup_nm_nextname_cleanup_procflags_newname_atoi_error__iob_fprintf_fatal_pipeline_malloc_pipe_fork_close_dup_execl_copytospace_printf_fopen_fread_nmf_fclose_fseek_sscanf__filbuf_strlencerror__doprnt__lastbuf_creat_open_errno_lseek_fflush_dup2_fwrite__flsbuf_scanf__doscan_fscanf__sctab__ctype___getccl__innum_ungetc__instr_atof_ldexp_read_execv_execve_write_isatty__sobuf__cleanup_free__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brkAAAAAABBBBBB ÿÿÿÿÿÿÿˆ,ˆ,sumacc/cc41/ccom68-   755      0     12      277565  3472711321   7225 ô`ÜÅ”Â^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØóûïýÝPûïHï¼ݬݬݬÝÝÝ!ûïÒnÝÝÝÝݬݬûï¹nÐP[ЬPÑP4ÑP
ÑP6ÑPH
ßïzûïÚÐ[Pݬûï-hÐP«ìЬ«åÑïøOÏ
ßïLûïèÙÐïÞOPЬ@ïØOÖïÎOÑïxq
ßï1ûï´ÙÐï~pÿñ
Àïê
Ðïppÿß
ÀïØ
ÐïbpÿÍ
ÀïÆ
ÐïTpÿ»
Àï´
Ôï>pÂï£
Ðï
PÐ`ï)pÂïŽ
Ðïˆ
PÒ¬QËQïpQÉQ`ïpÂïl
Ðïf
PÐ`ïêoÂïW
ÐïQ
PÐ`ïÑoݬûïbtÐP¬Ѽßïßï”ûïƒØÑï®o qåÑï¡opy
ßïûï­ØЬPРÿoûïÌyÐïtoQÐP¡ÝPûïžyÀï_oݬûï	ÚxïGoPÕà¤qßï=ßïQûïû×Ñï&o qåûïjyxï
oQÐPá¤qÝPûï8yÑïönpy
ßï ûïØàqï×nPÇPïÊnÐïÈnPΠÀï¼n€Â^ÁïªnP~@ï®n[Ð[WÃï›nX7Ð[Y'Ñi©ÁYWÐi­üÐgiЭügЩ­øЧ©Эø§ÀYÑYXÔÐWXÐ[WÑ[XÄÁ[ZÑjªøÐj­øÝ­øßïûï
×ÀZÑZï1nÙÃ[ï(nPÇP~Ã[~ûïH~Ã[PÐPï
n€žÎÌþ^´ÍÎþÎïbÔï`´ï^ÞÍÒþZÞï·uYÀZÞmPÑZPßï;ûïâ8ÐP°ÍÎþjÀYÐïÐLi2ÍÎþP°@ï«ùÍÌþ±ÍÌþü1ŒÕïþûï1ÐPïîÔïæ2ÍÌþPÀïÛP÷PÍÌþ[±ÍÌþ•R2ÍÌþP°@ï*ðÍÌþ2ÍÌþP2@ïçþPÑPï§-ÎïžÐïDLïCL°ÍÌþÍÎþµïŽ17ÿ·ïƒ1.ÿ2ÍÎþP°@ïÍÌþ±ÍÌþþÿWÕïZûïÐPïJÔïBÞïDïXÀX±hÿÿö±¨ÍÎþîÀXµh2hPÑPïí°¨ÍÌþÔPµÍÌþ2ïPÏP$77­2ÍÌþP2@ï¸üPÀPPÂPZÐY[2ÍÌþP2@ï¢üPxPPÂPYÁYPÐ`ïkK°ÍÌþÍÐþ2ÍÌþP°@ïûÍÌþ2ÍÌþP2@ï•úP2jQÀQPÖP÷PÍÒþ±ÍÒþ•)2ÍÒþP°@ïâîÍÎþ2ÍÎþP2ÍÌþQÎQQ2@ï—ýPÑPQ2ÍÌþP2@ïIúP°@ï±îÍÎþ2ÍÐþPÏP®_üüðo6ëýiwëýðoëýëý”4ëý±¨ÈîëýøëýëýDQq‘ëýëý—£D¯¾Ýëýëýäø€ž©ëý¶>N[d~†>N[d†‘ÈÏööëýëýžëýëý0HXaëýëýëýkwëýëýëýëýëý‘›êAëýXNl±j¹	4	_	
ëýëýëýëý_
Œ
™
±
ü
1_÷pÐäëýëýƒ
A
ÿƒ



ƒ
A
/
•
©
ƒ
ƒ
½
½
½
½
½
½
½
½
É
à
ƒ
ëýè
ú
ú
>Eiu­²ÊØç@Ð;†Ebkƒ>[d†‹1Šüßïäûïw5ÖïÅ÷ïÂ`2jP2@ïFöPÀP÷PÍÌþ4±ÍÌþ•+2ÍÌþP2@ïöìP±@ïºû2ÍÌþP°@ïÝìÍÎþ1!ü2jP°@ïùõÍÌþÂZÂYÞÍÔþPÑZP–1üÕïEõÎï<1üÔïûsÔïùs1àûÑïìsÐPÐPÝPÝkÝ«üûïïDÝPûïª%1µûÕïÅs
ßïûï¢ÒÕï´sÈï¯s˜a»ôûï‘-1‚ûÔïŽs˜a»ø1tûÐïƒs1jûûïYvÝûïâr1WûÝÝÝûïÐ÷ÿÿÐPï=HÔïOs1:ûÝÝÝûï³÷ÿÿÐPï H1#ûÝÐkPÝ ЫøPÝ ûï_CЫøQÐP¡˜a»1ýúÐkïs1óúÝÐkPÝ ЫüPÝ ûï/CЫüQÎÐkPÝ ЫüPÝ ЫøPÝ ûïCЫøQÐP¡˜a»Ð»»ü1§úÝ«ðûïK01mÿÝÝkûïs.ÐPï‚GÐï¤rï£r1zúÝÝÿÿÿÿûïA/ÐPï^GÐïƒr1ZúÝÝkâÝkûïï.1HúÐkïkrÝ«øêÝ«üÝkûï.1ÿÝkÝÿÿÿÿûïô.ÐPïGÔï7r1úÝ«üÝkâÔïrÔï!r˜a»ü1óùÑïÿqÔïöqnÐï*êPÖï#êÝPßïOÿßï‘ûïÎÚÝïÌqÝßï|ûï"ÝPûï>HÝPÝÝûï5öÿÿÝPÝkûï¸BÝPûïs#ßïÿûïèÐÔï”q1fþÝïwqÝkÝ«üûï‡BÝPûïB#1ÅþЫøï?F1BùÝïNqÝkÝ«ðÕàïPq
ßïÜþûïÐÏÕk	Ñk@ßïÝþûï¶ÏÐkÉ@k~Ý«øÝ«ôûïBÝPûï×"ÔïÙE1Üøàï÷p
ßï±þûïwÏÝ«øÝÿÿÿÿÝkßïèpûï‡>ÈÝÝkÝ
ûï@õÿÿ1pýÝÝ«øÝHéÝÝ«øÝ6àÕ«ü
ßïzþûïéÏÝ«üÝ«ôâÝkÝݾЫüïWE1ZøÕïjp
ßïeþûïõÎÝÝ«øÝÝûïÕôÿÿÝPÝHûïÆôÿÿ1þÝÝ«üÜÐï;pÅ«üP•@ïCp1øÅ«üPÐ àì{1õ÷Ýkûïþ01…ýÝïõoÝkÝ«üûïAÐPkÝPûï½!ÐkPÝ ûïx31»÷ÝkÝ«üûïÝ@ÝPûïn?1£÷Ýï¯oûïlC1ÄûÝkûïx8ûïK71€÷Ýkûïe81t÷ûï³;1j÷ßï¡ýûïÑÎ1Z÷ûï';1P÷×ï`oÑïZoÔïQoÝïKoûïÞFÂïqÿÐïkÿPÐ`ïcºÂï\ÿÐïVÿPÐ`ïRº1÷Ñïoûïã)ÖïoÑï/ÿ€q
ßï9ýûïÓÍÐïºÿÿÀï	ÿÐïºÿþþÀï÷þ1ªöÝ«üûïg1öÑ«üÿÿÿÿóÝ«üûï£nÐïœn1öÝïOdûï¤mÝï>dûïnàï8dàï0d	ÐïhnÔï`nÝûïÛóÿÿ1:öÝï
dûïGnáïdÐï8nÝ«èûï2[ÝPÝÝ«øÝLûïFHÝPÝmûï7HÝPûïTfÝï´cûïõm„Ýï©cûïæmáïŸcÐï×mÕ«ø
Ý«øûïfÝ«ôûïÖlÝïpcûï±màïjc´áïbc18ÿ1,ÿÕï•m
ÝïEcûïžlÝ«üûï|mûïƒôÿÿÝï'cûïhmàï!càïcÐïQmÝ1îþÑïþbÿÿÿÿßï‘ûûïÈËÕï*m
ÝïÚbûï3lÈïÔbÕï&ýOÔïm1éôÑï¹bÿÿÿÿßïVûûïË
ÝïbûïòkÈï“bÈïÎlÝïðüûïÕkÕï·l©ßï&ûûïÌšÐïØ·ï×·ÝÝÝûïºFÐPWѧ ÅﺷPÝàè{ßïþúûïËЧPïPPÊPï§QÉQP§Ý«üÝWÝ$ûïqFÐPWݧûï´Ì˜agÝݧÝlûïNFÝPûïkdÈïlÝï8üûïk1öþÝÝÝ4ÝÝÝaûïA_ÐPWЫüï·Ðï·§ÝÝWûï¥Îï·PÅïû¶Q÷Páü{Åïì¶PÝàô{1âþÝÝÝ4ÝÝÝaûïå^ÐPWЫü§ÝÝWûïT1ÖüÝ«üûïWñÿÿ1ÉüÐïekûïÒñÿÿÈïa1:óûïeðÿÿÕïGk
ßïñùûï’ÊûïKkÐPïâ`ûï=kÐPïØ`ûï/kÐPïî?ÝP1_üûïkÐPïÛ?ÝPûïöWÝPÝ«üÝmûïEÝPûï)c11üÕïÎjûïßjÐPïž?ÝPûïÍiÎïŒ?Ý«ø1üûûï·ïÿÿÕï™j
ßï[ùûïäÉÑ»üЫüPÕ Ðï4`ûï‡jÐPï"`ÝPûï]jÐïVjûïijÐPï`Ñï`
Ý«üûï±Ê1òÝïä_ûï)WÝPÝ«üÝmûï?DÝP1MûÕ«ôÝ«ôûïQbÕï÷i
ßïÑøûïBÉûïùîÿÿûïôiÐPï_ûïæiÐPï}_ûïØiÐPï—>ÝPûï®iÐï§iÕ«ü1mÿÈïX_1{ñûï¦îÿÿûï¡iÐPï8_ÝÝÝÝÝ«üûï&\ÝPÝlûï‹CÝPûï¨aûïiiÐPï(>ÝPûïWhûïðÿÿ1)üÐï7iï
>Ôï,i1öÝkûï¢\ÐPïñ=Ыüïi1ìðÐ;«ü~Ñï*õ`sÑïõUhÑïõJÑïõATÑïõ	Ñï÷ôBÑïîô$ÑïåôÑïÜôÑïÓô	ÑïÊôÕïµø
ßïƒ÷ûïÜÇÝkÝ«øÝ«üûïŸB1)õÑïšô£Ñï‘ôܘÑï†ôÑï}ôÈ„ÝkÝ«ôÁ«ø~ÂÝkÝ«øÝûïZBÝPÝ«ðÝ«ßïF÷”ÝûïUÝPÝ«üÝk‘ÝÝkÁ«ü~†ÐkPËÏÿÿÿ PÑP ÐkPËÏÿÿÿ PÑP0Óßï!÷ûï+ÇÐkïª<1­ïÝÝk1CÿÝûï»TÝPÝkÑ«üNÐPÐ	PÝP1"ÿÝkûï“^1IôÝkÝ«øÝoûïªAÐPïW<˜a°˜aÿJ<ÐïD<PРï;<1>ïÝ«ü¹ÝÝ«üÝ«ôÝûïnAÝPÝ
1ÁþÝÝ«üÝH1³þÝ«üÝ«øÝF1¤þÑ«üD-Ý«øûï˜SÕP
ßïmöûïÅÝÝ«øÝûïAÐP«øÐkï²ÝÝÝûïÿ@ÝPÝ«øÝE1KþÐkïú±Õï´fXÅïë±PÕàì{HÅïÛ±PÝàè{ßï'öûïåÅÝÝÝÝÝÝaûïÊYÐPWÐ隣§ÝÝWûï6ÝÝÝûï}@ÐPï*;ÎPÅkQ÷Páü{1îÝûï0SÐPï;Ðïc± Ðï÷:P2@ ÕkÔÝûïosÐïÝ:QÐP¡ÐïÒ:PС 1ÏíÝÝÝûï@ÐPïµ:pï± 1°íûï,1yòÝkÝ«üûïÈ6ÐPï:Ðÿ†:1ŽóÝÿÿÿÿ1õÝÝÿÿÿÿÝÝûï
êÿÿÝP1ÐôÝÝ«ô1ÈôÅ«üPÕàì{*ÝÝÝ$ÝÝÝaûï¬XÐPWЫü§ÝÝWûïЫüïw°ÝÝÝûïZ?ÐPï:Îïa°PÅïU°Q1ÖþЬ[á[ ï[~ßïõßïÁþûïæÍÞï´þPÐKïõPÂ^Ô­üûïAÃÐPï^ãÐ[1þÐK¼Z‘j-ÖZ‘jXpÐK¼P‘`-1ÝЭüPÖ­üÑPÑPìÑ­üvÞï8PtÑPe\ÑPi+ÑPtBÑPxÖïwôÑPdËÖïûÖï
ûÖZ•jt˜jPÑPb×ÖïªæÖï®ÞÖïªÖÞï²7PÝPÑ­ü	Þï÷PÞï÷PÝPÝK¼ûïÜÆÕP ÝK¼ßïöößïˆ7ûïÍÇÝûïx×Ö[Ñ[¬1ùþݬݬûïrÔ[Å[PÐàì{ò [íûïPûï3ÃûïàÄÐï¿®Ôïa8Ðïb8Ð ïc8Ð ïd8˜@ï`8Ð ïQ8ÐïB8Ðï_8Ðï\8Ð ïY8Ð ïV8Ðï8Ðï$cûïÙêÿÿûï$ÕïlÐPÔPÝPûïfÕïTÐPÔPЬ[2¬PÁZQ2AïgàRÈPR÷RAï[à˜‹ZàЬ[ЬZÐï<àYö[i×ï:6Ðï66PÖï/6˜`PšPP
ßï6ûïÊÐP[Á[PÒZQ2@ïàPÊQP
ÑYWù¶ÖY¯ßïì5Ý[ûïÓÖÁYPÐPïÐß”`ÝßïfõûïEÿÿÿÝßïõûï6ÿÿÿÝßï‰õûï'ÿÿÿÝßï‘õûïÿÿÿÝßï‰õûï	ÿÿÿ¨ ïÞßÔZÞïôòJïzàó€ZìÞïàò[À[2kPÖPÐ[@ïYàµkìÞïKõY˜‰PÖPÞï½ò@ï;à•iëÞïbõY˜‰PÖPÞï§ò@ïà•iëÞïNõY˜‰PÖPÞï‘ò@ïÿß•iëûïRÔY×ïà4ÐïÜ4PÖïÕ4˜`PšPP
ßïÃ4ûï¬ÈÐP[ÑPï¾á8Ð[PÑPÿÿÿÿÑP
XÑP\d1ýxZPÈï=¬P1ßïÈôûï~¿Ñï~á"1oÕï–®14Õ¬	ÑY¬1ŽÝûï<(1‚ßï™ôûï@¿Öï䫺×ï,4Ðï(4PÖï!4˜`PšPP
ßï4ûïøÇÐP[ÑP61Û1	ÑP21Î1îÑP01Á1¯ÑP
1@Ö1çþÐ
Z14ÐZ1.Ð	Z1(ÐZ1"ßï¯3ûï˜ÇÐP[Á[P³@ï™ÝVxZPÃ0[QÉQPZ×ï…3Ðï3PÖïz3˜`PšPP
ßïh3ûïQÇÐP[Á[P³@ïRÝxZPÃ0[QÉQPZ1±ßï;3Ý[ûï"Ô1ŸÑP11‘ÑP3øÃ0[Z×ï31^ÿÐï3PÖï
3˜`PšPP1UÿÑP4ÖÏÑP5ÏYÑPn1ÿ#ÑPb1ÿÑP78ªÑPf-ÐZ+ÑPt1ñþÑPrÐ
ZÑPv1ÛþÐ[ZÐZZÑï–ß'˜ZZÕY1êýÐZPÐPï'ª?Õ+Õ¬ÑY¬ÝZûïG&!ÑY¬ßïÂòûï
¾ÝYšZ~ûï"bÖY1GýÐYPÖYÝPÝûï
bÝYÝÿÿÿÿûïþaÐï\3PÐY@ïW38ÕY
ßïšòûïò¼ÑYÕïyîÕïmîÑY
ßïŒòûï˼
ÑP
IÑP*L×ï°1Ðï¬1PÖï¥1˜`PšPP
ßï“1ûï|ÅÐP[ÑPÿÿÿÿÀßïdòûïy¼Öï©´×ïd1Ðï`1PÖïY1˜`PšPP
ßïG1ûï0ÅÐP[ÑP/ßï11Ý[ûïÒ1oÿÂ^×ï1Ðï1PÖï1˜`PšPP
ßïü0ûïåÄÐP[ÖPxPPÐàhúZ2ªPÏPGX&any˜#ï³qrÑ#(K¾ÿbÝ[ßïsòûïþ»ßïŠòûïñ»1wÿÝ[ßï‡ñûï»ßÞïwÖïrÚÝÝ[ûïúÿÿûïðÐP[Ð[PÕ[19ÿáïÍ\˜@PÓï¿\ÐPÔPÝPßï*Öûïi
ÝPûï3ÐP­üÅPPž@ï›\Y‘©
0Õï‚\(Ðïv\ïu\2©~2©~Ý©ûïÃàÿÿÐPï,1Ð!PéïR\	ÐïG\PÔPÐPï?\Эüï1ÐPÔïe§Þï£ÕïžÙÝÝ[ûïGùÿÿ×ï•/Ðï‘/PÖïŠ/˜`PšPP
ßïx/ûïaÃÐP[ÑP.1×ÑPE1ÑPXÑPeëÑPx1{‘ï.Õ0•ï&Õ
ßï>ðûï$ºÝÝ[ûï¿øÿÿÞïÕXGxï·¦ﲦ˜hPá@ïh.˜hPÂ0P˜hPá@ïT.˜hPÂ7P
˜hPÂWPÀPïy¦ÖX•hµÓÿÿïh¦1rÐïô/1nÐï£.PÖïœ.˜`PšPP1pÝÝ[ûï0øÿÿ×ï~.Ðïz.PÖïs.˜`PšPP
ßïa.ûïJÂÐP[ÑPe	Ñ[Eg×ï?.Ðï;.PÖï4.˜`PšPP
ßï".ûïÂÐP[ÑP+Ñ[-eÿþ×Öïø×ßïø-Ý[ûïßΘe[ÝÝ[ûïŒ÷ÿÿßïØ-Ý[ûï¿ÎßïÁÓûï^hßï»-Ý[ûï¢Î‘ï¤Ó0+ÞïœÓX•h1ÜþxïH¥ïC¥˜hPÂ0PÀPï6¥ÖXÜÞïpÓXÅ
ï"¥P˜hQÀQPÃ0Pï¥ÖX•häËÿ省ø
Ñ­ø€ÿÿ1ŽþÔïƒ.×ï1-1‡þßï&-ûïÁÐP[ÑPL	Ñ[l	ÐïO.ßïû,Ý[ûïâÍÐP×ïè,Ðïä,PÖïÝ,˜`PšPP
ßïË,ûï´ÀÐP[Á[P³@ïµÖ!ßï­,Ý[ûï”ÍÞï–Òï‘ÖÝÝ.1þÐïYßï…,Ý[ûïlÍ2ªïÀ-2ªPÐ"ïtÙÐPÐ'ïiÙÔï¤Ýûïd÷ÿÿÔï”-1SÿÔXÑXI×ï4,Ðï0,PÖï),˜`PšPP
ßï,ûïÀÐP­øÑP`ÑP
6ßï&íûï÷¶”HïâÑÑX
ßï%íûïÞ¶ßï:íûïѶ1zÿö­øHï·ÑÖX1wÿ×ï´+Ðï°+PÖï©+˜`PšPP
ßï—+ûÐP[ÑP*1úþûïºùÿÿ1\úÖï%£ûïÔ1Lú×ïe+Ðïa+PÖïZ+˜`PšPP
ßïH+ûï1¿ÐP[ÑP=1«þ˜Qïz,ÐP×ï$+Ðï +PÖï+˜`PšPP
ßï+ûïð¾ÐP[ÑP-˜Oï<,ÐPÑ[>1YþÐïYW˜Eï!,Ð P×ïË*ÐïÇ*PÖïÀ*˜`PšPP
ßï®*ûï—¾ÐP[ÑP+1þ˜Nïà+¢×ïŒ*Ðïˆ*PÖï*˜`PšPP
ßïo*ûïX¾ÐP[ÑP&1ÒýÐï¢+Ðïœ+P×ïH*ÐïD*PÖï=*˜`PšPP
ßï+*ûï¾ÐP[ÑP|1ŠýÐïZ+¶×ï*Ðï*PÖïû)˜`PšPP
ßïé)ûïÒ½ÐP[ÑP<˜@ï+ÐPÑ[=1;ý˜Rï
+ÐP×ï´)Ðï°)PÖï©)˜`PšPP
ßï—)ûÐP[ÑP>
˜BïÌ*¬Ñ[=1ëü˜Tïº*®×ïf)Ðïb)PÖï[)˜`PšPP
ßïI)ûï2½ÐP[ÑP='1”ÑP+(1jÑP&1¡1RÑP%1‹1ˆü˜PïW*1ÚýÐïM*ÐPÐ	ïB*×ïð(Ðïì(PÖïå(˜`PšPP
ßïÓ(ûï¼¼ÐP[ÖPÀPP³#à`ù
ßï7êûïx´ßï¨(Ý[ûïÉœÐïâ)žÐ=ïÙ)ŠÐ?ïÐ)ÐïÇ)1wÿÐï½)1mÿÐï³)1cÿ×ï^(ÐïZ(PÖïS(˜`PšPP
ßïA(ûï*¼ÐP[ÑP<Ý[ßïÖéûï)³˜Aïg)1ÿ×ï(Ðï(PÖï(˜`PšPP
ßïõ'ûïÞ»ÐP[ÑP>Ý[ßï—éûïݲ˜Cï)1ËþÑP*1'ÿ16ûÑP/1%ÿÑP-1²þ1!ûÑP<1@ÿ1ûÑP^1'ÿÑP>1sÿ1ýúÑP|1ÿ1îú˜ïhÍZàJïÜ&ÎPÐZPÏPa0€…Š”™ñÿžñÿñÿ£ñÿñÿñÿñÿñÿ¨­²¸¾ÄÁÔ[~Kï¢åYÐiP˜`PÑPZ¬ÝißïÍûï/ÇÕP#2©PÏPj‘¡­¿Ïßßïùèûï4²ÀYºÐ[­Ð[¨Ð[£Ð	[žÐ[™Ð[”Ð[Ð[ŠÐ[…Ð[€Ð[1zÿÐÿÐ[1nÿÐ[1hÿÐïÿRïþR2©~Ý2©~ûïM×ÿÿÐPï¶'Ð!P2©ïª'Ðï¤'P2©ïš'Ð"PÐï¿RÐïˆ'Ð#PÐï­RÐïv'ìÐïRÐ1ïf'ºÐï‰ãÞïÌïþÏÝÝ ûï§ïÿÿ×ïõ%Ðïñ%PÖïê%˜`PšPP
ßïØ%ûïÁ¹ÑP(EÞï¾Ëï¹ÏÝÝ ûïbïÿÿ×ï°%Ðï¬%PÖï¥%˜`PšPP
ßï“%ûï|¹ÑP"Gßï‚çû1ÚÑ[
ëÑ[ÿÿÿÿâ×ïs%Ðïo%PÖïh%ö[`ßïY%Ý[ûïXÃ×ï:%Ðï6%PÖï/%˜`PšPP
ßï%ûï¹ÐP[ÑP"—ÞïËïûÎÝÝ ûï¤îÿÿ×ïò$Ðïî$PÖïç$˜`PšPP
ßïÕ$ûᄌÑP)1?ÿ×ïÐ$ÐïÌ$PÖïÅ$ö
`ßï¶$Ý
ûïµÂÔP×ï’$ÐïŽ$PÖï‡$˜`PšPP
ßïu$ûï^¸ÐP[ÑP#Ñ[ÿÿÿÿßïW$Ý[ûï>ÅÞï?Êï:ÎÝÝ ûïãíÿÿÔZ×ï/$7ßï'$ûï¸;Ðï$PÖï$˜`PšPPsÅ
ZPÀ[PÃ0PZ×ïø#ÉÐïô#PÖïí#˜`PšPPÐP[àKïM#ÎßïÑ#Ý[ûï¸ÄÐZïq›Þï³Éï®ÍÝÝ ûïWíÿÿ×ï¥#…ßï#ûÐP[ÑP
1óþÞï©ßY2ö[i×ïy#Ðïu#PÖïn#˜`PšPP
ßï\#ûïE·ÐP[ÖYÑ[
É”i1®þЬ[Ý[ûï+¸ÁPZÑZï@Ð>2ï5ÐÑZï.ÐÐZï%ÐÝïÐûïlÄÐPï
ÐÕP
ßïåûïD®ÝZÝ[ÝïòÏûïã·ÐïåÏ[ÀZïÝÏÂZïÚÏÐ[PÂ^ЬYÔZxZP˜‰QÁPQZ•iñïZPÇõPQÄõQÃQP­øЬYÞï›Ï­ü1©Õ½ü5ÝõÝûÐPX
ßï¢äûï°­ÐX½üÁÔXPЭüQÐP¡x­øPÁ½üP[ÐZÕk!ЭüPÑ ÷LÖ ÝYûïÓþÿÿÐPkÐkP‘»iÝYÝkûï-ÂÕPçxZPÀP[ÀZЭüPÑ[ ÂÔ[ÑZõ¢À­üÑ­ühý1Jÿßïäûï­Â0^Õ¬Ѭ˜É
ѬXõ
ßï×äûïä¬Ð¬PР­ü
ßïÊäûï̬Å­üPž@ïðM[Õï•äIÝ­üÝkßï¬äûï³Ð¬PÝ ûï7¯Ýï¥MЬPÝ Ý ݬûïèÿÿÝPßï†äûïV³Ý¬ݬûïùЬPР­øÝ­øݬûïA!ÐP¬Ы­ô˜«	­äÕïälßï[äûï³Ý­øûᆴݬûïèÿÿÝPßïFäûïí²ßï?äûïà²Ý­ôûݭä2«~2«~˜«~ûïÜçÿÿÝPßï"äûﱲѭô •«KÕ­ô	Ñ­ô1ïÑï¾L4Ñ­ô.ЬPÏP&&&&&&&à¬Ýkßïçãûï!«ÕïIã
ßï0äûïF²Õ­øÝkßï-äûïøªÐ­ø«ö¬«öïNL«	2'Ø«÷ï„—«Ѭ
Ѭ	Ѭ1÷ï!«ÝûïÑÿÿÝÿÿÿÿûïóÐÿÿÝûïêÐÿÿÝ­üûïàÐÿÿ1ùÝÝï¬~Ý[ûï¤Ý­üûïš1Ñ­ø­ô172«­ìЬPР­èЭø­à/ЭèPЭìQÐ@ï“ Aï Ö­ìÖ­èxþ­àPÊPï­àQÉQP­àÓ0­àBËÏÿÿÿ­àPÑP0ØЭìPÕ@ïT °Ð­èPÕ@ïG ¸Ð­ìPЭèQÑ@ï6 Aï0 ¡1«Ñ­àÑ­à	Ñ­à
 ЬP2«QÑQ Ѭ
ѬѬy˜«­ðÕïÊáÝ­ðûïæåÿÿÝPßïgâûï»°á¬"ÝÝï¬~Ý[ûï‘ÕP7Ý­üûïƒЬPÏP$¢Ö$¶ì]$×]×'<׌/ѬѬà¬1àˆ «
Ãï)˜PÞ@ïÉ•­ÜÕ½Ü1³Å½ÜP‘@ï{J
îŽÜP‘@ïlJߎÜPá@ï^JÐk­ØŽÜPÐàè{­ÔÑ­Ø­Ô1]­ܫЭðPÏP+%zÿ+zÿzÿzÿzÿzÿzÿzÿzÿ+zÿzÿ+%1UÿÕ­äøÑ­ðÑ­ðêÕïÐIâö«ËÏÿÿÿ­øPÑP Эüïð”Ñ­ðÑ­ð»Ñ­ð´ö«Ý«ûï–IÑ­ð¬žÑ­ðÑ­ð‘Ñ­ðŠö«ËÏÿÿÿ­øPÑP ЭüÑ­ð¬1½þßï_IÝ[ûï$ÕPêѬ1jþÔïCI1aþÑ­ð¬1ŽþÐï0IPÖï)IÑ«PêÝ­üûïÇ1nþÑ­ð÷ö«ËÏÿÿÿ­øPÑP Эüï”Ñ­ð¬Õ2«PÕ@ï»ÈÑ­ðÑ­ð»ÝkßïEàûïJ§ß­üûï ÐP[1üÑïšH­äDѬ>Ѭ8Ѭ2ѬÑ­ä&Ý[ûïk!ÐP­üЬPЭü Å­üPž@ïrH[1ËûÝkßïíßûïݦѬËÏÿÿÿ­øPÑP Эüïc“ï­øPÑP
ÑP	ÑP
ЬP÷ «
ï­øP÷P«ЬP÷ «á¬1öûЬPÏPC¡TäTww²""²""¡"Ó¡ÕïƒÞÝ«2«~2«~ßïßûïu­ßïÎ’Ý[ûïsÎûï¦GÐP«ËÏÿÿÿ­øPÑP µÐ­ü朗«ûïƒGÐP«ö«	Ѭ–ÝûïÀFÝ«ûïHGûïYGÐP«”«	1pÿßï?GÝ[ûïѬ17ûÔï'G1.ûÐïG«ÖïG1ûËÏÿÿÿ­øPÑPOxøï!’PÁP«Âï’Ëÿï’PËÿï}”QÑPQjšïq”ïl”ËÿïÝ‘PJšïÔ‘«šïÌ‘P×PËÿムQÉQPﵑšï¯‘Pšï,”QÑPQÊÿPÈPï
”ÑïKF1„þˆ«
1}þÑïê“–
ßï'Þûï¥ÐïГPЬ@ïn‘ÖïÀ“Ñï2Öÿÿÿÿûï"FÔïöEûï¦ÔïÝEÎï
ÖÐïÖï;Ðï‰;ï€;Ôï‚;ÕïøDÑïäÕøo
ßïºÝûÕïJ“
ßï²Ýûïs¤ÕïI;
ßï³Ýûï^¤Þï˜9ï›ÕÔï“Ôï2ïŠÐï„ï“ÐïDEÔï;Þï;ïû:Ýûï˜D˜@ïÒ’ÑïÜÛ
ßïRÝûïتÔ[1‡ÐKïTZ{ÅZPž@ïEYÑï«Û(ÝZÝißï(ÝûݩûïQ¦ßïÝûѩ)ÝÝÝÝÝÝaûïõ7ÐPXÐZ¨Ý	ÝXûïeöÿÿßï;’ÝYûï\Ö[Ñ[ï%’1mÿûïéOÝûïÎCÝûï£CÖï¡Ýïû‘ßïûïpEÔïè‘ŬPž@ï@D[ЫPÏP
2˜ ÐïDï
D2«~ÝÝ«ûïZÈÿÿÝÝÝÝÝÝaûï,7ÐPZЬªá¬ÐP
á¬Ð	PÐ
PÐPªá¬Ð
P
á¬ÐPÐPÝPÝZûïiõÿÿ†á¬1~ÿᬕ1vÿÓ¬Œ1mÿÝÝÝÝÝÝaûï³6ÐP[Ь«Õ¬ÝÝ[ûïõÿÿÝïDCûïóüÿÿÝï'CûïæüÿÿÝï2CûïÙüÿÿÔï%CЬïCÝÝÝÝÝÝaûïL6ÐP[Ь«ÑïðBÐïÖBЫլ<Ý
/ÑïÓBÐï¹BÐ	«Õ¬ÝÐï¥BÐ
«Õ¬ÝÝ[ûïqôÿÿЫ¬ݬûïHüÿÿլŬP÷ïºàü{ÃïPÀÂ^Á¬PÐ@ï³Z7Ðï6­üÝûï+ÇÿÿÝÿÿÿÿûïÇÿÿÝûïÇÿÿÎïk~ûïÇÿÿÅZP2àú{­üÕïÓØ*Ý­üÕZ
ÅZPÐàè{PÞïlÚPÝPßïDÚûﳧáïäAÐPáï×AÐ	PÐ
PÐP­øЬPÐ@ïïºAÐï´Aï³AÁPPÐ@ïôŒïAÁ­üPÐïp@ïnÐYÔ­ðЭð­ôÁ¬Z1ÎÐJïÄŒWÝWûïFÆÿÿÕW	ÑW 
ßïËÙûï0 ÅWPž@ïUA[Ñ­ø
Ñ«­ðЫ­ðÑ«­ôЫ­ô÷­ü«p2«~Ý«ûïyÐPX᫘«PïPV2«~2«~Ý«ûïÐPVÕVÝkßïhÙûï( ÑVï×@ÐVïÎ@ÇXYPÄXPÃPYP
ÇXYPÖPÅXPYÖZÑZïNŽ1&ÿÝÿÿÿÿûïpÅÿÿÇYï•@PÄYPÃPïŠ@PÇYï€@PÖPÅYPïu@Ñ­ø
7ЭìÝ­ìÝÝ­ìûïlÐPïU@Ý­ìÝ­ìûï¨ÐPYÁ­üPÐY@ïÕï2@
ßïÕØû艹ЭüPÐï@@ïëÁ­üPÐY@ïÞÁ¬PÁ­üQÐ@ï=‹AïÇÑïÖ1ŠÁ­üPÝ@ï¯Á­üPÝ@ï£Á­üPÝ@ï—ЭüPÝ@ïŒÁP~Á­ü~Á­ü~Ý­üßï]Øû	ïV¥Á­üPÐ@ïbZ%ÝJïXÅJïPPÝàè{ßïOØûï$¥ÖZÕJï3ÒÁ¬PÐ@ï•ŠïH?ЬïàŒÝ­üÝÝ­øûïÃÿÿݬûïªûïûøÿÿŬPÐàì{PÑP@ÑPÑP6ÑP ŬPÝàè{ßï××ûïbŬPŸ@ïØ>ûï±ÐP¬Å¬PÐàì{ŬPö	@ï¼>ݬûïPøÿÿЬ[ЬZ(Ñ[#Ñ[Ñ[Ñ[Ñ[Ñ[

Ý[ûïBÔYÑP0ÀYÑY3Ð[PÃY QïYQPPÊÏÿÿÿPÑPàÑPÑP ÑßïM×ûïÐPï[PÏP
+óÿóÿóÿóÿóÿóÿ+óÿóÿóÿÕÁZPÐ@ïÎPÐPÂ^ЭøÔ­üЬPíü Qï­üQPPÊÏÿÿÿPÑP2ÑPÑP ßïøÖûx­øPÑP0ЬPÄ@ït­øÖ¬À­üÑ­ü©Ð¬PÕ@ïZßïÙÖûïù›Ð PЬPÅ­ø@ï:PÂ^ÑÑïöŠ¬
ßï¬ÖûïœÐïߊ­üÇ ­üPxPPÃP­üPÇ ­üPÖPxP­üÑ­ü¬Ãï´Š¬[Ý[ûïâIÃï¡Š­ü[Ý[ûïÏIÃPÇ P[Ý[ûï¯@ÃïyŠ¬[Ý[ûï§IÑïgŠ¬
ßï<Öûï‚›Â^ÐïIŠ­üǬ­üPĬPÃP­üPǬ­üPÖPŬP­üÝ­üûïÿÿÿÑï ÓݬßïóÕûï¢Å¬Pž@ïQ<[˜«ï4¿Ñï"<	Ñï<Ðï¿Ðï¿PÏPFGGFÔ憎Ôï´ÒÔïâ¾Ý2«~2«~Ý«ݬûïKËÏÿÿÿ«PÑP0ÐPÐPÐPïxÒÝPûï
;2«~Ý«ûïýÿÿÝPûïÔ:Ý[ûï©>‰Õï<ÒݬݬݬݬݬßïÕûï&¡ÕïP¾
Þïà¼ïC¾À$ï:¾Ðï4¾PÔ Ðï*¾PЬ Ðï¾PЬ Ðï¾PЬ Ðï¾PЬ Ðïú½PÔ ѬÁ¬PÐ@ïÌPÔPÐïÙ½QÐP¡ÐïνPЬ  ËÏÿÿÿ¬PÑP0.ݬÁ¬~ЬPïPPÊPï¬QÉQP~ûïµüÿÿÐPÿŽ½/ŬPá@ïŸ:ŬP˜@ï’:PïPPÎPÿe½Ôÿ]½Ñï[½	ÑïR½!ËÏÿÿÿ¬PÑP0Ѭ
ßï	ÔûïÀ˜ËÏÿÿÿ¬PÑP0ЬPïPPÊPï¬QÉQP¬Ö¬1…þѬPÐïó¼PРPÐ@ïϬŬPž@ïñ9[‘«à«
ßïÅÓû礼Ы¬2«¬2«¬À«¬1/þÑ祿Ñ1ÐPÑ Ñ |Ñïx¼hýoÐïk¼PËÏÿÿÿ ðPÑP0ZÐï‡ûïÐïH¼PÝ  ûïíûÿÿÃ$ï6¼PÑPhýÐï&¼PРìPÐ@ïPÔPÝPûï²×ÿÿûï1ÔPÕï¼	ÝûïYüÿÿÕïç8ÐPÐPÝPûïF8ÐPZûïè8ÐP[ÝPûïÂ8Ôï|†ÝûïY×ÿÿÕï©8	ÐïuÏPÐZPÝPûï8ÝÝÝûïµÐPYÎ[©ÐYPݬûïv%ÐP[ÝÝ[ûï@DÝ[ûïטûïè€ÕïÏÝïþ…ßïWÒûïžÐï3»PÑP1©ÑPøÑPóÞ﮹ï»Ðï»PР[РZРYРXËÏÿÿÿ[PÑP0qÐJïÎWÝÿߺûï@ûÿÿÇÿÒºXÑWXÝYÝZÝ[ûïÚùÿÿÝPûïaúÿÿÐWXÕWÑWX
ßïÑÑûï.–ÕX
ßïÖÑûïá–ÐXJïg!Ñ[Ñ[	2ÝYÝZÝ[ûï…ùÿÿÝPûïúÿÿÔï…ÝûïµúÿÿÔï…ÔïEºÑXÉßï•ÑûïÄ•ЀЬ[Õï$º1¤Ñïº	Ñïºßï}Ñûï’•Îïù¹1{Ñïð¹	Ñïç¹=ûïµ9ÐïÓ¹PРï‚Ý[ÝÝÝûïçÝPÝ:ûïÜÐP[Ý[ûïö.Õ[ÕïdÍßï,Ñûï•1ÑïHÍÝ[ßïÑûï>œÐïh¹PРWРYРXÕÿU¹	ÎÿM¹ZÝXÝYÝWûï]øÿÿÐPZÐï4¹PÝ  ûïÙøÿÿÝ[ÝXÝYÝWÝÝÝûïj)ÝPÝ:ûï5ÐP[˜a»Ы«Ô«Ý«ûïE0ÐP«Ñ»˜a»ЫPР«˜nkÑZ #Ñ»ßïuÐûïQ”;ÝZÝ«ûï‰A-Ñ»ÝZЫPp ~ûïüAÝZÝ[ûïÝ/ÝPûï^BûïÝ[ûïê•Â^Ñïa¸hýÐïS¸PÕ ÖïÌÂ$ï@¸Ðï:¸PР[Ñ[PÖ РZÐJï

X¸ÅXPž@ï,5­üЭüPÐï¸QÁ¡  ~ЭüP2 ~ЭüP2 ~ЭüPÝ ÝXûïeùÿÿËÏÿÿÿ[PÑP01iÿÐïÊ·PÖ РYÐï¼·PРPÑY@ï—	
Ñ立hýÍÐÿš·­øÐï’·PÅ­øYQÁQ  ~Ðï·PÝ Á ~Ðïr·PРPïPPÊPÐï_·Qï¡QÉQP~ÐïN·PÝ 1_ÿÂ^Ðï;·­ü Ðï1·PÕ 
ßïïÎûï´’Â$ï·Ñï·hý-Ðï·PР[Ñ[
ËÏÿÿÿ[PÑP0ÏÐïç¶PÕ ªÐ ЭüïÕ¶Õï”ÊÝïtßï’ÎûÕï}Ê×ïuÊÂ$ÑhýÐPÕ àÔ ûïþÿÿЬ[ЬZÐjYÇ[YPÄ[PÃPYP
Ç[YPÖPÅ[PYÃYïå±PÑP¬ÑïL3ßï1ÎßïBÎûï’Á¬YjÐYP€Â^Ь[ЬZ2«~Ý«ûïwôÿÿÐPYÐjXÐX­ü2«~2«~Ý«ûïõÿÿÐPW‘«@ÃXïo±PÑPW
ßïòÍûï°‘ÁWX­üÇY­üPÄYPÃP­üPÇY­üPÖPÅYP­üέüX:‘«	‘«ÑW ß­üÝÝ ûïÿÿÿÐPXÃW­üXß­üÝYÝWûïïþÿÿÐPX‘«Ñ«'ØÿÿÐX«ЭüjÔPÑX«óÐPÂ^Ь[Õ¬
ЬPРPЫPÐPXÕ¬}ЬPРPÏP¨°µw¨°µÕ¬1˜ßï&ÍûïyÐZ1•ÇZïæ1PÄZPÃPïÛ1PÇZïÑ1PÖPÅZPïÆ1Õ¬
ßïÍûï:ÔPЫP…Õ¬
ЬPРP2«PÐP­üÁPPÐ@ïaZЭüPÐ@ïUY"ÐZÐZYÐZöÐZ
Ý«ûïp5ÐPZÐ YѬYßï‹ÌûïËÐY¬Õ¬1LÿÇZï21PÄZPÃPï'1PÀ¬PÑPY'ÇZï1PÄZPÃPï1PÇZï1PÖPÅZPïö0Õ¬*Ãïë0ïj¯PÑP¬
ßï6ÌûïªÀ¬ïÊ01ÿѬ Ñ«ï¹0É@¬P˜«QÑQPÐPÐï›0«Ãï“0ï¯PÑP¬
ßïòËûïRÀ¬ïr0ÐX«Ý[ûï‹41®þÔZÐï@0[?Ñï;0Ð[1Õï-0Õï10ßï¶Ëûïûï­=ÐP[Ñ[ÐZÝ[ݬûïÒáÿÿÑ[Ñ[ЬPÝ ûï‚óÿÿûï‰÷ÿÿÕZЬPÝ ûïk=Â^Ь­ôЬ­øЬ­üЭèÔ­ðЭìÔ[Ñ[aÐK­ôPÏP9K=K=K/ßïËûïŽÐPÑ­èéЭèÖ[µÑ­ìÛÐK­ô­ìîÕ­ðÎÐK­ô­ðáÕ­ðЭðÑ­ìЭì­ðÑ­è6Á
­ðPÑ­ðÑ­èšÑ­ì”Ñ­ìÐPÐPÑ­ðÂÑ­ì¼1vÿЭðPѼ!
ßï˜Êûï¿Õ¬ÔPÑïÅÝßï&ݬûïjЬPЬQР¡ЬPÐï ݬûï‘ЬPЬQР¡ЬPР[РZ1ËÏÿÿÿ[PÑP0ÐZPÖZÝ@ïEûï:³ÿÿï[PÊPï[QÉQP[Ó0[ÊЬPÝ ûïž;ЬQÐP¡ЬPï PÐP[ÑPÑ[	
Ñ[
ЬPÐ[ ЬPЬ[ÐkZ˜akÑZË«PxPPÈPï«QÉQPXÑZHÀXÑZ6À XЫPРY˜a»ЫPÐX Ý«ûï¢ÿÿÿÑZ6	ÝYûïx²ÿÿЫPР«ЫPР«€Ь[ЫYËÏÿÿÿYPÐPW!ïYPÊPïYQÉQPZÐWXËÏÿÿÿZPÐPW>Õ¬Ñï6-
Óï8-Ð	¬Ѭ	Ѭ1™Ñï-ôÑYFÐY1…ÑX0
ÑW ßïÀÈÑX ÑW0ÑW ßïÇÈûïo‹ÔYïZPÊPïZQ1nÿËÏÿÿÿYPÑP0Ö« Y0ËÏÿÿÿYPÑP #ßï¤Èûïò‹ËYPxPPÈPïYQÈQPÐPYÕï„,0ËÏÿÿÿYPÑP #ßï’ÈûïöŠËYPxPPÈPïYQÈQPÐPYÐY«Ь[ÐPÑ[ÐPÑ[ÐPÐ[PÕ¬=áï,Ь/áï,Ь!Õïõ+ЬÑïç+Ð	¬Ð¬ËÏÿÿÿ¬PÑP =ЬPÏP155$5$$$$$$$55$$55ßïðÇûï-ŠÐ¬á¬àï+
ßïõÇûïŠÐ¬PЬPÏPÖóÿóÿfóÿÖÖEèóÿ5óÿóÿýóÿUýóÿݬßïwÈûï Šàï8+¶ßï³Ç§àï(+¦ßï±Ç—Óï+•ßï®Ç†Õïü*ßï¬ÇûÑïç*NÐ	PËÏÿÿÿ¬PÑPïïvPÑP×ݬûïH6ÕPÉ1>ÿšïåuPÑPºÝ¬ûï+6ÕP¬1!ÿÐPÑïŒ*ðßïXÇ1ÿÑïz*1ÿþßïQÇ1ïþËÏÿÿÿ¬PÑP 	ßïHÇ1ØþЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑP ËÏÿÿÿ¬PÑP0ËÏÿÿÿ¬PÑP1›þßï&Ç1‹þÂ^м[Å[Pž@ï*Z)ò [Ô[Þïû)ZÀZÑ[¼
ßïÇûﲈѪÑö!ª
Ðj­üżPÐàè{­øżPÐàè{jÕïaÀÝ[ݼÝ­øßïéÆûïVÐ[¼ÐZPÂ^Ñï7ÀÝïr)Ýïp)ݬݬßïÛÆûï!Ô­üЬ­üÇ ­üPÄ PÂP­üЭü­ôÅ­ôPž@ï<)YÑ©ö¬©
ЬiÔ©”©ЭüP˜©
PʼÿÿÿPÑP¬Ði[ЬZÑ[ZÞò ­üÔ­üÞïò(YÀYÑ­ü­ôªßïvÆû輻›Ь[˜«
P˼ÿÿÿP~Ýkûï%ÿÿÿÄPž@ï±(ZժЪÐZPÑZ[÷ѪñÀZÑZèÆéÞï†(Zà€Ðï¢sXûïx+Þïl(Z	ѪÀZÑZèÆîßïúÅûï‡ÐZ[Ñ«ÔW1·2«ï\sÎïTsïOs˜«	PÑP¬tÕ«‘«ѬÐXï-sÝkßï¸Åûït†	Ý[ûïõ*Õ#˜«	~˜«
~Ãè{[PÇP~ÝkßïÅûïxá«
	Ý[ûïBЫÐW$ÕW Ý[ûïÆþÿÿÐPYÑP[Ý[ÝYûï/ЫÀ[Ñ[èÆÞïs'[Ñ[Z1#ÿÐXï‹rûïj*Â^Ь[ЬZЪ«ª«ª	«	Ъ«ª
«
°ª«°ª«°ª«ÐjkЬ[Á[ZÀZÑZèÆÞï'ZÑZ[
ßïíÄûᅤѪÕÝ[ÝZûï„ÿÿÿˆ«
˜«
PʾÿÿÿPÈPöPª
ÕïζÝkßïÁÄûïó…ÕïW½%Ãè{ZPÇP~Ãè{[PÇP~ßï¶Äûï<ŒÃè{ZPÆPÐPï–qЬ[˜«
P˾ÿÿÿPYÐ[ZÑZè{	Þï4qZÂZÑZ[G˜ª
PʾÿÿÿPÑPYÖÑkjÑŠª
Õïμ%Ãè{[PÇP~Ãè{ZPÇP~ßï?ÄûﳋßïNÄûdÀÂ$^Ь[ЬZÕïAÄÝZÝ[ЬPÝ@︨ßï>Äûïs‹Ð¬PËñÿÿÿ@ï[ªVÑVWÑkRÑP
*ÑPLÑPM1èÕ
ßï
ÄûﳄÝ[ݬÝ[ûï[ÕP
1¾Ñkr««Ð[PѬ
ìѬ0Ñk+˜ak˜ajÕ«ݪûЪPݪûï{…ЪPѬѬ
Ñk1´ÑjøÑV1"ÑkøÑjóЬPÑPS11¶ÑP1€8ÑP1‹ÑPöÑP}1ÑPu1	ÑPmÑPf1úÑPI1òÑPBRÑP>KÑP<D1ØÑP@81ÌÑPQÑPP1µÑPRôÕïP´
ßïêÂûïwƒÝZݬÝ[ûï
ÕP͘aj1ÊþÑPWÉ!ÑPU¾ÑPT³]ÑPV¨RÑPYÑPX>ÑPm3…ÑV,ÑkÑk"ÑjÑjЬPÑPiÑPdÑP_ÑP<ZÝÝÝÝZÝ[ݬûïÈÐPYÝYûï8ÐPWáWÝ©ûïãÕP
ßï@ÂûïÚàW1ŠÝ©ûïÐP©1ŒÑkn««ÑjnªªÐkЫЫ«˜ajЬPÑPÑPÑPÑP<1gÿ`ª«1«ýbª«1£ýdª«1›ýqªïQÁßï«ÁûïT1ýfª«1yýèWÐVPÑP1hÿÑP^áWѬoÕגּ	ÝYûï{á
WÝÝÝÝ©ûï%ÐP©áWÝÝÝÝ©ûï
ÐP©ÓW1áWЩPÝ©ûïÐP©1ôþЩPÐPXШ©Ш©Ш©áWÝÝYûïæÐPYá	WÝÝYûïÐÐPYáWÝYûïÐPYá
WÝYûï¬ÐPYàW1šÐ©[ЩZЬPÑP@1±1‡ÑP1û1ÑP11¿ÑP1Û1‹ÑP1—Åï±lPž@ï…!­üЭüPÕ mݽüßïqÀûïèЩЩ©Щ©Ðïzl©Ô©ÝÝYûïÓÿÿáWÝYûïKÐPYÝYûï‡)ÐPYÕÝßïFÝYûï¯ÐYPЭüPР©ЭüP2 ©ЭüP2 ©Ô©Ðï
l©Ñ©›2@©ЭüPР©Ô©Ð
©Ði€ÐiÐ2©Ô©Î©Ðï~õ©Ð©1cÿԩԩЩԩЩ1OÿЪ­ð!Å­ðPÀè{PÐP­ü‘ ‘ à ßït¿ûïÞ~1OÅ­ðPà@ïZ 1®Ñ«Ñ«ñÁ«PêÁ«PÐ@ïýô­àЭàPÐ@ïðô­ÜUÅ­ÜPÐàè{­èÅ­ðPÐàè{­ìÑ喝Ý­èÝ­ìßï ¿ûïž…Å­ÜPá@ïã4Ñ­ì­è-ЭܭðЭðªÕ­Ü1±Å­ðPÝàè{ßïñ¾ûï%~1–Ö­à1sÿÑ«,Ñ«&Å­ðPá@ï	ßïؾ1ÿßï¿ûï°~^Á«­ìßï"¿ûï'~GЫPïPPÊPï«QÉQP~ЭìPÝ@ïôÝ­ðûïÕPÅ­ðPÝàè{ßïö¾ûïP~ÝYûïõ	ÐPY1¹ýßï¿ûïp}1©ý˜akÐkiЫYË«PxPPÈPï«QÉQP©Ы©Ы©1zýÐkPÑPÔÑP
ÄÑP0ÑP;ªÝÝ«Ýûï¯øÿÿÐP­ø˜akÐkiÝ­øÝ«Ý;ûï•øÿÿ1yÿÝЫPÝ Ýûï€øÿÿÐP­øÝЫPÝ ÝûïjøÿÿÐP­ô˜a»лkÐkiÝ­øÝ­ôÝûïKøÿÿÝPݫݦÐ
iÐ[©Ô©1ÛüÑ«ªößï]¾1ÿÑPԩЩ1¼üÑPÜݬßïy¾ûï½|1¤üÑP
èÑk˜akÐkiЫYËÏÿÿÿ«PÑP
ßï¹½ûï8|ЫPïPPÊP1ÓþÑP$¢ÑP:¢Ñ«ª
ß︽ûï	|ÝÝZÝûï’÷ÿÿÐPZЪ­ìЪ­èЪ­äÝ­äÝ­èÝ­ìÝZÝ[ÝbûïÐP[Ѭ$1ÿ˜aiÐ[Y1öûÑPE1›ü^ÑPBGÑPA1ÿЩPÝ ЩPÝ ЩPÝ ûïßÿÿÑP 1­ûÝÝÝÝ©ûïƒÐP©1–ûÑPC¼1ÓþÑPH"1ÑPF1¹þÝ©ûïúÐPZÐZ©ËÏÿÿÿ«PÑP
ßïô¼ûï{ЫPïPPÊPï«QÉQP©ËÏÿÿÿ©PÑP 
ßïÓ¼ûïÖzЩPïPPÊPï©QÉQP©Ы©Ы©Ñk>Ñ»8ЫPÕ /ЫPÑ @!ЫPÅ P˜@ï
­ðÑ­ðÑ­ðÀiÑ©	Ñ©	1ŸúÀiË©PxPPÈPï©QÉQP©ÝÝYÝ
1:ýÑPo1þ1¶ýЬ[Ñk8 Ý«ûïëÿÿÿÐP«Ý«ûïÝÿÿÿÐP«Ð[PÑ«Ñ«	:Ý«Ý«Ý«ÝÝ[ÝcûïŸÐP[ÝÝ«ÝûïdõÿÿÐP«Ý[ûï#'Ñ«Ñ«Ñ«Ñ«
žÝÝÝÝ[ûïº
ÐP[ŠÂ^Ñïµ±ݬݬŬPÝàè{ßï‚»ûЬ­ü1¥ßï»ûïOyÔPÑ­ø¬1·Å­øPÐàì{PÑPrѬqÕﳪiÅ­øPÝàì{Å­øP2àú{PÖPÝ@ïUïݬûïgÿÿÿÕP;Å­øPÐàè{P‘`$•Å¬PÝàè{Å­øPÝàè{ßï »ûï…y4ÑP	‰Ö­üЭüPÐ@ïþî­ø1VÿÑ­ø 1LÿßïÚºûïÝxÐPÂ^Ь[ЬZЪ­ôÑ«Ñ«ѪѪÐPÔPÐP­øÕP,ѬRѬSѬT
ѬUÀ¬Ñ«@
Ѫ@ÔPѪ@ѬíÑ«@ѬѬ×ЬPÑPR1è1ÌÑP<X1ˆÑPG1iÑP61!ÑPŸÀ­ô«Ñ«@Ъ«Ъ«
ßïºûï„wÐP­ô«õÄ­ô«îÕ­ôÜÆ­ô«âÕ­ôßïä¹ÎЫPÇ­ôPQÄ­ôQÃQP«ÁÒ­ôPÊP«·È­ô«°Ì­ô«©Ð­ô­üx­ü««›Ð­ô­üέüPxP««ŠÎ««ƒÒ««1{ÿÕ«aÐP^Ñ«­ôôSÑ«­ôëJÑ«­ôâAÑ«­ôÙ8íô«P0Ííô«P&Ãíô«P¹Ã­ô«P¯Ñ«­ô	¦Ñ«­ôŸÔPÐP«1ÿÑP
1zÿ1xþÑP18ÿ1mþÑP@1AÿÑP>1þþ1TþÑPB16ÿ1EþÑP1ÿÃÑP1ÿ10þÑPL12ÿµÑPP1zÿÑPM1ÿ1þÑPQ1fÿ1öýÑPV10ÿ,ÑPT1ÿÑPS1æþ1ËýÑPU1éþ1¼ýÑPX1ÿÑPW1Þþ1ŸýÑPY1íþ1ýÀЬ[ЫPРYЫPРXÑY
ÑX
sÐkPÓ@ ÑkPÑkQßïî·ûïPuÑY
ÑX
ЫPЫQÑ ¡ÑX
лPÓ@ïV›ÐkPÝ@ßïÄ·ûïÎuËÏÿÿÿYPÑP
ËÏÿÿÿYPÑP0ЫZЫZËÏÿÿÿªPÑP&ËÏÿÿÿªPÑP0ÑjÕª1ûÝ[ßï‹·1éЫPРWЫPРVÑYXЫPЫQÑ ¡Ý[ßïl·ûï¾ËÏÿÿÿYPÑP0ËÏÿÿÿYPÑP1ËÏÿÿÿXPÑP0
ËÏÿÿÿXPÑPvËÏÿÿÿYPÑP0&ËÏÿÿÿXPÑP0ÑGïwêFïqê
Ý[ßï·ŽËÏÿÿÿYPÑP0ÖWËÏÿÿÿXPÑP0ÖVxþYPÊPïYQÉQPYxþXPÊPïXQÉQPX1/ÿÝ[ßï̶ûïž®œ^Ь[ÐkPÝ@ï˜ݬßﯶ߭œûï÷}ß­œûïStÂ^Ь[ЫPÅ Pž@ï÷Z˜a»˜akÝ«ûï§ÐP[ËÏÿÿÿ«PÑPЫ˪PxPPÈPïªQÉQP­ü2ª­ø2ª­ôÝ­ôÝ­øÝ­üÝ[ûï;ÐP[Ъ­è˜ª­ðá­ð;ЪPÏPÖáìÖáìßï	¶ûï*sÇ­ì­èPÅ­ìP­èÕ­èDÝ­ôÝ­øÝ­üÝÝÝÝ­ôÝ­øÝ­üÝ­èûïÓÝPûï¾ÝPÝ[ÝûïOÝPûïbÐP[ÝÝ[Ý
ûïîÿÿÐP[á­ð;2ª~ÝݪÝÝ[ÝgûïÐP[Ç­ìªPÄ­ìPÃPªPxPPï­ðQÉQP«Ý[ûïЭìЭô1FÿЭìЭô1;ÿЭìЭô10ÿЬ[ÑP^aÑP_<ÑPgЫ[ÐkPÑP'ÑP
ÔÑ»bÐPÑ»fòÑ»dèËÏÿÿÿ«PÑP0ÚËÏÿÿÿ«PÑP ÌÔPÝÝÝÝÝÝûï=ÐP[Ñ«€ÿÿÿѫЫѫ€ÿÿÑ«ÿÐ«Ð«Ь«2@«Ý[ûï
Ь[Ý«Ý«Ý«Ý[ûï
ÝPûï9ЬPËÏÿÿÿ PÑPßï3´ûïépÐ PЬPÝ Ý РPïPPÊPЬQï¡QÉQP~ûïDÔÿÿЬ[ѬЫPЫPÐPZÝÝÝѬЫPЫPÝPûïLÿÿÿÝPÝZÝjûï'ÐPYÝYûï7ÐPYѬÐY«ÐY«Ð[PЬ[ï«PÐPZÑP
ÑZkЫPÑ@ïnæÐZ)ЫPÑ@ï[æ ÐZЫPÑ@ïHæÐZÐZÝZûï¸ÐPZÐZ«Ë«PÈZPÐP«ÑkÑZ	ЫЫ«Ь[ËÏÿÿÿ«PÑP0(ЫPïPPÊPï«QÉQP«Ö«ÝÝ[ÝûïëÿÿËÏÿÿÿ«PÑP äÐ[PЬ[ÐkPÑPvÑPP<ÑPQ3ÑPR.ÑPS%ÑPTÑPUÝkßït²ûïkoÐ[PЫPÑ 
ЫPÑ ЫPÑ ÞЫPÑ ÔÀkÏÝÝÝÝ«ûï¬ýÿÿÝPÝ[Ýkûï‡ÝPûïšÂ$^Ь[Ðk­ðЫPР­üЭü­ôЫPР­øЫPР­èЫPР­ìЫPР­àЫPР­äЭðPÑP1ˆÑP1­ÑP$.ÑP:)ÑPo ËÏÿÿÿ­üPÑP1˜Ð­ø­ôЭì­èЭä­àÝ­àÝ­èÝ­ôÝ«ûï<ÐP«Ý­àÝ­èÝ­ôÝ«ûï%ÐP«Ñ­ðЭô«Эè«Эà«Ý[ûï½Ý«ûïÌüÿÿÐP­ÜÝ«ûï¾üÿÿÑP­Ü•ßï%±ûïµm†Ñ­ü­ø÷ßï+±èËÏÿÿÿ­øPÑP1fÿÝ­àÝ­ôûï`ÐÿÿÐP­ÜÝ­äÝ­øûïOÐÿÿÑP­ÜÙЭø­ô15ÿÀÂ^Ь[ÐkVЫPРZЫPРYÕZÕYÑVo
ßïË°ûï,mÔ­üÑZÑZЭüÂ
ZÑYÑYЭüÂ
YÓFï1“1ÐZPÏP%>A3ÐX.ÑYÐPÐPÐPXÐYXÑZßÑZÚÑYÕÑYÐÐXÓFïß’
ЫPРWÐZXÕ­üÑXÑXÁ
XPÐXPÐPWÑXZÝWÝÝWÝ«ûïÐP«ÑXY	ÑVoÝWÝÝWÝ«ûïnÐP«ÓFïr’ЫPР«ЫPР«ЫPР«ÓFïK’ЫÐW«Ô«ÐX«Õïö«ÝWÝYÝFïeÝZÝ[ßûïsÐ[PЬ[Ñ«
Ñk	Ý[ûï„ûÿÿѬ«Ь«Ь«Ð[PÓ0¬ݬݬݬÝÝ[ÝiûïOÑk4ѬѬ(ÐkÑ«Ñ«n««Ь«Ы«Ý[ûï2ݬݬݬÝÝ[ÝhªЬ[ЬZûïmlÐPYЬiÐ[©ÐZ©Ь©Ь©Ь©ÐYPÂ^Ь[ÑkßïÍ®ûïñjЭüЫ­üÑ­ü«
ßïÀ®ûïÒjÝ[ûï¯lЭüPÔ[мXËñÿÿÿHïâPÑP1ÑP1ÿÐXPÏPm****vWhW0FH*NQ=NQNQ©½CCÜÜÜÜÜÜÜÜÜÜÜöÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜCÜö©FHNQS?S?Ü·*Ü*ÜÜÜC8WW\\\\\\ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ4CCÝHï#Žßﶭûï¤iÐPЬPРPÝ ûï”ÐPYÐY[ЬPРPÝ ûï|ÐPZÒZPÊP[1Ëþ2PáZ¨ÐPèZùŸ2PÔPá[’Ð Pè[ù‰é[†2 PàZáY2Pá[š Pá[2Pà[öáZЬPÑ°2$PáY¸Ð¬PÑ°®2DPáY2PÐP2Pà[£à[…á[2PéZ
áY2
@PáZ	éY2 Pà[1ìþ2Pá[2EPÑXoÕZÐ$Pá[˜dPàZáY2GPÕ[ÁáZ2BPá[³˜fPé[«2DPá[¡˜`Pè[ø1…þà[ñáZõéYò2D"Pá[2‚PàYÞá[1ÍþáZ	éY2"PèZ1LþáYù2APЬPÏP FBQQQQUUMMIIQQQQBBBBBBBBBBBBBBBBFÐPÔPÐ PÐPÐPÐPÂ^Ь[Ý«Ý«Ý«ûïËÿÿÇP­üÝ[ûïUiÕ­ü
ßï–«ûï!hÝ­üûïÁõÿÿЬ[Á¬¼м¼ßï|«ûïln¬ѬéÕ¬
ßïb«ûïPnÐkPËñÿÿÿ@ï9ZÐkPÝ@ïn‹Ý[ßï>«ûï'nÑZ Ý«ßï2«ûïnÝ«ßï%«ûïnÝ«ûï°iÝ«Ý«ßï«ûïåmßï¯ÛûïâzÂ^Ь[ÑkIÝûï]Ýûï2ûïùÐP­üÝPûïÒÝ@p«~ûï)Ô«έüPÐP«Ð«ÐkЬ[Õï2¦ÝßïÜþÿÿÝ[ûïEhÕï‰ßï~ªûïÔfÐïsÝ[ûïÀÐP[ßï[ÿÿÿÝ[ûïphÝûï½Ý[ûïŠÝ[ûï¹g ^Ь[ÐkPËñÿÿÿ@ïì‹ZÐkPÑP;ÑP6ÑP^1ÛÑPb1—ÑPcôÑPdëÑPf|1¾Ñ«@QÞïã©«"Å«PÝàè{ûïþÐPYÝYûï´hÐP«2 «ÑZ
Ý«ûïYÿÿÿÑZ
Ý«ûïJÿÿÿÕ«´Î«~ß߭àûï`oß­à²Ð«PÝ ЫPÝ ÝûïpÈÿÿÀPÇP«ЫPÝ Ýûï¨ÇÿÿÆPÐP«…Ý«Ý«ûïr_Þï5©«1mÿѼ81ЬPÝ ûïêÿÿÿЬQÐP¡ЬPÝ ûïÔÿÿÿЬQÐP¡ЬPЬPËÏÿÿÿ PÑPÝݬÝ
ûïçßÿÿÐP¬ÚݬûïÂ^Ь[ï«PÐP­ôÑP
ÑP	Ý[ûïÚóÿÿÕÐ[PÐkZËñÿÿÿJï1ŠYÑYçÑYÝ«ûïªÿÿÿÐP«Ý«ûïœÿÿÿÐP«ÐZPÑPQ1²1iÑPB1ÑP	1Ã1æÑP1¶1ÎÑP‰1—Ý[ûïk
Ý«ûïÚþÿÿÐP«1kÿÑ»
ßï¨ûï¼cÝ«ûïDÕPÜлЫPЫ ЫPЫ ЫPЫ ˜akЫPÑ»®Ð»ÐÝ«ûï€ÕP1ÿЫPΠPЫQÐP¡ÐkÐkZÝ«ûïYÕPÑ»Ñ»Ы­üЫ«Эü«Ñ»Z3Ы­ðЫ­üЭüPР­ìР­èÐP«ЭüPЭð ЭüPЭì Эè«ÑZDÑ»>Ñ»8ЫPÑ°.ЫPÝ ÝÝ«ûïëéÿÿÕPЫP˜a°˜a»ЫPР«Ñ»'Ñ»Z!ЫPÑ°ЫPÝ ÝZÝ«ûï§éÿÿÕP¼Ñ»?Ñ»9Ý«ÝZÝ«ûïˆéÿÿÕP&˜a»Ý«Ý«Ý«Ý«ûïöÿÿÐP«˜akÝ«1NþÑZÑZ
ÑZÑZÝ«ûï(ÕP	ЫPÕ ¯ÑZGÝ«ûïÕP9ЫPÝ ûïÈÐP­ø%ÕP„˜@kÐkZЫPРЫQР¡ЫPЭø ÑZ1SýÝ«ûï½ÕPïЫPÕ æЫPΠPЫQÐP¡ÐkÐkZ1#ýÝ«ûïÕPïЫPÑ 1ÿ1ýÑ»÷Ы­üЫ«Эü«ÃPkP2@ï}¥k1ÝüÝ«ûïGÕPïЫPÕ 1Ëþ1ÀüÑP1¢ý1µüÑP
1‹ýÑP1´ý1 üÑP1©ý1•üÑP³ÑP¬ÑP1ý1|üÑP1…ý1qüÑPI1éüÑP<18ÿ1XüÑPP1Gÿ1IüÑPX18ÿQÑPUò&ÑPSçÑPRÜ1üÑPT1ÿ1
üÑPW1ùþ1ùûÑPV1èþ1êûÑPh1XüÑPY1Ëþ1ÍûÑPi1;ü1¾ûլìPÒPPËP¬PÎPÔ[	xÿ¬¬Ö[ѬñÐ[PѼЬPÑ @ÐPÔPѬï
‘Õï¤Ýïúßï¤	ݬßï¤ûï†fƬÕïð£Ѭ
ßï¤ûïcfѬïУЬPÐïã[ЬﺣЬPÏP77TTaßïî£ûï9_Ð[PÞïçÓßﮣûïfâÞïÍÓïl£Ñ[ÒÑ[Íßï’£ÚÐïO£¸ßï…£©Ý¬ß藍Ýï3£ûïäcÖï*£Ðï$£PÂ^Õï£1âÅï÷JPž@ïÏÿ[ÝïÜûï©ÿÿÿûï¼ÿÿÿÐPïÇûï®ÿÿÿÐPZßïA£ûïTeÝZßï?£ûïEe2«~2«~ЫPïPPÊPï«QÉQP~ûïpÁÿÿÇP­üÇ­üY
ßï£ûïeÐYP×YÕPêá­ü
ßï£ûïìdé­ü
ßï£ûïÛdÝZßï	£ûïÌdÝ­üÝZßï£ûïºdÔï$¢Ýï
ûïïýÿÿûï0Â^Ýûï.þÿÿÅïñIPž@ïÉþYÝYûïÑЩZxþZPÊPïZQÉQPZÑZÑZ	ÐPÔPÐPﺡûïþÿÿÐPÕïî„7ûïwþÿÿÐP­ôÝPßï‹¢ûïdßûï
dÝ­ôßûïýcÝïwIßï–¢ûïêcÝïdIÝï^IßûïÑcÔï‹„˜@­üÔ[1ªÅK¼Pž@ïüýY‘©wЩZö	©2'Ø©ß­üÝYûï¡ÊÿÿÑ©Ñ©b­ûÑ©Ñ©
w­ûl­ûÝJïm¦Ç©~˜­û~ßï"¢ûïKcxZPÈPï„ÐZ©ö©ß­üÝYûï8ÊÿÿÕP
ßï¢ûï1\Ö[Ñ[¬1MÿÇ­ü~ÝïƒHßïí¡ûïöbÇ ïKHPxPPÃPï?HPÇ ï5HPÖPxPï*HÝï(HÝïHûïßЬ[‘«Ýkûï
ÝPßï…¡ûï‚b‘«‘«	Ý«ûïœüÿÿÝkûïÕ	ÝPßïa¡ûïRbשּׁլ
Õ¬WßïD¡BÕ¬ßï9¡ßï9¡ÝïŸûïA`ݬßï%¡ÝïzŸûï+`Ѭßï¡ÝïaŸûï`Â^Õ¬Ð[×[
ßïê ûïÅaó¬[îЬ­üx­üPÀPï›IßïΠûïeZÐPÝïþFßïl‹ßï½ ßï\Ïûï¡_Â^ÐZ+ÐJ¼P‘`-ÐJ¼P‘ XÐJ¼P‘ pÐïùÖZÑZ¬ÏÝﳞûï|_ÝÝûïdÑPßï$ÝûïdÝÝûïöcÑPßïÝûïâcÝÝûï×cÑPßïæÝûïÃcßï ÝïCžûïŒ_ÐPïqÕP
ßïöŸûï¼Yݬݬûïç•ÿÿÐP­üÝïIßïèŸÝïžûïš]ÐPï/ÕP]×ÿ%ÐïPРQÖ ˜aPšPP
ÝïûïôaÐP[ÖP8×ïÎÐïÎPÖïüÍö[`´ßïíÍÝ[ûïìk£ßïoŸûïYÝïûïènЭüPÝïjûïÓnÝûïºmÀЬ[x¬PÀ[Pë`X1ŬPÑXPóѬíÕ«ЫPûïèùÿÿÐPWÕ«*ßïŸûï‰_Ý«ßïúžûïy_ßïðžûïl_ÝXßïæžûï]_ÝWßïåžûïN_ßïãžûïA_ßïãžûï4_ßïìžûï'_ûïjùÿÿÐPVÝPßïåžûï_ÐZЫY×Y2ÝVxZPÀ[PÑY`ÐZPÖZxPPÀ[PРPÐWPÝPßﲞûïÑ^ÖYÑZ¬ÆÕ«	ÝWûïëøÿÿÝݬÝÝ[ûïЬ[Õ¬ݬßûï^ì¬PÑP1‰Ã¬¬PxÿPPÁ¬PZßï[žûïb^xZPÀ[PÝ`ßïMžûïL^xZPÀ[PÝ ßï9žûï5^ûïxøÿÿÐPYÝPßï/žûï^ÝÃZ~ݬÝ[ûïbÿÿÿÝYݬÁZ~Ý[ûïPÿÿÿXЬZ×Z:ßïÿûïá]xZPÀ[PÝ`ßïñûïË]xZPÀ[PÝ ßïÝûï´]ñ¬Z¿ÿÕ«
Ý«ûïæöÿÿЬ[Ý[ݬÝݬÝÝÝûïëÿÿÝPÝoûïÌÑÿÿÐP[˜a»˜akЫP€Â^мYÐYPÑPh1™1ÁÑPT1å1¡ÑPR1Ô1ÑPЬPÕ 
Ñ @ЬPЬPÅ Pž@ï:÷[˜«PÏPâÿfâÿffâÿÎÝÝÝÝÝÝ^ûïDêÿÿÐPZÔª‘«ÐPÐPªÝÝÝݬÝZÝEûïêÿÿÝPûïÂáÿÿÐP¬1|ÿ•«	øЬPÔ ΫPЬQÐP¡1aÿ˜^¼ЬPÔ ЬPЫ 1IÿЬPРPËÏÿÿÿ PÑPЬPРPËÏÿÿÿ PÑPÑÀ¼1ÿЬPРPРWÑWÑW
ÑWÑW
ЬPÑ°˜h¼1äþЬPÐPQСQР¡ЬPÐPQСQР¡ЬPÐPQСQР¡˜a¼ЬPРPЬPÑ Ñ ÐPÔPÐPXЬPРPÑ ЬPРPÑ ÐPÔPÐPWÑXW1^þЬPРXРPРWЬPÑ°]РPР­üÐXPÏP'G9?ЬPРPÐX 1Yÿ˜­üPЬQСQÐP¡ßš­üPìï­üPä2­üPÞЬPÑ°Á1ÚýЬPÑ°Ýßï›ûïàS˜a¼ЬPÝ Ý ÑYjÐPÐ<PÝPûïûÎÿÿÑPS1Bþ1ˆýÑPU13þ1yýÑPj–ÑPi1Lþ1_ýÑPk1yÿ1PýÐPÔï¨?ЬPÏP((((((ËÏÿÿÿ¬PÑPÐPÔPÝûï5áÿÿÐP[Ǭ«Ð[PЬ[Áïì¬PÑP 
ßï-šûïëRx¬P×PÒPPËP«Pì QÂï½QxQPPÈPïµÀ¬ï©À¬ï‰A)ïï›~ßïó™ûï…Yxï†ïÂïvÑïpÎÁ\PÐP[Ѭ@:ï«Px«QÊÿÿQÈQPÝPïkPxkQÊÿÿQÉQP~ßï–™ûïY!ïkPxkQÊÿÿQÉQP~ßï‚™ûïúXÀ¬ïÞ@ݬûïXÀ¬ïÈ@Õ¬À¬ïÎŒÀ¬ï®@)ïïÀŒ~ßï=™ûïªXxï«Œ歷ÂÑï•ŒÎÔ[¼KÖ¬Ö[•¼í”KïxŒÞïrŒPï¬PÑP
ÑPЬPˬPÉP¬ïˬPÉP¬ãÐPÂ^ŬPž@ïeò[Ýkûï‡ÿÿÿÝPßûïX2«~2«~Ý«ûïB´ÿÿÐP­üÇP~ßûïÝWßï|˜ûïÐWѬlѬL
Ñï&=€ÐPÔPݬûïÈWpPï	=ÐPÕï¤ݬûïkêÿÿݬûï#ûï‡DÔYÐ[ÐK¼Z‘j-yÐYÖ[Ñ[¬ëûïÊRûïÏ?ÐYP1¬ÑPa6uÑPX1ƒÖZ•jú×Z61¢ÑPlÌÖïÃw Öï÷¡Öï‹ Öï‹¡Öï§wÖZÖZ•j„˜jPÑPs¸‘ªpßÖï^¡ßÖïb—×ÑPeÖïI—ÆÑPt­˜j~ßï¹—ûïžO«ÑPr‚ãÑPoÚÖïj—ÑPu§¾ÑPx¾Öïú–1rÿÕï
wßï€Ýï¤;ûïÐïÛ–ïòvÕïÄ–ÝßïlݬûïîPݬûïè*Ôï¼vݬûï°ÝÝݬûïHJûïMNЬï‚–Ðï|–ï“vЬï“vÑïq–ï0;Ðï\–ïwvÐï;ïT–ÔïJ–Ñï>–ïYvÐï1–ïLvûï±Çï;vPxPPÃPï/vPÇï%vPÖPxPïvûïëЬ[Ý[ûï?ÕPóÔï]vÝ[ûï¸ÝÝ[ûï»ÔZÝÝJïìuûï§ÖZÑZï,våЬ[ÐkZËñÿÿÿJïÓsYÑYÔPÑYÝ«ûïÓÿÿÿÐZPÑPíÑPèÑPãÑP;!Ý«ûï±ÿÿÿÕPÝ«ûï£ÿÿÿÕP'ÐP$Ý«ûïBÿÿÿЫXÝ«Ý[ûïøK˜ahÐPÔPЬ[ÐkZËñÿÿÿJïGsYÐZPÑPKYÑP;<ÑPÑPÑPøÑPFïÑY
Ý«ûï©ÿÿÿÑY
Ý«ûïšÿÿÿÑPHÇÍÑPIͺÑPd±lÑPNÑPL¬™ÑPO¡Ý[ûï|)ÕP”Ñïât‹Ý[ûïpKÐïÐtQÐPAïwtÖïÁtЫX˜a»ÝXÝ[ûïýJ˜ahÑPmŸ1FÿÑPfô1)ÿݬûï„Ôï tÕïæ“ßïq”ûï/SÝßïݬûïNݬûïŸÕïésÝïåsÝïÛsûᄁݬݬûï¯Â^á¬TѬ€ßï”ßï”ßï”ûï·R*Ѭ€ßѬ€ÝË€¬~ßïð“ûï‹RÔ­øÔ­ü9x­üPÒPPËP¬P'Õ­ø
ßïÑ“ûïaRÖ­øЭüPÝ@ï“ûïLRÖ­üЭüPÕ@ïþ’ºÂ^Ь­øûï]ݬûïYЬPÝ ÝPûïe.Õï	“9ݬßïi“ûï÷QÝ­øûïÿÿÿßï^“ûïàQÝßï2ݬûï´Lм[ËñÿÿÿKï¶pZÐ[YÐYPÑPK131ÑÑP;1&1£ÑP11ÑP1ä1	Р­ð1Ý­øݬûïÆ!ÐP­ø1ÃмPÝ@ïnßïó’ûïcJÝÝ­ôûïéýÿÿЬPЭðQР¡Ý­øÝ­ðûïÏýÿÿÝ­ðݬûï H˜a½ðè¬1JÝÝݬûïfEÑPX~ÑPHuÑPFBhÑPI7]ÑPlT!ÑPdIÑPL<ÑPf1ÑPm(Ý­øݬûïõ9ÐPYÑP1qÿÑY1ÿþЬPР­ôÑZ1æþÔ­ðÕï^‘EݬßïΑûïLPݬûïZýÿÿßïÑûï5PÝ­øûïCýÿÿÝIï\mßﱑûïPÐYPÑPN1©1ÛÑP1•1pÑP
1Ú1CÑP11.ÑP1qþÑ[^ôÝݬ1´ЬPР¬Ð¬Ь­øûïÞݬûïÚЬPÝ ÝPûïæ+ËP¬~ݬûïµ4ÕP1gýЭðPР[Ý[ÝÿÿÿÿÝ­ôûïg˜a½ð˜a¼ûïé2ÐPYÝPÝÿÿÿÿÝ­ôûï@ЬPЭðQСQР¡ÝЭðPÝ ûï½ûÿÿЭðPРPÉ PЭðQСQÐP¡ÝÝЭðPÝ ûïLCÝIûïw2ÐP­üÝPÝûïÝYûïo2ÝЭðPÝ ûïYûÿÿÝ­üûïU2˜^¼ЬPÔ ЭðPРPЬQР¡ЭðPРPЬQР¡ЭðPÝ ûïI1Nýûïÿ1ÐPYÝPÝÿÿÿÿݬûïV˜`¼ЬPÐY Ýݬûï÷ûÿÿ1ýѽô
Ý­øЭôPÝ ûï¡,1^þÝ
Ý­ôûïÎûÿÿ1Oþßï¹ûï¾FЬPÔ ˜K¼м[Ý­øݬûïàÕP1Àü1müЬPÔ ˜H¼м[Ý­øݬûï¹ÕP1™ü1FüЬPÔ ˜f¼м[Ý­øݬûï~ÕP1rü1üѬÝЬPÝ ûï2ûÿÿ1þÝ­øЬP1>ÿÝ­øݬûï6,ÕP1•ýé¬ѼNÐPÐ	PÐP¼1xýݬûïöDÐP­ôÝÝЬPÝ ûïvAЬPЭô ѼNÐPÐ	PÐP½ôѼNÐP«ÐP¦Ý­øݬûït-ÕP1ý1aûÝ­øݬûï=.ÕP1úüݬûïxDÐP­ðÐ:¼ÝÝЬPÝ ûïô@ЬPЭð ݬûï³ЬPÝ ÝPûï¿(ÕïcÝßï³ݬûï5GÝЭðPÝ ûïúÿÿÝÝ­ð1(þÝ­øݬûï-ÕP1mü1½úÝ­øݬûï7+ÕP1VüÐ[PÑP<5ÑPÑP
ÑP1‰úÁ[¼1.üÑPó1yúÑPëöÑPä1júÑP@ØÑP>Ñ1WúÑPBÅ1KúÑP‰1CúÑP1NüÑP
1þ1.úÑP1#ý1#úÑPH1ªý$ÑP;1%úÑP:1/ÿ1úÑPF1Žý1ñùÑPK1QýÑPI1Jý1ÔùÑPL1Åü1ÅùÑPg1îü,ÑPd1lýÑPb1%þ1šùÑPf1Hý1‹ùÑPm1mûÑPl1û1nùÑPn1Àü1_ùѼaݬݬûïâ/ÕPݬݬûïú3ÐPYÑPݬݬûïÕP1Áú1ùЬ[ÐkZËñÿÿÿJïWiPÐPYÑYÐZPÑPI1ô1ÍÑP.gÑP'XÑP
1ÿлPÓ@ïiïÝ
Ý«ûïÅ1âÝ«ûïXЫPÑ ï8kÐ[ïËj2ïÆjÝ«ûïðÑPÈ1§ÑPFx8ÑP;íÝ«ûï
ЫPÑ ïíjÐ[ï€j2ï{jÝ«ûïÿÿÿÑPHYÑPKPÖï²jHÑPfï4ÑPL1wÿÖÑPd&Ý«ûïÔþÿÿÝZÝ«ûïÖïrjÑPmÌÑYŒÐ»PÓ@ïhÝZÝ«ûïÁÑ«ïEj	Ý[ûï$Ý«ûï|þÿÿ1RÿЬ[ÐkPÑPÑPÑPÑPLÝ[ûïNþÿÿÝ«ûïÝ«ûïÁÿÿÿЬ[ÐkPÑPFMÑPHDÑPI;ÑPK2ÑPd)ÑPf ÐkPËñÿÿÿ@ïVgPÑP"ÑPÑPÖïƒiÝ«ûïÿÿÿЫ[Ь[Ñk8ݬÝ«ûïèÿÿÿЫ[ѬF
ѬdÔï:iÝ[ûïýÿÿÎZм[Ð[PÑPRv1±ÑP;1F1xÑP1Š1`ÑP1VÑP1õÝ Ý¬ûïLôÿÿÕ¬ÝIݬÝQûïOÕ¬15ÝIݬÕ¬1ÔP1Õ¬ÃP[PÐ@ïYˆ¼м[Ь¬Î¬ЬPÑ°1ÃРPÕ ôЬPРPРP•`äÐ[PÏPP	111111”w1Ñ[Y˜QP˜PPÐP¼ÐP[ЬPаPÓ@ïÌeÝ
ЬPÝ ûïlóÿÿÝ Ð¬PÝ ûï\óÿÿÝIݬÝ[ûïh=Ý Ð¬PÝ ûï8óÿÿÝIݬÝÚÝ Ð¬PÝ ЬPЬ Ý Ý¬ûïóÿÿÕ¬ÝIݬÝûïÝÝݬûï¤:Õ¬	ûïÏ)ЬPÐPZÝZÝÿÿÿÿЬPÝ ûïþÿÿݬݬЬPÝ ûïþÿÿÕ¬	ÝZûïž)˜a¼Õ¬	ûï|)ЬPÐPZÝÿÿÿÿÝZЬPÝ ûïÉýÿÿݬݬЬPÝ ûïµýÿÿÕ¬¶«Ý¬ݬЬPÝ ûïšýÿÿžÝЬPÝ ûï&òÿÿ˜a¼ݬݬЬPÝ ûïoýÿÿÕ¬	ûïö(ЬPÐPYÕ¬	ûïá(ЬPÐPXûïÑ(ÐPZÝPÝÿÿÿÿЬPÝ ûï$ýÿÿÝYÝXЬPРPÝ ûïýÿÿÝZûï©(ݬݬЬPРPÝ ûïíüÿÿÕ¬	ÝXûïƒ(Õ¬	ÝYûïu(ЬP˜a°1ËþЬPÑ 1þüÑ ÷Õ РP•`Õ¬1£þÝIݬÕ¬1þÝIݬÝûï41{þ˜PPÝP1þÑP1pþ1§üÑPP1àüÑPL1™þ1ŠüÑPQ1Ãü1{üÑPV1´ü&ÑPTòÑPSç1VüÑPU1ü1GüÑPX1€üÑPWò1-üÑPY1fü1üÖïˆdÐï‚dPÑP¬

ßï…ûï¿<Á¬¼м¼ßï“…ûïŠC¬ѬéЬP׬ÕP
ßïs…ûïhCмPÝ@ï•`ݬßï]…ûïMCмPÑPdÑP_ÑP^?ÑP_MÑPb]ÑPcTÑPdKÑPfBhßï0…ûïúB1ÌЬPРPÝ@ïô…ßïò„:ßïî„ûïÓBݬûï(ЬPÝ ßïЄûï³BЬPÝ ßïÅ„ûïŸBßï„ûï’BЬPÝ ûï<>ß彩ûïwBЬPÑ  1_ÿá ßï‘„ßï‘„ûïLBЬPË PÝ@ïD…ßïv„ûï+BЬPÝ ßïe„ûïB€мPËþÿÿÿ@ïü`PÐP¼Ô¼Õ¬1IѼgóݬûïÒ	ÕPЬPРXïXZxúXYÁZYPÑPÐPÐ PÐPï•bÑPÐ
PÐPÐPWÃZï~bPÃYPYЬPРPÐW Ð¼ûï‚;ЬQÐP¡ЬPаЬPРP2  ЬPРPÐW ЬPРPРЬPРPÔ ЬPРPÞ ЬPРPxZ  ЬPРP× ÕYeûï
;ÐP[˜Bk2 «ÐW«ЬPР«ûïì:ÐP«Ð»ЫP2  ЫPÐW ЫPÔ ЫPÐY ЫPÞЬPÐ[ ÀÂ^Ь[Ñk
1ÑЫ­üѽü^ЭüPР­øРYРX}ѽüѽüЭüPРWРVѽü	ѽü1‡ÑføÑg^yݦûïÑPjЦ­øѽüέøPÐP­øЧYÀ§­øЦX•hѽü•·•hЧXÝXÝ­øÝYÝ«ûï»ÕP˜_kÐY«Эø«ÐX«Ý­üûïu:Ýßï¦ýÿÿݬûï˜:ßïÿÿÿݬûïê:ßïݬûïÚ:ݬݬßï&…ûï{?Ь[ÔYÔZÑZé[ÖYxÿ[[ÖZÕ[ëÐYPÂ^Ðï`­üÆ­üÇ­üPÀPPÃP­üPÇ­üPÖPÁPP­üÊÃÿÿïÝ_Ýï×_ûï–ÿÿÿxPPÀP­üÝï^ißï´„ûïõ>Õï¯_Ýï§_Ýïa$ßûïÔ>ß滑ûïÇ>ßï¡„ûïº>Ý­üÝï1$ßï‘„ûï¤>Ýï^_Ýï$ßûï‹>Ýï5Ýïÿ#ßïu„ûïr>ÔïÕïˆÔïú‡ßï`„ûïQ>Þïü€[1Ñk¬(Ý«ßïO„ûï/>ѬF
ßï;„ûï>À[ÕkËЬPÝ@ï=[ßï„ûï7ÀЬPÑPO1@1/ÑPI1„1òÑPB1Ò1ÒÑP01¨ÑP-1qßï…„ûï¶6ЬPаPÑPsÑP)ÑP^<ÑP_\ßïǃûï„6ЬPРPvßûïU=ЬPÝ ûïï
ßïvƒûï9=ЬPÝ ûïáßïbƒûï=ßïVƒûï=ЬPÝ ûï¸ßïBƒÕЬPРPЬPР[Ñ[Ñ[ßï@ƒ±Ñ[Ñ[
ßï0ƒŸßï*ƒ—ÝIûïO ÐP[ÝPÝûïiЬPÝ ûïC Ý1ݬûï)РZxZPÝà¬$ßïá‚ûïl<xZPÈPï!]Ý[ûï ЬPРݬЬPÝ ݼûïßflûï-<Àï²Ñï¬ïË~ÐïŸï¾~Ôï“ЬPРPÒ PЬQСQÐP¡ÝRݬûïp(ÝPûïíЬPРPÒ PЬQСQÐP¡ЬPРPΠPЬQСQÐP¡ÝRݬûï&(ÝPûï£ЬPРPΠP´Ð¬PР[Р¬мPÑPÑP^GÑP_?ЬPÑ Ñ 
Ñ[Ñ[ÐPÔPÑ[Ñ[ÐPÐPЬQÀP¡ßï1hýßïŸûï4ѼbЬPÝ ßïŒûïâ:
ßï€ûïë3ѼbЬPРYРX!Ѽc
ЬPРX
ßïVûï±3ÑhÐh%Ñh^˜_hÑh_
ßï1ûï‚3ЬPРWÀW¨ÀW©NÑWÐPÐPÐPVÂV¨ÑV	ÞïPÞïPÝPÝÝXûïÞ$ÂV©ßïô€ÝÝYûïÉ$ÂVWÕW®ÑhÐh1]üÑh_ô˜^h1MüÑPC1Bü11üÑPM1þÑPL1Vü1üÑPN1÷ü1üÑPT1'þ,ÑPR1œüÑPP1[ý1ÚûÑPS1§þ1ËûÑPW1jþÑPU1Oþ1®ûÑP~1Gý1ŸûѬEÁ¬PÝ@ïB|Á¬PÝ@ï6|ßï€ûï9Á¬PxPPÈPïÍYÁ¬PxPPÈPï½YЬPÝ@ïþ{ЬPÝ@ïó{ßïÞûïÚ8x¬PÈPïŽYx¬PÈPï‚YïïŽYZšï‡Yï‚YÑï|Y
ÁïrYPÐPÐPïÍYÕï3y Áï*yPÑPï¶YÁïyPÐPï¥YÐ[Ñ[ï›YÐPÐPÐPKï•{ñ[áÿÐ[Ñ[ZÐPÐPÁ[QÐPAïs{ñ[áÿѬÐPÐPÐPÔPѬѬ^Ѭ
Ѭ_ÐPѬ
ЬPÝ ûïdÕPÐPÔPЬ[ÐkZÑZÑZ^ÑZ	ÑZ_ÐPÑZ
Ý«ûï ÑPÐPÔPЬ[Ñk
Ы[Ñk^	Ñk_ЫPÓ@ï‘zÐPÔPÑkÑkÐPÔPËÏÿÿÿ¬PÑPÔPЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑPѬÐPÔPЬPÏP*8Âÿ8FÂÿÂÿÂÿÂÿ*8¦Ñ¬ÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPЬ[Ñk^Ñ«
Ñ«ÐPÔPЬ[ÐkZÝ[ûïÌÿÿÿÕP2PÑZN?Ý«ûï¯ÿÿÿÕP1Ñ»+ЫPРP•`ЫPÝ ЫPÝ ûïâþÿÿÕP2PÔPݬßïû|ûïê5Ь[ÐkPÑPÑP^ßïÛ|ûïÜ.Ý[ûïbЫPÝ@ïºxßïµ|ûï¡5x«PÈPïUVßï«|ûï.Â^Ѽg	ЬPР¬ЬPР­üмPÑP.ÑP=ÑP^CÑP_mßï}|ûïN.ЬPЭü ЬPÀ ݬûïÂâßï8|ûï5åЬPÁ PÝ@ïxßï|ûïì4ЬPÁ PxPPÈPï˜U Ð¬PÀ ЬPÑ РP•`
ßïá{ûï9.ЬPРPÝ@ï¬wßïÒ{ûï“4ЬPx PÈPïCUЬPÕ РP•`šßï¨{ûïe4ݬûïßï“{ûïN41ÿÂ^Ь[ÑkgЫ[ÐkPÑPtÑP+ÑP
11ÑP^hÑP_1ßï†{ûï-Ý«ûïÒûÿÿÑP(Ы­üxà««ßï1{ûïÔ3Ý[ûïsЭü«ßï{ûï¸3Ý[ûïWЫPÝ@ï¯vßï÷zûï–3x«PÈPïJTÑ«@ЫP•`
ßïÒzûïø,ßïÒzûïa3Ý«ßïÇzûïQ3ßï½zûïD3ЫPÝ@ïDvßï¦zûï+3x«PÈPïßSÕ«ЫP•`#ßï„zûï3Ý[ûï¤ßïpzûïï2ÝÝ[ûïÕPÝ«ûï‡þÿÿßïGzûïÄ2iЫXШY˜_kЩ«Щ«Щ«Щ«ÑhN!Ý[ûïFþÿÿßïzûïƒ2ШP «ßïòyûïk2Ý[ûïþÿÿÝXûï-Ь[ЫP•`Ý«ßïÓy)Õ«Ý«ßïÆyÝ«ßï¾yûï2Ý«ßï²yûï2Ь[ݬÝ[ûïЬ[Õ«Ý«ûïÐPZÔZÕ«
Ý«ûï“Ý«Ý»ûïÀùÿÿÕPÝÝ«ûïtßÿÿ˜HkÝÝ[ûïÐPYÝZûïÑYÐPÔPЬ[Ç[PÂPïýtÑ[Â[Ð[PÑP&Ý[Ñ[	ÞïýxPÞïúxPÝPßïßxûï91Â^Õ¬ݬßïÛxûï11<ѬYЬPÝ@ï>NßïÁxûï*1Ðï8RPÑPAÑPC1üÃP¬PÄPž@ï¯t[ûï_ÐP­üÑïýQC	Þï„xPÞï‡xPÝPÝ ÝïØQûïIÕkݬÃPkPÝ@ï7tûïp0À[ÕkÝ­üÃPkPÝ@ïtûïP0Ñï’QC	Þï.xPÞï1xPÝPÝ ÝïmQûïÞݬÀ[ÃPkPÝ@ïÍsûï0Ý­üûï¬ÝÝÝï6QûïS$Ôï-QÔï#QѬFÃP¬P2@ïm¬ݬÃP¬PÝ@ïosûï¨/»Ñ¬@ÔPÓ¬ÐPà¬мPÓ@ïtN2P2@PÔP€Ь[ÐkXÑX
ЫPРPЫPÐPWÑXh
Ý[ûï'ÞïsYÑXiÑW©ÀYÕiîÓHï
N3лPÑPvÑP
aÑP^11ÑP_1„ßïêvûïõ'ÐkPËñÿÿÿ@ïÆMPÑP1fûïÂ(ÐPZÐ8j2 ªÐªЫªЫª1F˜a»ЫPР«´Ð»ЫPË PxPPÈPЫQï¡QÈQPЫQÐP¡‰˜^»ЫPË PxPPÈPЫQï¡QÈQPЫQÐP¡ЫPÕ Ëûï0(ÐPZÐj2 ªЫPРªЫªûï(ÐPªÐºЪP2  ЪPРЪPРP”`ЫPЪQР¡ЪPÔ ЫPÔ ÐZ«1èþûïÂ'ÐPZÃkjЫªЫªûïª'ÐPªЫªÐ:kÐZ«ЪZлjЫPРªЫPРªЫPРªЫPРªÝ«ûïøýÿÿЫZ˜FkÐZ«ûïP'ÐPZÐZ«Ðj2 ªÁ «PÊPxPPÈPÁ «QïQQÈQPÐPªЩªÔªÔªÂ^Ь[ЫYЫPРXÑYÑYÐPÔPÐP­üÑXÑXÐPÔPÐP­øÑ­üPлPÓ@ï·K˜FkЫ«ûï°&ÐPZÐZ«Ðj2 ªÁ «PÊPxPPÈPÁ «QïQQÉQPªÕ­ü	Þï’tPÞïtPÐPªÔªÔªЬ[ÑkhÑ«ЫPÑ ÐPÔPЬ[ÑkhÑ«ЫPÑ ÐPÔPЬ[ÑkzÑ«tÝ«ûï™ÿÿÿÕPfÝ«ûï‹ÿÿÿÕP.Ñ»RЫPРP•`FЫPÑ €ÿÿ8ЫPÑ ÿ*ЫZЪ«˜ajÑ»
ЫPР
ЫZЪ«˜ajÐkPÓ@ïzJhÑkP	ÑkQVЫZѪѪFЫZѪѪ6Ý«ûïÿÿÿÕP(Ý«ûïþþÿÿÕPЫZЪ«˜ajЫZЪ«˜ajЬ[ßïøþÿÿÝ[ûïI&ßï“ûÿÿÝ[ûï:&Ý[ûï#ëÿÿÔïonЬ[ЬPÑPd€"ÑPe€>ÑPf€SßïàrûïÈ#ÔPÑkøЫP•`ðÑ«€ÿÿÿæÑ«ÜÐPÑkÓЫP•`ËÕ«ÆÑ«ÿàºÑkµÐ«P•`­Ñ«§Ñ«ÅŸЬ[Ý«Ý»ûï7òÿÿЬ[ÑkN&Ñ»^ЫPÝ ЫPÝ ûïâòÿÿÕPÔPЫ[Ñk
Ы[ÑkÑk_	Ñk^ÐPÔPЬ[ÐkZÓJï½H1ЫPЫQÑ ¡Ñ»
XЫPÕ ЫP(ЫPÕ 1ЫïgJЫPаPÑP
3ЫPРPРïHJ2ïCJßïsûïm"ðÑ»gÀЫïJÓЫPЫQÑ ¡ç›Ñ¬€ÿÿѬÿ•¼Ѭ	ѬÔPÐPЬ[ЫZЫPÏP
 6I 6ÐZPé¬øÕZôÑkïÐZÐZ«æá¬áÑk
ÜÕZØÐZçá¬ÎÕZÛÈÀÂ^Ь[ÐkZËñÿÿÿJïzGYÝ«ûïWðÿÿÐPVÔ«ÑYѫЫÑY1–ÐZPÑP
ÑPH	ÑPfÐïyI«Ý«ûïÈñÿÿÕPЫPÑ VÐVP1ЫPРP1ÑWVê<ÑXVãÐXP1ñÁVXPÑPWÐWPÁVXPÑPï!I
ÐïIP1ÌÁVXPÑPW1¼ÐWP1ºÐ«PРXЫPРWÑZ:1ÑZF1`ÿÑZdôÑZb“ÓJï}FЫPÝ ûïUïÿÿÐPVÝÝ«ûïfþÿÿÐPXÝÝ«ûïWþÿÿÐPWÁVWPÑXPÁVWPÐXPÁVXQÑWQÁVXQÐWQÑPQÁVWPÑXP1ÿÁVWPÁVXPÑWP1DÿÁVXPÐP«ÓJïôE1õÐZPÑPBÑP	=ÑP8ÑP3ÑP.ÑPNØÑPOÏÝÝ«ûï½ýÿÿÐPWZÕXBÐV«1ªÑ«Ñ«ËÏÿÿÿ«PÑPÊÕX1€þÕW1€þÁXVPÑWP1°þÁXVP1iÿÁVPÑXPÁVP\ÐXPWÕXÁVVPÑWPGÁVVPDÁVXPÁVQÀVQÑPQ	ÁVPÀVPÁVXPÑWPÁVXPÁVQÀVQÑPQ	ÁVPÀVP	ÁVXPÐWPÐP«ÐZPÑPqÑPlÑPgÑPbÑP;]ÑZ<
ÑZ>ÑZÑ«
Ñ«ÐïGVÑZÑZ
ÑZÑZ1æÑ»^ЫPРPÓ@ïßháÑXW#1ÂÑXWÐWPÐXPÑPV1WýÑXW1£ý1iýЫPР­øЫPР­üÑ­üÑ­øjÑ­üÑ­üÑ­øXÑ­øRËÏÿÿÿ­øPÑPDÑ­øÑ­ø0Ñ­üÑ­üÑ»
ÕX<Ñ»
6Ñ»
.Ñ»
ÕX
"ÕXÕWÐX­ðÐWXЭðWЫ­ôЫ«Эô«ÝÝ«ûï»ûÿÿÐPWÑVX1®ü1ŽüÁVVPÁWVQÑXQÁWVQÐXQÁXVRÑWRÁXVRÐWRÑQRÁWVQÑXQÁWVQÐXQÁXVQÑWQÁXVQÐWQÑPQKÁWVPÑXPÁWVPÐXPÁXVQÑWQÁXVQÐWQÑPQÁWVPÑXP1üÁWVP1ýÁXVPÑWP1’ý1?üÁVVP1øüЬ[Ñkg
ЫPЫ Ы[Ñk
Ы[Ñk
	Ь«Ы[ÑkÑ»	Ь«Ы[ݬÝ[ûïÀЬ[Õï>mݬÝ[ßïXmûïŠ#2 WЬ«å¬ЬXÐkZËñÿÿÿJï`BPÐPVЫYÑYÑY7ÑZl2XÖïÞlÑVÝXÝ«ûï‡ÿÿÿÑVÝWÝ«ûïvÿÿÿÐZPÑPP1ã18ÑP>!1ÑP1Ì1ßÑP71ÍÑP£ÝÝ«ûï+ÿÿÿÑïDzÝ š2 XЬW1vÿÑïòC
2X2 W1`ÿЫP2 ÝÝ«ûïˆþÿÿÑïÂCÝ Ý«ûïÅþÿÿЫP2 ÝÝ«ûïSþÿÿÑïŒC2P2PЫQÐP¡ÝÐ2 X1ãþ2X1ÛþÑPë1ÓþÑP<1(ÿÑP:1?ÿ1¾þÑP=1@ÿ1³þÑPF¿ÑP?1*ÿ1þÑPL©1‘þÑPT&ÑPR’ÑPQ‡1oþÑPS1xÿ1`þÑPb1iÿÑPU1[ÿ1CþÑPl1Tÿ14þЬ[Ñk
Ы[ÑkÑk;Ñ»5ЫPРP•`)ЫPÑ €ÿÿЫPÑ ÿ
ÝÝ«ûïéÎÿÿÝÝ[òÔPЬ[Ñk
+ЫZÑZ"ÑZÑZÝ«ûïŠêÿÿÑPÐPÔPЬ[ЫZЫYЫPÕ ^ÐkPÓ@ï²?4Ñi
&Ñ© Ý©ûï?êÿÿÑP
Ý©ûïÿÿÿ1/Ý1Ñi^1ЩPÓ@ï¸cïÔPÐkPÓ@ïT?1£Ñª©4ÝZûï1ÿÿÿÕPݪ§Ñj^ЪPÓ@ïucÝÝZ1·ÝYûïýþÿÿÕP1rÿÑi^1sÿЩPÓ@ï@c1bÿÝZûïÐþÿÿÕPŸÑj^²ÐªPÓ@ïc¤ÐkPÝ@ïù<ßï“iûïÌÑj^ЪPÓ@ïëbѪ©ÝZûïwþÿÿÕP1_ÿ1@ÿÑi^ЩPÓ@ïºb1ÿþÝÝYûï$ÍÿÿÐPЬ[Ñ»^2ÝÝ« Ñk_+Ñk

ßï!iûï@ÝÝ«ûïâÌÿÿÐPЫ[ÑkÌÔPЬ[ЫPÕ bÑ»^XÑ»
ЫP>ÝÊÝ«ûïÌÿÿ6ÝÝ«ûïýÕP,ЫPЫPÑ°
&ЫPРPÝ ûï)ýÿÿÐPÑ»
ÀÑ»gÐÑ»^Ý
œÔP€Ь[ЫPРZЫPРYÐkPÑP=11ÑP1êÑP	
ZÑP1Ñ»^óÕZïÝÝ«ûïçËÿÿÐPÑ»^ÔPÑ»^ÈÑ»ÓЫPÑ ÉЫPÑ ¿1ÇÑP1¦1¼Ð«XÑhgШXÑh
µÝ¨ûïZçÿÿÑP¢Ý[ûï~ÐPWÐ:kÝÝÝ«ûïÐW«ѸN1«Ð§XÑhgШXѸN1 ßï`g1ÑP1ÿ4ÑP/1ÿÑPA1%ÿÑP?Ñ»^1ÿÑPC1ÿÕY1‘ÕZ16ÿÑ»
ЫPÝ ûïŠûÿÿ1ÜþÑ»g1ÿЫPÑ°
óЫPРPÒѸ	
ßïÞfûïáШP˜a°˜a¸ШPР¨Ý[ûïãÜÿÿÝ«Ý[ûïóøÿÿÝݧûïWÊÿÿÝÝW1bþÑ»
Ñ»^ЫP1iÿÑ»^1KÿÝ
16þÐïüePÖïõeݬßïcfûï>Ь[Ý«ûïîÿÿÿ˜akЫ[Ñk8éÑkc1ªÐ«ZÑ»
˜akЫ[Ðk>Ð
kÝ[ûï(ÜÿÿÑk_)Ý«ûïeúÿÿÝ[ûïÜÿÿÑk_
ßïèeûïÔÀZ«=ÑZÐPÐPÐPYÂY«ÑY	ÞïÈePÞïÌePÝPÝÝ[ûï8ÂYZÕZ¿ÝÝÝ[ûïÐÝ Ý[ûïÉÿÿЬ[ÔZÑk8Ý«ûïéÿÿÿÐPZЫ[Ñ«Ñ«ÇZPÀPPÃPZP
ÇZPÖPÁPPZÁZPÑkc!Ç«ZPÄ«PÃPZPÇ«ZPÖPÅ«PZÁ«ZPÇZPÀPPÃPZP
ÇZPÖPÁPPZÁZPм[Õï`eÝ[ݬݬßï\eûï¥à¬1†Ð¬PÑP€ÑP€	ÑP€YÑ[ЬPРP•`ÔPЬPÕ Ѭ€ÐPЬPÑ 
Ѭ€èЬPÑ ÿÿÿÿÄѬ€Ð¸Ý¬ݬûï6ïÿÿ謼á¬ݬûï’âÿÿÕP©á¬Ñ[	Ñ[_ЬPè ¾Ð[PÑP=ÑPBÑP
1.ÑP^1ÁÑP_1ÑP`1ŸÑPg13ÿË¿ÿÿÿ¬Pš€ZÒZPËP¬Pá¬áЬPÝ ûïºáÿÿÕPÏЬPР[ï[ï­:xú[ï¨:Áï¢:ï™:PÑPÐ
ï”:Ðï:Ðï„:Ð ï
:Ãïo:ï:Pxú[QÃQPï`:1¶þËßÿÿÿ¬PЬPРPÓ@ï?\ÐPÐPÐPZЬPРPÓ@ï"\1?ÿЬPРPÑ@ï:ëÑZÐPÐPÈPZ1ÿËÿýÿÿ¬PЬPÝ ûï0âÿÿÒ¬QÊQPá¬ÐPÕï#cݬݬßï7cûïfËÏÿÿÿ¬PÑP>á¬9ЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑP0Ûˬ~ݬûïÿÿÿï¬PѬP
Ë¿ÿÿÿ¬Pá¬ÔPЬPÏP
%9ku//õÿõÿWMCa×ï¬PËýÿÿÿ¬PËÿßÿÿ¬PËûÿÿÿ¬PËÿýÿÿ¬PËÿþÿÿ¬PËÿÿÿ¬PËÿûÿÿ¬PË÷ÿÿÿ¬PËïÿÿÿ¬PËßÿÿÿ¬PÞïæj[Ñ«	Ð[ïæ8À$[ÑkaáßïbûïKÔZÑkZ1‚Ð[Jï¿8ÖZÑZptÕJï6ìÞï‰j[ÑkaÔÑkÃÃkPÐ@ï/aYáY$ÑZ²ÑZ­ÑZ_¤ÝÝZûï¾ÞÿÿÕP“ÉYPÒPPËPJï£5PÑPYéÀ$[œûïÉÒÿÿѬ@	Ðï8[@мPÐ@ï8[2Ñk¼)lѼfѼ`Ѽ_VݬݼûïGÞÿÿÕPEÀ$[Ñka1ìÑk¹ÃkPÐ@ïj`YàY­Ð¼PÉYQÒQQËQ@ïþ4PÑPY»Ò¬PËP«P°ÝLݬûïwÐPZÝ«ÝZûïûÿÿÕPÝ«ݪûï9ýÿÿÕP1yÿÝRݬûï@ÐPZÝ«ÝZûï×úÿÿÕPÚÝ«ݪûïýÿÿÕPÉá«ЫPÝ[ݬûïÕP¯Ý« ݬݬûïݬÝ«ݬûï¸	2P2PÂ^Ь[Ôïá_•k1¿˜kPÏPA~!H44|4žc44ÉÉ444‰b™444¬k×﹂Ð﵂PÖﮂk`Ö[žßk~ûï› êÐïf_áÖ[˜k~ݬûï³ÖÿÿÐé¬ÌÖ[‘k
ùÃÝïà5ßït_ûÝïÏ5ßïb_éÑïÅ5
˜wP˜lPÝPßïH_ÌЭüxïœ5­ü­ü×­üxï“5­ü­ü‘kMЭüPÒ­üPÝPûï*Þÿÿ1LÿЬPÝ ßï_†Ý¼Ö[˜k~ûïµÕÿÿ1+ÿÖ[˜k~ݬûï…Р­üï­ü­üÝ­üßïÐ^1MÿÖ[˜k~ݬûï^ÝPûïÛÝÿÿ1éþÖ[˜k~ݬûïCÝPûïÞÿÿ1ÎþÖ[˜k~ݬûï(ÝPûïCßÿÿ1³þÖ[˜k~ݬûï
ÝPûïîÝÿÿ1˜þЬPÑP1,ÑP2'ÑP3"ÑPL*ÑPRFÝPßï4^ûïPÃ1¬PxPPÀPмPËñÿÿÿ@ï2PÑPЬPЬPРPмPËñÿÿÿ@ïé1PÑPЬPЬPРPÎï›6Ðï•6ïˆ6ÔïŽ6Ðïˆ6PÐPïx6Ô[ÔKï4ÓKïïUÕï[6Ð[ïV6Ð[ïK6ÓKïÏUÕïC6Ð[ï>6Ð[ï36Ö[Ñ[²ЬPР[ÔZCxZP˜^àï[~ݬûïÕxZQÐPáxZPÔàxZPÞï:]à×[ÖZÓ[I¶xZP˜^àËÿÿÿ[~ݬûïˆxZQÐPáxZPÔàxZPÞïî\àÂ[ÖZÓ0[´Ó[1œxZP˜_àxZPÐàѼdѼcѼf
ѼbЬPx PÀPÇ P~Ëÿðÿÿ[PÇP~ûïdxZQÐPáxZPÞïW\àxZPxýàPxZQÐPáÖZÔYÊIï`2òYðÔYxYPÕàÔPÖYÑYZêÐPx¬PÀPï¨1Ѭ(Çï›1PxPPÃPï1PÇï…1PÖPxPïz1Ñït1ïs1Ðïg1ïf1Ãï@QïW1PÑPï7QÃï+QïB1ï%QÎï71PмPÓ@ïJ/$ݬûï>ØÿÿÐP[Ý[ݬݬûïªÕPÐ[PЬPË [Ñ[ Ý[ݬÝPûï~ÕPÔÓ¬1Ðï¼3[Ñ[ï°3`ÓKï2SÝ[ݬݬûïKÕP¡Ö[ÖÓð¬5Ðï‰3[×[ ÓKïüRÝ[ݬݬûïÕP1hÿñïZ3[ÖÿÎPЬPÓ@ïÈR
ßï—Zûï…ЬPÑ@ïº0ÔPÓ¬ЬPÓ@ï–RéÓð¬ЬPÓ@ï~RÑЬPÝ ûï×ÿÿÑP1¨è¬·Á¬PÓ@ïUR¨Á¬PÑ@ïS0™Ð¬PÕ@ïE0
ÁPPÕ@ï80GÁ¬PÕ@ï*0ݬݬݬûïlÕP%ЬPÕ@ï	01MÿݬÁP~ݬûïGÕPèЬPÈ@ïß/Á¬PÈ@ïÎ/ÐPЬPÕ@ï¿/ãݬÝPݬûïÓD¬ݬÝLݬûï-ÕPÐPÓˆ¬ݬÝRݬûïÕPÛÔPݬݬûï‹úÿÿÐP¬Ѽ
Р¬Ѽ_GЬPÑ €&ï P×PѬPЬPï PѬPÐPÔPЬPѬ ÐPÔPѼ^àЬPѬ Ý ûïZÕÿÿÑPЬPÁ PѬPÐPÔPЬ[ЫZÑk^Ý«/Ñk_/ÑZ€ÝïZPÃP~ûïÝïZ~ÝÝZûïÕïX$ݬûïØÔÿÿÝPЬPÝ@ï÷Oßï,XûïÞЬPÓ@ïPOô@ï!.
ßïXûïÓݬûï‘ÔÿÿÑP+é¬
ßïXûï³Á¬Pô@ïç-
ßïXûï™Õï|W$ݬûïLÔÿÿÝPЬPÝ@ïkOßïéWûïRЬPÓ@ï’OÖ@ï•-ݬûïÔÿÿÑP,Á¬PÓ@ïmOÁ¬PÖ@ïk-é¬
ßï¯WûïÕ¬ßïÔWßïÒWûïäѬèÔZÔ[1x[PÒPPËP¬P!ÕZ
ßï§Wûï´ÖZÝKï³Vûï¤Ö[ÕKï£VÆ ^Õï‘V>ݬßïpWûï{ݬûïqÿÿÿßïgWûïdݬûïr¸ÿÿßïSWûïMѬѼaÕ¬ßïÏýÿÿݬûïkмPÓ@ï*ûï~Õ¬é¬ݬûï£á¬#á¬ݬû`¼ЬPÔ ЬPÔ Þ­ì[é¬ÝLݬûïH÷ÿÿÐP‹á¬ÝRݬûï0÷ÿÿÐP‹á¬Þïð-‹á¬Þï.‹á¬Þï.‹Þ­ìPÑ[P
ßïkVûïyÔkÞïéM­è1Ò½èPËP¬P"Þ­ì[ЭèPÝ ÝZûïlïÿÿÕPÀ[ÐkZäÀ­èÕ½èÊßï,Vûï*Ѽc	ЬPР¬ЬPРªÝZûï¿ÐPZݬûïŒÐj¼ЬPЪ ЬPЪ ЬPЪ ˜ajмPÑP^
ÑP_1˜ЬPà ЬPË PÐPYá
YЬPÑY nÕIïË*Ý ûïGÑÿÿÑPÁYPÕ@ï¯*
ßïqUûï`ЬPÝ ÝYûï¸üÿÿЬPÝ Ý ûïüÿÿЬPÝ Ý ÝYûïÊÏÿÿЬPÐY ЬPÑ €Yï PÃP­äЬPï ­àЭäPÑ@ï5*
Ó@ïLЭàPÑ@ï*1ÿÓ@ïLóßïæTûïÀ1ÿЬPРPÑ@ïî)ëЬPРPÓ@ïÏKÙßïÏTÊм¼ЬPЬQР¡ЬPЬQР¡ЬPЬQР¡ЬPЬQР¡ЬPЬQР¡Ь[Ý[ûï#ÐPZÝPûï›ÿÿÿЫYÑk^Ý«/Ñk_/ÑY€ÝïYPÃP~ûï]ûÿÿÝïY~ÝÝYûïIûÿÿÐjPËñÿÿÿ@ï²&PÑPÑPÐZPÝ«ûïsÿÿÿÐPªÝ«ûïeÿÿÿÐPªÞÔ[ÓKïÌJÕKïÏ(
ßïàSûï€ò[ÜÂ^ЭüÔ[x­ü­üÖ[Õ­üóÃ[PxP­øЭøPÖï¾SÝuûï¥ÿÿݬݬßïùtûï>ßï8Yßïætûï+Ñï…S
ßïYûïÝcûïC¥ÿÿÕï_SÑïWSßïY2ßï&Yßï”tûïÙݬݬݬݬßï{tûïÀßïYßïhtûï­ÝûÿÿÝwûïѤÿÿßïàXßï;tûï€ݬݬݬßï%tûïjßïÁXßïtûïWÂ^Þïî­ü	˜a½üÀ ­üÑ­ü8õíÞïúíïÍ)Â^ÐïÁ)­øÑ­ø8õÞï×íPßïaXûïçþÿÿÁ ­øPÐP­üÑP­øãѽüaÐPï~)Ñ­ü8õ¾Á ­üPÓÂ^ÕïR2Þïí­üѽüaÝ­üßï$XûïƒþÿÿÀ ­üÑ­ü8õØûï,ÿÿÿѼaßïݬûï€Õ¬ßïìWûï:þÿÿ˜a¼Â^Ь[ÑPÝ­üݬÝ«ûïßÿÿÿЫ[Эø¬Ô­øЭø­üß­øß­üݬÝ[û¼ÐkPËñÿÿÿ@ïÂ#PÑPµÐ«[Эü¬ÉЬ[ÐkPËñÿÿÿ@ï›#ZÑZ
ݬÝ«ûïØÿÿÿÑZ
ݬÝ«ûïÆÿÿÿÝ[û¼ÞïþP[ÐkPЫ@ïW#Á[PÐkQÐPAïˆ!À[ÕkÞ'ßï|WAßï~W9ЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑPËËÏÿÿÿ¬PÑP ßï>Wûïô¾ËÏÿÿÿ¬PÑP0¨Ð¬PÝ@ïUßï WûïÌЬ[Ý[ûïoÐPZÁZï¹rPÑPUÀïÈUÑïÂUÈ3
ßïÝVûïžüÿÿÔïˆrÕÿ¢U&Ýûï“ÐPY
ßïÎVûïqüÿÿÐYÿzUÝ[ÁïRrÿmUPÐPYÝPûï”ÁZPÀPï5rÐYPĬ¬ݬûï?ÐP[ÔPÐ[ZÝÁ¬~ûï–ÐPYÔŠôYûÐ[PݬûïxЬ[ЬZ‘«+ÐPÔPÐPXÝZûïC‘kw+ݶݬûï—ÐPYÕX1ÕYùÝYûïœÝ‘kalÕXÐPÐPÝPݬûïªÐPY<Ñï;.3ݶݬûï@ÐPYÕXÕYÝYûïHÝݬûïlÐPYÕY)ÝÝÝYûï ÕXÐPÔPÝPݬûï?ÐPYÕYÔPÔjöYªÕXâª‘kr¨ª¨ªÐZPݬÁ\~ݬûï³ЬPá ÎPÔPûï»ÐPZЬ[•‹ü×[Ý
ÝZûïÀ0PöPkÝ
ÝZûïÐPZ‘{XÛÖ[˜aYÑYzÞïŒnPöYkÖYÝݬûï	ÖPÚЬP¼!ïЬ[ÞïänXÑXïpÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûïÙÝ‘kalÕYÐPÐPÝPݬûïçÐPZ<Ñïx,3ݶݬûï}ÐPZÕYÕZÝZûï…Ýݬûï©ÐPZÕZ)ÝÝÝZûï]ÕYÐPÔPÝPݬûï|ÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ïÔßïÈmÁ\~ݬûïÜáï¿mÎPÔPPÀÔSЬRÔUš‚T‘ Tø‘T‘T
î‘+T‘-TˆSš‚T|P‘T04‘T9/ÑQÌÌÌyPVyPPÀVPØWQÂ0TÀTPØQÖUáS×Uš‚TÇ‘T.ãSòÔV‘Te‘TE[š‚T‘T+‘T-ˆSš‚T‘T0‘T9ÑVÌÌÌêÞFfV>F¤ÐVßáSÎVVÀVUÑUœÿÿÿÐœÿÿÿUÑUdÐdU}PP1ÔRÕU#ÑQ™™™	yÿPPÖRîyPVÀVPØWQÖRõUß=;ÕQ
yPPÂRyPP×RáQöÐQVÔW{VQWÁPVØW{
VPVÀPPÑVÖP×RòUÖáQyÿPPÖRyPPœÿPPnPVnQPdï‘þÿÿP`VPáSrPPÝRpP~ûïÆЬ[á«¨«è«ÎPà«÷ÝûïM
ÐP«¨«Õ«á«ߘ«Pž@ï6«ç¨«Ñ[`OáïÊk
ßï·kûïê
á«ÐP2PÝPÝ«˜«~ûï
ÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«p¬PïPRÀ¬RÑR
ðRP|PpïkPá¬rPPÐ"ï()Ь[ÔZÖZ•‹úÐZPЬ[ЬZÐ[XÔYŠ‹ÖYÑY¬ó”‹ò¬YùÐXP¼0ïмïÀ¼¼ÐQPÂ^™B­üЬ­ô2ÿ­ðß­ðÁ\~ݬûï¨×­ðЭôPÖ­ô”`ß­ðÝûïrЬP	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûï©ÐPYj˜ï¼a~ûïòÕPâ«Þ匿Þá«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûïAÐPYÐZ«Ôkná«1mÿЫZ3Ñ[pO1xÿÝûïwÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûïØÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûïlÑPY¨ «ÎPÔPÞïT`[Ý[ûïÀ[Ñ[ï~aëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûïYÕPÎZá«
Ý«ûï˳Œ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼Ь[ЬZ‘kŠ•‹÷ÔP˜kP˜zQÂQP¼ï¸ÔPÂ^ß­úݬûï\ÕPÔPÐP¼ïˆ¼ïxЬ[ЬZÐ[YŠ‹ûÐYPݬÝ	tݬûïݬÝtݬûï¼6ï$Ь[ѬÿÿÿÿÎPé«Ñ««Ñ««êÕkæÖ«Ök׫ЫPö¬`ÔP¼
ïÔÔPЬPЬRÑRÔQ{RPRPÔPÑPRÂRPÕïô(.ÉÈïæ(ÉÄïÞ(ÞïØ(ïÛ(ÞïÉ(ïÌ(ÝÁ¬~ûï*ÐPYÐïµ([Ôïº(ék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïv(	Ñ[ÄÔPñïh(¬ÿÁYPÆPxPïO(ÝûïbÐPZxï<(PÀZPÑPZÀxï,(~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿ	(Áï(PÑZPÈÿõ'xïö'PÀZPÃPjÐjïß'ÉÄÿÓ'1ÿxYPÁ[PïÀ'ÑZï¹'Ðÿ±'ï´'Ðkÿ¥'Éïž'kÁ[PЬ[Ð[ZÂZÐZï…'ËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐïå&@j‘Áï¨]¬~ÝÐ\SÐ^\¼ï_Ðï]PÀ£ï„]¼ïCЬïo]ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPïÎPÿÿÿÿ29þÿÿÿ8L9Lþÿÿÿ8K9KþÿIÿÿ8O9OþÿJÿÿ 4)þÿ'ÿÿ"4!þÿå]‚‘d;ãMbùYWXP8aNfæO
	_.\3B0RQ$ïðôKøíîõö÷ûúScT/länñšÉáj*ƒ$#-’–»Ji
Š‹ŒŽgÆ[5F9ÅšeG›žþp™¢£¤¦¨ª¬®¯±³µ¶·¸¹m(*ƒœ0½ºI1&Ÿ¼ '’&E0D'¿1Û“†Ûˆ0Aý91ÕÌ^͘Î!ÏÊЉÑ%Ò‡ÓùYWXÙƒPÀHNÖÈO×@ß&ÝÞÄàâÚ(*ÄRQü“^ïðôøíîõö÷ûúSÚTl—bñ
Ãa	ÃÜ—
	ÿ4	6
	`òl !#"
c/w¾<o",' t-uCówsky^hz„{2~|}qxsvtu=,wÇZ)+7:t¡uË?w>%y.sz{r~€|}qxsv•U
ìêëtéuçèwy+z{r~€|}qxsvtuwy)z{r~€|}qxsvtuòwtuw(ysvzr{€~$|}qxsvtuwyz{~|}qxsvtru€wyz{~|}qxsvr€tuwr€tqusvwyz{~|}qxsvtuwyz{~Ô|}qxsvØr€tutwuywzy{r~€|}qxsvqxsvtuwyÁz{r~€|}qxsvtuwyz{~|}qxsvr€VYWXPNOVYWXPN€ORQRQSTVYWX´PSNTOVYWX²PNORQRQSTVYWX°PSNTOVYWX­PNORQRQSTVYWX«PSNTOVYWX©PNORQRQSTVYWX§PSNTOVYWX¥PNORQtuwyRQ{STqxsvST…VYWXPNOVYWXPNORQ
RQSTVYWXSTLVYWXPNOVYWXRQPNORQSTRQtSuT”wVYWXPSNTOqxsvtuwyRQz{~|}qxsvtSuwyz{|qxsvtuwyz{qxsvüüÿüüüüøãüìüü{(w$üZüíí mëÿüÑüøæøü!üüüü’imZb`2üüüŒSÐüüüü*ü1üÞÿüÞüüKüüü"üü9–~6ÃËüüütø0üUüüëüëp!üüZüüüü–üü]P*÷êÄ·ü–üü ü~~~~~~ËZ¿ü/–üüüüüüüüüç«–ü>ü,^w_6––oüˆücÇ¿üüü––––––––üülüø~8ügc–üüöÿüüéüµµµµµ!ƒüóÿµ¹¶üª¤¸Eüü5žüüßüüÙƒ~üüüüÐüüüü¸üüü•µüü’nJüüüüüü&îÿüüz&xwusrqponmFlkj6mih\WVT$S
QONKJH#GE:	830/  ##%%%&		''))

**,,"-"...011/////3344((++225!6$$$$$$$$$$$$$$$$$7778

üÿÿåÿäÿðÿñÿÚÿïÿ"!íÿîÿöÿ#÷ÿ19ãÿèÿÑÿ2õÿçÿÏÿïÿÚÿ!4498âÿ26çÿèÿçÿèÿÒÿ326Îÿ:2ïÿ!ÖÿÔÿïÿÙÿ×ÿÐÿáÿàÿ37þÿÈÿ333837þÿôÿ4òÿ02êÿÕÿ9Þÿéÿçÿ2Øÿ8:ÑÿèÿßÿñÿÊÿ47ôÿ78:ÍÿÌÿôÿËÿ46 2òÿòÿòÿòÿòÿòÿ2ìÿôÿïÿ3æÿôÿ25Ôÿ8þÿ5×ÿþÿÞÿÛÿôÿôÿôÿ:ôÿ:ôÿ:ôÿ:ôÿ:ôÿôÿ:ôÿ:ôÿ:ôÿôÿôÿôÿôÿØÿ8Íÿôÿìÿ33ëÿ283Óÿþÿ9ñÿÝÿôÿôÿôÿôÿôÿôÿôÿôÿ5ÌÿØÿ73òÿ63ëÿëÿôÿéÿ9ãÿÜÿ5ôÿßÿüÿýÿûÿùÿúÿøÿ)*$%9Éÿ&+,-(/.ôÿ57þÿ399ÜÿÜÿÜÿÜÿóÿôÿÜÿ999ôÿ95Üÿ2222ôÿ72'+399ôÿôÿóÿôÿ32Üÿ3393ôÿóÿ399þÿ( þÿFþÿXþÿ9þÿþÿGw5;ACEwYBV*-T"$<=:?@67M•£¤¥¦W,.1w49UwHL	\>xD8TPRZ–±—˜™š›œ© {°&+/w3#%
}~€‚ƒ„…†‡ˆ‰“”UT¢§¨©©¡2
‹ŒŽŠ‘NQŸžwª¬|0[^zjq£’S­¯]_`aydefgklmznp®shio«crtzvubÿÿÿÿbad bdtydimension table overflowwhiles, fors, etc. too deeply nestednon-constant case expressioncase not in switchswitch table overflowduplicate default in switchdefault not inside switchswitch table overflowduplicate case in switch, %dyacc stack overflowsyntax errorfunction level error$%dFAKEstructure typed union member must be namedfield outside of structureillegal field sizefield outside of structurezero or negative subscriptfunction declaration in bad contextold-fashioned initialization: use =nesting too deepillegal breakillegal continuestatement not reachedvoid function %s cannot return valueloop not entered at toploop not entered at toploop not entered at topprecedence confusion possible: parenthesize!old-fashioned assignment operator& before array or function: ignoredstructure reference must be addressableundeclared initializer name %sÿÿÿÿøo\bgnu~…‹’–œ£§­µ½ÃÇÐFIELD[%d]SNULLAUTOEXTERNSTATICREGISTEREXTDEFLABELULABELMOSPARAMSTNAMEMOUUNAMETYPEDEFFORTRANENAMEMOEUFORTRANUSTATIC$_0 
"'`(2)3{4}5[6]7*?:+	-
/<%>&|^!L~M,88;9. D<
S>U=::ÿÿÔØÝ)ãè/í*öý.,'1-#+%0&37<$CL(SZ0agn
v…Š+rwccom:can't open %s
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890123456789abcdefABCDEF 	
01234567abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789	
unexpected EOFnewline in string or char constantnon-null byte ignored in string initializerempty character constanttoo many characters in character constantunexpected EOFillegal character: %03o (octal)illegal hex constantnewline in BCD constantBCD constant exceeds 6 charactersgcos BCD constant illegalambiguous assignment: assignment op taken=<%c illegal=>%c illegalyylex error, character %03o (octal)out of switch in yylexbad asm constructionbad AR_?? actionRan out of memory (savestr)ran out of memory (hash)ran out of hash tablesasmautobreakcharcasecontinuedoubledefaultdoexternelseenumforfloatfortrangotoifintlongreturnregisterswitchstructsizeofshortstatictypedefunsignedunionvoidwhiledefid calltyreducedefid( %s (%d), , %s, (%d,%d) ), level %d
	modified to , %s
	previous def'n: , %s, (%d,%d) ), level %d
declared argument %s is missing	previous class: %s
redeclaration of: %sredeclaration of %s	new entry made
void type for %s	dimoff, sizoff, offset: %d, %d, %d
parameter stack overflowbcsave errorparameter reset errorswitch errordclargs()
	%s (%d) 
dclstruct( %s ), szindex = %d
??gummy structure memberillegal zero sized structure member: %szero sized structure	dimtab[%d,%d,%d,%d] = %d,%d,%d,%d
	member %s(%d)
redeclaration of formal parameter, %scompiler takes alignment of functioncompiler takes size of functionunknown sizeinitialization alignment errorinoff errorbeginit(), curid = %d
instk((%d, %o,%d,%d, %d)
no automatic aggregate initializationinsane structure member listendinit(), inoff = %d
too many initializersempty array declarationbad scalar initializationcannot initialize extern or union} expecteddoinit(%o)
illegal initializationillegal {irbrace(): paramno = %d on entry
too many local variablesStructure too largetoo many local variablesillegal field typefield too bigzero size fieldstructure too largestructure too largenidcl errorillegal type combinationtymerge: arg 1array of functions is illegalfunction returns illegal typea function is declared as an argumentfunction illegal in structure or unionfunction has illegal storage classillegal use of fieldillegal classillegal classillegal classillegal register declarationillegal classillegal classfortran declaration must apply to functionfortran function has wrong typeillegal class: %dSymbol table full	nonunique entry for %s from %d to %d
lookup( %.8s, %d ), stwart=%d, instruct=%d
symbol table fullsymbol table full%s undefinedremoving %s from stab[ %d], flags %o level %d
symbol table full%s redefinition hides earlier one	%d hidden in %d
unhide uncovered %d from %d
unhide failsbuildtree( %s, %o, %o )
constant argument to NOTconstant in conditional contextdivision by 0.illegal lhs of assignment operator%s undefinedmember of structure or union requiredmember %s==%s?
illegal member use: %snonunique name demands struct/union or struct/union pointerstruct/union or struct/union pointer requiredundefined structure or unionillegal member use: %sillegal indirectionunacceptable operand of &assignment of different structurestype clash in conditionalillegal functionillegal functionother code %dchkstr( %s(%d), %d )
undefined structure or uniongummy structureillegal member use: perhaps %s.%s?division by 0division by 0illegal comparison of enumsenumeration type clash, operator %spointer/integerstructure pointerarray sizepointerillegal %s combination, op %sundefined bit field typepointer requiredillegal oconvert: %dillegal pointer subtractionillegal types in :void type illegal in expressiontymatch(%o): %o %s %o => %o
constant expectedconstant too big for cross-compileroperands of %s have incompatible typessizeof returns 0	    %o) %s, %d, %d, , %d, %d
statement not reached.L%dPQTURSXYVW& errorpO
Ô!	bra	.L%d
	bra	.L%d
	.even
	.text
	.data
locctr: STAB unusedillegal location counter.L%d:
	movl	d0,a0
	movl	#.L%d,a1
	movl	a0@+,a1@+
	movw	a0@+,a1@+
	movb	a0@+,a1@+
	movl	#.L%d,d0
	.bss
	.even
.L%d:
	.=.+%d.
	.text
	movl	#.L%d,a0
	jbsr	mcount
	.data
.L%d:	.long 0
	.text
	link	a6,#-_F%d
	moveml	#_S%d,a6@(-_F%d)
	mov%c	a6@(%d),%s
bad argument| A%d = %d
	.globl	%s
%s:

	.byte	,%d
	.long	0
illegal field type%s, line %d: wCannot open temp filerLost temp file	subl	#%d,d0
	cmpl	#%d,d0
	bhi	.L%d
	addw	d0,d0
	movw	pc@(6,d0:w),d0
	jmp	pc@(2,d0:w)
.L%d = .
	.word	.L%d-.L%d
.L%d:	cmpl	#%d,d0
	beq	.L%d
	bgt	.L%d
	cmpl	#%d,d0
	beq	.L%d
/tmp/pcXXXXXXbad conversionincode: field > int	.word	%d
	.long	%d, %d
	.long	%d
	.word	%d
	.comm	%s,%d
ÿÿÿÿô#ù#ÿ#$$$$$"$'$-$4$<$C$J$QPUTSRYXWVbad option: %cstore called on:
SZEROSONESMONESPECIAL+%d|order( %o,  )
order( %o,  ), cookie , rewrite %s
no table entry for op %sillegal initializationexpression causes compiler loop: try simplifying	    %o) %s %s  size=%d align=%d, , NOPREFMUSTDO PREF %s, SU= %d
SANYSAREGSTAREGSBREGSTBREGSCCSNAMESCONSFLDSOREGSTARNMSTARREGINTEMPFORARGSWADDÜ)	à)ä)ç)ë)ï)=ó)?÷)Aû)Cþ)ÿÿÿÿ*********** *#*&*)*,*/*
Ê  @2*=*H*S*^*i*t**Š*•*QPQQSUVSUWUSXUSYWYVWYWYWXYWY *<¥*>ª*¯*=µ*?»*Á*<Ç*>Í*Ó*=Ú*?á*è*í*ò*<÷*
ü*
++	++=++	%+,+=3+|	line %d, file %s
.L%d:	moveml	a6@(-_F%d),#%d
	unlk	a6
	rts
_F%d = %d
_S%d = %d
| M%d = %d
	.globl	fltused
%sfno hoptab for %s	jbsr		jbsr	@	movl	,a0
	jbsr	a0@bad subroutine namebwl	clrl	%s
sp@-Illegal ZT type conversionIllegal ZU%dNot a structureSTASG badSTASG-r	movw	AR,	movl	AR,AR
illegal zzzcode	movl	%s,%s
	movl	%s,%s
%d%sillegal conputinsput#%sbad arg temp%s@()illegal upper address##%sbad arg tempa6@(%d)%s@()@+-illegal address%d%s%s+%d	%s	#%d,sp
addqladdl	bra	.L%d
bad conditional branch: %s	cmp	AL,AR
	tst	AR
	cmp	UL,UR
	tst	UR
Bad address for hard opsfloatfixbad special shapeaddsuborandeormuldivdivslsrd0d1d2d3d4d5d6d7a0a1a2a3a4a5a6sp	beq	.L%d
	bne	.L%d
	ble	.L%d
	blt	.L%d
	bge	.L%d
	bgt	.L%d
	bls	.L%d
	bcs	.L%d
	bcc	.L%d
	bhi	.L%d
lmulldivlremalmulaldivalremulmululdivulremaulmulauldivaulremfaddfsubfmulfdivfnegfnegafaddafsubafmulafdivafaddfafsubfafmulfafdivf'store finds both sides trivialrallo( %o, %o )
setbin can't deal with %sbad setstrbad incr rewrite bad -= rewrite.L%d:
stuck starg	movl	AR,Z-
	movw	AR,Z-
 !@A€ @tshape( %o, %o), op = %d
ttype( %o, %o )
bad setrew%d%d%c%d%dbad getlr: %cb-h-o-u-{-usable asked about nontemp registerrfree( %s ), size %d
register overfreedillegal freeregister overfreedrbusy( %s ), size %d
illegal register pair freedRLEFTRRIGHTRESC1RESC2RESC3RNULLRNOP|reclaim( %o, ,  )
illegal reclaimcannot reclaimfaulty register movepotential register overwritepotential register overwriteregister allocation errorNAMESTRING^REG_OREGICONFCON`CCODES
U-
U*U&HUCALLKUFCALLL!M~lFORCEnINIThSCONViPCONV+h+=i!-(	-=)!*	*=	)&h&=i ?:&&||8,;,OP:=	</ˆ	=/=‰)>%ˆ?%=‰ @<<A<<=	0B>>C>>=	0|h|=i ^H^=I N++	O--	E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN	 oCAST	 %GOTObSTASG	cSTARGdSTCALLfUSTCALLÿÿÿÿw4}4‚4‡44‘4–4œ4£4©4±4¸4¾4Ä4Ë4Ô4Ú4Ü4x(3
too many errorscannot recover from earlier errors: goodbye!
compiler error: 
warning: 
out of tree space; simplify expressionwasted space: %ofreeing blank tree!undeffargcharshortintlongfloatdoublestrtyuniontyenumtymoetyucharushortunsignedulong??PTR FTN ARY %sout of temporary string spaceout of memory (tstr):#Â
×€(F:#Â
 €3F:#Çd€ÇFF:#Â
×Ê
×TF:Â
 Ê
 bF:Â
Ê
 {F:	ÇÊ
LjF:€–F:£F:Ê
ýF
&Ç	FGÊ
UG Â
×VG ÇaG&€Ç	oG&d€Ç	zG&Ê
Ç	ˆGÊ
 	–GÊ
	¯G8Ê
ǼG Ê
ÇÊG ŠØGÊ
îGÊ
 ûG DH Ê
D H Ê
-H Ê
	FH Ê
	hH Ê
€	“H Ê
µH Ê
 ËH ÇÊ
ÇäH Ê
ôH B
Ç€ÇI Ê
 Ê
 I`jI
ÇzIMÇ…INÂ
Çf€ÇIOÂ
Çf€Ç­INÂ
Ç€ÇÊIOÂ
Ç€ÇæINÇf€ÇJOÇf€ÇJNÇ€Ç<JOÇ€ÇXJ@e€PtJ @e€…J@e€P•J @e€¦J"Â
Çf€Ç¶J(Çf€ÇÅJ"ÇÊ
ÇÔJÇÊ
ÇâJ"Â
ÇÇðJ	"Â
Çf€ÇþJ	(Çf€Ç
K	"ÇÊ
ÇK	ÇÊ
Ç*K	"Â
ÇÇ8K"Â
Ç€ÇFK"Â
ÇÇTK"ÇÂ
ÇbK"Â
Ç€ÇoK"Â
ÇÇ|K"Â
‰K"Â
–K"Â
£KÂ
°K€Â
ÛK="Â
L="Â
!L="Â
>L=Â
[L=€Â
†L?Â
¶L?Â
ÕL?Â
ûL?Â
!M?€Â
UM"f€ÇŽM"@€ÇœM"ǦM"€f€Ç´M"Ê
€ÇÂM"€ÇÌMHÈÚMhDDÞMhÇ€ßMhDîMhDÿMhNhD
NhDNh€Ç'NhD6NhÊ
FƒGNhÊ
 JNhÊ
 	KNh Ê
 aNb@ˆwNb@zNb@ˆ}Nn€DŒNn€—Nn€¢N
@
­NN@N®NO@N¯N:@:°Nb@b±N
@²N ³N@L´N;@;µNn@n¶N@
·N
@¸N@¹NaaaaaaaaºN	clrZB	AL
	clrl	AL
	clrl	UL
	moveq	AR,AL
	movZB	AR,AL
	movl	AR,AL
	movl	UR,UL
	movl	AR,AL
	movZB	AR,AL
	andY	#N,AL
F	movl	AR,sp@-
	movl	#H,A1
	lslY	A1,AR
	andY	#M,AR
	andY	#N,AL
	orY	AR,AL
F	movl	sp@+,AR
	movZB	AR,A1
	movl	#H,A2
	lslY	A2,A1
	andY	#M,A1
	andY	#N,AL
	orY	A1,AL
	movZB	AL@,A1
	tstZB	AR
	cmpZB	#0,AR
	clrZB	A1
	moveq	AR,A1
	movZB	AR,A1
	movl	AR,A1
	movl	UR,U1
	movl	AR,A1
	movZB	AR,A1
	movZB	AR,A1
	extl	AR
	movl	AR,A1
	movl	AR,A1
	movl	AR,A1
	movl	UR,U1
	pea	AR@
ZP	movl	AR,Z-
	movw	AR,A1
	movl	A1,Z-
	clrl	A1
	movw	AR,A1
	movl	A1,Z-
	movb	AR,A1
	extw	A1
	extl	A1
	movl	A1,Z-
	clrl	A1
	movb	AR,A1
	movl	A1,Z-
	clrl	Z-
	movl	AR,Z-
	movl	UR,Z-
	movl	AR,Z-
	cmpZL	AR,AL
ZI	cmpZL	AR,AL
ZI	cmpZL	AR,AL
ZI	movl	UR,Z-
	movl	AR,Z-
	movl	UL,Z-
	movl	AL,Z-
	jbsr	fcmp
	addl	#16,sp
	tstl	d0
Z0ZI	moveq	#1,A1
ZN	negZB	AL
	notZB	AL
F	movZB	AL,A1
	addqZB	AR,AL
F	movZB	AL,A1
	subqZB	AR,AL
F	movZB	AL,A1
	addZB	AR,AL
F	movZB	AL,A1
	subZB	AR,AL
F	movZB	AL,A1
	addqZB	AR,AL
F	movZB	AL,A1
	subqZB	AR,AL
F	movZB	AL,A1
	addZB	AR,AL
F	movZB	AL,A1
	subZB	AR,AL
	lea	AL@(ZO),A1
	pea	AL@(ZO)
ZP	lea	AL@(ZM),A1
	pea	AL@(ZM)
ZP	addqZB	AR,AL
	addqZB	AR,AL
	addZB	AR,AL
	addZB	AR,AL
	addZB	AR,AL
	subqZB	AR,AL
	subqZB	AR,AL
	subZB	AR,AL
	subZB	AR,AL
	subZB	AR,AL
	eorZB	AR,AL
	eorZB	AR,AL
	OIZB	AR,AL
	OIZB	AR,AL
	OIZB	AR,AL
	muls	AR,AL
	mulu	AR,AL
	mulu	AR,AL
	extw	AL
	movb	AR,A1
	extw	A1
	muls	A1,AL
	andw	#255,AL
	clrw	A1
	movb	AR,A1
	muls	A1,AL
	extl	AL
	divs	AR,AL
	andl	#65535,AL
	divu	AR,AL
	andl	#65535,AL
	divu	AR,AL
	extw	AL
	movb	AR,A1
	extw	A1
	divs	A1,AL
	andw	#255,AL
	clrw	A1
	movb	AR,A1
	divs	A1,AL
	extl	AL
	divs	AR,AL
	swap	AL
	andl	#65535,AL
	divu	AR,AL
	swap	AL
	andl	#65535,AL
	divu	AR,AL
	swap	AL
	extw	AL
	movb	AR,A1
	extw	A1
	divs	A1,AL
	swap	AL
	andw	#255,AL
	clrw	A1
	movb	AR,A1
	divs	A1,AL
	swap	AL
	aOIZB	AR,AL
	aOIw	AL
	aOIZB	AR,AL
	lOIZB	AR,AL
	lOIw	AL
	lOIZB	AR,AL
ZC
	andl	#255,AL
	andl	#65535,AL
	extw	AL
	extw	AL
	extl	AL
	extl	AL
	andl	#255,AL
	andl	#65535,AL
ZT	movl	AL,A1
	clrl	U1
	clrl	Z-
	movl	AL,Z-
ZSZSZS	movl	AR,A1
	.long	CL
	.word	CL
	.byte	CL
help; I'm in trouble
/                           AAAAAABBBBBB ÿÿÿÿÿÿÿ€€ PÜ—r<ô€#¼+4ð;¨-BüUJ¼uRèzY„a¤g¨m4Šv¢T·‡ØÆì+—ÄΞ@Ú¦xÞ®xÞ·yÀÞÁÅÌßË~ðßÔÿ`àÝpàåÅáí áö~ÈáýxPãÇPãœäxTä $hä*Í”ä3¤ä;´äDÌÄäNfåWfxí`y€ïg–Œïn´Œïw¬ï¼ïˆ»Üïìï–üïŸ!ð¦»@ð®Pð·AðÀ ðǧÈðÐ7ôò×Ï8óÞ€`óæpóï €ïõû~,€rô
	2¨P (3üÈ3&	"¬P.	d°P5Ç<;&oBSVH¸ÚP:ÔhVÌ´^	¹´Pf	¸Pn…èvá~	øo†	6ˆqŽ	ªŒq—	Dq 	*”q¥%T®¸·#&v¾BfÚÆ	"˜qË	€ qÒNê{Ú~Ð{âLÜéêDñdšú`Þëô	lôú˜ý[üÿp%Ô+%82œ9	Dpy>¨FŸOëZ²Èe“Œnp°<wP<~	;È{ˆ	àÌ{+äL™Ú¨- 	ÌÐ{©	´Ô{²îÂ5º¬~Â>{ÊLÑød9ÜÖš7å	Ø{ï	@Ü{÷tŒ8"Z8	Fà{FÄäD,$˜RR,‚*Û4	Þè{:ËŽIBéÈ<JŒp?SŽ~KZ·ŒOb`¤Dj<~Cs•üG|ÕŠG…pfSŽ	<Ç—	~ÇŸç¨6¨"t¯øèz·³üUÂ/èË®üÓ	ØÇÛ	=Çã		Ç마nóWZoú-ôÞÐr	¼^h	Ç<‰"	JÇ( (B0ÿ„8	§ Ç?	å(ÇI	ý€ÉR	„ÉZ	’ˆÉc	’ŒÉjëìr	Éz	«˜É€Ýð‡­øŽ¯¼—ûØ 	TXõ¨	öXù¯kð·	ç`ù¿h@ÚÇ	½dúÎ.`OÔk”ܘä+Pìk\ô‹`ü6ÀÞ¤Ìß4ŠðŒ*vÛ%*Ý-€¾<6™,.?mê~I‚âRZËÜb	ÈhúhþPãqAPðy	Œlü‚KÆ*‹Jv’9RC›{P£ûœª÷ä
³)è'ºdž,ÀÇÔNÉðü‰ÔŒïÜfxíå	püî	Òtüø	†xüþ$Tä«ÈðÍhälxÞ	;hý(	ñÐþ. á6XÝ>ŸPNG{®OQŽ5Xë®H`aÆQkcÈTq«ú{y_ÜåP‡Š¼{”K}œz@=¤yð=«#ò²€>»íƈÄ;¼Ì8?ÖOœÞ	7Ôþæd ïÃT@ö‘ú~þ¬¬‡èdF78ˆ°ˆbTH&U€- l‰5Kr‰>ÎsFƒ†ÜMÐMW+Z‡_ŸSgåî~n»ò~v<xU~ªŽTˆö~	äØþ•	s˜›pàa£Ò¢oªë¬j´úÊd¼Ò®iÅmÎªk×jújáB„éÔ`ñlØfø‰6`	3¦f	ò”‡	:i	9\i	&j)	‹¤Û1	çlr;	LªîC	.ÊsL		èÜS	õŠZ	a”tb	ý‰j	ÖÝp	 Õw	žì~	¥¼u‡	èð	ÃJ‡˜	ÌÈzŸ	V–z§		ïX°	¸	*À		g\É	hÒ	—Û	–ã	®0Œë		µ`õ	Ĭ$ý	“È‹
1
€
‰ 
xðß
¸”ä%
2®,
tpà3
uð;
[ø‚F
H„L
ÍÒ‰V
nÐá\
GV‹g
	šdo
	mhv
	÷l€
H"‰
7L"’
P"š
	ip¢
	tª
	/x³
	ß|¼
	eہ
œT"Î
X"×
	|„ß
ÒÄÎæ
6Êî
+¤,ö
˜@+ÿ
7H,KD,Ë "ô¢ Xú)òŠ¶3ûbŒ:)ÖC±ÚK»à¨T	͈^	GØdþL¢k‚°Œsƒ<{îJŽƒ±(ÙŠ¤h·“rÙšã`"¢àÚ¡©z,—°ñf·¸Ž¿	uÜÉ	iàжÔØÇö½ßoú±é{ËðcØÆøĬ™º@Å
¸h°PÅ2*À#Ö¦¯,^’¯6—„À? FÂGy&ÃPÏ”ÂXÂÄÀ`æ2²l“T·t^ô˜~£´˜ˆ‘l™êÊ·˜ð¤" ¸V­¨VŠŸ®Æ’©¶¹ö ½3€©Ãér¸Ëx¹Ó$P$Ü…&¢å.T$í™<+ö›P£ÿmì$
	cä
	ñè
à,%
yª£'
3H¯-
Z2Î4
ˆ¸«<
\ÌD
:V¨K
0%T
¯˜©]
ÿž©f
=<«n
ïä©w
!.ª

xª…
W«
s¤«—
`¬Ÿ
’¬¦
;JƯ
dŸ
¨°Á
é`%Í
ˆ%Ø
Î&à
%8²é
R´ó
dBµþ
âhµ	ÚŽµ°¾¶8 ¸R ½'äŠÀ0KD+9	Tì@	MðH	ÝôL	•øRÉY	…8b	/@i²$5p+L,xQ>Ï~	¿„	`Š	›d	h–	œlœè<Ñ¥¼ºÐ¯HÒ·ñLÓÀ‡˜ÓȆBÔÏì”ÔÖü Õß	Õpé©jÜñÏ0.ù	Vx!üï€8óü°Þz4ò&ï%/á,;¬ï3ÂÜï9	›x
@ŤäG~’æPq´äX¨ ð]ÿ`àepól´ Pv|ä}ìïƒÌ¹äŒ•`ó“4¼ï›	
€
£–ï­	Ú€µ»*ð»ðÁ@ðÈÁôòÎ@Pò×	ÍÜÜÏ!óácrt0.ocgram.o_fake_fakenamexdefs.o_ccnamesscan.opftn.otrees.ooptim.ocode.olocal.o_inwd_wordreader.olocal2.oorder.omatch.o_mamaskallo.ocomm1.otable.ocalloc.ofreopen.ofprintf.omktemp.oaccess.ofopen.ocreat.oprintf.oatof.octype_.ofilbuf.oldexp.ostrlen.ostrncpy.osignal.olseek.ogetpid.osprintf.odoprnt.oflsbuf.oexit.odata.ostrcmp.oclose.oisatty.oopen.oread.ostrcpy.ostty.oioctl.oungetc.ounlink.ourem.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_tstrused_tstrbuf_curtstr_yylval_yyval_mkty_block_bdty_cerror_bcon_dstash_curdim_dimtab_savebc_psavbc_asavbc_brklab_contlab_flostat_swx_resetbc_addcase_optim_uerror_swp_swtab_getlab_deflab_tfree_adddef_swstart_swend_yyexca_yyact_yypact_yypgo_yyr1_yyr2_yychk_yydef_yyv_yychar_yynerrs_yyerrflag_genswitch_yyparse_yyerror_yylex_curclass_blevel_tymerge_defid_reached_retstat_ftnend_bccode_locctr_types_dclstruct_rstruct_instruct_stwart_bstruct_moedef_strucoff_sprintf_savestr_lookup_werror_stab_falloc_ftnarg_beginit_nidcl_uclass_doinit_endinit_irbrace_ilbrace_clearst_autooff_regvar_dclargs_ecomp_branch_buildtree_brkflag_retlab_curftn_idname_lineno_makety_icons_hflag_doszof_notlval_lastcon_ctype_dcon_getstr_ftitle_ftnno_paramstk_paramno_argoff_minrvar_inoff_xdebug_strflg_node_cflag_pflag_scnames_asm_esc_yytext_lxgcp_mainp1_lxmask_caloff_offsz__iob_ddebug_idebug_bdebug_tdebug_edebug_freopen_fprintf_p2init_lxinit_tinit_mkdope_yyaccpt_nerrors_ejobcode_lxenter_lxmore_lxdope_lxcp__filbuf_ungetc_lxmatch_lxtitle_lxstr_putbyte_bycode_lxcom_lxrdope_lxres_hash__ctype__isitfloat_strcmp__flsbuf_savetab_saveleft_htab_strlen_malloc_strncpy_calloc_instack_pstk_printf_tprint_fixtype_fixclass_psave_oalloc_mknonuniq_hide_efcode_tcheck_cendarg_defalign_bfcode_talign_tsize_fldal_inforce_vfdzero_zecode_vfdalign_ibseen_iclass_ilocctr_instk_defnam_incode_gotscal_fincode_cinit_upoff_fldty_noinit_commdec_eprint_fwalk_tyreduce_cisreg_relook_aobeg_aocode_unhide_movestab_aoend_opst_dope_conval_opact_pconvert_chkpun_convert_tymatch_ptmatch_oconvert_clocal_chkstr_stref_strargs_combo_offcon_bpsize_psize_econvert_talloc_moditype_fflush_prtdcon_walkf_ecode_p2tree_exname_tstr_rbusy_oflag_fortarg_revrel_andable_nncon_ispow2_proflag_proflg_strftn_tmpfile_outfile_lastloc_crslab_p2bend_usedregs_rnames_p2bbeg_where_tmpname_mktemp_signal_dexit_fopen_unlink_genbinary_cast_isitlong_atof_p2compile_nrecur_lflag_nospflag_e2debug_x2debug_udebug_tmpoff_maxoff_maxtreg_stotree_stocook_baseoff_maxtemp_fldtyp_allo0_setrew_rdebug_radebug_t2debug_sdebug_odebug_lineid_e2print_myreader_delay_reclaim_allchk_setregs_deltrees_deli_eobl2_delay1_delay2_codgen_ncopy_deltest_tcopy_cnames_canon_store_order_prcook_callflag_fregs_rcount_rallo_nextcook_match_tshape_cbranch_get2lab_cbgen_def2lab_offstar_gencall_genscall_setincr_setstr_setasop_setasg_setbin_lastchance_stoasg_markcall_constore_stoarg_mkadrs_negrel_adrput_ffld_rewfld_oreg2_szty_notoff_sucomp_maxtoff_cntbits_ioptab_fltused_hopcode_rstatus_brnode_brcase_toff_zzzcode_acon_getlr_conput_expand_rmove_respref_callreg_shltype_shumul_flshape_shtemp_spsz_indexreg_adrcon_insput_upput_argsize_genargs_popargs_ccbranches_lbranches_opfunc_hardops_hardconv_shortconv_floatconv_optim2_special_zum_mkrall_niceuty_crs2lab_fldsz_fldshf_ty_busy_ttype_rwtable_opptr_table_rtyflg_allo_resc_maxa_mina_maxb_minb_freereg_freetemp_usable_shareit_ushare_recl2_rfree_rwprint_lastfree_tfree1_indope_itstrbuf_strcpyudiv_cfree_free_fclose_creat_close_open_errno_lseek__doprnt_getpidurem_accesscerror__lastbuf_ldexp_read_getppid_write_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brk@Pò×	ÍÜÜÏ!óácrt0.ocgram.o_fake_fakenamexdefs.o_ccnamesscan.opftn.otrees.ooptim.ocode.olocal.o_inwd_wordsumacc/cc41/pr68   755      0     12       24616  3472711322   6614 ”lÂ^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØûï
ÝPûïH¼ѬßïºÝfûïßï¼ЬPÝ ûïÑÐPïÆÕPЬPÝ ßï˜Ýfûïâûï%ûïèûï]ûïÒûïŸûï(ÝïtÝÝ ßïrûï¿ÑPßïVÝwûï…ÝïMßïRûïlÝï>ßïRûïYÝï/ßïUûïFÝï ßïXûï3ÝïßïZûï Ýïßïeûï
ÝïóßïsûïúÝïäßïûïçÂ^ßïƒûïÔÇï¥PxPPÃPï™PßïoÝwûï±Ô­ü0ÝïlÝÝß­øûïºÑPßïZÝwûï€À­üÑ­üïFÆÂ^ßïMûïXÇï)PxPPÃPïPßï9Ýwûï5Ô­ü0ÝïðÝÝß­øûï>ÑPßï$ÝwûïÀ­üÑ­üïÎÆž®¸^´­þßïûïØÔ­ø1ªÝï˜ÝÝß­ðûïæÑPßïöÝwûï¬Þ­¾­¸Ö­øÖ­¸×ÿ_ÐïWPРQÖ šaP
ÝïDûï=öP½¸ÌÖ­øÞ­¾PÝPÝ­ôï­ðP˜@ïÒ~˜­ðPÆ P˜@ïº~2­þP¶­þÝPßï™ûï,À­øÑ­øï1IÿÂ^ßï°ûïÔ­ünÝïÉÝÝß­ôûïÑPßï ÝwûïÝÝ­ø2­ö~ï­ôP˜@ïÁ~ï­ôP˜@ï®~ï­ôP˜@ï›~ßïƒûï™À­üÑ­üïuˆÂ^ßï€ûïxÔ­ünÝï9ÝÝß­ôûï‡ÑPßïpÝwûïMÝ­ø2­ö~ï­ôP˜@ï‘~ï­ôP˜@ï~~ï­ôP˜@ïk~ßïSûï	À­üÑ­üïéˆßïSßïûï‘ݬ0ݬ,ݬ(ݬ$ݬ ݬݬݬݬݬݬßïbûïcßïßïOûïP˜¬PÑPaÑPf
ÑPwÝûï
û~ßïÔÝwûïcÿÿÿÔPݬÁ\~ݬûïgЬPá ÎPÔPЬ[Þï¨XÑXïÞÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûïíÝ‘kalÕYÐPÐPÝPݬûïûÐPZ<Ñï”3ݶݬûï}ÐPZÕYÕZÝZûï™Ýݬûï½ÐPZÕZ)ÝÝÝZûïéÕYÐPÔPÝPݬûïÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ïXßïŒÁ\~ݬûïáïƒÎPÔPÂ^Ь[ЬZÔ­üÕ¬05Ь­ø×jЪPÖªš`P	ÝZûïoÐPYöY‹×­øÚÖ­üÑ­ü¬ËЭüPÂ^Ь[ЬZÔ­üÕ¬.3ЬY×jЪPÖª‹`ÝZ˜‹~ûï[	×Yààª
Ö­üÑ­ü¬ÍЭüPЬ[á«¨«è«ÎPà«÷ÝûïµÐP«¨«Õ«á«ߘ«Pž@ïæ«ç¨«Ñ[ðáïr
ßï_ûï
á«ÐP2PÝPÝ«˜«~ûïÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«¼ï¸
	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûïùÐPYj˜ïL
~ûïÒÕPâ«Þï«Þá«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûï‘ÐPYÐZ«Ôkná«1mÿЫZ3Ñ[1xÿÝûïÇÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûï(ÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûï¼ÑPY¨ «ÎPÔPÞïä[Ý[ûïÀ[Ñ[ï
ëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûï9ÕPÎZá«
Ý«ûﳌ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼¼ï(ÔPÂ^ß­úݬûïDÕPÔPÐP¼ïø¼ïèݬÝ	tݬûïݬÝtݬûï¼6ï¬Õï\.É€$ïNÉ|$ïFÞï@ïCÞï1ï4ÝÁ¬~ûï*ÐPYÐï[Ôï"ék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïÞ	Ñ[|$ÔPñïЬÿÁYPÆPxPï·ÝûïbÐPZxï¤PÀZPÑPZÀxï”~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿqÁïjPÑZPÈÿ]xï^PÀZPÃPjÐjïGÉ|$ÿ;1ÿxYPÁ[Pï(ÑZï!ÐÿïÐkÿ
ÉïkÁ[PЬ[Ð[ZÂZÐZïíËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐïM@j‘Áïè¬~ÝÐ\SÐ^\¼ï_ÐïÍPÀ£ïļïCЬï¯ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPï™ÎPUsage: pr68 filenamerCouldn't open %s for inputerror reading headerMagic Number: %ld
Text Size: %ld bytes
Data Size: %ld bytes
BSS Size: %ld bytes
Symbol Table Size: %ld bytes
Text Relocation Size: %ld bytes
Data Relocation Size: %ld bytes
Entry Location: %ld

Text Segment
text size not multiple of 4read error in text section
Data Segment
data size not multiple of 4read error in text section
Symbol Table
read error in symbol table section%d: %c%c %ld %s
 E??????UATDBCR?????????????????????????
Text Relocation Commands
error reading text relocation commands%c %c %c %d %ld
TDBEBWL? D
Data Relocation Commands
error reading data relocation commands%c %c %c %d %ld
TDBEBWL? Dpr68: 
Illegal error type: '%c'h h 0”$—r<Ø$~<,Å\4l=~”Df8MœüU^fxgy€n–Œu´Œ}œ†»¼Ì”Ü›»£¬7D³Ïˆº€°ÂÀË €Ñ×~<Ýræ	¼8ê	<@ðœr÷t<þμê†?ß~\R"±â)N”0l8þ8A.ðG¤PØW~’	`´0j.\q;Œx¼~	—`…ÅüŒÀ“[æ›fx¤«¬Lª´œÌº•°Á3œÉ	
hÑ–Û&ãy„é	Úh ñ»ò÷ÜýŒ€ˆ	ÁD7 	Ì”$Ïq"crt0.opr68.oabort.ofprintf.ofopen.ocreat.oprintf.ordwr.ofilbuf.olseek.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_in_bhdr_error_fopen_header_text_data_symbols_rtext_rdata_fread_printf__filbuf__iob_fprintf_abort__doprnt__lastbuf_creat_close_open_errno_lseekcerror_fwrite__flsbuf_malloc_fflush_read_write_isatty__sobuf__cleanup_fclose_free__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brkЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPï™ÎPsumacc/cc41/rl68   755      0     12       26524  3472711322   6610 @FÄÂ^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØûï
ÝPûï ¼ݬݬûï­ûï–1‚Ýï…]ÝïÏûïmßïìÝïj]ûïÐPï`]ÏÝPÝÝ ßïZ]ûï×ÐïM]PÑPÑP
ÝPÝïz¥ûïûïÀÝï]ûï§ûïdÐPïû\ƒûïþÝûïáÐïÛ\EÐïÓ\PÐ@¼P‘`-ݬݬÐï¼\PÁ@¼~ûï&Ðï¦\PÝ@¼ûï®Öï”\ÑïŽ\¬±Â^˜­ÿ~ÝïÇûïЬPÖ¬`­ÿâßïÜßï¬ûïéݬݬݬݬݬݬßïûïÊßï±ßïzûï·ݬݬݬݬݬݬûïÿÿÿÝûïòÂ^ÝûïŽÐP­üЬ½üЭüPÔ Õïô
Эüïê!Ðïâ­ø	ЭøPР­øЭøPÕ îЭü Â^Õï»ÔPÐï°­üЭüPРï¢нüPÂ^ß­ôûï±ÕP
ÝïÇûï6ÿÿÿûïÑÐP­ü}ÕP
Ýï±ûïÿÿÿÝûï1Ý­ôûï`ÕP
Ýï‰ûïôþÿÿÝ­ôûïÝ­øûïݬ(ݬ$ݬ ݬݬݬݬݬݬݬû
ïÑÝï7ûï®þÿÿ9ÝûïÅÝ­øûïôÑP
Ýïûï‡þÿÿÝ­ôûïŸÝ­øûï•ž®´^ÝÁ ï‘ZPÁïŽZP~ÝïvZûïWÔ­ð1Ñïƒè
ÝïÊûïåýÿÿxïhPž@︭¸ÖïXÝï2ZÝÝÝ­¸ûï°ÐïZPá ÝïZÝïpûï›ýÿÿÔ­´Þ­¾[O×ÿöYÐïîYPРQÖ šaP
ÝïÛYûïÐPZÖPÝïÃYÝï%ûïPýÿÿÕZöZkÖ­´Ö[Þ­ïPÑ[P¨”kЭ¸PЭ´ Á­´~ÝûïÃЭ¸QÐP¡ß­¾Ð­¸PÝ ûïÂÁ	­´PÀP­ðÑ­ðïyY1óþÂ^ÝÁ ïXYPÀïUYPÁïVYP~Ýï6YûïÔ­üÝTûï]À­üÑ­üï-YåÝÁ ïYPÀïYPÀïYPÁï
YP~ÝïéXûïÊÔ­üÝDûïÀ­üÑ­üïäXåž®Œ^Ýï´XÝÝß­øûï2Ðï XPá ÝïXÝïòûïüÿÿÐïXPá ÝïqXÝïÓûïþûÿÿï­øP@ïÞ­÷ï­øP@ïÔ­ö‘­÷E\µ­ú2­úPÑPïS2PPxPPÐàd­ð2­ú~ßï£ß­ŒûïDÞ­Œ­ðÝ­ðÝ­ü˜­ö~˜­÷~ݬßï–ûïMÝ­ü˜­ö~˜­÷~ݬßïŒûï0Ĭ¬ݬûï_ÐP[ÔPÐ[ZÝÁ¬~ûï¶ÐPYÔŠôYûÐ[PݬûïÄéQÔPݬÁ\~ݬûï_ЬPá ÎPÔPЬ[ÞïlXÑXï¢ÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûïåÝ‘kalÕYÐPÐPÝPݬûïóÐPZ<ÑïàV3ݶݬûï}ÐPZÕYÕZÝZûï‘ÝݬûïµÐPZÕZ)ÝÝÝZûï™ÕYÐPÔPÝPݬûïˆÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ïlÂ^ЬPª ЬPè 1ÐѬsÕ nà iмZЬ­üÕ¬Ýݘ ~ûïûÐP­øÃPZPÀP­üÂZ¬ЬPà )ÕZ%Ñ­üZÐPQá PÑ­üPÐQPÀ­ü ­ü¼ÔPï¬[Ô[ЬPá ÐPQР¡ЬPª ݬÃ[¬~ЬP˜ ~ûï}ÐP­üÔ¼Õ[h×¼	ЬPÖ ZݬûïbNЬP³ BÝPûï9ЬPá Ô¼ЬPª ЬPÐPQР¡ݬݬЬP˜ ~ûïÐP­üÑ­üÿÿÿÿÎPÔPˆ@¬¼)ï¼*ïüЬRÐP‚ÐQbÔPßïÔÁ\~ݬûïŒáïËÎPÔPÂ^Ь[ЬZÔ­üÕ¬05Ь­ø×jЪPÖªš`P	ÝZûïoÐPYöY‹×­øÚÖ­üÑ­ü¬ËЭüPÂ^Ь[ЬZÔ­üÕ¬.3ЬY×jЪPÖª‹`ÝZ˜‹~ûï×	×Yààª
Ö­üÑ­ü¬ÍЭüPЬ[á«¨«è«ÎPà«÷ÝûïMÐP«¨«Õ«á«ߘ«Pž@ï¶[«ç¨«Ñ[áïº
ßï§ûï~
á«ÐP2PÝPÝ«˜«~ûïÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«Ÿ¬ݬûïÝïݬݬûï¼;ï*¼ïÂ^™B­üЬ­ô2ÿ­ðß­ðÁ\~ݬûï¨×­ðЭôPÖ­ô”`ß­ðÝûïrЬP	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûïÐPYj˜ï
~ûïÒÕPâ«ÞïãI«ÞïÛI«á«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûï­ÐPYÐZ«Ôkná«1mÿЫZ3Ñ[$1xÿÝûïãÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûïDÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûïØÑPY¨ «ÎPÔPÞï°[Ý[ûïÀ[Ñ[ïÚ	ëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûï9ÕPÎZá«
Ý«ûï7³Œ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼¼ïDÔPÂ^ß­úݬûï`ÕPÔPÐP¼ï¼ïЬ[ЬZÐ[Y•‹ü×[Š‹ûÐYPݬÝ	tݬûïݬÝtݬûï¼6ï¬Õï”O.É,fï†OÉ(fï~OÞïxOï{OÞïiOïlOÝÁ¬~ûï*ÐPYÐïUO[ÔïZOék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïO	Ñ[(fÔPñïO¬ÿÁYPÆPxPïïNÝûïbÐPZxïÜNPÀZPÑPZÀxïÌN~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿ©NÁï¢NPÑZPÈÿ•Nxï–NPÀZPÃPjÐjïNÉ(fÿsN1ÿxYPÁ[Pï`NÑZïYNÐÿQNïTNÐkÿENÉï>NkÁ[PЬ[Ð[ZÂZÐZï%NËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐï…M@j‘Á~ÝÐ\SÐ^\¼ï_Ðï}PÀ£ït¼ïCЬï_ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPïÑDÎP°ºáù(Jj‰›ÀÌïûrrl68: 
TDBEBWL???????? bad symbol id %d%c %c %c %011O %s
%c %c %c %011O
/bin/sortfilename required following -%c optionunrecognized option: %cfile %s not foundunrecognized magic number %Ounrecognized type %o on symbol %scould not reopen pipe as stdoutcould not reopen pipe as stdincould not exec %sfile %s format error, unexpected eofpipe faileddup failed or returned wrong valuefork failedsymbol table overflowbbT@f—r<yd"x,~œ4ż<ÌDL	J,	QH	Z~p	af
jϯ
r„è
zσ‹•fdžfЧyØ®–äµ´ä½ôÆ»Í$Ô4ÝœPä»|ìŒõ7¸üÏü€$4 Ø ~<&r/	X\7!@	1Ü]H\R	à]\	»ä]d	4ì]lÝsz­ˆÍý –#$ w(¤x,¨y0¬z4°{8´|<¸}@¼~DÀHÄLÉPÎ TÓ!XØoøâ"èëœzòtœùNp	#P	EŠ~B&`ì/£T:yðC.I¤xR
ÂY«Œa£lk»,	qdw;ä~â	ƒzØ
ŠeÌ‘þ
šk¢œ4ªÂ$¯F¸H	À€üÅûTÌyøÒ4Ù‚êâ´Tì.¼óÂù	—^ÅLX	[Â	fÐ&œ$,„è
3Ï;•$B3ôJ	
^R–\\	Úbd¼fjPpŒ|wÁ¸}7†	Ì@f‹Ïåcrt0.orl68.ocalloc.ofork.ofprintf.ofopen.ocreat.ofseek.odup.opipe.oprintf.ordwr.ofilbuf.oexecl.oexecv.oexecve.olseek.osprintf.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostrcat.ostty.oioctl.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_symtab_nextsym_argnum_namelist_filename_infile_filhdr_cflag_gflag_nflag_pflag_rflag_uflag_sortname_e1_e2_e3_e4_e5_e6_e7_e8_e9_e10_e11_e12_e13_procargs_startup_error_fopen_fread_getsyms_printcmds_fclose_nextname_cleanup_procflags_newname__iob_fprintf_fatal_malloc_pipeline_pipe_fork_close_dup_execl_fseek__filbuf_calloc_strcat_cmd_sprintf_printfudiv_cfree_freecerror__doprnt__lastbuf_creat_open_errno_lseek_fflush_dup2_fwrite__flsbuf_read_execv_execve_write_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brksumacc/cc41/size68   755      0     12       23407  3472711322   7142 D\Â^Юnž®PÐP®Õ€üÑP¾ÕpÐP®ÐPïØûï
ÝPûï¼ݬݬûï1ûï`ûïÛûïªÐPï{éûïDÝûïÉѬöï…ÐïNEÐïFPÐ@¼P‘`-ݬݬÐï/PÁ@¼~ûï%ÐïPÝ@¼ûïçÖïÑבּÂ^KÑPl2ÑPn2˜­ÿ~Ýïûï6&˜­ÿPÑPhÎöïäöïßöïÚЬPÖ¬`­ÿÍßïüßïfûïƒݬݬݬݬݬݬßïGûïdßïÓßï4ûïQݬݬݬݬݬݬûïÿÿÿÝûï”Â^ÝûïÐP­üЬ½üЭüPÔ Õï&
Эüï!Ðï­ø	ЭøPР­øЭøPÕ îЭü Â^ÕïíÔPÐïâ­üЭüPРïÔнüPÂ^ßïÝïûï²ÐPï“Ýï‡Ýï½ûïÚþÿÿÝïwÝÝ ßïuûïÖÐïhPÏPP
PPP–ïsÝïIûïêÏP+
+++Ýï*ÝïXûïqþÿÿÝïûï
ÝïûïªÐP­øÝïûï™ÐP­ôÝïëûïˆÀ­øPÁ­ôP­ü•ïð(Ýï¼ßï'ûïû•ïÑ
ßïûïæ•ï¸1!•ï±1ÚÝïŠßïðûï½Ýï{ûïÝPßïáûï¡ÝïcûïüÝPßïÒûï…ÝïKûïàÝPßïÃûïiÝï3ûïÄÝPßï´ûïMÝïûï¨ÝPßï¥ûï1ÝïûïŒÝPßï—ûïÝïëûïpÝPßï‰ûïù1™þÝ­üÝ­üÝï¶ûïKÝPÝï£ûï<ÝPÝïûï-ÝPßïS1•ï1ÓÝïißïUûïœÝïZûï÷ÝPßïFûï€ÝïBûïÛÝPßï5ûïdÝï*ûï¿ÝPßï$ûïHÝïûï£ÝPßïûï,Ýïúûï‡ÝPßïûïÝïâûïkÝPßïòûïôÝïÊûïOÝPßïâ1ÜþÝ­üÝ­üÝïœûï1ÝPÝï‰ûï"ÝPÝïvûïÝPßï²ûïœ1<ý•ït4ЬPïPPЬQïQQÊÿÿÿQÈQPx¬QÊÿÿÿQÈQPx¬QÈQPЬPݬÁ\~ݬûïgЬPá ÎPÔPЬ[ÞïŒXÑXïÂÔPÀX³¨é‘«+ÐPÔPÐPY‘kw+ݶݬûïÔÐPZÕY1ÕZùÝZûïíÝ‘kalÕYÐPÐPÝPݬûïûÐPZ<Ñï€3ݶݬûï}ÐPZÕYÕZÝZûï™Ýݬûï½ÐPZÕZ)ÝÝÝZûïéÕYÐPÔPÝPݬûïÐPZÕZ1ÿÔhöZ¨ÕYâ¨‘kr¨¨¨¨ÐXP¼ïXßïpÁ\~ݬûïáïgÎPÔPÂ^Ь[ЬZÔ­üÕ¬05Ь­ø×jЪPÖªš`P	ÝZûïoÐPYöY‹×­øÚÖ­üÑ­ü¬ËЭüPÂ^Ь[ЬZÔ­üÕ¬.3ЬY×jЪPÖª‹`ÝZ˜‹~ûï[	×Yààª
Ö­üÑ­ü¬ÍЭüPЬ[á«¨«è«ÎPà«÷ÝûïµÐP«¨«Õ«á«ߘ«Pž@ïҫ稫Ñ[˜áïV
ßïCûï
á«ÐP2PÝPÝ«˜«~ûïÐPkЫ«×k!Ñkÿÿÿÿ¨«á«
ª«¨ «Ôk1Wÿš»PÖ«¼ï¸
	

 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÔT7šR•Bïòþÿÿd»Ý­üÝRûïNÕPã­ðÖ­ðºžïÎþÿÿS}½üTàTÅÀP­ðÔRÕPÕTšS•Cï­þÿÿÎR×QS…×TõPá}T½üÂP­ðàRôP‘ÖP×QÐRã­ðЭðPÀžÎÿ^Ь[Ь­üЬ\Ô­ð<ÿÿPÐ[Q}½üTÃQURÑPRÐRP0rÿÐQ[áRÜ•‹¼Ð^U|Y|Vš‹PP X¢²²¬²²²²²²ò²²¸ç²¾ÉÉÉÉÉÉÉÉɲ²²²²²²²²²¥½²½²²²²²²²²²²²²y²²²²²²²²²²²²–¥$
êøÿ²²²øÿ²²²²²Ê²y²²P…1îþ1ßÈ@ZŒ P11ÿÐXPàZÎPÐŒR:PbÐQUÐRQ1'0123456789abcdef0123456789ABCDEFÐRÐSžïÔÿÿÿWÐRÐSžïÅÿÿÿWáZžïÊÿÿÿWÎSVÔQÀUÐŒPïRSPQAg…ñVRñÿ|V”e;0®àZ1}Õ¬ü1uÑSxPáZXPPqÐW0qYÊZïlPùP
n4
n® 
®
néŒ ï÷
nªùŒ
nÖW8
nïíÿÿÿ®; ®ÕWáZ+qáZ qÖWàZÐXÃQUVÂWVÂVX&ÀWQÝQžH¥ RÂ]RÂRX(VaHa,a0X¾ÃWŽQÁVSUÃQUXÃXYP àZàZRÐWP	ÂPXÂPY0)ýÃXYP7ÂXYÐXP0ýáR×PšR}½üTôT0ëüëR…Ö­ð}T½üÜÐYP1bý1]ý0R RÂPYÝQÐPWÂP^,`RWnÐWPÐ^Q0ÊüÀW^ÐŽQÐŒPP…Ð^Q1iÿÈ€Z1LýÈ Z1FýÈZ1@ýÈZ1:ýàZàZÈZàZÞIiY>I ÐY	ÞHhX>H ÐXÈZ1ýÔXÈZÊZ1ýàZ
ÐŒYæÌZÎYYÞÐŒXÙÎXXÔàZÐX0ëÁ­øXWÐWVÔWÑWÐWÃWPøPnW®#óVÐWPÖ­øÖWøPïHÿÿÿW®xÿWPˆ­ï@®ž®QÐWVŸïSþÿÿŸ¡0ž¡0Sƒ,a‘Vc”c8Va¡0¡ÃVUQÐnSÔWé­ï-ƒÖWЭøP0ƒÑPVÐVPÂPVÂP­ø(PacЭøP,a0PcÐXPàZã	Z.ƒÎ­øPÑPXÐXPÂPX,a0PcÐXPÑPVÐVPÂPX(PacÐXPž@£ RÂ]RÂRPÐPXÂPX,a0PcÐSUºDeB+’ÖXàZÐX0ÒÐXWÑWÐWÃWPøPnW®Ö­øÃWPøPï=þÿÿW®xÿWPˆ­ï@®àZ=ž®Q&ÐQVíôPùPn8nï—ÿÿÿeÐVQàZ1,ýŒ ¥ü1%ýÐWV×XЭø­ôЭø1ÁþÁ­øP0ÂPÑPX(ÐWVÂPXž®Q0¥þàZà	Z‘u0û‘e.ÖUáZ•1Ýüž®Q0±ÿäZÚàZÐXÕXÐXâZ1.ÿ1+ÿ”­ïpŒU1ŸrUU–­ïïURž¢€RÄ;RžÂÄRž¢žRÆÄR0‚qPUÖRÐR­øÎRRÑR
dïáUÂRÀ	Rï\tPTUPUùP	®ø	®®tï²UPUùP®ÐXWŸïœþÿÿÑŽnÀ­øWÑW	qUˆ® ®®ˆ­ï®ÔPЭø®pPÔT~ïMSÕRÎRRâRáTRdcPÀSóTòåRgPPÑRÀïÄÿÿÿQÎRRÁ(RSáSïAÂï®ÿÿÿQšBïbT BÈCG@¾M ¼[É¿u­Å+¨¶pPB<ò‡öVvÓˆµbºõ2>HÛQS'±ïë¥I[ÙÍÿ¿—ý¼¶#,;
Í È:„äÜ’›ÀX®ïÂ^Ь[á«¨«ª«à«PÎPÔYÐYX1‡ö¬­ÿÐXÝXß­ÿ˜«~ûïùÐPYj˜ï0	~ûïÒÕPâ«Þï{
«Þïs
«á«BЫZö¬»Ö«ÁZPÑ«PѬ
ÃZ«PÐPXÝPÝZ˜«~ûï‘ÐPYÐZ«Ôkná«1mÿЫZ3Ñ[¨1xÿÝûïÇÐPZÐZ«¨«ƒ¨«ÔYÐYX ÃZ«YÐYXÐZ«ÝYÝZ˜«~ûï(ÐPY2ÿkö¬ŠÐZ«ÑXY¨ «1ïþЬPЬ[2«PÊùÿÿÿPÑPAЫZ;ÃZ«Y4ÐZ«³„«ÔP2PÐPkÝYÝZ˜«~ûï¼ÑPY¨ «ÎPÔPÞïÈ[Ý[ûïÀ[Ñ[ïòëЬ[ÎZ³«=à«8Ý[ûïeÿÿÿÐPZ˜«~ûï9ÕPÎZá«
Ý«ûﳌ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼¼ï(ÔPÂ^ß­úݬûïDÕPÔPÐP¼ïø¼ïèݬÝ	tݬûïݬÝtݬûï¼6ï¬ÕïH.É0$ï:É,$ï2Þï,ï/Þïï ÝÁ¬~ûï*ÐPYÐï	[Ôïék$ÐjkÐkZéj÷xYPÀ[PÑZPxYPÀ[PÑP[1¹Ð[ZËk[Ñ[ZËÑZïÊ	Ñ[,$ÔPñLÿÁYPÆPxPï£ÝûïbÐPZxïPÀZPÑPZÀxï€~ûï@ÐPZÑZÿÿÿÿ¥ÐZÿ]ÁïVPÑZPÈÿIxïJPÀZPÃPjÐjï3É,$ÿ'1ÿxYPÁ[PïÑZï
ÐÿïÐkÿùÉïòkÁ[PЬ[Ð[ZÂZÐZïÙËjPÐPjÂ^Ь[é«ü	Ý[ûïÎÿÿÿÃ[«üPÇP­ôݬûïNþÿÿÐPZÑZ[ÐZPÐ[­üÐZ­øÝÁ¬~ûïšÐPYÑY­ôÐY­ôЭüPЭøQÐ`aÀ­üÀ­øЭôP×­ôÕPâÑZ[´xYPÀZPÑP[¨xYPÀZPÂ[PÆPÐï9@j‘Áï̬~ÝÐ\SÐ^\¼ï_Ðï±PÀ£ï¨¼ïCЬï“ÔPЬPЬRÑRÔQ{RPPRÑPRÔPÐP¼ïÐPï…ÎPT{“¥Âä#5Zf‰size68: 
r%s: 
fmagic:	0%O
tsize:	0x%X
dsize:	0x%X
bsize:	0x%X
ssize:	0x%X
rtsize:	0x%X
rdsize:	0x%X
entry:	0x%X
0x%X+0x%X+0x%X = %D = 0x%X
fmagic:	0%O
tsize:	%D
dsize:	%D
bsize:	%D
ssize:	%D
rtsize:	%D
rdsize:	%D
entry:	0%O
%D+%D+%D = %D = 0%O
filename required following -%c optionunrecognized option: %cfile %s not foundunrecognized magic number %Ounrecognized type %o on symbol %scould not reopen pipe as stdoutcould not reopen pipe as stdincould not exec %sfile %s format error, unexpected eofpipe faileddup failed or returned wrong valuefork failed  ØD$—r<Ü~&Å .07~X>füGœÀOÐXf<ayDh–Po´Pw`€»€‡Ž •»Ìܦ7­ÏL´€t¼„Å DËÑ~<×rà	1àè\ò	äü	»è-mÍ 	4ð(w,x0y 4z$8{(<|,@}0D~4H8L<Q@V D[o|e"²nç6t~`¶‡£ä’yº›œD¢.˜¨¤Ü±
Œ¸«ÜÀtÇNXÎq˜×êß0ç‚V
ð´Øú. ;P€	—ÅÀ„#þü,[ª4f<=LnEœK•tR3`Z	
b–ÈlyHr	Ú z»¶€ †ŒÌ€L’Á˜7d¡	ÌD$¦Ï5«crt0.osize68.ofprintf.ofopen.ocreat.oprintf.ordwr.ofilbuf.olseek.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_argnum_namelist_filename_infile_hflag_lflag_nflag_rflag_filhdr_e1_e2_e3_e4_e5_e6_e7_e8_e9_e10_e11_e12_procargs_startup_size_nextname_cleanup_procflags_newname_error__iob_fprintf_fatal_malloc_fopen_fread_reverse_fclose_printf__doprnt__lastbuf_creat_close_open_errno_lseekcerror__filbuf_fwrite__flsbuf_fflush_read_write_isatty__sobuf__cleanup_free__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brkÿÿÐPZ˜«~ûï9ÕPÎZá«
Ý«ûﳌ«Ô«ªÿ«ÔkÐZPûï{ÿÿÿ¼¼ï(ÔPÂ^ß­úݬûïDÕPÔPÐP¼ïø¼ïèݬÝ	tݬûïݬÝtݬûï¼6ï¬ÕïH.É0$ï:É,$ï2Þïsumacc/cceun/   775      0     12           0  3472711347   6325 sumacc/cceun/makefile   444      0     12        1430  3472711336  10102 PRGS=cc68 as68 c268 ccom68 ld68 lorder68 nm68 pr68 rl68 size68
LIBS=a68.hdr libc68.a
CFLAGS= -noshare -O 

install: newh cc68
	-mkdir ../bin
	-mv $(PRGS) ../bin
	-mv $(LIBS) ../lib

cc68:	cc68.o
	cc ${CFLAGS} -o cc68 cc68.o
	rm cc68.h cc68.o

cc68.o:	cc68.h
  
newh:
	sed 's;MACROOT;$(MACROOT);' cc68.hdr >cc68.h

# 'zap' can be used after installing with Eunice to zap some directories
# if you are tight on space.  Van Jacobson's Eunice instructions 
# (cceun/README) use directories bin, include and lib to hold files
# needed for user access of the compiler, loader, rmaker, etc.
# You may also want to remove directories cmd, etc, fix, info, and ws
# if you don't need them.

zap:
	rm -rf ../cc41 ../cc42 ../h ../man 
	rm -rf ../lib/io ../lib/*.s ../lib/*.c ../lib/*.b ../lib/libmact.a

ç‚V
ð´Øú. ;P€	—ÅÀ„#þü,[ª4f<=LnEœK•tR3`Z	
b–ÈlyHr	Ú zsumacc/cceun/cc68.c   444      0     12       36141  3472711336   7340 /*
 * cc68 - front end for MC68000 C compiler
 *
 * Jeffrey Mogul @ Stanford	February 10 1981
 * 	- hacked up from cc.c
 *
 * V. Pratt March 1981
 * 	-v (version), -d (dl68), -r (rev68) options
 *
 * Bill Nowicki February 1982
 *	- Changed exec's with full pathnames to use search path
 *	- "-ifilename" option added to substitute file for crt0.b
 *	- Merged Pratt's "single module" check of Januray 1982
 *	- Merged in Mogul's undocumented .ls hack
 *	- Merged in Pratt's "-u" hack
 *
 * March 1982 (jcm, vrp, win)
 *	- Fixed bug regarding linking a single .b file
 *	- Removed Jeff's ANNOYING #ifdef
 *	- Added -vL for LucasFilms "temporary" kludge
 *	- files with no suffix assumed to be b.out format
 *	- Changed back to absolute path names (sigh)
 *
 * November 1982 (win)
 *	- Added -V option for V environment: -T 10000, -iteamroot.b, -lV
 *	- Added /usr/local/include to include path
 *
 * June 1983 (Per Bothner)
 *	- -V option now also does -DVsystem
 *
 * July 1983 (win)
 *	- Added -vx option to use experimental versions
 *
 * January 21 1984 (Marvin M. Theimer)
 *	- Changed DIRSIZ to MAXNAMLEN for 4.2 directory names.
 *	- Changed /usr/local to /usr/stanford (WIN)
 *
 * May 1984 (croft)
 *	- added "-m" switch for Macintosh environment
 * August 1984 (Van Jacobson, LBL)
 *	- removed lots of wired in pathnames to file cc68.h
 *	- added support of as68 -h (header file) flag.
 */

#define	BSD42	1

#include <sys/types.h>
#include <stdio.h>
#include <ctype.h>
#include <signal.h>

#ifdef BSD42
#include <sys/dir.h>
#else
#include <dir.h>
#define	MAXNAMLEN DIRSIZ
#endif

#include "cc68.h"

char	*cpp = "/lib/cpp";	/* C preprocessor */
char	*ccom = "ccom68";	/* Johnson's portable C compiler */
char	*c2 = "c268";		/* Terman's .s->.s optimizer */
char	*as = "as68";		/* Patrick's 68k assembler */
char	*ld = "ld68";		/* 68k link editor */
char	*dl = "dl68";		/* MACSBUG downloader */
char	*rev = "rev68";		/* Pratt's .b 68k reformatter */


char	tmp0[30];		/* big enough for /tmp/ctm%05.5d */
char	*tmp1, *tmp2, *tmp3, *tmp4, *tmp5;
char	*infile=0, *outfile=0;
char	*savestr(), *strspl(), *setsuf(), *setlongsuf();
char	*type;
int	idexit();
char	**av, **clist, **llist, **flist, **ulist, **plist;
int	cflag=0, 	/* skip link editing, result is filename.b */
	dflag=0,	/* 1 -> apply dl68 to yield filename.d */
	eflag=0, 	/* error flag; records errors */
	gflag=0, 	/* 1 -> ccom68 generates info for sdb68 (nonexistent)*/
	lflag=0,	/* 1 -> as68 generates listing */
	oflag=0, 	/* optimization flag; 1 -> invoke o68 */
	pflag=0,	/* 1 -> don't delete temporary files */
	rflag=0,	/* 1 -> apply rev68 to yield filename.r */
	Rflag=0,	/* 1 -> ld68 preserves relocation bits */
	sflag=0,  	/* 1 -> skip assembly, result is filename.s */
	wflag=0,  	/* -w flag passed to ccom68 */
	zflag=0,	/* print exec() trace */
	exflag=0, 	/* 1 -> only apply cpp, result to stdout */
	noxflag=0,	/* 1 -> -x flag off -> output local symbols */
	Vflag=0,	/* 1 -> V kernel environment */
	mflag=0,	/* 1 -> Macintosh environment */
	proflag=0;	/* profile flag: generate jbsr mcount for each fctn */
int	
	exfail;
char	*chpass=0,
	*version=0,	/* version: -vm, -v1, -v2, ... */
	*Torg=0,	/* Text origin */
	*entrypt=0,	/* entry point */
	*npassname=0;

int	nc=0, 	/* no of programs for ccom */
	nl=0, 	/* no of .b inputs for ld (including libraries) */
	nm=0,	/* no of modules (excluding libraries) */
	nf=0,	/* no of flags for ld68 */
	nu=0,	/* no of files of unknown type */
	np=0, 	/* no of args for cpp */
	na=0;	/* no of args to each callsys */

#define	cunlink(s)	if (s&&!zflag) unlink(s)

main(argc, argv)
	char **argv;
{
	char *t;
	char *assource;
	int i, j, c;

	/* ld currently adds upto 5 args; 20 is room to spare */
	/* [Does this apply to ld68?  - pratt] */
	av = (char **)calloc(argc+20, sizeof (char **));
	clist = (char **)calloc(argc, sizeof (char **));
	llist = (char **)calloc(argc, sizeof (char **));
	flist = (char **)calloc(argc, sizeof (char **));
	ulist = (char **)calloc(argc, sizeof (char **));
	plist = (char **)calloc(argc, sizeof (char **));
	for (i = 1; i < argc; i++) {
		if (*argv[i] == '-') switch (argv[i][1]) {

		case '-':	/* negate some default */
			switch(argv[i][2]) 
			  {
				case 'x':
					noxflag++;
					break;
		    	  }
			break;

		case 'S':
			sflag++;
			cflag++;
			break;

		case 'e':
			if (++i < argc)
				entrypt = argv[i];
			break;
		case 'o':
			if (++i < argc) {
				outfile = argv[i];
				switch (getsuf(outfile)) {

				case 'c':
					error("-o would overwrite %s",
					    outfile);
					exit(8);
				}
			}
			break;
		case 'T':
			if (++i < argc) 
				Torg = argv[i];
			break;
		case 'u':
			if (++i < argc) {
				llist[nl++] = "-u";
				llist[nl++] = argv[i];
			}
			break;
		case 'O':
			oflag++;
			break;
		case 'p':
			proflag++;
			break;
		case 'g':
			gflag++;
			break;
		case 'L':			/* WIN */
			lflag++;
			break;
		case 'w':
			wflag++;
			break;
		case 'E':
			exflag++;
		case 'P':
			pflag++;
			if (argv[i][1]=='P')
				fprintf(stderr,
	"cc68: warning: -P option obsolete; you should use -E instead\n");
			plist[np++] = argv[i];
			break;
		case 'c':
			cflag++;
			break;
		case 'd':
			dflag++;
			break;
		case 'r':
			rflag++;
			break;
		case 'R':
			Rflag++;
			break;
		case 'D':
		case 'I':
		case 'U':
		case 'C':
			plist[np++] = argv[i];
			break;
		case 't':
			if (chpass)
				error("-t overwrites earlier option", 0);
			chpass = argv[i]+2;
			if (chpass[0]==0)
				chpass = "012p";
			break;
		case 'B':
			if (npassname)
				error("-B overwrites earlier option", 0);
			npassname = argv[i]+2;
			if (npassname[0]==0)
				npassname = "/usr/c/o";
			break;
		case 'l':
			llist[nl++] = argv[i];/* NOT flist, order matters! */
			break;
		case 'v':
			version = argv[i];
			break;
		case 'i':
			crt0 = argv[i]+2;
			break;
		case 'z':	/* trace exec() calls */
			zflag++;
			break;
		case 'V':	/* V environment */
			crt0 = (version && version[2]=='x') ? 
				xteamroot : teamroot;
			Torg = "10000";
			Vflag++;
			break;
		case 'm':	/* Macintosh environment */
			crt0 = macroot;
			Torg = "0";
			entrypt = "_start";
			mflag++;
			Rflag++;
			break;
		default:
			flist[nf++] = argv[i];
			break;
		}
		else {			/* not a flag */
			t = argv[i];
			c = getsuf(t);
			if (c=='c' || c=='s' || exflag) {
				clist[nc++] = t;
				t = setsuf(t, 'b');
				c = 'b';
			}
			if (c=='a' || c=='b') 
			  {
				if (nodup(llist, t))
				  {
					llist[nl++] = t;
					nm++;	/* count programs */
				  }
			  }
			else if (!strcmp(t,"b.out") || !index(t,'.') )
				infile = t;
			else {
				ulist[nu++] = t; /* Unrecognized suffix */
				nm++;
			}
		}
	}	/* End of loop to process arguments */
	for (i=0; i<nu; i++) {
		if (exflag||sflag||cflag) {
			clist[nc++] = ulist[i];
			type = "C code (type .c)";
		}
		else if (dflag||rflag) {
			infile = ulist[i];
			type = "b.out format";
		} 
		else {
			llist[nl++] = ulist[i];
		       	type = "relocatable binary (type .b)";
		}

		fprintf(stderr,
		       "cc68: warning: %s has unrecognized suffix, taken to be %s\n",
		       infile,type);
	}
	if (version && version[2]=='m') crt0 = maccrt0;
	if (version && version[2]=='x') crt0 = xteamroot;
	if (!nl && !infile) {
		fprintf(stderr,"cc68: no input specified\n");
		exit(8);
	}
	if ((eflag||sflag||cflag) && (dflag || rflag)) {
		fprintf(stderr,"cc68: warning: -E,-S,-c disable -d,-r\n");
		dflag = 0;
		rflag = 0;
	}
	if (gflag) {
		if (oflag)
			fprintf(stderr, "cc68: warning: -g disables -O\n");
		oflag = 0;
	}
	if (npassname && chpass ==0)
		chpass = "012p";
	if (chpass && npassname==0)
		npassname = "/usr/new";
	if (chpass)
	for (t=chpass; *t; t++) {
		switch (*t) {

		case '0':
			ccom = strspl(npassname, "ccom");
			continue;
		case '2':
			c2 = strspl(npassname, "c2");
			continue;
		case 'p':
			cpp = strspl(npassname, "cpp");
			continue;
		}
	}
	if (proflag)
		crt0 = profcrt0;
	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
		signal(SIGINT, idexit);
	if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
		signal(SIGTERM, idexit);
	if (pflag==0)
		sprintf(tmp0, "/tmp/ctm%05.5d", getpid());
	tmp1 = strspl(tmp0, "1");
	if (nc==0)
		goto nocom;
	tmp2 = strspl(tmp0, "2");
	tmp3 = strspl(tmp0, "3");
	if (pflag==0)
		tmp4 = strspl(tmp0, "4");
	if (oflag)
		tmp5 = strspl(tmp0, "5");
	for (i=0; i<nc; i++) {
		if (nc > 1) {
			printf("%s:\n", clist[i]);
			fflush(stdout);
		}
		if (getsuf(clist[i]) == 's') {
			assource = clist[i];
			goto assemble;		/* thereby skipping ccom68 */
		} else
			assource = tmp3;
		if (pflag)
			tmp4 = setsuf(clist[i], 'i');
		av[0] = "cpp"; av[1] = clist[i]; av[2] = exflag ? "-" : tmp4;
		na = 3;
		for (j = 0; j < np; j++)
			av[na++] = plist[j];
		if (version)
			if (strcmp(version,"-vx") == 0)
				av[na++] = sunxincludes;
		if (version)
			if (strcmp(version,"-vm") == 0)
				av[na++] = dmincludes;
		av[na++]=sunincludes;
		av[na++]=localincludes;
		av[na++]=defines;
		if (Vflag)
			av[na++] = "-DVsystem";
		av[na++] = 0;
		if (callsys(cpp, av)) {
			exfail++;
			eflag++;
		}
		if (pflag || exfail) {
			cflag++;
			continue;
		}
		if (sflag)
			assource = tmp3 = setsuf(clist[i], 's');
		av[0] = "ccom"; av[1] = tmp4; av[2] = oflag?tmp5:tmp3; na = 3;
		if (proflag)
			av[na++] = "-XP";
		if (gflag)
			av[na++] = "-Xg";
		if (wflag)
			av[na++] = "-w";
		av[na] = 0;
/*		if (callsys(ccom, av)) {
			cflag++;
			eflag++;
			continue;
		} */
		{ /* this is a hack.  */
		char command[100];
		if ( *ccom != '/' )
			sprintf(command,"%s%s <%s >%s",
				BinDirectory,ccom,av[1],av[2]);
		else
			sprintf(command,"%s <%s >%s",ccom,av[1],av[2]);

		if (zflag) printf( "\t%s\n", command );
		if(system(command)) {
		    eflag++;
		    continue;
		    }
		}
		if (oflag) {
			av[0] = "c2"; av[1] = tmp5; av[2] = tmp3; av[3] = 0;
			if (callsys(c2, av)) {
				unlink(tmp3);
				tmp3 = assource = tmp5;
			} else
				unlink(tmp5);
		}
		if (sflag)
			continue;
	assemble:
		cunlink(tmp1); cunlink(tmp2); cunlink(tmp4);
		na = 0;
		av[na++] = "as68"; 
		av[na++] = "-o"; 
		if (cflag && nc == 1 && outfile)
			av[na++] = outfile;
		else av[na++] = setsuf(clist[i], 'b');
		av[na++] = "-g";	/* permits undefined symbols in as68 */
		if (lflag) {
			av[na++] = "-L";
			av[na++] = setlongsuf(clist[i], "ls");
		}
		av[na++] = "-h";
		av[na++] = asheader;
		av[na++] = assource;
		av[na] = 0;
		if (callsys(as, av) > 1) {
			cflag++;
			eflag++;
			continue;
		}
	}		/* End of loop to produce .b files */

nocom:			/* link edit files in llist[0:nl-1] */
	if (cflag==0 && nl!=0) {
		na = 0;
		av[na++] = "ld";
		av[na++] = "-X";
		if (Rflag)
			av[na++] = "-r";
		if (mflag)
			av[na++] = "-d";
		if (version)
			av[na++] = version;
		if (entrypt) {
			av[na++] = "-e";
			av[na++] = entrypt;
		}
		if (Torg) {
			av[na++] = "-T";
			av[na++] = Torg;
		}
		av[na++] = crt0;	/* startup */
		if (dflag || rflag) {	/* if dl or rev then just output to */
			av[na++] = "-o";/* temporary file */
			av[na++] = infile = tmp1;
		}
		else if (outfile) {	/* else if outfile exists then */
			av[na++] = "-o";/* output to it.  Default is b.out */
			av[na++] = outfile;
		}
		for (i=0; i<nf; i++)	/* supply all flags */
			av[na++] = flist[i];
		for (i=0; i<nl; i++)	/* supply all .b arguments */
			av[na++] = llist[i];
		if (gflag)
			av[na++] = libg68;
		if (mflag)
			av[na++] = libmac;
		if (Vflag)
			av[na++] = libv68;
		else
			av[na++] = libc68;	/* libc.a only if not V */
		if (!noxflag)	       /* add -x by default unless --x given */
			av[na++] = "-x";
		av[na++] = 0;			/* argument delimiter */
		eflag |= callsys(ld, av);	/* invoke ld68 */

		if (nc==1 && nm==1 && eflag==0)
		    /*
		     * If we have only one module AND it was compiled
		     * (as opposed to just linked) then remove the .b file.
		     */
			unlink(setsuf(clist[0], 'b'));
	}

dnload:
	if (dflag && eflag==0) {
		na = 0;
		av[na++] = "dl";
		av[na++] = infile;
		if (version)
			av[na++] = version;
		if (Torg) {
			av[na++] = "-T";
			av[na++] = Torg;
		}
		av[na++] = "-o";
		av[na++] = outfile?	outfile:
			   nl?		strspl(setsuf(llist[0],'d'),"l"):
			   		"d.out";
		av[na++] = 0;
		eflag |= callsys(dl, av);	/* invoke dl68 */
	}

reverse:

	if (rflag && eflag==0) {
		na = 0;
		av[na++] = "rev";
		av[na++] = infile;
		av[na++] = outfile && !dflag?	outfile:
			   nl?			setsuf(llist[0],'r'):
			   			"r.out";
		av[na++] = 0;
		eflag |= callsys(rev, av);
	}

	dexit();
}

idexit()
{

	eflag = 100;
	dexit();
}

dexit()
{

	if (!pflag) {
		cunlink(tmp1);
		cunlink(tmp2);
		if (sflag==0)
			cunlink(tmp3);
		cunlink(tmp4);
		cunlink(tmp5);
	}
	exit(eflag);
}

error(s, x)
	char *s, *x;
{
	FILE *diag = exflag ? stderr : stdout;

	fprintf(diag, "cc68: ");
	fprintf(diag, s, x);
	putc('\n', diag);
	exfail++;
	cflag++;
	eflag++;
}

getsuf(as)
char as[];
{
	register int c;
	register char *s;
	register int t;

	s = as;
	c = 0;
	while (t = *s++)
		if (t=='/')
			c = 0;
		else
			c++;
	s -= 3;
	if (c <= MAXNAMLEN && c > 2 && *s++ == '.')
		return (*s);
	return (0);
}

char *
setsuf(as, ch)
	char *as;
{
	register char *s, *s1;

	s = s1 = savestr(as);
	while (*s)
		if (*s++ == '/')
			s1 = s;
	s[-1] = ch;
	return (s1);
}

char *
setlongsuf(as, suff)
char *as;
char *suff;
{
	register char *s, *s1;
	register int suflen = strlen(suff);

	s = s1 = savestr(as);
	while (*s)
		if (*s++ == '/')
			s1 = s;
	s[-1] = 0;
	if (strlen(s1) > (MAXNAMLEN - suflen)) {
		s[-suflen] = 0;
		s[-(suflen-1)] = '.';
	}
	return(strspl(s1,suff));
}


callsys(f, v)
	char *f, **v;
{
	int t, status;
	char cmd[256];
	
	if (version && version[2]=='L' && *f!='/')
	  {
	  	/*
		 * We substitute the LucasFilms versions of the loader,
		 * compiler, assembler, etc. if the -vL option was set,
		 * and we have an unqualified pathname.
		 */
	    strcpy( cmd, LucasKludge);
	    strcat( cmd, f);
	  }
	 else if (*f!='/')
	   {
	       /*
	        * add the binary directory at the begining if not
		* already specified, so you can have other versions
		* in your path without screwing up.
		*/
	    strcpy( cmd, BinDirectory);
	    strcat( cmd, f);
	   }
	 else strcpy( cmd, f);

	if (zflag) 
	  {
	  	/*
		 * print out a trace of all commands executed
		 */
	    char **arg = v+1;
	    printf( "\t%s ", cmd);
	    while (*arg) printf( "%s ", *arg++);
	    printf("\n");
	  }
	t = vfork();
	if (t == -1) {
		printf("No more processes\n");
		return (100);
	}
	if (t == 0) {
		execvp( cmd, v);
		printf("Can't find %s\n", cmd);
		fflush(stdout);
		_exit(100);
	}
	while (t != wait(&status))
		;
	if ((t=(status&0377)) != 0 && t!=14) {
		if (t!=2) {
			printf("Fatal error in %s\n", cmd);
			eflag = 8;
		}
		dexit();
	}
	return ((status>>8) & 0377);
}

nodup(l, os)
	char **l, *os;
{
	register char *t, *s;
	register int c;

	s = os;
	if (getsuf(s) != 'b')
		return (1);
	while (t = *l++) {
		while (c = *s++)
			if (c != *t++)
				break;
		if (*t==0 && c==0)
			return (0);
		s = os;
	}
	return (1);
}

#define	NSAVETAB	1024
char	*savetab;
int	saveleft;

char *
savestr(cp)
	register char *cp;
{
	register int len;

	len = strlen(cp) + 1;
	if (len > saveleft) {
		saveleft = NSAVETAB;
		if (len > saveleft)
			saveleft = len;
		savetab = (char *)malloc(saveleft);
		if (savetab == 0) {
			fprintf(stderr, "ran out of memory (savestr)\n");
			exit(1);
		}
	}
	strncpy(savetab, cp, len);
	cp = savetab;
	savetab += len;
	saveleft -= len;
	return (cp);
}

char *
strspl(left, right)
	char *left, *right;
{
	char buf[BUFSIZ];

	strcpy(buf, left);
	strcat(buf, right);
	return (savestr(buf));
}

ibc.a only if not V */
		if (!noxflag)	       /* add -x by default unless --x given */
			av[na++] = "-x";
		av[na++] = 0;			/* argument delimiter */
		eflag |= callsys(ld, av);	/* invoke ld68 */

		if (nc==1 && nm==1 && eflag==0)
		    /*
		     * If we have only one module AND it was compiled
		     * (as opposed to just linked) then remove the .b file.
		     */
			unlink(setsuf(clist[0], 'b'));
	}

dnload:
	sumacc/cceun/a68.hdr   444      0     12        1373  3472711336   7505 | Pre-Assembly Code

| The remainder of this file consists of statements that are 
| interpreted before every 68000 program.

| Define Register Names

.defrs	d0, 0., d1, 1., d2, 2., d3, 3.
.defrs  d4, 4., d5, 5., d6, 6., d7, 7.
.defrs	a0, 8., a1, 9., a2, 10., a3, 11.
.defrs	a4, 12., a5, 13., a6, 14., a7, 15.
.defrs	sp, 15., pc, 16., cc, 17., sr, 18., usp, 19.
| Next line is for 68010. --TPM
.defrs  sfc, 20., dfc, 21., vbr 22.

| Set Input and Output Radices

.radix	in, decimal
.radix	out, hex

| Define registers for movem
| D3 means just d3, D3+A2 means d3 and a2, A2-D3 means a1,a0,d7,...,d4,d3

D0	=	/1
D1	=	/2
D2	=	/4
D3	=	/8
D4	=	/10
D5	=	/20
D6	=	/40
D7	=	/80
A0	=	/100
A1	=	/200
A2	=	/400
A3	=	/800
A4	=	/1000
A5	=	/2000
A6	=	/4000
A7	=	/8000
ALL	=	0
xit(eflag);
}

error(s, x)
	char *s, *x;
{
	FILE *diag = exflag ? stderr : stdout;

	fprintf(diag, "cc68: ");
	fprintf(diag, s, x);
	putc('\n', diag);
	exfail++;
	cflag++;
	eflag++;
}

getsuf(as)
char as[];
{
	register int c;
	register char *s;
	register int t;sumacc/cceun/cc68.h   444      0     12        1653  3472711336   7325 #ifndef MAXNAMLEN
#define MAXNAMLEN 255
#endif

# define LucasKludge ""
# define BinDirectory "/usr/macintosh/bin/"
/* run-time start-up */
char	*crt0 = "/usr/macintosh/lib/crtsun.b";
char	*maccrt0 = "/usr/macintosh/lib/crt0.b";
char	*profcrt0 = "/usr/macintosh/lib/mcrt0.b";
char	*macroot = "/usr/macintosh/lib/crtmac.b";
char	*teamroot = "/usr/macintosh/lib/teamroot.b";
char	*xteamroot = "/usr/macintosh/xlib/teamroot.b";
char	*sunincludes = "-I/usr/macintosh/include";
char	*sunxincludes = "-I/usr/macintosh/xinclude";
char	*localincludes = "-I/usr/macintosh/include";
char	*dmincludes = "-I/usr/macintosh/include";
char	*asheader = "/usr/macintosh/lib/a68.hdr";	/* assembler header file */
char	*libmac = "/usr/macintosh/lib/libmac.a";
char	*libc68 = "/usr/macintosh/lib/libc68.a";
char	*libv68 = "/usr/macintosh/lib/libv68.a";
char	*libg68 = "/usr/macintosh/lib/libg68.a";
char	*defines = "-DMC68000";	/* tell cpp this is a 68000 */
ag++;
}

getsuf(as)
char as[];
{
	register int c;
	register char *s;
	register int t;sumacc/cceun/cc68.hdr   555      0     12        1473  3472711337   7657 #ifndef MAXNAMLEN
#define MAXNAMLEN 255
#endif

# define LucasKludge ""
# define BinDirectory "MACROOT/bin/"
/* run-time start-up */
char	*crt0 = "MACROOT/lib/crtsun.b";
char	*maccrt0 = "MACROOT/lib/crt0.b";
char	*profcrt0 = "MACROOT/lib/mcrt0.b";
char	*macroot = "MACROOT/lib/crtmac.b";
char	*teamroot = "MACROOT/lib/teamroot.b";
char	*xteamroot = "MACROOT/xlib/teamroot.b";
char	*sunincludes = "-IMACROOT/include";
char	*sunxincludes = "-IMACROOT/xinclude";
char	*localincludes = "-IMACROOT/include";
char	*dmincludes = "-IMACROOT/include";
char	*asheader = "MACROOT/lib/a68.hdr";	/* assembler header file */
char	*libmac = "MACROOT/lib/libmac.a";
char	*libc68 = "MACROOT/lib/libc68.a";
char	*libv68 = "MACROOT/lib/libv68.a";
char	*libg68 = "MACROOT/lib/libg68.a";
char	*defines = "-DMC68000";	/* tell cpp this is a 68000 */
ib/teamroot.b";
char	*xteamroot = "MACROOT/xlib/teamroot.b";
char	*sunincludes = "-IMACROOT/include";
char	*sunxincludes = "-IMACROOT/xinclude";
char	*localincludes = "-IMACROOT/include";
char	*dmisumacc/cceun/README   555      0     12       16706  3472711337   7322 [Below are some notes from Van Jacobson on his experiences installing
SUMacC under Eunice.  I have done some editing and added some comments 
in brackets.  --Bill Croft]



Eunice SUMACC
-------------

This directory contains the changes necessary to run SUMACC under VMS
Eunice.  It was prepared by Van Jacobson, Real Time Systems Group,
Lawrence Berkeley Laboratory, University of California.  Please let me
know if you have problems, or find bugs in the Eunice part of SUMACC.
If you send me mail saying you've got the Eunice Sumacc, I'll send you
mail whenever there are bug fixes, upgrades, etc.  My mail address is:

	van@lbl-csam.arpa or
	ucbvax!lbl-csam!van

Good luck!

  -Van Jacobson, August, 1984


Installation
------------
Do all of the installation in Eunice, not from dcl.

-- Decide on a permanent home for this package.  In the description
   that follows, I'll assume you've picked the name "/usr/macintosh".
   All of the Sumacc package will go into directories under
   "/usr/macintosh".  

   [I know of other Eunice sites that have placed the various binary, include
   and library files in the 'standard' Eunice places.  This may require more
   work however].

-- Create the Mac root directory & copy the distribution tar file into it.
   Then extract the tar file.

	mkdir /usr/macintosh
	cp esumac.tar /usr/macintosh
	cd /usr/macintosh
	tar xf esumac.tar
	rm esumac.tar

   [You've probably already done this, or you couldn't be reading this file!
   You may want to reextract it though, to put it in its 'final home'].

-- Edit the top level makefile to define MACROOT as the name of the
   root directory;  comment out the UNIX defines for DI DL and DP, and
   'uncomment' the Eunice lines.

-- CHDIR back to this (cceun) directory and type 'make MACROOT=/usr/macintosh'
   This will install the C compiler under Eunice.

	cd cceun
	make MACROOT=/usr/macintosh

-- [Now you should do whatever Eunice magic is necessary so that your
   executable 'search path' includes /usr/macintosh/bin.  This is so the
   makefiles in the other directories can access the cc68 stuff without
   any Eunice specific prefixes].

-- CHDIR to top level and type 'make'.

	cd ..
	make

-- You should now have a working Sumacc.  The last thing done by the
   "make" is the generation of a bunch of example programs so, if you
   get through the "make" with no errors it's at least 90% operational.
   If you get any errors during the "make", find a local Unix wizard or
   try to reach me on the telephone (415-486-6411, I wish you luck).

-- When things are working, tell anyone who wants to use Sumacc to include
   "/usr/macintosh/bin" in their shell search path.  Unix-phobes can
   run things from dcl in the usual Eunice way.  E.g.,
     $ cc68 :== $dra0:[usr.macintosh]cc68. cc68
     $ rmaker :== $dra0:[usr.macintosh]rmaker. rmaker
     etc.

-- Sumacc only uses things in the sub-directories "bin", "lib" and "include".
   Once it's been installed, you're free to remove any of the others.  

----------

[And here are some notes from another Eunice site, at Stanford:]

From: CALVIN TEAGUE <cal@su-star>
Subject: New sumacc release

Bill, I got the new tar file transferred and started the installation.
I didn't really understand the "MACROOT" stuff in the makefile, so I left
the original definitions for DL, DP, and DI and started the installation.
I don't see any problem in doing that under our Eunice.  So far, I have
found the following problems:

1.  At least for my version of Eunice, I changed  ttyfd = fileno(stdin)  to
	ttyfd(stdout) for both  macput.c  and  macget.c.

2.  In  macget.c,  I added   #define NO_RENAME   at the top; I'm not sure
	how to pass the  -DNO_RENAME  flag through the various levels of make.

By the way, I have a few changes to the  paintimp  program which you may want
to include.  These consist of a couple of Impress commands (EOF,
@document(language impress), etc.) and trapping of totally blank lines and
putting out just a CRLF character in that case.  (This resulted in almost a
factor of 3 reduction in the size of the DVI files that I tried.)  Also, one
of our users is working (tonight, I think) on a change for macput and macget
which would make those programs happier with VMS-style text files.  (Right
now, we have to convert VMS text files to Unix-style text files for the file
length to come out right).  I'll pass these on to you as soon as they're ready.
The  mwdvi  program from info-mac worked fine without any changes.
(Is anyone working on a MacDraw->Impress program yet?)

Cal
------

Date: 15 Nov 84 18:33:00 PST
From: CALVIN TEAGUE <cal@su-star>
Subject: new sumacc release installed
To: croft <croft@safe>

I decided to go back to the "standard" placements; also, it's
compatable with the other machines here on campus.  The installation
seemed to complete without any problems.  I recompiled my editor
program, and the program performed as it did on the earlier compiler
(not to say that it worked right!).  The  .b  files were the same size,
but the  .rsrc  file was 19106 bytes vs. 20898 bytes for the previous
rmaker.  The new one must be a little smarter.

The Eunice procedure isn't quite as straightforward as it first appears.
Here is a summary of what I had to do.  You might want to include some of
this in the installation documentation.

1.  Restore the tar file to a convenient location.  I used  /usr/local/mac.

2.  Edit files for site-specific changes.

	In my case, the changes were:

	a.  In  cmd/macget.c,  insert   #define NO_RENAME 1   at the top
		(for 4.1 rename).

	b.  In both  cmd/macget.c  &  cmd/macput.c,  change
		ttyfd=fileno(stdin)  to  ttyfd=fileno(stdout)
		(for Eunice I/O).

3.  Change  cceun/cc68.hdr  to reflect the "standard" file placements.
	In my case, the file became:

	----------
	#ifndef MAXNAMLEN
	#define MAXNAMLEN 255
	#endif

	# define LucasKludge ""
	# define BinDirectory "/usr/stanford/bin/"
	/* run-time start-up */
	char	*crt0 = "/usr/sun/lib/crtsun.b";
	char	*maccrt0 = "/usr/sun/lib/crt0.b";
	char	*profcrt0 = "/usr/sun/lib/mcrt0.b";
	char	*macroot = "/usr/sun/lib/crtmac.b";
	char	*teamroot = "/usr/sun/lib/teamroot.b";
	char	*xteamroot = "/usr/sun/xlib/teamroot.b";
	char	*sunincludes = "-I/usr/sun/include";
	char	*sunxincludes = "-I/usr/sun/xinclude";
	char	*localincludes = "-I/usr/stanford/include";
	char	*dmincludes = "-I/usr/sun/dm/include";
	char	*asheader = "/usr/sun/lib/a68.hdr";	/* assembler h file */
	char	*libmac = "/usr/sun/lib/libmac.a";
	char	*libc68 = "/usr/sun/lib/libc68.a";
	char	*libv68 = "/usr/sun/lib/libv68.a";
	char	*libg68 = "/usr/sun/lib/libg68.a";
	char	*defines = "-DMC68000";	/* tell cpp this is a 68000 */
	----------

4.  Change  cceun/makefile  to reflect the "standard" file placements.
	In my case, the file became:

----------
	PRGS=cc68 as68 c268 ccom68 ld68 lorder68 nm68 pr68 rl68 size68
	LIBS=a68.hdr libc68.a
	CFLAGS= -noshare -O 

	install: newh cc68
		-mkdir /usr/stanford/bin
		-mkdir /usr/sun/lib
		-mv $(PRGS) /usr/stanford/bin
		-mv $(LIBS) /usr/sun/lib

	... etc
----------

5.  In  cceun/cc68.c,  comment out the   #define BSD42 1   line. (for 4.1
	Eunice).

6.  In  lib/Makefile,  use   mk41lint   instead of   lint   (4.1, Eunice).
	Leave the original Unix definitions for DP, DL, DI.

7.  Change   lib/mk41lint   to a VMS text file by using    unixtovms.
	This file was originally a 512-byte fixed-length file, which
	Eunice tries to load as an executable image, encountering a
	bad header.

8.  cd to  cceun,  and issue   make.  (MACROOT no longer used).

9.  cd back to the mac root (/usr/local/mac) and issue   make.
------

yfd = fileno(stdin)  to
	ttyfd(stdout) for both  macput.c sumacc/cceun/as68   555      0     12      150361  3472711341   7155 €,<H0202ÿÿÿÿÿÿÿÿh€AS680à"t{aûŒ1.01 (UNIX ld)<<
?
R$_«
LIBCSHARE_001$kt¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿx,l 1&
Ô~Ý]ûï
¾Ÿï>ûïî½Ô~û_ÝÝ]ûïè½úlïýݬݬݬûïÔ~ûï¿ݬݬûï
ÕP1‰1‘ûï.cûïÕP5ûï–rÕP*ûïëIÕPûïæ;ÕPûï‘ÕP	ÝûïQÀïÚ ïA Ðïß PÐï4  Ðï,œQР¡Ðï œPÑï  Ðï  Õïw1oÿÕï”xÎPÔPÝPûï̾Â$^Ðïm ­Üß­àûïá^ÕP1áßï@wß­àûïîaÕPûïÑaÝûïŒVÝóßïwß­àûïÂaÕPÝßïwß­àûï®aÕPÔßïüvß­àûïšaÕPݳûï¿	Ýûï¸CÔPßïÕvß­àûïmaÕPוïןØßï½vß­àûïQaÕP0ûï®ÕP¹ûï½^Þï	ŸPÐQ‘A`,Öï}ŸÐPЭÜïqŸòÕïÖu×ïÎu	Ý#ûïQÞïÑuPÐï¶uQ•A`ÔPÐPöPïJŸÝûïCÑïuÝûï_Öï|u•ïŸÔPûïÞïwuQÐï\uRöPBaÞïUuPÐïJuSBaC`ÞïRuPÐï7uQ•A`ÔPÐPöPïËžÝûï†BЬPÑPÑP=ÑPfÝPßï–uûïägÔPyÞïìtPÐïátQÞïîtRÐïÓtSA`Cb@ÞïÉtPÐï¾tQ•A`ÔPÐPÞï¿tQÐï¤tRöPBaÞï«tPÐïtQöA`Þï™tPÐï~tQ•A`†ÐPöPïžÝûïÑAÂ0^ß­Øûïe\ÕPÝûïhÔPß­Øûï_ûïê\Þï6PÐï·Q‘A`,ÖïªûïÉ\”­×ßïÅtß­Øûï4_öP­×ßï²tß­Øûï_ÕPJß­Øûïì[ÕPÝ…ß­Øûï¾lÐP­Ðá ÐPÔPöP­Ö•­×˜­ÖP•­×ÔPÐP˜PPßûï>ÐøÔ­ü_x­üPÝà(xß­Øûï¡^ÕPCÕ­øx­üPá@ïsÐPÕ­øx­üPà@ïhséÕ­ø1ïþx­üPà@ïRsÓ1ÞþÖ­üx­üPÕà(x”1Âþßï´tßïFÙûﭻݬݬßï3Ùûïš»ûïS¾Ь[Ñï€y‘ïrtW)ö ïgt×ïUtÐ[ïRtÖïDtÔZÑJïQœ[
Õï7tÜÖZÑZï/táÐï'tPÐ[@ï*œÖïtÑïyÕïtݬûïsÿÿÿ×ïåsÖïãsWïçsßïjØûï•ï±x
ÝûïÕï¨s	Õï¤sÝï›sÝï‘sßï²sݬû‘ïwxÝï~sßïÒsݬûï|ºÔ[(ÐKïo›PÝ@ï›rÝKï`›ßïºsݬûïRºÖ[Ñ[ï;sÏÂ^Õï)s•ïxöïþwÞï¤×ïã›ÝûïÎ>”ïäwÂ^Ь[ûïþYÞïJšPÐïËšQ˜A`~ûïQ;ÕP
Ô«Ô«ÐPÝ[ûï~ÕP1¦1#1ÑP%1Ù1ïÑP!1d˜­ï~ßï"wûïÓýÿÿÝûïúýÿÿ1ì‘kï‘­ðéÕ«Õ­ôßÕ­ôЭô«À­ø«˜­ñPÊûÿÿÿP˜«QÈPQöQ«0‘k³‘­ð­Õ­ôÕ«£Ð­ôPЫQÑ ¡”Ô«ˆ«­ø«ûïYÞïf™PÐïç™QA`­ï˜­ï~ûïh:ÕP1ÿ‘­ï(÷‘­ï>‘­ï<Öï·™Ðï±™P@ï!™­ïßïv˜­ï~ûïx[ÕP13Ö߭ðûïUÕPÔP˜­ïPÑP/"1ðÑP*1ÄþÕ«1çþÕ­ôøÄ­ø«1RÿÕ«1ÒþÕ­ôøÆ­ø«1=ÿÕ«1½þÕ­ôøÒ­øPÊP«1%ÿÕ«1¥þÕ­ôøÈ­ø«1ÿÕ«1þÕ­ôøЫPÇ­øPQÄ­øQÃQP«1îþÕ«1nþÕ­ôøx­ø««1×þÕ«1WþÕ­ôøέøPxP««1½þÕ«1=þÕ­ôøx«PÉ­øP«1¢þÑP&1]ÿ1þÑP-1_þ1þÑP+1þ1öýÑP>£ÑP<…1çýÑP^1Tÿ1ØýÝ
1æýÂ^Ô­øÔ­üx­øPï¬QÉQP­øxÿ¬¬ò­üäЭøPÂ8^Ь[ûï@WÞPÐï
˜Q‘A`+Öï˜Ý[ûïÍÿÿÿÞïh—PÐïé—Q‘A`-1†ÖïÙ—Ý[ûï¦ÿÿÿÕPÔPÕ«	ÝûïKûÿÿΫ«WÖï®—Ý[ûï{ÿÿÿÕPÕÕ«	Ýûï#ûÿÿÝ«ûï3ÿÿÿÐP«&Öï}—Ý[ûïJÿÿÿÕP¤Õ«	ÝûïòúÿÿÒ««ÐPÞïË–PÐïL—Q‘A`!‘Þï·–PÐï8—Q‘A`~­ß­àûï¦UÕP1à‘­à0‘­à9ß­àûïY‘`$1€ß­àûï[fÐP­Ìè •ïùs	ÝûïnúÿÿЭÌPá Р«ЭÌPà 	ÝûïLúÿÿÔ«ЭÌPá ök1MÿЭÌPá Õ 	РPá ÔPЭÌPÐP«ö
k1$ÿÝ[Ýïñr-Öïq–ß­àûïçTÕPÝûïêùÿÿ1‹þÝ[ЭØPÝ@ïÖrß­àûïÌÔ­Ø#ÞﬕPÐï-–QÞï®rRЭØS‘A`Cb£Ö­ØÞï™rPЭØQ•A`ÍÞïy•PÐïú•Q‘A`'Ý[ÝÝ[ÝûïTÞïS•PÐïÔ•Q‘A`"àÞï?•PÐïÀ•Q‘A`[>ÖﲕÝ[ûïÁúÿÿöP­ßÞï•PÐQ‘A`]Ö	Ý	ûïùÿÿ˜­ßPÝ	1ÿÂ^Ô­üݬûï&WݬûïVWÐP[‘`.Ð
¬”k‘¼0ЬP‘ xЬÀ¬Ь[eÑZ01‰Ð¬PÑP1‚ÑPsÑP
dÑPÑZa%ÑZfÂWZÑZÿÿÿÿÝûïmøÿÿÔPÑZ919Ŭ­üPÁZP­üÖ[˜kZ–ЬPЭü ЬPÔ ö
¼ÐPÑZ9
Â0Z°ÑZ7öÎZ¦ÑZ2öêÖÔ[ÔZx[PïYQÉQP[ÖZÑZ¬9ÞïÝ“PÐï^”Q‘A`
%ÞïÉ“PÐïJ”Q‘A`ûïÐPYÖPµÔPЬPÐ[ ЬPÔ ÐPÂ^Þï‹“PÐï”QA`­ÿ‘­ÿ\1²Öïö“Ðïð“P@ï`“­ÿÞï|pZ‘j­ÿÖïÑ“ÖZ˜jPÀZ•jçÔ[”­ÿÞï1“PÐﲓQ‘A`0EÞï“PÐïž“Q‘A`71Þï	“PÐQ˜­ÿRxRR˜A`PÀRPÂ0PöP­ÿÖïm“Ö[Ñ[§Õ[˜­ÿPÞïÏ’PÐïP“QA`­ÿ‘­ÿ ‘­ÿ~‘­ÿ	
Ýûï¾öÿÿÎPÖï$“ÀÂ$^Ѭßï[vûïú²ÝûïQ±ßïvvßïgvßïÝ“ûïÔSݬûïôÔZÖZÐïvPÐ@¼PJ`Jï±”çßïCvÐïûuPÝ@¼ßïè”ûïSßï(vßïÕ”û僧ÐP­ü1ŒßïvÐïÁuPÝ@¼ßï®”ûïUSßïõußï›”ûïn±ÐP­ü[ßïÞuÐïŠuPÝ@¼ßïw”ûïSßïÁußïd”ûï7±ÐP­ü$ßïQ”ßï¤uûïö±ÝûïM°Öï;uݬûïÝ­üûïÍßïußïÃ’ûïæ°ÐP­üÝPûï«ß勒ßïhuûïš±ßïvußßïö“ûï}Rßïcußïã“ûï–°ÐPïõ“dßïÍ“ßïCuLßïYußïI“ß­Üûï=RßïIuÕï?n	Ðï7nPÞ­ÜPÝPûïE°ÐPï’ß­Üßïuûï±ÔP•ïn¢•ïnßïußïã’ßïu“ûïÔQßïußïb“ûïí¯ÐPït“ßïL“ßïät£Ýï^“ûûïªaßïætûïÿ_ÐPï¨Ðïþ‹ ÐïšPРûï&ûïÐPÔZFÝûï±ÐP[xZPÐà´~«xZPÐà¸~«ÖZÝ«ûï¨QÐPYxPPÐàd kÐ[IïòŽxZPÕà´~®ÐPò
ï!mÝ[ßïFtûïYóÿÿÐïmPЬ@ïù‘Ðï(sPÐ@¼P‘`-1wÐïsPÁ@¼[Öïs1&1ÑPL>1ÑPdæöïŸl‘«01ú‘«9÷Ö[˜kPÂ0PöPïl1âöïl1ØÐï²rPÐ@¼ï\lÖï¢röïKl1¸öïYl1®ÐïˆrPÕ@¼ðßï”sÐïurPÖïnrÝ@¼ßïLÑPeiöïlpÑPoWöïlÐï:rPÕ@¼SßïEsÐï'rPÖï rÝ@¼ßïV‘ûïµO-ÑPg1iÿ1	ÿÑPh1bÿ˜k~ßïsûÖ[•k1©þ˜kPÑPl1&ÿ¹ÑPp1øþ1eÿÑPs¼öï]kÃÂ^ÐïMŽ­øßïõûï¾LÕP ßïäûïñOßï×ûïÀ	ÐP­üЭøïŽÐPéïx	Ý+ûïŽñÿÿöï¯Ô[”Kï>ò[õßï¤ûï
.ÐPïÖЭüPРPÏPÆH=PV\ou`hp17°¸À ¨N×±ÁŽ–n÷vÿF϶?†®7¦/Vßfï6¿É~Ñ^çž'Õ6HRâôú‘¡©%%-5=EMU]emu}…åíŽs}ðÀàè°.þ&lÈØštО°àèðÈÐØ|Ž˜ÀÐØè&	õý{ *ñÑ4>H¢¸¾ŽŽŽ\Â"øFOX+4=ÙéF	X²½Ó‘
 œ+§ÿÈô†6	ÄÖÜ{Ž”x€ˆÞéapV	áR\f‡ð			Ýûï¿ïÿÿ˜ïáŽ~ßïr‹ûï™UÝûïî/˜ïÄŽïŒÔPÝpNûïùÆÝqNïÝsNçÝvNßÝwN×ÝÝ@ûÝÝ@@íÝÝ€@ãÝÝDÙÝÝ@DÏÝÝ€DÅÝÝF»ÝÝ@F±ÝÝ€F§ÝÝJÝÝ@J“ÝÝ€J‰ÝÝÀJ1~ÿÝÝH1sÿÝÝÀP1hÿÝÝÀQ1]ÿÝÝÀR1RÿÝÝÀS1GÿÝÝÀT1<ÿÝÝÀU11ÿÝÝÀV1&ÿÝÝÀW1ÿÝÝÀX1ÿÝÝÀY1ÿÝÝÀZ1úþÝÝÀ[1ïþÝÝÀ\1äþÝÝÀ]1ÙþÝÝÀ^1ÎþÝÝÀ_1ÃþÝÝBûï«1OþÝÝ@BìÝÝ€BâÝ@Hûï1+þÝÀNîÝ€NæÝÝûï1	þÝÝ0ìÝÝ âÝÝÝÝ€ûïõ
1ßýÝÝèÝÝâÝÝÝÝØÝÝìÝÝæÝÝÝÝ°ºÝÝìÝÝæÝÝÝ
ݱœÝÝìÝÝæÝÝÝÝÀ1}ÿÝÝëÝÝåÝÝÝÝÐ1^ÿÝÝëÝÝåÝÝÝPÝP1?ÿÝÝëÝÝåÝÝÝQÝQ1 ÿÝÝëÝÝåÝÀNÝ`ûïk1çüÝbûïI1×üÝdîÝfæÝhÞÝjÖÝlÎÝnÆÝ€NÝa¨Ýc°Ýe¨Ýg Ýi˜ÝkÝmˆÝo€Ý`ûï¥
1QüÝbîÝdæÝfÞÝhÖÝjÎÝlÆÝn¾Ýa¶Ýc®Ýe¦ÝgžÝi–ÝkŽÝm†Ýo1}ÿÝ`ûï¢
1ÈûÝbîÝdæÝfÞÝhÖÝjÎÝlÆÝn¾Ýa¶Ýc®Ýe¦ÝgžÝi–ÝkŽÝm†Ýo1}ÿÝÁûïß1?ûÝîÝÑæÝ@ÑÞÝ€ÑÖÝ‘ÎÝ@‘ÆÝ€‘¾ÝàûïÉ1÷úÝ@àîÝ€àæÝáÞÝ@áÖÝ€áÎÝàÆÝHà¾Ýˆà¶Ýá®ÝHá¦ÝˆážÝà–ÝXàŽÝ˜à†Ýá1}ÿÝXá1tÿݘá1kÿÝà1bÿÝPà1YÿÝà1PÿÝá1GÿÝPá1>ÿÝá15ÿÝÝ@Hûïl1$úÝÝ€HìÝÝÀHâÝÝXNØݱûï1öùÝH±î݈±æÝ@ûï¶1ÖùÝ€îÝÀæÝâÝ€AûïJ1²ùÝÀîÝÀ€æÝÀÁÞÝÀÀÖÝÈTûï1‚ùÝÈUîÝÈWæÝÈQÞÝÈ\ÖÝÈ^ÎÝÈRÆÝÈ_¾ÝÈS¶ÝÈ]®ÝÈ[¦ÝÈVžÝÈZ–ÝÈPŽÝÈX†ÝÈY1}ÿÝÁûï)1ùøÝÝÀAûïE1çøÝPNûï•1×øÝ€Hûïù1ÇøÝÀHîÝûï{1¯øÝHîÝÝûï=1•øÝÝ@ìÝÝ€âÝzNûïõ1qøÝpûï#1aøÝrNûï›1QøÝtNûïË1AøÝ@Nûï11øݬûïÄExPPÐàd [ݬÝ«ûïÞEÕPÐk[Õ[èÐ[PÂ^Þï߆[Þïè†ZЫ­üЪ­øÑï‡Ý1m‘k1ÑÝ­üûïYÕPïÝZûïœÕPâÝZûï³ÕPÕÐï
lP2À@`7Ý­üûï3ÕP1’ÝZûïcÕPðÝZûïzÕPxÐïÔkP2ÀB`ÝÝZTÝ­øûïöÕP]Ý[ûï)ÕPPÐï§kP2ÀD`'Ý­øûï½ÕP9Ý[ûïÕP,Ðï~kP2ÀF`ÝÝ[ûï1›‘k1]ÿ‘j•‘j¹‘k1	Ý­üûïNÕPï‘jÝ­øûïÕP	Ýûïræÿÿï­øPÈhNP1ÃÝ­øûïÕP1Æ‘kÝ­üûïÒÕP	Ýûï5æÿÿï­üPÈ`NP1†ÝZûïHÕP1ÝZûï\ÕPðÐï¶jPÔ`ݬÝ[ûïQÐï¡jPÐ`­ðÔ`ݬÝZûï8ÐïˆjPï`PöP­÷ÐïxjPï`PöP­ö˜­÷Px	PPȬP˜­öQxQQÈQPÈ­ðPÐïMjQÐPax‘j1)ÿݬÝ[ûïkÕP1Sÿ‘jFÝ­øûïùÕP8Õ¬3Ѭ20P2 PâPï­øQx	QQÈQPÐïëiQÐPaݬ1kþÐïÛiPÔ`Ý
ûïåÿÿÂ^Þï?„[ÞïH„ZЫ­üЪ­øÑïg„Ý1©‘k1‘ÝZûïXÕPðÝZûï!ÕPwÐï{iPЬ`x­üPâPÐïgiQÐP¡öïσݬÝZAÝ[ûïÕPBÝ[ûïÚÕP5Ðï4iPЬ`x­øPÐï$iQÐP¡öݬÝ[û﶑j±ÐïÿhPÔ`Ý
ûï?äÿÿÂ^Þïcƒ[ÞïlƒZЫ­üЪ­øÑÝ1^‘k1T‘jøÝ­üûïŒÕPÝ­üûï”ÕP1ɬPÐïhQÐPax­üPÐïhQÐP¡Ý­øûïºÕP'ÐïhhP1ÈÐï^hPÈ 1ºÐïPhPâ ñ1«Ý­øûï•ÕPÕÝ­øûï7ÕPÕÝ­øûï‰ÕPrÝ
ûï`ãÿÿvÐïhPЬ`x­øPÐïügQÐP¡Ý­üûï5ÕP1xÿÝ­üûï4ÕP1qÿÝ­üûïÓÕPÐïÁgPâ Ý­üûïÕPŽÐï¥gPÈ öï	‚1Ý­øûïeÕP1pÿÝ­øûïjÕPïÐïngPÔ`Ý
ûï®âÿÿÂ^ÞïÑ[ÞïÚZЫ­üЪ­øx¬PȬPÐï4gQÐPaÑïæ	Ýûïjâÿÿ‘k	1x¬PȬPÐïgQÐPaÕ¬fÑ«Õ«	Ýûï6âÿÿÑ«Ô­üï­üPx	PPÐïÑfQÈPaÝZûï`ÕPݬÝZûïìÕPݬÝZûïN	Ý
ûïåáÿÿЬPÑPÑP	ÑP#ÝZûïÒP­ðÝZûïÛË­ðP­ô2ÐP;ÝZûïéÒP­ðÝZûïBÐP­ìÝZûï«Ê­ðPÉ­ìP­ôÕ­ô!ѬÃÐPÝPÝ[ûï¬FݬÝZûï®x¬PȬPÐïôeQÐPa‘kKÝ«ûïÓÕP=ЬPÑP°1›ÑP±1”ÝZûïTÒP­ðÝZûïqË­ðP­ôÕ­ôS‘j1·Ýªûï€ÕPïЬPÑPÑP°ÑP±sÑPÐoݬÝ[ûïŽjšÀP1•ï«Px	PPâPÐï9eQÈPa1"ÿÔ­ôˆÝZûïÀÒP­ðÝZûï1iÿïªPx	PPÐïeQÈPaݬÝ[1íþÔ­ô
Ý[ûïbÐP­ôÕ­ôÍ‘j17þÝ­øûï«ÕPïÕ¬êѬ1iÿ2ÀPÐP­ðЬPÑPÑP°ÑPÐ1ðýï­øPx	PPȬPÈ­ðPÐïzdQÐPa1sÿÞïæ~[ÐïcdPЬ`Ñï	Ýûï˜ßÿÿÝ[ûï»ÕPÝ[ûïÒÕPݬÝ[ûïÐ
	Ý
ûïgßÿÿÂ^Þï‹~[Ы­üÑï¿~Ýg‘k-Ý­üûïÕPÐïãcP2üF`Ðï×cPÔ €ï@~<ÐïÄcPЬ`Ý[ûï.ÕPÝ[ûïEÕPݬÝ[ûïC
	Ý
ûïÚÞÿÿÞï~[Ðï}cPЬ`Ñï.~	Ýûï²ÞÿÿÝ[ûï9ÕP
ÝÝ[ûïø	Ý
ûïÞÿÿÐï:cPЬ`Õïë}	ÝûïpÞÿÿÂ^Ô­üÞï}[Ðï
cPЬ`Ñï¾}ÝD‘kÝ;Õ«ЫPÑ ï
vÝ$ÁïzPÃP«­üÑ­üÿ
Ñ­ü€ÿÿ	ÝûïüÝÿÿЭü«Ô«ÝÝ[ûï9CÂ^Ô­üÞï
}[Ðï‡bPЬ`Ñï8}ÝD‘kÝ;Õ«ЫPÑ ï‡uÝ$ÁïzyPÃP«­üÑ­ü
Ñ­ü€ÿÿÿ	ÝûïvÝÿÿÕ­üš­üPÐïbQÈPa!ѬaÐïbP2qN`	Ýûï@ÝÿÿÂ^Ô­üÞï`|[Ñï™|ÝûïÝÿÿ1É‘k

ݬûï3þÿÿ1·ÁïáxPÃP«­üà«àÑï{VLÝÝÿÝ€ÿÿÝûïEÝPÝÝ€ÿÿÿÝûïEÝPÁï•x~ÝÝ[ûï]DöPïÊ{OЫPÑ ïtt1zÿÑ­ü€ÿÿóÑ­üÿéÑ­ü
Ñ­ü€ÿÿÿݬûïïýÿÿ
ݬûïiþÿÿÂ^Ô­üÞïr{[Ñï«{Ýûï/Üÿÿ1Αk

ݬûïÁ1¼ÁïówPÃP«­üà«àÑïULÝÝÿÝ€ÿÿÝûï)DÝPÝÝ€ÿÿÿÝûïDÝPÁï§w~ÝÝ[ûïoCöPïÜzTÕ«†Ð«PÑ ïs1uÿÑ­ü€ÿÿóÑ­üÿéÑ­ü
Ñ­ü€ÿÿÿݬûïüüÿÿ
ݬûïvýÿÿͬPÐïÿ_QÐPaÐïõ_P2úN öï[zÝßï[zûït@Â^ÞïGz[ÞïPzZЫ­üЪ­øÐï³_PЬ`ÑïdzÝ1€ÑPtw˜kPÑPñ‘jjÝ­üûïtÕP\Ý­øûïfÕPNx	­øPÈ­üPÐïa_QÈPaBÝ­üûï-ÕP+Ý­øûïÕPï­øPï­üQx	QQÈQPÈPÀ‘jÇÝ
ûïeÚÿÿÂ^Þï‰y[Þï’yZÐïÿ^PЬ`Ñï°y	Ýûï4ÚÿÿݬÝ[ûï†Ъ­ü‘j$Ý­üûï¤
ÕPï­üPx	PPÐï´^QÈPa	Ý
ûïñÙÿÿÂ^Þïy[ÞïyZÐï‹^PЬ`Ñï<y?Ðïw^PÈÀ`Ý[ûï,ÕPÝ[ûïõ
ÕP
ÝÝ[ûïô	Ý
ûï‹ÙÿÿÑïôxíЫ­üЪ­ø‘k	N‘jIÝ­øûï	
ÕP;Õ«Ñ«	ÝûïKÙÿÿÑ­üÔ­üï­üPx	PPï­øQÈQPÐïÝ]QÈPa‘k‹Ý­üûï»	ÕP1zÿ‘jøÝ­øûï¥	ÕPêï­üPx	PPï­øQÈQPÈ P´Þï
x[ÞïxZÐï€]PЬ`Ñï1xÝ1†‘kzÝ«ûïP	ÕPlÝZûïÉ	ÕP_ÝZûïà	ÕPRx	«PâPÐï1]QÈPa0ÝZûïš	ÕP5ÝZûï±	ÕP(Ðï]Pâ`ÝÝ[ûï—=ÝÝZûïš‘k	¾Ý
ûï,ØÿÿÂ^ÞïOw[ÞïXwZÐïÅ\PЬ`Ъ­üÑïqw	Ýûïõ×ÿÿÝ[ûï	ÕP4‘j/Ý­üûïÕP!ï­üPx	PPÐïy\QÈPaÝÝ[ûï	Ý
ûï«×ÿÿÂ^ÞïÏv[ÞïØvZЫ­üЪ­øÐï;\PЬ`ÑïìvÝG‘k@Ý­üûïöÕP2‘j-Ý­øûïãÕPï­øPx	PPï­üQÈQPÐïê[QÈPa	Ý
ûï'×ÿÿÂ^Ô­üÞïHv[ÞïQvZЫ­øÐï¹[PЬ`ÑïjvÝûïîÖÿÿX‘kSÝ­øûïƒÕPEÐï‡[PÈ­ø`Áï§rPÃPª­üx­üPxðPPÑP­ü	Ýûï§ÖÿÿÐïU[PЭü öï¼uÂ^Þï·u[ÞïÀuZЫ­üЪ­øÐï#[PЬ`ÑïÔuÝ1Ú‘k1БjøÝ­üûïëÕPsÝ­øûïÝÕPex	­üPâPÈ­øPJÝ­øûïªÕPVï­üPx	PPÈHPï­øQ Ý­øûï™ÕP=x	­øPȈPï­üQÈQPÐïˆZQÈPaSÝ­üûïTÕPœÝ­üûïFÕPµÝ­üûïNÕPÝ­øûï*ÕPx	­üPȈPƒÝÝ
ûï{ÕÿÿÂ^ÞïŸt[Ы­üÑïÓt	ÝûïWÕÿÿ‘k	Ý
ûïIÕÿÿѬÝ­üûïßÕPլݭüûï¶ÕP	ÝûïÕÿÿï­üPȬPÐï½YQÐPaÂ^Þï)t[Þï2tZÑï[t	ÝûïßÔÿÿ‘k‘j		Ý
ûïÌÔÿÿЫ­üÝ­üûïMÕP	Ýûï°Ôÿÿï­üPȬPÐïTYQÐPaÝÝZûïá9Þï¸s[ÞïÁsZÐï.YPЬ`Ñïßs	ÝûïcÔÿÿ‘k	XÝZûïåÕP‘jFÝÝ[ûï‘9ÝÝZ,Ý[ûïÂÕP‘k(Ðï×XPâ
`ÝÝZûïc9ÝÝ[ûïf‘j	ÆÝ
ûïøÓÿÿÂ^Þïs[Þï$sZЫ­üЪ­øÐï‡XPЬ`Ñï8s	Ýûï¼Óÿÿ‘k1¤Ý­üûïPÕPï‘j˜ª~ûï&ÕP	Ý
ûï‰Óÿÿx	­üPÈ€PïªQÈQPÐï"XQÈPaÝÝZKÝ­øûïÕPK‘k˜«~ûïÖÕP	Ý
ûï9Óÿÿx	­øPâPï«QÈQPÐïÕWQÈPaÝÝ[ûïb8‘j§Ý
ûïÓÿÿÂ^Þï%r[Þï.rZЪ­üÑ«
Ñ«€ÿÿÿ	ÝûïËÒÿÿï­üPx	PPȬPš«QÈQPÐïdWQÐPaÑïr	ÝûïšÒÿÿ‘k	‘jÝ­üûï,ÕP	Ý
ûïyÒÿÿÞï q[ÐïWPЬ`ÑïÎq	ÝûïRÒÿÿ‘k		Ý
ûïDÒÿÿÝÝ[ûï‰7Þï`q[Õï™qɬPÐïÐVQÐPaÑïq	ÝûïÒÿÿÐï³VPЬ`‘k		Ý
ûïìÑÿÿÝÝ[ûï17Þïq[ÑïAq	ÝûïÅÑÿÿ‘k		Ý
ûï·Ñÿÿï«PȬPÐï[VQÐPaÂ^Ь[Ы­ü˜kPÏP	5„§ÀÙ'rŽßï[mßï%Vûï6ÑÿÿÐïVPÈ«`Ý­üûïÞÕPæÝ­üûïæÕPØÝ­üûïÕPÝ­üûïÕPÐïÎUPÈ<`»ÝûïÑÿÿ°Ý­üûïÕPçï«PÈPÐï UQÈPaÝ­üûïlÕPÄï«PÈPÛÝ­üûïSÕP«ï­üPÈ P˜«~ûï9ÕP!ï«PÈ(PÐïJUQÈPaÝÝ[ûï×51+ÿ˜«~ûïEÕP1^ÿÐï UPÈ:`Ô˜«~ûïëÕPï«PÈ0PÐïüTQÈPaÝ[ûïY§˜«~ûïúÕP1ÿÐïÕTPÈ;`×ÐïÉTPÈ8`1|ÿÐï¼TPÈ9`Ý1oÿÐï­TPÈ<`ѬÐPÐPÝP1RÿÂ^Ь[Ô­üÝ«ûï\ÕPÝ«ûïdÕPx«­ü	Ýûï©Ïÿÿ‘«â­üÑ«€ÿÿÿÑ«€
š«PÈP­ü	ÝûïwÏÿÿЭü«ѬѬÐPÔPÕ¬ѬÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPЬ[˜kPÑPÝ«ûïLÿÿÿÕPÔPÐPЬ[˜kPÑPÑP˜«~ûï^ÿÿÿÕPÔPÐPЬ[˜kPÑPÔPÐPЬ[˜kPÏPÐPÔPÂ^Ь[Ы­ü‘k Ý­üûï	ÿÿÿÕPÝ­üûïÿÿÿÕPÐPÔPЬ[ЬZ‘kÕZÝ«ûï‡þÿÿÕPÔPÐPÔ[ÔKï9oò [õÂ(^Ñï]G•ïWTÝûï	ûïÌß­àûï›(ÕP
Ð(ï,j1=Ýûï&‹ÐPZß­àûï;ÐPªß­àûïY+ÐP­ÜxPPÐà|¦ªÔªÐjÔªЭÜPÐZ@ï¬nÐZïÅlÔïSmÔYÔ­ØÑ­Ø1«ûïÈ(ÞïiPÐï•iQ‘A`,Öïˆiûï§(ÞïóhPÐïtiQ‘A`?ЭØPÈ@ïúQªÖïZiß­àûïÐ'ÕPNÁY ¤PЭØQÐPAï”lÞ­à[ÑYOkIï-lÖ[ÖY•kç”IïlÖYÑYPYÝ ûïüÌÿÿЭØï’lÔjÞïfhPÐïçhQ˜A`~ûï[(ÕPÐ!ïìhÝïæhûïSÌÿÿÝûï–ÝÝZûïÖ­Ø1öþÂ0^Ýû)ЬQÐP¡С­ÜÔ­Ø”ï\Qûï*ß­àûïó&ÕP+ßïÉQß­àûï*ÕPßï¼Qß­àûïï)ÕP&Ö­ØÔï>hѬxÝ­Üßï§gûïLÐP­Ü1»ßïˆQß­àûïµ)ÕPßïzQß­àûï¡)ÕPµ×­Ø°ÝûïÇÑ­ÔÝ­ÜßïTQûïøÐP­ÜÑ­Ð1ЭÔXЭÐЭЭÔß­àûïÓÐP­ÐÑP¾Ý­Üß­àûï=)Ñ­ÐÐ"ï¨gÝï¢gûïËÿÿÝ­Üß­àûï”ÐP­ÜѭЦÝûï91ÖþÂ$^Ô­üÖ­üûïX)Ýûïß­Üûï³%ßï¨Pß­ÜûïÇ(ÕPÏßï›Pß­Üûï³(ÕP»ßïPß­ÜûïŸ(ÕPßïPß­Üûï‹(ÕP–×­ü‘Ь[ЬZÔYÖY•IïOõÑYƒjIïˆOÖZÖY•jç”IïyOݬûï•(‘`
0ßïdOûïŸ7ÐP«”ïSOÝûÐPkÐkPÔ Ô»ÐkPÐ[PÂ^ݬûï?ÐP­øÑP	ÑPïÛiÝßïÉOûïŽÉÿÿÁ€­øPöP­þ”­ÿݬß­þûï5ÿÿÿЬ[ÔZÝJï[iÝ[ûïš'ÕPÁZPÖZÑZï€iÜÔPÂ^Ь[ÞïGePÐïÈeQA`­ÿÔZ‘­ÿ ‘­ÿ	­ÿJkÖï©eÐï£eP@ïe­ÿòZÕÕZ”JkÔPÝ[ûï$ÕPÝ[ûïeÿÿÿÕPÐPÐP‘­ÿ
‘­ÿÖïWe­ÿk”«ÐP‘­ÿ'Öï@e­ÿk”«ÐP‘­ÿ ‘­ÿ~
Öï"eÐP­ÿk”«Öïež®À^Ðïe­üß­Ìûïv#ÕP+ß­ÌûïÎÐP­ÄÑïøA>•ïóN*1ЭüïÇdÐPÝûï¸ÈÿÿÑ­ìP	Ý ûï7ÈÿÿÝûïzÔPÑï)MÏÝœû暈ÖïMÐï
MQÐPAïÐhÐAïÉh[ЭÄkЭÄPРË”Ð˘ԭìÔ­øÑ­øÑ­ìP…Á[PÀ­ìPЭøQÐPA«Tûï{#Þï™cPÐïdQA`­Ë˜­ËPÑP<5ÑP\1ŠÑP^1úÖïícÐïçcP@ïWc­É­É­Êö<­Éö>­Ê̘߭­Ê~˜­É~ûïZ#ÕPÝ!ûï?Çÿÿ1òþÔ­ðÞ­ÌPЭðQ•A`Ñ­ìPÐPÔPЭìQÖ­ìöPA«1âÖ­ðÌÖïocß­Ìûïå!ÕPcß­Ìûï»2ÐP­Àá ß­ÌЭÀPÝ ûïÙ	ÝûïÂÆÿÿÔ­ðÞ­ÌPЭðQ•A`Ñ­ìPÐPÔPЭìQÖ­ìöPA«kÖ­ðÏÝ1Cÿ‘­Ë M‘­Ë,G‘­Ë	A˜­Ë~ûï\"ÕP2Ñ­ìO(Á[PЭìQ­ËA`Ö­ìÖï¸bÐï²bP@ï"b­Ë­Á[PЭìQ”A`Ö­ìÖ­ø1CþÂ8^ÕïK”ïK˜ï	KPöïKÐïþJPÐ@ïÂf­ôЭôPÐÀ”­ðÕ½ð=ЭôP×À˜нôPЭôQРÁ”ÐïÃJPÝ@ï‡fûïò‚×ï®JûïÿÿÿЭðPР­ìÔ[ÔZ
ö­øJïraÖZÖ[•K½ì1¨ÑZƒô˜K½ìPšP­øÑ­ø€Îíø­üЭüPÁT­ôQxPPÀPQÐa­è•½èAнôPx­üQÒQQËQ P.ß­ÈÐïêJPÖïãJÝPûïß­Èßï4Kûï†"Þ­È­èÔY•I½è1fÿÑZƒôI½èJïÃ`ÖZÖYÞ”Jï¶`ûï%%ЭôPÐPQÐДÁ”ÐPÂ^ÝûïòÑï,>1ûïsÕP1ˆÐï^`­ô~Ýûï‚ÐP­øÔ ЭøPÔ ЭøPÔ нøЭøPÔ ÝÝ­øûïøÿÿÝœûïÒÖï>IÐï8IQÐPAïûdÐAïôd­üЭø½üЭøPЭüQРÁ”ЭüPЭôÀ˜ûïIûïùÿÿÂ^Ь[שּׂôÐZÇ­ôPxPPÃP­ôPÀ0PöPJ­ù×ZÇ­ôPÐP­ôÕP	ÙÖZJ­ù‹ÑZô”kÂ^ݬûï{!xPPÐà|¦­ü#ЭüPÝ ݬûï!ÕPЭüPЭüPР­üÕ­üØÔPÂ^ûïêÐï¾_­øÔ­üÞï+_PÐï¬_Q˜A`~ûï ÕP!ЬPÀ¬ÝPûïûÖ­üûï§Ñ­üÂЭøïs_ЭüPÞïJI[‘¬kÐPÖ[•kðÔPÂ,^ûïjÞï¶^PÐï7_Q˜A`~ûï«ÕPÔPÐZÔ­øÐï_­ôUÕ­ø×­øE‘­ÿ<‘­ÿ{ß­Ô˜­ÿPÁP~˜­ÿ~ûï…&‘­ÿ'Эø‘­ÿ"Эø‘­ÿ,ÖZÖï¿^Þï1^PÐï²^QA`­ÿ˜­ÿ~ûï!ÕP‰Ð­ôï•^ÐZPÂ^ЬPÔ ЬQР¡ЬPö¡ ЬQ ¡¡¼ÞïÖ]PÐïW^Q‘A`#GÖïJ^ݬûïXÃÿÿÕP‘¼	Ýûï¼Áÿÿö	¼ûïG1–1ÖÑP1ÄÑP
ݬûïÃÿÿÕPÓ×ïô]Þïe]PÐïæ]Q˜A`PÖïÛ]ÑPL!ÑPWÑPlÑPwö¼)ö¼#‘¼ö¼cÑP+1uÿ‘¼ö¼Ðï‚]PÖï{]@ïì\­ÿ]˜­ÿPÑP-Ê‘¼ö¼Òݬûï>ÕPÄÑP(ì19ÿÑP,1Gÿ1.ÿÑP@…ÑP:12ÿ1ÿÑP|1ÿ1	ÿЬ[‘kBö««Ý[ûïÂÿÿÕP0ûïÞï`\PÐïá\Q˜A`PÖïÖ\ÑP)ökÐPÑP,ÔPЫ«Ý[ûïÌÁÿÿÕPë‘kæÐï¥\PÖïž\‘@ï\:ÏÞï\PÐï‡\Q˜A`PÖï|\ÑPL!ÑPWÑPlÑPw“ˆ«ˆ«ûïmÐïA\PÖï:\‘@ï«[)1hÿök1YÿÂ^Õï59Õï!4ûïäÀÿÿÑï91×ÿu^Ðïm^PРQÖ öïû[aÝïV^Ýïì[ûïsz×ÿC^#•ïKDÐ*PÐ PÐï+^QСRÖ¡öPbÝï^•ï"DÐ*PÐ PÝPûï)zÝïù]ßïëZûïžz•ï]8Õïm3ûï0Àÿÿ•ïoE	•ï][ÕïL3•ïPE•ï¼C	•ïEE•ï«CÐ*PÐ PÝPÝïÅWßï'EÝïå[ûïzѬÅïEPÁP~IÝÝïòDÝïèDïï<Z~ûï¦ÝûïaÝxïÊD~Ýï¿DïïZ~ûï}Ýûï8Õ¬^•ï¤DVÔ[Ñ[eÇï/]PÑ[Pxï‚DPÁP~)ÝxïrD~ÝïgDx[PÀïBPï`~ûïÝûïÙÖ[¬xï@DPÀPÅP~ûï¿Ýûï¶Õï2ÝÝÝ
Ýï2ûï×	Ýûï×ÿÌZÐïÄZPРQÖ ïæ1aÝï­Z˜ï×1~ûïaxÝûïTÝïZßïYûïÍxßï
Yû`-×ÿkZÐïcZPРQÖ ö
a˜aPÝïMZÝ
ûïxЬ[ÔZ,×ÿ2ZÐï*ZPРQÖ ö aÝïZÝ ûïÐwÖZÑZ[ÏÂ^Ð[שּׁǬ¬PĬPÃP¬ZÕ¬À¬ZÑZ
Á0ZPÁ7ZPöPK­ðǬ¬PÐP¬×[׬ÕPÕ¬Õ[¶Ð PöPK­ð×[׬Õ¬!Õ[Õ¬åÐ0PãÐï‡YPРQÖ K­ðaò[ôÿoYáÝïhY˜K­ð~ûïwàÂ$^Ñïƒ5
Ýûï7üÿÿ•ïwB	Ýûï%üÿÿ”­ß1
ß­àûïýö­ßßï\Bß­àûïÉÕP¬ï6B1¿ßïABß­àûïªÕP¬ïB1 ßï&Bß­àûï‹ÕP¬ïúA1ßï
Bß­àûïlÕP
¬ïÜAcßïïAß­àûïNÕP
¬ï¿AEßïÔAß­àûï0ÕP
¬ï¢A'ßïºAß­àûïÕP
¬ï…A	Ý%ûïU»ÿÿûïvÞïÂVPÐïCWQ‘A`,Öï6Wß­àûï¬ÕP1âþ•­ß¬ï4AÂ^ï
4­ïÞ­÷[ÐïýV­ðÝ[ûïrÕP3Ý[ûï©‘k.ßïFAÝ[ûïuÕPEûï1“Эðï»VÐPéï!V	Ý+ûï7ºÿÿÝûïÒléïV	Ý+ûïºÿÿÝã•ïšV1sßïè@Ý[ûïÕP³ßïÛ@Ý[ûïÿÕP»ßïÎ@Ý[ûïìÕPÝ›ûïíëÿÿûïõÿÿÔPßïª@Ý[ûïÂÕPÚßïž@Ý[ûï¯ÕPÐßï‘@Ý[ûïœÕPÝÝûßïv@Ý[ûïzÕPâßïj@Ý[ûïgÕPÝÝÝûïZ1{ÿßïI@Ý[ûï@ÕPÝßï<@Ý[ûï-ÕPÎßï/@Ý[ûïÕPÝÝûïóüÿÿ12ÿßï@Ý[ûï÷ÕPáßï@Ý[ûïäÕP
ûï;1ÿßïð?Ý[ûïÇÕP!ÝïPÝï‰PûïÂÝûïÝøÿÿ1ÎþßïÂ?Ý[ûï“ÕPÔßïµ?Ý[ûï€ÕPÝïNP¿ßïŸ?Ý[ûïeÕP
ûïò1ƒþßï‰?Ý[ûïHÕP
ûï1fþßïr?Ý[ûï+ÕP
ûï|1Iþßï\?Ý[ûïÕP ÝTÝPÝEûï_1þßï0?Ý[ûïÛÕPÕßï%?Ý[ûïÈÕPÊßï?Ý[ûïµÕP
ûï
1Óýßï?Ý[ûï˜ÕP
ûï‡1¶ýßïì>Ý[ûï{ÕP1
ýûïÍ1–ýÝûï—÷ÿÿ‘ï¹0Ýï¬Sßï¸>ûï‘sÑïµ0:ûïÁ·ÿÿ•ï0
ßïáUûïŒq•ït0ûïiûïŒöïÉ)ÝïÖUûïArßïr>ßï£UûïVrÐPïµU0ßïUßïR>ûÿÿÐï00PÝ@ï Uûïûq×ï0Õï0ÝÝïuUûïÜÂÿÿûï—óÿÿÕP#ßï=RûïFôÿÿÕPÐï4RïWXöï(=ûïÛÞï>ZÔ[ݪÝZûï ÀPªÖ[ÀZÑ[ïþMâÐïþMPÁ PËPï„RÐïîMPÁ PËPïtRÐïÞMPÁ PËPïdRûïo%ûïôûï‹ûï.Õï6*Ýï.*ßïk=ûïyµÿÿûïÎ&ûïÔï¾NÔï*Ôï*Ôï*Öï/Ñï/Ô[Ñ[ïDM>Å[PÔàhÖ[éÐï6MPÔ Ðï0MPÐï¹Q ÁïµQï¬QPÐïMQÐP¡Ðï¦Qï-WßïS=ûï8	‘ï~.Ýï.ßïÔ<ûïVq ^ß­àûïÓÕPPß­àûï© ÐP[ûïaÞï­PPÐï.QQ‘A`,Öï!Qßï{Pûï„òÿÿÕPÕïnPÝ
ûï´ÿÿÝûïÒôÿÿÐïWP«Ô«Ð#«‡ÔZÔ[Ñ[ï{V2ÐKïvVYÑKïnVïÕPPÕZ7ßïPûïòÿÿÕP$Ð
ï¿PÝûïvôÿÿÐï÷OPÑ ïúKÜÖZÕïâOãÐïÞOïáOnÐZPÖZÕPßïÀOûïÉñÿÿÕP²Ðï·O©Õï«O
Ðï£OPРPÔPÐP©á©Ýûï´³ÿÿ!Õï€OÐïxOPË PÐPÐP©Ö[1ÿéïdOÖï]O”ï7OÝßï/OûïÌÝûï«óÿÿÂ^Ь[Þï
O­øÑ[ÐPÐPÐPï7;ûïPðÿÿÐP­üÔZ1ßïñNûïúðÿÿ‘ïäN
ÔïßNö
ïÔNÔïÖNÝ
ûïõ²ÿÿ9ÕïÁN1Å[ZPÁïÁNP~Ñ[ÔP
Ñ[ÐPÐPÝPßï‘NûïfÑ[xðï…NPЭøQÐPaЭøPÐïsN ЭøPÐïeN`Ñ[Ý[Ý­øûïßÝ[Ý­øûï[Ñïó+;•ïÆ+3Ñ[Ýxðï%N~ûï¯ÝïïN~ÝÝïNûï“ÖZÑZ­ü1÷þÑï¤+ÝûïXòÿÿ$•ïl+
ÝÝûïaÕïo&ûï2³ÿÿÅ[­üPÐPïNNÂ^ûïb
Þï®MPÐï/NQA`­ÿ˜­ÿ~ûïž
ÕP
ÝûïíñÿÿÖï
NÐï“9Ðï9ï°PÔZ#Ð[P˜­ÿQÑPQ?ûïùÿÿÐP[3Ý[ûï“ÖZÞïCMPÐïÄMQ˜A`[Ý[ûï6
ÕP¾Ñ[|µÐ[P˜­ÿQÑPQ	Ýûï$±ÿÿÕ¬Õ[ÝûïBÖZÑï–*ÝûïJñÿÿ$•ï^*
ÝÝûïSÕïa%ûï$²ÿÿÐZïEMЬ[ö[ïƒLÝßï{LûïÑï:*•ï
*ÝÝ[ûï•ï7Õ¬Åï€8ïs8PÑP1K•ïh8s•ïd5Ð*PÐ PÝPÝï~IßïP8ÝïžMûïÑkÝÝï¿6Ýïµ6ïï	L~ûïsóÿÿÝûï.óÿÿÝxï—6~ÝïŒ6ÝïâKûïMóÿÿÝÅïx6PÁP~ûïúòÿÿ•ïÚ7	•ïd6Ô[1ªÝÅïN6ïÁ7~Ýï>6ÝKïóQûïþòÿÿ×ÿþLÐïöLPРQÖ KïÿQaÝïÞL˜KïïQ~ûï‘jÑïq7,×ÿÀLÐï¸LPРQÖ ö a-Ýï¥LÝ ûï^jÑï<7ßï@7Ýï…Lûï¸jÖ[Ñ[ï71JÿÅï7ï7[Áï‹5~ûïòÿÿÖ[Ñ[êÝûïòÿÿÕïe#ÝÝÝ
ÝïW#ûï"òÿÿ	ÝûïÛñÿÿ×ÿLÐïLPРQÖ ï1#aÝïøK˜ï"#~ûï¬iÝûïŸñÿÿ•ï6!–ïw6ßï]Jßï6ÝïÁKûïôi-×ÿ²KÐïªKPРQÖ ö
a˜aPÝï”KÝ
ûïMiÔï%6Ôï§"Õ¬,Ðï6PЬ@ïRPÞï|PPÐïý5QïzPA`Öïî5Õ¬”ïç5Ôïå5Â^Ь[Ô­üßï¢Iûï«ëÿÿÕPÕï•IÐï‘IZ
Å[Zï"JÐï1JÝï+JûÿÿÔYÝ[ß­üûïìÖYÑYZíÝûïÄíÿÿÂ$^”­Þ­Þ­ßß­àûïOÐPZ)Þï<IPÐï½IQ˜A`~ûï1	ÕPÝûï4­ÿÿ1&ÕZ
Þïc5[1ÔZß­àÅZPÝà`ûïÕPÖZÑZïÚDÝÅZPž@ï-5[ÑZïÅD)ö­ßÖï¹Dß­àûï]ÐPkÔ«Ы«Ы«Ы«ûïMÞï™HPÐïIQ‘A`,Öï
Iß­àûïƒÕP#ÞïqHPÐïòHQ˜A`~ûïfÕPPö­ÞJß­àûï–
ßï¬Dß­àûïf
ÕPS•­ßHà«Cö­ÞûïÏÞïHPÐïœHQ‘A`,1kÿ•­Þ	ÝûÿÿÝ[ûï3ÝûïNìÿÿÈ«»ßïIDß­àûïÿ	ÕP£•­ß髚ȫ˜Ь[Ð[ï«CЫï£GÐïAHPÐ[ ÝkûïƒÐPZÈCªÐï~CªÔªÐZï¢MÂ$^ß­àûïqÕP1¹ß­àûï¤	”­ß”­Þßï¼Cß­àûïn	ÕP”­Þßï§Cß­àûïU	ÕPö­Þö­ß”­Ýûï¿ÞïGPÐïŒGQ‘A`,ÖïG•­ßß­àûïðÕP>Ô[Ñ[/ß­àÅ[PÝàûïõÕPOÅ[PÐàZ•­Þ'ÐZï®#Ñ[–­Ý•­Ý	Ý
ûï°ªÿÿÝûïóêÿÿÐZï#1Å[PÐàï1ÈÖ[Â0^”­×Ñï$+Ýö­×•­×ÐïñFÝïëFûïXªÿÿÝûï›êÿÿûïÝÞï)FPÐïªFQA`­Þ˜­Þ~ûïÕP°ÖïFÔ­Ð,‘­ÿ­Þ2Ñ­Ð,˜­ÿ~ûïòÕPÞ­ßPЭÐQ­ÿA`Ö­Ðûï9²ÿÿöP­ÿÇ‘­ÿ­ÞÐï_FÝïYFûïÆ©ÿÿ1RÿÞ­ßPЭÐQ”A`Öï"FßïBß­ßûï,eÐP­Ø1$ÿÝPûïîµÿÿ1ÿ×ï°BÑï
#
Ýûï¾éÿÿÕïÓ"ßïÄAÝïµFûïèdÂ$^ûïÞÑïÎ"1—ÞïEPÐïŸEQ‘A`,Öï’Eûï±ß­àûïÕP(ÞïïDPÐïpEQ˜A`~ûïäÕPKÝûïç¨ÿÿ@ß­àûï¯ÐP­ÜÔ ЭÜPÈ ûï[Þï§DPÐï(EQ˜A`~ûïœÕP1iÿÝûïèèÿÿÂ4^ûï$Ñï"1åÞïdDPÐïåDQ‘A`,ÖïØDûï÷ß­àûïGÕP)Þï5DPÐï¶DQ˜A`~ûï*ÕP±Ýûï-¨ÿÿ1ß­àûïôÐP­ÌÔ ЭÌPÈ… ûïœÐïpDPÖïiD‘@ïÚC,	Ý
ûïæ§ÿÿß­Ðûïd©ÿÿ‘­Ð	ÝûïͧÿÿЭÌPЭؠûïSÞïŸCPÐï DQ˜A`~ûï”ÕP1ÿÝûïàçÿÿÂ4^•ï÷ ßï:@ßïØEß­àûïÌßï)@ß­àûïèbÐP­Ìß­àßï@ûïªcÔ­ÜЭÜPÐ@ï¹IZtЪ[Óp[dݪßïÿ?Ý­Ìûï¨bݪßïô?Ý­Ìûï•bá[˜EPÐ PÝPá[Ð P˜UPÝPßïÉ?Ý­Ìûïgbßï¿?Ý­ÌûïWbÐjZÕZˆÖ­ÜÑ­Ü 1nÿÝ­Ìûï
bÝß­àßï¢?ß­àßï”?ßï€?ß­ÐûïðÝûï%ažÎLÿ^Ñïù1LûïöÐïÊBPÖïÃB‘@ï4B"Ýûï@¦ÿÿ1"Ô­ÔÑ­Ô„IÞïBPÐï“BQ‘A`
ÓÞïþAPÐïBQ‘A`¿ûïS®ÿÿöP­ÓÖP°‘­Ó"rÞÍOÿPЭÔQ”A`Ô­ÔÑ­Ô
qÞïÀAPÐïABQ˜A`~ûïµÕPTûïPÞïœAPÐïBQ‘A`,ÖïBßïjAûïsãÿÿЭÔPÐïaA@­ØÖ­ÔÞÍOÿPЭÔQ­ÓA`Ö­Ô13ÿ‘¬E	Ýûï]¥ÿÿÝ­üÝ­øÝ­ôÝ­ðÝ­ìÝ­èÝ­äÝ­àÝ­ÜÝ­ØßÍOÿ‘¬T	ÞïB~PÐï}BPÝPûï­`Ýûï^åÿÿÂ^Ь[ÖïoAÞïá@PÐïbAQA`­ÿ‘­ÿ á‘­ÿ	ÛÔZÞïÀ@PÐïAAQA`­ÿ‘­ÿ0‘­ÿ9/‘­ÿa‘­ÿz!‘­ÿA‘­ÿZ‘­ÿ_‘­ÿ.‘­ÿ$ÑZ Ýûÿÿ×Z”JkÐZP­ÿJkÖïÞ@ÖZŒÂ^ÖïÍ@Þï?@PÐïÀ@QA`­ÿ‘­ÿ á‘­ÿ	ÛûïÉÿÿÿÞï@PÐï–@Q‘A`,Öï‰@ûï¨ÿÿÿÞï0=[‘¬kÐPÖ[•kðÔPÂ^ÞïÏ?PÐïP@QA`­ÿ‘­ÿ¬ÔPÔ[Эø˜­ÿ~ûï¯ÿÿÿÕPèÖï%@Ðï@P@ï?K¼K¼­ÿ‘­ÿ¬õ­øÖïý?”K¼Ð[P‘­ÿ¬Ö­øÖ[Ñ[ ªŸÂ^Ь[ûïøþÿÿÞïD?PÐïÅ?QA`­ÿ‘­ÿ("Ý[Ý)Ý(Ý[Ý>Ý<
Ý[˜­ÿ~˜­ÿ~ûï6ÿÿÿ‘­ÿ<à‘­ÿ"â‘­ÿ^1Öï~?Ðïx?P@ïè>­ÿ˜­ÿ~ûïãþÿÿÕP¶Ýûïæ¢ÿÿÔPÔZ1‘­ÿ	1˜­ÿ~ûï¾þÿÿÕP"­ÿ‹Öï0?Ðï*?P@ïš>­ÿÖZ‘­ÿ É”kÐZPЬ[ЬZÖ[ÖZjk÷ЬZÖ[ÖZjk÷ЬPÔ[Ö[•K¼øÔZÑ[J¼K¼Ö[ÖZ•J¼ê”K¼ЬPÔ[Ö[•K¼øÐ[P”¼ݬݬûïªÿÿÿЬ[ÔZÔYéYÐPÐP˜IkQxPQPÀPZÖY•IkãÅZZPï
PPЬ[ЬZ•kÐPÖ[ÖZ‘kjïÔPЬ[‘kA	‘kZˆ kÖ[•këЬ[‘¬kÐPÖ[•kðÔPЬ[Ö[•kú×[Ð[PÂ^ïç­ÿ‘­ÿ
ßï•:ûïÀ]ûïµÕïU&ûï&ÛÿÿÕP1¿ÐïÃPÐ@ï³?­ø×½ø>Ý­øûï4\@Ñ­øï@1ØÕ[	Ý[ûï¡ÿÿ×½ø1€Ð­øPРQÖ šaPzЭøPРQÖ šaPÐP[ÖP¹Ðï[PÝ@ïK?ûï&\ÕïJûïïêÿÿ×ï71iÿÝûï¡ ÿÿßïå9ßïÙ9ßïw<ûïæýÿÿÖï®9ÐPÝ­øûï†[ÐP[Ñ[*	öïe%”ï]%×½øЭøPРQÖ šaP
Ý­øûïP[ÐP[ÔZ6Ñ[CÑZ„:×½øЭøPРQÖ šaP
Ý­øûï[ÐP[ÖPÖZö[Jïá;‘JïÚ;
¸”JïÑ;ÑZ„ö
Jï¿;Ýûï< ÿÿÖïô8‘­ÿ1=ÿßï¡;Ýïß8ßïø8ûï\1!ÿÔï
<Ôï¨AÔïÔï<ö ï	ö ïöA”ïtBÔïâ;Ôï>Ôï:;Ðï4;PöPï$;Ôï";”ï;ßï°8ßï–=ßïPBûï‡üÿÿßïœ8ßï>ûï ZÐPïBßïÿ=ßï|8ûïÊžÿÿßï8ßïBûïqZÐPïèAßïøAßïn8ûÿÿßï8ßï=ßïùAûïüÿÿßïk8ßïæAûï)ZÐPï¤AßïÐAßïL8ûïSžÿÿßï]8ßï×<ßïÑAûïÈûÿÿßïI8ßï¾AûïáYÐPï`Aßï¨Aßï*8ûïžÿÿ2ï
@Ðï¤:ï@Ðï:ïü?Ðï–:ïõ?ÝÁ ïä?PÁïá?P~Ýïý@ûï´YÝïð@ûïÐPïÆ?Ðïì@ï¿?Ðïå@ï¸?•ïš$	Ðïº?PÔPÐPï¢?ÝÝÝï¨@ûï_YÝï›@ÝÝ ßïe?ûïXYÝÝ Ýï€@ûï7YÔïƒ@Ôï@Â^ÝÝÝïa@ûïYÝÁ ï%?~ÝïF@ûïýXÔ­ø}×ÿ4@;×ÿ0@Ðï(@PРQÖ šaP
Ýï@ûïXÐï@QСRÖ¡öPb7Ýïñ?×ÿï?Ðïç?PРQÖ šaP
ÝïÔ?ûï×WÝPûïÖWÖ­øÑ­øï-91vÿÐï’>­üÐï²?ï…>Ðï«?ï~>ÝÝÝï?ûï?XÝÝÝïƒ?ûï.XÝÁ ï?>PÀï<>PÁï=>P~ÝïQ?ûïXÔ­ø}×ÿ??;×ÿ??Ðï7?PРQÖ šaP
Ýï$?ûï#WÐï?QСRÖ¡öPb7Ýïü>×ÿþ>Ðïö>PРQÖ šaP
Ýïã>ûïâVÝPûïáVÖ­øÑ­øïÐ>1vÿÔ­ø}×ÿ°>;×ÿ´>Ðï¬>PРQÖ šaP
Ýï™>ûï”VÐï€>QСRÖ¡öPb7Ýïm>×ÿs>Ðïk>PРQÖ šaP
ÝïX>ûïSVÝPûïRVÖ­øÑ­øïE>1vÿÝÝÝï">ûïÙVÝï>ÝÝ ßïß<ûïÒVÝï>ûïUVßï
>ûïhUÝïì=ûï;Vßï>ûïNUÝïÖ=ûï!Vßï>ûï4UÂ^Ь[˜ïÉ9PxÿPZЫY˜PPÁïl6P~ݬÝ[ûï*Ы­üЬPÑP@ÑP#ÑPxð­üPxZQÀï	QÐPaÖZ€ïp9xZPÀïòPЭü`€ïZ9ÊÐïÞ­ø˜ïJ9Pö­ü@½ø–ï=9­ž®˜^Ь[Þ­›ZÔYÐYXHkI­›ÖXÖYHkI­›ÖXÖYÀXÑY¬ãxÿ¬Yé¬"ݬßïÓ3ûï–™ÿÿj­ÿªjÖZ­ÿjÖZÐYP×YÕPçݬß­›ûïЬ[ÑïÑïf1ïe1Ýï}<ÝݬÝ[ûï=UÝïl<éÑï<1ï?1ëÂ^ЬPÕ Ñï1ï1IÝï><ݬݬݬß­øûï?ÀPï,<&Ýï <Ãï‚5¬~ݬݬß­øûïÀPï<ÑïÉ0ïÌ0ÌÂ^Ь[ЬPРYЩZÑïQr´«à©á©ðk÷©«9ÑZï†0ðk)ÑZïz0ðkÑZïn0ðk	Ýûïp˜ÿÿЬ«ð¬kðkݬÝÝÝ[ûï"TÐPЬPá Ý(ûïÉUÐP[ÖP
ßïZ2ûïó—ÿÿÐïý3«Ðïõ/«ЬPР«ЬPР«Ь«Ь« ά«Ь«$ЬPР«Þï
2Z
ÐjPÑ« ÐjZÕjïÐjkÐ[jЫPÝûïEUÐP[ÖP
ßïì1ûïo—ÿÿЬ«Ь«Ь«Á\Z
ÐjPѬ ÐjZÕjïÐjkÐ[jÐjPÂ^Ðï1[ЫZÑ«ªáª	ЫPÀ «Ðk[Õ[àÔ­üÐïc1[5Ý[ûïÑëPYÝYÝ[ûï%ЭüÕY
ßïp1ûïÒ–ÿÿÐk[Õ[ÇÕ­ü¶Â^Ь[ЬPÀ[ ЬPÝ Ý ûïºÐ¬QÀ¡PÐP­üÐïì0Z]ÑZ¬TЬPЪQÑ ¡EÕªÁª ªPÑP­ü
Ñ­üª Â[ªÕªѪ ­üÁª ªPÑ­üPÀ[ªѪ ­üÀ[ª ÐjZÕZŸЬ[ЫPá ЫPÑ« ЫPЫ$ZѪ«Ñ«ªЪPÐjZÕZæÙЬ[Ðï80ZÔYÑ[ªѬªЪ$PàªPÀPYÐjZÕZßÐYPÐï0[ÐkZÝ«$ûïÝ[ûïSÐZ[Õ[ãÔïà/Ь[ÐkZÝ[ûïàRÐZ[Õ[íÁ\~ݬݬûïÂ^Ýûï¼NÐPZÝûï°NÐPYÕZÑZÝZûï›NÐPZÑPïÕYÑYÝYûïNÐPYÑPïÝûï`NÝûïWNß­øûïOÐP[1Ý­øûïKNЬQÐP¡Ýûï*Nß­øûïØNÐP[cЬPЭü ÝݬûïÖMÐP[Iûï"NÐP[ÖP;ЬPÐ[`0Ð[Ð[PÖ[ÝPûïÙMÑ[íݬݬûïSÝïûlûïBOÔ[Ýûï¯MÝûï¦MÝßïü.ûï?NÝYûïžMÝYûï…MÝûï|MÝZûïƒMÝZûïjMÐ[PÂ$^Ь[
ßïÏ.ûïä“ÿÿßïØ.Ý[ûïïQÕP
ßïÇ.ûïÄ“ÿÿ‘ïb
	Ý[ßïº.ûï>PÝ[ûïAòÿÿÐP­Ü‘`$”½ÜÐïÑ5PÝ Ý[ß­àûïñÿÿÞ­à[Ý[ûï„ñÿÿÐPYxPPÐधZ-Ý[ݪûïœñÿÿÕP‘ïò	
ßïb.ûïÐOÐZPÐjZÕZÏûï6ÐPZÝ[ûïÚÐPªÔªÔªÔªÔªÐIï¹5jÐZIï°5ÐIï©5PÐï^I[SÝÀûï PÐPZÝßïõ-ûïÊ’ÿÿÖï˜-‘ïbÝï‰-ßïì-ûï:OÝZûïÐPïIÐÿIïýH Ð[PÔZšÇ[Å[PÀ¬PÐZ`Å[PÁ¬PZ×[Õ[æÐZPßï6ûïÉÿÿÿÐPï¸HÂ^Áï-ï-­üЬ[!Ðï-PÖïý,Ðïó,Qk@aЭüPÖ[Ñïã,ÒÝûïµOÐPïÄ,ÔïÂ,ÖïÀ,ݬûïÿÿÿÂ(^Ðïi.­ü”­Û”­Ú˜­Úïý31–­Û”­ÙûïoíÿÿÞï»-PÐï<.QA`­Ø‘­Ø:	‘­Ø=1ÕïÅ3‘­Ø:ÐPÐPöP­Ú–­ÛÖï.‘­Ü0/‘­Ü9)ß­Üûïìïÿÿ‘`$ÐPÔPöP­Ù
Ýûïc‘ÿÿÐPß­Üûï)ýÿÿÐP[ÑïØ
0‘­Ú*á«ÐïÃ-È«•­Ùâ«Ðï)«Ðïû,«•­Ù
‘­ÚÐ[ï3á«	Ýûïg‘ÿÿÑï3
Ðïþ2PÐ[@ïù2Öïï2	Ýûï>‘ÿÿÐï:-­üß­Üûï®ëÿÿÕP1Ñþ•­Û)Þï”,PÐï-Q˜A`~ûï‰ìÿÿÕPÝûïØÐÿÿÔPЭüïñ,‘­Ú1ÿûïýÛÿÿãÂ^Ô­üÞïà2[1†ÐkZz|•ïÏ	
ӪȪԪݪݪûïúÿÿÀPªѪï(
Àï—,ªѪïÿ'Áï‡,ï~,PÀPªÑZï~,
ÓpªÎªЭüªÖ­üÐjZÕZ„À[Ñ[$¨1nÿÂ^Ô­üÞï:2[1ÐÐkZ1¾1ÂѪÿÿÿÿ1«àª”­ô4Ѫïp'ö­ô$Ѫïd'ö­ôѪïX'ö­ôö­ô᪈ ­ôЪ­øЪYÝYûïOMöP­õݬÝÝß­ôûïKÝYßïR*ݬûï°J×¼ЬPРQÖ ”aݬÝûïJ˜­õPÀ	PÀP­üÐjZÕZ1>ÿÀ[Ñ[$¨1$ÿЭüPÞïL1[ÐkZâªÐjZÕZôÀ[Ñ[$¨ãÈxËxÍxÐxÓxÖxØxÛxÞxàx.endc.ift.iff.iftf.if.iifIftf called with bad option: %ddfndfeqznenzgtggeltllez9zBzYzkzƒz›z¬z¼zÍzÞzëzüz{2{B{Q{d{t{„{˜{§{Ç{â{ó{|(|A|O|k|ƒ|›|µ|Ä|Ý|ô|}3}a}„}¥}À}Ó}ï}ù} Assembler Error-- 

	%d Error(s) and %d Warning(s)
	 #	Description of Error(s)


    Err_load=%d
	%d	%s
~|^`s.error.c R1.3 on 1/3/80<unused>Missing .end statementInvalid characterMultiply defined symbolSymbol storage exceededOffset too largeSymbol too longUndefined symbolInvalid constantInvalid termInvalid operatorNon-relocatable expressionWrong type for instructionInvalid operandInvalid symbolInvalid assignmentToo many labelsInvalid op-codeInvalid entry pointInvalid stringBad filename or too many levelsWarning--attribute ignored.Error statementToo many levels: statement ignoredInvalid conditionWrong number of operandsLine too longInvalid register expressionInvalid machine addressUnimplemented directiveCannot open inserted fileInvalid stringToo many macro argumentsInvalid macro argumentInvalid formal argumentInappropriate .endc statement; ignoredWarning--relative address may be out of rangeWarning--invalid argument; ignoredInvalid instruction vector indexInvalid instruction vectorInvalid macro nameUnable to expand time macroBad csectOdd addressp~
+-*/&!^<>%/^%n
t	fr
bOperators[] and Evaluate() incompaitible for: %c
~|^`s.eval.c R1.8 on 1/7/80ÿÿÿÿ††"†'†,†2†8†>†D†	J†
P†U†Z†
_†d†i†n†s†x†}††††‹††”†™††¢†¦†«†¯†´† ¸†!½†"Á†#Ɔ$ʆ%φ&Ó†'؆(܆)á†*å†+ê†,î†-ó†.÷†/ü†0‡1‡2
‡3‡4‡5‡6‡7!‡8%‡9*‡:/‡;4‡<9‡=>‡>C‡?I‡@O‡AU‡BZ‡C_‡Dd‡Eh‡Fm‡Gr‡Hw‡I|‡J‡K†‡L‹‡M‡N•‡Oš‡Pž‡Q£‡R¨‡S­‡T²‡U·‡V¼‡WÁ‡XŇYʇZχ[Ô‡\؇]܇^à‡_ä‡`è‡aì‡bð‡cô‡dø‡eü‡fˆgˆhˆiˆjˆkˆlˆmˆn!ˆo&ˆp+ˆq0ˆr5ˆs:ˆt?ˆuDˆvIˆwNˆÇSˆÄYˆÅ_ˆÆeˆxlˆysˆzzˆ{ˆ|‡ˆ}Œˆ~‘ˆ–ˆ€›ˆ ˆ‚¥ˆƒ«ˆ„±ˆ…·ˆ†»ˆ‡ÀˆˆÅˆ‰ÊˆŠÎˆ‹ÒˆŒÖˆÚˆ‘àˆ’åˆ“êˆ”ïˆ•ôˆ–ùˆ—þˆ˜‰™
‰š‰›‰œ‰"‰ž&‰Ÿ*‰ .‰¡3‰¢7‰£;‰¤?‰¥B‰¦F‰§J‰¨N‰©R‰ªV‰«Z‰¬^‰­b‰®f‰¯i‰°n‰±s‰²x‰³}‰´ƒ‰µ‰‰¶‰·•‰¸›‰¹¡‰º¥‰»©‰¼®‰½²‰¾·‰¿½‰À‰ÁljẨÃusage: as68 [-godspelh] sourcefilename
/usr/sun/lib/a68.hdr.sr.a68rrCan't open source file: %s.s
rCan't open header file %s
.tempwCan't create output file: %s
.listwCan't create listing file: %s
.bwCan't create output file: %s
.Source stack overflow: %dUnknown option  '%c' ignored.
abcdaddbaddwaddladdqbaddqwaddqladdxbaddxwaddxlandbandwandlaslbaslwasllasrbasrwasrlbccbccsbchgbclrbcsbcssbeqbeqsbgebgesbgtbgtsbhibhisbleblesblsblssbltbltsbmibmisbnebnesbplbplsbrabrasbsetbsrbsrsbtstbvcbvcsbvsbvsschkclrbclrwclrlcmpbcmpwcmplcmpmbcmpmwcmpmldbccdbcsdbeqdbfdbradbgedbgtdbhidbledblsdbltdbmidbnedbpldbtdbvcdbvsdivsdivueorbeorweorlexgextwextljbsrjccjcsjeqjgejgtjhijlejlsjltjmijmpjnejpljrajsrjvcjvslealinklslblslwlslllsrblsrwlsrlmovbmovwmovlmovcmovsbmovswmovslmovemwmovemlmovepwmoveplmoveqmulsmulunbcdnegbnegwneglnegxbnegxwnegxlnopnotbnotwnotlorborworlpearesetrolbrolwrollrorbrorwrorlroxlbroxlwroxllroxrbroxrwroxrlrtertrrtssbcdsccscsseqsfsgesgtshisleslssltsmisnesplststopsubbsubwsublsubqbsubqwsubqlsubxbsubxwsubxlsvcsvsswaptastraptrapvtstbtstwtstlunlkŠä Unrecognized address mode in line %s~|^`s.ins.c R1.2 on 6/27/80X‹ÿÿÿÿ @€ @€.macro.rept.endm.endr'.macro.rept.endm.endrInvalid formal parameterpassed to Load_Arg$~|^`s.mac.c R1.2 on 12/5/79„‹
|,:()@]~|^`s.oper.c R1.2 on 12/17/79Ü‹%4d%c   binbexmdmcmecndld~|^`s.print.c R1.5 on 1/22/80.end.long.word.byte.macro.rept.ascii.asciz.blkb.blkw.blkl.list.nlist.insrt.text.data.bss.globl.comm.radix.typef.printf.error.page.defrs.even
   End: Position=%d, rCannot reopen temporary file %s%d errors in descriptor file

   Start_Pass: Pass=%d
<%4d%c       %s~|^`s.ps1.c R1.9 on 12/18/79ˆ¥«±``tˆ¶¼¾
Æ
ÉÍÐ×absextoutinr
~|^`s.ps2.c R1.4 on 12/13/79.text.data.bssoctal8decimal10hex16binary2,ž.symwCan't open symbol file: %s
%-10s  %O %c%c
/usr/bin/sortsort-o~|^`s.ps3.c R1.6 on 5/19/80xž
|Entering Read_Line
.end
%d: %s~|^`s.random.c R1.3 on 11/8/79.dtmwopen on output file %s failedw+open on output file %s failed.rtmw+open on output file %s failed.dtmw+open on output file %s failedPut_Words given odd nbytes=%d
 Ÿsdi storage exceeded
sdi bound list storage exceeded
Pathological sdi
~|^`s.sdi.c R1.7 on 6/27/80/dev/nulll»Lookup of null symbol Bad Symbol
      Lookup: S=%s, found
Symbol storage exceeded
--sym heap allocated, #%d --%s+X"ô*¬1t8<>87DÄAKpES€JXÈQ^@WdÐ[j`sàeyØlLŸ„oŒøp’â$Ä¢¨¨Ä±Œ¤ÄÀ´ÄÏ‚ ÇÖ°ÄßZ¬Äïr”Ýø—˜ÝÿÃœÝ	Æ ÝǤÝ.(Þ#´hß-Ælß5Úìß=
ìãEÀ^ÀNþ6ÀWâ&¾^‚.ÀfFÀo°VÀw™NÀ:&Àˆ~À‘†¾¡¾°þ¿¾•Þ¿ÅþÁÍÔοÓÛֿڽƿâE¾¿êN¶¿ñ?®¿øËnÃAöÁ1ž¿ÂfÃ[^Ã!aîÁ)–¿0ÊVÃ6›æÁ>êNÃDÍFÃM¾>ÃVª6Ã_$.Ãg°&Ãp!Ãx’ÃÉjÃ’œþšFÖÁ£îª&¾¹•f¿ÃCV¿Î±v¿Ø>N¿áÜn¿é¸^¿ñÒ¶ÁùÁ.¿ÿ¼æÂÖ¦Áö&¿¤6¿œ¿%¦ÖÂ+(öÂ2`ÎÂ9žÁ?–ÁE‚ŽÁN†ÁV»¿\AvÁd~ÁkÌ¿r¿x‘þ¾~•ÖÃ…¤Æ‹x¾Â“ϮšÉÎàÅö¾§ î¾°ì>¿¸ª¶Ã¾æ¾Äu¦¿ÌyžÂÓ–ÂÚñÞ¾â’־贮Ãî3ŽÂöŒÞÃývB5†¿
¼ξ}nÁyfÁÐ^Á&­VÁ0cFÁ7ÆF¿@Ç®¾I³>ÁR"vÂ\õ6Áfà.ÁpLž¾x„¾¾€p¶¾ˆ`î¿P¦¾™ˆƾ¢BÁ«vþÀ±‡–¾¸ÕŽ¿¾|îÀÅ¢Ž¾Ìð~¿ÒeæÀÙÞÁáxÞÀé²®ÁðˆnÂ÷6ÖÀ7ÞÂ	zf«¶Â[öÀNÎÀ&³ÆÀ-£¾À4¤¶À=†¾Ct®ÀJ+¦ÀQžÀXŽÀ`†Àh–ÀrM–Àzf>Àƒ=¦Ã‰ æ¿Ï~¾—„žÃžÚV¦ÆN®»–özŽÃ½ªNÁÇê~ÀѪÎÁÛò&Áå2vÀïòÆÁùÁ‘ÁëÁ*nÀ#ê¾Á-n^Â3fFÂ9Xv¾?ân¾DŒÆÃJľÃPRÀ_.f¾f;^¾mfÀwwö¿~,V¾…
N¾ŒèF¾“û.šk&¢Ï>¾§t­q³o¹O>ÂÁ	ÂÊÝ~ÂÒ?¦ÂÝW6Âä͆Ãìé6¾óÿ.¾û³~ÃØvþ
L~X	ËT *	8d 8	Sä >	¹ô G¯°~M	Z¡R	—¡X	¬”¡b	C˜¡f	yœ¡m	} ¡t	Y¤¡{ox˜t‡‰¦c’g˜* sŸ
€J§[†<®|<»ÖÈQÅ	>¨¡ÎŠÙ
œyá	°¬¡éþxõµx$x`ÿ8c]&$€ì*tl.epE:Ø E¡º`P›’^%(xjðôuf$ôXcˆ˜øp4Cœäx¤÷èx° yº;¤yÄ	_°¡Í	™´¡×|¨yáȬyé±Æù‰ì		ØŒ~		À|¢	5˜~#	8p0	€~6	ì~@	¹~K	Û~W	‚ ~b	†0~n	c¬x	Å&B‚	¿j	Œ	Çvc”	>	™	ƒ’c 	¤~ª	} µ	
Á	pv
Ì		΄¢Ô		9„£Û	~ç	–”~ñ	ûœ~ý	y ~
§¨~
	m¤£
Q¬~'
	WÔ£2
	Zô£=
	7¤H
	í¤R
	Ë<¤\
£´~f
ëÜ„m
,‚bu
	¬~
m‚‹
–r•
¡87¡
Ð&¨
dc®
ëÔ‰³
	ßD¤½
	¼L¤Ê
؉Ñ
		T¤Û
	2”¤ã
J4ð
ÆÄA#kÇ–&\f%$¾%&@L&/(j8>x"@€æ'H Ô(Pø¶&XI<'`]*h84+r<ª/zIz-ƒäB,‹üú,“„þ-Ì’.¥À*®Ø 0·P”0Áh.1˘
 Ôæ Ýÿ$2䓬2íŒì2õìD3û]6¥P6
/t6å6Ê‚3%Uà5-S´53×7<ðž6FkÊ5L{ 6T›06\@6dÚ6m”tjv^´6ÊfmŒëØl•È)žµð5¥	œ¤±	$4¥¹	…L¥Â	íì¥Ë	ùô¥Ô[(Šä	Ž4¦ì	×<¦öÑ Šû}$Š
	p|¦
,Š
³°‹&
³H74
BlŠ<
÷::I
®rW
ac
¡ì8o
M¸:|
$¶;ˆ
r6;’
µ„;Ÿ
|ðŠª
ªzA·
Eè`Ã
œ2aÍ
û0A×
ø?è
¬bð
e‚eü
Êp@Çt‹7DB±‚D!)¤‹(7¨‹1[¬‹<CPžEvHOÈ:HWâ"I^'j|vÊ	4ü¦‰	e§–íü‹¡LÎM¦LS®@WµÈšZ¼,LYÇ`Ð[ÎmŠ\Ô¦”YÛª^䉘[êû2PñŠ˜Q÷ˆ’]ê¼gB¶mI`!ao*6À¶t?…BoIÐàeU~ŠOaî^Oh·Pvn	Â4§{Ñ°Pƒ	Þ8§	:<§œ´ˆk¦Ð«	¤d§´	9”§¾<È Óa$ßÐkè>ŽTðTTú	õ §Ô\	;®W¨ÒÜ 	2¤§.6o6EHž>\LžL²aXÖÞb`ƒðbf	Ã$¨p	(¨v	,¨|	~0¨ƒ	þ4¨Š	"8¨’	¿<¨š	D¨¡	^d¨©	^„¨±i\u¼XDlżPŸÏfÊnج0nároé@¤oñ	†¤¨û	¨d»úÈŸ	wl»áÌŸ&»П0TÔŸ:jþqGËnrQcrt0.oexec_startas.ocond.oerror.oeval.oinit.oins.omac.ooper.oprint.ops.ops1.ops2.ops3.orandom.orel.osdi.o_sdispawn.osym.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_ins_example_ins_hash_tab_Code_Operand_Pass_Dot_Line_Position_BC_tsize_dsize_bsize_Done_Init_Read_Line_Cond_Label_Pseudo_Macro_Instruction_ByteWord_Dot_bkt_Cur_csect_Errors_Ignore_Cond_level_Condition_Subcondition_Get_Token_seq_Endc_Iftf_If_Print_Line_Eval_Cond_Non_Blank_Prog_Warning_cond_table_Sys_Error_Prog_Error_Lower_Lookup_Get_Operand_error_E_messages_Warnings_Err_code_E_pass1_Err_list_Err_load_E_warn_Error_Describe_Error_Endprint_O_list_listout_O_debug_Print_Error_eval_In_radix_Operators_Prefix_tab_Radix_tab_Escape_tab_Evaluate_Op_Delim_Get_Term_member_rev_lastc_O_global_Num_Value_Char_Value_Grab_Char_header_Title_O_listname_O_symtab_O_ext_only_O_print_O_outfile_Source_stack_Ss_top_File_name_Temp_name_Temp_file_Rel_name_Rel_file_op_codes_canum_Concat_Options_Push_Source_Sym_Init_Init_Macro_d_ins_Hash_ins_Mnemonic_Code_length_WCode_operands_numops_Get_Ins_Bkt_Scan_Operand_Field_Put_Words_no_op_one_op_clr_op_ctrl_op_move_op_two_op_jbrnch_cbrnch_branch_brnchs_regmem_shift_op_reg_op_postinc_bit_op_memreg_regbrnch_exg_op_addr_op_link_op_movem_op_movep_op_movs_op_movc_op_moveq_stop_op_rts_op_trap_srreg_data_addr_alt_addr_ccreg_eaddr_uspreg_areg_adrbyte_mem_addr_dreg_sfcreg_dfcreg_vbrreg_sr_addr_rel_val_ctrl_addr_sdi_bound_makesdi_baround_pcreg_M_defining__M_bkt__M_call__M_line_M_stack_Top_of_M_stack_CM_top_CM_tests_mac_Expanding_Mac_hash_tab_typ_mask_Lflags_Define_Macro_MLHold_Print_Macro_Store_String_Line_Delim_Load_Macro_Load_String_Get_Mtoken_Load_Arg_Form_Arg_No_ACS_count_Get_Mac_Bkt_Skip_Comma_Enclosed_octalize_Read_Macro_Line_append_Start_Line_Rept_oper_Num_Operands_Get_Defer_print_L_radix_L_ndigits_Line_no_Print_No_Space__NList_Text_csect_Data_csect_Bss_csect_filhdr_Entry_point_EntryFlag_End_Asciiz_Blkbw_Insrt_New_Csect_Globl_Comm_Radix_EPrintf_Page_Defrs_Even_Pr_Sym_Tab_Fix_Rel_sdi_resolve_Csects_sdi_inc_Csect_load_Sym_Fix_sdi_free_Rel_Header_Start_Pass_Ehead_Perm_Last_symbol_Equals_Label_count_Label_list_Put_Text_ps1_Ext_buf_Ext_mark_Ext_load_Extension_Ext_nbytes_Put_Rel_Extend_LoadChar_Rel_mark_ps2_Csect_radix_tab_ps3_sym_hash_tab_spawnl_random_Line_end_tab_Get_String_Length_Copy_Rel_flag_tout_dout_rtout_rdout_rtsize_rdsize_dname_rtname_rdname_Sym_Write_rel_cmd_sdi_list_sdi_len_longsdi_b_free_spawnv_sym_heap_sym_free_Sym_heap_count_Cblock_Ccblock_Cb_nextc_Cb_count_get_sym_bkt_sym_linkilbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_sumacc/cceun/c268   555      0     12       41100  3472711341   7024 €,<H0202ÿÿÿÿÿÿÿÿh€C2680`44ÔHûŒ1.01 (UNIX ld)
$«
LIBCSHARE_001$k-¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÄP
1&
Ô~Ý]ûï
0Ÿï>ûïî/Ô~ûï¼1ÝÝ]ûïè/úlïÃ/ݬݬݬûïÔ~ûï1Â^ѬЬPРP‘`+
׬À¬Öï?(Ô­üѬЬPРP‘`-
׬À¬Ö­üѬBßï÷ ЬPÝ ûï÷1ÐPïz+0ЬPÝ ßïÕ ßïuOûïÜ1Ýûï1Þï=OïH+ѬBßï¹ Ð¬PÝ ûï¤1ÐPï++0ЬPÝ ßï— ßï"Oûï‰1Ýûï°0ÞïúNïù*Ôï''ÔZûZïÀûïWÐPYûïUÔ[Ð[ïL'ûï#ÕïC'
ßïK ûïþ1ûï	ûï Ö[Õï'ÓÕï'
ßï' ûïÑ1ûïþÕïú&
ßï ûïµ1ûï¬
ÕïÚ&Œûï÷ÕPÝûïüÝïB*ûï•0Ñ[ZÐ[ZÕY1BÿÝï&*ûïy0Õ­ü1€ÝZßï¸ßïNûï|0Ýï8&ßï®ßïüMûïc0Ýï+&ßï¨ßïãMûïJ0Ýï&ßï¥ßïÊMûï10Ýï&ßïßï±Mûï0Ýïì%ßï™ßï˜Mûïÿ/Ýï×%ßïßïMûïæ/ÝïÂ%ßïˆßïfMûïÍ/Ýï‘%ßï…ßïMMûï´/Ýït%ßï€ßï4Mûï›/Ýï{%ßï€ßïMûï‚/Ýïf%ßïzßïMûïi/ÝïU%ßïußïéLûïP/Ýï8%ßïyßïÐLûï7/Ýï+%ßïußï·Lûï/ßïªLûïñ.Ýûï8.Â^Þï™$Zûï‡ÐPYïY­üšYYÐYPÑP1ÑPøÑPóÑPsÑP%1ŒûïÐP[öYkö­ü«Ô«Ýïh$ûïÉÐP«)ÑY$žÔP‘ï. LDßï% ûï†ÐP«ökÔ«Ô«ÐZ«Ð[ªÐ[ZÔ«ÑYÁÐPûï­ÐP[‘ïè.²ökÔ«ßïÙûïŒÐP[ö%k”«‘ÿá#.CÐïØ#P‘ L5ÀïÉ#ÝïÃ#ûïÐP«‘ÿ²#01zÿ‘ÿ¦#9ôÖï#ã”k•ûï,ÐP[öYkö­ü«‘ÿ#. Ðïv#P‘ LÁP~ûï­ÐP«1'ÿ‘ÿV#p1ÞþÐïI#P‘ cï‘ @èÔ«ö«««k1,ÿÞï[ÔY1ÕYÑZ:”‹ÐPÑZ
Ñ[T$Ø”‹ûïóÑZ	ÖYöZ‹×ÿª&Ðï¢&PРQÖ šaP
Ýï&ûï†,ÐPZÖP ”‹Ð$PЬ[ÔZÑY9Å
ZPÀYPÃ0PZ˜‹YÑY0è•{‘k-ÔPÐZPÂ^Ðï]"[1˜ÑP$MÝ«ßïÝï(&ûï›,1\ÑPáÑPÖÝ«ßïéÝï&ûïw,Õ¬×Ý«ûïà-1)˜«YÑYdÑYe	ÑYf”«Þï‡ZÕj1–˜«PxPP˜kQÈPQѪQ1‘k‘kÁj~ßïtÝjßïoÝï€%ûïó+ÑYdßïWÝïd%ûï×+ÑYeßï=ÝïH%ûï»+ÑYfßï#Ýï,%ûïŸ+‘k%Ý«ßï
1æþÀZ1LÿÕ«Ý«ßïúÝïú$ûïm+Õ¬,1óþ‘k‘kÝ«ßï×1§þßïÕÝïÉ$ûï<+Ы­üÕ¬Ðïæ «Ð[ïÝ Ð­ü[Õ[1€þ˜kPÑP1vþÕ«%Ý«ßïÝï$ûïò*Õ¬
Ý«ûï[,ßïn’Ь[Ý[ûïC-ÐPYÔPÝÁY~ûï&,ÐPZÝ[ÝZûï-ÐZPÞïæ[L˜iPxPP˜©QÀQQÀQP˜©QÀQPïPPÇ9PQÄ9QÃQPQÞAï#ZÑZ8,Þïö"ZÕŠìÐ[zÀ[ÐkY¯Â^ÞïÅ#Y”©©©©iÞïÆZÖZ‘j	ù‘j ô
‘j ‘j	Š‰•jÖZ‘j	ù‘j ôÐZï­˜ïs#PxPP˜ïi#QÀQQÀQP˜ï]#QÀQPïPPÇ9PQÄ9QÃQPQÞAïT"­ü{ÐkYÞï3#Z‘j‰	•Š÷ЫP×Y‘jb•ª•i
Ád«P‘jw•ª•i
Áe«P‘jl•ª•i
Áf«PÀ­üÑ­ü8,Þï×!­üнü[1|ÿÞïÆïáÔPÞïÂ"YÔ‰ÑY\.õÐï¦[)‘k Ç«PÄPÃP«PÐ[@ï‰"Ô«Ы[Õ[ÓÐïp[~‘k
‘k‘k%kÔ«Ç«PÄPÃP«PÐ@ïG"ZÑ«ªÐï/Z‘jÑ«ªЪZÕZìÕZ!ÝZûï©
РXÑXZШ«ÐXZÐZ«ÖªЫ[Õ[1{ÿÐïâ['ЫZ‘kÕ«ÕZ•j‘j%	Ý[ûïU
ÐZ[Õ[ÕÔï
Ðï¤[Õ[1³‘k
‘k‘k%JÕ«EÝ«ûï
ÐPZ‘j3Õª.Ñ«ª'Öï„Ъ«Ý«ûïï	ЪPÖ Ъ«ÖkdЫY‘i[ЫZЪZ‘j÷ÑZYIÝ«ûï³	Щ«Щ«ЩPÐ[ Щ«˜«P@ï/«Ðï©ÐYïþÖï@Öï&‘kx‘ks1ב»o‘»i‘»c‘»$]•»X‘»!R‘»"LÖïþÖïÄЫPÕ ЫPÝ ûï	ЫYЫPР«ЫPÐ[ Ðï~©ÐYïuÕ«‹Ð«ZÕZE‘j@Ñ«ZVЫPЫ ЫPЫ ÐïE«Ð[ï<Ы[ÝZûï±ÖïqÖï;Ý[ûïÝ[ûïÕÐP[Ы[1LþЪZ•Â^Ô­üЬ[ЫZ0ÔPÝZûïLÐPYök”«ÐY«Щ«Ô«Ö­üÖïäÖïЫ[ЪZ‘jõÝZÝ[ûïØÕPÑ[Z°Ð­üPЬZ‘jH‘º>ûïÐP[ökÐïž«Öï–Ô«Ô«Ð«Ъ«ÐZ«ЪPÐ[ Ð[ªÐ[PЪZÖªÐZPÂ^Ь[‘k1ÄЫZM1»‘jO‘»òЪZÐZYЭôЩYáÑY[Ü×­ôבiëЫPÑ© àЫ[1€Ð¬PЪZq‘jõ‘j¬ÐªZЫYY‘i‘iKÑ[YNÖïÓÖïñЫPÐZ ЫPÐY ЪPЩ ЩPЪ ЫªЫ©Ý«ûïõÐZPЩYÕY£Ð[PÑ[Y1oÿЬ[Ý[ûï¸þÿÿÐP­ø˜©P@ï_©Ý©ûïµЪPÐ[ ЩPÐ[ ЫPÐZ ЫPÐY Ы­üЪ«ЭüªЫ­üЩ«Эü©Ý«ûïUþÿÿÐPZЪ©ÐZ©Ý­øûïWЭøPÕ ×ïâÖïìÖïÐYPÐï–[9‘k0ЫZ*Ѫ$ЫY‘iÑ©ZÝYÝ[ûïЩYÕYâЫ[Õ[ÃЬ[ЬZSÝ[ûïÁýÿÿÐPYЪPЪ ЪPЪ ÐZXЪZÐï5¨ÐXï,ݪûï¤ЩªÐYªÖï[ÖïEЫ[‘kõЪZÝZÝ[ûï'ÕPÂ<^ÐïÉ[Õ[1EÕï:ÔYÅ!YP•@ï Å!YPŸ@ïÝYßïgûï¾#òYÕßï^ûï­#˜kPÏP)é”òòòòWÂÂ~~ÂòòòòÂò˜òòòòòòòòòòòòW1›‘«d1<‘«eöÝ[ûïßïdßï=ûï&ÕP.ßï,ûï7ÐPYJßï;ûïSÐP­ôÑYP4‘».ЫPЫ ЫPЫ Ðï«Ð[ï¹ÖïÃЫ[1Ìþ‘k&
ÝÝÝ[ûïÈßï¾ûï÷ÐPYßïÏûïçÐP­üßï¾ûï¸ÕY.Õ­üÅ!YPŸ@ï´ßïzÝ­üûï,"ßï‰ÝYíÕ­üßßïzßïSûï
ßïFûïó1_ÿÝ[ûïßïNûïH”ï²1@ÿÝ[ûïâÝÝÝ[ûïßïûï®ÅÝ[ûïŸßïéûï‘k·ßï×ûïÐPYßï^ÝYûïx”ßï´ßïJûï_	1~ÿÝ[ûïKÝÝÝ[ûï’ßïˆûï5•ï{1™þßïßïjûïS	ÕPæЫPЫ ЫPЫ Ð[­øЫ[ЭøPÐï ЭøïÖïAÖïC1EþÝ[ûïç‘«e1Ы­ø‘½øò‘»ìЫP‘ âЭøP‘ e×ßï‚ßïÝûïÆÕPÀßïíûïÐPY®ÑY©Ý­øûïßïNßï¥ûïŽÕP1“ßï²ûïÊÐP­ôÑYP}ÐïQ«ЭøPÐ[ Эøï?Ы[ö+k”«Õ«Ý«ÝYßïõß­Æûï Ý«ÝYßïåß­Æûïj Ô«ß­ÆûïcôÿÿÐP«ЭøPР­øЭøPÐ[ Эø«1ÙþÝ[ûïÉßïõûï¢ßï	ûï•ÝÝÝ[ûïØ1«ýÝ[ûïbûï]1áüÂ^ÔXÔ­üÐïj[
ÖXÐX«Ы[Õ[òÐïS[~ЫZ‘kr‘jmÕ«hÕªcЪPàª~ûïaÐP­øЫPà«~ûïLÑP­ø7Ñ«ª0˜«P@ï2
«ЪYЫªÐY«ЪXЫªÐX«ÖïÖ­üÐZ[Õ[1{ÿЭüPÕ¬άPЬPЬ[ЬZ‘kj‘«ªÔP•k‘kô‘k ïЫYЪXÕYÕXÐPÕY×ÕXÓ‘iˆΕ‰÷éЬ[	‘kЫ[Õ[óÐ[PÐïX[ЫïM”«Ð[PÝÝûïñÔ[Å![P”@ï‡ò[ñ”ï”ï×Å!¬Pž@ïh[Ð[YЬZÝZûïÙÕPj‹‘Š,ö”{Ô[Å![Pž@ï5Z‘ŠaÁ(¬P˜jQÑQPÅ![P”@ïò[ÒЬ[Ý[ûïƒÝ[ûïÐPZÅ!ZP”@ïèÑZÝZûï–ÿÿÿÅ!ZP”@ïÍÝ[ûï¤ÐPZç‘‹a5‘k00‘‹5+‘k@%ÔZÅ!ZP‘@ïœ#Å!ZP”@ï˜òZÝЬPР[Þï@Z‹Šû”ïUЬYЩ[Þï"Z‘k,‹Š•kô”ŠÞï,Z”j‘‹,‘k ‘k	Ö[ò‹Šû•¼#Ô[ݬÅ![PŸ@ï	ûïÀÕPÐ[Pò[ßÎPЬ[‘kd‘«0‘«7
•«˜«PÂ0P‘ka‘«0‘«5
•«˜«PÂ(PÎPÞï*ZÐï'[Ñ«Zûï5Ð[ZЫ[Õ[èЬ[Ð[Z•kÔP•Šü‘ªþ+‘ªþ-í‘‹a&‘k0!‘k5˜kPÂ(PÐPYÄ!P”@ï;ÝYûïîýÿÿÐPÂ^Õ¬ßï
ûï÷þÿÿÐP­üέüßïÕûïàþÿÿÐP[Õ­ü1ÝÞï»YÞïvZ‰Šû•ïÉÞï–Zö,ŠÞï·Y‰Šû”ï~Õ[8Ñ[Õ¬aï3Á([Pdï%Á0[PöPï”ïÖï.Õ­ü;Ñ­üÕ¬aï*Á(­üP
dïÁ0­üPöPï”ïÖïîßïüßïÂûï]ßïµûï.ïÿÿЬQÐP¡Â$^Õï•ÎYÐï‰[\‘k 
‘k!‘k"I˜kPÑPYÕ«9‘» ‘»!‘»"'ЫPЫ ЫPЫ ÐïX«Ð[ïOЫ[˜kYЫ[Õ[ Â^ЫZÝZûï­ûÿÿÐPZ‘j
\ÝZûïðüÿÿßïð
ÝûïíûÿÿÝûï‚ÐPYÝûïvÐP­ü"ÝZûïÛüÿÿÝûï^ÐP­üÝûïQÐPY‘º‘jÒЪZÝ­üÝY˜ª~ûï{ÕP'ÖïÏÖïáÝ«ûïûÿÿЪ«Ъ«ЫPÖ ÐZÅ!¬Pž@ïÇ[‘k#Ð[PÝ[ûïÂüÿÿÐP¬×Zוkåßï°Ý[ûïUÕPÒÞïÅPÂ^Ь[ЬZ‘‹#‘Š#ÔPÔY‘j9Ä
Y˜ŠPÂ0PÀPY‘j0êÐY­üÔY‘k9Ä
Y˜‹PÂ0PÀPY‘k0ê‘k+Ö[‘j+ÖZ‘‹j²•Š÷ÐY[ЭüZЬPÏP	#0=JWdq~‹‰Ñ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPÑ[ZÐPÔPЬ[ЬZ‘j#Ý[ûïuÕPÞïfY‹‰ûÞï‚YŠ‰ûÂ^Ь­üЬ­øЭüPÖ­ü‘`½øÔPЭøPÖ­ø•`åÐPЬ[Ý[ûïÕP”ï[ÞïTZ‹ŠûЬ[‘k*‘k(‘k-	‘«(ÔP•‹ü×[‘{+ò‘k)‘{5èÐPL#P#T#X#\#`#d#h#l#p#t#	x#|#ƒ#%‰##‘#	•#
š#Ÿ#£#
§#«#¯#³#·#»#¿#Ã#Ç#Ë#Î#Ò#'×#(Ü#)á#*æ#+ê#î#ò#ö#ü#&$$$ $!$"$##$$	 NrC2: can't find %s
wC2: can't create %s
iterate
comjump
rmove
%d iterations
%d jumps to jumps
%d inst. after jumps
%d jumps to .+2
%d redundant labels
%d cross-jumps
%d code motions
%d branches reversed
%d redundant moves
%d simplified addresses
%d loops inverted
%d redundant jumps
%d common seqs before jmp's
%d skips over jumps
%d redundant tst's
.L%d:
%s:
	j%s	%sbwl	.L%d
	%s
	.L%d

%s
brabeqbneblebgebltbgtbcsbhiblsbccjmp.globl.longmovclrnotaddqsubqnegtstasrasllsrlslextcmpaddsubandoreormulsmuludivsdivudbfjsrleapeamovemmoveqlinkunlk.text.data.bss.even.end%d: %s -
#0#0#-1#1d%d,%sd%d,.L%d#0+X„ â$60¨¨6?Œ¤6N´6]‚ 9d°6mZ¬6}r”O†—˜OÃœO—Æ O¢Ç¤O«.(P±´hQ»ÆlQÃÚìQË
ìUÓÀ^2Üþ62åâ&0ì‚.2ôF2ý°V2™N2
:&2~2†0/0>þ1L•Þ1Sþ3[ÔÎ1aÛÖ1h½Æ1pE¾1xN¶1?®1†Ën5ŽAö3–1ž1Âf5¦[^5¯aî3·–1¾ÊV5Ä›æ3ÌêN5ÒÍF5Û¾>5äª65í$.5õ°&5þ!5’55j5 œþ4(FÖ31î48&0G•f1QCV1\±v1f>N1oÜn1w¸^1Ò¶3‡Á.1¼æ4•Ö¦3ö&1¤¤61­œ1³¦Ö4¹(ö4À`Î4Çž3Í–3Ó‚Ž3܆3ä»1êAv3ò~3ùÌ1Â1‘þ0•Ö5¤Æ4x¾4!Ï®4(ÉÎ5.Åö05 î0>ì>1Fª¶5Læ0Ru¦1Zyž4a–4hñÞ0p’Ö0v´®5|3Ž4„ŒÞ5‹v†4’†1˜¼Î0ž}n3¤yf3ªÐ^3´­V3¾cF3ÅÆF1ÎÇ®0׳>3à"v4êõ63ôà.3þLž0„¾0p¶0`î1P¦0'ˆÆ00B39vþ2?‡–0FÕŽ1L|î2S¢Ž0Zð~1`eæ2gÞ3oxÞ2w²®3~ˆn4…6Ö2Ž7Þ4—zf4«¶4¥[ö2­NÎ2´³Æ2»£¾2¤¶2ˆ0Ñt®2Ø+¦2ßž2æŽ2î†2ö–2M–2f>2=¦5 æ1Ï~0%„ž5,ÚV44ÆN4<»–5DzŽ5KªN3Uê~2_ªÎ3iò&3s2v2}òÆ3‡3’‘3ë3§*n2±ê¾3»n^4ÁfF4ÇXv0Íân0ÒŒÆ5Øľ5ÞR2í.f0ô;^0ûf2wö1,V0
N0èF0!û.4(k&40Ï>05t4;q4Ao4GO>4O	4XÝ~4`?¦4kW64r͆5zé60ÿ.0‰³’ŽØv5•0›L¥~X« ²	—T$¸	nT(¿	¡p(Ê	t(Ñ	’x(Ø	l|(à	w€(è	„(ð	{ˆ(ö	èŒ(ý	X(	¦”(	À˜(	šœ(	 (%	
¤(,	œ¨(3	ά(9	>°(@	¸´(F		¸(Oðœ!T	å¼([	À(b	“Ä(i	°È(qú!x	·Ì(~	[Ü*†	q+Ž	Þ,+•	T+	¼8,¥	g<,®ø·Â°¾$¸Çš–	Ñ'¦
Ú%6䔺í9„ô¿Þü˜ð›J
¯Ü‰¾$ïp,žö4Šò<’pCñ4
M*ÚVŸ¤]Ñf€hn(Švb¬€ÉÚ‡ ž‘`¼—V ÓR¨–N°ôJ¸¬4ÁSˆÇÙ"Î.ô×sBà4àéõ¸ðcrt0.oexec_starto0.oo1.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_optab_line_first_freenodes_curlp_nbrbr_nsaddr_redunm_iaftbr_njp1_nrlab_nxjump_ncmot_nrevbr_loopiv_nredunj_nskip_ncomj_nsob_nrtst_nlit_nchange_isn_debug_lasta_lastr_firstr_revbr_regs_conloc_conval_ccloc_ophash_infile_outfile_opsetup_input_movedat_refcount_iterate_clearreg_comjump_rmove_jumpsw_output_getline_getnode_copy_getnum_oplook_nonlab_decref_xjump_codemove_insertl_equop_backjmp_dualop_equstr_findrand_isreg_repladdr_dest_savereg_setcon_source_singop_redunbr_areg_check_findcon_compare_natural_setcc¢Ž0Zð~1`eæ2gÞ3oxÞ2w²®3~ˆn4…6Ö2Ž7Þ4—zf4«¶4¥[ö2­NÎ2´³Æ2»£¾2¤¶2ˆ0Ñt®2Ø+¦2ßž2æŽ2î†2ö–2M–2f>2=¦5 æ1Ï~0%„ž5,ÚV44ÆN4<»–5DzŽ5KªN3Uê~2_ªÎ3iò&3s2sumacc/cceun/ccom68   444      0     12      270207  3472711342   7473 €,<H0202ÿÿÿÿÿÿÿÿh€CCOM680ÁM¼@1.01 (UNIX ld)p.p
s†ž$$«
LIBCSHARE_001$k9¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿà\Ì
ì1&
Ô~Ý]ûï
HŸïÆûïîGÔ~ûï¼IÝÝ]ûïèGúlïÃGݬݬݬûï“Ô~ûïIݬݬݬÝÝÝ!ûïjnÝÝÝÝݬݬûïQnÐP[ЬPÑP4ÑP
ÑP6ÑPH
ßïZóûï«ÙÐ[PݬûïÅgÐP«ìЬ«åÑï:Ï
ßï,óûïtÙÐïæ9PЬ@ïà9ÖïÖ9Ñïðöœ[
ßïóûï@ÙÐï†ZÿÑöÀïÊöÐïxZÿ¿öÀï¸öÐïjZÿ­öÀï¦öÐï\Zÿ›öÀï”öÔïFZÂïƒöÐï}öPÐ`ï1ZÂïnöÐïhöPÒ¬QËQïZQÉQ`ïZÂïLöÐïFöPÐ`ïòYÂï7öÐï1öPÐ`ïÙYݬûïúsÐP¬Ѽßï_òßïtòûïØÑï¶YÄ[åÑï©Y”c
ßï_òûï9ØЬPРÿ‰YûïdyÐï|YQÐP¡ÝPûï6yÀïgYݬûï•ÙxïOYPÕàÈ[ßïòßï1òûï‡×Ñï.YÄ[åûïyxïYQÐPáÈ[ÝPûïÐxÑïþX”c
ßïòûïŽ×ÃÄ[ïßXPÇPïÒXÐïÐXPΠÀïÄX€Â^Áï²XP~@ï¶X[Ð[WÃï£XX7Ð[Y'Ñi©ÁYWÐi­üÐgiЭügЩ­øЧ©Эø§ÀYÑYXÔÐWXÐ[WÑ[XÄÁ[ZÑjªøÐj­øÝ­øßïpñûï–ÖÀZÑZï9XÙÃ[ï0XPÇP~Ã[~ûïÜ}Ã[PÐPïX€žÎÌþ^´ÍÎþÎïBðÔï@ð´ï>ðÞÍÒþZÞï¿_YÀZÞmPÑZPßïñûïx8ÐP°ÍÎþjÀYÐïØ6i2ÍÎþP°@ï‹åÍÌþ±ÍÌþü1ŒÕïÞïûïÐPïÎïÔïÆï2ÍÌþPÀï»ïP÷PÍÌþ[±ÍÌþ•R2ÍÌþP°@ï
ÜÍÌþ2ÍÌþP2@ïÇêPÑPï‡ï-Îï~ïÐïL6ïK6°ÍÌþÍÎþµïnï17ÿ·ïcï1.ÿ2ÍÎþP°@ïèìÍÌþ±ÍÌþþÿWÕï:ïûïwÐPï*ïÔï"ïÞï$ÛXÀX±hÿÿö±¨ÍÎþîÀXµh2hPÑPïöîí°¨ÍÌþÔPµÍÌþ2ïåîPÏP$77­2ÍÌþP2@ï˜èPÀPPÂPZÐY[2ÍÌþP2@ï‚èPxPPÂPYÁYPÐ`ïs5°ÍÌþÍÐþ2ÍÌþP°@ïøæÍÌþ2ÍÌþP2@ïuæP2jQÀQPÖP÷PÍÒþ±ÍÒþ•)2ÍÒþP°@ïÂÚÍÎþ2ÍÎþP2ÍÌþQÎQQ2@ïwéPÑPQ2ÍÌþP2@ï)æP°@ï‘ÚÍÎþ2ÍÐþPÏP®_üüðo6ëýiwëýðoëýëý”4ëý±¨ÈîëýøëýëýDQq‘ëýëý—£D¯¾Ýëýëýäø€ž©ëý¶>N[d~†>N[d†‘ÈÏööëýëýžëýëý0HXaëýëýëýkwëýëýëýëýëý‘›êAëýXNl±j¹	4	_	
ëýëýëýëý_
Œ
™
±
ü
1_÷pÐäëýëýƒ
A
ÿƒ



ƒ
A
/
•
©
ƒ
ƒ
½
½
½
½
½
½
½
½
É
à
ƒ
ëýè
ú
ú
>Eiu­²ÊØç@Ð;†Ebkƒ>[d†‹1ŠüßïÄíûï
5Öï¥ì÷ï¢ì`2jP2@ï&âPÀP÷PÍÌþ4±ÍÌþ•+2ÍÌþP2@ïÖØP±@ïšç2ÍÌþP°@ï½ØÍÎþ1!ü2jP°@ïÙáÍÌþÂZÂYÞÍÔþPÑZP–1üÕï%ìõÎïì1üÔï^Ôï^1àûÑïô]ÐPÐPÝPÝkÝ«üûï…DÝPûïB%1µûÕïÍ]
ßïôìûï.ÒÕï¼]Èï·]˜a»ôûï)-1‚ûÔï–]˜a»ø1tûÐï‹]1jûûïñuÝûïzr1WûÝÝÝûïÐ÷ÿÿÐPïE2ÔïW]1:ûÝÝÝûï³÷ÿÿÐPï(21#ûÝÐkPÝ ЫøPÝ ûïõBЫøQÐP¡˜a»1ýúÐkï]1óúÝÐkPÝ ЫüPÝ ûïÅBЫüQÎÐkPÝ ЫüPÝ ЫøPÝ ûï¤BЫøQÐP¡˜a»Ð»»ü1§úÝ«ðûïã/1mÿÝÝkûï.ÐPïŠ1Ðï¬\ï«\1zúÝÝÿÿÿÿûïÙ.ÐPïf1Ðï‹\1ZúÝÝkâÝkûï‡.1HúÐkïs\Ý«øêÝ«üÝkûï¬-1ÿÝkÝÿÿÿÿûïŒ.ÐPï1Ôï?\1úÝ«üÝkâÔï\Ôï)\˜a»ü1óùÑï\Ôïþ[nÐï
ÖPÖïÖÝPßï/ëßï‘8ûïÄAÝïÔ[Ýßï|8ûï§!ÝPûïÔGÝPÝÝûï5öÿÿÝPÝkûïNBÝPûï#ßïåêûïtÐÔïœ[1fþÝï[ÝkÝ«üûïBÝPûïÚ"1ÅþЫøïG01BùÝïV[ÝkÝ«ðÕàïX[
ßï¼êûï\ÏÕk	Ñk@ßï½êûïBÏÐkÉ@k~Ý«øÝ«ôûï²AÝPûïo"Ôïá/1ÜøàïÿZ
ßï‘êûïÏÝ«øÝÿÿÿÿÝkßïðZûï>ÈÝÝkÝ
ûï@õÿÿ1pýÝÝ«øÝHéÝÝ«øÝ6àÕ«ü
ßïZêûïuÏÝ«üÝ«ôâÝkÝݾЫüï_/1ZøÕïrZ
ßïEêûïÎÝÝ«øÝÝûïÕôÿÿÝPÝHûïÆôÿÿ1þÝÝ«üÜÐïCZÅ«üP•@ïKZ1øÅ«üPÐ àf1õ÷Ýkûï”01…ýÝïýYÝkÝ«üûï›@ÐPkÝPûïU!ÐkPÝ ûï31»÷ÝkÝ«üûïs@ÝPûï?1£÷Ýï·YûïC1ÄûÝkûï8ûïá61€÷Ýkûïû71t÷ûïI;1j÷ßïéûï]Î1Z÷ûï½:1P÷×ïhYÑïbYÔïYYÝïSYûïtFÂïQëÐïKëPÐ`ïkïÂï<ëÐï6ëPÐ`ïZï1÷ÑïYûï{)Öï	YÑïë¤[
ßïéûï_ÍÐï!ïÿðêÀïéêÐïïÿÞêÀï×ê1ªöÝ«üûï¤f1öÑ«üÿÿÿÿóÝ«üûï;nÐï¤X1öÝïWNûï<mÝïFNûïnàï@Nàï8N	ÐïpXÔïhXÝûïÛóÿÿ1:öÝïNûïßmáïNÐï@XÝ«èûïÊZÝPÝÝ«øÝLûïÞGÝPÝmûïÏGÝPûïìeÝï¼Mûïm„Ýï±Mûï~máï§MÐïßWÕ«ø
Ý«øûï²eÝ«ôûïnlÝïxMûïImàïrM´áïjM18ÿ1,ÿÕïW
ÝïMMûï6lÝ«üûïmûïƒôÿÿÝï/Mûïmàï)Màï!MÐïYWÝ1îþÑïMÿÿÿÿßïqçûïTËÕï2W
ÝïâLûïËkÈïÜLÕïéOÔïW1éôÑïÁLÿÿÿÿßï6çûïË
Ýï¥LûïŠkÈï›LÈïÖVÝïÐèûïmkÕï¿V©ßïçûïŽËšÐïàìïßìÝÝÝûïRFÐPWѧ ÅïÂìPÝàfßïÞæûïŒÊЧPïPPÊPï§QÉQP§Ý«üÝWÝ$ûï	FÐPWݧûï@̘agÝݧÝlûïæEÝPûïdÈïVÝïèûïµj1öþÝÝÝ4ÝÝÝaûïÙ^ÐPWЫüï$ìÐïì§ÝÝWûï=ÎïìPÅïìQ÷Pá fÅïôëPÝàf1âþÝÝÝ4ÝÝÝaûï}^ÐPWЫü§ÝÝWûïì1ÖüÝ«üûïWñÿÿ1ÉüÐïmUûïÒñÿÿÈïK1:óûïeðÿÿÕïOU
ßïÑåûïÊûïãjÐPïêJûïÕjÐPïàJûïÇjÐPïö)ÝP1_üûï´jÐPïã)ÝPûïŽWÝPÝ«üÝmûï¤DÝPûïÁb11üÕïÖTûïwjÐPï¦)ÝPûïeiÎï”)Ý«ø1üûûï·ïÿÿÕï¡T
ßï;åûïpÉÑ»üЫüPÕ Ðï<JûïjÐPï*JÝPûïõiÐï^TûïjÐPïJÑï
J
Ý«üûï=Ê1òÝïìIûïÁVÝPÝ«üÝmûï×CÝP1MûÕ«ôÝ«ôûïéaÕïÿS
ßï±äûïÎÈûïùîÿÿûïŒiÐPï—Iûï~iÐPï…IûïpiÐPïŸ(ÝPûïFiÐï¯SÕ«ü1mÿÈï`I1{ñûï¦îÿÿûï9iÐPï@IÝÝÝÝÝ«üûï¾[ÝPÝlûï#CÝPûï@aûïiÐPï0(ÝPûïïgûïðÿÿ1)üÐï?Sï(Ôï4S1öÝkûï:\ÐPïù'ЫüïS1ìðÐ;«ü~Ñï
á`sÑïÿàUhÑïôàJÑïëàATÑïàà	Ñï×àBÑïÎà$ÑïÅàÑï¼àÑï³à	ÑïªàÕï•ä
ßïcãûïhÇÝkÝ«øÝ«üûï7B1)õÑïzà£ÑïqàܘÑïfàÑï]àÈ„ÝkÝ«ôÁ«ø~ÂÝkÝ«øÝûïòAÝPÝ«ðÝ«ßï&ã”Ýûï°TÝPÝ«üÝk‘ÝÝkÁ«ü~†ÐkPËÏÿÿÿ PÑP ÐkPËÏÿÿÿ PÑP0Óßïãûï·ÆÐkï²&1­ïÝÝk1CÿÝûïSTÝPÝkÑ«üNÐPÐ	PÝP1"ÿÝkûï+^1IôÝkÝ«øÝoûïBAÐPï_&˜a°˜aÿR&ÐïL&PРïC&1>ïÝ«ü¹ÝÝ«üÝ«ôÝûïAÝPÝ
1ÁþÝÝ«üÝH1³þÝ«üÝ«øÝF1¤þÑ«üD-Ý«øûï0SÕP
ßïMâûïÅÝÝ«øÝûï¯@ÐP«øÐkï$çÝÝÝûï—@ÝPÝ«øÝE1KþÐkïçÕï¼PXÅïóæPÕàfHÅïãæPÝàfßïâûïqÅÝÝÝÝÝÝaûïbYÐPWÐï¯æ§ÝÝWûïÎÝÝÝûï@ÐPï2%ÎïŒæPÅkQ÷Pá f1îÝûïÈRÐPï
%Ðïkæ Ðïÿ$P2@ ÕkÔÝûïsÐïå$QÐP¡ÐïÚ$PС 1ÏíÝÝÝûï ?ÐPï½$pïæ 1°íûï±+1yòÝkÝ«üûï^6ÐPï•$ÐÿŽ$1ŽóÝÿÿÿÿ1õÝÝÿÿÿÿÝÝûï
êÿÿÝP1ÐôÝÝ«ô1ÈôÅ«üPÕàf*ÝÝÝ$ÝÝÝaûïDXÐPWЫü§ÝÝWûï³ЫüïåÝÝÝûïò>ÐPï$ÎïiåPÅï]åQ1ÖþЬ[á[ ï[~ßï_áßïÁ+ûïÜ4Þï´+PÐKï÷àPÂ^Ô­üûïÍÂÐPïfÐ[1þÐK¼Z‘j-ÖZ‘jXpÐK¼P‘`-1ÝЭüPÖ­üÑPÑPìÑ­üvÞïÄPPtÑPe\ÑPi+ÑPtBÑPxÖïWàÑPdËÖïîæÖïêæÖZ•jt˜jPÑPb×ÖïŠîæÖïŽîÞÖïŠîÖÞï^PPÝPÑ­ü	Þï÷âPÞïðâPÝPÝK¼ûïÖ2ÕP ÝK¼ßïÖâßï4Pûï›2ÝûïÂ1Ö[Ñ[¬1ùþݬݬûï¨qÔ[Å[PÐàfò@[íûïLûï¿ÂûïlÄÐïÇãÔïi"Ðïj"Ð ïk"Ð ïl"˜@ïh"Ð ïY"ÐïJ"Ðïg"Ðïd"Ð ïa"Ð ï^"Ðï"Ðï,MûïÙêÿÿûïš#ÕïLÐPÔPÝPûï°eÕï4ÐPÔPЬ[2¬PÁZQ2AïoRÈPR÷RAïc˜‹ZàЬ[ЬZÐïDYö[i×ïæNÐïâNPÖïÛNš`P
ßïÌNûïÓ0ÐP[Á[PÒZQ2@ïPÊQP
ÑY{.¹ÖY²ßï›NÝ[ûï`2ÁYPÐPïÛ”`ÝßïJáûïIÿÿÿÝßïqáûï:ÿÿÿÝßïmáûï+ÿÿÿÝßïuáûïÿÿÿÝßïmáûï
ÿÿÿ¨ ïêÔZÞïØÞJï†ó€ZìÞïÄÞ[À[2kPÖPÐ[@ïeµkìÞï/áY˜‰PÖPÞï¡Þ@ïG•iëÞïFáY˜‰PÖPÞï‹Þ@ï)•iëÞï2áY˜‰PÖPÞïuÞ@ï•iëûïúÔY×ïMÐïŒMPÖï…Mš`P
ßïvMûï}/ÐP[ÑPïÍ8Ð[PÑPÿÿÿÿÑP
XÑP\d1ôxZPÈïLáP1ßï¯àûï¿Ñï"1fÕï¥ã1+Õ¬	ÑY¬1…ÝûïÙ'1yßï€àûïÓ¾Öïóàº×ïßLÐïÛLPÖïÔLš`P
ßïÅLûïÌ.ÐP[ÑP61Ø1ÑP21Ë1èÑP01¾1¬ÑP
1:Öï’à1íþÐ
Z1.ÐZ1(Ð	Z1"ÐZ1ßïeLûïl.ÐP[Á[P³@ï«SxZPÃ0[QÉQPZ×ï;LÐï7LPÖï0Lš`P
ßï!Lûï(.ÐP[Á[P³@ïgxZPÃ0[QÉQPZ1®ßïôKÝ[ûï¹/1œÑP11ŽÑP3øÃ0[Z×ïÑK1aÿÐïÊKPÖïÃKš`P1[ÿÑP4ÙÒÑP5ÒYÑPn1ÿ#ÑPb1ÿÑP78­ÑPf-ÐZ+ÑPt1÷þÑPrÐ
ZÑPv1áþÐ[ZÐZZÑï®'˜ZZÕY1óýÐZPÐPï?ß?Õï³á+Õ¬ÑY¬ÝZûïí%!ÑY¬ßï²Þû尿ÝYšZ~ûïÊaÖY1SýÐYPÖYÝPÝûïµaÝYÝÿÿÿÿûï¦aÐïtPÐY@ïo8ÕY
ßïŠÞûÑYÕïiÚÕï]ÚÑY
ßï|Þûïg¼
ÑP
FÑP*I×ïlJÐïhJPÖïaJš`P
ßïRJûïY,ÐP[ÑPÿÿÿÿÃßïWÞûï¼Öï7Þ·×ï#JÐïJPÖïJš`P
ßï	Jûï,ÐP[ÑP/ßïóIÝ[ûï¸-1uÿÂ^×ïÛIÐï×IPÖïÐIš`P
ßïÁIûïÈ+ÐP[ÖPxPPÐàŒ/Z2ªPÏPGX&R_j‰ãñ›G]­ü(-nÁÿMÝ[ßïlÞûßïƒÞûï–»1zÿÝ[ßï€Ýûï2»ßÞï˜ï“ÝÝ[ûï4úÿÿûï¹ÐP[Ð[PÕ[1<ÿáïîF˜@PÓïàFÐPÔPÝPßïKûï
ÝPûïÃ2ÐP­üÅPPž@ï¼FY‘©
0Õï£F(Ðï—Fï–F2©~2©~Ý©ûïÜàÿÿÐPïMÐ!PéïsF	ÐïhFPÔPÐPï`FЭüï(ÐPÔï†ÜÞïÄ
ï¿ÝÝ[ûï`ùÿÿ×ïZHÐïVHPÖïOHš`P
ßï@HûïG*ÐP[ÑP.1ÔÑPE1ÑPXÑPeëÑPx1r‘ïR
0•ïJ

ßï:Üûï̹ÝÝ[ûïÛøÿÿÞï+
XGxïÛÛïÖÛ˜hPá@ï8G˜hPÂ0P˜hPá@ï$G˜hPÂ7P
˜hPÂWPÀPïÛÖX•hµÓÿÿïŒÛ1iÐï1eÐïkGPÖïdGš`P1jÝÝ[ûïOøÿÿ×ïIGÐïEGPÖï>Gš`P
ßï/Gûï6)ÐP[ÑPe	Ñ[Ed×ï
GÐï	GPÖïGš`P
ßïóFûïú(ÐP[ÑP+Ñ[-eÿ+
Öï%
ßïÉFÝ[ûïŽ*˜e[ÝÝ[ûï±÷ÿÿßï©FÝ[ûïn*ßïîûïhßïŒFÝ[ûïQ*‘ïÑ0+ÞïÉX•h1åþxïuÚïpÚ˜hPÂ0PÀPïcÚÖXÜÞïXÅ
ïOÚP˜hQÀQPÃ0Pï@ÚÖX•häËÿï/Ú­ø
Ñ­ø€ÿÿ1—þÔï°×ïF1þßï÷Eûïþ'ÐP[ÑPL	Ñ[l	Ðï|ßïÌEÝ[ûï‘)ÐP×ï¹EÐïµEPÖï®Eš`P
ßïŸEûï¦'ÐP[Á[P³@ïå!ßïEÝ[ûïF)ÞïÆïÁÝÝ.1þÐï7CßïYEÝ[ûï)2ªïð2ªPÐ"ï¤ÐPÐ'ï™Ôï;ÙÝûïˆ÷ÿÿÔïÄ1VÿÔXÑXF×ïEÐïEPÖïýDš`P
ßïîDûïõ&ÐP­øÑP`ÑP
6ßï1Ùû﮶”HïÑX
ßï0ÙûßïEÙû1}ÿö­øHïêÖX1zÿ×ï‹DÐï‡DPÖï€Dš`P
ßïqDûïx&ÐP[ÑP*1ÿûïØùÿÿ1túÖï[Øûï¦1dú×ï?DÐï;DPÖï4Dš`P
ßï%Dûï,&ÐP[ÑP=1´þ˜Qï³ÐP×ïDÐïýCPÖïöCš`P
ßïçCûïî%ÐP[ÑP-˜OïxÐPÑ[>1eþÐï•A˜Eï]Ð P×ï«CÐï§CPÖï Cš`P
ßï‘Cûï˜%ÐP[ÑP+1 þ˜Nï¥×ïoCÐïkCPÖïdCš`P
ßïUCûï\%ÐP[ÑP&1äýÐïäÐïÞP×ï.CÐï*CPÖï#Cš`P
ßïCûï%ÐP[ÑP|1ŸýÐ×ïïBÐïëBPÖïäBš`P
ßïÕBûïÜ$ÐP[ÑP<˜@ïfÐPÑ[=1Sý˜RïRÐP×ï BÐïœBPÖï•Bš`P
ßï†Bûï$ÐP[ÑP>
˜Bï¯Ñ[=1ý˜Tï±×ïUBÐïQBPÖïJBš`P
ßï;BûïB$ÐP[ÑP='1‹ÑP+(1aÑP&1ž1IÑP%1ˆ1¦ü˜Pï¥1ïýÐï›ÐPÐ	ï×ïâAÐïÞAPÖï×Aš`P
ßïÈAûïÏ#ÐP[ÖPÀPP³#à„.
ßï`ÖûïM´ßïAÝ[ûïb%ŸÐï3¡Ð=ï*Ð?ï!„Ðï1zÿÐï1pÿÐï1fÿ×ïSAÐïOAPÖïHAš`P
ßï9Aûï@#ÐP[ÑP<Ý[ßïÖûﳘAï»1ÿ×ï
AÐïAPÖïÿ@š`P
ßïð@ûï÷"ÐP[ÑP>Ý[ßïÆÕû︲˜Cïr1ÔþÑP*1-ÿ1]ûÑP/1+ÿÑP-1»þ1HûÑP<1Fÿ1=ûÑP^1-ÿÑP>1vÿ1$ûÑP|1
ÿ1û˜ïÀZàJïà?ÎPÐZPÏPa0€…Š”™ñÿžñÿñÿ£ñÿñÿñÿñÿñÿ¨­²¸¾ÄÁÔ[~KïÒÑYÐiP˜`PÑPZ¬ÝißïZûïå$ÕP#2©PÏPj‘¡­¿Ïßßï)Õûï²ÀYºÐ[­Ð[¨Ð[£Ð	[žÐ[™Ð[”Ð[Ð[ŠÐ[…Ð[€Ð[1zÿÐÿÐ[1nÿÐ[1hÿÐïW=ïV=2©~Ý2©~ûï×ÿÿÐPïÐ!P2©ïÐïüP2©ïòÐ"PÐï=ÐïàÐ#PÐï=ÐïÎìÐïõ<Ð1ᄎÐï¹ÏÞï[ïVÝÝ ûï÷ïÿÿ×ïñ>Ðïí>PÖïæ>š`P
ßï×>ûïÞ ÑP(BÞïïÝÝ ûïµïÿÿ×ï¯>Ðï«>PÖï¤>š`P
ßï•>ûïœ ÑP"Gßï¸Óûïb°1ÔÑ[
ëÑ[ÿÿÿÿâ×ïu>Ðïq>PÖïj>ö[`ßï[>Ý[ûïX ×ï<>Ðï8>PÖï1>š`P
ßï">ûï) ÐP[ÑP"šÞïaï\ÝÝ ûïýîÿÿ×ï÷=Ðïó=PÖïì=š`P
ßïÝ=ûïäÑP)1Eÿ×ïØ=ÐïÔ=PÖïÍ=ö
`ßï¾=Ý
ûï»ÔP×ïš=Ðï–=PÖï=š`P
ßï€=ûï‡ÐP[ÑP#Ñ[ÿÿÿÿßïb=Ý[ûï'!Þï¦ÿï¡ÝÝ ûïBîÿÿÔZ×ï:=4ßï2=ûï95Ðï'=PÖï =š`PpÅ
ZPÀ[PÃ0PZ×ï=ÌÐï=PÖïû<š`PÐP[àKïf<Ñßïâ<Ý[ûï§ ÐZïÞÐÞï ÿïÝÝ ûï¼íÿÿ×ï¶<‹ßï®<ûïµÐP[ÑP
1üþÞïîËY/ö[i×ïŠ<Ðï†<PÖï<š`P
ßïp<ûïwÐP[ÖYÑ[
Ì”i1ºþЬ[Ý[ûïQ!ÁPZÑZï°>2ï¥ÑZïžÐZï•Ýïûï¦ ÐPï}ÕP
ßïbÑûï8®ÝZÝ[Ýïbûï
!ÐïU[ÀZïMÂZïJÐ[PÂ^ЬYÔZxZP˜‰QÁPQZ•iñïZPÇõPQÄõQÃQP­øЬYÞï­ü1©Õ½ü5ÝõÝûï|ÐPX
ßïêÐû來ÐX½üÁÔXPЭüQÐP¡x­øPÁ½üP[ÐZÕk!ЭüPÑ ÷LÖ ÝYûïÓþÿÿÐPkÐkP‘»iÝYÝkûïûÕPçxZPÀP[ÀZЭüPÑ[ ÂÔ[ÑZõ¢À­üÑ­üŒ21JÿßïfÐûï­Â0^Õ¬Ѭ¼þ
Ѭ|*
ßïÑûïجЬPР­ü
ßïÑûïÀ¬Å­üPž@ï`8[ÕïÝÐIÝ­üÝkßïôÐûï¿ЬPÝ ûï+¯Ýï8ЬPÝ Ý ݬûïéèÿÿÝPßïÎÐûïˆݬݬûï÷ЬPР­øÝ­øݬûï?!ÐP¬Ы­ô˜«	­äÕï[Ðlßï£ÐûïBÝ­øûﲮݬûï€èÿÿÝPßïŽÐûïßï‡ÐûïÝ­ôûݭä2«~2«~˜«~ûïDèÿÿÝPßïjÐûïãÑ­ô •«KÕ­ô	Ñ­ô1ïÑï.74Ñ­ô.ЬPÏP&&&&&&&à¬Ýkßï/Ðûï«Õï‘Ï
ßïxÐûïxÕ­øÝkßïuÐûïìªÐ­ø«ö¬«öï¾6«	2'Ø«÷ïôÌ«Ѭ
Ѭ	Ѭ1÷ï{«ÝûïhÑÿÿÝÿÿÿÿûï[ÑÿÿÝûïRÑÿÿÝ­üûïHÑÿÿ1ùÝÝï¬~Ý[ûï¢Ý­üûïš1Ñ­ø­ô172«­ìЬPР­èЭø­à/ЭèPЭìQÐ@ïAïý
Ö­ìÖ­èxþ­àPÊPï­àQÉQP­àÓ0­àBËÏÿÿÿ­àPÑP0ØЭìPÕ@ïÄ
°Ð­èPÕ@ï·
¸Ð­ìPЭèQÑ@ï¦
Aï 
¡1«Ñ­àÑ­à	Ñ­à
 ЬP2«QÑQ Ѭ
ѬѬy˜«­ðÕïÎÝ­ðûïNæÿÿÝPßï¯Îûïíá¬"ÝÝï¬~Ý[ûïÕP7Ý­üûïƒЬPÏP$¢Ö$¶ì]$×]×'<׌/ѬѬà¬1àˆ «
Ãï™ÍPÞ@ï9Ë­ÜÕ½Ü1³Å½ÜP‘@ïë4
îŽÜP‘@ïÜ4ߎÜPá@ïÎ4Ðk­ØŽÜPÐàf­ÔÑ­Ø­Ô1]­ܫЭðPÏP+%zÿ+zÿzÿzÿzÿzÿzÿzÿzÿ+zÿzÿ+%1UÿÕ­äøÑ­ðÑ­ðêÕï@4âö«ËÏÿÿÿ­øPÑP Эüï`ÊÑ­ðÑ­ð»Ñ­ð´ö«Ý«ûï–IÑ­ð¬žÑ­ðÑ­ð‘Ñ­ðŠö«ËÏÿÿÿ­øPÑP ЭüïÊÑ­ð¬1½þßïÏ3Ý[ûï"ÕPêѬ1jþÔï³31aþÑ­ð¬1ŽþÐï 3PÖï™3Ñ«PêÝ­üûïÇ1nþÑ­ð÷ö«ËÏÿÿÿ­øPÑP ЭüïŽÉÑ­ð¬Õ2«PÕ@ï+ÈÑ­ðÑ­ð»ÝkßïÌûï>§ß­üûïžÐP[1üÑï
3­äDѬ>Ѭ8Ѭ2ѬÑ­ä&Ý[ûïi!ÐP­üЬPЭü Å­üPž@ïâ2[1ËûÝkßï5ÌûïѦѬËÏÿÿÿ­øPÑP ЭüïÓÈï­øPÑP
ÑP	ÑP
ЬP÷ «
ï­øP÷P«ЬP÷ «á¬1öûЬPÏPC¡TäTww²""²""¡"Ó¡ÕïËÊÝ«2«~2«~ßïÉËûï§ßï>ÈÝ[ûïqÎûï¦GÐP«ËÏÿÿÿ­øPÑP µÐ­üïÈ«ûïƒGÐP«ö«	Ѭ–ÝûïÀFÝ«ûïHGûïYGÐP«”«	1pÿßï¯1Ý[ûïѬ17ûÔï—11.ûÐïŽ1«Öï†11ûËÏÿÿÿ­øPÑPOxøï‘ÇPÁP«Âï€ÇËÿïuÇPËÿïíÉQÑPQjšïáÉïÜÉËÿïMÇPJšïDÇ«šï<ÇP×PËÿï.ÇQÉQPï%ÇšïÇPšïœÉQÑPQÊÿï‹ÉšïÇPÈPï}ÉÑï»01„þˆ«
1}þÑïZÉ–
ßïoÊûï¥Ðï@ÉPЬ@ïÞÆÖï0ÉÑïzÂÿÿÿÿûï"FÔïf0ûï¦ÔïM0ÎïRÂÐïLÂïÿ%Ðïù%ïð%Ôïò%Õï`äDÑï,ÂZ
ßïÊûï|¤ÕïºÈ
ßïúÉûïg¤Õï¹%
ßïûÉûïR¤Þï$ïãÁÔï…ÈÔïÿÅ2ïúÅÐïôÅïsÈÐï´/Ôïr%Þïx%ïk%Ýûï˜D˜@ïBÈÑï$È
ßïšÉûï
Ô[1‡ÐKïÄÅZ{ÅZPž@ïv/YÑïóÇ(ÝZÝißïpÉûïÕÝ©ûïE¦ßïcÉûï¾Ñ©)ÝÝÝÝÝÝaûïõ7ÐPXÐZ¨Ý	ÝXûïeöÿÿßï«ÇÝYûïZÖ[Ñ[ï•Ç1mÿûïåOÝûïÎCÝûï£CÖïÅÝïkÇßï
ÅûïpEÔïXÇŬPž@ï°.[ЫPÏP
2˜ Ðï{.ïz.2«~ÝÝ«ûïÂÈÿÿÝÝÝÝÝÝaûï,7ÐPZЬªá¬ÐP
á¬Ð	PÐ
PÐPªá¬Ð
P
á¬ÐPÐPÝPÝZûïiõÿÿ†á¬1~ÿᬕ1vÿÓ¬Œ1mÿÝÝÝÝÝÝaûï³6ÐP[Ь«Õ¬ÝÝ[ûïõÿÿÝï´-ûïóüÿÿÝï—-ûïæüÿÿÝï¢-ûïÙüÿÿÔï•-Ьï…-ÝÝÝÝÝÝaûïL6ÐP[Ь«Ñï`-ÐïF-Ыլ<Ý
/ÑïC-Ðï)-Ð	«Õ¬ÝÐï-Ð
«Õ¬ÝÝ[ûïqôÿÿЫ¬ݬûïHüÿÿլŬP÷ï*Ãà fÃïŽÅPÀÂ^Á¬PÐ@ï#ÃZ7Ð玲üÝûï“ÇÿÿÝÿÿÿÿûï†ÇÿÿÝûï}ÇÿÿÎïÛÂ~ûïoÇÿÿÅZP2àf­üÕïÅ*Ý­üÕZ
ÅZPÐàfPÞï´ÆPÝPßïŒÆûïåáïT,ÐPáïG,Ð	PÐ
PÐP­øЬPÐ@ïÂï*,Ðï$,ï#,ÁPPÐ@ïdÂïÿ+Á­üPÐïà@ïÞÐYÔ­ðЭð­ôÁ¬Z1ËÐJï4ÂWÝWûï®ÆÿÿÕW	ÑW@
ßïÆûï$ ÅWPž@ïÅ+[Ñ­ø
Ñ«­ðЫ­ðÑ«­ôЫ­ô÷­ü«m2«~Ý«ûïwÐPXá«ï«V2«~2«~Ý«ûïÐPVÕVÝkßï³Åûï ÑVïJ+ÐVïA+ÇXYPÄXPÃPYP
ÇXYPÖPÅXPYÖZÑZïÁÃ1)ÿÝÿÿÿÿûïÛÅÿÿÇYï+PÄYPÃPïý*PÇYïó*PÖPÅYPïè*Ñ­ø
7ЭìÝ­ìÝÝ­ìûïmÐPïÈ*Ý­ìÝ­ìûï©ÐPYÁ­üPÐY@ïƒÿÕï¥*
ßï ÅûЭüPÐïŒ*@ï^ÿÁ­üPÐY@ïQÿÁ¬PÁ­üQÐ@ï°ÀAï:ÿÑïèÂ1ŠÁ­üPÝ@ï"ÿÁ­üPÝ@ïÿÁ­üPÝ@ï
ÿЭüPÝ@ïÿþÁP~Á­ü~Á­ü~Ý­üßï¨Äû	ï‹Á­üPÐ@ïÕþZ%ÝJïËþÅJïÃþPÝàfßïšÄûïYÖZÕJï¦þÒÁ¬PÐ@ïÀï»)ЬïSÂÝ­üÝÝ­øûïøÃÿÿݬûï ûïýøÿÿŬPÐàfPÑP@ÑPÑP6ÑP ŬPÝàfßï!ÄûïXŬPŸ@ïJ)ûï±ÐP¬Å¬PÐàfŬPö	@ï.)ݬûïRøÿÿЬ[ЬZ(Ñ[#Ñ[Ñ[Ñ[Ñ[Ñ[

Ý[ûïBÔYÑP0ÀYÑY3Ð[PÃY QïYQPPÊÏÿÿÿPÑPàÑPÑP Ñßï—ÃûïúœÐPï[PÏP
+óÿóÿóÿóÿóÿóÿ+óÿóÿóÿÕÁZPÐ@ï@ýPÐPÂ^ЭøÔ­üЬPíü Qï­üQPPÊÏÿÿÿPÑP2ÑPÑP ßïBÃûx­øPÑP0ЬPÄ@ïæü­øÖ¬À­üÑ­ü©Ð¬PÕ@ïÌüßï#Ãûïï›Ð PЬPÅ­ø@ï¬üPÂ^ÑïsÀ¬ÑïhÀ¬
ßïöÂûïœÐïQÀ­üÇ ­üPxPPÃP­üPÇ ­üPÖPxP­üÑ­ü¬Ãï&À¬[Ý[ûïàIÃïÀ­ü[Ý[ûïÍIÃïÀ¬PÇ P[Ý[ûï±@Ãï뿬[Ý[ûï¥IÑïÙ¿¬
ßï†Âûïx›Â^ЭüǬ­üPĬPÃP­üPǬ­üPÖPŬP­üÝ­üûïÿÿÿÑïj¿ݬßï=ÂûïIŬPž@ïÃ&[˜«ï¦ôÑï”&	Ñï‹&ÐïôÐï‡ôPÏPFGGFÔï¿Ôïþ¾ÔïTôÝï
¿2«~2«~Ý«ݬûïKËÏÿÿÿ«PÑP0ÐPÐPÐPï¾ÝPûï;2«~Ý«ûïýÿÿÝPûïÖ:Ý[ûï«>‰ÕݬݬݬݬݬßïeÁûïZÕïÂó
ÞïRòïµóÀ$ï¬óÐï¦óPÔ ÐïœóPЬ ÐïóPЬ Ðï„óPЬ ÐïxóPЬ ÐïlóPÔ ѬÁ¬PÐ@ï>úPÔPÐïKóQÐP¡Ðï@óPЬ  ËÏÿÿÿ¬PÑP0.ݬÁ¬~ЬPïPPÊPï¬QÉQP~ûïµüÿÿÐPÿó/ŬPá@ï%ŬP˜@ï%PïPPÎPÿ×òÔÿÏòÑïÍò	ÑïÄò!ËÏÿÿÿ¬PÑP0Ѭ
ßïSÀûﶘËÏÿÿÿ¬PÑP0ЬPïPPÊPï¬QÉQP¬Ö¬1…þѬPÐïeòPРPÐ@ïAù¬Å¬Pž@ïc$[‘«à«
ßïÀûЫ¬2«¬2«¬À«¬1/þÑïòÑï
ò1ÐïýñPÑ Ñ |ÑïêñŒ2oÐïÝñPËÏÿÿÿ ðPÑP0ZÐûïÐïºñPÝ  ûïíûÿÿÃ$ï¨ñPÑPŒ2Ðï˜ñPРìPÐ@ïtøPÔPÝPûïØÿÿûï1ÔPÕïrñ	ÝûïYüÿÿÕïY#ÐPÐPÝPûïH8ÐPZûïê8ÐP[ÝPûïÄ8Ôïî»Ýûï¿×ÿÿÕï#	Ðï¿»PÐZPÝPûï8ÝÝÝûï·ÐPYÎ[©ÐYPݬûïx%ÐP[ÝÝ[ûï>DÝ[ûï͘ûïè€Õï\»Ýïp»ßûï9Ðï¥ðPÑP1©ÑPøÑPóÞï ïïƒðÐï}ðPР[РZРYРXËÏÿÿÿ[PÑP0qÐJï@÷WÝÿQðûï@ûÿÿÇÿDðïûºXÑWXÝYÝZÝ[ûïÚùÿÿÝPûïaúÿÿÐWXÕWÑWX
ßï¾ûï$–ÕX
ßï ¾ûï×–ÐXJïÙö!Ñ[Ñ[	2ÝYÝZÝ[ûï…ùÿÿÝPûïúÿÿÔïxºÝûïµúÿÿÔïuºÔï·ïÑXÉßïß½ûﺕЀЬ[Õï–ï1¤Ñï‹ï	Ñï‚ïßïǽûÎïkï1{Ñïbï	ÑïYï=ûï·9ÐïEïPРïx·Ý[ÝÝÝûïéÝPÝ:ûïÞÐP[Ý[ûïø.Õ[Õ﮹ßïv½ûï•1Ñï’¹Ý[ßïf½ûïrÐïÚîPРWРYРXÕÿÇî	Îÿ¿îZÝXÝYÝWûï]øÿÿÐPZÐï¦îPÝ  ûïÙøÿÿÝ[ÝXÝYÝWÝÝÝûïl)ÝPÝ:ûï7ÐP[˜a»Ы«Ô«Ý«ûïG0ÐP«Ñ»˜a»ЫPР«˜nkÑZ #Ñ»ßûïG”;ÝZÝ«ûï‡A-Ñ»ÝZЫPp ~ûïúAÝZÝ[ûïß/ÝPûï\BûïÝ[ûïà•Â^ÑïÓíŒ2ÐïÅíPÕ Öï]¸Â$ï²íÐï¬íPР[Ñ[PÖ РZÐJï|ôX¸ÅXPž@ïž­üЭüPÐïzíQÁ¡  ~ЭüP2 ~ЭüP2 ~ЭüPÝ ÝXûïeùÿÿËÏÿÿÿ[PÑP01iÿÐï<íPÖ РYÐï.íPРPÑY@ï	ô
ÑïíŒ2ÍÐÿí­øÐïíPÅ­øYQÁQ  ~ÐïóìPÝ Á ~ÐïäìPРPïPPÊPÐïÑìQï¡QÉQP~ÐïÀìPÝ 1_ÿÂ^Ðï­ì­ü Ðï£ìPÕ 
ßï9»û朗Â$ï‰ìÑïƒìŒ2-ÐïvìPР[Ñ[
ËÏÿÿÿ[PÑP0ÏÐïYìPÕ ªÐ ЭüïGìÕïÞ¶Ýïæ¶ßïܺûï»ÕïǶ×￶Â$ïìÑï
ìŒ2ÐïìPÕ àÔ ûïþÿÿЬ[ЬZÐjYÇ[YPÄ[PÃPYP
Ç[YPÖPÅ[PYÃYïWçPÑP¬Ñï¾ßï{ºßûï
’Á¬YjÐYP€Â^Ь[ЬZ2«~Ý«ûïwôÿÿÐPYÐjXÐX­ü2«~2«~Ý«ûïõÿÿÐPW‘«@ÃXïáæPÑPW
ßï<ºû撚ÁWX­üÇY­üPÄYPÃP­üPÇY­üPÖPÅYP­üέüX:‘«	‘«ÑW ß­üÝÝ ûïÿÿÿÐPXÃW­üXß­üÝYÝWûïïþÿÿÐPX‘«Ñ«'ØÿÿÐX«ЭüjÔPÑX«óÐPÂ^Ь[Õ¬
ЬPРPЫPÐPXÕ¬}ЬPРPÏP¨°µw¨°µÕ¬1˜ßïp¹ûïoÐZ1•ÇZïXPÄZPÃPïMPÇZïCPÖPÅZPï8Õ¬
ßïR¹ûï0ÔPЫP…Õ¬
ЬPРP2«PÐP­üÁPPÐ@ïÓðZЭüPÐ@ïÇðY"ÐZÐZYÐZöÐZ
Ý«ûïr5ÐPZÐ YѬYßïÕ¸ûïÁÐY¬Õ¬1LÿÇZï¤PÄZPÃPï™PÀ¬PÑPY'ÇZïˆPÄZPÃPï}PÇZïsPÖPÅZPïhÕ¬*Ãï]ïÜäPÑP¬
ßûï À¬ï<1ÿѬ Ñ«ï+É@¬P˜«QÑQPÐPÐï
«Ãïï„äPÑP¬
ßï<¸ûïHÀ¬ïäÐX«Ý[ûï41®þÔZÐï²[?Ñï­Ð[1ÕïŸÕï£ßï¸ûïøŽûï«=ÐP[Ñ[ÐZÝ[ݬûïÔáÿÿÑ[Ñ[ЬPÝ ûï‚óÿÿûï‰÷ÿÿÕZЬPÝ ûïi=Â^Ь­ôЬ­øЬ­üЭèÔ­ðЭìÔ[Ñ[aÐK­ôPÏP9K=K=K/ßï`·ûïúÐPÑ­èéЭèÖ[µÑ­ìÛÐK­ô­ìîÕ­ðÎÐK­ô­ðáÕ­ðЭðÑ­ìЭì­ðÑ­è6Á
­ðPÑ­ðÑ­èšÑ­ì”Ñ­ìÐPÐPÑ­ðÂÑ­ì¼1vÿЭðPѼ!
ßïâ¶ûïµÕ¬ÔPÑï×±Ýßï&ݬûï`ЬPЬQР¡ЬPÐïóí ݬûï‘ЬPЬQР¡ЬPР[РZ1ËÏÿÿÿ[PÑP0ÐZPÖZÝ@ï·íû盧ÿÿï[PÊPï[QÉQP[Ó0[ÊЬPÝ ûïœ;ЬQÐP¡ЬPï PÐP[ÑPÑ[	
Ñ[
ЬPÐ[ ЬPЬ[ÐkZ˜akÑZË«PxPPÈPï«QÉQPXÑZHÀXÑZ6À XЫPРY˜a»ЫPÐX Ý«ûï¢ÿÿÿÑZ6	ÝYûïâ²ÿÿЫPР«ЫPР«€Ь[ЫYËÏÿÿÿYPÐPW!ïYPÊPïYQÉQPZÐWXËÏÿÿÿZPÐPW>Õ¬Ñï¨
ÓïªÐ	¬Ѭ	Ѭ1™ÑïƒôÑYFÐY1…ÑX0
ÑW ßï
µÑX ÑW0ÑW ßïµûïe‹ÔYïZPÊPïZQ1nÿËÏÿÿÿYPÑP0Ö« Y0ËÏÿÿÿYPÑP #ßïî´ûïè‹ËYPxPPÈPïYQÈQPÐPYÕïö0ËÏÿÿÿYPÑP #ßïÜ´ûïìŠËYPxPPÈPïYQÈQPÐPYÐY«Ь[ÐPÑ[ÐPÑ[ÐPÐ[PÕ¬=áïŽÐ¬/áï€Ð¬!ÕïgЬÑïYÐ	¬Ð¬ËÏÿÿÿ¬PÑP =ЬPÏP155$5$$$$$$$55$$55ßï:´ûï#ŠÐ¬á¬àï
ßï?´ûïŠÐ¬PЬPÏPÖóÿóÿfóÿÖÖEèóÿ5óÿóÿýóÿUýóÿݬßïÁ´ûïŠà襁ßïý³§àßïû³—Óßïø³†Õïnßïö³ûï}‰ÑïYNÐ	PËÏÿÿÿ¬PÑPïït«PÑP×ݬûïF6ÕPÉ1>ÿšïW«PÑPºÝ¬ûï)6ÕP¬1!ÿÐPÑïþðß1ÿÑïì1ÿþß1ïþËÏÿÿÿ¬PÑP 	ßï’³1ØþЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑP ËÏÿÿÿ¬PÑP0ËÏÿÿÿ¬PÑP1›þßïp³1‹þÂ^м[Å[Pž@ï€Z)ò@[Ô[ÞïmZÀZÑ[¼
ßïe³û行ѪÑö!ª
Ðj­üżPÐàf­øżPÐàfjÕ﫬Ý[ݼÝ­øßï3³ûïŠùÐ[¼ÐZPÂ^Ñï¬ÝïäÝïâݬݬßï%³ûïUùÔ­üЬ­üÇ@­üPÄ@PÂP­üЭü­ôÅ­ôPž@ï®YÑ©ö¬©
ЬiÔ©”©ЭüP˜©
PʼÿÿÿPÑP¬Ði[ЬZÑ[ZÞò@­üÔ­üÞïdYÀYÑ­ü­ôªßïÀ²û›Ь[˜«
P˼ÿÿÿP~Ýkûï%ÿÿÿÄPž@ï#ZժЪÐZPÑZ[÷ѪñÀZÑZüéÞïøZà€Ðï©Xûïz+ÞïÞZ	ѪÀZÑZüîßïD²ûï‡ÐZ[Ñ«ÔW1·2«ïΨÎïƨïÁ¨˜«	PÑP¬tÕ«‘«ѬÐXÝkßï²ûïj†	Ý[ûï÷*ÕïÛª#˜«	~˜«
~Ãf[PÇP~ÝkßïÙ±ûï¬÷á«
	Ý[ûïBЫÐW$ÕW Ý[ûïÆþÿÿÐPYÑP[Ý[ÝYûï/ЫÀ[Ñ[üÞïå[Ñ[Z1#ÿÐXïý§ûïl*Â^Ь[ЬZЪ«ª«ª	«	Ъ«ª
«
°ª«°ª«°ª«ÐjkЬ[Á[ZÀZÑZüÞïtZÑZ[
ßï7±û﵅ѪÕÝ[ÝZûï„ÿÿÿˆ«
˜«
PʾÿÿÿPÈPöPª
Õï£Ýkßï±ûïé…Õï¡©%ÃfZPÇP~Ãf[PÇP~ßï±ûïpöÃfZPÆPÐPï§Ь[˜«
P˾ÿÿÿPYÐ[ZÑZf	Þ簾ZÂZÑZ[G˜ª
PʾÿÿÿPÑPYÖÑkjÑŠª
Õï©%Ãf[PÇP~ÃfZPÇP~ßûïçõßûﳄÀÂ$^Ь[ЬZÕÝZÝ[ЬPÝ@ï(Þßûï¥õЬPËñÿÿÿ@ïËßVÑVWÑkRÑP
*ÑPLÑPM1èÕïÔ¡
ßïU°û龍Ý[ݬÝ[ûï[ÕP
1¾Ñkr««Ð[PѬ
ìѬ0Ñk+˜ak˜ajÕ«ݪûï~…ЪPݪûïo…ЪPѬѬ
Ñk1´ÑjøÑV1"ÑkøÑjóЬPÑPS11¶ÑP1€8ÑP1‹ÑPöÑP}1ÑPu1	ÑPmÑPf1úÑPI1òÑPBRÑP>KÑP<D1ØÑP@81ÌÑPQÑPP1µÑPRôÕ
ßï2¯ûïkƒÝZݬÝ[ûï
ÕP͘aj1ÊþÑPWÉ!ÑPU¾ÑPT³]ÑPV¨RÑPYÑPX>ÑPm3…ÑV,ÑkÑk"ÑjÑjЬPÑPiÑPdÑP_ÑP<ZÝÝÝÝZÝ[ݬûïÈÐPYÝYûï8ÐPWáWÝ©ûïãÕP
ßûïÎàW1ŠÝ©ûïÐP©1ŒÑkn««ÑjnªªÐkЫЫ«˜ajЬPÑPÑPÑPÑP<1gÿ`ª«1«ýbª«1£ýdª«1›ýqªï™­ßïó­ûïH1ýfª«1yýèWÐVPÑP1hÿÑP^áWѬoÕïôž	ÝYûï{á
WÝÝÝÝ©ûï%ÐP©áWÝÝÝÝ©ûï
ÐP©ÓW1áWЩPÝ©ûïÐP©1ôþЩPÐPXШ©Ш©Ш©áWÝÝYûïæÐPYá	WÝÝYûïÐÐPYáWÝYûïÐPYá
WÝYûï¬ÐPYàW1šÐ©[ЩZЬPÑP@1±1‡ÑP1û1ÑP11¿ÑP1Û1‹ÑP1—Åï!¢Pž@ïõ­üЭüPÕ mݽüß﹬ûïÜЩЩ©Щ©Ðïê¡©Ô©ÝÝYûïÓÿÿáWÝYûïKÐPYÝYûïƒ)ÐPYÕïÔ«ÝßïFÝYûï£ÐYPЭüPР©ЭüP2 ©ЭüP2 ©Ô©Ðï}¡©Ñ©›2@©ЭüPР©Ô©Ð
©Ði€ÐiÐ2©Ô©Î©ÐïîߩЩ1cÿԩԩЩԩЩ1OÿЪ­ð!Å­ðPÀfPÐP­ü‘ ‘ à ßKûïÒ~1OÅ­ðPà@ïÊ
1®Ñ«Ñ«ñÁ«PêÁ«PÐ@ïmß­àЭàPÐ@ï`ß­ÜUÅ­ÜPÐàf­èÅ­ðPÐàf­ìÑïð¢Ý­èÝ­ìßïh«ûïÐïÅ­ÜPá@ïS
4Ñ­ì­è-ЭܭðЭðªÕ­Ü1±Å­ðPÝàfßï9«ûï~1–Ö­à1sÿÑ«,Ñ«&Å­ðPá@ïÿ		ßï «1ÿßïS«ûï¤~^Á«­ìßïj«ûï~GЫPïPPÊPï«QÉQP~ЭìPÝ@ïtÞÝ­ðûïÕPÅ­ðPÝàfßï>«ûïD~ÝYûïõ	ÐPY1¹ýßïM«ûïd}1©ý˜akÐkiЫYË«PxPPÈPï«QÉQP©Ы©Ы©1zýÐkPÑPÔÑP
ÄÑP0ÑP;ªÝÝ«Ýûï¯øÿÿÐP­ø˜akÐkiÝ­øÝ«Ý;ûï•øÿÿ1yÿÝЫPÝ Ýûï€øÿÿÐP­øÝЫPÝ ÝûïjøÿÿÐP­ô˜a»лkÐkiÝ­øÝ­ôÝûïKøÿÿÝPݫݦÐ
iÐ[©Ô©1ÛüÑ«ªöß索1ÿÑPԩЩ1¼üÑPÜݬßïÁªûï±|1¤üÑP
èÑk˜akÐkiЫYËÏÿÿÿ«PÑP
ßïªûï,|ЫPïPPÊP1ÓþÑP$¢ÑP:¢Ñ«ª
ßïªûïý{ÝÝZÝûï’÷ÿÿÐPZЪ­ìЪ­èЪ­äÝ­äÝ­èÝ­ìÝZÝ[ÝbûïÐP[Ѭ$1ÿ˜aiÐ[Y1öûÑPE1›ü^ÑPBGÑPA1ÿЩPÝ ЩPÝ ЩPÝ ûïßÿÿÑP 1­ûÝÝÝÝ©ûïƒÐP©1–ûÑPC¼1ÓþÑPH"1ÑPF1¹þÝ©ûïúÐPZÐZ©ËÏÿÿÿ«PÑP
ßï<©ûïüzЫPïPPÊPï«QÉQP©ËÏÿÿÿ©PÑP 
ßï©ûïÊzЩPïPPÊPï©QÉQP©Ы©Ы©Ñk>Ñ»8ЫPÕ /ЫPÑ @!ЫPÅ P˜@ï}­ðÑ­ðÑ­ðÀiÑ©	Ñ©	1ŸúÀiË©PxPPÈPï©QÉQP©ÝÝYÝ
1:ýÑPo1þ1¶ýЬ[Ñk8 Ý«ûïëÿÿÿÐP«Ý«ûïÝÿÿÿÐP«Ð[PÑ«Ñ«	:Ý«Ý«Ý«ÝÝ[ÝcûïŸÐP[ÝÝ«ÝûïdõÿÿÐP«Ý[ûï™#'Ñ«Ñ«Ñ«Ñ«
žÝÝÝÝ[ûïº
ÐP[ŠÂ^ÑïýݬݬŬPÝàfßïʧûïÒêЬ­ü1¥ßïɧûïCyÔPÑ­ø¬1·Å­øPÐàfPÑPrѬqÕïû–iÅ­øPÝàfÅ­øP2àfPÖPÝ@ïÅÙݬûïgÿÿÿÕP;Å­øPÐàfP‘`$•Å¬PÝàfÅ­øPÝàfßïh§ûïyy4ÑP	‰Ö­üЭüPÐ@ïnÙ­ø1VÿÑ­ø@1Lÿßï"§ûïÑxÐPÂ^Ь[ЬZЪ­ôÑ«Ñ«ѪѪÐPÔPÐP­øÕP,ѬRѬSѬT
ѬUÀ¬Ñ«@
Ѫ@ÔPѪ@ѬíÑ«@ѬѬ×ЬPÑPR1è1ÌÑP<X1ˆÑPG1iÑP61!ÑPŸÀ­ô«Ñ«@Ъ«Ъ«
ßïN¦ûïxwÐP­ô«õÄ­ô«îÕ­ôÜÆ­ô«âÕ­ôßï,¦ÎЫPÇ­ôPQÄ­ôQÃQP«ÁÒ­ôPÊP«·È­ô«°Ì­ô«©Ð­ô­üx­ü««›Ð­ô­üέüPxP««ŠÎ««ƒÒ««1{ÿÕ«aÐP^Ñ«­ôôSÑ«­ôëJÑ«­ôâAÑ«­ôÙ8íô«P0Ííô«P&Ãíô«P¹Ã­ô«P¯Ñ«­ô	¦Ñ«­ôŸÔPÐP«1ÿÑP
1zÿ1xþÑP18ÿ1mþÑP@1AÿÑP>1þþ1TþÑPB16ÿ1EþÑP1ÿÃÑP1ÿ10þÑPL12ÿµÑPP1zÿÑPM1ÿ1þÑPQ1fÿ1öýÑPV10ÿ,ÑPT1ÿÑPS1æþ1ËýÑPU1éþ1¼ýÑPX1ÿÑPW1Þþ1ŸýÑPY1íþ1ýÀЬ[ЫPРYЫPРXÑY
ÑX
sÐkPÓ@ïÑ ÑkPÑkQßï6¤ûïDuÑY
ÑX
ЫPЫQÑ ¡ÑX
лPÓ@ïÆÐÐkPÝ@ïùÎßï¤ûïÂuËÏÿÿÿYPÑP
ËÏÿÿÿYPÑP0ЫZЫZËÏÿÿÿªPÑP&ËÏÿÿÿªPÑP0ÑjÕª1ûÝ[ßïÓ£1éЫPРWЫPРVÑYXЫPЫQÑ ¡Ý[ßï´£ûï¾ËÏÿÿÿYPÑP0ËÏÿÿÿYPÑP1ËÏÿÿÿXPÑP0
ËÏÿÿÿXPÑPvËÏÿÿÿYPÑP0&ËÏÿÿÿXPÑP0ÑGïçÔFïáÔ
Ý[ßïV£ŽËÏÿÿÿYPÑP0ÖWËÏÿÿÿXPÑP0ÖVxþYPÊPïYQÉQPYxþXPÊPïXQÉQPX1/ÿÝ[ßï£ûïž®œ^Ь[ÐkPÝ@ïŽÍݬßï÷¢ß­œûïUåß­œûïGtÂ^Ь[ЫPÅ Pž@ïgÿZ˜a»˜akÝ«ûï§ÐP[ËÏÿÿÿ«PÑPЫ˪PxPPÈPïªQÉQP­ü2ª­ø2ª­ôÝ­ôÝ­øÝ­üÝ[ûï;ÐP[Ъ­è˜ª­ðá­ð;ЪPÏPÖáìÖáìßïQ¢ûïsÇ­ì­èPÅ­ìP­èÕ­èDÝ­ôÝ­øÝ­üÝÝÝÝ­ôÝ­øÝ­üÝ­èûïÏÝPûï¾ÝPÝ[ÝûïOÝPûï^ÐP[ÝÝ[Ý
ûïîÿÿÐP[á­ð;2ª~ÝݪÝÝ[ÝgûïÐP[Ç­ìªPÄ­ìPÃPªPxPPï­ðQÉQP«Ý[ûïЭìЭô1FÿЭìЭô1;ÿЭìЭô10ÿЬ[ÑP^aÑP_<ÑPgЫ[ÐkPÑP'ÑP
ÔÑ»bÐPÑ»fòÑ»dèËÏÿÿÿ«PÑP0ÚËÏÿÿÿ«PÑP ÌÔPÝÝÝÝÝÝûï=ÐP[Ñ«€ÿÿÿѫЫѫ€ÿÿÑ«ÿÐ«Ð«Ь«2@«Ý[ûïЬ[Ý«Ý«Ý«Ý[ûï
ÝPûï5ЬPËÏÿÿÿ PÑPßï{ ûïÝpÐ PЬPÝ Ý РPïPPÊPЬQï¡QÉQP~ûïBÔÿÿЬ[ѬЫPЫPÐPZÝÝÝѬЫPЫPÝPûïLÿÿÿÝPÝZÝjûï'ÐPYÝYûï3ÐPYѬÐY«ÐY«Ð[PЬ[ï«PÐPZÑP
ÑZkЫPÑ@ïÞÐÐZ)ЫPÑ@ïËÐ ÐZЫPÑ@ï¸ÐÐZÐZÝZûï´ÐPZÐZ«Ë«PÈZPÐP«ÑkÑZ	ЫЫ«Ь[ËÏÿÿÿ«PÑP0(ЫPïPPÊPï«QÉQP«Ö«ÝÝ[ÝûïëÿÿËÏÿÿÿ«PÑP äÐ[PЬ[ÐkPÑPvÑPP<ÑPQ3ÑPR.ÑPS%ÑPTÑPUÝkß>ûï_oÐ[PЫPÑ 
ЫPÑ ЫPÑ ÞЫPÑ ÔÀkÏÝÝÝÝ«ûï¬ýÿÿÝPÝ[Ýkûï‡ÝPûï–Â$^Ь[Ðk­ðЫPР­üЭü­ôЫPР­øЫPР­èЫPР­ìЫPР­àЫPР­äЭðPÑP1ˆÑP1­ÑP$.ÑP:)ÑPo ËÏÿÿÿ­üPÑP1˜Ð­ø­ôЭì­èЭä­àÝ­àÝ­èÝ­ôÝ«ûï<ÐP«Ý­àÝ­èÝ­ôÝ«ûï%ÐP«Ñ­ðЭô«Эè«Эà«Ý[ûï¹Ý«ûïÌüÿÿÐP­ÜÝ«ûï¾üÿÿÑP­Ü•ßïmûï©m†Ñ­ü­ø÷ßïsèËÏÿÿÿ­øPÑP1fÿÝ­àÝ­ôûï^ÐÿÿÐP­ÜÝ­äÝ­øûïMÐÿÿÑP­ÜÙЭø­ô15ÿÀÂ^Ь[ÐkVЫPРZЫPРYÕZÕYÑVo
ßïûï mÔ­üÑZÑZЭüÂ
ZÑYÑYЭüÂ
YÓFï¡È1ÐZPÏP%>A3ÐX.ÑYÐPÐPÐPXÐYXÑZßÑZÚÑYÕÑYÐÐXÓFïOÈ
ЫPРWÐZXÕ­üÑXÑXÁ
XPÐXPÐPWÑXZÝWÝÝWÝ«ûïÐP«ÑXY	ÑVoÝWÝÝWÝ«ûïnÐP«ÓFïâÇЫPР«ЫPР«ЫPР«ÓFï»ÇЫÐW«Ô«ÐX«Õï>˜ÝWÝYÝFïÕÅÝZÝ[ßïé›ûïNÝÐ[PЬ[Ñ«
Ñk	Ý[ûï„ûÿÿѬ«Ь«Ь«Ð[PÓ0¬ݬݬݬÝÝ[ÝiûïOÑk4ѬѬ(ÐkÑ«Ñ«n««Ь«Ы«Ý[ûï.ݬݬݬÝÝ[ÝhªЬ[ЬZûïalÐPYЬiÐ[©ÐZ©Ь©Ь©Ь©ÐYPÂ^Ь[Ñkßï›ûïåjЭüЫ­üÑ­ü«
ßï›ûïÆjÝ[ûï£lЭüPÔ[мXËñÿÿÿHïRÆPÑP1ÑP1ÿÐXPÏPm****vWhW0FH*NQ=NQNQ©½CCÜÜÜÜÜÜÜÜÜÜÜöÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜCÜö©FHNQS?S?Ü·*Ü*ÜÜÜC8WW\\\\\\ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ4CCÝHï“Ãßïþ™ûï˜iÐPЬPРPÝ ûï”ÐPYÐY[ЬPРPÝ ûï|ÐPZÒZPÊP[1Ëþ2PáZ¨ÐPèZùŸ2PÔPá[’Ð Pè[ù‰é[†2 PàZáY2Pá[š Pá[2Pà[öáZЬPÑ°2$PáY¸Ð¬PÑ°®2DPáY2PÐP2Pà[£à[…á[2PéZ
áY2
@PáZ	éY2 Pà[1ìþ2Pá[2EPÑXoÕZÐ$Pá[˜dPàZáY2GPÕ[ÁáZ2BPá[³˜fPé[«2DPá[¡˜`Pè[ø1…þà[ñáZõéYò2D"Pá[2‚PàYÞá[1ÍþáZ	éY2"PèZ1LþáYù2APЬPÏP FBQQQQUUMMIIQQQQBBBBBBBBBBBBBBBBFÐPÔPÐ PÐPÐPÐPÂ^Ь[Ý«Ý«Ý«ûïËÿÿÇP­üÝ[ûïIiÕ­ü
ßïÞ—ûïhÝ­üûïÁõÿÿЬ[Á¬¼м¼ßïÄ—ûïžØ¬ѬéÕ¬
ß流ûï‚ØÐkPËñÿÿÿ@ï©ÂZÐkPÝ@ïÞÀÝ[ßûïYØÑZ Ý«ßïz—ûïDØÝ«ßïm—ûï4ØÝ«ûï¤iÝ«Ý«ßïW—ûïØßïÃôûï×Â^Ь[ÑkIÝûï]Ýûï2ûïùÐP­üÝPûïÒÝ@p«~ûï%Ô«έüPÐP«Ð«ÐkЬ[Õïz’ÝßïÜþÿÿÝ[ûï9hÕïùñßïÆ–ûïÈfÐïãñÝ[ûïÀÐP[ßï[ÿÿÿÝ[ûïdhÝûï½Ý[ûï†Ý[ûï­g ^Ь[ÐkPËñÿÿÿ@ï\ÁZÐkPÑP;ÑP6ÑP^1ÛÑPb1—ÑPcôÑPdëÑPf|1¾Ñ«@QÞï+–«"Å«PÝàfûïúÐPYÝYûï¨hÐP«2 «ÑZ
Ý«ûïYÿÿÿÑZ
Ý«ûïJÿÿÿÕ«´Î«~ßïÒ•ß­àûï¾Öß­à²Ð«PÝ ЫPÝ ÝûïnÈÿÿÀPÇP«ЫPÝ Ýûï¦ÇÿÿÆPÐP«…Ý«Ý«ûïh_Þï}•«1mÿѼ81ЬPÝ ûïêÿÿÿЬQÐP¡ЬPÝ ûïÔÿÿÿЬQÐP¡ЬPЬPËÏÿÿÿ PÑPÝݬÝ
ûïçßÿÿÐP¬ÚݬûïÂ^Ь[ï«PÐP­ôÑP
ÑP	Ý[ûïÚóÿÿÕïâ”Ð[PÐkZËñÿÿÿJï¡¿YÑYçÑYÝ«ûïªÿÿÿÐP«Ý«ûïœÿÿÿÐP«ÐZPÑPQ1²1iÑPB1ÑP	1Ã1æÑP1¶1ÎÑP‰1—Ý[ûïg
Ý«ûïÚþÿÿÐP«1kÿÑ»
ßïW”ûï°cÝ«ûï@ÕPÜлЫPЫ ЫPЫ ЫPЫ ˜akЫPÑ»®Ð»ÐÝ«ûï€ÕP1ÿЫPΠPЫQÐP¡ÐkÐkZÝ«ûïYÕPÑ»Ñ»Ы­üЫ«Эü«Ñ»Z3Ы­ðЫ­üЭüPР­ìР­èÐP«ЭüPЭð ЭüPЭì Эè«ÑZDÑ»>Ñ»8ЫPÑ°.ЫPÝ ÝÝ«ûïëéÿÿÕPЫP˜a°˜a»ЫPР«Ñ»'Ñ»Z!ЫPÑ°ЫPÝ ÝZÝ«ûï§éÿÿÕP¼Ñ»?Ñ»9Ý«ÝZÝ«ûïˆéÿÿÕP&˜a»Ý«Ý«Ý«Ý«ûïöÿÿÐP«˜akÝ«1NþÑZÑZ
ÑZÑZÝ«ûï(ÕP	ЫPÕ ¯ÑZGÝ«ûïÕP9ЫPÝ ûïÈÐP­ø%ÕP„˜@kÐkZЫPРЫQР¡ЫPЭø ÑZ1SýÝ«ûï½ÕPïЫPÕ æЫPΠPЫQÐP¡ÐkÐkZ1#ýÝ«ûïÕPïЫPÑ 1ÿ1ýÑ»÷Ы­üЫ«Эü«ÃPkP2@ïÅ‘k1ÝüÝ«ûïGÕPïЫPÕ 1Ëþ1ÀüÑP1¢ý1µüÑP
1‹ýÑP1´ý1 üÑP1©ý1•üÑP³ÑP¬ÑP1ý1|üÑP1…ý1qüÑPI1éüÑP<18ÿ1XüÑPP1Gÿ1IüÑPX18ÿQÑPUò&ÑPSçÑPRÜ1üÑPT1ÿ1
üÑPW1ùþ1ùûÑPV1èþ1êûÑPh1XüÑPY1Ëþ1ÍûÑPi1;ü1¾ûլìPÒPPËP¬PÎPÔ[	xÿ¬¬Ö[ѬñÐ[PѼЬPÑ @ÐPÔPѬïR}Õï^ÝïB}ßïd	ݬßïdûï¸ÐƬÕï8Ѭ
ßïLûï•ÐѬïЬPÐï[ЬïЬPÏP77TTaßï6ûï-_Ð[PÞïûìïÎßïöûï7ÐâÞïáìï´Ñ[ÒÑ[ÍßïÚÚÐï¼ï—¸ßïͩݬßïìÝï{ûïÏÖïrÐïlPÂ^ÕïS1âÅïg€Pž@ï?ê[Ýï$|ûï©ÿÿÿûï¼ÿÿÿÐPï|ûï®ÿÿÿÐPZßï‰ûï†ÏÝZßï‡ûïwÏ2«~2«~ЫPïPPÊPï«QÉQP~ûïnÁÿÿÇP­üÇ­üY
ßïYûï9ÏÐYP×YÕPêá­ü
ßïOûïÏé­ü
ßïOûï
ÏÝZßïQûïþÎÝ­üÝZßïOûïìÎÔïlŽÝïR{ûïïýÿÿûï,Â^Ýûï.þÿÿÅïaPž@ï9éYÝYûïÑЩZxþZPÊPïZQÉQPZÑZÑZ	ÐPÔPÐPïŽûïþÿÿÐPïàzÕï^º7ûïwþÿÿÐP­ôÝPßïÓŽûïLÎßïÖŽûï?ÎÝ­ôßïÔŽûï/ÎÝïç~ßïÞŽûïÎÝïÔ~ÝïÎ~ßïÖŽûïÎÔïû¹˜@­üÔ[1ªÅK¼Pž@ïlèY‘©wЩZö	©2'Ø©ß­üÝYûïŸÊÿÿÑ©Ñ©b­ûÑ©Ñ©
w­ûl­ûÝJïµ’Ç©~˜­û~ßïjŽûï}ÍxZPÈPïp¹ÐZ©ö©ß­üÝYûï6ÊÿÿÕP
ßïKŽûï%\Ö[Ñ[¬1MÿÇ­ü~Ýïó}ßï5Žûï(ÍÇ ï»}PxPPÃPï¯}PÇ ï¥}PÖPxPïš}Ýï˜}ÝïŽ}ûïÛЬ[‘«Ýkûï
ÝPßïÍûï´Ì‘«‘«	Ý«ûïœüÿÿÝkûïÑ	ÝPßï©ûï„Ìשּׁլ
Õ¬WßïŒBÕ¬ßïßïÝïØ‹ûïwËݬßïmÝï‹ûïaËѬßïWÝï©‹ûïHËÂ^Õ¬Ð[×[
ßï2ûï÷Ëó¬[îЬ­üx­üPÀPïßïûïYZÐPÝïn|ßï´wßïßïpèûï×ÊÂ^ÐZ+ÐJ¼P‘`-ÐJ¼P‘ XÐJ¼P‘ pÐïi·ÖZÑZ¬ÏÝïûŠûï–ÌÝÝûï+ÉÑPßï ÝûïÉÝÝûïÉÑPßïÝûïøÈÝÝûïíÈÑPßïâÝûïÙÈßïZŒÝï‹ŠûïÊÐPïá¶ÕP
ßï>Œûï°YݬݬûïO–ÿÿÐP­üÝﹶßï0ŒÝïIŠûïüÉÐPÕPZ×ÿ•¶Ðï¶PРQÖ šaP
Ýïz¶ûï)ÉÐP[ÖP8×ïçÐïçPÖïçö[`·ßïçÝ[ûïɦßﺋûïYÝïʉûïMÈЭüPÝﶉûï9ÈÝûïpÈÀЬ[x¬PÀ[Pë`X1ŬPÑXPóѬíÕ«ЫPûïìùÿÿÐPWÕ«*ßïN‹ûï¿ÉÝ«ßïF‹ûï¯Éßï<‹ûï¢ÉÝXßï2‹ûï“ÉÝWßï1‹ûï„Éßï/‹ûïwÉßï/‹ûïjÉßï8‹ûï]ÉûïnùÿÿÐPVÝPßï1‹ûïDÉÐZЫY×Y2ÝVxZPÀ[PÑY`ÐZPÖZxPPÀ[PРPÐWPÝPßïþŠûïÉÖYÑZ¬ÆÕ«	ÝWûïïøÿÿÝݬÝÝ[ûïЬ[Õ¬ݬßïÌŠûïÃÈì¬PÑP1‰Ã¬¬PxÿPPÁ¬PZß流ûï˜ÈxZPÀ[PÝ`ßûï‚ÈxZPÀ[PÝ ßï…ŠûïkÈûï|øÿÿÐPYÝPßï{ŠûïRÈÝÃZ~ݬÝ[ûïbÿÿÿÝYݬÁZ~Ý[ûïPÿÿÿXЬZ×Z:ßïKŠûïÈxZPÀ[PÝ`ßï=ŠûïÈxZPÀ[PÝ ßï)ŠûïêÇñ¬Z¿ÿÕ«
Ý«ûïêöÿÿЬ[Ý[ݬÝݬÝÝÝûï	ëÿÿÝPÝoûïÐÑÿÿÐP[˜a»˜akЫP€Â^мYÐYPÑPh1™1ÁÑPT1å1¡ÑPR1Ô1ÑPЬPÕ 
Ñ @ЬPЬPÅ Pž@ï®á[˜«PÏPâÿfâÿffâÿÎÝÝÝÝÝÝ^ûïHêÿÿÐPZÔª‘«ÐPÐPªÝÝÝݬÝZÝEûïêÿÿÝPûïÆáÿÿÐP¬1|ÿ•«	øЬPÔ ΫPЬQÐP¡1aÿ˜^¼ЬPÔ ЬPЫ 1IÿЬPРPËÏÿÿÿ PÑPЬPРPËÏÿÿÿ PÑPÑÀ¼1ÿЬPРPРWÑWÑW
ÑWÑW
ЬPÑ°˜h¼1äþЬPÐPQСQР¡ЬPÐPQСQР¡ЬPÐPQСQР¡˜a¼ЬPРPЬPÑ Ñ ÐPÔPÐPXЬPРPÑ ЬPРPÑ ÐPÔPÐPWÑXW1^þЬPРXРPРWЬPÑ°]РPР­üÐXPÏP'G9?ЬPРPÐX 1Yÿ˜­üPЬQСQÐP¡ßš­üPìï­üPä2­üPÞЬPÑ°Á1ÚýЬPÑ°Ýßï_‡ûïØS˜a¼ЬPÝ Ý ÑYjÐPÐ<PÝPûïÿÎÿÿÑPS1Bþ1ˆýÑPU13þ1yýÑPj–ÑPi1Lþ1_ýÑPk1yÿ1PýÐPÔïuЬPÏP((((((ËÏÿÿÿ¬PÑPÐPÔPÝûï9áÿÿÐP[Ǭ«Ð[PЬ[ÁïX»¬PÑP 
ßïy†ûïãRx¬P×PÒPPËP«Pì QÂï)»QxQPPÈPï!»À¬ï»À¬ïýv)ïï»~ßï?†ûï»ÃxïòºïíºÂïâºÑïܺÎÁ\PÐP[Ѭ@:ï«Px«QÊÿÿQÈQPÝPïkPxkQÊÿÿQÉQP~ßïâ…ûïSÃ!ïkPxkQÊÿÿQÉQP~ßïÎ…ûï0ÃÀ¬ïRvݬûïXÀ¬ï<vÕ¬À¬ï:ºÀ¬ï"v)ïï,º~ßûïàÂxïºïºÂïºÑïºÎÔ[¼Kïõ¹Ö¬Ö[•¼í”Kïä¹ÞïÞ¹Pï¬PÑP
ÑPЬPˬPÉP¬ïˬPÉP¬ãÐPÂ^ŬPž@ïÙÜ[Ýkûï‡ÿÿÿÝPßïî„ûï:Â2«~2«~Ý«ûïD´ÿÿÐP­üÇP~ßïÒ„ûïÂßïÈ„ûïÂѬlѬL
Ñïšr€ÐPÔPݬûïVÂpPï}rÐPÕï\ݬûïoêÿÿݬûï#ûïƒDÔYÐ[ÐK¼Z‘j-yÐYÖ[Ñ[¬ëûïÂRûïË?ÐYP1¬ÑPa6uÑPX1ƒÖZ•jú×Z61¢ÑPlÌÖï7­ ÖïCŽÖï׌Öï×Öï­ÖZÖZ•j„˜jPÑPs¸‘ªpßÖïªßÖﮃ×ÑPeÖÆÑPt­˜j~ßï„ûï–O«ÑPr‚ãÑPoÚÖﶃÑPu§¾ÑPx¾ÖïFƒ1rÿÕï~¬ßïjlÝïqûïÐï'ƒïf¬ÕïƒÝßïlݬûïæPݬûïä*Ôï0¬ݬûï°ÝÝݬûïBJûïGNЬï΂ÐïÈ‚ï¬Ьï¬Ñbï¤pÐ拓ïë«Ðï‘pï ‚Ôï–‚ÑïÍ«Ðï}‚ïÀ«ûï±ÇﯫPxPPÃPPÇPÖPxPûïëЬ[Ý[ûï?ÕPóÔïÑ«Ý[ûï¸ÝÝ[ûï»ÔZÝÝJï`«ûï§ÖZÑZï «åЬ[ÐkZËñÿÿÿJïG©YÑYÔPÑYÝ«ûïÓÿÿÿÐZPÑPíÑPèÑPãÑP;!Ý«ûï±ÿÿÿÕPÝ«ûï£ÿÿÿÕP'ÐP$Ý«ûïBÿÿÿЫXÝ«Ý[ûïòK˜ahÐPÔPЬ[ÐkZËñÿÿÿJﻨYÐZPÑPKYÑP;<ÑPÑPÑPøÑPFïÑY
Ý«ûï©ÿÿÿÑY
Ý«ûïšÿÿÿÑPHÇÍÑPIͺÑPd±lÑPNÑPL¬™ÑPO¡Ý[ûïx)ÕP”ÑïVª‹Ý[ûïjKÐïDªQÐPAïë©Öï5ªЫX˜a»ÝXÝ[ûï÷J˜ahÑPmŸ1FÿÑPfô1)ÿݬûï„ÔÕï2€ßï½€ûïe½ÝßïݬûïûMݬûïŸÕï]©ÝïY©ÝïO©ûᄁݬݬûï¯Â^á¬TѬ€ßïg€ßïe€ßïb€ûïí¼*Ѭ€ßѬ€ÝË€¬~ßï<€ûïÁ¼Ô­øÔ­ü9x­üPÒPPËP¬P'Õ­ø
ßï€ûï—¼Ö­øЭüPÝ@ï_ûÖ­üЭüPÕ@ïJºÂ^Ь­øûï]ݬûïYЬPÝ ÝPûïa.ÕïU9ݬßïµûï-¼Ý­øûïÿÿÿßïªûï¼Ýßï2ݬûï¬Lм[ËñÿÿÿKï*¦ZÐ[YÐYPÑPK131ÑÑP;1&1£ÑP11ÑP1ä1	Р­ð1Ý­øݬûïÂ!ÐP­ø1ÃмPÝ@ï¤ßï?ûï[JÝÝ­ôûïéýÿÿЬPЭðQР¡Ý­øÝ­ðûïÏýÿÿÝ­ðݬûïšH˜a½ðè¬1JÝÝݬûï`EÑPX~ÑPHuÑPFBhÑPI7]ÑPlT!ÑPdIÑPL<ÑPf1ÑPm(Ý­øݬûïñ9ÐPYÑP1qÿÑY1ÿþЬPР­ôÑZ1æþÔ­ðÕïª}Eݬßï~ûݬûïZýÿÿßï~ûïkºÝ­øûïCýÿÿÝIïТßïý}ûïMºÐYPÑPN1©1ÛÑP1•1pÑP
1Ú1CÑP11.ÑP1qþÑ[^ôÝݬ1´ЬPР¬Ð¬Ь­øûïÞݬûïÚЬPÝ ÝPûïâ+ËP¬~ݬûï±4ÕP1gýЭðPР[Ý[ÝÿÿÿÿÝ­ôûïg˜a½ð˜a¼ûïå2ÐPYÝPÝÿÿÿÿÝ­ôûï@ЬPЭðQСQР¡ÝЭðPÝ ûï½ûÿÿЭðPРPÉ PЭðQСQÐP¡ÝÝЭðPÝ ûïFCÝIûïs2ÐP­üÝPÝûïŒÝYûïk2ÝЭðPÝ ûïYûÿÿÝ­üûïQ2˜^¼ЬPÔ ЭðPРPЬQР¡ЭðPРPЬQР¡ЭðPÝ ûï
I1Nýûïû1ÐPYÝPÝÿÿÿÿݬûïV˜`¼ЬPÐY Ýݬûï÷ûÿÿ1ýѽô
Ý­øЭôPÝ ûï,1^þÝ
Ý­ôûïÎûÿÿ1Oþßï|ûï¶FЬPÔ ˜K¼м[Ý­øݬûïÜÕP1Àü1müЬPÔ ˜H¼м[Ý­øݬûïµÕP1™ü1FüЬPÔ ˜f¼м[Ý­øݬûïzÕP1rü1üѬÝЬPÝ ûï2ûÿÿ1þÝ­øЬP1>ÿÝ­øݬûï2,ÕP1•ýé¬ѼNÐPÐ	PÐP¼1xýݬûïðDÐP­ôÝÝЬPÝ ûïpAЬPЭô ѼNÐPÐ	PÐP½ôѼNÐP«ÐP¦Ý­øݬûïp-ÕP1ý1aûÝ­øݬûï9.ÕP1úüݬûïrDÐP­ðÐ:¼ÝÝЬPÝ ûïî@ЬPЭð ݬûï³ЬPÝ ÝPûï»(Õï¯yÝßï³ݬûï-GÝЭðPÝ ûïúÿÿÝÝ­ð1(þÝ­øݬûï-ÕP1mü1½úÝ­øݬûï3+ÕP1VüÐ[PÑP<5ÑPÑP
ÑP1‰úÁ[¼1.üÑPó1yúÑPëöÑPä1júÑP@ØÑP>Ñ1WúÑPBÅ1KúÑP‰1CúÑP1NüÑP
1þ1.úÑP1#ý1#úÑPH1ªý$ÑP;1%úÑP:1/ÿ1úÑPF1Žý1ñùÑPK1QýÑPI1Jý1ÔùÑPL1Åü1ÅùÑPg1îü,ÑPd1lýÑPb1%þ1šùÑPf1Hý1‹ùÑPm1mûÑPl1û1nùÑPn1Àü1_ùѼaݬݬûïÞ/ÕPݬݬûïö3ÐPYÑPݬݬûïÕP1Áú1ùЬ[ÐkZËñÿÿÿJïËžPÐPYÑYÐZPÑPI1ô1ÍÑP.gÑP'XÑP
1ÿлPÓ@ï‹žïÝ
Ý«ûïÁ1âÝ«ûïXЫPÑ ﬠÐ[ï? 2ï: Ý«ûïðÑPÈ1§ÑPFx8ÑP;íÝ«ûï
ЫPÑ ïa Ð[ïôŸ2ïïŸÝ«ûïÿÿÿÑPHYÑPKPÖï& HÑPfï4ÑPL1wÿÖÑPd&Ý«ûïÔþÿÿÝZÝ«ûïÖïæŸÑPmÌÑYŒÐ»PÓ@ï‡ÝZÝ«ûï½Ñ«﹟	Ý[ûï Ý«ûï|þÿÿ1RÿЬ[ÐkPÑPÑPÑPÑPLÝ[ûïNþÿÿÝ«ûïÝ«ûïÁÿÿÿЬ[ÐkPÑPFMÑPHDÑPI;ÑPK2ÑPd)ÑPf ÐkPËñÿÿÿ@ïÊœPÑP"ÑPÑPÖï÷žÝ«ûïÿÿÿЫ[Ь[Ñk8ݬÝ«ûïèÿÿÿЫ[ѬF
ѬdÔﮞÝ[ûïýÿÿÎZм[Ð[PÑPRv1±ÑP;1F1xÑP1Š1`ÑP1VÑP1õÝ Ý¬ûïLôÿÿÕ¬ÝIݬÝQûïKÕ¬15ÝIݬÕ¬1ÔP1Õ¬ÃP[PÐ@ï¥t¼м[Ь¬Î¬ЬPÑ°1ÃРPÕ ôЬPРPРP•`äÐ[PÏPP	111111”w1Ñ[Y˜QP˜PPÐP¼ÐP[ЬPаPÓ@ï@›Ý
ЬPÝ ûïlóÿÿÝ Ð¬PÝ ûï\óÿÿÝIݬÝ[ûïd=Ý Ð¬PÝ ûï8óÿÿÝIݬÝÚÝ Ð¬PÝ ЬPЬ Ý Ý¬ûïóÿÿÕ¬ÝIݬÝûïÝÝݬûïž:Õ¬	ûïË)ЬPÐPZÝZÝÿÿÿÿЬPÝ ûïþÿÿݬݬЬPÝ ûïþÿÿÕ¬	ÝZûïš)˜a¼Õ¬	ûïx)ЬPÐPZÝÿÿÿÿÝZЬPÝ ûïÉýÿÿݬݬЬPÝ ûïµýÿÿÕ¬¶«Ý¬ݬЬPÝ ûïšýÿÿžÝЬPÝ ûï&òÿÿ˜a¼ݬݬЬPÝ ûïoýÿÿÕ¬	ûïò(ЬPÐPYÕ¬	ûïÝ(ЬPÐPXûïÍ(ÐPZÝPÝÿÿÿÿЬPÝ ûï$ýÿÿÝYÝXЬPРPÝ ûïýÿÿÝZûï¥(ݬݬЬPРPÝ ûïíüÿÿÕ¬	ÝXûï(Õ¬	ÝYûïq(ЬP˜a°1ËþЬPÑ 1þüÑ ÷Õ РP•`Õ¬1£þÝIݬÕ¬1þÝIݬÝûï01{þ˜PPÝP1þÑP1pþ1§üÑPP1àüÑPL1™þ1ŠüÑPQ1Ãü1{üÑPV1´ü&ÑPTòÑPSç1VüÑPU1ü1GüÑPX1€üÑPWò1-üÑPY1fü1üÖïü™Ðïö™PÑP¬

ßïËqûï·<Á¬¼м¼ßïßqûïÀ­Â¬ѬéЬP׬ÕP
ßï¿qûïž­мPÝ@ï	–ݬßï©qûмPÑPdÑP_ÑP^?ÑP_MÑPb]ÑPcTÑPdKÑPfBhßï|qûï0­1ÌЬPРPÝ@ï@rßï>q:ßï:qûï	­ݬûï{(ЬPÝ ßïqûïé¬ЬPÝ ßïqûïÕ¬ßïqûïȬЬPÝ ûï4>ßïöpûï­¬ЬPÑ  1_ÿá ßïÝpßïÝpûЬPË PÝ@ïqßïÂpûïa¬ЬPÝ ßï±pûïM¬€мPËþÿÿÿ@ïp–PÐP¼Ô¼Õ¬1IѼgóݬûïÎ	ÕPЬPРXïXZxúXYÁZYPÑPÐPÐ PÐPï	˜ÑPÐ
PÐPÐPWÃZïò—PÃYPYЬPРPÐW Ð¼ûïz;ЬQÐP¡ЬPаЬPРP2  ЬPРPÐW ЬPРPРЬPРPÔ ЬPРPÞïÌo ЬPРPxZ  ЬPРP× ÕYeûï;ÐP[˜Bk2 «ÐW«ЬPР«ûïä:ÐP«Ð»ЫP2  ЫPÐW ЫPÔ ЫPÐY ЫPÞïSo ЬPÐ[ ÀÂ^Ь[Ñk
1ÑЫ­üѽü^ЭüPР­øРYРX}ѽüѽüЭüPРWРVѽü	ѽü1‡ÑføÑg^yݦûïÑPjЦ­øѽüέøPÐP­øЧYÀ§­øЦX•hѽü•·•hЧXÝXÝ­øÝYÝ«ûï·ÕP˜_kÐY«Эø«ÐX«Ý­üûïm:Ýßï¦ýÿÿݬûï:ßïÿÿÿݬûïâ:ßïþݬûïÒ:ݬݬßïrqûﱩЬ[ÔYÔZÑZé[ÖYxÿ[[ÖZÕ[ëÐYPÂ^Ðï‘•­üÆ­üÇ­üPÀPPÃP­üPÇ­üPÖPÁPP­üÊÃÿÿïQ•ÝïK•ûï–ÿÿÿxPPÀP­üÝïªUßïqûï+©Õï#•Ýï•ÝïÕYßïåpûï
©ßïðpûïý¨ßïípûïð¨Ý­üÝï¥YßïÝpûïÚ¨ÝïÒ”ÝïŒYßïÏpûïÁ¨ÝïmÝïsYßïÁpû﨨ÔïhmÕïNtÔïFtßï¬pûÞïHm[1Ñk¬(Ý«ßï›pûïe¨ѬF
ßï‡pûïN¨À[ÕkËЬPÝ@ï±ßïipûï7ÀЬPÑPO1@1/ÑPI1„1òÑPB1Ò1ÒÑP01¨ÑP-1qßïÑpûï®6ЬPаPÑPsÑP)ÑP^<ÑP_\ßïpûï|6ЬPРPvßï×oûЬPÝ ûïë
ßïÂoûïo§ЬPÝ ûïÝßï®oûïT§ßï¢oûïF§ЬPÝ ûï´ßïŽoÕЬPРPЬPР[Ñ[Ñ[ßïŒo±Ñ[Ñ[
ßï|oŸßïvo—ÝIûïK ÐP[ÝPÝûïeЬPÝ ûï? Ý1ݬûï)РZxZPÝà¨ßï-oûxZPÈPï•’Ý[ûï ЬPРݬЬPÝ ݼûïÿ
ßïønûïc¦ÀïþkÑïøkïkÐïëkï
kÔïßkЬPРPÒ PЬQСQÐP¡ÝRݬûïl(ÝPûïéЬPРPÒ PЬQСQÐP¡ЬPРPΠPЬQСQÐP¡ÝRݬûï"(ÝPûïŸЬPРPΠP´Ð¬PР[Р¬мPÑPÑP^GÑP_?ЬPÑ Ñ 
Ñ[Ñ[ÐPÔPÑ[Ñ[ÐPÐPЬQÀP¡ßïÙm1hýßïëmûï4ѼbЬPÝ ßïØmûï¥
ßïÌmûïã3ѼbЬPРYРX!Ѽc
ЬPРX
ßï¢mûï©3ÑhÐh%Ñh^˜_hÑh_
ßï}mûïz3ЬPРWÀW¨ÀW©NÑWÐPÐPÐPVÂV¨ÑV	ÞïMmPÞïNmPÝPÝÝXûïÚ$ÂV©ßï@mÝÝYûïÅ$ÂVWÕW®ÑhÐh1]üÑh_ô˜^h1MüÑPC1Bü11üÑPM1þÑPL1Vü1üÑPN1÷ü1üÑPT1'þ,ÑPR1œüÑPP1[ý1ÚûÑPS1§þ1ËûÑPW1jþÑPU1Oþ1®ûÑP~1Gý1ŸûѬEÁ¬PÝ@ïŽhÁ¬PÝ@ï‚hßï`lûïS£Á¬PxPPÈPïAÁ¬PxPPÈPï1ЬPÝ@ïJhЬPÝ@ï?hßï*lûï£x¬PÈPïx¬PÈPïöŽïïZšïûŽïöŽÑïðŽ
ÁïæŽPÐPÐPïAÕïe ÁïvePÑPï*ÁïeePÐPïÐ[Ñ[ïÐPÐPÐPKïágó[ãÐ[Ñ[ZÐPÐPÁ[QÐPAïÁgó[ãѬÐPÐPÐPÔPѬѬ^Ѭ
Ѭ_ÐPѬ
ЬPÝ ûïdÕPÐPÔPЬ[ÐkZÑZÑZ^ÑZ	ÑZ_ÐPÑZ
Ý«ûï ÑPÐPÔPЬ[Ñk
Ы[Ñk^	Ñk_ЫPÓ@ïáfÐPÔPÑkÑkÐPÔPËÏÿÿÿ¬PÑPÔPЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑPѬÐPÔPЬPÏP*8Âÿ8FÂÿÂÿÂÿÂÿ*8¦Ñ¬ÐPÔPѬÐPÔPѬÐPÔPѬÐPÔPЬ[Ñk^Ñ«
Ñ«ÐPÔPЬ[ÐkZÝ[ûïÌÿÿÿÕP2PÑZN?Ý«ûï¯ÿÿÿÕP1Ñ»+ЫPРP•`ЫPÝ ЫPÝ ûïâþÿÿÕP2PÔPݬßïKiûï$ Ь[ÐkPÑPÑP^ßï+iûïØ.Ý[ûïbЫPÝ@ï
eßïiûïÛŸx«PÈPïÍ‹ßïûhûï™.Â^Ѽg	ЬPР¬ЬPР­üмPÑP.ÑP=ÑP^CÑP_mßïÍhûïJ.ЬPЭü ЬPÀ ݬûïÂâßïˆhûïEŸåЬPÁ PÝ@ïUdßïkhûï&ŸЬPÁ PxPPÈPЬPÀ ЬPÑ РP•`
ßï1hûï5.ЬPРPÝ@ïücßï"hûïÍžЬPx PÈPﻊЬPÕ РP•`šßïøgûݬûïßïãgû1ÿÂ^Ь[ÑkgЫ[ÐkPÑPtÑP+ÑP
11ÑP^hÑP_1ßïÖgûï-Ý«ûïÒûÿÿÑP(Ы­üxà««ßïgûïžÝ[ûïsЭü«ßïggûïòÝ[ûïWЫPÝ@ïÿbßïGgûïÐx«PÈPï‰Ñ«@ЫP•`
ßï"gûïô,ßï"gûï›Ý«ßïgûï‹ßï
gûï~ЫPÝ@ï”bßïöfûïex«PÈPïW‰Õ«ЫP•`#ßïÔfûï?Ý[ûï¤ßïÀfûï)ÝÝ[ûïÕPÝ«ûï‡þÿÿßï—fûïþœiЫXШY˜_kЩ«Щ«Щ«Щ«ÑhN!Ý[ûïFþÿÿßïXfû|ШP «ßïBfû樂Ý[ûïþÿÿÝXûï-Ь[ЫP•`Ý«ßï#f)Õ«Ý«ßïfÝ«ßïfûïYœÝ«ßïfûïIœЬ[ݬÝ[ûïЬ[Õ«Ý«ûïÐPZÔZÕ«
Ý«ûï“Ý«Ý»ûïÀùÿÿÕPÝÝ«ûïxßÿÿ˜HkÝÝ[ûïÐPYÝZûïÑYÐPÔPЬ[Ç[PÂPïMaÑ[Â[Ð[PÑP&Ý[Ñ[	ÞïMePÞïJePÝPßï/eûïs›Â^Õ¬ݬßï+eûïX›1<ѬYЬPÝ@ﶃßïeûï
*1Ðï°‡PÑPAÑPC1üÃP¬PÄPž@ïÿ`[ûï_ÐP­üÑïu‡C	ÞïÔdPÞï×dPÝPÝ ÝïP‡ûïIÕkݬÃPkPÝ@ï‡`û漢À[ÕkÝ­üÃPkPÝ@ïg`ûÑï
‡C	Þï~dPÞïdPÝPÝ Ýïå†ûïÞݬÀ[ÃPkPÝ@ï`ûï@šÝ­üûï¬ÝÝÝﮆûïQ$Ô牢ÔѬFÃP¬P2@ïdY¬ݬÃP¬PÝ@ï¿_ûï♻Ѭ@ÔPÓ¬ÐPà¬мPÓ@ïìƒ2P2@PÔP€Ь[ÐkXÑX
ЫPРPЫPÐPWÑXh
Ý[ûï'Þïà_YÑXiÑW©ÀYÕiîÓH3лPÑPvÑP
aÑP^11ÑP_1„ßï:cûïñ'ÐkPËñÿÿÿ@ï>ƒPÑP1fûï¾(ÐPZÐ8j2 ªÐªЫªЫª1F˜a»ЫPР«´Ð»ЫPË PxPPÈPЫQï¡QÈQPЫQÐP¡‰˜^»ЫPË PxPPÈPЫQï¡QÈQPЫQÐP¡ЫPÕ Ëûï,(ÐPZÐj2 ªЫPРªЫªûï(ÐPªÐºЪP2  ЪPРЪPРP”`ЫPЪQР¡ЪPÔ ЫPÔ ÐZ«1èþûï¾'ÐPZÃkjЫªЫªûï¦'ÐPªЫªÐ:kÐZ«ЪZлjЫPРªЫPРªЫPРªЫPРªÝ«ûïøýÿÿЫZ˜FkÐZ«ûïL'ÐPZÐZ«Ðj2 ªÁ «PÊPxPPÈPÁ «QïQQÈQPÐPªЩªÔªÔªÂ^Ь[ЫYЫPРXÑYÑYÐPÔPÐP­üÑXÑXÐPÔPÐP­øÑ­üPлPÓ@ï/˜FkЫ«ûï¬&ÐPZÐZ«Ðj2 ªÁ «PÊPxPPÈPÁ «QïQQÉQPªÕ­ü	Þïâ`PÞïß`PÐPªÔªÔªЬ[ÑkhÑ«ЫPÑ ÐPÔPЬ[ÑkhÑ«ЫPÑ ÐPÔPЬ[ÑkzÑ«tÝ«ûï™ÿÿÿÕPfÝ«ûï‹ÿÿÿÕP.Ñ»RЫPРP•`FЫPÑ €ÿÿ8ЫPÑ ÿ*ЫZЪ«˜ajÑ»
ЫPР
ЫZЪ«˜ajÐkPÓ@ïòhÑkP	ÑkQVЫZѪѪFЫZѪѪ6Ý«ûïÿÿÿÕP(Ý«ûïþþÿÿÕPЫZЪ«˜ajЫZЪ«˜ajЬ[ßïøþÿÿÝ[ûïE&ßï“ûÿÿÝ[ûï6&Ý[ûï'ëÿÿÔï¿ZЬ[ЬPÑPd€"ÑPe€>ÑPf€Sßï0_ûïÄ#ÔPÑkøЫP•`ðÑ«€ÿÿÿæÑ«ÜÐPÑkÓЫP•`ËÕ«ÆÑ«ÿàºÑkµÐ«P•`­Ñ«§Ñ«ÅŸЬ[Ý«Ý»ûï7òÿÿЬ[ÑkN&Ñ»^ЫPÝ ЫPÝ ûïâòÿÿÕPÔPЫ[Ñk
Ы[ÑkÑk_	Ñk^ÐPÔPЬ[ÐkZÓJï5~1ЫPЫQÑ ¡Ñ»
XЫPÕ ЫP(ЫPÕ 1ЫïßЫPаPÑP
3ЫPРPРïÀ2ï»ßïT_ûïi"ðÑ»gÀЫï•ÓЫPЫQÑ ¡ç›Ñ¬€ÿÿѬÿ•¼Ѭ	ѬÔPÐPЬ[ЫZЫPÏP
 6I 6ÐZPé¬øÕZôÑkïÐZÐZ«æá¬áÑk
ÜÕZØÐZçá¬ÎÕZÛÈÀÂ^Ь[ÐkZËñÿÿÿJïò|YÝ«ûïWðÿÿÐPVÔ«ÑYѫЫÑY1–ÐZPÑP
ÑPH	ÑPfÐïñ~«Ý«ûïÈñÿÿÕPЫPÑ VÐVP1ЫPРP1ÑWVê<ÑXVãÐXP1ñÁVXPÑPWÐWPÁVXPÑPï™~
Ðï‘~P1ÌÁVXPÑPW1¼ÐWP1ºÐ«PРXЫPРWÑZ:1ÑZF1`ÿÑZdôÑZb“ÓJïõ{ЫPÝ ûïUïÿÿÐPVÝÝ«ûïfþÿÿÐPXÝÝ«ûïWþÿÿÐPWÁVWPÑXPÁVWPÐXPÁVXQÑWQÁVXQÐWQÑPQÁVWPÑXP1ÿÁVWPÁVXPÑWP1DÿÁVXPÐP«ÓJïl{1õÐZPÑPBÑP	=ÑP8ÑP3ÑP.ÑPNØÑPOÏÝÝ«ûï½ýÿÿÐPWZÕXBÐV«1ªÑ«Ñ«ËÏÿÿÿ«PÑPÊÕX1€þÕW1€þÁXVPÑWP1°þÁXVP1iÿÁVPÑXPÁVP\ÐXPWÕXÁVVPÑWPGÁVVPDÁVXPÁVQÀVQÑPQ	ÁVPÀVPÁVXPÑWPÁVXPÁVQÀVQÑPQ	ÁVPÀVP	ÁVXPÐWPÐP«ÐZPÑPqÑPlÑPgÑPbÑP;]ÑZ<
ÑZ>ÑZÑ«
Ñ«Ðï}|VÑZÑZ
ÑZÑZ1æÑ»^ЫPРPÓ@ï/UáÑXW#1ÂÑXWÐWPÐXPÑPV1WýÑXW1£ý1iýЫPР­øЫPР­üÑ­üÑ­øjÑ­üÑ­üÑ­øXÑ­øRËÏÿÿÿ­øPÑPDÑ­øÑ­ø0Ñ­üÑ­üÑ»
ÕX<Ñ»
6Ñ»
.Ñ»
ÕX
"ÕXÕWÐX­ðÐWXЭðWЫ­ôЫ«Эô«ÝÝ«ûï»ûÿÿÐPWÑVX1®ü1ŽüÁVVPÁWVQÑXQÁWVQÐXQÁXVRÑWRÁXVRÐWRÑQRÁWVQÑXQÁWVQÐXQÁXVQÑWQÁXVQÐWQÑPQKÁWVPÑXPÁWVPÐXPÁXVQÑWQÁXVQÐWQÑPQÁWVPÑXP1üÁWVP1ýÁXVPÑWP1’ý1?üÁVVP1øüЬ[Ñkg
ЫPЫ Ы[Ñk
Ы[Ñk
	Ь«Ы[ÑkÑ»	Ь«Ы[ݬÝ[ûïÀЬ[ÕïŽYݬÝ[ßï¨YûïÄ2 WЬ«å¬ЬXÐkZËñÿÿÿJïØwPÐPVЫYÑYÑY7ÑZl2XÖï.YÑVÝXÝ«ûï‡ÿÿÿÑVÝWÝ«ûïvÿÿÿÐZPÑPP1ã18ÑP>!1ÑP1Ì1ßÑP71ÍÑP£ÝÝ«ûï+ÿÿÿÑï‡yzÝ š2 XЬW1vÿÑïjy
2X2 W1`ÿЫP2 ÝÝ«ûïˆþÿÿÑï:yÝ Ý«ûïÅþÿÿЫP2 ÝÝ«ûïSþÿÿÑïy2P2PЫQÐP¡ÝÐ2 X1ãþ2X1ÛþÑPë1ÓþÑP<1(ÿÑP:1?ÿ1¾þÑP=1@ÿ1³þÑPF¿ÑP?1*ÿ1þÑPL©1‘þÑPT&ÑPR’ÑPQ‡1oþÑPS1xÿ1`þÑPb1iÿÑPU1[ÿ1CþÑPl1Tÿ14þЬ[Ñk
Ы[ÑkÑk;Ñ»5ЫPРP•`)ЫPÑ €ÿÿЫPÑ ÿ
ÝÝ«ûïíÎÿÿÝÝ[òÔPЬ[Ñk
+ЫZÑZ"ÑZÑZÝ«ûïŠêÿÿÑPÐPÔPЬ[ЫZЫYЫPÕ ^ÐkPÓ@ï*u4Ñi
&Ñ© Ý©ûï?êÿÿÑP
Ý©ûïÿÿÿ1/Ý1Ñi^1ЩPÓ@ïPïÔPÐkPÓ@ïÌt1£Ñª©4ÝZûï1ÿÿÿÕPݪ§Ñj^ЪPÓ@ïÅOÝÝZ1·ÝYûïýþÿÿÕP1rÿÑi^1sÿЩPÓ@ïO1bÿÝZûïÐþÿÿÕPŸÑj^²ÐªPÓ@ïiO¤ÐkPÝ@ïqrßïãUûïÈÑj^ЪPÓ@ï;OѪ©ÝZûïwþÿÿÕP1_ÿ1@ÿÑi^ЩPÓ@ï
O1ÿþÝÝYûï(ÍÿÿÐPЬ[Ñ»^2ÝÝ« Ñk_+Ñk

ßïqUûï<ÝÝ«ûïæÌÿÿÐPЫ[ÑkÌÔPЬ[ЫPÕ bÑ»^XÑ»
ЫP>ÝÊÝ«ûï¡Ìÿÿ6ÝÝ«ûïýÕP,ЫPЫPÑ°
&ЫPРPÝ ûï)ýÿÿÐPÑ»
ÀÑ»gÐÑ»^Ý
œÔP€Ь[ЫPРZЫPРYÐkPÑP=11ÑP1êÑP	
ZÑP1Ñ»^óÕZïÝÝ«ûïëËÿÿÐPÑ»^ÔPÑ»^ÈÑ»ÓЫPÑ ÉЫPÑ ¿1ÇÑP1¦1¼Ð«XÑhgШXÑh
µÝ¨ûïZçÿÿÑP¢Ý[ûï|ÐPWÐ:kÝÝÝ«ûïþÐW«ѸN1«Ð§XÑhgШXѸN1 ßï°S1ÑP1ÿ4ÑP/1ÿÑPA1%ÿÑP?Ñ»^1ÿÑPC1ÿÕY1‘ÕZ16ÿÑ»
ЫPÝ ûïŠûÿÿ1ÜþÑ»g1ÿЫPÑ°
óЫPРPÒѸ	
ßï.SûïÝШP˜a°˜a¸ШPР¨Ý[ûïçÜÿÿÝ«Ý[ûïóøÿÿÝݧûï[ÊÿÿÝÝW1bþÑ»
Ñ»^ЫP1iÿÑ»^1KÿÝ
16þÐïLRPÖïERݬßï³Rûïx†Ь[Ý«ûïîÿÿÿ˜akЫ[Ñk8éÑkc1ªÐ«ZÑ»
˜akЫ[Ðk>Ð
kÝ[ûï,ÜÿÿÑk_)Ý«ûïeúÿÿÝ[ûïÜÿÿÑk_
ßï8RûïÐÀZ«=ÑZÐPÐPÐPYÂY«ÑY	ÞïRPÞïRPÝPÝÝ[ûï8ÂYZÕZ¿ÝÝÝ[ûïÎÝ Ý[ûï"ÉÿÿЬ[ÔZÑk8Ý«ûïéÿÿÿÐPZЫ[Ñ«Ñ«ÇZPÀPPÃPZP
ÇZPÖPÁPPZÁZPÑkc!Ç«ZPÄ«PÃPZPÇ«ZPÖPÅ«PZÁ«ZPÇZPÀPPÃPZP
ÇZPÖPÁPPZÁZPм[Õï°QÝ[ݬݬßï¬Qûïß„à¬1†Ð¬PÑP€ÑP€	ÑP€YÑ[ЬPРP•`ÔPЬPÕ Ѭ€ÐPЬPÑ 
Ѭ€èЬPÑ ÿÿÿÿÄѬ€Ð¸Ý¬ݬûï6ïÿÿ謼á¬ݬûï’âÿÿÕP©á¬Ñ[	Ñ[_ЬPè ¾Ð[PÑP=ÑPBÑP
1.ÑP^1ÁÑP_1ÑP`1ŸÑPg13ÿË¿ÿÿÿ¬Pš€ZÒZPËP¬Pá¬áЬPÝ ûïºáÿÿÕPÏЬPР[ï[ï%pxú[ï pÁïpïpPÑPÐ
ïpÐï•oÐïüoÐ ï…oÃïçoïzoPxú[QÃQPïØo1¶þËßÿÿÿ¬PЬPРPÓ@ïHÐPÐPÐPZЬPРPÓ@ïrH1?ÿЬPРPÑ@ï’oëÑZÐPÐPÈPZ1ÿËÿýÿÿ¬PЬPÝ ûï0âÿÿÒ¬QÊQPá¬ÐPÕïsOݬݬßï‡Oûï ‚ËÏÿÿÿ¬PÑP>á¬9ЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑP0Ûˬ~ݬûïÿÿÿï¬PѬP
Ë¿ÿÿÿ¬Pá¬ÔPЬPÏP
%9ku//õÿõÿWMCa×ï¬PËýÿÿÿ¬PËÿßÿÿ¬PËûÿÿÿ¬PËÿýÿÿ¬PËÿþÿÿ¬PËÿÿÿ¬PËÿûÿÿ¬PË÷ÿÿÿ¬PËïÿÿÿ¬PËßÿÿÿ¬PÞï6W[Ñ«	Ð[ï^nÀ$[ÑkaáßïeNûïGÔZÑkZ1‚Ð[Jï7nÖZÑZptÕJï}kìÞïÙV[ÑkaÔÑkÃÃkPÐ@ïMYáY$ÑZ²ÑZ­ÑZ_¤ÝÝZûï¾ÞÿÿÕP“ÉYPÒPPËPJïkPÑPYéÀ$[œûïÍÒÿÿѬ@	Ðï•m[@мPÐ@ïm[2Ñk¼)lѼfѼ`Ѽ_VݬݼûïGÞÿÿÕPEÀ$[Ñka1ìÑk¹ÃkPÐ@ïºLYàY­Ð¼PÉYQÒQQËQ@ïvjPÑPY»Ò¬PËP«P°ÝLݬûïwÐPZÝ«ÝZûïûÿÿÕPÝ«ݪûï9ýÿÿÕP1yÿÝRݬûï@ÐPZÝ«ÝZûï×úÿÿÕPÚÝ«ݪûïýÿÿÕPÉá«ЫPÝ[ݬûïÕP¯Ý« ݬݬûïݬÝ«ݬûï¶	2P2PÂ^Ь[Ôï1L•k1¿˜kPÏPA~!H44|4žc44ÉÉ444‰b™444¬k×ïÕ›ÐïÑ›PÖïÊ›k`Ö[žßï¹›˜k~ûïµ}êÐï¶KáÖ[˜k~ݬûï·ÖÿÿÐé¬ÌÖ[‘k
ùÃÝïXkßïÄKûïÁ~®ÝïGkßï²KéÑï=k
˜wP˜lPÝPßï˜KÌЭüxïk­ü­ü×­üxïk­ü­ü‘kMЭüPÒ­üPÝPûï*Þÿÿ1LÿЬPÝ ßïUK†Ý¼Ö[˜k~ûï¹Õÿÿ1+ÿÖ[˜k~ݬûï…Р­üï­ü­üÝ­üßï K1MÿÖ[˜k~ݬûï^ÝPûïÛÝÿÿ1éþÖ[˜k~ݬûïCÝPûïÞÿÿ1ÎþÖ[˜k~ݬûï(ÝPûïCßÿÿ1³þÖ[˜k~ݬûï
ÝPûïîÝÿÿ1˜þЬPÑP1,ÑP2'ÑP3"ÑPL*ÑPRFÝPßï„JûïLÃ1¬PxPPÀ$:PмPËñÿÿÿ@ï†gPÑPЬPЬPРPмPËñÿÿÿ@ïagPÑPЬPЬPРPÎïlÐï
lïlÔïlÐïlPÐPïðkÔ[ÔKï{iÓKï?BÕïÓkÐ[ïÎkÐ[ïÃkÓKïBÕï»kÐ[ï¶kÐ[ï«kÖ[Ñ[²ЬPР[ÔZCxZP˜^à$:ï[~ݬûïÕxZQÐPá@:xZPÔà<:xZPÞïŠIà4:×[ÖZÓ[I¶xZP˜^à$:Ëÿÿÿ[~ݬûïˆxZQÐPá@:xZPÔà<:xZPÞï>Ià4:Â[ÖZÓ0[´Ó[1œxZP˜_à$:xZPÐà@:ѼdѼcѼf
ѼbЬPx PÀPÇ P~Ëÿðÿÿ[PÇP~ûïdxZQÐPá<:xZPÞï§Hà4:xZPxýà<:PxZQÐPá<:ÖZÔYÊIïØgòYðÔYxYPÕà@:ÔPÖYÑYZêÐPx¬PÀPï gѬ(ÇïgPxPPÃPïgPÇïýfPÖPxPïòfÑïìfïëfÐïßfïÞfÃï=ïÏfPÑPï‡=Ãï{=ïºfïu=Îï¯fPмPÓ@ïÂd$ݬûï>ØÿÿÐP[Ý[ݬݬûï¨ÕPÐ[PЬPË [Ñ[ Ý[ݬÝPûï|ÕPÔÓ¬1Ðï4i[Ñ[ï(i^ÓKï‚?Ý[ݬݬûïIÕP¡Ö[ÖÓð¬3Ðïi[×[ ÓKïL?Ý[ݬݬûïÕP1hÿóïÒh[ØÎPЬPÓ@ï?
ßïéFûïƒЬPÑ@ï4fÔPÓ¬ЬPÓ@ïè>éÓð¬ЬPÓ@ïÐ>ÑЬPÝ ûï×ÿÿÑP1¨è¬·Á¬PÓ@ï§>¨Á¬PÑ@ïÍe™Ð¬PÕ@ï¿e
ÁPPÕ@ï²eGÁ¬PÕ@ï¤eݬݬݬûïlÕP%ЬPÕ@ïƒe1MÿݬÁP~ݬûïGÕPèЬPÈ@ïYeÁ¬PÈ@ïHeÐPЬPÕ@ï9eãݬÝPݬûïÓD¬ݬÝLݬûï-ÕPÐPÓˆ¬ݬÝRݬûïÕPÛÔPݬݬûïúÿÿÐP¬Ѽ
Р¬Ѽ_GЬPÑ €&ï P×PѬPЬPï PѬPÐPÔPЬPѬ ÐPÔPѼ^àЬPѬ Ý ûï\ÕÿÿÑPЬPÁ PѬPÐPÔPЬ[ЫZÑk^Ý«/Ñk_/ÑZ€ÝïZPÃP~ûïÝïZ~ÝÝZûïÕïZD$ݬûïÚÔÿÿÝPЬPÝ@ïI<ßï~DûïwЬPÓ@ïp<Oô@ï›c
ßïqDûïÑݬûï“ÔÿÿÑP+é¬
ßïdDûï±Á¬Pô@ïac
ßïWDûï—ÕïÎC$ݬûïNÔÿÿÝPЬPÝ@ï½;ßï;DûïŽvЬPÓ@ïä;Ö@ïcݬûïÔÿÿÑP,Á¬PÓ@ï¿;Á¬PÖ@ïåbé¬
ßïDûïÕ¬ßï&Dßï$Dûï vѬèÔZÔ[1x[PÒPPËP¬P!ÕZ
ßïùCûïðuÖZÝKïCûïàuÖ[ÕKïõBÆ ^ÕïãB>ݬßïÂCûï·uݬûïqÿÿÿßï¹Cûï uݬûïx¸ÿÿßï¥Cûï‰uѬѼaÕ¬ßïÏýÿÿݬûïiмPÓ@ï…_ûï~Õ¬é¬ݬûï¡á¬#á¬ݬû`¼ЬPÔ ЬPÔ Þ­ì[é¬ÝLݬûïJ÷ÿÿÐP‹á¬ÝRݬûï2÷ÿÿÐP‹á¬Þïjc‹á¬Þï~c‹á¬Þï’c‹Þ­ìPÑ[P
ßï½BûïwÔkÞï;:­è1Ò½èPËP¬P"Þ­ì[ЭèPÝ ÝZûïnïÿÿÕPÀ[ÐkZäÀ­èÕ½èÊßï~Bûï(Ѽc	ЬPР¬ЬPРªÝZûï¿ÐPZݬûïŠÐj¼ЬPЪ ЬPЪ ЬPЪ ˜ajмPÑP^
ÑP_1˜ЬPà ЬPË PÐPYá
YЬPÑY nÕIïE`Ý ûïIÑÿÿÑPÁYPÕ@ï)`
ßïÃAûï^ЬPÝ ÝYûï¸üÿÿЬPÝ Ý ûïüÿÿЬPÝ Ý ÝYûïÐÏÿÿЬPÐY ЬPÑ €Yï PÃP­äЬPï ­àЭäPÑ@ï¯_
Ó@ïp8ЭàPÑ@ï—_1ÿÓ@ïU8óßï8Aûï¾1ÿЬPРPÑ@ïh_ëЬPРPÓ@ï!8Ùßï!AÊм¼ЬPЬQР¡ЬPЬQР¡ЬPЬQР¡ЬPЬQР¡ЬPЬQР¡Ь[Ý[ûï!ÐPZÝPûï›ÿÿÿЫYÑk^Ý«/Ñk_/ÑY€ÝïYPÃP~ûï]ûÿÿÝïY~ÝÝYûïIûÿÿÐjPËñÿÿÿ@ï,\PÑPÑPÐZPÝ«ûïsÿÿÿÐPªÝ«ûïeÿÿÿÐPªÞÔ[ÓKï7ÕKïI^
ßï2@ûï~ò[ÜÂ^ЭüÔ[x­ü­üÖ[Õ­üóÃ[PxP­øЭøPÖï@ÝuûÿÿݬݬßïŽûï€pßïŒEßïŽûïmpÑïÙ?
ßïrEûïÝcûïO¥ÿÿÕï³?Ñï«?ßïTE2ßïzEßï´ûïpݬݬݬݬßï›ûïpßï_EßïˆûïïoÝûÿÿÝwûïݤÿÿßï4Eßï[ûïÂoݬݬݬßïEûï¬oßïEßï2ûï™oÂ^Þï“#­ü	˜a½üÀ ­üÑ­ü\*íÞïv#ïI_Â^Ðï=_­øÑ­ø\*ÞïS#PßïµDûïçþÿÿÁ ­øPÐP­üÑP­øãѽüaÐPïú^Ñ­ü\*¾Á ­üPÓÂ^Õïq>2Þïý"­üѽüaÝ­üßïxDûïƒþÿÿÀ ­üÑ­ü\*Øûï,ÿÿÿѼaßïݬûï€Õ¬ßï@Dûï:þÿÿ˜a¼Â^Ь[ÑPÝ­üݬÝ«ûïßÿÿÿЫ[Эø¬Ô­øЭø­üß­øß­üݬÝ[û¼ÐkPËñÿÿÿ@ï>YPÑPµÐ«[Эü¬ÉЬ[ÐkPËñÿÿÿ@ïYZÑZ
ݬÝ«ûïØÿÿÿÑZ
ݬÝ«ûïÆÿÿÿÝ[û¼ÞïR=[ÐkPЫ@ïÓXÁ[PÐkQÐPAïWÀ[ÕkÞ'ßïÐCAßïÒC9ЬPïPPÊPï¬QÉQP¬ËÏÿÿÿ¬PÑPËËÏÿÿÿ¬PÑP ßï’Cûï2n¾ËÏÿÿÿ¬PÑP0¨Ð¬PÝ@ïmAßïtCûï
nЬ[Ý[ûï¡oÐPZÁZï5]PÑPUÀïBÑïBÄ
ßï1CûïžüÿÿÔï]ÕÿöA&ÝûïÙnÐPY
ßï"CûïqüÿÿÐYÿÎAÝ[ÁïÎ\ÿÁAPÐPYÝPûïoÁZPÀPï±\ÐYPÿÿÿÿ29þÿÿÿ8L9Lþÿÿÿ8K9KþÿIÿÿ8O9OþÿJÿÿ 4)þÿ'ÿÿ"4!þÿå]‚‘d;ãMbùYWXP8aNfæO
	_.\3B0RQ$ïðôKøíîõö÷ûúScT/länñšÉáj*ƒ$#-’–»Ji
Š‹ŒŽgÆ[5F9ÅšeG›žþp™¢£¤¦¨ª¬®¯±³µ¶·¸¹m(*ƒœ0½ºI1&Ÿ¼ '’&E0D'¿1Û“†Ûˆ0Aý91ÕÌ^͘Î!ÏÊЉÑ%Ò‡ÓùYWXÙƒPÀHNÖÈO×@ß&ÝÞÄàâÚ(*ÄRQü“^ïðôøíîõö÷ûúSÚTl—bñ
Ãa	ÃÜ—
	ÿ4	6
	`òl !#"
c/w¾<o",' t-uCówsky^hz„{2~|}qxsvtu=,wÇZ)+7:t¡uË?w>%y.sz{r~€|}qxsv•U
ìêëtéuçèwy+z{r~€|}qxsvtuwy)z{r~€|}qxsvtuòwtuw(ysvzr{€~$|}qxsvtuwyz{~|}qxsvtru€wyz{~|}qxsvr€tuwr€tqusvwyz{~|}qxsvtuwyz{~Ô|}qxsvØr€tutwuywzy{r~€|}qxsvqxsvtuwyÁz{r~€|}qxsvtuwyz{~|}qxsvr€VYWXPNOVYWXPN€ORQRQSTVYWX´PSNTOVYWX²PNORQRQSTVYWX°PSNTOVYWX­PNORQRQSTVYWX«PSNTOVYWX©PNORQRQSTVYWX§PSNTOVYWX¥PNORQtuwyRQ{STqxsvST…VYWXPNOVYWXPNORQ
RQSTVYWXSTLVYWXPNOVYWXRQPNORQSTRQtSuT”wVYWXPSNTOqxsvtuwyRQz{~|}qxsvtSuwyz{|qxsvtuwyz{qxsvüüÿüüüüøãüìüü{(w$üZüíí mëÿüÑüøæøü!üüüü’imZb`2üüüŒSÐüüüü*ü1üÞÿüÞüüKüüü"üü9–~6ÃËüüütø0üUüüëüëp!üüZüüüü–üü]P*÷êÄ·ü–üü ü~~~~~~ËZ¿ü/–üüüüüüüüüç«–ü>ü,^w_6––oüˆücÇ¿üüü––––––––üülüø~8ügc–üüöÿüüéüµµµµµ!ƒüóÿµ¹¶üª¤¸Eüü5žüüßüüÙƒ~üüüüÐüüüü¸üüü•µüü’nJüüüüüü&îÿüüz&xwusrqponmFlkj6mih\WVT$S
QONKJH#GE:	830/  ##%%%&		''))

**,,"-"...011/////3344((++225!6$$$$$$$$$$$$$$$$$7778

üÿÿåÿäÿðÿñÿÚÿïÿ"!íÿîÿöÿ#÷ÿ19ãÿèÿÑÿ2õÿçÿÏÿïÿÚÿ!4498âÿ26çÿèÿçÿèÿÒÿ326Îÿ:2ïÿ!ÖÿÔÿïÿÙÿ×ÿÐÿáÿàÿ37þÿÈÿ333837þÿôÿ4òÿ02êÿÕÿ9Þÿéÿçÿ2Øÿ8:ÑÿèÿßÿñÿÊÿ47ôÿ78:ÍÿÌÿôÿËÿ46 2òÿòÿòÿòÿòÿòÿ2ìÿôÿïÿ3æÿôÿ25Ôÿ8þÿ5×ÿþÿÞÿÛÿôÿôÿôÿ:ôÿ:ôÿ:ôÿ:ôÿ:ôÿôÿ:ôÿ:ôÿ:ôÿôÿôÿôÿôÿØÿ8Íÿôÿìÿ33ëÿ283Óÿþÿ9ñÿÝÿôÿôÿôÿôÿôÿôÿôÿôÿ5ÌÿØÿ73òÿ63ëÿëÿôÿéÿ9ãÿÜÿ5ôÿßÿüÿýÿûÿùÿúÿøÿ)*$%9Éÿ&+,-(/.ôÿ57þÿ399ÜÿÜÿÜÿÜÿóÿôÿÜÿ999ôÿ95Üÿ2222ôÿ72'+399ôÿôÿóÿôÿ32Üÿ3393ôÿóÿ399þÿ( þÿFþÿXþÿ9þÿþÿGw5;ACEwYBV*-T"$<=:?@67M•£¤¥¦W,.1w49UwHL	\>xD8TPRZ–±—˜™š›œ© {°&+/w3#%
}~€‚ƒ„…†‡ˆ‰“”UT¢§¨©©¡2
‹ŒŽŠ‘NQŸžwª¬|0[^zjq£’S­¯]_`aydefgklmznp®shio«crtzvubÿÿÿÿbad bdtydimension table overflowwhiles, fors, etc. too deeply nestednon-constant case expressioncase not in switchswitch table overflowduplicate default in switchdefault not inside switchswitch table overflowduplicate case in switch, %dyacc stack overflowsyntax errorfunction level error$%dFAKEstructure typed union member must be namedfield outside of structureillegal field sizefield outside of structurezero or negative subscriptfunction declaration in bad contextold-fashioned initialization: use =nesting too deepillegal breakillegal continuestatement not reachedvoid function %s cannot return valueloop not entered at toploop not entered at toploop not entered at topprecedence confusion possible: parenthesize!old-fashioned assignment operator& before array or function: ignoredstructure reference must be addressableundeclared initializer name %sÿÿÿÿZXø^øcøjøqøzøø‡øŽø’ø˜øŸø£ø©ø±ø¹ø¿øÃøÌøFIELD[%d]SNULLAUTOEXTERNSTATICREGISTEREXTDEFLABELULABELMOSPARAMSTNAMEMOUUNAMETYPEDEFFORTRANENAMEMOEUFORTRANUSTATIC$_0 
"'`(2)3{4}5[6]7*?:+	-
/<%>&|^!L~M,88;9. D<
S>U=::ÿÿÐýÔýÙý)ßýäý/éý*òýùý.þ,þþ'þ1þ-þþ'þ%,þ&/þ3þ8þ$?þHþ(OþVþ0]þcþjþ
rþ{þþ†þ+Œþrwccom:can't open %s
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890123456789abcdefABCDEF 	
01234567abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789	
unexpected EOFnewline in string or char constantnon-null byte ignored in string initializerempty character constanttoo many characters in character constantunexpected EOFillegal character: %03o (octal)illegal hex constantnewline in BCD constantBCD constant exceeds 6 charactersgcos BCD constant illegalambiguous assignment: assignment op taken=<%c illegal=>%c illegalyylex error, character %03o (octal)out of switch in yylexbad asm constructionbad AR_?? actionRan out of memory (savestr)ran out of memory (hash)ran out of hash tablesasmautobreakcharcasecontinuedoubledefaultdoexternelseenumforfloatfortrangotoifintlongreturnregisterswitchstructsizeofshortstatictypedefunsignedunionvoidwhiledefid calltyreducedefid( %s (%d), , %s, (%d,%d) ), level %d
	modified to , %s
	previous def'n: , %s, (%d,%d) ), level %d
declared argument %s is missing	previous class: %s
redeclaration of: %sredeclaration of %s	new entry made
void type for %s	dimoff, sizoff, offset: %d, %d, %d
parameter stack overflowbcsave errorparameter reset errorswitch errordclargs()
	%s (%d) 
dclstruct( %s ), szindex = %d
??gummy structure memberillegal zero sized structure member: %szero sized structure	dimtab[%d,%d,%d,%d] = %d,%d,%d,%d
	member %s(%d)
redeclaration of formal parameter, %scompiler takes alignment of functioncompiler takes size of functionunknown sizeinitialization alignment errorinoff errorbeginit(), curid = %d
instk((%d, %o,%d,%d, %d)
no automatic aggregate initializationinsane structure member listendinit(), inoff = %d
too many initializersempty array declarationbad scalar initializationcannot initialize extern or union} expecteddoinit(%o)
illegal initializationillegal {irbrace(): paramno = %d on entry
too many local variablesStructure too largetoo many local variablesillegal field typefield too bigzero size fieldstructure too largestructure too largenidcl errorillegal type combinationtymerge: arg 1array of functions is illegalfunction returns illegal typea function is declared as an argumentfunction illegal in structure or unionfunction has illegal storage classillegal use of fieldillegal classillegal classillegal classillegal register declarationillegal classillegal classfortran declaration must apply to functionfortran function has wrong typeillegal class: %dSymbol table full	nonunique entry for %s from %d to %d
lookup( %.8s, %d ), stwart=%d, instruct=%d
symbol table fullsymbol table full%s undefinedremoving %s from stab[ %d], flags %o level %d
symbol table full%s redefinition hides earlier one	%d hidden in %d
unhide uncovered %d from %d
unhide failsbuildtree( %s, %o, %o )
constant argument to NOTconstant in conditional contextdivision by 0.illegal lhs of assignment operator%s undefinedmember of structure or union requiredmember %s==%s?
illegal member use: %snonunique name demands struct/union or struct/union pointerstruct/union or struct/union pointer requiredundefined structure or unionillegal member use: %sillegal indirectionunacceptable operand of &assignment of different structurestype clash in conditionalillegal functionillegal functionother code %dchkstr( %s(%d), %d )
undefined structure or uniongummy structureillegal member use: perhaps %s.%s?division by 0division by 0illegal comparison of enumsenumeration type clash, operator %spointer/integerstructure pointerarray sizepointerillegal %s combination, op %sundefined bit field typepointer requiredillegal oconvert: %dillegal pointer subtractionillegal types in :void type illegal in expressiontymatch(%o): %o %s %o => %o
constant expectedconstant too big for cross-compileroperands of %s have incompatible typessizeof returns 0	    %o) %s, %d, %d, , %d, %d
statement not reached.L%dPQTURSXYVW& error8h
Ð
	bra	.L%d
	bra	.L%d
	.even
	.text
	.data
locctr: STAB unusedillegal location counter.L%d:
	movl	d0,a0
	movl	#.L%d,a1
	movl	a0@+,a1@+
	movw	a0@+,a1@+
	movb	a0@+,a1@+
	movl	#.L%d,d0
	.bss
	.even
.L%d:
	.=.+%d.
	.text
	movl	#.L%d,a0
	jbsr	mcount
	.data
.L%d:	.long 0
	.text
	link	a6,#-_F%d
	moveml	#_S%d,a6@(-_F%d)
	mov%c	a6@(%d),%s
bad argument| A%d = %d
	.globl	%s
%s:

	.byte	,%d
	.long	0
illegal field type%s, line %d: wCannot open temp filerLost temp file	subl	#%d,d0
	cmpl	#%d,d0
	bhi	.L%d
	addw	d0,d0
	movw	pc@(6,d0:w),d0
	jmp	pc@(2,d0:w)
.L%d = .
	.word	.L%d-.L%d
.L%d:	cmpl	#%d,d0
	beq	.L%d
	bgt	.L%d
	cmpl	#%d,d0
	beq	.L%d
/tmp/pcXXXXXXbad conversionincode: field > int	.word	%d
	.long	%d, %d
	.long	%d
	.word	%d
	.comm	%s,%d
ÿÿÿÿðõû#)08?FQPUTSRYXWVbad option: %cstore called on:
SZEROSONESMONESPECIAL+%d|order( %o,  )
order( %o,  ), cookie , rewrite %s
no table entry for op %sillegal initializationexpression causes compiler loop: try simplifying	    %o) %s %s  size=%d align=%d, , NOPREFMUSTDO PREF %s, SU= %d
SANYSAREGSTAREGSBREGSTBREGSCCSNAMESCONSFLDSOREGSTARNMSTARREGINTEMPFORARGSWADDØ	Üàãçë=ï?óA÷Cúÿÿÿÿýþ

"%(+
Ê  @.9DOZep{†‘QPQQSUVSUWUSXUSYWYVWYWYWXYWYœ<¡>¦«=±?·½<Ã>ÉÏ=Ö?Ýäéî<ó
ø
ý	=	!(=/|	line %d, file %s
.L%d:	moveml	a6@(-_F%d),#%d
	unlk	a6
	rts
_F%d = %d
_S%d = %d
| M%d = %d
	.globl	fltused
%sfno hoptab for %s	jbsr		jbsr	@	movl	,a0
	jbsr	a0@bad subroutine namebwl	clrl	%s
sp@-Illegal ZT type conversionIllegal ZU%dNot a structureSTASG badSTASG-r	movw	AR,	movl	AR,AR
illegal zzzcode	movl	%s,%s
	movl	%s,%s
%d%sillegal conputinsput#%sbad arg temp%s@()illegal upper address##%sbad arg tempa6@(%d)%s@()@+-illegal address%d%s%s+%d	%s	#%d,sp
addqladdl	bra	.L%d
bad conditional branch: %s	cmp	AL,AR
	tst	AR
	cmp	UL,UR
	tst	UR
Bad address for hard opsfloatfixbad special shapeaddsuborandeormuldivdivslsrd0d1d2d3d4d5d6d7a0a1a2a3a4a5a6sp	beq	.L%d
	bne	.L%d
	ble	.L%d
	blt	.L%d
	bge	.L%d
	bgt	.L%d
	bls	.L%d
	bcs	.L%d
	bcc	.L%d
	bhi	.L%d
lmulldivlremalmulaldivalremulmululdivulremaulmulauldivaulremfaddfsubfmulfdivfnegfnegafaddafsubafmulafdivafaddfafsubfafmulfafdivf'store finds both sides trivialrallo( %o, %o )
setbin can't deal with %sbad setstrbad incr rewrite bad -= rewrite.L%d:
stuck starg	movl	AR,Z-
	movw	AR,Z-
 !@A€ @tshape( %o, %o), op = %d
ttype( %o, %o )
bad setrew%d%d%c%d%dbad getlr: %c^dkqwusable asked about nontemp registerrfree( %s ), size %d
register overfreedillegal freeregister overfreedrbusy( %s ), size %d
illegal register pair freedRLEFTRRIGHTRESC1RESC2RESC3RNULLRNOP|reclaim( %o, ,  )
illegal reclaimcannot reclaimfaulty register movepotential register overwritepotential register overwriteregister allocation errorNAMESTRING^REG_OREGICONFCON`CCODES
U-
U*U&HUCALLKUFCALLL!M~lFORCEnINIThSCONViPCONV+h+=i!-(	-=)!*	*=	)&h&=i ?:&&||8,;,OP:=	</ˆ	=/=‰)>%ˆ?%=‰ @<<A<<=	0B>>C>>=	0|h|=i ^H^=I N++	O--	E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN	 oCAST	 %GOTObSTASG	cSTARGdSTCALLfUSTCALLÿÿÿÿs y ~ ƒ ‰  ’ ˜ Ÿ ¥ ­ ´ º À Ç Ð Ö Ø œ:$
too many errorscannot recover from earlier errors: goodbye!
compiler error: 
warning: 
out of tree space; simplify expressionwasted space: %ofreeing blank tree!undeffargcharshortintlongfloatdoublestrtyuniontyenumtymoetyucharushortunsignedulong??PTR FTN ARY %sout of temporary string spaceout of memory (tstr):#Â
×€$2:#Â
 €/2:#Çd€ÇB2:#Â
×Ê
×P2:Â
 Ê
 ^2:Â
Ê
 w2:	ÇÊ
Ç„2:€’2:Ÿ2:Ê
ù2
&Ç	B3Ê
Q3 Â
×R3 Ç]3&€Ç	k3&d€Ç	v3&Ê
Ç	„3Ê
 	’3Ê
	«38Ê
Ǹ3 Ê
ÇÆ3 ŠÔ3Ê
ê3Ê
 ÷3 D4 Ê
D4 Ê
)4 Ê
	B4 Ê
	d4 Ê
€	4 Ê
±4 Ê
 Ç4 ÇÊ
Çà4 Ê
ð4 B
Ç€Ç5 Ê
 Ê
 5`f5
Çv5MÇ5NÂ
Çf€ÇŒ5OÂ
Çf€Ç©5NÂ
Ç€ÇÆ5OÂ
Ç€Çâ5NÇf€Çþ5OÇf€Ç6NÇ€Ç86OÇ€ÇT6@e€Pp6 @e€6@e€P‘6 @e€¢6"Â
Çf€Ç²6(Çf€ÇÁ6"ÇÊ
ÇÐ6ÇÊ
ÇÞ6"Â
ÇÇì6	"Â
Çf€Çú6	(Çf€Ç	7	"ÇÊ
Ç7	ÇÊ
Ç&7	"Â
ÇÇ47"Â
Ç€ÇB7"Â
ÇÇP7"ÇÂ
Ç^7"Â
Ç€Çk7"Â
ÇÇx7"Â
…7"Â
’7"Â
Ÿ7Â
¬7€Â
×7="Â
8="Â
8="Â
:8=Â
W8=€Â
‚8?Â
²8?Â
Ñ8?Â
÷8?Â
9?€Â
Q9"f€ÇŠ9"@€Ç˜9"Ç¢9"€f€Ç°9"Ê
€Ç¾9"€ÇÈ9HÈÖ9hDDÚ9hÇ€Û9hDê9hDû9hü9hD:hD:h€Ç#:hD2:hÊ
FƒC:hÊ
 F:hÊ
 	G:h Ê
 ]:b@ˆs:b@v:b@ˆy:n€Dˆ:n€“:n€ž:
@
©:N@Nª:O@N«::@:¬:b@b­:
@®: ¯:@L°:;@;±:n@n²:@
³:
@´:@µ:aaaaaaaa¶:	clrZB	AL
	clrl	AL
	clrl	UL
	moveq	AR,AL
	movZB	AR,AL
	movl	AR,AL
	movl	UR,UL
	movl	AR,AL
	movZB	AR,AL
	andY	#N,AL
F	movl	AR,sp@-
	movl	#H,A1
	lslY	A1,AR
	andY	#M,AR
	andY	#N,AL
	orY	AR,AL
F	movl	sp@+,AR
	movZB	AR,A1
	movl	#H,A2
	lslY	A2,A1
	andY	#M,A1
	andY	#N,AL
	orY	A1,AL
	movZB	AL@,A1
	tstZB	AR
	cmpZB	#0,AR
	clrZB	A1
	moveq	AR,A1
	movZB	AR,A1
	movl	AR,A1
	movl	UR,U1
	movl	AR,A1
	movZB	AR,A1
	movZB	AR,A1
	extl	AR
	movl	AR,A1
	movl	AR,A1
	movl	AR,A1
	movl	UR,U1
	pea	AR@
ZP	movl	AR,Z-
	movw	AR,A1
	movl	A1,Z-
	clrl	A1
	movw	AR,A1
	movl	A1,Z-
	movb	AR,A1
	extw	A1
	extl	A1
	movl	A1,Z-
	clrl	A1
	movb	AR,A1
	movl	A1,Z-
	clrl	Z-
	movl	AR,Z-
	movl	UR,Z-
	movl	AR,Z-
	cmpZL	AR,AL
ZI	cmpZL	AR,AL
ZI	cmpZL	AR,AL
ZI	movl	UR,Z-
	movl	AR,Z-
	movl	UL,Z-
	movl	AL,Z-
	jbsr	fcmp
	addl	#16,sp
	tstl	d0
Z0ZI	moveq	#1,A1
ZN	negZB	AL
	notZB	AL
F	movZB	AL,A1
	addqZB	AR,AL
F	movZB	AL,A1
	subqZB	AR,AL
F	movZB	AL,A1
	addZB	AR,AL
F	movZB	AL,A1
	subZB	AR,AL
F	movZB	AL,A1
	addqZB	AR,AL
F	movZB	AL,A1
	subqZB	AR,AL
F	movZB	AL,A1
	addZB	AR,AL
F	movZB	AL,A1
	subZB	AR,AL
	lea	AL@(ZO),A1
	pea	AL@(ZO)
ZP	lea	AL@(ZM),A1
	pea	AL@(ZM)
ZP	addqZB	AR,AL
	addqZB	AR,AL
	addZB	AR,AL
	addZB	AR,AL
	addZB	AR,AL
	subqZB	AR,AL
	subqZB	AR,AL
	subZB	AR,AL
	subZB	AR,AL
	subZB	AR,AL
	eorZB	AR,AL
	eorZB	AR,AL
	OIZB	AR,AL
	OIZB	AR,AL
	OIZB	AR,AL
	muls	AR,AL
	mulu	AR,AL
	mulu	AR,AL
	extw	AL
	movb	AR,A1
	extw	A1
	muls	A1,AL
	andw	#255,AL
	clrw	A1
	movb	AR,A1
	muls	A1,AL
	extl	AL
	divs	AR,AL
	andl	#65535,AL
	divu	AR,AL
	andl	#65535,AL
	divu	AR,AL
	extw	AL
	movb	AR,A1
	extw	A1
	divs	A1,AL
	andw	#255,AL
	clrw	A1
	movb	AR,A1
	divs	A1,AL
	extl	AL
	divs	AR,AL
	swap	AL
	andl	#65535,AL
	divu	AR,AL
	swap	AL
	andl	#65535,AL
	divu	AR,AL
	swap	AL
	extw	AL
	movb	AR,A1
	extw	A1
	divs	A1,AL
	swap	AL
	andw	#255,AL
	clrw	A1
	movb	AR,A1
	divs	A1,AL
	swap	AL
	aOIZB	AR,AL
	aOIw	AL
	aOIZB	AR,AL
	lOIZB	AR,AL
	lOIw	AL
	lOIZB	AR,AL
ZC
	andl	#255,AL
	andl	#65535,AL
	extw	AL
	extw	AL
	extl	AL
	extl	AL
	andl	#255,AL
	andl	#65535,AL
ZT	movl	AL,A1
	clrl	U1
	clrl	Z-
	movl	AL,Z-
ZSZSZS	movl	AR,A1
	.long	CL
	.word	CL
	.byte	CL
help; I'm in trouble
+Xà$œB.Ø6ø?F\-M°UUpu]œzd´ƒlÀBrÄBxä‰À¡Š·’„Æšè¢pΩèÙ± Þ¹â$Nɨ¨NØŒ¤Nç´Nö‚ Qý°NZ¬Nr”g—˜g&Ãœg0Æ g;ǤgD.(hJ´hiTÆli\Úìid
ìmlÀ^Juþ6J~â&H…‚.JFJ–°VJž™NJ¦:&J¯~J¸†HÈH×þIå•ÞIìþKôÔÎIúÛÖI½ÆI	E¾IN¶I?®IËnM'AöK/1žI6ÂfM?[^MHaîKP–IWÊVM]›æKeêNMkÍFMt¾>M}ª6M†$.MŽ°&M—!MŸ’M¨M°jM¹œþLÁFÖKÊîLÑ&Hà•fIêCVIõ±vIÿ>NIÜnI¸^IÒ¶K Á.I&¼æL.Ö¦K6ö&I=¤6IFœIL¦ÖLR(öLY`ÎL`žKf–Kl‚ŽKu†K}»IƒAvK‹~K’ÌI™ÂIŸ‘þH¥•ÖM¬¤ÆL²x¾LºÏ®LÁÉÎMÇÅöHΠîH×ì>Iߪ¶MåæHëu¦IóyžLú–LñÞH	’ÖH´®M3ŽLŒÞM$v†L+†I1¼ÎH7}nK=yfKCÐ^KM­VKWcFK^ÆFIgÇ®Hp³>Ky"vLƒõ6Kà.K—LžHŸ„¾H§p¶H¯`îI·P¦HÀˆÆHÉBKÒvþJ؇–HßÕŽIå|îJ좎Hóð~IùeæJÞKxÞJ²®KˆnL6ÖJ'7ÞL0zfL6«¶L>[öJFNÎJM³ÆJT£¾J[¤¶Jd†Hjt®Jq+¦JxžJŽJ‡†J–J™M–J¡f>Jª=¦M° æI¶Ï~H¾„žMÅÚVLÍÆNLÕ»–MÝzŽMäªNKîê~JøªÎKò&K2vJòÆK K+‘K6ëK@*nJJê¾KTn^LZfFL`XvHfânHkŒÆMqľMwRJ†.fH;^H”fJžwöI¥,VH¬
NH³èFHºû.LÁk&LÉÏ>HÎtLÔqLÚoLàO>Lè	LñÝ~Lù?¦LW6L͆Mé6Hÿ.H"³~M'ØvM.H4L>~àD	2Ì:N $WüÄ`	#Ð:h	dÔ:oÇXuÚn|Sr‚`ÚŠ:ˆhÌИ	¹Ø: 	Ü:¨…°áü÷¸	ZÀ	6¬[È	ª°[Ñ	D´[Ú	*¸[ß%pèÔñ#ÚuøBÚ	"¼[	€Ä[Nž{~„{ôÛ#ê`+d¶4dú;ìàChàJú”éR[øëYlì_Ðíe%4ïl˜ñs	D”cx¨üó€Ÿô‰ëô”²xŸ“¨¨pb<±PB¸	;ìeÂ	àðeÊ+–LÓÛ\-Ú	Ìôeã	´øeìîv5ô`~üòz	ºK	ø9	ÖN7		üe)		@f1	t@8:	"8B		FfL	DÎ+U	˜R]	ƒÒÚe		Þfk	Ë@Is	íz<{	Œ"?„	Ž0K‹	·>O“	aVD›	<0C¤	•®G­	Õ<G¶	pS¿		<$üÈ		~(üÐ	ç\6Ù	Ösà	øœzè	³°Uó	/ä÷ü	®ø÷
	Ù,ü
	=0ü
		4ü
§<n$
Xo+
-ð÷2
Þ„r:
½hC
	8üL
ìˆS
	J<üY
¡ÚAa
ÿ€÷i
	§Düp
	åLüz
	ý¤þƒ
	¨þ‹
	’¬þ”
	’°þ›
ëè÷£
	´þ«
	«¼þ±
áì÷¸
­ô÷¿
¯ØÈ
ûÔøÑ
	T|*Ù
	÷|.à
kè
	ç„.ð
hèÙø
	Àˆ/ÿ
lþ”þ+LkX‹\'ä‰/ð¤7*Û>ÒÜF€p<O™(Xmž~b‚þk(sÔØø{	ÈŒ/	1ŠK†*“JŽš9C£{«û¨²øàù»)´'ÂdR,Èð¬‰Ó	”1Ü	Ò˜1æ	†œ1ì	;Œ2õ	ñô3ûÝŸN{`OB5ë`H%axQ0czT6«®{>_¬ÛFå‡O¼ÐzYK¶|a{ò<iy¢=p#¦w2>€ívˆ‰;p‘ê>›O˜þ£	8ø3«dœþ´Ã@»‘®~Ã¬\‡ËèFÔ7è‡Ý`ˆäbHëUºò ‰úK"‰
ÎÈr
ƒ.Ü
‚M
+
‡$
ŸÄR,
å¢~3
»¦~;
<*UC
ª@TM
ª~T
	äü3Z
	s¼5`
q”ah
ÓVoo
ë`jy
ú~d
ÒbiŠ
´l“
^kœ
j®j¦
òƒ®
ˆ`¶
lŒf½
‰ê_Æ
4ZfÍ
óD‡Õ
îhÝ
9iä
Úiî
‹LÛö
ç r.~s		ÜõĉaHtýĈ'~Ý-ÊÔ4žè
;¥puDèì
LÃú†UÍ|z\VJzd	ï|7mu+}	g€7†h—˜– ®à‹¨	µ„7²Ä¨º“x‹Â2¾É‰Ò2^Ù[¨‚äH´ƒêÍ‚‰ôG‹ÿ	šˆ7	mŒ7	÷7D!7H*L2	i”7:	˜7B	/œ7K	ß 7T	e¤7]œPfTo	|¨7wÒpÎ~âɆ/ Ž˜<—7D K@¨Ëœ°ôÀ¡¸XªÁò6¶ËŒÒ)²ÕÛ±¾Ù㻨ì	ά7ö	Gü7üþü¡…`ŒƒìŒîú±ÒØ"¥·+Ù2ã\:àŠ¡AzÜ–HñOhŽW	u8a	i8h¶„pÇ¢½wo¦±Š®Êˆc„ÆÄ\™™ºìÄ¢¸°©üIJ2Ö¿»ÖR¯Ä^>¯Î¿0À× òÁßÒÂèä@ÂðÂpÀøæÞ±“·^¤˜£d˜ ‘™(ùv·0ð 8¸­@V:ŸFÊ>©N¹¦ U3,©[é¸cx²¸k$Lt…Ö¡}7P…œ8Ž›£—mè 	c8¨	ñ8°à(¶‚Z£¿3ô®ÅZÞÍ̈d«ÔÌÜ:¨ã,ì¯D©õÿJ©þ=èªï©!Ú©
$ªWƪ'sP«/`¸«7’È«>;öÅGÅP¨ʯYé\e„pÑüx%ä±R<´‹d㵡Ú:µ©°j¶²@L¸·RL½¿ä6ÀÈK@Ñ	T8Ø	P8à	Ý8ä	•8êÀÈñ	…\8ú	/d8µ !,HQêÎ	¿$:	„:"	›ˆ:(	Œ:.	¬:4èèÐ=¼fÐGHÀÑOöÒX‡BÓ`†ìÓgô>ÔnüJÕw	Õ”:©܉Ô,‘	Vœ:›crt0.oexec_startcgram.o_fake_fakenamexdefs.o_ccnamesscan.opftn.otrees.ooptim.ocode.olocal.o_inwd_wordreader.olocal2.oorder.omatch.o_mamaskallo.ocomm1.otable.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_tstrused_tstrbuf_curtstr_yylval_yyval_mkty_block_bdty_cerror_bcon_dstash_curdim_dimtab_savebc_psavbc_asavbc_brklab_contlab_flostat_swx_resetbc_addcase_optim_uerror_swp_swtab_getlab_deflab_tfree_adddef_swstart_swend_yyexca_yyact_yypact_yypgo_yyr1_yyr2_yychk_yydef_yyv_yychar_yynerrs_yyerrflag_genswitch_yyparse_yyerror_yylex_curclass_blevel_tymerge_defid_reached_retstat_ftnend_bccode_locctr_types_dclstruct_rstruct_instruct_stwart_bstruct_moedef_strucoff_savestr_lookup_werror_stab_falloc_ftnarg_beginit_nidcl_uclass_doinit_endinit_irbrace_ilbrace_clearst_autooff_regvar_dclargs_ecomp_branch_buildtree_brkflag_retlab_curftn_idname_lineno_makety_icons_hflag_doszof_notlval_lastcon_ctype_dcon_getstr_ftitle_ftnno_paramstk_paramno_argoff_minrvar_inoff_xdebug_strflg_node_cflag_pflag_scnames_asm_esc_yytext_lxgcp_mainp1_lxmask_caloff_offsz_ddebug_idebug_bdebug_tdebug_edebug_p2init_lxinit_tinit_mkdope_yyaccpt_nerrors_ejobcode_lxenter_lxmore_lxdope_lxcp_lxmatch_lxtitle_lxstr_putbyte_bycode_lxcom_lxrdope_lxres_hash_isitfloat_savetab_saveleft_htab_instack_pstk_tprint_fixtype_fixclass_psave_oalloc_mknonuniq_hide_efcode_tcheck_cendarg_defalign_bfcode_talign_tsize_fldal_inforce_vfdzero_zecode_vfdalign_ibseen_iclass_ilocctr_instk_defnam_incode_gotscal_fincode_cinit_upoff_fldty_noinit_commdec_eprint_fwalk_tyreduce_cisreg_relook_aobeg_aocode_unhide_movestab_aoend_opst_dope_conval_opact_pconvert_chkpun_convert_tymatch_ptmatch_oconvert_clocal_chkstr_stref_strargs_combo_offcon_bpsize_psize_econvert_talloc_moditype_prtdcon_walkf_ecode_p2tree_exname_tstr_rbusy_oflag_fortarg_revrel_andable_nncon_ispow2_proflag_proflg_strftn_tmpfile_outfile_lastloc_crslab_p2bend_usedregs_rnames_p2bbeg_where_tmpname_dexit_genbinary_cast_isitlong_p2compile_nrecur_lflag_nospflag_e2debug_x2debug_udebug_tmpoff_maxoff_maxtreg_stotree_stocook_baseoff_maxtemp_fldtyp_allo0_setrew_rdebug_radebug_t2debug_sdebug_odebug_lineid_e2print_myreader_delay_reclaim_allchk_setregs_deltrees_deli_eobl2_delay1_delay2_codgen_ncopy_deltest_tcopy_cnames_canon_store_order_prcook_callflag_fregs_rcount_rallo_nextcook_match_tshape_cbranch_get2lab_cbgen_def2lab_offstar_gencall_genscall_setincr_setstr_setasop_setasg_setbin_lastchance_stoasg_markcall_constore_stoarg_mkadrs_negrel_adrput_ffld_rewfld_oreg2_szty_notoff_sucomp_maxtoff_cntbits_ioptab_fltused_hopcode_rstatus_brnode_brcase_toff_zzzcode_acon_getlr_conput_expand_rmove_respref_callreg_shltype_shumul_flshape_shtemp_spsz_indexreg_adrcon_insput_upput_argsize_genargs_popargs_ccbranches_lbranches_opfunc_hardops_hardconv_shortconv_floatconv_optim2_special_zum_mkrall_niceuty_crs2lab_fldsz_fldshf_ty_busy_ttype_rwtable_opptr_table_rtyflg_allo_resc_maxa_mina_maxb_minb_freereg_freetemp_usable_shareit_ushare_recl2_rfree_rwprint_lastfree_tfree1_indope_itstrbufpen_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scasumacc/cceun/dl68   555      0     12       23007  3472711343   7127 €,<H0202ÿÿÿÿÿÿÿÿh€DL680À¨8KûŒ1.01 (UNIX ld)
	$«
LIBCSHARE_001$k,¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$°
1&
Ô~Ý]ûï
.Ÿïnûïî-Ô~ûï¼/ÝÝ]ûïè-úlïÃ-ݬݬݬûï;Ô~ûï/Â^ï¬PöP­ÿï¬PöP­þ‘­ÿ		˜­ÿPÀ7P˜­ÿPÀ0PöP­ÿ‘­þ		˜­þPÀ7P˜­þPÀ0PöP­þ˜­þ~˜­ÿ~ßï}ÝïCûïö/ЬPïPPЬQïQQÊÿÿÿQÈQPx¬QÊÿÿÿQÈQPx¬QÈQP˜¬PÀPï˜P~ûïIÿÿÿݬßïÝïÛûïŽ/ÔïòѬѬ˜¬PÁP~ûï¯ÿÿÿxð¬P˜P~˜¬PÁP~ûï•ÿÿÿxø¬P˜P~ûï…ÿÿÿ˜¬~ûïzÿÿÿЬP׬ÕP%šï‘PÒP~ûï¾þÿÿßï™
ÝïVûï	/ЬPÖ¬˜`~½Â^Ô­ü>íü¬PÑP íü¬PÐ PÐP­øݬÝPݬ˜ï
~ûïÿÿÿÀ­ø¬À­ø¬À ­üÑ­ü¬»Â(^Ô­ülíü¬PÑP íü¬PÐ PÐP­øݬÝÝPß­Øûï.ÑPßïñ	ßïøKûï_.Ýûï†-ݬÝ­øؘ߭ï‘	~ûï™þÿÿÀ­ø¬À ­üÑ­ü¬‘¬a‘¬z	˜¬P P/‘¬A
‘¬Z˜¬P‘¬0‘¬9_Ð.PÐ$PÂ^Ь­èÔ­ä1”ݬÝÝß­øûïÛ-ÕP1‰À­ä­èЭèP­ø ЭèP­ù Ý­üûï¤ýÿÿЭèQÐP¡À­èÀ­èÖ­ä×¼ЬPРQÖ šaP
ݬûïä,öP½èÔÝ­èûïÌ/À­èPÁP­èé­è”½èÀ­èÑ­äïj	1_ÿì­èPÐP¼Â^Ô­ô1ÅݬÝÝß­øûï$-ÕP1ËÔ­ð5ݬûïv,öP­ïNÑ­ðH˜­ï~ûï±þÿÿÅ­ôQÀ¬QЭðRöPBaÖ­ð×¼ÆЬPРQÖ šaPÀÅ­ôPÀ¬PЭðQö A`Ö­ðÑ­ðæ#×¼ЬPРQÖ šaP
ݬûïû+öP­ï•­ïØÝ­üûïtüÿÿÅ­ôQÀ¬QÐP¡Ö­ô‘ï¤mšÅP2UPÑ­ôP1ÿÅ­ô¼ЬPžÎìß^2­øѬßï¦ßï¡Iûï,Ýûï/+Эô1äЭôPÐ@¼P‘`-1»Ð­ôPÐ@¼P˜ PÑPTÑPoOÑPscÑPv*1œÐ­ôPÖ­ôÑP¬ðß­øßïPЭôPÝ@¼ûï¶,uЭôPÐ@¼P ïÍbЭôPÖ­ôÑP¬UЭôPÝ@¼ßï´>ЭôPÐ@¼P˜ PÂ0PöPïЭôPÐ@¼P˜ PÂ0PöPï|ЭôPÝ@¼ßïhûï-Ö­ôÑ­ô¬1ÿßïºßïHûïï*ÐPï2Qßï ßï,ûï#-ßï‘ßïûïÀ*ÐPï"ßïßïqßï?Hûï¦*ÝûïÍ)•ïí@ßïbßïßûïz*ÐPïÁ/ßïÉßïBßïùGûï`*Ýûï‡)ÞïÑGïÝï†ÝÝ ßï\ûïK*ÑP"ßïrßïßï®Gûï*Ýûï<)Ñï("ßïCßïôßïGûïæ)Ýûï
)Эø­üÝïøÝ­øÝïûïûÿÿÀïâ­øÝÁ ï×~ÝïìûïÓ)ÝïÇÝ­øÝïÖûïáúÿÿÀï±­øÝÁ ï¢PÁïŸP~Ýï¯ûï–)Õï’1
‘ï§mZßÍôïÝï‰ßï¯ûïVûÿÿÝÍôïûï;ùÿÿÐPÍðïÀïR­øÝ­øÝßÍðï˜ï]~ûïeùÿÿÀ­øÝÍôïÝ­øßïh1ŸßÍôïÝï/ßÍðßûïºûÿÿÐPÍìßÝÍôï‘ï%m2ºPÐðPÝPÝÍìßûï¸ùÿÿ‘ïm2ºPÐðPÝPûïŸøÿÿÐPÍìï‘ïÚm2ºPÐðPÁÍôïP~ûïuøÿÿÐPÍðïÝÝpßÍìïûïUùÿÿÕï‰	ÐïPЭüPÝPÝݘï~~ûï‚øÿÿ%c%cS%d
Read error
Usage: dl68 infile [ > outfile ]
%xr.68rdl68: Can't open %s
wdl68: Can't open %s
dl68: %s wrong format
dl68: %s not proper b.out file
+Xâ$4-¨¨4<Œ¤4K´4Z‚ 7a°4jZ¬4zr”Mƒ—˜MŠÃœM”Æ MŸÇ¤M¨.(N®´hO¸ÆlOÀÚìOÈ
ìSÐÀ^0Ùþ60ââ&.é‚.0ñF0ú°V0™N0
:&0~0†.,.;þ/I•Þ/Pþ1XÔÎ/^ÛÖ/e½Æ/mE¾/uN¶/|?®/ƒËn3‹Aö1“1ž/šÂf3£[^3¬aî1´–/»ÊV3Á›æ1ÉêN3ÏÍF3ؾ>3áª63ê$.3ò°&3û!3’33j3œþ2%FÖ1.î25&.D•f/NCV/Y±v/c>N/lÜn/t¸^/|Ò¶1„Á./Š¼æ2’Ö¦1šö&/¡¤6/ªœ/°¦Ö2¶(ö2½`Î2Äž1Ê–1ЂŽ1Ù†1á»/çAv1ï~1öÌ/ýÂ/‘þ.	•Ö3¤Æ2x¾2Ï®2%ÉÎ3+Åö.2 î.;ì>/Cª¶3Iæ.Ou¦/Wyž2^–2eñÞ.m’Ö.s´®3y3Ž2ŒÞ3ˆv†2†/•¼Î.›}n1¡yf1§Ð^1±­V1»cF1ÂÆF/ËÇ®.Ô³>1Ý"v2çõ61ñà.1ûLž.„¾.p¶.`î/P¦.$ˆÆ.-B16vþ0<‡–.CÕŽ/I|î0P¢Ž.Wð~/]eæ0dÞ1lxÞ0t²®1{ˆn2‚6Ö0‹7Þ2”zf2š«¶2¢[ö0ªNÎ0±³Æ0¸£¾0¿¤¶0Ȇ.Ît®0Õ+¦0Üž0ãŽ0ë†0ó–0ýM–0f>0=¦3 æ/Ï~."„ž3)ÚV21ÆN29»–3AzŽ3HªN1Rê~0\ªÎ1fò&1p2v0zòÆ1„1‘1šë1¤*n0®ê¾1¸n^2¾fF2ÄXv.Êân.ÏŒÆ3Õľ3ÛR0ê.f.ñ;^.øf0wö/	,V.
N.èF.û.2%k&2-Ï>.2t28q2>o2DO>2L	2UÝ~2]?¦2hW62o͆3wé6.~ÿ..†³~3‹Øv3’.˜L¢~ˆ¨	4Ø°Á·¾½
Ä	¼øÌ	güÕ	Ý
áÃî,ô|XüqÂ	8 
.øY0Rº8B
@[ˆH’ÒPLŽWcrt0.oexec_startdl68.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_filhdr_Sdata_Send_vflag_infile_outfile_infilename_outfilename_syms_puthex_reverse_checksum_checkout_print_exormacs_record_outbuf_outbin_macify_rbuild_buildÂf3£[^3¬aî1´–/»ÊV3Á›æ1ÉêN3ÏÍF3ؾ>3áª63ê$.3ò°&3û!3’33j3œþ2%FÖ1.î25&.D•f/NCV/Y±v/c>N/lÜn/t¸^/|Ò¶1„Á./Š¼æ2’Ö¦1šö&/¡¤6/ªœ/°¦Ö2¶(ö2½`Î2Äž1Ê–1ЂŽ1Ù†1á»/çAv1ïsumacc/cceun/ld68   555      0     12       42506  3472711343   7134 €,<H0202ÿÿÿÿÿÿÿÿh€LD680ÀnÕpkûŒ1.01 (UNIX ld)
ÿ$«
LIBCSHARE_001$k(¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ èý<1&
Ô~Ý]ûï
&Ÿï>ûïî%Ô~ûï¼'ÝÝ]ûïè%úlïÃ%ݬݬݬûïÔ~ûï'Â^2ïJ%ݬݬûïyÐï3%­üнüïç"Ýïá"ûï>ЭüPР­üÕ­üÝûïµûïê
Ðïø$­üнüï¬"Ýï¦"ûïïЭüPР­üÕ­üÝûïèÝûïû&Ðïk"8Ðïc"PÐ@¼P‘`-ݬݬûïyÐïC"PÝ@¼ûïÖï1"Ñï+"¬¾Â^ÝÝûïÜ(ÐP­üЬ½üЭüPÔ ÕïL$
ЭüïB$!Ðï:$­ø	ЭøPР­øЭøPÕ îЭü Â^ÐïÇ!PÁ@¼­ü1?˜­ûPÏPB6ynnnnnnnnnnnnnÝMnnnÕnnnnnnnnnnnÏ(nnnnn¶n{n åín¡ûnó˜­û~Ýï1¬Öï/!Ñï)!¬1Ðï!PÐ@¼ïÆ1’Öï	!Ñï!¬lÐïù PÝ@¼ûïÍÝPûïô1dò¬ïÙ ˜­û~Ýï’ûïuÐï¿ PÝ@¼ûï“ÝPûïºÐï#ïO1ò¬ï” ˜­û~ÝïMûï01Ðïy PÝ@¼ûï+'ÐPïÎ"1æÖï] ÑïW ¬ÀÐïM PÝ@¼ûï#ÐPïŠ"1ºò¬ï/ ˜­û~ÝïèûïËÐï PÝ@¼ûïëÐPï^"ÖïD"}ÐïôPÝ@¼ûïÂýÿÿÖ­üЭüP•`õ^Öï"VÖï"NÖïý!FÖïù!Öïã!8˜½üïeÖ­ü+Öïâ!#ÖïVÖïÖ!ÖïÖ!Þïï¡ЭüPÖ­ü`­û1±ýÂ^Ь[ЬZ‹­ÿŠ­þ‘­ÿA‘­ÿZ€ ­ÿ‘­þA‘­þZ€ ­þ‚­þ­ÿ˜­ÿP•­þÃÔPÂ^Ô­üy‘¼0‘¼9x­üP˜¼QÀQPÃ0P­üW‘¼a‘¼fx­üP˜¼QÀQPÃWP­ü2‘¼A‘¼Fx­üP˜¼QÀQPÃ7P­ü˜¼~ßïÍûïLÖ¬•¼‚ЭüPÂ^Ь[Ô­üÝ[ûïóÑP7ÑP!<arLÝïoÝï1ûï:ÝïTûïo#ÝïKûïb#ÝÝÝï5ûï°#ÝÝûï'ÇÝÝûïØ$ÐP­ôÔ Ô½ôÕï¢ÐïžPЭô ЭôïЭôï‚Ðï|ï{ЭüÝÝÝïÍûïH#ÝïÀÝÝ<ßï ûï#ÕP1NÿÐï¢Pà ñÀ<­üÝßïÔßïÚûï]%ÕPXÝÝ­üûïwÕPHÝÝûï&$ÐP­ðÔ Эü½ðÕÿòÐïîPЭð ЭðïàЭðïÖÐïÐÿÇß­øßïsßï˜ûï‹#Á­øPÊPÀP­üÝÝ­ü1*ÿÂ^Ь­üݬûï<ÐïBïUÀï;ïNÀï4ïGÔ­ðÔï¶Ð來ôÁ ïCPÀï@PÀP­üÝÝ­üÝï˜ûï"Áï+­ü­øûïbÀP­üûïÀP­ðÑ­ü­øãÕ¬Õ­ðFÀïìï³Àïåï¬ÀïÞï¥Àï/ïîÀïÐï—ÀïÉïÐPÑïþ­ô×ïôÐïîPÄPÔðt&ÞÔPÂ^˜ï—­ü˜ï­øÕïï­üPÑP
ÑPÑP1‰á­üKûï§ûïÒÝPûï­ÕPiÐï[àkYáï;V‘ï4 PÑï/«CÐï%«9Õï1Õï‹ÐïP‘`.‘ LÁ	ïÿPÀPï3“kªÔPÕ«	‘ïÖ"ïïÍköïÒ«Ðï«ÐPÂ^ЭüЭøßïMûïÊÝPûïñßï>ûï´ÝPûïÛßï/ûïžÝPûïÅÔïÕïéÕïÙaÝ"ÝïûßïûïjÝPûï…Ý#ÝïáßïéûïLÝPûïgÝ$ÝïÇßïÒûï.ÝPûïIûïXïïšPÀPï’Õïä9ÁÿïkPËÿPï^ÁïlïSPÀÿPËÿPïCÁïKï2ï1ïï=PÀPï5Áï/ïïÁï'ïï	ÔïSÔïùЭøÕïÛ2ßïßïûïÐÐPï£ßïÿÝïQûïÔ­øÞïa[SÝ[ûïÁÕ­øBÕïŠ:Ý«Ý«ЭüPÖ­üÇPQxQQÃQPQ	Þï¸PÞï¶PÝPÝï9ûï`À[ÅïðPÀd&PÑ[P™Àï]ïTÂ^ÔïKÞïÙ[,‘k $Ы­üÁ­üPËP­üÐï&«ö%kÀ­üïÀ[ÅïPÀd&PÑ[PÀЬ[Á	«PÀPï>˜kPÏP 
OYcmÕïœÕïœïÕ«êÕïû
ßïêûïfÖïæÝ«ßïàûïP½Àïr«³Àïl«©Àïj«Ÿö$kÀïa«’Ь[‘k Õ«ÝïïÝ«Ýï¶ûï¬kЬ«Õï|2ïI	2ï>Ðïï7Ðïï0Ðïúï)Õï»	ÐïïPÔPÐPïÕï¡	ÐïÙPÔPÐPïÕï‹ÔPÐïPÐPïßÕïå%ßïàûïÕPßïÖûïõ
ÐPï¾Õï¸)‘ÿ°"Ýï×ûïžÐï˜PРïÐï'ï‚ßïÝïzûï
ÐPïÐÝïdÝïŽûï‡ßï`ßï{ûïNßïnûïáßïOßï[ûï¾ÐPï…
ÝïIûï>ÕïŒ1’ßïßï÷ûïúßïêûïßï
ßïoûïÚßïbûïmßïüßï·ûïJÐPï
ÝïÕûïÊßïÖßï&ûï!ÐPïð
Ýï¬ûï¡ÝïÏÝÝ ßïAûï<Â^Ô­üݬûï
	ÑP1ÑP!<arJßïsûï}ÝïqûïŒÝïhûïÝïVÝÝ ßïÜûïoÝûïdÃÐÿЭøAнø­üÝÝ­üÝï ûï›ÝïÝÝ ßï™ûï,Ý­üûï ЭøPР­øÕ­øºÐï€PРïw1aÿÂ^Ь­üÔ­ôݬûï
Ðïï.Àïï'Àïýï Á ï-PÀï*PÀP­üÝÝ­üÝï‚ûïýÁï­ü­ø1ñï­ðPÑPEÑP@ÑP;1Ùûï3
ÀP­üò@­ô
Ýï$ûïûï$˜ïØ­ðÕïP°à­ð5Õï;¸Õï7Ðï»P‘`.‘ Lyûï
ÝPûïò
gûï
ÐP[ÝïÚÝï„Ýï²ûïŸ
íôPÐ[@殺‘ï\ ,‘ïSk
ÑïN«Ýï˜ÝïBÝï\ûï'
Ñ­ü­ø1ÿÝÁ ¬~ÝïfûïáÝÁ ¬PÀïæPÀïãPÁïäP~Ýï@ûï·ÝïÓÝï½ÝïoÝï9Ýï+ûï ÝÁ ¬PÁï—P~ÝïûûïvÝÁ ¬PÀï{PÀïxPÀïyPÁïvP~ÝïÎûïEÝïeÝïOÝïÝïËÝï½ûï.Àï,ïßÀï%ïØÀïïÑÀïïÊÂ^Ô­èǬ­ì1MÑ­è¬
ßïdûïQÝïIÝÝß­øûïaï­øPÏPV`oFzÑP1•ÑP1“ÝïÝï÷ûïà1ÝïÿÝïåûïÊ1ß­øûïñÐP­ð.Ðï­ð$Ãï[ï­ðÁïPïGPÃPï­ðá­ø
Á¬­üPÂP­ðï­øPÑP1iÿЭô
ЭôЭôÑ­ü¬1uÿݬÝ­ðÝ­ôÝ­üÝ­èûïÐP­èÕï†>à­ø9À¬­üï­øPÑP2­úPÐ@ï(”PРPÔP÷P­úݬÝÝß­øûï¤ЭìP×­ìÕP1¥þíè¬~ݬÝïõûïrÂ^Ь[µ«±«@2«PÐ@ïÓZÝïÊÝïÈ
ûï_
Ô­üЭüPЪ­üïjPÏP7
")0ݪÝï”Ýï–
ûï)
ËðkÄðk½ðk¶Õï–ËájÇðk£Â^Ô­üѬ¬ÝïGÝïM
ûïÜ	ЬPì¬~ݬÝïûï›
Ô[Q×ÿ
ÐïPРQÖ šaP
Ýïòûï½ÐPZÖPÝïæÝï ûï±	x­üPšZQÉQP­üÖ[Ñ[¬©À¬­üì[2x[PÎPPxP­üPšPZ×¼ЬPРQÖ öZaݬÝZûïZ×[Õ[ÊÁ¬¬PÂ^Ь[ЬZÁZ[PÆPÄPÐàh&YÖ[Å[PÑàh&Yï×ZÅZPÑYàh&ñÑ[ZRÅ[PÅZQÑàh&áh&=Å[PÀd&P(`­èÅZPÀd&PÅ[QÀd&Q(`aÞ­èPÅZQÀd&Q(`aÑ[ZÖ[×ZÑ[Z1zÿѬZÁ¬~ÝZݬûïAÿÿÿÑ[¬Á¬~ݬÝ[ûï*ÿÿÿÝÝÝï¦ûï	ÝïåÝïÝïûïòÝÁ ïÅPÁïÂP~ÝïjûïÑÕï‘ÝÃï*~ÝûïÂþÿÿÕïf1áÞï#[1ÀÝï-ÝÝÝ[ûïžЫZ
ßï2ûïÿЫY@ÐïPРQÖ ‰a-‘i Ý«ßïûïÑ×ÿÙÐÝïј‰~ûïÐZP×ZÕPÊ×ÿ¸Ðï°PРQÖ ”aÝïžÝûï[ÐïPá Ýï
Ýïa
ûïBÀ[ÅïDPÀd&PÑ[P1)ÿÕïv1ˆÝÝÝïOûï®ÝÝÝïBûïÝï…Ýï#Ýï%ûï†ÝïpÝï
ÝïûïmÝïÿûïþÝïöûïñßïyûïßïûï÷ÝïÃûïÊÝïºûï½ßïu
ûïÐÂ^Ь[”ïÍÐ[ï~Ôïp‘k-1c‘«lö•«Þï¶
[ßï³
ßïÁûïüßï©
ßï®ûïÉÞï¡ï,Á[~ßï’ûïÝÁïP~ûï¾ßït
Ýïûï‹ÑïŸmiÞïW
ïåÁ[~ÁïÚ~ûï€ßï\
ÝïÆûïMßïL
Ýï³ûïêÐPïÝPûï°Ýï”ÝïŠûï5Ñï)xiÞï	
ïoÁ[~Áïd~ûï
ßï
ÝïPûï×ßïü	Ýï=ûïtÐPï'ÝPûï:ÝïÝïûï¿Ýïßï	ûï¬ßïü
ûï¯ÐP­øÑP5Þïå
PЭøQ‘A`bÞïÓ
PЭøQ‘A`aÞïÀ
PЭøQ‘A`.&ßïh	ßï«
ûï.Ýbßï˜
ûïÕï{
/ßï<	ßï}
ûï°ÐPï_
Ýï_
ÝïMûï*ßï	ßïN
ûïÐPï4
Ýï0
ÝïûïûÝï
ÝÝß­üûï1ÝÝÝïý	ûïxÑ­ü
Ñ­ü!<arЭüPÔPÝïˆûïÐ`PÔ[Ô[ЬX˜ˆPÊ ÿÿÿPx[QÁQP[•hêï[PÇÿPQÄÿQÃQPQÁQ[Ð[YHÝï3ÐKïdPÝ ûÿ‰ÐPZÐKïMPà`(Ö[Ñ[ Ô[Ñ[Y
Ýï@ûïÕKï"¯x[PÀT&PЬïÒݬûïÚÐPïÅö ï²Ôï°ûïÿÿÿÂ^Ь[1ÑÝï˜ûïÿÿÿÐP­üÑï»ÿ
ÝïÆûï›Åï Pž@ï¬[Ð[ïŒÕ½ü
ßïfûï˜Ð[½üÁïC~Ýûï?ÐP«
ÝïuûïJÝïÝ«ûï•»
ßï0ûïNÐïþ
«ö««ïå
kÐïâ
«Эü«Ðï
«ÖïÐPÐ[ïö
ÔP˜ï²
PÑP*ÑP1ÑP8ÑP ?ÑP"ÑP#ÑP$$áPö!ïƒ
ÀïD
ï{
Àï<
ïo
Àï4
ïc
ÝݬÝïŸûï
Ýï’ÝÝ ßï
ûï«Ñï
ÝïvÝï<ûïAÁïî	PËP[Ð[ïâ	Î[ïÃ	ÁïØ	PËPZÁZ[PÎPï°	ÁïÅ	PÊPÐPïº	ÝïÝÝßïº	ûïmÐïýPá ÝïùÝï³ûïÄÔZÑZ2|×ÿ×ÐïÏPРQÖ šaP
Ýï¼ûï‡ÐP[ÖPÝï°Ýïjûï{ÖZµö[JïW	òÐZïB	Ýï†Ýï€ûïÞï3	ï	Á	ZP”ïU	ÁZPßïCûïiݬݬݬݬݬݬûïPßï$ûïCݬݬݬݬݬݬûï¯ÿÿÿÝûï~
ݬݬݬݬݬݬûï‰ÿÿÿûïê
ݬݬݬݬûï+Ŭ¬QÑPQЬPá Ýï®ÝïhûïyÿÿÿЬPá Ýï’ÝïPûï]ÿÿÿÂ^Ь­ü1Žßïeûïfÿÿÿ×¼ЬPРQÖ šaP
ݬûï
ÐP[ÖP8ЬPá Ýï1ÝïëûïüþÿÿЬPá ÝïÝïÓûïàþÿÿ×¼ЬPРQÖ ö[aݬÝ[ûï¹	ЭüP×­üÕP1sÿx"~"¬"Å"Þ"ô"#/#U#m#ƒ##³#ã#$G$]$o$ƒ$™$Ã$%%P%~%+atox: illegal hex argument (%c)__.SYMDEF       %d_etext_edata_end_etext_edata_endsym.outwlist.out%s %x	%s %x
Undefined:
%s
_start_startw/tmp/ld6XXXXXXw+/tmp/ld6XXXXXX/tmp/ld6XXXXXXw+w+bad file type on second passrelocation after end of segmentzero length symbolbad character in symbol %s-la/usr/sun/lib/lib.a/usr/sun/dm/lib/libxxxxxxxxxxxxxxx.ar/usr/sun/xlib/libxxxxxxxxxxxxxxx.ar.rrhash table conflictnull symbol enteredld68: 
bad count to dcopyb.outmissing argument following command option -%cunrecognized option: -%cpremature end of file %sread error on file %sunknown type of file %sunknown type of file %s in readhdrmultiply defined symbol %s in file %sentry point not in textcannot create file %scannot reopen output filelocal symbol overflowinternal error - undefined symbol %s in file %sformat error in file %s, bad relocation sizeformat error in file %s, relocation outside of segmenterror writing file %sfile %s not foundhash table overflowsymbol table overflowformat error in file %s, null symbol nameformat error in file %s, invalid symbol id in relocation command%s references %sformat error in file %s, bad address in relocation commandbad header in archive %s, ARFMAG is 0x%x 0x%xunknown archive magic, 0x%x 0x%x 0x%x 0x%x+Xâ$,+¨¨,:Œ¤,I´,X‚ /_°,hZ¬,xr”E—˜EˆÃœE’Æ EǤE¦.(F¬´hG¶ÆlG¾ÚìGÆ
ìKÎÀ^(×þ6(àâ&&ç‚.(ïF(ø°V(™N(:&(~(†&*&9þ'G•Þ'Nþ)VÔÎ'\ÛÖ'c½Æ'kE¾'sN¶'z?®'Ën+‰Aö)‘1ž'˜Âf+¡[^+ªaî)²–'¹ÊV+¿›æ)ÇêN+ÍÍF+Ö¾>+ߪ6+è$.+ð°&+ù!+’+
+j+œþ*#FÖ),î*3&&B•f'LCV'W±v'a>N'jÜn'r¸^'zÒ¶)‚Á.'ˆ¼æ*Ö¦)˜ö&'Ÿ¤6'¨œ'®¦Ö*´(ö*»`Î*ž)È–)΂Ž)׆)ß»'åAv)í~)ôÌ'ûÂ'‘þ&•Ö+¤Æ*x¾*Ï®*#ÉÎ+)Åö&0 î&9ì>'Aª¶+Gæ&Mu¦'Uyž*\–*cñÞ&k’Ö&q´®+w3Ž*ŒÞ+†v†*†'“¼Î&™}n)Ÿyf)¥Ð^)¯­V)¹cF)ÀÆF'ÉÇ®&Ò³>)Û"v*åõ6)ïà.)ùLž&„¾&	p¶&`î'P¦&"ˆÆ&+B)4vþ(:‡–&AÕŽ'G|î(N¢Ž&Uð~'[eæ(bÞ)jxÞ(r²®)yˆn*€6Ö(‰7Þ*’zf*˜«¶* [ö(¨NÎ(¯³Æ(¶£¾(½¤¶(Ɔ&Ìt®(Ó+¦(Úž(áŽ(é†(ñ–(ûM–(f>(=¦+ æ'Ï~& „ž+'ÚV*/ÆN*7»–+?zŽ+FªN)Pê~(ZªÎ)dò&)n2v(xòÆ)‚)‘)˜ë)¢*n(¬ê¾)¶n^*¼fF*ÂXv&Èân&ÍŒÆ+Óľ+ÙR(è.f&ï;^&öf(wö',V&
N&èF&û.*#k&*+Ï>&0t*6q*<o*BO>*J	*SÝ~*[?¦*fW6*m͆+ué6&|ÿ.&„³~+‰Øv+&–L ~X¦	¬%¯	Ü´%·Å À¥ ÉZ Ó	4ô%Û	&ã	¦,&ì	Xd&ô	ÑL&ý	bP&	T&	–\¦	³\#Ö "¾ +	1`#3ß >	ëd#D	\h#K	l#U	ßp#`	At#k	BÜ#v	{D$‚	¬$	%%œ	x%¢	|%¨	Ž€%¯	Ž„%¶	̈%¼	-Œ%Ã	-%Ê	Ý”%Ñ	͘%Ø	Ýœ%ß
 æ	í %í	m¤%ô û	ͨ%	½¬%		<°%	Ú´%	0¸%$	Z¼%-	šÀ%6	yÄ%=	}È%D	YÌ%K	iÐ%R	"Ô%Z	¿Ø%bi  i	rÜ%p	óà%w	ãä%~w$ ‚x( †y, Šz0 Ž{4 ’W8 —|< ›}@ Ÿ‚D £€H §L ¬P ± T ¶!X »"\ À#` Å$d Ê%h Ï&l Ô'p Ù)t Þ*x ã+| è,€ íö„ ÷oì	EÐ	Ç\	ø˜	M¼
'	FÊ2	£Ž=	B:E	d@N	ppU	œ\	€Bb	 ôn	gØw	D~	]h…	ฎ	¥H–	Ùrœ	ÉZ¦	˜Œ®	%d¶	bz
¾	ÚÐ
Ä	ÐjÌ	/ŽÓ	^ŒÚ	Ûôã	’xë	dó	èú	,ò
d 

crt0.oexec_startld.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_arglist_archdr_arclist_arclast_arcelast_filhdr_cursym_csymbuf_symtab_lastsym_symindex_hshtab_local_nloc_nund_entrypt_argnum_ofilename_text_rtext_filename_mfilename_tfilename_xfilename_dofilename_drofilename_trofilename_tout_dout_trout_drout_Lout_xflag_Xflag_Sflag_rflag_sflag_vflag_dflag_Lflag_nflag_Bflag_qflag_torigin_dorigin_doffset_borigin_corigin_tsize_dsize_bsize_csize_rtsize_rdsize_ssize_ctrel_cdrel_cbrel_e1_e2_e3_e4_e5_e5a_e6_e7_e8_e9_e10_e11_e12_e13_e14_e15_e16_e17_e18_e19_e20_e21_e22_e23_mystrcmp_procargs_load1arg_middle_setupout_load2arg_finishout_procflags_newarg_slookup_enter_error_atox_foldstrcmp_getfile_fatal_load1_readhdr_getsym_sym1_symreloc_lookup_ldrsym_common_sym2_bletch_dread_load2_load2td_relext_relcmd_dcopy_sym_sort_hashSÝ~*[?¦*fW6*m͆+ué6&|ÿ.&„³~+‰Øv+&–L ~X¦	¬%¯	Ü´%·Å À¥ Ésumacc/cceun/lorder68   555      0     12         643  3472711343   7760 #! /bin/sh
trap "rm -f $$sym?ef; exit" 0 1 2 13 15
case $# in
0)	echo usage: lorder68 file ...
	exit ;;
1)	case $1 in
	*.b)	set $1 $1
	esac
esac
nm68 -g -f  $* | sed '
	/^$/d
	/:$/{
		/\.b:/!d
		s/://
		h
		s/.*/& &/
		p
		d
	}
	/[TD] /{
		s/.* //
		G
		s/\n/ /
		w '$$symdef'
		d
	}
	s/.* //
	G
	s/\n/ /
	w '$$symref'
	d
'
sort $$symdef -o $$symdef
sort $$symref -o $$symref
join $$symref $$symdef | sed 's/[^ ]* *//'
v+&–L ~X¦	¬%¯	Ü´%·Å À¥ Ésumacc/cceun/nm68   555      0     12       21577  3472711344   7155 €,<H0202ÿÿÿÿÿÿÿÿh€NM680 MåJûŒ1.01 (UNIX ld)
$«
LIBCSHARE_001$k¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¸1&
Ô~Ý]ûï
Ÿï>ûïîÔ~ûï¼
ÝÝ]ûïèúlïÃݬݬݬûïÔ~ûï
ݬݬûï1ûïûïëûïºÐPïw	éûïTÝûïO
ÐïW	EÐïO	PÐ@¼P‘`-ݬݬÐï8	PÁ@¼~ûï&Ðï"	PÝ@¼ûïÖï	Ñï
	¬±Â^1gÑPOLwÑPcê–ïì1é1­ÑPfj–ïá–ïã1Ì–ïÊ1ÖïÕ1º–ïÐ1±Ý¬ûï¹ÐPïÈÑPd–ï°1ÑPg¸˜­ÿ~Ýï®ûïq1qÿÑPh]ÔÑPnÔ–ïZP˜­ÿPÑPo1Wÿ–ïJ1bÿÑPu1qÿÑPr1Zÿ—ÑPpŽ1:ÿÑPx‚–ï$ЬPÖ¬`­ÿ£ßïJßï(*ûïݬݬݬݬݬݬßï	*ûïpßïßïö)ûï]ݬݬݬݬݬݬûïÿÿÿÝûïhÂ^•ïS•ïy	ÞïÒPÞïÌPÐP­ü•ïm	Þï¼PÔPÐP­øÝÝPÝ­üßï©Ýï]ÝïWûï‚Â^ÝûïÂ
ÐP­üЬ½üЭüPÔ Õïö
Эüïì!Ðïä­ø	ЭøPР­øЭøPÕ îЭü Â^Õï½ÔPÐï²­üЭüPРï¤нüPÂ^ß­ôûï¥	ÕP
ÝïÝûïØþÿÿûïýÐP­ü}ÕP
ÝïÇûïºþÿÿÝûïµÝ­ôûï»ÕP
ÝïŸûï–þÿÿÝ­ôûïÝ­øûï†ݬ(ݬ$ݬ ݬݬݬݬݬݬݬû
ï‘
ÝïMûïPþÿÿ9ÝûïIÝ­øûïOÑP
Ýï2ûï)þÿÿÝ­ôûï#Ý­øûï¼¼Ö¬Ö¬‘¼ Ö¬ž®ˆ^•ï¢Ýï†ßïþûïßï÷Ýïmûï
ÐPïcBÝïWÝï‘,ÑPRÑPIÑP	@ÑP!<ar^ÝPÝïgûï2ýÿÿÝïÝÝ ßïûïÖ	Ðï
PÑP¥ÝÁ ïûPÁïøP~ûïµÝïÙûïX	ЭÀÝÝÝïÃûï¢	Ýï¶ÝÝ<ß­Äûïv	ÕPÅÐïžPà ¹ß­Šß­ÄûïÑþÿÿÝï…ÝÝ ßïƒûïB	À<­Àß­ŠÁ ­ÀPÀïnPÁïkP~ûï(ß­¼ßïËß­ôûï
Á­¼PÊPÀP­ÀÝÝ­À1bÿž®¼^ÝݬÝïûïøÔ­ð1¸ÝïÝÝß­øûïÆÐïòPá ÝïâÝï4ûïëûÿÿÞ­¾[Q×ÿÍÐïÅPРQÖ šaP
Ýï²ûïáÐPZÑPÿÿÿÿÝï•ÝïçûïžûÿÿÕZöZkÖ[Þ­ïPÑ[P¦”k•ïu$‘­¾~
‘­¾_1ùÞ­¾YÞ­¿PÐPXˆ‰ûö y•ïMá­øÝ•ïX“­øÏ•ïN“­øÁï­øPÏPy€‡Ž•ß­¾˜­ø~ÝïEûïûÿÿÀï ­ü•ï(Ýïàßïcûï]Õ¬ݬßïRûïHà­øˆ ­÷•ïÛ5ß­¾˜­÷~Ý­üßï.3U­÷žA­÷—T­÷D­÷‰B­÷‚ß­¾˜­÷~Ý­üßïûïëß­¾ûï‰	À	PÀP­ðÑ­ðïd1;þ¨¶Ýõ	$	F	f	…	—	¼	È	ë	nm68: 
+0+2-r-t 
%s:
r%d%s:%s:%06X %c %s
%08O %c %s
/usr/bin/sortfilename required following -%c optionunrecognized option: %cfile %s not foundunrecognized magic number %Ounrecognized type %o on symbol %scould not reopen pipe as stdoutcould not reopen pipe as stdincould not exec %sfile %s format error, unexpected eofpipe faileddup failed or returned wrong valuefork failed+Xâ$-¨¨<Œ¤K´Z‚ a°jZ¬zr”+ƒ—˜+ŠÃœ+”Æ +ŸÇ¤+¨.(,®´h-¸Æl-ÀÚì-È
ì1ÐÀ^Ùþ6ââ&é‚.ñFú°V™N
:&~†,;þ
I•Þ
PþXÔÎ
^ÛÖ
e½Æ
mE¾
uN¶
|?®
ƒËn‹Aö“1ž
šÂf£[^¬aî´–
»ÊVÁ›æÉêNÏÍFؾ>áª6ê$.ò°&û!’jœþ%FÖ.î5&D•f
NCV
Y±v
c>N
lÜn
t¸^
|Ò¶„Á.
Š¼æ’Ö¦šö&
¡¤6
ªœ
°¦Ö¶(ö½`ÎĞʖЂŽÙ†á»
çAvï~öÌ
ýÂ
‘þ	•Ö¤Æx¾Ï®%ÉÎ+Åö2 î;ì>
Cª¶IæOu¦
Wyž^–eñÞm’Ös´®y3ŽŒÞˆv††
•¼Î›}n¡yf§Ð^±­V»cFÂÆF
ËÇ®Ô³>Ý"vçõ6ñà.ûLž„¾p¶`î
P¦$ˆÆ-B6vþ<‡–CÕŽ
I|îP¢ŽWð~
]eædÞlxÞt²®{ˆn‚6Ö‹7Þ”zfš«¶¢[öªNα³Æ¸£¾¿¤¶È†Ît®Õ+¦ÜžãŽë†ó–ýM–f>=¦ æ
Ï~"„ž)ÚV1ÆN9»–AzŽHªNRê~\ªÎfò&p2vzòÆ„‘šë¤*n®ê¾¸n^¾fFÄXvÊânÏŒÆÕľÛRê.fñ;^øfwö
	,V
NèFû.%k&-Ï>2t8q>oDO>L	UÝ~]?¦hW6o͆wé6~ÿ.†³~‹Øv’˜L¢~X¨	1ø	°\º	ü	Ä	¼
Ì	4
ÔÞÛâé
ð÷­þÍý í$-($,"#0,w40x84y<8z@<{D@|HD}LH‚PL€TPXU\Z `_o˜i"€rÅbv8€`≣ô”y朤Z«£bµóFÂðÖÇcrt0.oexec_startnm68.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_argnum_namelist_filename_infile_filhdr_cflag_gflag_nflag_fflag_oflag_pflag_rflag_uflag_dflag_hflag_offset_sortname_e1_e2_e3_e4_e5_e6_e7_e8_e9_e10_e11_e12_procargs_startup_nm_nextname_cleanup_procflags_newname_error_fatal_pipeline_copytospace_nmf6
ªœ
°¦Ö¶(ö½`ÎĞʖЂŽÙ†á»
çAvïsumacc/cceun/pr68   555      0     12       20434  3472711344   7153 €,<H0202ÿÿÿÿÿÿÿÿh€PR680 YNKûŒ1.01 (UNIX ld)
$«
LIBCSHARE_001$k¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ8
1&
Ô~Ý]ûï
Ÿï>ûïîÔ~ûï¼
ÝÝ]ûïèúlïÃݬݬݬûïÔ~ûï
ѬßïšÝfûïßïœЬPÝ ûï'ÐPï^
ÕPЬPÝ ßïxÝfûïâûï%ûïèûï]ûïÒûïŸûï(Ýï
ÝÝ ßï

ûïÝ
ÑPßï6Ýwûï…Ýïå	ßï2ûïjÝïÖ	ßï2ûïWÝïÇ	ßï5ûïDÝï¸	ßï8ûï1Ýï©	ßï:ûïÝïš	ßïEûïÝï‹	ßïSûïø
Ýï|	ßïaûïå
Â^ßïcûïÒ
Çï=	PxPPÃPï1	PßïOÝwûï±Ô­ü0Ýï	ÝÝß­øûïØÑPßï:Ýwûï€À­üÑ­üïÞÆÂ^ßï-ûïV
ÇïÁPxPPÃPïµPßïÝwûï5Ô­ü0ÝïˆÝÝß­øûï\ÑPßïÝwûïÀ­üÑ­üïfÆž®¸^´­þßïóûïÖÔ­ø1ªÝï0ÝÝß­ðûïÑPßïÖÝwûï¬Þ­¾­¸Ö­øÖ­¸×ÿ÷ÐïïPРQÖ šaP
ÝïÜûïöP½¸ÌÖ­øÞ­¾PÝPÝ­ôï­ðP˜@ï²~˜­ðPÆ P˜@ïš~2­þP¶­þÝPßïyûï*À­øÑ­øïœ1IÿÂ^ßïûïÔ­ünÝïaÝÝß­ôûï5ÑPßï€ÝwûïÝÝ­ø2­ö~ï­ôP˜@ï¡~ï­ôP˜@ïŽ~ï­ôP˜@ï{~ßïcûï—À­üÑ­üï
ˆÂ^ßï`ûïvÔ­ünÝïÑÝÝß­ôûï¥
ÑPßïPÝwûïMÝ­ø2­ö~ï­ôP˜@ïq~ï­ôP˜@ï^~ï­ôP˜@ïK~ßï3ûïÀ­üÑ­üïˆßï3ßï¬'ûï
ݬ0ݬ,ݬ(ݬ$ݬ ݬݬݬݬݬݬßï~'ûïå	ßïùßïk'ûïÒ	˜¬PÑPaÑPf
ÑPwÝûïÙûïb˜¬~ßï´ÝwûïcÿÿÿUsage: pr68 filenamerCouldn't open %s for inputerror reading headerMagic Number: %ld
Text Size: %ld bytes
Data Size: %ld bytes
BSS Size: %ld bytes
Symbol Table Size: %ld bytes
Text Relocation Size: %ld bytes
Data Relocation Size: %ld bytes
Entry Location: %ld

Text Segment
text size not multiple of 4read error in text section
Data Segment
data size not multiple of 4read error in text section
Symbol Table
read error in symbol table section%d: %c%c %ld %s
 E??????UATDBCR?????????????????????????
Text Relocation Commands
error reading text relocation commands%c %c %c %d %ld
TDBEBWL? D
Data Relocation Commands
error reading data relocation commands%c %c %c %d %ld
TDBEBWL? Dpr68: 
Illegal error type: '%c'+Xâ$-¨¨<Œ¤K´Z‚ a°jZ¬zr”+ƒ—˜+ŠÃœ+”Æ +ŸÇ¤+¨.(,®´h-¸Æl-ÀÚì-È
ì1ÐÀ^Ùþ6ââ&é‚.ñFú°V™N
:&~†,;þ
I•Þ
PþXÔÎ
^ÛÖ
e½Æ
mE¾
uN¶
|?®
ƒËn‹Aö“1ž
šÂf£[^¬aî´–
»ÊVÁ›æÉêNÏÍFؾ>áª6ê$.ò°&û!’jœþ%FÖ.î5&D•f
NCV
Y±v
c>N
lÜn
t¸^
|Ò¶„Á.
Š¼æ’Ö¦šö&
¡¤6
ªœ
°¦Ö¶(ö½`ÎĞʖЂŽÙ†á»
çAvï~öÌ
ýÂ
‘þ	•Ö¤Æx¾Ï®%ÉÎ+Åö2 î;ì>
Cª¶IæOu¦
Wyž^–eñÞm’Ös´®y3ŽŒÞˆv††
•¼Î›}n¡yf§Ð^±­V»cFÂÆF
ËÇ®Ô³>Ý"vçõ6ñà.ûLž„¾p¶`î
P¦$ˆÆ-B6vþ<‡–CÕŽ
I|îP¢ŽWð~
]eædÞlxÞt²®{ˆn‚6Ö‹7Þ”zfš«¶¢[öªNα³Æ¸£¾¿¤¶È†Ît®Õ+¦ÜžãŽë†ó–ýM–f>=¦ æ
Ï~"„ž)ÚV1ÆN9»–AzŽHªNRê~\ªÎfò&p2vzòÆ„‘šë¤*n®ê¾¸n^¾fFÄXvÊânÏŒÆÕľÛRê.fñ;^øfwö
	,V
NèFû.%k&-Ï>2t8q>oDO>L	UÝ~]?¦hW6o͆wé6~ÿ.†³~‹Øv’˜L¢~X¨	¼ì
¬	<ô
²œŽ¹ÎØÁë¢Ç?ÍßšÖ\nݱþäcrt0.oexec_startpr68.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_in_bhdr_error_header_text_data_symbols_rtext_rdata.ñFú°V™N
:&~†,;þ
I•Þ
PþXÔÎ
^ÛÖ
e½Æ
mE¾
uN¶
|?®
ƒËn‹Aö“1sumacc/cceun/rev68   555      0     12       20335  3472711345   7327 €,<H0202ÿÿÿÿÿÿÿÿh€REV680`Î)KûŒ1.01 (UNIX ld)
$«
LIBCSHARE_001$k¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
1&
Ô~Ý]ûï
ŸïûïîÔ~ûï¼
ÝÝ]ûïèúlïÃݬݬݬûïÛÔ~ûï
ЬPïPPЬQïQQÊÿÿÿQÈQPx¬QÊÿÿÿQÈQPx¬QÈQPЬPïPPšPPx¬QÊÿÿÿQÈQPžÎøþ^Ô­ühíü¬PÑPíü¬P2PÐP­øݬÝÝPßÍøþûïä
ÑPßïûïŠÝûïáݬÝÝ­øßÍøþûïÞ
À­üÑ­ü¬‘žÎPÿ^ÔÍ\ÿѬßïÍûï@Ýûï—ЬPÝ ß­šûï¾ßïÉß­šûï>
ÐP­¼?ßïµß­šûïxßï©ß­šûï
ÐP­¼ß­šßï’ûïÚ
Ýûï1Ý­¼ÝÝ ß­àûï
ÑPß­šßïyûï«
ÝûïÑ­à#Ñ­àß­šßïdûï~
ÝûïÕѬ	ЬPÝ ßï^ßÍ|ÿûïíßïSßÍ|ÿûïlÐP­¸ßÍ|ÿßï:ûï-
Ýûï„Þ­àÍTÿÞ­ÀÍPÿÔÍXÿÐÍTÿPÀÍTÿÝ`ûïÓýÿÿÐPÝPÿÀÍPÿòÍXÿÝÝ­¸ÝÝ ß­ÀûïPÝ­¸Á­è­ä~Ý­¼ûïóýÿÿÔÍ`ÿ1¥×½¸Э¸PРQÖ ÍgÿaÝ­¸˜Ígÿ~ûïXÖÍ`ÿÖÍ\ÿ×½¼Э¼PРQÖ šaP
Ý­¼ûï)öPÍgÿ¬×½¸Э¸PРQÖ ”aÝ­¸Ýûï
ÖÍ`ÿÖÍ\ÿéÍ\ÿ$×½¸Э¸PРQÖ ”aÝ­¸ÝûïÝ
ÖÍ\ÿÑÍ`ÿ­ð1ÕÝ­¼ÝÝßÍpÿûïLÕPçÀÍ`ÿÍpÿÍjÿÍqÿÍkÿÝÍtÿûï´üÿÿÐPÍlÿÝ­¸ÝÝßÍjÿûï;ÀÍ\ÿ1+ÿïïÙPðPï×ïïÇPðPïÅïïµPðPï³2ï§~ûï‡üÿÿ÷Pï Ýï”ûï=üÿÿÐPïŽðï”ï|Ý­¸ÝÝßïnûï±
Ý­¼ÝÝßïRûïu
ÕP1cÿÝÍ\ÿûïíûÿÿÐPÍ\ÿÝÝÝ­¸ûïh
Ý­¸ÝÝßÍ\ÿûïf
Ý­¼ûïì	Ý­¸ûïâ	Read error
Usage: rev68 filename [ outfile ]
r.68rrev68: Can't open %s
rev68: %s wrong format
rev68: %s not proper .68 file
r.outwrev68: Can't write %s
+Xâ$.¨¨=Œ¤L´[‚ b°kZ¬{r”+„—˜+‹Ãœ+•Æ + Ç¤+©.(,¯´h-¹Æl-ÁÚì-É
ì1ÑÀ^Úþ6ãâ&ê‚.òFû°V™N:&~†-<þ
J•Þ
QþYÔÎ
_ÛÖ
f½Æ
nE¾
vN¶
}?®
„ËnŒAö”1ž
›Âf¤[^­aîµ–
¼ÊV›æÊêNÐÍFÙ¾>âª6ë$.ó°&ü!’
jœþ&FÖ/î6&E•f
OCV
Z±v
d>N
mÜn
u¸^
}Ò¶…Á.
‹¼æ“Ö¦›ö&
¢¤6
«œ
±¦Ö·(ö¾`ÎŞ˖тŽÚ†â»
èAvð~÷Ì
þÂ
‘þ
•Ö¤Æx¾Ï®&ÉÎ,Åö3 î<ì>
Dª¶JæPu¦
Xyž_–fñÞn’Öt´®z3Ž‚ŒÞ‰v††
–¼Îœ}n¢yf¨Ð^²­V¼cFÃÆF
ÌÇ®Õ³>Þ"vèõ6òà.üLž„¾p¶`î
P¦%ˆÆ.B7vþ=‡–DÕŽ
J|îQ¢ŽXð~
^eæeÞmxÞu²®|ˆnƒ6ÖŒ7Þ•zf›«¶£[ö«Nβ³Æ¹£¾À¤¶É†Ït®Ö+¦ÝžäŽì†ô–þM–f>=¦ æ
Ï~#„ž*ÚV2ÆN:»–BzŽIªNSê~]ªÎgò&q2v{òÆ…‘›ë¥*n¯ê¾¹n^¿fFÅXvËânÐŒÆÖľÜRë.fò;^ùfwö

,V
NèFû.&k&.Ï>3t9q?oEO>M	VÝ~^?¦iW6p͆xé6ÿ.‡³~ŒØv“™L£~(©qX²kŽ¼B¬Ä	r¤Ì	=¬Õcrt0.oexec_startrev68.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_reverse_sreverse_outbin_relcom_orelcomÚì-É
ì1ÑÀ^Úþ6ãâ&ê‚.òFû°V™N:&~†-<þ
J•Þ
QþYÔÎ
_ÛÖ
f½Æ
nE¾
vN¶
}?®
„ËnŒAö”1sumacc/cceun/rl68   555      0     12       21534  3472711346   7153 €,<H0202ÿÿÿÿÿÿÿÿh€RL680'.ðJûŒ1.01 (UNIX ld)
$%«
LIBCSHARE_001$k:¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀ< 1&
Ô~Ý]ûï
JŸï>ûïîIÔ~ûï¼KÝÝ]ûïèIúlïÃIݬݬݬûïÔ~ûïKݬݬûï­ûï–1‚ÝïHÝï¯ûïmßïÌÝïHûïLÐPïøGÏÝPÝÝ ßïòGûïLÐïåGPÑPÑP
ÝPÝïZ¥ûïûïÀÝï¬Gûï“KûïdÐPï“GƒûïþÝûïÓJÐïsGEÐïkGPÐ@¼P‘`-ݬݬÐïTGPÁ@¼~ûï&Ðï>GPÝ@¼ûï®Öï,GÑï&G¬±Â^˜­ÿ~Ýï§ûïЬPÖ¬`­ÿâßï¼ßï¤hûïKݬݬݬݬݬݬßï…hûïìJßï‘ßïrhûïÙJݬݬݬݬݬݬûïÿÿÿÝûïäIÂ^ÝûïœLÐP­üЬ½üЭüPÔ ÕïÔ
ЭüïÊ!Ðï­ø	ЭøPР­øЭøPÕ îЭü Â^Õï›ÔPÐï­üЭüPРï‚нüPÂ^ß­ôûïHÕP
Ýï§ûï6ÿÿÿûï×GÐP­ü}ÕP
Ýï‘ûïÿÿÿÝûïGÝ­ôûï•GÕP
ÝïiûïôþÿÿÝ­ôûïjGÝ­øûï`Gݬ(ݬ$ݬ ݬݬݬݬݬݬݬû
ïkLÝïûï®þÿÿ9Ýûï#GÝ­øûï)GÑP
Ýïüûï‡þÿÿÝ­ôûïýFÝ­øûïóFž®´^ÝÁ ï)EPÁï&EP~ÝïEûïUIÔ­ð1Ñïcè
ÝïªûïåýÿÿxïHPž@ïP­¸Öï8ÝïÊDÝÝÝ­¸ûïòHÐï¶DPá Ýï¦DÝïPûï›ýÿÿÔ­´Þ­¾[O×ÿŽDÐï†DPРQÖ šaP
ÝïsDûï
HÐPZÖPÝï[DÝïûïPýÿÿÕZöZkÖ­´Ö[Þ­ïPÑ[P¨”kЭ¸PЭ´ Á­´~Ýûï±IЭ¸QÐP¡ß­¾Ð­¸PÝ ûïpJÁ	­´PÀP­ðÑ­ðïD1óþÂ^ÝÁ ïðCPÀïíCPÁïîCP~ÝïÎCûïHÔ­üÝTûï]À­üÑ­üïÅCåÝÁ ïªCPÀï§CPÀï¨CPÁï¥CP~ÝïCûïÈGÔ­üÝDûïÀ­üÑ­üï|Cåž®Œ^ÝïLCÝÝß­øûïtGÐï8CPá Ýï(CÝïÒûïüÿÿÐïCPá Ýï	CÝï³ûïþûÿÿï­øP@ï¾­÷ï­øP@ï´­ö‘­÷E\µ­ú2­úPÑPï32PPxPPÐà
­ð2­ú~ßïƒß­ŒûïâGÞ­Œ­ðÝ­ðÝ­ü˜­ö~˜­÷~ݬßïvûïoGÝ­ü˜­ö~˜­÷~ݬßïlûïRG¬¶Ýõ	$	F	f	…	—	¼	È	ë	÷	rrl68: 
TDBEBWL???????? bad symbol id %d%c %c %c %011O %s
%c %c %c %011O
/bin/sortfilename required following -%c optionunrecognized option: %cfile %s not foundunrecognized magic number %Ounrecognized type %o on symbol %scould not reopen pipe as stdoutcould not reopen pipe as stdincould not exec %sfile %s format error, unexpected eofpipe faileddup failed or returned wrong valuefork failedsymbol table overflow+Xâ$P-¨¨P<Œ¤PK´PZ‚ Sa°PjZ¬Pzr”iƒ—˜iŠÃœi”Æ iŸÇ¤i¨.(j®´hk¸ÆlkÀÚìkÈ
ìoÐÀ^LÙþ6Lââ&Jé‚.LñFLú°VL™NL
:&L~L†J,J;þKI•ÞKPþMXÔÎK^ÛÖKe½ÆKmE¾KuN¶K|?®KƒËnO‹AöM“1žKšÂfO£[^O¬aîM´–K»ÊVOÁ›æMÉêNOÏÍFOؾ>Oáª6Oê$.Oò°&Oû!O’OOjOœþN%FÖM.îN5&JD•fKNCVKY±vKc>NKlÜnKt¸^K|Ò¶M„Á.KŠ¼æN’Ö¦Mšö&K¡¤6KªœK°¦ÖN¶(öN½`ÎNÄžMÊ–MЂŽMÙ†Má»KçAvMï~MöÌKýÂK‘þJ	•ÖO¤ÆNx¾NÏ®N%ÉÎO+ÅöJ2 îJ;ì>KCª¶OIæJOu¦KWyžN^–NeñÞJm’ÖJs´®Oy3ŽNŒÞOˆv†N†K•¼ÎJ›}nM¡yfM§Ð^M±­VM»cFMÂÆFKËÇ®JÔ³>MÝ"vNçõ6Mñà.MûLžJ„¾Jp¶J`îKP¦J$ˆÆJ-BM6vþL<‡–JCÕŽKI|îLP¢ŽJWð~K]eæLdÞMlxÞLt²®M{ˆnN‚6ÖL‹7ÞN”zfNš«¶N¢[öLªNÎL±³ÆL¸£¾L¿¤¶LȆJÎt®LÕ+¦LÜžLãŽLë†Ló–LýM–Lf>L=¦O æKÏ~J"„žO)ÚVN1ÆNN9»–OAzŽOHªNMRê~L\ªÎMfò&Mp2vLzòÆM„M‘MšëM¤*nL®ê¾M¸n^N¾fFNÄXvJÊânJÏŒÆOÕľOÛRLê.fJñ;^JøfLwöK	,VJ
NJèFJû.N%k&N-Ï>J2tN8qN>oNDO>NL	NUÝ~N]?¦NhW6No͆Owé6J~ÿ.J†³~O‹ØvO’J˜L¢~X¨	X
°!¹	1HÁ\Ë	”HÕ	¼˜HÝ	4 HåÞìóú­Íý# w$x(!y,%z0){4-|81}<5‚@9€D=HBLG PL!TQo["dœ–k#ltE¦^‰`’£py¦Þ­£ˆ·Â@¼crt0.oexec_startrl68.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_symtab_nextsym_argnum_namelist_filename_infile_filhdr_cflag_gflag_nflag_pflag_rflag_uflag_sortname_e1_e2_e3_e4_e5_e6_e7_e8_e9_e10_e11_e12_e13_procargs_startup_error_getsyms_printcmds_nextname_cleanup_procflags_newname_fatal_pipeline_cmdæN’Ö¦Mšö&K¡¤6KªœK°¦ÖN¶(öN½`ÎNÄžMÊ–MЂŽMÙ†Má»KçAvMïsumacc/cceun/size68   555      0     12       21274  3472711346   7511 €,<H0202ÿÿÿÿÿÿÿÿh€SIZE680%ŸùJûŒ1.01 (UNIX ld)
$«
LIBCSHARE_001$k¡
LIBCSHARE_002ìÿ?ýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ@1&
Ô~Ý]ûï
Ÿï>ûïîÔ~ûï¼
ÝÝ]ûïèúlïÃݬݬݬûïÔ~ûï
ݬݬûï1ûï`ûïÛûïªÐPï
éûïDÝûïO
ѬöïeÐïæ	EÐïÞ	PÐ@¼P‘`-ݬݬÐïÇ	PÁ@¼~ûï%Ðï±	PÝ@¼ûïçÖïŸ	Ñï™	¬±Â^KÑPl2ÑPn2˜­ÿ~Ýïõûï6&˜­ÿPÑPhÎöïÄöï¿öïºЬPÖ¬`­ÿÍßïÜßïÚ*ûïA
ݬݬݬݬݬݬßï»*ûï"
ßï³ßï¨*ûï
ݬݬݬݬݬݬûïÿÿÿÝûïÂ^ÝûïÒÐP­üЬ½üЭüPÔ Õï
Эüïü!Ðïô­ø	ЭøPР­øЭøPÕ îЭü Â^ÕïÍÔPÐï­üЭüPРï´нüPÂ^ßïòÝï5ûïDÐPï+ÝïÝïûïÚþÿÿÝïÝÝ ßï
ûï0ÐïPÏPP
PPP–ïSÝïáûïêÏP+
+++ÝïÂÝï8ûïqþÿÿÝï§ûïŠÝï©ûïªÐP­øÝïœûï™ÐP­ôÝïƒûïˆÀ­øPÁ­ôP­ü•ïÐ(ÝïTßïûï5•ï±
ßï÷ûï •ï˜1!•ï‘1ÚÝï"ßïÐûï÷ÝïûïÝPßïÁûïÛÝïûûïüÝPßï²ûï¿ÝïãûïàÝPßï£ûï£ÝïËûïÄÝPßï”ûï‡Ýï³ûï¨ÝPßï…ûïkÝï›ûïŒÝPßïwûïOÝïƒûïpÝPßïiûï31™þÝ­üÝ­üÝïNûïKÝPÝï;ûï<ÝPÝï(ûï-ÝPßï31•ïp1ÓÝïßï5ûïÖ
Ýïòûï÷ÝPßï&ûïº
ÝïÚûïÛÝPßïûïž
ÝïÂûï¿ÝPßïûï‚
Ýïªûï£ÝPßïóûïf
Ýï’ûï‡ÝPßïâûïJ
ÝïzûïkÝPßïÒûï.
ÝïbûïOÝPßïÂ1ÜþÝ­üÝ­üÝï4ûï1ÝPÝï!ûï"ÝPÝïûïÝPßï’ûïÖ	1<ý•ïT4ЬPïPPЬQïQQÊÿÿÿQÈQPx¬QÊÿÿÿQÈQPx¬QÈQPЬPP	w		¡	¾	à	

1
V
b
…
size68: 
r%s: 
fmagic:	0%O
tsize:	0x%X
dsize:	0x%X
bsize:	0x%X
ssize:	0x%X
rtsize:	0x%X
rdsize:	0x%X
entry:	0x%X
0x%X+0x%X+0x%X = %D = 0x%X
fmagic:	0%O
tsize:	%D
dsize:	%D
bsize:	%D
ssize:	%D
rtsize:	%D
rdsize:	%D
entry:	0%O
%D+%D+%D = %D = 0%O
filename required following -%c optionunrecognized option: %cfile %s not foundunrecognized magic number %Ounrecognized type %o on symbol %scould not reopen pipe as stdoutcould not reopen pipe as stdincould not exec %sfile %s format error, unexpected eofpipe faileddup failed or returned wrong valuefork failed+Xâ$/¨¨>Œ¤M´\‚ c°lZ¬|r”+…—˜+ŒÃœ+–Æ +¡Ç¤+ª.(,°´h-ºÆl-ÂÚì-Ê
ì1ÒÀ^Ûþ6äâ&ë‚.óFü°V™N:&~†.=þ
K•Þ
RþZÔÎ
`ÛÖ
g½Æ
oE¾
wN¶
~?®
…ËnAö•1ž
œÂf¥[^®a
½ÊVÛæËêNÑÍFÚ¾>ãª6ì$.ô°&ý!’jœþ'FÖ0î7&F•f
PCV
[±v
e>N
nÜn
v¸^
~Ò¶†Á.
Œ¼æ”Ö¦œö&
£¤6
¬œ
²¦Ö¸(ö¿`Îƞ̖҂ŽÛ†ã»
éAvñ~øÌ
ÿÂ
‘þ•Ö¤Æx¾ Ï®'ÉÎ-Åö4 î=ì>
Eª¶KæQu¦
Yyž`–gñÞo’Öu´®{3ŽƒŒÞŠv†‘†
—¼Î}n£yf©Ð^³­V½cFÄÆF
ÍÇ®Ö³>ß"véõ6óà.ýLž„¾
p¶`î
P¦&ˆÆ/B8vþ>‡–EÕŽ
K|îR¢ŽYð~
_eæfÞnxÞv²®}ˆn„6Ö7Þ–zfœ«¶¤[ö¬Nγ³Æº£¾Á¤¶Ê†Ðt®×+¦ÞžåŽí†õ–ÿM–f>=¦ æ
Ï~$„ž+ÚV3ÆN;»–CzŽJªNTê~^ªÎhò&r2v|òƆ‘‘œë¦*n°ê¾ºn^ÀfFÆXvÌânÑŒÆ׾ÝRì.fó;^úfwö
,V
NèF û.'k&/Ï>4t:q@oFO>N	WÝ~_?¦jW6q͆yé6€ÿ.ˆ³~Øv”šL¤~Xª	1”
²\¼	˜
Æ	¼œ
Î-ÕmÜãÍê	4¤
òwöxúyþz {$|(
},‚0€48<  @%o˜/"Î8çR>(H`ÒQ£\yÖeœ`l¨sq´|crt0.oexec_startsize68.o_fd_fab_pointer_next_free_buf_next_free_fab__$cache_flags__$efn__$flags__$spare_buffer_environ_errno_vmserrno_yyportlib__ctype___iob__lastbuf__sctab__sibuf__sobuf__strout__filbuf__exit__error__getccl__instr__innum__doscan__doprnt__$startup_unix__$startup_vms__$get_fabrab_write_wdleng_wait_wait3_vwrite_vtimes_vread_vfork_valloc_ungetc_umask_ttyslot_ttyname_tmpnam_times_tell_system_swab_strncpy_strncmp_strncat_strlen_strcpyn_strcpy_strcmpn_strcmp_strcatn_strcat_sprintf_sleep__$signal_init_sigpause_sigignore_sigrelse_sighold_sigset_signal_setbuf_sbrk_rindex_rewind_reset_setexit_read_rand_srand_qsort_putw_puts_putchar_printf_pipe_pclose_popen_pause_open_nice_nargs_modf_mktemp_ltol3_ltoi_lseek_longjmp_setjmp_locv_link_unlink_ldexp_l3tol_killpg_kill_itol_isatty_ioctl_index_stty_gtty_getw_gets_getpwuid_getpwnam_getpw_setpgrp_getpgrp_getpass_getlogin_getgrnam_getgrgid_getgid_getuid_getpid_getenv_getegid_geteuid_getchar_gcvt_ftime_time_ftell_fstat_stat_fseek_sscanf_fscanf_scanf_frexp_freopen_realloc_free_malloc_fwrite_fread_fputs_fputc_fprintf_fork_fopen_fgets_fgetc_fdopen_fclose__cleanup_fflush__flsbuf_fabs_exit_execve_execv_execvp_execlp_execle_execl_getpwent_endpwent_setpwent_getgrent_endgrent_setgrent_getfsfile_getfsspec_getfsent_endfsent_setfsent_fcvt_ecvt_dup2_dup_dtol_ltod__$free_fabrab_creat_close_clearerr_utime_chown_chmod_chdir_cfree_calloc_brk_atol_atoi_atof_dysize_asctime_gmtime_localtime_ctime_alloca_alarm_access_abs_abort__end_$$$start_main_argnum_namelist_filename_infile_hflag_lflag_nflag_rflag_filhdr_e1_e2_e3_e4_e5_e6_e7_e8_e9_e10_e11_e12_procargs_startup_size_nextname_cleanup_procflags_newname_error_fatal_reversejœþ'FÖ0î7&F•f
PCV
[±v
e>N
nÜn
v¸^
~Ò¶†Á.
Œ¼æ”Ö¦œö&
£¤6
¬œ
²¦Ö¸(ö¿`Îƞ̖҂ŽÛ†ã»
éAvñsumacc/cceun/libc68.a   444      0     12      253672  3472711350   7710 !<arch>
clrerr.b        406162685   11    21    100664  118       `
 6NVÿüHî ÿü*nmÿÏLî ÿüN^Nu _S1_F1"clearerr.L18fgetc.b         406162738   11    21    100664  203       `
@cNVHî nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹XN^Nu _filbuf_S10.L10000<.L10001_F1"fgetc<.L186
fgets.b         406162742   11    21    100664  299       `
l—NVÿôHî0€ÿô*n(nS®o4S•m -R­ @H€HÀ€ÿ`
HUN¹X.m
Ç‡
fÆJ‡l¹îfB€``¶B .Lî0€ÿôN^Nub.L17 _filbuf€0_S14.L10000Z.L21\.L22L.L20>.L10001_F1"fgets.L198
fprintf.b       406162760   11    21    100664  205       `
@eNVHî/.Hn/.N¹ßü n0(HÀ€ gpÿ`B€N^Nu_S18.L10000"fprintf _doprnt:.L10001_F1:.L18
fputc.b         406162764   11    21    100664  211       `
HcNVHî nSm . nR¨"(S A€H€HÀ`/. ./N¹PN^Nu_S10.L10000"fputc _flsbufB.L10001_F1B.L18<
fputs.b         406162768   11    21    100664  281       `
TNVÿðHî0Àÿð*n(n`*S”m ",R¬ A€H€HÀ`HT /N¹P.H€HÀ,fÌ Lî0ÀÿðN^NuÀ0_S1..L10000H.L20 _flsbuf"fputs>.L20000<.L10001_F1.L20001>.L19J.L186
gets.b          406162777   11    21    100664  334       `
p–(NVÿøHî €ÿø*nS¹m 9R¹ @H€HÀ€ÿ`/<N¹X.€
gJ‡mÇ`¼J‡l
»îfB€`B .Lî €ÿøN^Nu _filbuf€ _S12.L10000"gets`.L22R.L21.L20@.L10001_F1f.L18 _iob+½
‹°
+½
‹°
4:getw.b          406162781   11    21    100664  315       `
|NVÿøHî €ÿø*nS•m -R­ @H€HÀ€ÿ`
HUN¹X.0-HÀ€gpÿ`*S•m -R­ @H€HÀ€ÿ`
HUN¹Xက‡Lî €ÿøN^Nu _filbuf€ _S1*.L10000H.L20n.L10003"getw4.L10001_F1d.L10002r.L18.h
puts.b          406162785   11    21    100664  473       `
ÙPNVÿøHî €ÿø*n`4 "9R¹ A€H€HÀ`S¹lÞ/< /N¹PH€HÀ.fÜS¹m 9R¹ @¼
H€HÀ`/</<
N¹PLî €ÿøN^Nu€ _S12.L10000N.L20 _flsbuf„.L10003*.L20002"putsD.L20000D.L10001_F1p.L10002.L20001D.L19„.L18 _iob‹°K½K½,‹°4>K½P‹°XK½^‹°r~
putw.b          406162789   11    21    100664  290       `
p‚NVÿøHî €ÿø..*nS•m "-R­ A€H€HÀ`HU /N¹PS•m à€"-R­ A€H€HÀ`HU à€/N¹PLî €ÿøN^Nu€ _S1,.L10000 _flsbuff.L10003:.L10001_F1"putwV.L10002f.L184`scanf.b         406162793   11    21    100664  462       `
œò NVHîHn/./<N¹ßüN^NuNVHîHn/./.N¹ßüN^NuNVÿìHî ÿì*n=|Aÿü-Mÿø-MÿôB®ÿð`R®ÿðJføHn/.HnÿðN¹ßüLî ÿìN^Nu_S1"Nsscanf.L23x.L25t.L24J.L21 _doscan _S3"(fscanft.L20000_F1_S2_F2"scanfp.L20001_F3$.L18 _iob‹°@†doscan.b        406162735   11    21    100664  5060      `
t€ø	¸NVÿÜHî0€ÿÜ*n(nB®ÿüB®ÿìH€HÀ.€g0€	g”€
gŠ€ g€€%g* nSmÎ nR¨ (S€ @H€HÀ€ÿ`ºH€HÀ.€%gÆB®ÿð‡*g
 LXŒ-Hÿð`H€HÀ.B®ÿø-|ÿè`.‡9n./<
/.ÿøN¹PЇ€0-@ÿøH€HÀ.‡0lÊJ®ÿøf-|u0ÿø‡lfH€HÀ.-|ÿè`(‡hfB®ÿèH€HÀ.`‡[f
HUa¤X*@ € @H€HÀ€g € .-|ÿèJ‡fpÿ`øHnÿì/./.ÿè/.ÿø//.ÿðaèßüJ€g
J®ÿðgR®ÿüJ®ÿìgþtJ®ÿüf¬pÿ`´`þb/.N¹X`$ nSmê nR¨ (S€ @H€HÀ€ÿ-@ÿô€ gÐ€	gÈ€
gÀ®ÿÿÿÿÿôgþ/./.ÿôN¹P`ýô/.N¹X-@ÿô°‡gýÞ€ÿÿÿÿfpÿ`/./.ÿôN¹P .ÿü``ý¸`ý´Lî0€ÿÜN^NuNVÿœHî Àÿœ®cg®sg
®[f0/./././.J®g n `B€/a¶ßü`¢B®ÿ¨B®ÿ¬B®ÿ¸®eg
®ff-|ÿ¸|
®of|`®xf|AîÿÀ*HB®ÿ¼B®ÿ´ nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹X.€ gÄ‡	g¼‡
f`²‡-fBR®ÿ´Ç nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹X.S®`î‡+fäS® nSl¸/.N¹X`Ä‡am‡fo‡AmÎ‡FnÄR®ÿ¬†f .ÿ¨ç€`†
f .ÿ¨å€Ð®ÿ¨ã€` .ÿ¨é€-@ÿ¨-Gÿ°‡0m‡9n‡0`‡am‡fn‡W`‡7ß®ÿ¨..ÿ°Ç nSm, nR¨ (S€ @H€HÀ€ÿ.S®m2‡0m
‡9oÿJ†gÿ‡.fH†
fJ®ÿ¸f2J®ÿ´g
 .ÿ¨D€-@ÿ¨‡ÿÿÿÿgÌ/./N¹P nB`¾R®ÿ¬`ÿf‡eg‡Ef¶J®ÿ¼f°†
f¨J®ÿ¸g¢J®ÿ¬f`šR®ÿ¼Ç nSm nR¨ (S€ @H€HÀ€ÿ`/.N¹X.‡+gþö‡-gþì‡0mÿD‡9oþØ`ÿ6`þÐ`ÿ./.N¹X`þä n ¼J®gAîÿÀ»ÈfB€`’B .ÿ¸é€€®€b0Ð@0;NûZff&&&&&&&&&&&&&**@p`HHnÿÀN¹X n P €`æHnÿÀN¹X n P €!A`Ì n P0®ÿª`À n P ®ÿ¨`´Lî ÀÿœN^NuNVÿìHî8€ÿì*n(n nB&M®cf®u0f-|B®ÿü®sf-|ÿüS”m ,R¬ @H€HÀ€ÿ`
HTN¹X.€t @H€HÀÀ®ÿüg‡ÿÿÿÿf¼-|ÿü®cfB®ÿü`d`¢®[fX-|ÿü`N €t @H€HÀÀ®ÿüf@»ügÇS®o0S”m ,R¬ @H€HÀ€ÿ`
HTN¹X.‡ÿÿÿÿfª‡ÿÿÿÿgJ®oHT/N¹P nB`
 n ¼»üg»Ëg®cgBp`B€Lî8€ÿìN^NuNVÿôHî Àÿô*nB†^fR†RB‡‡€l>J†g €t @ÿý` €t @R‡`Ò €t @ÿýR‡J‡fS`*H€HÀ.€€]gJ†gÎ €t @`Ì 
Lî ÀÿôN^Nu6.L130æ.L10032è.L88n.L79.L10020"t_instr$.L52R.L30>.L131~.L10034€.L111˜.L20006ê.L10010š.L10007 _filbufr.L42¢.L31€0_S1€.L110.L106 fltusedæ.L93
.L83Â.L73°.L10000ª.L32.L63æ.L332.L20018¸.L10019h.L23d.L22d.L25h.L21î.L34Œ.L29|.L28Z.L27".L26.L24À.L105^.L98 .L44ü.L35#t_sctab_F4¼.L89ž.L20004.L36(.L10005R.L54b.L20016.L74ž.L10017.L64¶.L45>.L37À.L104¨.L84,.L38"_doscan€8_S3 atof".L94’.L20009`.L55È.L46>.L39&.L129‚.L20014ª.L10015h.L128>.L127ª.L103.L65ì.L20002È.L47º.L10003".L126^.L99¸.L100294.L75J.L56 _ctype_.L125 .L10027Æ.L90Š.L20012N.L10013È.L48ø.L124Ò.L102j.L10025>.L85–.L20007¸.L10008>.L123".L10023j.L66j.L57".L122Ü.L10031".L95.L20010h.L80ì.L10021h.L10011².L10001æ.L20000j.L120ö.L121t.L10033ø.L101*.L76$_F14.L20019Ì.L119.L100v.L70Ü.L20005´.L674.L10006Ð.L118Ú.L91¤.L86"Ü_getccl´.L117€.L20017.L10018Ê.L59À _S2n.L814.L77¢.L1168.L96 .L68d.L20015Ø.L710.L20003Ì.L10016d_F2ì.L10004ª.L115 ungetc€.L109v.L87È.L50X.L114.L92 .L69†.L20013P.L78ž.L10014ò.L61.L82”.L20008¬.L10028º.L10009À _S4R.L113.L108v.L10026 .L72.L51È.L10002"r_innum>.L40¸.L20001R.L97<.L10024Ž.L20011B.L10012 lmulˆ.L112.L107_F3Ô.L10030Ø.L10022.L62h.L41¬ÌSBÀ.TH¤Òúp²>(>>à	ê	6xœ			*	\filbuf.b        406162750   11    21    100664  1661      `
H0upNVÿüHî ÿü*n0-HÀ€fpÿ`¢0-HÀ€@g.pÿ`Žm` 0-HÀ€gê-H€HÀ€H+@J­gÚ+m0-HÀ€gp` <//-aBP*€S•l•ÿÿÿÿfm`m B•pÿ` mH€HÀ€ÿR­Lî ÿüN^NuNVÿèHî0ðÿè*n..(MB…B„`JN¹€
f|
/N¹XÆ
g*H€HÀ€gvnò€g€g
`úpÿ`/< N¹XSŒS…gÞS…SŒ	f(|HU/<\N¹P`º/<`N¹X`¨(MB…/<d`èBSŒS…HU/<j`ÆUŒS…B„J…gJ„g g	fRŒ`l	f,	g fBSŒ S…J€fèHU/<nN¹P`¸`Ô gR„SŒS…/<rN¹X`š`€gÿn€g€€gÿ R…°‡mþ° Lî0ðÿèN^Nu
%s  XXX

%s
%s ¬.L520.L30„.L20006x.L42:.L31 _S1"_filbuf|.L10000.L63À.L53.L33"Ìx_read<.L29¨.L28¢.L27®.L26d.L23^.L216.L24^.L22".L20\.L44.L35Ä.L54r.L200044.L36†.L45.L64.L378.L38 emt_putcharÄ.L55`.L46>.L390.L20002Ö.L10003Š.L47ö.L56 emt_getchard.L48~.L20007Ê.L57–.L49‚.L10001^.L20000_F1â.L58l.L20005ô.L59ð0_S2n.L60è.L20003_F2j.L50þ.L61À.L10002¦.L51L.L40>.L20001H.L19r.L62 printfT.L41Â.L18	V&êF‰°h=n‰°z=€‰°‰° ‰°æ=쉰=

setbuf.b        406162797   11    21    100664  232       `
XhNVÿüHî ÿü*nJ­g0-HÀ€g/-N¹Xmÿó+nfm`+mB•Lî ÿüN^Nu _S1J.L22D.L21"setbuf_F1 free..L19L.L18(sprintf.b       406162801   11    21    100664  273       `
luNVÿðHîÿð=|Bÿü-nÿô-|ÿÿðHnÿðHn/.N¹ßüS®ÿðm .ÿôR®ÿô @BH€HÀ`Hnÿð/<N¹P .N^Nu_S1P.L10000 _flsbuf _doprntb.L10001_F1"sprintff.L18,\
ungetc.b        406162810   11    21    100664  252       `
dxNVÿüHî ÿü*n®ÿÿÿÿfpÿ`>0-HÀ€g
 -°­b -°­fJ•fR­R•S­ m®B€`pÿLî ÿüN^Nu _S14.L10000F.L22X.L21F.L20_F1"ungetc.L19Z.L18abs.b           406162815   11    21    100664  130       `
$>NVHîJ®l
 .D€-@ .N^Nu_S1.L13.L12_F1"absatof.b          406162830   11    21    100664  1894      `
àXðNVÿÔHî àÿÔ*nB†B…-yÿø-yÿü-y ÿð-y$ÿô-|ÿè-|ÿäH€HÀ.€ gð‡-f
-|ÿÿÿÿÿè`z‡+grS`n/9ä/9à/.ÿü/.ÿøN¹lP €0/N¹X///.ÿü/.ÿø/9,/9(N¹ßü//N¹ßü-@ÿø-Aÿü`R†H€HÀ. € @H€HÀ€fÿr‡.f’H€HÀ. € @H€HÀ€gp/9ä/9à/.ÿü/.ÿøN¹lÄ €0/N¹X///.ÿü/.ÿø/94/90N¹ßü//N¹ßü-@ÿø-AÿüS†`ÿr‡Eg‡efpH€HÀ.€+g2‡-f
-|ÿÿÿÿÿä` S`/<
/N¹P"0Ð*H€HÀ. € @H€HÀ€fÄJ®ÿäl D€*Ü…-FÿìJ†l D€,B‡`4 €g" 瀀è @/(/HnÿðN¹ßüâ†J†g
R‡‡mÄJ®ÿìl/.ÿô/.ÿðHnÿøN¹`/.ÿô/.ÿðHnÿøN¹ßü/.ÿì/.ÿü/.ÿøN¹ßü-@ÿø-AÿüJ®ÿèl//N¹P` .ÿø".ÿüLî àÿÔN^Nu\€A BÈE@I¾¼ SÉ¿enSü²ï`@€B B š.L30.L17.L42
.L31à _S1 fltusedÖ.L15ª.L10000š.L32#èexp5#àtwoe56(.L43–.L330.L34.L26Þ.L22Þ.L24Þ.L29(.L28Ü.L27l.L23Þ.L25d.L21R.L20^.L44.L35,.L20004º.L36 fnegh.L45ì.L37Ì.L38`.L46ì.L39"atofX.L47Ð.L20002 _ctype_^.L48 ldexp‚.L49p.L20000 fadd,_F1”.L20005 fcmp afdiv`.L20003š.L50 floatÎ.L51ì.L20001ì.L40 lmul fmulB.L19 afmul.L41 .L18‰°‰°‰°$‰°,‰°r‰°x-†1˜‰°¬‰°²6¸*È%ê%‰°,‰°2-@1R‰°f‰°l6r*‚5Ú%ø	<8N.|8'¨Æatoi.b          406162820   11    21    100664  458       `
„NVÿôHî Àÿô*nB‡B†`RH€HÀ€	gð€ gè€+g
€-f,R†R`&9n&/<
/N¹PHHÁЀ0.0lÔJ†g D€` Lî ÀÿôN^Nu.L17h.L16À _S1x.L10000.L15h.L14n.L23h.L22<.L20>.L21.L13z.L12B.L20002z.L10001.L20000_F1"atoih.L20001 lmul.L19.L18Ratol.b          406162835   11    21    100664  470       `
NVÿôHî €ÿô*nB®ÿüB‡`RH€HÀ€	gð€ gè€+g
€-f0R‡R`*9n*/<
/.ÿüN¹PHHÁЀ0-@ÿü0lÐJ‡g .ÿüD€` .ÿüLî €ÿôN^Nu.L17n.L16€ _S1€.L10000.L15n.L14t.L23n.L22>.L20@.L21.L13„.L12"atolD.L20002„.L10001.L20000_F1n.L20001 lmul.L19.L18Vblt.b           406162837   11    21    100664  216       `
¬ o"o €"	²€g
"/`r"/J€gD€T€°l^’€S€ÙS€lÿú €ÿÿÿügF’€ä€€m.Hç>LÙ|þHÐ|þÑü0€€lÿäLß|þJ€gS€ ÙS€lÿúJgSÙSlÿú /Nu"bltclear.b         406162839   11    21    100664  240       `
¬"/ /glÒ€ AgB S€gZ"ÿÿÿg4àHçÿ~/"|xLÑ|ÿ"@Hàÿ~Hàÿ~Hàÿ~Hàÿ~HàÿS—nè"Lß~ÿ"ÿÿÿügB YnúJ€gB S€núNuxzeros"clearˆ°2crypt.b         406162865   11    21    100664  6536      `
Ø´lpNVÿìHîàÿìB‡`J €X @H€HÀS€Ð® @ €Ð"@ €t @H€HÀS€Ð® @ €ì"@R‡‡m®B‡‡l$B…`v9ÐH€HÀ-@ÿüB†` €Ñ @ €Ð"@R††màîÿÿë9ìH€HÀ-@ÿüB†` €í @ €ì"@R††màîÿÿR… € @H€HÀº€mÿvB††l‚/<0/N¹P€І-@ÿø €  @H€HÀ€Ï @"nÿø/<0/N¹P€І€-@ÿø €¸ @H€HÀ€Ï @"nÿøR†`ÿxR‡`þÖLîàÿìN^NuNVÿèHîäÿèB†`& €Ø @H€HÀS€Ð® @ €
ˆ"@R††@mÒB®ÿø`J®gp®ÿø-@ÿü`-nÿøÿüB†` €
¨ @ €
È"@R†† màB†`P/<0/.ÿüN¹P€І @H€HÀ" AHHÁ
§ AHHÁ± € @R††0m¨B†`/</N¹P. € @H€HÀë€"	 AHHÁçÐ"
 AHHÁåÐ" AHHÁãÐ" AHHÁB‚å¡Ð"íhÒ€ €
 @H€HÀé€Ò€ AH€HÀ* å€. 怀"
è A€ 䀀"
é A€  "
ê A€ Bâ €"
ë A€R††mþöB†`> €
ˆ @H€HÀ"
h AHHÁ
ç AHHÁ³€"
¨ A€R†† mºB†† l €
È @ €
ˆ"@R†`ÞR®ÿø®ÿømýÚB†`6 €
ˆ @H€HÀ. €
¨ @ €
ˆ"@ €
¨ @‡R†† mÂB††@l& € @H€HÀ€
‡ @ .І"@R†`ÒLîäÿèN^NuNVÿìHîàÿìB‡` €8 @BR‡‡BmêB‡`8‡@l>B†`p†"à¡ €8 @R†R‡†mÚR‡R® nH€HÀ*fº/<8aû
XB‡` €8 @BR‡‡BmêB‡` €8 @ €"@R‡‡0màB‡`Ü nH€HÀ*R® €z @……Zo]……9o_…….B††l˜ ì €g„/</N¹PІ€ @H€HÀ-@ÿü/</N¹PІ€-@ÿø/</N¹PІ€  @"nÿø/</N¹PІ€ -@ÿø @®ÿÿR†`ÿbR‡‡mÿB‡`/</<8aûdPR‡‡mäB‡`\B…B†`&ã…/</N¹PІ€8 @H€HÀŠ€R††mÒ….…9o^……Zo\… €| @…R‡‡mœ €| @BJ9{f
ùz{ <zLîàÿìN^Nu:2*"
<4,$>6.&@80( 91)!	;3+#=5-%
?7/'(08@ '/7?&.6>%-
5=$,4<#+3;"*
2:!)	1991)!	:2*"
;3+#<4,$?7/'>6.&=5-%


)4%/7(3-!0,1'8"5.*2$  		


 

	

	
	
	

	



	

	

	
	

	

	


	
	


	
	


	

	

	

	
	

	

	
	

	


	

	


	

	

	

		



	
 	
.L20031Ü.L88v.L79Ê.L52ü.L30:.L111>.L20033æ.L20006æ.L31à_S1 PC2_CtPC1_DB.L110&.L20035.L106Ò.L938.L83ô.L73˜.L32L.L20037j.L63Ô.L53¢.L33F.L20039ø.L20018Ž.L27ˆ.L26ä.L29š.L34Ž.L22b.L28`.L24V.L23X.L25ØIP.L1058.L98Ò.L35¸PC2_Dî.L89Ì.L54Ü.L36Ô.L20004KSÒ.L74È.L20016t.L648eÔ.L37n.L104z.L84è
f‚.L38
.L94à_S3ô.L55¦.L20009ˆ.L39shifts|.L20014d.L103l.L65š.L200020.L99.L20028<.L75.L56à.L20026à.L90l.L20012.L102Ò.L20024š.L85p.L20007œ.L20022z.L66ø.L570.L20030.L95H.L80>.L20020.L20010X.L20000È.L120".L101.L20032F.L76_F1ÐC”.L119:.L20034î.L58Ü.L20019È
tempLEìDr.L20036.L100Ð.L70†.L67¼.L20005FP¢.L20038Š.L118Î.L91¤.L86r.L117Š.L20017ô.L59ä_S2>.L77ˆ
Lz.L116.L96|.L68.L60È.L71z.L20015_F2‚.L20003p.L115"€crypt"˜encrypth
P8.L109œ.L87preS¨
RhS"setkey¢.L114þ.L20029Ú.L92r.L78Æ.L69.L20013.L61Î.L82¨.L20027Ì.L20008ª.L113.L108´.L20025v.L51ð.L72þ.L40.L20001..L97Ž.L20023ø.L20011 lmulXPC1_C .L112v.L107_F3.L20021.L62		*	6	N‰°r	†	‰°¦‰°¬	À	ʉ°à	ê–		(	6–L	T	h	v	ª	Â	ü	–(	0	B	P	b–„		¢	¶	Ê	Þ	ö		.	D	Z	r	Ž	ž	¬	¾	Þ	è			(	4	T	b	’	Ɖ°ð			&	R–˜	¢–¼	Æ–Ø	â–ø	‰°.–X	b	˜	®©f¸‰°À‰°Ä‰°Êctype_.b        406162869   11    21    100664  180       `
„                            #_ctype_index.b         406162882   11    21    100664  179       `
,gNVÿøHî €ÿø*n.°f 
`JfòB€Lî €ÿøN^Nu.L16€ _S1.L15.L14 .L13".L12_F1"index
qsort.b         406162891   11    21    100664  1345      `
,PNVHî#î,#î0/./.N¹PЮ//.aPN^NuNVÿàHî0€ÿà.90 .®-@ÿì°‡cT ã€//.ÿìN¹P//N¹P-@ÿìЮ-@ÿø-@ÿô*n .‡(@`Ÿ®ÿø/.ÿøHUaP»îÿødˆ/.ÿøHU y,NP-@ÿðgÒJ®ÿðm\`h»îÿøfHHTß®ÿô/.ÿôHUaßüß®ÿø*nÿø`BHT/.ÿô y,NP-@ÿðf$HTß®ÿô/.ÿôa¢P`HTHUa–P™ÇÛÇ`ÿ|J®ÿðnš™Ç¹îÿôb¸»îÿøfL .ÿø®".’®ÿô°m/. .ÿôЇ/aþÖP-nÿø`þÚ/.ÿø/.aþ¾P .ÿôЇ-@`þ¾HUŸ®ÿø/.ÿøHTaLßüŸ®ÿô(nÿô`þüLî0€ÿàN^NuNVÿðHî0€ÿð-y0ÿü*n(nÔÇS®ÿüfôLî0€ÿðN^NuNVÿìHî8ÿì-y0ÿø*n(n&nH€HÀ-@ÿüÓÔîÿÿS®ÿøfèLî8ÿìN^Nu.L30L.L17.L42Ð.L20006°.L16 ulmul_S1.L32t.L338.L14°.L20Œ.L34>.L278.L228.L256.L290.L28È.L238.L26ª.L21à.L35_F4à.L36*.L20004Ú.L37"qsortÔ.L38 .L39€0_S3êqstexc8.L20002<qs1ª.L20000ºqsexc uldiv_F1*.L20005€0_S20qsesö.L20003 _F2,qscmp .L408_S4š.L20001¬.L19 lmul.L41_F3^.L18‰°‰°$‰°H"j.v‰°º‰°þ‰°Æ‰°ö
rand.b          406162895   11    21    100664  276       `
P€ NVHî#îPN^NuNVHî/<AÆNm/9PN¹P€09#ÀPrâ €ÿN^Nu_S1J.L15"rand.L13Prandx_F1_S2_F2"srand lmul‰°‰°(	.‰°<rindex.b        406162898   11    21    100664  184       `
0hNVÿôHî0€ÿô*n.(|°f(MJfô Lî0€ÿôN^Nu .L16€0_S1.L15 .L14$.L13&.L12_F1"rindexsetjmp.b        406162900   11    21    100664  99        `
$ o —HèüüB€Nu o /Lèüü.Nu"longjmp"setjmp
strcat.b        406162903   11    21    100664  180       `
,hNVÿôHî8ÿô*n(n&MJfüSÜfü Lî8ÿôN^Nu.L168_S1"strcat.L15.L14.L13 .L12_F1strcatn.b       406162907   11    21    100664  210       `
<vNVÿðHî8€ÿð*n(n..&MJfüSÜgS‡løSB ``îLî8€ÿðN^Nu..L17*.L16€8_S1.L15"strcatn.L14.L130.L12_F1strcmp.b        406162911   11    21    100664  199       `
<kNVÿøHî0ÿø*n(n`JfB€`°gòH€HÀSŒHHÁLî0ÿøN^Nu0_S1.L15".L14.L132.L12.L20000_F1"strcmp
strcmpn.b       406162914   11    21    100664  276       `
H¬NVÿôHî0€ÿô*n(n..`B€`"°fJgòS‡lòJ‡mêH€HÀSŒHHÁLî0€ÿôN^Nu€0_S1..L10000&.L15*.L14&.L13>.L12&.L20002>.L10001.L20000"strcmpn_F1.L20001strcpy.b        406162917   11    21    100664  146       `
$NNVÿôHî8ÿô*n(n&MÜfü Lî8ÿôN^Nu8_S1.L14.L13.L12_F1"strcpystrcpyn.b       406162921   11    21    100664  291       `
@ÃNVÿðHî8€ÿð*n(n&MB‡`Üg`BR‡¾®mö`R‡¾®mæ Lî8€ÿðN^Nu .L17*.L16€8_S1,.L152.L14*.L134.L12"strcpyn,.L20002 .L20000_F1.L20003.L20001(.L18
strncat.b       406162927   11    21    100664  210       `
<vNVÿðHî8€ÿð*n(n..&MJfüSÜgS‡løSB ``îLî8€ÿðN^Nu..L17*.L16€8_S1.L15.L14.L130.L12_F1"strncatstrncmp.b       406162931   11    21    100664  276       `
H¬NVÿôHî0€ÿô*n(n..`B€`"°fJgòS‡lòJ‡mêH€HÀSŒHHÁLî0€ÿôN^Nu€0_S1..L10000&.L15*.L14&.L13>.L12&.L20002>.L10001.L20000_F1"strncmp.L20001strncpy.b       406162937   11    21    100664  291       `
@ÃNVÿðHî8€ÿð*n(n&MB‡`Üg`BR‡¾®mö`R‡¾®mæ Lî8€ÿðN^Nu .L17*.L16€8_S1,.L152.L14*.L134.L12"strncpy,.L20002 .L20000_F1.L20003.L20001(.L18
swab.b          406162941   11    21    100664  209       `
PYNVÿôHî0€ÿô*n(n../</N¹P.S‡m0HÀá€2HÁàÿÐ8ÀT`âLî0€ÿôN^Nu€0_S1F.L14"swab(.L13F.L12_F1 ldiv 
abort.b         406162943   11    21    100664  54        `
NAB€Nu"abortaldiv.b         406162944   11    21    100664  208       `
ŒNVHç<*< n lD€D…&".lDD…(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚ J…lD€ €Lß<N^Nu ulmul"aldiv+²lalmul.b         406162946   11    21    100664  130       `
TNVHç8(< n$lD‚D„&.lDƒD„B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐJ„lD€ €LßN^Nu"almulalrem.b         406162948   11    21    100664  212       `
NVHç8(< n lD€D„$".lDlB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€J„lD€ €LßN^Nu ulmul"alrem+²nauldiv.b        406162950   11    21    100664  185       `
tNVHç8 n &".(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚  €LßN^Nu ulmul"auldiv+²Z
aulmul.b        406162952   11    21    100664  99        `
4NVHç0 n$&.B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐ €LßN^Nu"aulmul
aulrem.b        406162953   11    21    100664  185       `
tNVHç0 n $".lB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€ €LßN^Nu ulmul"aulrem+²Z
chrtab.b        406163071   11    21    100664  1583      `
$$~$$~$$>A@>A>ab#C8DH00IFF9         I**I~ @$BBBBBB$8D @@|~D8$D~|@@XdB$<B@XdBBB$~   "A">AAAA>"AAA#   @ @  @$B<BAMSQQQI&"AAAAAA~AAA~AAAA~>A@@@@@@A>~AAAAAAAA~~@@@x@@@@@@@|@@@@@>A@@OAAAA>AAAA~AAAAADD8ABDHPpHDBA@@@@@@@@@AcUIAAAAAAAaQIECAAAA>AAAAAAAA>~AAA~@@@@@>AAAAAAYE>~AAA~DBAAA>A@@>A>AAAAAAAAA>AAAAAAA"AAAAIIUcAAAA""AAAA" @@@ 88"ÿ <>BB>@@@@|BBBB|<B@@B<>BBBB><B|@B<~>BBBB>B>@@@@|BBBBB(@@@@FHPpHFvIIIII@|BBBBB<BBBB<|BBBB|@@@@>BBBB>\b@@@@>@<B<~BBBBB=AAA"IIIII6B$$BBBB" @~ ~ *~~~~~~~~~~#chrtab
ddtinit.b       406163117   11    21    100664  101       `
5NVHîN^Nu_S1
.L12_F1"ddtinit
exit.b          406163074   11    21    100664  110       `
2NVÿüHî€ÿü..NNLî€ÿüN^Nu€_S1.L12"exit_F1getenv.b        406163109   11    21    100664  804       `
ŒD NVÿüHîÿü-|Œÿü`0 nÿü//.a0PJ€f/.N¹X nÿü"Ò€R `X®ÿüJ®ÿüfÊB€N^NuNVHî`  .R® @".R® A°gp`
 nJfØB€N^NuTk{„PATH=/usr/sun/bootfileHOME=/mnt/guestTERM=sunUSER=guestL.L17_S1„.L15{.L14„.L26|.L27†.L24|.L25@.L22D.L20k.L13T.L12#Œenvp"getenv"Pstrpref\.L20002D.L20000_F1_S2 strlen_F2.L20001J.L19@.L18‰°,iîiîiîiîstrlen.b        406162924   11    21    100664  178       `
$nNVÿøHî €ÿø*nB‡`R‡Jfú Lî €ÿøN^Nu€ _S1.L14.L13.L12.L20000_F1"strlen.L20001signal.b        406163115   11    21    100664  436       `
T@NVHîN^NuNVHîN^NuNVHîN^NuNVHîN^NuNVHîN^NuNVHîN^Nu&.L16_S1.L14P.L22B.L20_S6
.L12_F4"sighold_S3_F5"	*sigignore_S5_F1_F6"signal_S2"8sigrelse_F2"Fsigpause_S4"sigset4.L18_F3stubs.b         408926823   121   21    100644  515       `
h<(NVHî/./<hN¹PN^NuNVHî/<ŽaÎXN^NuNVHî/<“a¶XN^NuNVHî/<™ažXN^NuThe routine %s is not implemented!!!
timeftimelocaltimeŽ.L174.L16_S1h.L14d.L22™.L23“.L20.L12_F4"8ftime_S3_F1"
noSuchProc" time_S2_F2_S4"	PlocaltimeL.L19_F3 printf‰°‰°,‰°D‰°\
printf.b        406163081   11    21    100664  233       `
@qNVHî/<Hn/.N¹ßü09HÀ€ gpÿ`B€N^Nu_S18.L10000 _doprnt:.L10001_F1:.L18 _iob"printf‹°‹°&
doprnt.b        406162709   11    21    100664  3119      `
ô«hNVÿ4Hî<üÿ4*n(n&nAîÿt$H`œÇ`–%fôAîÿtµÈg(HS/<Aîÿt 
ˆ/HnÿtN¹ßüAîÿt$HB.ÿhB„| ÿi-fR.ÿhR0f|0ÿiR*g2B…H€HÀ€0,m2†	n*/<
/N¹PІ*`Ò`RH€HÀ€0,*B.ÿg†0†.fR*g<B„` †	n(R.ÿg/<
/N¹PІ(H€HÀ€0,lІ0`RH€HÀ,R.ÿg( €egFnP€Ogön€%gd€Dgê€Lgx€Ug˜€XgÊ€cg€dgº€og¦n€fgT€ggâ€lg(€rg0€sgö€ug4€xgh`ÞH€HÀ€dgZ€ogH€ug
€xg>S$v
J‚fJ„fü0Aîÿj-HÿüJ‚gZ//N¹P,†
l&p0`$v$`Èv`øv
J”lü- D€$`²`¬$`¬pWІ nÿü€R®ÿü//N¹P$`¢Aîÿj .ÿü°ˆc¸S®ÿü nÿüÐ`æ LXŒ-HÿüB††l˜ .ÿüR®ÿü @ÐfSŠR†`â-\ÿüf-|ôÿü,f,<ÿ$nÿüJgjS†mdRŠ`ð`\(T*\`ÆJ.ÿgfxHnÿøHnÿô//,/N¹ßü-@ÿüPŒJ®ÿøgü-,.ÿônü0` nÿüÐR®ÿüS†nò,gü. .ÿôD€-@ÿôoS†m
ü0S®ÿônòJ†oÖS†mÐ nÿüÐR®ÿü`î`ØJ.ÿgfx`R„HnÿøHnÿô//,/N¹ßü-@ÿüPŒJ®ÿøgü- nÿü0fR®ÿô nÿüÐR®ÿüü.,`
 nÿüÐR®ÿüS†nòüeS®ÿôJ®ÿômü+`ü- .ÿôD€-@ÿô/<
 .ÿô/N¹P€0À/<
 .ÿô/N¹P€0ÀAîÿt-Hÿü 
®ÿü"’€,lB†J.ÿhf D€,.ÿiH€HÀ/HS/ 
®ÿü//.ÿüN¹ßü`ûŠJ.ÿgfxHR//,/N¹ßüPŒJfüSŠ`Šü%fûhAîÿtµÈg"HS/<Aîÿt 
ˆ/HnÿtN¹ßüLî<üÿ4N^Nu(null)X.L79.L52î.L88Š.L30æ.L111 fcvt<.L42¸.L31&.L20006ü<_S1 fltusedØ.L110Š.L106D.L93ô.L83^.L10000–.L73Ì.L32\.L63ä.L43.L530.L33À.L22Ú.L24 .L34º.L29‚.L28t.L27\.L25,.L23º.L21f.L98<.L44€.L105.L35â.L20004<.L54ö.L89.L36º.L74.L64<.L450.L37@.L104 ecvtÖ.L84Ú.L38D.L94B.L46>.L20009<.L552.L39 _stroutl.L103.L65B.L47.L20002@.L75X.L99
.L56þ.L90F.L48ê.L124@.L102æ.L85.L20007"_doprntB.L57.L66¶.L123F.L49º.L20000d.L80@.L95`.L10001f.L122~.L101 .L76 uldiv¶.L120Ž.L121Ì_F1².L119B.L58º.L20005f.L100l.L67|.L70®.L118*.L91ê.L86F.L59º.L77¾.L81–.L1166.L96|.L68F.L60 ulrem@.L71è.L20003 gcvtŽ.L115Æ.L109Ú.L87X.L50.L1146.L92H.L78H.L61.L69Ì.L82.L20008ú.L113¸.L108@.L72.L51Þ.L40 .L20001L.L97 lmulê.L18â.L112Œ.L107Z.L62Þ.L414Lx¬xþb(Nr‰°Æ,žNb24€e¢4à
gcvt.b          406162773   11    21    100664  972       `
`4NVÿìHî0€ÿìHnÿüHnÿø/././.N¹ßü*@(nJ®ÿügü- .S€.` 
Ї @0f
S®S‡J‡nêJ®ÿøm .ÿø®€nJ®ÿølv®ÿÿÿýÿøllS®ÿøÝü.~`ÝR‡¾®möüeJ®ÿøl .ÿøD€-@ÿøü-`ü+/<
/.ÿøN¹P€0À/<
/.ÿøN¹P€0À`ZJ®ÿøn0gü.J®ÿøl
R®ÿøü0`ð~`ݾ®ÿøfü.R‡¾®oì .°®ÿøm`ü0 .R®°®ÿømîü.,.ÿÿfSŒB .Lî0€ÿìN^Nu$.L30V.L174.L20006.L31Z.L16€0_S1 fltused.L32€.L10000T.L15F.L33:.L14V.L134.L34.L29.L28ü.L26ü.L27.L25F.L24¶.L23².L22˜.L20’.L21B.L35P.L36.L20004 ecvt’.L200020.L20007p.L10001V.L20000_F1.L20005 ldivŽ.L20003 lrem"gcvtD.L20001.L19ì.L18 "Â$Üstrout.b        406162807   11    21    100664  616       `
  NVÿôHî0€ÿô*n..(nJ®lˆ-f<®0f2S”mH€HÀ",R¬ A€H€HÀ`HTH€HÀ/N¹PS‡S”m .",R¬ A€H€HÀ`HT ./N¹PR®`„HTH€HÀ/N¹PS‡m2S”mæH€HÀ",R¬ A€H€HÀ`ÞHT ./N¹PS®J®gS”mâ .",R¬ A€H€HÀ`ÚLî0€ÿôN^NuÖ.L10007€0_S1L.L10000ü.L26Ú.L24Ú.L25¤.L20 _flsbuf`.L21¤.L23¤.L10005"_stroutŒ.L10003^.L10001_F1Æ.L10006’.L10004|.L10002.L19ü.L18X†žÐflsbuf.b        406162757   11    21    100664  1036      `
´0NVÿäHî8àÿä*n0-HÀ€f pÿ`˜(m¹üf>»üNqm0-HÀ€gØnÿÿ|..ÿÿH€HÀ/N¹XB•`<`Ê -Œ.,o +LB…&Lº‡lH€HÀ/N¹XR…`è*¼ÿî+L¼‡g
m pÿ` .Lî8àÿäN^NuNVÿôHî0€ÿô*n0-HÀ€€f8(m¹üg, -Œ.o"+L*¼ S‡J€g LRŒHPN¹X`èB€Lî0€ÿôN^NuNVÿüHî ÿü*|»ùdHUaXÛü`êLî ÿüN^NuNVÿøHî €ÿø*n~ÿ0-HÀ€g*0-HÀ€@fHUaÿ:X.0-HÀ€gB­mÿ€B• Lî €ÿøN^Nu _lastbuf€.L308.L42´.L31à8_S1.L33.L34˜.L29”.L28˜.L27j.L26¦.L24<.L20l.L25".L22<.L21"_flsbufª.L44.L35_F4.L36 .L45N.L38 .L46 _S3"Âfflush"(_cleanup"Xfclose6.L20000_F1€0_S2 putchar_F2€ _S4F.L40N.L41_F3 _iob¸.L18Kº%0`Ž‹°%4Kº:data.b          406162690   11    21    100664  440       `
D<@#@_lastbuf _sobuf _sibuf#_iobkîkîiî@ecvt.b          406162879   11    21    100664  2179      `
4 ˆNVHî/</././././.a:ßüN^NuNVHî/</././././.a
ßüN^NuNVÿäHî0€ÿäJ®lB®®Om-|NB‡ nB*|4/9ˆ/9„/./.N¹l" n ¼/./.N¹P-@-AHnÿø/./.N¹ßü-@-A(|„/9/9Œ/.ÿü/.ÿøN¹gò(|„/9˜/9”/.ÿü/.ÿøN¹g–Hnÿø/9 /9œ/.ÿü/.ÿøN¹ßü//N¹ßü-@ÿð-Aÿô/9°/9¬/9¨/9¤/.ÿô/.ÿðN¹ßü//N¹ßü//N¹P€0SŒ€R‡`ÿP¹ü„dÜ`ô .€4(@J®fÙÇ n ‡¹ü4dxB94` /9¸/9´/./.N¹o¸/9À/9¼/./.N¹ßü-@ÿð-Aÿô/9È/9Ä//N¹lÿx-nÿð-nÿôS‡`®»Ìb^»ü„dV/9Ð/9ÌHnN¹ßüHnÿð/./.N¹ßü-@-A/.ÿô/.ÿðN¹P€0À`ž¹ü„eB9ƒ`>*LZ`0SŒR`*¼0¹ü4bî¼1 nRJ®f»ü4c¼0R9nÐB <4Lî0€ÿäN^NuB =õÂ\(õÃB B @€B ¬.L304.L17*.L16t.L42Î.L31"0fcvt_S1Ú.L32\.L15 fltusedÖ.L43Ú.L33Ú.L34Î.L26¤.L29œ.L28”.L27.L25.L23Œ.L24Ò.L21„.L22†.L20,.L13Ì.L44´.L35".L36æ.L45Ú.L37 fneg¼.L38"ecvt.L46Ä.L39€0_S3".L47ò.L20002þ.L48 fdiv fix`cvt.L49 modf.L20000 fadd_F1_S2 fcmp$.L20003_F2.L50.L51ì.L20001î.L40 fmult.L19 afmult.L41_F3‰°‰°–‰°œ/ªÄ*à‰°ô‰°ú‰°/‰°‰°‰°$/2‰°@‰°F&T*d‰°x‰°~‰°„‰°Š,˜6¨'¸IºÐ	àIºö‰îþ‰°‰°/‰°$‰°*68‰°L‰°R/\Iºz‰°‚‰°ˆ8’*ª'ÆIºØ‰îàIºøIº‰°&
lmul.b          406162968   11    21    100664  125       `
P
NVHç8(<$.lD‚D„&.lDƒD„B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐJ„lD€LßN^Nu"lmul
uldiv.b         406162973   11    21    100664  184       `
tNVHç8 .&".(lH@€ÿÿ€Á40€ÁH@0H@`6â€â€ÿÿÿÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚ LßN^Nu ulmul"uldiv+²\ulrem.b         406162976   11    21    100664  180       `
pNVHç0 .$".lB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€LßN^Nu ulmul"ulrem+²Xtermbas.b       406163096   11    21    100664  1677      `
Ì€IÀNVHî nJg R® @H€HÀ/N¹X`ÞN^NuNVHî`"€cgF€hgD€vgF/<:a¤X/<÷ašXB¹ÌN¹€€?fº/<`ÐR¹ÌR¹Ì``ÄN^NuNVHî/<N¹XN^NuNVHî 9Ì€g€g
€g`Ha¸ 9̀Р@H€HÀ/N¹X .€ /N¹X .€ /N¹XN^NuNVHîaÿb 9Ìå€€Ô @ Ю @H€HÀ/N¹XN^NuNVHîaÿ( 9Ì€à @H€HÀ/N¹XN^NuNVHîaþø 9Ì€ä @H€HÀ/N¹XN^NuÿÿÿÿYYaèíòJJKKABCDABCD;<=>
Supply terminal type (hit ? for help)
 v=vt52, h=h-19, c=concept Unknown type."	ºcursorpos˜.L30"jclearscreen,.L42z.L31_S1ò.L16‚.L32í.L15Æ.L53â.L43.L33è.L14#Ðcursmoš.L27÷.L28š.L25Š.L34^.L26,.L22,.L20
.L21_S6Ê.L44.L35_F4–.L36 getcharä.L45T.L37#Ôcursdi:.L38ä.L46_S3ä.L47\.L20002_F5#äcleolf.L49^.L20000_S5_F1#Ìtermtype_F6"žesc_char_S2"	0queryterm putchar"	šclearlineZ.L20003_F2_S7_F7"
0cursorstep#àcleos–.L51_S4¶.L40<.L20001"putstr_F3/$‰°V‰°`	îjp‰°„鼌鼒/°‰°Æ‰°è	î/þ//&‰°@	H/`‰°z	€/‰°ª	°/Àiîiîiî
getchar.b       406163077   11    21    100664  133       `
INVHîN¹N^Nu_S1.L12"getchar emt_getchar_F1
putchar.b       406163085   11    21    100664  153       `
(INVÿüHî€ÿü.H€HÀ/N¹XLî€ÿüN^Nu€_S1.L12 emt_putchar_F1"putchar
emtgetchar.b    406162986   11    21    100664  142       `
JNVHî/<N¹XN^Nu_S1.L12 emt_call"emt_getchar_F1emtputchar.b    406162991   11    21    100664  154       `
(JNVHî.H€HÀ//<N¹PN^Nu_S1".L12 emt_call"emt_putchar_F1fbmode.b        406163033   11    21    100664  141       `
 ENVHî/./<N¹PN^Nu_S1.L12 emt_call_F1"fbmode
getconfig.b     406163029   11    21    100664  144       `
LNVHî/<N¹XN^Nu_S1.L12 emt_call_F1"
emt_getconfiggetcontext.b    406162995   11    21    100664  145       `
MNVHî/<ÿÿÿýN¹XN^Nu_S1.L12 emt_call"emt_getcontext_F1
getmemsize.b    406162999   11    21    100664  145       `
MNVHî/<N¹XN^Nu_S1.L12 emt_call_F1"emt_getmemsize
getsegmap.b     406163003   11    21    100664  156       `
(LNVHî/././<ÿÿÿþN¹ßüN^Nu_S1$.L12 emt_call"
emt_getsegmap_F1mayget.b        406163050   11    21    100664  275       `
T‡NVHîySu@f/<N¹X`*/<N¹XJ€fpÿ`/<N¹X€N^Nu:.L16_S1$.L13N.L12 emt_call linereadyrx_F1"
emt_mayget lineget,B
mayput.b        406163055   11    21    100664  291       `
d‡NVHîySu@f.H€HÀ//<	N¹P`0/<N¹XJ€fpÿ`.H€HÀ//<N¹PB€N^NuD.L16_S1 lineput linereadytx..L13^.L12 emt_call"
emt_mayput_F1&6V
ttyio.b         406163105   11    21    100664  1402      `
NVHî#îtN^NuNVÿüHî ÿü*| Jg .倀` @`êLî ÿüN^NuNVHî .倀` @¼(N^NuNVHî .倀` @H€HÀN^NuNVHî .倀` @®N^NuNVHî .倀` @H€HÀ€N^NuNVHî .倀` @H€HÀ€N^NuNVÿøHî0ÿø . Ю*@ .倀`(@®.•Lî0ÿøN^NuNVÿøHî0ÿø . Ю*@ .倀`(@®.FÁ•Lî0ÿøN^NuNVHî/</</.aÿbßüN^NuNVHî/</</.aÿzßüN^NuNVHî/</</.aÿßüN^NuNVHî/</</.aÿ*ßüN^NuDáê..L30&.L17_F13_S12_F11_S10<.L16_S1p.L320_S9_F8"Ðlinereadytx"ˆlineput"	Êlinearmtxž.L34"	zlinearmrxô.L28Ì.L26¤.L24„.L22b.L20.L13_S6Æ.L36"ølineset_F4"¨linereadyrxî.L38_S3_F9"¢linedisarmrx"	8lineclear_F50_S8# NECinit"òlinedisarmtx_S13_F12_S11_F10_S5_F1_F6 _S2"flineget_F2_S7"Flineresettxint_F7.L40_S4"lineservice"	linereset_F3<.L18#wreg1‰°"	
	Jsetcontext.b    406163007   11    21    100664  149       `
 MNVHî/./<ÿÿÿüN¹PN^Nu_S1.L12 emt_call_F1"emt_setcontext
setecho.b       406163011   11    21    100664  142       `
 FNVHî/./<N¹PN^Nu_S1.L12 emt_call_F1"setechosetsegmap.b     406163015   11    21    100664  160       `
,LNVHî/./././<ÿÿÿÿN¹ßüN^Nu_S1"
emt_setsegmap(.L12 emt_call_F1ticks.b         406163019   11    21    100664  140       `
HNVHî/<N¹XN^Nu_S1.L12 emt_call"	emt_ticks_F1version.b       406163024   11    21    100664  142       `
JNVHî/<N¹XN^Nu_S1"emt_version.L12 emt_call_F1emtcall.b       406162981   11    21    100664  122       `
$6NVHî/./././.NOPN^Nu_S1.L12"emt_call_F1asin.b          406163126   11    21    100664  1502      `
4XÚXNVÿðHîÿð-y<ÿø-y@ÿü/9H/9D/./.N¹l(/./.N¹P-@-A-yLÿø-yPÿü/9X/9T/./.N¹o#ü! 9\"9``ü/./././.N¹ßü///9h/9dN¹ßü//N¹P-@ÿð-Aÿô/9p/9l/./.N¹oF/././.ÿô/.ÿðN¹ßü//N¹P///98/94N¹ßü`(/.ÿô/.ÿð/./.N¹ßü//N¹P-@ÿð-Aÿô/.ÿô/.ÿð/.ÿü/.ÿøN¹ßüN^NuNVHî/9x/9t/./.N¹l/./.N¹P-@-A/9€/9|/./.N¹o#ü! 9„"9ˆ`*/./.aýòP///98/94N¹ßüN^Nu@ÉÚ¢!hÂ@€À€@€@€@3333333@€Ð.L30<.L17t.L31Ž.L16_S1.L32 fltused|.L33..L29„.L34r.L27B.L25l.L26d.L24\.L23”.L21T.L22L.L20 sqrt fneg4pio2"’acos"asin fdivn.L20000_F1 fsub_S2 fcmp atan_F2j.L20001 fmulD.L19^.L18 errno‰°‰°‰°‰°"0@‰°P‰°X‰°`‰°ft‹°#€‰°†‰°Œ ¦‰°¶‰°¼ÂÒ‰°â‰°èö‰°*‰°06Td „‰°ž‰°¤²Â‰°Ò‰°Øæ‹°#ò‰°ø‰°þ‰°‰°$atan.b          406163138   11    21    100664  3277      `
 °HNVHî/9/9/./.N¹o/./.a2`$/./.N¹P//aP//N¹PN^NuNVHî/./././.N¹ßü/././/N¹f</9/9/./.N¹m 9°"9´`œ/9´/9°`„/9$/9 /./.N¹lò/9,/9(/./.N¹mn/./././.N¹P//N¹ßü//a&P///9´/9°/9´/9°N¹ßü//N¹ßü`ä/./././.N¹ßü//aÄP///9´/9°/9´/9°N¹P//N¹ßü//N¹`/94/90/./.N¹o$/./././.N¹ßü//aB`:/./././.N¹P//N¹ßü//aP//N¹PN^NuNVHî/9¬/9¨/./.N¹l/./.aâP`Ø/9¤/9 /./.N¹oB/././9</98N¹ßü//a˜P///9´/9°N¹`r/9L/9H/./.N¹ßü///9D/9@/./.N¹ßü//N¹ßü//a"P///9¼/9¸N¹ßüN^NuNVÿðHîÿð/./././.N¹ßü-@ÿø-Aÿü/9ä/9à///9Ü/9Ø///9Ô/9Ð///9Ì/9È///9Ä/9ÀN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿð-Aÿô/9/9/.ÿü/.ÿø/9/9/.ÿü/.ÿø/9ü/9ø/.ÿü/.ÿø/9ô/9ð/.ÿü/.ÿø/9ì/9è/.ÿü/.ÿøN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü///.ÿô/.ÿðN¹ßü-@ÿð-Aÿô/././/N¹ßüN^NuA‚y™üï2?ÔÌÏçy’@ÉÚ¢!hÂ@IÚ¢!hÂB:¨Iùv‚D†6v1T÷‡E ðr¤O
EÞ‹R
E`2Mf·CkÓð´KEûã\QÂEÐYòW…Fõ\*~E`2Mf·@€@€@€^.L31_S1Ô.L32 fltusedš.L43Ä.L33Øatanp1.L34Z.L264.L28.L29ø.L44â.L35¸pio4_F4j.L20004 .L36atanq0¨sq2m18.L45"txatan|.L37 fnegÈatanp3°pio2(.L38 sq2p1@.L46_S3".L39H.L47V.L20002øatanq2š.L48 fdiv"^atan2X.L20000"bsatan fadd_F1àatanp0 fsubèatanq4_S2Ðatanp2 fcmp"atanr.L20003_F2atanq1Àatanp4_S4\.L200010.L40 fmulp.L41_F3ðatanq3‰°‰°- >T&z-’‰°š‰° -®‰°¶‰°¼‰°Æ‰°Ì‰°Ö‰°Ü-ꉰô‰°ú- ",‰°F‰°L‰°R‰°X&^)n"Ž‰°¨‰°®‰°´‰°ºÀ)Ì&܉°ä‰°ê-ø"4"@X‰°n‰°t-‚‰°œ‰°¢-°‰°À‰°Æ"̉°æ‰°ì)ò‰°ú‰°&‰°‰°$)2"B‰°Z‰°`&f6‰°¤‰°ª‰°´‰°º‰°Ä‰°Ê‰°Ô‰°Ú‰°ä‰°ê6ð&6& 60&@6P&`‰°t‰°z‰°ˆ‰°Ž‰°œ‰°¢‰°°‰°¶‰°Ä‰°Ê&Ø6è&ø6&6(&86H&X"p6
fabs.b          406163203   11    21    100664  266       `
Lv NVHî/9P/9L/./.N¹l/./.N¹P-@-A .".N^Nu_S1 fltusedL.L14>.L13F.L12 fneg_F1 fcmp"fabs‰°‰° 0hypot.b         406163144   11    21    100664  929       `
x(9¨NVÿøHîÿø/9|/9x/./.N¹l/./.N¹P-@-A/9„/9€/./.N¹l/./.N¹P-@-A/./././.N¹o$-nÿø-nÿü-n-n-nÿø-nÿü/9Œ/9ˆ/./.N¹f 9"9”`t/./.HnN¹ßü/./././.N¹ßü///9œ/9˜N¹ßü//N¹P///./.N¹ßüN^NuNVHî/./././.aþ”ßüN^Nu@€€.L17r.L16_S1 fltusedx.L15>.L14t.L24˜.L22L.L13.L21ˆ.L20 sqrt fneg"hypot fadd_F1_S2 fcmp_F2 afdiv"Pcabs fmulØ.L19®.L18‰°‰° 0‰°@‰°FTd„‰°°‰°¶ĉ°Ì‰°Ò扰‰°.B
jn.b            406163158   11    21    100664  3024      `
dXìNVÿÔHîÿÔJ®l" .D€-@/./.N¹P-@-AJ®f$/./.N¹`/./.N¹P`N®gâ/9h/9d/./.N¹f 9l"9p`/./.N¹P".²€nê/./.N¹P-@ÿô-Aÿø/./.N¹P-@ÿì-Aÿð-|ÿü`–-nÿìÿä-nÿðÿè/.ÿø/.ÿô/.ÿð/.ÿì/././.ÿüN¹X///9x/9tN¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿì-Aÿð-nÿäÿô-nÿèÿøR®ÿü .ÿü°®mÿb .ÿì".ÿð`/./././.N¹ßü-@ÿÜ-Aÿà-y|ÿÔ-y€ÿØ .€-@ÿü`d/.ÿØ/.ÿÔ/.ÿüN¹X///9ˆ/9„N¹ßü//N¹ßü///.ÿà/.ÿÜN¹ßü-@ÿÔ-AÿØS®ÿü .ÿü°®n’/.ÿØ/.ÿÔ/.N¹X///9/9ŒN¹ßü//N¹ßü///./.N¹ßü-@ÿÔ-AÿØ-@ÿô-Aÿø-y”ÿì-y˜ÿð .S€-@ÿü`–-nÿìÿä-nÿðÿè/.ÿø/.ÿô/.ÿð/.ÿì/././.ÿüN¹X///9 /9œN¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿì-Aÿð-nÿäÿô-nÿèÿøS®ÿüJ®ÿünÿf/.ÿð/.ÿì/./.N¹P///.ÿØ/.ÿÔN¹ßü//N¹ßüN^NuNVÿàHîÿà/9¨/9¤/./.N¹n#ü! 9¬"9°`v-|ÿøJ®l* .D€-@/</N¹P€f-|ÿÿÿÿÿøJ®f/./.N¹P`$®f/./.N¹P//`æ/./.N¹P-@ÿð-Aÿô/./.N¹P-@ÿè-Aÿì-|ÿü`–-nÿèÿà-nÿìÿä/.ÿô/.ÿð/.ÿì/.ÿè/././.ÿüN¹X///9¸/9´N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿè-Aÿì-nÿàÿð-nÿäÿôR®ÿü .ÿü°®mÿb/.ÿì/.ÿè/.ÿøN¹X//N¹ßüN^NuAAA@€AÿÿÿþÿÿÿþAˆ.L52¨.L42V.L20006_S1 y1`.L73 fltusedh.L63|.L532.L43\.L44`.L20004t.L54H.L20016,.L74`.L64f.L45 fneg0.L20009 y0|.L55’.L46P.L20014œ.L65<.L20002d.L47 j0<.L758.L56T.L20012 fdivl.L48 fixV.L20007`.L66F.L57¬.L49œ.L20010|.L200000.L76,_F1<.L58 fsub$.L70ì.L67Ì.L20005D.L20017_S2„.L59 j1´.L77 fcmp¤.L68"¬ynŒ.L60"jnN.L20015$.L71 _F2Ø.L20003 lrem”.L50R.L20013¬.L69”.L61 floatH.L20008>.L72x.L51è.L20001Z.L20011 fmul\.L62 errno$B1R‰°h‰°n3|‰°„‰°Š œ¶1ÎA‰°‰°$G*:GJ*ZG¦‰°º‰°ÂA扰ò‰°øGþ*&AT‰°`‰°fGl*|”‰°°‰°¸Aö‰°‰°GG.*>zGŽž‰°¸‰°¾3Ì‹°I؉°Þ‰°ä<4Rj‚AƉ°Ò‰°ØGÞîGþ*AJGVj0.b            406163175   11    21    100664  4501      `
Tˆ˜NVÿäHîÿä/9	h/9	d/./.N¹l/./.N¹P-@-A/9	p/9	l/./.N¹oÞ/./.aŒP/9`/9\/./.N¹ßü-@ÿð-Aÿô//N¹P///9/9N¹ßü///.ÿô/.ÿðN¹P///9/9N¹ßü//N¹ßü///././9X/9TN¹ßü//N¹P//N¹`/./././.N¹ßü-@ÿø-Aÿü-y	tÿð-y	xÿô-y	|ÿè-y	€ÿì-|ÿä`– .ÿä瀀d @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀¬ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßüN^NuNVÿäHîÿäB¹/9	ˆ/9	„/./.N¹n#ü! 9	Œ"9	`f/9	˜/9	”/./.N¹oÞ/./.a@P/9`/9\/./.N¹ßü-@ÿð-Aÿô//N¹P///9/9N¹ßü///.ÿô/.ÿðN¹P///9/9N¹ßü//N¹ßü///././9X/9TN¹ßü//N¹P//N¹`f/./././.N¹ßü-@ÿø-Aÿü-y	œÿð-y	 ÿô-y	¤ÿè-y	¨ÿì-|ÿä`– .ÿäç€€Ô @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀	 @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/./.N¹P///./.aûrP///9X/9TN¹ßü//N¹ßü///.ÿì/.ÿè/.ÿô/.ÿðN¹ßü//N¹ßüN^NuNVÿäHîÿä/./././.N¹ßü///9	°/9	¬N¹ßü-@ÿø-Aÿü-y	´ÿð-y	¸ÿô-y	¼ÿè-y	Àÿì-|ÿä`– .ÿä瀀ô @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀, @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü#À#Á-y	Äÿð-y	Èÿô-y	Ìÿè-y	Ðÿì-|ÿä`– .ÿä瀀d @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀œ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü///././9	Ø/9	ÔN¹ßü//N¹ßü#À#ÁN^Nu@"ùƒnND@IÚ¢!hÂbÕø
Ä%0áÌ3îbþ_±#BPp)ªÜòð,Z«µyY£9#ÕëO™1´¹gQºÌ?ÐëÍ_Í‚Îíù#õGÑÓ¼µ.KàbÕø
Ä%0_–®ÉlÑ[ÖéÍ&-âÆWÍ#Cøê×´S‘m“9Œ>O½z½1a Jˆ`ɦö0Eªb	p›çÆ@€K¤˜š*ðï^L<-`ħ5L_qtà}UJö:C¯µ·I_©Ï
lFTYÒ-®+K¤˜š*ðï^L<D†:U>õL“ÑöJ÷3Viš8IXn’‰Þ2F#{67êá³@€Æy	à²[–¯Ç"5ªþÄeǼC箯ÛÆßLy»‘ÄbCX,ËFHÁœcïüÅiåIy	à²[–¯J"Ç–ÈlçJ2µÐ“CI]T…ÒÇ)Guc‘R4Ä-DÌb¿q–ëë@€à¾ÖçÐâadŒ„›{ß‘¢¤±ÏT\ô\&À+*äÙ»l¾ƒt¸/V;¡WÿÒÊ.\¥~Ma¥Áª
#×È!šZßìë|b¡œX£ý_h¹ÔZ»/§[ªIûïìuW¦¨räµSs\Wª@n¸O
*Ÿ GÁ4JtŽjB¸'ûE N}µ¹Õ@€BÿÿÿþÿÿÿþBC€BÔ	.L88¼	.L79ü.L20006_S1Ôj0p4Ä	.L83d.L73 fltused$.L63 sqrt\pio4Ô.L20004@.L54p.L74.L64 fneg	j0q4dj0p3Ì	.L84X.L20009_S3"Dy0>.L55 log pzeroî.L65:.L20002"j0h.L75d	.L56œj0q3 fdivôj0p2è.L85h.L20007 sinTtpiŠ.L668.L57ø.L80.L20000P.L76 faddòasympt_F1,j0q2 fsubl	.L58è.L20005”	.L70„	.L67dj0p1ô.L86_S2.L81¬	.L77 fcmp¬j0q1Œ	.L68t	.L60h.L20003œ	.L71_F2 qzeroì.L87´	.L78„.L69|	.L61ì.L20008ü.L82 cos¤	.L72ˆ.L20001 fmul_F3.L62 errno‰°‰°8 0‰°@‰°F8T‰°l‰°r.€#˜‹°?¤‹°?ªI°FÈ‹°Ô‹°ÚIà.ð‰°‰°	$I0IJ‰°^‰°f‰°n‰°v	I®*¾	ØIö*6‹îLP‰°V‰°\8j‹°Lv‰°|‰°‚‰°Œ‰°’8 ‰°¸‰°¾.ÌFä‹°?ð‹°?öIü#‹° ‹°&I,*<‰°T‰°Z`	pI|I–‰°ª‰°²‰°º‰°Â	ÜIú*
	$IB*Rz‰°˜‰°žI¤I´Ô*äI‰°‰°$*‰°>‰°F‰°N‰°V	pIŽ*ž	¸IÖ*æ‹°"‹°(‰°.‰°6‰°>‰°F	`I~*Ž	¨IÆ*Ö‰°‰°$*I:‹°?F‹°?L
j1.b            406163193   11    21    100664  4982      `
TÈ"NVÿÜHîÿÜ-nÿà-nÿä/9
ˆ/9
„/.ÿä/.ÿàN¹l/.ÿä/.ÿàN¹P-@ÿà-Aÿä/9
/9
Œ/.ÿä/.ÿàN¹oD/.ÿä/.ÿàa~P/9p/9l/9
˜/9
”N¹ßü///.ÿä/.ÿàN¹ßü-@ÿð-Aÿô//N¹P///9`/9\N¹ßü///.ÿô/.ÿðN¹P///9X/9TN¹ßü//N¹ßü///.ÿä/.ÿà/9h/9dN¹ßü//N¹P//N¹ßü-@ÿð-Aÿô/9
 /9
œ/./.N¹l/.ÿô/.ÿðN¹P-@ÿð-Aÿô .ÿð".ÿô`"/.ÿä/.ÿà/.ÿä/.ÿàN¹ßü-@ÿø-Aÿü-y
¤ÿð-y
¨ÿô-y
¬ÿè-y
°ÿì-|ÿÜ`– .ÿÜ瀀t @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿÜ瀀¼ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿÜJ®ÿÜlÿf/.ÿì/.ÿè/.ÿô/.ÿð/./.N¹ßü//N¹ßüN^NuNVÿÜHîÿÜB¹-nÿà-nÿä/9
¸/9
´/.ÿä/.ÿàN¹n#ü! 9
¼"9
À`Î/9
È/9
Ä/.ÿä/.ÿàN¹oú/.ÿä/.ÿàa¨P/9p/9l/9
Ð/9
ÌN¹ßü///.ÿä/.ÿàN¹ßü-@ÿð-Aÿô//N¹P///9`/9\N¹ßü///.ÿô/.ÿðN¹P///9X/9TN¹ßü//N¹ßü///.ÿä/.ÿà/9h/9dN¹ßü//N¹P//N¹`²/.ÿä/.ÿà/.ÿä/.ÿàN¹ßü-@ÿø-Aÿü-y
Ôÿð-y
Øÿô-y
Üÿè-y
àÿì-|	ÿÜ`– .ÿÜ瀀	ä @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿÜ瀀
4 @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿÜJ®ÿÜlÿf/.ÿä/.ÿà/9
è/9
äN¹ßü///.ÿä/.ÿàN¹P///.ÿä/.ÿàaúœP//N¹ßü//N¹ßü///9h/9dN¹ßü///.ÿì/.ÿè/.ÿô/.ÿð/.ÿä/.ÿàN¹ßü//N¹ßü//N¹ßüN^NuNVÿäHîÿä/./././.N¹ßü///9
ð/9
ìN¹ßü-@ÿø-Aÿü-y
ôÿð-y
øÿô-y
üÿè-yÿì-|ÿä`– .ÿä瀀	 @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀	< @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü#ÀT#ÁX-yÿð-yÿô-yÿè-yÿì-|ÿä`– .ÿä瀀	t @/(//.ÿü/.ÿø/.ÿô/.ÿðN¹ßü//N¹ßü-@ÿð-Aÿô .ÿä瀀	¬ @/(//.ÿü/.ÿø/.ÿì/.ÿèN¹ßü//N¹ßü-@ÿè-AÿìS®ÿäJ®ÿälÿf/.ÿì/.ÿè/.ÿô/.ÿðN¹ßü///././9/9N¹ßü//N¹ßü#À\#Á`N^Nu@"ùƒnND@IÚ¢!hÂbü)Aëág|5ïlÌÊ_–€F=çNÛÿ6]	X„FÕk׺ÅÔšúî0PKqÒM<?ËM“°pRF(ÑöŸ²VFc|)Aë`$	Ís©\XnùÄRϱX=SsÃH¼Sô-åÂQ‡ªOq¹QioH<J·SÂŽžOEÈÝÏs0™ó@€Ë‡^[¢2×Ì´æLįËÉ„Ú)°vʹúJÏ8`ÈÖ€{ÅÉs»Œàîݡ^[¢2×Ì•,cÒÀÅËÈ÷öõžC´Ê¸Œ
–6ÈÑîFŵàMUƒ®_@€HÄéÕ:xžH¦L”‘hHAkWWG|†—Q·EÕLƒ¸Å_C
?Au/J-Mö)JÞV„WJ­F%[Y2IÃtÍòBb.H:ОrEWõÀóØô@€æ¨ÊävžRCe³ñ Á{»ãƒp7>X`˜-i‡Æ‚ÌÝ.›CYY˜SOØZÕ7'nÌœÜPXî0$¾™Ë¶¾)¨Vg×;â‚9;9d“S
ÃE¸`Í![…’Q\À?h[]aX‡\{ÖTˆoE¾‡O†ŒÉêVÁJ¾Ô–
Ê”EÉ‹ŽóU@€BA@ÿÿÿþÿÿÿþBA@@€C€B.L88.L79f.L20006_S1t	p3tp1.L93ô
.L83Ä
.L73"Îy1 fltused¤
.L63<	q2 sqrt4
q4lpio4.L89æ.L20004Ê.L54Ì
.L74¬
.L64 fnegü
.L84_S3J.L55 logTpzero.L20002Š.L65Ô
.L75„
.L56æ.L90 fdivê.L20007ö.L85 sindtpi–.L66ª.L57ä
.L80Ž.L20000Ü
.L76 faddðasympt$_F1ä	p4	p2 fsubŒ
.L58¼q1ú.L20005´
.L70Ž.L67ò.L91.L86¬	q3_S2"j1N.L81.L77 fcmpì.L68”
.L60†.L20003¼
.L71$_F2\qzeroú.L87ê.L92".L78 .L69ž.L61V.L20008ì
.L82 cos6.L72ú.L20001 fmul_F3œ
.L62 errno‰°‰°<,<‰°L‰°R<`‰°x‰°~‰°„‰°ŠM/¨#À‰°Ì‰°ÒMØJð‰°ü‰°M/‰°0‰°6 <
LMX‰°l‰°r<€M¼‰°Ð‰°Ø‰°à‰°è	M *0	JMh*xM° À‹îPÚ‰°ì‰°ò<‹°P‰°‰°‰°"‰°(<6‰°N‰°T‰°Z‰°`Mf/~J–‰°¢‰°¨M®#Ɖ°Ò‰°ØMÞ*‰° 
"M.MH‰°\‰°d‰°l‰°t	ŽM¬*¼	ÖMô*‰°,‰°2 8PMn/~‰°Ž‰°”MšM Ò*âM‰°‰°" (‰°<‰°D‰°L‰°T	nMŒ*œ	¶MÔ*ä ‰° ‰°&‰°,‰°4‰°<‰°D	^M|*Œ	¦MÄ*Ô ‰°‰°" (M8‰°D‰°Jpow.b           406163199   11    21    100664  917       `
d()ÀNVÿôHîÿô/9h/9d/./.N¹nî/9p/9l/./.N¹f./9x/9t/./.N¹oê 9|"9€`ð/./.N¹P-@ÿô/./.N¹P".ÿô²€f¬/./.N¹P//N¹P///./.N¹ßü//N¹P-@ÿø-Aÿü .ÿô€g//.ÿøN¹P-@ÿø-Aÿü .ÿø".ÿü`L/./.N¹P///./.N¹ßü//N¹P`#ü! 9„"9ˆN^Nud.L17.L16_S1 fltused`.L15„.L26
.L25 .L24|.L23b.L20J.L22t.L21 fneg exp log fix_F1 fcmp"pow fmull.L19r.L18 errno‰°‰° ‰°*‰°0>‰°F‰°LZ‰°d‰°j|ª¶Ê
Úü2
B‹°P‰°V‰°\
log.b           406163213   11    21    100664  2113      `
xNVÿÜHîÿÜ/9Ì/9È/./.N¹n#ü! 9Ð"9Ô`üHnÿÜ/./.N¹ßü-@ÿø-Aÿü`2/9Ü/9Ø/.ÿü/.ÿøN¹ßü-@ÿø-Aÿü .ÿÜS€-@ÿÜ/9ä/9à/.ÿü/.ÿøN¹m²/9Œ/9ˆ/.ÿü/.ÿøN¹l2/.ÿü/.ÿø/9ì/9èN¹ßü-@ÿø-Aÿü .ÿÜS€-@ÿÜ/9ü/9ø/.ÿü/.ÿøN¹ßü///9ô/9ð/.ÿü/.ÿøN¹ßü//N¹ßü-@ÿð-Aÿô////N¹ßü-@ÿè-Aÿì/9”/9///9œ/9˜///9¤/9 ///9¬/9¨N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿà-Aÿä/9´/9°/.ÿì/.ÿè/9¼/9¸/.ÿì/.ÿè/9Ä/9À/.ÿì/.ÿè/9/9N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü///.ÿä/.ÿàN¹ßü-@ÿà-Aÿä/9|/9x/.ÿÜN¹X//N¹ßü///.ÿô/.ÿð/.ÿä/.ÿàN¹ßü//N¹ßü-@ÿà-AÿäN^NuNVHî/9„/9€/./.aü¢P//N¹ßüN^Nu@1r÷ÑÏzA]ݪ¨¬@5ó3ùÞeÂÀlŽB÷¨‰#‰™"Â3ûh’@±?טÃG˜eÂ@lŽB›Ù½,$l“çdr!ÿÿÿþÿÿÿþA@A@€@€@€:.L52xlog2_S1°q0¨p3˜p1 fltusedø.L63@.L53Àq2">log10È.L54€ln10.L64Ð.L55"logr.L65”.L56 fdiv°.L57ˆsqrto2”.L20000 fadd frexp$_F1 p2p0 fsubà.L58¸q1_S2Ø.L59 fcmpþ.L60_F2 floatè.L61b.L20001 fmulð.L62 errno‰°‰°  ‹°(,‰°2‰°8N‰°d‰°j&x‰°–‰°œ ª‰°²‰°¸ Ɖ°Ö‰°Ü&≰‰°‰°$‰°*8H&d‰°x‰°~‰°ˆ‰°Ž‰°˜‰°ž‰°¨‰°®&´Ä&Ôä&ô‰°‰°‰°,‰°2‰°@‰°F‰°T‰°Z&`p&€& °È‰°Ü‰°â#ì&ø&(‰°J‰°Ph
sin.b           406163223   11    21    100664  2416      `
p€8(NVHî/9Ä/9À/./.N¹l/./.N¹P-@-A/</./.a.ßüN^NuNVHî/</./.a
ßüN^NuNVÿÄHîÿÄ-nÿà-nÿä/9Ì/9È/.ÿä/.ÿàN¹l"/.ÿä/.ÿàN¹P-@ÿà-Aÿä .T€-@/9t/9p/.ÿä/.ÿàN¹ßü-@ÿà-Aÿä/9Ô/9Ð/.ÿä/.ÿàN¹oÈHnÿø/.ÿä/.ÿàN¹ßü-@ÿØ-AÿÜ/.N¹X///.ÿü/.ÿøN¹ßü-@ÿø-AÿüHnÿð/.ÿü/.ÿø/9Ü/9ØN¹ßü//N¹ßü/.ÿô/.ÿð/9ä/9àN¹ßü///.ÿü/.ÿøN¹ßü//N¹P`L/.ÿä/.ÿàN¹P-@ÿÔ/N¹X///.ÿä/.ÿàN¹ßü-@ÿØ-AÿÜ .ЮÿÔ€-@ .€g(/.ÿÜ/.ÿØ/9ì/9èN¹ßü-@ÿØ-AÿÜ®o/.ÿÜ/.ÿØN¹P-@ÿØ-AÿÜ/.ÿÜ/.ÿØ/.ÿÜ/.ÿØN¹ßü-@ÿè-Aÿì/.ÿÜ/.ÿØ/9|/9x///9„/9€///9Œ/9ˆ///9”/9///9œ/9˜N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿÌ-AÿÐ/9¤/9 /.ÿì/.ÿè/9¬/9¨/.ÿì/.ÿè/9´/9°/.ÿì/.ÿè/9¼/9¸/.ÿì/.ÿèN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿÄ-AÿÈ///.ÿÐ/.ÿÌN¹ßüN^Nu@"ùƒnNDLO2Xúê»Ë–Øx3©‰ŸIÖäᶔTÂÇX]
1ªDøñ!û†LçΧ%îdIÇNg5 &GÜbhqÌD§K-Ÿá?Gÿø?€A€@€Ð.L30È.L31_S1 q0p3€p1Ü.L32 fltusedÐ.L33°q2j.L28Ø.L34x.L27T.L22>.L24À.L25à.L35,.L36`.L37 fnegè.L38‚.L39_S3 fdiv fix"Xsin modf(.L20000 fadd_F1˜p4ˆp2xp0 fsub¨q1¸q3_S2 fcmp_F2 float"|sinus"cosptwoopi fmul<_F3‰°‰°% 0‰°”‰°š%¨¸‰°Ò‰°Ø+扰ú‰°%$'<P‰°p‰°v+|Œ‰° ‰°¦+¬!ÄÔæ'ô!‰°B‰°H!Nt+”‰°°‰°¶‰°À‰°Æ‰°Ð‰°Ö‰°à‰°æ‰°ð‰°ö+ü+,+<L+\l+|‰°‰°–‰°¤‰°ª‰°¸‰°¾‰°Ì‰°Òà+ð+ +0@`sqrt.b          406163231   11    21    100664  1686      `
pX^PNVÿèHîÿè/9t/9p/./.N¹n6/9|/9x/./.N¹l
#ü! 9€"9„`Hnÿì/./.N¹ßü-@ÿø-Aÿü` /9Œ/9ˆHnÿøN¹ßüS®ÿì/9”/9/.ÿü/.ÿøN¹mÄ .ÿì€g /9œ/9˜HnÿøN¹ßüS®ÿì/.ÿü/.ÿø/9¬/9¨N¹ßü///9¤/9 N¹ßü-@ÿð-Aÿô®<ÿìo&/9´/9°HnÿðN¹ßü®<ÿì`Ð®ÿÿÿÄÿìl&/9¼/9¸HnÿðN¹ßü®<ÿì`ÐJ®ÿìm0/</.ÿìN¹Prá¡/N¹X//HnÿðN¹`2/< .ÿìD€/N¹Prá¡/N¹X//HnÿðN¹ßüB®ÿè`\/.ÿô/.ÿð/./.N¹ßü///.ÿô/.ÿðN¹ßü///9Ä/9ÀN¹ßü-@ÿð-AÿôR®ÿè®ÿèoš .ÿð".ÿôN^NuA@A@@€O€O€@°.L30L.L17Z.L31p.L16_S1 fltusedŠ.L32\.L15¸.L33l.L14À.L34Z.L29*.L28¨.L27 .L26˜.L25æ.L24º.L21.L22ˆ.L23ž.L20ø.L35"sqrtV.L36þ.L20004d.L37Z.L38À.L39ò.L20002 fdivž.L20000 fadd frexp_F1 ldiv fcmpZ.L20003 afdiv float~.L20001 fmul€.L19 afmulx.L18 errno‰°‰°# ‰°(‰°.#<‹°,H‰°N‰°T j‰°€‰°†*‰° ‰°¦#´‰°È‰°Î*؉°ð‰°öü‰°‰°(‰°6‰°<*F‰°f‰°l%v"œ&ª*º"Ð&Þ%î(‰°8‰°>(Dldiv.b          406162967   11    21    100664  203       `
ˆNVHç<*< .lD€D…&".lDD…(lB@H@€Á40€ÁH@0H@`6â€â€ÿÿÿ€ÿÿÿlè€Á€ÿÿ$//N¹P¶€lS‚ J…lD€Lß<N^Nu ulmul"ldiv+²j
tan.b           406163241   11    21    100664  2412      `
 d@NVÿÐHîÿÐB®ÿÔ-yPÿø-yTÿü/9\/9X/./.N¹l(/./.N¹P-@-A-y`ÿø-ydÿü/9/9/./.N¹ßü-@-AHnÿè/./.N¹ßü-@ÿà-Aÿä/.ÿì/.ÿèN¹P-@ÿÐ/</N¹P€bÐ@0;NûÌ:nˆ/.ÿä/.ÿà/.ÿä/.ÿàN¹ßü-@ÿØ-AÿÜ/.ÿä/.ÿà/9/9///9/9///9$/9 ///9,/9(///94/90N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿð-Aÿô/9</98/.ÿÜ/.ÿØ/9D/9@/.ÿÜ/.ÿØ/9L/9H/.ÿÜ/.ÿØ/9l/9hN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü///.ÿô/.ÿðN¹ßü-@ÿð-Aÿô®ÿÔf$/9t/9p/.ÿô/.ÿðN¹fÞ#ü"/9|/9x/.ÿü/.ÿøN¹o¨ 9€"9„`ê/.ÿä/.ÿà/9Œ/9ˆN¹ßü-@ÿà-Aÿä-|ÿÔ`ýœ/.ÿü/.ÿøN¹P-@ÿø-Aÿü`Ú/.ÿä/.ÿà/9”/9N¹ßü-@ÿà-Aÿä/.ÿü/.ÿøN¹P-@ÿø-Aÿü`ý>`ý: 9˜"9œ`D/.ÿô/.ÿð/9¤/9 N¹ßü-@ÿð-Aÿô/.ÿô/.ÿð/.ÿü/.ÿøN¹ßüN^Nu@¢ùƒnNDÇL0Ï‚ÖÁ‚Eƒÿ y+VÂx™
ì=>0yêÂe9Áj¯ú6Çý矗¿¢F”îÊÌÄ€ÙX(ç@€À€@€ÿÿþÿÿÿþ@€@€ÿÿÿþÿÿÿþ@€_S18q0(p3p1 fltused€.L73.L63P.L53Hq2b.L54˜.L74¬.L64 fnegX.L55"tanè.L65 .L75`.L56 fdiv fixà.L66è.L57 modfB.L20000 fadd0_F10p4 p2p0 fsubÎ.L58@q1p.L70h.L67invpi.L59 fcmpˆ.L60æ.L68°.L71 lrem¾.L69N.L61.L51x.L72 fmulh.L62 errno‰°‰°‰° ‰°&$4D‰°T‰°\‰°d‰°j-x˜´(È-ú‰°‰°‰°&‰°,‰°6‰°<‰°F‰°L‰°V‰°\-br-‚’-¢²-ÂÒ-≰ö‰°ü‰°
‰°‰°‰°$‰°2‰°8->N-^n-~Ž¦‰°Æ‰°Ì$Ú‹°/艰ô$‰°‰°‰°$‰°*0X‰°r‰°x~š‰°²‰°¸‰°È‰°ÎÔ-ølrem.b          406162971   11    21    100664  207       `
ŒNVHç8(< .lD€D„$".lDlB@H@€Á0€ÁB@H@`<&â€â€ÿÿÿÿÿÿlÿè€Á€ÿÿ//N¹P´€lƒ‚D€J„lD€LßN^Nu ulmul"lrem+²l
ulmul.b         406162975   11    21    100664  94        `
0NVHç0$.&.B€0ÀÃ2HBÄÃHCÂÃÒ‚HABAÐLßN^Nu"ulmultanh.b          406163245   11    21    100664  618       `
Ô ÞxNVÿøHîÿø-yÔÿø-yØÿü/9à/9Ü/./.N¹l(/./.N¹P-@-A-yäÿø-yèÿü/9ð/9ì/./.N¹o
 .ÿø".ÿü`L/./.N¹P///./.N¹P///.ÿü/.ÿøN¹ßü//N¹ßüN^Nu@€À€B¨Ü.L17^.L16_S1 fltusedÔ.L15Ð.L14ì.L20 fneg cosh fdiv_F1 sinh fcmp"tanh fmul„.L19ä.L18‰°‰°‰°‰°"0@‰°P‰°X‰°`‰°ftŽ¢¶	Æsinh.b          406163253   11    21    100664  2274      `
À€J8NVÿìHî€ÿì~/9ü/9ø/./.N¹l/./.N¹P-@-A~ÿ/9/9/./.N¹oP/9/9/./.N¹P//N¹ßü-@ÿø-AÿüJ‡o`D/.ÿü/.ÿøN¹P`0/9/9/./.N¹ox/9/9/./.N¹P//N¹P///./.N¹P//N¹ßü///N¹X//N¹ßü//N¹`–/./././.N¹ßü-@ÿð-Aÿô/././9Ä/9À///9Ì/9È///9Ô/9Ð///9Ü/9ØN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿø-Aÿü/9ä/9à/.ÿô/.ÿð/9ì/9è/.ÿô/.ÿð/9ô/9ð/.ÿô/.ÿðN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//HnÿøN¹ßü/.ÿü/.ÿø/N¹X//N¹ßüLî€ÿìN^NuNVHî/9$/9 /./.N¹l/./.N¹P-@-A/9,/9(/./.N¹o/94/90/./.N¹P`L/9</98/./.N¹P//N¹P///./.N¹P//N¹ßü//N¹ßüN^NuÊþõÓ%Úyȯœ\0.‘kÆ4ãa¶ÑoØÂÒqïB ;ÈÊþõÓ%ÚyGm¼±õt
Ä-­Ïæ€ØB¨A@AB¨AAº.L31€_S1àq0Øp3Èp1$.L32 fltused .L33ðq2^.L34.L29B.L27.L28Ü.L20š.L26.L25®.L23.L24B.L21ø.L22(.L35ª.L200040.L368.L37 fneg exp®.L20002"æcosh fdivÖ.L20000 fadd_F1Ðp2Àp0 fsubèq1_S2 fcmp"sinh¬.L20003_F2 afdiv float´.L20001 fmul‰°‰°%"2‰°D‰°J%X‰°`‰°ft€¤‰°°‰°¶%ĉ°Ì‰°Òàì"*,*:,T‰°p‰°v‰°€‰°†‰°‰°–‰° ‰°¦,¬¼,ÌÜ,ìü,‰° ‰°&‰°4‰°:‰°H‰°N\,l|,Œœ)°*Æ,Ò‰°ò‰°ø%‰°&‰°,%:‰°B‰°HV‰°`‰°ft€” °exp.b           406163261   11    21    100664  1855      `
ôxÓàNVÿÜHîÿÜ/9@/9</./.N¹f 9D"9H`¼/98/94N¹P///./.N¹l 9L"9P`„/98/94/./.N¹o#ü" 9T"9X`N/9(/9$HnN¹ßü/./.N¹P//N¹P-@ÿÜ/9`/9\/.ÿÜN¹X///./.N¹ßü//N¹ßü-@ÿø-Aÿü////N¹ßü-@ÿà-Aÿä/.ÿü/.ÿø/9ø/9ô///9/9ü///9/9N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿð-Aÿô/9/9/.ÿä/.ÿà/9/9/.ÿä/.ÿà/9 /9/.ÿä/.ÿà/9h/9dN¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü//N¹ßü-@ÿè-Aÿì/.ÿÜ/.ÿô/.ÿð//N¹ßü///.ÿô/.ÿð/.ÿì/.ÿèN¹ßü///90/9,N¹ßü//N¹ßü//N¹ßüN^NuJýôÆÙúGìñ‚S¯ïCruœ‡Ø%K·0@¸q9iI ¤ÛàEÚ©4¿ÁÅ»@¸ª;)\ñ@µó3ùÞeG@@€ÿÿþÿÿÿþ@@€6.L52_S1 fltusedexpq1<.L53,sqrt2D.L54expp2 fnegn.L55"expL.L56 fdivexpq2 ldexp fix¤.L574maxf fadd$_F1 fsubT.L58ôexpp0$log2e\.L59 fcmpd.L60expq0 floatüexpp1ð.L51 fmul floor afmul errno‰°‰° ‰°(‰°.‰°8‰°>DX‰°`‰°f‰°p‰°v„‹°"‰°–‰°œ‰°¦‰°¬!¶ ÊÖ‰°â‰°èò2‰°N‰°T‰°^‰°d‰°n‰°tzŠšªº‰°Î‰°Ô‰°â‰°è‰°ö‰°ü‰°
‰°&6FVfŠª‰°º‰°ÀÆÖæ
floor.b         406163266   11    21    100664  692       `
øxNVÿøHîÿø/9/9/./.N¹lŒ/./.N¹P-@-AHn/./.N¹ßü-@ÿø-Aÿü/9/9/.ÿü/.ÿøN¹g/9 /9HnN¹ßü/./.N¹P-@-A`Hn/./.N¹ßü .".N^NuNVHî/./.N¹P//aÿ
P//N¹PN^Nu@€.L17˜.L16_S1 fltused.L15².L14.L21Ò.L13 fneg afadd"Öceil modf_F1_S2 fcmp_F2Ê.L19"floor.L18‰°‰° 2N‰°b‰°hv‰°~‰°„	Ž¢Àêfloat.b         406162965   11    21    100664  2994      `
T$ú BPJ€l0¼!A"ÿÿ€!AH@î€@ÿfBB¨B¨Nu@€1@NuB€0(@€fBNuJPg@H@ï€"(fB€Nuÿÿ€"(NuN¹ÑhN¹¶Nup"(f"(fB@Nu@ S@ãdÿúP@NuB$(&(2kfNuâ‚â“SAfÿø‚ÿÿÿ`ãƒã’RAfÿø!B!CNu"|`J@f( .". IN¹ .". |TN¹Nu .". IN¹ n " |TN¹NuNuNV |T ."."nN¹0(HÀ"€BhN¹DN^NuNV |T .".N¹ .ÑhN¹DN^NuNVHç8 .". |TN¹"|`28(n3|ÿ€ I`j3DBhD8m#h#h1|ÿ€ I`BpøN¹¶B€ãƒã’ã‘ãSDfÿô!C!B#A#@N¹~Qh IN¹N¹¶"nN¹D"À" |TN¹DLßN^NuNVHç0 .". |TN¹JhnB€`$pøN¹¶2(B€ãƒã’ãSAfÿöJPgD€LßN^NuNVHç0 |TB¨BP .kj1|ÿ€` 0¼D€!@N¹N¹¶@81@N¹DLßN^NuNVB@N¹ôN¹æN^NuNVB@N¹ô
QN¹æN^NuNVB@N¹ô
QN¹æJ€N^NuNVpN¹ôN¹æ n À N^NuNVpN¹ô
QN¹æ n À N^NuNVpN¹ôB¨N¹æ n €N^NuNVpN¹ôB¨
QN¹æ n €N^NuHç00(2)Ak IN¹¶"|TÑh`D@N¹¶ÑhJPgDƒ@‚ )")JQgD@€ÖÕ€J‚lDƒ@‚P`P!B!CN¹~N¹DLßNuNV". .k€€`€ÿÿÿN^NuNVB@N¹ôN¹ÞN^NuNVpN¹ôN¹Þ n À N^NuNVpN¹ôN¹Þ n €N^NuHç< 0±X0ÑXB‚BƒB…xP‰$|l02!ÂÀÖÕ…SDfÿò$Ä$Â$ƒB‚BƒxUˆTŠ0 2ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒB‚BƒxU‰TŠ02!ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒUˆTŠ0 2ÂÀÓ¢RŠÚÚÚÚÚÚÚÚQˆYˆN¹~N¹DLß<NuNVB€N¹ôN¹àN^NuNVpN¹ôN¹à n À N^NuNVpN¹ôN¹à n €N^NuHç>0±X0‘X f‚À"$&B„B…|:`SFg0Düã•ã”ã“ã’–•€lÿèSFgã…ã”ã“ã’ÖÕ€lÿÒ`ÿèYˆ Ä …QˆN¹~N¹DLß|Nu"LfltusedTafloatàdivPadde¸fixehb_manl8diveJmodfellsumXa_manh"jfnegfloate@l3dsúl1ds"€afsubêshifteVa_exptæadd"fdiv"Âafsubf"bafadd`bfloat"lfix"€ldexpDitoe`b_sign"ªmodfôgetargsdb_manhMANH"¢afaddf"fadd"Nfrexp",fsubEXPTSIGNoffsetetoiôokTa_sign"Ffcmpbb_expt\a_manl"¦afdivÞmulthmultel2ds¶shift"Äafdivf~normal"Âafmulf"ÀfloatMANL"Žfmul"¤afmul(²€(²Š‰°ö(²‰°(² (²2‰°@(²F‰°T(²f(²x‰°†(²”(²¢‰°¼(²Â‰°È(²(²4(²@(²F(²P‰°Z(²`‰°~(²„(²š‰°Ê(²ö(²ü(²
(²(²$(²4(²>(²N(²X(²j(²p(²ˆ(²’(²ª(²´(²Ê(²Ø(²ü‰°(²(²Z(²`(²–(²œ(²¬(²²(²Ê(²Ð‰°ö(²€(²†(²˜(²ž(²®(²´(²Ì(²Ò(²B(²Hò2‰°N‰°T‰°^‰°d‰°nsumacc/Makefile   444      0     12        1376  3472710526   6756 # SUMacC makefile

RT=/usr/sun
DP=/usr/sun/bin
DL=/usr/sun/lib
DI=/usr/include

# for Eunice, comment out the lines above and enable the lines below
#MACROOT=/usr/local/mac
#DP=$(MACROOT)/bin
#DL=$(MACROOT)/lib
#DI=$(MACROOT)/include

all:
	-mkdir $(RT)
	-mkdir $(DP) $(DL)
	-mkdir $(DI) $(DI)/mac
	cp  h/*.h $(DI)/mac
	ln -s $(DI)/mac $(RT)/include
	cd cc42; make install
	cd cc; make all
	cp man/*.1 /usr/man/man1
	cd cmd; make DP=$(DP) DL=$(DL) 
	cd cmd; make DP=$(DP) DL=$(DL) install
	cd lib; make DP=$(DP) DL=$(DL) 
	cd lib; make DP=$(DP) DL=$(DL) install
	cd libc; make DP=$(DP) DL=$(DL) install
	cd mac; make DP=$(DP) DL=$(DL) 

clean:
	cd cc42; make clean
	cd cc; make clean
	cd cmd; make clean
	cd lib; make clean
	cd libc; make clean
	cd mac; make clean

 €N^NuHç< 0±X0ÑXB‚BƒB…xP‰$|l02!ÂÀÖÕ…SDfÿò$Ä$Â$ƒB‚BƒxUˆTŠ0 2ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒB‚BƒxU‰TŠ02!ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒUˆTŠ0 2ÂÀÓ¢RŠÚÚÚÚÚÚÚÚQˆYˆN¹~N¹DLß<NuNVB€N¹ôN¹àN^NuNVpN¹ôN¹à n À N^NuNVpN¹ôN¹à nsumacc/README   444      0     12        1414  3470501250   6155 Files in this directory:

Makefile	top level makefile
README		this file
cc41		C compiler binaries for VAX 4.1 BSD  \
cc42		C compiler binaries for VAX 4.2 BSD   >- bigger sym table
cceun		C compiler binaries for VMS Eunice   /
cmd		source for UNIX SUMacC "commands"
etc		misc notes, new programs, etc.
fix		"bugs" that need fixing
h		header files
info		(some) files from the info-mac archives [on magtape only]
lib		library files
mac		mac example and test programs
man		manual pages
order		'how to order' SUMacC
sites		list of SUMacC sites (at least some of them...)
sumacc.mail	mail and bug reports 
sumacc.ms	manual describing SUMacC;  -ms troff macros. [new version]
ws		reference copy of Apple workshop files [in 2nd tar file]
ws-		some older workshop files [on magtape only]
±X0ÑXB‚BƒB…xP‰$|l02!ÂÀÖÕ…SDfÿò$Ä$Â$ƒB‚BƒxUˆTŠ0 2ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒB‚BƒxU‰TŠ02!ÂÀÖÕ…SDfÿò"" "ÖÕ€$Â$ƒUˆTŠ0 2ÂÀÓ¢RŠÚÚÚÚÚÚÚÚQˆYˆN¹~N¹DLß<NuNVB€N¹ôN¹àN^NuNVpN¹ôN¹à n À N^NuNVpN¹ôN¹à nsumacc/order   444      0     12       15613  3470501435   6366 SUMacC ORDERING INFORMATION	(Version 2.0, 11/84)

WHAT YOU GET

SUMacC is the Stanford / UNIX Macintosh C development environment, a
collection of programs that allows you to "cross-develop" Macintosh
applications on your UNIX system and then download them to the Mac for
execution.  Some advantages of this approach:  (1) The per-programmer
cost for using SUMacC is almost zero;  other systems require per
person, a Lisa ($4000), or a Mac stand-alone C compiler plus 2nd disk
drive ($500 + $300).  (2) You program in a full Bell Labs PCC C
compiler with all the UNIX support tools: emacs, make, cshell, lint,
lex, yacc, grep, diff, lpr, etc.  (3) The large disks and memory on
your UNIX system result in faster editing and compilation.  (4) When
applebus / ethernet connections become available, executing a file
directly from your UNIX 'file server' should take no longer than
loading it off a SONY disk.

Included with the package are Macintosh library / header / lint files,
UNIX commands (such as rmaker, macget/put, mac-to-laserprinter),
example / test programs, workshop header files (for reference), manual
pages, and documentation.  Source is included for all of the above.
Since the compiler / loader is derived from the Bell Labs PCC, only
binaries are provided for these.

Example / test programs in C include:  macscrawl (sketcher), 
grow (from the workshop), insane (float test), alert (tests alert-dialogs),
calendar (desk accessory), ramdisk, hangman, kermit, mini-finder,
printspooler (desk accessory).


WHAT YOU NEED

Your UNIX should be a VAX running 4.1 or 4.2 BSD, or Eunice (UNIX under VMS).
SUMacC has also been "ported" (by others) to a number of different UNIX
systems (Pyramid, SUN, Metheus, System V, etc.)  While we do not provide
compiler binaries for systems other than the VAX, a list of sites (including
those with ports) and porting hints are included.  [See <info-mac>sumacc.sites
on host SUMEX].

You also need a Mac disk containing MacTerminal (.15 or later;  1.1 seems
to be the latest).  Your RS232 serial connection between the Mac and UNIX
should be 9600 baud with a full 8 bit transparent data path.  I.e. terminal
switchers or "network" connections may interfere with the "modem7" protocol
used in downloading.  Lower baud rates will work, but are not recommended.

Buy Inside Mac ($100) plus updates and supplement ($100) from Apple.

Handy but not required:  occasional access to a Lisa, since Apple currently 
only releases new code in Pascal;  for example you may want to translate a new
header or interface file into C on your own if you need it desparately.


WHAT'S NEW

SUMacC was originally released in June 84.  This release incorporates
all bug fixes since then, new contributed programs, header / interface
file changes including Apple's revised name upper/lower case
conventions, new workshop reference files, vms eunice binaries, and an
increased C compiler symbol table size.


CAVEAT EMPTOR

The package is under a Stanford copyright which must be retained on all
copies of this software.  Any fixes or enhancements made to the package
should be reported back to us, for incorporation into future releases.
While we will attempt to fix bugs and provide new features, no warrantee
is expressed or implied.  You are basically on your own.

SUMacC currently does not support segmentation, so on a 'thin' Mac you
are limited to about 80K bytes of program.  There are no restrictions
on the size of SUMacC programs, other than the available physical
memory.  (The Apple Workshop pascal compiler generates PC-relative
code, so its segments are limited to 32K bytes each.  SUMacC
dynamically relocates the program at run-time, by following relocation
chains run-length encoded though the "unused" high order byte of long
word addresses.)

Some esoteric features of the official Apple Mac Workshop environment
(a moving target) have not yet been tested (or converted):  Graf3D,
rare rmaker types, new imagewriter / laser printer support, Applebus, etc.
C library and header files will always be somewhat behind in tracking
the Pascal versions since Apple only releases code in Pascal.


ACKNOWLEDGEMENTS

The 68000 C compiler used by SUMacC is the Bell Labs (Johnson) portable
C compiler, ported by Chris Terman of MIT and used in the MIT NU
project and the Stanford SUN system.  The assembler is by Mike Patrick,
also of MIT.  This same compiler / assembler / loader is used in many
of the 68K UNIX boxes currently on the market.  Many modifications and
bug fixes have been applied by folks at Stanford, MIT, and Lucasfilm:
Jeff Mogul, Bill Nowicki, John Seamons, Vaughan Pratt, Eric Ostrom, and
a cast of thousands.

Dave Johnson of Brown Univ. contributed the excellent macget/macput
programs that make downloading painless.  Among the many people
contributing improvements, new example programs, and bug fixes are:
Mike Schuster of CALTECH, Dan Winkler and Steve Engle of Harvard, Bill
Schilit at Columbia, Joe Pallas and  Steve Gross at Stanford, John
Seamons at Lucasfilm, John Peterson at Utah, Ben Hyde of Intermetrics,
Bruce Horn of Apple/Adobe, Van Jacobson at LBL, and many others.  Thank
you all!


TO ORDER A MAGNETIC TAPE

The tape duplication company below will send a 1600 bpi, UNIX tar tape
(1200 feet) for $65.  This includes the new reel of tape and surface
(book rate) postage.  They will accept checks or PO's (payable to Data
Processing Services).  

Maria Code
Data Processing Services
SUMacC distribution tape
1371 Sydney Drive
Sunnyvale, CA  94087
(408) 735 8006

You may wish to include more money for postage to get faster delivery:
Additional postage rates.
US only.
	$2.50	airmail
outside US.
	$2.50	surface	 (2 months to Europe!)
	$4.00	airmail North America (Canada/Mexico)
	$7.00	airmail Europe
	$10.00	airmail elsewhere (Africa, Asia, etc.)
	

FTP INSTRUCTIONS

For those with ARPANET access, the package is also available as a tar
file located on <info-mac>sumacc.tar.  Since the tar file has become so
large, it is in two pieces.  sumacc.tar contains the main package, and
ws.tar contains the workshop reference files.  It is stored both on
SUMEX-AIM (California) and COLUMBIA-20 (New York), so you should pick
the host closest to you.  It would be appreciated if you performed the
file transfer during off hours as it takes about a half-hour under best
conditions.  At two in the afternoon it would take much more time than
this and be an annoying additional load on our systems.  If more than
one group in your area wants a copy, please try to coordinate things so
you only get it from us once.

The hosts mentioned above are not UNIX hosts, so you must be extra
careful in performing the file transfer to ensure you get all eight
bits.  On your side you must set the transfer mode to 'TENEX' or 'TYPE
L 8' (ask your FTP guru if unsure).  We picked these distribution hosts
because they happen to have direct Arpanet connections (as opposed to
routing through gateways).

If you take a copy, please send me (croft@sumex) a note so I can
maintain a list of users.
package is under a Stanford copyright which must be retained on all
copies of this software.  Any fixes or enhancemensumacc/sites   444      0     12       11526  3470501436   6402 Here is a list of sites and contact people who have fetched a copy
of SUMACC.  If you are looking for a copy, you can find someone in your
area who already has it.  

Some of the people below have also volunteered
to make a SMALL number of tape copies for others in the area;
these folks are marked with 'copy'.  Please contact them
first before sending any media.

Folks marked with 'port to xxx' have ported the SUMACC system to the
given hardware/OS.


siteperson@site:Name:Organization:Misc:FTP pathname


WEST COAST

croft@sumex:Bill Croft:Stanford SUMEX::<info-mac>sumacc.tar
croft@diablo:Bill Croft:Stanford HPP/SUMEX::/usr/local/mac/*
cal@su-star:Calvin Teague:Stanford radio-astron:port to VMS EUNICE!:
pallas@gregorio:Joe Pallas:Stanford Distributed Systems Group::
gross@su-sierra:Steve Gross:Stanford EE:port to Cromemco Cromix:
s.samsyn@su-lotsa:Dan Samuel:Stanford LOTS::
greep@su-russell:Steve Tepper:Stanford CSLI::
smh@sri-prism:Scott Hinnrichs:SRI:port to Pyramid:
sml@ford-wdl1:Steve Lazarus:Ford Aerospace::
mikes@cit-vax:Mike Schuster:CALTECH:copy, port to metheus:
csudf%ucbopal.CC@Berkeley:Urszula Frydman:Berkeley CC::
hamachi%ucbkim@Berkeley:Gordon Hamachi:Berkeley::
chaos2%ucbtopaz.cc@berkeley:Jim Crutchfield:ucb physics::
jsc%ucbcory@berkeley:James Carrington:ucb cory::
david%ucbmedea@berkeley:David Mintz:ucb 548-3621::
noao!miami!angel@lbl-csam:Angel Li:NOAO::
van%ucbmonet@berkeley:Van Jacobsen:LBL Engr:port to VMS EUNICE:
furuta@washington:Richard Furuta:UofWashington:copy for Seattle area:
microsof!reubenb@uw-beaver:Reuben ?:Microsoft::
vandata?206-542-7611:Dwight VandenBerghe:VANDATA:port to UNOS:
tektronix!reed!schlick@berkeley:Gary Schlickeiser:Reed College::
tektronix!tekchips!wardc@berkeley:Ward Cunningham:Tektronix::
kfd@aids-unix:Ken Dove:AIDS::
bajaj@uci-750a:Anil Bajaj:UCIrvine::
dagobah!jks@berkeley:John Seamons:Lucasfilm Ltd.:copy:
sun!sevans@berkeley:Steve Evans:SUN Microsystems::
guyton@rand-unix:Jim Guyton:RAND::
fortune!jcs@sri-tsc:Joe Sharp:Fortune Computer::
unisoft!normac!stephen@berkeley:Stephen Lewis:UNISOFT:port to UNISOFT III/V:
3COM?961-9602:Pitts Jarvis:3COM::
unisoft!drivax!lafleur@berkeley:Tom Lafleur:Digital Research:port Sys V:
ssi?321-3646:Charlie Burns:Silicon Systems Inc. (or was it VTI?)::
mtxinu!apple!todd@berkeley:Todd MacMillan:Apple R&D::
parker@nrl-css:Alan Parker:Naval Research::
ios!daves@decwrl:Dave Schnepper:DEC West Res Lab::
ihnp4!drux1!afg@berkeley:Al Gettier:Bell Labs Denver:port to Sys V:
teltone!joe@uw-beaver:Joe Brady:Teltone:port to Pyramid:
ames!ev@RIACS:Everett Palmer:NASA AMES::


SOUTH/MIDWEST

jw-peterson@utah-20:John Peterson:UofUtah::
mike@rice:Mike Caplinger:RiceU:copy:
jsq@ut-sally:John Quarterman:UTexas::~ftp/pub/sumacc/sumacc.*
awd@ut-ngp:Andrew Donoho:UTexas:copy, port VMS (EUNICE?):
Gavin_Eadie%UMich-MTS.Mailnet@MIT-MULTICS:Gavin Eadie:UofMich::
cbosgd!bentley!fjh@berkeley:FJ Hirsch:Bell Labs Columbus::
cbosgd!osu-dbs!elwell@berkeley:Clayton Elwell:Ohio State
djk@compion-vms:Daniel Kopetzky:Gould Software, Urbana IL::
cak@purdue:Chris Kent:Purdue::
carey@wisc-crys:Mike Carey:UofWisc::
planting@wisc-rsch:Harry Plantinga:UofWisc::
jlc@ardc:John Chmielewski:Western Electric:port to 3b20:
wash?!denzau?314-889-5688:Art Denzau:Washington Univ, St. Louis::


EAST COAST

cower@columbia-20:Rich Cower:ColumbiaU::<info-mac>sumacc.tar
barkley@nbs-vms:John Barkley:National Bureau of Standards::
itkin@umcp-cs::Dave Itkin:UofMaryland::
farber@udel-ee:Dave Farber:UofDelaware (csnet/arpanet)::
ron%udel-cc-relay@udel-relay:Ron Reisor:UofDelaware CC::
sob@harvard::Scott Bradner:Harvard::
lee@rochester:Lee Moore:UofRochester::public/sumacc.tar
bukys@rochester:Liudvikas Bukys:UofRochester::bukys/uucp/sumacc.*
amd!rocksvax!ritcv!moscom!gaa@berkeley:Gary Algier:MOSCOM Rochester:port to NCR:
Max.Henrion@cmu-ri-isl1:Max Henrion:CMU::
Robert.White@cmu-cs-gandalf:Robert White:CMU (Apple tech rep)::
Duane.Williams@cmu-cs-ius:Duane Williams:CMU::
boyle%mit-oz@mit-mc:Joe Boyle:MIT-PREP::/u/bandy/*
johnson@mit-xx:Paul Johnson:MIT LCS::
spitzer%pco@cisl:Charlie Spitzer:MIT MULTICS::
dbrown@hi-multics:Drew Brown:Honeywell Multics::
ddj%brown.csnet@csnet-relay:Dave Johnson:Brown (csnet/bitnet):port to SUN:
us.alan@cu20b:Alan Crosswell:Columbia:for bitnet access mail to eacus@cuvmb:
mac%upenn-1100%upenn.csnet@csnet-relay:Dave Axler:UPenn::
princeton!down!north@seismo:Stephen North:Princeton::
randy@nlm-vax:Randy Huntzinger:Nat Lib of Medicine::
intmet@bbna:Ben Hyde:Intermetrics, Cambridge::
sdyer@bbncca:Steve Dyer:BBN::
fischer@rutgers:Ron Fischer:Rutgers::


FOREIGN

kingdon%ubc.csnet@csnet-relay:Stewart Kingdon:UofBritish Columbia:copy:
Takehiro.Tokuda@cmu-cs-gandalf:T Tokuda:Yamanashi Univ, Takeda::
bob%basser.oz@decwrl:Bob Kummerfeld:UofSydney CS:port to Interdata Sys V:
decvax!mulga:ross:Ross Nealon:UofWollengong::
utcsrgv!dciem!mmt@uw-beaver:?:Canadian Defense Inst::
vmircam!js:Jacqueline Signorini:IRCAM, Paris::
ve Schnepper:DEC West Res Lab::
ihnp4!drux1!afg@berkeley:Al Gettier:Bell Labs Denver:port to Sys V:
teltone!joe@uw-beaver:Joe Brady:Teltone:port to Pyramid:
ames!ev@RIACSsumacc/sumacc.ms   444      0     12       44241  3470501436   7144 .na
.TL
SUMacC: Stanford UNIX Mac C Development Kit
.AU
Bill Croft
.AI
Stanford University
Medical Center
SUMEX Project, rm TB105
Stanford, CA  94305

Version 2.0, 11/84
.AB
This note describes SUMacC, 
a UNIX cross development environment 
for the Apple Macintosh.
.AE
.NH
Introduction
.PP
This note describes SUMacC (pronounced like 
.I "poison sumac" 
), a cross development environment that runs
on UNIX which is used to compile and download C programs for execution on the
Apple Macintosh.
.PP
SUMacC was released originally in June 84 in a beta test form.  The current
release includes all the bug fixes since then, plus additional
material that has been collected thru the 
.I info-mac
bulletin board on SUMEX.
It includes most of the updates released by Apple in the 'Mac Supplements'
of July 20 and October 22.
The 'Imagewriter pre-release' of August 1 (for wide platen Imagewriters)
is not yet integrated.
.PP
We are distributing this package under the condition that it may
be 'used' but not 'sold' without our permission.
The package is under a Stanford copyright
which must be retained on all copies of this software.
Any fixes or enhancements should be reported
back to us, for incorporation into future releases.
While we will attempt to fix bugs and provide new features, no
warrantee is expressed or implied.  You are basically on your own.
.NH
Prerequisites
.PP
The package is currently only setup for a VAX running Berkeley
UNIX or Eunice.  It should be convertable to any other UNIX box having
a 68000 C compiler.  For a list of sites that have or are porting
SUMacC to other systems, look at the file 'sites' and 'etc/port'.
.PP
We assume you have some release of the Apple 
.I MacTerminal
program.
This is used to download files from UNIX
to your Mac disk.  Your RS232 connection from UNIX to the Mac must
pass all 8 bits and not impose any 'automatic' flow control;  i.e.,
connections thru terminal switchers or networks may not work.
.PP
It's also handy (but not necessary) to have at least one Lisa system
available, since this is how new software is
released from Apple.
.NH
Contents of the Kit
.PP
The following directories/files are in the distribution:
.IP sumacc.ms 12
This file, in \-ms macro format.
.IP Makefile
Master makefile that calls Makefile's in subdirectories.
.IP cc42
C compiler binaries for 4.2 BSD.
.IP cc41
C compiler binaries for 4.1 BSD.
.IP cceun
C compiler binaries for VMS Eunice.
.IP h
Macintosh header files, copied to /usr/include/mac.
.IP lib
Macintosh library files.
.IP cmd
Resource maker and other related commands.
.IP mac
Mac C example and test programs
.IP man
Manual pages.
.IP ws
Reference copy of most of the sources distributed with the Lisa Workshop.
.NH
Installation
.PP
If you are running VMS Eunice, first examine the README and other 
files in the cceun directory.
.PP
The makefiles included have been conditionalized so that you can
change where the files reside after installation.  
At Stanford for historical reasons
the binaries are in
.I /usr/stanford/bin,
the library stuff goes in
.I /usr/sun/lib,
and the include files are kept in
.I /usr/include/mac.
If you change where things are located, you will have to: (1) edit
the master Makefile and/or the sub-Makefiles to change the installation
directory names.  (2) Edit 
.I cc*/cc68.c, 
the C compiler driver so that
it can find the assembler/loader/etc.  
This is easy to change for
.I /usr/stanford/bin,
but since the 
.I ld68 
and 
.I as68 
binaries provided have
.I /usr/sun/lib
wired in, you may want to leave that one alone.
Use
.I mkdir
to make these directories if they don't already exist.
Another possibility to change the file locations is to use the
symbolic link facility on 4.2 to (e.g.) 
.I
link -s /usr/local /usr/stanford/bin.
.R
.PP
This release contains a compiler with a larger symbol table, so
your should
.I cd
to 
.I cc42
or
.I cc41
or
.I cceun
and type
.I make.
This will install the compiler.
If you have compiler sources, the only change made in this release was in file
ccom/manifest;  the define for SYMTSZ was increased from 800 to 1600.
.PP
.I "4.1 BSD or Eunice:"
If you are running 4.1 (or a Eunice based on 4.1), edit 
lib/Makefile so that the lint library is constructed with 'mk41lint';
(4.1 lint doesnt understand the '\-C' switch.)
.PP
Now from the main directory, do a
.I make.
This will compile and install the commands, Mac library, 
Mac lint library,
include files, manual pages, and example programs.
.PP
Find your disk with MacTerminal on it.
Locally, we use a disk that also contains
.I 
Resource Mover, Set File, Examine File, 
.R
and
.I MacsBug
utilities.  These are useful utilities supplied on the
.I MacStuff
disks that come with the Workshop supplement.
You should now be able to follow the instructions under
.B Downloading
below to try out some of the programs in the UNIX
.I mac
directory.
.NH
Example Programs
.PP
The C example programs provided are:
.IP macscrawl 3
A primitive text/drawing program.
Its commands are
single keyboard characters;  examine the source code before
trying to use it.  Try the 'm'agnifying lens to zoom in and out
on sections of the screen and/or the lens itself.
.IP grow
A straight translation of the Pascal Grow program provided
in the Workshop.  Most toolbox managers
are exercised.  
You might runoff a listing of grow.c and grow.p
to compare how the Pascal was translated to C.
.I
Note a bug: 
.R
both the Pascal
and the C version apparently do not save TextEdit state when the
Notepad desk accessory is in use, resulting in weird behavior
with that accessory.
.IP insane
This tests the SANE IEEE 80 bit floating point package and
numeric conversion.  Floating operations seem to average
about 1 millisecond (well you can't say it isn't accurate...).
.IP "alert   "
Tests alert and dialog boxes, from Bill Schilit.
.IP calendar
A calendar desk accessory, from Mike Schuster.
.IP ramdisk
A ramdisk device driver, converted to C from workshop assembler.
.IP hang
A hangman game, from Dan Winkler and Ken Arnold.
.IP kermit
A preliminary implementation of kermit, from Steve Engle.  'cmd/kermit.c'
is the UNIX side.  
.IP mfinder
A 'mini' finder that can start a program several times faster than the
real finder.
.IP print
A 'print' desk accessory that can print several files in the backround,
from Mike Schuster.
.NH
Typical Compilation Cycle
.PP
Examine the Makefile and *.rc (resource compiler input)
files in the mac directory.
The makefile typically looks something like:
.DS
.I
cc68 \-m grow.c
rmaker grow.rc
.R
.DE
.PP
Cc68 compiles, assembles, and loads the C program onto a file
called
.I b.out.
Then the resource maker (sometimes called the resource compiler)
reads the file grow.rc.
This file directs rmaker to read the binary b.out and combine it
with some hex icon information in grow.rc.  The resulting
output, which would be directly executable on the Mac, is
left in the file grow.rsrc.  (rsrc stands for 'resource', and
is the same suffix convention that is used on the Lisa).
.PP
From time to time, you will also want to 
.I lint
your sources to ensure proper matching of argument and data
types.  For example:
.I
lint grow.c -lmac
.R
.NH
Downloading
.PP
Macget and macput on UNIX (from Dave Johnson, Brown U) are used to up and
download files with MacTerminal.  See the manual
pages for macget and macput for full details;
there is also a protocol description manual in 'cmd/macput.doc'.  
Typical usage is very
simple;  for example, to download the 'grow.rsrc' program
produced above:  (1) run MacTerminal on the Mac.  (2) through
MacTerminal, type the UNIX command:
.I
macput -r grow.
.R
(3) macput will now take over and perform the file transfer, in
cooperation with MacTerminal.  When the transfer is complete you
can:  (4) quit MacTerminal and run your program.
.PP
If your program uses a special icon (as do the samples provided),
a strange feature of the 'finder' requires that the 'bundle'
bit be set at least once on one of these binaries.  You
can use the 'Set File' program for this.  After finder
caches the icon in it's 'DeskTop', further bundle bits are
not needed.
.PP
Although macput / MacTerminal is the simplest way to download
files, a 
.I kermit
also exists for the Mac.  You may find this especially useful
if you need to perform file transfers with other hosts besides UNIX.
See '{cmd,man,mac}/kermit*'.
.KS
.NH
Toolbox Programming
.NH 2
Argument Passing
.PP
When using
.I
Inside Macintosh
.R
to program in C, you must do a mental translation of the
Pascal calling conventions into corresponding C conventions.
.KE
They are quite straightforward and even if you goof, lint will warn you.  
Take a look at the sample programs to get the hang of it.
Remember that a Pascal VAR, means a variable passed by
reference (address).
Here are the conventions:
.PP
When passing a structure or string, pass its address.
Pointers or handles are passed the same as in C (by value).
If Pascal expects a VAR, pass its address (if it's 
a structure or string, you've already 
converted that to an address (rule above)).
.PP
SUMacC also does automatic translation for 'integer'
and 'string' formats during Toolbox calls.  The default
integer in Pascal is a short, while C assumes it is a long.
Pascal strings are not null terminated but instead begin
with a byte count.
Some further implications of this mechanism for strings
are discussed in a section below.
.NH 2
Handle Dereferencing
.DS
The Pascal notation
.I
hTE^^.viewRect := pRect;
.R
is translated as
.I
(*hTE)\->viewRect = pRect;
.R
.DE
.NH 2
Pascal Bird-Nest Soup
.PP
Compare mac/grow.c with mac/grow.p.  Notice how the C version
can use many less nesting levels than Pascal by proper use of
.I
break, continue, 
.R
and
.I return
statements.  This greatly improves the readability
and understanding of C programs.
C programs also allow much easier setup of initialized global
data and strings.  Part of the reason 'resources' are so
common in the Pascal example programs, is that they allow
an 'easy' way for Pascal programs to access initialized data.
Of course this must be tempered with the fact that these resources
must be named and numbered in another file and introduce another
level of indirection in understanding a program listing.
The plus side to resources is that they allow easy language
translation of your program, but how many of the programs you
write will have international distribution?  If source is available
you could achieve a similar affect by placing your language
dependent strings in an ifdef'ed section or include file.
.NH 2
String Utilities
.PP
Normally on Toolbox calls, the routine
.I mactrap.s
converts automatically
between the C string convention
and the Pascal strings expected.  This occurs both
on passing the argument via the function call, and on string
VARs returned.
Thus in 99% of the cases you need do nothing special for strings.
However occasionally a Pascal string is embedded in a Toolbox
structure or something similar.
In such cases there are these functions to help out (see mac/grow.c
for an example call and lib/strconv.s for more detailed info):
.IP c2pstr 8
This converts a C to Pascal string in-place by shifting the C string
down one position and inserting a byte count at the beginning.
.IP p2cstr
This is the converse operation of converting a Pascal to a C string;
the byte count is removed and a trailing zero byte added.
.IP isapstr
This is a function;  it returns the argument, which is
a string pointer, negated.  If passed to a toolbox routine that expects
a string, this negative pointer will override the default
C to Pascal string conversion.  In effect the function states 'this
argument is-a Pascal string'.
.NH 2
Heap vs. C Bss
.PP
Uninitialized globals in C are placed in an area called 'bss'.
In this implementation, bss is reserved by appending
that amount of trailing zero bytes to the CODE resource.
(The Mac segment loader has no convenient mapping for
a bss notion contiguous to text/data;  sorry).
Thus you can use uninitialized globals as normal, but if you
have any truly large structures (over a few hundred bytes), you
should call the Toolbox routines 
.I NewPtr
or
.I NewHandle
to get a piece of the heap,
and place the pointer or handle to that area in a global variable
instead.  This is actually a common C coding practice on
UNIX, using the 
.I malloc
routine there.
.NH 2
Pascal Toolbox Calling on C Routines
.PP
Yes, this does happen occasionally.  For an example see mac/grow.c in the
routines ScrollUp, ScrollDown.  Your C function must
call an assembly helper 
.I getpargs.
.PP
This function is called with one argument, a pointer to a 'local'
structure to receive the Pascal arguments.  Your structure declaration
must include each Pascal argument, in 'stack' order, and with
the proper 'type' associated with each Pascal variable.
See the Inside Mac section 'Programming in Assembly Language', 'Calling 
conventions, stack-based routines'.  You may also
want to look at lib/getpargs.s.
.PP
Getpargs 'pops' the Pascal arguments off the stack and into your
local structure.  As a side effect, it also returns as a value,
a pointer to the Pascal return value (on the stack).  So you
can set this before returning, if your C routine is called as a function.
.PP
Below is an example C routine that is 'declared' in Pascal as
.I
FUNCTION hisproc (one: Ptr; two: INTEGER) : INTEGER;
.R
.DS L
	hisproc()
	{
		struct {
			short	two;
			Ptr	one;
		} pargs;
		short	*pret;

		pret = (short *) getpargs(&pargs, sizeof pargs);  /* get arguments */
		if (pargs.two != 0) ...  /* use the 2nd argument */
		*pret = returnvalue;
	}
.DE
.NH 2
Floating Point
.PP
See mac/insane.c for examples of SANE usage.  However you may
be better off with the fixed point arithmetic provided by
.I
FixRatio, FixMul, FixRound 
.R
discussed in the Toolbox Utilities
section of Inside Mac.
.PP
The MIT C compiler we are using also has its own built-in
floating point formats and library routines (in libc.a),
but we have no experience with these.
They are certainly not the IEEE standard.
.NH 2
Naming conventions.
.PP
Since Pascal is case insensitive, some of the names present in the
original Pascal header files had inconsistent case conventions.
Apple realized the headaches this could cause for C programmers,
and in October 84 released a small set of rules that govern
case in names.  When you invent new names, you should use these
rules.  
.IP "1." 4
The first character of a name is upper case if the symbol is:
a toolbox routine name,
a type,
an assembler global symbol.
.br
e.g.: InitGraf, MoveTo, ProcPtr, MonkeyLives
.IP "2."
The first character of a name is lower case if the symbol is:
a field,
a constant,
a variable.
.br
e.g.: shiftKey, everyEvent, fInvisible
.IP "3."
If the name consists of multiple words, the subwords are capitalized.
.IP "4."
If there are acronyms within the name, they are cased the same.
.br
e.g.: fCTS, ctsHold, TEHandle, TENew, eofErr
.NH 2
Low memory globals
.PP
The Pascal workshop defines several functions whose only purpose is to
get or set certain low memory assembler globals.  For example
TEGetScrapLen returns the contents of assembler global TEScrpLength;
TESetScrapLen can be used to set this global.  In C it is simpler
to just setup a define such as: '#define TEScrapLen (*(short *)0xab0)'.
Then the 'variable' TEScrapLen can be used as normal in the left or
right hand side of any expression.
.PP
This has been done for all of the get/set functions provided in the
workshop.  Below is a list of these locations.  If you have others
it's easy to add them to your own program.
DoubleTime CaretTime VBLQHdr EvQHdr DrvQHdr FSQHdr VCBQHdr SysPPtr 
DefVCBPtr DlgFont TEScrapHandle TEScrapLen AlertStage.
.NH 
Compiler Sources
.PP
The distribution contains only sources for the code
written at here at SUMEX (along with code contributed by
other groups).  Since the compiler/loader is based on
the Bell Labs (Johnson) Portable C Compiler, we must be careful
about distributing copies of this.  
It's also unclear what good the compiler
will do for you, since it's a large and somewhat unwieldy
amount of code.
As an interim policy we
will make these sources available to other Universities if there
is enough interest.
However don't ask unless you plan some active
development in this area.
.NH
Currently Unimplemented
.PP
SUMacC currently does not support overlays, so on a small Mac you are
limited to about 80K bytes of program.
There are no restrictions on the
size of SUMacC programs, other than the available physical memory.
The Apple workshop Pascal compiler generates PC-relative code, so its segments
are limited to 32K bytes each.  
SUMacC dynamically relocates the program
at run-time, by following relocation chains run-length encoded though
the 'unused' high order byte of long word addresses.
.PP
The Graf3D package is not converted (but see
lib/TODO for a hint on how to do it).
Some of the more esoteric rmaker types are still unimplemented.
C library and header files will always be somewhat behind in tracking
the Pascal versions
since Apple only
releases code in Pascal.  It's handy to have at least one Lisa around so
you can, for example, translate a new header file into C on your
own if you need it desparately.
.NH
Acknowledgements
.PP
The 68000 C compiler used by SUMacC is the Bell Labs (Johnson) 
portable C compiler, ported by Chris Terman of MIT and used in
the MIT NU project and the Stanford SUN system.  This same compiler /
assembler / loader is used in many of the 68K UNIX boxes currently
on the market.  The assembler is by Mike Patrick, also of MIT.
Many modifications and bug fixes have been applied by folks at
Stanford, MIT, and Lucasfilm:  Jeff Mogul, Bill Nowicki, John Seamons,
Vaughan Pratt, Eric Ostrom, and a cast of thousands.
.PP
Dave Johnson of Brown Univ. contributed the excellent macget/macput
programs that make downloading painless.  Among the many people
contributing improvements, new example programs, and bug fixes
are:  Mike Schuster of CALTECH, Dan Winkler and Steve Engle
of Harvard, Bill Schilit
at Columbia, Joe Pallas and  Steve Gross at Stanford, John Seamons
at Lucasfilm, John Peterson at Utah, Ben Hyde of Intermetrics,
Bruce Horn of Apple/Adobe, Van Jacobson at LBL, and many others.
Thank you all!
.NH
Freeware
.PP
If you think sharing is a good idea, then I
encourage you to make your own projects available to the
info-mac community.  Post a note to info-mac and tell folks
how to FTP the program from your site;  alternately SUMEX
would be glad to archive your programs for FTPing in our
info-mac directory.
ne name,
a type,
an assembler global symbol.
.br
e.g.: InitGraf, MoveTo, ProcPtr, MonkeyLives
.IP "2."
The first character of a name is lower case if the symbol is:
a field,
a constant,
a variable.
.br
e.g.: shiftKey, everyEvent, fInvisible
.IP "3."
If the name consists of multiple words, the subwords are capitalized.
.IP "4."
If there are acronyms sumacc/sumacc.mail   444      0     12       65407  3470501436   7456 Date: Tue 19 Jun 84 12:43:24-PDT
From: Joseph I. Pallas <PALLAS@SU-SCORE.ARPA>
Subject: QD and QDVar
To: croft@SUMEX-AIM.ARPA
cc: sumacc@SUMEX-AIM.ARPA

The pascal programs don't explicitly allocate a struct QDVar and
assign QD to point at it.  Is there some reason that you don't have a
statically allocated struct QDVar and statically initialized global
QD pointing at it in the library?

Such a scheme would still allow you to modify QD if you wanted to, and
save one extra step that's VERY easy to forget.

joe
-------
21-Jun-84 12:18:10-PDT,3333;000000000000
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Thu 21 Jun 84 12:18:01-PDT
Date: Thu, 21 Jun 84 12:20:55 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: using MACSBUG with SUMACC
Cc: croft, sumacc@sumex

----
	Date: 20 Jun 1984 20:27-EST
	From: David.Anderson@CMU-CS-G.ARPA
	
	I picked up my copy of the SUMacC disk today, and it included MacsBug
	and Disassembler.  I can't figure out what they do -- can someone
	enlighten me?  They sound terribly useful.
	
----
David,

Your SUMACC disk as distributed has MACSBUG named xMACSBUG, this prevents
it from being loaded at boot time.  If you want to debug something you
should follow these steps:

Ensure that Macsbug is NOT loaded;  i.e. the name in the system
folder should read "xMACSBUG".  If this is not true, then rename it,
attempt eject (to flush), and reboot.  MacTerminal and the Finder don't
work well when the large MACSBUG and DISASSEMBLER are loaded;  Finder
runs out of space and MacTerminal crashes.

AFTER you have downloaded and/or converted your program, then
rename "xMACSBUG" to "MACSBUG", eject, and reboot.  This will load
the debugger/disassembler at the top of memory.

Make sure that you have an ASCII terminal connected to the
"printer" port at 9600 baud.

Double click your program, pause a half-second, then hold down
the mouse button.  When you hear a beep, release the mouse button.
What this does is:  (1) load your program,  (2) tells the "C runtime
startoff" (lib/crtmac.s, the first part of your program to
get control after loading) to "pause" before entering your main
program.  This will give you time to set breakpoints or alter
memory before your program starts.

The "beep" means crtmac is waiting in a tight loop for register
D0 to become zero.  It will just sit there forever.  Now on
the side of your Mac, carefully press the "INTERRUPT" (not the
"RESET") button once.  The debugger should print out a register
dump on your terminal.

I assume you have read the section "ROM 7.0 MacsBug Summary" in
your Inside Macintosh.  This is located somewhat behind the "Misc"
tab in my copy.  Other sections that are helpful are "Pascal Program
Debug Strategy" and "Toolbox Names";  the latter is useful for setting
breakpoints on toolbox calls.

To MACSBUG, type "d0 0";  this clears register D0 and will allow
the program to proceed.  Now you might want to set a breakpoint on
a location or a trap;  use the appropriate "br" or "at" command.
You will probably want to have an assembler listing of your
program;  use the "-S" switch of cc68.  After you are ready to
proceed, type "g" or "t".  This will go to the next breakpoint
or trace each instruction before execution.

When finished debugging you will (unfortunately) need to rename
MACSBUG back to xMACSBUG and reboot if you want to use MacTerminal.

BETTER DEBUGGERS:  Soon Apple will be releasing their two-Mac debugger/
assembler system.  Instead of an ascii terminal on the printer port, you
use another Mac with a nice window based debugging package.  And instead
of MACSBUG/DISASSEMBLER there is just a tiny "stub" that lives on the
system heap which interfaces to the "remote" window debugger.  This idea
is very similar to David Bogg's old "TeleSwat" protocol on the Alto.
21-Jun-84 12:38:44-PDT,1064;000000000000
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Thu 21 Jun 84 12:38:41-PDT
Date: Thu, 21 Jun 84 12:41:47 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: utilities on SUMACC disk
Cc: sumacc@sumex

	Date: Wed 20 Jun 84 00:37:38-EDT
	From: BERGER@CMU-CS-C.ARPA
	Subject: SetFile and resource mover questions
	
	I can't get SetFile to set the creator field of a file. Am I
	doing something wrong, or is it just broken?
	
	Also, how do you get the Resource Mover to do anything?
	
	Robert Berger
	Berger@CMU-CS-C

Somewhere in the Monitor/Workshop/Inside Mac document set was a "hint"
on how to use SETFILE.  There is a bug in SETFILE and you have to use
the "tab" key (rather than the mouse) to select the text field(s) that you
want to edit.  After changing all the stuff you are interested in, then
you mouse "SET IT" and exit.

For a discussion of the Resource Mover, see the section "Working with
Resource Files on the Macintosh" in the "Putting Together an Application"
document dated 1/13/84.
22-Jun-84 16:49:10-PDT,1566;000000000000
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Fri 22 Jun 84 16:49:06-PDT
Date: Fri, 22 Jun 84 16:51:41 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: debugging new icons
Cc: croft, mikes@cit-vax, sumacc@sumex

The finder has a "cache" of the icon information that it gleans
from your application resource file when it is installed for the first
time.  This means that the finder runs faster, but there is also
a finder bug here:  there is currently no way to tell the finder
to refresh his cached icon pictures.  

This situation where this is most painful is when you are debugging
the icon for your application.  Even though you change the icon in
your program's resource file, the finder won't see the change.
Currently the only solution is to force the finder to rebuild his
DeskTop file by rebooting with command-option held down.  (Since this
cache is indexed by filetype/creator, you should also ensure that
ALL your applications on the disk have the new definition in their
resource file's because you don't know which one the finder will 
encounter first to make his cache entry).

One solution might be to have the finder compare the date when he
made his cache entry to the "modified" date of the file being
considered.  If the file is newer than the cache, that entry in
the cache should be rebuilt.

When I mentioned this to Bruce Horn, he said that he had once 
considered checking the (SETFILE) "init" bit for this purpose, but
didn't have time at the moment to implement it.


Date:     1 Jul 84 (Sun) 11:59:06 EDT
From:     Dave Johnson <ddj%Brown@csnet-relay.arpa>
To:       Bruce.Lucas@cmu-cs-ius.arpa, info-mac@sumex-aim.arpa
Subject:  Re: debugging icons

I tried using the Resource Mover to edit bad icons out of the Desk Top,
as was suggested, with only partial success.  At first I was using a new
author-identifier for each new try at an icon, but this seems wasteful
and would probably require eventually building a new desktop when it
becomes too full.

My original strategy for using rmover was to throw away the application with
the old icon, or turn off the bundle bit using Set File if the application
already had the new icon (but was showing the previous version), then go
into rmover on the Desk Top, and cut out the resource named by the author
string (ie, CCOM, or safer, TEST).  When the bundle bit was turned back on,
the new icon did appear, but unfortunately the previous mask was still there.

I believe removing one of the ICN# resources would solve the problem, but
don't have any idea which one to remove (there were about 16 ICN# resources
on the disk I was playing with).  I did try cutting out all of them (pasting
them in a handy MacTerminal document), but this resulted it a "Ghost Disk"
where all of the fancy icons had vanished, and I couldn't get them to come
back using the usual Bundle Bit trick.  They did return when I pasted the
resources back into the desk top, but it still gave me the bad mask . . .
back where I started.  (the folder, generic document, and generic application
or "hand" icons are probably in the System file -- only they survived without
any ICN# resources in the DeskTop).  The disk was also in bad shape after this 
ordeal; with a messed up free list, it eventually had to be erased.

Until someone figures out how the Finder maps reference idents, the best way
might be to debug icons on a scratch disk with no folders and only MacTerm,
SetFile, and the application being worked on, so you could blow away the
DeskTop any time without much pain.  Then once the icon is finished, move it
to a more stable disk.

Nicer would be a version of the icon editor that could install the icon
directly into the application's resource (and the finder?), so we don't
have to muck about sending the icon to the VAX, installing it in the .rc
file, rebuilding the application, and sending it back to the Mac again.
Even a utility that would do nothing but install icons into applications
would be better than the current situation.

	Dave Johnson
-------
 3-Jul-84 15:47:10-PDT,1282;000000000000
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Tue 3 Jul 84 15:46:56-PDT
Date: Tue, 3 Jul 84 15:49:34 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: new macsbug uses window instead of tty
Cc: sumacc@sumex

Apple has given us a new version of Macsbug that interacts through a
window at the bottom of the screen.  As you recall, the Macsbug distributed
with the Workshop 2.0 requires an external tty on the line printer port.

The new Macsbug is archived on SUMEX (FTP login: anonymous) on
<info-mac>macsbug.data.  You must retrieve it with "tenex" or "type l 8"
FTP mode, since it is an 8 bit file.  After transfering it to your local
UNIX, download it with "macput -d macsbug".  Note that this is a program,
but it's in the data fork (not resource fork).  I assume you have read the
previous note on info-mac concerning use of Macsbug.

After downloading, you should remove or rename any older debuggers ("xMacsbug"
or "Disassembler") that you had on your disk.  The new Macsbug has the
disassembler built in, so it is wasteful to load Disassembler twice.
The new Macsbug is probably slightly larger than the old Macsbug+Disassembler,
and it can't be split off from the disassembler if you're really tight on space.
 3-Jul-84 15:58:43-PDT,1077;000000000000
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Tue 3 Jul 84 15:58:26-PDT
Date: Tue, 3 Jul 84 16:01:05 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: StartupScreen and ScreenMaker
Cc: sumacc@sumex

Apple has also given us their ScreenMaker program.  This program reads
the upper left corner of a MacPaint document and converts it to a 20K byte
file called StartupScreen.  If this file is present at boot time, it is
displayed instead of the "Welcome to Macintosh" message you normally
see.  (If you are using Macsbug AND StartupScreen, a tiny line lights up
at the top of screen, in place of the "Macsbug loaded" message).
A disadvantage of StartupScreen:  it takes up space on your disk and
causes startup to be about a half-second longer than normal.

The ScreenMaker is archived on SUMEX (FTP login: anonymous) on
<info-mac>screenmaker.rsrc.  You must retrieve it with "tenex" or "type l 8"
FTP mode, since it is an 8 bit file.  After transfering it to your local
UNIX, download it with "macput -r screenmaker".
10-Jul-84 11:27:08-PDT,3543;000000000000
Mail-From: CROFT created at 10-Jul-84 11:27:04
Date: Tue 10 Jul 84 11:27:04-PDT
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [Mike Schuster <MIKES@CIT-20.ARPA>: Hacking the Text Edit scrap]
To: sumacc@SUMEX-AIM.ARPA, croft@SUMEX-AIM.ARPA

Return-Path: <MIKES@CIT-20>
Received: from CIT-20.ARPA by SUMEX-AIM.ARPA with TCP; Tue 10 Jul 84 11:03:21-PDT
Date: 10 Jul 1984 1104-PDT
Subject: Hacking the Text Edit scrap
From: Mike Schuster <MIKES@CIT-20.ARPA>
To: info-mac@SUMEX-AIM.ARPA

The Text Edit routines use a scrap whose length and handle are located
in the low memory global area.  The length of the scrap is a short at
absolute 2736.  The handle to the scrap is a long at absolute 2740.
Here is a useful C structure:

  typedef struct
     {
     short length;	/* length of text edit scrap */
     short filler;	/* what is this for? seems to be -1 always */
     Handle handle;	/* handle to text edit scrap */
     } TEGloRec;
  typedef TEGloRec *TEGloPtr;
  TEGloPtr TEGlo;

The variable TEGlo is initialized via

  TEGlo = (TEGloPtr) 2736;

The routine TEInit initializes TEGlo.length to 0 and TEGlo.handle to
NewHandle(0).  The routines TECut and TECopy set TEGlo.length to the
length of the selected text and set TEGlo.handle to point to a copy of
the selected text.

If you are using the TE scrap as a private scrap, here are some things
to remember:
   1) Be sure to squirrel away a copy of the TE scrap before opening a
      dialog box containing editable text, since the scrap might be
      modified (for example, SFPutFile).
   2) Be sure to establish a convention on the location of the 'true'
      clipboard.  Here is one that seems to work:
         When an application window is active, the clipboard is contained
         in TE scrap.  When a system desk accessory window is active, or
         when no windows are open, the clipboard is contained in the 
         Scrap Manager scrap.
      With this convention, I perform the following TE scrap -- SM scrap 
      transfers:
         a) when no windows are open, and an application window is opened
	    (SM scrap -> TE scrap).
         b) when an application window is closed leaving no opened windows
	    (TE scrap -> SM scrap).
         c) when an application window is deactivated or closed and a desk 
            accessory window is activated or opened (TE scrap -> SM scrap).
         d) when a desk accessory window is deactivated or closed and an 
	    application window is activated or opened (SM scrap -> TE scrap).
         e) when an application window is active upon ExitToShell
	    (TE scrap -> SM scrap)
      You can use the changeFlag in the modifiers field of the next
      event to catch some of the cases c) and d).  Be aware that no 
      deactivation event, and hence no changeFlag occurs when a window is 
      closed.  I have been forcing the clipboard scrap to disk to avoid 
      multiple copied during these operations.  Be sure to check for
      SM errors (such as disk locked or write protected, etc).
   3) Be careful with cutting and pasting long selections.  I have seen
      cases where a TERecord was left in an inconsistent state after a
      TEPaste.  I suspect that TE routines fail to handle MemError
      conditions.  On the other hand, it maybe a bug in my program.
      I'm currently reverse engineering TE to find out whats going on.
      Preliminary results support my conjecture.

Mike
(mikes@cit-20, mikes@cit-vax)
-------
-------
11-Jul-84 10:28:48-PDT,1778;000000000000
Mail-From: CROFT created at 11-Jul-84 10:28:45
Date: Wed 11 Jul 84 10:28:45-PDT
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [Mike Schuster <MIKES@CIT-20.ARPA>: Optimizing the TextBox routine]
To: sumacc@SUMEX-AIM.ARPA, croft@SUMEX-AIM.ARPA

Return-Path: <MIKES@CIT-20>
Received: from CIT-20.ARPA by SUMEX-AIM.ARPA with TCP; Wed 11 Jul 84 10:07:58-PDT
Date: 11 Jul 1984 1008-PDT
Subject: Optimizing the TextBox routine
From: Mike Schuster <MIKES@CIT-20.ARPA>
To: info-mac@SUMEX-AIM.ARPA

The TextBox(text, length, box, j) routine evidently operates by first
calling EraseRect to erase the box, then calling TENew to allocate a
TERecord, then calling TESetText to stuff the text into the TERecord,
then calling TEUpdate to draw the text, and finally calling TEDispose
to deallocate everything.  Unfortunately, TESetText creates a copy of
the text.  

So, TextBox should not be used as is to draw your private scrap into a
'clipboard' window, especially if your scrap is long.  As an alternative,
you can write your own TextBox that first stuffs the handle to your
private scrap into the hText field of the TERecord, then stuffs the
length of the handle into the TELength field, and finally calls
TECalText to recalculate the lineStarts array, as suggested in Inside
Mac.

The problem with this alternative is that the lineStarts array can get
long.  As a second alternative, you might figure out how many lines will
fit into the box by using information returned by GetFontInfo, and then
scan down your private scrap to find an upper bound on the number of 
characters that will be drawn, by counting end-of-line characters.
Finally, you supply this upper bound as the TElength field.

Mike
(mikes@cit-20,mikes@cit-vax)
-------
-------
13-Jul-84 10:17:22-PDT,623;000000000000
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Fri 13 Jul 84 10:17:16-PDT
Date: Fri, 13 Jul 84 10:21:09 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: disk spinning during macsbug
Cc: croft, sumacc@sumex

Since the disk drive motor is shut off with a software timeout,
it can remain on "forever" if you hit a breakpoint in macsbug
while it's spinning.  Bruce Horn offers this advice:

	Yep, you're right, it's timed in software.  
	The address to kill the motor is the IWM, DFF1FF.  
	Just do a DM DFF1FF in the debugger and it should turn the thing off.
	
	Bruce
13-Jul-84 10:28:28-PDT,1645;000000000001
Mail-From: CROFT created at 13-Jul-84 10:28:25
Date: Fri 13 Jul 84 10:28:24-PDT
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [Mike Schuster <MIKES@CIT-20.ARPA>: wordBreak hook in Text Edit]
To: croft@SUMEX-AIM.ARPA, sumacc@SUMEX-AIM.ARPA

Mail-From: PATTERMANN created at 13-Jul-84 08:51:16
Return-Path: <MIKES@CIT-20>
Received: from CIT-20.ARPA by SUMEX-AIM.ARPA with TCP; Thu 12 Jul 84 22:56:22-PDT
Date: 12 Jul 1984 2256-PDT
Subject: wordBreak hook in Text Edit
From: Mike Schuster <MIKES@CIT-20.ARPA>
To: info-mac@SUMEX-AIM.ARPA
ReSent-date: Fri 13 Jul 84 08:51:16-PDT
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;

You can change the set of word delimiting characters used by the Text
Edit routines for word wrap calculations and double click selections
by installing a non-zero address of a routine in the field 'wordBreak'
of a TERecord.  The default set of delimiting characters is /00 thru
/20, inclusive.  The routine is passed the address of the first
character of the text in a0, and an offset to the character in
question in d0.  The routine returns with d0 nonzero if the character
is a delimiter.  Also, the status register should be set reflecting
the value in d0.  As a sample, this routine defines delimiters to be
/00 thru /2f, inclusive.

	.text
	.globl	wdbreak
wdbreak:
	cmpb	#/2f,a0@(0,d0:w)
	sls	d0
	tstb	d0
	rts

One thing to remember: defining a period '.' to be a delimiter might
be great for editing C programs, but lousy when word wrapping causes a
period at the end of a sentence to appear on the next line all by
itself.
-------
-------
17-Jul-84 00:42:22-PDT,2537;000000000001
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Tue 17 Jul 84 00:42:07-PDT
Date: Tue, 17 Jul 84 00:46:01 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: additional macsbug commands
Cc: croft, sumacc@sumex

The "new" macsbug (that uses a window at the bottom of the Mac screen)
that was posted to info-mac a few weeks ago, has some new command syntax.
Here is a note from Bruce Horn explaining the new commands:
----

Here's a summary of the new Macsbug commands:

CL a -- clears the breakpoint at location a.  If a is omitted, all breakpoints
are cleared.

BR a c -- sets a breakpoint at location a for count c.  This allows you to say
"Stop after this location is hit 6 times."

GT a -- is Go Till a. (i.e. sets temporary breakpoint at a and goes.)

T n -- Traces n instructions.

S n -- Steps through n instructions  This is just like the old trace, where
it will actually step into the dispatcher.  Now T, the previous command, will
step OVER a trap.  No more tracing through the dispatcher when you just want
to get back to the main procedure.

MR n -- Looks n bytes down the stack and replaces the longword there (usually
a return address) with a magic address in the debugger.  Instead of returning
normally, this returns control to the debugger which puts back in the real
address.  This is a good way to step across subroutines which you know are
good--just trace one instruction into the routine and type MR.

WH x -- if x<512, prints out the address corresponding to the A-Trap numbered
x.  If >=512, the A-Trap "nearest" the address X will be printed.  This is
useful for finding out what trap was executing when an error occurred.

RX -- Toggles the display mode so that the registers are or are not dumped
during a trace command.  The disassembly at PC will always occur.

I think that's all of the new or changed routines in the improved Macsbug.

Parsing is slightly different, however.  Gone is the DH command, replaced by
the prefix @ for indirect.  So the command DH 4200 is replaced by DM @4200.
An additional symbol, TP (thePort) is also supported.  This is useful for
looking at the Quickdraw globals.

You can reference addresses relative to a given location just by using the +
operator.  You can also use ".", last address referenced, to temporarily have
an anchor from which to reference relative addresses.  For example, DM 14000
will set . to 14000, and then you can say DM .+200, DM .+400, etc.

Bruce
-------

18-Jul-84 20:02:41-PDT,1457;000000000001
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Wed 18 Jul 84 20:02:37-PDT
Date: Wed, 18 Jul 84 20:06:31 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: non local returns in SUMacC using setjmp/longjmp
Cc: sumacc@sumex

The "libc.a" provided on the SUMacC distribution contains a setjmp/longjmp.
The calling sequence is the same as for 4.2BSD (and most other UNIXes).
Your program must declare a "type" jmp_buf:
	
	typedef int jmp_buf[13];
	jmp_buf environ;
	...
	if (setjmp(&environ) != 0) { /* abort */ }
	...
	longjmp(&environ,1);	/* return to toplevel */

Here's the assembler in case you're curious:

|setjmp, longjmp
|
|	longjmp(a, v)
|causes a "return(v)" from the
|last call to
|
|	setjmp(v)
|by restoring all the registers and
|adjusting the stack
|
|jmp_buf is set up as:
|
|	_________________
|	|	pc	|
|	-----------------
|	|	d2	|
|	-----------------
|	|	...	|
|	-----------------
|	|	d7	|
|	-----------------
|	|	a2	|
|	-----------------
|	|	...	|
|	-----------------
|	|	a7	|
|	-----------------

	.globl setjmp, longjmp
	.text

setjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@,a0@		|pc
	moveml	#/FCFC,a0@(4.)	|d2-d7, a2-a7
	clrl	d0		|return 0
	rts

longjmp:
	movl	sp@(4.),a0	|pointer to jmp_buf
	movl	sp@(8.),d0	|value returned
	moveml	a0@(4.),#/FCFC	|restore d2-d7, a2-a7
	movl	a0@,sp@		|restore pc of call to setjmp to stack
	rts
20-Jul-84 21:04:44-PDT,1700;000000000001
Mail-From: CROFT created at 20-Jul-84 21:04:36
Date: Fri 20 Jul 84 21:04:35-PDT
From: Bill Croft <CROFT@SUMEX-AIM.ARPA>
Subject: [INTMET@BBNA.ARPA: Update events]
To: sumacc@SUMEX-AIM.ARPA

Mail-From: PATTERMANN created at 20-Jul-84 18:47:00
Return-Path: <INTMET@BBNA.ARPA>
Received: from BBNA.ARPA by SUMEX-AIM.ARPA with TCP; Thu 19 Jul 84 12:52:51-PDT
Date: Thu 19 Jul 84 15:53:28-EDT
From: INTMET@BBNA.ARPA
Subject: Update events
To: info-mac@SUMEX-AIM.ARPA
ReSent-date: Fri 20 Jul 84 18:47:00-PDT
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;

It seems that the window manager does not generate an update event for the
desk top.  Since the desk top isn't realy a window it isn't clear how it
would refer to it.  A comment in the work shop pascal sources that were
included in sumacc annotates a check if the update is on a window who's
pointer is null says "Whats this for?"  And the awnser seems to be... if
it was ever decided to generate update events for the desk top then it
might be reffered to by using a null pointer in the event message.
  I presume that finder updates its "desk top" by slipping a real window
over the entire desk, sort of a table cloth I guess.  
  The manual suggests that if you recieve an update event for a desk
accessory that you ignore it, it also says that it should neve happen.
It realy isn't a good idea ever to ignore an update event, the event
manager checks for windows which need updating often, if you don't call
BeginUpdate and EndUpdate on the window once you get the update event then
the event manager will keep throwing the event at you with a passion.
			Ben Hyde
-------
-------
23-Jul-84 13:41:09-PDT,808;000000000001
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Mon 23 Jul 84 13:41:03-PDT
Date: Mon, 23 Jul 84 13:45:16 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: GetCursor
Cc: sumacc@sumex

	Date: Sun, 22 Jul 84 22:45:24 edt
	From: chavez@harvard.ARPA (R. Martin Chavez)
	Subject: Cursors
	
		Does anyone out there have rmaker.c definitions for
	the watch and shadow-"+" cursors?  If not, I'll just paste in
	some cursor resources from the system file.
		Thanks,
		R. Martin Chavez
	
Actually, look at the "file" example program, the normal way to pick
up these other cursors IS from the system resource:

	CursHandle watchH;
	watchH = GetCursor(4);	/* Apple should put these magic numbers
				   in an interface file somewhere */
	SetCursor(*watchH);
23-Jul-84 18:17:46-PDT,1043;000000000001
Return-Path: <croft@safe>
Received: from safe by SUMEX-AIM.ARPA with TCP; Mon 23 Jul 84 18:17:42-PDT
Date: Mon, 23 Jul 84 18:22:01 pdt
From: Bill Croft <croft@safe>
To: info-mac@sumex
Subject: decoding uploaded lisa sources
Cc: sumacc@sumex

By using maccom to write Lisa .text files onto a Mac disk, you can
upload these sources quickly to your UNIX using "macget -u".
At this point the files still contain some funny Lisa control
sequences.  You can use the program below (unlisa.c) to deconvert
the compressed spaces.  (Even after conversion you may need to delete
some funny characters from the beginning of the file, these are
probably Lisa Editor cookies).
----
#include <stdio.h>
/* Lisa format to normal format converter */
main ()
{
   int c;

   while ( (c=getchar()) != EOF) {
     if (c == 16) {
      
       for (c=getchar(); c>32; c--) 
         putc(' ',stdout);
     }
     else
       if (c != 0) putc((char) c, stdout);
   }
}
----
Program above is from jw-peterson@utah-20;  thanks, John.
17-Sep-84 14:52:15-PDT,865;000000000001
Return-Path: <Douglass.GENCOM@MIT-MULTICS.ARPA>
Received: from MIT-MULTICS.ARPA by SUMEX-AIM.ARPA with TCP; Mon 17 Sep 84 14:52:04-PDT
Posted-Date:  17 Sep 84 17:43 EDT
Date:  Mon, 17 Sep 84 17:42 EDT
From:  Douglass@MIT-MULTICS.ARPA
Subject:  SUMacC MountVol and Offline question
To:  info-mac@SUMEX-AIM.ARPA
cc:  sumacc@SUMEX-AIM.ARPA
Message-ID:  <840917214208.883700@MIT-MULTICS.ARPA>

I am using SUMacC and have encountered a problem trying to use the routines
MountVol and Offline.  They are defined using the routines _mountvol and
_offline which (except that _mountvol is called _mountvo) are in the file
/usr/sumaccs/lib/io.s (on my system) but are commented out.  _offline has the
additional notation "removed 12 apr 84".  Does anyone know why they are
commented out and if they would work?  Thanks.
                              --scott
 19 Jul 84 12:52:51-PDT
Date: Thu 19 Jul 84 15:53:28-EDT
From: INTMET@BBNA.ARPA
Subject: Update events
To: info-mac@SUMEX-AIM.ARPA
ReSent-date: Fri 20 Jul 84 18:47:00-PDT
ReSent-From: Ed Pattermann <PATTERMANN@SUMEX-AIM.ARPA>
ReSent-To: info-mac: ;
sumacc/README_TO_INSTALL   444      0     12         723  3472712205   7735 
Notes about installation:
	1) must have permisstion to create the following directories:
		/usr/sun and subdirectories
		/usr/include/mac
	2) included in your path should be:
		/usr/sun/bin

Having done the above do a make from (whatever)/sumacc directory.

Please note that the directories cc41 and cceun are not used in building
the kit from source, but contain the C compiler binaries for 4.1 BSD and
Eunice systems respectively.  They are provide as a courtesy.
offline which (except that _mountvol is callehten me?  They sound terribly useful.
	
----
David,

Your SUMACC disk as distributed has MACSBUG named xMACSBUG, this prevents
it from being loaded at boot time.  If you want to debug something you
should follow these steps:

Ensure that Macsbug is NOT loaded;  i.e. the name in the system
folder should read "xMACSBUG".  If this is not true, then rename it,
attempt eject (to flush), and reboot.  MacTerminal and the Finder don't
work well when the large MACSBUG and DISASSEMBLER are loaded;  Finder
runs out of space and MacTerminal crashes.

AFTER you have downloaded and/or converted your program, then
rename "xMACSBUG" to "MACSBUG", eject, and reboot.  This will load
the debugger/disassembler at the top of memory.

Make sure that you have an ASCII terminal connected to the
"printer" port at 9600 baud.

Double click your program, pause a half-second, then hold down
the mouse button.  When you hear a beep, release the mouse button.
What this does is:  (1) load your program,  (2) tells the "C runtime
startoff" (li