Author Topic: compiled instruction contains flaw  (Read 9445 times)

nobody

  • Guest
compiled instruction contains flaw
« on: November 15, 2008, 04:39:49 PM »
Hello !

I have the following problem (using SUSE LINUX 11 with NASM version 2.02 compiled on Jun  6 2008).

I program 64bit assembly code and the following code does not execute properly after code generation with nasm:

mov r9,[memoryvalue] = 08900000000000089h
   and r9,0ff00000000000000h

yields 0x0 in r9
--> incorrect !


This code works fine, but not the way I want it:

mov r9,[memoryvalue]
   mov rax,0ff00000000000000h
   and r9,rax      

yields 0x089 in r9
--> correct

Is there a newer version of nasm avaiable or a workaround (wo the add. command) possible?


Many thanks

Bjoern

nobody

  • Guest
Re: compiled instruction contains flaw
« Reply #1 on: November 15, 2008, 04:58:31 PM »
Yes, there is a newer version, with many bugs fixed. Get it here on the download page, or better yet:

http://www.nasm.us

The "downloads" section has a better selection of "releases" than you'll find here, and the "snapshots" section has the "latest and greatest". I *think* 2.05.01 will fix your problem, but might as well look at the lastest if you're hunting bugs. If it *isn't* fixed (I'm not up on the 64-bit code), please get back to us. Thanks for the feedback!

Best,
Frank

nobody

  • Guest
Re: compiled instruction contains flaw
« Reply #2 on: November 15, 2008, 05:07:46 PM »
Just used latest NASM version, bug is fixed.

Many thanks,
Bjoern

nobody

  • Guest
Re: compiled instruction contains flaw
« Reply #3 on: November 15, 2008, 05:15:53 PM »
Ooops,

wrong (still had the mov instr., not the and instr. changed).

and r9,0ff00000000000000h

instruction yield the following warning on compiling (now latest NASM version 2.05.01 compiled on Oct 29 2008):

warning: signed dword immediate exceeds bounds

and still the code does not execute properly (also if i use an unsigned 64bit no).

So any remedies for this problem are still welcome !

Many thanks,
Björn