flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > (fasmg) invalid identifier

Author
Thread Post new topic Reply to topic
Mike Gonta



Joined: 26 Dec 2010
Posts: 243
Mike Gonta 07 Apr 2017, 10:19
Code:
include '8086.inc'
        org     100h
display_text = 9
hello_asm:
        mov     ah,display_text
        mov     dx,.1
        int     21h
        int     20h
.1 db 'Hello world!',24h    
The use of doted numbers as labels is very popular (at least with me).
Even (for example) hello_asm.1 is an invalid identifier

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com
Post 07 Apr 2017, 10:19
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 07 Apr 2017, 10:23
In fasmg "." is no longer a part of label, it is a special character that here indicates that symbol is going to be defined in the "hello_asm" namespace. Because it is not allowed to have a symbol with name "1", this results in error. This is something that is a consequence of fasmg having namespaces and it cannot be easily altered in this architecture.
Post 07 Apr 2017, 10:23
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 07 Apr 2017, 18:23
As a side note: even in fasm 1 such labels were a bit non-standard (I would personally avoid them), as before version 1.52 a symbol like ".1" was interpreted as a floating-point number.
Post 07 Apr 2017, 18:23
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 03 Sep 2017, 20:10
With the new releases of fasmg the identifier requirements are relaxed, numeric names are now allowed after the dot operator. The above source now assembles with no changes.

I'm sorry this took so long, I needed to re-consider the idea several times before I realized that this shouldn't hurt anything.
Post 03 Sep 2017, 20:10
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.