AnsweredAssumed Answered

Mixing ASM and C.Error:C18107: Illegal Operands

Question asked by Liu Yu on Mar 11, 2011
Latest reply on Mar 11, 2011 by Liu Yu


     I'm trying to mix assember and C code in a c file:

interrupt void OSTickISR(){  OSIntEnter();  if ( OSIntNesting == 1 )  {     asm {       pshh;       tsx;       pshx;       pshh;       ldx OSTCBCur;       pshx;       ldx OSTCBCur+1; ; this line got ERROR: C18107       pulh;       pula;       sta 0,x;       pula;       sta 1,x;      }    }   OSTimeTick();   EnableInterrupts;   OSIntExit();}

 When I compiled this code, I got one error, ERROR: C18107: Illegal operands at the 11th line. I have define OSTCBCur as a pointer. Why do I get this error?  Thank you.

 Beset regards.

Liu Yu