Mail Archives: djgpp/1999/03/19/10:16:39.1
On 18 Mar 99 at 17:24, Nate Eldredge wrote:
> Alternatively, if you want to leave GCC out of the function entirely,
> you can use `asm' at the top level. For instance:
>
> static int bar(void);
>
> asm("_bar: movl $42, %eax; ret");
Doesn't this create segment problems, i.e. code is meant to be
in a text segment, data in a data segment? ISTR running into a
problem with this once, but it may have been on RSXNTDJ, not
djgpp. The problem with just being explicit and forcing it
with `.code' is that I think gcc might not notice you doing
this, and so it can't put it back afterwards itself -- so again
you end up guessing which segment it left it in.
IMHO the safest thing is to put such assembly code in a
separate .S or .s file -- I can't see any real disadvantages
with this, but maybe wiser people can or I'm worrying about
nothing.
--
George
- Raw text -