Subversion Repositories Kolibri OS

Rev

Rev 4888 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4888 Rev 4890
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;; Working with program symbols ;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;; Working with program symbols ;;;;;;;;;;;;;;;;;;;;;;;;
3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4
 
4
 
5
include 'sort.inc'
5
include 'sort.inc'
6
 
6
 
7
; compare proc for sorter
7
; compare proc for sorter
8
compare:
8
compare:
9
        cmpsd
9
        cmpsd
10
        jnz     @f
10
        jnz     @f
11
        cmp     esi, edi
11
        cmp     esi, edi
12
 
12
 
13
  @@:
13
  @@:
14
        ret
14
        ret
15
 
15
 
16
; compare proc for sorter 2
16
; compare proc for sorter 2
17
compare2:
17
compare2:
18
        cmpsd
18
        cmpsd
19
 
19
 
20
  @@:
20
  @@:
21
        cmpsb
21
        cmpsb
22
        jnz     @f
22
        jnz     @f
23
        cmp     byte [esi-1], 0
23
        cmp     byte [esi-1], 0
24
        jnz     @b
24
        jnz     @b
25
        cmp     esi, edi
25
        cmp     esi, edi
26
 
26
 
27
  @@:
27
  @@:
28
        ret
28
        ret
29
 
29
 
30
free_symbols:
30
free_symbols:
31
        mov     ecx, [symbols]
31
        mov     ecx, [symbols]
32
        jecxz   @f
32
        jecxz   @f
33
        mcall   68, 13
33
        mcall   68, 13
34
        and     [symbols], 0
34
        and     [symbols], 0
35
        and     [num_symbols], 0
35
        and     [num_symbols], 0
36
 
36
 
37
  @@:
37
  @@:
38
        ret
38
        ret
39
 
39
 
40
 
40
 
41
;-----------------------------------------------------------------------------
41
;-----------------------------------------------------------------------------
42
;                        Load symbols event
42
;                        Load symbols event
43
 
43
 
44
OnLoadSymbols.fileerr:
44
OnLoadSymbols.fileerr:
45
        test    ebp, ebp
45
        test    ebp, ebp
46
        jz      @f
46
        jz      @f
47
        mcall   68, 13, edi
47
        mcall   68, 13, edi
48
        ret
48
        ret
49
 
49
 
50
  @@:
50
  @@:
51
        push    eax
51
        push    eax
52
        mcall   68, 13, edi
52
        mcall   68, 13, edi
53
        mov     esi, aCannotLoadFile
53
        mov     esi, aCannotLoadFile
54
        call    put_message_nodraw
54
        call    put_message_nodraw
55
        pop     eax
55
        pop     eax
56
        cmp     eax, 0x20
56
        cmp     eax, 0x20
57
        jae     .unk
57
        jae     .unk
58
        mov     esi, [load_err_msgs + eax*4]
58
        mov     esi, [load_err_msgs + eax*4]
59
        test    esi, esi
59
        test    esi, esi
60
        jnz     put_message
60
        jnz     put_message
61
 
61
 
62
  .unk:
62
  .unk:
63
        mov     esi, unk_err_msg2
63
        mov     esi, unk_err_msg2
64
        jmp     put_message
64
        jmp     put_message
65
 
65
 
66
 
66
 
67
OnLoadSymbols:
67
OnLoadSymbols:
68
        xor     ebp, ebp
68
        xor     ebp, ebp
69
; load input file
69
; load input file
70
        mov     esi, [curarg]
70
        mov     esi, [curarg]
71
        call    free_symbols
71
        call    free_symbols
72
 
72
 
73
  .silent:
73
  .silent:
74
; esi = ptr to symbols filename
74
; esi = ptr to symbols filename
75
        xor     edi, edi
75
        xor     edi, edi
76
        cmp     [num_symbols], edi              ; Any previously loaded symbols?
76
        cmp     [num_symbols], edi              ; Any previously loaded symbols?
77
        je      .loadfile
77
        je      .loadfile
78
        call    free_symbols                    ; Yep, free them
78
        call    free_symbols                    ; Yep, free them
79
 
79
 
80
  .loadfile:
80
  .loadfile:
81
        mov     ebx, fn70_attr_block            ; Get file attributes
81
        mov     ebx, fn70_attr_block            ; Get file attributes
82
        mov     [ebx+21], esi
82
        mov     [ebx+21], esi
83
        mcall   70
83
        mcall   70
84
        test    eax, eax
84
        test    eax, eax
85
        jnz     .fileerr
85
        jnz     .fileerr
86
        cmp     dword [fileattr+36], edi        ; Is upper dword of filesize larger then 0?
86
        cmp     dword [fileattr+36], edi        ; Is upper dword of filesize larger then 0?
87
        jnz     .memerr
87
        jnz     .memerr
88
        mov     ecx, dword [fileattr+32]        ; Lower dword of filesize
88
        mov     ecx, dword [fileattr+32]        ; Lower dword of filesize
89
        mcall   68, 12                          ; allocate the memory
89
        mcall   68, 12                          ; allocate the memory
90
        test    eax, eax
90
        test    eax, eax
91
        jz      .memerr
91
        jz      .memerr
92
        mov     edi, eax
92
        mov     edi, eax
93
        mov     ebx, fn70_read_block
93
        mov     ebx, fn70_read_block
94
        mov     [ebx+12], ecx
94
        mov     [ebx+12], ecx
95
        mov     [ebx+16], edi
95
        mov     [ebx+16], edi
96
        mov     [ebx+21], esi
96
        mov     [ebx+21], esi
97
        mcall   70                              ; Read the file into the allocated buffer
97
        mcall   70                              ; Read the file into the allocated buffer
98
        test    eax, eax
98
        test    eax, eax
99
        jnz     .fileerr
99
        jnz     .fileerr
100
 
100
 
101
 
101
 
102
; calculate memory requirements to load debug symbols
102
; calculate memory requirements to load debug symbols
103
 
103
 
104
        lea     edx, [ecx+edi-1]                ; edx = EOF-1
104
        lea     edx, [ecx+edi-1]                ; edx = EOF-1
105
        mov     esi, edi
105
        mov     esi, edi
106
        xor     ecx, ecx
106
        xor     ecx, ecx
107
 
107
 
108
        mov     [symbol_section], 1    ;;;;;
108
        mov     [symbol_section], 1    ;;;;;
109
 
109
 
110
  .calcloop:
110
  .calcloop:
111
        cmp     esi, edx
111
        cmp     esi, edx
112
        jae     .calcdone
112
        jae     .calcdone
113
        cmp     byte[esi], ' '          ; skip spaces at the beginning of a line
113
        cmp     byte[esi], ' '          ; skip spaces at the beginning of a line
114
        jne     .not_space
114
        jne     .not_space
115
        inc     esi
115
        inc     esi
116
        jmp     .calcloop
116
        jmp     .calcloop
117
  .not_space:
117
  .not_space:
118
        cmp     byte[esi], '.'
118
        cmp     byte[esi], '.'
119
        jne     .not_section
119
        jne     .not_section
120
        inc     esi
120
        inc     esi
121
        mov     [symbol_section], 0
121
        mov     [symbol_section], 0
122
        cmp     dword[esi], 'text'
122
        cmp     dword[esi], 'text'
123
        je      .section_ok
123
        je      .section_ok
124
        cmp     dword[esi], 'data'
124
        cmp     dword[esi], 'data'
125
        je      .section_ok
125
        je      .section_ok
126
        cmp     dword[esi], 'bss '
126
        cmp     dword[esi], 'bss '
127
        jne     .skipline
127
        jne     .skipline
128
  .section_ok:
128
  .section_ok:
129
        inc     [symbol_section]
129
        inc     [symbol_section]
130
        jmp     .skipline
130
        jmp     .skipline
131
  .not_section:
131
  .not_section:
132
        cmp     [symbol_section], 0
132
        cmp     [symbol_section], 0
133
        je      .skipline
133
        je      .skipline
134
 
134
 
135
        cmp     word[esi], '0x'
135
        cmp     word[esi], '0x'
136
        jne     .skipline
136
        jne     .skipline
137
        inc     esi
137
        inc     esi
138
        inc     esi
138
        inc     esi
139
 
139
 
140
  @@:
140
  @@:
141
        cmp     esi, edx
141
        cmp     esi, edx
142
        jae     .calcdone
142
        jae     .calcdone
143
        lodsb
143
        lodsb
144
        or      al, 20h
144
        or      al, 20h
145
        sub     al, '0'
145
        sub     al, '0'
146
        cmp     al, 9
146
        cmp     al, 9
147
        jbe     @b
147
        jbe     @b
148
        sub     al, 'a'-'0'-10
148
        sub     al, 'a'-'0'-10
149
        cmp     al, 15
149
        cmp     al, 15
150
        jbe     @b
150
        jbe     @b
151
        dec     esi
151
        dec     esi
152
 
152
 
153
  @@:
153
  @@:
154
        cmp     esi, edx
154
        cmp     esi, edx
155
        ja      .calcdone
155
        ja      .calcdone
156
        lodsb
156
        lodsb
157
        cmp     al, 20h
157
        cmp     al, 20h
158
        je      @b
158
        je      @b
159
        jb      .calcloop
159
        jb      .calcloop
160
        cmp     al, 9
160
        cmp     al, 9
161
        jz      @b
161
        jz      @b
162
        add     ecx, 12+1
162
        add     ecx, 12+1
163
        inc     [num_symbols]
163
        inc     [num_symbols]
164
 
164
 
165
  @@:
165
  @@:
166
        inc     ecx
166
        inc     ecx
167
        cmp     esi, edx
167
        cmp     esi, edx
168
        ja      .calcdone
168
        ja      .calcdone
169
        lodsb
169
        lodsb
170
        cmp     al, 0xD
170
        cmp     al, 0xD
171
        jz      .calcloop
171
        jz      .calcloop
172
        cmp     al, 0xA
172
        cmp     al, 0xA
173
        jz      .calcloop
173
        jz      .calcloop
174
        jmp     @b
174
        jmp     @b
175
 
175
 
176
  .skipline:
176
  .skipline:
177
        cmp     esi, edx
177
        cmp     esi, edx
178
        jae     .calcdone
178
        jae     .calcdone
179
        lodsb
179
        lodsb
180
        cmp     al, 0xD
180
        cmp     al, 0xD
181
        jz      .calcloop
181
        jz      .calcloop
182
        cmp     al, 0xA
182
        cmp     al, 0xA
183
        jz      .calcloop
183
        jz      .calcloop
184
        jmp     .skipline
184
        jmp     .skipline
185
 
185
 
186
  .calcdone:
186
  .calcdone:
187
 
187
 
188
; Allocate memory to place the debug symbols in
188
; Allocate memory to place the debug symbols in
189
 
189
 
190
        mcall   68, 12
190
        mcall   68, 12
191
        test    eax, eax
191
        test    eax, eax
192
        jnz     .memok
192
        jnz     .memok
193
        inc     ebx
193
        inc     ebx
194
        mov     ecx, edi
194
        mov     ecx, edi
195
        mov     al, 68
195
        mov     al, 68
196
        mcall
196
        mcall
197
 
197
 
198
  .memerr:
198
  .memerr:
199
        mov     esi, aNoMemory
199
        mov     esi, aNoMemory
200
        jmp     put_message
200
        jmp     put_message
201
 
201
 
202
  .memok:
202
  .memok:
203
        mov     [symbols], eax
203
        mov     [symbols], eax
204
        mov     ebx, eax
204
        mov     ebx, eax
205
        push    edi
205
        push    edi
206
        mov     esi, edi
206
        mov     esi, edi
207
        mov     edi, [num_symbols]
207
        mov     edi, [num_symbols]
208
        lea     ebp, [eax+edi*4]
208
        lea     ebp, [eax+edi*4]
209
        lea     edi, [eax+edi*8]
209
        lea     edi, [eax+edi*8]
210
 
210
 
211
; Actual loading of the debug symbols
211
; Actual loading of the debug symbols
212
; esi->input, edx->EOF, ebx->ptrs, edi->names
212
; esi->input, edx->EOF, ebx->ptrs, edi->names
213
 
213
 
214
        mov     [symbol_section], 1    ;;;;;
214
        mov     [symbol_section], 1    ;;;;;
215
 
215
 
216
  .readloop:
216
  .readloop:
217
        cmp     esi, edx
217
        cmp     esi, edx
218
        jae     .readdone
218
        jae     .readdone
219
        cmp     byte[esi], ' '
219
        cmp     byte[esi], ' '
220
        jne     .not_space2
220
        jne     .not_space2
221
        inc     esi
221
        inc     esi
222
        jmp     .readloop
222
        jmp     .readloop
223
  .not_space2:
223
  .not_space2:
224
        cmp     byte[esi], '.'
224
        cmp     byte[esi], '.'
225
        jne     .not_section2
225
        jne     .not_section2
226
        inc     esi
226
        inc     esi
227
        mov     [symbol_section], 0
227
        mov     [symbol_section], 0
228
        cmp     dword[esi], 'text'
228
        cmp     dword[esi], 'text'
229
        je      .section_ok2
229
        je      .section_ok2
230
        cmp     dword[esi], 'data'
230
        cmp     dword[esi], 'data'
231
        je      .section_ok2
231
        je      .section_ok2
232
        cmp     dword[esi], 'bss '
232
        cmp     dword[esi], 'bss '
233
        jne     .readline
233
        jne     .readline
234
  .section_ok2:
234
  .section_ok2:
235
        inc     [symbol_section]
235
        inc     [symbol_section]
236
        jmp     .readline
236
        jmp     .readline
237
  .not_section2:
237
  .not_section2:
238
        cmp     [symbol_section], 0
238
        cmp     [symbol_section], 0
239
        je      .readline
239
        je      .readline
240
 
240
 
241
        cmp     word[esi], '0x'
241
        cmp     word[esi], '0x'
242
        jnz     .readline
242
        jnz     .readline
243
        inc     esi
243
        inc     esi
244
        inc     esi
244
        inc     esi
245
        xor     eax, eax
245
        xor     eax, eax
246
        xor     ecx, ecx
246
        xor     ecx, ecx
247
 
247
 
248
  @@:
248
  @@:
249
        shl     ecx, 4
249
        shl     ecx, 4
250
        add     ecx, eax
250
        add     ecx, eax
251
        cmp     esi, edx
251
        cmp     esi, edx
252
        jae     .readdone
252
        jae     .readdone
253
        lodsb
253
        lodsb
254
        or      al, 20h
254
        or      al, 20h
255
        sub     al, '0'
255
        sub     al, '0'
256
        cmp     al, 9
256
        cmp     al, 9
257
        jbe     @b
257
        jbe     @b
258
        sub     al, 'a'-'0'-10
258
        sub     al, 'a'-'0'-10
259
        cmp     al, 15
259
        cmp     al, 15
260
        jbe     @b
260
        jbe     @b
261
        dec     esi
261
        dec     esi
262
 
262
 
263
  @@:
263
  @@:
264
        cmp     esi, edx
264
        cmp     esi, edx
265
        ja      .readdone
265
        ja      .readdone
266
        lodsb
266
        lodsb
267
        cmp     al, 20h
267
        cmp     al, 20h
268
        jz      @b
268
        jz      @b
269
        jb      .readloop
269
        jb      .readloop
270
        cmp     al, 9
270
        cmp     al, 9
271
        jz      @b
271
        jz      @b
272
        mov     dword [ebx], edi
272
        mov     dword [ebx], edi
273
        add     ebx, 4
273
        add     ebx, 4
274
        mov     dword [ebp], edi
274
        mov     dword [ebp], edi
275
        add     ebp, 4
275
        add     ebp, 4
276
        mov     dword [edi], ecx
276
        mov     dword [edi], ecx
277
        add     edi, 4
277
        add     edi, 4
278
        stosb
278
        stosb
279
 
279
 
280
  @@:
280
  @@:
281
        xor     eax, eax
281
        xor     eax, eax
282
        stosb
282
        stosb
283
        cmp     esi, edx
283
        cmp     esi, edx
284
        ja      .readdone
284
        ja      .readdone
285
        lodsb
285
        lodsb
286
        cmp     al, 0xD
286
        cmp     al, 0xD
287
        jz      .readloop
287
        jz      .readloop
288
        cmp     al, 0xA
288
        cmp     al, 0xA
289
        jz      .readloop
289
        jz      .readloop
290
        mov     byte [edi-1], al
290
        mov     byte [edi-1], al
291
        jmp     @b
291
        jmp     @b
292
 
292
 
293
  .readline:
293
  .readline:
294
        cmp     esi, edx
294
        cmp     esi, edx
295
        jae     .readdone
295
        jae     .readdone
296
        lodsb
296
        lodsb
297
        cmp     al, 0xD
297
        cmp     al, 0xD
298
        jz      .readloop
298
        jz      .readloop
299
        cmp     al, 0xA
299
        cmp     al, 0xA
300
        jz      .readloop
300
        jz      .readloop
301
        jmp     .readline
301
        jmp     .readline
302
 
302
 
303
  .readdone:
303
  .readdone:
304
        pop     ecx
304
        pop     ecx
305
        mcall   68, 13
305
        mcall   68, 13
306
        mov     ecx, [num_symbols]
306
        mov     ecx, [num_symbols]
307
        mov     edx, [symbols]
307
        mov     edx, [symbols]
308
        mov     ebx, compare
308
        mov     ebx, compare
309
        call    sort
309
        call    sort
310
        mov     ecx, [num_symbols]
310
        mov     ecx, [num_symbols]
311
        lea     edx, [edx+ecx*4]
311
        lea     edx, [edx+ecx*4]
312
        mov     ebx, compare2
312
        mov     ebx, compare2
313
        call    sort
313
        call    sort
314
        mov     esi, aSymbolsLoaded
314
        mov     esi, aSymbolsLoaded
315
        call    put_message
315
        call    put_message
316
        jmp     draw_disasm.redraw
316
        jmp     draw_disasm
317
 
317
 
318
;-----------------------------------------------------------------------------
318
;-----------------------------------------------------------------------------
319
;
319
;
320
; in: EAX = address
320
; in: EAX = address
321
; out: ESI, CF
321
; out: ESI, CF
322
 
322
 
323
find_symbol:
323
find_symbol:
324
        cmp     [num_symbols], 0
324
        cmp     [num_symbols], 0
325
        jnz     @f
325
        jnz     @f
326
 
326
 
327
  .ret0:
327
  .ret0:
328
        xor     esi, esi
328
        xor     esi, esi
329
        stc
329
        stc
330
        ret
330
        ret
331
 
331
 
332
  @@:
332
  @@:
333
        push    ebx ecx edx
333
        push    ebx ecx edx
334
        xor     edx, edx
334
        xor     edx, edx
335
        mov     esi, [symbols]
335
        mov     esi, [symbols]
336
        mov     ecx, [num_symbols]
336
        mov     ecx, [num_symbols]
337
        mov     ebx, [esi]
337
        mov     ebx, [esi]
338
        cmp     [ebx], eax
338
        cmp     [ebx], eax
339
        jz      .donez
339
        jz      .donez
340
        jb      @f
340
        jb      @f
341
        pop     edx ecx ebx
341
        pop     edx ecx ebx
342
        jmp     .ret0
342
        jmp     .ret0
343
 
343
 
344
  @@:
344
  @@:
345
    ; invariant: symbols_addr[edx] < eax < symbols_addr[ecx]
345
    ; invariant: symbols_addr[edx] < eax < symbols_addr[ecx]
346
    ; TODO: add meaningful label names
346
    ; TODO: add meaningful label names
347
  .0:
347
  .0:
348
        push    edx
348
        push    edx
349
 
349
 
350
  .1:
350
  .1:
351
        add     edx, ecx
351
        add     edx, ecx
352
        sar     edx, 1
352
        sar     edx, 1
353
        cmp     edx, [esp]
353
        cmp     edx, [esp]
354
        jz      .done2
354
        jz      .done2
355
        mov     ebx, [esi+edx*4]
355
        mov     ebx, [esi+edx*4]
356
        cmp     [ebx], eax
356
        cmp     [ebx], eax
357
        jz      .done
357
        jz      .done
358
        ja      .2
358
        ja      .2
359
        mov     [esp], edx
359
        mov     [esp], edx
360
        jmp     .1
360
        jmp     .1
361
 
361
 
362
  .2:
362
  .2:
363
        mov     ecx, edx
363
        mov     ecx, edx
364
        pop     edx
364
        pop     edx
365
        jmp     .0
365
        jmp     .0
366
 
366
 
367
  .donecont:
367
  .donecont:
368
        dec     edx
368
        dec     edx
369
 
369
 
370
  .done:
370
  .done:
371
        test    edx, edx
371
        test    edx, edx
372
        jz      @f
372
        jz      @f
373
        mov     ebx, [esi+edx*4-4]
373
        mov     ebx, [esi+edx*4-4]
374
        cmp     [ebx], eax
374
        cmp     [ebx], eax
375
        jz      .donecont
375
        jz      .donecont
376
 
376
 
377
  @@:
377
  @@:
378
        pop     ecx
378
        pop     ecx
379
 
379
 
380
  .donez:
380
  .donez:
381
        mov     esi, [esi+edx*4]
381
        mov     esi, [esi+edx*4]
382
        add     esi, 4
382
        add     esi, 4
383
        pop     edx ecx ebx
383
        pop     edx ecx ebx
384
        clc
384
        clc
385
        ret
385
        ret
386
 
386
 
387
  .done2:
387
  .done2:
388
        lea     esi, [esi+edx*4]
388
        lea     esi, [esi+edx*4]
389
        pop     ecx edx ecx ebx
389
        pop     ecx edx ecx ebx
390
        stc
390
        stc
391
        ret
391
        ret
392
 
392
 
393
;-----------------------------------------------------------------------------
393
;-----------------------------------------------------------------------------
394
;
394
;
395
; in: esi->name
395
; in: esi->name
396
; out: if found: CF = 0, EAX = value
396
; out: if found: CF = 0, EAX = value
397
;      otherwise CF = 1
397
;      otherwise CF = 1
398
find_symbol_name:
398
find_symbol_name:
399
        cmp     [num_symbols], 0
399
        cmp     [num_symbols], 0
400
        jnz     @f
400
        jnz     @f
401
 
401
 
402
  .stc_ret:
402
  .stc_ret:
403
        stc
403
        stc
404
        ret
404
        ret
405
 
405
 
406
  @@:
406
  @@:
407
        push    ebx ecx edx edi
407
        push    ebx ecx edx edi
408
        push    -1
408
        push    -1
409
        pop     edx
409
        pop     edx
410
        mov     ebx, [symbols]
410
        mov     ebx, [symbols]
411
        mov     ecx, [num_symbols]
411
        mov     ecx, [num_symbols]
412
        lea     ebx, [ebx+ecx*4]
412
        lea     ebx, [ebx+ecx*4]
413
    
413
    
414
    ; invariant: symbols_name[edx] < name < symbols_name[ecx]
414
    ; invariant: symbols_name[edx] < name < symbols_name[ecx]
415
  .0:
415
  .0:
416
        push    edx
416
        push    edx
417
 
417
 
418
  .1:
418
  .1:
419
        add     edx, ecx
419
        add     edx, ecx
420
        sar     edx, 1
420
        sar     edx, 1
421
        cmp     edx, [esp]
421
        cmp     edx, [esp]
422
        jz      .done2
422
        jz      .done2
423
        call    .cmp
423
        call    .cmp
424
        jz      .done
424
        jz      .done
425
        jb      .2
425
        jb      .2
426
        mov     [esp], edx
426
        mov     [esp], edx
427
        jmp     .1
427
        jmp     .1
428
 
428
 
429
  .2:
429
  .2:
430
        mov     ecx, edx
430
        mov     ecx, edx
431
        pop     edx
431
        pop     edx
432
        jmp     .0
432
        jmp     .0
433
 
433
 
434
  .done:
434
  .done:
435
        pop     ecx
435
        pop     ecx
436
 
436
 
437
  .donez:
437
  .donez:
438
        mov     eax, [ebx+edx*4]
438
        mov     eax, [ebx+edx*4]
439
        mov     eax, [eax]
439
        mov     eax, [eax]
440
        pop     edi edx ecx ebx
440
        pop     edi edx ecx ebx
441
        clc
441
        clc
442
        ret
442
        ret
443
 
443
 
444
  .done2:
444
  .done2:
445
        pop     edx edi edx ecx ebx
445
        pop     edx edi edx ecx ebx
446
        stc
446
        stc
447
        ret
447
        ret
448
 
448
 
449
  .cmp:
449
  .cmp:
450
        mov     edi, [ebx+edx*4]
450
        mov     edi, [ebx+edx*4]
451
        push    esi
451
        push    esi
452
        add     edi, 4
452
        add     edi, 4
453
 
453
 
454
  @@:
454
  @@:
455
        cmpsb
455
        cmpsb
456
        jnz     @f
456
        jnz     @f
457
        cmp     byte [esi-1], 0
457
        cmp     byte [esi-1], 0
458
        jnz     @b
458
        jnz     @b
459
 
459
 
460
  @@:
460
  @@:
461
        pop     esi
461
        pop     esi
462
        ret
462
        ret