Subversion Repositories Kolibri OS

Rev

Rev 8687 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8687 Rev 8718
Line 2... Line 2...
2
section '.text' executable
2
section '.text' executable
3
public start
3
public start
4
public start as '_start'
4
public start as '_start'
5
;extrn mf_init
5
;extrn mf_init
6
extrn main
6
extrn main
7
;include 'debug2.inc'
7
include '../../../../../proc32.inc'
8
include 'proc32.inc'
8
include '../../../../../macros.inc'
9
include 'macros.inc'
9
include '../../../../../dll.inc'
10
include 'dll.inc'
10
;include '../../../../../debug.inc'
11
__DEBUG__=0
-
 
Line 12... Line 11...
12
 
11
 
13
;start_:
12
;start_:
14
virtual at 0
13
virtual at 0
15
	db 'MENUET01' ; 1. Magic number (8 bytes)
14
	db 'MENUET01' ; 1. Magic number (8 bytes)
Line 149... Line 148...
149
    test eax, eax
148
    test eax, eax
150
    jz .fail
149
    jz .fail
151
    mov dword[ebx], eax
150
    mov dword[ebx], eax
152
    jmp .handle_next_import
151
    jmp .handle_next_import
153
.done:
152
.done:
-
 
153
    ;DEBUGF 1, "Library: %s not loaded!\n", esi
-
 
154
    ;mcall -1
154
    ret
155
    ret
155
.fail:
156
.fail:
156
    ret
157
    ret
-
 
158
 
157
;==============================
159
;==============================
Line 158... Line 160...
158
 
160
 
159
;==============================
161
;==============================
160
load_library:
162
load_library:
Line 199... Line 201...
199
    ret
201
    ret
200
.fail:
202
.fail:
201
    mov eax, 0
203
    mov eax, 0
202
    ret
204
    ret
Line 203... Line -...
203
    
-
 
204
; ==== memmove for tcc ======
-
 
205
 
-
 
206
proc memmove c, to:dword,from:dword,count:dword
-
 
207
 
-
 
208
    push esi
-
 
209
    push edi
-
 
210
	mov ecx,[count]
-
 
211
	test ecx,ecx
-
 
212
	jz no_copy_block_
-
 
213
		mov esi,[from]
-
 
214
		mov edi,[to]
-
 
215
		cmp esi, edi
-
 
216
		je no_copy_block_
-
 
217
		jg copy_
-
 
218
            add	esi, ecx
-
 
219
            add	edi, ecx
-
 
220
            dec	esi
-
 
221
            dec	edi
-
 
222
            std
-
 
223
copy_:
-
 
224
		rep movsb
-
 
225
        cld
-
 
226
no_copy_block_:
-
 
227
 
-
 
228
    pop edi
-
 
229
    pop esi
-
 
230
    mov eax,[to]
-
 
231
	ret
-
 
232
endp
-
 
233
    
-
 
234
    
205
 
Line 235... Line 206...
235
;==============================
206
;==============================
Line 236... Line 207...
236
 
207
 
237
lib_init_str db 'lib_init', 0
208
lib_init_str db 'lib_init', 0
238
 
209
 
239
public argc as '__argc'
-
 
Line 240... Line 210...
240
public params as '__argv'
210
public argc as '__argc'
241
public path as '__path'
211
public params as '__argv'
242
public memmove
212
public path as '__path'
243
 
213
 
244
section '.bss' 
214
section '.bss' 
245
buf_len = 0x400
215
buf_len = 0x400
246
max_parameters=0x20
216
max_parameters=0x20
Line 247... Line -...
247
argc	 rd 1
-
 
248
argv	 rd max_parameters
-