Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: ...and an assembler question

Author: J. Wesley Cleveland

Date: 11:47:11 06/20/03

Go up one level in this thread


On June 20, 2003 at 04:11:37, martin fierz wrote:

>i wanted to try that prefetch command, but i'm no good at assembler. could
>somebody check whether my code does what i think it does?
>
>void prefetch(int x)
>  // this prefetches 128 bytes into the cache, starting at the address of x
>  {
>  __asm
>       {
>       mov ebx, dword ptr x
>       prefetchnta [ebx]
>       }
>  }
>
>does this do what i think it does or does it do something different? i'm really
>unfamiliar with assembler :-(

I suspect it is not what you want. I think this would use the value of x as an
address to prefetch. Try changing the first line to

void prefetch(char *x)

and passing in the address you want to prefetch.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.