I neeeeeeeed Your Help

Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2006
Posts: 1
Reputation: alsami is an unknown quantity at this point 
Solved Threads: 0
alsami alsami is offline Offline
Newbie Poster

I neeeeeeeed Your Help

 
0
  #1
Dec 27th, 2006





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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,413
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1470
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: I neeeeeeeed Your Help

 
0
  #2
Dec 27th, 2006
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.

  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.
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 2
Reputation: Abuhamad is an unknown quantity at this point 
Solved Threads: 0
Abuhamad Abuhamad is offline Offline
Newbie Poster

Re: I neeeeeeeed Your Help

 
0
  #3
Dec 28th, 2006
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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,413
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1470
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: I neeeeeeeed Your Help

 
0
  #4
Dec 28th, 2006
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Assembly Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC