15832Srrh /* 2*19826Sdist * Copyright (c) 1982 Regents of the University of California. 3*19826Sdist * All rights reserved. The Berkeley software License Agreement 4*19826Sdist * specifies the terms and conditions for redistribution. 5*19826Sdist * 6*19826Sdist * @(#)instrs.h 5.1 (Berkeley) 04/30/85 75832Srrh */ 8*19826Sdist 95832Srrh /* 105832Srrh * Argument data types 115832Srrh * 125832Srrh * If you change these definitions, you must also change the tables 135832Srrh * in assizetab.c 145832Srrh */ 155832Srrh #define TYPB 000 /* byte integer */ 165832Srrh #define TYPW 001 /* word integer */ 175832Srrh #define TYPL 002 /* long integer */ 185832Srrh #define TYPQ 003 /* quad integer */ 195832Srrh #define TYPO 004 /* octa integer */ 205832Srrh #define TYPF 005 /* F float */ 215832Srrh #define TYPD 006 /* D float */ 225832Srrh #define TYPG 007 /* G float */ 235832Srrh #define TYPH 010 /* H float */ 245832Srrh #define TYPUNPACKED 011 /* when unpacked into mantissa & exponent */ 255832Srrh #define TYPNONE 012 /* when nothing */ 265832Srrh #define TYPLG 4 /* number of bits the above take up */ 275832Srrh 285832Srrh #define TYPMASK ((1<<TYPLG)-1) /* the mask (assumes 2's comp arith) */ 295832Srrh /* 305832Srrh * Constructors and extractors for argument access kinds and types 315832Srrh */ 325832Srrh #define A_CONS(access, type) ((access) | (type)) 335832Srrh #define A_ACCEXT(consed) ((consed) & (TYPMASK << TYPLG)) 345832Srrh #define A_TYPEXT(consed) ((consed) & TYPMASK) 355832Srrh 365832Srrh /* 375832Srrh * Argument access types used to test validity of operands to operators 385832Srrh */ 395832Srrh #define ACCR (1<<TYPLG) /* read */ 405832Srrh #define ACCW (2<<TYPLG) /* write */ 415832Srrh #define ACCB (4<<TYPLG) /* branch displacement */ 425832Srrh #define ACCA (8<<TYPLG) /* address only */ 4312562Srrh #define ACCV (8<<TYPLG) /* address only */ 445832Srrh #define ACCM (ACCR | ACCW) /* modify */ 455832Srrh #define ACCI (ACCB | ACCR) /* XFC code */ 465832Srrh 475832Srrh #define ACCESSMASK (ACCA | ACCR | ACCW | ACCB) /* the mask */ 485832Srrh 495832Srrh /* 505832Srrh * Construction of TYPX and ACCX, to make the instrs table 515832Srrh * easy to use and read. 525832Srrh */ 535832Srrh /* 5412562Srrh * For real memory address 555832Srrh */ 565832Srrh #define A_AB A_CONS(ACCA, TYPB) 575832Srrh #define A_AW A_CONS(ACCA, TYPW) 585832Srrh #define A_AL A_CONS(ACCA, TYPL) 595832Srrh #define A_AQ A_CONS(ACCA, TYPQ) 605832Srrh #define A_AO A_CONS(ACCA, TYPO) 615832Srrh #define A_AF A_CONS(ACCA, TYPF) 625832Srrh #define A_AD A_CONS(ACCA, TYPD) 635832Srrh #define A_AG A_CONS(ACCA, TYPG) 645832Srrh #define A_AH A_CONS(ACCA, TYPH) 655832Srrh /* 6612562Srrh * For real memory addresses, or register addresses [sic] 6712943Srrh * 6812943Srrh * CHEAT! we just call these read access, since 6912943Srrh * registers are allowed. All field instruction, except insv, 7012943Srrh * are are read access fields. 7112562Srrh */ 7212943Srrh #define A_VB A_CONS(ACCR, TYPB) 7312943Srrh #define A_VW A_CONS(ACCR, TYPW) 7412943Srrh #define A_VL A_CONS(ACCR, TYPL) 7512943Srrh #define A_VQ A_CONS(ACCR, TYPQ) 7612943Srrh #define A_VO A_CONS(ACCR, TYPO) 7712943Srrh #define A_VF A_CONS(ACCR, TYPF) 7812943Srrh #define A_VD A_CONS(ACCR, TYPD) 7912943Srrh #define A_VG A_CONS(ACCR, TYPG) 8012943Srrh #define A_VH A_CONS(ACCR, TYPH) 8112562Srrh /* 825832Srrh * For branch displacement 835832Srrh */ 845832Srrh #define A_BB A_CONS(ACCB, TYPB) 855832Srrh #define A_BW A_CONS(ACCB, TYPW) 865832Srrh /* 875832Srrh * For modification 885832Srrh */ 895832Srrh #define A_MB A_CONS(ACCM, TYPB) 905832Srrh #define A_MW A_CONS(ACCM, TYPW) 915832Srrh #define A_ML A_CONS(ACCM, TYPL) 925832Srrh #define A_MF A_CONS(ACCM, TYPF) 935832Srrh #define A_MD A_CONS(ACCM, TYPD) 945832Srrh #define A_MG A_CONS(ACCM, TYPG) 955832Srrh #define A_MH A_CONS(ACCM, TYPH) 965832Srrh /* 975832Srrh * For reading 985832Srrh */ 995832Srrh #define A_RB A_CONS(ACCR, TYPB) 1005832Srrh #define A_RW A_CONS(ACCR, TYPW) 1015832Srrh #define A_RL A_CONS(ACCR, TYPL) 1025832Srrh #define A_RQ A_CONS(ACCR, TYPQ) 1035832Srrh #define A_RO A_CONS(ACCR, TYPO) 1045832Srrh #define A_RF A_CONS(ACCR, TYPF) 1055832Srrh #define A_RD A_CONS(ACCR, TYPD) 1065832Srrh #define A_RG A_CONS(ACCR, TYPG) 1075832Srrh #define A_RH A_CONS(ACCR, TYPH) 1085832Srrh /* 1095832Srrh * For writing 1105832Srrh */ 1115832Srrh #define A_WB A_CONS(ACCW, TYPB) 1125832Srrh #define A_WW A_CONS(ACCW, TYPW) 1135832Srrh #define A_WL A_CONS(ACCW, TYPL) 1145832Srrh #define A_WQ A_CONS(ACCW, TYPQ) 1155832Srrh #define A_WO A_CONS(ACCW, TYPO) 1165832Srrh #define A_WF A_CONS(ACCW, TYPF) 1175832Srrh #define A_WD A_CONS(ACCW, TYPD) 1185832Srrh #define A_WG A_CONS(ACCW, TYPG) 1195832Srrh #define A_WH A_CONS(ACCW, TYPH) 1205832Srrh 1215832Srrh #ifndef INSTTAB 1225832Srrh /* 1235832Srrh * Define what the entries in the table look like. 1245832Srrh * This is only used for adb and sdb; not for as. 1255832Srrh */ 1265832Srrh #define INSTTAB 1275832Srrh struct insttab{ 1285832Srrh char *iname; 1295832Srrh u_char eopcode; 1305832Srrh u_char popcode; 1315832Srrh char nargs; 1325832Srrh u_char argtype[6]; 1335832Srrh } insttab[]; 1345832Srrh 1355832Srrh #define OP(name,eopcode,popdcode,nargs,a1,a2,a3,a4,a5,a6) {name,eopcode,popdcode,nargs,a1,a2,a3,a4,a5,a6} 1365832Srrh 1375832Srrh #endif INSTTAB 1385832Srrh 1395832Srrh /* 1405832Srrh * Definitions for the escape bytes 1415832Srrh */ 1425832Srrh #define CORE 0 1435832Srrh #define NEW 1 1445832Srrh #define ESCD 0xfd 1455832Srrh #define ESCF 0xff 146