flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > New FASM feature. :)

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 01 Oct 2003, 18:45
Here's the first beta release with my implementation of that feature with the ` character as conversion operator. I've also allowed # operator to be used to concatenate quoted strings only, so this version is able to correctly process such macro for object files:
Code:
macro EXTRN symbol
{
  if used symbol
   extrn '_'#`symbol as symbol
  end if
}    
Post 01 Oct 2003, 18:45
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 01 Oct 2003, 19:38
It works great with my sources. Thank you. Smile

Please yourself, but I still think ` isn't good choice. It's good for advanced user, but as scientica wrote, newbies will have troubles with it. It simply decrease readability of the source. Not everyone using syntax highlighing. Please, think again.

Regards.
Post 01 Oct 2003, 19:38
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Yawgmoth



Joined: 20 Aug 2003
Posts: 37
Yawgmoth 01 Oct 2003, 20:07
Yeah, ` is way, way too similar to '.
Post 01 Oct 2003, 20:07
View user's profile Send private message Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 02 Oct 2003, 04:27
What do the fasm usesr from those contries that uses a non latin charset (e.g. China, Russia) say? is it easy to differe betwen ' and '? Are they accessible at all on the keyboard? (I just thought of this, after seeing a chinese keyboard layout)

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 02 Oct 2003, 04:27
View user's profile Send private message Visit poster's website Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 02 Oct 2003, 07:17
With FasmW, it shouldn't be any problem since the AsmEdit-control highlights ' and " as strings, while ` is highlighted as a symbol.... Wink IMHO: we should go for `... But, that's what I mean...

Good work Tomasz (and John)! Wink

So long!
Tommy
Post 02 Oct 2003, 07:17
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 02 Oct 2003, 07:17
Yes scientica is right. IMHO it is confusing and difficult to read.

What about ~ or § or > (^ is good too)?
Post 02 Oct 2003, 07:17
View user's profile Send private message Yahoo Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 02 Oct 2003, 08:21
It is one of the base set of ASCII (please check in the characters table in my tutorial preliminary Wink), so there can't be any trouble with it.

There is only one small problem with this feature - it is not as clear and logical in use as concatenation operator, and this also be a trouble for newbies. That is, it has to be explained clearly in documentation, that only the single word following the ` operator is converted into type of quoted string. For example, when we define such macro:
Code:
macro test arg { db `arg }    

and then use it like here:
Code:
test 2+2    

it will end as:
Code:
db '2'+2    

and it may be a bit confusing.
Post 02 Oct 2003, 08:21
View user's profile Send private message Visit poster's website Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle 02 Oct 2003, 09:18
and what about ::

_________________
Microsoft: brings power of yesterday to computers of today.
Post 02 Oct 2003, 09:18
View user's profile Send private message Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark 02 Oct 2003, 13:55
In my keyboard layout, It's impossible to type that char (grasp accen '~' has been used to switch the keyboard layout from Thai to English and it's hard to change and It share with that char).
Post 02 Oct 2003, 13:55
View user's profile Send private message Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 02 Oct 2003, 14:37
Privalov wrote:
Code:
macro test arg { db `arg }    

and then use it like here:
Code:
test 2+2    

it will end as:
Code:
db '2'+2    

and it may be a bit confusing.

Hmm... What about:
test (2+2) ? will it be:
db '?'

(Haven't been able to try the beta yet)

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 02 Oct 2003, 14:37
View user's profile Send private message Visit poster's website Reply with quote
aaro



Joined: 21 Jun 2003
Posts: 107
Location: hel.fi
aaro 04 Oct 2003, 16:24
How about this:
After replacing symbols with their values replace all ` with '
then you could code things like:
Code:
macro test arg {
value = arg
db `arg`,'=',`value`
}

test 2+2
;Will become:
db '2+2','=','4'
    

Without problems
Post 04 Oct 2003, 16:24
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 04 Oct 2003, 17:55
At the stage when macros are preprocessed there already are no more characters like ' - quoted strings and simple words are two types of "byte streams" there, and that operator simply converts one into another.
Post 04 Oct 2003, 17:55
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.