flat assembler
Message board for the users of flat assembler.

Index > Heap > Other ways of using FASM

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
FASM is a powerful tool, not just for actually writting code. But the macros make it very powerful.
I was thinking of different ways to use FASM.

One I like is:
If you write a single instruction like:
Code:
mov eax, 2    

and assemble it, FASM will generate a flat binary with no header and only with this instruction. This is nice, because if you right click the file and look at the file size you have the size of the instruction.

The design of FASM is a genius thing. It's almost like the code is mapped directly for what the assembled file will be. No linker tricks, no hidden bytes. Very Happy

So, you can test instructions for seeing what is smaller and use in your optimization.

Another good use of FASM is assembling HEX directly to binary files using db. You can use create your own file format with FASM.

Post other weird ways of using FASM (using macros for making HTML layout easier?). Razz
Post 23 Jan 2008, 21:04
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
in FASMLIB, i often use FASM to generate all type of code / text from single file.

I have list of procedures, and from that i generate various include files, test scripts, library / object dependencies, DLL exports, etc...
Post 23 Jan 2008, 21:18
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4238
Location: 2018
edfed
with fasm, i've created a meta assembler.
functions are like in a tree.
each functions can be called from anywhere, but it's not asm, it's a meta assembler.
like it:
Code:
meta:
dd caller,0,0,0,0,@f-$-4  ;this is the context of the meta function
dd topmost
dd box
dd copymem
dd readdisk
dd clearbuffer
dd alocatememory
dd topleast
@@:
instead of 
push ? ? ? ?
call topleast
push ? ? ? ? ?
call alocatememory
push ? ? ? ? ?
call clearbuffer
push ? ? ? ? ? 
call readdisk
push ? ? ? ? ? 
call copymem
push x y xl yl color
call box
push ? ? ? ? 
call topmost
    


with this in combinaison with a complete library, all is possible to do, very easy.
but this is only the main part, after, each elements need to be defined elsewhere... it use a lot of memory for execution contexts, but is fast. no use of the stack parameter passing.

execution context are defined in a data segment, closed to the meta assembly. as it's defined, and modifiable from anywher, it's powerfull. not like stack params..
the more memory use, the faster it is.
the less memory use, the slower it is.
in a certain limit ...
Post 23 Jan 2008, 21:58
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Well, you can check the XOR15 thread where I posted a cypher/decypher using display and file directives.

Also I have used it in the past in a homework where I needed to program in Pascal a simple database report program and I used fasm to generate the test database. I'm attaching it but it is written in Spanish, sorry...


Description:
Download
Filename: Ejercicio8.rar
Filesize: 47.22 KB
Downloaded: 111 Time(s)

Post 23 Jan 2008, 22:21
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7725
Location: Kraków, Poland
Tomasz Grysztar
You can find some other samples linked from the Important/Interesting threads list, see the items in the "WICKED FASM MACRO HUMOR" section (BTW, who gave it this name? I don't recall it being me. Smile).
Post 23 Jan 2008, 22:37
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
My never finished ada syntax is listed there Surprised

BTW, I think that I solved the problem I had with it when I partially developed the macrosed elf formatter, maybe I should revisit the ada syntax macros and finish them.
Post 23 Jan 2008, 23:35
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
"WICKED FASM MACRO HUMOR" section (BTW, who gave it this name? I don't recall it being me.

i remember using it after it was being used to describe this kind of stuff for some time, but not sure who came first with it. maybe even me Smile
Post 24 Jan 2008, 00:11
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
Tomasz wrote:
...(BTW, who gave it this name? I don't recall it being me. ).
As I recall, it was Revolution:

http://board.flatassembler.net/topic.php?t=5905&postdays=0&postorder=asc&start=20
28 September 2006
revolution wrote:
...tom tobias, you have a wicked sense of irony.

http://board.flatassembler.net/topic.php?t=4816
Three weeks earlier, 18 August 2006, Tomasz had created the FASM permanent topic:
"Important/Interesting threads"
(but when was the "Wicked FASM Humor topic added as a separate subheading???)
As I remember, (but my memory....) Tomasz' original thread did not contain a subheading named Humor, I believe it was added later, but I may be incorrect about that. That was just about the time, August/September 2006, of the FIRST FASM technical conference (Code name "White Shirts", as opposed to "Black Shirts", or "Black Hat"), if that helps to jog anyone's recollection....

In between these two dates, i.e. first week of September 2006, MHajduk wrote this:
http://board.flatassembler.net/topic.php?t=5735&postdays=0&postorder=asc&start=40
08 September 2006
MHajduk wrote:
...this thread (and other on "Important/Interesting threads" list) has been moved from FASM GEMS to WICKED FASM MACRO HUMOR:...

However, I wonder if this comment by MHajduk was not added weeks or months later, i.e. AFTER the additional subheading of HUMOR had been added to Tomasz' list of important threads....In a few decades, some of you will learn the potential advantages of losing one's memory....it's not all bad...I have, for example, already forgotten what it is that I have been awaiting these past several months....
http://samuel-beckett.net/Waiting_for_Godot_Part1.html
something round, I just can't quite put my finger on it....it's at the tip of my tongue, nope, gone with the wind....
http://www.imdb.com/title/tt0031381/
Oh, wait a minute, I feel something moving, yes, now I remember, The South, Atlanta, Gone with the Wind, nope, I am hopelessly lost. Oh, now I have it, no, escaped again:
http://geology.com/state-map/maryland.shtml
I know it has something to do with Washington, the city, not the State, nor the General, nor the university. Washington is close to Atlanta, close to Gone with the Wind, nope, just can't put the pieces together. Where's my cuspidor?
Smile
Post 24 Jan 2008, 02:51
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
tom tobias wrote:
However, I wonder if this comment by MHajduk was not added weeks or months later, i.e. AFTER the additional subheading of HUMOR had been added to Tomasz' list of important threads....
I'm sure that it was 08 September 2006, because this message wasn't edited by me later. And I'm almost sure it was vid, who changed the name of this thread (as a neophyte moderator he made that day great changes Wink ).

Now I think that my mentioned message was too emotional... but, from the other hand, was true and honest. Smile This forum was my "sandbox" (or "proving ground") and I hope that I won't "reproduce" on the other forums mistakes which were made here by me. Wink

I have a feeling that I've learned here much more about human nature in general than about programming in assembler. Laughing
Post 24 Jan 2008, 08:56
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7725
Location: Kraków, Poland
Tomasz Grysztar
Well, the very first thread in that list, the NASM macro syntax emulation contains the post made by vid, 10 Jul 2005:
vid wrote:
seems like writing FASM macros will soon become some kind of wicked humor.

I believe this is the original place where it came from. But who did rename the FASM GEMS section this way, I don't know. Smile
Post 24 Jan 2008, 10:46
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
Smile
Post 24 Jan 2008, 11:03
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
I remember I was the one who placed name into Important/Interesting thread, but I am not sure if I am originator of name too.
Post 24 Jan 2008, 12:07
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
Tomasz wrote:
...I don't know.
vid wrote:
...but I am not sure ...
you both may not have so long to wait, afterall....
MHajduk wrote:
...I've learned here much more about human nature in general ....
And you have taught me, many things, now, if only I could remember precisely what you wrote a couple of years back, ....Oh, yes, the neuronal presynaptic inhibition of Sir John Eccles.... Ah, yes, brings back memories of yesteryear....
Smile
Post 24 Jan 2008, 12:32
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
Re: Other ways of using FASM abbreviation Wink

FASM is abbreviation of Faculdade Santa Marcelina Wink Laughing

Image

FASM in YouTube: FASM - Nurse's Day (promo vid)
Post 24 Jan 2008, 15:14
View user's profile Send private message Visit poster's website Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
MHajduk: That's a brazilian university. Very Happy
Post 24 Jan 2008, 16:29
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
OK, we have official sponsor for fasm Technical Meeting '08 then Razz
Post 24 Jan 2008, 17:08
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4238
Location: 2018
edfed
can they pay the airplane for me and others?
Post 24 Jan 2008, 17:51
View user's profile Send private message Visit poster's website Reply with quote
Kenneth



Joined: 16 Nov 2005
Posts: 38
Location: United States of America
Kenneth
Custom formatted database of monsters for an mmorpg, with health and weaknesses (among other things). So my program will know what attack to use for greatest damage etc.

Compiling scripts into bytecode at runtime.
Post 25 Jan 2008, 18:17
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4238
Location: 2018
edfed
another way to use fasm phonem:
Image

Image
Post 25 Jan 2008, 18:57
View user's profile Send private message Visit poster's website Reply with quote
Rahsennor



Joined: 07 Jul 2007
Posts: 61
Rahsennor
A... Phasmid? Laughing

I'm using FASM for modding. I haven't found good texture or modeling tools for Total Annihilation, so with the aid of some format documentation, I'm using FASM and a few macros.

Try that in C. Twisted Evil
Post 26 Jan 2008, 03:57
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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 can 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.