flat assembler
Message board for the users of flat assembler.

Index > Main > Community package macros feedback request

Author
Thread Post new topic Reply to topic
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Today vid told to me that he can help with macros but neither he nor me know what kind of macros should be included as a base. So, this thread is intended to fetch requirements from future users so a suitable package can be arranged. Before posting please make sure to provide enough info, if possible a complete specification in case the macro(s) not exists yet, not just "I would like to have macros that makes me happy" or "It would be great to have macros that makes programming easier".

He also told me about chatting in an IRC channel about this. I think we still have a channel on freenode so we could set a date where most of us can participate and chat a little more freely than what will be allowed on this thread Smile

Here I leave the PMs:

vid wrote:
I can help with macros (not sure if "maintain" is right word though). Biggest problem would be decide on macros. That will need some IRC chat where everyone is present. Which macros to include, how heavy macro support we want "by default", etc...

LocoDelAssembly wrote:
The macros that comes with the official package seems to be almost enough, it would be great to have those macros that came with Fresh which allowed you to define data and variables everywhere and that later the macros arranged to put them all together in a well-known place.

(Unnecesary part omitted)

vid wrote:
Well, those idata and udata ARE the problem... that means data must be placed at the end of source, contrary to common use.

Also, there are different levels of macros that come with standard package. There is "include all" version (.code / .data / .end), and also the more handwork version ( custom imports, exports, etc...)

In current version it IS a bit confusing. I agree that tomasz made it best possible way for everyone, but i don't think that such package should be for everyone. My opinion is to make easy-to-use package for near-beginners, kinda like MASM32 but normal. More advanced people will be able to build environment themselves.

PS: please forward this post to all interested. I expect some feedback about these ideas Wink
Post 19 May 2008, 21:33
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
My idea would be to focus more on easy-to-use package, eg. quasi-automatic imports for basic DLLs, idata / udata macros (maybe more, like c[onstant]data, etc...), invoke, parameter number counting ... all this by default.

I could provide macros that would allow this, and allow to make compatible headers for other libraries. Like this:

Code:
include 'win32.inc'   ;our default package
include 'winsock.inc' ;extra DLL not included in default package (not used here)
include 'fasmlib.inc' ;extra library (not used here)

idata {
  string db "oh yeah",0
}

start:
invoke MessageBoxA, 0, string, "uh oh", 0
invoke ExitProcess, 0

.end start    


Note that there *is* one tough problem: using idata/udata would be required, if you want them to be placed in data section. no ".data" possible (yep, I made mistake in post quoted by Loco). If we allow ".data", then we have to disallow idata/udata, or force user to place .data behind every idata/udata Sad

These are macros i can provide... actually, they are mostly done for my old FASMPAK thingy, just few minor changes needed, i hope.
Post 19 May 2008, 23:50
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
I would be pleased to see 'includeonce' (or similar name) in the macros package. I think it is important for multi-person development. I have previously posted a version, but just for completeness here it is again
Code:
match =files@included,files@included{

 macro nest_includeonce\{
              macro includeonce path,[instr]\\{\\common
                  file@include equ path
                       match head path tail,files@included\\\{file@include equ\\\}
                 match head path,files@included\\\{file@include equ\\\}
                      match file,file@include\\\{
                         files@included equ files@included path
                              nest_includeonce
                            include file
                                purge includeonce
                           irp i,instr\\\\{i\\\\}
                    \\\}
                \\}
  \}nest_includeonce

        macro show_included\{match x i,files@included\\{irps j,i\\\{display \\\`j,13,10\\\}\\}\}

   files@included equ x

}    
There is also a need for an associated 'libraryonce'
Code:
macro libraryonce [dll_tag,dll_name,import_file] {
    forward
       libraryonce@tag equ dll_tag
 match head dll_tag tail,.library_tag_list\{libraryonce@tag equ\}
        match head dll_tag,.library_tag_list\{libraryonce@tag equ\}
     match any,libraryonce@tag\{
           .library_tag_list equ .library_tag_list,dll_tag
             dll_tag#.module_name equ dll_name
           match any,import_file\\{includeonce import_file\\}
    \}
}    
There are a few other macros to support the libraryonce concept. I have posted the full set in my principles thread.
Post 20 May 2008, 14:10
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
What exactly should be "includeonce" used for? Can you give example where it is useful?
Post 20 May 2008, 14:46
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
vid wrote:
What exactly should be "includeonce" used for? Can you give example where it is useful?
In larger projects, once can write modular files that include all of their own dependencies. Thus if one or more modules want to use 'utilities.inc' they can all just include it without needing to worry about duplication. The idea being that although the file is referenced multiple times it will only be included once, hence the name includeonce.

This also enhances the ability to write self-contained modules of common utilities and functions used in many different projects. I find this useful in many ways.
Post 20 May 2008, 14:55
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
Okay, you're right. But I think most important is to make basic package that delivers default macros and win32 includes. I'd postpone things like this for bit later. It's always good idea to start small.
Post 20 May 2008, 15:27
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
LocoDelAssembly wrote:
He also told me about chatting in an IRC channel about this. I think we still have a channel on freenode so we could set a date where most of us can participate and chat a little more freely than what will be allowed on this thread
Sorry, I don't chat on the Internet.
Post 20 May 2008, 16:33
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 GitHub, YouTube, Twitter.

Website powered by rwasa.