home *** CD-ROM | disk | FTP | other *** search
/ Commodore 64 Scene Diskmags Assortment / Vision_02_19xx_Vision_Side_C.d64 / ldfile.b (.txt) next >
Commodore BASIC  |  2023-02-26  |  877b  |  49 lines

  1. 0 rem mozart sat11dec93
  2. 1 rem load a file in basic
  3. 2 :
  4. 4 il%=10:a$="":a=0:lo=0
  5. 5 dv=peek(186):ze$=chr$(0):fi$=""
  6. 6 en=0:em$="":et=0:es=0
  7. 9 :
  8. 10 close15:open15,dv,15:close15
  9. 11 if st=0 then20
  10. 12 print"[150][196]evice not present"
  11. 13 goto90
  12. 19 :
  13. 20 open15,dv,15:rem command channel
  14. 29 :
  15. 30 input"[159][198]ilename to load[158]";fi$
  16. 31 if len(fi$)<1 then30
  17. 32 fi$=fi$+",p"
  18. 39 :
  19. 40 open il%,dv,0,fi$:rem input channel
  20. 41 gosub1000:rem check drive channel
  21. 42 if en>19 and en<>73 then90
  22. 43 :
  23. 44 print"[159][204]oading file ... [158]";fi$;"[159]"
  24. 49 :
  25. 50 gosub1100:rem input a byte
  26. 51 lo=a:rem lo byte header address
  27. 52 gosub1100
  28. 53 lo=lo+(256*a):rem hi byte
  29. 59 :
  30. 60 gosub1100
  31. 61 poke lo,a:rem process byte first
  32. 62 lo=lo+1
  33. 63 if st=0 then60:rem test later
  34. 69 :
  35. 90 print"[159]":close il%:close 15
  36. 91 clr:end:rem exit
  37. 99 :
  38. 1000 rem drive channel i/o check
  39. 1010 input#15,en,em$,et,es
  40. 1020 if en<20 or en=73 then return
  41. 1030 print"[150]";en;em$;et;es
  42. 1040 return
  43. 1099 :
  44. 1100 rem input a byte
  45. 1110 get#il%,a$
  46. 1120 a=asc(a$+ze$)
  47. 1130 return
  48. 1199 :
  49.