xref: /original-bsd/usr.bin/pascal/src/pc.h (revision 6c57d260)
1 /* Copyright (c) 1979 Regents of the University of California */
2 
3 /* static	char sccsid[] = "@(#)pc.h 1.3 04/01/81"; */
4 
5     /*
6      *		random constants for pc
7      */
8 
9     /*
10      *	the name of the display.
11      */
12 #define	DISPLAYNAME	"__disply"
13 
14     /*
15      *	the structure below describes the locals used by the run time system.
16      *	at function entry, at least this much space is allocated,
17      *	and the following information is filled in:
18      *	the address of a routine to close the current frame for unwinding,
19      *	a pointer to the display entry for the current static level and
20      *	the previous contents of the display for this static level.
21      *	the curfile location is used to point to the currently active file,
22      *	and is filled in as io is initiated.
23      *	one of these structures is allocated on the (negatively growing) stack.
24      *	at function entry, fp is set to point to the last field of the struct,
25      *	thus the offsets of the fields are as indicated below.
26      */
27 struct rtlocals {
28     struct iorec	*curfile;
29     struct dispsave	dsave;
30     struct dispsave	*dptr;
31     int			(*unwind)();
32 } rtlocs;
33 #define	CURFILEOFFSET	( ( -sizeof rtlocs ) + sizeof rtlocs.unwind )
34 #define	DSAVEOFFSET	( CURFILEOFFSET + sizeof rtlocs.curfile )
35 #define	DPTROFFSET	( DSAVEOFFSET + sizeof rtlocs.dsave )
36 #define	UNWINDOFFSET	( DPTROFFSET + sizeof rtlocs.dptr )
37 #define	UNWINDNAME	"_UNWIND"
38 
39     /*
40      *	the register save mask for saving no registers
41      */
42 #define	RSAVEMASK	( 0 )
43 
44     /*
45      *	runtime check mask for divide check and integer overflow
46      */
47 #define	RUNCHECK	( ( 1 << 15 ) | ( 1 << 14 ) )
48 
49     /*
50      *	formats for various names
51      *	    NAMEFORMAT		arbitrary length strings.
52      *	    EXTFORMAT		for externals, a preceding underscore.
53      *	    PREFIXFORMAT	used to print made up names with prefixes.
54      *	    LABELPREFIX		with getlab() makes up label names.
55      *	    LLABELPREFIX	with getlab() makes up sdb labels.
56      *	    FORMALPREFIX	prefix for EXTFORMAT for formal entry points.
57      *	a typical use might be to print out a name with a preceeding underscore
58      *	with putprintf( EXTFORMAT , 0 , name );
59      */
60 #define	NAMEFORMAT	"%s"
61 #define	EXTFORMAT	"_%s"
62 #define	PREFIXFORMAT	"%s%d"
63 #define	LABELPREFIX	"L"
64 #define	LLABELPREFIX	"LL"
65 #define	FORMALPREFIX	"__"
66 
67     /*
68      *	the name of the statement counter
69      */
70 #define	STMTCOUNT	"__stcnt"
71 
72     /*
73      *	the name of the pcp counters
74      */
75 #define	PCPCOUNT	"__pcpcount"
76 
77     /*
78      *	a vector of pointer to enclosing functions for fully qualified names.
79      */
80 char	*enclosing[ DSPLYSZ ];
81 
82     /*
83      *	and of course ...
84      */
85 #define	BITSPERBYTE	8
86 
87     /*
88      *	error number for case label not found (ECASE)
89      *	stolen from ~mckusick/px/lib/h01errs.h
90      */
91 #define	ECASE		5
92