SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Technology Stocks : Advanced Micro Devices - Moderated (AMD)
AMD 223.67+1.7%9:55 AM EST

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Joe NYC who wrote (74148)3/10/2002 3:14:45 AM
From: bacchus_iiRead Replies (1) of 275872
 
Joe,


Can this be done (using registers instead of pushing parameters on the stack)? I have my doubts about it. Isn't the result just the opposite, that is when a function is called, doesn't more registers need to be stored?


I have seen, long ago, computer implementing in hardware a sort of cache holding the top n words of the stack. I never saw this for the X86. It's mostly interesting when polish string notation is used to execute operation with operand from the stack and result (including intermediate result) stored also on the stack.


My assembly skills are extremely rusty, (as you can probably tell from the question), maybe you can refresh my memory. What happens when a function is called? Can you assume that the state of the registers is the same as prior to the call? If the answer is yes, they need to be stored someplace (on stack), so 8 extra registers presents extra overhead? Is there a shortcut for finding out which registers need to be saved?

It could be a software programming discipline I guess. The saving should than be done by the subroutine at the entry and the saving should then be done only for the register that will be needed by the subroutine.
Of course for context change, all registry got to be saved and restored for the new tread context. Maybe for interrupt service routine, for very small ISR, a reduced set of register could be saved, provide this small ISR return only to the interrupted tread.

Note: all this is WAG from me since my assembler is more far away then yours.

Gottfried
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext