]> git.sur5r.net Git - cc65/commitdiff
Added additional entry points that clear the high word of the right operand.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 15 Aug 2009 20:58:35 +0000 (20:58 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 15 Aug 2009 20:58:35 +0000 (20:58 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4023 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/runtime/ladd.s
libsrc/runtime/ldiv.s
libsrc/runtime/lmod.s
libsrc/runtime/lmul.s
libsrc/runtime/lsub.s
libsrc/runtime/lumod.s

index a68583e765b264b177addacadcba7d6f30b531df..4e864c79727ac354e770711b6b70c2f2414329a7 100644 (file)
@@ -4,7 +4,7 @@
 ; CC65 runtime: long add
 ;
 
-       .export         tosaddeax
+       .export         tosadd0ax, tosaddeax
        .import         addysp1
        .importzp       sp, sreg, tmp1
 
 
 ; EAX = TOS + EAX
 
+tosadd0ax:
+        ldy     #$00
+        sty     sreg
+        sty     sreg+1
+
 tosaddeax:
        clc
 .if (.cpu .bitand CPU_ISET_65SC02)
index cbbf78aa7a1714c243ecd125ec6b960c17f5c711..3d8dda0d5bd4a0ee60cc869f702d35006b290e42 100644 (file)
@@ -7,9 +7,14 @@
 ; When negating values, we will ignore the possibility here, that one of the
 ; values if $80000000, in which case the negate will fail.
 
-               .export         tosdiveax
-       .import         poplsargs, udiv32, negeax
-       .importzp       ptr1, tmp1, tmp2
+               .export         tosdiv0ax, tosdiveax
+       .import         poplsargs, udiv32, negeax
+       .importzp       sreg, ptr1, tmp1, tmp2
+
+tosdiv0ax:
+        ldy     #$00
+        sty     sreg
+        sty     sreg+1
 
 tosdiveax:
                jsr     poplsargs       ; Get arguments from stack, adjust sign
index ab3d8c0b79d26b3fbdb2ebbab6f8f79c5884fbc6..89826ba842783700495da823b1de58fdec554f27 100644 (file)
@@ -7,11 +7,16 @@
 ; When negating values, we will ignore the possibility here, that one of the
 ; values if $8000, in which case the negate will fail.
 
-               .export         tosmodeax
+               .export         tosmod0ax, tosmodeax
        .import         poplsargs, udiv32, negeax
        .importzp       sreg, ptr1, ptr2, tmp1, tmp3, tmp4
 
-tosmodeax:
+tosmod0ax:
+        ldy     #$00
+        sty     sreg
+        sty     sreg+1
+
+tosmodeax:                         
                jsr     poplsargs       ; Get arguments from stack, adjust sign
        jsr     udiv32          ; Do the division, remainder is in (ptr2:tmp3:tmp4)
 
index 1a909a3d64d370449e395f875630bb1f5e53318b..44a46b5aaa994563afa4d19593412795b66bf759 100644 (file)
@@ -4,10 +4,16 @@
 ; CC65 runtime: multiplication for long (unsigned) ints
 ;
 
-               .export         tosumuleax, tosmuleax
+               .export         tosumul0ax, tosumuleax, tosmul0ax, tosmuleax
        .import         addysp1
        .importzp       sp, sreg, tmp1, tmp2, tmp3, tmp4, ptr1, ptr3, ptr4
 
+tosmul0ax:
+tosumul0ax:
+        ldy     #$00    
+        sty     sreg
+        sty     sreg+1
+
 tosmuleax:
 tosumuleax:
 mul32: sta     ptr1
index 2ade75e2e9475604a60c505ee4f3539143db5d81..30ae49da173eda0753ff20be0face7860233cd5c 100644 (file)
@@ -7,12 +7,17 @@
 ;
 ; EAX = TOS - EAX
 ;
-       .export         tossubeax
-       .import         addysp1
-       .importzp       sp, sreg
+       .export         tossub0ax, tossubeax
+       .import         addysp1
+       .importzp       sp, sreg
 
         .macpack        cpu
 
+tossub0ax:
+        ldy     #$00
+        sty     sreg
+        sty     sreg+1
+
 tossubeax:
        sec
        eor     #$FF
index 00f5e7353361fdd4b318250a4b7d09f946e290be..3128bc078afd2eb1ddd27f2f890a8ef5a28e7fd9 100644 (file)
@@ -4,10 +4,15 @@
 ; CC65 runtime: modulo operation for long unsigned ints
 ;
 
-               .export         tosumodeax
+               .export         tosumod0ax, tosumodeax
                .import         getlop, udiv32
                .importzp       sreg, tmp3, tmp4, ptr2
 
+tosumod0ax:                          
+        ldy     #$00
+        sty     sreg
+        sty     sreg+1
+
 tosumodeax:
        jsr     getlop          ; Get the paramameters
        jsr     udiv32          ; Do the division