1: /
   2: /
   3: 
   4: /  a7 -- pdp-11 assembler
   5: 
   6: expres:
   7:         clr     xsymbol
   8: expres1:
   9:         mov     r5,-(sp)
  10:         mov     $'+,-(sp)
  11:         clr     r2
  12:         mov     $1,r3
  13:         br      1f
  14: advanc:
  15:         jsr     pc,readop
  16: 1:
  17:         mov     r4,r0
  18:         jsr     r5,betwen; 0; 177
  19:                 br .+4
  20:         br      7f
  21:         movb    (r4),r0
  22:         tst     r0
  23:         bne     1f
  24:         tstb    passno
  25:         beq     1f
  26:         jsr     r5,error; 'u
  27: 1:
  28:         cmp     r0,$40
  29:         bne     1f
  30:         mov     r4,xsymbol
  31:         clr     r1
  32:         br      oprand
  33: 1:
  34:         mov     2(r4),r1
  35:         br      oprand
  36: 7:
  37:         cmp     r4,$141
  38:         blo     1f
  39:         asl     r4
  40:         mov     curfb-[2*141](r4),r0
  41:         mov     2(r0),r1
  42:         movb    (r0),r0
  43:         br      oprand
  44: 1:
  45:         mov     $esw1,r1
  46: 1:
  47:         cmp     (r1)+,r4
  48:         beq     1f
  49:         tst     (r1)+
  50:         bne     1b
  51:         tst     (sp)+
  52:         mov     (sp)+,r5
  53:         rts     pc
  54: 1:
  55:         jmp     *(r1)
  56: 
  57: esw1:
  58:         '+;     binop
  59:         '-;     binop
  60:         '*;     binop
  61:         '/;     binop
  62:         '&;     binop
  63:         037;    binop
  64:         035;    binop
  65:         036;    binop
  66:         '%;     binop
  67:         '[;     brack
  68:         '^;     binop
  69:         1;      exnum
  70:         2;      exnum1
  71:         '!;     binop
  72:         200;    0
  73: 
  74: binop:
  75:         cmpb    (sp),$'+
  76:         beq     1f
  77:         jsr     pc,errore
  78: 1:
  79:         movb    r4,(sp)
  80:         br      advanc
  81: 
  82: exnum1:
  83:         mov     numval,r1
  84:         br      1f
  85: 
  86: exnum:
  87:         jsr     pc,getw
  88:         mov     r4,r1
  89: 1:
  90:         mov     $1,r0
  91:         br      oprand
  92: 
  93: brack:
  94:         mov     r2,-(sp)
  95:         mov     r3,-(sp)
  96:         jsr     pc,readop
  97:         jsr     pc,expres1
  98:         cmp     r4,$']
  99:         beq     1f
 100:         jsr     r5,error; ']
 101: 1:
 102:         mov     r3,r0
 103:         mov     r2,r1
 104:         mov     (sp)+,r3
 105:         mov     (sp)+,r2
 106: 
 107: oprand:
 108:         mov     $exsw2,r5
 109: 1:
 110:         cmp     (sp),(r5)+
 111:         beq     1f
 112:         tst     (r5)+
 113:         bne     1b
 114:         br      eoprnd
 115: 1:
 116:         jmp     *(r5)
 117: 
 118: exsw2:
 119:         '+; exadd
 120:         '-; exsub
 121:         '*; exmul
 122:         '/; exdiv
 123:         037; exor
 124:         '&; exand
 125:         035;exlsh
 126:         036;exrsh
 127:         '%; exmod
 128:         '^; excmbin
 129:         '!; exnot
 130:         200;  0
 131: 
 132: excmbin:
 133:         mov     r0,r3
 134:         br      eoprnd
 135: 
 136: exrsh:
 137:         neg     r1
 138:         beq     exlsh
 139:         inc     r1
 140:         clc
 141:         ror     r2
 142: exlsh:
 143:         jsr     r5,combin; relte2
 144:         als     r1,r2
 145:         br      eoprnd
 146: 
 147: exmod:
 148:         jsr     r5,combin; relte2
 149:         mov     r3,r0
 150:         mov     r2,r3
 151:         clr     r2
 152:         dvd     r1,r2
 153:         mov     r3,r2
 154:         mov     r0,r3
 155:         br      eoprnd
 156: 
 157: exadd:
 158:         jsr     r5,combin; reltp2
 159:         add     r1,r2
 160:         br      eoprnd
 161: 
 162: exsub:
 163:         jsr     r5,combin; reltm2
 164:         sub     r1,r2
 165:         br      eoprnd
 166: 
 167: exand:
 168:         jsr     r5,combin; relte2
 169:         com     r1
 170:         bic     r1,r2
 171:         br      eoprnd
 172: 
 173: exor:
 174:         jsr     r5,combin; relte2
 175:         bis     r1,r2
 176:         br      eoprnd
 177: 
 178: exmul:
 179:         jsr     r5,combin; relte2
 180:         mpy     r2,r1
 181:         mov     r1,r2
 182:         br      eoprnd
 183: 
 184: exdiv:
 185:         jsr     r5,combin; relte2
 186:         mov     r3,r0
 187:         mov     r2,r3
 188:         clr     r2
 189:         dvd     r1,r2
 190:         mov     r0,r3
 191:         br      eoprnd
 192: 
 193: exnot:
 194:         jsr     r5,combin; relte2
 195:         com     r1
 196:         add     r1,r2
 197:         br      eoprnd
 198: 
 199: eoprnd:
 200:         mov     $'+,(sp)
 201:         jmp     advanc
 202: 
 203: combin:
 204:         tstb    passno
 205:         bne     combin1
 206:         mov     r0,-(sp)
 207:         bis     r3,(sp)
 208:         bic     $!40,(sp)
 209:         bic     $!37,r0
 210:         bic     $!37,r3
 211:         cmp     r0,r3
 212:         ble     1f
 213:         mov     r0,-(sp)
 214:         mov     r3,r0
 215:         mov     (sp)+,r3
 216: 1:
 217:         tst     r0
 218:         beq     1f
 219:         cmp     (r5)+,$reltm2
 220:         bne     2f
 221:         cmp     r0,r3
 222:         bne     2f
 223:         mov     $1,r3
 224:         br      2f
 225: 1:
 226:         tst     (r5)+
 227:         clr     r3
 228: 2:
 229:         bis     (sp)+,r3
 230:         rts     r5
 231: combin1:
 232:         mov     r1,-(sp)
 233:         clr     maxtyp
 234:         jsr     pc,maprel
 235:         mov     r0,r1
 236:         mpy     $6,r1
 237:         mov     r3,r0
 238:         jsr     pc,maprel
 239:         add     (r5)+,r0
 240:         add     r1,r0
 241:         movb    (r0),r3
 242:         bpl     1f
 243:         cmp     r3,$-1
 244:         beq     2f
 245:         jsr     r5,error; 'r
 246: 2:
 247:         mov     maxtyp,r3
 248: 1:
 249:         mov     (sp)+,r1
 250:         rts     r5
 251: 
 252: maprel:
 253:         cmp     r0,$40
 254:         bne     1f
 255:         mov     $5,r0
 256:         rts     pc
 257: 1:
 258:         bic     $!37,r0
 259:         cmp     r0,maxtyp
 260:         blos    1f
 261:         mov     r0,maxtyp
 262: 1:
 263:         cmp     r0,$5
 264:         blos    1f
 265:         mov     $1,r0
 266: 1:
 267:         rts     pc
 268: 
 269: X = -2
 270: M = -1
 271: reltp2:
 272:         .byte 0, 0, 0, 0, 0, 0
 273:         .byte 0, M, 2, 3, 4,40
 274:         .byte 0, 2, X, X, X, X
 275:         .byte 0, 3, X, X, X, X
 276:         .byte 0, 4, X, X, X, X
 277:         .byte 0,40, X, X, X, X
 278: 
 279: reltm2:
 280:         .byte 0, 0, 0, 0, 0, 0
 281:         .byte 0, M, 2, 3, 4,40
 282:         .byte 0, X, 1, X, X, X
 283:         .byte 0, X, X, 1, X, X
 284:         .byte 0, X, X, X, 1, X
 285:         .byte 0, X, X, X, X, X
 286: 
 287: relte2:
 288:         .byte 0, 0, 0, 0, 0, 0
 289:         .byte 0, M, X, X, X, X
 290:         .byte 0, X, X, X, X, X
 291:         .byte 0, X, X, X, X, X
 292:         .byte 0, X, X, X, X, X
 293:         .byte 0, X, X, X, X, X

Defined functions

M defined in line 270; used 3 times
X defined in line 269; used 57 times
advanc defined in line 14; used 2 times
binop defined in line 74; used 11 times
brack defined in line 93; used 1 times
  • in line 67
combin defined in line 203; used 9 times
combin1 defined in line 231; used 1 times
eoprnd defined in line 199; used 11 times
esw1 defined in line 57; used 1 times
  • in line 45
exadd defined in line 157; used 1 times
exand defined in line 167; used 1 times
excmbin defined in line 132; used 1 times
exdiv defined in line 184; used 1 times
exlsh defined in line 142; used 2 times
exmod defined in line 147; used 1 times
exmul defined in line 178; used 1 times
exnot defined in line 193; used 1 times
exnum defined in line 86; used 1 times
  • in line 69
exnum1 defined in line 82; used 1 times
  • in line 70
exor defined in line 173; used 1 times
expres defined in line 6; never used
expres1 defined in line 8; used 1 times
  • in line 97
exrsh defined in line 136; used 1 times
exsub defined in line 162; used 1 times
exsw2 defined in line 118; used 1 times
maprel defined in line 252; used 2 times
oprand defined in line 107; used 4 times
relte2 defined in line 287; used 7 times
reltm2 defined in line 279; used 2 times
reltp2 defined in line 271; used 1 times
Last modified: 1975-07-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 708
Valid CSS Valid XHTML 1.0 Strict