Last change
on this file since d6f9ed1 was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Added Alcyon C reference output.
|
-
Property mode
set to
100644
|
File size:
3.5 KB
|
Rev | Line | |
---|
[7bf3856] | 1 | .globl _Cbuffs
|
---|
| 2 | .globl _Stdbufs
|
---|
| 3 | .globl _Stdbuf
|
---|
| 4 | .globl __clsall
|
---|
| 5 | .bss
|
---|
| 6 | L1:.ds.b 4
|
---|
| 7 | .text
|
---|
| 8 | .globl __ClFlag
|
---|
| 9 | .comm __ClFlag,2
|
---|
| 10 | .text
|
---|
| 11 | _closall:
|
---|
| 12 | ~~closall:
|
---|
| 13 | link R14,#0
|
---|
| 14 | movem.l R7-R7/R13-R13,-(sp)
|
---|
| 15 | ~fp=R13
|
---|
| 16 | *line 32
|
---|
| 17 | move.l #_Cbuffs,R13
|
---|
| 18 | bra L6
|
---|
| 19 | L7:
|
---|
| 20 | *line 33
|
---|
| 21 | move.l R13,(sp)
|
---|
| 22 | jsr _fclose
|
---|
| 23 | add.l #18,R13
|
---|
| 24 | L5:L6:
|
---|
| 25 | *line 32
|
---|
| 26 | cmp.l #198+_Cbuffs,R13
|
---|
| 27 | blo L7
|
---|
| 28 | L4:
|
---|
| 29 | *line 35
|
---|
| 30 | move.l L1,R8
|
---|
| 31 | jsr (R8)
|
---|
| 32 | L3:tst.l (sp)+
|
---|
| 33 | movem.l (sp)+,R13-R13
|
---|
| 34 | unlk R14
|
---|
| 35 | rts
|
---|
| 36 | .globl _flush_
|
---|
| 37 | .text
|
---|
| 38 | _flush_:
|
---|
| 39 | ~~flush_:
|
---|
| 40 | ~ptr=R13
|
---|
| 41 | ~data=12
|
---|
| 42 | link R14,#0
|
---|
| 43 | movem.l R6-R7/R13-R13,-(sp)
|
---|
| 44 | ~size=R7
|
---|
| 45 | *line 54
|
---|
| 46 | move.l 8(R14),R13
|
---|
| 47 | *line 54
|
---|
| 48 | *line 54
|
---|
| 49 | tst __ClFlag
|
---|
| 50 | bne L9
|
---|
| 51 | *line 55
|
---|
| 52 | *line 56
|
---|
| 53 | move.l __clsall,L1
|
---|
| 54 | *line 57
|
---|
| 55 | move.l #_closall,__clsall
|
---|
| 56 | *line 58
|
---|
| 57 | move #1,__ClFlag
|
---|
| 58 | *line 59
|
---|
| 59 | *line 60
|
---|
| 60 | L9:
|
---|
| 61 | *line 61
|
---|
| 62 | *line 61
|
---|
| 63 | btst #2,12(R13)
|
---|
| 64 | beq L10
|
---|
| 65 | *line 62
|
---|
| 66 | *line 63
|
---|
| 67 | move.l (R13),R0
|
---|
| 68 | sub.l 8(R13),R0
|
---|
| 69 | move R0,R7
|
---|
| 70 | *line 64
|
---|
| 71 | *line 65
|
---|
| 72 | *line 65
|
---|
| 73 | move R7,(sp)
|
---|
| 74 | move.l 8(R13),-(sp)
|
---|
| 75 | move.b 13(R13),R0
|
---|
| 76 | ext.w R0
|
---|
| 77 | move R0,-(sp)
|
---|
| 78 | jsr _write
|
---|
| 79 | addq.l #6,sp
|
---|
| 80 | cmp #-1,R0
|
---|
| 81 | bne L11
|
---|
| 82 | *line 66
|
---|
| 83 | L12:
|
---|
| 84 | *line 67
|
---|
| 85 | *line 68
|
---|
| 86 | or.b #16,12(R13)
|
---|
| 87 | *line 69
|
---|
| 88 | move #-1,R0
|
---|
| 89 | bra L8
|
---|
| 90 | *line 70
|
---|
| 91 | L11:
|
---|
| 92 | *line 71
|
---|
| 93 | *line 72
|
---|
| 94 | L10:
|
---|
| 95 | *line 73
|
---|
| 96 | *line 73
|
---|
| 97 | cmp #-1,12(R14)
|
---|
| 98 | bne L13
|
---|
| 99 | *line 74
|
---|
| 100 | *line 75
|
---|
| 101 | and.b #-5,12(R13)
|
---|
| 102 | *line 76
|
---|
| 103 | clr R0
|
---|
| 104 | ext.l R0
|
---|
| 105 | move.l R0,(R13)
|
---|
| 106 | move.l R0,4(R13)
|
---|
| 107 | *line 77
|
---|
| 108 | clr R0
|
---|
| 109 | bra L8
|
---|
| 110 | *line 78
|
---|
| 111 | *line 79
|
---|
| 112 | L13:
|
---|
| 113 | *line 80
|
---|
| 114 | *line 81
|
---|
| 115 | tst.l 8(R13)
|
---|
| 116 | bne L14
|
---|
| 117 | *line 81
|
---|
| 118 | move.l R13,(sp)
|
---|
| 119 | jsr _getbuff
|
---|
| 120 | *line 82
|
---|
| 121 | L14:
|
---|
| 122 | *line 83
|
---|
| 123 | *line 83
|
---|
| 124 | cmp #1,16(R13)
|
---|
| 125 | bne L15
|
---|
| 126 | *line 84
|
---|
| 127 | *line 85
|
---|
| 128 | *line 86
|
---|
| 129 | move #1,(sp)
|
---|
| 130 | move.l R14,-(sp)
|
---|
| 131 | add.l #12,(sp)
|
---|
| 132 | move.b 13(R13),R0
|
---|
| 133 | ext.w R0
|
---|
| 134 | move R0,-(sp)
|
---|
| 135 | jsr _write
|
---|
| 136 | addq.l #6,sp
|
---|
| 137 | cmp #-1,R0
|
---|
| 138 | beq L12
|
---|
| 139 | *line 87
|
---|
| 140 | *line 88
|
---|
| 141 | move 12(R14),R0
|
---|
| 142 | bra L8
|
---|
| 143 | *line 89
|
---|
| 144 | *line 90
|
---|
| 145 | L15:
|
---|
| 146 | *line 91
|
---|
| 147 | move.l 8(R13),(R13)
|
---|
| 148 | *line 92
|
---|
| 149 | move.l 8(R13),R0
|
---|
| 150 | move 16(R13),R1
|
---|
| 151 | ext.l R1
|
---|
| 152 | add.l R1,R0
|
---|
| 153 | move.l R0,4(R13)
|
---|
| 154 | *line 93
|
---|
| 155 | or.b #4,12(R13)
|
---|
| 156 | *line 95
|
---|
| 157 | move.l (R13),R8
|
---|
| 158 | move 12(R14),R0
|
---|
| 159 | move.b R0,(R8)
|
---|
| 160 | and #255,R0
|
---|
| 161 | add.l #1,(R13)
|
---|
| 162 | bra L8
|
---|
| 163 | L8:tst.l (sp)+
|
---|
| 164 | movem.l (sp)+,R7-R7/R13-R13
|
---|
| 165 | unlk R14
|
---|
| 166 | rts
|
---|
| 167 | .globl _fflush
|
---|
| 168 | .text
|
---|
| 169 | _fflush:
|
---|
| 170 | ~~fflush:
|
---|
| 171 | ~ptr=8
|
---|
| 172 | link R14,#-4
|
---|
| 173 | *line 111
|
---|
| 174 | move #-1,(sp)
|
---|
| 175 | move.l 8(R14),-(sp)
|
---|
| 176 | jsr _flush_
|
---|
| 177 | addq.l #4,sp
|
---|
| 178 | bra L16
|
---|
| 179 | L16:unlk R14
|
---|
| 180 | rts
|
---|
| 181 | .globl _fclose
|
---|
| 182 | .text
|
---|
| 183 | _fclose:
|
---|
| 184 | ~~fclose:
|
---|
| 185 | ~ptr=R13
|
---|
| 186 | link R14,#-2
|
---|
| 187 | movem.l R7-R7/R13-R13,-(sp)
|
---|
| 188 | ~err=-2
|
---|
| 189 | *line 126
|
---|
| 190 | move.l 8(R14),R13
|
---|
| 191 | *line 126
|
---|
| 192 | clr -2(R14)
|
---|
| 193 | *line 128
|
---|
| 194 | *line 128
|
---|
| 195 | tst.b 12(R13)
|
---|
| 196 | beq L18
|
---|
| 197 | *line 129
|
---|
| 198 | *line 130
|
---|
| 199 | *line 131
|
---|
| 200 | btst #2,12(R13)
|
---|
| 201 | beq L19
|
---|
| 202 | *line 131
|
---|
| 203 | move #-1,(sp)
|
---|
| 204 | move.l R13,-(sp)
|
---|
| 205 | jsr _flush_
|
---|
| 206 | addq.l #4,sp
|
---|
| 207 | move R0,-2(R14)
|
---|
| 208 | *line 132
|
---|
| 209 | L19:
|
---|
| 210 | *line 133
|
---|
| 211 | move.b 13(R13),R0
|
---|
| 212 | ext.w R0
|
---|
| 213 | move R0,(sp)
|
---|
| 214 | jsr _close
|
---|
| 215 | or R0,-2(R14)
|
---|
| 216 | *line 134
|
---|
| 217 | *line 135
|
---|
| 218 | *line 135
|
---|
| 219 | btst #1,12(R13)
|
---|
| 220 | beq L20
|
---|
| 221 | *line 136
|
---|
| 222 | *line 137
|
---|
| 223 | move.l 8(R13),R8
|
---|
| 224 | move.l _Stdbufs,(R8)
|
---|
| 225 | *line 138
|
---|
| 226 | move.l 8(R13),_Stdbufs
|
---|
| 227 | *line 139
|
---|
| 228 | L20:
|
---|
| 229 | *line 140
|
---|
| 230 | *line 141
|
---|
| 231 | L18:
|
---|
| 232 | *line 142
|
---|
| 233 | clr.b 12(R13)
|
---|
| 234 | *line 143
|
---|
| 235 | move -2(R14),R0
|
---|
| 236 | bra L17
|
---|
| 237 | L17:tst.l (sp)+
|
---|
| 238 | movem.l (sp)+,R13-R13
|
---|
| 239 | unlk R14
|
---|
| 240 | rts
|
---|
| 241 | .globl _putc
|
---|
| 242 | .text
|
---|
| 243 | _putc:
|
---|
| 244 | ~~putc:
|
---|
| 245 | ~ptr=R13
|
---|
| 246 | ~c=8
|
---|
| 247 | link R14,#0
|
---|
| 248 | movem.l R7-R7/R13-R13,-(sp)
|
---|
| 249 | *line 160
|
---|
| 250 | move.l 10(R14),R13
|
---|
| 251 | *line 160
|
---|
| 252 | *line 161
|
---|
| 253 | move.l (R13),R0
|
---|
| 254 | cmp.l 4(R13),R0
|
---|
| 255 | blo L22
|
---|
| 256 | *line 161
|
---|
| 257 | move 8(R14),(sp)
|
---|
| 258 | and #255,(sp)
|
---|
| 259 | move.l R13,-(sp)
|
---|
| 260 | jsr _flush_
|
---|
| 261 | addq.l #4,sp
|
---|
| 262 | bra L21
|
---|
| 263 | *line 162
|
---|
| 264 | L22:
|
---|
| 265 | *line 163
|
---|
| 266 | move.l (R13),R8
|
---|
| 267 | move 8(R14),R0
|
---|
| 268 | move.b R0,(R8)
|
---|
| 269 | and #255,R0
|
---|
| 270 | add.l #1,(R13)
|
---|
| 271 | bra L21
|
---|
| 272 | L21:tst.l (sp)+
|
---|
| 273 | movem.l (sp)+,R13-R13
|
---|
| 274 | unlk R14
|
---|
| 275 | rts
|
---|
| 276 | .globl _puterr
|
---|
| 277 | .text
|
---|
| 278 | _puterr:
|
---|
| 279 | ~~puterr:
|
---|
| 280 | ~c=8
|
---|
| 281 | link R14,#-4
|
---|
| 282 | *line 175
|
---|
| 283 | move.l #36+_Cbuffs,(sp)
|
---|
| 284 | move 8(R14),-(sp)
|
---|
| 285 | jsr _putc
|
---|
| 286 | addq.l #2,sp
|
---|
| 287 | bra L23
|
---|
| 288 | L23:unlk R14
|
---|
| 289 | rts
|
---|
| 290 | .data
|
---|
Note:
See
TracBrowser
for help on using the repository browser.