Hi
A couple minor errors in typing. See changes:
Hi
The ADD HL,H was a mistake. It should have been ADD HL,HL.
Here is my loopless and conditional less version:
; divides 0-799 by 10
; hl is input dividend
; a= qoutient
; h=remainder
add hl,hl
add hl,hl
add hl,de
add hl,hl
ld b,h
ld c,l
add hl,hl
add hl,hl
add hl,bc
add hl,de
ld a,h ; add little more accuracy
add a,#16d ; tweak value
ld c,a
ld b,#0
add hl,bc
ld a,h ; quo*2
rra ; quo=a
ld l,a
ld c,a
ld h,b
add hl,hl
add hl,hl
add hl,bc
add hl,hl ; quo*10 to calc Remainder
ex de,hl
sbc hl,de ; l= remainder
ret
230 clock cycles and no conditionals
Dwight
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008
_________________________________________________________________
Connect and share in new ways with Windows Live.