Mail Archives: djgpp/1997/01/28/22:53:46
i'm trying to code the following line in inline assembler, but i made a booboo.
a=*((unsigned short *)(EBX<<1));
where EBX is an unsigned long and a is an unsigned short
EBX<<1 points to a correct memory location incidentally, that line is supposed to
look like that ;)
i coded this as..
asm ("movw (%%ebx,2),%%ax"
: "=a" (a)
: "b" (EBX)
: "%eax");
but it has the effect of doing a=*((unsigned short *)(EBX)); instead.
it's ignoring the ,2 bit totally and i can't see why. how should i be doing this?
movw ($0,%%ebx,2),%%ax won't work either ;(
nik
--
Graham Tootell GameBoutique Ltd. - THE online gaming experience
nikki AT gameboutique DOT com http://www.gameboutique.com
- Raw text -