Mail Archives: djgpp/1997/01/29/00:35:00
nikki wrote:
>
> 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
try : movw (,%%ebx,2),%%ax
--
***** *** ** ** Dan M. Hedlund
** ** ***** *** ** <markiv AT rangenet DOT com>
** ** ** ** **** ** http://www.rangenet.com/markiv
** ** ** ** ** ** **
** ** ******* ** ****
** ** ** ** ** ***
** ** ** ** ** **
***** ** ** ** **
- Raw text -