Learner Learner - 6 months ago 63
C Question

Assembly instruction in STVD IDE for STM8 microcontroller

I'm programming

micro controller in
. I happen to use an assembly instruction in the middle of code. As shown here

I used a instruction as below

asm("MOV $00500A,#$3");

But I'm facing with following error

#error cpstm8 ..\app\sched.c:183(5) missing prototype

Can anyone help me in fixing this?


For STM8 assembly instruction, you need to use _ before the instruction as shown below

 _asm("MOV $00500A,#$3");