1 /* Copyright (c) 1979 Regents of the University of California */ 2 3 /* static char sccsid[] = "@(#)pc.h 1.6 11/10/82"; */ 4 5 #include <setjmp.h> 6 7 /* 8 * random constants for pc 9 */ 10 11 /* 12 * the name of the display. 13 */ 14 #define DISPLAYNAME "__disply" 15 16 /* 17 * the structure below describes the locals used by the run time system. 18 * at function entry, at least this much space is allocated, 19 * and the following information is filled in: 20 * the address of a routine to close the current frame for unwinding, 21 * a pointer to the display entry for the current static level and 22 * the previous contents of the display for this static level. 23 * the curfile location is used to point to the currently active file, 24 * and is filled in as io is initiated. 25 * one of these structures is allocated on the (negatively growing) stack. 26 * at function entry, fp is set to point to the last field of the struct, 27 * thus the offsets of the fields are as indicated below. 28 */ 29 struct rtlocals { 30 jmp_buf gotoenv; 31 struct iorec *curfile; 32 struct dispsave dsave; 33 } rtlocs; 34 #define GOTOENVOFFSET ( -sizeof rtlocs ) 35 #define CURFILEOFFSET ( GOTOENVOFFSET + sizeof rtlocs.gotoenv ) 36 #define DSAVEOFFSET ( CURFILEOFFSET + sizeof rtlocs.curfile ) 37 38 /* 39 * the register save mask for saving no registers 40 */ 41 #define RSAVEMASK ( 0 ) 42 43 /* 44 * runtime check mask for divide check and integer overflow 45 */ 46 #define RUNCHECK ( ( 1 << 15 ) | ( 1 << 14 ) ) 47 48 /* 49 * formats for various names 50 * NAMEFORMAT arbitrary length strings. 51 * EXTFORMAT for externals, a preceding underscore. 52 * LABELFORMAT for label names, a preceding dollar-sign. 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 LABELFORMAT "$%s" 63 #define PREFIXFORMAT "%s%d" 64 #define LABELPREFIX "L" 65 #define LLABELPREFIX "LL" 66 #define FORMALPREFIX "__" 67 68 /* 69 * the name of the statement counter 70 */ 71 #define STMTCOUNT "__stcnt" 72 73 /* 74 * the name of the pcp counters 75 */ 76 #define PCPCOUNT "__pcpcount" 77 78 /* 79 * a vector of pointer to enclosing functions for fully qualified names. 80 */ 81 char *enclosing[ DSPLYSZ ]; 82 83 /* 84 * and of course ... 85 */ 86 #define BITSPERBYTE 8 87