15832Srrh /* 25832Srrh * Copyright (c) 1982 Regents of the University of California 3*12562Srrh * @(#)instrs.h 4.4 05/19/83 45832Srrh */ 55832Srrh /* 65832Srrh * Argument data types 75832Srrh * 85832Srrh * If you change these definitions, you must also change the tables 95832Srrh * in assizetab.c 105832Srrh */ 115832Srrh #define TYPB 000 /* byte integer */ 125832Srrh #define TYPW 001 /* word integer */ 135832Srrh #define TYPL 002 /* long integer */ 145832Srrh #define TYPQ 003 /* quad integer */ 155832Srrh #define TYPO 004 /* octa integer */ 165832Srrh #define TYPF 005 /* F float */ 175832Srrh #define TYPD 006 /* D float */ 185832Srrh #define TYPG 007 /* G float */ 195832Srrh #define TYPH 010 /* H float */ 205832Srrh #define TYPUNPACKED 011 /* when unpacked into mantissa & exponent */ 215832Srrh #define TYPNONE 012 /* when nothing */ 225832Srrh #define TYPLG 4 /* number of bits the above take up */ 235832Srrh 245832Srrh #define TYPMASK ((1<<TYPLG)-1) /* the mask (assumes 2's comp arith) */ 255832Srrh /* 265832Srrh * Constructors and extractors for argument access kinds and types 275832Srrh */ 285832Srrh #define A_CONS(access, type) ((access) | (type)) 295832Srrh #define A_ACCEXT(consed) ((consed) & (TYPMASK << TYPLG)) 305832Srrh #define A_TYPEXT(consed) ((consed) & TYPMASK) 315832Srrh 325832Srrh /* 335832Srrh * Argument access types used to test validity of operands to operators 345832Srrh */ 355832Srrh #define ACCR (1<<TYPLG) /* read */ 365832Srrh #define ACCW (2<<TYPLG) /* write */ 375832Srrh #define ACCB (4<<TYPLG) /* branch displacement */ 385832Srrh #define ACCA (8<<TYPLG) /* address only */ 39*12562Srrh #define ACCV (8<<TYPLG) /* address only */ 405832Srrh #define ACCM (ACCR | ACCW) /* modify */ 415832Srrh #define ACCI (ACCB | ACCR) /* XFC code */ 425832Srrh 435832Srrh #define ACCESSMASK (ACCA | ACCR | ACCW | ACCB) /* the mask */ 445832Srrh 455832Srrh /* 465832Srrh * Construction of TYPX and ACCX, to make the instrs table 475832Srrh * easy to use and read. 485832Srrh */ 495832Srrh /* 50*12562Srrh * For real memory address 515832Srrh */ 525832Srrh #define A_AB A_CONS(ACCA, TYPB) 535832Srrh #define A_AW A_CONS(ACCA, TYPW) 545832Srrh #define A_AL A_CONS(ACCA, TYPL) 555832Srrh #define A_AQ A_CONS(ACCA, TYPQ) 565832Srrh #define A_AO A_CONS(ACCA, TYPO) 575832Srrh #define A_AF A_CONS(ACCA, TYPF) 585832Srrh #define A_AD A_CONS(ACCA, TYPD) 595832Srrh #define A_AG A_CONS(ACCA, TYPG) 605832Srrh #define A_AH A_CONS(ACCA, TYPH) 615832Srrh /* 62*12562Srrh * For real memory addresses, or register addresses [sic] 63*12562Srrh */ 64*12562Srrh #define A_VB A_CONS(ACCV, TYPB) 65*12562Srrh #define A_VW A_CONS(ACCV, TYPW) 66*12562Srrh #define A_VL A_CONS(ACCV, TYPL) 67*12562Srrh #define A_VQ A_CONS(ACCV, TYPQ) 68*12562Srrh #define A_VO A_CONS(ACCV, TYPO) 69*12562Srrh #define A_VF A_CONS(ACCV, TYPF) 70*12562Srrh #define A_VD A_CONS(ACCV, TYPD) 71*12562Srrh #define A_VG A_CONS(ACCV, TYPG) 72*12562Srrh #define A_VH A_CONS(ACCV, TYPH) 73*12562Srrh /* 745832Srrh * For branch displacement 755832Srrh */ 765832Srrh #define A_BB A_CONS(ACCB, TYPB) 775832Srrh #define A_BW A_CONS(ACCB, TYPW) 785832Srrh /* 795832Srrh * For modification 805832Srrh */ 815832Srrh #define A_MB A_CONS(ACCM, TYPB) 825832Srrh #define A_MW A_CONS(ACCM, TYPW) 835832Srrh #define A_ML A_CONS(ACCM, TYPL) 845832Srrh #define A_MF A_CONS(ACCM, TYPF) 855832Srrh #define A_MD A_CONS(ACCM, TYPD) 865832Srrh #define A_MG A_CONS(ACCM, TYPG) 875832Srrh #define A_MH A_CONS(ACCM, TYPH) 885832Srrh /* 895832Srrh * For reading 905832Srrh */ 915832Srrh #define A_RB A_CONS(ACCR, TYPB) 925832Srrh #define A_RW A_CONS(ACCR, TYPW) 935832Srrh #define A_RL A_CONS(ACCR, TYPL) 945832Srrh #define A_RQ A_CONS(ACCR, TYPQ) 955832Srrh #define A_RO A_CONS(ACCR, TYPO) 965832Srrh #define A_RF A_CONS(ACCR, TYPF) 975832Srrh #define A_RD A_CONS(ACCR, TYPD) 985832Srrh #define A_RG A_CONS(ACCR, TYPG) 995832Srrh #define A_RH A_CONS(ACCR, TYPH) 1005832Srrh /* 1015832Srrh * For writing 1025832Srrh */ 1035832Srrh #define A_WB A_CONS(ACCW, TYPB) 1045832Srrh #define A_WW A_CONS(ACCW, TYPW) 1055832Srrh #define A_WL A_CONS(ACCW, TYPL) 1065832Srrh #define A_WQ A_CONS(ACCW, TYPQ) 1075832Srrh #define A_WO A_CONS(ACCW, TYPO) 1085832Srrh #define A_WF A_CONS(ACCW, TYPF) 1095832Srrh #define A_WD A_CONS(ACCW, TYPD) 1105832Srrh #define A_WG A_CONS(ACCW, TYPG) 1115832Srrh #define A_WH A_CONS(ACCW, TYPH) 1125832Srrh 1135832Srrh #ifndef INSTTAB 1145832Srrh /* 1155832Srrh * Define what the entries in the table look like. 1165832Srrh * This is only used for adb and sdb; not for as. 1175832Srrh */ 1185832Srrh #define INSTTAB 1195832Srrh struct insttab{ 1205832Srrh char *iname; 1215832Srrh u_char eopcode; 1225832Srrh u_char popcode; 1235832Srrh char nargs; 1245832Srrh u_char argtype[6]; 1255832Srrh } insttab[]; 1265832Srrh 1275832Srrh #define OP(name,eopcode,popdcode,nargs,a1,a2,a3,a4,a5,a6) {name,eopcode,popdcode,nargs,a1,a2,a3,a4,a5,a6} 1285832Srrh 1295832Srrh #endif INSTTAB 1305832Srrh 1315832Srrh /* 1325832Srrh * Definitions for the escape bytes 1335832Srrh */ 1345832Srrh #define CORE 0 1355832Srrh #define NEW 1 1365832Srrh #define ESCD 0xfd 1375832Srrh #define ESCF 0xff 138