'Sun  Apr 23, 1989   2:19:38 pm 
'***********************************************************************
'This routine replaces DATE$ using plain English, with day of week.
'***********************************************************************
DECLARE FUNCTION newdate$ ()
TYPE RegType
     ax    AS INTEGER
     bx    AS INTEGER
     cx    AS INTEGER
     dx    AS INTEGER
     bp    AS INTEGER
     si    AS INTEGER
     di    AS INTEGER
     flags AS INTEGER
END TYPE
DIM SHARED inregs AS RegType, outregs AS RegType
DIM SHARED day$(7), month$(12)
       
     PRINT newdate$

FUNCTION newdate$
     day$(0) = "Sunday"
     day$(1) = "Monday"
     day$(2) = "Tuesday"
     day$(3) = "Wednesday"
     day$(4) = "Thursday"
     day$(5) = "Friday"
     day$(6) = "Saturday"
     month$(1) = "Jan"
     month$(2) = "Feb"
     month$(3) = "Mar"
     month$(4) = "Apr"
     month$(5) = "May"
     month$(6) = "Jun"
     month$(7) = "Jul"
     month$(8) = "Aug"
     month$(9) = "Sep"
     month$(10) = "Oct"
     month$(11) = "Nov"
     month$(12) = "Dec"
     t1 = &H2A00: t2 = 0: t3 = 0: t4 = 0
     inregs.ax = t1: inregs.bx = t2: inregs.cx = t3: inregs.dx = t4
     CALL interrupt(&H21, inregs, outregs)
     t1 = outregs.ax: t2 = outregs.bx: t3 = outregs.cx: t4 = outregs.dx
     day = t1 - ((FIX(t1 / 256)) * 256)
     day$ = day$(day)
     year = t3
     year$ = LTRIM$(RTRIM$(STR$(year)))
     month = FIX(t4 / 256)
     month$ = month$(month)
     date = t4 - (month * 256)
     newdate$ = day$ + SPACE$(2) + month$ + STR$(date) + "," + STR$(year)
END FUNCTION

