 /* $Header:aspseudo.c 12.0$ */
 /* $ACIS:aspseudo.c 12.0$ */
 /* $Source: /ibm/acis/usr/src/bin/as_ca/RCS/aspseudo.c,v $ */
#ifndef lint
static char rcsid[] = "$Header:aspseudo.c 12.0$";
#endif
/* $Source: /ibm/acis/usr/src/bin/as_ca/RCS/aspseudo.c,v $ */
/*
 *	Copyright (c) 1982 Regents of the University of California
 */
#ifndef lint
static char sccsid[] = "@(#)aspseudo.c 4.5 6/30/83";
#endif not lint

#include <stdio.h>
#include "as.h"

#define	OP(name, eopcode, popcode, nargs, arg1, arg2, arg3, arg4, arg5, arg6) \
	{ \
		name, popcode, nargs, arg1, arg2, arg3, arg4, arg5, arg6, \
		(nargs == 0 ? INST0:INSTn), eopcode \
	}
#define	PSEUDO(name, type, tag) \
	{ \
		name, type, 0,   0, 0, 0, 0, 0, 0, \
		tag, CORE \
	}

readonly struct Instab instab[] = {
#include "instrs.as"
PSEUDO("\0\0\0\0\0\0\0\0\0\0", 0, 0)
};

readonly struct Opcode imops[] = {
	{ ESCD,	CAL16_OP},
	{ ESCD,	STC_OP	},
	{ ESCD,	STH_OP	},
	{ ESCD,	ST_OP	},
	{ ESCD,	CAL_OP	},
	{ ESCD,	CAL_OP	},
	{ 0,	0	},
	{ ESCD,	CAL_OP	},
	{ ESDI, AI_OP	},	/* add */
	{ ESDI, AI_OP	},	/* sub */
	{ ESDI, CI_OP	},	/* cmp */
	{ ESDI, CLI_OP	}	/* cmpl */
};

readonly struct Opcode normops[] = {
	{ ESCD,	LH_OP	},
	{ ESCD,	STC_OP	},
	{ ESCD,	STH_OP	},
	{ ESCD,	ST_OP	},
	{ ESCD,	LC_OP	},
	{ ESCD,	LHA_OP	},
	{ 0,	0,	},
	{ ESCD,	L_OP	},
	{ CORE, A_OP	},
	{ CORE, S_OP	},
	{ CORE, C_OP	},
	{ CORE, CL_OP	}
};

readonly struct Opcode shortops[] = {
	{ ESRD, LHS_OP	},
	{ ESDS, STCS_OP	},
	{ ESDS, STHS_OP	},
	{ ESDS, STS_OP	},
	{ ESDS, LCS_OP	},
	{ ESDS, LHAS_OP	},
	{ 0,	0,	},
	{ ESDS, LS_OP	},
	{ CORE, AIS_OP	},
	{ CORE, SIS_OP	},
	{ CORE, CIS_OP	},
	{ 0,	0,	}
};

readonly int	shortop_maxd[] = {
	0,
	15, 30, 60,
	15, 30, 0, 60
};

readonly struct Opcode nxo_ops[] = {
	{ ESDIUS, OIL_OP	},
	{ ESDIUS, XIL_OP	},
	{ ESDIUS, NILO_OP	},
	{ ESDIUS, OIU_OP	},
	{ ESDIUS, XIU_OP	},
	{ ESDIUS, NILZ_OP	},	/* cheat */
	{ CORE, O_OP	},
	{ CORE, X_OP	},
	{ CORE, N_OP	}
};

readonly struct Opcode shiftops[] = {
	{ CORE,	SLI_OP	},
	{ CORE,	SLI_OP	},
	{ CORE,	SRI_OP	},
	{ CORE,	SARI_OP	},
	{ CORE,	SLI16_OP	},
	{ CORE,	SLI16_OP	},
	{ CORE,	SRI16_OP	},
	{ CORE,	SARI16_OP	}
};

/* Instructions to follow CAU for load/store macros */
readonly struct Opcode loadstops[] = {
	{ ESCD,	L_OP	},
	{ ESCD,	LH_OP	},
	{ ESCD,	LHA_OP	},
	{ ESCD,	LC_OP	},
	{ ESCD,	CAL_OP	},	/* for LDA */
	{ ESCD,	ST_OP	},
	{ ESCD,	STH_OP	},
	{ ESCD,	STH_OP	},
	{ ESCD,	STC_OP	},
};
