source: buchla-68k/alcyon/fseek.s@ c3aee8a

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

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1.globl _Cbuffs
2.globl _Stdbufs
3.globl _Stdbuf
4.globl _chantab
5.globl _Wrkbuf
6.globl _fseek
7.text
8_fseek:
9~~fseek:
10~fp=R13
11~pos=12
12~mode=16
13link R14,#-4
14movem.l R5-R7/R13-R13,-(sp)
15~i=R7
16~lr=R6
17~curpos=-4
18*line 27
19move.l 8(R14),R13
20*line 27
21*line 27
22btst #2,12(R13)
23beq L2
24*line 28
25*line 29
26*line 30
27move #-1,(sp)
28move.l R13,-(sp)
29jsr _flush_
30addq.l #4,sp
31tst R0
32beq L3
33*line 30
34move #-1,R0
35bra L1
36*line 31
37L3:bra L4
38L2:
39*line 32
40*line 33
41*line 34
42*line 35
43cmp #1,16(R14)
44bne L5
45tst.l (R13)
46beq L5
47*line 35
48move.l 4(R13),R0
49sub.l (R13),R0
50sub.l R0,12(R14)
51L5:L4:
52*line 38
53clr R0
54ext.l R0
55move.l R0,4(R13)
56move.l R0,(R13)
57*line 39
58and.b #-9,12(R13)
59*line 41
60move 16(R14),(sp)
61move.l 12(R14),-(sp)
62move.b 13(R13),R0
63ext.w R0
64move R0,-(sp)
65jsr _lseek
66addq.l #6,sp
67move R0,R6
68*line 43
69*line 44
70move.b 13(R13),R0
71ext.w R0
72muls #12,R0
73move.l R0,R8
74move.l #_chantab,R9
75move.l 8(R8,R9.l),R8
76clr R0
77move 32(R8),R0
78and #-32768,R0
79beq L6
80*line 44
81or.b #8,12(R13)
82*line 45
83L6:
84*line 46
85*line 47
86tst R6
87bge L7
88*line 47
89move #-1,R0
90bra L1
91*line 48
92L7:
93*line 49
94clr R0
95bra L1
96L1:tst.l (sp)+
97movem.l (sp)+,R6-R7/R13-R13
98unlk R14
99rts
100.data
Note: See TracBrowser for help on using the repository browser.