Problem compiling .asm file

I am trying to implement a task switcher on my Tiva C launchpad (ARM Cortex-M4F)

I need to write an assembly module to handle saving some of the MCU registers, however I have no idea what the convention is for writing the assembly function I need. Below is a link to a screenshot of my assembly function and the errors I am getting:

I have the function already declared elsewhere in the project's files, so I thought I would be able to refer to it using the EXTERN keyword, but I get the error: Error[4]: Bad instruction

I also am getting the error: Error[4]: Unexpected end of file encountered which I am not sure is related to the first error, or if I need to add something else to the end of the code.

Could anyone here help me understand how I can get this assembly function to compile with the rest of my project?

  • Hi,

    Were you able to find a solution to your issue?

    RenesasRulz Forum Moderator
  • This thread will be archived due to inactivity.

    Mike Clements
    RenesasRulz Moderator
  • I have exactly the same problem. Worse still, I solved it a few years a go, but don't remember the solution.
  • In reply to John:

    Do you use IAR EWARM or EWSYN?
    My proposal would be to have a new C file with an empty C function, tell the compiler to generate an assembler file, and use this as base for your assembler file.
    The file in the original post missed all section declarations, probably missed the end command at the end of the assembler file, and the extern declaration should be in the C file that tries to use this assembler function.