Mail Archives: djgpp/1998/03/23/12:30:36
On Sun, 22 Mar 1998 21:54:35 -0800 (PST), Nate Eldredge
<eldredge AT ap DOT net> wrote:
>At 08:43 3/22/1998 GMT, Jason Stratos Papadopoulos wrote:
>>Hello. In the course of writing some high-speed modular multiplication
>>I came across this problem with gcc's inline assembly.
>>
>>The full code is too lengthy to post, but I have some inline assembly
>>for which eax is on the clobber list. More specifically, the function
>>it's in looks like this:
>[deleted]
>>Why is gcc using eax to address memory when I specifically put it on
>>the clobber list?! This has actually happened once or twice before, the
>>only way around it is to use all the register names directly, rather than
>>leave it up to the compiler.
>>
>>Is this a bug?
>
>I think this is a bug, especially since the documentation says:
>
>"The input operands are guaranteed not to use any of the clobbered registers..."
>
Something similar happened to me before... I used an inline asm
function to write to the text-mem (ie. 0xb8000), and the inline asm
function overwrote a pointer to a struct, resulting in GPF´s...
I replaced the inline asm function with _farpokeb (or whatever - a
DJGPP function in any case), and it worked. I guess the DJGPP
function restored all the registers it clobbered, but my inline asm
function listed all the clobbed registers.
- Raw text -