Learner Learner - 1 year ago 162
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?

Answer Source

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

 _asm("MOV $00500A,#$3");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download