File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / usr / src / lib / c2 / c2.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:24:19 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v12b, v121, HEAD
Power 6/32 Unix version 1.2b

/*
 * Header for object code improver
 */

/* tokens */
#define JBR	1
#define CBR	2
#define JMP	3
#define LABEL	4
#define DLABEL	5
#define EROU	6
#define JSW	7
#define MOV	8
#define CLR	9
#define INC	10
#define DEC	11
#define TST	12
#define PUSH	13
#define CVT	14
#define CMP	15
#define ADD	16
#define SUB	17
#define BIT	18
#define AND	19
#define OR	20
#define XOR	21
#define COM	22
#define NEG	23
#define MUL	24
#define DIV	25
#define EDIV	26
#define SHAL	27
#define SHAR	28
#define SHL	29
#define SHR	30
#define CALLF	31
#define CALLS	32
#define RET	33
#define CASE	34
#define TEXT	35
#define DATA	36
#define BSS	37
#define ALIGN	38
#define END	39
#define MOVZ	40
#define WGEN	41
#define ADDA	42
#define SUBA	43
#define AOBLEQ	44
#define AOBLSS	45
#define MOVA	46
#define PUSHA	47
#define LGEN	48
#define SET	49
#define MOVBLK	50
#define MFPR	51
#define MTPR	52
#define PROBE	53
#define MOVO	54
#define LCOMM	55
#define COMM	56

#define	JEQ	0
#define	JNE	1
#define	JLE	2
#define	JGE	3
#define	JLT	4
#define	JGT	5
/* rearranged for unsigned branches so that jxxu = jxx + 6 */
#define	JLOS	8
#define	JHIS	9
#define	JLO	10
#define	JHI	11

#define JBC 12
#define JBS 13

#define	BYTE	1
#define	WORD	2
#define LONG	3
#define QUAD	4
#define OP2	7
#define OP3	8
#define OPB	9
#define OPX	10

/* #define T(a,b) (a|((b)<<8)) NUXI problems */
#define U(a,b) (a|((b)<<4))

#define C2_ASIZE 128

struct optab {
	char	opstring[7];
	char	opcod;
	unsigned char	subopcod;
} optab[];

struct node {
	char	op;
	unsigned char	subop;
	short	refc;
	struct	node	*forw;
	struct	node	*back;
	struct	node	*ref;
	char	*code;
	struct	optab	*pop;
	long	labno;
	short	seq;
};

/* struct { NUXI problems
	short	combop;
}; */

char	line[512];
struct	node	first;
char	*curlp;
int	nbrbr;
int	nsaddr;
int	redunm;
int	iaftbr;
int	njp1;
int	nrlab;
int	nxjump;
int	ncmot;
int	nrevbr;
int	loopiv;
int	nredunj;
int	nskip;
int	ncomj;
int	naob;
int	nrtst;
int	nbj;

int	nchange;
int	isn;
int	debug;
char	*lasta;
char	*lastr;
char	*firstr;
char	revbr[];
#define	NREG	13
char	*regs[NREG+5]; /* 0-12, 4 for operands, 1 for running off end */
char	conloc[C2_ASIZE];
char	conval[C2_ASIZE];
char	ccloc[C2_ASIZE];

#define	RT1	NREG
#define	RT2	NREG+1
#define RT3	NREG+2
#define RT4	NREG+3
#define	LABHS	127

char *copy();
long getnum();
struct node *codemove();
struct node *insertl();
struct node *nonlab();
struct node *alloc();
#define COPYCODE

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.