AnsweredAssumed Answered

RAM or ROM where is a #define stored?

Question asked by Johannes Philippi on Oct 2, 2007
Latest reply on Oct 8, 2007 by CompilerGuru
Hello everybody,

I've got a question on the constants I use in my C-program. I'm using a lot of constants in my program like

#define CONST_VAR  value

where value are signed/unsigned integers or floating points like pi.

My question is where are these constants stored in the memory of my HCS08DZ60 microcontroller, and how many bytes do they occupy? Are they stored in the same region as global variables, i.e. in the STACK? Wich region of the memory does the stack belong to? In the prm-file of my project I can modify its size, but I still don't know where all these variables/constants are stored (Z_RAM, RAM, ROM1, ROM) in the memory.

Could someone tell me the place and size of storage for the constants in the following lines:

//global variable
UINT32 my32BitVariable;
UINT8  my8BitVariable;

#define MY_CONST_1   130
#define MY_CONST_2   -13
#define MY_CONST_3   0.884637
#define MY_CONST_4   600

The problem I have to deal with, is that some variables simply do not work correctly. And I think this is because they are stoerd in a memory region that is to small for all of the variables/constants  declared.

Many thanks,