944,183 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 3226
  • Assembly RSS
Dec 27th, 2006
0

I neeeeeeeed Your Help

Expand Post »





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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
alsami is offline Offline
1 posts
since Dec 2006
Dec 27th, 2006
0

Re: I neeeeeeeed Your Help

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.

Assembly Syntax (Toggle Plain Text)
  1. beginning of loop:
  2.  
  3. get current time, convert current hour and minutes to just minutes and compare it with the time in the schedule.
  4.  
  5. IF curtime >= Dr. E time
  6. diaplay Dr. E time
  7. else if curtime >= Dr. D time
  8. diaplay Dr. D time
  9. else if curtime >= Dr. C time
  10. diaplay Dr. C time
  11. else if curtime >= Dr. B time
  12. diaplay Dr. B time
  13. else if curtime >= Dr. A time
  14. diaplay Dr. A time
  15. else
  16. display nothing
  17.  
  18. 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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Dec 28th, 2006
0

Re: I neeeeeeeed Your Help

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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Abuhamad is offline Offline
2 posts
since Dec 2006
Dec 28th, 2006
0

Re: I neeeeeeeed Your Help

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: how to do serial communication and conversion to parallel
Next Thread in Assembly Forum Timeline: which SDK?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC