source: buchla-68k/alcyon/fscanf.s@ 4810254

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