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

Defined functions

advanc defined in line 13; used 2 times
binop defined in line 72; used 11 times
brack defined in line 85; used 1 times
  • in line 66
combin defined in line 195; used 9 times
eoprnd defined in line 191; used 11 times
esw1 defined in line 56; used 1 times
  • in line 40
exadd defined in line 149; used 1 times
exand defined in line 159; used 1 times
excmbin defined in line 125; used 1 times
exdiv defined in line 176; used 1 times
exlsh defined in line 135; used 2 times
exmod defined in line 140; used 1 times
exmul defined in line 170; used 1 times
exnot defined in line 185; used 1 times
exnum defined in line 80; used 1 times
  • in line 68
exor defined in line 165; used 1 times
expres defined in line 6; used 1 times
  • in line 89
exrsh defined in line 129; used 1 times
exsub defined in line 154; used 1 times
exsw2 defined in line 111; used 1 times
oprand defined in line 99; used 5 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 526
Valid CSS Valid XHTML 1.0 Strict