diff --git a/STATUS.md b/STATUS.md index dd27dfb2..65edf246 100644 --- a/STATUS.md +++ b/STATUS.md @@ -76,7 +76,7 @@ Not all of them - only these we want to have implemented. | Address | Name | Status | Remarks | | :-------: | :----------- | :------: | :------------------------------------------------: | | `$A004` | revision str | DONE | | -| `$A533` | LINKPRG | NOT DONE | | +| `$A533` | LINKPRG | DONE | | | `$A659` | set txt ptr | NOT DONE | | | `$A68E` | RUNC | NOT DONE | | | `$A7AE` | NEWSTT | NOT DONE | | diff --git a/c64/basic/a533.linkprg.s b/c64/basic/a533.linkprg.s index b7b11e80..675a794e 100644 --- a/c64/basic/a533.linkprg.s +++ b/c64/basic/a533.linkprg.s @@ -1,6 +1,91 @@ -// XXX provide documentation and implementation -// see: https://www.lemon64.com/forum/viewtopic.php?t=64721&sid=bc400a5a6d404f8f092e4d32a92f5de7 +// +// Well-known BASIC routine, described in: +// +// - [CM64] Compute's Mapping the Commodore 64 - page 95 +// - https://www.lemon64.com/forum/viewtopic.php?t=64721&sid=bc400a5a6d404f8f092e4d32a92f5de7 +// LINKPRG: - STUB_IMPLEMENTATION() + + // Start by getting pointer to the first line + jsr init_oldtxt + +linkprg_loop: + // Is the pointer to the end of the program + ldy #1 + +#if CONFIG_MEMORY_MODEL_60K + ldx #