From 854f23e945192e7c53b54a9b804e4f60db946e03 Mon Sep 17 00:00:00 2001 From: cuz Date: Sat, 16 Mar 2002 20:27:50 +0000 Subject: [PATCH] Added a few more specialized multiply routines git-svn-id: svn://svn.cc65.org/cc65/trunk@1193 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/runtime/Makefile | 3 +++ libsrc/runtime/mulax6.s | 30 ++++++++++++++++++++++++++++++ libsrc/runtime/mulax7.s | 32 ++++++++++++++++++++++++++++++++ libsrc/runtime/mulax9.s | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 libsrc/runtime/mulax6.s create mode 100644 libsrc/runtime/mulax7.s create mode 100644 libsrc/runtime/mulax9.s diff --git a/libsrc/runtime/Makefile b/libsrc/runtime/Makefile index fdb7fc650..45a7d1ad6 100644 --- a/libsrc/runtime/Makefile +++ b/libsrc/runtime/Makefile @@ -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 index 000000000..e5e350385 --- /dev/null +++ b/libsrc/runtime/mulax6.s @@ -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 index 000000000..b7ce28cff --- /dev/null +++ b/libsrc/runtime/mulax7.s @@ -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 index 000000000..037f5e76e --- /dev/null +++ b/libsrc/runtime/mulax9.s @@ -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 + + -- 2.39.5