Subversion Repositories Kolibri OS

Rev

Rev 5098 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4973 right-hear 1
CATCH_NULL_CALL = 0
2
 
3
format MS COFF
4
section '.text' code readable executable
5
public start
6
;EXTRN _edata
7
EXTRN ___menuet__app_param_area
8
EXTRN ___menuet__app_path_area
9
EXTRN ___crt1_startup
5098 clevermous 10
EXTRN ___memsize
4973 right-hear 11
start:
12
public ___menuet__app_header
13
public ___menuet__memsize
14
section '.A' code readable executable
15
___menuet__app_header:
16
 db 'MENUET01'
17
 dd 0x01
18
 dd do_start
19
; dd _edata
20
 dd 0
21
___menuet__memsize:
5098 clevermous 22
 dd ___memsize
4973 right-hear 23
 dd app_stack
24
 dd ___menuet__app_param_area
25
 dd ___menuet__app_path_area
26
 
5131 clevermous 27
do_start:
28
	push	68
29
	pop	eax
30
	push	11
31
	pop	ebx
32
	push	eax
33
	int	0x40
34
	pop	eax
35
	inc	ebx
36
	mov	ecx, 0x100000
37
	int	0x40
38
	lea	esp, [eax+ecx]
4973 right-hear 39
if CATCH_NULL_CALL
40
	mov	byte [0], 0xE9
41
	mov	dword [1], _libc_null_call-5
42
end if
5131 clevermous 43
 jmp ___crt1_startup
4973 right-hear 44
 
45
if CATCH_NULL_CALL
46
EXTRN ___libc_null_call
47
 
48
_libc_null_call:
49
    push eax
50
    push ebx
51
    push ecx
52
    push edx
53
    push esi
54
    push edi
55
    push ebp
56
    call ___libc_null_call
57
    mov eax,-1
58
    int 0x40
59
end if
60
 
61
section '.bss' readable writeable
5131 clevermous 62
rb 0x100
4973 right-hear 63
app_stack: