From 9f5fd1e3821101ca40f2536e61fd88436898b4f5 Mon Sep 17 00:00:00 2001 From: 4am Date: Sun, 21 Nov 2021 15:34:44 -0500 Subject: [PATCH] unconditional branch wasn't always taken because stepptr doesn't always return with Z=0 --- src/okvs.a | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/okvs.a b/src/okvs.a index 3f02c067d..fa446aa9c 100644 --- a/src/okvs.a +++ b/src/okvs.a @@ -395,8 +395,11 @@ okvs_next_field +ST16 PTR okvs_next_field_PTR_is_already_set jsr stepptr - bne incptr - + jmp incptr ; do NOT change this to BNE + ; because if the low byte of PTR is 0 + ; and the value of (PTR) is also 0 + ; then stepptr will return with Z=1 and + ; we will fall through here unexpectedly incptr4 jsr incptr2 incptr2 jsr incptr incptr