Morse Code for the HP-41
Overview
-Clifford Stern has written a superb Morse Code program which is listed
in "Synthetic Programming made easy" by Keith Jarett.
-The following "MC" is far from being so good but it uses the ATOX
function of the X-Functions module,
it can transmit more characters and it occupies less program
memory.
-"MC" uses the synthetic TONE P ( decimal codes = 159 , 120 )
for . and the standard TONE 8 for _
-For instance, L = TONE P TONE 8 TONE P TONE
P = . _ . .
-Then, a second routine ( "LMC" ) may help you to learn Morse code.
Warning:
-If the last executed tone is a synthetic tone ( TONE P or another
one ),
my HP-41 emits a strange frrrrrrrr ( press your ear against
your calculator to check )
-Simply execute a BEEP or any non-synthetic TONE to remove this vibration
1°) Morse Code Program
Codes: ( in the same order as the LBLs )
L = . _ . .
? = . . _ _ . . 8 = _ _ _ . . Z = _ _ . . D = _ . . ; = _ . _ . _ . + = . _ . _ . @ = . _ _ . _ . C = _ . _ . " = . _ . . _ . |
/ = _ . . _ .
F = . . _ . R = . _ . ( = _ . _ _ . P = . _ _ . ! = . . . _ . ' = . _ _ _ _ . 9 = _ _ _ _ . G = _ _ . N = _ . |
: = _ _ _ . . .
7 = _ _ . . . B = _ . . . 6 = _ . . . . & = . _ . . . 5 = . . . . . H = . . . . S = . . . I = . . E = . |
. = . _ . _ . _
_ = . . _ _ . _ ) = _ . _ _ . _ Q = _ _ . _ K = _ . _ = = _ . . . _ $ = . . . _ . . _ X = * = _ . . _ % = _ . _ . _ - = _ . . . . _ |
4 = . . . . _
V = . . . _ U = . . _ A = . _ , = _ _ . . _ _ 3 = . . . _ _ 2 = . . _ _ _ J = . _ _ _ Y = _ . _ _ W = . _ _ |
1 = . _ _ _ _
0 = _ _ _ _ _ O = _ _ _ M = _ _ T = _ space = a pause |
Data Registers: /
Flags: /
Subroutines: /
01 LBL "MC"
02 LBL 00 03 64 04 ATOX 05 X=0? 06 GTO 32 07 X>Y? 08 - 09 XEQ IND X 10 GTO 00 11 LBL 12 12 TONE P 13 GTO 04 14 LBL 63 15 XEQ 21 16 GTO 04 17 LBL 56 18 TONE 8 19 LBL 26 20 TONE 8 21 LBL 04 22 TONE 8 23 GTO 09 24 LBL 59 25 TONE 8 |
26 LBL 43
27 XEQ 18 28 GTO 14 29 LBL 64 30 XEQ 01 31 LBL 03 32 TONE 8 33 GTO 18 34 LBL 34 35 TONE P 36 LBL 47 37 TONE 8 38 LBL 06 39 TONE P 40 LBL 18 41 TONE P 42 GTO 14 43 LBL 40 44 TONE 8 45 LBL 16 46 TONE P 47 GTO 07 48 LBL 33 49 XEQ 19 50 GTO 14 |
51 LBL 39
52 TONE P 53 LBL 57 54 XEQ 13 55 LBL 07 56 TONE 8 57 LBL 14 58 TONE 8 59 GTO 05 60 LBL 58 61 TONE 8 62 LBL 55 63 TONE 8 64 LBL 02 65 TONE 8 66 GTO 19 67 LBL 54 68 TONE 8 69 GTO 08 70 LBL 38 71 XEQ 18 72 GTO 09 73 LBL 53 74 TONE P 75 LBL 08 |
76 TONE P
77 LBL 19 78 TONE P 79 LBL 09 80 TONE P 81 LBL 05 82 TONE P 83 RTN 84 LBL 46 85 XEQ 18 86 GTO 11 87 LBL 31 88 XEQ 21 89 GTO 11 90 LBL 41 91 XEQ 14 92 LBL 17 93 TONE 8 94 LBL 11 95 TONE 8 96 GTO 01 97 LBL 61 98 TONE 8 99 GTO 22 100 LBL 36 |
101 XEQ 19
102 LBL 24 103 LBL 42 104 TONE 8 105 GTO 21 106 LBL 37 107 XEQ 11 108 GTO 01 109 LBL 45 110 TONE 8 111 LBL 52 112 TONE P 113 LBL 22 114 TONE P 115 LBL 21 116 TONE P 117 LBL 01 118 TONE P 119 GTO 20 120 LBL 44 121 XEQ 26 122 GTO 13 123 LBL 51 124 XEQ 19 125 GTO 13 |
126 LBL 50
127 TONE P 128 LBL 10 129 TONE P 130 GTO 15 131 LBL 25 132 TONE 8 133 LBL 23 134 TONE P 135 GTO 13 136 LBL 49 137 TONE P 138 GTO 02 139 LBL 48 140 TONE 8 141 LBL 02 142 TONE 8 143 LBL 15 144 TONE 8 145 LBL 13 146 TONE 8 147 LBL 20 148 TONE 8 149 LBL 32 150 END |
( 305 bytes / SIZE 000 )
-Store an alpha string of at most 24 characters in the alpha register
and execute "MC"
-Do not use lower case letters.
-Use XTOA to store special characters in alpha ( for instance,
64 XTOA adds @ to the alpha string )
Example: Place "HEWLETT PACKARD" in the alpha register , XEQ "MC" and you'll hear:
dih dih dih dit dit
dih daah daah dih daah dih dit dit
daah daah
dih daah daah dit dih daah
daah dih daah dit daah dih daah dih
daah dih daah dit daah dih dit
Notes:
-The XEQ IND X ( line 09 ) is much faster if the program is executed
from an HEPAX module.
-You can also transmit a message by groups of at most 6 characters,
after storing them into contiguous registers Rbb thru Ree (
bb > 00 )
LBL "MESSAGE"
STO 00 CLA LBL 00 ARCL IND 00 XEQ "MC" ISG 00 GTO 00 END |
-Place the control number bbb.eee in X-register
and execute "MESSAGE"
2°) Learning Morse Code
-This short routine transmits a random message of 1 to 24 characters
among 1 2 .... 9 A B C ....... Y Z
-You have to decipher the message.
Data Registers:
• R00 = seed
( initialize R00 before executing LMC )
R01 thru R04 = the characters
Flag: F26
Subroutine: "MC"
01 LBL "LMC"
02 CF 26 03 CLA 04 57 05 LBL 01 06 RCL 00 07 R-D 08 FRC |
09 STO 00
10 36 11 * 12 INT 13 48 14 + 15 X<=Y? 16 GTO 01 |
17 7
18 + 19 LBL 01 20 XTOA 21 RDN 22 DSE Y 23 GTO 01 24 ASTO 01 |
25 ASHF
26 ASTO 02 27 ASHF 28 ASTO 03 29 ASHF 30 ASTO 04 31 LBL 10 32 CLA |
33 ARCL 01
34 ARCL 02 35 ARCL 03 36 ARCL 04 37 SF 26 38 XEQ "MC" 39 END |
( 67 bytes / SIZE 005 )
-Place a seed in R00 and the number of characters ( between 1 &
24 ) in X-register and XEQ "LMC"
-Press XEQ 10 to repeat the message.
Example: 1 STO 00 4 XEQ "LMC" >>>> dih daah daah dih daah daah daah daah daah daah dit daah dih daah
-The message is AY9K ( here in R01 )
Reference:
[1] Keith Jarett - "HP-41 Synthetic Programming Made Easy" - Synthetix