flat assembler
Message board for the users of flat assembler.

Index > Main > flat assembler 1.57

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
rather dont use @@ in macros, i prefer macro-local labels, because then use can still use @f/@b jump over macro, with your version it will be hard-to-find bug.

Also prepend all labels by ".."

Code:
macro fldq dfloat 
{ 
     local ..mynumber,..here
     jmp ..here
     align 8 
     ..mynumber dq dfloat 
..here: 
     fld [mynumber] 
    ;more of your code here 
}
    


see http://decard.net/?body=tajga&chapter=preproc#local
Post 23 Jan 2005, 19:11
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
All right, thanks for the correction
MadMatt
Post 24 Jan 2005, 09:09
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
Quote:
thoug, I'd really want to beable to make it:

Code:
movq [variablename], 1.0f    

I have an interesting solution to make such kind of macros, but it causes one problem. The idea is to allow the syntax like:
Code:
mov [var][4],eax ; the same as mov [var+4],eax
mov dword ptr var[4],eax ; the same as mov dword ptr var+4,eax    

It's very easy to add such feature to parser (I can post the quick instructions how to make if anyone's interested), the only trouble is that it causes a problem with the constructs like:
Code:
push [var1] [var2]    

which are allowed and I was even using the in fasm sources. With such feature enabled this would be interpreted as "push [var1+var2]", so it wouldn't be assembled correctly. I don't know if this feature would be worth such breaking the backward compatibility.
Post 28 Jan 2005, 13:00
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 dont like it, or any overbloating of syntax at all.
This way we will end up in M$ like
mov ax,a = mov ax, word a = mov ax, word ptr a = mov ax, word ptr [a] = mov ax,[a] etc.
Post 28 Jan 2005, 13:26
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
Quote:
Code:
mov [var][4],eax ; the same as mov [var+4],eax
mov dword ptr var[4],eax ; the same as mov dword ptr var+4,eax    

It's very easy to add such feature to parser (I can post the quick instructions how to make if anyone's interested), the only trouble is that it causes a problem with the constructs like:

hmm.. IMO that notation causes more consufion than good :/

maybew some "macromatic lea" (name sugesstion: 'mlea' or 'mea') would be better? eg:
Code:
variable = [labelName]
varname = mea variable+4 ; preprocessed to:  varname = labelName+4
varname = mea [variable+4] ; becomming (thoug "illegal" syntax): "varname = variable+4" => "varname = [labelName]+4"    

mea could work at fix/equ "level" to prevent [a+b] from 'expanding' (eg if a=1; b=2 mea [a+b] == '1+2'/'3' instead of (the desired) 'a+b' )
Post 28 Jan 2005, 14:19
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
I never liked that syntax at all. This is one of the kind of things I dislike from the Masm syntax.
Post 28 Jan 2005, 19:19
View user's profile Send private message Yahoo Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
pelaillo wrote:
This is one of the kind of things I dislike from the Masm syntax.


Me too. Smile
Post 28 Jan 2005, 20:40
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
I wouldn't want a solution that would case more problems than it solves. The macro I made seems to work good, but I don't know what kind of perfomance hits, if any, this method will cause.
MadMatt
Post 28 Jan 2005, 22:19
View user's profile Send private message Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin
JohnFound wrote:
pelaillo wrote:
This is one of the kind of things I dislike from the Masm syntax.


Me too. Smile


And me too
Post 29 Jan 2005, 06:26
View user's profile Send private message ICQ Number Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
I'm so glad to finally hear it from many people (after all those emails of "why can't I do this, with MASM I can!" style). Wink
Post 29 Jan 2005, 09:05
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:  
Goto page Previous  1, 2

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