Core Commit: C56F3C7 (mega65info shows an extra digit: C56F3C78)
Describe the bug
Saving memory with BSAVE causes subsequent Load/Verify/Save commands using BSMON to fail. The upper 2 bytes of the address saved persist and are applied to the BSMON commands.
This will actually break any usage of the KERNAL LOAD or SAVE functions if those callers do not manually set specific zero page locations before making the call. BSMON is just the easiest way to demonstrate the fact that BSAVE isn't cleaning up after itself.
To Reproduce
Save some high memory location using BSAVE
BSAVE"BS2",P($8000000) TO P($8000010)
Enter the Monitor
Load that same file (or any file really) to a location below $FFFF (I have another bug I'll be filing soon to deal with BSMON load/save issues to addresses over $FFFF).
L"BS2",8 8000
Inspect memory to see that the memory stored into the file was not loaded to the address specified:
M8000 8010
Inspect memory at the address it was actually loaded (use the higher 2 bytes from the BSAVE command):
M8008000 8008010
Expected behavior
Addresses used by BSAVE should have no impact on future calls the KERNAL Load and Save functions.
Screenshots
Bad behavior:
Expected behavior:
Additional context
BLOAD doesn't have this issue because it clears the higher bytes of EAL (the zero page location used to store the load address). BSAVE should do this for SAL and EAL (the start and end addresses), but it doesn't.
Test Environment (required)
Describe the bug Saving memory with BSAVE causes subsequent Load/Verify/Save commands using BSMON to fail. The upper 2 bytes of the address saved persist and are applied to the BSMON commands.
This will actually break any usage of the KERNAL LOAD or SAVE functions if those callers do not manually set specific zero page locations before making the call. BSMON is just the easiest way to demonstrate the fact that BSAVE isn't cleaning up after itself.
To Reproduce
Save some high memory location using BSAVE
Enter the Monitor
Load that same file (or any file really) to a location below $FFFF (I have another bug I'll be filing soon to deal with BSMON load/save issues to addresses over $FFFF).
Inspect memory to see that the memory stored into the file was not loaded to the address specified:
Inspect memory at the address it was actually loaded (use the higher 2 bytes from the BSAVE command):
Expected behavior Addresses used by BSAVE should have no impact on future calls the KERNAL Load and Save functions.
Screenshots Bad behavior:
Expected behavior:
Additional context BLOAD doesn't have this issue because it clears the higher bytes of EAL (the zero page location used to store the load address). BSAVE should do this for SAL and EAL (the start and end addresses), but it doesn't.