From c9869c1a26a5be1f3e3c789ed31e56568fa69059 Mon Sep 17 00:00:00 2001 From: IrgendwerA8 Date: Wed, 25 Jul 2018 22:38:29 +0200 Subject: [PATCH] Quick fix for missing _div() adaptation after 95223be. --- libsrc/common/divt.s | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libsrc/common/divt.s b/libsrc/common/divt.s index b532f6f95..f1291c86f 100644 --- a/libsrc/common/divt.s +++ b/libsrc/common/divt.s @@ -18,10 +18,12 @@ .importzp sreg, ptr1, tmp1 _div: jsr tosdivax ; Division-operator does most of the work - sta sreg ; Quotient is in sreg - stx sreg+1 - lda ptr1 ; Unsigned remainder is in ptr1 - ldx ptr1+1 + lda sreg ; Unsigned remainder is in sreg + ldx sreg+1 + ldy ptr1 ; transfer quotient to sreg + sty sreg + ldy ptr1+1 + sty sreg+1 ; Adjust the sign of the remainder. ; It must be the same as the sign of the dividend. -- 2.39.5