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.

Effect of returning a variable from a function on stack size and no. of cycle in 8051

Status
Not open for further replies.

Embedded_Geek

Full Member level 6
Joined
Jul 5, 2010
Messages
340
Helped
58
Reputation
116
Reaction score
56
Trophy points
1,318
Location
Germany
Activity points
2,948
What is the effect of returning a variable from a function (embedded C) on the stack size? Is it a good approach to always return a variable or we should minimize the use of it? All of you please put up your opinions with brief reason.
 

Due to limited stack space, the standard method of 8051 compilers for returning function results is passing them in registers. Consult your compiler manual for details. Clearly you won't use function results without a purpose.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top