Mail Archives: djgpp/1997/06/09/21:45:31
William McGugan wrote:
>
> What registers do I have to save when using external assembler
> functions? I'm asking because my assembly functions crash with -O, and
> I thought it might be due to DJGPP using a register variable that was
> corrupted my asm functions.
%ebx, %esi, %edi, %ebp, %es, %ds and %ss (%cs is pretty obvious:) %eax,
%edx and %ecx are all free for your use (however, %eax is used for
return values (so is %edx, but only for 8 byte values)). %fs and %gs are
also free, however, libc uses %gs internally and never touches %fs.
> I have declared all my global variables and external functions as
> volatile, but that doesn't seem to help.
No, it wouldn't, as the variables getting scragged are probably your
locals (they tend to go into register when gcc is optimising).
Bill
--
Leave others their otherness.
- Raw text -