Last change
on this file since cc2c9e0 was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Added Alcyon C reference output.
|
-
Property mode
set to
100644
|
File size:
1.8 KB
|
Line | |
---|
1 | .globl _Cbuffs
|
---|
2 | .globl _Stdbufs
|
---|
3 | .globl _Stdbuf
|
---|
4 | .globl _agetc
|
---|
5 | .text
|
---|
6 | _agetc:
|
---|
7 | ~~agetc:
|
---|
8 | ~ptr=R13
|
---|
9 | link R14,#0
|
---|
10 | movem.l R6-R7/R13-R13,-(sp)
|
---|
11 | ~c=R7
|
---|
12 | *line 19
|
---|
13 | move.l 8(R14),R13
|
---|
14 | L2:
|
---|
15 | *line 20
|
---|
16 | *line 20
|
---|
17 | move.l R13,(sp)
|
---|
18 | jsr _getc
|
---|
19 | move R0,R7
|
---|
20 | cmp #-1,R7
|
---|
21 | beq L3
|
---|
22 | *line 21
|
---|
23 | *line 22
|
---|
24 | and #127,R7
|
---|
25 | move R7,R0
|
---|
26 | bra L5
|
---|
27 | *line 23
|
---|
28 | L6:
|
---|
29 | *line 24
|
---|
30 | *line 25
|
---|
31 | sub.l #1,(R13)
|
---|
32 | *line 26
|
---|
33 | move #-1,R0
|
---|
34 | bra L1
|
---|
35 | *line 27
|
---|
36 | L7:
|
---|
37 | *line 28
|
---|
38 | L8:
|
---|
39 | *line 29
|
---|
40 | bra L2
|
---|
41 | *line 30
|
---|
42 | bra L4
|
---|
43 | L5:tst R0
|
---|
44 | beq L8
|
---|
45 | cmp #10,R0
|
---|
46 | beq L7
|
---|
47 | cmp #26,R0
|
---|
48 | beq L6
|
---|
49 | bra L4
|
---|
50 | L4:
|
---|
51 | *line 31
|
---|
52 | *line 32
|
---|
53 | *line 33
|
---|
54 | L3:
|
---|
55 | *line 34
|
---|
56 | move R7,R0
|
---|
57 | bra L1
|
---|
58 | L1:tst.l (sp)+
|
---|
59 | movem.l (sp)+,R7-R7/R13-R13
|
---|
60 | unlk R14
|
---|
61 | rts
|
---|
62 | .globl _gets
|
---|
63 | .text
|
---|
64 | _gets:
|
---|
65 | ~~gets:
|
---|
66 | ~line=8
|
---|
67 | link R14,#0
|
---|
68 | movem.l R6-R7/R13-R13,-(sp)
|
---|
69 | ~cp=R13
|
---|
70 | ~i=R7
|
---|
71 | *line 44
|
---|
72 | move.l 8(R14),R13
|
---|
73 | *line 46
|
---|
74 | bra L12
|
---|
75 | L11:
|
---|
76 | *line 47
|
---|
77 | move.b R7,(R13)+
|
---|
78 | L12:
|
---|
79 | *line 47
|
---|
80 | move.l #_Cbuffs,(sp)
|
---|
81 | jsr _getc
|
---|
82 | move R0,R7
|
---|
83 | cmp #-1,R7
|
---|
84 | beq L10000
|
---|
85 | cmp #10,R7
|
---|
86 | bne L11
|
---|
87 | L10000:L10:
|
---|
88 | *line 49
|
---|
89 | clr.b (R13)
|
---|
90 | *line 51
|
---|
91 | *line 52
|
---|
92 | cmp #-1,R7
|
---|
93 | bne L13
|
---|
94 | cmp.l 8(R14),R13
|
---|
95 | bne L13
|
---|
96 | *line 52
|
---|
97 | clr.l R0
|
---|
98 | bra L9
|
---|
99 | *line 53
|
---|
100 | L13:
|
---|
101 | *line 54
|
---|
102 | move.l 8(R14),R0
|
---|
103 | bra L9
|
---|
104 | L9:tst.l (sp)+
|
---|
105 | movem.l (sp)+,R7-R7/R13-R13
|
---|
106 | unlk R14
|
---|
107 | rts
|
---|
108 | .globl _fgets
|
---|
109 | .text
|
---|
110 | _fgets:
|
---|
111 | ~~fgets:
|
---|
112 | ~s=8
|
---|
113 | ~n=12
|
---|
114 | ~fp=14
|
---|
115 | link R14,#0
|
---|
116 | movem.l R6-R7/R13-R13,-(sp)
|
---|
117 | ~c=R7
|
---|
118 | ~cp=R13
|
---|
119 | *line 66
|
---|
120 | move.l 8(R14),R13
|
---|
121 | *line 68
|
---|
122 | bra L17
|
---|
123 | L16:
|
---|
124 | *line 69
|
---|
125 | *line 70
|
---|
126 | move.b R7,(R13)+
|
---|
127 | *line 71
|
---|
128 | *line 72
|
---|
129 | *line 73
|
---|
130 | cmp #10,R7
|
---|
131 | beq L15
|
---|
132 | L17:
|
---|
133 | *line 74
|
---|
134 | sub #1,12(R14)
|
---|
135 | ble L10001
|
---|
136 | move.l 14(R14),(sp)
|
---|
137 | jsr _agetc
|
---|
138 | move R0,R7
|
---|
139 | cmp #-1,R7
|
---|
140 | bne L16
|
---|
141 | L10001:L15:
|
---|
142 | *line 76
|
---|
143 | clr.b (R13)
|
---|
144 | *line 78
|
---|
145 | *line 79
|
---|
146 | cmp #-1,R7
|
---|
147 | bne L18
|
---|
148 | cmp.l 8(R14),R13
|
---|
149 | bne L18
|
---|
150 | *line 79
|
---|
151 | clr.l R0
|
---|
152 | bra L14
|
---|
153 | *line 80
|
---|
154 | L18:
|
---|
155 | *line 81
|
---|
156 | move.l 8(R14),R0
|
---|
157 | bra L14
|
---|
158 | L14:tst.l (sp)+
|
---|
159 | movem.l (sp)+,R7-R7/R13-R13
|
---|
160 | unlk R14
|
---|
161 | rts
|
---|
162 | .data
|
---|
Note:
See
TracBrowser
for help on using the repository browser.