HP Forums

Full Version: Decimal to octal conversion for the HP-12C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Probably some of you are interested in mechanical calculators too. Watch this: http://www.youtube.com/watch?v=LGQTocT0Xr4

Therefore I tried to write a short program for the HP-12C this morning. Here it is.

Decimal to octal conversion on the HP-12C

01  STO 0
02 8
03 STO 1
04 0
05 RCL 0
06 X=0?
07 GTO 22
08 8
09 /
10 ENTER
11 INTG
12 STO 0
13 -
14 RCL 1
15 *
16 1
17 0
18 STO*1
19 RDN
20 +
21 GTO 05
22 RDN
23 GTO 00

Usage: Integer decimal number [R/S]


On the other hand, the stack registers are enough.

Decimal to octal conversion for the HP-12C ver.2.

01  0
02 X<>Y
03 8
04 X<>Y
05 X=0?
06 GTO 28
07 8
08 /
09 INTG
10 ENTER
11 RDN
12 RDN
13 LST X
14 FRAC
15 X<>Y
16 *
17 LST X
18 RDN
19 +
20 X<>Y
21 1
22 0
23 RDN
24 RDN
25 RDN
26 *
27 GTO 04
28 RDN
29 RDN
30 GTO 00

Usage: Integer decimal number [R/S]


Edited: 11 Nov 2009, 10:14 a.m.