flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > struct doesn't like db

Author
Thread Post new topic Reply to topic
zann



Joined: 12 Oct 2006
Posts: 4
zann
A lot of windows structs won't compile if they have a db or db dup as the last field.
(I tried a couple of versions of struct.inc and am using the july 09 file. The problem is triggered by the ends macro. Am I missing something? Could some odd thing I defined earlier have confused some internal list?)

dw compiles fine, so I've been halving the dups and using that as a work around. There's no work around for some unaligned structs though, such as:

struct SHITEMID
cb DW ?
abID db ?
ends


produces all these errs.

flat assembler version 1.68 (1062223 kilobytes memory)
c:\fasmw\winstructs.inc [6172]:
ends
c:\fasmw\include\macro\struct.inc [85] ends [6]:
make@struct name,fields
c:\fasmw\include\macro\struct.inc [105] make@struct [13]:
match fields, define \{ define@struct fields \} }
c:\fasmw\include\macro\struct.inc [105] match [0]:
match fields, define \{ define@struct fields \} }
c:\fasmw\include\macro\struct.inc [113] define@struct [5]:
name#field type def
c:\fasmw\include\macro\struct.inc [133] db [8]:
rb sizeof.#name#field - ($-field)
error: invalid expression.

(ShItemID compiles fine with dw in the last field, but since its used as a packed list it needs a 3 byte struct.)
Post 12 Sep 2009, 00:47
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
After swapping the fields position FASMW still gives me an error: "Error: definition of SHITEMID contains illegal instructions."

Replace "DW" with "dw" and it will work.
Post 12 Sep 2009, 01:26
View user's profile Send private message 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.