Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
1,819 Views

Assembly Include/Header File?

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
Highlighted
Valued Contributor III
60 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
Highlighted
Valued Contributor III
60 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
Highlighted
Valued Contributor III
60 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