home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1990 May
/
1990-05.d64
/
dec2hex
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
295b
|
7 lines
5 print"[147]":poke53280,14:poke53281,6:poke646,14
10 h$="0123456789abcdef":b=16:b1=2^b:rem b is number of bits
20 print"convert a decimal number into":print"its hexadecimal equivalent"
30 input"enter decimal value";n:ifabs(n)>b1-1then30
40 n$="":ifn<0thenn=b1+n
50 fori=1tob/4:t=n-(int(n/16)*16):n$=mid$(h$,t+1,1)+n$:n=n/16:nexti:printn$