1: /* Copyright (c) 1982, Regents, University of California */
   2: #define ADDQ 5
   3: #define ADD 13
   4: #define IMMED 074
   5: /* These structures are here for looks, only */
   6: struct add { short op:4, reg:3, mode:3, ea:6; } x;
   7: struct addq { short op:4, data:3, size:3, ea:6; } y;
   8: nargs(arg)
   9: long arg; /* this is only here for address calculation */
  10: {
  11:     register long *a5;
  12:     register handy;
  13:     register char reg, mode, ea;
  14: #define size mode
  15: #define data reg
  16: 
  17:     a5 = (&arg) - 2; /* this points to old a6 */
  18:     a5 = (long *) *a5; /* a5 now = my parents a6 */
  19:     a5 = (long *) a5[1]; /* pick up return address into a5 */
  20: 
  21:     handy = * (short *)a5;
  22:     ea = handy & 077; handy >>= 6;
  23:     mode = handy & 07; handy >>= 3;
  24:     reg = handy & 07; handy >>= 3;
  25:     /* op = handy & 017; */
  26:     switch(handy & 017) {
  27:     case ADD:
  28:         if(reg!=7)
  29:             return(0); /* this instruction doesn't adjust the sp */
  30:         if(ea!=IMMED)
  31:             return(0); /* too hard to decode adjustment */
  32:         handy = (long) (1 + (short *) a5);
  33:         if(mode==03) {  /* addw #n,a7 */
  34:             handy = *(short *)handy;
  35:             return(handy >> 2);
  36:         }
  37:         if(mode==07) { /* addl #n,a7 */
  38:             handy = *(long *)handy;
  39:             return(handy >> 2);
  40:         }
  41:         else return(0); /* this was doing something to d7 */
  42:     case ADDQ:
  43:         if(ea!=017)
  44:             return(0); /* this doesn't adjust a7 */
  45:         if(size!=02)
  46:             return(0); /* should complain -- we are doing
  47: 				      addq[bw] something,a7 */
  48:         switch(data) {
  49:         case 0: return(2);
  50:         case 4: return(1);
  51:         }
  52:     }
  53:     return(0);
  54: }

Defined functions

nargs defined in line 8; never used

Defined variables

x defined in line 6; never used
y defined in line 7; never used

Defined struct's

add defined in line 6; never used
addq defined in line 7; never used

Defined macros

ADD defined in line 3; never used
ADDQ defined in line 2; never used
IMMED defined in line 4; used 1 times
  • in line 30
data defined in line 15; used 1 times
  • in line 48
size defined in line 14; used 1 times
  • in line 45
Last modified: 1985-08-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 881
Valid CSS Valid XHTML 1.0 Strict