Mixing ASM and C.Error:C18107: Illegal Operands

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Mixing ASM and C.Error:C18107: Illegal Operands

跳至解决方案
838 次查看
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

标签 (1)
0 项奖励
1 解答
507 次查看
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 项奖励
2 回复数
508 次查看
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 项奖励
507 次查看
Tianshu
Contributor I

Hello Bigmac:

        I have solved my problem. Thanks for your help!

        Best  Regards.

Liuyu

0 项奖励