/* Copyright (c) 1979 Regents of the University of California */
/* static char sccsid[] = "@(#)objfmt.h 1.13 4/8/83"; */
* The size of the display.
* The structure of the runtime display
char *locvars
; /* pointer to local variables */
struct blockmark
*stp
; /* pointer to local stack frame */
* The following union allows fast access to
* precomputed display entries
struct dispsave frame
[DSPLYSZ
];
* the display is made up of saved AP's and FP's.
* FP's are used to find locals,
* and AP's are used to find parameters.
* FP and AP are untyped pointers,
* but are used throughout as (char *).
* the display is used by adding AP_OFFSET or FP_OFFSET to the
* address of the approriate display entry.
# define FP_OFFSET ( sizeof (char *) )
* the display is just the saved a6.
* arguments are at positive offsets,
* locals are at negative offsets.
* there are no offsets within the saved display structure.
* the structure below describes the block mark used by the architecture.
* this is the space used by the machine between the arguments and the
* whatever is used to point to the arguments.
char *tos
; /* pointer to top of stack frame */
struct iorec
*file
; /* pointer to active file name */
long framesze
; /* number of bytes of local vars */
long nargs
; /* number of bytes of arguments */
long tests
; /* TRUE => perform runtime tests */
short offset
; /* offset of procedure in source file */
char name
[1]; /* name of active procedure */
struct dispsave odisp
; /* previous display value for this level */
struct dispsave
*dp
; /* pointer to active display entry */
char *pc
; /* previous location counter */
long lino
; /* previous line number */
* since we have the ap pointing to the number of args:
* there's the saved pc (from the jsr)
* and the saved a6 (from the link a6).
* formal routine structure:
long (*fentryaddr
)(); /* formal entry point */
long fbn
; /* block number of function */
struct dispsave fdisp
[ DSPLYSZ
]; /* saved at first passing */
#define FBNOFFSET ( FENTRYOFFSET + sizeof frtn.fentryaddr )
#define FDISPOFFSET ( FBNOFFSET + sizeof frtn.fbn )
* the creation time, the size and the magic number of the obj file
* START defines the beginning of the text space.
* This should be the defined external label "start",
* however there is no way to access externals from C
* whose names do not begin with an "_".
# define HEADER_BYTES 2048 /* the size of px_header */
# define START 0x0 /* beginning of text */
# define HEADER_BYTES 3072 /* the size of px_header */
# define START 0x8000 /* beginning of text */
# define INDX 1 /* amt to shift display index */
* these are because of varying sizes of pointers
# define INT_TYP (nl + T2INT)
# define MAXSET 65536 /* maximum set size */
# define INT_TYP (nl + T4INT)
# define PTR_DCL unsigned long /* for pointer variables */
# define SHORTADDR 32768 /* maximum short address */
# define TOOMUCH 65536 /* maximum variable size */
# define MAXSET 65536 /* maximum set size */
* Offsets due to the structure of the runtime stack.
* DPOFF1 is the amount of fixed storage in each block allocated
* as local variables for the runtime system.
* since locals are allocated negative offsets,
* -DPOFF1 is the last used implicit local offset.
* DPOFF2 is the size of the block mark.
* since arguments are allocated positive offsets,
* DPOFF2 is the end of the implicit arguments.
* for obj, the first argument has the highest offset
* from the stackpointer. and the block mark is an
* implicit last parameter.
* for pc, the first argument has the lowest offset
* from the argumentpointer. and the block mark is an
* implicit first parameter.
# define MAGICNUM 0403 /* obj magic number */
# define DPOFF2 (sizeof (struct blockmark))
# define INPUT_OFF -8 /* offset of `input' */
# define OUTPUT_OFF -4 /* offset of `output' */
# define DPOFF2 (sizeof (struct blockmark))
# define DPOFF1 ( sizeof (struct rtlocals) )
# define DPOFF2 ( sizeof (struct blockmark) )