Showing posts with label Free42. Show all posts
Showing posts with label Free42. Show all posts

Saturday, October 10, 2026

HP 42S/DM42/Free 42: Two Functions Programmed Three Different Ways

HP 42S/DM42/Free 42: Two Functions Programmed Three Different Ways



Introduction



In 1979, Electro Scientific Industries (esi) released the (rare) ESI Calcumeter 4100 which is a combination multimeter and RPN calculator. I’m going to focus on the calculator part.


The calculator is a standard RPN calculator with the following functions: x^2, √, 1/x, 10^x, e^x, LN, log, and y^x. Also present are the standard ↓ROLL (roll down) and x<>y (swap) functions. Then we have other unique function such as:


mx+b: Applies a linear regression model to a measurement, with m stored in memory and b is grabbed from the y-registered


dBV: Decibel measurement (volt): 20 * log(measurement ÷ memory) (measurement is probably in the X register)


%DEV: percent change of a measurement from the value stored in memory:

100 * (measurement – memory) ÷ memory


AVG: average of cumulative amount of measurements against the value stored in memory


xy/(x+y): calculates x * y ÷ (x + y)


xy/(x – y): calculates x * y ÷ (x – y)


Getting this multimeter combo was not inexpensive, it had a retail price of $399 in 1979.


Today’s blog will focus on two of these functions, particularly xy/(x+y) and xy/(x-y).



The Functions xy/(x+y) and xy/(x-y)


As I could gather from the calculator’s keyboard:


xy/(x+y): Multiply Over Plus*

MOP(x,y) = (x * y) ÷ (x + y) = 1/(1/y + 1/x)


xy/(x-y): Multiply Over Subtract*

MOP(x,y) = (x * y) ÷ (x - y) = 1/(1/y – 1/x)


* These are my names for these functions. I don’t have the manual. Here I am assuming that the stack is in the traditional order: X is the display, Y is the stack just above X, and the RPN works like any (HP) RPN calculator.


All programs are made using the Free42 app (42S/41C family).


Stage 1: The Long Way


This starts out by duplicating x and y first until we have the stack as follows: Y, X, Y, X.



00 { 19-Byte Prgm }

01▸LBL "MOP"

02 ENTER

03 ENTER

04 CLX

05 -

06 R↓

07 X<>Y

08 +

09 R↓

10 ×

11 R↑

12 ÷

13 RTN

14 END


00 { 19-Byte Prgm }

01▸LBL "MOS"

02 ENTER

03 ENTER

04 CLX

05 -

06 R↓

07 X<>Y

08 -

09 R↓

10 ×

11 R↑

12 ÷

13 RTN

14 END



Stage 2: What if we assume x and y are nonzero?


Let n = (x * y) ÷ (x ± y)

Then:

1/n = (x ± y) ÷ (x * y)

1/n = x ÷ (x * y) ± y ÷ (x * y)

1/n = 1/y ± 1/x

n = 1/(1/y ± 1/x)



00 { 14-Byte Prgm }

01▸LBL "MOAR"

02 1/X

03 X<>Y

04 1/X

05 +

06 1/X

07 RTN

08 END


00 { 15-Byte Prgm }

01▸LBL "MOSR"

02 X<>Y

03 1/X

04 X<>Y

05 1/X

06 -

07 1/X

08 RTN

09 .END.


Shorter.


Stage 3: Using Stack Storage Operations (41C/42S only)


The HP 41C and 42S families allow us to use stack levels (X, Y, Z, T, and L) as storage registers. Let's see if we can take advantage of this.



00 { 17-Byte Prgm }

01▸LBL "MOP42"

02 STO ST Z

03 X<>Y

04 STO× ST Z

05 +

06 ÷

07 RTN

08 END


00 { 17-Byte Prgm }

01▸LBL "MOS42"

02 STO ST Z

03 X<>Y

04 STO× ST Z

05 -

06 ÷

07 RTN

08 END


Sources


Electro Scientific Industries, Inc. “Calcumeter 4100” Ad/Pamphlet Micrometrics, Inc. Portland, OR. 1979


Sanden, Kees van der. “The ESI Calcumeter 4100” https://www.keesvandersanden.nl/calculators/esi4100.php Retrieved June 19, 2026.





I hope you enjoyed our deep dive. See you next time,


Eddie


All original content copyright, © 2011-2026. 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.

Saturday, December 13, 2025

RPN: HP 42S, DM42, Free 42 Tones, Column Vectors, and Songs

RPN: HP 42S, DM42, Free 42 Tones, Column Vectors, and Songs



Making Music of 10 Tones


The HP 42S, and subsequently, the Free42 app, the Plus42 app, and the Swiss Micros DM42, along with the HP 41C and DM41X. Let’s focus on the HP 42S version.


Tone is followed by:


* a single-digit integer (0-9)

* a tone number called indirectly through a stack level (X, Y, Z, T) or a memory register


I asked on the MoHPC (Museum of HP Calculators) forum what scale that the 42S used for the tones. According to Thomas Okken, who programmed the Free42 app, the tones come from the A major scale, with the note A3 called from TONE 1. TONE 0 played the E3 note. Thank you, Thomas!


https://www.hpmuseum.org/forum/thread-23678-post-205315.html#pid205315


The program CTONE plays a collection of tones that is stored in a single-column matrix named MCOL. An example of a collection of tones


[ [ 1 ]

[ 3 ]

[ 5 ]

[ 1 ]

[ 3 ]

[ 5 ]

[ 7 ]

[ 7 ]

[ 7 ]

[ 7 ]

[ 1 ]

[ 3 ]

[ 5 ]

[ 1 ]

[ 3 ]

[ 5 ]

[ 7 ]

[ 8 ]

[ 9 ]

[ 7 ] ]


CTONE: plays tones of the column vector MCOL


00 { 44-Byte Prgm }

01▸LBL "CTONE"

02 INDEX "MCOL"

03 WRAP

04 RCL "MCOL"

05 DIM?

06 X<>Y

07 3

08 10↑X

09 ÷

10 +

11 STO 00

12▸LBL 00

13 RCLEL

14 TONE IND ST X

15 I+

16 ISG 00

17 GTO 00

18 RTN

19 .END.


The following program, CRVCT, creates a matrix with one column named MCOL.


CRVCT: create a vector MCOL


00 { 79-Byte Prgm }

01▸LBL "CRVCT"

02 "SIZE?"

03 PROMPT

04 STO 01

05 1

06 DIM "MCOL"

07 X<>Y

08 3

09 10↑X

10 ÷

11 +

12 STO 00

13 INDEX "MCOL"

14 WRAP

15 ALL

16▸LBL 00

17 "ROW "

18 RCL 00

19 IP

20 ARCL ST X

21 ├"?"

22 PROMPT

23 STOEL

24 ISG 00

25 GTO 01

26 GTO 02

27▸LBL 01

28 I+

29 GTO 00

30▸LBL 02

31 RCL "MCOL"

32 FIX 04

33 RTN

34 .END.


Source


“HP 42S TONE” Museum of HP Calculators. https://www.hpmuseum.org/forum/thread-23678-post-205315.html#pid205315 Retried June 9, 2025.


Have fun,


Eddie


All original content copyright, © 2011-2025. 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.

The author does not use AI engines and never will.

Saturday, October 11, 2025

RPN Calculators: INPUT vs PROMPT

RPN Calculators: INPUT vs PROMPT


Later RPN keystroke programming calculators are able to display alphabetic messages and store to variables for alphabetic names.


HP 32S, HP 32SII, HP 33S, HP 35S, DM32

HP 41C (all variants), DM41X

HP 42S, DM42, DM42n, Free 42

Single letter variable names

Numeric-named variables only

Both numeric-named variables and alphabetic (and alphanumeric) variable names. Alphabetic and alphanumeric named variables are enclosed in quotes (alpha strings) well stored and recalled and take additional memory.

Can display messages by setting Flag 10 and using the equation feature to type messages

Can display messages and prompts

Can display messages and prompts


Two common ways to cue the user to enter values are the INPUT and PROMPT commands.


The INPUT Command: HP 32 and HP 42S (and Swiss Micros/emulator equivalents)


Note: The INPUT command is not available in the HP 41C’s command set.


General syntax: INPUT var


When an INPUT command is encountered, the screen will display [var]?= on the X stack.


Example:

INPUT R displays R? [previous value stored in R]


HP 32 Family: The variable is a single-letter name or the indirect variable i.

HP 42S Family: A custom alpha variable, a numeric-named variable (i.e. 00, 01, 02, etc.), indirect variables, or the stack levels X, Y, T, Z, or L (last argument).


The INPUT has the double benefit of storing whatever is entered into the variable asked for. INPUT will also show the previously stored value, so we can just accept it by pressing R/S to keep the old value.


Example: Volume of a Cone


HP 32 family

HP 42S family

V01 LBL V

V02 INPUT R

V03 INPUT H

V04 π

V05 RCL R

V06 x^2

V07 ×

V08 RCL H

V09 ×

V10 3

V11 ÷

V12 RTN


No quotes are needed for alphabetic variables.



00 {30-Byte Prgm }

01 LBL “VCONE1”

02 INPUT “R”

03 INPUT “H”

04 PI

05 RCL “R”

06 x↑2

07 ×

08 RCL “H”

09 ×

10 3

11 ÷

12 RTN


We could use variables 00 and 01 (for example) for radius and height, respectively, except the input command prompt will show “R00?” or “R01?” which may not be user-friendly.


The INPUT does not replace the contents of the alpha register.


If we want the alphanumeric/alphanumeric variables (“R”, “H”) to be erased, we could have inserted CLV “R” and CLV “H” at the end, but that will erase the value associated with them.



The PROMPT Command: HP 41C and HP 42S (and Swiss Micros/emulator equivalents)


Note: The PROMPT command is not available on the HP 32S family.


General Syntax:

“alpha string”

PROMPT

STO var


The alpha string is displayed until something, usually a numeric value, is entered. Unlike the INPUT command, the PROMPT does not automatically store the entered value into a variable. Therefore, if you want to use the value for future use, a STO (store) command must be used following the prompt.


Let’s take our volume of the cone example again:


HP 41C family

HP 42S family

01 LBL “VCONE2”

02 ^T RADIUS?

03 PROMPT

04 STO 00

05 ^T HEIGHT?

06 PROMPT

07 STO 01

08 PI

09 RCL 00

10 X↗2

11 *

12 RCL 01

13 *

14 3

15 /

16 RTN



R00 = radius

R01 = volume

00 { 40-Byte Prgm }

01 LBL “VCONE2”

02 “RADIUS?”

03 PROMPT

04 STO 00

05 “HEIGHT?”

06 PROMPT

07 STO 01

08 PI

09 RCL 00

10 X↑2

11 ×

12 RCL 01

13 ×

14 3

15 ÷

16 RTN



R00 = radius

R01 = volume


With PROMPT, I like to use the numeric-named memory registers, but we can use alphabetic or alphanumeric registers as well.


HP 32SII/DM32: Simulating PROMPT with Flag 10


Even though the HP 32SII does not have a PROMPT command, we can kind of simulate it by using the equation message feature.


To set flag 10: [ |→ ] [ × ]* (FLAGS), { SF }. [ . ] [ 0 ]

To clear flag 10: [ |→ ] [ × ]* (FLAGS), { CF }. [ . ] [ 0 ]

We have to use the decimal point key in order to access flags beyond 9.

(*HP 35S: [ ←| ] [ ↑ ] (FLAGS))


HP 32SII/33S/35S/DM32


W01 LBL W

W02 SF 10

W03 “=RADIUS”

W04 STO R

W05 “=HEIGHT”

W06 STO H

W07 CF 10


W08 π

W09 RCL R

W10 x^2

W11 ×

W12 RCL H

W13 ×

W14 3

W15 ÷

W16 RTN


Turn message mode on

Enter as an equation =RADIUS

Enter radius and press [R/S]

Enter as an equation =HEIGHT

Enter height and press [R/S]

Turn message mode off, so equations can operate normally



Note: Equations are NOT on the original HP 32S.



I hope you find this helpful.


Eddie


All original content copyright, © 2011-2025. 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.


The author does not use AI engines and never will.

Sunday, October 5, 2025

HP 41C/DM41X and HP 42S/DM42: Conversions

HP 41C/DM41X and HP 42S/DM42: Conversions


The program CONV has the "standard" conversions:



inches (IN) <-> centimeters (CM)

gallons (GAL) <-> liters (L)

pounds (LB) <-> kilograms (KG)

Fahrenheit (°F) <-> Celsius (°C)



Source: HP 67 Manual (Useful Conversion Factors, back cover). April 1977.



HP 41C/DM41: CONV41


Download raw file: CONV 41 Version


Custom menu:

Key: A (Σ+), B (1/x), C (√x), D (LOG), E (LN)

1st Level (to US): →IN, →GAL, →LB, →°F, HELP

2nd Level (to SI): →CM, →L, →KG, →°C, EXIT

(184 bytes)


01▸LBL "CONV"

02 SF 27

03 CF 01

04 RTN

05▸LBL A

06 2.54

07 FS? 01

08 1/X

09 /

10 CF 01

11 RTN

12▸LBL a

13 SF 01

14 GTO A

15▸LBL B

16 3.785411784

17 FS? 01

18 1/X

19 /

20 CF 01

21 RTN

22▸LBL b

23 SF 01

24 GTO B

25▸LBL C

26 .45359237

27 FS? 01

28 1/X

29 /

30 CF 01

31 RTN

32▸LBL c

33 SF 01

34 GTO C

35▸LBL D

36 1.8

37 *

38 32

39 +

40 RTN

41▸LBL d

42 32

43 -

44 1.8

45 /

46 RTN

47▸LBL E

48 CF 27

49 RTN

50▸LBL e

51 SF 21

52 "A >IN a >CM"

53 AVIEW

54 "B >GAL b >L"

55 AVIEW

56 "C >LB c> KG"

57 AVIEW

58 "D >F d >C"

59 AVIEW

60 CF 21

61 RTN

62 END



HP 42S/DM42/Free 42: CONV42


Download raw file:  CONV 42 Version


Custom menu:

1st Level (to US): →IN, →GAL, →LB, →°F

2nd Level (to SI): →CM, →L, →KG, →°C

The arrow keys (↓) and (↑) toggle the menu.

To exit the program, press [EXIT].


00 { 219-Byte Prgm }

01▸LBL "CONV"

02▸LBL A

03 MENU

04 "→IN"

05 KEY 1 XEQ 01

06 "→GAL"

07 KEY 2 XEQ 02

08 "→LB"

09 KEY 3 XEQ 03

10 "→°F"

11 KEY 4 XEQ 04

12 KEY 7 GTO B

13 KEY 8 GTO B

14 KEY 9 GTO 99

15▸LBL 20

16 STOP

17 GTO 20

18▸LBL B

19 MENU

20 "→CM"

21 KEY 1 XEQ 05

22 "→L"

23 KEY 2 XEQ 06

24 "→KG"

25 KEY 3 XEQ 07

26 "→°C"

27 KEY 4 XEQ 08

28 KEY 7 GTO A

29 KEY 8 GTO A

30 KEY 9 GTO 99

31▸LBL 21

32 STOP

33 GTO 21

34▸LBL 99

35 CLMENU

36 EXITALL

37 RTN

38▸LBL 01

39 2.54

40 /

41 RTN

42▸LBL 02

43 3.785411784

44 /

45 RTN

46▸LBL 03

47 0.45359237

48 /

49 RTN

50▸LBL 04

51 1.8

52 ×

53 32

54 +

55 RTN

56▸LBL 05

57 2.54

58 ×

59 RTN

60▸LBL 06

61 3.785411784

62 ×

63 RTN

64▸LBL 07

65 0.45359237

66 ×

67 RTN

68▸LBL 08

69 32

70 -

71 1.8

72 /

73 RTN

74 .END.


Eddie


All original content copyright, © 2011-2025. 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.

Sunday, July 28, 2024

More Updates: HP 15C Collector's Edition and Swiss Micros DM42

Thanks to Museum of HP Calculators Forums:


HP 15C Collector's Edition (SAMBA software and the HP 15C Connectivity cable required)

*  Key bounce issue is addressed

*  Decimal display mode in HP 16C mode corrected


Links:

Forum Post:  https://www.hpmuseum.org/forum/thread-22078.html

BIN file download page:  https://hpcalcs.com/download/

SAM-BA Software:  https://www.microchip.com/en-us/development-tool/sam-ba-in-system-programmer#Software

Where to buy the required cable:

Calculator Store (Europe):  https://www.thecalculatorstore.com/

HP Supply (United States/Canada, per forum, available in August 2024):  https://hpofficesupply.com



Swiss Micros DM42 - v.3.23 DCMP 3.25

*  Software updated to match Free42 firmware 3.1.8


Info about Free42:  https://thomasokken.com/free42/

Swiss Micros Post:  https://forum.swissmicros.com/viewtopic.php?p=33058#p33058

Firmware Page:  https://technical.swissmicros.com/dm42/firmware/



Eddie

All original content copyright, © 2011-2024. 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.

Saturday, February 3, 2024

Swiss Micros DM42 and TI-84 Plus: Sum of an Infinite Geometric Series

Swiss Micros DM42 and TI-84 Plus:  Sum of an Infinite Geometric Series



Introduction


An infinite geometric series has the form:


a + a × r + a × r^2 + a × r^3 + ...


= a × (1 + r + r^2 + r^3 + ....)



If |r| < 1, the series converges and a sum exists. 


∞

Σ  a × r^n   =   a ÷ (1 - r)

n=0


∞

Σ  a × r^(n-1)   =   a ÷ (1 - r)

n=1


However if |r| ≥ 1, the series diverges and does not have as sum.



DM42 Program:  GSUM


Calculators: DM42, HP 42S, Free42, Plus42


00 { 36-Byte Prgm }

01 LBL "GSUM"

02 ENTER

03 ABS

04 1

05 X<>Y

06 X>Y?

07 GTO 00

08 R↓

09 R↓

10 1

11 X<>Y

12 -

13 ÷

14 RTN

15 LBL 00

16 CLX

17 "DIVERGES"

18 AVIEW

19 .END.


In the case the series diverges, the X stack is cleared (displays 0).  



TI-84 Plus Program:  GSUM


Calculators:  TI-84 Plus, TI-84 Plus CE (Python), TI-83 Premium CE (Python)


Disp "Σ(A*R^N,0,INF)","Σ(A*R^(N-1),1,I)"

Prompt A,R

ClrHome

Disp "A=",A,"R=",R

If abs(R)<1

Then

A/(1-R)→S

Disp "SUM=",S

Else

Disp "DIVERGES"

End



Examples


A:  3,  R:  -0.2

Stack:  Y = 3, X = -0.2

Result = 2.5


A:  3,  R:  0.2

Stack:  Y = 3, X = -0.2

Result = 3.75


A:  3,  R:  -2.2

Stack:  Y = 3, X = -2.2

Result = diverges


A:  3,  R:  2.2

Stack:  Y = 3, X = 2.2

Result = diverges



Eddie


All original content copyright, © 2011-2024.  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. 


HP 42S/DM42/Free 42: Two Functions Programmed Three Different Ways

HP 42S/DM42/Free 42: Two Functions Programmed Three Different Ways Introduction In 1979, Electro Scientific Industries (esi)...