1: / dsw - delete from tty
   2: 
   3:         cmp     (sp)+,$2
   4:         blt     1f
   5:         tst     (sp)+
   6:         mov     (sp)+,0f
   7: 1:
   8:         sys     stat; 0:dot; stbuf
   9:         bes     error
  10:         mov     stbuf+4,r0
  11:         bic     $!60000,r0
  12:         cmp     r0,$40000
  13:         bne     error
  14:         mov     0b,0f
  15:         sys     open; 0:..; 0
  16:         bes     error
  17:         mov     r0,r1
  18: 1:
  19:         clrb    buf+17.
  20:         mov     r1,r0
  21:         sys     read; buf; 16.
  22:         bes     done
  23:         tst     r0
  24:         beq     done
  25:         tst     buf
  26:         beq     1b
  27:         mov     0b,r2
  28:         mov     $obuf,r3
  29: 2:
  30:         movb    (r2)+,(r3)+
  31:         bne     2b
  32:         mov     $buf+2,r2
  33:         dec     r3
  34:         cmpb    -1(r3),$'/
  35:         beq     2f
  36:         movb    $'/,(r3)+
  37: 2:
  38:         movb    (r2)+,(r3)+
  39:         bne     2b
  40:         sys     stat; obuf; stbuf
  41:         bes     error
  42:         bit     $60000,stbuf+4
  43:         bne     1b
  44:         mov     $buf+2,r2
  45: 2:
  46:         tstb    (r2)+
  47:         bne     2b
  48:         movb    $' ,-(r2)
  49:         sub     $buf+1,r2
  50:         mov     r2,0f
  51: 
  52: 2:
  53:         mov     $1,r0
  54:         sys     write; buf+2; 0:..
  55:         clr     r0
  56:         sys     read; ch; 1
  57:         cmpb    ch,$'\n
  58:         beq     1b
  59:         clr     r0
  60:         sys     read; ch1; 1
  61:         cmpb    ch1,$'\n
  62:         beq     3f
  63: 4:
  64:         clr     r0
  65:         sys     read; ch; 1
  66:         cmpb    ch,$'\n
  67:         beq     2b
  68:         br      4b
  69: 3:
  70:         cmpb    ch,$'x
  71:         beq     done
  72:         cmpb    ch,$'y
  73:         bne     2b
  74:         sys     unlink; obuf
  75:         bes     error
  76:         br      1b
  77: 
  78: done:
  79:         sys     exit
  80: 
  81: error:
  82:         mov     $1,r0
  83:         sys     write; mes; 2
  84:         sys     exit
  85: 
  86: dot:    <.\0>
  87: mes:    <?\n>
  88: 
  89:         .bss
  90: obuf:   .=.+100.
  91: stbuf:  .=.+40.
  92: buf:    .=.+18.
  93: ch:     .=.+1
  94: ch1:    .=.+1

Defined functions

done defined in line 78; used 3 times
dot defined in line 86; used 1 times
  • in line 8
error defined in line 81; used 5 times
mes defined in line 87; used 1 times
  • in line 83

Defined variables

buf defined in line 92; used 7 times
ch defined in line 93; used 6 times
ch1 defined in line 94; used 2 times
obuf defined in line 90; used 3 times
stbuf defined in line 91; used 4 times
Last modified: 1975-05-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 387
Valid CSS Valid XHTML 1.0 Strict