source: buchla-68k/alcyon/conin.s@ ca867c1

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.4 KB
Line 
1.globl _errno
2.globl __ConBuf
3.comm __ConBuf,258
4.globl __CBused
5.comm __CBused,2
6.globl __conin
7.text
8__conin:
9~~_conin:
10~x=8
11~buff=10
12~len=14
13link R14,#-2
14movem.l R6-R7,-(sp)
15~nbp=-2
16~l=R7
17*line 29
18*line 29
19tst.b 1+__ConBuf
20bne L2
21*line 30
22*line 31
23move.b #255,__ConBuf
24*line 32
25clr R0
26move.b R0,2+__ConBuf
27move.b R0,1+__ConBuf
28*line 33
29*line 34
30move.l #__ConBuf,(sp)
31move #2,-(sp)
32jsr _readbuf
33addq.l #2,sp
34*line 35
35move.l #L3,(sp)
36move #2,-(sp)
37jsr _writeln
38addq.l #2,sp
39*line 36
40*line 37
41*line 37
42cmp.b #26,2+__ConBuf
43bne L4
44*line 38
45*line 39
46clr.b 1+__ConBuf
47*line 40
48clr R0
49bra L1
50*line 41
51*line 42
52L4:
53*line 43
54move.b 1+__ConBuf,R0
55ext.w R0
56add #1,R0
57move.b R0,1+__ConBuf
58move R0,-2(R14)
59*line 44
60move -2(R14),R8
61add.l #__ConBuf,R8
62move.b #13,1(R8)
63add #1,-2(R14)
64*line 45
65move.l #__ConBuf,R8
66move -2(R14),R9
67add.l R9,R8
68move.b #10,1(R8)
69*line 46
70move #2,__CBused
71*line 47
72*line 48
73L2:
74*line 49
75*line 50
76move.b 1+__ConBuf,R7
77ext.w R7
78move R7,R0
79cmp 14(R14),R0
80ble L5
81*line 50
82move 14(R14),R7
83*line 51
84L5:
85*line 52
86move R7,(sp)
87move.l #__ConBuf,R0
88move __CBused,R1
89ext.l R1
90add.l R1,R0
91move.l R0,-(sp)
92move.l 10(R14),-(sp)
93jsr _memcpy
94addq.l #8,sp
95*line 53
96add R7,__CBused
97*line 54
98move R7,R0
99move.b 1+__ConBuf,R1
100sub.b R0,R1
101move.b R1,1+__ConBuf
102*line 55
103move R7,R0
104bra L1
105L1:tst.l (sp)+
106movem.l (sp)+,R7-R7
107unlk R14
108rts
109.data
110L3:.dc.b $D,$A,$0
Note: See TracBrowser for help on using the repository browser.