Inline Assembly and Operators

Cosmic's and this compiler's inline assembly may not support the same amount or level of operators. But in most cases it is simple to rewrite or transform them.

Listing: Accounting for different operators among different compilers


#ifdef __MWERKS__

  ldx #(BOFFIE + WUPIE) ; enable Interrupts

#else

  ldx #(BOFFIE | WUPIE) ; enable Interrupts

#endif

#ifdef __MWERKS__

  lda   #(_TxBuf2+Data0)

  ldx   #((_TxBuf2+Data0) / 256)

#else

  lda   #((_TxBuf2+Data0) & $ff)

  ldx   #(((_TxBuf2+Data0) >> 8) & $ff)

#endif