Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

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

Altera_Forum
Honored Contributor II
1,263 Views

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-
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
301 Views

I think you have to use .s files instead of .asm

0 Kudos
Altera_Forum
Honored Contributor II
301 Views

<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).
0 Kudos
Altera_Forum
Honored Contributor II
301 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
301 Views

<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-
0 Kudos
Reply