flat assembler
Message board for the users of flat assembler.

Index > Main > Bug Report: fstenv

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 15 Jul 2006, 10:51
Having problems with fstenv instruction using local variables for storage, when I do this:

local fpuenvtemp[28]:BYTE
fstenv [fpuenvtemp]

I get an "invalid size of operand"
Post 15 Jul 2006, 10:51
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 15 Jul 2006, 12:55
try searching first next time
Post 15 Jul 2006, 12:55
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Hunter



Joined: 07 Jun 2006
Posts: 41
Hunter 15 Jul 2006, 22:24
Yes, madmatt is right, FASM generates error "invalid size of operand" for following code:
envdata db 28 dup (0)
fstenv [envdata]

but
label envdata_label
envdata db 28 dup (0)
fstenv [envdata_label]
is compiled successfully.

I think, the operand size isn't needed for fstenv, fnstenv, fldenv, fsave, fnsave, frstor, fxsave, fxrstor instructions in this situation.
Post 15 Jul 2006, 22:24
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 15 Jul 2006, 22:57
Post 15 Jul 2006, 22:57
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 15 Jul 2006, 23:18
vid: Yeh, I should've checked the intel docs before I posted, it only accepts a global (static) memory reference to work.

locodelassembly: after reading the post, looks like a $66 prefix is all that is needed a make it work, I'll have to try and see what happens.
Post 15 Jul 2006, 23:18
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 15 Jul 2006, 23:24
Tried a direct approach: fstenv [esp + 48], also fstenv [ebp _48] and it compiled without error.
Why won't it work with the local variable?
Post 15 Jul 2006, 23:24
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 15 Jul 2006, 23:29
Quote:

vid: Yeh, I should've checked the intel docs before I posted, it only accepts a global (static) memory reference to work.


But you can use the stack if you want
Code:
include 'win32axp.inc'

.code
proc start
local ..fpuenvtemp[28]:BYTE
label .fpuenvtemp at ..fpuenvtemp
  fstenv [.fpuenvtemp]

  ret
endp

.end start    


[edit]
Quote:
Tried a direct approach: fstenv [esp + 48], also fstenv [ebp _48] and it compiled without error.
Why won't it work with the local variable?

Because fstenv needs a label with no type[/edit]
Post 15 Jul 2006, 23:29
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 16 Jul 2006, 08:46
i meant searching the board, for that thread - i was too lazy to explain it or search for the thread myself Smile
Post 16 Jul 2006, 08:46
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.