Classic Computer Magazine Archive COMPUTE! ISSUE 64 / SEPTEMBER 1985 / PAGE 10

 
Readers Feedback

 The Editors and Readers of COMPUTE!



64 Key Beeper
Is there a program for the Commodore 64 that will cause a beep when a key is pressed?
Jeffrey Gurr

The following program adds audible feedback to the keyboard of your 64, as found on Atari computers. (Ironically, owners of Atari 400s and 800s frequently write us for a way to turn off the built-in keyboard beep.) The program puts a short, interrupt-driven machine language routine in an unused memory area (679-760), activates the beep routine, then erases itself. Be sure to save a copy of the program before running it, and turn up the volume on your TV or monitor. This routine is designed to be used in direct mode (while you're typing a program, etc.) rather than in program mode (while a program is running). It doesn't interfere with most BASIC operations, but any program that creates other sounds, changes the hardware interrupt vector, or alters locations 3-4 and 679-760 may disrupt the beep or cause other problems. You should always disable the beep (press RUN/STOP-RESTORE) before running other programs. Enter SYS 679 to turn it back on.

1 S=679:N=S
2 READQ:IFQ=256THEN4
3 POKEN,Q:N=N+1:CK=CK+Q:GOTO2
4 IFCK<>9233THENPRINT"ERROR IN
   DATA":END
5 SYS(S):NEW
6 DATA 120,169,206,141,20,3,16
  9,2,141,21,3
7 DATA 162,0,138,157,0,212,232
  ,224,25,208,248
8 DATA 169,15,141,24,212,169,6
  7,141,5,212,169
9 DATA 17,141,1,212,88,96,165,
  197,201,64,240
10 DATA 30,197,3,208,6,165,4,2
   40,2,208,24
11 DATA 169,32,141,4,212,169,3
   3,141,4,212,165
12 DATA 197,133,3,169,1,133,4,
   208,4,169,0
13 DATA 133,4,76,49,234,256