From a6bcadab6effd7272db4fca3e43d2f9f016c83fa Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Sat, 12 Mar 2022 22:04:28 -0600 Subject: [PATCH] Fix bugs in sevenseg.s Fixed bug where we forgot to restore x in _hex_set_8 if the idx check fails. We did remember to restore it if the check passed. Fixed bug where _hex_set_24 did not return 0. --- sw/sevenseg.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sw/sevenseg.s b/sw/sevenseg.s index e915d59..6b9efc6 100644 --- a/sw/sevenseg.s +++ b/sw/sevenseg.s @@ -18,6 +18,7 @@ _hex_set_8: phx cmp #$3 ; If idx >= 3 then fail bcc @1 + plx lda #$1 rts @1: tax ; Move idx into x @@ -44,6 +45,7 @@ _hex_set_24: stx SEVEN_SEG+1 lda sreg sta SEVEN_SEG+2 + lda #$0 rts ; @in A: mask