View Single Post
Old 28 July 2021, 07:46   #6
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by mcgeezer View Post
Thanks - indeed this is 68000

That code won't assemble as I'm getting an out of range displacement.
the displacement must fit into 1 byte. Thus the code needs to be very close to the table.
used cycles: 4 + 14 = 18

the lea approach will work within a +-32k range
used cycles 8 + 4 + 14 = 26


If you end up putting that code into a subroutine...
... shift/add is faster (40 cycles), since bsr/rts eats the advantage up.
and the shift/add code can be inlined everywhere - ok, you need a scratch register...

... so if that is not available or size matters: use the mul ^^

Last edited by bebbo; 28 July 2021 at 10:05.
bebbo is offline  
 
Page generated in 0.06606 seconds with 11 queries