Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4613 → Rev 4609

/programs/system/launcher/trunk/launcher.asm
5,11 → 5,6
; Compile with FASM 1.52 or newer
;
;-----------------------------------------------------------------------------
; last update: 06/03/2014
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Dynamic memory allocation for AUTORUN.DAT.
; Added additional diagnostic messages for BOARD.
;-----------------------------------------------------------------------------
; last update: 02/03/2014
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Reducing the consumption of RAM, 4 KB instead of 32 KB.
35,32 → 30,8
include "../../../debug-fdo.inc"
;-----------------------------------------------------------------------------
START: ; start of execution
mcall 68,11
mcall 70,autorun_dat_info ;get information AUTORUN.DAT
test eax,eax
jnz .read_error
 
mov ecx,[processinfo+32]
test ecx,ecx
jnz @f
inc ecx ; if file size zero
;--------------------------------------
@@:
mov [autorun_dat_info.size],ecx
mcall 68,12
mov [autorun_dat_info.address],eax
mov ebp,eax
mov [autorun_dat_info.mode],dword 0
mcall 70,autorun_dat_info ;load AUTORUN.DAT
test eax,eax
jz @f
.read_error:
DEBUGF 1, "L: AUTORUN.DAT read error\n"
jmp exit
;--------------------------------------
@@:
add ebx,ebp
add ebx,file_data
mov [fileend],ebx
;-----------------------------------------------------------------------------
; this cycle does not contain an obvious exit condition,
82,14 → 53,12
call next_line
jmp start_program
;-----------------------------------------------------------------------------
exit_1:
DEBUGF 1, "L: AUTORUN.DAT processed\n"
exit:
or eax,-1
mcall
;-----------------------------------------------------------------------------
run_program: ; time to delay in eax
DEBUGF 1, "L: %s Param: %s\n",program,parameters
DEBUGF 1, "Launch: %s Parameter: %s\n",program,parameters
push eax
mcall 70,start_info
pop ebx
141,7 → 110,7
pushad
call skip_spaces
mov esi,[position]
add esi,ebp
add esi,file_data
cmp [esi],byte '"'
jz .quoted
;--------------------------------------
181,7 → 150,7
push ebx esi
call skip_spaces
mov esi,[position]
add esi,ebp
add esi,file_data
xor eax,eax
cmp [esi],byte '-'
jnz @f
225,7 → 194,7
push esi
xor eax,eax
mov esi,[position]
add esi,ebp
add esi,file_data
;--------------------------------------
.start:
cmp esi,[fileend]
244,11 → 213,11
;-----------------------------------------------------------------------------
next_line:
mov esi,[position]
add esi,ebp
add esi,file_data
;--------------------------------------
.start:
cmp esi,[fileend]
jae exit_1
jae exit
 
lodsb
cmp al,13
263,7 → 232,7
.finish:
inc dword [position]
cmp esi,[fileend]
jae exit_1
jae exit
 
lodsb
cmp al,13
279,21 → 248,20
include_debug_strings
;-----------------------------------------------------------------------------
autorun_dat_info: ; AUTORUN.DAT
.mode dd 5 ; get information or read file
.start dd 0
.params dd 0
.size dd 0
.address dd processinfo
.mode dd 0 ; read file
.start_block dd 0 ; block to read
dd 0
.blocks dd 4*512 ; 2 Kb max for AUTORUN.DAT
.address dd file_data
db "/SYS/SETTINGS/AUTORUN.DAT",0
;-----------------------------------------------------------------------------
start_info:
.mode dd 7
.flags dd 0
dd 0
.params dd parameters
dd 0
dd 0
db 0
.path dd program
.path:
;-----------------------------------------------------------------------------
IM_END:
;-----------------------------------------------------------------------------
315,6 → 283,10
rd 1
;-----------------------------------------------------------------------------
align 4
file_data:
rb 4*512 ; 2 Kb for AUTORUN.DAT
;-----------------------------------------------------------------------------
align 4
rb 256
stack_top:
;-----------------------------------------------------------------------------