source: buchla-68k/alcyon/lseek.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: 2.3 KB
Line 
1.globl _chantab
2.globl _Wrkbuf
3.globl _errno
4.globl _lseek
5.text
6_lseek:
7~~lseek:
8~pos=R7
9~fd=8
10~how=14
11link R14,#0
12movem.l R6-R7/R13-R13,-(sp)
13~fp=R13
14*line 29
15move.l 10(R14),R7
16*line 29
17*line 29
18tst 8(R14)
19blt L10000
20cmp #11,8(R14)
21ble L2
22L10000:*line 30
23*line 34
24*line 35
25*line 36
26move #9,_errno
27*line 37
28move.l #$ffffffff,R0
29bra L1
30*line 38
31*line 39
32L2:
33*line 40
34*line 40
35move 8(R14),R0
36muls #12,R0
37add.l #_chantab,R0
38move.l R0,R8
39tst.b 3(R8)
40bne L3
41*line 41
42*line 45
43*line 46
44*line 47
45move #22,_errno
46*line 48
47move.l #$ffffffff,R0
48bra L1
49*line 49
50*line 50
51L3:
52*line 51
53move 8(R14),R0
54muls #12,R0
55add.l #_chantab,R0
56move.l R0,R8
57move.l 8(R8),R13
58*line 53
59move 14(R14),R0
60bra L5
61*line 54
62L6:
63*line 55
64*line 56
65add.l 48(R13),R7
66bra L4
67*line 57
68*line 58
69L7:
70*line 59
71*line 60
72clr.l R0
73move 38(R13),R0
74move.l 40(R13),R1
75move.l #$9,R2
76asl.l R2,R1
77add.l R1,R0
78add.l R0,R7
79*line 61
80L8:
81*line 62
82bra L4
83*line 63
84*line 64
85L9:
86*line 65
87*line 66
88move #22,_errno
89*line 67
90move.l #$ffffffff,R0
91bra L1
92bra L4
93L5:tst R0
94beq L8
95cmp #1,R0
96beq L7
97cmp #2,R0
98beq L6
99bra L9
100L4:
101*line 71
102*line 71
103tst.l R7
104bge L10
105*line 72
106*line 73
107clr 38(R13)
108*line 74
109clr.l 40(R13)
110*line 75
111or #8192,32(R13)
112*line 76
113*line 80
114*line 81
115*line 82
116move #22,_errno
117*line 83
118move.l #$ffffffff,R0
119bra L1
120*line 84
121bra L11
122L10:
123*line 85
124*line 85
125cmp.l 48(R13),R7
126ble L12
127*line 86
128*line 87
129move.l 48(R13),R0
130and.l #$1ff,R0
131move R0,38(R13)
132*line 88
133move.l 48(R13),R0
134move.l #$9,R1
135asr.l R1,R0
136move.l R0,40(R13)
137*line 89
138or #8192,32(R13)
139*line 90
140*line 95
141*line 96
142*line 97
143move #22,_errno
144*line 98
145move.l #$ffffffff,R0
146bra L1
147*line 99
148*line 100
149L12:L11:
150*line 101
151move.l R7,R0
152and.l #$1ff,R0
153move R0,38(R13)
154*line 102
155move.l R7,R0
156move.l #$9,R1
157asr.l R1,R0
158move.l R0,40(R13)
159*line 104
160*line 104
161move.l R13,(sp)
162jsr __seek
163tst R0
164bge L13
165*line 105
166*line 106
167or #8192,32(R13)
168*line 107
169move #5,_errno
170*line 108
171move.l #$ffffffff,R0
172bra L1
173*line 109
174*line 110
175L13:
176*line 111
177*line 112
178cmp.l 48(R13),R7
179bne L14
180*line 112
181or #-32768,32(R13)
182*line 113
183*line 118
184*line 119
185L14:
186*line 120
187move.l R7,R0
188bra L1
189L1:tst.l (sp)+
190movem.l (sp)+,R7-R7/R13-R13
191unlk R14
192rts
193.data
Note: See TracBrowser for help on using the repository browser.