Setting up repository
[linux-libre-firmware.git] / a56 / a56.h
1 /*******************************************************
2  *
3  *  a56 - a DSP56001 assembler
4  *
5  *  Written by Quinn C. Jensen
6  *  July 1990
7  *
8  *******************************************************\
9
10 /*
11  * Copyright (C) 1990-1994 Quinn C. Jensen
12  *
13  * Permission to use, copy, modify, distribute, and sell this software
14  * and its documentation for any purpose is hereby granted without fee,
15  * provided that the above copyright notice appear in all copies and
16  * that both that copyright notice and this permission notice appear
17  * in supporting documentation.  The author makes no representations
18  * about the suitability of this software for any purpose.  It is
19  * provided "as is" without express or implied warranty.
20  *
21  */
22
23 /*
24  *  a56.h - general definitions
25  *
26  */
27
28 #include <stdio.h>
29
30 #ifndef TRUE
31 #define TRUE 1
32 #define FALSE 0
33 #define NOT !
34 typedef int BOOL;
35 #endif
36
37 struct sym {
38         char *name;
39         struct n {
40                 short type;
41 #define UNDEF -1
42 #define INT 0
43 #define FLT 1
44                 short seg;
45 #define NONE 0
46 #define PROG 1
47 #define XDATA 2
48 #define YDATA 3
49 #define LDATA 4
50 #define ANY 5
51                 union val {
52                         int i;
53                         double f;
54                 } val;
55         } n;
56         struct sym *next;
57 } *find_sym();
58
59 extern int pass;
60
61 #define NEW(object) ((object *)alloc(sizeof(object)))
62
63 #define MAX_NEST 20             /* maximum include file nesting */
64
65 struct inc {
66         char *file;
67         FILE *fp;
68         int line;
69 };
70 extern struct inc inc[];
71 extern int inc_p;
72 #define curfile inc[inc_p].file
73 #define curline inc[inc_p].line
74
75 extern int ldebug;
76
77 struct psect {
78         char *name;
79         int seg;
80         unsigned int pc, bottom, top;
81         struct psect *next;
82 } *find_psect(), *new_psect();
83
84 FILE *open_read(), *open_write(), *open_append();
85
86         /* save string s somewhere */
87 #define strsave(s) ((s) != NULL ? \
88                 (char *)strcpy((char *)malloc(strlen(s)+1),(s)) : NULL)
89
90         /* after a call to fgets(), remove the newline character */
91 #define rmcr(s) {if (s[strlen(s)-1] == '\n') s[strlen(s)-1] = '\0';};
92
93 #define ASSERT(expr, str) \
94                 if(expr) fprintf(stderr, "ASSERT: %s: line %d: %s\n", __FILE__, __LINE__, str);