* asranlib/asranlib.c, link/lkar.h, link/lkar.c:
[fw/sdcc] / as / mcs51 / asm.h
1 /* asm.h
2
3    Copyright (C) 1989-1995 Alan R. Baldwin
4    721 Berkeley St., Kent, Ohio 44240
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 3, or (at your option) any
9 later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
18
19 /*
20  * 28-Oct-97 JLH:
21  *           - add proto for StoreString
22  *           - change s_id from [NCPS] to pointer
23  *           - change m_id from [NCPS] to pointer
24  *           - change NCPS to 80
25  *           - case sensitive
26  *           - add R_J11 for 8051 assembler
27  *           - add outr11 prototype for 8051 assembler
28  *           - always define "ccase"
29  *  2-Nov-97 JLH:
30  *           - add jflag for debug control
31  *           - prototypes for DefineNoICE_Line
32  * 30-Jan-98 JLH:
33  *           - add memory space flags to a_flag for 8051
34  *
35  *  3-Feb-00 KV:
36  *           - add DS80C390 flat mode support.
37  */
38
39 #define VERSION "V01.70 + NoICE + SDCC mods + Flat24 Feb-1999"
40
41 #if !defined(__BORLANDC__) && !defined(_MSC_VER)
42 #include <unistd.h>
43 #endif
44
45 /*
46  * Case Sensitivity Flag
47  */
48 #define CASE_SENSITIVE  1
49
50 /*)Module       asm.h
51  *
52  *      The module asm.h contains the definitions for constants,
53  *      structures, global variables, and ASxxxx functions
54  *      contained in the ASxxxx.c files.  The two functions
55  *      and three global variables from the machine dependent
56  *      files are also defined.
57  */
58
59 /*
60  *       compiler/operating system specific definitions
61  */
62
63 /* DECUS C void definition */
64 /* File/extension seperator */
65
66 #ifdef  decus
67 #define VOID    char
68 #define FSEPX   '.'
69 #endif
70
71 /* PDOS C void definition */
72 /* File/extension seperator */
73
74 #ifdef  PDOS
75 #define VOID    char
76 #define FSEPX   ':'
77 #endif
78
79 /* Default void definition */
80 /* File/extension seperator */
81
82 #ifndef VOID
83 #define VOID    void
84 #define FSEPX   '.'
85 #define OTHERSYSTEM
86 #endif
87
88 /*
89  * PATH_MAX
90  */
91 #include <limits.h>
92 #ifndef PATH_MAX                                /* POSIX, but not required   */
93 #if defined(_MSC_VER) || defined(__BORLANDC__)  /* Microsoft C or Borland C*/
94 #include <stdlib.h>
95 #define PATH_MAX        _MAX_PATH
96 #else
97 #define PATH_MAX                                /* define a reasonable value */
98 #endif
99 #endif
100
101 #ifdef _WIN32       /* WIN32 native */
102
103 #  define NATIVE_WIN32          1
104 #  ifdef __MINGW32__  /* GCC MINGW32 depends on configure */
105 #    include "../../sdccconf.h"
106 #  else
107 #    include "../../sdcc_vc.h"
108 #    define PATH_MAX  _MAX_PATH
109 #  endif
110
111 #else               /* Assume Un*x style system */
112 #  include "../../sdccconf.h"
113 #endif
114
115 /*
116  * Assembler definitions.
117  */
118 #define LFTERM  '('                     /* Left expression delimeter */
119 #define RTTERM  ')'                     /* Right expression delimeter */
120
121 #define NCPS    80                      /* Chars. per symbol (JLH: change from 8) */
122 #define HUGE    1000                    /* A huge number */
123 #define NERR    3                       /* Errors per line */
124 #define NINPUT  1024                    /* Input buffer size (icodes need space) */
125 #define NCODE   128                     /* Listing code buffer size */
126 #define NTITL   64                      /* Title buffer size */
127 #define NSBTL   64                      /* SubTitle buffer size */
128 #define NHASH   64                      /* Buckets in hash table */
129 #define HMASK   077                     /* Hash mask */
130 #define NLPP    60                      /* Lines per page */
131 #define MAXFIL  6                       /* Maximum command line input files */
132 #define MAXINC  6                       /* Maximum nesting of include files */
133 #define MAXIF   10                      /* Maximum nesting of if/else/endif */
134
135 #define NLIST   0                       /* No listing */
136 #define SLIST   1                       /* Source only */
137 #define ALIST   2                       /* Address only */
138 #define BLIST   3                       /* Address only with allocation */
139 #define CLIST   4                       /* Code */
140 #define ELIST   5                       /* Equate only */
141
142 #define dot     sym[0]                  /* Dot, current loc */
143 #define dca     area[0]                 /* Dca, default code area */
144
145
146 /* NB: for Flat24 extentions to work, Addr_T must be at least 24
147  * bits. This is checked at runtime when the .flat24 directive
148  * is processed.
149  */
150 typedef unsigned int Addr_T;
151
152 /*
153  *      The area structure contains the parameter values for a
154  *      specific program or data section.  The area structure
155  *      is a linked list of areas.  The initial default area
156  *      is "_CODE" defined in asdata.c, the next area structure
157  *      will be linked to this structure through the structure
158  *      element 'struct area *a_ap'.  The structure contains the
159  *      area name, area reference number ("_CODE" is 0) determined
160  *      by the order of .area directives, area size determined
161  *      from the total code and/or data in an area, area fuzz is
162  *      a variable used to track pass to pass changes in the
163  *      area size caused by variable length instruction formats,
164  *      and area flags which specify the area's relocation type.
165  */
166 struct  area
167 {
168         struct  area *a_ap;             /* Area link */
169         char    a_id[NCPS];             /* Area Name */
170         int     a_ref;                  /* Ref. number */
171         Addr_T  a_addr;                 /* Area address */
172         Addr_T  a_size;                 /* Area size */
173         Addr_T  a_fuzz;                 /* Area fuzz */
174         int     a_flag;                 /* Area flags */
175 };
176
177 /*
178  *      The "A_" area constants define values used in
179  *      generating the assembler area output data.
180  *
181  * Area flags
182  *
183  *         7     6      5    4     3     2     1     0
184  *      +-----+-----+-----+-----+-----+-----+-----+-----+
185  *      | BIT |XDATA|DATA | PAG | ABS | OVR |     |     |
186  *      +-----+-----+-----+-----+-----+-----+-----+-----+
187  */
188
189 #define A_CON   0000                    /* Concatenating */
190 #define A_OVR   0004                    /* Overlaying */
191 #define A_REL   0000                    /* Relocatable */
192 #define A_ABS   0010                    /* absolute */
193 #define A_NOPAG 0000                    /* Non-Paged */
194 #define A_PAG   0020                    /* Paged */
195
196 /* Additional flags for 8051 address spaces */
197 #define A_DATA  0000                    /* data space (default)*/
198 #define A_CODE  0040                    /* code space */
199 #define A_XDATA 0100                    /* external data space */
200 #define A_BIT   0200                    /* bit addressable space */
201
202 /*
203  *      The "R_" relocation constants define values used in
204  *      generating the assembler relocation output data for
205  *      areas, symbols, and code.
206  *
207  * Relocation flags
208  *
209  *         7     6     5     4     3     2     1     0
210  *      +-----+-----+-----+-----+-----+-----+-----+-----+
211  *      | MSB | PAGn| PAG0| USGN| BYT2| PCR | SYM | BYT |
212  *      +-----+-----+-----+-----+-----+-----+-----+-----+
213  */
214
215 #define R_WORD  0x00                    /* 16 bit */
216 #define R_BYTE  0x01                    /*  8 bit */
217
218 #define R_AREA  0x00                    /* Base type */
219 #define R_SYM   0x02
220
221 #define R_NORM  0x00                    /* PC adjust */
222 #define R_PCR   0x04
223
224 #define R_BYT1  0x00                    /* Byte count for R_BYTE = 1 */
225 #define R_BYT2  0x08                    /* Byte count for R_BYTE = 2 */
226
227 #define R_SGND  0x00                    /* Signed Byte */
228 #define R_USGN  0x10                    /* Unsigned Byte */
229
230 #define R_NOPAG 0x00                    /* Page Mode */
231 #define R_PAG0  0x20                    /* Page '0' */
232 #define R_PAG   0x40                    /* Page 'nnn' */
233
234 #define R_LSB   0x00                    /* low byte */
235 #define R_MSB   0x80                    /* high byte */
236
237 #define R_BYT3  0x100                   /* if R_BYTE is set, this is a
238                                          * 3 byte address, of which
239                                          * the linker must select one byte.
240                                          */
241 #define R_HIB   0x200                   /* If R_BYTE & R_BYT3 are set, linker
242                                          * will select byte 3 of the relocated
243                                          * 24 bit address.
244                                          */
245
246 #define R_BIT   0x400                   /* Linker will convert from byte-addressable
247                                          * space to bit-addressable space.
248                                          */
249
250 #define R_J11   (R_WORD|R_BYT2)         /* JLH: 11 bit JMP and CALL (8051) */
251 #define R_J19   (R_WORD|R_BYT2|R_MSB)   /* 19 bit JMP/CALL (DS80C390)      */
252 #define R_C24   (R_WORD|R_BYT1|R_MSB)   /* 24 bit address (DS80C390)       */
253 #define R_J19_MASK (R_BYTE|R_BYT2|R_MSB)
254
255 #define IS_R_J19(x) (((x) & R_J19_MASK) == R_J19)
256 #define IS_R_J11(x) (((x) & R_J19_MASK) == R_J11)
257 #define IS_C24(x) (((x) & R_J19_MASK) == R_C24)
258
259 #define R_ESCAPE_MASK   0xf0            /* Used to escape relocation modes
260                                          * greater than 0xff in the .rel
261                                          * file.
262                                          */
263
264 /*
265  * Listing Control Flags
266  */
267
268 #define R_HIGH  0040000                 /* High Byte */
269 #define R_RELOC 0100000                 /* Relocation */
270
271 #define R_DEF   00                      /* Global def. */
272 #define R_REF   01                      /* Global ref. */
273 #define R_REL   00                      /* Relocatable */
274 #define R_ABS   02                      /* Absolute */
275 #define R_GBL   00                      /* Global */
276 #define R_LCL   04                      /* Local */
277
278 /*
279  *      The mne structure is a linked list of the assembler
280  *      mnemonics and directives.  The list of mnemonics and
281  *      directives contained in the device dependent file
282  *      xxxpst.c are hashed and linked into NHASH lists in
283  *      module assym.c by syminit().  The structure contains
284  *      the mnemonic/directive name, a subtype which directs
285  *      the evaluation of this mnemonic/directive, a flag which
286  *      is used to detect the end of the mnemonic/directive
287  *      list in xxxpst.c, and a value which is normally
288  *      associated with the assembler mnemonic base instruction
289  *      value.
290  */
291 struct  mne
292 {
293         struct  mne *m_mp;              /* Hash link */
294         char    *m_id;                  /* Mnemonic JLH: change from [NCPS] */
295         char    m_type;                 /* Mnemonic subtype */
296         char    m_flag;                 /* Mnemonic flags */
297         Addr_T  m_valu;                 /* Value */
298 };
299
300 /*
301  *      The sym structure is a linked list of symbols defined
302  *      in the assembler source files.  The first symbol is "."
303  *      defined in asdata.c.  The entry 'struct tsym *s_tsym'
304  *      links any temporary symbols following this symbol and
305  *      preceeding the next normal symbol.  The structure also
306  *      contains the symbol's name, type (USER or NEW), flag
307  *      (global, assigned, and multiply defined), a pointer
308  *      to the area structure defining where the symbol is
309  *      located, a reference number assigned by outgsd() in
310  *      asout.c, and the symbols address relative to the base
311  *      address of the area where the symbol is located.
312  */
313 struct  sym
314 {
315         struct  sym  *s_sp;             /* Hash link */
316         struct  tsym *s_tsym;           /* Temporary symbol link */
317         char    *s_id;                  /* Symbol: JLH change from [NCPS] */
318         char    s_type;                 /* Symbol subtype */
319         char    s_flag;                 /* Symbol flags */
320         struct  area *s_area;           /* Area line, 0 if absolute */
321         int     s_ref;                  /* Ref. number */
322         Addr_T  s_addr;                 /* Address */
323         Addr_T  s_org;                  /* Start Address if absolute */
324 };
325
326 #define S_GBL           01              /* Global */
327 #define S_ASG           02              /* Assigned */
328 #define S_MDF           04              /* Mult. def */
329 #define S_END           010             /* End mark for pst. */
330 #define S_BIT           020             /* address of bit in byte memory */
331
332 #define S_NEW           0               /* New name */
333 #define S_USER          1               /* User name */
334                                         /* unused slot */
335                                         /* unused slot */
336                                         /* unused slot */
337
338 #define S_BYTE          5               /* .byte */
339 #define S_WORD          6               /* .word */
340 #define S_ASCII         7               /* .ascii */
341 #define S_ASCIZ         8               /* .asciz */
342 #define S_BLK           9               /* .blkb or .blkw */
343 #define S_INCL          10              /* .include */
344 #define S_DAREA         11              /* .area */
345 #define S_ATYP          12              /* .area type */
346 #define S_AREA          13              /* .area name */
347 #define S_GLOBL         14              /* .globl */
348 #define S_PAGE          15              /* .page */
349 #define S_TITLE         16              /* .title */
350 #define S_SBTL          17              /* .sbttl */
351 #define S_IF            18              /* .if */
352 #define S_ELSE          19              /* .else */
353 #define S_ENDIF         20              /* .endif */
354 #define S_EVEN          21              /* .even */
355 #define S_ODD           22              /* .odd */
356 #define S_RADIX         23              /* .radix */
357 #define S_ORG           24              /* .org */
358 #define S_MODUL         25              /* .module */
359 #define S_ASCIS         26              /* .ascis */
360 #define S_FLAT24        27              /* .flat24 */
361 #define S_OPTSDCC       28              /* .optsdcc */
362
363 /*
364  *      The tsym structure is a linked list of temporary
365  *      symbols defined in the assembler source files following
366  *      a normal symbol.  The structure contains the temporary
367  *      symbols number, a flag (multiply defined), a pointer to the
368  *      area structure defining where the temporary structure
369  *      is located, and the temporary symbol's address relative
370  *      to the base address of the area where the symbol
371  *      is located.
372  */
373 struct  tsym
374 {
375         struct  tsym *t_lnk;            /* Link to next */
376 /* sandeep changed to 'int' from 'char' */
377 /* this will increase the number temp symbols
378    that can be defined from 255 to INT_MAX */
379         int t_num;                      /* 0-INT_MAX$ */
380         int t_flg;                      /* flags */
381
382         struct  area *t_area;           /* Area */
383         Addr_T  t_addr;                 /* Address */
384 };
385
386 /*
387  *      External Definitions for all Global Variables
388  */
389
390 extern  int     aserr;                  /*      ASxxxx error counter
391                                          */
392 extern  jmp_buf jump_env;               /*      compiler dependent structure
393                                          *      used by setjmp() and longjmp()
394                                          */
395 extern  int     inpfil;                 /*      count of assembler
396                                          *      input files specified
397                                          */
398 extern  int     incfil;                 /*      current file handle index
399                                          *      for include files
400                                          */
401 extern  int     cfile;                  /*      current file handle index
402                                          *      of input assembly files
403                                          */
404 extern  int     flevel;                 /*      IF-ELSE-ENDIF flag will be non
405                                          *      zero for false conditional case
406                                          */
407 extern  int     tlevel;                 /*      current conditional level
408                                          */
409 extern  int     ifcnd[MAXIF+1];         /*      array of IF statement condition
410                                          *      values (0 = FALSE) indexed by tlevel
411                                          */
412 extern  int     iflvl[MAXIF+1];         /*      array of IF-ELSE-ENDIF flevel
413                                          *      values indexed by tlevel
414                                          */
415 extern  char
416         afn[PATH_MAX];                  /*      afile() temporary filespec
417                                          */
418 extern  char
419         srcfn[MAXFIL][PATH_MAX];        /*      array of source file names
420                                          */
421 extern  int
422         srcline[MAXFIL];                /*      current source file line
423                                          */
424 extern  char
425         incfn[MAXINC][PATH_MAX];        /*      array of include file names
426                                          */
427 extern  int
428         incline[MAXINC];                /*      current include file line
429                                          */
430 extern  int     radix;                  /*      current number conversion radix:
431                                          *      2 (binary), 8 (octal), 10 (decimal),
432                                          *      16 (hexadecimal)
433                                          */
434 extern  int     line;                   /*      current assembler source
435                                          *      line number
436                                          */
437 extern  int     page;                   /*      current page number
438                                          */
439 extern  int     lop;                    /*      current line number on page
440                                          */
441 extern  int     pass;                   /*      assembler pass number
442                                          */
443 extern  int     org_cnt;                /*      .org directive counter
444                                          */
445 extern  int     lflag;                  /*      -l, generate listing flag
446                                          */
447 extern  int     cflag;                  /*      -c, generate sdcdb debug information
448                                          */
449 extern  int     gflag;                  /*      -g, make undefined symbols global flag
450                                          */
451 extern  int     aflag;                  /*      -a, make all symbols global flag
452                                          */
453 extern  int     jflag;                  /*      -j, generate debug information flag
454                                          */
455 extern  int     oflag;                  /*      -o, generate relocatable output flag
456                                          */
457 extern  int     sflag;                  /*      -s, generate symbol table flag
458                                          */
459 extern  int     pflag;                  /*      -p, enable listing pagination
460                                          */
461 extern  int     xflag;                  /*      -x, listing radix flag
462                                          */
463 extern  int     fflag;                  /*      -f(f), relocations flagged flag
464                                          */
465 extern  Addr_T  laddr;                  /*      address of current assembler line
466                                          *      or value of .if argument
467                                          */
468 extern  Addr_T  fuzz;                   /*      tracks pass to pass changes in the
469                                          *      address of symbols caused by
470                                          *      variable length instruction formats
471                                          */
472 extern  int     lmode;                  /*      listing mode
473                                          */
474 extern  struct  area    area[];         /*      array of 1 area
475                                          */
476 extern  struct  area *areap;            /*      pointer to an area structure
477                                          */
478 extern  struct  sym     sym[];          /*      array of 1 symbol
479                                          */
480 extern  struct  sym *symp;              /*      pointer to a symbol structure
481                                          */
482 extern  struct  sym *symhash[NHASH];    /*      array of pointers to NHASH
483                                          *      linked symbol lists
484                                          */
485 extern  struct  mne *mnehash[NHASH];    /*      array of pointers to NHASH
486                                          *      linked mnemonic/directive lists
487                                          */
488 extern  char    *ep;                    /*      pointer into error list
489                                          *      array eb[NERR]
490                                          */
491 extern  char    eb[NERR];               /*      array of generated error codes
492                                          */
493 extern  const char *ip;                 /*      pointer into the assembler-source
494                                          *      text line in ib[]
495                                          */
496 extern  const char *ib;                 /*      assembler-source text line
497                                          */
498 extern  char    *cp;                    /*      pointer to assembler output
499                                          *      array cb[]
500                                          */
501 extern  char    cb[NCODE];              /*      array of assembler output values
502                                          */
503 extern  int     *cpt;                   /*      pointer to assembler relocation type
504                                          *      output array cbt[]
505                                          */
506 extern  int     cbt[NCODE];             /*      array of assembler relocation types
507                                          *      describing the data in cb[]
508                                          */
509 extern  char    tb[NTITL];              /*      Title string buffer
510                                          */
511 extern  char    stb[NSBTL];             /*      Subtitle string buffer
512                                          */
513 extern  char    optsdcc[NINPUT];        /*      sdcc compile options
514                                          */
515 extern  int     flat24Mode;             /*      non-zero if we are using DS390 24 bit
516                                          *      flat mode (via .flat24 directive).
517                                          */
518 extern  char    symtbl[];               /*      string "Symbol Table"
519                                          */
520 extern  char    aretbl[];               /*      string "Area Table"
521                                          */
522 extern  char    module[NCPS];           /*      module name string
523                                          */
524 extern  FILE    *lfp;                   /*      list output file handle
525                                          */
526 extern  FILE    *ofp;                   /*      relocation output file handle
527                                          */
528 extern  FILE    *tfp;                   /*      symbol table output file handle
529                                          */
530 extern  FILE    *sfp[MAXFIL];           /*      array of assembler-source file handles
531                                          */
532 extern  FILE    *ifp[MAXINC];           /*      array of include-file file handles
533                                          */
534 extern  unsigned char   ctype[128];     /*      array of character types, one per
535                                          *      ASCII character
536                                          */
537
538 extern  char    ccase[128];             /* an array of characters which
539                                          * perform the case translation function
540                                          */
541 /*
542  * Definitions for Character Types
543  */
544 #define SPACE   0000
545 #define ETC     0000
546 #define LETTER  0001
547 #define DIGIT   0002
548 #define BINOP   0004
549 #define RAD2    0010
550 #define RAD8    0020
551 #define RAD10   0040
552 #define RAD16   0100
553 #define ILL     0200
554
555 #define DGT2    DIGIT|RAD16|RAD10|RAD8|RAD2
556 #define DGT8    DIGIT|RAD16|RAD10|RAD8
557 #define DGT10   DIGIT|RAD16|RAD10
558 #define LTR16   LETTER|RAD16
559
560 /*
561  *      The exp structure is used to return the evaluation
562  *      of an expression.  The structure supports three valid
563  *      cases:
564  *      (1)     The expression evaluates to a constant,
565  *              mode = S_USER, flag = 0, addr contains the
566  *              constant, and base = NULL.
567  *      (2)     The expression evaluates to a defined symbol
568  *              plus or minus a constant, mode = S_USER,
569  *              flag = 0, addr contains the constant, and
570  *              base = pointer to area symbol.
571  *      (3)     The expression evaluates to a external
572  *              global symbol plus or minus a constant,
573  *              mode = S_NEW, flag = 1, addr contains the
574  *              constant, and base = pointer to symbol.
575  */
576 struct  expr
577 {
578         char    e_mode;                 /* Address mode */
579         char    e_flag;                 /* Symbol flag */
580         Addr_T  e_addr;                 /* Address */
581         union   {
582                 struct area *e_ap;
583                 struct sym  *e_sp;
584         } e_base;                       /* Rel. base */
585         int     e_rlcf;                 /* Rel. flags */
586 };
587
588 /* C Library functions */
589 /* for reference only
590 extern  VOID            exit();
591 extern  int             fclose();
592 extern  char *          fgets();
593 extern  FILE *          fopen();
594 extern  int             fprintf();
595 extern  VOID            longjmp();
596 extern  VOID *          malloc();
597 extern  int             printf();
598 extern  char            putc();
599 extern  int             rewind();
600 extern  int             setjmp();
601 extern  int             strcmp();
602 extern  char *          strcpy();
603 extern  int             strlen();
604 extern  char *          strncpy();
605 */
606
607 /* Machine independent functions */
608
609 /* asmain.c */
610 extern  FILE *          afile();
611 extern  VOID            asexit();
612 extern  VOID            asmbl();
613 extern  int             main();
614 extern  VOID            newdot();
615 extern  VOID            phase();
616 extern  VOID            usage();
617
618 /* aslex.c */
619 extern  char            endline();
620 extern  char            get();
621 extern  VOID            getid();
622 extern  int             as_getline();
623 extern  int             getmap();
624 extern  char            getnb();
625 extern  VOID            getst();
626 extern  int             more();
627 extern  VOID            unget();
628 extern  VOID            chop_crlf();
629
630 /* assym.c */
631 extern  struct  area *  alookup();
632 extern  struct  mne *   mlookup();
633 extern  int             hash();
634 extern  struct  sym *   lookup();
635 extern  VOID *          new();
636 extern  char *          strsto(char *str);
637 extern  int             symeq();
638 extern  VOID            syminit();
639 extern  VOID            symglob();
640 extern  VOID            allglob();
641
642 /* assubr.c */
643 extern  VOID            aerr();
644 extern  VOID            diag();
645 extern  VOID            err();
646 extern  VOID            warnBanner(void);
647 extern  char *          geterr();
648 extern  VOID            qerr();
649 extern  VOID            rerr();
650
651 /* asexpr.c */
652 extern  VOID            abscheck();
653 extern  Addr_T          absexpr();
654 extern  VOID            clrexpr();
655 extern  int             digit();
656 extern  int             is_abs();
657 extern  VOID            expr();
658 extern  int             oprio();
659 extern  VOID            term();
660
661 /* aslist.c */
662 extern  VOID            list();
663 extern  VOID            list1();
664 extern  VOID            list2();
665 extern  VOID            lstsym();
666 extern  VOID            slew();
667
668 /* asout.c */
669 extern  int             hibyte();
670 extern  int             lobyte();
671 extern  int             byte3(int);
672 extern  VOID            out();
673 extern  VOID            outab();
674 extern  VOID            outarea();
675 extern  VOID            outaw();
676 extern  VOID            outall();
677 extern  VOID            outdot();
678 extern  VOID            outbuf();
679 extern  VOID            outchk();
680 extern  VOID            outgsd();
681 extern  VOID            outrb();
682 extern  VOID            outrw(struct expr *, int);
683 extern  VOID            outr24(struct expr *, int);
684 extern  VOID            outsym();
685 extern  VOID            out_lb();
686 extern  VOID            out_lw();
687 extern  VOID            out_l24(int, int);
688 extern  VOID            out_rw();
689 extern  VOID            out_tw();
690 extern  VOID            out_t24(int);
691 extern  VOID            outr11();       /* JLH */
692 extern  VOID            outr19(struct expr *, int, int);
693
694 /* asnoice.c */
695 extern void DefineNoICE_Line();
696 extern void DefineCDB_Line();
697
698 /* Machine dependent variables */
699
700 extern  char *          cpu;
701 extern  char *          dsft;
702 extern  int             hilo;
703 extern  struct  mne     mne[];
704
705 /* Machine dependent functions */
706
707 extern  VOID            minit();
708 extern  VOID            machine(struct mne *);
709
710 /* strcmpi.c */
711 extern  int as_strcmpi(const char *s1, const char *s2);
712 extern  int as_strncmpi(const char *s1, const char *s2, size_t n);