2824
|
1 * Disassembly by Os9disasm of qsort.r
|
|
2
|
|
3 psect qsort_c,$0,$0,1,0,qsort
|
|
4
|
|
5 vsect
|
|
6
|
|
7 * Uninitialized data (class B)
|
|
8 B0000 rmb 2
|
|
9 B0002 rmb 2
|
|
10 * Initialized Data (class G)
|
|
11
|
|
12 ends
|
|
13
|
|
14
|
|
15 qsort: pshs u
|
|
16 ldd #$ffb8
|
|
17 lbsr _stkcheck
|
|
18 ldd 8,s
|
|
19 std B0000,y
|
|
20 ldd 10,s
|
|
21 std B0002,y
|
|
22 ldd 6,s
|
|
23 addd #-1
|
|
24 pshs d
|
|
25 ldd B0000,y
|
|
26 lbsr ccmult
|
|
27 addd 4,s
|
|
28 pshs d
|
|
29 ldd 6,s
|
|
30 pshs d
|
|
31 bsr L002f
|
|
32 lbra L010a
|
|
33 L002f pshs u
|
|
34 ldd #$ffb4
|
|
35 lbsr _stkcheck
|
|
36 leas -4,s
|
|
37 lbra L0101
|
|
38 L003c ldu 8,s
|
|
39 ldd 10,s
|
|
40 std 2,s
|
|
41 ldd 10,s
|
|
42 subd 8,s
|
|
43 pshs d
|
|
44 ldd B0000,y
|
|
45 lslb
|
|
46 rola
|
|
47 lbsr ccdiv
|
|
48 pshs d
|
|
49 ldd B0000,y
|
|
50 lbsr ccmult
|
|
51 addd 8,s
|
|
52 std ,s
|
|
53 bra L0066
|
|
54 L0060 ldd B0000,y
|
|
55 leau d,u
|
|
56 L0066 ldd ,s
|
|
57 pshs d
|
|
58 pshs u
|
|
59 jsr [B0002,y]
|
|
60 leas 4,s
|
|
61 std -2,s
|
|
62 blt L0060
|
|
63 bra L0080
|
|
64 L0078 ldd 2,s
|
|
65 subd B0000,y
|
|
66 std 2,s
|
|
67 L0080 ldd 2,s
|
|
68 pshs d
|
|
69 ldd 2,s
|
|
70 pshs d
|
|
71 jsr [B0002,y]
|
|
72 leas 4,s
|
|
73 std -2,s
|
|
74 blt L0078
|
|
75 cmpu 2,s
|
|
76 bhi L00c9
|
|
77 cmpu 2,s
|
|
78 bcc L00bb
|
|
79 ldd 2,s
|
|
80 pshs d
|
|
81 pshs u
|
|
82 lbsr L010e
|
|
83 leas 4,s
|
|
84 cmpu ,s
|
|
85 bne L00b2
|
|
86 ldd 2,s
|
|
87 std ,s
|
|
88 bra L00bb
|
|
89 L00b2 ldd ,s
|
|
90 cmpd 2,s
|
|
91 bne L00bb
|
|
92 stu ,s
|
|
93 L00bb ldd B0000,y
|
|
94 leau d,u
|
|
95 ldd 2,s
|
|
96 subd B0000,y
|
|
97 std 2,s
|
|
98 L00c9 cmpu 2,s
|
|
99 lbls L0066
|
|
100 ldd 2,s
|
|
101 subd 8,s
|
|
102 pshs d
|
|
103 pshs u
|
|
104 ldd 14,s
|
|
105 subd ,s++
|
|
106 cmpd ,s++
|
|
107 bge L00f2
|
|
108 ldd 10,s
|
|
109 pshs d
|
|
110 pshs u
|
|
111 lbsr L002f
|
|
112 leas 4,s
|
|
113 ldd 2,s
|
|
114 std 10,s
|
|
115 bra L0101
|
|
116 L00f2 ldd 2,s
|
|
117 pshs d
|
|
118 ldd 10,s
|
|
119 pshs d
|
|
120 lbsr L002f
|
|
121 leas 4,s
|
|
122 stu 8,s
|
|
123 L0101 ldd 8,s
|
|
124 cmpd 10,s
|
|
125 lblo L003c
|
|
126 L010a leas 4,s
|
|
127 puls u,pc
|
|
128 L010e pshs u
|
|
129 ldd #$ffbd
|
|
130 lbsr _stkcheck
|
|
131 ldu 4,s
|
|
132 leas -3,s
|
|
133 ldd B0000,y
|
|
134 std 1,s
|
|
135 bra L0135
|
|
136 L0122 ldb ,u
|
|
137 stb ,s
|
|
138 ldb [9,s]
|
|
139 stb ,u+
|
|
140 ldb ,s
|
|
141 ldx 9,s
|
|
142 leax 1,x
|
|
143 stx 9,s
|
|
144 stb -1,x
|
|
145 L0135 ldd 1,s
|
|
146 addd #-1
|
|
147 std 1,s
|
|
148 subd #-1
|
|
149 bne L0122
|
|
150 leas 3,s
|
|
151 puls u,pc
|
|
152
|
|
153 ends
|
|
154
|