Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

How do you add an assembly file to a Nios project?

I feel like a complete idiot because this should be easy. But I've spent a ton of time looking everywhere for the answer and am drawing blanks.

How do you add an assembly file (.asm) to a Nios project and get it to compile? Any .asm files I add are completely ignored when I build the project. I can inject complete gibberish in them and I don't get so much as a peep from the builder.

What is strange is that in my preferences, under file types, it shows an entry for .asm as being hooked up for assembly. But nothing happens to those files.

Thanks for any help,

-todd-

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    I think you have to use .s files instead of .asm[/b]

    --- Quote End ---

    I tried that, but then it complains that the .c file is missing. For example. "file.s" will result in the makefile complaining that it doesn&#39;t know how to make "file.c". That&#39;s because it only expects "file.s" *after* it has compiled "file.c" (.s is the intermediate filename for C/C++ code that&#39;s been converted to assembly).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    NiosII uses a stock (for the most part) GCC toolchain. Just doing a quick hunt on Google yields the answer. GCC is expecting .S, not .s.

    Cheers,

    - slacker
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    GCC is expecting .S, not .s.[/b]

    --- Quote End ---

    Ahhh, that&#39;s it! Thank you very much. I was going crazy because the IDE has references to .asm in the preferences section. I now know those are red herrings.

    VisualDSP from Analog Devices and VisualStudio from Microsoft both take .asm files, so I thought that&#39;s how you do it here. Now I know why none of my googles involving Nios and asm brought up any answers.

    Thanks again,

    -todd-