Mixing ASM and C.Error:C18107: Illegal Operands

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Mixing ASM and C.Error:C18107: Illegal Operands

ソリューションへジャンプ
1,495件の閲覧回数
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 解決策
1,164件の閲覧回数
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 返答(返信)
1,165件の閲覧回数
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 件の賞賛
返信
1,164件の閲覧回数
Tianshu
Contributor I

Hello Bigmac:

        I have solved my problem. Thanks for your help!

        Best  Regards.

Liuyu

0 件の賞賛
返信