From 851926b301dfef17c3e56237d95dca41d0317834 Mon Sep 17 00:00:00 2001 From: uz Date: Wed, 4 Nov 2009 18:17:00 +0000 Subject: [PATCH] Add C callable special multiplication routines. git-svn-id: svn://svn.cc65.org/cc65/trunk@4440 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/Makefile | 236 +++++++++++++++--------------- libsrc/common/cc65_imul16x16r32.s | 24 +++ libsrc/common/cc65_umul16x16r32.s | 24 +++ 3 files changed, 167 insertions(+), 117 deletions(-) create mode 100644 libsrc/common/cc65_imul16x16r32.s create mode 100644 libsrc/common/cc65_umul16x16r32.s diff --git a/libsrc/common/Makefile b/libsrc/common/Makefile index 381742fdf..7b0864280 100644 --- a/libsrc/common/Makefile +++ b/libsrc/common/Makefile @@ -80,123 +80,125 @@ C_OBJS = _afailed.o \ timezone.o # From assembly source-files -S_OBJS = _cwd.o \ - _environ.o \ - _fdesc.o \ - _file.o \ - _fopen.o \ - _heap.o \ - _heapadd.o \ - _heapblocksize.o\ - _heapmaxavail.o \ - _heapmemavail.o \ - _oserror.o \ - _printf.o \ - _seterrno.o \ - _swap.o \ - _sys.o \ - abs.o \ - atexit.o \ - atoi.o \ - calloc.o \ - cc65_sincos.o \ - chdir.o \ - copydata.o \ - creat.o \ - ctime.o \ - divt.o \ - errno.o \ - fclose.o \ - fmisc.o \ - fopen.o \ - fprintf.o \ - fread.o \ - free.o \ - fscanf.o \ - fwrite.o \ - getcpu.o \ - getcwd.o \ - getenv.o \ - isalnum.o \ - isalpha.o \ - isblank.o \ - iscntrl.o \ - isdigit.o \ - isgraph.o \ - islower.o \ - isprint.o \ - ispunct.o \ - isspace.o \ - isupper.o \ - isxdigit.o \ - itoa.o \ - labs.o \ - longjmp.o \ - ltoa.o \ - malloc.o \ - maperrno.o \ - memchr.o \ - memcmp.o \ - memcpy.o \ - memmove.o \ - memset.o \ - mkdir.o \ - modfree.o \ - modload.o \ - oserrcheck.o \ - printf.o \ - putchar.o \ - putenv.o \ - rand.o \ - raise.o \ - remove.o \ - rename.o \ - rmdir.o \ - scanf.o \ - searchenv.o \ - setjmp.o \ - signal.o \ - sigtable.o \ - snprintf.o \ - sprintf.o \ - sscanf.o \ - strcat.o \ - strchr.o \ - strcmp.o \ - strcoll.o \ - strcpy.o \ - strcspn.o \ - strdup.o \ - strerror.o \ - stricmp.o \ - strlen.o \ - strlower.o \ - strncat.o \ - strncmp.o \ - strncpy.o \ - strnicmp.o \ - stroserr.o \ - strpbrk.o \ - strrchr.o \ - strspn.o \ - strstr.o \ - strtoimax.o \ - strtoumax.o \ - strupper.o \ - time.o \ - tolower.o \ - toupper.o \ - uname.o \ - ungetc.o \ - unlink.o \ - utscopy.o \ - vfprintf.o \ - vfscanf.o \ - vprintf.o \ - vscanf.o \ - vsnprintf.o \ - vsprintf.o \ - vsscanf.o \ +S_OBJS = _cwd.o \ + _environ.o \ + _fdesc.o \ + _file.o \ + _fopen.o \ + _heap.o \ + _heapadd.o \ + _heapblocksize.o \ + _heapmaxavail.o \ + _heapmemavail.o \ + _oserror.o \ + _printf.o \ + _seterrno.o \ + _swap.o \ + _sys.o \ + abs.o \ + atexit.o \ + atoi.o \ + calloc.o \ + cc65_imul16x16r32.o \ + cc65_sincos.o \ + cc65_umul16x16r32.o \ + chdir.o \ + copydata.o \ + creat.o \ + ctime.o \ + divt.o \ + errno.o \ + fclose.o \ + fmisc.o \ + fopen.o \ + fprintf.o \ + fread.o \ + free.o \ + fscanf.o \ + fwrite.o \ + getcpu.o \ + getcwd.o \ + getenv.o \ + isalnum.o \ + isalpha.o \ + isblank.o \ + iscntrl.o \ + isdigit.o \ + isgraph.o \ + islower.o \ + isprint.o \ + ispunct.o \ + isspace.o \ + isupper.o \ + isxdigit.o \ + itoa.o \ + labs.o \ + longjmp.o \ + ltoa.o \ + malloc.o \ + maperrno.o \ + memchr.o \ + memcmp.o \ + memcpy.o \ + memmove.o \ + memset.o \ + mkdir.o \ + modfree.o \ + modload.o \ + oserrcheck.o \ + printf.o \ + putchar.o \ + putenv.o \ + rand.o \ + raise.o \ + remove.o \ + rename.o \ + rmdir.o \ + scanf.o \ + searchenv.o \ + setjmp.o \ + signal.o \ + sigtable.o \ + snprintf.o \ + sprintf.o \ + sscanf.o \ + strcat.o \ + strchr.o \ + strcmp.o \ + strcoll.o \ + strcpy.o \ + strcspn.o \ + strdup.o \ + strerror.o \ + stricmp.o \ + strlen.o \ + strlower.o \ + strncat.o \ + strncmp.o \ + strncpy.o \ + strnicmp.o \ + stroserr.o \ + strpbrk.o \ + strrchr.o \ + strspn.o \ + strstr.o \ + strtoimax.o \ + strtoumax.o \ + strupper.o \ + time.o \ + tolower.o \ + toupper.o \ + uname.o \ + ungetc.o \ + unlink.o \ + utscopy.o \ + vfprintf.o \ + vfscanf.o \ + vprintf.o \ + vscanf.o \ + vsnprintf.o \ + vsprintf.o \ + vsscanf.o \ zerobss.o diff --git a/libsrc/common/cc65_imul16x16r32.s b/libsrc/common/cc65_imul16x16r32.s new file mode 100644 index 000000000..331e2189b --- /dev/null +++ b/libsrc/common/cc65_imul16x16r32.s @@ -0,0 +1,24 @@ +; +; Ullrich von Bassewitz, 2010-11-03 +; +; CC65 library: 16x16 => 32 signed multiplication +; + + .export _cc65_imul16x16r32 + .import imul16x16r32, popax + .importzp ptr1 + + +;--------------------------------------------------------------------------- +; 16x16 => 32 signed multiplication routine. + + +.proc _cc65_imul16x16r32 + + sta ptr1 + stx ptr1+1 + jsr popax + jmp imul16x16r32 + +.endproc + diff --git a/libsrc/common/cc65_umul16x16r32.s b/libsrc/common/cc65_umul16x16r32.s new file mode 100644 index 000000000..84c71538f --- /dev/null +++ b/libsrc/common/cc65_umul16x16r32.s @@ -0,0 +1,24 @@ +; +; Ullrich von Bassewitz, 2010-11-03 +; +; CC65 library: 16x16 => 32 unsigned multiplication +; + + .export _cc65_umul16x16r32 + .import umul16x16r32, popax + .importzp ptr1 + + +;--------------------------------------------------------------------------- +; 16x16 => 32 unsigned multiplication routine. + +.proc _cc65_umul16x16r32 + + sta ptr1 + stx ptr1+1 + jsr popax + jmp umul16x16r32 + +.endproc + + -- 2.39.5