Subversion Repositories Kolibri OS

Rev

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

Rev 635 Rev 755
Line 57... Line 57...
57
; info by Privalov: starting from FASM 1.51
57
; info by Privalov: starting from FASM 1.51
58
;   ~3/8 - additional memory
58
;   ~3/8 - additional memory
59
;   ~5/8 - main memory
59
;   ~5/8 - main memory
60
init_memory:
60
init_memory:
61
	mcall	18, 16
61
	mcall	18, 16
62
	cmp	eax, 0xFFFFFFFF shr 9
62
	cmp	ecx, 0x38000000 shr 9
63
	jbe	@f
63
	jbe	@f
64
	mov	eax, 0xFFFFFFFF shr 9
64
	mov	ecx, 0x38000000 shr 9
65
@@:
65
@@:
66
	shl	eax, 9
66
	shl	ecx, 9
67
	lea	ecx, [eax+stacktop]
-
 
68
	mcall	64, 1
67
	mcall	68, 12
69
	mov	[memory_start], stacktop
68
	mov	[memory_start], eax
-
 
69
	mov	[memblock], eax
-
 
70
	push	eax
-
 
71
	add	eax, ecx
70
	mov	[additional_memory_end], ecx
72
	mov	[additional_memory_end], eax
71
	sub	ecx, stacktop
73
	pop	eax
72
	shr	ecx, 3
74
	shr	ecx, 3
-
 
75
	add	eax, ecx
73
	lea	ecx, [ecx*5+stacktop]
76
	lea	eax, [ecx*4+eax]
74
	mov	[memory_end],ecx
77
	mov	[memory_end],eax
75
	mov	[additional_memory],ecx
78
	mov	[additional_memory],eax
76
	ret
79
	ret
Line 77... Line 80...
77
 
80
 
78
exit_program:
81
exit_program:
79
	cmp	[_mode],NORMAL_MODE
82
	cmp	[_mode],NORMAL_MODE
80
	jne	@f
83
	jne	@f
81
	mcall	64, 1, stacktop
84
	mcall	68, 13, [memblock]
82
	jmp	still
85
	jmp	still
83
@@:
86
@@:
84
	or	eax,-1
87
	or	eax,-1