1: .data
2: / putw/putc -- write words/characters on output file
3:
4: .globl _putc, _putw, _fflush, _fcreat
5: .globl cerror, _werflg
6: .comm _errno,2
7:
8: _fcreat:
9: mov r5,-(sp)
10: mov sp,r5
11: mov 4(r5),0f
12: mov 6(r5),r1
13: mov pc,(r1) / a putatively illegal file desc.
14: sys 0; 9f
15: br 7f
16: /.data
17: 9: sys creat; 0:..; 644
18: /.text
19: 7:
20: bes badret
21: mov r0,(r1)+
22: clr (r1)+
23: clr (r1)+
24: br goodret
25:
26: _putw:
27: mov r5,-(sp)
28: mov sp,r5
29: mov 6(r5),r1
30: dec 2(r1)
31: bge 1f
32: jsr pc,fl
33: dec 2(r1)
34: 1:
35: movb 4(r5),*4(r1)
36: inc 4(r1)
37: dec 2(r1)
38: bge 1f
39: jsr pc,fl
40: dec 2(r1)
41: 1:
42: movb 5(r5),*4(r1)
43: inc 4(r1)
44: mov 4(r5),r0
45: br goodret
46:
47: _putc:
48: mov r5,-(sp)
49: mov sp,r5
50: mov 6(r5),r1
51: dec 2(r1)
52: bge 1f
53: jsr pc,fl
54: dec 2(r1)
55: 1:
56: mov 4(r5),r0
57: movb r0,*4(r1)
58: inc 4(r1)
59: br goodret
60:
61: _fflush:
62: mov r5,-(sp)
63: mov sp,r5
64: mov 4(r5),r1
65: jsr pc,fl
66: br goodret
67:
68: fl:
69: mov r1,r0
70: add $6,r0
71: mov r0,-(sp)
72: mov r0,0f
73: mov 4(r1),0f+2
74: beq 1f
75: sub r0,0f+2
76: mov (r1),r0
77: sys 0; 9f
78: br 7f
79: /.data
80: 9: sys write; 0:..; ..
81: /.text
82: 7:
83: bec 1f
84: mov r0,_werflg
85: 1:
86: mov (sp)+,4(r1)
87: mov $512.,2(r1)
88: rts pc
89:
90: badret:
91: jmp cerror
92:
93: goodret:
94: clr _errno
95: mov (sp)+,r5
96: rts pc
97: .bss
98: _werflg:.=.+2
Defined variables
_errno
defined in line
6; used 1 times
_fcreat
declared in line
4; defined in line
8; used 1 times
_fflush
declared in line
4; defined in line
61; used 1 times
_putc
declared in line
4; defined in line
47; used 1 times
_putw
declared in line
4; defined in line
26; used 1 times
_werflg
declared in line
5; defined in line
98; used 2 times
fl
defined in line
68; used 4 times