1 /*******************************************************
3 * a56 - a DSP56001 assembler
5 * Written by Quinn C. Jensen
8 *******************************************************\
11 * Copyright (C) 1990-1994 Quinn C. Jensen
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.
24 * a56.h - general definitions
61 #define NEW(object) ((object *)alloc(sizeof(object)))
63 #define MAX_NEST 20 /* maximum include file nesting */
70 extern struct inc inc[];
72 #define curfile inc[inc_p].file
73 #define curline inc[inc_p].line
80 unsigned int pc, bottom, top;
82 } *find_psect(), *new_psect();
84 FILE *open_read(), *open_write(), *open_append();
86 /* save string s somewhere */
87 #define strsave(s) ((s) != NULL ? \
88 (char *)strcpy((char *)malloc(strlen(s)+1),(s)) : NULL)
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';};
93 #define ASSERT(expr, str) \
94 if(expr) fprintf(stderr, "ASSERT: %s: line %d: %s\n", __FILE__, __LINE__, str);