HEXDEC converter for 33E/33C Message #1 Posted by Glenn Hayhurst on 3 May 2006, 10:02 a.m.
Here is a program that I wrote several years ago and just found recently. I posted it to the museum curator, but it has not been posted in the programs section yet.
Best Wishes all,
Glenn

Program for the HP 33E and HP33C
HEX to DECIMAL
DECIMAL to HEX
by: Glenn Hayhurst  Longmont CO
This program will convert DECIMAL numbers
in the range of 065535 to their HEX
equivalents.
It will also convert HEX numbers in the
range of 0FFFF to their DECIMAL equivalents.
Program Listing
Key Display
_______________
ENTER 0131
RCL 5 0224 5
/ 0371
g INT 0432
STO 1 0523 1
RCL 5 0624 5
* 0761
 0841
ENTER 0931
ENTER 1031
RCL 6 1124 6
/ 1271
g INT 1315 32
STO 2 1423 2
RCL 6 1524 6
* 1661
 1741
ENTER 1831
ENTER 1931
RCL 7 2024 7
/ 2171
g INT 2215 32
STO 3 2323 3
RCL 7 2424 7
* 2561
 2641
g INT 2715 32
STO 0 2823 0
RCL 1 2924 1
f PAUSE 3014 74
RCL 2 3124 2
f PAUSE 3214 74
RCL 3 3324 3
f PAUSE 3414 74
RCL 0 3524 0
GTO 00 3613 00
RCL 1 3724 1 <Entry point for H>D conversion
RCL 5 3824 5
* 3961
STO + 0 4023 51 0
RCL 2 4124 2
RCL 6 4224 6
* 4361
STO + 0 4423 51 0
RCL 3 4524 3
RCL 7 4624 7
* 4761
STO + 0 4823 51 0
RCL 0 4924 0

Enter the program, then store these three
values that are used in the calculations.
4096 STO 5
256 STO 6
16 STO 7

Before running the program for the first
time, hit g RTN. This sets the program
to step 00.

Example:
To convert from DECIMAL to HEX:
43961 ENTER (stores value in Y register)
R/S (run program)
The display will pause with four numbers.
These numbers appear in the order of the
hex value.
10 11 11 9 (Display shows)
A B B 9 (Hex Value)

Example:
To convert from HEX to DECIMAL:
Store the hex values in the following
registers.
I.E. ( HEX ) A B B 9
(DEC equiv) 10 11 11 9
10 STO 1
11 STO 2
11 STO 3
9 STO 0
Then: GSB 37 (entry point for H>D conversion)
The program will run converting the values stored
in registers 1, 2, 3, 0 to a decimal value that is
left in the X register (display).
Answer: 43961

Number conversion table:
HEX DECIMAL
 
0 0
1 1
2 2
... ...
9 9
A 10
B 11
C 12
D 13
E 14
F 15

Registers used:
R0 HEX digit
R1 HEX digit
R2 HEX digit
R3 HEX digit
R4 unused
R5 4096 fixed value for program
R6 256 fixed value for program
R7 16 fixed value for program
Edited: 3 May 2006, 10:12 a.m. after one or more responses were posted
