flat assembler
Message board for the users of flat assembler.

Index > Main > FASM 'ASSUME' Directive?

Author
Thread Post new topic Reply to topic
Irwin



Joined: 25 Jan 2008
Posts: 1
Irwin
Hi!

Whilst using MASM32 in the past I would use an 'assume' directive to make the compiler aware to the fact that a register is pointing to a structure, so I could reference the structure like this:

Code:
mov    eax, dword ptr ds:[ebx+045h]
assume eax:POINT
mov    esi, dword ptr ds:[eax.x]    


Now that I'm using FASM I can't find any such function, I've already looked through the documentation for such a directive/macro but I can't find any so I was wondering if there is any at all that I may have missed/overlooked.

Any help would be appreciated Smile
Post 25 Jan 2008, 20:33
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Use "include 'macro\masm.inc'"

And yes, it is not documented unfortunatelly, I think that http://flatassembler.net/docs.php?article=win32 should give some comments about it.

PS: Well, there is a reason for lack of documentation http://board.flatassembler.net/topic.php?p=37076#37076
Post 25 Jan 2008, 20:51
View user's profile Send private message Reply with quote
dap



Joined: 01 Dec 2007
Posts: 61
Location: Belgium
dap
I've never used this feature with MASM but doesn't it look the same as VIRTUAL ?
Post 26 Jan 2008, 11:39
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
you can get effect similar to "ASSUME" by using "virtual", but it's not the same.
Post 26 Jan 2008, 11:58
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6038
Location: Poland
MHajduk
You can write
Code:
mov esi, dword [eax + POINT.x]    
Post 26 Jan 2008, 12:23
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2937
Location: vpcmipstrm
bitRAKE
Code:
Testing:
  virtual at edi
    .sym SYMBOL
  end virtual
  mov eax,[.sym.hash] ;=>mov eax,[edi+SYMBOL.hash]    
...works well. As does:
Code:
Testing:
  label .sym DWORD at edx
  mov eax,[.sym]    
...but does not easily extend to:
Code:
Testing:
  label .sym SYMBOL at edx
  mov eax,[.sym.hash]    
...unless a macro is used to change label directive.
FASM only has type checking on CPU types as struc is just a macro really.
Post 26 Jan 2008, 21:53
View user's profile Send private message Visit poster's website 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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.