I'm a bit embarrassed to have to ask, but...
I quite often - nearly always, in fact - push all registers onto the stack at the beginning of a routine:
Code:.routine
pushad ; preserve registers
(do stuff)
popad ; restore registers
ret
But I find that when I need to return a value in EAX, I do this:
Code:.routine
pushad
(do some stuff...)
(put some value in EAX)
mov [^temp], eax
popad
mov eax, [^temp]
ret
Is there a neater way to return a value in EAX without stashing the return value in a temporary memory location first?
Thanks.
David.