Hi guys, I need to improve this code, so far I got this result (using standard Z80 times, not M1 times).
Tem goal is to divide by 16 the value on H register (ideally not destroying HL, nor DE registers):
; ; divide by 16 (32 cycles) ; srl h ; srl h ; srl h ; srl h ; ; divide by 16 (27 cycles) ; ld a, h ; and 1111 0000 b ; rrca ; rrca ; rrca ; rrca ; divide by 16 (18 cycles) ld b, base_addr_div_by_16_LUT ld c, h ld a, (bc)
The third one needs a 256-bytes Look Up Table with all values pre-loaded (it also needs to be address aligned to 0x00 on low byte).
Speed is more crucial here than size.
Is there a best solution?
!login ou Inscrivez-vous pour poster