CODE SEGMENT
    ASSUME CS:CODE, DS:CODE, ES:CODE, SS:CODE
    ORG 80H
CommandLine:
    ORG 100H
START: XOR AX, AX
    MOV DX, AX
    MOV BX, OFFSET CommandLine[1]
@@: MOV DL, [BX]
    INC BX
    CMP DL, ' '
    JE @B
@@: CMP DL, '0'
    JB @START
    CMP DL, '9'
    JA @START
    SUB DL, '0'
    SHL AX, 1
    MOV CX, AX
    SHL CX, 1
    SHL CX, 1
    ADD AX, CX
    ADD AX, DX
    MOV DL, [BX]
    INC BX
JMP SHORT @B
@START:
    OR AX, AX
    JNZ @F
    MOV AL, 10
@@: MOV SleepSecond, AX
    MOV AH, 2CH
    INT 21H
    MOV LastSecond, DH
@@START:
    MOV AH, 6
    MOV DL, 0FFH
    INT 21H
    MOV ReturnCode, AL
    OR AL, AL
    JNZ @EXIT
    MOV CX, -1
    MOV DX, CX
    @@: LOOP @B
    MOV CX, DX
    @@:LOOP @B
    MOV CX, DX
    @@: LOOP @B
    MOV CX, DX
    @@: LOOP @B
    MOV CX, DX
    SHR CX, 1
    @@: NOP
    LOOP @B
    MOV AH, 2CH
    INT 21H
    CMP DH, LastSecond
    JE @@START
        MOV LastSecond, DH
        DEC SleepSecond
JNZ @@START
@EXIT: MOV AH, 4CH
    MOV AL, ReturnCode
    INT 21H
    SleepSecond DW ?
    LastSecond DB ?
    ReturnCode DB ?
CODE ENDS
    END START
