Last change
on this file since ca867c1 was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Added Alcyon C reference output.
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | .globl _Cbuffs
|
---|
2 | .globl _Stdbufs
|
---|
3 | .globl _Stdbuf
|
---|
4 | .bss
|
---|
5 | L1:.ds.b 2
|
---|
6 | .text
|
---|
7 | .bss
|
---|
8 | L2:.ds.b 4
|
---|
9 | .text
|
---|
10 | .text
|
---|
11 | _gchar:
|
---|
12 | ~~gchar:
|
---|
13 | ~what=8
|
---|
14 | link R14,#-4
|
---|
15 | *line 18
|
---|
16 | *line 18
|
---|
17 | tst 8(R14)
|
---|
18 | bne L5
|
---|
19 | *line 19
|
---|
20 | *line 20
|
---|
21 | *line 21
|
---|
22 | move.l L2,R8
|
---|
23 | btst #3,12(R8)
|
---|
24 | beq L6
|
---|
25 | *line 21
|
---|
26 | move #-1,L1
|
---|
27 | *line 22
|
---|
28 | bra L7
|
---|
29 | L6:
|
---|
30 | *line 23
|
---|
31 | move.l L2,(sp)
|
---|
32 | jsr _agetc
|
---|
33 | move R0,L1
|
---|
34 | L7:
|
---|
35 | *line 24
|
---|
36 | bra L8
|
---|
37 | L5:
|
---|
38 | *line 25
|
---|
39 | move.l L2,(sp)
|
---|
40 | move L1,-(sp)
|
---|
41 | jsr _ungetc
|
---|
42 | addq.l #2,sp
|
---|
43 | move R0,L1
|
---|
44 | L8:
|
---|
45 | *line 27
|
---|
46 | move L1,R0
|
---|
47 | bra L4
|
---|
48 | L4:unlk R14
|
---|
49 | rts
|
---|
50 | .globl _scanf
|
---|
51 | .text
|
---|
52 | _scanf:
|
---|
53 | ~~scanf:
|
---|
54 | ~fmt=8
|
---|
55 | ~args=12
|
---|
56 | link R14,#-4
|
---|
57 | *line 35
|
---|
58 | move.l #_Cbuffs,L2
|
---|
59 | *line 36
|
---|
60 | clr L1
|
---|
61 | *line 37
|
---|
62 | move.l R14,(sp)
|
---|
63 | add.l #12,(sp)
|
---|
64 | move.l 8(R14),-(sp)
|
---|
65 | move.l #_gchar,-(sp)
|
---|
66 | jsr _scanfmt
|
---|
67 | addq.l #8,sp
|
---|
68 | bra L9
|
---|
69 | L9:unlk R14
|
---|
70 | rts
|
---|
71 | .globl _fscanf
|
---|
72 | .text
|
---|
73 | _fscanf:
|
---|
74 | ~~fscanf:
|
---|
75 | ~fp=8
|
---|
76 | ~fmt=12
|
---|
77 | ~args=16
|
---|
78 | link R14,#-4
|
---|
79 | *line 46
|
---|
80 | move.l 8(R14),L2
|
---|
81 | *line 47
|
---|
82 | clr L1
|
---|
83 | *line 48
|
---|
84 | move.l R14,(sp)
|
---|
85 | add.l #16,(sp)
|
---|
86 | move.l 12(R14),-(sp)
|
---|
87 | move.l #_gchar,-(sp)
|
---|
88 | jsr _scanfmt
|
---|
89 | addq.l #8,sp
|
---|
90 | bra L10
|
---|
91 | L10:unlk R14
|
---|
92 | rts
|
---|
93 | .data
|
---|
Note:
See
TracBrowser
for help on using the repository browser.