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