From: dkelvey at
hotmail.com
To: cctalk at
classiccmp.org
Date: Fri, 25 Jan 2008 07:30:26 -0800
Subject: RE: Z80 Divide by 10
> To: cctalk at
classiccmp.org
>
> From: dwight elvey:
>
> Well, you've got me confused.
>
> HL = dividend (Dnd)
>
>> ld d,h
>> ld e,l ; DE=Dnd
>> add hl,hl ; HL=Dnd*2
>> add hl,hl ; HL=Dnd*4
>> add hl,de ; HL=Dnd*5
>> add hl,hl ; HL=Dnd*10
>> ld b,h
>> ld c,l ; BC=Dnd*10
>> add hl,hl ; HL=Dnd*20
>> add hl,hl ; HL=Dnd*40
>> add hl,bc ; HL=Dnd*50
>> add hl,de ; HL=Dnd*51
> ; At this point, HL=0-41000
>> ld a,h ; A=HIGH(Dnd*51)
>> rra ; A=HIGH(Dnd*51)2
I forgot to correct this comment. ; A=Dnd*51/512 or about 1/10
Dwight
_________________________________________________________________
Need to know the score, the latest news, or you need your Hotmail?-get your
"fix".