make divition return to A, because compiler.

This commit is contained in:
hugova 2025-08-01 00:32:53 +02:00
parent be13c298c7
commit 2a3db7876f
3 changed files with 4 additions and 5 deletions

View file

@ -39,5 +39,6 @@ R_neg: ; R < 0
LSR count LSR count
BNE for_i BNE for_i
for_i_end: for_i_end:
TXA
RTS RTS
.endproc .endproc

View file

@ -15,16 +15,14 @@
LDY #(j+1) LDY #(j+1)
STY VAL_B STY VAL_B
JSR div ; A = VAL_A / VAL_B, clobers X. JSR div ; A = VAL_A / VAL_B, clobers X.
CPX #i/(j+1) CMP #i/(j+1)
BEQ :+ BEQ :+
jmp error jmp error
: :
.endrepeat .endrepeat
.endrepeat .endrepeat
TXA
jmp end jmp end
error: error:
TXA
;; Error make screen read ;; Error make screen read
;; X * Y has the result in A that is wrong. ;; X * Y has the result in A that is wrong.
LDX #$02 LDX #$02

View file

@ -12,7 +12,7 @@
JSR div ; A = VAL_A / VAL_B, clobers X. JSR div ; A = VAL_A / VAL_B, clobers X.
.endrepeat .endrepeat
paint: paint:
;; Donw make screen green ;; Done, make screen green
LDA #$13 LDA #$05
STA $D020 STA $D020
.endscope .endscope