|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 3712 (0xe80) Types: TextFile Names: »CDB.H«
└─⟦1275f6521⟧ Bits:30005823 BD Software C Compiler v1.50a └─ ⟦this⟧ »CDB.H« └─⟦b35f94715⟧ Bits:30003295 BDS C version 1.50 arbejdsdiskette til RC703 Piccolo └─⟦b35f94715⟧ Bits:30005324 BDS C version 1.50 arbejdsdiskette til RC703 Piccolo └─ ⟦this⟧ »CDB.H«
#include <bdscio.h> /* Copyright (c) 1982 by J. David Kirkland, Jr. */ #define CDB2ADDR 0x7f00 /* where cdb2.ovl code sits; run-time tables * grow down from here */ #define RST_NUM 6 /* restart number for debugger breaks */ #define CDB2_FILE "CDB2.OVL" /* name of CDB2 overlay file */ #define CDB2_DRIVE "" /* default drive for CDB2.OVL */ #define NOBREAK 255 #define COPYRIGHT "Copyright (c) 1982 by J. David Kirkland, Jr." /* each function in the target program has an entry in the function * name table. The primary source of this information is the .SYM file * produced by l2. Each entry in the table is a struct fntentry. * */ struct fntentry æ char *fntaddr; /* -> first code byte (the RST n 0x0000) * in the function */ char fntnameÆ9Å; /* function name, null terminated */ char fntbreakindex; /* index into the breaktab array; * if any breakpoints are set in this function, * breaktabÆfntbreakindexÅ is the first break- * point; if none, value is NOBREAK */ struct stentry *fntst; /* -> first symbol table entry for local symbols * of this function or NIL if none */ unsigned fntfsize; /* number of bytes in stack frame */ å; #define ORIGIN BASE /* CP/M base page */ #define NIL 0 /* NIL pointer */ /* #define TYPE 0x70 #define STELT 0x08 #define FORML 0x04 #define WHAT 0x03 #define LIND 0xc0 #define CLEV 0x3f */ /* every symbol table entry corresponds to either a variable (be it a local, * a global, a formal parameter, or a structure element) or a structure. * The format is basically that of the CC1 produced symbol table, except: * the name is the LAST 8 bytes, not the first * the "stsize" field has been massaged to some extent * The name is last to enable cdb2, when searching for a local symbol, * to scan through the symbol table until a symbol with a name ending with * an 0xff byte is found (this marks the end of the locals for a given * function); because the symbol table is built down from the end of the * fn table, and I wanted to avoid wasting a whole record at the end * of each function, the name had to be at the end. (unclear, but * think for a while). */ struct stentry æ char stb1, stb2; /* descriptor bytes */ unsigned stadrs; /* relative address of variable */ unsigned stsize; /* if struct def: size of struct * if struct ref: -> struct def */ unsigned stdimsz; /* 2d dimension of array, or 0xff00 if 1 dim */ char stnameÆ8Å; /* str7 */ å; /* macros to extract information for descriptor bytes */ #define PTFNF(s) ((s).stb1&0x80) #define TYPE(s) (((s).stb1&0x70)>>4) #define CHAR 0 #define INT 1 #define UNSIGNED 2 #define LONG 3 #define FLOAT 4 #define DOUBLE 5 #define STRUCT 6 #define FUNCTION 7 #define STELT(s) (((s).stb1&0x08)) /* 3 is it a structure element ? */ #define FORML(s) (((s).stb1&0x04)) /* 2 is it a formal parameter ? */ #define WHAT(s) (((s).stb1&0x03)) #define VARIABLE 0 #define FUNCDEF 1 #define STRUCTDEF 2 #define FUNCREF 3 #define LIND(s) (((s).stb2&0xc0)>>6) /* levels of indirection */ #define CLEV(s) (((s).stb2&0x3f)) /* "defining block" -- only before * build has processed the entry */ /* after symbol table is built, CLEV is replaced by : */ #define LOCAL(s) (((s).stb2&0x02)) /* 1 is it local ? */ /* only applies if a structure ref: */ #define SPTR(s) (((s).stb2&0x01)) /* TRUE -> stsize is a pointer to * structure definition * FALSE -> stsize is size, in bytes, * of structure */ «eof»