home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1990 December / 64er_Magazin_90-12_1990_Markt__Technik_de_Side_A.d64 / hexadezim.zahlen (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  659b  |  30 lines

  1. 10 print"[147]":rem umrechnung dezimalzahl in hexzahl
  2. 20 print"umrechnung dezimalzahl in hexzahl"
  3. 30 print"*********************************"
  4. 40 print:input" dezimalzahl";d
  5. 50 s=int(d/16)
  6. 60 r=d-s*16
  7. 70 ifr<=9thenh$=chr$(r+48)+h$
  8. 80 ifr>9thenh$=chr$(r+55)+h$
  9. 90 ifs>15thend=s:goto50
  10. 100 ifs=0then130
  11. 110 ifs<=9thenh$=chr$(s+48)+h$
  12. 120 ifs>9thenh$=chr$(s+55)+h$
  13. 130 print:print" hexzahl="h$
  14. 140 print:h$="":goto40
  15. 160 :
  16. 170 :
  17. 200 print"[147]":rem umrechnung hexzahl in dezimalzahl
  18. 210 print"umrechnung hexzahl in dezimalzahl"
  19. 220 print"*********************************"
  20. 230 print:input" hexzahl";h$
  21. 240 l=len(h$)
  22. 250 fori=lto1step-1
  23. 260 s=asc(mid$(h$,i,1))
  24. 270 ifs<60thend=d+(s-48)*16^e
  25. 280 ifs>60thend=d+(s-55)*16^e
  26. 290 e=e+1
  27. 300 nexti
  28. 310 print:print" dezimalzahl="d
  29. 320 d=0:e=0:goto230
  30.