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
Solved! Go to Solution.
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
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
Hello Bigmac:
I have solved my problem. Thanks for your help!
Best Regards.
Liuyu