Calling asm func from C in IAR EW2.31C

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone

I'm trying to call an asm function from C source without success. Do I make some mistake? In the attachment there are the project files.

Many thanks

Have a nice day

Pippo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Pippo,

My 8051 IAR compiler puts a lot more assembler stuff around its assembler functions that are to be integrated with a C source. It looks like you are missing all the assembler defines and setups so the linker can match this function to the IAR C calling convention.

Did you read the chapter in the manual regarding interfacing C and assembler? The recommended, simplest way is to create a dummy function in C with all the input parameters and return value, compile this and then modify the generated assembler code. I haven't had any trouble doing it that way.

Dennis

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone

I found the way: the option "Disable embedded C++ syntax" (Project->Options->ICCAVR->Language) was not set.

Thanks

Have a nice day

Pippo