git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5040
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2008-02-22 Philipp Klaus Krause <pkk AT spth.de>
+
+ * device/lib/z80/mul.s: Rewrote __muluchar_rrx_s, to improve 8-bit mult.,
+ implements #1896290.
+
2008-02-22 Maarten Brock <sourceforge.brock AT dse.nl>
* src/SDCCast.c (createIvalStruct): fixed bug 1466761
- ;; Originally from GBDK by Pascal Felber.
+ .area _CODE
- .area _CODE
+; This multiplication routine is similar to the one
+; from Rodnay Zaks, "Programming the Z80".
+
+__muluchar_rrx_s::
+ ld hl, #2
+ add hl, sp
+ ld e, (hl)
+ inc hl
+ ld h, (hl)
+ ld l, #0
+ ld d, l
+ ld b, #8
+muluchar_rrx_s_loop:
+ add hl, hl
+ jr nc, muluchar_rrx_s_noadd
+ add hl, de
+muluchar_rrx_s_noadd:
+ djnz muluchar_rrx_s_loop
+ ret
+
+;; Originally from GBDK by Pascal Felber.
__mulschar_rrx_s::
ld hl,#2
jp .mul16
-__muluchar_rrx_s::
- ld hl,#2
- add hl,sp
-
- ld e,(hl)
-
- inc hl
- ld c,(hl)
-
- ;; Clear the top
- xor a
- ld d,a
- ld b,a
-
- jp .mul16
-
__mulint_rrx_s::
ld hl,#2
add hl,sp