Morseova abeceda (Morse Code Sender and Decoder)
- Type
- Education
- Category
- Morse code: keyboard sender, joystick key and decoder
- Author
- Janusz J. and Ing. J. Kielar (adapted in Frýdek-Místek)
- Published in
- Flop (Czech disk magazine for 8-bit Atari), issue 7
- Year
- 1988
- Language
- Atari BASIC
- Requirements
- Any 8-bit Atari with Atari BASIC; joystick in port 1 for the Morse key mode
About the program
Morseová abeceda ("Morse alphabet") is a practical tool from the radio-amateur side of the 8-bit scene. The REMs credit Janusz J. and Ing. J. Kielar, Warsaw 1986–87, and an adaptation in Frýdek-Místek in 1988. Its menu is in Czech, but two REMs are still in Polish. It works both ways: type on the keyboard and the Atari sends your text in Morse through the TV speaker, or use the joystick as a Morse key and the program decodes what you send. It's a different program from the shorter Czech Morse keyer and trainer that also appeared on Flop.
Czech and Polish text in the program
| Original | English |
|---|---|
| Stiskni libovolnou klávesu | Press any key |
| A – použití klávesnice | A – use the keyboard |
| B – použití klíče | B – use the (Morse) key |
| KÓDY: D – SP5IVJ, E – QRZ, F – QRA, G – QRT, H – QRX, I – QTH | Codes: canned messages to send |
| CO CHCEŠ NA OBRAZOVCE? A – abecedu, B – Morseovku, * – návrat do menu | What do you want on screen? A – the letters, B – the Morse, * – back to the menu |
| ČAS DEKÓDOVÁNÍ? (10–60) | Decoding time? (10–60) |
| CHYBÍ DATA · CHYBÍ DEFINICE ZNAKU | Missing data · character not defined |
| WYKORZYSTANIE KLAWIATURY (Polish REM) | Using the keyboard |
Typing it in
The listing is plain ASCII. The Morse table is in DATA from line 20000 as letter/code pairs (A,.-,B,-...), in an order that groups letters by length rather than alphabetically, ending with a $ marker. Digits have their own five-element array B(). The canned messages in lines 4000–9000 are strings ending in *.
Line 180 jumps to 1000*MA, where MA is the menu letter's position in the alphabet (A = 1, B = 2 …). There's no line 3000, so pressing C, which isn't offered on the menu, stops the program with ERROR 12.
How to use it
- A – keyboard. First choose whether to show the letters you type (A) or the dots and dashes (B). Then type: each character is looked up in the DATA and keyed out, with a short tone for a dot and a long one for a dash.
*returns to the menu. - B – Morse key. Push the joystick left for a dot and right for a dash. Choose B ("Morseovku") to see your dots and dashes as you send, or A to have them decoded. You'll be asked for a decoding time from 10 to 60, which sets how long a pause ends a letter. A higher number means a shorter pause (the wait is 120/n passes of the loop), so faster operators should use larger values.
- D–I – codes. Sends a ready-made call: the callsign SP5IVJ (a Polish amateur station) or one of the standard Q-codes QRZ ("who is calling me?"), QRA (station name), QRT (stop sending), QRX (wait) and QTH (location).
How it works
Each lookup is a plain RESTORE and READ loop through the DATA pairs until the letter matches. The code string is then played element by element with SOUND 0,20,14,15 held for 8 loop passes (dot) or 30 (dash). The decoder builds up a string of dots and dashes from the joystick and, when the pause timer runs out, searches the same table for that code rather than for a letter. Five-element codes are matched against the digit array B(), which also holds = and /.
Listing
5 REM **MORSEOVKA**
6 REM (C) Janusz J. + ING J.KIELAR
7 REM Warszawa 1986,7;F-Mistek 1988
10 OPEN #1,4,0,"K:"
12 ? "{CLEAR}":POKE 752,1
14 GRAPHICS 2
16 POSITION 2,1:? #6;"-.-.-.-.-.-.-.-."
18 POSITION 2,3:? #6;"morseova abeceda"
20 POSITION 2,5:? #6;"(C) 1986-8 "
22 POSITION 2,7:? #6;"-.-.-.-.-.-.-.-."
25 DIM B(12,9),SP$(7),L$(10)
26 DIM WL$(1),DL$(1),A$(6)
28 DIM KL$(6),AL$(1),K$(6)
29 L$="0123456789"
30 FOR E=0 TO 4
35 FOR F=0 TO 4
40 EF=E+F:FE=INT(0.3*F*E)
45 B(F,EF)=45
50 B(F+6,EF+1)=46
55 B(F+6,FE)=45
60 B(F+1,FE)=46
65 NEXT F:NEXT E
66 B(10,0)=45:B(10,1)=46:B(10,2)=46:B(10,3)=46:B(10,4)=45
67 B(11,0)=45:B(11,1)=46:B(11,2)=46:B(11,3)=45:B(11,4)=46
70 ?:? " Stiskni libovolnou klavesu"
75 GET #1,P
80 GRAPHICS 0+16
82 POKE 752,1
84 POKE 764,147
100 ? "{CLEAR}"
110 POSITION 16,5:? "{inv} MENU {/inv}"
120 POSITION 7,7:? "A - pouziti klavesnice"
130 POSITION 7,8:? "B - pouziti klice"
135 POSITION 15,11:? "{inv} KODY: {/inv}"
136 POSITION 14,13:? "D - SP5IVJ"
137 POSITION 14,14:? "E - QRZ"
138 POSITION 14,15:? "F - QRA"
139 POSITION 14,16:? "G - QRT"
140 POSITION 14,17:? "H - QRX"
141 POSITION 14,18:? "I - QTH"
160 GET #1,AM
165 IF AM<65 OR AM>73 THEN 160
170 MA=AM-64
180 GOTO 1000*MA
1000 REM WYKORZYSTANIE KLAWIATURY
1010 GOSUB 1500
1020 ? "{CLEAR}"
1025 IF AK=42 THEN 100
1030 GET #1,X
1032 IF X=42 THEN 1010
1033 IF AK=65 THEN ? CHR$(X);
1035 IF X>46 AND X<58 OR X=61 THEN 1400
1040 WL$=CHR$(X)
1050 RESTORE
1060 READ DL$,A$
1065 L=LEN(A$)
1070 IF DL$="$" THEN ? "CHYBI DATA ";:GOTO 1030
1080 IF DL$=WL$ THEN 1200
1090 GOTO 1060
1200 FOR D=1 TO L
1210 IF AK=65 THEN 1230
1220 ? A$(D,D);
1230 IF A$(D,D)="-" THEN GOSUB 1300:GOTO 1245
1240 FOR F=1 TO 8:SOUND 0,20,14,15:NEXT F
1242 FOR F=1 TO 10:NEXT F
1245 SOUND 0,0,0,0
1250 NEXT D
1255 ? " ";
1260 GOTO 1030
1300 FOR F=1 TO 30
1310 SOUND 0,20,14,15
1320 NEXT F
1330 RETURN
1400 Z=X-48
1402 IF Z=13 THEN Z=10
1404 IF Z=-1 THEN Z=11
1410 FOR FF=0 TO 4
1415 IF AK=65 THEN 1425
1420 ? CHR$(B(Z,FF));
1425 IF B(Z,FF)=45 THEN GOSUB 1300:GOTO 1432
1430 FOR U=1 TO 8:SOUND 0,20,14,15:NEXT U
1431 FOR U=1 TO 10:NEXT U
1432 SOUND 0,0,0,0
1435 NEXT FF
1440 ? " ";
1450 GOTO 1030
1500 ? "{CLEAR}"
1510 POSITION 7,5:? "{inv} CO CHCES NA OBRAZOVCE? {/inv}"
1520 POSITION 10,7:? "A - abecedu"
1530 POSITION 10,8:? "B - Morseovku"
1540 POSITION 10,10:? "* - navrat do menu"
1550 GET #1,AK
1560 RETURN
2000 REM pouziti klice
2004 POKE 764,255
2005 GOSUB 1500
2007 IF AK=65 THEN 2100
2008 IF AK=42 THEN 100
2010 ? "{CLEAR}"
2015 ST=STICK(0)
2020 IF ST=11 THEN ? ".";:FOR F=1 TO 8:SOUND 0,20,14,15:NEXT F
2030 IF ST=7 THEN ? "-";:FOR F=1 TO 30:SOUND 0,20,14,15:NEXT F
2040 SOUND 0,0,0,0
2050 IF PEEK(764)=7 THEN 2004
2060 GOTO 2015
2100 POSITION 10,14:? "CAS DEKODOVANI ? "
2101 POSITION 17,15:? "(10 - 60)"
2102 POSITION 27,14:? ;:INPUT Z
2103 CZ=INT(120/Z)
2105 ? "{CLEAR}"
2110 DK=1
2115 KL$=""
2120 FOR R=1 TO CZ
2121 SOUND 0,0,0,0
2123 ST=STICK(0)
2125 IF ST=11 THEN 2210
2130 IF ST=7 THEN 2230
2133 L=LEN(KL$)
2134 IF L=6 THEN 2175
2135 IF PEEK(764)=7 THEN 2004
2136 IF L=5 THEN 2300
2140 NEXT R
2170 IF L=0 THEN 2120
2175 RESTORE
2180 READ AL$,K$
2185 IF AL$="$" THEN 2400
2190 IF K$=KL$ THEN ? AL$;:GOTO 2110
2195 GOTO 2180
2210 IF DK>6 THEN 2400
2212 KL$(DK,DK)="."
2215 FOR F=1 TO 8:SOUND 0,20,14,15:NEXT F
2220 DK=DK+1
2225 GOTO 2120
2230 IF DK>6 THEN 2400
2232 KL$(DK,DK)="-"
2235 FOR F=1 TO 30:SOUND 0,20,14,15:NEXT F
2240 DK=DK+1
2245 GOTO 2120
2300 FOR G=0 TO 11
2310 FOR E=0 TO 4
2315 N=E+1
2317 IF G=11 AND ASC(KL$(N,N))<>B(11,E) THEN 2400
2320 IF ASC(KL$(N,N))<>B(G,E) THEN 2330
2323 IF E=4 AND ASC(KL$(5,5))=B(G,4) THEN 2333
2325 NEXT E
2330 NEXT G
2333 IF G=10 THEN ? "=";:GOTO 2110
2335 IF G=11 THEN ? "/";:GOTO 2110
2350 ? G;
2360 GOTO 2110
2400 ? "CHYBI DEFINICE ZNAKU";
2410 GOTO 2110
4000 SP$="SP5IVJ*"
4005 LS=LEN(SP$)
4010 GOSUB 4500
4020 GOTO 160
4500 N=0
4510 N=N+1
4515 IF LS>4 AND N=3 THEN 4800
4520 RESTORE
4530 READ DL$,A$
4540 IF A$="*" THEN RETURN
4550 IF DL$=SP$(N,N) THEN 4570
4560 GOTO 4530
4570 L=LEN(A$)
4580 FOR F=1 TO L
4590 IF A$(F,F)="." THEN GOSUB 4930:GOTO 4690
4610 GOSUB 4900
4690 NEXT F
4700 FOR E=1 TO 12
4710 NEXT E
4720 GOTO 4510
4800 FOR M=1 TO 10
4810 IF L$(M,M)=SP$(N,N) THEN 4820
4815 NEXT M
4820 MM=M-1
4830 FOR F=0 TO 4
4840 IF B(MM,F)=46 THEN GOSUB 4930:GOTO 4860
4850 GOSUB 4900
4860 NEXT F
4890 GOTO 4510
4900 FOR E=1 TO 19
4910 SOUND 0,20,14,15
4920 NEXT E
4930 FOR E=1 TO 5
4940 SOUND 0,20,14,15
4950 NEXT E
4960 SOUND 0,0,0,0
4970 FOR E=1 TO 5
4975 NEXT E
4980 RETURN
5000 SP$="QRZ*"
5010 GOSUB 4500
5020 GOTO 160
6000 SP$="QRA*"
6010 GOSUB 4500
6020 GOTO 160
7000 SP$="QRT*"
7010 GOSUB 4500
7020 GOTO 160
8000 SP$="QRX*"
8010 GOSUB 4500
8020 GOTO 160
9000 SP$="QTH*"
9010 GOSUB 4500
9020 GOTO 160
20000 DATA A,.-,B,-...,S,...,T,-,G,--.
20010 DATA J,.---,N,-.,O,---,K,-.-,Y,-.--
20020 DATA M,--,F,..-.,Z,--..,I,..,X,-..-
20030 DATA D,-..,R,.-.,H,....,E,.,W,.--
20040 DATA L,.-..,Q,--.-,P,.--.,V,...-,C,-.-.
20050 DATA U,..-,?,..--..,!,--..--
20060 DATA $,*
Credits
- Program listing: Morseova abeceda (Morse Code Sender and Decoder) — program listing (Flop (Czech disk magazine for 8-bit Atari), issue 7) — Janusz J. and Ing. J. Kielar (adapted in Frýdek-Místek)
- Picture: The title screen. Press any key for the menu. — Janusz J. and Ing. J. Kielar (adapted in Frýdek-Místek) (program); screenshot by the site
- Gury's Atari 8-bit Forever — Morseova abeceda (listing) — Janusz J. and Ing. J. Kielar (adapted in Frýdek-Místek)
- Flop disk magazine directory (linked from the Gury entry) — Magazín FLOP
