ThomasSpeedrunner

New Macros

Oct 12th, 2014
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; make org safer (impossible to overwrite previously assembled bytes) and count padding
  2. org macro address
  3.     if notZ80(MOMCPU)
  4.         if address < *
  5.             if assembleZ80SoundDriver
  6.                 error "too much stuff before org $\{address} ($\{(*-address)} bytes)"
  7.             else
  8.                 error "too much stuff before org $\{address} ($\{(*-address)} bytes) ... try setting assembleZ80SoundDriver=1 in the asm file"
  9.             endif
  10.         elseif address > *
  11. paddingSoFar    set paddingSoFar + address - *
  12.             !org address
  13.         endif
  14.     endm
  15.  
  16. ; define the cnop pseudo-instruction
  17. cnop macro offset,alignment
  18.         org (*-1+(alignment)-((*-1+(-(offset)))#(alignment)))
  19.     endm
Advertisement