Mark Ashby

[CW6.1] Inline ASM

Discussion created by Mark Ashby on May 8, 2006
Latest reply on Sep 7, 2006 by Roberto Dario
How can I compile inline assembly without the following error?
 
Error  : illegal use of asm inline function
List.cpp line 172        or.l    d2,d0;
 
The error seems to be related to the "or.l" instruction.  If I replace with "ori.l #" then it works.  Could the compiler/assembler have an issue with the keyword "or"?
 
Here is the code from list.cpp around line 172.
 
extern "C" {
  void DisableInt(WORD);
  void EnableInt(void);
}
void DisableInt(WORD wIntMask)
{
  asm
  {
   move.w   sr, d0;
   move.w   d0, -(a7);
   move.w   wIntMask, d2
   or.l     d2, d0;
   move.w   d0, sr;
  }
}
void EnableInt(void)
{
  asm
  {
   move.w (a7)+, d0;
   move.w d0, sr;
  }
}

Outcomes