Rev 8919 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8919 | IgorA | 1 | include "..\..\develop\info3ds\info_fun_float.inc" |
8824 | IgorA | 2 | |
3 | align 4 |
||
4 | proc @DoubleToStr$qduso uses esi edi |
||
8140 | IgorA | 5 | cld |
8824 | IgorA | 6 | lea esi,[esp+12] |
7 | mov edi,Data_Double |
||
8 | movsd |
||
9 | movsd |
||
10 | mov ax,[esp+20] |
||
11 | mov [NumberSymbolsAD],ax |
||
12 | call DoubleFloat_to_String |
||
13 | cmp dword[esp+24],0 |
||
14 | je @f |
||
15 | call String_crop_0 |
||
16 | @@: |
||
17 | mov eax,Data_String |
||
18 | ret |
||
19 | endp |
||
20 | |||
21 | align 4 |
||
22 | proc @StrToDouble$qpc uses esi edi |
||
23 | cld |
||
24 | mov edi,Data_String |
||
25 | mov esi,[esp+12] |
||
26 | mov ecx,32 |
||
27 | repnz movsb |
||
28 | call String_to_DoubleFloat |
||
29 | fld qword[Data_Double] |
||
30 | ret |
||
31 | endp |
||
32 | |||
33 | ;input: |
||
34 | ; *str - указатель на строку, число должно быть в 10 или 16 ричном виде |
||
35 | ;output: |
||
36 | ; eax - число |
||
37 | align 4 |
||
38 | proc @StrToInt$qpc uses ebx esi |
||
39 | xor eax,eax |
||
40 | xor ebx,ebx |
||
41 | mov esi,[esp+12] |
||
42 | |||
43 | ;на случай если перед числом находятся пробелы |
||
44 | @@: |
||
45 | cmp byte[esi],' ' |
||
46 | jne @f |
||
47 | inc esi |
||
48 | jmp @b |
||
49 | @@: |
||
50 | |||
51 | ;определение отрицательных чисел |
||
52 | xor ecx,ecx |
||
53 | inc ecx |
||
54 | cmp byte[esi],'-' |
||
55 | jne @f |
||
56 | dec ecx |
||
57 | inc esi |
||
58 | @@: |
||
59 | |||
60 | cmp word[esi],'0x' |
||
61 | je .load_digit_16 |
||
62 | |||
63 | .load_digit_10: ;считывание 10-тичных цифр |
||
64 | mov bl,byte[esi] |
||
65 | cmp bl,'0' |
||
66 | jl @f |
||
67 | cmp bl,'9' |
||
68 | jg @f |
||
69 | sub bl,'0' |
||
70 | imul eax,10 |
||
71 | add eax,ebx |
||
72 | inc esi |
||
73 | jmp .load_digit_10 |
||
74 | jmp @f |
||
75 | |||
76 | .load_digit_16: ;считывание 16-ричных цифр |
||
77 | add esi,2 |
||
78 | .cycle_16: |
||
79 | mov bl,byte[esi] |
||
80 | cmp bl,'0' |
||
81 | jl @f |
||
82 | cmp bl,'f' |
||
83 | jg @f |
||
84 | cmp bl,'9' |
||
85 | jle .us1 |
||
86 | cmp bl,'A' |
||
87 | jl @f ;отсеиваем символы >'9' и <'A' |
||
88 | .us1: ;составное условие |
||
89 | cmp bl,'F' |
||
90 | jle .us2 |
||
91 | cmp bl,'a' |
||
92 | jl @f ;отсеиваем символы >'F' и <'a' |
||
93 | sub bl,32 ;переводим символы в верхний регистр, для упрощения их последущей обработки |
||
94 | .us2: ;составное условие |
||
95 | sub bl,'0' |
||
96 | cmp bl,9 |
||
97 | jle .cor1 |
||
98 | sub bl,7 ;convert 'A' to '10' |
||
99 | .cor1: |
||
100 | shl eax,4 |
||
101 | add eax,ebx |
||
102 | inc esi |
||
103 | jmp .cycle_16 |
||
104 | @@: |
||
105 | or ecx,ecx ;если число отрицательное |
||
106 | jnz @f |
||
107 | sub ecx,eax |
||
108 | mov eax,ecx |
||
109 | @@: |
||
110 | ret |
||
111 | endp |
||
112 | |||
113 | align 4 |
||
114 | proc @strlen$qpxc uses edi |
||
115 | cld |
||
8140 | IgorA | 116 | mov edi,[esp+8] |
117 | mov ecx,-1 |
||
118 | xor al,al |
||
8824 | IgorA | 119 | repnz scasb |
8140 | IgorA | 120 | not ecx |
121 | lea eax,[ecx-1] |
||
122 | ret |
||
123 | endp |
||
124 | |||
8824 | IgorA | 125 | align 4 |
126 | proc @strcpy$qpcpxc uses esi edi |
||
8140 | IgorA | 127 | cld |
128 | mov edi,[esp+16] |
||
129 | mov ecx,-1 |
||
130 | mov esi,edi |
||
131 | xor al,al |
||
8824 | IgorA | 132 | repnz scasb |
8140 | IgorA | 133 | not ecx |
134 | mov edi,[esp+12] |
||
135 | mov edx,ecx |
||
136 | mov eax,edi |
||
137 | shr ecx,2 |
||
8824 | IgorA | 138 | rep movsd |
8140 | IgorA | 139 | mov ecx,edx |
140 | and ecx,3 |
||
8824 | IgorA | 141 | rep movsb |
8140 | IgorA | 142 | ret |
143 | endp |
||
144 | |||
8824 | IgorA | 145 | align 4 |
9485 | IgorA | 146 | proc @strncpy$qpcpxcl uses esi edi |
147 | cld |
||
148 | mov edi,[esp+16] |
||
149 | mov ecx,[esp+20] |
||
150 | jecxz @f |
||
151 | mov esi,edi |
||
152 | xor al,al |
||
153 | repnz scasb |
||
154 | not ecx |
||
155 | mov edi,[esp+12] |
||
156 | mov edx,ecx |
||
157 | mov eax,edi |
||
158 | shr ecx,2 |
||
159 | rep movsd |
||
160 | mov ecx,edx |
||
161 | and ecx,3 |
||
162 | rep movsb |
||
163 | @@: |
||
164 | ret |
||
165 | endp |
||
166 | |||
167 | align 4 |
||
168 | proc @memcmp$qpxvt1l uses esi edi |
||
169 | cld |
||
170 | mov ecx,[esp+20] |
||
171 | mov edi,[esp+16] |
||
172 | mov esi,[esp+12] |
||
173 | repe cmpsb |
||
174 | movzx eax,byte[esi-1] |
||
175 | movzx edx,byte[edi-1] |
||
176 | sub eax,edx |
||
177 | ret |
||
178 | endp |
||
179 | |||
180 | align 4 |
||
8824 | IgorA | 181 | proc @memcpy$qpvpxvui uses esi edi |
8140 | IgorA | 182 | cld |
183 | mov edi,[esp+12] |
||
184 | mov eax,edi |
||
185 | mov ecx,[esp+20] |
||
186 | mov esi,[esp+16] |
||
187 | mov edx,ecx |
||
188 | shr ecx,2 |
||
8824 | IgorA | 189 | rep movsd |
8140 | IgorA | 190 | mov ecx,edx |
191 | and ecx,3 |
||
8824 | IgorA | 192 | rep movsb |
8140 | IgorA | 193 | ret |
194 | endp |
||
195 | |||
8824 | IgorA | 196 | align 4 |
197 | proc @memset$qpvcui uses edi |
||
8140 | IgorA | 198 | cld |
199 | mov edi,[esp+8] |
||
200 | mov al,[esp+12] |
||
201 | mov ah,al |
||
202 | mov dx,ax |
||
203 | shl eax,16 |
||
204 | mov ax,dx |
||
205 | mov ecx,[esp+16] |
||
206 | mov edx,ecx |
||
207 | shr ecx,2 |
||
8824 | IgorA | 208 | rep stosd |
8140 | IgorA | 209 | mov ecx,edx |
210 | and ecx,3 |
||
8824 | IgorA | 211 | rep stosb |
8140 | IgorA | 212 | mov eax,[esp+4] |
213 | ret |
||
214 | endp |
||
215 | |||
8824 | IgorA | 216 | align 4 |
217 | proc @strcmp$qpxct1 uses esi edi |
||
218 | cld |
||
219 | xor eax,eax |
||
220 | mov edi,[esp+16] |
||
221 | mov esi,edi |
||
222 | mov ecx,-1 |
||
223 | repne scasb |
||
224 | not ecx |
||
225 | mov edi,esi |
||
226 | mov esi,[esp+12] |
||
227 | repe cmpsb |
||
228 | mov al,[esi-1] |
||
229 | movzx edx,byte[edi-1] |
||
230 | sub eax,edx |
||
231 | ret |
||
232 | endp |
||
233 | |||
234 | align 4 |
||
235 | proc @strchr$qpxci uses edi |
||
236 | mov edi,[esp+8] |
||
237 | mov edx,edi |
||
238 | mov ecx,-1 |
||
239 | xor eax,eax |
||
240 | cld |
||
241 | repne scasb |
||
242 | not ecx |
||
243 | mov edi,edx |
||
244 | mov al,[esp+12] |
||
245 | repne scasb |
||
246 | jnz @f |
||
247 | lea eax,[edi-1] |
||
248 | ret |
||
249 | @@: |
||
250 | xor eax,eax |
||
251 | ret |
||
252 | endp |
||
253 | |||
254 | align 4 |
||
255 | proc @strstr$qpxct1 uses ebx esi edi |
||
256 | xor eax,eax |
||
257 | mov esi,[esp+16] |
||
258 | test esi,esi |
||
259 | je .not_f |
||
260 | mov edi,[esp+20] |
||
261 | test edi,edi |
||
262 | je .not_f |
||
263 | mov edx,edi |
||
264 | mov ecx,-1 |
||
265 | cld |
||
266 | repne scasb |
||
267 | not ecx |
||
268 | mov ebx,ecx ;ebx = strlen(str2) |
||
269 | align 4 |
||
270 | .cycle: |
||
271 | cmp byte[esi],0 |
||
272 | je .not_f |
||
273 | mov edi,edx |
||
274 | push esi |
||
275 | mov ecx,ebx |
||
276 | repe cmpsb |
||
277 | pop esi |
||
278 | inc esi |
||
279 | cmp byte[edi-1],0 |
||
9485 | IgorA | 280 | jne .cycle |
8824 | IgorA | 281 | |
282 | lea eax,[esi-1] |
||
283 | .not_f: |
||
9485 | IgorA | 284 | ret |
8824 | IgorA | 285 | endp |
286 | |||
287 | align 4 |
||
8140 | IgorA | 288 | proc __ftol |
289 | sub esp,12 |
||
290 | wait |
||
291 | fstcw word [esp+8] |
||
292 | wait |
||
293 | mov al,[esp+9] |
||
8824 | IgorA | 294 | or byte [esp+9],0x0c |
8140 | IgorA | 295 | fldcw word [esp+8] |
296 | fistp qword [esp] |
||
297 | mov [esp+9],al |
||
298 | fldcw word [esp+8] |
||
299 | mov eax,[esp] |
||
300 | mov edx,[esp+4] |
||
301 | add esp,12 |
||
302 | ret |
||
303 | endp |
||
304 | |||
8824 | IgorA | 305 | align 4 |
306 | proc @floor$qd |
||
8140 | IgorA | 307 | fld qword [esp+4] |
308 | mov ax,[esp+10] |
||
309 | shl ax,1 |
||
310 | cmp ax,0x8680 |
||
8824 | IgorA | 311 | ja .floor_end |
8140 | IgorA | 312 | mov ch,4 |
313 | sub esp,2 |
||
314 | wait |
||
315 | fstcw word [esp] |
||
316 | mov ax,0xf3ff |
||
317 | wait |
||
318 | mov dx,[esp] |
||
319 | and ax,dx |
||
8824 | IgorA | 320 | or ah,ch |
8140 | IgorA | 321 | mov [esp],ax |
322 | fldcw word [esp] |
||
323 | frndint |
||
324 | mov [esp],dx |
||
325 | fldcw word [esp] |
||
326 | add esp,2 |
||
327 | .floor_end: |
||
328 | ret |
||
329 | endp |
||
8919 | IgorA | 330 | |
331 | align 4 |
||
332 | proc @MessageBox$qpc |
||
333 | mov eax,[esp+4] |
||
334 | notify_window_run eax |
||
335 | ret |
||
336 | endp'a' |