Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Which memory segment is allocated for the Register variable?

Status
Not open for further replies.

sivamit

Full Member level 4
Joined
Dec 1, 2005
Messages
201
Helped
20
Reputation
40
Reaction score
14
Trophy points
1,298
Activity points
2,651
Register variable

Hi,
when we define a variable as register in microcontrollers..where exactly(which memory segment) storage is allocated for this?
 

Re: Register variable

Hi Sivamit,
When we define a variable as register, the compiler arranges for the variables to be stored in microcontroller registers rather than allocating storage on a stack (as with variables declared auto). This makes accessing their values very quick, usually much quicker than if the variables were on a stack.
But the compiler may decide not to store the variables in microcontroller registers.

Regards,
vhn
 

Re: Register variable

Hi Vhn,
Thanks for your reply.
But do we have separate data memory ( to store auto or static variables) other than CPU registers to store variables in a MICROCONTROLLER.
Sorry I know only assembly language programming for uCs. I never used register or auto definitions in my program.
 

Re: Register variable

Hi Sivamit,
Yes. We do have separate RAM area for storing auto, static, extern variables apart from CPU registers.

Regards,
vhn
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top