first commit
This commit is contained in:
commit
52ec9c241e
26 changed files with 372 additions and 0 deletions
20
README.md
Normal file
20
README.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# HP-42S RPN Programs
|
||||
|
||||
These are my RPN programs to be used with the HP-42S scientific calculator.
|
||||
As I do not own the original calculator, the programs also run on
|
||||
[Free42](http://thomasokken.com/free42/) and the
|
||||
[Swissmicros DM42](https://www.swissmicros.com/dm42.php).
|
||||
|
||||
Notes on the usage might be found in each directory.
|
||||
|
||||
The directories also contain .raw files which are the binaries.
|
||||
This is not the git-way but rather useful and I'll give my best to keep them in
|
||||
sync.
|
||||
|
||||
Compilation is done with [Swissmicros' Online Converter](https://www.swissmicros.com/dm42/decoder/)
|
||||
|
||||
## License
|
||||
Most of the programs (the ones I made) are licensed under **GNU GPLv3**.
|
||||
Some programs were contributed by others and are stored here for convenience.
|
||||
If so, this is mentioned in a local readme and the program is subject to
|
||||
whatever the original author prefers.
|
34
base/README.md
Normal file
34
base/README.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
This is the base conversion program contributed by Ton van de Burgt to the
|
||||
[Free42 Software Collection](http://thomasokken.com/free42/42progs/index.html)
|
||||
|
||||
---
|
||||
|
||||
# Base
|
||||
A program for viewing several bases together.
|
||||
|
||||
## Usage
|
||||
![Usage](images/image001.gif)
|
||||
|
||||
The program shows the ASCII character, the Hexadecimal value, the Decimal value and the Binary value.
|
||||
The maximum value of the word is 1 byte: "FF" in Hex, 255 in Dec, 1111.1111 in Bin.
|
||||
- Pressing [ASCII] you can enter a new ASCII value
|
||||
- Pressing [HEX] you can enter a new Hexadecimal value
|
||||
- Pressing [DEC] you can enter a new Decimal value
|
||||
- Pressing [BIN] you can enter a new Binary value
|
||||
|
||||
## Example
|
||||
Press [ASCII] and enter a "Q":
|
||||
|
||||
![Example 2](images/image002.gif)
|
||||
|
||||
Press [R/S] and the several bases are displayed:
|
||||
|
||||
![Example 3](images/image003.gif)
|
||||
|
||||
Press [HEX] and enter "15"
|
||||
|
||||
![Example 4](images/image004.gif)
|
||||
|
||||
Press [R/S] and the several bases are displayed:
|
||||
|
||||
![Example 5](images/image005.gif)
|
BIN
base/base.raw
Normal file
BIN
base/base.raw
Normal file
Binary file not shown.
75
base/base.txt
Normal file
75
base/base.txt
Normal file
|
@ -0,0 +1,75 @@
|
|||
00 { 181-Byte Prgm }
|
||||
01▸LBL "BASE"
|
||||
02▸LBL 00
|
||||
03 255
|
||||
04 AND
|
||||
05 STO "WORD"
|
||||
06 CLMENU
|
||||
07 "ASCII"
|
||||
08 KEY 1 XEQ 01
|
||||
09 "HEX"
|
||||
10 KEY 2 XEQ 02
|
||||
11 "DEC"
|
||||
12 KEY 3 XEQ 03
|
||||
13 "BIN"
|
||||
14 KEY 4 XEQ 04
|
||||
15 KEY 9 GTO 09
|
||||
16 " "
|
||||
17 XTOA
|
||||
18 10
|
||||
19 X<>Y
|
||||
20 X=Y?
|
||||
21 "LF"
|
||||
22 ├" "
|
||||
23 256
|
||||
24 +
|
||||
25 HEXM
|
||||
26 ARCL ST X
|
||||
27 ├" "
|
||||
28 744
|
||||
29 +
|
||||
30 AIP
|
||||
31 ├" "
|
||||
32 LASTX
|
||||
33 -
|
||||
34 BINM
|
||||
35 ARCL ST X
|
||||
36 4
|
||||
37 AROT
|
||||
38 ATOX
|
||||
39 4
|
||||
40 AROT
|
||||
41 ATOX
|
||||
42 5
|
||||
43 AROT
|
||||
44 ATOX
|
||||
45 8
|
||||
46 AROT
|
||||
47 AVIEW
|
||||
48 MENU
|
||||
49 RCL "WORD"
|
||||
50 STOP
|
||||
51 GTO 00
|
||||
52▸LBL 01
|
||||
53 CLA
|
||||
54 RCL "WORD"
|
||||
55 XTOA
|
||||
56 AON
|
||||
57 STOP
|
||||
58 AOFF
|
||||
59 ATOX
|
||||
60 RTN
|
||||
61▸LBL 02
|
||||
62 HEXM
|
||||
63 GTO 05
|
||||
64▸LBL 03
|
||||
65 DECM
|
||||
66 GTO 05
|
||||
67▸LBL 04
|
||||
68 BINM
|
||||
69▸LBL 05
|
||||
70 INPUT "WORD"
|
||||
71 RTN
|
||||
72▸LBL 09
|
||||
73 EXITALL
|
||||
74 END
|
BIN
base/images/image001.gif
Normal file
BIN
base/images/image001.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
base/images/image002.gif
Normal file
BIN
base/images/image002.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
base/images/image003.gif
Normal file
BIN
base/images/image003.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
base/images/image004.gif
Normal file
BIN
base/images/image004.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
base/images/image005.gif
Normal file
BIN
base/images/image005.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
19
brewery/README.md
Normal file
19
brewery/README.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Brewery calculations
|
||||
|
||||
## SPND - Spundungsdruck
|
||||
This is a **solver-program** to calculate the carbonization pressure according
|
||||
to this formula:
|
||||
```
|
||||
2617.25
|
||||
(- 10.73797) + ----------
|
||||
t + 273.15
|
||||
c(p, t) := (p + 1.013) %e 10
|
||||
```
|
||||
|
||||
c: CO₂ concentration in g/l
|
||||
p: Carbonization gauge pressure in bar
|
||||
ϑ: Temperature in °C
|
||||
|
||||
https://elfring.ms/blog/rpn-karbonisierungsrechner
|
||||
|
||||
|
BIN
brewery/spund.raw
Normal file
BIN
brewery/spund.raw
Normal file
Binary file not shown.
22
brewery/spund.txt
Normal file
22
brewery/spund.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
00 { 77-Byte Prgm }
|
||||
01▸LBL "SPND"
|
||||
02 MVAR "bar"
|
||||
03 MVAR "°C"
|
||||
04 MVAR "g/l"
|
||||
05 2617.25
|
||||
06 273.15
|
||||
07 RCL "°C"
|
||||
08 +
|
||||
09 ÷
|
||||
10 10.73797
|
||||
11 -
|
||||
12 E↑X
|
||||
13 RCL "bar"
|
||||
14 1.013
|
||||
15 +
|
||||
16 ×
|
||||
17 10
|
||||
18 ×
|
||||
19 RCL "g/l"
|
||||
20 -
|
||||
21 END
|
21
diving/README.md
Normal file
21
diving/README.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Calculations for Diving
|
||||
|
||||
> Please note:
|
||||
> As diving is potentially dangerous, please be sensible and verify the
|
||||
> calculations on your own.
|
||||
|
||||
## MOD
|
||||
Maximum-Operating-Depth for nitrox
|
||||
|
||||
1. Enter the percentage of oxygen in the gas.
|
||||
2. Execute the program.
|
||||
3. Get the MOD in meters for the O₂-pressures of 1,4 and 1,6 bar.
|
||||
|
||||
## NTRX - Nitrox
|
||||
This is a **solver-program** for the general nitrox formula:
|
||||
```
|
||||
PO₂ x 10
|
||||
EAN = ---------- x 100
|
||||
D + 10
|
||||
```
|
||||
|
BIN
diving/mod.raw
Normal file
BIN
diving/mod.raw
Normal file
Binary file not shown.
25
diving/mod.txt
Normal file
25
diving/mod.txt
Normal file
|
@ -0,0 +1,25 @@
|
|||
00 { 64-Byte Prgm }
|
||||
01▸LBL "MOD"
|
||||
02 100
|
||||
03 ÷
|
||||
04 STO 01
|
||||
05 1.4
|
||||
06 RCL 01
|
||||
07 ÷
|
||||
08 1
|
||||
09 -
|
||||
10 10
|
||||
11 ×
|
||||
12 "MOD1,4= "
|
||||
13 ARCL ST X
|
||||
14 1.6
|
||||
15 RCL 01
|
||||
16 ÷
|
||||
17 1
|
||||
18 -
|
||||
19 10
|
||||
20 ×
|
||||
21 ├"[LF]MOD1,6= "
|
||||
22 ARCL ST X
|
||||
23 AVIEW
|
||||
24 END
|
BIN
diving/nitrox.raw
Normal file
BIN
diving/nitrox.raw
Normal file
Binary file not shown.
18
diving/nitrox.txt
Normal file
18
diving/nitrox.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
00 { 46-Byte Prgm }
|
||||
01▸LBL "NTRX"
|
||||
02 MVAR "D"
|
||||
03 MVAR "Pp"
|
||||
04 MVAR "EAN"
|
||||
05 RCL "D"
|
||||
06 10
|
||||
07 ÷
|
||||
08 1
|
||||
09 +
|
||||
10 RCL "EAN"
|
||||
11 100
|
||||
12 ÷
|
||||
13 ×
|
||||
14 RCL "Pp"
|
||||
15 -
|
||||
16 END
|
||||
|
6
microwave/README.md
Normal file
6
microwave/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# MWVE - Microwave
|
||||
A little helper for the microwave oven.
|
||||
|
||||
Enter wattage and time for something to cook.
|
||||
The program will return an available powerlevel (from MY oven) and an adjusted time.
|
||||
The time is entered in mm,ss
|
BIN
microwave/mwve.raw
Normal file
BIN
microwave/mwve.raw
Normal file
Binary file not shown.
44
microwave/mwve.txt
Normal file
44
microwave/mwve.txt
Normal file
|
@ -0,0 +1,44 @@
|
|||
00 { 133-Byte Prgm }
|
||||
01▸LBL "MWVE"
|
||||
02 INPUT "Watt"
|
||||
03 INPUT "Zeit"
|
||||
04 →HR
|
||||
05 STO "Zeit"
|
||||
06 100
|
||||
07 STO 00
|
||||
08 RCL "Watt"
|
||||
09 270
|
||||
10 X≤Y?
|
||||
11 STO 00
|
||||
12 RCL "Watt"
|
||||
13 300
|
||||
14 X≤Y?
|
||||
15 STO 00
|
||||
16 RCL "Watt"
|
||||
17 440
|
||||
18 X≤Y?
|
||||
19 STO 00
|
||||
20 RCL "Watt"
|
||||
21 600
|
||||
22 X≤Y?
|
||||
23 STO 00
|
||||
24 RCL "Watt"
|
||||
25 950
|
||||
26 X≤Y?
|
||||
27 STO 00
|
||||
28 RCL "Watt"
|
||||
29 RCL 00
|
||||
30 ÷
|
||||
31 RCL "Zeit"
|
||||
32 ×
|
||||
33 "t= "
|
||||
34 →HMS
|
||||
35 0.01
|
||||
36 ×
|
||||
37 ATIME
|
||||
38 RCL 00
|
||||
39 ├"[LF]P= "
|
||||
40 AIP
|
||||
41 ├"W"
|
||||
42 AVIEW
|
||||
43 END
|
34
split/README.md
Normal file
34
split/README.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
# SPLIT - Split expenditures among people
|
||||
Several people of a group had different expenses.
|
||||
The expenditures shall be shared among the whole group.
|
||||
|
||||
## Usage
|
||||
* Create a 1xN matrix where N is the number of people.
|
||||
* Enter the expenses into the matrix.
|
||||
* Execute this program.
|
||||
* Z will conatin the sum.
|
||||
* Y will contain amount per person.
|
||||
* X will contain a matrix with the compensation cashflow.
|
||||
|
||||
## Annotation
|
||||
```
|
||||
LBL "SPLIT"
|
||||
STO "m"
|
||||
RSUM ─┐ Store the sum of the whole row
|
||||
DET │ It is returned as a 1x1 matrix, the DET will be a scalar
|
||||
STO 01 ─┘
|
||||
RCL "m"
|
||||
DIM? The X-DIM of the matrix is the number of elements, DIM? returns into X, Y
|
||||
RCL 01 ─┐
|
||||
X<>Y │ Sum / number = amount per person
|
||||
÷ ─┘
|
||||
STO 02 Store the amount per person
|
||||
RCL 01 RCL the Sum to have it in Z later on
|
||||
X<>Y Get the amount per person back into X (Could also be RCL 02)
|
||||
RCL "m" ─┐
|
||||
X<>Y │ Matrix - amount p.p. = matrix with comp. cashflow
|
||||
- ─┘
|
||||
RCL 02 ─┐ Put the amount p.p. into Y
|
||||
X<>Y ─┘
|
||||
END
|
||||
```
|
BIN
split/split.raw
Normal file
BIN
split/split.raw
Normal file
Binary file not shown.
20
split/split.txt
Normal file
20
split/split.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
00 { 35-Byte Prgm }
|
||||
01▸LBL "SPLIT"
|
||||
02 STO "m"
|
||||
03 RSUM
|
||||
04 DET
|
||||
05 STO 01
|
||||
06 RCL "m"
|
||||
07 DIM?
|
||||
08 RCL 01
|
||||
09 X<>Y
|
||||
10 ÷
|
||||
11 STO 02
|
||||
12 RCL 01
|
||||
13 X<>Y
|
||||
14 RCL "m"
|
||||
15 X<>Y
|
||||
16 -
|
||||
17 RCL 02
|
||||
18 X<>Y
|
||||
19 END
|
16
statitics/README.md
Normal file
16
statitics/README.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Statistics Tools
|
||||
|
||||
## SnCk
|
||||
Sum of combinations.
|
||||
The usual nCk function returns the number of combinations for k elements out of n.
|
||||
This program sums up the combinations for 1 .. k out of n.
|
||||
|
||||
```
|
||||
k
|
||||
====
|
||||
\ 1
|
||||
n! > -----------
|
||||
/ k! (n - k)!
|
||||
====
|
||||
k = 1
|
||||
```
|
BIN
statitics/SnCk.raw
Normal file
BIN
statitics/SnCk.raw
Normal file
Binary file not shown.
18
statitics/SnCk.txt
Normal file
18
statitics/SnCk.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
00 { 40-Byte Prgm }
|
||||
01▸LBL "ΣnCk"
|
||||
02 0
|
||||
03 STO 00
|
||||
04 INPUT "n"
|
||||
05 INPUT "k"
|
||||
06▸LBL 06
|
||||
07 RCL "n"
|
||||
08 RCL "k"
|
||||
09 COMB
|
||||
10 STO+ 00
|
||||
11 1
|
||||
12 STO- "k"
|
||||
13 RCL "k"
|
||||
14 X>0?
|
||||
15 GTO 06
|
||||
16 RCL 00
|
||||
17 END
|
Loading…
Reference in a new issue