home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 4 #10 / Commodore_Disk_User_Vol.4_10_1991_-.d64 / loader2 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  601b  |  19 lines

  1. 1 rem *********************************
  2. 2 rem *     sample loader for data    *
  3. 3 rem *         with checksum         *
  4. 4 rem *********************************
  5. 5 rem
  6. 10 sa=49152:ea=50800:dt=16
  7. 20 printchr$(147)spc(14)"reading ml!"
  8. 30 fori=0todt-2:read d$:gosub 100
  9. 40 printchr$(19)chr$(17)chr$(17)chr$(17)"loading at:";sa+i
  10. 50 pokesa+i,d:ck=ck+d:next:readd$:gosub100:ck=ckand255
  11. 60 ifd<>ckthenprintchr$(17)"data error in line";peek(63)+256*peek(64):stop
  12. 70 sa=sa+dt-1:ck=0:ifsa<=eagoto30
  13. 80 printchr$(17)"finished!":end
  14. 100 rem d=val(d$):return
  15. 110 rem remove 'rem' from line 100 for decimal numbers
  16. 120 l=asc(right$(d$,1))-48:ifl>9thenl=l-7
  17. 130 h=asc(left$(d$,1))-48:ifh>9thenh=h-7
  18. 140 d=l+16*h:return
  19.