How I can write an assembly language program, which will constantly monitor the computer clock (date and time) and for a certain day and during meeting times, display
“MEETING FOR Dr. A” in the middle of the screen .


As an example to check your program, set you computer date to 19th of January
and test the program written for a sample date of 20th of January, 2007. The
meeting times on that day (20th of Jan) are given by;

MEETING FOR Dr. A = 5:14 AM
MEETING FOR Dr. B = 11:50 AM
MEETING FOR Dr. C = 2:52 PM or 14:52
MEETING FOR Dr. D = 5:13 PM or 17:13
MEETING FOR Dr. E = 6:43 PM or 18:43


the program should display “MEETING FOR Dr. A” when your computer
clock becomes 5:14 AM during January 20, 2007.

TILTE "EE 390"
.MODEL SMALL
.STOCK 100


VAR1 DB " MEETING FOR Dr. A "
VAR2 DB " MEETING FOR Dr. B "
VAR3 DB " MEETING FOR Dr. C "
VAR4 DB " MEETING FOR Dr. D "
VAR5 DB " MEETING FOR Dr. E "


.CODE

MOV AX,@DATA
MOV DS,AX


MOV AH, 2AH ;Get date, AL = day of week, CX = year, DL = day
INT 21H

MOV AH, 2CH ;Get time, CH = hour, CL = minutes, DH = seconds,
INT 21H ;DL = hundredths of a second

MOV AH, 2BH ;Set date:
MOV CX, 07D7H ;CX = year
MOV DH, 01H ;DH = month
MOV DL, 14H ;DL = day
CMP CX
INT 21H

MOV AH, 2DH ;Set time:
MOV CH, 05H ;CH = hour
MOV DH, 00H ;DH = seconds
MOV CL, 14H ;CL = minutes
MOV DL, 00H ;DL = hundredths of a second
INT 21H

MOV AH, 2DH ;Set time:
MOV CH, 11H ;CH = hour
MOV DH, 00H ;DH = seconds
MOV CL, 50H ;CL = minutes
MOV DL, 00H ;DL = hundredths of a second
INT 21H


MOV AH, 2DH ;Set time:
MOV CH, 14H ;CH = hour
MOV DH, 00H ;DH = seconds
MOV CL, 52H ;CL = minutes
MOV DL, 00H ;DL = hundredths of a second
INT 21H


MOV AH, 2DH ;Set time:
MOV CH, 17H ;CH = hour
MOV DH, 00H ;DH = seconds
MOV CL, 13H ;CL = minutes
MOV DL, 00H ;DL = hundredths of a second
INT 21H


MOV AH, 2DH ;Set time:
MOV CH, 18H ;CH = hour
MOV DH, 00H ;DH = seconds
MOV CL, 43H ;CL = minutes
MOV DL, 00H ;DL = hundredths of a second
INT 21H

Since we have five meetings a day, the program has to generate the related display output five times during that day.


thanks

you already have a schedule of doctors and times. Convert the times from HH:MM into just minutes for easy comparison. For example: 5:14 AM is (5*60)+14 = 314 minutes into the day.

beginning of loop:

  get current time, convert current hour and minutes to just minutes and compare it with the time in the schedule.  

IF curtime >= Dr. E time
    diaplay Dr. E time
else if curtime >= Dr. D time
    diaplay Dr. D time
else if curtime >= Dr. C time
    diaplay Dr. C time
else if curtime >= Dr. B time
    diaplay Dr. B time
else if curtime >= Dr. A time
    diaplay Dr. A time
else
   display nothing

delay for 1 minute then return to top of loop

>>.STOCK 100
should be STACK, not STOCK

Thank you ancient dragon for your help which I get big benefit from it.
the remaining part is who he can monitor the computer clock?


How you can monitor the computer clock?

you "monitor" the clock just as I described -- just poll it every minute. There are interrupts which you can hook that will call the interrupt function you write every clock tick, but that is way too often for your purose (18 to 100 times per second).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.