Sys dsk 03

System disk 003.
 Working with Sound

Dinkit 003 now has I/O (input/output)! Called the PC speaker, will OK, that is just output only. Fine! Dinkit 003 now just has O!
In “System disk 003” we will be working with generating sound from the PC speaker. There are  two tools (subroutines) that were added to the kernels basic core called "Beepe" and "Beep". The first tool when called simply beeps the PC speaker. (BONK) Beepe is just used by the kernel for panic conditions. (When the system is dying) Beepe uses no interrupts or stack, just jump to it and beep the error code then shut down. "Beepe" has been added to Much of the kernel code, so that you know the an error has happened. (Great
for debugging) As a user the above will not have much interest to you, because this code is very stable. If you make changes to the kernel core and hear weird bees, you may want to find out what the mean.
Beep uses interrupts and is programmable. Beep use "S_wait" to give a constant wait time and constant tone independent of the CPU speed. This badly needed tool was never implemented in any of the 6 Ms-Dos versions. Thus games and other program would run out of control with higher speed CPU's. With the use of "Beep" and "S_wait" you can make interesting sound files. In time sound files of various types will become available for your use to cut and past into this project. There is three new lines of code to make the PC speaker work below.

     mov   dx,4000 <--- change this number to change pitch
     mov  bl,4 <--- change this number to change the on time
     call   beep

   mov    al,2
       call    wait

Put the code (in red) in to the “do_program” subroutine and you can beep the PC speaker most any pitch low or hi, long or short. Use the Wait instruction to place a pause between sounds you can place several beep instructions to play a short tune. programing never got any easier.  This is all great but why!  can’t I see any thing on the screen? You will heve to goto “System disk 004” to find out.

Download “System Disk 3”

Go to the download page and click on the “System disk 003” link