A Vocal Hex Dump For The KIM-1
William C. Clements, Jr. Dept. Of Chemical And Metallurgical Engineering The University Of Alabama
This article describes a program for the KIM-1 that begins at a given RAM address and pronounces the contents of successive locations, with appropriate pauses inserted for naturalness, just as a person would read off a list of hex words. It uses what is almost certainly the least expensive speech synthesis equipment and software now on the market; for about $100, the single-board computer owner can experiment with computer-generated speech. The program given here is concerned with removing a little of the drudgery from proofreading programs in RAM. The program runs on a KIM-1 to which has been added a 6522 VIA and at least 1K of expansion RAM.
Personal computers surely are the ultimate in modern versatility, making everything from dungeons-and-dragons to home automation to self-instruction in computer science available to nearly everyone. But no matter how much fun it is to use the polished end result of one's programming, the checking of machine code to see if it was entered correctly remains pure drudgery, and the cleverest technology isn't likely to ever place it on a level with playing a rousing game of motorcycle racing with the computer. For those of us with video terminals but no printer, it can be especially irritating; one's eyes move up to the screen dump, down to the written program, up and down, kind of like watching a vertical tennis game, until the eyes have had it.
It would help to have someone read off the code from the screen so the programmer can keep his eyes on the paper. But another person isn't always available, and anyhow this is just the kind of work that computers were invented to handle, right? The only trouble is, most speech synthesizers are expensive, and are usually for the S-100 bus, not directly usable with the KIM or similar single-board machine. Now, thanks to Texas Instruments, Inc. and Dave Kemp of East Coast Micro Products, these objections have been neatly removed. The T-I Speak and Spell™, an inexpensive ($50 range) preprogrammed speech synthesizer computer was developed to teach kids to spell.1 Its internal ROMs contain the coding to vocalize hundreds of words plus several phrases, the letters of the alphabet, and the numerals. But it's more than a toy. The device has an internal edge connector intended for plugging in additional vocabulary ROMs, and the various control lines that operate the speech synthesizer are available there. East Coast Micro Products market a small interface kit, model SP-11, that plugs onto the edge connector, and performs the level shifting and parallel-to-serial conversion needed for interfacing the synthesizer to a computer. The whole thing fits into the battery compartment of the Speak and Spell™, making a very neat package. Along with the interface board, you get extensive support software, a detailed explanation of how the synthesizer works, and five demo programs written for the SYM computer. The software includes a program for pronouncing individual hex characters whose ASCII representation has been placed in the accumulator, and uses the 6522 VIA that the SYM uses for I/0.
As mentioned at the start of this article, my immediate goal in purchasing the SP-1 was to use it with a KIM to read out memory words. The listing gives the resulting program. The user begins execution at BEGIN, types the first RAM address on the TTY, and the program reads 256 locations out on the Speak and Spell™. If you're checking fewer locations, just hit the reset key when you're through. If your program is longer, type in the next location and it will read you 256 more.
The comments in the listing should be self explanatory for the most part. Label references not defined in the listing (such as FPNT, OUTSPE, etc.) are mostly labels in the SP-1 software. GETBYT is a routine in the KIM monitor.
The SP-1 software is set up to use the 6522 Versatile Interface Adaptor on the SYM board, so unless you want to re-program extensively, your best bet is to add a 6522 to your KIM; you ought to have one anyhow if you're a serious KIMmer. Mine was already present on a VIDEO PLUS™ board that I use with my system1. If you don't have a VIA in your system, I suggest you refer to the articles listed in the footnotes3, 4. It should not be hard to provide one. The SP-1 software resides entirely in the KIM on-board memory with one exception: the speech data dictionary provided with the software requires 770 bytes of continuous memory in addition to the 478 bytes required by the SP-1 support software and by the vocal dump routine. None of the code is selfmodifying, so you can relocate it at will, even into EPROM where it will become a valuable utility. The only memory that has to be RAM is the twelve-byte frame buffer which I located between $17A0 and $17AB. If you do relocate, take care to adjust the entries in TABLE. These are address pointers to entries in the speech dictionary supplied with the SP-1. The accompanying program listing assumes that the dictionary resides between $2000 and $2302 in expansion memory.
0010 .BA $100 0020 ADLO .DE $A 0030 ADHI .DE $B 0035 SPNT .DE 2 0040 GETBYT .DE $1F9D 0050 FPNT .DE 4 0060 SPINIT .DE $200 0070 OUTSPE .DE $2D0 0100- 20 9D 1F 0080 BEGIN JSR GETBYT ;GET START 0103- 85 0B 0090 STA *ADHI ;ADDRESS 0105- 20 9D 1F 0100 JSR GETBYT ;FROM 0108- 85 0A 0110 STA *ADLO ;KEYBOARD 010A- A9 A0 0120 LDA #$A0 ;SET FRAME 010C- 85 04 0130 STA *FPNT ;POINTER 010E- A9 17 0140 LDA #$17 ;TO 0110- 85 05 0150 STA *FPNT+1 ;$17A0 (12 LOCS NEEDED) 0112- 20 00 02 0160 JSR SPINIT ;SET UP TIMERS 0115- 20 2D 01 0170 JSR PAUSE ;PAUSE BEFORE SPEAKING 0118- A0 FF 0180 LDY #$FF ;USE Y TO COUNT LOCS. 011A- C8 0190 LOOP INY ;DUMPED 011B- 98 0200 TYA 011C- 48 0210 PHA 011D- B1 0A 0220 LDA (ADLO), Y ;GET CURRENT CONTENTS FOR DUMP 011F- 20 31 01 0230 JSR SAY ;PRONOUNCE CONTENTS; 0122- 20 2D 01 0240 JSR PAUSE ;THEN PAUSE 0125- 68 0250 PLA 0126- A8 0260 TAY 0127- C9 FF 0270 CMP #$FF 0129- D0 EF 0280 BNE LOOP ;LOOP 256 TIMES 012B- F0 D3 0290 BEQ BEGIN ;GET NEW START 012D- A2 20 0300 PAUSE LDX #$20 ;SET POINTER FOR PAUSE 012F- D0 0E 0310 BNE SP1 ;BRANCH TO SPEECH PAUSE 0131- 48 0320 SAY PHA ;SAVE CONTENTS 0132- 29 F0 0330 AND #$F0 ;GET HIGH-ORDER NYBBLE 0134- 4A 0340 LSR A ;FORM INDEX 0135- 4A 0350 LSR A ;INTO ADDRESS TABLE 0136- 4A 0360 LSR A 0137- 20 3E 01 0370 JSR SPEAK ;SPEAK FIRST CHARACTER 013A- 68 0380 PLA 013B- 29 0F 0390 AND #$F ;GET LOW-ORDER NYBBLE 013D- 0A 0400 ASL A ;FORM INDEX 013E- AA 0410 SPEAK TAX ;AND FALL THROUGH 013F- BD 4C 01 0420 SP1 LDA TABLE, X ;TO SPEAK IT 0142- 85 02 0430 STA *SPNT 0144- BD 4D 01 0440 LDA TABLE+1, X 0147- 85 03 0450 STA *SPNT +1 0149- 4C D0 02 0460 JMP OUTSPE 014C- 00 20 49 0470 TABLE .BY 0 $20 $49 $20 $76 $20 $9F $20 ;ADDRESS TABLE FOR 014F- 20 76 20 0152- 9F 20 0154- DB 20 11 0480 .BY $DB $20 $11 $21 $52 $21 $86 $21 ; SPEECH DICTIONARY 0157- 21 52 21 015A- 86 21 015C- B7 21 DA 0490 .BY $B7 $21 $DA $21 $16 $22 $36 $22 015F- 21 16 22 0162- 36 22 0164- 61 22 8E 0500 .BY $61 $22 $8E $22 $B5 $22 $D0 $22 $FD $22 0167- 22 B5 22
The SP-1 utilities can be used for many other purposes. A great deal of information and some references concerned with speech synthesis using Linear Predictive Coding techniques are given in the literature supplied with the kit. With this material, you can make your KIM as talkative as you wish!
016A- D0 22 FD 016D- 22 0510 .EN LABEL FILE: [/ = EXTERNAL] /ADLO = 000A / ADHI = 000B /SPNT = 0002 /GETBYT = 1F9D /F PNT = 0004 /SPINIT = 0200 /OUTSPE = 02D0 BEGIN = 0100 LOOP = 011A PAUSE = 012D SAY = 0131 SPEAK = 013E SP1 = 013F TABLE = 014C //0000, 016E, 016E
- Speak and Spell is a trademark of Texas Instruments, Inc. VIDEO PLUS is a trademark of The Computerist, Inc.
- East Coast Micro Products, 1307 Beltram Ct., Odenton, Md. 21113.
- See 6502 User Notes, No. 13, p. 16 for information about adding a 6522 I/O board.
- See MICRO, No. 17, pp. 27-39 for a general description of the 6522.