NAME    DAVID

;    DAVID'S MS-FORTRAN Runtime DOS INTERFACE.
;
;    MACRO DEFINITIONS
SET_DTA MACRO  BUFFER
        MOV     DX,OFFSET DGROUP:BUFFER
        MOV     AH,1AH
        INT     33
        ENDM
SEARCH_FIRST MACRO  FCB
             MOV  DX,OFFSET DGROUP:FCB
             MOV  AH,11H
             INT  33
             ENDM
DISPLAY  MACRO  STRING
         MOV  DX,OFFSET DGROUP:STRING
         MOV  AH,09H
         INT  33
         ENDM
SEARCH_NEXT MACRO FCB
            MOV  DX,OFFSET DGROUP:FCB
            MOV  AH,12H
            INT  33
            ENDM
CONVERT  MACRO   VALUE,BASE,DEST
         LOCAL  TABLE,START
         JMP   START
TABLE    DB  "0123456789ABCDEF"
START:   MOV  AL,VALUE
         XOR  AH,AH
         XOR  BX,BX
         DIV  BASE
         MOV  BL,AL
         MOV  AL,CS:TABLE[BX]
         MOV  DEST,AL
         MOV  BL,AH
         MOV  AL,CS:TABLE[BX]
         MOV  DEST[1],AL
         ENDM
GET_TIME MACRO
         MOV AH,2CH
         INT 33
         ENDM
GET_DATE MACRO
         MOV  AH,2AH
         INT  33
         ENDM
PAGE +
;
;       DGROUP, DATA   segment    class DATA
;
DATA    SEGMENT PUBLIC 'DATA'
    TIME  DB  "00:00:00.00",13,10,"$"
    TEN   DB  10
DATA    ENDS

DGROUP  GROUP   DATA
CODE    SEGMENT 'CODE'
        ASSUME  CS:CODE,DS:DGROUP,SS:DGROUP
PUBLIC  SHWTIM,GHOURS,GMINUT,GSECON,G100S,GDAYOW,GMONTH,GETDAY
;DOSFN:  Call DOS Operating System
;
GHOURS  PROC    FAR
        PUSH    BP
        GET_TIME
        XOR  AH,AH
        MOV  AL,CH
        POP  BP
        RET  4
GHOURS  ENDP
;
GMINUT  PROC   FAR
        PUSH    BP
        GET_TIME
        XOR   AH,AH
        MOV   AL,CL
        POP   BP
        RET   4
GMINUT  ENDP
;
GSECON  PROC    FAR
        PUSH    BP
        GET_TIME
        XOR  AH,AH
        MOV  AL,DH
        POP   BP
        RET   4
GSECON  ENDP
;
G100S   PROC   FAR
        PUSH    BP
        GET_TIME
        XOR     AH,AH
        MOV     AL,DL
        POP     BP
        RET     4
G100S   ENDP
;
SHWTIM  PROC    FAR
        PUSH    BP
        GET_TIME
        CONVERT  CH,DS:TEN,DS:TIME
        CONVERT  CL,DS:TEN,DS:TIME[3]
        CONVERT  DH,DS:TEN,DS:TIME[6]
        CONVERT  DL,DS:TEN,DS:TIME[9]
        DISPLAY  TIME
        POP     BP
        RET
SHWTIM  ENDP
;
;
;
GMONTH  PROC   FAR
        PUSH    BP
        GET_DATE
        XOR    AH,AH
        MOV    AL,DH
        POP    BP
        RET    4
GMONTH  ENDP
;
GETDAY  PROC   FAR
        PUSH    BP
        GET_DATE
        XOR    AH,AH
        MOV    AL,DL
        POP    BP
        RET    4
GETDAY  ENDP
;
GDAYOW  PROC  FAR
        PUSH  BP
        GET_DATE
        XOR   AH,AH
        POP   BP
        RET   4
GDAYOW  ENDP
;
 CODE    ENDS

END
