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