home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tiger Disk 111
/
Tiger_Disk_111_20xx_Tiger-Crew-Disk_de_Side_B.d64
/
hexmon
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
1KB
|
43 lines
0 poke53280,11:poke53281,11
1 print"[147] 64 hexmon by c. phillips
5 [153]" type h & address to convert to decimal.
6 print" type the address to view contents in hex.
7 [153]" type d & address to view in decimal.
8 print" hit <return> for next block."
9 date$="today"
10 y=16:z=32
20 deffnmd(x)=int(x-int(int(x/y)*y))
30 h$="0123456789abcdef":goto220
40 input"address";a$
50 ifa$="end"ora$="bye"ora$="e"thenprint:print,"off at ";ti$:end
52 if left$(a$,1)="d"then110
54 if left$(a$,1)="c"then160
56 if left$(a$,1)="h"then180
58 if a$="sys"then20
60 a=val(a$):fori=atoa+zstep8:d=i
70 hx$="":gosub250:printhx$;tab(7)
80 forj=itoi+7
90 printmid$(h$,fnmd(peek(j)/16)+1,1);mid$(h$,fnmd(peek(j))+1,1);" ";
100 nextj:print:nexti:a$=str$(i):goto40
110 a=val(right$(a$,len(a$)-1))
120 fori=atoa+zstep8
130 printi;:l=1:forj=itoi+7step2
135 printtab(l*8);:l=l+1
140 printpeek(j)+peek(j+1)*256;:nextj
150 print:nexti:a=i:a$="d"+str$(a):goto40
160 a=val(right$(a$,len(a$)-1))
170 fori=atoa+199:printchr$(peek(i));:next:a$="c"+str$(i):goto40
180 j=len(a$):d=0:fori=2toj:k=1
190 ifmid$(h$,k,1)<>mid$(a$,i,1)thenk=k+1:goto190
200 d=d+(k-1)*16^(j-i):nexti
210 printchr$(17)tab(20);"=";d:a$=str$(d):goto40
220 printtab(8);
225 printdate$;spc(3);left$(ti$,2);":";mid$(ti$,3,2);":";right$(ti$,2)
230 print:print:goto40
250 rem **** long hex from decimal ****
260 rem l=log(d)/log(16):rem log(d) base 16
265 rem for m=int(l) to 0 step-1
270 form=3to0step-1
280 hx$=hx$+mid$(h$,fnmd(d/16^m)+1,1)
290 nextm:y=16:return