Skip to main content
2 of 2
deleted 29 characters in body; edited title
clabacchio
  • 13.7k
  • 4
  • 46
  • 80

Where are static variables stored?

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?

Swanand
  • 3.3k
  • 6
  • 31
  • 46