1 /* Copyright (c) 1984 Regents of the University of California */ 2 3 /* @(#)inline.h 1.2 (Berkeley) 08/20/84 */ 4 5 /* 6 * COMMENTCHAR is the character delimiting comments in the assembler. 7 * LABELCHAR is the character that separates labels from instructions. 8 * ARGSEPCHAR is the character that separates arguments in instructions. 9 */ 10 #define COMMENTCHAR '#' 11 #define LABELCHAR ':' 12 #define ARGSEPCHAR ',' 13 14 /* 15 * Expansion parameters: 16 * QUEUESIZE is the number of instructions to be considered for 17 * integration of argument pushes and pops 18 * MAXLINELEN is the longest expected input line 19 * MAXARGS is the maximum number of arguments in an assembly instruction 20 */ 21 #define QUEUESIZE 16 22 #define MAXLINELEN 128 23 #define MAXARGS 10 24 25 /* 26 * The following global variables are used to manipulate the queue of 27 * recently seen instructions. 28 * line - The queue of instructions. 29 * bufhead - Pointer to next availble queue slot. It is not 30 * considered part of te instruction stream until 31 * bufhead is advanced. 32 * buftail - Pointer to last instruction in queue. 33 * Note that bufhead == buftail implies that the queue is empty. 34 */ 35 int bufhead, buftail; 36 char line[QUEUESIZE][MAXLINELEN]; 37 38 #define SUCC(qindex) ((qindex) + 1 == QUEUESIZE ? 0 : (qindex) + 1) 39 #define PRED(qindex) ((qindex) - 1 < 0 ? QUEUESIZE - 1 : (qindex) - 1) 40 41 /* 42 * Hash table headers should be twice as big as the number of patterns. 43 * They must be a power of two. 44 */ 45 #define HSHSIZ 128 46 47 /* 48 * These tables specify the substitutions that are to be done. 49 */ 50 struct pats { 51 char *name; 52 char *replace; 53 struct pats *next; 54 int size; 55 }; 56 struct pats *patshdr[HSHSIZ]; 57 extern struct pats language_ptab[], libc_ptab[], machine_ptab[]; 58 59 /* 60 * This table defines the set of instructions that demark the 61 * end of a basic block. 62 */ 63 struct inststoptbl { 64 char *name; 65 struct inststoptbl *next; 66 int size; 67 }; 68 struct inststoptbl *inststoptblhdr[HSHSIZ]; 69 extern struct inststoptbl inststoptable[]; 70 71 /* 72 * Miscellaneous functions. 73 */ 74 char *newline(), *copyline(), *doreplaceon(); 75