Home » CEEFAX disks » telesoftware10.adl » 29-10-88/T\SPK04
29-10-88/T\SPK04
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » CEEFAX disks » telesoftware10.adl |
Filename: | 29-10-88/T\SPK04 |
Read OK: | ✔ |
File size: | 3AFD bytes |
Load address: | FFFF4E0D |
Exec address: | FFFF432F |
File contents
The Acorn Speech System - by - Gordon Horsington ---------------------------------------------------- Module 4. Searching the word PHROM for word names. -------------------------------------------------- In the last module I showed you how to use the Read and Branch instruction to create a simple word interpreter. The interpreter was limited in its application because it was restricted to using only the ASCII associated words in word PHROM A, and only one word PHROM could be fitted into the computer when it was used. The program BRANCH did have the virtue of being a small program with a very simple algorithm. That simple algorithm can be elaborated to enable an interpreter to search for any of the available words by name and with more than one word PHROM fitted into the computer. If more than one word PHROM is fitted you cannot use the Read and Branch instruction. You can still multiply the ASCII code by two to quickly find the pointer for ASCII associated words but you can neither use the Read and Branch instruction to load the word PHROM address register with the speech data address nor can you find the pointer to the speech data for all the named words by multiplying the word name by two. The existance of the word names in word PHROM A allows you to search the word PHROM for the speech data. The first byte of the speech data follows the last byte of the associated word name. Searching the word PHROM must be done "intelligently". A crude search of every byte in the word PHROM is inappropriate for two reasons. Osbyte &9F and Osbyte &9E, which have to be used to make the search, are relatively slow at reading a byte from a word PHROM. A crude search of every byte in a 16k word PHROM takes about six and a half seconds even with a fast machine code program. The second reason for an intelligent search is that some word names, such as UH in word PHROM A, will be confused with speech data when a crude search is made from the begining to the end of a word PHROM. In order to make the search as fast as possible and to avoid searching the speech data for word names, it is necessary to use the list of pointers in the word PHROM header to indicate which bytes of a word PHROM are to be searched. The pointers indicate the first byte of the speech data for each word. A variable number of bytes immediately preceding each set of data bytes make up the word name for the speech data. It is only necessary to search a few bytes preceding the address stored in each pointer. If, for example, you want to find the data for the word NUMBER the program you use will need to compare the word in reverse order, ie. REBMUN, with the six bytes (with bits rotated) preceding the addresses stored in every word pointer until a match is found. This can be done using the Read Byte command to read the six bytes preceding the address contained in each pointer. The program will have to compare the stored bytes with REBMUN until the word name is found which matches REBMUN. The program should then stop searching the word PHROM. The word PHROM address register will be left pointing to the first byte of the required speech data. The Speak command can then be used to speak the required word. The algoritm used to create the program BRANCH can be modified to search for any word in word PHROM A. The following algorithm has been used in the program SEARCH. It does not use the quick but dangerous Read and Branch instruction. Instead it identifies ASCII associated words so that an extended search is not required to find their speech data. Other words have to be searched for a pointer at a time. 1) Read the word fron the keyboard. 2) If the word has two or more characters then go to 8) 3) If the word is a null string then go to 1) 4) The word has only one character so multiply the ASCII code by two to give the pointer address. 5) Transform the pointer address into the five bytes used by the Load Address command and load the word PHROM address register with the pointer address. 6) Read the two bytes stored in the pointer and transform the four nybbles in these two bytes into the five bytes required by the Load Address command. Load the word PHROM address register with the data address. 7) Execute the Speak instruction to speak the word. Return to BASIC. 8) The word name has more than one character. The word pointers in word PHROM A start at &00FE and continue until the end-of-pointers marker at &0248. The pointers are used starting at &00FE and ending when the end-of-pointers marker is read. To start with the "next pointer" will be &00FE. 9) Transform the two bytes of the next pointer address into the five bytes required by the Load Address command, load the word PHROM address register with the address of the next pointer and read the contents of the pointer. If the LSB = #&FF then return to BASIC. 10) Subtract the length of the word typed at the keyboard from the address stored in the pointer. Transform and load this modified address into the word PHROM address register. The word PHROM address register now points to the begining of the reverse ordered word name if it is the same as the word typed on the keyboard. 11) Compare every character of the word typed on the keyboard with every byte in the word PHROM. If they match the word has been found and the address register points to the first byte of the speech data. If they do not match then find the next pointer address and go to 9). 12) Execute the Speak instruction to speak the word. Return to BASIC. The program SEARCH elaborates this algorithm a little in order to print out the address at which it finds the speech data. This can be used to correct the addresses for B, BETWEEN, BOTH, and BUTTON, all of which are incorrectly listed in issue 2 of the Speech System User Guide. Load and run the program. Respond to the ? prompt by typing the name of any word in word PHROM A. You should type the name exactly as it is stored in the word PHROM. (TONE 1) is rejected because it it stored as (TONE1) but AVAIL will find the speech data for the word AVAILABLE because the program only attempts to match the number of characters typed on the keyboard. If you type a word which does not match with any of stored words the program returns to BASIC. If you type a part of a word name without starting with the first character of the word name, for example VAIL as part of AVAILABLE, you will generate an error and produce garbled speech. You could modify the program to trap and reject this error. The program SEARCH does not need to use the quick method of finding ASCII associated words in order to work properly. The program can be shortened by deleting lines 430 to 440 and lines 470 to 610. The program will still find the speech data for all the words and word-parts but it will take a little longer to find the ASCII associated words than it did with these extra lines. The full program is significantly faster at finding the data for the word Z than the shortened version because the shortened version has to search every word in word PHROM A before it finds Z. The full version finds the data for the word Z without any searching. 10 REM: SEARCH 20 buffer=&70 30 pointer=&80 40 workspace=pointer+2 50 length=pointer+4 60 testbyte=pointer+5 70 offset=pointer+6 80 temp=pointer+7 90 osnewl=&FFE7 100 oswrch=&FFEE 110 osword=&FFF1 120 osbyte=&FFF4 130 DIM mcode &200 140 FORpass=0TO2STEP2 150 P%=mcode 160 [ OPT pass 170 LDA #&EB \ read speech processor flag 180 LDX #0 190 LDY #&FF 200 JSR osbyte \ check for Acorn Speech upgrade 210 CPX #&FF \ X = #&FF if speech present 220 BEQ start 230 BRK 240 BRK 250 EQUS "No Speech upgrade" 260 BRK 270 .start 280 LDA #ASC("?") 290 JSR oswrch \ write ? as prompt for input 300 LDA #0 \ read string from keyboard 310 LDX #block MOD 256 \ LSB parameter block 320 LDY #block DIV 256 \ MSB parameter block 330 JSR osword \ read word to be spoken 340 BCC clear \ carry set if escape pressed 350 .escape 360 LDA #&7E 370 JSR osbyte \ acknowledge escape 380 BRK 390 BRK 400 EQUS "Escape" 410 BRK 420 .clear 430 CPY #2 \ are there 2 or more characters? 440 BCS word \ branch if there are, 450 CPY #0 \ if there are no characters - 460 BEQ start \ go back and get some. 470 LDA buffer \ load the ASCII character 480 ASL A \ multiply by 2 490 TAX \ LSB of pointer address 500 LDY #0 \ MSB of pointer address 510 JSR address \ write XY into address register 520 JSR read \ read LSB of speech data 530 JSR reverse \ reverse the bits 540 TAX \ LSB of speech data into X 550 STX workspace \ store LSB of data address 560 JSR read \ read MSB of speech data 570 JSR reverse \ reverse the bits 580 TAY \ MSB of speech data into Y 590 STY workspace+1 \ store MSB of data address 600 JSR address \ write XY into address register 610 JMP sayit \ speak the word 620 .word 630 STY length \ length of word name 640 DEY 650 STY offset \ length of word - 1 660 LDA buffer,Y 670 STA testbyte \ last char of word name 680 LDA #&FE \ LSB of word pointers 690 STA pointer \ LSB of pointer table 700 LDA #0 \ MSB of word pointers 710 STA pointer+1 \ MSB of pointer table 720 .search 730 LDA &FF \ poll escape flag 740 BMI escape \ branch if escape pressed 750 LDX pointer \ LSB for address register 760 LDY pointer+1 \ MSB for address register 770 TXA 780 CLC 790 ADC #2 \ add 2 to pointer for next time 800 STA pointer 810 TYA 820 ADC #0 830 STA pointer+1 840 JSR address \ write XY into address register 850 JSR read \ read LSB at this address 860 JSR reverse \ reverse the bits 870 CMP #&FF \ is it the termination byte? 880 BEQ return \ if yes return to BASIC 890 STA workspace \ store reversed LSB 900 JSR read \ read MSB 910 JSR reverse \ reverse the bits 920 STA workspace+1 \ store reversed MSB 930 LDA workspace \ load LSB 940 SEC 950 SBC length \ and subtract the length of the word 960 TAX \ LSB into X 970 LDA workspace+1 \ load MSB 980 SBC #0 990 TAY \ MSB into Y 1000 JSR address \ write XY into address register 1010 JSR read \ read last character from PHROM 1020 JSR rotate \ rotate the bits 1030 CMP testbyte \ is it the same as typed word? 1040 BNE search \ No, try next pointer 1050 LDX offset \ Yes, compare all characters 1060 .compare 1070 DEX 1080 BMI sayit \ if X=&FF word match found 1090 JSR read \ read next byte 1100 JSR rotate \ rotate the bits 1110 CMP buffer,X \ compare with typed word 1120 BNE search \ branch if no match 1130 BEQ compare \ compare next character 1140 .sayit 1150 LDA #&9F \ write to speech processor 1160 LDY #&50 \ speak command 1170 JSR osbyte \ speak the word 1180 LDA #ASC("&") \ hex symbol 1190 JSR oswrch 1200 LDA workspace+1 1210 JSR printhex \ print MSB of address 1220 LDA workspace 1230 JSR printhex \ print LSB of address 1240 JSR osnewl 1250 .return 1260 RTS \ return to BASIC 1270 .address 1280 TYA \ MSB is in Y register 1290 PHA \ push MSB twice 1300 PHA 1310 TXA \ LSB is in X register 1320 AND #&F \ isolate first nybble 1330 ORA #&40 \ OR it with Load Address command 1340 JSR write \ send command to speech processor 1350 TXA \ second nybble 1360 AND #&F0 1370 LSR A 1380 LSR A 1390 LSR A 1400 LSR A 1410 ORA #&40 1420 JSR write \ send command to speech processor 1430 PLA \ third nybble 1440 AND #&F 1450 ORA #&40 1460 JSR write \ send command to speech processor 1470 PLA \ fourth nybble 1480 AND #&F0 1490 LSR A 1500 LSR A 1510 LSR A 1520 LSR A 1530 ORA #&4C 1540 JSR write \ send command to speech processor 1550 LDA #&43 \ last byte always #&43 1560 .write 1570 TAY \ transfer command into Y register 1580 LDA #&9F \ write to speech processor 1590 JMP osbyte \ Osbyte and return 1600 .read 1610 LDA #&9F \ write to speech processor 1620 LDY #&10 \ read byte command 1630 JSR osbyte \ send read byte command 1640 LDA #&9E \ read speech processor 1650 JSR osbyte \ read next byte from PHROM 1660 TYA \ result in accumulator 1670 RTS 1680 .rotate 1690 PHA 1700 ROR A \ bit 0 into carry flag 1710 PLA 1720 ROR A \ rotate the byte read from PHROM 1730 RTS 1740 .reverse 1750 STA temp \ temporary store for byte 1760 ROL temp \ bit 7 into carry flag 1770 ROR A \ carry to bit 7 of accumulator 1780 ROL temp \ bit 6 into carry flag 1790 ROR A \ bit 7 to 6, carry to bit 7 1800 ROL temp \ bit 5 into carry 1810 ROR A \ and so on ... 1820 ROL temp 1830 ROR A 1840 ROL temp 1850 ROR A 1860 ROL temp 1870 ROR A 1880 ROL temp 1890 ROR A 1900 ROL temp 1910 ROR A \ bits in accumulator reversed 1920 RTS 1930 .printhex 1940 PHA 1950 LSR A 1960 LSR A 1970 LSR A 1980 LSR A 1990 JSR nybble \ print MS nybble in ASCII 2000 PLA \ and print LS nybble in ASCII 2010 .nybble 2020 AND #&F 2030 SED 2040 CLC 2050 ADC #&90 2060 ADC #&40 2070 CLD 2080 JMP oswrch 2090 .block 2100 EQUW buffer 2110 EQUB &F 2120 EQUB ASC(" ") 2130 EQUB ASC("~") 2140 ] 2150 NEXT 2160 CALL mcode
00000000 54 68 65 20 41 63 6f 72 6e 20 53 70 65 65 63 68 |The Acorn Speech| 00000010 20 53 79 73 74 65 6d 20 20 2d 20 20 62 79 20 20 | System - by | 00000020 2d 20 20 47 6f 72 64 6f 6e 20 48 6f 72 73 69 6e |- Gordon Horsin| 00000030 67 74 6f 6e 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |gton.-----------| 00000040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000060 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0d 4d 6f 64 75 6c |---------..Modul| 00000070 65 20 34 2e 20 53 65 61 72 63 68 69 6e 67 20 74 |e 4. Searching t| 00000080 68 65 20 77 6f 72 64 20 50 48 52 4f 4d 20 66 6f |he word PHROM fo| 00000090 72 20 77 6f 72 64 20 6e 61 6d 65 73 2e 0d 2d 2d |r word names..--| 000000a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000000d0 0d 0d 49 6e 20 74 68 65 20 6c 61 73 74 20 6d 6f |..In the last mo| 000000e0 64 75 6c 65 20 49 20 73 68 6f 77 65 64 20 79 6f |dule I showed yo| 000000f0 75 20 68 6f 77 20 74 6f 20 75 73 65 20 74 68 65 |u how to use the| 00000100 20 52 65 61 64 20 61 6e 64 20 42 72 61 6e 63 68 | Read and Branch| 00000110 20 69 6e 73 74 72 75 63 74 69 6f 6e 0d 74 6f 20 | instruction.to | 00000120 63 72 65 61 74 65 20 61 20 73 69 6d 70 6c 65 20 |create a simple | 00000130 77 6f 72 64 20 69 6e 74 65 72 70 72 65 74 65 72 |word interpreter| 00000140 2e 20 54 68 65 20 69 6e 74 65 72 70 72 65 74 65 |. The interprete| 00000150 72 20 77 61 73 20 6c 69 6d 69 74 65 64 20 69 6e |r was limited in| 00000160 20 69 74 73 0d 61 70 70 6c 69 63 61 74 69 6f 6e | its.application| 00000170 20 62 65 63 61 75 73 65 20 69 74 20 77 61 73 20 | because it was | 00000180 72 65 73 74 72 69 63 74 65 64 20 74 6f 20 75 73 |restricted to us| 00000190 69 6e 67 20 6f 6e 6c 79 20 74 68 65 20 41 53 43 |ing only the ASC| 000001a0 49 49 20 61 73 73 6f 63 69 61 74 65 64 0d 77 6f |II associated.wo| 000001b0 72 64 73 20 69 6e 20 77 6f 72 64 20 50 48 52 4f |rds in word PHRO| 000001c0 4d 20 41 2c 20 61 6e 64 20 6f 6e 6c 79 20 6f 6e |M A, and only on| 000001d0 65 20 77 6f 72 64 20 50 48 52 4f 4d 20 63 6f 75 |e word PHROM cou| 000001e0 6c 64 20 62 65 20 66 69 74 74 65 64 20 69 6e 74 |ld be fitted int| 000001f0 6f 20 74 68 65 0d 63 6f 6d 70 75 74 65 72 20 77 |o the.computer w| 00000200 68 65 6e 20 69 74 20 77 61 73 20 75 73 65 64 2e |hen it was used.| 00000210 0d 0d 54 68 65 20 70 72 6f 67 72 61 6d 20 42 52 |..The program BR| 00000220 41 4e 43 48 20 64 69 64 20 68 61 76 65 20 74 68 |ANCH did have th| 00000230 65 20 76 69 72 74 75 65 20 6f 66 20 62 65 69 6e |e virtue of bein| 00000240 67 20 61 20 73 6d 61 6c 6c 20 70 72 6f 67 72 61 |g a small progra| 00000250 6d 20 77 69 74 68 20 61 0d 76 65 72 79 20 73 69 |m with a.very si| 00000260 6d 70 6c 65 20 61 6c 67 6f 72 69 74 68 6d 2e 20 |mple algorithm. | 00000270 54 68 61 74 20 73 69 6d 70 6c 65 20 61 6c 67 6f |That simple algo| 00000280 72 69 74 68 6d 20 63 61 6e 20 62 65 20 65 6c 61 |rithm can be ela| 00000290 62 6f 72 61 74 65 64 20 74 6f 20 65 6e 61 62 6c |borated to enabl| 000002a0 65 0d 61 6e 20 69 6e 74 65 72 70 72 65 74 65 72 |e.an interpreter| 000002b0 20 74 6f 20 73 65 61 72 63 68 20 66 6f 72 20 61 | to search for a| 000002c0 6e 79 20 6f 66 20 74 68 65 20 61 76 61 69 6c 61 |ny of the availa| 000002d0 62 6c 65 20 77 6f 72 64 73 20 62 79 20 6e 61 6d |ble words by nam| 000002e0 65 20 61 6e 64 20 77 69 74 68 0d 6d 6f 72 65 20 |e and with.more | 000002f0 74 68 61 6e 20 6f 6e 65 20 77 6f 72 64 20 50 48 |than one word PH| 00000300 52 4f 4d 20 66 69 74 74 65 64 20 69 6e 74 6f 20 |ROM fitted into | 00000310 74 68 65 20 63 6f 6d 70 75 74 65 72 2e 0d 0d 49 |the computer...I| 00000320 66 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 |f more than one | 00000330 77 6f 72 64 20 50 48 52 4f 4d 20 69 73 20 66 69 |word PHROM is fi| 00000340 74 74 65 64 20 79 6f 75 20 63 61 6e 6e 6f 74 20 |tted you cannot | 00000350 75 73 65 20 74 68 65 20 52 65 61 64 20 61 6e 64 |use the Read and| 00000360 20 42 72 61 6e 63 68 0d 69 6e 73 74 72 75 63 74 | Branch.instruct| 00000370 69 6f 6e 2e 20 59 6f 75 20 63 61 6e 20 73 74 69 |ion. You can sti| 00000380 6c 6c 20 6d 75 6c 74 69 70 6c 79 20 74 68 65 20 |ll multiply the | 00000390 41 53 43 49 49 20 63 6f 64 65 20 62 79 20 74 77 |ASCII code by tw| 000003a0 6f 20 74 6f 20 71 75 69 63 6b 6c 79 20 66 69 6e |o to quickly fin| 000003b0 64 0d 74 68 65 20 70 6f 69 6e 74 65 72 20 66 6f |d.the pointer fo| 000003c0 72 20 41 53 43 49 49 20 61 73 73 6f 63 69 61 74 |r ASCII associat| 000003d0 65 64 20 77 6f 72 64 73 20 62 75 74 20 79 6f 75 |ed words but you| 000003e0 20 63 61 6e 20 6e 65 69 74 68 65 72 20 75 73 65 | can neither use| 000003f0 20 74 68 65 20 52 65 61 64 0d 61 6e 64 20 42 72 | the Read.and Br| 00000400 61 6e 63 68 20 69 6e 73 74 72 75 63 74 69 6f 6e |anch instruction| 00000410 20 74 6f 20 6c 6f 61 64 20 74 68 65 20 77 6f 72 | to load the wor| 00000420 64 20 50 48 52 4f 4d 20 61 64 64 72 65 73 73 20 |d PHROM address | 00000430 72 65 67 69 73 74 65 72 20 77 69 74 68 20 74 68 |register with th| 00000440 65 0d 73 70 65 65 63 68 20 64 61 74 61 20 61 64 |e.speech data ad| 00000450 64 72 65 73 73 20 6e 6f 72 20 63 61 6e 20 79 6f |dress nor can yo| 00000460 75 20 66 69 6e 64 20 74 68 65 20 70 6f 69 6e 74 |u find the point| 00000470 65 72 20 74 6f 20 74 68 65 20 73 70 65 65 63 68 |er to the speech| 00000480 20 64 61 74 61 20 66 6f 72 0d 61 6c 6c 20 74 68 | data for.all th| 00000490 65 20 6e 61 6d 65 64 20 77 6f 72 64 73 20 62 79 |e named words by| 000004a0 20 6d 75 6c 74 69 70 6c 79 69 6e 67 20 74 68 65 | multiplying the| 000004b0 20 77 6f 72 64 20 6e 61 6d 65 20 62 79 20 74 77 | word name by tw| 000004c0 6f 2e 0d 0d 54 68 65 20 65 78 69 73 74 61 6e 63 |o...The existanc| 000004d0 65 20 6f 66 20 74 68 65 20 77 6f 72 64 20 6e 61 |e of the word na| 000004e0 6d 65 73 20 69 6e 20 77 6f 72 64 20 50 48 52 4f |mes in word PHRO| 000004f0 4d 20 41 20 61 6c 6c 6f 77 73 20 79 6f 75 20 74 |M A allows you t| 00000500 6f 20 73 65 61 72 63 68 20 74 68 65 0d 77 6f 72 |o search the.wor| 00000510 64 20 50 48 52 4f 4d 20 66 6f 72 20 74 68 65 20 |d PHROM for the | 00000520 73 70 65 65 63 68 20 64 61 74 61 2e 20 54 68 65 |speech data. The| 00000530 20 66 69 72 73 74 20 62 79 74 65 20 6f 66 20 74 | first byte of t| 00000540 68 65 20 73 70 65 65 63 68 20 64 61 74 61 20 66 |he speech data f| 00000550 6f 6c 6c 6f 77 73 0d 74 68 65 20 6c 61 73 74 20 |ollows.the last | 00000560 62 79 74 65 20 6f 66 20 74 68 65 20 61 73 73 6f |byte of the asso| 00000570 63 69 61 74 65 64 20 77 6f 72 64 20 6e 61 6d 65 |ciated word name| 00000580 2e 0d 0d 53 65 61 72 63 68 69 6e 67 20 74 68 65 |...Searching the| 00000590 20 77 6f 72 64 20 50 48 52 4f 4d 20 6d 75 73 74 | word PHROM must| 000005a0 20 62 65 20 64 6f 6e 65 20 22 69 6e 74 65 6c 6c | be done "intell| 000005b0 69 67 65 6e 74 6c 79 22 2e 20 41 20 63 72 75 64 |igently". A crud| 000005c0 65 20 73 65 61 72 63 68 20 6f 66 0d 65 76 65 72 |e search of.ever| 000005d0 79 20 62 79 74 65 20 69 6e 20 74 68 65 20 77 6f |y byte in the wo| 000005e0 72 64 20 50 48 52 4f 4d 20 69 73 20 69 6e 61 70 |rd PHROM is inap| 000005f0 70 72 6f 70 72 69 61 74 65 20 66 6f 72 20 74 77 |propriate for tw| 00000600 6f 20 72 65 61 73 6f 6e 73 2e 20 4f 73 62 79 74 |o reasons. Osbyt| 00000610 65 20 26 39 46 0d 61 6e 64 20 4f 73 62 79 74 65 |e &9F.and Osbyte| 00000620 20 26 39 45 2c 20 77 68 69 63 68 20 68 61 76 65 | &9E, which have| 00000630 20 74 6f 20 62 65 20 75 73 65 64 20 74 6f 20 6d | to be used to m| 00000640 61 6b 65 20 74 68 65 20 73 65 61 72 63 68 2c 20 |ake the search, | 00000650 61 72 65 20 72 65 6c 61 74 69 76 65 6c 79 0d 73 |are relatively.s| 00000660 6c 6f 77 20 61 74 20 72 65 61 64 69 6e 67 20 61 |low at reading a| 00000670 20 62 79 74 65 20 66 72 6f 6d 20 61 20 77 6f 72 | byte from a wor| 00000680 64 20 50 48 52 4f 4d 2e 20 41 20 63 72 75 64 65 |d PHROM. A crude| 00000690 20 73 65 61 72 63 68 20 6f 66 20 65 76 65 72 79 | search of every| 000006a0 20 62 79 74 65 20 69 6e 0d 61 20 31 36 6b 20 77 | byte in.a 16k w| 000006b0 6f 72 64 20 50 48 52 4f 4d 20 74 61 6b 65 73 20 |ord PHROM takes | 000006c0 61 62 6f 75 74 20 73 69 78 20 61 6e 64 20 61 20 |about six and a | 000006d0 68 61 6c 66 20 73 65 63 6f 6e 64 73 20 65 76 65 |half seconds eve| 000006e0 6e 20 77 69 74 68 20 61 20 66 61 73 74 0d 6d 61 |n with a fast.ma| 000006f0 63 68 69 6e 65 20 63 6f 64 65 20 70 72 6f 67 72 |chine code progr| 00000700 61 6d 2e 20 54 68 65 20 73 65 63 6f 6e 64 20 72 |am. The second r| 00000710 65 61 73 6f 6e 20 66 6f 72 20 61 6e 20 69 6e 74 |eason for an int| 00000720 65 6c 6c 69 67 65 6e 74 20 73 65 61 72 63 68 20 |elligent search | 00000730 69 73 20 74 68 61 74 0d 73 6f 6d 65 20 77 6f 72 |is that.some wor| 00000740 64 20 6e 61 6d 65 73 2c 20 73 75 63 68 20 61 73 |d names, such as| 00000750 20 55 48 20 69 6e 20 77 6f 72 64 20 50 48 52 4f | UH in word PHRO| 00000760 4d 20 41 2c 20 77 69 6c 6c 20 62 65 20 63 6f 6e |M A, will be con| 00000770 66 75 73 65 64 20 77 69 74 68 20 73 70 65 65 63 |fused with speec| 00000780 68 0d 64 61 74 61 20 77 68 65 6e 20 61 20 63 72 |h.data when a cr| 00000790 75 64 65 20 73 65 61 72 63 68 20 69 73 20 6d 61 |ude search is ma| 000007a0 64 65 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 |de from the begi| 000007b0 6e 69 6e 67 20 74 6f 20 74 68 65 20 65 6e 64 20 |ning to the end | 000007c0 6f 66 20 61 20 77 6f 72 64 0d 50 48 52 4f 4d 2e |of a word.PHROM.| 000007d0 0d 0d 49 6e 20 6f 72 64 65 72 20 74 6f 20 6d 61 |..In order to ma| 000007e0 6b 65 20 74 68 65 20 73 65 61 72 63 68 20 61 73 |ke the search as| 000007f0 20 66 61 73 74 20 61 73 20 70 6f 73 73 69 62 6c | fast as possibl| 00000800 65 20 61 6e 64 20 74 6f 20 61 76 6f 69 64 20 73 |e and to avoid s| 00000810 65 61 72 63 68 69 6e 67 20 74 68 65 0d 73 70 65 |earching the.spe| 00000820 65 63 68 20 64 61 74 61 20 66 6f 72 20 77 6f 72 |ech data for wor| 00000830 64 20 6e 61 6d 65 73 2c 20 69 74 20 69 73 20 6e |d names, it is n| 00000840 65 63 65 73 73 61 72 79 20 74 6f 20 75 73 65 20 |ecessary to use | 00000850 74 68 65 20 6c 69 73 74 20 6f 66 20 70 6f 69 6e |the list of poin| 00000860 74 65 72 73 20 69 6e 0d 74 68 65 20 77 6f 72 64 |ters in.the word| 00000870 20 50 48 52 4f 4d 20 68 65 61 64 65 72 20 74 6f | PHROM header to| 00000880 20 69 6e 64 69 63 61 74 65 20 77 68 69 63 68 20 | indicate which | 00000890 62 79 74 65 73 20 6f 66 20 61 20 77 6f 72 64 20 |bytes of a word | 000008a0 50 48 52 4f 4d 20 61 72 65 20 74 6f 20 62 65 0d |PHROM are to be.| 000008b0 73 65 61 72 63 68 65 64 2e 0d 0d 54 68 65 20 70 |searched...The p| 000008c0 6f 69 6e 74 65 72 73 20 69 6e 64 69 63 61 74 65 |ointers indicate| 000008d0 20 74 68 65 20 66 69 72 73 74 20 62 79 74 65 20 | the first byte | 000008e0 6f 66 20 74 68 65 20 73 70 65 65 63 68 20 64 61 |of the speech da| 000008f0 74 61 20 66 6f 72 20 65 61 63 68 20 77 6f 72 64 |ta for each word| 00000900 2e 20 41 0d 76 61 72 69 61 62 6c 65 20 6e 75 6d |. A.variable num| 00000910 62 65 72 20 6f 66 20 62 79 74 65 73 20 69 6d 6d |ber of bytes imm| 00000920 65 64 69 61 74 65 6c 79 20 70 72 65 63 65 64 69 |ediately precedi| 00000930 6e 67 20 65 61 63 68 20 73 65 74 20 6f 66 20 64 |ng each set of d| 00000940 61 74 61 20 62 79 74 65 73 20 6d 61 6b 65 0d 75 |ata bytes make.u| 00000950 70 20 74 68 65 20 77 6f 72 64 20 6e 61 6d 65 20 |p the word name | 00000960 66 6f 72 20 74 68 65 20 73 70 65 65 63 68 20 64 |for the speech d| 00000970 61 74 61 2e 20 49 74 20 69 73 20 6f 6e 6c 79 20 |ata. It is only | 00000980 6e 65 63 65 73 73 61 72 79 20 74 6f 20 73 65 61 |necessary to sea| 00000990 72 63 68 20 61 20 66 65 77 0d 62 79 74 65 73 20 |rch a few.bytes | 000009a0 70 72 65 63 65 64 69 6e 67 20 74 68 65 20 61 64 |preceding the ad| 000009b0 64 72 65 73 73 20 73 74 6f 72 65 64 20 69 6e 20 |dress stored in | 000009c0 65 61 63 68 20 70 6f 69 6e 74 65 72 2e 0d 0d 49 |each pointer...I| 000009d0 66 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 20 |f, for example, | 000009e0 79 6f 75 20 77 61 6e 74 20 74 6f 20 66 69 6e 64 |you want to find| 000009f0 20 74 68 65 20 64 61 74 61 20 66 6f 72 20 74 68 | the data for th| 00000a00 65 20 77 6f 72 64 20 4e 55 4d 42 45 52 20 74 68 |e word NUMBER th| 00000a10 65 20 70 72 6f 67 72 61 6d 0d 79 6f 75 20 75 73 |e program.you us| 00000a20 65 20 77 69 6c 6c 20 6e 65 65 64 20 74 6f 20 63 |e will need to c| 00000a30 6f 6d 70 61 72 65 20 74 68 65 20 77 6f 72 64 20 |ompare the word | 00000a40 69 6e 20 72 65 76 65 72 73 65 20 6f 72 64 65 72 |in reverse order| 00000a50 2c 20 69 65 2e 20 52 45 42 4d 55 4e 2c 20 77 69 |, ie. REBMUN, wi| 00000a60 74 68 0d 74 68 65 20 73 69 78 20 62 79 74 65 73 |th.the six bytes| 00000a70 20 28 77 69 74 68 20 62 69 74 73 20 72 6f 74 61 | (with bits rota| 00000a80 74 65 64 29 20 70 72 65 63 65 64 69 6e 67 20 74 |ted) preceding t| 00000a90 68 65 20 61 64 64 72 65 73 73 65 73 20 73 74 6f |he addresses sto| 00000aa0 72 65 64 20 69 6e 20 65 76 65 72 79 0d 77 6f 72 |red in every.wor| 00000ab0 64 20 70 6f 69 6e 74 65 72 20 75 6e 74 69 6c 20 |d pointer until | 00000ac0 61 20 6d 61 74 63 68 20 69 73 20 66 6f 75 6e 64 |a match is found| 00000ad0 2e 20 54 68 69 73 20 63 61 6e 20 62 65 20 64 6f |. This can be do| 00000ae0 6e 65 20 75 73 69 6e 67 20 74 68 65 20 52 65 61 |ne using the Rea| 00000af0 64 20 42 79 74 65 0d 63 6f 6d 6d 61 6e 64 20 74 |d Byte.command t| 00000b00 6f 20 72 65 61 64 20 74 68 65 20 73 69 78 20 62 |o read the six b| 00000b10 79 74 65 73 20 70 72 65 63 65 64 69 6e 67 20 74 |ytes preceding t| 00000b20 68 65 20 61 64 64 72 65 73 73 20 63 6f 6e 74 61 |he address conta| 00000b30 69 6e 65 64 20 69 6e 20 65 61 63 68 0d 70 6f 69 |ined in each.poi| 00000b40 6e 74 65 72 2e 20 54 68 65 20 70 72 6f 67 72 61 |nter. The progra| 00000b50 6d 20 77 69 6c 6c 20 68 61 76 65 20 74 6f 20 63 |m will have to c| 00000b60 6f 6d 70 61 72 65 20 74 68 65 20 73 74 6f 72 65 |ompare the store| 00000b70 64 20 62 79 74 65 73 20 77 69 74 68 20 52 45 42 |d bytes with REB| 00000b80 4d 55 4e 0d 75 6e 74 69 6c 20 74 68 65 20 77 6f |MUN.until the wo| 00000b90 72 64 20 6e 61 6d 65 20 69 73 20 66 6f 75 6e 64 |rd name is found| 00000ba0 20 77 68 69 63 68 20 6d 61 74 63 68 65 73 20 52 | which matches R| 00000bb0 45 42 4d 55 4e 2e 20 54 68 65 20 70 72 6f 67 72 |EBMUN. The progr| 00000bc0 61 6d 20 73 68 6f 75 6c 64 20 74 68 65 6e 0d 73 |am should then.s| 00000bd0 74 6f 70 20 73 65 61 72 63 68 69 6e 67 20 74 68 |top searching th| 00000be0 65 20 77 6f 72 64 20 50 48 52 4f 4d 2e 20 54 68 |e word PHROM. Th| 00000bf0 65 20 77 6f 72 64 20 50 48 52 4f 4d 20 61 64 64 |e word PHROM add| 00000c00 72 65 73 73 20 72 65 67 69 73 74 65 72 20 77 69 |ress register wi| 00000c10 6c 6c 20 62 65 0d 6c 65 66 74 20 70 6f 69 6e 74 |ll be.left point| 00000c20 69 6e 67 20 74 6f 20 74 68 65 20 66 69 72 73 74 |ing to the first| 00000c30 20 62 79 74 65 20 6f 66 20 74 68 65 20 72 65 71 | byte of the req| 00000c40 75 69 72 65 64 20 73 70 65 65 63 68 20 64 61 74 |uired speech dat| 00000c50 61 2e 20 54 68 65 20 53 70 65 61 6b 0d 63 6f 6d |a. The Speak.com| 00000c60 6d 61 6e 64 20 63 61 6e 20 74 68 65 6e 20 62 65 |mand can then be| 00000c70 20 75 73 65 64 20 74 6f 20 73 70 65 61 6b 20 74 | used to speak t| 00000c80 68 65 20 72 65 71 75 69 72 65 64 20 77 6f 72 64 |he required word| 00000c90 2e 0d 0d 54 68 65 20 61 6c 67 6f 72 69 74 6d 20 |...The algoritm | 00000ca0 75 73 65 64 20 74 6f 20 63 72 65 61 74 65 20 74 |used to create t| 00000cb0 68 65 20 70 72 6f 67 72 61 6d 20 42 52 41 4e 43 |he program BRANC| 00000cc0 48 20 63 61 6e 20 62 65 20 6d 6f 64 69 66 69 65 |H can be modifie| 00000cd0 64 20 74 6f 20 73 65 61 72 63 68 0d 66 6f 72 20 |d to search.for | 00000ce0 61 6e 79 20 77 6f 72 64 20 69 6e 20 77 6f 72 64 |any word in word| 00000cf0 20 50 48 52 4f 4d 20 41 2e 20 54 68 65 20 66 6f | PHROM A. The fo| 00000d00 6c 6c 6f 77 69 6e 67 20 61 6c 67 6f 72 69 74 68 |llowing algorith| 00000d10 6d 20 68 61 73 20 62 65 65 6e 20 75 73 65 64 20 |m has been used | 00000d20 69 6e 20 74 68 65 0d 70 72 6f 67 72 61 6d 20 53 |in the.program S| 00000d30 45 41 52 43 48 2e 20 49 74 20 64 6f 65 73 20 6e |EARCH. It does n| 00000d40 6f 74 20 75 73 65 20 74 68 65 20 71 75 69 63 6b |ot use the quick| 00000d50 20 62 75 74 20 64 61 6e 67 65 72 6f 75 73 20 52 | but dangerous R| 00000d60 65 61 64 20 61 6e 64 20 42 72 61 6e 63 68 0d 69 |ead and Branch.i| 00000d70 6e 73 74 72 75 63 74 69 6f 6e 2e 20 49 6e 73 74 |nstruction. Inst| 00000d80 65 61 64 20 69 74 20 69 64 65 6e 74 69 66 69 65 |ead it identifie| 00000d90 73 20 41 53 43 49 49 20 61 73 73 6f 63 69 61 74 |s ASCII associat| 00000da0 65 64 20 77 6f 72 64 73 20 73 6f 20 74 68 61 74 |ed words so that| 00000db0 20 61 6e 0d 65 78 74 65 6e 64 65 64 20 73 65 61 | an.extended sea| 00000dc0 72 63 68 20 69 73 20 6e 6f 74 20 72 65 71 75 69 |rch is not requi| 00000dd0 72 65 64 20 74 6f 20 66 69 6e 64 20 74 68 65 69 |red to find thei| 00000de0 72 20 73 70 65 65 63 68 20 64 61 74 61 2e 20 4f |r speech data. O| 00000df0 74 68 65 72 20 77 6f 72 64 73 0d 68 61 76 65 20 |ther words.have | 00000e00 74 6f 20 62 65 20 73 65 61 72 63 68 65 64 20 66 |to be searched f| 00000e10 6f 72 20 61 20 70 6f 69 6e 74 65 72 20 61 74 20 |or a pointer at | 00000e20 61 20 74 69 6d 65 2e 0d 0d 0d 31 29 20 52 65 61 |a time....1) Rea| 00000e30 64 20 74 68 65 20 77 6f 72 64 20 66 72 6f 6e 20 |d the word fron | 00000e40 74 68 65 20 6b 65 79 62 6f 61 72 64 2e 0d 0d 32 |the keyboard...2| 00000e50 29 20 49 66 20 74 68 65 20 77 6f 72 64 20 68 61 |) If the word ha| 00000e60 73 20 74 77 6f 20 6f 72 20 6d 6f 72 65 20 63 68 |s two or more ch| 00000e70 61 72 61 63 74 65 72 73 20 74 68 65 6e 20 67 6f |aracters then go| 00000e80 20 74 6f 20 38 29 0d 0d 33 29 20 49 66 20 74 68 | to 8)..3) If th| 00000e90 65 20 77 6f 72 64 20 69 73 20 61 20 6e 75 6c 6c |e word is a null| 00000ea0 20 73 74 72 69 6e 67 20 74 68 65 6e 20 67 6f 20 | string then go | 00000eb0 74 6f 20 31 29 0d 0d 34 29 20 54 68 65 20 77 6f |to 1)..4) The wo| 00000ec0 72 64 20 68 61 73 20 6f 6e 6c 79 20 6f 6e 65 20 |rd has only one | 00000ed0 63 68 61 72 61 63 74 65 72 20 73 6f 20 6d 75 6c |character so mul| 00000ee0 74 69 70 6c 79 20 74 68 65 20 41 53 43 49 49 20 |tiply the ASCII | 00000ef0 63 6f 64 65 20 62 79 20 74 77 6f 20 74 6f 0d 20 |code by two to. | 00000f00 20 20 67 69 76 65 20 74 68 65 20 70 6f 69 6e 74 | give the point| 00000f10 65 72 20 61 64 64 72 65 73 73 2e 0d 0d 35 29 20 |er address...5) | 00000f20 54 72 61 6e 73 66 6f 72 6d 20 74 68 65 20 70 6f |Transform the po| 00000f30 69 6e 74 65 72 20 61 64 64 72 65 73 73 20 69 6e |inter address in| 00000f40 74 6f 20 74 68 65 20 66 69 76 65 20 62 79 74 65 |to the five byte| 00000f50 73 20 75 73 65 64 20 62 79 20 74 68 65 20 4c 6f |s used by the Lo| 00000f60 61 64 0d 20 20 20 41 64 64 72 65 73 73 20 63 6f |ad. Address co| 00000f70 6d 6d 61 6e 64 20 61 6e 64 20 6c 6f 61 64 20 74 |mmand and load t| 00000f80 68 65 20 77 6f 72 64 20 50 48 52 4f 4d 20 61 64 |he word PHROM ad| 00000f90 64 72 65 73 73 20 72 65 67 69 73 74 65 72 20 77 |dress register w| 00000fa0 69 74 68 20 74 68 65 0d 20 20 20 70 6f 69 6e 74 |ith the. point| 00000fb0 65 72 20 61 64 64 72 65 73 73 2e 0d 0d 36 29 20 |er address...6) | 00000fc0 52 65 61 64 20 74 68 65 20 74 77 6f 20 62 79 74 |Read the two byt| 00000fd0 65 73 20 73 74 6f 72 65 64 20 69 6e 20 74 68 65 |es stored in the| 00000fe0 20 70 6f 69 6e 74 65 72 20 61 6e 64 20 74 72 61 | pointer and tra| 00000ff0 6e 73 66 6f 72 6d 20 74 68 65 20 66 6f 75 72 20 |nsform the four | 00001000 6e 79 62 62 6c 65 73 0d 20 20 20 69 6e 20 74 68 |nybbles. in th| 00001010 65 73 65 20 74 77 6f 20 62 79 74 65 73 20 69 6e |ese two bytes in| 00001020 74 6f 20 74 68 65 20 66 69 76 65 20 62 79 74 65 |to the five byte| 00001030 73 20 72 65 71 75 69 72 65 64 20 62 79 20 74 68 |s required by th| 00001040 65 20 4c 6f 61 64 20 41 64 64 72 65 73 73 0d 20 |e Load Address. | 00001050 20 20 63 6f 6d 6d 61 6e 64 2e 20 4c 6f 61 64 20 | command. Load | 00001060 74 68 65 20 77 6f 72 64 20 50 48 52 4f 4d 20 61 |the word PHROM a| 00001070 64 64 72 65 73 73 20 72 65 67 69 73 74 65 72 20 |ddress register | 00001080 77 69 74 68 20 74 68 65 20 64 61 74 61 20 61 64 |with the data ad| 00001090 64 72 65 73 73 2e 0d 0d 37 29 20 45 78 65 63 75 |dress...7) Execu| 000010a0 74 65 20 74 68 65 20 53 70 65 61 6b 20 69 6e 73 |te the Speak ins| 000010b0 74 72 75 63 74 69 6f 6e 20 74 6f 20 73 70 65 61 |truction to spea| 000010c0 6b 20 74 68 65 20 77 6f 72 64 2e 20 52 65 74 75 |k the word. Retu| 000010d0 72 6e 20 74 6f 20 42 41 53 49 43 2e 0d 0d 38 29 |rn to BASIC...8)| 000010e0 20 54 68 65 20 77 6f 72 64 20 6e 61 6d 65 20 68 | The word name h| 000010f0 61 73 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 |as more than one| 00001100 20 63 68 61 72 61 63 74 65 72 2e 20 54 68 65 20 | character. The | 00001110 77 6f 72 64 20 70 6f 69 6e 74 65 72 73 20 69 6e |word pointers in| 00001120 20 77 6f 72 64 0d 20 20 20 50 48 52 4f 4d 20 41 | word. PHROM A| 00001130 20 73 74 61 72 74 20 61 74 20 26 30 30 46 45 20 | start at &00FE | 00001140 61 6e 64 20 63 6f 6e 74 69 6e 75 65 20 75 6e 74 |and continue unt| 00001150 69 6c 20 74 68 65 20 65 6e 64 2d 6f 66 2d 70 6f |il the end-of-po| 00001160 69 6e 74 65 72 73 20 6d 61 72 6b 65 72 20 61 74 |inters marker at| 00001170 0d 20 20 20 26 30 32 34 38 2e 20 54 68 65 20 70 |. &0248. The p| 00001180 6f 69 6e 74 65 72 73 20 61 72 65 20 75 73 65 64 |ointers are used| 00001190 20 73 74 61 72 74 69 6e 67 20 61 74 20 26 30 30 | starting at &00| 000011a0 46 45 20 61 6e 64 20 65 6e 64 69 6e 67 20 77 68 |FE and ending wh| 000011b0 65 6e 20 74 68 65 0d 20 20 20 65 6e 64 2d 6f 66 |en the. end-of| 000011c0 2d 70 6f 69 6e 74 65 72 73 20 6d 61 72 6b 65 72 |-pointers marker| 000011d0 20 69 73 20 72 65 61 64 2e 20 54 6f 20 73 74 61 | is read. To sta| 000011e0 72 74 20 77 69 74 68 20 74 68 65 20 22 6e 65 78 |rt with the "nex| 000011f0 74 20 70 6f 69 6e 74 65 72 22 20 77 69 6c 6c 0d |t pointer" will.| 00001200 20 20 20 62 65 20 26 30 30 46 45 2e 0d 0d 39 29 | be &00FE...9)| 00001210 20 54 72 61 6e 73 66 6f 72 6d 20 74 68 65 20 74 | Transform the t| 00001220 77 6f 20 62 79 74 65 73 20 6f 66 20 74 68 65 20 |wo bytes of the | 00001230 6e 65 78 74 20 70 6f 69 6e 74 65 72 20 61 64 64 |next pointer add| 00001240 72 65 73 73 20 69 6e 74 6f 20 74 68 65 20 66 69 |ress into the fi| 00001250 76 65 20 62 79 74 65 73 0d 20 20 20 72 65 71 75 |ve bytes. requ| 00001260 69 72 65 64 20 62 79 20 74 68 65 20 4c 6f 61 64 |ired by the Load| 00001270 20 41 64 64 72 65 73 73 20 63 6f 6d 6d 61 6e 64 | Address command| 00001280 2c 20 6c 6f 61 64 20 74 68 65 20 77 6f 72 64 20 |, load the word | 00001290 50 48 52 4f 4d 20 61 64 64 72 65 73 73 0d 20 20 |PHROM address. | 000012a0 20 72 65 67 69 73 74 65 72 20 77 69 74 68 20 74 | register with t| 000012b0 68 65 20 61 64 64 72 65 73 73 20 6f 66 20 74 68 |he address of th| 000012c0 65 20 6e 65 78 74 20 70 6f 69 6e 74 65 72 20 61 |e next pointer a| 000012d0 6e 64 20 72 65 61 64 20 74 68 65 20 63 6f 6e 74 |nd read the cont| 000012e0 65 6e 74 73 20 6f 66 0d 20 20 20 74 68 65 20 70 |ents of. the p| 000012f0 6f 69 6e 74 65 72 2e 20 49 66 20 74 68 65 20 4c |ointer. If the L| 00001300 53 42 20 3d 20 23 26 46 46 20 74 68 65 6e 20 72 |SB = #&FF then r| 00001310 65 74 75 72 6e 20 74 6f 20 42 41 53 49 43 2e 0d |eturn to BASIC..| 00001320 0d 31 30 29 20 53 75 62 74 72 61 63 74 20 74 68 |.10) Subtract th| 00001330 65 20 6c 65 6e 67 74 68 20 6f 66 20 74 68 65 20 |e length of the | 00001340 77 6f 72 64 20 74 79 70 65 64 20 61 74 20 74 68 |word typed at th| 00001350 65 20 6b 65 79 62 6f 61 72 64 20 66 72 6f 6d 20 |e keyboard from | 00001360 74 68 65 20 61 64 64 72 65 73 73 0d 20 20 20 73 |the address. s| 00001370 74 6f 72 65 64 20 69 6e 20 74 68 65 20 70 6f 69 |tored in the poi| 00001380 6e 74 65 72 2e 20 54 72 61 6e 73 66 6f 72 6d 20 |nter. Transform | 00001390 61 6e 64 20 6c 6f 61 64 20 74 68 69 73 20 6d 6f |and load this mo| 000013a0 64 69 66 69 65 64 20 61 64 64 72 65 73 73 20 69 |dified address i| 000013b0 6e 74 6f 0d 20 20 20 74 68 65 20 77 6f 72 64 20 |nto. the word | 000013c0 50 48 52 4f 4d 20 61 64 64 72 65 73 73 20 72 65 |PHROM address re| 000013d0 67 69 73 74 65 72 2e 20 54 68 65 20 77 6f 72 64 |gister. The word| 000013e0 20 50 48 52 4f 4d 20 61 64 64 72 65 73 73 20 72 | PHROM address r| 000013f0 65 67 69 73 74 65 72 20 6e 6f 77 0d 20 20 20 70 |egister now. p| 00001400 6f 69 6e 74 73 20 74 6f 20 74 68 65 20 62 65 67 |oints to the beg| 00001410 69 6e 69 6e 67 20 6f 66 20 74 68 65 20 72 65 76 |ining of the rev| 00001420 65 72 73 65 20 6f 72 64 65 72 65 64 20 77 6f 72 |erse ordered wor| 00001430 64 20 6e 61 6d 65 20 69 66 20 69 74 20 69 73 20 |d name if it is | 00001440 74 68 65 0d 20 20 20 73 61 6d 65 20 61 73 20 74 |the. same as t| 00001450 68 65 20 77 6f 72 64 20 74 79 70 65 64 20 6f 6e |he word typed on| 00001460 20 74 68 65 20 6b 65 79 62 6f 61 72 64 2e 0d 0d | the keyboard...| 00001470 31 31 29 20 43 6f 6d 70 61 72 65 20 65 76 65 72 |11) Compare ever| 00001480 79 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 |y character of t| 00001490 68 65 20 77 6f 72 64 20 74 79 70 65 64 20 6f 6e |he word typed on| 000014a0 20 74 68 65 20 6b 65 79 62 6f 61 72 64 20 77 69 | the keyboard wi| 000014b0 74 68 20 65 76 65 72 79 0d 20 20 20 62 79 74 65 |th every. byte| 000014c0 20 69 6e 20 74 68 65 20 77 6f 72 64 20 50 48 52 | in the word PHR| 000014d0 4f 4d 2e 20 49 66 20 74 68 65 79 20 6d 61 74 63 |OM. If they matc| 000014e0 68 20 74 68 65 20 77 6f 72 64 20 68 61 73 20 62 |h the word has b| 000014f0 65 65 6e 20 66 6f 75 6e 64 20 61 6e 64 20 74 68 |een found and th| 00001500 65 0d 20 20 20 61 64 64 72 65 73 73 20 72 65 67 |e. address reg| 00001510 69 73 74 65 72 20 70 6f 69 6e 74 73 20 74 6f 20 |ister points to | 00001520 74 68 65 20 66 69 72 73 74 20 62 79 74 65 20 6f |the first byte o| 00001530 66 20 74 68 65 20 73 70 65 65 63 68 20 64 61 74 |f the speech dat| 00001540 61 2e 20 49 66 20 74 68 65 79 0d 20 20 20 64 6f |a. If they. do| 00001550 20 6e 6f 74 20 6d 61 74 63 68 20 74 68 65 6e 20 | not match then | 00001560 66 69 6e 64 20 74 68 65 20 6e 65 78 74 20 70 6f |find the next po| 00001570 69 6e 74 65 72 20 61 64 64 72 65 73 73 20 61 6e |inter address an| 00001580 64 20 67 6f 20 74 6f 20 39 29 2e 0d 0d 31 32 29 |d go to 9)...12)| 00001590 20 45 78 65 63 75 74 65 20 74 68 65 20 53 70 65 | Execute the Spe| 000015a0 61 6b 20 69 6e 73 74 72 75 63 74 69 6f 6e 20 74 |ak instruction t| 000015b0 6f 20 73 70 65 61 6b 20 74 68 65 20 77 6f 72 64 |o speak the word| 000015c0 2e 20 52 65 74 75 72 6e 20 74 6f 20 42 41 53 49 |. Return to BASI| 000015d0 43 2e 0d 0d 0d 54 68 65 20 70 72 6f 67 72 61 6d |C....The program| 000015e0 20 53 45 41 52 43 48 20 65 6c 61 62 6f 72 61 74 | SEARCH elaborat| 000015f0 65 73 20 74 68 69 73 20 61 6c 67 6f 72 69 74 68 |es this algorith| 00001600 6d 20 61 20 6c 69 74 74 6c 65 20 69 6e 20 6f 72 |m a little in or| 00001610 64 65 72 20 74 6f 20 70 72 69 6e 74 0d 6f 75 74 |der to print.out| 00001620 20 74 68 65 20 61 64 64 72 65 73 73 20 61 74 20 | the address at | 00001630 77 68 69 63 68 20 69 74 20 66 69 6e 64 73 20 74 |which it finds t| 00001640 68 65 20 73 70 65 65 63 68 20 64 61 74 61 2e 20 |he speech data. | 00001650 54 68 69 73 20 63 61 6e 20 62 65 20 75 73 65 64 |This can be used| 00001660 20 74 6f 0d 63 6f 72 72 65 63 74 20 74 68 65 20 | to.correct the | 00001670 61 64 64 72 65 73 73 65 73 20 66 6f 72 20 42 2c |addresses for B,| 00001680 20 42 45 54 57 45 45 4e 2c 20 42 4f 54 48 2c 20 | BETWEEN, BOTH, | 00001690 61 6e 64 20 42 55 54 54 4f 4e 2c 20 61 6c 6c 20 |and BUTTON, all | 000016a0 6f 66 20 77 68 69 63 68 20 61 72 65 0d 69 6e 63 |of which are.inc| 000016b0 6f 72 72 65 63 74 6c 79 20 6c 69 73 74 65 64 20 |orrectly listed | 000016c0 69 6e 20 69 73 73 75 65 20 32 20 6f 66 20 74 68 |in issue 2 of th| 000016d0 65 20 53 70 65 65 63 68 20 53 79 73 74 65 6d 20 |e Speech System | 000016e0 55 73 65 72 20 47 75 69 64 65 2e 0d 0d 4c 6f 61 |User Guide...Loa| 000016f0 64 20 61 6e 64 20 72 75 6e 20 74 68 65 20 70 72 |d and run the pr| 00001700 6f 67 72 61 6d 2e 20 52 65 73 70 6f 6e 64 20 74 |ogram. Respond t| 00001710 6f 20 74 68 65 20 3f 20 70 72 6f 6d 70 74 20 62 |o the ? prompt b| 00001720 79 20 74 79 70 69 6e 67 20 74 68 65 20 6e 61 6d |y typing the nam| 00001730 65 20 6f 66 0d 61 6e 79 20 77 6f 72 64 20 69 6e |e of.any word in| 00001740 20 77 6f 72 64 20 50 48 52 4f 4d 20 41 2e 20 59 | word PHROM A. Y| 00001750 6f 75 20 73 68 6f 75 6c 64 20 74 79 70 65 20 74 |ou should type t| 00001760 68 65 20 6e 61 6d 65 20 65 78 61 63 74 6c 79 20 |he name exactly | 00001770 61 73 20 69 74 20 69 73 20 73 74 6f 72 65 64 0d |as it is stored.| 00001780 69 6e 20 74 68 65 20 77 6f 72 64 20 50 48 52 4f |in the word PHRO| 00001790 4d 2e 20 28 54 4f 4e 45 20 31 29 20 69 73 20 72 |M. (TONE 1) is r| 000017a0 65 6a 65 63 74 65 64 20 62 65 63 61 75 73 65 20 |ejected because | 000017b0 69 74 20 69 74 20 73 74 6f 72 65 64 20 61 73 20 |it it stored as | 000017c0 28 54 4f 4e 45 31 29 0d 62 75 74 20 41 56 41 49 |(TONE1).but AVAI| 000017d0 4c 20 77 69 6c 6c 20 66 69 6e 64 20 74 68 65 20 |L will find the | 000017e0 73 70 65 65 63 68 20 64 61 74 61 20 66 6f 72 20 |speech data for | 000017f0 74 68 65 20 77 6f 72 64 20 41 56 41 49 4c 41 42 |the word AVAILAB| 00001800 4c 45 20 62 65 63 61 75 73 65 20 74 68 65 0d 70 |LE because the.p| 00001810 72 6f 67 72 61 6d 20 6f 6e 6c 79 20 61 74 74 65 |rogram only atte| 00001820 6d 70 74 73 20 74 6f 20 6d 61 74 63 68 20 74 68 |mpts to match th| 00001830 65 20 6e 75 6d 62 65 72 20 6f 66 20 63 68 61 72 |e number of char| 00001840 61 63 74 65 72 73 20 74 79 70 65 64 20 6f 6e 20 |acters typed on | 00001850 74 68 65 0d 6b 65 79 62 6f 61 72 64 2e 20 49 66 |the.keyboard. If| 00001860 20 79 6f 75 20 74 79 70 65 20 61 20 77 6f 72 64 | you type a word| 00001870 20 77 68 69 63 68 20 64 6f 65 73 20 6e 6f 74 20 | which does not | 00001880 6d 61 74 63 68 20 77 69 74 68 20 61 6e 79 20 6f |match with any o| 00001890 66 20 73 74 6f 72 65 64 20 77 6f 72 64 73 0d 74 |f stored words.t| 000018a0 68 65 20 70 72 6f 67 72 61 6d 20 72 65 74 75 72 |he program retur| 000018b0 6e 73 20 74 6f 20 42 41 53 49 43 2e 20 49 66 20 |ns to BASIC. If | 000018c0 79 6f 75 20 74 79 70 65 20 61 20 70 61 72 74 20 |you type a part | 000018d0 6f 66 20 61 20 77 6f 72 64 20 6e 61 6d 65 20 77 |of a word name w| 000018e0 69 74 68 6f 75 74 0d 73 74 61 72 74 69 6e 67 20 |ithout.starting | 000018f0 77 69 74 68 20 74 68 65 20 66 69 72 73 74 20 63 |with the first c| 00001900 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 20 |haracter of the | 00001910 77 6f 72 64 20 6e 61 6d 65 2c 20 66 6f 72 20 65 |word name, for e| 00001920 78 61 6d 70 6c 65 20 56 41 49 4c 20 61 73 0d 70 |xample VAIL as.p| 00001930 61 72 74 20 6f 66 20 41 56 41 49 4c 41 42 4c 45 |art of AVAILABLE| 00001940 2c 20 79 6f 75 20 77 69 6c 6c 20 67 65 6e 65 72 |, you will gener| 00001950 61 74 65 20 61 6e 20 65 72 72 6f 72 20 61 6e 64 |ate an error and| 00001960 20 70 72 6f 64 75 63 65 20 67 61 72 62 6c 65 64 | produce garbled| 00001970 20 73 70 65 65 63 68 2e 0d 59 6f 75 20 63 6f 75 | speech..You cou| 00001980 6c 64 20 6d 6f 64 69 66 79 20 74 68 65 20 70 72 |ld modify the pr| 00001990 6f 67 72 61 6d 20 74 6f 20 74 72 61 70 20 61 6e |ogram to trap an| 000019a0 64 20 72 65 6a 65 63 74 20 74 68 69 73 20 65 72 |d reject this er| 000019b0 72 6f 72 2e 0d 0d 54 68 65 20 70 72 6f 67 72 61 |ror...The progra| 000019c0 6d 20 53 45 41 52 43 48 20 64 6f 65 73 20 6e 6f |m SEARCH does no| 000019d0 74 20 6e 65 65 64 20 74 6f 20 75 73 65 20 74 68 |t need to use th| 000019e0 65 20 71 75 69 63 6b 20 6d 65 74 68 6f 64 20 6f |e quick method o| 000019f0 66 20 66 69 6e 64 69 6e 67 20 41 53 43 49 49 0d |f finding ASCII.| 00001a00 61 73 73 6f 63 69 61 74 65 64 20 77 6f 72 64 73 |associated words| 00001a10 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 77 6f 72 | in order to wor| 00001a20 6b 20 70 72 6f 70 65 72 6c 79 2e 20 54 68 65 20 |k properly. The | 00001a30 70 72 6f 67 72 61 6d 20 63 61 6e 20 62 65 20 73 |program can be s| 00001a40 68 6f 72 74 65 6e 65 64 0d 62 79 20 64 65 6c 65 |hortened.by dele| 00001a50 74 69 6e 67 20 6c 69 6e 65 73 20 34 33 30 20 74 |ting lines 430 t| 00001a60 6f 20 34 34 30 20 61 6e 64 20 6c 69 6e 65 73 20 |o 440 and lines | 00001a70 34 37 30 20 74 6f 20 36 31 30 2e 20 54 68 65 20 |470 to 610. The | 00001a80 70 72 6f 67 72 61 6d 20 77 69 6c 6c 20 73 74 69 |program will sti| 00001a90 6c 6c 0d 66 69 6e 64 20 74 68 65 20 73 70 65 65 |ll.find the spee| 00001aa0 63 68 20 64 61 74 61 20 66 6f 72 20 61 6c 6c 20 |ch data for all | 00001ab0 74 68 65 20 77 6f 72 64 73 20 61 6e 64 20 77 6f |the words and wo| 00001ac0 72 64 2d 70 61 72 74 73 20 62 75 74 20 69 74 20 |rd-parts but it | 00001ad0 77 69 6c 6c 20 74 61 6b 65 20 61 0d 6c 69 74 74 |will take a.litt| 00001ae0 6c 65 20 6c 6f 6e 67 65 72 20 74 6f 20 66 69 6e |le longer to fin| 00001af0 64 20 74 68 65 20 41 53 43 49 49 20 61 73 73 6f |d the ASCII asso| 00001b00 63 69 61 74 65 64 20 77 6f 72 64 73 20 74 68 61 |ciated words tha| 00001b10 6e 20 69 74 20 64 69 64 20 77 69 74 68 20 74 68 |n it did with th| 00001b20 65 73 65 0d 65 78 74 72 61 20 6c 69 6e 65 73 2e |ese.extra lines.| 00001b30 20 54 68 65 20 66 75 6c 6c 20 70 72 6f 67 72 61 | The full progra| 00001b40 6d 20 69 73 20 73 69 67 6e 69 66 69 63 61 6e 74 |m is significant| 00001b50 6c 79 20 66 61 73 74 65 72 20 61 74 20 66 69 6e |ly faster at fin| 00001b60 64 69 6e 67 20 74 68 65 20 64 61 74 61 0d 66 6f |ding the data.fo| 00001b70 72 20 74 68 65 20 77 6f 72 64 20 5a 20 74 68 61 |r the word Z tha| 00001b80 6e 20 74 68 65 20 73 68 6f 72 74 65 6e 65 64 20 |n the shortened | 00001b90 76 65 72 73 69 6f 6e 20 62 65 63 61 75 73 65 20 |version because | 00001ba0 74 68 65 20 73 68 6f 72 74 65 6e 65 64 20 76 65 |the shortened ve| 00001bb0 72 73 69 6f 6e 0d 68 61 73 20 74 6f 20 73 65 61 |rsion.has to sea| 00001bc0 72 63 68 20 65 76 65 72 79 20 77 6f 72 64 20 69 |rch every word i| 00001bd0 6e 20 77 6f 72 64 20 50 48 52 4f 4d 20 41 20 62 |n word PHROM A b| 00001be0 65 66 6f 72 65 20 69 74 20 66 69 6e 64 73 20 5a |efore it finds Z| 00001bf0 2e 20 54 68 65 20 66 75 6c 6c 0d 76 65 72 73 69 |. The full.versi| 00001c00 6f 6e 20 66 69 6e 64 73 20 74 68 65 20 64 61 74 |on finds the dat| 00001c10 61 20 66 6f 72 20 74 68 65 20 77 6f 72 64 20 5a |a for the word Z| 00001c20 20 77 69 74 68 6f 75 74 20 61 6e 79 20 73 65 61 | without any sea| 00001c30 72 63 68 69 6e 67 2e 0d 0d 0d 20 20 20 31 30 20 |rching.... 10 | 00001c40 52 45 4d 3a 20 53 45 41 52 43 48 0d 20 20 20 32 |REM: SEARCH. 2| 00001c50 30 20 62 75 66 66 65 72 3d 26 37 30 0d 20 20 20 |0 buffer=&70. | 00001c60 33 30 20 70 6f 69 6e 74 65 72 3d 26 38 30 0d 20 |30 pointer=&80. | 00001c70 20 20 34 30 20 77 6f 72 6b 73 70 61 63 65 3d 70 | 40 workspace=p| 00001c80 6f 69 6e 74 65 72 2b 32 0d 20 20 20 35 30 20 6c |ointer+2. 50 l| 00001c90 65 6e 67 74 68 3d 70 6f 69 6e 74 65 72 2b 34 0d |ength=pointer+4.| 00001ca0 20 20 20 36 30 20 74 65 73 74 62 79 74 65 3d 70 | 60 testbyte=p| 00001cb0 6f 69 6e 74 65 72 2b 35 0d 20 20 20 37 30 20 6f |ointer+5. 70 o| 00001cc0 66 66 73 65 74 3d 70 6f 69 6e 74 65 72 2b 36 0d |ffset=pointer+6.| 00001cd0 20 20 20 38 30 20 74 65 6d 70 3d 70 6f 69 6e 74 | 80 temp=point| 00001ce0 65 72 2b 37 0d 20 20 20 39 30 20 6f 73 6e 65 77 |er+7. 90 osnew| 00001cf0 6c 3d 26 46 46 45 37 0d 20 20 31 30 30 20 6f 73 |l=&FFE7. 100 os| 00001d00 77 72 63 68 3d 26 46 46 45 45 0d 20 20 31 31 30 |wrch=&FFEE. 110| 00001d10 20 6f 73 77 6f 72 64 3d 26 46 46 46 31 0d 20 20 | osword=&FFF1. | 00001d20 31 32 30 20 6f 73 62 79 74 65 3d 26 46 46 46 34 |120 osbyte=&FFF4| 00001d30 0d 20 20 31 33 30 20 44 49 4d 20 6d 63 6f 64 65 |. 130 DIM mcode| 00001d40 20 26 32 30 30 0d 20 20 31 34 30 20 46 4f 52 70 | &200. 140 FORp| 00001d50 61 73 73 3d 30 54 4f 32 53 54 45 50 32 0d 20 20 |ass=0TO2STEP2. | 00001d60 31 35 30 20 50 25 3d 6d 63 6f 64 65 0d 20 20 31 |150 P%=mcode. 1| 00001d70 36 30 20 5b 20 20 20 20 20 20 20 4f 50 54 20 70 |60 [ OPT p| 00001d80 61 73 73 0d 20 20 31 37 30 20 20 20 20 20 20 20 |ass. 170 | 00001d90 20 20 4c 44 41 20 23 26 45 42 20 20 20 20 20 20 | LDA #&EB | 00001da0 5c 20 72 65 61 64 20 73 70 65 65 63 68 20 70 72 |\ read speech pr| 00001db0 6f 63 65 73 73 6f 72 20 66 6c 61 67 0d 20 20 31 |ocessor flag. 1| 00001dc0 38 30 20 20 20 20 20 20 20 20 20 4c 44 58 20 23 |80 LDX #| 00001dd0 30 0d 20 20 31 39 30 20 20 20 20 20 20 20 20 20 |0. 190 | 00001de0 4c 44 59 20 23 26 46 46 0d 20 20 32 30 30 20 20 |LDY #&FF. 200 | 00001df0 20 20 20 20 20 20 20 4a 53 52 20 6f 73 62 79 74 | JSR osbyt| 00001e00 65 20 20 20 20 5c 20 63 68 65 63 6b 20 66 6f 72 |e \ check for| 00001e10 20 41 63 6f 72 6e 20 53 70 65 65 63 68 20 75 70 | Acorn Speech up| 00001e20 67 72 61 64 65 0d 20 20 32 31 30 20 20 20 20 20 |grade. 210 | 00001e30 20 20 20 20 43 50 58 20 23 26 46 46 20 20 20 20 | CPX #&FF | 00001e40 20 20 5c 20 58 20 3d 20 23 26 46 46 20 69 66 20 | \ X = #&FF if | 00001e50 73 70 65 65 63 68 20 70 72 65 73 65 6e 74 0d 20 |speech present. | 00001e60 20 32 32 30 20 20 20 20 20 20 20 20 20 42 45 51 | 220 BEQ| 00001e70 20 73 74 61 72 74 0d 20 20 32 33 30 20 20 20 20 | start. 230 | 00001e80 20 20 20 20 20 42 52 4b 0d 20 20 32 34 30 20 20 | BRK. 240 | 00001e90 20 20 20 20 20 20 20 42 52 4b 0d 20 20 32 35 30 | BRK. 250| 00001ea0 20 20 20 20 20 20 20 20 20 45 51 55 53 20 22 4e | EQUS "N| 00001eb0 6f 20 53 70 65 65 63 68 20 75 70 67 72 61 64 65 |o Speech upgrade| 00001ec0 22 0d 20 20 32 36 30 20 20 20 20 20 20 20 20 20 |". 260 | 00001ed0 42 52 4b 0d 20 20 32 37 30 20 2e 73 74 61 72 74 |BRK. 270 .start| 00001ee0 0d 20 20 32 38 30 20 20 20 20 20 20 20 20 20 4c |. 280 L| 00001ef0 44 41 20 23 41 53 43 28 22 3f 22 29 0d 20 20 32 |DA #ASC("?"). 2| 00001f00 39 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 6f |90 JSR o| 00001f10 73 77 72 63 68 20 20 20 20 5c 20 77 72 69 74 65 |swrch \ write| 00001f20 20 3f 20 61 73 20 70 72 6f 6d 70 74 20 66 6f 72 | ? as prompt for| 00001f30 20 69 6e 70 75 74 0d 20 20 33 30 30 20 20 20 20 | input. 300 | 00001f40 20 20 20 20 20 4c 44 41 20 23 30 20 20 20 20 20 | LDA #0 | 00001f50 20 20 20 5c 20 72 65 61 64 20 73 74 72 69 6e 67 | \ read string| 00001f60 20 66 72 6f 6d 20 6b 65 79 62 6f 61 72 64 0d 20 | from keyboard. | 00001f70 20 33 31 30 20 20 20 20 20 20 20 20 20 4c 44 58 | 310 LDX| 00001f80 20 23 62 6c 6f 63 6b 20 4d 4f 44 20 32 35 36 20 | #block MOD 256 | 00001f90 5c 20 4c 53 42 20 70 61 72 61 6d 65 74 65 72 20 |\ LSB parameter | 00001fa0 62 6c 6f 63 6b 0d 20 20 33 32 30 20 20 20 20 20 |block. 320 | 00001fb0 20 20 20 20 4c 44 59 20 23 62 6c 6f 63 6b 20 44 | LDY #block D| 00001fc0 49 56 20 32 35 36 20 5c 20 4d 53 42 20 70 61 72 |IV 256 \ MSB par| 00001fd0 61 6d 65 74 65 72 20 62 6c 6f 63 6b 0d 20 20 33 |ameter block. 3| 00001fe0 33 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 6f |30 JSR o| 00001ff0 73 77 6f 72 64 20 20 20 20 5c 20 72 65 61 64 20 |sword \ read | 00002000 77 6f 72 64 20 74 6f 20 62 65 20 73 70 6f 6b 65 |word to be spoke| 00002010 6e 0d 20 20 33 34 30 20 20 20 20 20 20 20 20 20 |n. 340 | 00002020 42 43 43 20 63 6c 65 61 72 20 20 20 20 20 5c 20 |BCC clear \ | 00002030 63 61 72 72 79 20 73 65 74 20 69 66 20 65 73 63 |carry set if esc| 00002040 61 70 65 20 70 72 65 73 73 65 64 0d 20 20 33 35 |ape pressed. 35| 00002050 30 20 2e 65 73 63 61 70 65 0d 20 20 33 36 30 20 |0 .escape. 360 | 00002060 20 20 20 20 20 20 20 20 4c 44 41 20 23 26 37 45 | LDA #&7E| 00002070 0d 20 20 33 37 30 20 20 20 20 20 20 20 20 20 4a |. 370 J| 00002080 53 52 20 6f 73 62 79 74 65 20 20 20 20 5c 20 61 |SR osbyte \ a| 00002090 63 6b 6e 6f 77 6c 65 64 67 65 20 65 73 63 61 70 |cknowledge escap| 000020a0 65 0d 20 20 33 38 30 20 20 20 20 20 20 20 20 20 |e. 380 | 000020b0 42 52 4b 0d 20 20 33 39 30 20 20 20 20 20 20 20 |BRK. 390 | 000020c0 20 20 42 52 4b 0d 20 20 34 30 30 20 20 20 20 20 | BRK. 400 | 000020d0 20 20 20 20 45 51 55 53 20 22 45 73 63 61 70 65 | EQUS "Escape| 000020e0 22 0d 20 20 34 31 30 20 20 20 20 20 20 20 20 20 |". 410 | 000020f0 42 52 4b 0d 20 20 34 32 30 20 2e 63 6c 65 61 72 |BRK. 420 .clear| 00002100 0d 20 20 34 33 30 20 20 20 20 20 20 20 20 20 43 |. 430 C| 00002110 50 59 20 23 32 20 20 20 20 20 20 20 20 5c 20 61 |PY #2 \ a| 00002120 72 65 20 74 68 65 72 65 20 32 20 6f 72 20 6d 6f |re there 2 or mo| 00002130 72 65 20 63 68 61 72 61 63 74 65 72 73 3f 0d 20 |re characters?. | 00002140 20 34 34 30 20 20 20 20 20 20 20 20 20 42 43 53 | 440 BCS| 00002150 20 77 6f 72 64 20 20 20 20 20 20 5c 20 62 72 61 | word \ bra| 00002160 6e 63 68 20 69 66 20 74 68 65 72 65 20 61 72 65 |nch if there are| 00002170 2c 0d 20 20 34 35 30 20 20 20 20 20 20 20 20 20 |,. 450 | 00002180 43 50 59 20 23 30 20 20 20 20 20 20 20 20 5c 20 |CPY #0 \ | 00002190 69 66 20 74 68 65 72 65 20 61 72 65 20 6e 6f 20 |if there are no | 000021a0 63 68 61 72 61 63 74 65 72 73 20 2d 0d 20 20 34 |characters -. 4| 000021b0 36 30 20 20 20 20 20 20 20 20 20 42 45 51 20 73 |60 BEQ s| 000021c0 74 61 72 74 20 20 20 20 20 5c 20 67 6f 20 62 61 |tart \ go ba| 000021d0 63 6b 20 61 6e 64 20 67 65 74 20 73 6f 6d 65 2e |ck and get some.| 000021e0 0d 20 20 34 37 30 20 20 20 20 20 20 20 20 20 4c |. 470 L| 000021f0 44 41 20 62 75 66 66 65 72 20 20 20 20 5c 20 6c |DA buffer \ l| 00002200 6f 61 64 20 74 68 65 20 41 53 43 49 49 20 63 68 |oad the ASCII ch| 00002210 61 72 61 63 74 65 72 0d 20 20 34 38 30 20 20 20 |aracter. 480 | 00002220 20 20 20 20 20 20 41 53 4c 20 41 20 20 20 20 20 | ASL A | 00002230 20 20 20 20 5c 20 6d 75 6c 74 69 70 6c 79 20 62 | \ multiply b| 00002240 79 20 32 0d 20 20 34 39 30 20 20 20 20 20 20 20 |y 2. 490 | 00002250 20 20 54 41 58 20 20 20 20 20 20 20 20 20 20 20 | TAX | 00002260 5c 20 4c 53 42 20 6f 66 20 70 6f 69 6e 74 65 72 |\ LSB of pointer| 00002270 20 61 64 64 72 65 73 73 0d 20 20 35 30 30 20 20 | address. 500 | 00002280 20 20 20 20 20 20 20 4c 44 59 20 23 30 20 20 20 | LDY #0 | 00002290 20 20 20 20 20 5c 20 4d 53 42 20 6f 66 20 70 6f | \ MSB of po| 000022a0 69 6e 74 65 72 20 61 64 64 72 65 73 73 0d 20 20 |inter address. | 000022b0 35 31 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 |510 JSR | 000022c0 61 64 64 72 65 73 73 20 20 20 5c 20 77 72 69 74 |address \ writ| 000022d0 65 20 58 59 20 69 6e 74 6f 20 61 64 64 72 65 73 |e XY into addres| 000022e0 73 20 72 65 67 69 73 74 65 72 0d 20 20 35 32 30 |s register. 520| 000022f0 20 20 20 20 20 20 20 20 20 4a 53 52 20 72 65 61 | JSR rea| 00002300 64 20 20 20 20 20 20 5c 20 72 65 61 64 20 4c 53 |d \ read LS| 00002310 42 20 6f 66 20 73 70 65 65 63 68 20 64 61 74 61 |B of speech data| 00002320 0d 20 20 35 33 30 20 20 20 20 20 20 20 20 20 4a |. 530 J| 00002330 53 52 20 72 65 76 65 72 73 65 20 20 20 5c 20 72 |SR reverse \ r| 00002340 65 76 65 72 73 65 20 74 68 65 20 62 69 74 73 0d |everse the bits.| 00002350 20 20 35 34 30 20 20 20 20 20 20 20 20 20 54 41 | 540 TA| 00002360 58 20 20 20 20 20 20 20 20 20 20 20 5c 20 4c 53 |X \ LS| 00002370 42 20 6f 66 20 73 70 65 65 63 68 20 64 61 74 61 |B of speech data| 00002380 20 69 6e 74 6f 20 58 0d 20 20 35 35 30 20 20 20 | into X. 550 | 00002390 20 20 20 20 20 20 53 54 58 20 77 6f 72 6b 73 70 | STX worksp| 000023a0 61 63 65 20 5c 20 73 74 6f 72 65 20 4c 53 42 20 |ace \ store LSB | 000023b0 6f 66 20 64 61 74 61 20 61 64 64 72 65 73 73 0d |of data address.| 000023c0 20 20 35 36 30 20 20 20 20 20 20 20 20 20 4a 53 | 560 JS| 000023d0 52 20 72 65 61 64 20 20 20 20 20 20 5c 20 72 65 |R read \ re| 000023e0 61 64 20 4d 53 42 20 6f 66 20 73 70 65 65 63 68 |ad MSB of speech| 000023f0 20 64 61 74 61 0d 20 20 35 37 30 20 20 20 20 20 | data. 570 | 00002400 20 20 20 20 4a 53 52 20 72 65 76 65 72 73 65 20 | JSR reverse | 00002410 20 20 5c 20 72 65 76 65 72 73 65 20 74 68 65 20 | \ reverse the | 00002420 62 69 74 73 0d 20 20 35 38 30 20 20 20 20 20 20 |bits. 580 | 00002430 20 20 20 54 41 59 20 20 20 20 20 20 20 20 20 20 | TAY | 00002440 20 5c 20 4d 53 42 20 6f 66 20 73 70 65 65 63 68 | \ MSB of speech| 00002450 20 64 61 74 61 20 69 6e 74 6f 20 59 0d 20 20 35 | data into Y. 5| 00002460 39 30 20 20 20 20 20 20 20 20 20 53 54 59 20 77 |90 STY w| 00002470 6f 72 6b 73 70 61 63 65 2b 31 20 5c 20 73 74 6f |orkspace+1 \ sto| 00002480 72 65 20 4d 53 42 20 6f 66 20 64 61 74 61 20 61 |re MSB of data a| 00002490 64 64 72 65 73 73 0d 20 20 36 30 30 20 20 20 20 |ddress. 600 | 000024a0 20 20 20 20 20 4a 53 52 20 61 64 64 72 65 73 73 | JSR address| 000024b0 20 20 20 5c 20 77 72 69 74 65 20 58 59 20 69 6e | \ write XY in| 000024c0 74 6f 20 61 64 64 72 65 73 73 20 72 65 67 69 73 |to address regis| 000024d0 74 65 72 0d 20 20 36 31 30 20 20 20 20 20 20 20 |ter. 610 | 000024e0 20 20 4a 4d 50 20 73 61 79 69 74 20 20 20 20 20 | JMP sayit | 000024f0 5c 20 73 70 65 61 6b 20 74 68 65 20 77 6f 72 64 |\ speak the word| 00002500 0d 20 20 36 32 30 20 2e 77 6f 72 64 0d 20 20 36 |. 620 .word. 6| 00002510 33 30 20 20 20 20 20 20 20 20 20 53 54 59 20 6c |30 STY l| 00002520 65 6e 67 74 68 20 20 20 20 5c 20 6c 65 6e 67 74 |ength \ lengt| 00002530 68 20 6f 66 20 77 6f 72 64 20 6e 61 6d 65 0d 20 |h of word name. | 00002540 20 36 34 30 20 20 20 20 20 20 20 20 20 44 45 59 | 640 DEY| 00002550 0d 20 20 36 35 30 20 20 20 20 20 20 20 20 20 53 |. 650 S| 00002560 54 59 20 6f 66 66 73 65 74 20 20 20 20 5c 20 6c |TY offset \ l| 00002570 65 6e 67 74 68 20 6f 66 20 77 6f 72 64 20 2d 20 |ength of word - | 00002580 31 0d 20 20 36 36 30 20 20 20 20 20 20 20 20 20 |1. 660 | 00002590 4c 44 41 20 62 75 66 66 65 72 2c 59 0d 20 20 36 |LDA buffer,Y. 6| 000025a0 37 30 20 20 20 20 20 20 20 20 20 53 54 41 20 74 |70 STA t| 000025b0 65 73 74 62 79 74 65 20 20 5c 20 6c 61 73 74 20 |estbyte \ last | 000025c0 63 68 61 72 20 6f 66 20 77 6f 72 64 20 6e 61 6d |char of word nam| 000025d0 65 0d 20 20 36 38 30 20 20 20 20 20 20 20 20 20 |e. 680 | 000025e0 4c 44 41 20 23 26 46 45 20 20 20 20 20 20 5c 20 |LDA #&FE \ | 000025f0 4c 53 42 20 6f 66 20 77 6f 72 64 20 70 6f 69 6e |LSB of word poin| 00002600 74 65 72 73 0d 20 20 36 39 30 20 20 20 20 20 20 |ters. 690 | 00002610 20 20 20 53 54 41 20 70 6f 69 6e 74 65 72 20 20 | STA pointer | 00002620 20 5c 20 4c 53 42 20 6f 66 20 70 6f 69 6e 74 65 | \ LSB of pointe| 00002630 72 20 74 61 62 6c 65 0d 20 20 37 30 30 20 20 20 |r table. 700 | 00002640 20 20 20 20 20 20 4c 44 41 20 23 30 20 20 20 20 | LDA #0 | 00002650 20 20 20 20 5c 20 4d 53 42 20 6f 66 20 77 6f 72 | \ MSB of wor| 00002660 64 20 70 6f 69 6e 74 65 72 73 0d 20 20 37 31 30 |d pointers. 710| 00002670 20 20 20 20 20 20 20 20 20 53 54 41 20 70 6f 69 | STA poi| 00002680 6e 74 65 72 2b 31 20 5c 20 4d 53 42 20 6f 66 20 |nter+1 \ MSB of | 00002690 70 6f 69 6e 74 65 72 20 74 61 62 6c 65 0d 20 20 |pointer table. | 000026a0 37 32 30 20 2e 73 65 61 72 63 68 0d 20 20 37 33 |720 .search. 73| 000026b0 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 26 46 |0 LDA &F| 000026c0 46 20 20 20 20 20 20 20 5c 20 70 6f 6c 6c 20 65 |F \ poll e| 000026d0 73 63 61 70 65 20 66 6c 61 67 0d 20 20 37 34 30 |scape flag. 740| 000026e0 20 20 20 20 20 20 20 20 20 42 4d 49 20 65 73 63 | BMI esc| 000026f0 61 70 65 20 20 20 20 5c 20 62 72 61 6e 63 68 20 |ape \ branch | 00002700 69 66 20 65 73 63 61 70 65 20 70 72 65 73 73 65 |if escape presse| 00002710 64 0d 20 20 37 35 30 20 20 20 20 20 20 20 20 20 |d. 750 | 00002720 4c 44 58 20 70 6f 69 6e 74 65 72 20 20 20 5c 20 |LDX pointer \ | 00002730 4c 53 42 20 66 6f 72 20 61 64 64 72 65 73 73 20 |LSB for address | 00002740 72 65 67 69 73 74 65 72 0d 20 20 37 36 30 20 20 |register. 760 | 00002750 20 20 20 20 20 20 20 4c 44 59 20 70 6f 69 6e 74 | LDY point| 00002760 65 72 2b 31 20 5c 20 4d 53 42 20 66 6f 72 20 61 |er+1 \ MSB for a| 00002770 64 64 72 65 73 73 20 72 65 67 69 73 74 65 72 0d |ddress register.| 00002780 20 20 37 37 30 20 20 20 20 20 20 20 20 20 54 58 | 770 TX| 00002790 41 0d 20 20 37 38 30 20 20 20 20 20 20 20 20 20 |A. 780 | 000027a0 43 4c 43 0d 20 20 37 39 30 20 20 20 20 20 20 20 |CLC. 790 | 000027b0 20 20 41 44 43 20 23 32 20 20 20 20 20 20 20 20 | ADC #2 | 000027c0 5c 20 61 64 64 20 32 20 74 6f 20 70 6f 69 6e 74 |\ add 2 to point| 000027d0 65 72 20 66 6f 72 20 6e 65 78 74 20 74 69 6d 65 |er for next time| 000027e0 0d 20 20 38 30 30 20 20 20 20 20 20 20 20 20 53 |. 800 S| 000027f0 54 41 20 70 6f 69 6e 74 65 72 0d 20 20 38 31 30 |TA pointer. 810| 00002800 20 20 20 20 20 20 20 20 20 54 59 41 0d 20 20 38 | TYA. 8| 00002810 32 30 20 20 20 20 20 20 20 20 20 41 44 43 20 23 |20 ADC #| 00002820 30 0d 20 20 38 33 30 20 20 20 20 20 20 20 20 20 |0. 830 | 00002830 53 54 41 20 70 6f 69 6e 74 65 72 2b 31 0d 20 20 |STA pointer+1. | 00002840 38 34 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 |840 JSR | 00002850 61 64 64 72 65 73 73 20 20 20 5c 20 77 72 69 74 |address \ writ| 00002860 65 20 58 59 20 69 6e 74 6f 20 61 64 64 72 65 73 |e XY into addres| 00002870 73 20 72 65 67 69 73 74 65 72 0d 20 20 38 35 30 |s register. 850| 00002880 20 20 20 20 20 20 20 20 20 4a 53 52 20 72 65 61 | JSR rea| 00002890 64 20 20 20 20 20 20 5c 20 72 65 61 64 20 4c 53 |d \ read LS| 000028a0 42 20 61 74 20 74 68 69 73 20 61 64 64 72 65 73 |B at this addres| 000028b0 73 0d 20 20 38 36 30 20 20 20 20 20 20 20 20 20 |s. 860 | 000028c0 4a 53 52 20 72 65 76 65 72 73 65 20 20 20 5c 20 |JSR reverse \ | 000028d0 72 65 76 65 72 73 65 20 74 68 65 20 62 69 74 73 |reverse the bits| 000028e0 0d 20 20 38 37 30 20 20 20 20 20 20 20 20 20 43 |. 870 C| 000028f0 4d 50 20 23 26 46 46 20 20 20 20 20 20 5c 20 69 |MP #&FF \ i| 00002900 73 20 69 74 20 74 68 65 20 74 65 72 6d 69 6e 61 |s it the termina| 00002910 74 69 6f 6e 20 62 79 74 65 3f 0d 20 20 38 38 30 |tion byte?. 880| 00002920 20 20 20 20 20 20 20 20 20 42 45 51 20 72 65 74 | BEQ ret| 00002930 75 72 6e 20 20 20 20 5c 20 69 66 20 79 65 73 20 |urn \ if yes | 00002940 72 65 74 75 72 6e 20 74 6f 20 42 41 53 49 43 0d |return to BASIC.| 00002950 20 20 38 39 30 20 20 20 20 20 20 20 20 20 53 54 | 890 ST| 00002960 41 20 77 6f 72 6b 73 70 61 63 65 20 5c 20 73 74 |A workspace \ st| 00002970 6f 72 65 20 72 65 76 65 72 73 65 64 20 4c 53 42 |ore reversed LSB| 00002980 0d 20 20 39 30 30 20 20 20 20 20 20 20 20 20 4a |. 900 J| 00002990 53 52 20 72 65 61 64 20 20 20 20 20 20 5c 20 72 |SR read \ r| 000029a0 65 61 64 20 4d 53 42 0d 20 20 39 31 30 20 20 20 |ead MSB. 910 | 000029b0 20 20 20 20 20 20 4a 53 52 20 72 65 76 65 72 73 | JSR revers| 000029c0 65 20 20 20 5c 20 72 65 76 65 72 73 65 20 74 68 |e \ reverse th| 000029d0 65 20 62 69 74 73 0d 20 20 39 32 30 20 20 20 20 |e bits. 920 | 000029e0 20 20 20 20 20 53 54 41 20 77 6f 72 6b 73 70 61 | STA workspa| 000029f0 63 65 2b 31 20 5c 20 73 74 6f 72 65 20 72 65 76 |ce+1 \ store rev| 00002a00 65 72 73 65 64 20 4d 53 42 0d 20 20 39 33 30 20 |ersed MSB. 930 | 00002a10 20 20 20 20 20 20 20 20 4c 44 41 20 77 6f 72 6b | LDA work| 00002a20 73 70 61 63 65 20 5c 20 6c 6f 61 64 20 4c 53 42 |space \ load LSB| 00002a30 0d 20 20 39 34 30 20 20 20 20 20 20 20 20 20 53 |. 940 S| 00002a40 45 43 0d 20 20 39 35 30 20 20 20 20 20 20 20 20 |EC. 950 | 00002a50 20 53 42 43 20 6c 65 6e 67 74 68 20 20 20 20 5c | SBC length \| 00002a60 20 61 6e 64 20 73 75 62 74 72 61 63 74 20 74 68 | and subtract th| 00002a70 65 20 6c 65 6e 67 74 68 20 6f 66 20 74 68 65 20 |e length of the | 00002a80 77 6f 72 64 0d 20 20 39 36 30 20 20 20 20 20 20 |word. 960 | 00002a90 20 20 20 54 41 58 20 20 20 20 20 20 20 20 20 20 | TAX | 00002aa0 20 5c 20 4c 53 42 20 69 6e 74 6f 20 58 0d 20 20 | \ LSB into X. | 00002ab0 39 37 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 |970 LDA | 00002ac0 77 6f 72 6b 73 70 61 63 65 2b 31 20 5c 20 6c 6f |workspace+1 \ lo| 00002ad0 61 64 20 4d 53 42 0d 20 20 39 38 30 20 20 20 20 |ad MSB. 980 | 00002ae0 20 20 20 20 20 53 42 43 20 23 30 0d 20 20 39 39 | SBC #0. 99| 00002af0 30 20 20 20 20 20 20 20 20 20 54 41 59 20 20 20 |0 TAY | 00002b00 20 20 20 20 20 20 20 20 5c 20 4d 53 42 20 69 6e | \ MSB in| 00002b10 74 6f 20 59 0d 20 31 30 30 30 20 20 20 20 20 20 |to Y. 1000 | 00002b20 20 20 20 4a 53 52 20 61 64 64 72 65 73 73 20 20 | JSR address | 00002b30 20 5c 20 77 72 69 74 65 20 58 59 20 69 6e 74 6f | \ write XY into| 00002b40 20 61 64 64 72 65 73 73 20 72 65 67 69 73 74 65 | address registe| 00002b50 72 0d 20 31 30 31 30 20 20 20 20 20 20 20 20 20 |r. 1010 | 00002b60 4a 53 52 20 72 65 61 64 20 20 20 20 20 20 5c 20 |JSR read \ | 00002b70 72 65 61 64 20 6c 61 73 74 20 63 68 61 72 61 63 |read last charac| 00002b80 74 65 72 20 66 72 6f 6d 20 50 48 52 4f 4d 0d 20 |ter from PHROM. | 00002b90 31 30 32 30 20 20 20 20 20 20 20 20 20 4a 53 52 |1020 JSR| 00002ba0 20 72 6f 74 61 74 65 20 20 20 20 5c 20 72 6f 74 | rotate \ rot| 00002bb0 61 74 65 20 74 68 65 20 62 69 74 73 0d 20 31 30 |ate the bits. 10| 00002bc0 33 30 20 20 20 20 20 20 20 20 20 43 4d 50 20 74 |30 CMP t| 00002bd0 65 73 74 62 79 74 65 20 20 5c 20 69 73 20 69 74 |estbyte \ is it| 00002be0 20 74 68 65 20 73 61 6d 65 20 61 73 20 74 79 70 | the same as typ| 00002bf0 65 64 20 77 6f 72 64 3f 0d 20 31 30 34 30 20 20 |ed word?. 1040 | 00002c00 20 20 20 20 20 20 20 42 4e 45 20 73 65 61 72 63 | BNE searc| 00002c10 68 20 20 20 20 5c 20 4e 6f 2c 20 74 72 79 20 6e |h \ No, try n| 00002c20 65 78 74 20 70 6f 69 6e 74 65 72 0d 20 31 30 35 |ext pointer. 105| 00002c30 30 20 20 20 20 20 20 20 20 20 4c 44 58 20 6f 66 |0 LDX of| 00002c40 66 73 65 74 20 20 20 20 5c 20 59 65 73 2c 20 63 |fset \ Yes, c| 00002c50 6f 6d 70 61 72 65 20 61 6c 6c 20 63 68 61 72 61 |ompare all chara| 00002c60 63 74 65 72 73 0d 20 31 30 36 30 20 2e 63 6f 6d |cters. 1060 .com| 00002c70 70 61 72 65 0d 20 31 30 37 30 20 20 20 20 20 20 |pare. 1070 | 00002c80 20 20 20 44 45 58 0d 20 31 30 38 30 20 20 20 20 | DEX. 1080 | 00002c90 20 20 20 20 20 42 4d 49 20 73 61 79 69 74 20 20 | BMI sayit | 00002ca0 20 20 20 5c 20 69 66 20 58 3d 26 46 46 20 77 6f | \ if X=&FF wo| 00002cb0 72 64 20 6d 61 74 63 68 20 66 6f 75 6e 64 0d 20 |rd match found. | 00002cc0 31 30 39 30 20 20 20 20 20 20 20 20 20 4a 53 52 |1090 JSR| 00002cd0 20 72 65 61 64 20 20 20 20 20 20 5c 20 72 65 61 | read \ rea| 00002ce0 64 20 6e 65 78 74 20 62 79 74 65 0d 20 31 31 30 |d next byte. 110| 00002cf0 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 72 6f |0 JSR ro| 00002d00 74 61 74 65 20 20 20 20 5c 20 72 6f 74 61 74 65 |tate \ rotate| 00002d10 20 74 68 65 20 62 69 74 73 0d 20 31 31 31 30 20 | the bits. 1110 | 00002d20 20 20 20 20 20 20 20 20 43 4d 50 20 62 75 66 66 | CMP buff| 00002d30 65 72 2c 58 20 20 5c 20 63 6f 6d 70 61 72 65 20 |er,X \ compare | 00002d40 77 69 74 68 20 74 79 70 65 64 20 77 6f 72 64 0d |with typed word.| 00002d50 20 31 31 32 30 20 20 20 20 20 20 20 20 20 42 4e | 1120 BN| 00002d60 45 20 73 65 61 72 63 68 20 20 20 20 5c 20 62 72 |E search \ br| 00002d70 61 6e 63 68 20 69 66 20 6e 6f 20 6d 61 74 63 68 |anch if no match| 00002d80 0d 20 31 31 33 30 20 20 20 20 20 20 20 20 20 42 |. 1130 B| 00002d90 45 51 20 63 6f 6d 70 61 72 65 20 20 20 5c 20 63 |EQ compare \ c| 00002da0 6f 6d 70 61 72 65 20 6e 65 78 74 20 63 68 61 72 |ompare next char| 00002db0 61 63 74 65 72 0d 20 31 31 34 30 20 2e 73 61 79 |acter. 1140 .say| 00002dc0 69 74 0d 20 31 31 35 30 20 20 20 20 20 20 20 20 |it. 1150 | 00002dd0 20 4c 44 41 20 23 26 39 46 20 20 20 20 20 20 5c | LDA #&9F \| 00002de0 20 77 72 69 74 65 20 74 6f 20 73 70 65 65 63 68 | write to speech| 00002df0 20 70 72 6f 63 65 73 73 6f 72 0d 20 31 31 36 30 | processor. 1160| 00002e00 20 20 20 20 20 20 20 20 20 4c 44 59 20 23 26 35 | LDY #&5| 00002e10 30 20 20 20 20 20 20 5c 20 73 70 65 61 6b 20 63 |0 \ speak c| 00002e20 6f 6d 6d 61 6e 64 0d 20 31 31 37 30 20 20 20 20 |ommand. 1170 | 00002e30 20 20 20 20 20 4a 53 52 20 6f 73 62 79 74 65 20 | JSR osbyte | 00002e40 20 20 20 5c 20 73 70 65 61 6b 20 74 68 65 20 77 | \ speak the w| 00002e50 6f 72 64 0d 20 31 31 38 30 20 20 20 20 20 20 20 |ord. 1180 | 00002e60 20 20 4c 44 41 20 23 41 53 43 28 22 26 22 29 20 | LDA #ASC("&") | 00002e70 5c 20 68 65 78 20 73 79 6d 62 6f 6c 0d 20 31 31 |\ hex symbol. 11| 00002e80 39 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 6f |90 JSR o| 00002e90 73 77 72 63 68 0d 20 31 32 30 30 20 20 20 20 20 |swrch. 1200 | 00002ea0 20 20 20 20 4c 44 41 20 77 6f 72 6b 73 70 61 63 | LDA workspac| 00002eb0 65 2b 31 0d 20 31 32 31 30 20 20 20 20 20 20 20 |e+1. 1210 | 00002ec0 20 20 4a 53 52 20 70 72 69 6e 74 68 65 78 20 20 | JSR printhex | 00002ed0 5c 20 70 72 69 6e 74 20 4d 53 42 20 6f 66 20 61 |\ print MSB of a| 00002ee0 64 64 72 65 73 73 0d 20 31 32 32 30 20 20 20 20 |ddress. 1220 | 00002ef0 20 20 20 20 20 4c 44 41 20 77 6f 72 6b 73 70 61 | LDA workspa| 00002f00 63 65 0d 20 31 32 33 30 20 20 20 20 20 20 20 20 |ce. 1230 | 00002f10 20 4a 53 52 20 70 72 69 6e 74 68 65 78 20 20 5c | JSR printhex \| 00002f20 20 70 72 69 6e 74 20 4c 53 42 20 6f 66 20 61 64 | print LSB of ad| 00002f30 64 72 65 73 73 0d 20 31 32 34 30 20 20 20 20 20 |dress. 1240 | 00002f40 20 20 20 20 4a 53 52 20 6f 73 6e 65 77 6c 0d 20 | JSR osnewl. | 00002f50 31 32 35 30 20 2e 72 65 74 75 72 6e 0d 20 31 32 |1250 .return. 12| 00002f60 36 30 20 20 20 20 20 20 20 20 20 52 54 53 20 20 |60 RTS | 00002f70 20 20 20 20 20 20 20 20 20 5c 20 72 65 74 75 72 | \ retur| 00002f80 6e 20 74 6f 20 42 41 53 49 43 0d 20 31 32 37 30 |n to BASIC. 1270| 00002f90 20 2e 61 64 64 72 65 73 73 0d 20 31 32 38 30 20 | .address. 1280 | 00002fa0 20 20 20 20 20 20 20 20 54 59 41 20 20 20 20 20 | TYA | 00002fb0 20 20 20 20 20 20 5c 20 4d 53 42 20 69 73 20 69 | \ MSB is i| 00002fc0 6e 20 59 20 72 65 67 69 73 74 65 72 0d 20 31 32 |n Y register. 12| 00002fd0 39 30 20 20 20 20 20 20 20 20 20 50 48 41 20 20 |90 PHA | 00002fe0 20 20 20 20 20 20 20 20 20 5c 20 70 75 73 68 20 | \ push | 00002ff0 4d 53 42 20 74 77 69 63 65 0d 20 31 33 30 30 20 |MSB twice. 1300 | 00003000 20 20 20 20 20 20 20 20 50 48 41 0d 20 31 33 31 | PHA. 131| 00003010 30 20 20 20 20 20 20 20 20 20 54 58 41 20 20 20 |0 TXA | 00003020 20 20 20 20 20 20 20 20 5c 20 4c 53 42 20 69 73 | \ LSB is| 00003030 20 69 6e 20 58 20 72 65 67 69 73 74 65 72 0d 20 | in X register. | 00003040 31 33 32 30 20 20 20 20 20 20 20 20 20 41 4e 44 |1320 AND| 00003050 20 23 26 46 20 20 20 20 20 20 20 5c 20 69 73 6f | #&F \ iso| 00003060 6c 61 74 65 20 66 69 72 73 74 20 6e 79 62 62 6c |late first nybbl| 00003070 65 0d 20 31 33 33 30 20 20 20 20 20 20 20 20 20 |e. 1330 | 00003080 4f 52 41 20 23 26 34 30 20 20 20 20 20 20 5c 20 |ORA #&40 \ | 00003090 4f 52 20 69 74 20 77 69 74 68 20 4c 6f 61 64 20 |OR it with Load | 000030a0 41 64 64 72 65 73 73 20 63 6f 6d 6d 61 6e 64 0d |Address command.| 000030b0 20 31 33 34 30 20 20 20 20 20 20 20 20 20 4a 53 | 1340 JS| 000030c0 52 20 77 72 69 74 65 20 20 20 20 20 5c 20 73 65 |R write \ se| 000030d0 6e 64 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 73 70 |nd command to sp| 000030e0 65 65 63 68 20 70 72 6f 63 65 73 73 6f 72 0d 20 |eech processor. | 000030f0 31 33 35 30 20 20 20 20 20 20 20 20 20 54 58 41 |1350 TXA| 00003100 20 20 20 20 20 20 20 20 20 20 20 5c 20 73 65 63 | \ sec| 00003110 6f 6e 64 20 6e 79 62 62 6c 65 0d 20 31 33 36 30 |ond nybble. 1360| 00003120 20 20 20 20 20 20 20 20 20 41 4e 44 20 23 26 46 | AND #&F| 00003130 30 0d 20 31 33 37 30 20 20 20 20 20 20 20 20 20 |0. 1370 | 00003140 4c 53 52 20 41 0d 20 31 33 38 30 20 20 20 20 20 |LSR A. 1380 | 00003150 20 20 20 20 4c 53 52 20 41 0d 20 31 33 39 30 20 | LSR A. 1390 | 00003160 20 20 20 20 20 20 20 20 4c 53 52 20 41 0d 20 31 | LSR A. 1| 00003170 34 30 30 20 20 20 20 20 20 20 20 20 4c 53 52 20 |400 LSR | 00003180 41 0d 20 31 34 31 30 20 20 20 20 20 20 20 20 20 |A. 1410 | 00003190 4f 52 41 20 23 26 34 30 0d 20 31 34 32 30 20 20 |ORA #&40. 1420 | 000031a0 20 20 20 20 20 20 20 4a 53 52 20 77 72 69 74 65 | JSR write| 000031b0 20 20 20 20 20 5c 20 73 65 6e 64 20 63 6f 6d 6d | \ send comm| 000031c0 61 6e 64 20 74 6f 20 73 70 65 65 63 68 20 70 72 |and to speech pr| 000031d0 6f 63 65 73 73 6f 72 0d 20 31 34 33 30 20 20 20 |ocessor. 1430 | 000031e0 20 20 20 20 20 20 50 4c 41 20 20 20 20 20 20 20 | PLA | 000031f0 20 20 20 20 5c 20 74 68 69 72 64 20 6e 79 62 62 | \ third nybb| 00003200 6c 65 0d 20 31 34 34 30 20 20 20 20 20 20 20 20 |le. 1440 | 00003210 20 41 4e 44 20 23 26 46 0d 20 31 34 35 30 20 20 | AND #&F. 1450 | 00003220 20 20 20 20 20 20 20 4f 52 41 20 23 26 34 30 0d | ORA #&40.| 00003230 20 31 34 36 30 20 20 20 20 20 20 20 20 20 4a 53 | 1460 JS| 00003240 52 20 77 72 69 74 65 20 20 20 20 20 5c 20 73 65 |R write \ se| 00003250 6e 64 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 73 70 |nd command to sp| 00003260 65 65 63 68 20 70 72 6f 63 65 73 73 6f 72 0d 20 |eech processor. | 00003270 31 34 37 30 20 20 20 20 20 20 20 20 20 50 4c 41 |1470 PLA| 00003280 20 20 20 20 20 20 20 20 20 20 20 5c 20 66 6f 75 | \ fou| 00003290 72 74 68 20 6e 79 62 62 6c 65 0d 20 31 34 38 30 |rth nybble. 1480| 000032a0 20 20 20 20 20 20 20 20 20 41 4e 44 20 23 26 46 | AND #&F| 000032b0 30 0d 20 31 34 39 30 20 20 20 20 20 20 20 20 20 |0. 1490 | 000032c0 4c 53 52 20 41 0d 20 31 35 30 30 20 20 20 20 20 |LSR A. 1500 | 000032d0 20 20 20 20 4c 53 52 20 41 0d 20 31 35 31 30 20 | LSR A. 1510 | 000032e0 20 20 20 20 20 20 20 20 4c 53 52 20 41 0d 20 31 | LSR A. 1| 000032f0 35 32 30 20 20 20 20 20 20 20 20 20 4c 53 52 20 |520 LSR | 00003300 41 0d 20 31 35 33 30 20 20 20 20 20 20 20 20 20 |A. 1530 | 00003310 4f 52 41 20 23 26 34 43 0d 20 31 35 34 30 20 20 |ORA #&4C. 1540 | 00003320 20 20 20 20 20 20 20 4a 53 52 20 77 72 69 74 65 | JSR write| 00003330 20 20 20 20 20 5c 20 73 65 6e 64 20 63 6f 6d 6d | \ send comm| 00003340 61 6e 64 20 74 6f 20 73 70 65 65 63 68 20 70 72 |and to speech pr| 00003350 6f 63 65 73 73 6f 72 0d 20 31 35 35 30 20 20 20 |ocessor. 1550 | 00003360 20 20 20 20 20 20 4c 44 41 20 23 26 34 33 20 20 | LDA #&43 | 00003370 20 20 20 20 5c 20 6c 61 73 74 20 62 79 74 65 20 | \ last byte | 00003380 61 6c 77 61 79 73 20 23 26 34 33 0d 20 31 35 36 |always #&43. 156| 00003390 30 20 2e 77 72 69 74 65 0d 20 31 35 37 30 20 20 |0 .write. 1570 | 000033a0 20 20 20 20 20 20 20 54 41 59 20 20 20 20 20 20 | TAY | 000033b0 20 20 20 20 20 5c 20 74 72 61 6e 73 66 65 72 20 | \ transfer | 000033c0 63 6f 6d 6d 61 6e 64 20 69 6e 74 6f 20 59 20 72 |command into Y r| 000033d0 65 67 69 73 74 65 72 0d 20 31 35 38 30 20 20 20 |egister. 1580 | 000033e0 20 20 20 20 20 20 4c 44 41 20 23 26 39 46 20 20 | LDA #&9F | 000033f0 20 20 20 20 5c 20 77 72 69 74 65 20 74 6f 20 73 | \ write to s| 00003400 70 65 65 63 68 20 70 72 6f 63 65 73 73 6f 72 0d |peech processor.| 00003410 20 31 35 39 30 20 20 20 20 20 20 20 20 20 4a 4d | 1590 JM| 00003420 50 20 6f 73 62 79 74 65 20 20 20 20 5c 20 4f 73 |P osbyte \ Os| 00003430 62 79 74 65 20 61 6e 64 20 72 65 74 75 72 6e 0d |byte and return.| 00003440 20 31 36 30 30 20 2e 72 65 61 64 0d 20 31 36 31 | 1600 .read. 161| 00003450 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 26 |0 LDA #&| 00003460 39 46 20 20 20 20 20 20 5c 20 77 72 69 74 65 20 |9F \ write | 00003470 74 6f 20 73 70 65 65 63 68 20 70 72 6f 63 65 73 |to speech proces| 00003480 73 6f 72 0d 20 31 36 32 30 20 20 20 20 20 20 20 |sor. 1620 | 00003490 20 20 4c 44 59 20 23 26 31 30 20 20 20 20 20 20 | LDY #&10 | 000034a0 5c 20 72 65 61 64 20 62 79 74 65 20 63 6f 6d 6d |\ read byte comm| 000034b0 61 6e 64 0d 20 31 36 33 30 20 20 20 20 20 20 20 |and. 1630 | 000034c0 20 20 4a 53 52 20 6f 73 62 79 74 65 20 20 20 20 | JSR osbyte | 000034d0 5c 20 73 65 6e 64 20 72 65 61 64 20 62 79 74 65 |\ send read byte| 000034e0 20 63 6f 6d 6d 61 6e 64 0d 20 31 36 34 30 20 20 | command. 1640 | 000034f0 20 20 20 20 20 20 20 4c 44 41 20 23 26 39 45 20 | LDA #&9E | 00003500 20 20 20 20 20 5c 20 72 65 61 64 20 73 70 65 65 | \ read spee| 00003510 63 68 20 70 72 6f 63 65 73 73 6f 72 0d 20 31 36 |ch processor. 16| 00003520 35 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 6f |50 JSR o| 00003530 73 62 79 74 65 20 20 20 20 5c 20 72 65 61 64 20 |sbyte \ read | 00003540 6e 65 78 74 20 62 79 74 65 20 66 72 6f 6d 20 50 |next byte from P| 00003550 48 52 4f 4d 0d 20 31 36 36 30 20 20 20 20 20 20 |HROM. 1660 | 00003560 20 20 20 54 59 41 20 20 20 20 20 20 20 20 20 20 | TYA | 00003570 20 5c 20 72 65 73 75 6c 74 20 69 6e 20 61 63 63 | \ result in acc| 00003580 75 6d 75 6c 61 74 6f 72 0d 20 31 36 37 30 20 20 |umulator. 1670 | 00003590 20 20 20 20 20 20 20 52 54 53 0d 20 31 36 38 30 | RTS. 1680| 000035a0 20 2e 72 6f 74 61 74 65 0d 20 31 36 39 30 20 20 | .rotate. 1690 | 000035b0 20 20 20 20 20 20 20 50 48 41 0d 20 31 37 30 30 | PHA. 1700| 000035c0 20 20 20 20 20 20 20 20 20 52 4f 52 20 41 20 20 | ROR A | 000035d0 20 20 20 20 20 20 20 5c 20 62 69 74 20 30 20 69 | \ bit 0 i| 000035e0 6e 74 6f 20 63 61 72 72 79 20 66 6c 61 67 0d 20 |nto carry flag. | 000035f0 31 37 31 30 20 20 20 20 20 20 20 20 20 50 4c 41 |1710 PLA| 00003600 0d 20 31 37 32 30 20 20 20 20 20 20 20 20 20 52 |. 1720 R| 00003610 4f 52 20 41 20 20 20 20 20 20 20 20 20 5c 20 72 |OR A \ r| 00003620 6f 74 61 74 65 20 74 68 65 20 62 79 74 65 20 72 |otate the byte r| 00003630 65 61 64 20 66 72 6f 6d 20 50 48 52 4f 4d 0d 20 |ead from PHROM. | 00003640 31 37 33 30 20 20 20 20 20 20 20 20 20 52 54 53 |1730 RTS| 00003650 0d 20 31 37 34 30 20 2e 72 65 76 65 72 73 65 0d |. 1740 .reverse.| 00003660 20 31 37 35 30 20 20 20 20 20 20 20 20 20 53 54 | 1750 ST| 00003670 41 20 74 65 6d 70 20 20 20 20 20 20 5c 20 74 65 |A temp \ te| 00003680 6d 70 6f 72 61 72 79 20 73 74 6f 72 65 20 66 6f |mporary store fo| 00003690 72 20 62 79 74 65 0d 20 31 37 36 30 20 20 20 20 |r byte. 1760 | 000036a0 20 20 20 20 20 52 4f 4c 20 74 65 6d 70 20 20 20 | ROL temp | 000036b0 20 20 20 5c 20 62 69 74 20 37 20 69 6e 74 6f 20 | \ bit 7 into | 000036c0 63 61 72 72 79 20 66 6c 61 67 0d 20 31 37 37 30 |carry flag. 1770| 000036d0 20 20 20 20 20 20 20 20 20 52 4f 52 20 41 20 20 | ROR A | 000036e0 20 20 20 20 20 20 20 5c 20 63 61 72 72 79 20 74 | \ carry t| 000036f0 6f 20 62 69 74 20 37 20 6f 66 20 61 63 63 75 6d |o bit 7 of accum| 00003700 75 6c 61 74 6f 72 0d 20 31 37 38 30 20 20 20 20 |ulator. 1780 | 00003710 20 20 20 20 20 52 4f 4c 20 74 65 6d 70 20 20 20 | ROL temp | 00003720 20 20 20 5c 20 62 69 74 20 36 20 69 6e 74 6f 20 | \ bit 6 into | 00003730 63 61 72 72 79 20 66 6c 61 67 0d 20 31 37 39 30 |carry flag. 1790| 00003740 20 20 20 20 20 20 20 20 20 52 4f 52 20 41 20 20 | ROR A | 00003750 20 20 20 20 20 20 20 5c 20 62 69 74 20 37 20 74 | \ bit 7 t| 00003760 6f 20 36 2c 20 63 61 72 72 79 20 74 6f 20 62 69 |o 6, carry to bi| 00003770 74 20 37 0d 20 31 38 30 30 20 20 20 20 20 20 20 |t 7. 1800 | 00003780 20 20 52 4f 4c 20 74 65 6d 70 20 20 20 20 20 20 | ROL temp | 00003790 5c 20 62 69 74 20 35 20 69 6e 74 6f 20 63 61 72 |\ bit 5 into car| 000037a0 72 79 0d 20 31 38 31 30 20 20 20 20 20 20 20 20 |ry. 1810 | 000037b0 20 52 4f 52 20 41 20 20 20 20 20 20 20 20 20 5c | ROR A \| 000037c0 20 61 6e 64 20 73 6f 20 6f 6e 20 2e 2e 2e 0d 20 | and so on .... | 000037d0 31 38 32 30 20 20 20 20 20 20 20 20 20 52 4f 4c |1820 ROL| 000037e0 20 74 65 6d 70 0d 20 31 38 33 30 20 20 20 20 20 | temp. 1830 | 000037f0 20 20 20 20 52 4f 52 20 41 0d 20 31 38 34 30 20 | ROR A. 1840 | 00003800 20 20 20 20 20 20 20 20 52 4f 4c 20 74 65 6d 70 | ROL temp| 00003810 0d 20 31 38 35 30 20 20 20 20 20 20 20 20 20 52 |. 1850 R| 00003820 4f 52 20 41 0d 20 31 38 36 30 20 20 20 20 20 20 |OR A. 1860 | 00003830 20 20 20 52 4f 4c 20 74 65 6d 70 0d 20 31 38 37 | ROL temp. 187| 00003840 30 20 20 20 20 20 20 20 20 20 52 4f 52 20 41 0d |0 ROR A.| 00003850 20 31 38 38 30 20 20 20 20 20 20 20 20 20 52 4f | 1880 RO| 00003860 4c 20 74 65 6d 70 0d 20 31 38 39 30 20 20 20 20 |L temp. 1890 | 00003870 20 20 20 20 20 52 4f 52 20 41 0d 20 31 39 30 30 | ROR A. 1900| 00003880 20 20 20 20 20 20 20 20 20 52 4f 4c 20 74 65 6d | ROL tem| 00003890 70 0d 20 31 39 31 30 20 20 20 20 20 20 20 20 20 |p. 1910 | 000038a0 52 4f 52 20 41 20 20 20 20 20 20 20 20 20 5c 20 |ROR A \ | 000038b0 62 69 74 73 20 69 6e 20 61 63 63 75 6d 75 6c 61 |bits in accumula| 000038c0 74 6f 72 20 72 65 76 65 72 73 65 64 0d 20 31 39 |tor reversed. 19| 000038d0 32 30 20 20 20 20 20 20 20 20 20 52 54 53 0d 20 |20 RTS. | 000038e0 31 39 33 30 20 2e 70 72 69 6e 74 68 65 78 0d 20 |1930 .printhex. | 000038f0 31 39 34 30 20 20 20 20 20 20 20 20 20 50 48 41 |1940 PHA| 00003900 0d 20 31 39 35 30 20 20 20 20 20 20 20 20 20 4c |. 1950 L| 00003910 53 52 20 41 0d 20 31 39 36 30 20 20 20 20 20 20 |SR A. 1960 | 00003920 20 20 20 4c 53 52 20 41 0d 20 31 39 37 30 20 20 | LSR A. 1970 | 00003930 20 20 20 20 20 20 20 4c 53 52 20 41 0d 20 31 39 | LSR A. 19| 00003940 38 30 20 20 20 20 20 20 20 20 20 4c 53 52 20 41 |80 LSR A| 00003950 0d 20 31 39 39 30 20 20 20 20 20 20 20 20 20 4a |. 1990 J| 00003960 53 52 20 6e 79 62 62 6c 65 20 20 20 20 5c 20 70 |SR nybble \ p| 00003970 72 69 6e 74 20 4d 53 20 6e 79 62 62 6c 65 20 69 |rint MS nybble i| 00003980 6e 20 41 53 43 49 49 0d 20 32 30 30 30 20 20 20 |n ASCII. 2000 | 00003990 20 20 20 20 20 20 50 4c 41 20 20 20 20 20 20 20 | PLA | 000039a0 20 20 20 20 5c 20 61 6e 64 20 70 72 69 6e 74 20 | \ and print | 000039b0 4c 53 20 6e 79 62 62 6c 65 20 69 6e 20 41 53 43 |LS nybble in ASC| 000039c0 49 49 0d 20 32 30 31 30 20 2e 6e 79 62 62 6c 65 |II. 2010 .nybble| 000039d0 0d 20 32 30 32 30 20 20 20 20 20 20 20 20 20 41 |. 2020 A| 000039e0 4e 44 20 23 26 46 0d 20 32 30 33 30 20 20 20 20 |ND #&F. 2030 | 000039f0 20 20 20 20 20 53 45 44 0d 20 32 30 34 30 20 20 | SED. 2040 | 00003a00 20 20 20 20 20 20 20 43 4c 43 0d 20 32 30 35 30 | CLC. 2050| 00003a10 20 20 20 20 20 20 20 20 20 41 44 43 20 23 26 39 | ADC #&9| 00003a20 30 0d 20 32 30 36 30 20 20 20 20 20 20 20 20 20 |0. 2060 | 00003a30 41 44 43 20 23 26 34 30 0d 20 32 30 37 30 20 20 |ADC #&40. 2070 | 00003a40 20 20 20 20 20 20 20 43 4c 44 0d 20 32 30 38 30 | CLD. 2080| 00003a50 20 20 20 20 20 20 20 20 20 4a 4d 50 20 6f 73 77 | JMP osw| 00003a60 72 63 68 0d 20 32 30 39 30 20 2e 62 6c 6f 63 6b |rch. 2090 .block| 00003a70 0d 20 32 31 30 30 20 20 20 20 20 20 20 20 20 45 |. 2100 E| 00003a80 51 55 57 20 62 75 66 66 65 72 0d 20 32 31 31 30 |QUW buffer. 2110| 00003a90 20 20 20 20 20 20 20 20 20 45 51 55 42 20 26 46 | EQUB &F| 00003aa0 0d 20 32 31 32 30 20 20 20 20 20 20 20 20 20 45 |. 2120 E| 00003ab0 51 55 42 20 41 53 43 28 22 20 22 29 0d 20 32 31 |QUB ASC(" "). 21| 00003ac0 33 30 20 20 20 20 20 20 20 20 20 45 51 55 42 20 |30 EQUB | 00003ad0 41 53 43 28 22 7e 22 29 0d 20 32 31 34 30 20 5d |ASC("~"). 2140 ]| 00003ae0 0d 20 32 31 35 30 20 4e 45 58 54 0d 20 32 31 36 |. 2150 NEXT. 216| 00003af0 30 20 43 41 4c 4c 20 6d 63 6f 64 65 0d |0 CALL mcode.| 00003afd