DUE DATE: Wednesday, March 13, 2002, at NOON to my mailbox in HRN 545
(no late submissions accepted!!!)
Summary
This project introduces students to direct hardware I/O programming
on IBM PC computers, writing a replacement Interrupt Service Routine,
and using timing services provided by the 8254 Programmable Interval Timer.
Your task is to write an installable alarm program, scheduled to
play sound on the PC speaker at the specified time. Your program should
have the following features:
- Allow the user to enter time (in hours and minutes) when the alarm
will be triggered at startup. It should accept time in either standard
format (1-12, am/pm) or military time (0-24). Display a message giving the
user some instructions.
- Play some interesting music when the alarm goes off. If you are like
me, and lack any musical talents, playing the musical scale from one
of our examples will suffice. It should, however, be more fun than
just a single tone.
- Allow the user to toggle the alarm on and off using the ALT-A key combination.
In addition, if the alarm has been triggered, turning it off
with ALT-A should also stop any sound playing.
- If the alarm is not turned off, it should
stop playing sound after one minute.
- Include some sort of a status display, so that the
user knows whether the alarm is on.
- In addition, the alarm should function as a clock, continuosly
displaying current time of day in the upper right-hand corner of the
screen.
Notes
- In order for your program to stay in memory but allow DOS to return
to the command prompt, it will have to be designed as a TSR (Terminate and
Stay Resident utility.) Use DOS function 31h of int 21h to accomplish this.
- To properly keep track of time, your program would have to hook one
of the timer tick interrupt routines. It is recommended
that you use int 1Ch to make it easier.
- To properly catch any key presses, you program would also have to
hook the keyboard interrupt (int 9).
- Turning the alarm off once it has been triggered, and then turning
it back on within one minute should NOT re-trigger it.
- Standard project guidelines apply:
be neat, write comments, check for errors.
- Turn in your assignment ON TIME. If it is not in my
mailbox at noon on the due date, it is late, and therefore not accepted.
Period. Slip it under my door of HRN 539 if the office is closed.
Extra Credit
- (15 pts) Add SNOOZE functionality to your alarm that can
be triggered by hitting ALT-S key combination. Use a 10 second snooze time
period, that is if the user hits SNOOZE, the alarm should
stop playing sound for 10 seconds, and then start plaing
it again until the user turns it off with ALT-A. Note: in order
to receive extra credit, the main assignment has to be
completely functional. In other words, don't leave out a required part but
do the extra credit instead.
What to turn in
A printout of your code and a floppy disk containing your source
file and resulting binaries. You may also use the submit directories,
if you wish. However, please turn in a hard copy of your source code
in either case.
Alex Fedosov
2002-03-24