CALL/RTC trap: no PPAGE/DPAGE/EPAGE banking; 64 KiB flat address space only #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
CALLandRTC— the CPU12 instructions for calling subroutines in expanded(banked) memory — decode but trap (
M68HC12.cs:591-594). There is noimplementation of the program-page register
PPAGE(norDPAGE/EPAGEfordata), so the model is limited to a flat 64 KiB address space.
Current behavior
ComputeCallAddress(M68HC12.cs:878-891) fetches and discards the CALLoperand bytes (extended or indexed form plus the PPAGE operand byte) and never
applies the page. The
PAGEregister exists in the register set (index 8 inM68HC12Registers, exposed to GDB aspage) but is never read or written byany instruction.
Impact
CALL/RTCto reach code above 64 KiB cannot run.PPAGEfor bank switching aresilently wrong (register exists but is inert).
Affected files
src/Infrastructure/src/Emulator/Peripherals/Peripherals/CPU/M68HC12/M68HC12.cssrc/Infrastructure/src/Emulator/Peripherals/Peripherals/CPU/M68HC12/M68HC12Opcodes.cs(CALL hasCalloperand format already)platforms/cpus/m68hc12.replDesired behavior
CALL/RTC(and ideallyRTI) readand write.
CALLpushes a 5-byte frame (PC, thenPPAGE) and loads thepage operand into
PPAGE;RTCpopsPPAGEandPCand returns.PPAGE-selected 16 KiB window into the program address space so
FetchBytesees the banked code.
works; they require the data read/write path to consult the page registers.
Acceptance criteria
CALL/RTCno longer trap; round-tripCALL→ ... →RTCpreservescaller PC and restores the prior
PPAGE.PPAGEis observable/readable through the monitor and GDB (pageregister) and is restored by
RTC.PPAGE(a banked program executes from the selectedpage).
4A hh ll pg) and indexed form(
4B xb pg), RTC frame layout, and PPAGE restore on RTC.Suggested approach
window (a dedicated memory region remapped by the CPU) or make
FetchBytecompute a banked address. Prefer the former so data paths and Renode's
monitor/ELF loading agree.
follow-up issue.
docs/m68hc12/reference/M68HC12-EABI.txt) documents thememory-expansion layout.