Multiply A * 48

Pagina 3/3
1 | 2 |

Van Micha

Supporter (15)

afbeelding van Micha

24-03-2021, 14:49

The last ld l,a can be left out, winning another 5 cycles...

ld l,a
add a,a  ; *2
add a,l  ; *3
add a,a  ; *6
ld h,0
 ld l,a 
add hl,hl  ; *12
add hl,hl  ; *24
add hl,hl  ; *48

Van Micha

Supporter (15)

afbeelding van Micha

24-03-2021, 15:27

Micha wrote:

The last ld l,a can be left out, winning another 5 cycles...

Of course it cannot be left out... never mind

Van RvS

Resident (49)

afbeelding van RvS

24-03-2021, 21:23

Grauw wrote:

I can’t fathom why the Z80 engineers would make complex special instructions like RLD / RRD, rather than implement something useful like stack-relative indexing or even nibble swapping. I guess BCD support was a big thing for processor marketing in the 70s.

Fully agree! These rld/rrd instructions are weird

Van Metalion

Paragon (1375)

afbeelding van Metalion

24-03-2021, 22:31

Nibble swapping would have been a great help ...

Pagina 3/3
1 | 2 |