Re: A85: a div 6


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

Re: A85: a div 6




On Sun, 29 Nov 1998, Humberto Yeverino wrote:
> Here's a faster way:
> 
> DivBy6:
>   ld b,6
>   ld c,%00100000
>   ld d,%11000000
>   ld h,0
> DivBy6Loop:
>   cp d
>   jr c,DB6_AisLess
>   sub a,d		;subtract
> DB6_AisLess:
    ccf
    rl h
>   srl d
>   djnz DivBy6Loop
>   ret			;h=a/6 and a=remainder
> 
Oops, should have looked at my old routines first...

-Humberto Yeverino Jr.

"I kick ass for the Lord."
-Dead Alive (1992)

***********************************************************
Home Page:                                               
  http://www.engr.csufresno.edu/~humberto/Home.html      

Ti Page:                                                 
  http://www.engr.csufresno.edu/~humberto/tex.html       

z80 Source Page:                                         
  http://www.engr.csufresno.edu/~humberto/z80source.html 

Official Tyrant Home Page:                              
  http://www.engr.csufresno.edu/~humberto/tyrant.html    

E-mail:                                                  
  humberto@engr.csufresno.edu                            
***********************************************************


References: