Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Assembly Include/Header File?

Altera_Forum
Honored Contributor II
2,758 Views

Hello all, 

 

I am currently working on an assembly design that will require the equivalent of a .h file in which I can# define certain constants used in the design. I am aware of doing this in c of course, but not assembly. Is there any way I can do this outside of the .data section in my .s file?  

 

My design is generic and I would hate to have to hard code these values in my code.  

 

Thanks, 

Matt
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
999 Views

The convention with GCC is to use .S (upper case) for assembler files that need to be pre-processed and .s (lower case) for files that do not.

Altera_Forum
Honored Contributor II
999 Views

 

--- Quote Start ---  

The convention with GCC is to use .S (upper case) for assembler files that need to be pre-processed and .s (lower case) for files that do not. 

--- Quote End ---  

 

 

I am not entirely sure what to do with this .S file. Am i able to include .c files here, or# define constants in here directly?  

 

Thanks
Altera_Forum
Honored Contributor II
999 Views

 

--- Quote Start ---  

The convention with GCC is to use .S (upper case) for assembler files that need to be pre-processed and .s (lower case) for files that do not. 

--- Quote End ---  

 

 

I believe I have it figured out. Please let me know if anything I have stated is invalid. 

 

I will want to change my file extension to .S. In this file, i will# include a header.h file that will contain my# defines for whatever constants I want. When I go to build, The GCC compiler will preprocess my request to include the header.h file.
Reply