14 - Decimal to Hexadecimal Converter

Post Reply
Peet
Posts: 91
Joined: Tue Sep 29, 2020 12:01 am
Location: Germany

14 - Decimal to Hexadecimal Converter

Post by Peet »

HP41 Standard Applications (modified version)

Usage (User-Mode on):
<decimal value> <F> (X<>Y) converts <dec> to hexadecimal
alpha <hex value> alpha <F> (X<>Y) converts <hex> to decimal

Code: Select all

LBL "H-D"
GTO 11
LBL F
FS?C 22
CF 23
FS? 23
GTO 04
CLA 
ARCL X
"|- DEC="
AVIEW
STO 19
XEQ 08
+
LBL 01
LASTX
ISG 16
LBL 00
1 E2
/
INT
X#0?
GTO 01
CLA
LASTX
LBL 03
1 E2
*
ARCL IND X
FRC
DSE 16
GTO 03
SF 23
ASTO X
CLA
ARCL X
"|- HEX"
AVIEW
CLA
ARCL X
RTN
LBL 04
ASTO 16
"|- HEX="
AVIEW
.00802
STO 17
0
STO 19
LBL 05
0
STO 18
" "
ASTO Y
ARCL 16
ASTO 16
ASHF
ASTO X
X=Y?
GTO 08
CLA
ASTO Y
X=Y?
GTO 05
LBL 06
RCL IND 18
X=Y?
GTO 07
RDN
ISG 18
LBL 00
GTO 06
LBL 07
RCL 18
RCL 17
INT
10^X
*
ST+ 19
ISG 17
GTO 05
LBL 08
16
STO 18
1
STO 17
0
STO 16
1 E2
STO 20
FS? 23
GTO 09
RCL 18
X<> 20
STO 18
LBL 09
RCL 19
LBL 10
RCL 20
/
STO 19
FRC
RCL 20
*
RCL 17
*
ST+ 16
RCL 18
ST* 17
RCL 19
INT
X#0?
GTO 10
X<> 16
CLA
FC?C 23
RTN
CLA
ARCL X
"|- DEC"
PROMPT
LBL 11
FIX 0
SF 27
CF 29
CF 22
CF 23
"0"
ASTO 00
"1"
ASTO 01
"2"
ASTO 02
"3"
ASTO 03
"4"
ASTO 04
"5"
ASTO 05
"6"
ASTO 06
"7"
ASTO 07
"8"
ASTO 08
"9"
ASTO 09
"A"
ASTO 10
"B"
ASTO 11
"C"
ASTO 12
"D"
ASTO 13
"E"
ASTO 14
"F"
ASTO 15
"HEX-DEC"
AVIEW
END
Attachments
14_H-D_Hex-Dec.raw
(310 Bytes) Downloaded 10 times
My programmable calculators - former: CBM PR100, HP41CV, HP28S, HP11C - current: HP48G(+), HP35S, DM41X, DM42
Post Reply