Re: Abort x86 assemble code

From: Darryl Miles (darryl@netbauds.net)
Date: Thu Jan 04 2001 - 03:08:36 EST


hugang <linuxbest@sina.com> wrote:
> I have following code ,and I can not understand the mark line,who can tell me.thanks.
> 00000ec7 xorl 0x400dec(,%eax,4),%ecx ????<-----------------What it to do.

extern u_int32_t eax;
extern u_int32_t ecx;

{
        u_int32_t *ptr;

        ptr = (u_int32_t *)((eax * 4) + 0x400dec);

        ecx ^= *ptr;
}

Commonly used in the above form (with a fixed displacement) to access a
32bit value within an array of 32bit values.

The array start offset would be hardwired at 0x400dec, the zero based
index into the array is provided by eax.

-- 
Darryl Miles
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 07 2001 - 21:00:17 EST