flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > problem with use "assume" macro

Author
Thread Post new topic Reply to topic
marcinzabrze12



Joined: 07 Aug 2011
Posts: 60
marcinzabrze12
Another yet problem. When i try use assume:
Code:
 
assume    eax:POINT                   ; everything ok 
assume    eax:IMAGE_OPTIONAL_HEADER32 ; everything ok

assume    eax:WIN32_FIND_DATA         ; error "illegal instruction"
assume    eax:IMAGE_NT_HEADERS32      ; error "illegal instruction"
    
Post 15 Mar 2012, 01:18
View user's profile Send private message Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 237
Location: the-ideom
Mike Gonta
marcinzabrze12 wrote:
Another yet problem. When i try use assume:
Code:
 
assume    eax:POINT                   ; everything ok 
assume    eax:IMAGE_OPTIONAL_HEADER32 ; everything ok

assume    eax:WIN32_FIND_DATA         ; error "illegal instruction"
assume    eax:IMAGE_NT_HEADERS32      ; error "illegal instruction"
    
The assume macro doesn't like nested structs.
A workaround is to flatten the struct.
Original includes:
Code:
struct FILETIME
  dwLowDateTime  dd ?
  dwHighDateTime dd ?
ends
struct WIN32_FIND_DATA
  dwFileAttributes   dd ?
  ftCreationTime     FILETIME
  ftLastAccessTime   FILETIME
  ftLastWriteTime    FILETIME
  nFileSizeHigh      dd ?
  nFileSizeLow       dd ?
  dwReserved0           dd ?
  dwReserved1           dd ?
  cFileName             TCHAR MAX_PATH dup (?)
  cAlternateFileName TCHAR 14 dup (?)
ends    

flattened include:
Code:
struct WIN32_FIND_DATA
  dwFileAttributes dd ?
; FILETIME
    ftCreationTime.dwLowDateTime dd ?
    ftCreationTime.dwHighDateTime dd ?
; FILETIME
    ftLastAccessTime.dwLowDateTime dd ?
    ftLastAccessTime.dwHighDateTime dd ?
; FILETIME
    ftLastWriteTime.dwLowDateTime dd ?
    ftLastWriteTime.dwHighDateTime dd ?
  nFileSizeHigh dd ?
  nFileSizeLow dd ?
  dwReserved0 dd ?
  dwReserved1 dd ?
  cFileName TCHAR MAX_PATH dup (?)
  cAlternateFileName TCHAR 14 dup (?)
ends    
Also The assume macro doesn't like comma separated data statements.

_________________
Mike Gonta
the-ideom - now you know how to compile

https://mikegonta.com
Post 12 Jul 2012, 07:39
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7419
Location: Kraków, Poland
Tomasz Grysztar
Today's update in 1.71.03 package fixes this bug.
Post 27 Sep 2012, 14:09
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-2019, Tomasz Grysztar.

Powered by rwasa.