Fastest Divide by 6
Re: Fastest Divide by 6
ohh thanks
-
- Drutt
- Posts: 17
- Joined: Sat Dec 09, 2017 9:07 pm
Re: Fastest Divide by 6
That's faster:
Code: Select all
LD H, 0
LD D, H ; DE = HL
LD E,A
ADD A,A
LD L,A
ADD HL, HL ; x04
ADD HL, DE ; x05
ADD HL, HL ; x10
ADD HL, HL ; x20
ADD HL, DE ; x21
ADD HL, HL ; x42
ADD HL, DE ; x43
Ast A. Moore wrote: ↑Sun Dec 31, 2017 6:52 pm Well, if your range is up to 77, then this will be 3 T states faster (dividend goes into A):
Code: Select all
LD H, 0 LD D, H ; DE = HL ld e,a add a,a ld l,a ADD HL, HL ; x04 ADD HL, DE ; x05 ADD HL, HL ; x10 ADD HL, DE ; x11 ADD HL, HL ; x22 ADD HL, HL ; x44 SBC HL, DE ; x43