source: buchla-68k/alcyon/fread.s@ d21fc6f

Last change on this file since d21fc6f was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 760 bytes
Line 
1.globl _Cbuffs
2.globl _Stdbufs
3.globl _Stdbuf
4.globl _fread
5.text
6_fread:
7~~fread:
8~buffer=R13
9~size=12
10~number=14
11~stream=16
12link R14,#-2
13movem.l R5-R7/R13-R13,-(sp)
14~total=-2
15~c=R7
16~i=R6
17*line 28
18move.l 8(R14),R13
19*line 28
20clr -2(R14)
21bra L4
22L5:
23*line 29
24*line 30
25move 12(R14),R6
26bra L8
27L9:
28*line 31
29*line 32
30*line 33
31move.l 16(R14),(sp)
32jsr _getc
33move R0,R7
34cmp #-1,R7
35bne L10
36*line 33
37move -2(R14),R0
38bra L1
39*line 34
40L10:
41*line 35
42move.b R7,(R13)+
43L7:
44*line 30
45sub #1,R6
46L8:
47*line 30
48tst R6
49bne L9
50L6:
51*line 36
52L3:
53*line 28
54add #1,-2(R14)
55L4:
56*line 28
57move -2(R14),R0
58cmp 14(R14),R0
59blt L5
60L2:
61*line 38
62move -2(R14),R0
63bra L1
64L1:tst.l (sp)+
65movem.l (sp)+,R6-R7/R13-R13
66unlk R14
67rts
68.data
Note: See TracBrowser for help on using the repository browser.