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