1

I'm programming STM8 micro controller in STVD. 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?

GShaik
  • 197
  • 1
  • 17
Learner
  • 13
  • 4
  • Is [tag:gcc] your compiler? Isn't [Cosmic](http://www.cosmic-software.com/stm8.php) your current compiler? If so, use its manual... – LPs Sep 26 '16 at 06:17
  • I'm using cosmic compiler. In it's manual I couldn't find – Learner Sep 26 '16 at 06:21
  • Well, looking at the [tag:gcc] one is not the solution... ;) Look at [this link](http://cosmic-software.com/manuals.php).... – LPs Sep 26 '16 at 06:24

1 Answers1

2

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

 _asm("MOV $00500A,#$3");
GShaik
  • 197
  • 1
  • 17