123341Smckusick /* 223341Smckusick * Copyright (c) 1984 Regents of the University of California. 323341Smckusick * All rights reserved. The Berkeley software License Agreement 423341Smckusick * specifies the terms and conditions for redistribution. 523341Smckusick * 6*27462Skarels * @(#)inline.h 1.6 (Berkeley) 04/27/86 723341Smckusick */ 816958Smckusick 916958Smckusick /* 1016958Smckusick * COMMENTCHAR is the character delimiting comments in the assembler. 1116958Smckusick * LABELCHAR is the character that separates labels from instructions. 1216977Smckusick * ARGSEPCHAR is the character that separates arguments in instructions. 1316958Smckusick */ 1416958Smckusick #define COMMENTCHAR '#' 1516958Smckusick #define LABELCHAR ':' 1616977Smckusick #define ARGSEPCHAR ',' 1716958Smckusick 1816958Smckusick /* 1916958Smckusick * Expansion parameters: 2016958Smckusick * QUEUESIZE is the number of instructions to be considered for 2116958Smckusick * integration of argument pushes and pops 2216958Smckusick * MAXLINELEN is the longest expected input line 2316958Smckusick * MAXARGS is the maximum number of arguments in an assembly instruction 2416958Smckusick */ 2516958Smckusick #define QUEUESIZE 16 2626905Smckusick #define MAXLINELEN 1024 2716958Smckusick #define MAXARGS 10 2816958Smckusick 2916958Smckusick /* 3016958Smckusick * The following global variables are used to manipulate the queue of 3116958Smckusick * recently seen instructions. 3216958Smckusick * line - The queue of instructions. 3316958Smckusick * bufhead - Pointer to next availble queue slot. It is not 3416958Smckusick * considered part of te instruction stream until 3516958Smckusick * bufhead is advanced. 3616958Smckusick * buftail - Pointer to last instruction in queue. 3716958Smckusick * Note that bufhead == buftail implies that the queue is empty. 3816958Smckusick */ 3916958Smckusick int bufhead, buftail; 4016958Smckusick char line[QUEUESIZE][MAXLINELEN]; 4116958Smckusick 4216958Smckusick #define SUCC(qindex) ((qindex) + 1 == QUEUESIZE ? 0 : (qindex) + 1) 4316958Smckusick #define PRED(qindex) ((qindex) - 1 < 0 ? QUEUESIZE - 1 : (qindex) - 1) 4416958Smckusick 4516958Smckusick /* 4616977Smckusick * Hash table headers should be twice as big as the number of patterns. 4716977Smckusick * They must be a power of two. 4816958Smckusick */ 4916958Smckusick #define HSHSIZ 128 5016958Smckusick 5116977Smckusick /* 5216977Smckusick * These tables specify the substitutions that are to be done. 5316977Smckusick */ 5416958Smckusick struct pats { 5524382Smckusick int args; 5616958Smckusick char *name; 5716958Smckusick char *replace; 5816958Smckusick struct pats *next; 5916958Smckusick int size; 6016958Smckusick }; 6116977Smckusick struct pats *patshdr[HSHSIZ]; 6216958Smckusick extern struct pats language_ptab[], libc_ptab[], machine_ptab[]; 63*27462Skarels extern struct pats vax_libc_ptab[], vaxsubset_libc_ptab[]; 64*27462Skarels extern struct pats vax_ptab[], vaxsubset_ptab[]; 6516977Smckusick 6616977Smckusick /* 6716977Smckusick * This table defines the set of instructions that demark the 6816977Smckusick * end of a basic block. 6916977Smckusick */ 7016977Smckusick struct inststoptbl { 7116977Smckusick char *name; 7216977Smckusick struct inststoptbl *next; 7316977Smckusick int size; 7416977Smckusick }; 7516977Smckusick struct inststoptbl *inststoptblhdr[HSHSIZ]; 7616977Smckusick extern struct inststoptbl inststoptable[]; 7716977Smckusick 7816977Smckusick /* 7916977Smckusick * Miscellaneous functions. 8016977Smckusick */ 8116958Smckusick char *newline(), *copyline(), *doreplaceon(); 82