1: /
   2: /
   3: 
   4: /  a7 -- pdp-11 assembler pass 1
   5: 
   6: expres:
   7:         mov     r5,-(sp)
   8:         mov     $'+,-(sp)
   9:         clr     opfound
  10:         clr     r2
  11:         mov     $1,r3
  12:         br      1f
  13: advanc:
  14:         jsr     pc,readop
  15: 1:
  16:         mov     r4,r0
  17:         jsr     r5,betwen; 0; 177
  18:                 br .+4
  19:         br      7f
  20:         movb    (r4),r0
  21:         mov     2(r4),r1
  22:         br      oprand
  23: 7:
  24:         cmp     r4,$141
  25:         blo     1f
  26:         cmp     r4,$141+10.
  27:         bhis    2f
  28:         movb    curfbr-141(r4),r0
  29:         asl     r4
  30:         mov     curfb-[2*141](r4),r2
  31:         bpl     oprand
  32:         jsr     r5,error; 'f
  33:         br      oprand
  34: 2:
  35:         clr     r3
  36:         clr     r2
  37:         br      oprand
  38: 1:
  39:         mov     $esw1,r1
  40: 1:
  41:         cmp     (r1)+,r4
  42:         beq     1f
  43:         tst     (r1)+
  44:         bne     1b
  45:         tst     opfound
  46:         bne     2f
  47:         jsr     pc,errore
  48: 2:
  49:         tst     (sp)+
  50:         mov     (sp)+,r5
  51:         rts     pc
  52: 1:
  53:         jmp     *(r1)
  54: 
  55: esw1:
  56:         '+;     binop
  57:         '-;     binop
  58:         '*;     binop
  59:         '/;     binop
  60:         '&;     binop
  61:         037;    binop
  62:         035;    binop
  63:         036;    binop
  64:         '%;     binop
  65:         '[;     brack
  66:         '^;     binop
  67:         1;      exnum
  68:         '!;     binop
  69:         0;      0
  70: 
  71: binop:
  72:         cmpb    (sp),$'+
  73:         beq     1f
  74:         jsr     pc,errore
  75: 1:
  76:         movb    r4,(sp)
  77:         br      advanc
  78: 
  79: exnum:
  80:         mov     numval,r1
  81:         mov     $1,r0
  82:         br      oprand
  83: 
  84: brack:
  85:         mov     r2,-(sp)
  86:         mov     r3,-(sp)
  87:         jsr     pc,readop
  88:         jsr     pc,expres
  89:         cmp     r4,$']
  90:         beq     1f
  91:         jsr     r5,error; ']
  92: 1:
  93:         mov     r3,r0
  94:         mov     r2,r1
  95:         mov     (sp)+,r3
  96:         mov     (sp)+,r2
  97: 
  98: oprand:
  99:         inc     opfound
 100:         mov     $exsw2,r5
 101: 1:
 102:         cmp     (sp),(r5)+
 103:         beq     1f
 104:         tst     (r5)+
 105:         bne     1b
 106:         br      eoprnd
 107: 1:
 108:         jmp     *(r5)
 109: 
 110: exsw2:
 111:         '+; exadd
 112:         '-; exsub
 113:         '*; exmul
 114:         '/; exdiv
 115:         037; exor
 116:         '&; exand
 117:         035;exlsh
 118:         036;exrsh
 119:         '%; exmod
 120:         '!; exnot
 121:         '^; excmbin
 122:         0;  0
 123: 
 124: excmbin:
 125:         mov     r0,r3                   / give left flag of right
 126:         br      eoprnd
 127: 
 128: exrsh:
 129:         neg     r1
 130:         beq     exlsh
 131:         inc     r1
 132:         clc
 133:         ror     r2
 134: exlsh:
 135:         jsr     r5,combin; 0
 136:         als     r1,r2
 137:         br      eoprnd
 138: 
 139: exmod:
 140:         jsr     r5,combin; 0
 141:         mov     r1,-(sp)
 142:         mov     r2,r1
 143:         clr     r0
 144:         dvd     (sp)+,r0
 145:         mov     r1,r2
 146:         br      eoprnd
 147: 
 148: exadd:
 149:         jsr     r5,combin; 0
 150:         add     r1,r2
 151:         br      eoprnd
 152: 
 153: exsub:
 154:         jsr     r5,combin; 1
 155:         sub     r1,r2
 156:         br      eoprnd
 157: 
 158: exand:
 159:         jsr     r5,combin; 0
 160:         com     r1
 161:         bic     r1,r2
 162:         br      eoprnd
 163: 
 164: exor:
 165:         jsr     r5,combin; 0
 166:         bis     r1,r2
 167:         br      eoprnd
 168: 
 169: exmul:
 170:         jsr     r5,combin; 0
 171:         mpy     r2,r1
 172:         mov     r1,r2
 173:         br      eoprnd
 174: 
 175: exdiv:
 176:         jsr     r5,combin; 0
 177:         mov     r1,-(sp)
 178:         mov     r2,r1
 179:         clr     r0
 180:         dvd     (sp)+,r0
 181:         mov     r0,r2
 182:         br      eoprnd
 183: 
 184: exnot:
 185:         jsr     r5,combin; 0
 186:         com     r1
 187:         add     r1,r2
 188:         br      eoprnd
 189: 
 190: eoprnd:
 191:         mov     $'+,(sp)
 192:         jmp     advanc
 193: 
 194: combin:
 195:         mov     r0,-(sp)
 196:         bis     r3,(sp)
 197:         bic     $!40,(sp)
 198:         bic     $!37,r0
 199:         bic     $!37,r3
 200:         cmp     r0,r3
 201:         ble     1f
 202:         mov     r0,-(sp)
 203:         mov     r3,r0
 204:         mov     (sp)+,r3
 205: 1:
 206:         tst     r0
 207:         beq     1f
 208:         tst     (r5)+
 209:         beq     2f
 210:         cmp     r0,r3
 211:         bne     2f
 212:         mov     $1,r3
 213:         br      2f
 214: 1:
 215:         tst     (r5)+
 216:         clr     r3
 217: 2:
 218:         bis     (sp)+,r3
 219:         rts     r5

Defined functions

advanc defined in line 13; used 2 times
binop defined in line 71; used 11 times
brack defined in line 84; used 1 times
  • in line 65
combin defined in line 194; used 9 times
eoprnd defined in line 190; used 11 times
esw1 defined in line 55; used 1 times
  • in line 39
exadd defined in line 148; used 1 times
exand defined in line 158; used 1 times
excmbin defined in line 124; used 1 times
exdiv defined in line 175; used 1 times
exlsh defined in line 134; used 2 times
exmod defined in line 139; used 1 times
exmul defined in line 169; used 1 times
exnot defined in line 184; used 1 times
exnum defined in line 79; used 1 times
  • in line 67
exor defined in line 164; used 1 times
expres defined in line 6; used 1 times
  • in line 88
exrsh defined in line 128; used 1 times
exsub defined in line 153; used 1 times
exsw2 defined in line 110; used 1 times
oprand defined in line 98; used 5 times
Last modified: 1975-07-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 449
Valid CSS Valid XHTML 1.0 Strict