1: /
   2: /
   3: 
   4: / a5 -- pdp-11 assembler pass 1
   5: 
   6: readop:
   7:         mov     savop,r4
   8:         beq     1f
   9:         clr     savop
  10:         rts     pc
  11: 1:
  12:         jsr     pc,8f
  13:         jsr     pc,putw
  14:         rts     pc
  15: 
  16: 8:
  17:         jsr     pc,rch
  18: _readop:
  19:         mov     r0,r4
  20:         movb    chartab(r0),r1
  21:         bgt     rdname
  22:         jmp     *1f-2(r1)
  23: 
  24:         fixor
  25:         escp
  26:         8b
  27:         retread
  28:         dquote
  29:         garb
  30:         squote
  31:         rdname
  32:         skip
  33:         rdnum
  34:         retread
  35:         string
  36: 1:
  37: 
  38: escp:
  39:         jsr     pc,rch
  40:         mov     $esctab,r1
  41: 1:
  42:         cmpb    r0,(r1)+
  43:         beq     1f
  44:         tstb    (r1)+
  45:         bne     1b
  46:         rts     pc
  47: 1:
  48:         movb    (r1),r4
  49:         rts     pc
  50: 
  51: esctab:
  52:         .byte '/, '/
  53:         .byte '\<, 035
  54:         .byte '>, 036
  55:         .byte '%, 037
  56:         .byte 0, 0
  57: 
  58: fixor:
  59:         mov     $037,r4
  60: retread:
  61:         rts     pc
  62: 
  63: rdname:
  64:         movb    r0,ch
  65:         cmp     r1,$'0
  66:         blo     1f
  67:         cmp     r1,$'9
  68:         blos    rdnum
  69: 1:
  70:         jmp     rname
  71: 
  72: rdnum:
  73:         jsr     pc,number
  74:                 br 1f
  75:         rts     pc
  76: 
  77: squote:
  78:         jsr     pc,rsch
  79:         br      1f
  80: dquote:
  81:         jsr     pc,rsch
  82:         mov     r0,-(sp)
  83:         jsr     pc,rsch
  84:         swab    r0
  85:         bis     (sp)+,r0
  86: 1:
  87:         mov     r0,numval
  88:         mov     $1,r4
  89:         jsr     pc,putw
  90:         mov     numval,r4
  91:         jsr     pc,putw
  92:         mov     $1,r4
  93:         tst     (sp)+
  94:         rts     pc
  95: 
  96: skip:
  97:         jsr     pc,rch
  98:         mov     r0,r4
  99:         cmp     r0,$'\e
 100:         beq     1f
 101:         cmp     r0,$'\n
 102:         bne     skip
 103: 1:
 104:         rts     pc
 105: 
 106: garb:
 107:         jsr     r5,error; 'g
 108:         br      8b
 109: 
 110: string:
 111:         mov     $'<,r4
 112:         jsr     pc,putw
 113:         clr     numval
 114: 1:
 115:         jsr     pc,rsch
 116:         tst     r1
 117:         bne     1f
 118:         mov     r0,r4
 119:         bis     $400,r4
 120:         jsr     pc,putw
 121:         inc      numval
 122:         br      1b
 123: 1:
 124:         mov     $-1,r4
 125:         jsr     pc,putw
 126:         mov     $'<,r4
 127:         tst     (sp)+
 128:         rts     pc
 129: 
 130: rsch:
 131:         jsr     pc,rch
 132:         cmp     r0,$'\e
 133:         beq     4f
 134:         cmp     r0,$'\n
 135:         beq     4f
 136:         clr     r1
 137:         cmp     r0,$'\\
 138:         bne     3f
 139:         jsr     pc,rch
 140:         mov     $schar,r2
 141: 1:
 142:         cmpb    (r2)+,r0
 143:         beq     2f
 144:         tstb    (r2)+
 145:         bpl     1b
 146:         rts     pc
 147: 2:
 148:         movb    (r2)+,r0
 149:         clr     r1
 150:         rts     pc
 151: 3:
 152:         cmp     r0,$'>
 153:         bne     1f
 154:         inc     r1
 155: 1:
 156:         rts     pc
 157: 4:
 158:         jsr     r5,error; '<
 159:         jmp     aexit
 160: 
 161: schar:
 162:         .byte 'n, 012
 163:         .byte 't, 011
 164:         .byte 'e, 004
 165:         .byte '0, 000
 166:         .byte 'r, 015
 167:         .byte 'a, 006
 168:         .byte 'p, 033
 169:         .byte 0,  -1

Defined functions

_readop defined in line 18; never used
dquote defined in line 80; used 1 times
  • in line 28
escp defined in line 38; used 1 times
  • in line 25
esctab defined in line 51; used 1 times
  • in line 40
fixor defined in line 58; used 1 times
  • in line 24
garb defined in line 106; used 1 times
  • in line 29
rdname defined in line 63; used 2 times
rdnum defined in line 72; used 2 times
readop defined in line 6; never used
retread defined in line 60; used 2 times
rsch defined in line 130; used 4 times
schar defined in line 161; used 1 times
skip defined in line 96; used 2 times
squote defined in line 77; used 1 times
  • in line 30
string defined in line 110; used 1 times
  • in line 35
Last modified: 1975-07-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 610
Valid CSS Valid XHTML 1.0 Strict