Skip to main content
1 of 2
Swanand
  • 3.3k
  • 6
  • 31
  • 46

Where are static variables are stored?

Simple Question. Suppose I am using a 8051. I compiled a code which has a static variable. Where that Static Variable will be stored? In RAM? In Stack? On Heap?? In flash? Where?

Also, Correct me If I am wrong: CONST are stored in ROM. And Global variables are stored in Flash.(What if I don't have Flash?)

I am expecting answers with respect to Embedded Programming. It's not like in Code Segment or in .bss, but exact where on my board?

Thanks!

Swanand
  • 3.3k
  • 6
  • 31
  • 46