source: buchla-68k/alcyon/fputs.s@ 9519422

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

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1.globl _Cbuffs
2.globl _Stdbufs
3.globl _Stdbuf
4.globl _puts
5.text
6_puts:
7~~puts:
8~str=R13
9link R14,#0
10movem.l R7-R7/R13-R13,-(sp)
11*line 15
12move.l 8(R14),R13
13*line 15
14bra L4
15L3:
16*line 16
17*line 17
18move.l #18+_Cbuffs,(sp)
19move.b (R13)+,R0
20ext.w R0
21move R0,-(sp)
22jsr _putc
23addq.l #2,sp
24cmp #-1,R0
25bne L5
26*line 17
27move #-1,R0
28bra L1
29*line 18
30L5:L4:
31*line 19
32tst.b (R13)
33bne L3
34L2:
35*line 19
36move.l #18+_Cbuffs,(sp)
37move #10,-(sp)
38jsr _putc
39addq.l #2,sp
40bra L1
41L1:tst.l (sp)+
42movem.l (sp)+,R13-R13
43unlk R14
44rts
45.globl _aputc
46.text
47_aputc:
48~~aputc:
49~c=R7
50~ptr=R13
51link R14,#0
52movem.l R6-R7/R13-R13,-(sp)
53*line 27
54move 8(R14),R7
55*line 27
56move.l 10(R14),R13
57*line 27
58and #127,R7
59*line 29
60*line 30
61cmp #10,R7
62bne L7
63*line 30
64*line 31
65move.l R13,(sp)
66move #13,-(sp)
67jsr _putc
68addq.l #2,sp
69cmp #-1,R0
70bne L8
71*line 31
72move #-1,R0
73bra L6
74*line 32
75L8:L7:
76*line 33
77move.l R13,(sp)
78move R7,-(sp)
79jsr _putc
80addq.l #2,sp
81bra L6
82L6:tst.l (sp)+
83movem.l (sp)+,R7-R7/R13-R13
84unlk R14
85rts
86.globl _fputs
87.text
88_fputs:
89~~fputs:
90~s=R13
91~fp=12
92link R14,#0
93movem.l R7-R7/R13-R13,-(sp)
94*line 41
95move.l 8(R14),R13
96*line 41
97bra L12
98L11:
99*line 42
100*line 43
101move.l 12(R14),(sp)
102move.b (R13)+,R0
103ext.w R0
104move R0,-(sp)
105jsr _aputc
106addq.l #2,sp
107cmp #-1,R0
108bne L13
109*line 43
110move #-1,R0
111bra L9
112L13:L12:
113*line 44
114tst.b (R13)
115bne L11
116L10:
117*line 44
118clr R0
119bra L9
120L9:tst.l (sp)+
121movem.l (sp)+,R13-R13
122unlk R14
123rts
124.data
Note: See TracBrowser for help on using the repository browser.