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) -- Ignore unavailable to you. Want to Upgrade?


To: bacchus_ii who wrote (74151)3/10/2002 6:55:33 AM
From: dale_laroyRespond to of 275872
 
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.<

When I did assembly language programming for the 68K I would allocate a few "spare" registers as scratch registers. I would pass parameters to the subroutines in these scratch registers and the subroutine would return the values in these same registers. Any registers used by the subroutine other than the scratch registers would be saved on the stack then popped by the subroutine just prior to the return.

I would imagine that the easiest way to take advantage of the extra registers of x86-64 would be to dedicate them as scratch registers for parameter passing.