-#define NCPS 80 /* characters per symbol (JLH: change from 8) */
-#define NDATA 16 /* actual data */
-#define NINPUT PATH_MAX /* Input buffer size */
-#define NHASH 64 /* Buckets in hash table */
-#define HMASK 077 /* Hash mask */
-#define NLPP 60 /* Lines per page */
-#define NTXT 16 /* T values */
+#define NCPS 80 /* characters per symbol (JLH: change from 8) */
+#define NDATA 16 /* actual data */
+#define NINPUT PATH_MAX /* Input buffer size */
+#define NHASH 64 /* Buckets in hash table */
+#define HMASK 077 /* Hash mask */
+#define NLPP 60 /* Lines per page */
+#define NTXT 16 /* T values */
- * The structures of head, area, areax, and sym are created
- * as the REL files are read during the first pass of the
- * linker. The struct head is created upon encountering a
- * H directive in the REL file. The structure contains a
- * link to a link file structure (struct lfile) which describes
- * the file containing the H directive, the number of data/code
- * areas contained in this header segment, the number of
- * symbols referenced/defined in this header segment, a pointer
- * to an array of pointers to areax structures (struct areax)
- * created as each A directive is read, and a pointer to an
- * array of pointers to symbol structures (struct sym) for
- * all referenced/defined symbols. As H directives are read
- * from the REL files a linked list of head structures is
- * created by placing a link to the new head structure
- * in the previous head structure.
+ * The structures of head, area, areax, and sym are created
+ * as the REL files are read during the first pass of the
+ * linker. The struct head is created upon encountering a
+ * H directive in the REL file. The structure contains a
+ * link to a link file structure (struct lfile) which describes
+ * the file containing the H directive, the number of data/code
+ * areas contained in this header segment, the number of
+ * symbols referenced/defined in this header segment, a pointer
+ * to an array of pointers to areax structures (struct areax)
+ * created as each A directive is read, and a pointer to an
+ * array of pointers to symbol structures (struct sym) for
+ * all referenced/defined symbols. As H directives are read
+ * from the REL files a linked list of head structures is
+ * created by placing a link to the new head structure
+ * in the previous head structure.
- struct head *h_hp; /* Header link */
- struct lfile *h_lfile;/* Associated file */
- int h_narea; /* # of areas */
- struct areax **a_list; /* Area list */
- int h_nglob; /* # of global symbols */
- struct sym **s_list; /* Globle symbol list */
- char m_id[NCPS]; /* Module name */
+ struct head *h_hp; /* Header link */
+ struct lfile *h_lfile;/* Associated file */
+ int h_narea; /* # of areas */
+ struct areax **a_list; /* Area list */
+ int h_nglob; /* # of global symbols */
+ struct sym **s_list; /* Globle symbol list */
+ char m_id[NCPS]; /* Module name */
- * A structure area is created for each 'unique' data/code
- * area definition found as the REL files are read. The
- * struct area contains the name of the area, a flag byte
- * which contains the area attributes (REL/CON/OVR/ABS),
- * an area subtype (not used in this assembler), and the
- * area base address and total size which will be filled
- * in at the end of the first pass through the REL files.
- * As A directives are read from the REL files a linked
- * list of unique area structures is created by placing a
- * link to the new area structure in the previous area structure.
+ * A structure area is created for each 'unique' data/code
+ * area definition found as the REL files are read. The
+ * struct area contains the name of the area, a flag byte
+ * which contains the area attributes (REL/CON/OVR/ABS),
+ * an area subtype (not used in this assembler), and the
+ * area base address and total size which will be filled
+ * in at the end of the first pass through the REL files.
+ * As A directives are read from the REL files a linked
+ * list of unique area structures is created by placing a
+ * link to the new area structure in the previous area structure.
- struct area *a_ap; /* Area link */
- struct areax *a_axp; /* Area extension link */
- Addr_T a_addr; /* Beginning address of area */
- Addr_T a_size; /* Total size of the area */
- Addr_T a_unaloc; /* Total number of unalocated bytes, for error reporting */
- char a_type; /* Area subtype */
- char a_flag; /* Flag byte */
- char a_id[NCPS]; /* Name */
+ struct area *a_ap; /* Area link */
+ struct areax *a_axp; /* Area extension link */
+ Addr_T a_addr; /* Beginning address of area */
+ Addr_T a_size; /* Total size of the area */
+ Addr_T a_unaloc; /* Total number of unalocated bytes, for error reporting */
+ char a_type; /* Area subtype */
+ char a_flag; /* Flag byte */
+ char a_id[NCPS]; /* Name */
- * An areax structure is created for every A directive found
- * while reading the REL files. The struct areax contains a
- * link to the 'unique' area structure referenced by the A
- * directive and to the head structure this area segment is
- * a part of. The size of this area segment as read from the
- * A directive is placed in the areax structure. The beginning
- * address of this segment will be filled in at the end of the
- * first pass through the REL files. As A directives are read
- * from the REL files a linked list of areax structures is
- * created for each unique area. The final areax linked
- * list has at its head the 'unique' area structure linked
- * to the linked areax structures (one areax structure for
- * each A directive for this area).
+ * An areax structure is created for every A directive found
+ * while reading the REL files. The struct areax contains a
+ * link to the 'unique' area structure referenced by the A
+ * directive and to the head structure this area segment is
+ * a part of. The size of this area segment as read from the
+ * A directive is placed in the areax structure. The beginning
+ * address of this segment will be filled in at the end of the
+ * first pass through the REL files. As A directives are read
+ * from the REL files a linked list of areax structures is
+ * created for each unique area. The final areax linked
+ * list has at its head the 'unique' area structure linked
+ * to the linked areax structures (one areax structure for
+ * each A directive for this area).
- * A sym structure is created for every unique symbol
- * referenced/defined while reading the REL files. The
- * struct sym contains the symbol's name, a flag value
- * (not used in this linker), a symbol type denoting
- * referenced/defined, and an address which is loaded
- * with the relative address within the area in which
- * the symbol was defined. The sym structure also
- * contains a link to the area where the symbol was defined.
- * The sym structures are linked into linked lists using
- * the symbol link element.
+ * A sym structure is created for every unique symbol
+ * referenced/defined while reading the REL files. The
+ * struct sym contains the symbol's name, a flag value
+ * (not used in this linker), a symbol type denoting
+ * referenced/defined, and an address which is loaded
+ * with the relative address within the area in which
+ * the symbol was defined. The sym structure also
+ * contains a link to the area where the symbol was defined.
+ * The sym structures are linked into linked lists using
+ * the symbol link element.
- * The structure rerr is loaded with the information
- * required to report an error during the linking
- * process. The structure contains an index value
- * which selects the areax structure from the header
- * areax structure list, a mode value which selects
- * symbol or area relocation, the base address in the
- * area section, an area/symbol list index value, and
- * an area/symbol offset value.
+ * The structure rerr is loaded with the information
+ * required to report an error during the linking
+ * process. The structure contains an index value
+ * which selects the areax structure from the header
+ * areax structure list, a mode value which selects
+ * symbol or area relocation, the base address in the
+ * area section, an area/symbol list index value, and
+ * an area/symbol offset value.
- * The structure lbname is created for all combinations of the
- * library path specifications (input by the -k option) and the
- * library file specifications (input by the -l option) that
- * lead to an existing file. The element path points to
- * the path string, element libfil points to the library
- * file string, and the element libspc is the concatenation
- * of the valid path and libfil strings.
+ * The structure lbname is created for all combinations of the
+ * library path specifications (input by the -k option) and the
+ * library file specifications (input by the -l option) that
+ * lead to an existing file. The element path points to
+ * the path string, element libfil points to the library
+ * file string, and the element libspc is the concatenation
+ * of the valid path and libfil strings.
-extern char *_abs_; /* = { ". .ABS." };
- */
-extern int lkerr; /* ASLink error flag
- */
-extern char *ip; /* pointer into the REL file
- * text line in ib[]
- */
-extern char ib[NINPUT]; /* REL file text line
- */
-extern char *rp; /* pointer into the LST file
- * text line in rb[]
- */
-extern char rb[NINPUT]; /* LST file text line being
- * address relocated
- */
-extern unsigned char ctype[]; /* array of character types, one per
- * ASCII character
- */
+extern char *_abs_; /* = { ". .ABS." };
+ */
+extern int lkerr; /* ASLink error flag
+ */
+extern char *ip; /* pointer into the REL file
+ * text line in ib[]
+ */
+extern char ib[NINPUT]; /* REL file text line
+ */
+extern char *rp; /* pointer into the LST file
+ * text line in rb[]
+ */
+extern char rb[NINPUT]; /* LST file text line being
+ * address relocated
+ */
+extern unsigned char ctype[]; /* array of character types, one per
+ * ASCII character
+ */
-extern struct lfile *filep; /* The pointers (lfile *) filep,
- * (lfile *) cfp, and (FILE *) sfp
- * are used in conjunction with
- * the routine getline() to read
- * asmlnk commands from
- * (1) the standard input or
- * (2) or a command file
- * and to read the REL files
- * sequentially as defined by the
- * asmlnk input commands.
- *
- * The pointer *filep points to the
- * beginning of a linked list of
- * lfile structures.
- */
-extern struct lfile *cfp; /* The pointer *cfp points to the
- * current lfile structure
- */
-extern struct lfile *startp;/* asmlnk startup file structure
- */
-extern struct lfile *linkp; /* pointer to first lfile structure
- * containing an input REL file
- * specification
- */
-extern struct lfile *lfp; /* pointer to current lfile structure
- * being processed by parse()
- */
-extern struct head *headp; /* The pointer to the first
- * head structure of a linked list
- */
-extern struct head *hp; /* Pointer to the current
- * head structure
- */
-extern struct area *areap; /* The pointer to the first
- * area structure of a linked list
- */
-extern struct area *ap; /* Pointer to the current
- * area structure
- */
-extern struct areax *axp; /* Pointer to the current
- * areax structure
- */
-extern struct sym *symhash[NHASH]; /* array of pointers to NHASH
- * linked symbol lists
- */
-extern struct base *basep; /* The pointer to the first
- * base structure
- */
-extern struct base *bsp; /* Pointer to the current
- * base structure
- */
-extern struct globl *globlp;/* The pointer to the first
- * globl structure
- */
-extern struct globl *gsp; /* Pointer to the current
- * globl structure
- */
-extern struct sdp sdp; /* Base Paged structure
- */
-extern struct rerr rerr; /* Structure containing the
- * linker error information
- */
-extern FILE *ofp; /* Linker Output file handle
- */
-extern FILE *mfp; /* Map output file handle
- */
-extern FILE *jfp; /* NoICE output file handle
- */
-extern FILE *rfp; /* File handle for output
- * address relocated ASxxxx
- * listing file
- */
-extern FILE *sfp; /* The file handle sfp points to the
- * currently open file
- */
-extern FILE *tfp; /* File handle for input
- * ASxxxx listing file
- */
+extern struct lfile *filep; /* The pointers (lfile *) filep,
+ * (lfile *) cfp, and (FILE *) sfp
+ * are used in conjunction with
+ * the routine getline() to read
+ * asmlnk commands from
+ * (1) the standard input or
+ * (2) or a command file
+ * and to read the REL files
+ * sequentially as defined by the
+ * asmlnk input commands.
+ *
+ * The pointer *filep points to the
+ * beginning of a linked list of
+ * lfile structures.
+ */
+extern struct lfile *cfp; /* The pointer *cfp points to the
+ * current lfile structure
+ */
+extern struct lfile *startp;/* asmlnk startup file structure
+ */
+extern struct lfile *linkp; /* pointer to first lfile structure
+ * containing an input REL file
+ * specification
+ */
+extern struct lfile *lfp; /* pointer to current lfile structure
+ * being processed by parse()
+ */
+extern struct head *headp; /* The pointer to the first
+ * head structure of a linked list
+ */
+extern struct head *hp; /* Pointer to the current
+ * head structure
+ */
+extern struct area *areap; /* The pointer to the first
+ * area structure of a linked list
+ */
+extern struct area *ap; /* Pointer to the current
+ * area structure
+ */
+extern struct areax *axp; /* Pointer to the current
+ * areax structure
+ */
+extern struct sym *symhash[NHASH]; /* array of pointers to NHASH
+ * linked symbol lists
+ */
+extern struct base *basep; /* The pointer to the first
+ * base structure
+ */
+extern struct base *bsp; /* Pointer to the current
+ * base structure
+ */
+extern struct globl *globlp;/* The pointer to the first
+ * globl structure
+ */
+extern struct globl *gsp; /* Pointer to the current
+ * globl structure
+ */
+extern struct sdp sdp; /* Base Paged structure
+ */
+extern struct rerr rerr; /* Structure containing the
+ * linker error information
+ */
+extern FILE *ofp; /* Linker Output file handle
+ */
+extern FILE *mfp; /* Map output file handle
+ */
+extern FILE *jfp; /* NoICE output file handle
+ */
+extern FILE *rfp; /* File handle for output
+ * address relocated ASxxxx
+ * listing file
+ */
+extern FILE *sfp; /* The file handle sfp points to the
+ * currently open file
+ */
+extern FILE *tfp; /* File handle for input
+ * ASxxxx listing file
+ */
- */
-extern int oflag; /* Output file type flag
- */
-extern int mflag; /* Map output flag
- */
-extern int sflag; /* JCF: Memory usage output flag
- */
-extern int packflag; /* Pack data memory flag
- */
-extern int stacksize; /* Pack data memory flag
- */
-extern int jflag; /* NoICE output flag
- */
-extern int xflag; /* Map file radix type flag
- */
-extern int pflag; /* print linker command file flag
- */
-extern int uflag; /* Listing relocation flag
- */
-extern int rflag; /* Extended linear address record flag.
- */
-extern int radix; /* current number conversion radix:
- * 2 (binary), 8 (octal), 10 (decimal),
- * 16 (hexadecimal)
- */
-extern int line; /* current line number
- */
-extern int page; /* current page number
- */
-extern int lop; /* current line number on page
- */
-extern int pass; /* linker pass number
- */
-extern int rtcnt; /* count of elements in the
- * rtval[] and rtflg[] arrays
- */
-extern Addr_T rtval[]; /* data associated with relocation
- */
-extern int rtflg[]; /* indicates if rtval[] value is
- * to be sent to the output file.
- * (always set in this linker)
- */
-extern int hilo; /* REL file byte ordering
- */
-extern int gline; /* LST file relocation active
- * for current line
- */
-extern int gcntr; /* LST file relocation active
- * counter
- */
-extern struct lbpath *lbphead; /* pointer to the first
- * library path structure
- */
-extern struct lbname *lbnhead; /* pointer to the first
- * library name structure
- */
-extern struct lbfile *lbfhead; /* pointer to the first
- * library file structure
- */
-extern Addr_T iram_size; /* internal ram size
- */
-extern long xram_size; /* external ram size
- */
-extern long code_size; /* code size
- */
+ */
+extern int oflag; /* Output file type flag
+ */
+extern int mflag; /* Map output flag
+ */
+extern int sflag; /* JCF: Memory usage output flag
+ */
+extern int packflag; /* Pack data memory flag
+ */
+extern int stacksize; /* Pack data memory flag
+ */
+extern int jflag; /* NoICE output flag
+ */
+extern int xflag; /* Map file radix type flag
+ */
+extern int pflag; /* print linker command file flag
+ */
+extern int uflag; /* Listing relocation flag
+ */
+extern int rflag; /* Extended linear address record flag.
+ */
+extern int radix; /* current number conversion radix:
+ * 2 (binary), 8 (octal), 10 (decimal),
+ * 16 (hexadecimal)
+ */
+extern int line; /* current line number
+ */
+extern int page; /* current page number
+ */
+extern int lop; /* current line number on page
+ */
+extern int pass; /* linker pass number
+ */
+extern int rtcnt; /* count of elements in the
+ * rtval[] and rtflg[] arrays
+ */
+extern Addr_T rtval[]; /* data associated with relocation
+ */
+extern int rtflg[]; /* indicates if rtval[] value is
+ * to be sent to the output file.
+ * (always set in this linker)
+ */
+extern int hilo; /* REL file byte ordering
+ */
+extern int gline; /* LST file relocation active
+ * for current line
+ */
+extern int gcntr; /* LST file relocation active
+ * counter
+ */
+extern struct lbpath *lbphead; /* pointer to the first
+ * library path structure
+ */
+extern struct lbname *lbnhead; /* pointer to the first
+ * library name structure
+ */
+extern struct lbfile *lbfhead; /* pointer to the first
+ * library file structure
+ */
+extern Addr_T iram_size; /* internal ram size
+ */
+extern long xram_size; /* external ram size
+ */
+extern long code_size; /* code size
+ */
-extern Addr_T adb_b();
-extern Addr_T adb_hi();
-extern Addr_T adb_lo();
-extern Addr_T adb_24_hi(Addr_T v, int i);
-extern Addr_T adb_24_mid(Addr_T v, int i);
-extern Addr_T adb_24_lo(Addr_T v, int i);
-extern Addr_T adw_w();
-extern Addr_T adw_24(Addr_T, int);
-extern Addr_T adw_hi();
-extern Addr_T adw_lo();
-extern Addr_T evword();
-extern VOID rele();
-extern VOID reloc();
-extern VOID relt();
-extern VOID relr();
-extern VOID relp();
-extern VOID relerr();
-extern char * errmsg[];
-extern VOID errdmp();
-extern VOID relerp();
-extern VOID erpdmp();
-extern VOID prntval();
-extern int lastExtendedAddress;
+extern Addr_T adb_b(register Addr_T v, register int i);
+extern Addr_T adb_bit(register Addr_T v, register int i);
+extern Addr_T adb_hi(Addr_T v, int i);
+extern Addr_T adb_lo(Addr_T v, int i);
+extern Addr_T adb_24_bit(register Addr_T v, register int i);
+extern Addr_T adb_24_hi(Addr_T v, int i);
+extern Addr_T adb_24_mid(Addr_T v, int i);
+extern Addr_T adb_24_lo(Addr_T v, int i);
+extern Addr_T adw_w(register Addr_T v, register int i);
+extern Addr_T adw_24(Addr_T v, int i);
+extern Addr_T adw_hi(Addr_T v, int i);
+extern Addr_T adw_lo(Addr_T v, int i);
+extern Addr_T evword(VOID);
+extern VOID rele(VOID);
+extern VOID reloc(char c);
+extern VOID relt(VOID);
+extern VOID relr(VOID);
+extern VOID relp(VOID);
+extern VOID relerr(char *str);
+extern char * errmsg[];
+extern VOID errdmp(FILE *fptr, char *str);
+extern VOID relerp(char *str);
+extern VOID erpdmp(FILE *fptr, char *str);
+extern VOID prntval(FILE *fptr, Addr_T v);
+extern int lastExtendedAddress;