Swiss Micros DM41X: Working With Alpha Strings
This first blog in the October series for the DM41X will cover basic tips and tricks for working with alpha strings.
Considerations
Alpha characters are marked in blue on the Swiss Micros DM41X and the HP 41C series. Alpha characters and the shift characters are shown on the back of the calculator.
The alpha string can hold up to 24 characters total. All letters are upper case, with the only lower case letters available are a, b, c, d, and e.
Let's start with clearing the alpha register. Usually, when a new alpha string is started, it will replace the contents of the alpha register. However, ARCL and |- add to the string. A sure way to make sure that the alpha register is cleared by executing the Clear Alpha (CLA) command.
You can attach the contents of a register, including stack register characters, to the end of the alpha register by using the ARCL command.
ALENG returns the length of the alpha string.
You can store strings by using ASTO. But please be aware, each register can only hold up to six characters. Example: an attempt to store EDWARDS to R00 will only store EDWARD.
Swiss Micros DM41X Program 1: ALP1
Notes:
To attach strings together, use the append symbol (|-) as the first symbol of the string. Press [ alpha ], [ shift ], [ XEQ ] for the append symbol.
33 XTOA adds an exclamation point (shown as a small 1 or a small exclamation point). XTOA is present for the HP 41CX, HP 41C with the Extended Module, or the Swiss Micros DM41X. XTOA appends characters to the end of the string. Some XTOA characters include:
12 ยต
33 !
34 "
36 $
37 % (also [ alpha ], [ shift ], G)
63 ? (also [ alpha ], [ 3 ])
Program:
Goal: Build "HELLO WORLD, I AM THE 41!" from two strings and 33 XTOA. If you have an HP 41C without the extended functions, the 33 XTOA must be ignored.
01 LBL^T ALP1
02 CLA
03 ^T HELLO WORLD,
04 ^T |- I AM THE 41
05 33
06 XTOA
07 AVIEW
08 END
Swiss Micros DM41X Program 2: ALP2
Goal:
Store 41 in R00.
"HELLO WORLD, I AM THE "
Alpha recall R00.
01 LBL^T ALP2
02 FIX 0
03 41
04 STO 00
05 ^T HELLO WORLD,
06 ^T |- I AM THE
07 ARCL 00
08 AVIEW
09 FIX 4
10 END
Swiss Micros DM41X Program 3: ALP3
Goal:
Ask for two numbers and store them in R01 and R02, respectively.
Multiply them and store the result in R03.
Build the string "{R01} * {R02} = {R03}"
01 LBL^T APL3
02 FIX 0
03 CLA
04 CLX
05 ^T R01?
06 PROMPT
07 STO 01
08 CLA
09 ^T R02?
10 PROMPT
11 STO 02
12 RCL 01
13 *
14 STO 03
15 CLA
16 ARCL 01
17 ^T |- *
8 ARCL 02
19 ^T |- =
20 ARCL 03
21 AVIEW
22 FIX 4
23 RTN
24 END
Example: R01 = 11, R02 = 24
Result: "11*24=264"
Swiss Micros DM41X Program 4: ALP4
Ask what is user's name. Then store the name in:
"HELLO, {NAME} ."
Remember, ASTO stores only the left four characters.
01 LBL^T ALP4
02 CLA
03 ^T NAME?
04 PROMPT
05 AON
06 ASTO 00
07 CLA
08 ^T HELLO,
09 ARCL 00
10 ^T |- .
11 AVIEW
12 END
Example: LAUREN (it's already in Alpha mode because of the AON command)
HELLO, LAUREN.
Hope you find this helpful,
Eddie
All original content copyright, © 2011-2021. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.