			    {file CONSTS}
import sysglobals;

export

const
      crevid = daterec[year:90,day:23,month:1]; 
      crevno = '3.23dNovy'; 
      compilername = 'Pascal';        {title}
      copyright1 = 'Copyright Hewlett-Packard Company, 1982, 1989.';
      copyright2 = 'All rights reserved.';
      FULLDUMP = false;         (* conditional compilation for tree dump *)
      allowmodcal = FALSE;      (* conditional compilation for $MODCAL$ *)
      MC68020 = TRUE;           (* conditional compilation for 68020/68881 *)
      IDLENGTH = 80;            (* # of significant chars in names. *)
      MAXCURSOR = 1023;         (* Source page size-1 (set by workstation) *)
      maxinfiles = 10;          (* Allow 5 levels of INCLUDE *)

      DISPLIMIT = 20;           (* Symbol table levels *)
      MAXPLEVEL = 15;           (* Procedure nesting depth *)
      LClimit = -32768;         (* Maximum size for local/global vars *)

      BITSPERADDR = 8;          (* # of bits in an address unit (byte) *)
      WORDSIZE = 4;             (* # of address units (bytes) in a word *)
      BITSPERWORD = 32;         (* # of bits per word *)
      WORDALIGN = 2;            (* Alignment requirement for a word *)
      INTSIZE = WORDSIZE;       (* Sizes of predefined types, in bytes *)
      SHORTINTSIZE = 2;
      REALSIZE = 8;
      CHARSIZE = 1;             (* Unpacked char size *)
      BITSPERCHAR = 8;          (* # of bits in a packed char *)
      BOOLSIZE = 1;             (* Unpacked boolean size *)
      SCALARSIZE = 2;           (* Unpacked enumerated type *)
      PTRSIZE = WORDSIZE;       (* Size of a pointer, in bytes *)
      proksize = 8;             (* Size of a procedure var, in bytes *)

      INTALIGN = WORDALIGN;     (* Alignment requirements *)
      REALALIGN = WORDALIGN;
      CHARALIGN = 1;            (* Unpacked char alignment *)
      BOOLALIGN = 1;            (* Unpacked boolean alignment *)
      SCALARALIGN = WORDALIGN;  (* Unpacked enumerated type *)
      PTRALIGN = WORDALIGN;
      prokalign = WORDALIGN;
      parmalign = WORDALIGN;    (* minimum alignment for a parameter *)

      bigsets = true;           (* support expanded set capacity ? *)
$if bigsets$
      setlow  = 0;              (* Bounds on ordinal value of set members *)
      sethigh = 261999;         (*                  allow 262000 elements *)
      setdefaulthigh = 8175;    (* Default bound for set constructors
				   containing variable element(s) *)
      oldsethigh = 255;         (* max ordinal set val before extending *)
      setelemsize = 2;          (* Allocate unpacked sets in word units *)
      setlensize = 2;           (* Use word to actual set size *)
      setelembits = 16;
      setalign = wordalign;     (* Alignment of unpacked set *)
      setsize = ( (sethigh + setelembits) div setelembits)
			* setelemsize + setlensize;
						 (* Max set size , in bytes *)
      setdefaultsize = ( (setdefaulthigh+setelembits) div setelembits )
			* setelemsize + setlensize;
						 (* Default set size,
						in bytes, for constructors
						with variable element(s) *)
$end$
$if not bigsets$
      setlow  = 0;              (* Bounds on ordinal value of set members *)
      sethigh = 255;
      setelemsize = 2;          (* Allocate unpacked sets in word units *)
      setlensize = 2;           (* Use word to actual set size *)
      setelembits = 16;
      setalign = wordalign;     (* Alignment of unpacked set *)
      setsize = 34;             (* Max size of a set, in bytes *)
$end$
      NILFILESIZE = 150+fidleng;(* Size of a file info block *)
      FILESIZE = 150+fblksize;  (* Size of FIB with mass storage buffer *)
      STRINGSIZE = 81;          (* size of the default string, in bytes *)
      STRGLGTH = 255;           (* max length of a string *)
      bigintlen = 10;           (* max number of digits in 32-bit integer *)
      LCAFTERMARKSTACK = 0;     (* Addr of first local variable *)
      markstacksize = 12;       (* Size of inner proc stack marker, in bytes *)
      level1markstacksize = 8;  (* Size of outer proc stack marker*)
      INITLC = 0;               (* starting LC in main prog *)
      initmodlc = 0;            (* starting LC in outer modules - ignored
				   if modownLC = false  *)
      nilvalue = 0;             (* representation of NIL *)
      linesperpage = 60;        (* default # of lines on a listing page *)
      maxerrors = 10;           (* maximum number of errors on a line *)
      optnsize = 13;            (* option name size *)
      refiledefault = 30;       (* default size for ref file *)
      defiledefault = 10;       (* default size for def file *)
      maxreg = 7;               (* 68000 register numbering *)
      searchdefault = 10;
      overlaydefault = 9;

TYPE

      ADDRRANGE = integer;

      alpha = string[idlength]; (* names *)
      alphaptr = ^alpha;

				(* constants *)

      byt = 0..255;

      reflistptr = ^localref;
      localref = record
		   pc: addrrange;
		   next: reflistptr;
		 end;

      scstref = ^scstruct;
      stp = ^structure; ctp = ^identifier;

      CSTCLASS = (REEL,PSET,paofch,STRNG,bigpaoc,strctconst
		  $IF MC68020$ ,chk2_bounds $END$);

      CSP = ^ CONSTREC;

      paoc = packed array[1..strglgth] of char;
      bigpac = packed array[1..1] of char;
      stortype = (bytte,wrd,long,multi);
$if bigsets$
      setrecptr = ^setrec;
      setrec = record
		nxt : setrecptr;
		val : set of 0..oldsethigh
	      end;
$end$

      CONSTREC = RECORD
		   CCLASS: CSTCLASS;
		   case {pooled:} boolean of
		     false:
		       (case cstclass of
			  strctconst:
			    (kstruc: scstref;
			     isdumped,hasbeenoutput: boolean;
			     namep: alphaptr;
			     location: addrrange));
		     true:
		       (next: csp;       (*chain of pooled constants*)
		       conlbl: reflistptr;   (* refs to this const *)
		       case cstclass of
 $if bigsets$
			  PSET: ( plgth : integer;
				  pval : setrecptr
				);
 $end$
 $if not bigsets$
			 PSET:      (plgth: shortint;
				     PVAL: SET OF setlow..sethigh);
 $end$
			 STRNG,
			 paofch:    (SLGTH: 0..STRGLGTH;
				     SVAL: paoc);
			 bigpaoc:   (paoclgth: integer;
				     paocval: bigpac);

			 REEL:(RVAL: real)

			 $IF MC68020$;
			 chk2_bounds: (lower,upper: integer;
				       size: stortype)
			 $END$ );
		 END;

      VALU = RECORD CASE intval: BOOLEAN OF
		      TRUE:  (IVAL: INTEGER);
		      FALSE: (VALP: CSP)
		    END;

      vcref = ^valucel;
      valucel = record
		  vcnxt: vcref;
		  vcval: valu;
		  case boolean of
		    true: (vid: ctp);
		  end;

      scstruct = record
		   scstp: stp;
		   scvcp: vcref;
		   end;

				(* machine-dependent attributes*)

      callmodetype = (abscall,relcall);
      regrange = 0..maxreg;
      regtype = (A,D,F);
      addrtype =
	(inAreg,inDreg,inFreg,multiple,predecr,
	 postincr,locinreg,topofstack,loconstack,
	 labelledconst,namedconst,enumconst,
	 shortabs,longabs,prel,immediate
	 $IF MC68020$
	 ,fmultiple
	 ,inFcc                          { Don Novy  1/18/90 }
         $END$
	 );
      accesstype = (direct,indirect);
      multiregs = packed array[regtype,regrange] of boolean;

      attrptr = ^attrtype;

      attrtype = record
		   next: attrptr;
		   offset: addrrange; {used by absolute,longconst,locinreg}
		   regnum: regrange;{used by inreg,locinreg}
		   access: accesstype;
		   storage: stortype;
		   indexed: boolean;
		   indexreg: regrange;
		   indexstorage: stortype;
		   $IF MC68020$
		     indexscale: 0..3;
		   $END$
		   packd: boolean;
		   signbit: boolean;
		   bitsize: shortint;
		   bitoffset: record
				static: integer;
				variable: -1..maxreg;
				storage: stortype;
			      end;
		   case addrmode: addrtype of
		     predecr,postincr,
		     topofstack,loconstack,
		     inAreg,inDreg,inFreg
                     $IF MC68020$      { Don Novy  1/18/90 }
                     ,inFcc
                     $END$
                     : ();      (* use regnum *)

		     locinreg : (gloptr: alphaptr);   (* uses regnum, offset *)

		     shortabs,
		     longabs,
		     prel     : (absaddr: valu);  (* address + offset *)
		     immediate: (smallval: integer);
		     namedconst: (constptr: csp; callmode: callmodetype);
		     labelledconst: (constvalp: csp);
		     enumconst: (enumstp: stp);
		     multiple: (regs: multiregs);
		     $IF MC68020$
		       fmultiple: (fregs: packed array[regrange] of boolean);
		     $END$
		     end;



