1 /*******************************************************
3 * a56 - a DSP56001 assembler
5 * Written by Quinn C. Jensen
8 *******************************************************\
11 * Copyright (C) 2008 Robert Millan <rmh@aybabtu.com>
13 * This file is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published
15 * by the Free Software Foundation, either version 3 of the License,
16 * or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see
25 * <http://www.gnu.org/licenses/>.
27 * This file incorporates work covered by the following copyright and
30 * Copyright (C) 1990-1994 Quinn C. Jensen
32 * Permission to use, copy, modify, distribute, and sell this software
33 * and its documentation for any purpose is hereby granted without fee,
34 * provided that the above copyright notice appear in all copies and
35 * that both that copyright notice and this permission notice appear
36 * in supporting documentation. The author makes no representations
37 * about the suitability of this software for any purpose. It is
38 * provided "as is" without express or implied warranty.
43 * a56.h - general definitions
80 #define NEW(object) ((object *)alloc(sizeof(object)))
82 #define MAX_NEST 20 /* maximum include file nesting */
89 extern struct inc inc[];
91 #define curfile inc[inc_p].file
92 #define curline inc[inc_p].line
99 unsigned int pc, bottom, top;
101 } *find_psect(), *new_psect();
103 FILE *open_read(), *open_write(), *open_append();
105 /* save string s somewhere */
106 #define strsave(s) ((s) != NULL ? \
107 (char *)strcpy((char *)malloc(strlen(s)+1),(s)) : NULL)
109 /* after a call to fgets(), remove the newline character */
110 #define rmcr(s) {if (s[strlen(s)-1] == '\n') s[strlen(s)-1] = '\0';};
112 #define ASSERT(expr, str) \
113 if(expr) fprintf(stderr, "ASSERT: %s: line %d: %s\n", __FILE__, __LINE__, str);
115 char *alloc (int size);
116 char *fixstring (char *s);