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:         tst     overlaid
  29:         beq     0f
  30: /
  31: / Bill Shannon's hack to the assembler to force globl text
  32: / references to remain undefined so that the link editor may
  33: / resolve them. This is necessary if a function is used as an
  34: / arg in an overlay located piece of code, and the function is
  35: / actually in another overlay. Elsewise, the assembler fix's up
  36: / the reference before the link editor changes the globl refrence
  37: / to the thunk. -wfj 5/80
  38:         cmp     r0,$42          / is it globl text ?
  39:         bne     0f              / nope
  40:         mov     $40,r0          / yes, treat it as undefined external
  41: 0:
  42:         cmp     r0,$40
  43:         bne     1f
  44:         mov     r4,xsymbol
  45:         clr     r1
  46:         br      oprand
  47: 1:
  48:         mov     2(r4),r1
  49:         br      oprand
  50: 7:
  51:         cmp     r4,$141
  52:         blo     1f
  53:         asl     r4
  54:         mov     curfb-[2*141](r4),r0
  55:         mov     2(r0),r1
  56:         movb    (r0),r0
  57:         br      oprand
  58: 1:
  59:         mov     $esw1,r1
  60: 1:
  61:         cmp     (r1)+,r4
  62:         beq     1f
  63:         tst     (r1)+
  64:         bne     1b
  65:         tst     (sp)+
  66:         mov     (sp)+,r5
  67:         rts     pc
  68: 1:
  69:         jmp     *(r1)
  70: 
  71: esw1:
  72:         '+;     binop
  73:         '-;     binop
  74:         '*;     binop
  75:         '/;     binop
  76:         '&;     binop
  77:         037;    binop
  78:         035;    binop
  79:         036;    binop
  80:         '%;     binop
  81:         '[;     brack
  82:         '^;     binop
  83:         1;      exnum
  84:         2;      exnum1
  85:         '!;     binop
  86:         200;    0
  87: 
  88: binop:
  89:         cmpb    (sp),$'+
  90:         beq     1f
  91:         jsr     pc,errore
  92: 1:
  93:         movb    r4,(sp)
  94:         br      advanc
  95: 
  96: exnum1:
  97:         mov     numval,r1
  98:         br      1f
  99: 
 100: exnum:
 101:         jsr     pc,getw
 102:         mov     r4,r1
 103: 1:
 104:         mov     $1,r0
 105:         br      oprand
 106: 
 107: brack:
 108:         mov     r2,-(sp)
 109:         mov     r3,-(sp)
 110:         jsr     pc,readop
 111:         jsr     pc,expres1
 112:         cmp     r4,$']
 113:         beq     1f
 114:         jsr     r5,error; ']
 115: 1:
 116:         mov     r3,r0
 117:         mov     r2,r1
 118:         mov     (sp)+,r3
 119:         mov     (sp)+,r2
 120: 
 121: oprand:
 122:         mov     $exsw2,r5
 123: 1:
 124:         cmp     (sp),(r5)+
 125:         beq     1f
 126:         tst     (r5)+
 127:         bne     1b
 128:         br      eoprnd
 129: 1:
 130:         jmp     *(r5)
 131: 
 132: exsw2:
 133:         '+; exadd
 134:         '-; exsub
 135:         '*; exmul
 136:         '/; exdiv
 137:         037; exor
 138:         '&; exand
 139:         035;exlsh
 140:         036;exrsh
 141:         '%; exmod
 142:         '^; excmbin
 143:         '!; exnot
 144:         200;  0
 145: 
 146: excmbin:
 147:         mov     r0,r3
 148:         br      eoprnd
 149: 
 150: exrsh:
 151:         neg     r1
 152:         beq     exlsh
 153:         inc     r1
 154:         clc
 155:         ror     r2
 156: exlsh:
 157:         jsr     r5,combin; relte2
 158:         als     r1,r2
 159:         br      eoprnd
 160: 
 161: exmod:
 162:         jsr     r5,combin; relte2
 163:         mov     r3,r0
 164:         mov     r2,r3
 165:         clr     r2
 166:         dvd     r1,r2
 167:         mov     r3,r2
 168:         mov     r0,r3
 169:         br      eoprnd
 170: 
 171: exadd:
 172:         jsr     r5,combin; reltp2
 173:         add     r1,r2
 174:         br      eoprnd
 175: 
 176: exsub:
 177:         jsr     r5,combin; reltm2
 178:         sub     r1,r2
 179:         br      eoprnd
 180: 
 181: exand:
 182:         jsr     r5,combin; relte2
 183:         com     r1
 184:         bic     r1,r2
 185:         br      eoprnd
 186: 
 187: exor:
 188:         jsr     r5,combin; relte2
 189:         bis     r1,r2
 190:         br      eoprnd
 191: 
 192: exmul:
 193:         jsr     r5,combin; relte2
 194:         mpy     r2,r1
 195:         mov     r1,r2
 196:         br      eoprnd
 197: 
 198: exdiv:
 199:         jsr     r5,combin; relte2
 200:         mov     r3,r0
 201:         mov     r2,r3
 202:         clr     r2
 203:         dvd     r1,r2
 204:         mov     r0,r3
 205:         br      eoprnd
 206: 
 207: exnot:
 208:         jsr     r5,combin; relte2
 209:         com     r1
 210:         add     r1,r2
 211:         br      eoprnd
 212: 
 213: eoprnd:
 214:         mov     $'+,(sp)
 215:         jmp     advanc
 216: 
 217: combin:
 218:         tstb    passno
 219:         bne     combin1
 220:         mov     r0,-(sp)
 221:         bis     r3,(sp)
 222:         bic     $!40,(sp)
 223:         bic     $!37,r0
 224:         bic     $!37,r3
 225:         cmp     r0,r3
 226:         ble     1f
 227:         mov     r0,-(sp)
 228:         mov     r3,r0
 229:         mov     (sp)+,r3
 230: 1:
 231:         tst     r0
 232:         beq     1f
 233:         cmp     (r5)+,$reltm2
 234:         bne     2f
 235:         cmp     r0,r3
 236:         bne     2f
 237:         mov     $1,r3
 238:         br      2f
 239: 1:
 240:         tst     (r5)+
 241:         clr     r3
 242: 2:
 243:         bis     (sp)+,r3
 244:         rts     r5
 245: combin1:
 246:         mov     r1,-(sp)
 247:         clr     maxtyp
 248:         jsr     pc,maprel
 249:         mov     r0,r1
 250:         mpy     $6,r1
 251:         mov     r3,r0
 252:         jsr     pc,maprel
 253:         add     (r5)+,r0
 254:         add     r1,r0
 255:         movb    (r0),r3
 256:         bpl     1f
 257:         cmp     r3,$-1
 258:         beq     2f
 259:         jsr     r5,error; 'r
 260: 2:
 261:         mov     maxtyp,r3
 262: 1:
 263:         mov     (sp)+,r1
 264:         rts     r5
 265: 
 266: maprel:
 267:         cmp     r0,$40
 268:         bne     1f
 269:         mov     $5,r0
 270:         rts     pc
 271: 1:
 272:         bic     $!37,r0
 273:         cmp     r0,maxtyp
 274:         blos    1f
 275:         mov     r0,maxtyp
 276: 1:
 277:         cmp     r0,$5
 278:         blo     1f
 279:         mov     $1,r0
 280: 1:
 281:         rts     pc
 282: 
 283: X = -2
 284: M = -1
 285: reltp2:
 286:         .byte 0, 0, 0, 0, 0, 0
 287:         .byte 0, M, 2, 3, 4,40
 288:         .byte 0, 2, X, X, X, X
 289:         .byte 0, 3, X, X, X, X
 290:         .byte 0, 4, X, X, X, X
 291:         .byte 0,40, X, X, X, X
 292: 
 293: reltm2:
 294:         .byte 0, 0, 0, 0, 0, 0
 295:         .byte 0, M, 2, 3, 4,40
 296:         .byte 0, X, 1, X, X, X
 297:         .byte 0, X, X, 1, X, X
 298:         .byte 0, X, X, X, 1, X
 299:         .byte 0, X, X, X, X, X
 300: 
 301: relte2:
 302:         .byte 0, 0, 0, 0, 0, 0
 303:         .byte 0, M, X, X, X, X
 304:         .byte 0, X, X, X, X, X
 305:         .byte 0, X, X, X, X, X
 306:         .byte 0, X, X, X, X, X
 307:         .byte 0, X, X, X, X, X

Defined functions

M defined in line 284; used 3 times
X defined in line 283; used 57 times
advanc defined in line 14; used 2 times
binop defined in line 88; used 11 times
brack defined in line 107; used 1 times
  • in line 81
combin defined in line 217; used 9 times
combin1 defined in line 245; used 1 times
eoprnd defined in line 213; used 11 times
esw1 defined in line 71; used 1 times
  • in line 59
exadd defined in line 171; used 1 times
exand defined in line 181; used 1 times
excmbin defined in line 146; used 1 times
exdiv defined in line 198; used 1 times
exlsh defined in line 156; used 2 times
exmod defined in line 161; used 1 times
exmul defined in line 192; used 1 times
exnot defined in line 207; used 1 times
exnum defined in line 100; used 1 times
  • in line 83
exnum1 defined in line 96; used 1 times
  • in line 84
exor defined in line 187; used 1 times
expres defined in line 6; never used
expres1 defined in line 8; used 1 times
exrsh defined in line 150; used 1 times
exsub defined in line 176; used 1 times
exsw2 defined in line 132; used 1 times
maprel defined in line 266; used 2 times
oprand defined in line 121; used 4 times
relte2 defined in line 301; used 7 times
reltm2 defined in line 293; used 2 times
reltp2 defined in line 285; used 1 times
Last modified: 1982-10-01
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 507
Valid CSS Valid XHTML 1.0 Strict