flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > struct.inc minor tweak

Author
Thread Post new topic Reply to topic
Mr_Silent



Joined: 25 Apr 2006
Posts: 30
Mr_Silent
little tweak to subj
Code:
macro define@struct name,[field,type,def]
 ......
    macro name value \\{
   forward
     match , value \\\{ type def \\\}
     match any, value \\\{ \\\local ..field
                           ;..field: type value                       ;was
                           ..field = $                                ;now
                           type value
                           ; original code follows
                           if ~ field eq .
                            rb sizeof.#name#field - ($-..field)
                           end if \\\}
   common \\} \} }
    

this will allow the following
Code:
struct a
 x db ?
 y db ?
ends

var=0
var=var+3  ;var is NOT a constant

repeat var
 a %,%+1
end repeat
    
Post 09 Sep 2006, 06:26
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
revolution
since '..field' is defined locally only and not EQUated to another symbol then I see no problem with the suggested change.
Post 09 Sep 2006, 06:38
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.

Powered by rwasa.