User Tools

Site Tools


vbasic_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
vbasic_tutorial [2021/01/25 13:14] – [Initialisation] silverdrvbasic_tutorial [2022/12/04 12:01] (current) – [Transferring VASYL data] silverdr
Line 226: Line 226:
 > OK but what if my data is larger than the 4KiB available at 49152??  > OK but what if my data is larger than the 4KiB available at 49152?? 
  
-The answer is either you find a buffer large enough to hold all your data at once or you need to ''LOAD'' the data in chunks not larger than the available buffer. I would strongly recommend the latter approach - split the file into as many smaller ones as needed and then ''LOAD'' and ''COPY'' them one by one. This will always work regardless of the size of your BASIC program.+The answer is either you find a buffer large enough to hold all your data at once or you need to ''LOAD'' it in chunks not larger than the available buffer. I would strongly recommend the latter approach - split the file into as many smaller ones as needed and then ''LOAD'' and ''COPY'' them one by one. This will always work regardless of the size of your BASIC program.
  
 > But wouldn't it be much better to simply ''OPEN'' the file and read its content byte by byte and use ''VPOKE'' to send it to VASYL? > But wouldn't it be much better to simply ''OPEN'' the file and read its content byte by byte and use ''VPOKE'' to send it to VASYL?
Line 236: Line 236:
  
   - adapt the way you handle data transfer to VASYL memory to the amount of data you need to move there   - adapt the way you handle data transfer to VASYL memory to the amount of data you need to move there
-  - it does not pay to ''LOAD'' a few bytes. Using DATA or ''VDATA'' will be more efficient and less error-prone+  - it does not pay to ''LOAD'' a few bytes. Using ''DATA'' or ''VDATA'' will be more efficient and less error-prone
   - when dealing with large amounts of data, the most efficient way is to ''LOAD'' it in chunks not larger than the available buffer size. Up to 4KiB in practice   - when dealing with large amounts of data, the most efficient way is to ''LOAD'' it in chunks not larger than the available buffer size. Up to 4KiB in practice
   - steer clear of using memory areas other than the 4KiB of free RAM available at $c000. You'll thank me once we meet :-)   - steer clear of using memory areas other than the 4KiB of free RAM available at $c000. You'll thank me once we meet :-)
vbasic_tutorial.1611609260.txt.gz · Last modified: 2021/01/25 13:14 by silverdr