V22.0201 (sec. 1) - Computer Systems Organization (Honors)

Assignment 3

You are to create a program which can play a simple tune on the PC. The program should accept as keyboard input a sequence of up to 16 letters (A - G). When the enter key is struck, the program should play that sequence of notes using the speaker. At any point the program should accept the backspace key (delete the last letter typed), the enter key (play the current tune), or a valid letter (add to the current tune).  Any invalid input should result in some error signal, such as a single low-frequency note.

The notes played should be the octave starting with A = 440 Hz:

Note Frequency
A 440
B 494
C 523
D 587
E 659
F 698
G 784
You should have a brief pause between each note.

For (1 point) extra credit:  display the frequency of the A (as a decimal number). The up arrow and down arrow keys should shift the frequencies by one octave (double or halve all the frequencies). If you submit the extra credit version, you do not have to also submit the regular assignment; if the 'tuning' feature does not work, we will still give credit for the regular assignment.

Be sure to include comments in your program, and in particular include a line with your name.

You may want to make use of the NOTE procedure, part of Dewar's PADDLE program; this procedure plays one note on the speaker.  If you do use NOTE, you must include it as part of the program you submit.

This assignment is due on October 29th.  There is a penalty of 1/2 point (out of a total of 7 points) for each day late.

Email your assignment (the listing file produced by the Dewar assembler) to the grader.  Include your name and "Asgn 3" in the subject line.