From 68b61f4c8cea540d89537be56c05f1a9edc03536 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sun, 6 Oct 2019 17:06:42 +0200 Subject: [PATCH] provided LINKPRG routine --- STATUS.md | 2 +- c64/basic/a533.linkprg.s | 91 ++++++++++++++++++++++++++++++++++++++-- c64/basic/cmd_load.s | 86 +------------------------------------ c64/kernal/f4a5.load.s | 2 +- 4 files changed, 91 insertions(+), 90 deletions(-) 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 #