Mixing ASM and C.Error:C18107: Illegal Operands

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mixing ASM and C.Error:C18107: Illegal Operands

Jump to solution
853 Views
Tianshu
Contributor I

Hi:

     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

Labels (1)
0 Kudos
1 Solution
522 Views
bigmac
Specialist III

Hello Liu Yu,

 

Inline assembly code has some syntax differences from normal assembly code, found in an asm file.  Try

 

    ldx OSTCBCur:1;

.

Regards,

Mac

 

View solution in original post

0 Kudos
2 Replies
523 Views
bigmac
Specialist III

Hello Liu Yu,

 

Inline assembly code has some syntax differences from normal assembly code, found in an asm file.  Try

 

    ldx OSTCBCur:1;

.

Regards,

Mac

 

0 Kudos
522 Views
Tianshu
Contributor I

Hello Bigmac:

        I have solved my problem. Thanks for your help!

        Best  Regards.

Liuyu

0 Kudos