1*16958Smckusick /* Copyright (c) 1984 Regents of the University of California */ 2*16958Smckusick 3*16958Smckusick /* @(#)inline.h 1.1 (Berkeley) 08/18/84 */ 4*16958Smckusick 5*16958Smckusick /* 6*16958Smckusick * COMMENTCHAR is the character delimiting comments in the assembler. 7*16958Smckusick * LABELCHAR is the character that separates labels from instructions. 8*16958Smckusick */ 9*16958Smckusick #define COMMENTCHAR '#' 10*16958Smckusick #define LABELCHAR ':' 11*16958Smckusick 12*16958Smckusick /* 13*16958Smckusick * Expansion parameters: 14*16958Smckusick * QUEUESIZE is the number of instructions to be considered for 15*16958Smckusick * integration of argument pushes and pops 16*16958Smckusick * MAXLINELEN is the longest expected input line 17*16958Smckusick * MAXARGS is the maximum number of arguments in an assembly instruction 18*16958Smckusick */ 19*16958Smckusick #define QUEUESIZE 16 20*16958Smckusick #define MAXLINELEN 128 21*16958Smckusick #define MAXARGS 10 22*16958Smckusick 23*16958Smckusick /* 24*16958Smckusick * The following global variables are used to manipulate the queue of 25*16958Smckusick * recently seen instructions. 26*16958Smckusick * line - The queue of instructions. 27*16958Smckusick * bufhead - Pointer to next availble queue slot. It is not 28*16958Smckusick * considered part of te instruction stream until 29*16958Smckusick * bufhead is advanced. 30*16958Smckusick * buftail - Pointer to last instruction in queue. 31*16958Smckusick * Note that bufhead == buftail implies that the queue is empty. 32*16958Smckusick */ 33*16958Smckusick int bufhead, buftail; 34*16958Smckusick char line[QUEUESIZE][MAXLINELEN]; 35*16958Smckusick 36*16958Smckusick #define SUCC(qindex) ((qindex) + 1 == QUEUESIZE ? 0 : (qindex) + 1) 37*16958Smckusick #define PRED(qindex) ((qindex) - 1 < 0 ? QUEUESIZE - 1 : (qindex) - 1) 38*16958Smckusick 39*16958Smckusick /* 40*16958Smckusick * The hash table should be twice as big as the number of patterns. 41*16958Smckusick * It must be a power of two. 42*16958Smckusick */ 43*16958Smckusick #define HSHSIZ 128 44*16958Smckusick 45*16958Smckusick struct pats { 46*16958Smckusick char *name; 47*16958Smckusick char *replace; 48*16958Smckusick struct pats *next; 49*16958Smckusick int size; 50*16958Smckusick }; 51*16958Smckusick struct pats *hashhdr[HSHSIZ]; 52*16958Smckusick extern struct pats language_ptab[], libc_ptab[], machine_ptab[]; 53*16958Smckusick struct pats **hash(); 54*16958Smckusick char *newline(), *copyline(), *doreplaceon(); 55