Home » CEEFAX disks » telesoftware16.adl » Speller/C/SETUP

Speller/C/SETUP

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 » telesoftware16.adl
Filename: Speller/C/SETUP
Read OK:
File size: 057A bytes
Load address: FFFF1900
Exec address: FFFF8023
File contents
   10REM Watcher Spelling Checker
   20REM (C) Allan Kelly 12/7/87
   30REM Set up dictionary
   40 
   50DIM table(27)
   60nw$="C.NEWORDS"
   70diction$="C.DICTION"
   80 
   90PRINT''"Creating Dictionary File"
  100PRINT"Are you sure? (Y/N)"
  110*FX21,0
  120REPEAT key=GET AND&DF
  130UNTIL key=ASC"Y" OR key=ASC"N"
  140IF key=ASC"Y" PROCset_up_dictionary
  150END
  160 
  170DEFPROCset_up_dictionary
  180LOCAL file
  190file=OPENIN(diction$)
  200IF file<>0 PRINT"File DICTION already exist. Delete file before trying again.":CLOSE#file ELSE PROCdiction_set_up
  210ENDPROC
  220 
  230DEFPROCdiction_set_up
  240LOCAL loop,file,pointer,x
  250PRINT''"Creating Dictionary File"
  260file=OPENOUT(diction$)
  270 
  280REM Generate look up table
  290FOR loop=1 TO 27
  300table(loop)=0
  310NEXT
  320pointer=(3*27)+1
  330FOR loop=1 TO 26
  340table(loop)=pointer
  350READ x$
  360pointer=pointer+LEN(x$)
  370IF x=1 pointer=pointer+1
  380NEXT
  390table(27)=pointer
  400 
  410REM Write look up table to disc
  420FOR loop=1 TO 27
  430BPUT#file,table(loop) MOD 256
  440BPUT#file,(table(loop) DIV 256) MOD 256
  450BPUT#file,(table(loop) DIV 256) DIV 256
  460NEXT
  470BPUT#file,255
  480 
  490REM Write initial words to file
  500RESTORE 690
  510FOR loop=1 TO 26
  520READ x$
  530PROCput_string(x$)
  540NEXT
  550CLOSE#file
  560 
  570ENDPROC
  580 
  590DEFPROCput_string(x$)
  600LOCAL loop
  610FOR loop=1 TO LEN(x$)
  620BPUT#file,ASC(MID$(x$,loop,1))
  630NEXT
  640PTR#file=PTR#file-1
  650BPUT#file,(ASC(MID$(x$,LEN(x$),1)))+128
  660ENDPROC
  670 
  680REM Data for initial dictionary file
  690DATA AND,BE,CAN,DO
  700DATA END,FOR,GO,HAD
  710DATA IN,JOB,KEEP,LET
  720DATA MANY,NOT,OR,PUT
  730DATA QUIT,REAL,STOP,THE
  740DATA UP,VERY,WE,XRAY
  750DATA YES,ZONE

� Watcher Spelling Checker
� (C) Allan Kelly 12/7/87
� Set up dictionary
( 
2� table(27)
<nw$="C.NEWORDS"
Fdiction$="C.DICTION"
P 
Z!�''"Creating Dictionary File"
d�"Are you sure? (Y/N)"
n*FX21,0
x� key=� �&DF
�� key=�"Y" � key=�"N"
�!� key=�"Y" �set_up_dictionary
��
� 
���set_up_dictionary
�
� file
�file=�(diction$)
�f� file<>0 �"File DICTION already exist. Delete file before trying again.":�#file � �diction_set_up
��
� 
���diction_set_up
�� loop,file,pointer,x
�!�''"Creating Dictionary File"
file=�(diction$)
 
� Generate look up table
"� loop=1 � 27
,table(loop)=0
6�
@pointer=(3*27)+1
J� loop=1 � 26
Ttable(loop)=pointer
^� x$
hpointer=pointer+�(x$)
r� x=1 pointer=pointer+1
|�
�table(27)=pointer
� 
�!� Write look up table to disc
�� loop=1 � 27
��#file,table(loop) � 256
�$�#file,(table(loop) � 256) � 256
�$�#file,(table(loop) � 256) � 256
��
��#file,255
� 
�!� Write initial words to file
�
� �trB
�� loop=1 � 26
� x$
�put_string(x$)
�
&
�#file
0 
:�
D 
N��put_string(x$)
X
� loop
b� loop=1 � �(x$)
l�#file,�(�x$,loop,1))
v�
��#file=�#file-1
� �#file,(�(�x$,�(x$),1)))+128
��
� 
�&� Data for initial dictionary file
�� AND,BE,CAN,DO
�� END,FOR,GO,HAD
�� IN,JOB,KEEP,LET
�� MANY,NOT,OR,PUT
�� QUIT,REAL,STOP,THE
�� UP,VERY,WE,XRAY
�� YES,ZONE
�
00000000  0d 00 0a 1e f4 20 57 61  74 63 68 65 72 20 53 70  |..... Watcher Sp|
00000010  65 6c 6c 69 6e 67 20 43  68 65 63 6b 65 72 0d 00  |elling Checker..|
00000020  14 1d f4 20 28 43 29 20  41 6c 6c 61 6e 20 4b 65  |... (C) Allan Ke|
00000030  6c 6c 79 20 31 32 2f 37  2f 38 37 0d 00 1e 17 f4  |lly 12/7/87.....|
00000040  20 53 65 74 20 75 70 20  64 69 63 74 69 6f 6e 61  | Set up dictiona|
00000050  72 79 0d 00 28 05 20 0d  00 32 0f de 20 74 61 62  |ry..(. ..2.. tab|
00000060  6c 65 28 32 37 29 0d 00  3c 13 6e 77 24 3d 22 43  |le(27)..<.nw$="C|
00000070  2e 4e 45 57 4f 52 44 53  22 0d 00 46 18 64 69 63  |.NEWORDS"..F.dic|
00000080  74 69 6f 6e 24 3d 22 43  2e 44 49 43 54 49 4f 4e  |tion$="C.DICTION|
00000090  22 0d 00 50 05 20 0d 00  5a 21 f1 27 27 22 43 72  |"..P. ..Z!.''"Cr|
000000a0  65 61 74 69 6e 67 20 44  69 63 74 69 6f 6e 61 72  |eating Dictionar|
000000b0  79 20 46 69 6c 65 22 0d  00 64 1a f1 22 41 72 65  |y File"..d.."Are|
000000c0  20 79 6f 75 20 73 75 72  65 3f 20 28 59 2f 4e 29  | you sure? (Y/N)|
000000d0  22 0d 00 6e 0b 2a 46 58  32 31 2c 30 0d 00 78 10  |"..n.*FX21,0..x.|
000000e0  f5 20 6b 65 79 3d a5 20  80 26 44 46 0d 00 82 19  |. key=. .&DF....|
000000f0  fd 20 6b 65 79 3d 97 22  59 22 20 84 20 6b 65 79  |. key=."Y" . key|
00000100  3d 97 22 4e 22 0d 00 8c  21 e7 20 6b 65 79 3d 97  |=."N"...!. key=.|
00000110  22 59 22 20 f2 73 65 74  5f 75 70 5f 64 69 63 74  |"Y" .set_up_dict|
00000120  69 6f 6e 61 72 79 0d 00  96 05 e0 0d 00 a0 05 20  |ionary......... |
00000130  0d 00 aa 17 dd f2 73 65  74 5f 75 70 5f 64 69 63  |......set_up_dic|
00000140  74 69 6f 6e 61 72 79 0d  00 b4 0a ea 20 66 69 6c  |tionary..... fil|
00000150  65 0d 00 be 14 66 69 6c  65 3d 8e 28 64 69 63 74  |e....file=.(dict|
00000160  69 6f 6e 24 29 0d 00 c8  66 e7 20 66 69 6c 65 3c  |ion$)...f. file<|
00000170  3e 30 20 f1 22 46 69 6c  65 20 44 49 43 54 49 4f  |>0 ."File DICTIO|
00000180  4e 20 61 6c 72 65 61 64  79 20 65 78 69 73 74 2e  |N already exist.|
00000190  20 44 65 6c 65 74 65 20  66 69 6c 65 20 62 65 66  | Delete file bef|
000001a0  6f 72 65 20 74 72 79 69  6e 67 20 61 67 61 69 6e  |ore trying again|
000001b0  2e 22 3a d9 23 66 69 6c  65 20 8b 20 f2 64 69 63  |.":.#file . .dic|
000001c0  74 69 6f 6e 5f 73 65 74  5f 75 70 0d 00 d2 05 e1  |tion_set_up.....|
000001d0  0d 00 dc 05 20 0d 00 e6  14 dd f2 64 69 63 74 69  |.... ......dicti|
000001e0  6f 6e 5f 73 65 74 5f 75  70 0d 00 f0 19 ea 20 6c  |on_set_up..... l|
000001f0  6f 6f 70 2c 66 69 6c 65  2c 70 6f 69 6e 74 65 72  |oop,file,pointer|
00000200  2c 78 0d 00 fa 21 f1 27  27 22 43 72 65 61 74 69  |,x...!.''"Creati|
00000210  6e 67 20 44 69 63 74 69  6f 6e 61 72 79 20 46 69  |ng Dictionary Fi|
00000220  6c 65 22 0d 01 04 14 66  69 6c 65 3d ae 28 64 69  |le"....file=.(di|
00000230  63 74 69 6f 6e 24 29 0d  01 0e 05 20 0d 01 18 1c  |ction$).... ....|
00000240  f4 20 47 65 6e 65 72 61  74 65 20 6c 6f 6f 6b 20  |. Generate look |
00000250  75 70 20 74 61 62 6c 65  0d 01 22 11 e3 20 6c 6f  |up table..".. lo|
00000260  6f 70 3d 31 20 b8 20 32  37 0d 01 2c 11 74 61 62  |op=1 . 27..,.tab|
00000270  6c 65 28 6c 6f 6f 70 29  3d 30 0d 01 36 05 ed 0d  |le(loop)=0..6...|
00000280  01 40 14 70 6f 69 6e 74  65 72 3d 28 33 2a 32 37  |.@.pointer=(3*27|
00000290  29 2b 31 0d 01 4a 11 e3  20 6c 6f 6f 70 3d 31 20  |)+1..J.. loop=1 |
000002a0  b8 20 32 36 0d 01 54 17  74 61 62 6c 65 28 6c 6f  |. 26..T.table(lo|
000002b0  6f 70 29 3d 70 6f 69 6e  74 65 72 0d 01 5e 08 f3  |op)=pointer..^..|
000002c0  20 78 24 0d 01 68 19 70  6f 69 6e 74 65 72 3d 70  | x$..h.pointer=p|
000002d0  6f 69 6e 74 65 72 2b a9  28 78 24 29 0d 01 72 1b  |ointer+.(x$)..r.|
000002e0  e7 20 78 3d 31 20 70 6f  69 6e 74 65 72 3d 70 6f  |. x=1 pointer=po|
000002f0  69 6e 74 65 72 2b 31 0d  01 7c 05 ed 0d 01 86 15  |inter+1..|......|
00000300  74 61 62 6c 65 28 32 37  29 3d 70 6f 69 6e 74 65  |table(27)=pointe|
00000310  72 0d 01 90 05 20 0d 01  9a 21 f4 20 57 72 69 74  |r.... ...!. Writ|
00000320  65 20 6c 6f 6f 6b 20 75  70 20 74 61 62 6c 65 20  |e look up table |
00000330  74 6f 20 64 69 73 63 0d  01 a4 11 e3 20 6c 6f 6f  |to disc..... loo|
00000340  70 3d 31 20 b8 20 32 37  0d 01 ae 1c d5 23 66 69  |p=1 . 27.....#fi|
00000350  6c 65 2c 74 61 62 6c 65  28 6c 6f 6f 70 29 20 83  |le,table(loop) .|
00000360  20 32 35 36 0d 01 b8 24  d5 23 66 69 6c 65 2c 28  | 256...$.#file,(|
00000370  74 61 62 6c 65 28 6c 6f  6f 70 29 20 81 20 32 35  |table(loop) . 25|
00000380  36 29 20 83 20 32 35 36  0d 01 c2 24 d5 23 66 69  |6) . 256...$.#fi|
00000390  6c 65 2c 28 74 61 62 6c  65 28 6c 6f 6f 70 29 20  |le,(table(loop) |
000003a0  81 20 32 35 36 29 20 81  20 32 35 36 0d 01 cc 05  |. 256) . 256....|
000003b0  ed 0d 01 d6 0e d5 23 66  69 6c 65 2c 32 35 35 0d  |......#file,255.|
000003c0  01 e0 05 20 0d 01 ea 21  f4 20 57 72 69 74 65 20  |... ...!. Write |
000003d0  69 6e 69 74 69 61 6c 20  77 6f 72 64 73 20 74 6f  |initial words to|
000003e0  20 66 69 6c 65 0d 01 f4  0a f7 20 8d 74 72 42 0d  | file..... .trB.|
000003f0  01 fe 11 e3 20 6c 6f 6f  70 3d 31 20 b8 20 32 36  |.... loop=1 . 26|
00000400  0d 02 08 08 f3 20 78 24  0d 02 12 13 f2 70 75 74  |..... x$.....put|
00000410  5f 73 74 72 69 6e 67 28  78 24 29 0d 02 1c 05 ed  |_string(x$).....|
00000420  0d 02 26 0a d9 23 66 69  6c 65 0d 02 30 05 20 0d  |..&..#file..0. .|
00000430  02 3a 05 e1 0d 02 44 05  20 0d 02 4e 14 dd f2 70  |.:....D. ..N...p|
00000440  75 74 5f 73 74 72 69 6e  67 28 78 24 29 0d 02 58  |ut_string(x$)..X|
00000450  0a ea 20 6c 6f 6f 70 0d  02 62 14 e3 20 6c 6f 6f  |.. loop..b.. loo|
00000460  70 3d 31 20 b8 20 a9 28  78 24 29 0d 02 6c 19 d5  |p=1 . .(x$)..l..|
00000470  23 66 69 6c 65 2c 97 28  c1 78 24 2c 6c 6f 6f 70  |#file,.(.x$,loop|
00000480  2c 31 29 29 0d 02 76 05  ed 0d 02 80 13 cf 23 66  |,1))..v.......#f|
00000490  69 6c 65 3d 8f 23 66 69  6c 65 2d 31 0d 02 8a 20  |ile=.#file-1... |
000004a0  d5 23 66 69 6c 65 2c 28  97 28 c1 78 24 2c a9 28  |.#file,(.(.x$,.(|
000004b0  78 24 29 2c 31 29 29 29  2b 31 32 38 0d 02 94 05  |x$),1)))+128....|
000004c0  e1 0d 02 9e 05 20 0d 02  a8 26 f4 20 44 61 74 61  |..... ...&. Data|
000004d0  20 66 6f 72 20 69 6e 69  74 69 61 6c 20 64 69 63  | for initial dic|
000004e0  74 69 6f 6e 61 72 79 20  66 69 6c 65 0d 02 b2 13  |tionary file....|
000004f0  dc 20 41 4e 44 2c 42 45  2c 43 41 4e 2c 44 4f 0d  |. AND,BE,CAN,DO.|
00000500  02 bc 14 dc 20 45 4e 44  2c 46 4f 52 2c 47 4f 2c  |.... END,FOR,GO,|
00000510  48 41 44 0d 02 c6 15 dc  20 49 4e 2c 4a 4f 42 2c  |HAD..... IN,JOB,|
00000520  4b 45 45 50 2c 4c 45 54  0d 02 d0 15 dc 20 4d 41  |KEEP,LET..... MA|
00000530  4e 59 2c 4e 4f 54 2c 4f  52 2c 50 55 54 0d 02 da  |NY,NOT,OR,PUT...|
00000540  18 dc 20 51 55 49 54 2c  52 45 41 4c 2c 53 54 4f  |.. QUIT,REAL,STO|
00000550  50 2c 54 48 45 0d 02 e4  15 dc 20 55 50 2c 56 45  |P,THE..... UP,VE|
00000560  52 59 2c 57 45 2c 58 52  41 59 0d 02 ee 0e dc 20  |RY,WE,XRAY..... |
00000570  59 45 53 2c 5a 4f 4e 45  0d ff                    |YES,ZONE..|
0000057a
Speller/C/SETUP.m0
Speller/C/SETUP.m1
Speller/C/SETUP.m2
Speller/C/SETUP.m4
Speller/C/SETUP.m5