The Museum of HP Calculators


Ft-In for the HP 42s

This program is by Fernando Jannaut and is used here by permission.

This program is supplied without representation or warranty of any kind. Fernando Jannaut and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Overview

FtIn: Basic Math in feet-inches

FtIn is an HP 42s program that allows the four basic arithmetic operations (+, -, x, ÷) between numbers expressed in Feet, Inches and fractions (up to 1/256 of an inch).

Inside the program the math is performed in inches so the screen shows always in the upper line the results in Feet, Inches and fractions (up to 1/256 of an inch) and in the lower line, the result in inches and decimal fraction. The only exception is when you make a multiplication between two Ft-In distances to find an area; the program shows the result in ft2 and decimal fraction of ft2 in the upper line, and the same area but in in2 and decimal fraction of in2 in the lower line.

The total result of any math is always stored on Reg 00. By entering a distance (pressing XEQ ENT or XEQ F-IN) the contents of Reg 00 is replaced by this new value.

The number 7 on program line No. 19 means a maximum denominator of 2(7+1) = 256 which makes the program to work in n/256 of an inch. For example, by changing this number to a 3 the program will work in n/16 of an inch [2(3+1) = 16].

Program Labels:

The main program Labels are assigned to the upper line of keys as shown below
ENT    +    -    x    ÷    F-IN

USAGE:

  1. Before you start the program you must change the HP 42s display to Shift DISP ALL.
  2. To enter a distance in the program, first type in the Feet number (if this is 0 then type 0) and press ENTER, then type in the Inch number (if this is 0 then type 0) and press ENTER, then type in the fraction of an inch numerator (if this is 0 then type 0) and press ENTER, and finally type in the fraction of an inch denominator (if this is 0 then type 0) and then press EXQ ENT; the program will show in the upper line the total distance in Ft-in format and in the lower line the total distance in inches.

Example: Enter a distance of 15’-3 5/16”

Type    Press
15      ENTER
3       ENTER
5       ENTER
16      XEQ ENT: the display will show:

15’-3 5/16”
X: 183.3125

The lower line shows the distance in inches (183.3125 inches), now the program is ready to do some math with this distance.

  1. To enter a second distance, first type in the Feet number (if this is 0 then type 0) and press ENTER, then type in the Inch number (if this is 0 then type 0) and press ENTER, then type in the fraction of an inch numerator (if this is 0 then type 0) and press ENTER, and finally type in the fraction of an inch denominator (if this is 0 then type 0). By doing this you are ready to perform some math.
  2. To add (+) or subtract (-) the second number to the first one just press XEQ + or XEQ -, and the total result will be shown in the regular way.

Example: Enter a second distance of 4’-11” to be added to the first one

Type       Press
4       ENTER
11      ENTER
0       ENTER
0       XEQ +: the display will show:

20’-2 5/16”
X: 242.3125
The lower line shows the total distance in inches (242.3125 inches), and here the program is ready to do some more math with this distance.

It is possible to enter a distance in inches and decimal fraction of inches in the Stack register X and then represent it in the Ft-In format by pressing XEQ F-IN to initiate a new math operation.

Example: Enter a first distance of 71.25 inches.

Type    Press
71.25   XEQ F-IN: the display will show:

5’-11 1/4”
X: 71.25
The lower line shows the total distance in inches (71.25 inches), and here the program is ready to do some math with this distance. 5. To multiply (x) the first one by the second one just press XEQ x and the total result will be shown in ft2 and decimal fraction.

Example: Enter a second distance of 4’-11” to be multiplied to the first one

Type    Press
4       ENTER
11      ENTER
0       ENTER
0       XEQ x: the display will show:

29.19270833333  ft2
X: 4,203.75
The lower line shows the total in in2 (4203.75), and here the program is ready to do some math with this area.
  1. To divide (÷) the first one by the second one just press XEQ ÷, and the total result will be shown in the regular way.

Example: Enter the first distance (5’-11 1/4”) and then Enter a second distance of 4’-11” to divide the first one

Type       Press
5       ENTER
11      ENTER
1       ENTER
4       XEQ ENT: the display will show:

5’-11 1/4”
X: 71.25

4       ENTER
11      ENTER
0       ENTER
0       XEQ ÷: the display will show:

1’-2 125.830508475/256”
X: 14.4915254237

The line shows the total distance in the regular way using up to n/256 of a fraction of an inch. If the figure is too long to fit in the windows then it will scroll down to the lower line. To see the result in inches (14.4915254237) just press EXIT, and here the program is ready to do some math with this number.

  1. To add (+), subtract (-), multiply (x) or divide (÷) the first one by a round number just enter the round number and then press +, -, x or ÷ (using the arithmetic operators of the HP 42s), and the total result will be shown in inches, then to convert this to a f-in and fractions of an in just press XEQ F-IN, the result will be shown in the regular way.

Example: Enter a second number of 4 to divide the first one

Type       Press
5       ENTER
11      ENTER
1       ENTER
4       XEQ ENT: the display will show:

5’-11 1/4”
X: 71.25

4       ÷: the display will show 17.8125.
To convert this to f-in format, just press XEQ F-IN; the display will show:
1’-5 13/16”
X: 17.8125
The lower line shows the total distance in inches (17.8125 inches), and here the program is ready to do some more math with this distance.

And this is it. Please enjoy this useful routine as I do in my day by day work.

Registers usage:
R00     In.######...
R01     Ft
R02     In
R03     Numerator (in.######..)
R04     Denominator
R05     Exponent of 2
R06     Limit of denominator [2(n+1)]
R07     Used
Author: FERNANDO JANNAUT
Program version: 1.0
Documentation version: 1.0
May 7, 2009

Listing

00 { 247-Byte Prgm }
01>LBL 00
02 X≠0?
03 GTO 02
04 CLX
05 1
06>LBL 02
07 ÷
08 +
09 X⇔Y
10 12
11 ×
12 +
13 FS?C 01
14 +/-
15 RTN
16>LBL "F-In"
17 CF 01
18 STO 07
19 7
20 STO 06
21 X⇔Y
22 X<0?
23 SF 01
24 ABS
25 12
26 ÷
27 IP
28 STO 01
29 12
30 ×
31 RCL 07
32 ABS
33 -
34 +/-
35 IP
36 STO 02
37 RCL 07
38 ABS
39 RCL 01
40 12
41 ×
42 RCL 02
43 +
44 -
45 STO 03
46 0
47 STO 05
48>LBL 03
49 RCL 06
50 RCL 05
51 X>Y?
52 GTO 04
53 RCL 03
54 ENTER
55 IP
56 X=Y?
57 GTO 04
58 2
59 STO× 03
60 1
61 STO+ 05
62 GTO 03
63>LBL 04
64 RCL 03
65 0.49999
66 +
67 IP
68 2
69 RCL 05
70 yx
71 STO 04
72 RCL 01
73 RCL 02
74 RCL 03
75 R↑
76 GTO "Ent"
77>LBL "÷"
78 XEQ 00
79 RCL 00
80 X⇔Y
81 ÷
82 12
83 ×
84 STO 00
85 GTO "F-In"
86>LBL "×"
87 XEQ 00
88 RCL 00
89 ×
90 STO 00
91 144
92 ÷
93 CLA
94 ARCL ST X
95 ⊢" ft2"
96 RCL 00
97 AVIEW
98 STOP
99>LBL "-"
100 XEQ 00
101 RCL 00
102 X⇔Y
103 -
104 STO 00
105 GTO "F-In"
106>LBL "+"
107 XEQ 00
108 RCL 00
109 +
110 STO 00
111 GTO "F-In"
112>LBL "Ent"
113 CLA
114 FS? 01
115 ⊢"-"
116 ARCL ST T
117 ⊢"'-"
118 ARCL ST Z
119 X⇔Y
120 X=0?
121 GTO 01
122 ⊢" "
123 ARCL ST X
124 ⊢"/"
125 ARCL ST Y
126>LBL 01
127 ⊢"""
128 X⇔Y
129 XEQ 00
130 STO 00
131 AVIEW
132 .END.

Go back to the software library
Go back to the main exhibit hall