source: buchla-68k/alcyon/addfpu.s@ 0170798

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

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1.globl _addfpu
2.text
3_addfpu:
4~~addfpu:
5~t=8
6~k=10
7link R14,#0
8movem.l R4-R7,-(sp)
9~x=R7
10~z=R6
11~y=R5
12*line 31
13move 8(R14),(sp)
14jsr _fromfpu
15move R0,R7
16*line 33
17*line 34
18cmp #32767,R7
19bne L2
20*line 34
21clr R0
22move 8(R14),R0
23bra L1
24*line 35
25L2:
26*line 36
27move 8(R14),R5
28*line 37
29move R7,R6
30add 10(R14),R6
31*line 39
32*line 40
33cmp #32767,R6
34blt L3
35*line 40
36move #32767,(sp)
37jsr _tofpu
38bra L1
39*line 41
40L3:
41*line 42
42bra L6
43L5:
44*line 43
45add #1,R7
46move R7,(sp)
47jsr _tofpu
48move R0,R5
49L6:
50*line 43
51cmp 8(R14),R5
52beq L5
53cmp R7,R6
54bgt L5
55L4:
56*line 45
57clr R0
58move R5,R0
59bra L1
60L1:tst.l (sp)+
61movem.l (sp)+,R5-R7
62unlk R14
63rts
64.globl _subfpu
65.text
66_subfpu:
67~~subfpu:
68~t=8
69~k=10
70link R14,#0
71movem.l R4-R7,-(sp)
72~x=R7
73~z=R6
74~y=R5
75*line 65
76move 8(R14),(sp)
77jsr _fromfpu
78move R0,R7
79*line 67
80*line 68
81cmp #1,R7
82bne L8
83*line 68
84clr R0
85move 8(R14),R0
86bra L7
87*line 69
88L8:
89*line 70
90move 8(R14),R5
91*line 71
92move R7,R6
93sub 10(R14),R6
94*line 73
95*line 74
96cmp #1,R6
97bgt L9
98*line 74
99move #1,(sp)
100jsr _tofpu
101bra L7
102*line 75
103L9:
104*line 76
105bra L12
106L11:
107*line 77
108sub #1,R7
109move R7,(sp)
110jsr _tofpu
111move R0,R5
112L12:
113*line 77
114cmp 8(R14),R5
115beq L11
116cmp R7,R6
117blt L11
118L10:
119*line 79
120clr R0
121move R5,R0
122bra L7
123L7:tst.l (sp)+
124movem.l (sp)+,R5-R7
125unlk R14
126rts
127.data
Note: See TracBrowser for help on using the repository browser.