flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Macroinstructions > Macroinstructions Frequently Asked Questions (FAQ)

Author
Thread Post new topic Reply to topic
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Macroinstructions Frequently Asked Questions (FAQ)
Macroinstructions Frequently Asked Questions (FAQ)
maintained by: Site Admin (Privalov), Matrix

Posting Information for newbies:
You've got a problem with assembly programming?
There are probably many people who can help you solve it. You only have to do the following:
First of all, you should take a look at the Flat Assembler Documentation, then you might wanna take a look at the examples section,
IF you already did so, THEN try using the search function of this message board,
IF you can't find the solution, do the following:
Try to categorize your problem, ask yourself the questions:
Is your problem assembly related? IF NOT, THEN post to Heap
ELSE Does it belong to a specific operating system? IF YES, THEN post it to the appropriate forum:
DOS, Windows, Linux, Unix, MenuetOS
ELSE Do you think your problem is due to some bug in FASM? (we hope not) IF YES, THEN post it to Compiler internals
ELSE You would like to give some feedback on the forums? IF YES, THEN post to Feedback
ELSE Post it to Main.

For advanced programmers there are also:
Macroinstructions - Post here your useful macroinstructions, discuss various tricks and syntax adjustments.
Compiler internals - Submit modifications to flat assembler itself.
OS Construction - Post here if you are writing your own OS kernel, boot loader, etc.
IDE Development - For developers and users of the Integrated Development Environments for flat assembler.

You probably could categorize your problem, now you may open a new topic named with the best description of your problem/suggestion, imagine if you saw that topic just created, what would you think if it had that name?

Beginning of FAQ:

This thread/sticky is intended to be a good list of FAQs (or simply usefull things), it's understandable that from time to time the search function might be a little tricky to use and it might take a while to find what one is looking for (especially when one isn't too familiar with the art of searching).

If you think some question in this FAQ is missing, please post a reply here with a link to the thread, and a short/brief motivation - the reply will then be deleted if approved and the entry added to the FAQ, if the entry is rejected a reply will be made to the post explaining why it's rejected, the request and the answer will then be kept for about an week and then both will be deleted to keep this thread as clean as possible.

Macro tutorials:
Macro tutorials
Macro tutorials -- continuation
Explanation of MATCH directive
Guide to fasm's preprocessor by vid - it became obsolete in some parts, but we await the new version.

Macro solutions:
MASM-like structures and procedures
union macro
for macro
switch/case macros generating jump table
XOR crypting macro
Random number macro
Date/time macros
Efficient list building macros

Other
Utility to save result of preprocessing - great tool to test macros and learn macrosyntax.

newbies, pls read the FASM documentation , Design Principles, or Why fasm Is Different

Other FAQs:


Last edited by Matrix on 08 Dec 2005, 04:59; edited 5 times in total
Post 07 Feb 2005, 08:34
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2469
Location: Bucharest, Romania
Not really a spectacular thing, and I forgot to mention it

pk macro - packs constant immediates like:


Code:
and al5
and ah2

which, if written like:

Code:
pk al:5ah:2

becomes:

Code:
and ax0205h


I find it quite useful, not only for optimization (in some situations, it can be used to improve the code's readability, in my opinion Wink)

any instruction can be used after the 'pk', of course, as long as the CPU architecture allows it (and combinations, of course). Smile
Post 25 Mar 2006, 14:31
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 340
Location: ukraina
Imports (has appeared many times before, in FAQ hence)


Code:

;why not to...
import some.dll,'some.dll',\
        func1,'func1',\
        func2,'func2'

;...instead of
library some.dll,'some.dll'
import some.dll,\
        func1,'func1',\
        func2,'func2'


Post 23 Oct 2013, 21:08
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14795
Location: Lost in translation

idle wrote:
Imports (has appeared many times before, in FAQ hence)


Code:

;why not to...
import some.dll,'some.dll',\
        func1,'func1',\
        func2,'func2'

;...instead of
library some.dll,'some.dll'
import some.dll,\
        func1,'func1',\
        func2,'func2'



You will still need to have another macro (or some other way) to build the DLL library section. Using import by itself multiple times doesn't give a chance to create the library.
Post 24 Oct 2013, 00:41
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.