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++

Assembly Include/Header File?

Altera_Forum
Honored Contributor II
5,206 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
3,447 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.

0 Kudos
Altera_Forum
Honored Contributor II
3,447 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
0 Kudos
Altera_Forum
Honored Contributor II
3,447 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.
0 Kudos
Reply