[Prev][Next][Index][Thread]

Re: A85: 16-bit integer Square Root (few changes)





just a small modification on the shift hl part... it wouldn't get shifted
properly the way it was... my changes start with ;&&& 

On Sun, 15 Mar 1998, Humberto Yeverino wrote:
<snip>
> >  Anyways here it is:
> >  Sqrt16:	
> 
> **   push hl ;if you want to save hl 
> 
> >    push de
> >    push bc
> >    ld de,0
> >    ld bc,0
> >    call CP_HL_DE
> >    jr z,Sqrt16Done  ;0 is a special case.
> >    ld de,65280
> >    ld bc,256
> >    sbc hl,de
> >    jr nc,Sqrt16done
> >    dec bc           ;bc=255

;&&& few changes I'd make:


;&&& remove this : > >    scf
;&&& change the order:
; shift hl
rr l
rr h
jr nc, noSet
set 7, l
noSet:
<snip>
rest of code ...

Erik Huizing
ehuizing@acs.ucalgary.ca
http://www.ucalgary.ca/~ehuizing



Follow-Ups: References: