1: / cat -- concatinate files
2:
3: mov (sp)+,r5
4: tst (sp)+
5: mov $obuf,r2
6: cmp r5,$1
7: beq 3f
8:
9: loop:
10: dec r5
11: ble done
12: mov (sp)+,r0
13: cmpb (r0),$'-
14: bne 2f
15: clr fin
16: br 3f
17: 2:
18: mov r0,0f
19: sys open; 0:..; 0
20: bes loop
21: mov r0,fin
22: 3:
23: mov fin,r0
24: sys read; ibuf; 512.
25: bes 3f
26: mov r0,r4
27: beq 3f
28: mov $ibuf,r3
29: 4:
30: movb (r3)+,r0
31: jsr pc,putc
32: dec r4
33: bne 4b
34: br 3b
35: 3:
36: mov fin,r0
37: beq loop
38: sys close
39: br loop
40:
41: done:
42: sub $obuf,r2
43: beq 1f
44: mov r2,0f
45: mov $1,r0
46: sys write; obuf; 0:..
47: 1:
48: sys exit
49:
50: putc:
51: movb r0,(r2)+
52: cmp r2,$obuf+512.
53: blo 1f
54: mov $1,r0
55: sys write; obuf; 512.
56: mov $obuf,r2
57: 1:
58: rts pc
59:
60: .bss
61: ibuf: .=.+512.
62: obuf: .=.+512.
63: fin: .=.+2
64: .text
Defined functions
done
defined in line
41; used 1 times
loop
defined in line
9; used 3 times
putc
defined in line
50; used 1 times
Defined variables
fin
defined in line
63; used 4 times
ibuf
defined in line
61; used 2 times
obuf
defined in line
62; used 6 times