Mail Archives: djgpp/1997/02/01/07:44:52
> unsigned char inportb (int port)
> {
> unsigned char c;
> asm ("inb %%dx, %%al"
> : "=a" (c)
> : "d" (port));
> return c;
> }
>
just a thought, would marking a and d as clobbered help at all?
ie. asm volatile ("inb %%dx,%%al"
: "=a" (c)
: "d" (port)
: "al", "dx" ); ?
perhaps if gcc was forced to reload d each time it wouldn't be able to
optimise it by assuming the value in it was constant? mind you it might just
push it on a stack instead :)
regards,
nik
--
Graham Tootell
nikki AT gameboutique DOT com
- Raw text -