From 42ad32b0cc79b2438499a22f235a04c768d94720 Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Tue, 15 Jul 2025 12:53:02 -0400 Subject: [PATCH] fix minor bug which also frees up r4 --- src/misc/50count.asm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/misc/50count.asm b/src/misc/50count.asm index 7cdefac..356884f 100644 --- a/src/misc/50count.asm +++ b/src/misc/50count.asm @@ -9,22 +9,23 @@ prog: imm6 0x1 load r0, r2 ; value to increment by - ; r1+r2=(r3 & r4) + ; r1+r2=r3 add ; add r1 + value - load r3, r4 ; over-write upper MSB to store a copy load r3, r2 ; store result in r2 imm6 0x32 load r0, r1 sub ; 50 - r2 = remainder + ; r3 (C) holds the difference between 50 and our result + imm6 prog.result beqz ; if r3 == 0 branch to [r0] - load r4, r1 + load r2, r1 imm6 prog.loop ba ; else, copy result to r1 and loop .result: - out r4 + out r2 halt \ No newline at end of file