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