View Single Post
Old 05 February 2011, 00:02   #16
frank_b
Registered User
 
Join Date: Jun 2008
Location: Boston USA
Posts: 441
Code:
and.w #power of 2-1,d0
A quick way to get the remainder on a power of two div
Code:
      move.w x,d0
      and.w   #$f,d0   ; blitter shift value
It's a tad faster than a div.
Code:
       move.b  d0,-(sp)
       move.w (sp)+,d0  ; magic fast shift :)
Reduce system call overhead (not really relevant on the Amiga but cool on the ST)
If you call functions and pass params via the stack might be useful.

Code:
       move.w #something,-(sp)
       trap      #x


       move.w  #some other param,-(sp)
       trap       #x

       addq.l      #4,sp   ; clean up both params at once
Absolute short addressing to set ST IO registers. Don't try this on anything other than a vanilla 68k
Code:
      move.w    #val,$ffff8240.w
Relying on the cpu flags to avoid a compare
Code:
      move.l   somevar,d0
      beq.s     itiszero

itiszero
      blah blah blah

Last edited by frank_b; 29 July 2012 at 13:07. Reason: Added code tags
frank_b is offline  
 
Page generated in 0.04154 seconds with 11 queries