Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5497 leency 1
CATCH_NULL_CALL = 0
2
 
3
format ELF
4
section '.text' executable
5
public start
6
EXTRN _edata
7
EXTRN ___menuet__app_param_area
8
EXTRN ___menuet__app_path_area
9
EXTRN ___crt1_startup
10
start:
11
public ___menuet__app_header
12
public ___menuet__memsize
13
___menuet__app_header:
14
 db 'MENUET01'
15
 dd 0x01
16
if CATCH_NULL_CALL
17
 dd do_start
18
else
19
 dd ___crt1_startup
20
end if
21
 dd _edata
22
___menuet__memsize:
23
 dd 0x800000
24
 dd app_stack
25
 dd ___menuet__app_param_area
26
 dd ___menuet__app_path_area
27
 
28
if CATCH_NULL_CALL
29
do_start:
30
	mov	byte [0], 0xE9
31
	mov	dword [1], _libc_null_call-5
32
 call ___crt1_startup
33
; Handle exit if __crt1_startup returns (shouldn't happen)
34
 mov eax,-1
35
 int 0x40
36
end if
37
 
38
if CATCH_NULL_CALL
39
EXTRN ___libc_null_call
40
 
41
_libc_null_call:
42
    push eax
43
    push ebx
44
    push ecx
45
    push edx
46
    push esi
47
    push edi
48
    push ebp
49
    call ___libc_null_call
50
    mov eax,-1
51
    int 0x40
52
end if
53
 
54
section '.bss' writeable
55
rd 0x20000
56
app_stack: