From 0d79685ba7f91a5624fbdb130cd348ace5c34ba9 Mon Sep 17 00:00:00 2001 From: spth Date: Wed, 1 Apr 2009 19:13:27 +0000 Subject: [PATCH] Minor Z80 multiplication improvement git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5422 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 +++++ device/lib/z80/mul.s | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1cbf384e..9805da8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-01 Philipp Klaus Krause + + * device/lib/z80/mul.s: + Minor improvement in Z80 16x16 bit multiplication. + 2009-03-23 Borut Razem * src/SDCCval.c, src/SDCCmain.c, device/include/limits.h, diff --git a/device/lib/z80/mul.s b/device/lib/z80/mul.s index b54fd9d7..cba10dfe 100644 --- a/device/lib/z80/mul.s +++ b/device/lib/z80/mul.s @@ -33,15 +33,14 @@ __mulint_rrx_hds:: ;; ;; Register used: AF,BC,DE,HL __mul16:: - ld hl,#0 + ld l,#0 ld a,b - ; ld c,c ld b,#16 ;; Optimise for the case when this side has 8 bits of data or ;; less. This is often the case with support address calls. or a - jr NZ,1$ + jr NZ,2$ ld b,#8 ld a,c @@ -49,11 +48,12 @@ __mul16:: ;; Taken from z88dk, which originally borrowed from the ;; Spectrum rom. add hl,hl +2$: rl c rla ;DLE 27/11/98 - jr NC,2$ + jr NC,3$ add hl,de -2$: +3$: djnz 1$ ret -- 2.30.2