1: / chgrp -- change group
   2: 
   3: 
   4:         .globl  fopen, getc, mesg
   5: 
   6:         mov     sp,r5
   7:         mov     (r5),r4
   8:         cmp     r4,$3
   9:         bge     1f
  10:         jsr     r5,mesg; <chown uid f1 ...\n\0>; .even
  11: 1:
  12:         add     $4,r5
  13:         mov     (r5),r3
  14:         cmpb    (r3),$'0
  15:         blt     1f
  16:         cmpb    (r3),$'9
  17:         bgt     1f
  18:         jsr     r5,cvnum; geta
  19:         br      do
  20: 1:
  21:         mov     $uids,r0
  22:         jsr     r5,fopen; ubuf
  23:         bec     1f
  24:         jsr     r5,mesg; <Can't open /etc/uids\n\0>; .even
  25:         sys     exit
  26: 1:
  27:         mov     r3,r2
  28: 2:
  29:         jsr     r5,getc; ubuf
  30:         bcc     3f
  31: who:
  32:         jsr     r5,mesg; <Who?\n\0>; .even
  33:         sys     exit
  34: 3:
  35:         cmp     r0,$':
  36:         beq     3f
  37:         cmpb    (r2)+,r0
  38:         beq     2b
  39: 2:
  40:         jsr     r5,getc; ubuf
  41:         bcs     who
  42:         cmp     r0,$'\n
  43:         bne     2b
  44:         br      1b
  45: 3:
  46:         tstb    (r2)
  47:         bne     2b
  48: 3:
  49:         jsr     r5,getc; ubuf
  50:         cmpb    r0,$':
  51:         bne     3b
  52:         jsr     r5,cvnum; getc
  53: do:
  54:         sub     $2,r4
  55:         swab    r1
  56:         mov     r1,0f+2
  57:         tst     (r5)+
  58: 1:
  59:         mov     (r5),0f
  60:         mov     (r5)+,9f
  61:         sys     stat; 9:..; statb
  62:         movb    statb+7,0f+2
  63:         sys     chown; 0:..; 0
  64:         bec     2f
  65:         mov     0b,r0
  66:         mov     r0,0f
  67:         clr     0f+2
  68: 3:
  69:         tstb    (r0)+
  70:         beq     3f
  71:         inc     0f+2
  72:         br      3b
  73: 3:
  74:         mov     $1,r0
  75:         sys     write; 0:..; ..
  76:         jsr     r5,mesg; <?\n\0>; .even
  77: 2:
  78:         dec     r4
  79:         bgt     1b
  80:         sys     exit
  81: 
  82: cvnum:
  83:         clr     r1
  84: 1:
  85:         jsr     r5,*(r5); ubuf
  86:         bcs     1f
  87:         sub     $'0,r0
  88:         cmp     r0,$9.
  89:         bhi     1f
  90:         mpy     $10.,r1
  91:         add     r0,r1
  92:         br      1b
  93: 1:
  94:         tst     (r5)+
  95:         rts     r5
  96: 
  97: geta:
  98:         movb    (r3)+,r0
  99:         tst     (r5)+
 100:         rts     r5
 101: 
 102: uids:   </etc/group\0>
 103: 
 104:         .bss
 105: statb:  .=.+36.
 106: ubuf:   .=.+518.

Defined functions

cvnum defined in line 82; used 2 times
do defined in line 53; used 1 times
  • in line 19
geta defined in line 97; used 1 times
  • in line 18
uids defined in line 102; used 1 times
  • in line 21
who defined in line 31; used 1 times
  • in line 41

Defined variables

statb defined in line 105; used 2 times
ubuf defined in line 106; used 5 times
Last modified: 1975-05-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 720
Valid CSS Valid XHTML 1.0 Strict