; David Adamson

;PROGRAM NAME:       NOW.COM
;OUTPUT FORMAT:      Current date is 12-25-94
;                    Current time is 16:38:57

CODE    SEGMENT 
ASSUME  CS:CODE,DS:CODE,ES:NOTHING,SS:NOTHING
ORG     100h

BEGIN:
       mov     ax, cs
       mov     ds, ax
       MOV     DX,OFFSET DATE  ;Announce 'Current date is'
       CALL    PRINT_STRING
       MOV     AH,2Ah
       INT     21h             ;Get Date
       MOV     AL,DH           ;DH contains month(as number)
       MOV     BL,'-'        
       CALL    SHOWIT          ;call month     
       MOV     AL,DL           ;DL has day(as number)
       CALL    SHOWIT        
       MOV     AX,CX           ;CX contains year
       MOV     BL,64h          ;64h = 100
       DIV     BL              ;Split year 
       MOV     AL,AH           ;move year to al
       MOV     BL, 00          ;Used by 'JL Last_L'  
       CALL    SHOWIT          ;call year      
       MOV     DL,0Dh          ;0D = CR
       INT     21h             ;Display_character from DL
       MOV     DL,0Ah          ;0A = LF
       INT     21h             ;Display_character from DL
       MOV     DX,OFFSET TIME  ;Announce 'Current time is'
       CALL    PRINT_STRING
       MOV     AH,2Ch
       INT     21h             ;Get Time
       MOV     BL,3Ah          ;3Ah = ':'
       MOV     AL,CH           ;CH contains hour
       CALL    SHOWIT        
       MOV     AL,CL           ;CL contains minutes
       CALL    SHOWIT             
       MOV     BL,20h        
       MOV     AL,DH           ;DH contains seconds
       CALL    SHOWIT        
       MOV     DL,0Dh          ;0D = CR
       INT     21h             ;Display_character from DL
       MOV     DL,0Ah          ;0A = LF
       INT     21h             ;Display_character from DL
       MOV     AX,4C00h  
       INT     21h             ;TERM_with_Return_Code
;---------------------------------------------------
SHOWIT: 
        PUSH    DX             ;Save DX, holds date or time
        MOV     DL,0Ah
        XOR     AH,AH         ;Zero AH
        DIV     DL            ;Div by 10
        OR      AX,3030h      ;Convert to ASCII
        MOV     DX,AX
        MOV     AH,02h
        INT     21h           ;Display_character from DL, First charter
        MOV     DL,DH       
        INT     21h           ;Display_character from DL, Second charter
        cmp     bl, 21h       ; Is it '/','-',or':'?
        JL      LAST_D        ; If not, quit
        MOV     DL,BL       
        INT     21h           ;Display_character from DL, '/' or ':'
        LAST_D:
        POP     DX            ;Restore DX
        RET                   ;End branch 
;---------------------------------------------------
PRINT_STRING:  MOV     AH,9                    ;Print string via DOS.
               INT     21H
               RET
;---------------------------------------------------

DATE DB 'Current date is $'
TIME DB 'Current time is $'

CODE  ENDS
        END  BEGIN



___ Blue Wave/QWK v2.12

--- Maximus 2.00
 * Origin: The Dragon's Lair - (334) 263-9272 (1:375/300)
