| | |
I neeeeeeeed Your Help
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2006
Posts: 1
Reputation:
Solved Threads: 0
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.
>>.STOCK 100
should be STACK, not STOCK
Assembly Syntax (Toggle Plain Text)
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
Last edited by Ancient Dragon; Dec 27th, 2006 at 6:06 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
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).
Last edited by Ancient Dragon; Dec 28th, 2006 at 11:06 am.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Other Threads in the Assembly Forum
- Previous Thread: how to do serial communication and conversion to parallel
- Next Thread: which SDK?
| Thread Tools | Search this Thread |






