moved link/ to as/link/
[fw/sdcc] / as / mcs51 / aslink.h
1 /* aslink.h */
2
3 /*
4  * (C) Copyright 1989-1995
5  * All Rights Reserved
6  *
7  * Alan R. Baldwin
8  * 721 Berkeley St.
9  * Kent, Ohio  44240
10  *
11  * 28-Oct-97 JLH:
12  *           - add proto for StoreString
13  *           - change s_id from [NCPS] to pointer
14  *           - change NCPS to 80
15  *           - case sensitive
16  *           - add R_J11 for 8051 assembler
17  * 31-Oct-97 JLH:
18  *           - add jflag and jfp for NoICE output
19  * 30-Jan-98 JLH:
20  *           - add memory space flags to a_flag for 8051
21  */
22
23 #define VERSION "V01.70 + NoICE + SDCC Feb 1999"
24
25 /*
26  * Case Sensitivity Flag
27  */
28 #define CASE_SENSITIVE  1
29
30 /*)Module       asmlnk.h
31  *
32  *      The module asmlnk.h contains the definitions for constants,
33  *      structures, global variables, and LKxxxx functions
34  *      contained in the LKxxxx.c files.
35  */
36
37 /*)BUILD
38         $(PROGRAM) =    ASLINK
39         $(INCLUDE) =    ASLINK.H
40         $(FILES) = {
41                 LKMAIN.C
42                 LKLEX.C
43                 LKAREA.C
44                 LKHEAD.C
45                 LKSYM.C
46                 LKEVAL.C
47                 LKDATA.C
48                 LKLIST.C
49                 LKRLOC.C
50                 LKLIBR.C
51                 LKS19.C
52                 LKIHX.C
53         }
54         $(STACK) = 2000
55 */
56
57 /* DECUS C void definition */
58 /* File/extension seperator */
59
60 #ifdef  decus
61 #define VOID    char
62 #define FSEPX   '.'
63 #endif
64
65 /* PDOS C void definition */
66 /* File/extension seperator */
67
68 #ifdef  PDOS
69 #define VOID    char
70 #define FSEPX   ':'
71 #endif
72
73 /* Default void definition */
74 /* File/extension seperator */
75
76 #ifndef VOID
77 #define VOID    void
78 #define FSEPX   '.'
79 #define OTHERSYSTEM
80 #endif
81
82 /*
83  * PATH_MAX
84  */
85 #include <limits.h>
86 #ifndef PATH_MAX                /* POSIX, but not required   */
87  #if defined(__BORLANDC__) || defined(_MSC_VER)
88   #include <stdlib.h>
89   #define PATH_MAX      _MAX_PATH
90  #else
91   #define PATH_MAX      255     /* define a reasonable value */
92  #endif
93 #endif
94
95 /*
96  * This file defines the format of the
97  * relocatable binary file.
98  */
99
100 #define NCPS    80              /* characters per symbol (JLH: change from 8) */
101 #define NDATA   16              /* actual data */
102 #define NINPUT  PATH_MAX        /* Input buffer size */
103 #define NHASH   64              /* Buckets in hash table */
104 #define HMASK   077             /* Hash mask */
105 #define NLPP    60              /* Lines per page */
106 #define NTXT    16              /* T values */
107
108 /*
109  *      The "R_" relocation constants define values used in
110  *      generating the assembler relocation output data for
111  *      areas, symbols, and code.
112  *
113  *
114  *      Relocation types.
115  *
116  *             7     6     5     4     3     2     1     0
117  *          +-----+-----+-----+-----+-----+-----+-----+-----+
118  *          | MSB | PAGn| PAG0| USGN| BYT2| PCR | SYM | BYT |
119  *          +-----+-----+-----+-----+-----+-----+-----+-----+
120  */
121
122 #define R_WORD  0x00            /* 16 bit */
123 #define R_BYTE  0x01            /*  8 bit */
124
125 #define R_AREA  0x00            /* Base type */
126 #define R_SYM   0x02
127
128 #define R_NORM  0x00            /* PC adjust */
129 #define R_PCR   0x04
130
131 #define R_BYT1  0x00            /* Byte count for R_BYTE = 1 */
132 #define R_BYT2  0x08            /* Byte count for R_BYTE = 2 */
133
134 #define R_SGND  0x00            /* Signed Byte */
135 #define R_USGN  0x10            /* Unsigned Byte */
136
137 #define R_NOPAG 0x00            /* Page Mode */
138 #define R_PAG0  0x20            /* Page '0' */
139 #define R_PAG   0x40            /* Page 'nnn' */
140
141 #define R_LSB   0x00            /* low byte */
142 #define R_MSB   0x80            /* high byte */
143
144 #define R_BYT3  0x100           /* if R_BYTE is set, this is a
145                                  * 3 byte address, of which
146                                  * the linker must select one byte.
147                                  */
148 #define R_HIB   0x200           /* If R_BYTE & R_BYT3 are set, linker
149                                  * will select byte 3 of the relocated
150                                  * 24 bit address.
151                                  */
152
153 #define R_BIT   0x400           /* Linker will convert from byte-addressable
154                                  * space to bit-addressable space.
155                                  */
156
157 #define R_J11   (R_WORD|R_BYT2) /* JLH: 11 bit JMP and CALL (8051) */
158 #define R_J19   (R_WORD|R_BYT2|R_MSB) /* 19 bit JMP/CALL (DS80C390) */
159 #define R_C24   (R_WORD|R_BYT1|R_MSB) /* 24 bit address (DS80C390) */
160 #define R_J19_MASK (R_BYTE|R_BYT2|R_MSB)
161
162 #define IS_R_J19(x) (((x) & R_J19_MASK) == R_J19)
163 #define IS_R_J11(x) (((x) & R_J19_MASK) == R_J11)
164 #define IS_C24(x) (((x) & R_J19_MASK) == R_C24)
165
166 #define R_ESCAPE_MASK   0xf0    /* Used to escape relocation modes
167                                  * greater than 0xff in the .rel
168                                  * file.
169                                  */
170
171 /*
172  * Global symbol types.
173  */
174 #define S_REF   1               /* referenced */
175 #define S_DEF   2               /* defined */
176
177 /*
178  * Area type flags
179  */
180 #define A_CON   0000            /* concatenate */
181 #define A_OVR   0004            /* overlay */
182 #define A_REL   0000            /* relocatable */
183 #define A_ABS   0010            /* absolute */
184 #define A_NOPAG 0000            /* non-paged */
185 #define A_PAG   0020            /* paged */
186
187 /* Additional flags for 8051 address spaces */
188 #define A_DATA  0000            /* data space (default)*/
189 #define A_CODE  0040            /* code space */
190 #define A_XDATA 0100            /* external data space */
191 #define A_BIT   0200            /* bit addressable space */
192
193 /*
194  * File types
195  */
196 #define F_STD   1               /* stdin */
197 #define F_LNK   2               /* File.lnk */
198 #define F_REL   3               /* File.rel */
199
200 /*
201  *      General assembler address type
202  */
203 typedef unsigned int Addr_T;
204
205 /*
206  *      The structures of head, area, areax, and sym are created
207  *      as the REL files are read during the first pass of the
208  *      linker.  The struct head is created upon encountering a
209  *      H directive in the REL file.  The structure contains a
210  *      link to a link file structure (struct lfile) which describes
211  *      the file containing the H directive, the number of data/code
212  *      areas contained in this header segment, the number of
213  *      symbols referenced/defined in this header segment, a pointer
214  *      to an array of pointers to areax structures (struct areax)
215  *      created as each A directive is read, and a pointer to an
216  *      array of pointers to symbol structures (struct sym) for
217  *      all referenced/defined symbols.  As H directives are read
218  *      from the REL files a linked list of head structures is
219  *      created by placing a link to the new head structure
220  *      in the previous head structure.
221  */
222 struct  head
223 {
224         struct  head   *h_hp;   /* Header link */
225         struct  lfile  *h_lfile;/* Associated file */
226         int     h_narea;        /* # of areas */
227         struct  areax **a_list; /* Area list */
228         int     h_nglob;        /* # of global symbols */
229         struct  sym   **s_list; /* Globle symbol list */
230         char    m_id[NCPS];     /* Module name */
231 };
232
233 /*
234  *      A structure area is created for each 'unique' data/code
235  *      area definition found as the REL files are read.  The
236  *      struct area contains the name of the area, a flag byte
237  *      which contains the area attributes (REL/CON/OVR/ABS),
238  *      an area subtype (not used in this assembler), and the
239  *      area base address and total size which will be filled
240  *      in at the end of the first pass through the REL files.
241  *      As A directives are read from the REL files a linked
242  *      list of unique area structures is created by placing a
243  *      link to the new area structure in the previous area structure.
244  */
245 struct  area
246 {
247         struct  area    *a_ap;  /* Area link */
248         struct  areax   *a_axp; /* Area extension link */
249         Addr_T  a_addr;         /* Beginning address of area */
250         Addr_T  a_size;         /* Total size of the area */
251         Addr_T  a_unaloc;       /* Total number of unalocated bytes, for error reporting */
252         char    a_type;         /* Area subtype */
253         char    a_flag;         /* Flag byte */
254         char    a_id[NCPS];     /* Name */
255 };
256
257 /*
258  *      An areax structure is created for every A directive found
259  *      while reading the REL files.  The struct areax contains a
260  *      link to the 'unique' area structure referenced by the A
261  *      directive and to the head structure this area segment is
262  *      a part of.  The size of this area segment as read from the
263  *      A directive is placed in the areax structure.  The beginning
264  *      address of this segment will be filled in at the end of the
265  *      first pass through the REL files.  As A directives are read
266  *      from the REL files a linked list of areax structures is
267  *      created for each unique area.  The final areax linked
268  *      list has at its head the 'unique' area structure linked
269  *      to the linked areax structures (one areax structure for
270  *      each A directive for this area).
271  */
272 struct  areax
273 {
274         struct  areax   *a_axp; /* Area extension link */
275         struct  area    *a_bap; /* Base area link */
276         struct  head    *a_bhp; /* Base header link */
277         Addr_T  a_addr;         /* Beginning address of section */
278         Addr_T  a_size;         /* Size of the area in section */
279 };
280
281 /*
282  *      A sym structure is created for every unique symbol
283  *      referenced/defined while reading the REL files.  The
284  *      struct sym contains the symbol's name, a flag value
285  *      (not used in this linker), a symbol type denoting
286  *      referenced/defined, and an address which is loaded
287  *      with the relative address within the area in which
288  *      the symbol was defined.  The sym structure also
289  *      contains a link to the area where the symbol was defined.
290  *      The sym structures are linked into linked lists using
291  *      the symbol link element.
292  */
293 struct  sym
294 {
295         struct  sym     *s_sp;  /* Symbol link */
296         struct  areax   *s_axp; /* Symbol area link */
297         char    s_type;         /* Symbol subtype */
298         char    s_flag;         /* Flag byte */
299         Addr_T  s_addr;         /* Address */
300         char    *s_id;          /* Name: JLH change from [NCPS] */
301 };
302
303 /*
304  *      The structure lfile contains a pointer to a
305  *      file specification string, the file type, and
306  *      a link to the next lfile structure.
307  */
308 struct  lfile
309 {
310         struct  lfile   *f_flp; /* lfile link */
311         int     f_type;         /* File type */
312         char    *f_idp;         /* Pointer to file spec */
313 };
314
315 /*
316  *      The struct base contains a pointer to a
317  *      base definition string and a link to the next
318  *      base structure.
319  */
320 struct  base
321 {
322         struct  base  *b_base;  /* Base link */
323         char          *b_strp;  /* String pointer */
324 };
325
326 /*
327  *      The struct globl contains a pointer to a
328  *      global definition string and a link to the next
329  *      global structure.
330  */
331 struct  globl
332 {
333         struct  globl *g_globl; /* Global link */
334         char          *g_strp;  /* String pointer */
335 };
336
337 /*
338  *      A structure sdp is created for each 'unique' paged
339  *      area definition found as the REL files are read.
340  *      As P directives are read from the REL files a linked
341  *      list of unique sdp structures is created by placing a
342  *      link to the new sdp structure in the previous area structure.
343  */
344 struct  sdp
345 {
346         struct  area  *s_area;  /* Paged Area link */
347         struct  areax *s_areax; /* Paged Area Extension Link */
348         Addr_T  s_addr;         /* Page address offset */
349 };
350
351 /*
352  *      The structure rerr is loaded with the information
353  *      required to report an error during the linking
354  *      process.  The structure contains an index value
355  *      which selects the areax structure from the header
356  *      areax structure list, a mode value which selects
357  *      symbol or area relocation, the base address in the
358  *      area section, an area/symbol list index value, and
359  *      an area/symbol offset value.
360  */
361 struct  rerr
362 {
363         int     aindex;         /* Linking area */
364         int     mode;           /* Relocation mode */
365         Addr_T  rtbase;         /* Base address in section */
366         int     rindex;         /* Area/Symbol reloaction index */
367         Addr_T  rval;           /* Area/Symbol offset value */
368 };
369
370 /*
371  *      The structure lbpath is created for each library
372  *      path specification input by the -k option.  The
373  *      lbpath structures are linked into a list using
374  *      the next link element.
375  */
376 struct lbpath {
377         struct  lbpath  *next;
378         char            *path;
379 };
380
381 /*
382  *      The structure lbname is created for all combinations of the
383  *      library path specifications (input by the -k option) and the
384  *      library file specifications (input by the -l option) that
385  *      lead to an existing file.  The element path points to
386  *      the path string, element libfil points to the library
387  *      file string, and the element libspc is the concatenation
388  *      of the valid path and libfil strings.
389  *
390  *      The lbpath structures are linked into a list
391  *      using the next link element.
392  *
393  *      Each library file contains a list of object files
394  *      that are contained in the particular library. e.g.:
395  *
396  *              \iolib\termio
397  *              \inilib\termio
398  *
399  *      Only one specification per line is allowed.
400  */
401 struct lbname {
402         struct  lbname  *next;
403         char            *path;
404         char            *libfil;
405         char            *libspc;
406 };
407
408 /*
409  *      The function fndsym() searches through all combinations of the
410  *      library path specifications (input by the -k option) and the
411  *      library file specifications (input by the -l option) that
412  *      lead to an existing file for a symbol definition.
413  *
414  *      The structure lbfile is created for the first library
415  *      object file which contains the definition for the
416  *      specified undefined symbol.
417  *
418  *      The element libspc points to the library file path specification
419  *      and element relfil points to the object file specification string.
420  *      The element filspc is the complete path/file specification for
421  *      the library file to be imported into the linker.  The
422  *      file specicifation may be formed in one of two ways:
423  *
424  *      (1)     If the library file contained an absolute
425  *              path/file specification then this becomes filspc.
426  *              (i.e. C:\...)
427  *
428  *      (2)     If the library file contains a relative path/file
429  *              specification then the concatenation of the path
430  *              and this file specification becomes filspc.
431  *              (i.e. \...)
432  *
433  *      The lbpath structures are linked into a list
434  *      using the next link element.
435  */
436 struct lbfile {
437         struct  lbfile  *next;
438         char            *libspc;
439         char            *relfil;
440         char            *filspc;
441         long            offset; /*>=0 if rel file is embedded in a lib file at this offset*/
442 };
443
444 /*
445  *      External Definitions for all Global Variables
446  */
447
448 extern  char    *_abs_;         /*      = { ".  .ABS." };
449                                  */
450 extern  int     lkerr;          /*      ASLink error flag
451                                  */
452 extern  char    *ip;            /*      pointer into the REL file
453                                  *      text line in ib[]
454                                  */
455 extern  char    ib[NINPUT];     /*      REL file text line
456                                  */
457 extern  char    *rp;            /*      pointer into the LST file
458                                  *      text line in rb[]
459                                  */
460 extern  char    rb[NINPUT];     /*      LST file text line being
461                                  *      address relocated
462                                  */
463 extern  unsigned char   ctype[];        /*      array of character types, one per
464                                  *      ASCII character
465                                  */
466
467 extern char sdccopt[NINPUT];
468 extern char sdccopt_module[NINPUT];
469 extern char curr_module[NINPUT];
470
471 /*
472  *      Character Type Definitions
473  */
474 #define SPACE   0000
475 #define ETC     0000
476 #define LETTER  0001
477 #define DIGIT   0002
478 #define BINOP   0004
479 #define RAD2    0010
480 #define RAD8    0020
481 #define RAD10   0040
482 #define RAD16   0100
483 #define ILL     0200
484
485 #define DGT2    DIGIT|RAD16|RAD10|RAD8|RAD2
486 #define DGT8    DIGIT|RAD16|RAD10|RAD8
487 #define DGT10   DIGIT|RAD16|RAD10
488 #define LTR16   LETTER|RAD16
489
490 #if     CASE_SENSITIVE
491 #else
492 extern  char    ccase[];        /*      an array of characters which
493                                  *      perform the case translation function
494                                  */
495 #endif
496
497 extern  struct  lfile   *filep; /*      The pointers (lfile *) filep,
498                                  *      (lfile *) cfp, and (FILE *) sfp
499                                  *      are used in conjunction with
500                                  *      the routine as_getline() to read
501                                  *      asmlnk commands from
502                                  *      (1) the standard input or
503                                  *      (2) or a command file
504                                  *      and to read the REL files
505                                  *      sequentially as defined by the
506                                  *      asmlnk input commands.
507                                  *
508                                  *      The pointer *filep points to the
509                                  *      beginning of a linked list of
510                                  *      lfile structures.
511                                  */
512 extern  struct  lfile   *cfp;   /*      The pointer *cfp points to the
513                                  *      current lfile structure
514                                  */
515 extern  struct  lfile   *startp;/*      asmlnk startup file structure
516                                  */
517 extern  struct  lfile   *linkp; /*      pointer to first lfile structure
518                                  *      containing an input REL file
519                                  *      specification
520                                  */
521 extern  struct  lfile   *lfp;   /*      pointer to current lfile structure
522                                  *      being processed by parse()
523                                  */
524 extern  struct  head    *headp; /*      The pointer to the first
525                                  *      head structure of a linked list
526                                  */
527 extern  struct  head    *hp;    /*      Pointer to the current
528                                  *      head structure
529                                  */
530 extern  struct  area    *areap; /*      The pointer to the first
531                                  *      area structure of a linked list
532                                  */
533 extern  struct  area    *ap;    /*      Pointer to the current
534                                  *      area structure
535                                  */
536 extern  struct  areax   *axp;   /*      Pointer to the current
537                                  *      areax structure
538                                  */
539 extern  struct  sym *symhash[NHASH]; /* array of pointers to NHASH
540                                       * linked symbol lists
541                                       */
542 extern  struct  base    *basep; /*      The pointer to the first
543                                  *      base structure
544                                  */
545 extern  struct  base    *bsp;   /*      Pointer to the current
546                                  *      base structure
547                                  */
548 extern  struct  globl   *globlp;/*      The pointer to the first
549                                  *      globl structure
550                                  */
551 extern  struct  globl   *gsp;   /*      Pointer to the current
552                                  *      globl structure
553                                  */
554 extern  struct  sdp     sdp;    /*      Base Paged structure
555                                  */
556 extern  struct  rerr    rerr;   /*      Structure containing the
557                                  *      linker error information
558                                  */
559 extern  FILE    *ofp;           /*      Linker Output file handle
560                                  */
561 extern  FILE    *mfp;           /*      Map output file handle
562                                  */
563 extern  FILE    *jfp;           /*      NoICE output file handle
564                                  */
565 extern  FILE    *rfp;           /*      File handle for output
566                                  *      address relocated ASxxxx
567                                  *      listing file
568                                  */
569 extern  FILE    *sfp;           /*      The file handle sfp points to the
570                                  *      currently open file
571                                  */
572 extern  FILE    *tfp;           /*      File handle for input
573                                  *      ASxxxx listing file
574                                  */
575 extern  FILE    *dfp;           /*      File handle for debug info output
576                                  */
577 extern  int     dflag;          /*      Output debug information flag
578                                  */
579 extern  int     oflag;          /*      Output file type flag
580                                  */
581 extern  int     mflag;          /*      Map output flag
582                                  */
583 extern  int     sflag;          /*      JCF: Memory usage output flag
584                                  */
585 extern  int     packflag;       /*      Pack data memory flag
586                                  */
587 extern  int     stacksize;      /*      Pack data memory flag
588                                  */
589 extern  int     jflag;          /*      NoICE output flag
590                                  */
591 extern  int     xflag;          /*      Map file radix type flag
592                                  */
593 extern  int     pflag;          /*      print linker command file flag
594                                  */
595 extern  int     uflag;          /*      Listing relocation flag
596                                  */
597 extern int      rflag;          /*      Extended linear address record flag.
598                                 */
599 extern  int     radix;          /*      current number conversion radix:
600                                  *      2 (binary), 8 (octal), 10 (decimal),
601                                  *      16 (hexadecimal)
602                                  */
603 extern  int     line;           /*      current line number
604                                  */
605 extern  int     page;           /*      current page number
606                                  */
607 extern  int     lop;            /*      current line number on page
608                                  */
609 extern  int     pass;           /*      linker pass number
610                                  */
611 extern  int     rtcnt;          /*      count of elements in the
612                                  *      rtval[] and rtflg[] arrays
613                                  */
614 extern  Addr_T  rtval[];        /*      data associated with relocation
615                                  */
616 extern  int     rtflg[];        /*      indicates if rtval[] value is
617                                  *      to be sent to the output file.
618                                  *      (always set in this linker)
619                                  */
620 extern  int     hilo;           /*      REL file byte ordering
621                                  */
622 extern  int     gline;          /*      LST file relocation active
623                                  *      for current line
624                                  */
625 extern  int     gcntr;          /*      LST file relocation active
626                                  *      counter
627                                  */
628 extern  struct lbpath *lbphead; /*      pointer to the first
629                                  *      library path structure
630                                  */
631 extern  struct lbname *lbnhead; /*      pointer to the first
632                                  *      library name structure
633                                  */
634 extern  struct lbfile *lbfhead; /*      pointer to the first
635                                  *      library file structure
636                                  */
637 extern  Addr_T iram_size;       /*      internal ram size
638                                  */
639 extern  long xram_size;         /*      external ram size
640                                  */
641 extern  long code_size;         /*      code size
642                                  */
643
644
645 /* C Library function definitions */
646 /* for reference only
647 extern  VOID            exit();
648 extern  int             fclose();
649 extern  char *          fgets();
650 extern  FILE *          fopen();
651 extern  int             fprintf();
652 extern  VOID            free();
653 extern  VOID *          malloc();
654 extern  char            putc();
655 extern  char *          strcpy();
656 extern  int             strlen();
657 extern  char *          strncpy();
658 */
659
660 /* Program function definitions */
661
662 /* lkmain.c */
663 extern  FILE *          afile();
664 extern  VOID            bassav();
665 extern  VOID            gblsav();
666 extern  VOID            iramsav();
667 extern  VOID            xramsav();
668 extern  VOID            codesav();
669 extern  VOID            iramcheck();
670 extern  VOID            link_main();
671 extern  VOID            lkexit();
672 extern  int             main();
673 extern  VOID            map();
674 extern  int             parse();
675 extern  VOID            setbas();
676 extern  VOID            setgbl();
677 extern  VOID            usage();
678 extern  VOID            copyfile();
679
680 /* lklex.c */
681 extern  char            endline();
682 extern  char            get();
683 extern  VOID            getfid();
684 extern  VOID            getid();
685 extern  VOID            getSid();
686 extern  int             as_getline();
687 extern  int             getmap();
688 extern  char            getnb();
689 extern  int             more();
690 extern  VOID            skip();
691 extern  VOID            unget();
692 extern  VOID            chop_crlf();
693
694 /* lkarea.c */
695 extern  VOID            lkparea();
696 extern  VOID            lnkarea();
697 extern  VOID            lnkarea2();
698 extern  VOID            lnksect();
699 extern  VOID            newarea();
700
701 /* lkhead.c */
702 extern  VOID            module();
703 extern  VOID            newhead();
704
705 /* lksym.c */
706 extern  int             hash();
707 extern  struct  sym *   lkpsym();
708 extern  VOID *          new();
709 extern  struct  sym *   newsym();
710 extern  VOID            symdef();
711 extern  int             symeq();
712 extern  VOID            syminit();
713 extern  VOID            symmod();
714 extern  Addr_T          symval();
715
716 /* lkeval.c */
717 extern  int             digit();
718 extern  Addr_T          eval();
719 extern  Addr_T          expr();
720 extern  int             oprio();
721 extern  Addr_T          term();
722
723 /* lklist.c */
724 extern  int             dgt();
725 extern  VOID            lkulist();
726 extern  VOID            lkalist();
727 extern  VOID            lkglist();
728 extern  VOID            lstarea();
729 extern  VOID            newpag();
730 extern  VOID            slew();
731
732 /* lkrloc.c */
733 extern  Addr_T          adb_b(register Addr_T v, register int i);
734 extern  Addr_T          adb_bit(register Addr_T v, register int i);
735 extern  Addr_T          adb_hi(Addr_T  v, int i);
736 extern  Addr_T          adb_lo(Addr_T  v, int i);
737 extern  Addr_T          adb_24_bit(register Addr_T v, register int i);
738 extern  Addr_T          adb_24_hi(Addr_T v, int i);
739 extern  Addr_T          adb_24_mid(Addr_T v, int i);
740 extern  Addr_T          adb_24_lo(Addr_T v, int i);
741 extern  Addr_T          adw_w(register Addr_T v, register int i);
742 extern  Addr_T          adw_24(Addr_T v, int i);
743 extern  Addr_T          adw_hi(Addr_T  v, int i);
744 extern  Addr_T          adw_lo(Addr_T  v, int i);
745 extern  Addr_T          evword(VOID);
746 extern  VOID            rele(VOID);
747 extern  VOID            reloc(char c);
748 extern  VOID            relt(VOID);
749 extern  VOID            relr(VOID);
750 extern  VOID            relp(VOID);
751 extern  VOID            relerr(char *str);
752 extern  char *          errmsg[];
753 extern  VOID            errdmp(FILE *fptr, char *str);
754 extern  VOID            relerp(char *str);
755 extern  VOID            erpdmp(FILE *fptr, char *str);
756 extern  VOID            prntval(FILE *fptr, Addr_T v);
757 extern  int             lastExtendedAddress;
758
759 /* lklibr.c */
760 extern  int             addfile();
761 extern  VOID            addlib();
762 extern  VOID            addpath();
763 extern  int             fndsym();
764 extern  VOID            library();
765 extern  VOID            loadfile();
766 extern  VOID            search();
767
768 /* lks19.c */
769 extern  VOID            s19();
770
771 /* lkihx.c */
772 extern  VOID            ihx();
773 extern  VOID            ihxEntendedLinearAddress(Addr_T);
774 extern  VOID            newArea();
775
776 /* lkstore.c */
777 extern char             *StoreString( char *str );
778
779 /* lknoice.c */
780 extern void             DefineNoICE( char *name, Addr_T value, int page );
781
782 /* JCF: lkmem.c */
783 extern int summary(struct area * xp);
784 extern int summary2(struct area * xp);
785
786 /* JCF: lkaomf51.c */
787 extern void SaveLinkedFilePath(char * filepath);
788 extern void CreateAOMF51(void);