Relocatable object and executable format #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "object-format"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR introduces the S7B binary file format, which is an object file format with multiple chunk types. The PR7 (executable) format is a subset of the object format: it may not contain any relocation chunks.
The CODE and BSS write loops wrote through the 2048-byte slot 2 window without detecting boundary overflow. Programs larger than ~1920 bytes (e.g. TinyBASIC at 4674 bytes) would spill from slot 2 (&2F:7F) into slot 3 (&30:00+), corrupting the FS scratch bank -- including the PR7 loader's own checksum and write-pointer variables. This caused checksum mismatches ("?") and dirty FS state ("Not found" on subsequent loads). Fix: detect when write pointer G crosses &30, remap slot 2 to the next sequential bank, and reset G to &20. Applied to both _pr7_code_loop and _pr7_bss_loop. Also fix the monitor error path for PR7 failures: close the open file and restore slots 2/3/4 before reporting the error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>