]> git.sur5r.net Git - cc65/commitdiff
Added a few more specialized multiply routines
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 16 Mar 2002 20:27:50 +0000 (20:27 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 16 Mar 2002 20:27:50 +0000 (20:27 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1193 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/runtime/Makefile
libsrc/runtime/mulax6.s [new file with mode: 0644]
libsrc/runtime/mulax7.s [new file with mode: 0644]
libsrc/runtime/mulax9.s [new file with mode: 0644]

index fdb7fc650db4e7706cd6061916b33a1daa1f72ec..45a7d1ad6c394a2b8a08856ab525deb5feab2e74 100644 (file)
@@ -131,6 +131,9 @@ OBJS =      add.o           \
                mul.o           \
        mulax3.o        \
        mulax5.o        \
+       mulax6.o        \
+       mulax7.o        \
+       mulax9.o        \
        mulax10.o       \
                ne.o            \
                neg.o           \
diff --git a/libsrc/runtime/mulax6.s b/libsrc/runtime/mulax6.s
new file mode 100644 (file)
index 0000000..e5e3503
--- /dev/null
@@ -0,0 +1,30 @@
+;
+; Ullrich von Bassewitz, 16.03.2002
+;
+; CC65 runtime: Multiply the primary register
+;
+
+       .export         mulax6
+       .importzp       ptr1
+
+.proc  mulax6
+
+       sta     ptr1
+       stx     ptr1+1
+       asl     a
+       rol     ptr1+1
+       clc
+       adc     ptr1
+       pha
+       txa
+       adc     ptr1+1
+       sta     ptr1+1
+       pla
+       asl     a
+       rol     ptr1+1
+       ldx     ptr1+1
+       rts
+
+.endproc
+
+
diff --git a/libsrc/runtime/mulax7.s b/libsrc/runtime/mulax7.s
new file mode 100644 (file)
index 0000000..b7ce28c
--- /dev/null
@@ -0,0 +1,32 @@
+;
+; Ullrich von Bassewitz, 16.03.2002
+;
+; CC65 runtime: Multiply the primary register
+;
+
+       .export         mulax7
+       .importzp       ptr1, tmp1
+
+.proc  mulax7
+
+       sta     ptr1
+       stx     ptr1+1
+       stx     tmp1
+       asl     a
+       rol     tmp1                    ; * 2
+       asl     a
+       rol     tmp1                    ; * 4
+       asl     a
+       rol     tmp1                    ; * 8
+       sec
+       sbc     ptr1
+       pha
+       lda     tmp1
+       sbc     ptr1+1                  ; * (8 - 1)
+       tax
+       pla
+       rts
+
+.endproc
+
+
diff --git a/libsrc/runtime/mulax9.s b/libsrc/runtime/mulax9.s
new file mode 100644 (file)
index 0000000..037f5e7
--- /dev/null
@@ -0,0 +1,32 @@
+;
+; Ullrich von Bassewitz, 16.03.2002
+;
+; CC65 runtime: Multiply the primary register
+;
+
+       .export         mulax9
+       .importzp       ptr1, tmp1
+
+.proc  mulax9
+
+       sta     ptr1
+       stx     ptr1+1
+       stx     tmp1
+       asl     a
+       rol     tmp1                    ; * 2
+       asl     a
+       rol     tmp1                    ; * 4
+       asl     a
+       rol     tmp1                    ; * 8
+       clc
+       adc     ptr1                    ; * (8+1)
+       pha
+       lda     tmp1
+       adc     ptr1+1
+       tax
+       pla
+       rts
+
+.endproc
+
+