; wraps command line arguments in quotes and launches a target. ; TARGET equ 'target_name' must be defined before including this file. include 'KOSfuncs.inc' org 0x0 use32 db 'MENUET01' dd 1 dd start dd i_end dd m_end dd m_end dd params dd 0 start: cmp byte [params], 0 je .launch mov esi, params mov ah, '"' .shift_loop: mov al, [esi] mov [esi], ah inc esi mov ah, al test al, al jnz .shift_loop mov word [esi], '"' mov dword [fi + 8], params .launch: mov eax, SF_FILE mov ebx, fi int 0x40 mov eax, SF_TERMINATE_PROCESS int 0x40 fi: dd SSF_START_APP, 0, 0, 0, 0 db 0 dd target_path target_path db TARGET, 0 i_end: params rb 1024 m_end: