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 >
Commodore BASIC  |  2023-02-26  |  1KB  |  43 lines

  1. 0 poke53280,11:poke53281,11
  2. 1 print"[147]        64 hexmon by c. phillips
  3. 5 [153]"  type h & address to convert to          decimal.
  4. 6 print"  type the address to view contents       in hex.
  5. 7 [153]"  type d & address to view in             decimal.
  6. 8 print"  hit <return> for next block."
  7. 9 date$="today"
  8. 10 y=16:z=32
  9. 20 deffnmd(x)=int(x-int(int(x/y)*y))
  10. 30 h$="0123456789abcdef":goto220
  11. 40 input"address";a$
  12. 50 ifa$="end"ora$="bye"ora$="e"thenprint:print,"off at ";ti$:end
  13. 52 if left$(a$,1)="d"then110
  14. 54 if left$(a$,1)="c"then160
  15. 56 if left$(a$,1)="h"then180
  16. 58 if a$="sys"then20
  17. 60 a=val(a$):fori=atoa+zstep8:d=i
  18. 70 hx$="":gosub250:printhx$;tab(7)
  19. 80 forj=itoi+7
  20. 90 printmid$(h$,fnmd(peek(j)/16)+1,1);mid$(h$,fnmd(peek(j))+1,1);" ";
  21. 100 nextj:print:nexti:a$=str$(i):goto40
  22. 110 a=val(right$(a$,len(a$)-1))
  23. 120 fori=atoa+zstep8
  24. 130 printi;:l=1:forj=itoi+7step2
  25. 135 printtab(l*8);:l=l+1
  26. 140 printpeek(j)+peek(j+1)*256;:nextj
  27. 150 print:nexti:a=i:a$="d"+str$(a):goto40
  28. 160 a=val(right$(a$,len(a$)-1))
  29. 170 fori=atoa+199:printchr$(peek(i));:next:a$="c"+str$(i):goto40
  30. 180 j=len(a$):d=0:fori=2toj:k=1
  31. 190 ifmid$(h$,k,1)<>mid$(a$,i,1)thenk=k+1:goto190
  32. 200 d=d+(k-1)*16^(j-i):nexti
  33. 210 printchr$(17)tab(20);"=";d:a$=str$(d):goto40
  34. 220 printtab(8);
  35. 225 printdate$;spc(3);left$(ti$,2);":";mid$(ti$,3,2);":";right$(ti$,2)
  36. 230 print:print:goto40
  37. 250 rem **** long  hex from decimal ****
  38. 260 rem l=log(d)/log(16):rem log(d) base    16
  39. 265 rem for m=int(l) to 0 step-1
  40. 270 form=3to0step-1
  41. 280 hx$=hx$+mid$(h$,fnmd(d/16^m)+1,1)
  42. 290 nextm:y=16:return
  43.