1*49430Sbostic /*- 2*49430Sbostic * Copyright (c) 1984 The Regents of the University of California. 3*49430Sbostic * All rights reserved. 424034Ssam * 5*49430Sbostic * %sccs.include.redist.c% 6*49430Sbostic * 7*49430Sbostic * @(#)inline.h 1.3 (Berkeley) 05/08/91 824034Ssam */ 924034Ssam 1024034Ssam /* 1124034Ssam * COMMENTCHAR is the character delimiting comments in the assembler. 1224034Ssam * LABELCHAR is the character that separates labels from instructions. 1324034Ssam * ARGSEPCHAR is the character that separates arguments in instructions. 1424034Ssam */ 1524034Ssam #define COMMENTCHAR '#' 1624034Ssam #define LABELCHAR ':' 1724034Ssam #define ARGSEPCHAR ',' 1824034Ssam 1924034Ssam /* 2024034Ssam * Expansion parameters: 2124034Ssam * QUEUESIZE is the number of instructions to be considered for 2224034Ssam * integration of argument pushes and pops 2324034Ssam * MAXLINELEN is the longest expected input line 2424034Ssam * MAXARGS is the maximum number of arguments in an assembly instruction 2524034Ssam */ 2624034Ssam #define QUEUESIZE 16 2724034Ssam #define MAXLINELEN 128 2824034Ssam #define MAXARGS 10 2924034Ssam 3024034Ssam /* 3124034Ssam * The following global variables are used to manipulate the queue of 3224034Ssam * recently seen instructions. 3324034Ssam * line - The queue of instructions. 3424034Ssam * bufhead - Pointer to next availble queue slot. It is not 3524034Ssam * considered part of te instruction stream until 3624034Ssam * bufhead is advanced. 3724034Ssam * buftail - Pointer to last instruction in queue. 3824034Ssam * Note that bufhead == buftail implies that the queue is empty. 3924034Ssam */ 4024034Ssam int bufhead, buftail; 4124034Ssam char line[QUEUESIZE][MAXLINELEN]; 4224034Ssam 4324034Ssam #define SUCC(qindex) ((qindex) + 1 == QUEUESIZE ? 0 : (qindex) + 1) 4424034Ssam #define PRED(qindex) ((qindex) - 1 < 0 ? QUEUESIZE - 1 : (qindex) - 1) 4524034Ssam 4624034Ssam /* 4724034Ssam * Hash table headers should be twice as big as the number of patterns. 4824034Ssam * They must be a power of two. 4924034Ssam */ 5024034Ssam #define HSHSIZ 128 5124034Ssam 5224034Ssam /* 5324034Ssam * These tables specify the substitutions that are to be done. 5424034Ssam */ 5524034Ssam struct pats { 5626405Ssam int args; 5724034Ssam char *name; 5824034Ssam char *replace; 5924034Ssam struct pats *next; 6024034Ssam int size; 6124034Ssam }; 6224034Ssam struct pats *patshdr[HSHSIZ]; 6324034Ssam extern struct pats language_ptab[], libc_ptab[], machine_ptab[]; 6424034Ssam 6524034Ssam /* 6624034Ssam * This table defines the set of instructions that demark the 6724034Ssam * end of a basic block. 6824034Ssam */ 6924034Ssam struct inststoptbl { 7024034Ssam char *name; 7124034Ssam struct inststoptbl *next; 7224034Ssam int size; 7324034Ssam }; 7424034Ssam struct inststoptbl *inststoptblhdr[HSHSIZ]; 7524034Ssam extern struct inststoptbl inststoptable[]; 7624034Ssam 7724034Ssam /* 7824034Ssam * Miscellaneous functions. 7924034Ssam */ 8024034Ssam char *newline(), *copyline(), *doreplaceon(); 81