7

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 2

11

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.

2
  • so, for a program in BASIC area, this would be $1C01 - $FEFF ?
    – Peter B.
    Jan 10, 2021 at 22:33
  • 1
    @PeterB. Yep. That would be the limit for the DLOAD command.
    – Brian H
    Jan 11, 2021 at 0:35
3

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).

2
  • 3
    After 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.
    Jan 10, 2021 at 22:44
  • @PeterB. Right , it stops at $FF00. But the command accepts a length of up to 65535
    – Raffzahn
    Jan 10, 2021 at 23:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .