View Single Post
Old 09 August 2016, 17:33   #36
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
Quote:
Originally Posted by Mrs Beanbag View Post
Well ok, but it's also not just about memory used by the code but about time wasted reading instructions to execute. And a word-read doesn't cost less than a longword-read on 68020+, so...
A word doesn't cost less than a longword to read, but it costs more space in the dcache. So if the table gets read repetitively, it has better be small.


Quote:
Originally Posted by Mrs Beanbag View Post
But anyway, supposing we had instruction that did this in 4 bytes:
Code:
  add.w d16(An),An
  jmp (An)
and it would be nice not to have to trash An while doing it.
But there, d16 is a constant.
Did you mean, rather :
Code:
 add.w (An,Dn.w*2),An
 jmp (An)
In that case it would even be better to replace :
Code:
 lea table(pc),An
 add.w (An,Dn.w*2),An
 jmp (An)
By :
Code:
 jmpt table(pc),Dn
meynaf is offline  
 
Page generated in 0.04459 seconds with 11 queries