Showing posts with label DM42. Show all posts
Showing posts with label DM42. 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, August 29, 2026

The MU Key on a Four Function Calculator and Programs for the DM42/HP 42S

 The MU Key on a Four Function Calculator and Programs for the DM42/HP 42S


Not too long ago, I purchased this very colorful, four function calculator from the University I work at, the Dexin BST DX-818.





The DX-818 is powered by a solar panel with an option to be run by an AAA battery when using the calculator in less than bright light conditions. The AAA battery is optional.



A Standard Calculator



This calculator is the standard four function key calculator, complete with the square root function, percent function, the standard three memory keys (M+, M-, and MRC), and a grand total (GT) key. A grand total is started when calculations are completed by pressing the equals key [ = ]. The grand total is both recalled and cleared when the [ GT ] is pressed.



The Markup Equation



Before we head to the calculators, the mark up is a calculation of between selling price (new), cost (old), and mark up. The markup is ratio between the selling price and cost over cost and as expressed as a percentage (%):



MU = (selling price – cost) ÷ cost = (selling price ÷ cost - 1)



Solving for the other variables yield:

selling price = cost * (1 + MU)

cost = selling price ÷ (1 + MU)

In these equations, MU is expressed as a decimal.



If let the selling price be the new value and cost be the old value, then we have the equation for percent change (Δ%):

Δ% = (new – old) ÷ old = (new ÷ old - 1)

Similarly:

new = old * (1 + Δ%)

old = new ÷ (1 + Δ%)

In these equations, Δ% is expressed as a decimal.



The Markup Key (MU)



On this particular calculator, there is an [ MU ] key. This is the markup key. Apparently, there are two types of [ MU ] key, one set of syntax for Casio calculators with the [ MU ] key. An example of a Casio calculator with an [ MU ] key is the MJ-120D plus. They way Casio calculators use the [ MU ] key is a calculation:



cost [ MU ] markup percentage [ % ] returns selling price.

Immediately pressing [ = ] returns selling price – cost.



However, some calculators, like the colorful calculator featured (I really wish I knew the model number) with the [ MU ] have another syntax, and that is what I will address from here on out.





On this particular calculator, the syntax, using one of the four arithmetic functions is:


y < +, -, ×, or ÷ > x [ MU ]


No use of the equals key is needed, unless you want to add the result to the grand total.



The four calculations with the [ MU ] key, on this particular calculator (and possibly the NewYes calculators from China) are:



Key Sequence

Formula Used

Notes

Y [ + ] X [ MU ]

100 * (Y ÷ X + 1)


Y [ - ] X [ MU ]

100 * (Y ÷ X - 1)

Calculates markup or percent change (Δ%).

Y = selling price, new value

X = cost, old value

Y [ × ] X [ MU ]

Y * (1 + X ÷ 100)

Adds X% to Y. Calculates the new value (selling price) given old value (cost) (Y) and markup (X).

Y [ ÷ ] X [ MU ]

Y ÷ (1 – X ÷ 100)

Finds the original retail price given selling price (Y) and discount rate (X). This can also be used for gross-up calculations.



Sample Calculations



Problem

Keystrokes

Result

Determine 100 * (Y ÷ X + 1) with Y = 420, X = 25

420 [ + ] 25 [ MU ]

1780

An item that cost the company $14.75 sells for $19.99. Find the markup.

19.99 [ - ] 14.75 [ MU ]

35.5254237288

(≈35.53%)

A company manufactures a product with a unit cost of $32.84 and wants a 20% markup. What is the selling price?

32.84 [ × ] 20 [ MU ]

39.408

(about $39.41)

A product is currently on sale for $39.99. If the discount is 35%, what is the original retail price.

39.99 [ ÷ ] 35 [ MU ]

61.523076923

(about $61.52)




RPN Programming with the Swiss Micros DM42



Here are four RPN programs, which are were programmed using a Swiss Micros DM42, which can be used on the HP 42S (and probably the HP 41C).



Program MU+: Y [ + ] X [ MU ]

00 {17-Byte Prgm}

01 LBL “MU+”
02 ÷

03 1

04 +

05 100

06 ×

07 RTN

08 END



Program MU-: Y [ - ] X [ MU ]

00 {17-Byte Prgm}

01 LBL “MU-”
02 ÷

03 1

04 -

05 100

06 ×

07 RTN

08 END



Program MUMLT: Y [ × ] X [ MU ]

00 {12-Byte Prgm}

01 LBL “MUMLT”
02 %

03 +

04 RTN

05 END



Program MUDIV: Y [ ÷ ] X [ MU ]

00 {21-Byte Prgm}

01 LBL “MUDIV”
02 ENTER

03 100

04 ÷

05 1

06 X<>Y

07 -

08 ÷

09 RTN

10 END



Sources


 Casio. “MJ-120D Plus” https://www.casio.com/intl/basic-calculators/product.MJ-120DPLUS/ Accessed May 23, 2026.


Eaton, Glenn. “The Calculator MU Key” Eaton Family Website. Posted on June 30, 2017. https://eatonfamily.au/calculator-mu-key/ Accessed May 23, 2026.


“How to use the MU button on a calculator? #1” YouTube Short: @newyes1162. Posted December 5, 2022. https://www.youtube.com/shorts/OiS8yFKKJSU Accessed May 23, 2026


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, August 1, 2026

DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues

DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues




The programs are listed for the Swiss Micros DM42 and Hewlett Packard 42S.



All examples are on rounded to four decimal places and complex mode turned on (CPXRES).



Monic Quadratic Equation: quad2.raw



The program QUAD2 solves the equation for w:

w² + Y * w + X = 0

Y: contents of stack Y

X: contents of stack X



Code:

00 { 35-Byte Prgm }

01▸LBL "QUAD2"

02 X<>Y

03 ENTER

04 2

05 ÷

06 +/-

07 ENTER

08 X↑2

09 X<>Y

10 R↓

11 X<>Y

12 -

13 SQRT

14 R↑

15 X<>Y

16 ENTER

17 ENTER

18 R↑

19 ENTER

20 R↓

21 X<>Y

22 +

23 R↓

24 -

25 R↑

26 RTN

27 .END.



Example 1: w² + 7 * w + 5 = 0

Stack: Y: 7, X: 5

Results: -6.1926, -0.8074



Example 2: w² – 4 = 0

Stack: Y: 0, X: -4

Results: -2.0000, 2.0000



Characteristic Polynomial: char2.raw



The program CHAR2 find the coefficients of 2 x 2 matrix:

[ [ A, B ] [ C , D ] ]

Result: λ² – T1 * λ + T2 = 0 where

T1 = A + D

T2 = det([[ A, B ] [ C, D ]]) = A * D – C * B



The program provides prompts and results in messages.



Code:

00 { 81-Byte Prgm }

01▸LBL "CHAR2"

02 "[[A,B][C,D]]"

03 AVIEW

04 PSE

05 PSE

06 "L↑2-T1×L+T2=0"

07 AVIEW

08 PSE

09 PSE

10 INPUT "A"

11 ENTER

12 ENTER

13 INPUT "D"

14 ENTER

15 R↓

16 +

17 "T1= "

18 ARCL ST X

19 AVIEW

20 STOP

21 R↓

22 ×

23 INPUT "C"

24 INPUT "B"

25 ×

26 -

27 "T2= "

28 ARCL ST X

29 AVIEW

30 RTN

31 .END.



Example 1: [ [ -6, 4 ] [ 2, 3 ] ]

Results: T1: 3, T2: -26



Example 2: [ [ 5, 8 ] [ -1, 2 ] ]

Results: T1: 7, T2: 18



Eigenvalues of 2 x 2 Matrices: egn2.raw



The program EGNV2 calculates the eigenvalues of a 2 x 2 matrix:

[ [ A, B ] [ C , D ] ]



The program provides prompts and results in messages. The command CPXRES sets the calculator to accept complex number results.



Code:

00 { 106-Byte Prgm }

01▸LBL "EGNV2"

02 CPXRES

03 "[[A,B][C,D]]"

04 AVIEW

05 PSE

06 PSE

07 INPUT "A"

08 INPUT "B"

09 INPUT "C"

10 INPUT "D"

11 RCL "A"

12 RCL "D"

13 +

14 +/-

15 RCL "A"

16 RCL "D"

17 ×

18 RCL "B"

19 RCL "C"

20 ×

21 -

22 X<>Y

23 ENTER

24 2

25 ÷

26 +/-

27 ENTER

28 X↑2

29 X<>Y

30 R↓

31 X<>Y

32 -

33 SQRT

34 R↑

35 X<>Y

36 ENTER

37 ENTER

38 R↑

39 ENTER

40 R↓

41 X<>Y

42 +

43 "E1="

44 ARCL ST X

45 AVIEW

46 PSE

47 PSE

48 R↓

49 -

50 "E2="

51 ARCL ST X

52 AVIEW

53 PSE

54 PSE

55 R↑

56 RTN

57 .END.



Example 1: [ [ -6, 4 ] [ 2, 3 ] ]

Results: 3.8151, - 6.8151



Example 2: [ [ 5, 8 ] [ -1, 2 ] ]

Results: 3.5 ± 2.37792 i


You can download the three programs here: https://drive.google.com/file/d/1SKcVIhKYHnnuhrvBJxfOmwsV8sRTSj0X/view?usp=sharing





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, June 6, 2026

RPN: Solving T * w + Z = Y * w + X (featuring DM42, HP 67)

RPN:   Solving T * w + Z = Y * w + X  (featuring DM42, HP 67)


Introduction and Code



This is inspired in part by the new Casio fx-92 being released where it has added the linear equation:

ax + b = cx + d



( https://tiplanet.org/forum/viewtopic.php?p=280173&sid=2174c3a99692ac8898ff3957db84031a#p280173 (in French), retrieved February 6, 2026)



Solve the equation for w:

T * w + Z = Y * w + X


where the solution is w = (Z – X) ÷ (Y – T)


The values for T, Z, Y, and X are taken directly from the four-level classic RPN stack.



HP 42S/DM42/HP 41C (programmed with a DM42) Code


LBL “TZYX1”

x<>y

R↓

-

R↓

-

R↑

x<>y

÷

RTN



HP 67 Code


001: LBL A; 31, 25, 11

002: x<>y; 35, 52

003: R↓; 35, 53

004: -; 51

005: R↓; 35, 53

006: -; 51

007: R↑; 35, 54

008: x<>y; 35, 52

009: ÷; 81

010: RTN; 35, 52



Stack Results:


Start

Finish

T

Z - X

Z

Z - X

Y

Y

X

(Z – X) ÷ (Y – T) = W (solution)



Examples


Example 1: 5 * w + 20 = 10 * w + 30


T: 5

Z: 20

Y: 10

X: 30


Solution: w = -2




Example 2: 3 * w – 18 = -2 * w + 16


T: 3

Z: -18

Y: -2

X: 16


Solution: w = 6.8




Example 3: 5 * w + 3 = w + 2


T: 5

Z: 3

Y: 1

X: 2


Solution: w = -0.25




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.

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)...