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