Assembly Language
S.A.M. HANDLER
Less typing for your Atari's voiceby Chris Bone
Owners of S.A.M. (Software Automatic Mouth) can use this program to define the voice synthesizer as an I/O device-much like a printer. This allows you to program S.A.M. commands with less typing. This BASIC program will run on all Atari computers of any memory configuration-but you need S.A.M. software and a disk drive. Antic Disk subscribers, load S.A.M. and RECITER, then RUN "D:SAMHANDL,BAS".
S.A.M. (Tronix, $59.95) is the sole software-only voice synthesizer
for Atari computers. It costs considerably less than "black box"
synthesizer hardware and sounds just about as good. With a little
experience, you can understand just about everything S.A.M. says.
It's somewhat cumbersome to use, though-you must enter speech
into a string, then execute a USR call.
This program makes using S.A.M. a good deal easier, and even
adds a few extra capabilities. Type in Listing 1, check it with TYPO,
and SAVE a copy. You don't need to type Listing 2 (SAMHANDL.ASM on
the Antic disk) in order to use the program. Listing 2 shows the
source code for the machine language portion of the BASIC program.
First load S.A.M. and RECITER according to the S.A.M. documentation.
Then load the S.A.M. Handler and RUN it.
The program sets up a handler to allow the Operating System
to treat S.A.M. as any other Input/Output device. To "speak," all
you need to do is OPEN a channel for output to device V: (voice) (e.g.
OPEN #1,8,0,"V:") and anything printed to that channel (such as: PRINT
#1:"HELLO") is spoken by S.A.M.!
Now you can also have S.A.M. read out a program listing by LOADing
the program, then executing LIST "V: ". I use this to have S.A.,M.
read long DATA statements that I've typed in from published listings, while
I check the statements on the printed page. This saves much of the
time and frustration that's usually involved in checking a program.
The S.A.M. Handler remains active as long as you don't turn
off the computer or press [RESET]. if the latter occurs, reinitialize the
handler by executing A=USR(1536).
PROGRAM TAKE-APART
This take-apart refers to the assembly language portion of the S.A.M. handler, Listing 2.
150- 410 Initialize the handler.
430-1020 The handler itself. Lines 620-690 check for
an end-of-line character, and if found, place a period at the end of the
text to allow S.A.M.'s voice to drop in inflection and to speak the contents
of the buffer.
710- 750 Check for comma and, if found, send a space after
the comma. This is necessary for DATA lines, because if there are
numbers on both sides of a comma, S.A.M. normally doesn't recognize it.
Chris Bone is one of Antic's readers from England, from Watford, Herts., to be exact
Program Listings:
Listing 1: SAMHANDL.BAS Download
Listing 2: SAMHANDL.ASM Download / View