]> git.sur5r.net Git - cc65/commitdiff
Rename the 8x8 multiplication using the same scheme as for the 16x16
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 12 Nov 2009 15:48:11 +0000 (15:48 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 12 Nov 2009 15:48:11 +0000 (15:48 +0000)
multiplication.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4463 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/runtime/Makefile
libsrc/runtime/mul8x8r16.s [deleted file]
libsrc/runtime/umul8x8r16.s [new file with mode: 0644]

index a7c95970041ab7df2bb1401326adf723308a4939..7ab599219d34e4b75d2bf19fcce7f624f2e40361 100644 (file)
@@ -155,7 +155,6 @@ OBJS =      add.o           \
                mod.o           \
                mul.o           \
         mul8.o          \
-        mul8x8r16.o     \
        mulax3.o        \
        mulax5.o        \
        mulax6.o        \
@@ -222,6 +221,7 @@ OBJS =      add.o           \
         udiv32by16r16.o \
                umod.o          \
         umul16x16r32.o  \
+        umul8x8r16.o    \
                xor.o           \
         zeropage.o
 
diff --git a/libsrc/runtime/mul8x8r16.s b/libsrc/runtime/mul8x8r16.s
deleted file mode 100644 (file)
index a096181..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-;
-; Ullrich von Bassewitz, 2010-11-02
-;
-; CC65 runtime: 8x8 => 16 multiplication
-;
-
-               .export         umul8x8r16
-        .export         mul8x8r16 := umul8x8r16
-       .importzp       ptr1, ptr3
-
-
-;---------------------------------------------------------------------------
-; 8x8 => 16 multiplication routine.
-;
-;   lhs         rhs           result          result also in
-; -------------------------------------------------------------
-;   ptr1-lo     ptr3-lo         ax              ptr1
-;
-
-umul8x8r16:
-       lda     #0              ; Clear byte 1
-               ldy     #8              ; Number of bits
-        lsr     ptr1            ; Get first bit of lhs into carry
-@L0:    bcc     @L1
-        clc
-        adc     ptr3
-@L1:    ror
-        ror     ptr1
-        dey
-        bne     @L0
-        tax
-        stx     ptr1+1          ; Result in a/x and ptr1
-       lda     ptr1            ; Load the result
-       rts                     ; Done
-
diff --git a/libsrc/runtime/umul8x8r16.s b/libsrc/runtime/umul8x8r16.s
new file mode 100644 (file)
index 0000000..543110f
--- /dev/null
@@ -0,0 +1,37 @@
+;
+; Ullrich von Bassewitz, 2010-11-02
+;
+; CC65 runtime: 8x8 => 16 multiplication
+;
+
+               .export         umul8x8r16, umul8x8r16m
+       .importzp       ptr1, ptr3
+
+
+;---------------------------------------------------------------------------
+; 8x8 => 16 multiplication routine.
+;
+;   lhs         rhs           result          result also in
+; -------------------------------------------------------------
+;   ptr1-lo     ptr3-lo         ax              ptr1
+;
+
+umul8x8r16:
+        sta     ptr3
+umul8x8r16m:
+       lda     #0              ; Clear byte 1
+               ldy     #8              ; Number of bits
+        lsr     ptr1            ; Get first bit of lhs into carry
+@L0:    bcc     @L1
+        clc
+        adc     ptr3
+@L1:    ror
+        ror     ptr1
+        dey
+        bne     @L0
+        tax
+        stx     ptr1+1          ; Result in a/x and ptr1
+       lda     ptr1            ; Load the result
+       rts                     ; Done
+
+