Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly Language > Merit of callee...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 4968 of 5072
Post > Topic >>

Merit of callee-saved register

by Tim Frink <plfriko@[EMAIL PROTECTED] > Apr 22, 2008 at 09:51 AM

Hi,

I've a general question about calling conventions and the use of registers
across calls. In a book I found this:
"For a variable whose range of appearance spans many procedure calls,
the use of a callee-saved register is advantageous, because saving and
restoring once at the procedure entry and exit respectively are cheaper
than saving and restoring around each call."

What I don't understand is the term "cheaper". In my opinion cheaper must
mean less code (i.e. less instructions in the code) since when the same
function is invoked multiple times, there are just once the instructions
in this function for saving/restoring while in the case of register
saving/restoring around the each call for each call separate instructions
must be added.

Cheaper cannot mean faster execution because the number of executed
saving/restoring instructions would be the same for both approaches, 
right?

Or do you understand this in another way?

Regards,
Tim
 




 3 Posts in Topic:
Merit of callee-saved register
Tim Frink <plfriko@[EM  2008-04-22 09:51:18 
Re: Merit of callee-saved register
Robert Redelmeier <red  2008-04-22 12:45:32 
Re: Merit of callee-saved register
"robertwessel2@[EMAI  2008-04-22 14:38:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 16:08:40 CDT 2008.