Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 634 → Rev 635

/programs/develop/fasm/trunk/fasm.asm
27,8 → 27,8
dd 0x01 ; header version
dd START ; program start
dd program_end ; program image size
dd APP_MEMORY ; required amount of memory
dd 0xDFFF0 ; stack
dd stacktop ; required amount of memory
dd stacktop ; stack
dd params,0x0 ; parameters,icon
 
include 'lang.inc'
593,3 → 593,7
fileinfos rb (4+20+MAX_PATH)*max_handles
fileinfos_end:
pinfo process_information
 
align 1000h
rb 1000h
stacktop:
/programs/develop/fasm/trunk/system.inc
58,15 → 58,29
; ~3/8 - additional memory
; ~5/8 - main memory
init_memory:
mov [memory_start],0x100000
mov [memory_end],0x100000+(APP_MEMORY-0x100000)/8*5
mov [additional_memory],0x100000+(APP_MEMORY-0x100000)/8*5
mov [additional_memory_end],APP_MEMORY
mcall 18, 16
cmp eax, 0xFFFFFFFF shr 9
jbe @f
mov eax, 0xFFFFFFFF shr 9
@@:
shl eax, 9
lea ecx, [eax+stacktop]
mcall 64, 1
mov [memory_start], stacktop
mov [additional_memory_end], ecx
sub ecx, stacktop
shr ecx, 3
lea ecx, [ecx*5+stacktop]
mov [memory_end],ecx
mov [additional_memory],ecx
ret
 
exit_program:
cmp [_mode],NORMAL_MODE
je still
jne @f
mcall 64, 1, stacktop
jmp still
@@:
or eax,-1
mcall