flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Name length

Author
Thread Post new topic Reply to topic
darkprof



Joined: 25 Jul 2016
Posts: 3
darkprof 11 May 2019, 10:19
This code don`t work
Code:
push aS
aS: '%s', 0
    

But if rename aS to aS_, code compiled.
Post 11 May 2019, 10:19
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 11 May 2019, 10:32
"as" is a reserved word.

You can use single letter labels.
Code:
push a
a: '%s', 0    
And indeed any length label you want, including very very long names. But you have to avoid the reserved words.
Post 11 May 2019, 10:32
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 11 May 2019, 10:35
Actually if you had reversed the lines the error message would have been more enlightening.
Code:
as:
push as    
And the result:
Code:
as:
processed: as:
error: reserved word used as symbol.    
Post 11 May 2019, 10:35
View user's profile Send private message Visit poster's website Reply with quote
darkprof



Joined: 25 Jul 2016
Posts: 3
darkprof 11 May 2019, 11:49
revolution wrote:
Actually if you had reversed the lines the error message would have been more enlightening.
Code:
as:
push as    
And the result:
Code:
as:
processed: as:
error: reserved word used as symbol.    

Second symbol in uppercase
Code:
flat assembler  version 1.73.11  (128000 kilobytes memory, x64)
test.asm [24186]:
  push aS
processed: push aS
error: invalid operand.
    
Post 11 May 2019, 11:49
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 11 May 2019, 16:30
All reserved words are valid in any mixed case.

as == aS == As == AS.

This is different from normal labels, which are case sensitive.

a != A
Post 11 May 2019, 16:30
View user's profile Send private message Visit poster's website Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 763
guignol 13 May 2019, 03:37
how dare you to reserve like that
Post 13 May 2019, 03:37
View user's profile Send private message 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.