commit 52ec9c241edba821775f9765b76417b8ce5b678f Author: Joerg Elfring Date: Tue Feb 5 20:33:55 2019 +0100 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..6998c13 --- /dev/null +++ b/README.md @@ -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. diff --git a/base/README.md b/base/README.md new file mode 100644 index 0000000..e080dc3 --- /dev/null +++ b/base/README.md @@ -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) diff --git a/base/base.raw b/base/base.raw new file mode 100644 index 0000000..3c94541 Binary files /dev/null and b/base/base.raw differ diff --git a/base/base.txt b/base/base.txt new file mode 100644 index 0000000..d07d7d6 --- /dev/null +++ b/base/base.txt @@ -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 diff --git a/base/images/image001.gif b/base/images/image001.gif new file mode 100644 index 0000000..6ba6091 Binary files /dev/null and b/base/images/image001.gif differ diff --git a/base/images/image002.gif b/base/images/image002.gif new file mode 100644 index 0000000..679c133 Binary files /dev/null and b/base/images/image002.gif differ diff --git a/base/images/image003.gif b/base/images/image003.gif new file mode 100644 index 0000000..31caae2 Binary files /dev/null and b/base/images/image003.gif differ diff --git a/base/images/image004.gif b/base/images/image004.gif new file mode 100644 index 0000000..32e09b1 Binary files /dev/null and b/base/images/image004.gif differ diff --git a/base/images/image005.gif b/base/images/image005.gif new file mode 100644 index 0000000..8471705 Binary files /dev/null and b/base/images/image005.gif differ diff --git a/brewery/README.md b/brewery/README.md new file mode 100644 index 0000000..786f892 --- /dev/null +++ b/brewery/README.md @@ -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 + + diff --git a/brewery/spund.raw b/brewery/spund.raw new file mode 100644 index 0000000..db72c19 Binary files /dev/null and b/brewery/spund.raw differ diff --git a/brewery/spund.txt b/brewery/spund.txt new file mode 100644 index 0000000..dcac8f1 --- /dev/null +++ b/brewery/spund.txt @@ -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 diff --git a/diving/README.md b/diving/README.md new file mode 100644 index 0000000..819ba2f --- /dev/null +++ b/diving/README.md @@ -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 +``` + diff --git a/diving/mod.raw b/diving/mod.raw new file mode 100644 index 0000000..8a9f0b7 Binary files /dev/null and b/diving/mod.raw differ diff --git a/diving/mod.txt b/diving/mod.txt new file mode 100644 index 0000000..ccf7b74 --- /dev/null +++ b/diving/mod.txt @@ -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 diff --git a/diving/nitrox.raw b/diving/nitrox.raw new file mode 100644 index 0000000..f4f257b Binary files /dev/null and b/diving/nitrox.raw differ diff --git a/diving/nitrox.txt b/diving/nitrox.txt new file mode 100644 index 0000000..70351b3 --- /dev/null +++ b/diving/nitrox.txt @@ -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 + diff --git a/microwave/README.md b/microwave/README.md new file mode 100644 index 0000000..2f9f1df --- /dev/null +++ b/microwave/README.md @@ -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 diff --git a/microwave/mwve.raw b/microwave/mwve.raw new file mode 100644 index 0000000..f8e1c2b Binary files /dev/null and b/microwave/mwve.raw differ diff --git a/microwave/mwve.txt b/microwave/mwve.txt new file mode 100644 index 0000000..3baaac3 --- /dev/null +++ b/microwave/mwve.txt @@ -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 diff --git a/split/README.md b/split/README.md new file mode 100644 index 0000000..2c0c4aa --- /dev/null +++ b/split/README.md @@ -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 +``` diff --git a/split/split.raw b/split/split.raw new file mode 100644 index 0000000..005b85c Binary files /dev/null and b/split/split.raw differ diff --git a/split/split.txt b/split/split.txt new file mode 100644 index 0000000..a0b630a --- /dev/null +++ b/split/split.txt @@ -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 diff --git a/statitics/README.md b/statitics/README.md new file mode 100644 index 0000000..08317e3 --- /dev/null +++ b/statitics/README.md @@ -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 +``` diff --git a/statitics/SnCk.raw b/statitics/SnCk.raw new file mode 100644 index 0000000..48832ad Binary files /dev/null and b/statitics/SnCk.raw differ diff --git a/statitics/SnCk.txt b/statitics/SnCk.txt new file mode 100644 index 0000000..92472c8 --- /dev/null +++ b/statitics/SnCk.txt @@ -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