1: /*
   2:  * Copyright (c) 1982 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)instrs.h	5.1 (Berkeley) 4/30/85
   7:  */
   8: 
   9: /*
  10:  *	Argument data types
  11:  *
  12:  *	If you change these definitions, you must also change the tables
  13:  *	in assizetab.c
  14:  */
  15: #define TYPB        000 /* byte integer */
  16: #define TYPW        001 /* word integer */
  17: #define TYPL        002 /* long integer */
  18: #define TYPQ        003 /* quad integer */
  19: #define TYPO        004 /* octa integer */
  20: #define TYPF        005 /* F float */
  21: #define TYPD        006 /* D float */
  22: #define TYPG        007 /* G float */
  23: #define TYPH        010 /* H float */
  24: #define TYPUNPACKED 011 /* when unpacked into mantissa & exponent */
  25: #define TYPNONE     012 /* when nothing */
  26: #define TYPLG       4   /* number of bits the above take up */
  27: 
  28: #define TYPMASK ((1<<TYPLG)-1)  /* the mask (assumes 2's comp arith) */
  29: /*
  30:  *	Constructors and extractors for argument access kinds and types
  31:  */
  32: #define A_CONS(access, type)    ((access) | (type))
  33: #define A_ACCEXT(consed)    ((consed) & (TYPMASK << TYPLG))
  34: #define A_TYPEXT(consed)    ((consed) & TYPMASK)
  35: 
  36: /*
  37:  * Argument access types used to test validity of operands to operators
  38:  */
  39: #define ACCR    (1<<TYPLG)          /* read */
  40: #define ACCW    (2<<TYPLG)          /* write */
  41: #define ACCB    (4<<TYPLG)          /* branch displacement */
  42: #define ACCA    (8<<TYPLG)          /* address only */
  43: #define ACCV    (8<<TYPLG)          /* address only */
  44: #define ACCM    (ACCR | ACCW)           /* modify */
  45: #define ACCI    (ACCB | ACCR)           /* XFC code */
  46: 
  47: #define ACCESSMASK  (ACCA | ACCR | ACCW | ACCB) /* the mask */
  48: 
  49: /*
  50:  *	Construction of TYPX and ACCX, to make the instrs table
  51:  *	easy to use and read.
  52:  */
  53: /*
  54:  *	For real memory address
  55:  */
  56: #define A_AB    A_CONS(ACCA, TYPB)
  57: #define A_AW    A_CONS(ACCA, TYPW)
  58: #define A_AL    A_CONS(ACCA, TYPL)
  59: #define A_AQ    A_CONS(ACCA, TYPQ)
  60: #define A_AO    A_CONS(ACCA, TYPO)
  61: #define A_AF    A_CONS(ACCA, TYPF)
  62: #define A_AD    A_CONS(ACCA, TYPD)
  63: #define A_AG    A_CONS(ACCA, TYPG)
  64: #define A_AH    A_CONS(ACCA, TYPH)
  65: /*
  66:  *	For real memory addresses, or register addresses [sic]
  67:  *
  68:  *	CHEAT! we just call these read access, since
  69:  *	registers are allowed. All field instruction, except insv,
  70:  *	are are read access fields.
  71:  */
  72: #define A_VB    A_CONS(ACCR, TYPB)
  73: #define A_VW    A_CONS(ACCR, TYPW)
  74: #define A_VL    A_CONS(ACCR, TYPL)
  75: #define A_VQ    A_CONS(ACCR, TYPQ)
  76: #define A_VO    A_CONS(ACCR, TYPO)
  77: #define A_VF    A_CONS(ACCR, TYPF)
  78: #define A_VD    A_CONS(ACCR, TYPD)
  79: #define A_VG    A_CONS(ACCR, TYPG)
  80: #define A_VH    A_CONS(ACCR, TYPH)
  81: /*
  82:  *	For branch displacement
  83:  */
  84: #define A_BB    A_CONS(ACCB, TYPB)
  85: #define A_BW    A_CONS(ACCB, TYPW)
  86: /*
  87:  *	For modification
  88:  */
  89: #define A_MB    A_CONS(ACCM, TYPB)
  90: #define A_MW    A_CONS(ACCM, TYPW)
  91: #define A_ML    A_CONS(ACCM, TYPL)
  92: #define A_MF    A_CONS(ACCM, TYPF)
  93: #define A_MD    A_CONS(ACCM, TYPD)
  94: #define A_MG    A_CONS(ACCM, TYPG)
  95: #define A_MH    A_CONS(ACCM, TYPH)
  96: /*
  97:  *	For reading
  98:  */
  99: #define A_RB    A_CONS(ACCR, TYPB)
 100: #define A_RW    A_CONS(ACCR, TYPW)
 101: #define A_RL    A_CONS(ACCR, TYPL)
 102: #define A_RQ    A_CONS(ACCR, TYPQ)
 103: #define A_RO    A_CONS(ACCR, TYPO)
 104: #define A_RF    A_CONS(ACCR, TYPF)
 105: #define A_RD    A_CONS(ACCR, TYPD)
 106: #define A_RG    A_CONS(ACCR, TYPG)
 107: #define A_RH    A_CONS(ACCR, TYPH)
 108: /*
 109:  *	For writing
 110:  */
 111: #define A_WB    A_CONS(ACCW, TYPB)
 112: #define A_WW    A_CONS(ACCW, TYPW)
 113: #define A_WL    A_CONS(ACCW, TYPL)
 114: #define A_WQ    A_CONS(ACCW, TYPQ)
 115: #define A_WO    A_CONS(ACCW, TYPO)
 116: #define A_WF    A_CONS(ACCW, TYPF)
 117: #define A_WD    A_CONS(ACCW, TYPD)
 118: #define A_WG    A_CONS(ACCW, TYPG)
 119: #define A_WH    A_CONS(ACCW, TYPH)
 120: 
 121: #ifndef INSTTAB
 122: /*
 123:  *	Define what the entries in the table look like.
 124:  *	This is only used for adb and sdb; not for as.
 125:  */
 126: #define INSTTAB
 127: struct insttab{
 128:     char    *iname;
 129:     u_char  eopcode;
 130:     u_char  popcode;
 131:     char    nargs;
 132:     u_char  argtype[6];
 133: } insttab[];
 134: 
 135: #define OP(name,eopcode,popdcode,nargs,a1,a2,a3,a4,a5,a6) {name,eopcode,popdcode,nargs,a1,a2,a3,a4,a5,a6}
 136: 
 137: #endif INSTTAB
 138: 
 139: /*
 140:  *	Definitions for the escape bytes
 141:  */
 142: #define CORE    0
 143: #define NEW 1
 144: #define ESCD    0xfd
 145: #define ESCF    0xff

Defined variables

insttab defined in line 133; never used

Defined struct's

insttab defined in line 127; never used

Defined macros

ACCA defined in line 42; used 13 times
ACCB defined in line 41; used 5 times
ACCESSMASK defined in line 47; used 1 times
ACCI defined in line 45; used 1 times
ACCM defined in line 44; used 8 times
ACCR defined in line 39; used 22 times
ACCV defined in line 43; never used
ACCW defined in line 40; used 12 times
A_AB defined in line 56; never used
A_ACCEXT defined in line 33; never used
A_AD defined in line 62; never used
A_AF defined in line 61; never used
A_AG defined in line 63; never used
A_AH defined in line 64; never used
A_AL defined in line 58; never used
A_AO defined in line 60; never used
A_AQ defined in line 59; never used
A_AW defined in line 57; never used
A_BB defined in line 84; used 2 times
A_BW defined in line 85; used 2 times
A_CONS defined in line 32; used 45 times
A_MB defined in line 89; never used
A_MD defined in line 93; never used
A_MF defined in line 92; never used
A_MG defined in line 94; never used
A_MH defined in line 95; never used
A_ML defined in line 91; never used
A_MW defined in line 90; never used
A_RB defined in line 99; never used
A_RD defined in line 105; never used
A_RF defined in line 104; never used
A_RG defined in line 106; never used
A_RH defined in line 107; never used
A_RL defined in line 101; never used
A_RO defined in line 103; never used
A_RQ defined in line 102; never used
A_RW defined in line 100; never used
A_TYPEXT defined in line 34; never used
A_VB defined in line 72; never used
A_VD defined in line 78; never used
A_VF defined in line 77; never used
A_VG defined in line 79; never used
A_VH defined in line 80; never used
A_VL defined in line 74; never used
A_VO defined in line 76; never used
A_VQ defined in line 75; never used
A_VW defined in line 73; never used
A_WB defined in line 111; never used
A_WD defined in line 117; never used
A_WF defined in line 116; never used
A_WG defined in line 118; never used
A_WH defined in line 119; never used
A_WL defined in line 113; never used
A_WO defined in line 115; never used
A_WQ defined in line 114; never used
A_WW defined in line 112; never used
CORE defined in line 142; used 3 times
ESCD defined in line 144; never used
ESCF defined in line 145; never used
INSTTAB defined in line 126; used 1 times
NEW defined in line 143; never used
OP defined in line 135; never used
TYPB defined in line 15; used 11 times
TYPF defined in line 20; used 13 times
TYPG defined in line 22; used 13 times
TYPH defined in line 23; used 13 times
TYPLG defined in line 26; used 10 times
TYPMASK defined in line 28; used 4 times
TYPNONE defined in line 25; used 4 times
TYPQ defined in line 18; used 13 times
TYPUNPACKED defined in line 24; used 5 times
TYPW defined in line 16; used 11 times

Usage of this include

instrs.h used 1 times
Last modified: 1985-04-30
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1773
Valid CSS Valid XHTML 1.0 Strict