SYSTEM_COMMANDS DB 'testcommand! ' DD HANDLE_TEST DB 'help! ' DD HANDLE_HELP DB 'memmap! ' DD HANDLE_MEMMAP DB 'gdt! ' DD HANDLE_GDT DB 'parttable! ' DD HANDLE_PARTTABLE DB 'format! ' DD HANDLE_FORMAT DB 'disklist! ' DD HANDLE_DISKLIST DB 'rs! ' DD HANDLE_READSECTOR DB 'files! ' DD HANDLE_FILES DB 'partlist! ' DD HANDLE_PARTLIST DB 'execimg! ' DD HANDLE_EXECIMAGE DB 'fileinfo! ' DD HANDLE_FILEINFO DB 'read! ' DD HANDLE_READFILE DB 'run! ' DD HANDLE_RUNFILE DB 'copy! ' DD HANDLE_COPYFILE DB 'syscopy! ' DD HANDLE_SYSCOPY DB 'qboot! ' DD HANDLE_QBOOT DB 'loadmod! ' DD HANDLE_LOADMOD DB 'memtop! ' DD HANDLE_MEMTOP DB 'rm! ' DD HANDLE_READMEM DB 'modlist! ' DD HANDLE_MODLIST DB 'serverlist! ' DD HANDLE_SERVERLIST DB 'crash! ' DD HANDLE_CRASH DB 'q1! ' DD HANDLE_QUICKY1 DB 'q2! ' DD HANDLE_QUICKY2 DB 'q3! ' DD HANDLE_QUICKY3 DB 'q4! ' DD HANDLE_QUICKY4 DB 'q5! ' DD HANDLE_QUICKY5 DB 'pciinfo! ' DD HANDLE_PCIINFO DB 'pcibuffer! ' DD HANDLE_PCIBUFFER DB 'pic! ' DD HANDLE_PIC DB 'script! ' DD HANDLE_SCRIPT DB 'del! ' DD HANDLE_DEL DB 0 %include "commands/test.inc" %include "commands/help.inc" %include "commands/memmap.inc" %include "commands/gdt.inc" %include "commands/parttabl.inc" %include "commands/format.inc" %include "commands/disklist.inc" %include "commands/read.inc" %include "commands/files.inc" %include "commands/partlist.inc" %include "commands/execimg.inc" %include "commands/fileinfo.inc" %include "commands/run.inc" %include "commands/rs.inc" %include "commands/copy.inc" %include "commands/syscopy.inc" %include "commands/qboot.inc" %include "commands/loadmod.inc" %include "commands/memtop.inc" %include "commands/rm.inc" %include "commands/modlist.inc" %include "commands/srvlist.inc" %include "commands/crash.inc" %include "commands/quickies.inc" %include "commands/pcibuf.inc" %include "commands/pciinfo.inc" %include "commands/pic.inc" %include "commands/script.inc" %include "commands/del.inc" ;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; IN: AL = PARAMETER NUMBER TO GET ;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ GETPARAMETER_S: PUSHAD MOV CL, AL MOV EAX, COMMAND_BUFFER MOV [PARAMETER_OFFSET], EAX MOV DL, 0 ; 0 SPACES COUNTED. XOR AH, AH MOV ESI, COMMAND_BUFFER NEXTLETTEROFPARAMETER2: MOV AL, [DS:ESI] CMP AL, ' ' JNE NOSPACEINPARAM2 CMP AH, AL JE NOSPACEINPARAM2 ; DOUBLE SPACE INC DL CMP DL, CL JNE NOSPACEINPARAM2 ; NOT THIS PARAMETER INC ESI MOV EDI, SINGLE_PARAMETER NEXTCHARFROMPARAM: MOV AL, [DS:ESI] CMP AL, ' ' JE SKIPTHISCHARFROMPARAMETER MOV [DS:EDI], AL INC EDI MOV AL, [DS:ESI+1] CMP AL, 0 JE ADDPARAMETERTERMINATOR CMP AL, ' ' JNE SKIPTHISCHARFROMPARAMETER ADDPARAMETERTERMINATOR: MOV AL, 0 MOV [DS:EDI], AL ; ADD TERMINATOR JMP FOUNDTHEPARAMETER SKIPTHISCHARFROMPARAMETER: INC ESI JMP NEXTCHARFROMPARAM NOSPACEINPARAM2: CMP AL, 0 JE FOUNDTHEPARAMETER INC ESI MOV AH, AL JMP NEXTLETTEROFPARAMETER2 FOUNDTHEPARAMETER: POPAD RET ;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ COUNTPARAMETERS: PUSHAD MOV DL, 0 ; 0 SPACES COUNTED. XOR AH, AH MOV ESI, COMMAND_BUFFER NEXTLETTEROFPARAMETER: MOV AL, [DS:ESI] CMP AL, ' ' JNE NOSPACEINPARAM CMP AH, AL JE NOSPACEINPARAM ; DOUBLE SPACE INC DL NOSPACEINPARAM: CMP AL, 0 JE ENDOFPARAMETER INC ESI MOV AH, AL JMP NEXTLETTEROFPARAMETER ENDOFPARAMETER: MOV [PARAM_COUNT], DL POPAD RET