This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I generated assembly code with Code Composer Studio to check its output and understand how it works.
However, when I try to add the compiled file into the project, it is full of errors. Am I missing something ?
What is the correct way to add ASM code ?
I attached the generated ASM file. I tried erasing everything but the function called function, but errors remain there.
It has .asm extension, isn't it recognizing it ?
Thank you.
That webpage is about creating Makefiles. I only found 3 entries on keyword asm, and they were not related.
Any other site ? A guide on ASM syntaxis would be also helpful.
Thank you.
Try this
This solutuion is referenced from https://students.cs.byu.edu/~cs224ta/references/HowTos/HowTo_SetupAsmProject.php
Hope this helps
Kishen
Looks like this is a full ASM project. I don't need that.
I need to add asm code, but I have C code too. What I really need is to create callable subroutines in ASM.
Also, I need the output to be ELF format.
Thanks.
Yes, I want both C and ASM subroutines, however, the problem is not how to call the subroutines.
I think I clearly explained it on the first post:
Jon Zarate said:hen I try to add the compiled file into the project, it is full of errors
The compiler is not accepting the ASM file that itself generated.
My ASM file is in the first post. You can try to use it in your own project and tell me if you get any errors.
Thank you.
I solved it. The problem was I was using same file names: main.c and main.asm.
Once changed them, all errors are gone. Here is the code that switches on the green led (4.7) on a MSP430-5529.
main.c
#include <msp430.h> extern int function (); int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer function (); return 0; }
subroutines.asm
.sect ".text:function" .clink .global function function: ;* --------------------------------------------------------------------------* OR.B #128,&PBDIR_H+0 ; [] OR.B #128,&PBOUT_H+0 RETA ; [] ; [] .global PBOUT_H .global PBDIR_H
Thanks.
**Attention** This is a public forum