What is the largest single file that can be loaded into a C128 using standard Kernal functions (i.e., LOAD, DLOAD, BLOAD). Is it possible to load more than 64kB by overflowing to Bank 1?
2 Answers
The maximum size file that you can load with the built-in commands is 65280 bytes. This is using the address range of $0000-$FEFF for either BANK. There is no "wrap" ability to extend from bank 0 to 1.
All of the BASIC commands (LOAD, DLOAD, BLOAD) rely on the kernal ILOAD code. The limitation is that the ILOAD code will not continue loading once it reaches a destination address >$FF00.
The source code tracks this using the variable eah.
What is the largest single file that can be loaded into a C128 using standard Kernal functions (i.e., LOAD, DLOAD, BLOAD).
LOAD and DLOAD load only as many bytes as given by the file information. In addition they only work reliably with Bank0 and paged in Kernal (*1).
BLOAD, by contrast, can load up to 65535 bytes (one less than 64 KiB) into any bank. So while loading into bank 0 is still restricted by other RAM usage and ROM(s) mapped in, loading to any other (RAM) Bank will let you use up to 64 KiB minus 1.
Is it possible to load more than 64kB by overflowing to Bank 1?
No. The C128 does not manage its banks in a continuous manner. Each is a separate 64 KiB address space with no inherent relation to any other.
*1 - Making the RAM writable doesn't really help, as hitting any hardware register will break it - especially hitting the MMU ($FF00).
-
3After reading Brian's answer and trying a BLOAD beyond area $FF00 I think your estimation with 65535 bytes needs to be corrected to 256 bytes less.Peter B.– Peter B.2021-01-10 22:44:20 +00:00Commented Jan 10, 2021 at 22:44
-
@PeterB. Right , it stops at $FF00. But the command accepts a length of up to 65535Raffzahn– Raffzahn2021-01-10 23:06:17 +00:00Commented Jan 10, 2021 at 23:06