From f56b0638f4220e89dd68521a5c28723b9affdfdf Mon Sep 17 00:00:00 2001 From: 0CodErr <0CodErr@kolibrios.org> Date: Wed, 10 Oct 2018 12:44:21 +0000 Subject: [PATCH] =?UTF-8?q?add=20cmdline=20parameter=20"-d"=20=E2=80=94=20?= =?UTF-8?q?delay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://kolibrios.org@7446 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/searchap/searchap.asm | 29 +++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/programs/system/searchap/searchap.asm b/programs/system/searchap/searchap.asm index 1d33318b11..af98570a27 100644 --- a/programs/system/searchap/searchap.asm +++ b/programs/system/searchap/searchap.asm @@ -34,8 +34,10 @@ dd IM_END dd I_END dd stacktop +params dd PARAMS dd 0x0 - dd 0x0 +;--------------------------------------------------------------------- +delay dd 0;500 ;--------------------------------------------------------------------- fileinfo: .subfunction dd 5 @@ -83,7 +85,28 @@ define __DEBUG_LEVEL__ 2 ; 1 = verbose, 2 = main only include "../../debug-fdo.inc" ;------------------------------------------------------------------------------- START: - mcall 5,500 +; process cmdline params + mov esi, [params] + test [esi], byte 0xFF + jz .params_done + cmp word[esi], '-d' ; delay + jne .params_done + add esi, 2 +; str2uint(delay) + xor eax, eax + xor ecx, ecx +.convert: + lodsb + test al, al + jz .converted + lea ecx, [ecx + ecx * 4] + lea ecx, [eax + ecx * 2 - '0'] + jmp .convert +.converted: + mov [delay], ecx +.params_done: +;-------------------------------------- + mcall 5,[delay] mov ebx,start_dir mov ax,[ebx] mov ebx,read_folder_name @@ -401,6 +424,8 @@ include_debug_strings IM_END: ;------------------------------------------------------------------------------- align 4 +PARAMS: rb 256 +align 4 left_folder_block rd 1 right_folder_block rd 1 temp_counter_1 rd 1