diff --git a/host/src/routines/arithmatic/div.s b/host/src/routines/arithmatic/div.s index 64d5c02..447fd61 100644 --- a/host/src/routines/arithmatic/div.s +++ b/host/src/routines/arithmatic/div.s @@ -39,5 +39,6 @@ R_neg: ; R < 0 LSR count BNE for_i for_i_end: + TXA RTS .endproc diff --git a/host/src/routines/arithmatic/div_test.s b/host/src/routines/arithmatic/div_test.s index 2cd0a32..d904295 100644 --- a/host/src/routines/arithmatic/div_test.s +++ b/host/src/routines/arithmatic/div_test.s @@ -15,16 +15,14 @@ LDY #(j+1) STY VAL_B JSR div ; A = VAL_A / VAL_B, clobers X. - CPX #i/(j+1) + CMP #i/(j+1) BEQ :+ jmp error : .endrepeat .endrepeat - TXA jmp end error: - TXA ;; Error make screen read ;; X * Y has the result in A that is wrong. LDX #$02 diff --git a/host/src/routines/arithmatic/div_test_zero.s b/host/src/routines/arithmatic/div_test_zero.s index 6e2509a..870a5d8 100644 --- a/host/src/routines/arithmatic/div_test_zero.s +++ b/host/src/routines/arithmatic/div_test_zero.s @@ -12,7 +12,7 @@ JSR div ; A = VAL_A / VAL_B, clobers X. .endrepeat paint: - ;; Donw make screen green - LDA #$13 + ;; Done, make screen green + LDA #$05 STA $D020 .endscope