32 lines
1.5 KiB
Markdown
32 lines
1.5 KiB
Markdown
# ROM applications
|
|
|
|
Applications in this directory execute directly from ROM; the reset bootstrap
|
|
does not copy them. Each application must have its own non-overlapping `ORG`
|
|
below `8000` and should include `bios.inc` from the project's `include`
|
|
directory instead of accessing the UART hardware directly.
|
|
|
|
The current allocation is:
|
|
|
|
- `1000-180C`: Tiny BASIC
|
|
- `180D-7FFF`: available for more applications (`1900` is the next convenient
|
|
aligned origin)
|
|
|
|
The resident BIOS and monitor own high RAM at `C000-FFFF`. Tiny BASIC owns
|
|
`8000-BFFF` for its workspace and stack. A future application may reuse Tiny
|
|
BASIC's lower-RAM allocation because ROM applications run one at a time, but it
|
|
must leave `C000-FFFF` untouched.
|
|
|
|
Applications using the interrupt-driven console must leave interrupt mode 2,
|
|
the `I` register, and the BIOS UART/CTC configuration intact. They may return
|
|
normally if they preserve the caller's stack, or jump to `BIOS_MONITOR` for a
|
|
non-returning monitor warm start after replacing the stack pointer.
|
|
|
|
Use `BIOS_BANK` and `BIOS_ROM_DISABLE` for the write-only banking latch rather
|
|
than writing port `00` directly. The BIOS keeps the ROM-disable state when the
|
|
RAM bank selection changes. A ROM application must not expect a normal `RET`
|
|
after it maps out the ROM containing its return address.
|
|
|
|
To add an application, add its assembler target and ROM offset to the Makefile,
|
|
overlay its binary in the `monitor.prog.bin` recipe, and add a monitor command
|
|
or use `G address` to launch it.
|