The MASM Forum

64 bit assembler => UASM Assembler Development => Topic started by: aw27 on July 22, 2017, 05:41:54 PM

Title: FISTTP—Store Integer with Truncation
Post by: aw27 on July 22, 2017, 05:41:54 PM
Using this "new" x87 instruction gives the error:
"Error A2030: Instruction or register not accepted in current CPU mode".

I tried all CPU modes.

It works fine with Masm.
Title: Re: FISTTP—Store Integer with Truncation
Post by: jj2007 on July 22, 2017, 05:52:07 PM
Which UASM version doesn't work?

include \masm32\include\masm32rt.inc
.686
.xmm

.code
start:
  fldpi
  push eax
  FISTTP dword ptr [esp]
  pop ecx

  MsgBox 0, cat$(str$(ecx), " is the result"), "fisttp:", MB_OK
  exit

end start
Title: Re: FISTTP—Store Integer with Truncation
Post by: aw27 on July 22, 2017, 06:02:06 PM
This way does not:
fisttp dword ptr storedDword

Title: Re: FISTTP—Store Integer with Truncation
Post by: jj2007 on July 22, 2017, 06:15:56 PM
For me, fisttp dword ptr storedDword works like a charm. Can you post a complete example?
Title: Re: FISTTP—Store Integer with Truncation
Post by: aw27 on July 22, 2017, 06:27:43 PM
You are right.
It works with
.686
.xmm

It does not work with
.xmm
.686

Thanks.

But it works with Masm. So probably I reported the wrong issue.  :lol:

Title: Re: FISTTP—Store Integer with Truncation
Post by: jj2007 on July 22, 2017, 07:47:26 PM
It's not a bug but a little incompatibility. I guess the team will fix it in a day or two. Microxxxx needs a decade or two...
Title: Re: FISTTP—Store Integer with Truncation
Post by: aw27 on July 22, 2017, 08:03:44 PM
Quote from: jj2007 on July 22, 2017, 07:47:26 PM
It's not a bug but a little incompatibility. I guess the team will fix it in a day or two. Microxxxx needs a decade or two...
For me there is no need to fix the incompatibility, I have repeated 10 times "First .686, second .xmm". I will never forget it :P
Title: Re: FISTTP—Store Integer with Truncation
Post by: hutch-- on July 26, 2017, 01:55:16 PM
 :biggrin:

Now you understand why MASM does not have bugs, only features that you need to understand. Thank God for ML64.

.code
  ; everything inbetween
end

:P