I have this kernel with the shell, and I'm trying to put the time and date commands in it but can't seem to make it work. It shows no error while compiling but it doesn't do anything when I test it. Can anyone tell me what I'm doing wrong here?

Here's the code so far:

;*****************start of the kernel code***************
[org 0x000]
[bits 16]
[SEGMENT .text]

;START #####################################################
    mov ax, 0x0100                      ;location where kernel is loaded
    mov ds, ax
    mov es, ax
    
    cli
    mov ss, ax                          ;stack segment
    mov sp, 0xFFFF                      ;stack pointer at 64k limit
    sti

    push dx
    push es
    xor ax, ax
    mov es, ax
    cli
    mov word [es:0x21*4], _int0x21      ; setup interrupt service
    mov [es:0x21*4+2], cs
    sti
    pop es
    pop dx

    mov si, strWelcomeMsg   		; load message
    mov al, 0x01            		; request sub-service 0x01
    int 0x21

    call _shell                         ; call the shell
    
    int 0x19                ; reboot
;END #######################################################

_int0x21:
    _int0x21_ser0x01:       ;service 0x01
    cmp al, 0x01            ;see if service 0x01 wanted
    jne _int0x21_end        ;goto next check (now it is end)
    
_int0x21_ser0x01_start:
    lodsb                   ; load next character
    or  al, al              ; test for NUL character
    jz  _int0x21_ser0x01_end
    mov ah, 0x0E            ; BIOS teletype
    mov bh, 0x00            ; display page 0
    mov bl, 0x07            ; text attribute
    int 0x10                ; invoke BIOS
    jmp _int0x21_ser0x01_start
    _int0x21_ser0x01_end:
    jmp _int0x21_end

    _int0x21_end:
    iret

_shell:
    _shell_begin:
    					;move to next line
    call _display_endl
    					;display prompt
    call _display_prompt
    					;get user command
    call _get_command
               				;split command into components
    call _split_cmd
        				;check command & perform action
        				; empty command
_cmd_none:              
    mov si, strCmd0
    cmp BYTE [si], 0x00
    jne _cmd_ver                	;next command
    jmp _cmd_done
        
    					; display version
_cmd_ver:               
    mov si, strCmd0
    mov di, cmdVer
    mov cx, 4
    repe cmpsb
    jne _cmd_cls   	        	;next command
        
    call _display_endl
    mov si, strOsName               	;display version
    mov al, 0x01
    int 0x21
    call _display_space
    mov si, txtVersion              	;display version
    mov al, 0x01
    int 0x21
    call _display_space

    mov si, strMajorVer             
    mov al, 0x01
    int 0x21
    mov si, strMinorVer
    mov al, 0x01
    int 0x21
    jmp _cmd_done

_cmd_cls:               
    mov si, strCmd0
    mov di, cmdCls
    mov cx, 4
    repe cmpsb
    jne _cmd_date   	        	;next command
        

    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl

    mov bh, 0
    mov dl, 0
    mov dh, 00
    mov ah, 02
    int 10h
    jmp _cmd_done

_cmd_date:               
    mov si, strCmd0
    mov di, cmdDate
    mov cx, 4
    repe cmpsb
    jne _cmd_time   	        	;next command
        

    jmp overdata 

    overdata: 
        mov ah,4    
        int 1Ah    

        mov di,datestring  

        mov al,dh     
        call byte2hex 
        mov al,'-'   
        stosb         
        mov al,dl    
        call byte2hex
        mov al,'-'    
        stosb       
        mov ax,cx    
        call word2hex 
        mov al,'$'    
        stosb        

        mov dx,datestring     ;just like "Hello World!"
        mov ah,9      
        int 21h
        mov ah,4Ch   
        int 21h

    word2hex:
        mov bx,ax        
        shr ax,12         
        call nyb2hex     
        mov ax,bx        
        shr ax,8          
        call nyb2hex    
       mov ax,bx
    byte2hex:
        mov bx,ax   
        shr ax,4
        call nyb2hex
        mov ax,bx
    nyb2hex:
        and al,0Fh    
        cmp al,10     
                  
        ;sbb al,105  
        ;das         
        jc okdigit   
        add al,7     
    okdigit:
        add al,30h   
        ;int 029h     
        stosb         
        ret          

    jmp _cmd_done

_cmd_time: 
    mov si, strCmd0
    mov di, cmdTime
    mov cx, 4
    repe cmpsb
    jne _cmd_hlp

    jmp _WasteTime

    global _WasteTime
     
    _WasteTime:
        mov  bx, sp
        mov  bx, [ss:bx+02h]

        push si
        push di

        mov  ah, 00h
        int  1Ah
        
        mov  di, cx
        mov  si, dx

    .Waster:        
        mov  ah, 00h
        int  1Ah

        sub  dx, si
        sbb  cx, di

        cmp  cx, 0
        jne  .EndOfProc

        cmp  dx, bx
        jb   .Waster

    .EndOfProc:
        pop  di
        pop  si
        ret


    jmp _cmd_done

_cmd_hlp:
    mov si, strCmd0
    mov di, cmdHlp
    mov cx, 4
    repe cmpsb
    jne _cmd_abt   	        	;next command

    call _display_endl
    mov si, strHelp               	;display help
    mov al, 0x01
    int 0x21
    call _display_space
    mov si, txtHelp              	;display help
    mov al, 0x01
    int 0x21

    mov si, strCmdOne               	;display command
    mov al, 0x01
    int 0x21
    mov si, strCmdTwo             
    mov al, 0x01
    int 0x21
    mov si, strCmdThree
    mov al, 0x01
    int 0x21
    mov si, strCmdFour
    mov al, 0x01
    int 0x21
    mov si, strCmdFive             
    mov al, 0x01
    int 0x21
    mov si, strCmdSix
    mov al, 0x01
    int 0x21
    jmp _cmd_done


_cmd_abt:               
    mov si, strCmd0
    mov di, cmdAbt
    mov cx, 4
    repe cmpsb
    jne _cmd_exit   	        	;next command
        
    call _display_endl
    mov si, txtAbout               	;display about
    mov al, 0x01
    int 0x21
    call _display_space
    mov si, strAbout              	;display about
    mov al, 0x01
    int 0x21
    call _display_space

    mov si, strMajorAbt             
    mov al, 0x01
    int 0x21
    mov si, strMinorAbt
    mov al, 0x01
    int 0x21
    jmp _cmd_done

        				; exit shell
_cmd_exit:              
    mov si, strCmd0
    mov di, cmdExit
    mov cx, 5
    repe cmpsb
    jne _cmd_unknown            	;next command

    je _shell_end                   	;exit from shell


_cmd_unknown:
    call _display_endl
    mov si, msgUnknownCmd           	;unknown command
    mov al, 0x01
    int 0x21

_cmd_done:
    					;call _display_endl
    jmp _shell_begin
        
_shell_end:
    ret

_get_command:
        				;initiate count
    mov BYTE [cmdChrCnt], 0x00
    mov di, strUserCmd

_get_cmd_start:
    mov ah, 0x10            		;get character
    int 0x16

    cmp al, 0x00            		;check if extended key
    je _extended_key
    cmp al, 0xE0            		;check if new extended key
    je _extended_key

    cmp al, 0x08            		;check if backspace pressed
    je _backspace_key

    cmp al, 0x0D            		;check if Enter pressed
    je _enter_key

    mov bh, [cmdMaxLen]             	;check if maxlen reached
    mov bl, [cmdChrCnt]
    cmp bh, bl
    je _get_cmd_start
        				;add char to buffer, display it and start again
    mov [di], al                    	;add char to buffer
    inc di                              ;increment buffer pointer
    inc BYTE [cmdChrCnt]    		;inc count

    mov ah, 0x0E                    	;display character
    mov bl, 0x07
    int 0x10
    jmp _get_cmd_start

_extended_key:                  	;extended key - do nothing now
    jmp _get_cmd_start

_backspace_key:
    mov bh, 0x00                    	;check if count = 0
    mov bl, [cmdChrCnt]
    cmp bh, bl
    je _get_cmd_start          		;yes, do nothing
        
    dec BYTE [cmdChrCnt]    		;dec count
    dec di
        				;check if beginning of line
    mov ah, 0x03                	;read cursor position
    mov bh, 0x00
    int 0x10

    cmp dl, 0x00
    jne _move_back
    dec dh
    mov dl, 79
    mov ah, 0x02
    int 0x10

    mov ah, 0x09            		; display without moving cursor
    mov al, ' '
    mov bh, 0x00
    mov bl, 0x07
    mov cx, 1                       	; times to display
    int 0x10
    jmp _get_cmd_start

_move_back:
    mov ah, 0x0E            		; BIOS teletype acts on backspace!
    mov bh, 0x00
    mov bl, 0x07
    int 0x10
    mov ah, 0x09           		; display without moving cursor
    mov al, ' '
    mov bh, 0x00
    mov bl, 0x07
    mov cx, 1                       	; times to display
    int 0x10
    jmp _get_cmd_start

_enter_key:
    mov BYTE [di], 0x00
    ret

_split_cmd:
        				;adjust si/di
    mov si, strUserCmd
        				;mov di, strCmd0
        				;move blanks
_split_mb0_start:
    cmp BYTE [si], 0x20
    je _split_mb0_nb
    jmp _split_mb0_end

_split_mb0_nb:
    inc si
    jmp _split_mb0_start

_split_mb0_end:
    mov di, strCmd0

_split_1_start:                 	;get first string
    cmp BYTE [si], 0x20
    je _split_1_end
    cmp BYTE [si], 0x00
    je _split_1_end
    mov al, [si]
    mov [di], al
    inc si
    inc di
    jmp _split_1_start

_split_1_end:
    mov BYTE [di], 0x00
        				;move blanks
_split_mb1_start:
    cmp BYTE [si], 0x20
    je _split_mb1_nb
    jmp _split_mb1_end

_split_mb1_nb:
    inc si
    jmp _split_mb1_start

_split_mb1_end:
    mov di, strCmd1

_split_2_start:                 	;get second string
    cmp BYTE [si], 0x20
    je _split_2_end
    cmp BYTE [si], 0x00
    je _split_2_end
    mov al, [si]
    mov [di], al
    inc si
    inc di
    jmp _split_2_start

_split_2_end:
    mov BYTE [di], 0x00
			        	;move blanks
_split_mb2_start:
    cmp BYTE [si], 0x20
    je _split_mb2_nb
    jmp _split_mb2_end

_split_mb2_nb:
    inc si
    jmp _split_mb2_start

_split_mb2_end:
    mov di, strCmd2

_split_3_start:                 	;get third string
    cmp BYTE [si], 0x20
    je _split_3_end
    cmp BYTE [si], 0x00
    je _split_3_end
    mov al, [si]
    mov [di], al
    inc si
    inc di
    jmp _split_3_start

_split_3_end:
    mov BYTE [di], 0x00
        				;move blanks
_split_mb3_start:
    cmp BYTE [si], 0x20
    je _split_mb3_nb
    jmp _split_mb3_end

_split_mb3_nb:
    inc si
    jmp _split_mb3_start

_split_mb3_end:
    mov di, strCmd3


_split_4_start:                 	;get fourth string
    cmp BYTE [si], 0x20
    je _split_4_end
    cmp BYTE [si], 0x00
    je _split_4_end
    mov al, [si]
    mov [di], al
    inc si
    inc di
    jmp _split_4_start

_split_4_end:
    mov BYTE [di], 0x00
        				;move blanks
_split_mb4_start:
    cmp BYTE [si], 0x20
    je _split_mb4_nb
    jmp _split_mb4_end

_split_mb4_nb:
    inc si
    jmp _split_mb4_start

_split_mb4_end:
    mov di, strCmd4


_split_5_start:                 	;get last string
    cmp BYTE [si], 0x20
    je _split_5_end
    cmp BYTE [si], 0x00
    je _split_5_end
    mov al, [si]
    mov [di], al
    inc si
    inc di
    jmp _split_5_start

_split_5_end:
    mov BYTE [di], 0x00
    ret

_display_space:
    mov ah, 0x0E                        ; BIOS teletype
    mov al, 0x20
    mov bh, 0x00                        ; display page 0
    mov bl, 0x07                        ; text attribute
    int 0x10                            ; invoke BIOS
    ret

_display_endl:
    mov ah, 0x0E            		; BIOS teletype acts on newline!
    mov al, 0x0D
    mov bh, 0x00
    mov bl, 0x07
    int 0x10
    mov ah, 0x0E            		; BIOS teletype acts on linefeed!
    mov al, 0x0A
    mov bh, 0x00
    mov bl, 0x07
    int 0x10
    ret

_display_prompt:
    mov si, strPrompt
    mov al, 0x01
    int 0x21
    ret



[SEGMENT .data]
    strWelcomeMsg db  "Welcome to GeoLiz NaviOS", 0x00
    strPrompt     db  "==>", 0x00
    cmdMaxLen     db  255                     ;maximum length of commands

    strOsName     db  "GeoLiz", 0x00    ;OS details
    strMajorVer   db  "0", 0x00
    strMinorVer   db  ".7", 0x0D, 0x0A, 0x00

    strHelp       db  "List of ", 0x00    ;Help
    strCmdOne     db  "ver-Get version ", 0x0D, 0x0A, 0x00
    strCmdTwo     db  "exit-Reboot ", 0x0D, 0x0A, 0x00
    strCmdThree   db  "date-Get date today ", 0x0D, 0x0A, 0x00
    strCmdFour    db  "time-Get time now ", 0x0D, 0x0A, 0x00
    strCmdFive    db  "help-list commands ", 0x0D, 0x0A, 0x00
    strCmdSix     db  "abt-about creator", 0x0D, 0x0A, 0x00

    strAbout      db  "GeoLiz NaviOS", 0x0D, 0x0A, 0x00  ;about OS
    strMajorAbt   db  "Creators: Geo and Liz", 0x0D, 0x0A, 0x00
    strMinorAbt   db  " Created: Sept.20,2007", 0x0D, 0x0A, 0x00

    cmdVer        db  "ver", 0x00             ; internal commands
    cmdExit       db  "exit", 0x00
    cmdDate       db  "date", 0x00
    cmdTime       db  "time", 0x00
    cmdHlp        db  "help", 0x00
    cmdAbt        db  "abt", 0x00
    cmdCls        db  "cls", 0x00


    datestring times 0Eh db 0 

    txtVersion    db  "Version", 0x00 	;messages and other strings
    txtHelp       db  "Commands:", 0x0D, 0x0A, 0x00
    txtAbout      db  "About", 0x0D, 0x0A, 0x00
    msgUnknownCmd db  "Unknown command!", 0x00


[SEGMENT .bss]
    strUserCmd    resb    256             ;buffer for user commands
    cmdChrCnt     resb    1               ;count of characters
    strCmd0       resb    256             ;buffers for the command components
    strCmd1       resb    256
    strCmd2       resb    256
    strCmd3       resb    256
    strCmd4       resb    256

;********************end of the kernel code********************
Attachments
;*************************************************************************
;the ultimate boot-strap loader
;to load a file from a DOS FAT12 floppy as the OS
;*************************************************************************
[BITS 16]
[ORG 0x0000]
jmp     START
     
     OEM_ID                db "QUASI-OS"
     BytesPerSector        dw 0x0200
     SectorsPerCluster     db 0x01
     ReservedSectors       dw 0x0001
     TotalFATs             db 0x02
     MaxRootEntries        dw 0x00E0
     TotalSectorsSmall     dw 0x0B40
     MediaDescriptor       db 0xF0
     SectorsPerFAT         dw 0x0009
     SectorsPerTrack       dw 0x0012
     NumHeads              dw 0x0002
     HiddenSectors         dd 0x00000000
     TotalSectorsLarge     dd 0x00000000
     DriveNumber           db 0x00
     Flags                 db 0x00
     Signature             db 0x29
     VolumeID              dd 0xFFFFFFFF
     VolumeLabel           db "QUASI  BOOT"
     SystemID              db "FAT12   "
     
     START:
     ; code located at 0000:7C00, adjust segment registers
          cli
          mov     ax, 0x07C0
          mov     ds, ax
          mov     es, ax
          mov     fs, ax
          mov     gs, ax
     ; create stack
          mov     ax, 0x0000
          mov     ss, ax
          mov     sp, 0xFFFF
          sti
     ; post message
          mov     si, msgLoading
          call    DisplayMessage
     LOAD_ROOT:
     ; compute size of root directory and store in cx
          xor     cx, cx
          xor     dx, dx
          mov     ax, 0x0020                          ; 32 byte directory entry
          mul     WORD [MaxRootEntries]               ; total size of directory
          div     WORD [BytesPerSector]               ; sectors used by directory
          xchg    ax, cx
     ; compute location of root directory and store in ax
          mov     al, BYTE [TotalFATs]                ; number of FATs
          mul     WORD [SectorsPerFAT]                ; sectors used by FATs
          add     ax, WORD [ReservedSectors]          ; adjust for bootsector
          mov     WORD [datasector], ax               ; base of root directory
          add     WORD [datasector], cx
     ; read root directory into memory (7C00:0200)
          mov     bx, 0x0200                          ; copy root dir above bootcode
          call    ReadSectors
     ; browse root directory for binary image
          mov     cx, WORD [MaxRootEntries]           ; load loop counter
          mov     di, 0x0200                          ; locate first root entry
     .LOOP:
          push    cx
          mov     cx, 0x000B                          ; eleven character name
          mov     si, ImageName                       ; image name to find
          push    di
     rep  cmpsb                                       ; test for entry match
          pop     di
          je      LOAD_FAT
          pop     cx
          add     di, 0x0020                          ; queue next directory entry
          loop    .LOOP
          jmp     FAILURE
     LOAD_FAT:
     ; save starting cluster of boot image
          mov     si, msgCRLF
          call    DisplayMessage
          mov     dx, WORD [di + 0x001A]
          mov     WORD [cluster], dx                  ; files first cluster
     ; compute size of FAT and store in cx
          xor     ax, ax
          mov     al, BYTE [TotalFATs]                ; number of FATs
          mul     WORD [SectorsPerFAT]                ; sectors used by FATs
          mov     cx, ax
     ; compute location of FAT and store in ax
          mov     ax, WORD [ReservedSectors]          ; adjust for bootsector
     ; read FAT into memory (7C00:0200)
          mov     bx, 0x0200                          ; copy FAT above bootcode
          call    ReadSectors
     ; read image file into memory (0100:0000)
          mov     si, msgCRLF
          call    DisplayMessage
          mov     ax, 0x0100                          ; destination of image CS
          mov     es, ax
          mov     bx, 0x0000                          ; destination for image IP
          push    bx
     LOAD_IMAGE:
          mov     ax, WORD [cluster]                  ; cluster to read
          pop     bx                                  ; buffer to read into
          call    ClusterLBA                          ; convert cluster to LBA
          xor     cx, cx
          mov     cl, BYTE [SectorsPerCluster]        ; sectors to read
          call    ReadSectors
          push    bx
     ; compute next cluster
          mov     ax, WORD [cluster]                  ; identify current cluster
          mov     cx, ax                              ; copy current cluster
          mov     dx, ax                              ; copy current cluster
          shr     dx, 0x0001                          ;
     ;divide by two
          add     cx, dx                              ; sum for (3/2)
          mov     bx, 0x0200                          ; location of FAT in memory
          add     bx, cx                              ; index into FAT
          mov     dx, WORD [bx]                       ; read two bytes from FAT
          test    ax, 0x0001
          jnz     .ODD_CLUSTER
     .EVEN_CLUSTER:
          and     dx, 0000111111111111b               ; take low twelve bits
         jmp     .DONE
     .ODD_CLUSTER:
          shr     dx, 0x0004                          ; take high twelve bits
     .DONE:
          mov     WORD [cluster], dx                  ; store new cluster
          cmp     dx, 0x0FF0                          ; test for end of file
          jb      LOAD_IMAGE
     DONE:
          mov     si, msgCRLF
          call    DisplayMessage
          push    WORD 0x0100
          push    WORD 0x0000
          retf
     FAILURE:
          mov     si, msgFailure
          call    DisplayMessage
          mov     ah, 0x00
          int     0x16                                ; await keypress
          int     0x19                                ; warm boot computer
     
     ;*************************************************************************
     ; PROCEDURE DisplayMessage
     ; display ASCIIZ string at ds:si via BIOS
     ;*************************************************************************
     DisplayMessage:
          lodsb                                       ; load next character
          or      al, al                              ; test for NUL character
          jz      .DONE
          mov     ah, 0x0E                            ; BIOS teletype
          mov     bh, 0x00                            ; display page 0
          mov     bl, 0x07                            ; text attribute
          int     0x10                                ; invoke BIOS
          jmp     DisplayMessage
     .DONE:
          ret
     
     ;*************************************************************************
     ; PROCEDURE ReadSectors
     ; reads cx sectors from disk starting at ax into
     ;memory location es:bx
     ;*************************************************************************
     ReadSectors:
     .MAIN
          mov     di, 0x0005                          ; five retries for error
     .SECTORLOOP
          push    ax
          push    bx
          push    cx
          call    LBACHS
          mov     ah, 0x02                            ; BIOS read sector
          mov     al, 0x01                            ; read one sector
          mov     ch, BYTE [absoluteTrack]            ; track
          mov     cl, BYTE [absoluteSector]           ; sector
          mov     dh, BYTE [absoluteHead]             ; head
          mov     dl, BYTE [DriveNumber]              ; drive
          int     0x13                                ; invoke BIOS
          jnc     .SUCCESS                            ; test for read error
          xor     ax, ax                              ; BIOS reset disk
          int     0x13                                ; invoke BIOS
          dec     di                                  ; decrement error counter
          pop     cx
          pop     bx
          pop     ax
          jnz     .SECTORLOOP                         ; attempt to read again
          int     0x18
     .SUCCESS
          mov     si, msgProgress
          call    DisplayMessage
          pop     cx
          pop     bx
          pop     ax
          add     bx, WORD [BytesPerSector]           ; queue next buffer
          inc     ax                                  ; queue next sector
          loop    .MAIN                               ; read next sector
          ret
     
     ;*************************************************************************
     ; PROCEDURE ClusterLBA
     ; convert FAT cluster into LBA addressing scheme
     ; LBA = (cluster - 2) * sectors per cluster
     ;*************************************************************************
     ClusterLBA:
          sub     ax, 0x0002                          ; zero base cluster number
          xor     cx, cx
          mov     cl, BYTE [SectorsPerCluster]        ; convert byte to word
          mul     cx
          add     ax, WORD [datasector]               ; base data sector
          ret
     
     ;*************************************************************************
     ; PROCEDURE LBACHS
     ; convert ax LBA addressing scheme to CHS addressing scheme
     ; absolute sector = (logical sector / sectors per track) + 1
     ; absolute head   = (logical sector / sectors per track) MOD number of heads
     ; absolute track  = logical sector / (sectors per track * number of heads)
     ;*************************************************************************
     LBACHS:
          xor     dx, dx                              ; prepare dx:ax for operation
          div     WORD [SectorsPerTrack]              ; calculate
          inc     dl                                  ; adjust for sector 0
          mov     BYTE [absoluteSector], dl
          xor     dx,
;*****************start of the kernel code***************
[org 0x000]
[bits 16]
[SEGMENT .text]

;START #####################################################
    mov ax, 0x0100                      ;location where kernel is loaded
    mov ds, ax
    mov es, ax
    
    cli
    mov ss, ax                          ;stack segment
    mov sp, 0xFFFF                      ;stack pointer at 64k limit
    sti

    push dx
    push es
    xor ax, ax
    mov es, ax
    cli
    mov word [es:0x21*4], _int0x21      ; setup interrupt service
    mov [es:0x21*4+2], cs
    sti
    pop es
    pop dx

    mov si, strWelcomeMsg   		; load message
    mov al, 0x01            		; request sub-service 0x01
    int 0x21

    call _shell                         ; call the shell
    
    int 0x19                ; reboot
;END #######################################################

_int0x21:
    _int0x21_ser0x01:       ;service 0x01
    cmp al, 0x01            ;see if service 0x01 wanted
    jne _int0x21_end        ;goto next check (now it is end)
    
_int0x21_ser0x01_start:
    lodsb                   ; load next character
    or  al, al              ; test for NUL character
    jz  _int0x21_ser0x01_end
    mov ah, 0x0E            ; BIOS teletype
    mov bh, 0x00            ; display page 0
    mov bl, 0x07            ; text attribute
    int 0x10                ; invoke BIOS
    jmp _int0x21_ser0x01_start
    _int0x21_ser0x01_end:
    jmp _int0x21_end

    _int0x21_end:
    iret

_shell:
    _shell_begin:
    					;move to next line
    call _display_endl
    					;display prompt
    call _display_prompt
    					;get user command
    call _get_command
               				;split command into components
    call _split_cmd
        				;check command & perform action
        				; empty command
_cmd_none:              
    mov si, strCmd0
    cmp BYTE [si], 0x00
    jne _cmd_ver                	;next command
    jmp _cmd_done
        
    					; display version
_cmd_ver:               
    mov si, strCmd0
    mov di, cmdVer
    mov cx, 4
    repe cmpsb
    jne _cmd_cls   	        	;next command
        
    call _display_endl
    mov si, strOsName               	;display version
    mov al, 0x01
    int 0x21
    call _display_space
    mov si, txtVersion              	;display version
    mov al, 0x01
    int 0x21
    call _display_space

    mov si, strMajorVer             
    mov al, 0x01
    int 0x21
    mov si, strMinorVer
    mov al, 0x01
    int 0x21
    jmp _cmd_done

_cmd_cls:               
    mov si, strCmd0
    mov di, cmdCls
    mov cx, 4
    repe cmpsb
    jne _cmd_date   	        	;next command
        

    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl
    call _display_endl

    mov bh, 0
    mov dl, 0
    mov dh, 00
    mov ah, 02
    int 10h
    jmp _cmd_done

_cmd_date:               
    mov si, strCmd0
    mov di, cmdDate
    mov cx, 4
    repe cmpsb
    jne _cmd_time   	        	;next command
        

    jmp overdata 

    overdata: 
        mov ah,4    
        int 1Ah    

        mov di,datestring  

        mov al,dh     
        call byte2hex 
        mov al,'-'   
        stosb         
        mov al,dl    
        call byte2hex
        mov al,'-'    
        stosb       
        mov ax,cx    
        call word2hex 
        mov al,'$'    
        stosb        

        mov dx,datestring     ;just like "Hello World!"
        mov ah,9      
        int 21h
        mov ah,4Ch   
        int 21h

    word2hex:
        mov bx,ax        
        shr ax,12         
        call nyb2hex     
        mov ax,bx        
        shr ax,8          
        call nyb2hex    
       mov ax,bx
    byte2hex:
        mov bx,ax   
        shr ax,4
        call nyb2hex
        mov ax,bx
    nyb2hex:
        and al,0Fh    
        cmp al,10     
                  
        ;sbb al,105  
        ;das         
        jc okdigit   
        add al,7     
    okdigit:
        add al,30h   
        ;int 029h     
        stosb         
        ret          

    jmp _cmd_done

_cmd_time: 
    mov si, strCmd0
    mov di, cmdTime
    mov cx, 4
    repe cmpsb
    jne _cmd_hlp

    jmp _WasteTime

    global _WasteTime
     
    _WasteTime:
        mov  bx, sp
        mov  bx, [ss:bx+02h]

        push si
        push di

        mov  ah, 00h
        int  1Ah
        
        mov  di, cx
        mov  si, dx

    .Waster:        
        mov  ah, 00h
        int  1Ah

        sub  dx, si
        sbb  cx, di

        cmp  cx, 0
        jne  .EndOfProc

        cmp  dx, bx
        jb   .Waster

    .EndOfProc:
        pop  di
        pop  si
        ret


    jmp _cmd_done

_cmd_hlp:
    mov si, strCmd0
    mov di, cmdHlp
    mov cx, 4
    repe cmpsb
    jne _cmd_abt   	        	;next command

    call _display_endl
    mov si, strHelp               	;display help
    mov al, 0x01
    int 0x21
    call _display_space
    mov si, txtHelp              	;display help
    mov al, 0x01
    int 0x21

    mov si, strCmdOne               	;display command
    mov al, 0x01
    int 0x21
    mov si, strCmdTwo             
    mov al, 0x01
    int 0x21
    mov si, strCmdThree
    mov al, 0x01
    int 0x21
    mov si, strCmdFour
    mov al, 0x01
    int 0x21
    mov si, strCmdFive             
    mov al, 0x01
    int 0x21
    mov si, strCmdSix
    mov al, 0x01
    int 0x21
    jmp _cmd_done


_cmd_abt:               
    mov si, strCmd0
    mov di, cmdAbt
    mov cx, 4
    repe cmpsb
    jne _cmd_exit   	        	;next command
        
    call _display_endl
    mov si, txtAbout               	;display about
    mov al, 0x01
    int 0x21
    call _display_space
    mov si, strAbout              	;display about
    mov al, 0x01
    int 0x21
    call _display_space

    mov si, strMajorAbt             
    mov al, 0x01
    int 0x21
    mov si, strMinorAbt
    mov al, 0x01
    int 0x21
    jmp _cmd_done

        				; exit shell
_cmd_exit:              
    mov si, strCmd0
    mov di, cmdExit
    mov cx, 5
    repe cmpsb
    jne _cmd_unknown            	;next command

    je _shell_end                   	;exit from shell


_cmd_unknown:
    call _display_endl
    mov si, msgUnknownCmd           	;unknown command
    mov al, 0x01
    int 0x21

_cmd_done:
    					;call _display_endl
    jmp _shell_begin
        
_shell_end:
    ret

_get_command:
        				;initiate count
    mov BYTE [cmdChrCnt], 0x00
    mov di, strUserCmd

_get_cmd_start:
    mov ah, 0x10            		;get character
    int 0x16

    cmp al, 0x00            		;check if extended key
    je _extended_key
    cmp al, 0xE0            		;check if new extended key
    je _extended_key

    cmp al, 0x08            		;check if backspace pressed
    je _backspace_key

    cmp al, 0x0D            		;check if Enter pressed
    je _enter_key

    mov bh, [cmdMaxLen]             	;check if maxlen reached
    mov bl, [cmdChrCnt]
    cmp bh, bl
    je _get_cmd_start
        				;add char to buffer, display it and start again
    mov [di], al                    	;add char to buffer
    inc di                              ;increment buffer pointer
    inc BYTE [cmdChrCnt]    		;inc count

    mov ah, 0x0E                    	;display character
    mov bl, 0x07
    int 0x10
    jmp _get_cmd_start

_extended_key:                  	;extended key - do nothing now
    jmp _get_cmd_start

_backspace_key:
    mov bh, 0x00                    	;check if count = 0
    mov bl, [cmdChrCnt]
    cmp bh, bl
    je _get_cmd_start          		;yes, do nothing
        
    dec BYTE [cmdChrCnt]    		;dec count
    dec di
        				;check if beginning of line
    mov ah, 0x03                	;read cursor position
    mov bh, 0x00
    int 0x10

    cmp dl, 0x00
    jne _move_back
    dec dh
    mov dl, 79
    mov ah, 0x02
    int 0x10

    mov ah, 0x09            		; display without moving cursor
    mov al, ' '
    mov bh, 0x00
    mov bl, 0x07
    mov cx, 1                       	; times to display
    int 0x10
    jmp _get_cmd_start

_move_back:
    mov ah, 0x0E            		; BIOS teletype acts on backspace!
    mov bh, 0x00
    mov bl, 0x07
    int 0x10
    mov ah, 0x09           		; display without moving cursor
    mov al, ' '
    mov bh, 0x00
    mov bl, 0x07
    mov cx, 1                       	; times to display
    int 0x10
    jmp _get_cmd_start

_enter_key:
    mov BYTE [di], 0x00
    ret

_split_cmd:
        				;adjust si/di
    mov si, strUserCmd
        				;mov di, strCmd0
        				;move blanks
_split_mb0_start:
    cmp BYTE [si], 0x20
    je _split_mb0_nb
    jmp _split_mb0_end

_split_mb0_nb:
    inc si
    jmp _split_mb0_start

_split_mb0_end:
    mov di, strCmd0

_split_1_start:                 	;get first string
    cmp BYTE [si], 0x20
    je _split_1_end
    cmp BYTE [si], 0x00
    je _split_1_end
    mov al, [si]
    mov [di], al
    inc si
    inc di
    jmp _split_1_start

_split_1_end:
    mov BYTE [di], 0x00
        				;move blanks
_split_mb1_start:
    cmp BYTE [si], 0x20
    je _split_mb1_nb
    jmp _split_mb1_end

_split_mb1_nb:
    inc si
    jmp _split_mb1_start

_split_mb1_end:
    mov di, strCmd1

_split_2_start:                 	;get second string
    cmp BYTE [si], 0x20
    je _split_2_end
    cmp BYTE [si], 0x00
    je _split_2_end
    mov al, [si]
    mov [di],
This question has already been answered. Start a new discussion instead.