Atari 400 Basic Reference Manual page 115

Vintage computer
Hide thumbs Also See for 400:
Table of Contents

Advertisement

DECIMAL/
HEXADECIMAL
CONVERSION
PROGRAM
H-18 Appendix
This program
can
be typed in and used
to
convert
hexadecimal numbers
to
decimal numbers and vice versa.
10 DIM A$(9),ADS(1)
H:::; I
Ot·t::"
:
?
30
?
=?
"Enter·
'D'
fm··
DEC to HE:=<
r:r:rn•.
) er·
si!)n.
11
:?
HEnt.et-·
'H'
fC~r-·
HE: : - = :
t.£:' [;EC
!:CJnt.,.te
r·s ion . "
=
HlF'UT A$
40 IF LHV A$
:
:
•=(1
THE~;
30
50 IF A$=HHH
THEt-~
3eO
60 IF A:t<
>"D!'
THEii 30
90 TPAP 90
10(1
~?"
=
?
u
ENTEP A DEC
I f·1AL
f·~Ut·1E:E~~
FROt·1
(;
TH~:OUGH
9999999999
.
"
110
·?
"DEC:
II,;
;
H4PUT t·i
12ft IF
t·~<~3 f)F.~
N>=1E+10
THEr·~
GOTC! 1e0
13t1
!=9
140
TH1F·=t-~
=
t·i=
IrH<
t~
.
...-16
>
150 TEi·1P= TEi-1?
-t·f:i::
16
160 IF TEt-1F<
W
THErl
A$(
I_,
I
>=::;TF.:$(
TH1F
>:
G
DTO 180
170
At(
I, I
>
=CHP:tt::
Tt:J1F'-10+A:
: ;u: "A"
> >
1
!3(1
IF
f{:::
>0
THEf·~
I=
I -1
: GOTO
14~)
19lf
"?
11
HE>:
:
:
11
.i
A$(I
.f
9
)
:?
2ft0 GC;TO 110
30£t TRAF 30t1
310
?
UGH
=?
uENTE~~
A
HE>::
NJ1·
1 E:EP
F~~Oi·1
~J
THf?C
FFFFFFFF . ''
320
·-::
·
"HE:=·::
=
!I
;
:
INPUT A$
33(1
t4=0
34(1 FOj:;: I=1 TO LEH( AS>
345
AD$=;~$(
I.: I)
:
IF AO:t<
11
0'!
THEF·~
30(1
350
IF AJ\ I
. .
I
)
:
:
:
=
"9"
iHEr~
r·l=t·i::i::
16+!...!~11-
(
AD:t
>
:
GOTC~
37(1
355 IF
AD:t<
II
A
!I
THEt-i 300
357
IF
AD:t>"F
11
THEii
3€10
360
t·4=t·t:;:
:
16+r:r:;C(
AD$
) -A3C\
H
A
i!
)+
1
(1
370
t·~E>::T
I
380
?
"DEC
=
";N:?
390
t:;OTO
32(1
40fl
Ef.iD

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

800

Table of Contents