Page 1 of 1

13 - Decimal to Binary Converter

Posted: Sun Dec 13, 2020 12:33 am
by Peet
Usage:
LBL A: DEC -> BIN
LBL B: BIN -> DEC

Example:
12 <A> DEC-12= BIN-1100
10 <B> BIN-10= DEC-2

Code: Select all

LBL "D-B"
SF 27
"DEC-BIN"
PROMPT
LBL A
FIX 0
CF 29
"DEC-"
ARCL X
"|-="
AVIEW
1
STO 02
CLX
STO 03
RDN
LBL 00
1
X=Y?
GTO 01
RDN
ENTER
ENTER
2
/
INT
STO 05
2
*
-
RCL 02
*
ST+ 03
10
ST* 02
RCL 05
GTO 00
LBL 01
RCL 02
ST+ 03
RCL 03
"BIN-"
ARCL X
FIX 4
SF 29
PROMPT
LBL B
FIX 0
CF 29
"BIN-"
ARCL X
"|-="
AVIEW
STO 01
CLX 
STO 02
STO 03
LBL 03
RCL 01
10
/
ENTER 
ENTER
FRC
10
*
2
RCL 02
Y^X
*
ST+ 03
RDN
INT
STO 01
1
ST+ 02
RCL 02
10
X=Y?
GTO 04
GTO 03
LBL 04
RCL 03
"DEC-"
ARCL X 
FIX 4
SF 29
PROMPT
END