flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > label with no value, no namespace but if defined |
Author |
|
bitRAKE 30 Mar 2023, 22:51
Here I extend the example from the fasmg documentation:
Code: postpone namespace GLOBAL element NOVALUE irpv G,GLOBAL label G:NOVALUE at NOVALUE end irpv end namespace end postpone struc (head) ? tail& match ,tail display 10, `head," is NOVALUE" define GLOBAL head macro ? line& purge ? end macro end match head tail end struc dd Main.local_to_main Main: undefined_labels_have_no_value IwantItToBeALAbelWithoutValue .local_to_main: |
|||
30 Mar 2023, 22:51 |
|
revolution 31 Mar 2023, 00:36
The double dot is for global labels not attached to a preceding label.
Code: label1: ..global1: .local1: ..global2: |
|||
31 Mar 2023, 00:36 |
|
Roman 31 Mar 2023, 07:57
revolution wrote: The double dot is for global labels not attached to a preceding label. This is work in Fasmw 1.73 too? |
|||
31 Mar 2023, 07:57 |
|
revolution 31 Mar 2023, 08:34
Roman wrote:
Try it. |
|||
31 Mar 2023, 08:34 |
|
edfed 01 Apr 2023, 00:13
cool very cool. i'll use it
but what i suggest is a label withou any value attached to it. like: Code: Global. mov eax,Global;impossible to do if defined Global display 'yes' end if if Global=3 impossible to know end if Global.;no error even if still defined if Global eq display 'yes it exists' end if if Global ~eq impossible to know end if something like that. but of course, the negative conditions are not mandatory. the only condition to have is a label without value attached to it, and global, and reccursive, and don't care if still defined |
|||
01 Apr 2023, 00:13 |
|
revolution 01 Apr 2023, 01:39
Assign no value.
Code: Global = |
|||
01 Apr 2023, 01:39 |
|
macomics 01 Apr 2023, 07:01
Code: struc global { if 0 label . end if } Label1=1 mov al,Label2.local6 Label2: .local1: db '1' .local2=2 .local3 global Global1 global .local4: Global2 global if defined Global1 .local5=5 end if .local6 db 6 |
|||
01 Apr 2023, 07:01 |
|
edfed 01 Apr 2023, 10:38
it is to have an intuitive and easy to use boolean flag useable during preprocessing.
not the same as label equ thing label: label= thing cause theses still have a purpose. Code: DEBUG: if DEBUG mov eax,thing end if for the moment, the best fit is label: but it have a scope, and i don't care the value assinged to it. and it needs something around to if that Code: if defined DEBUG end if |
|||
01 Apr 2023, 10:38 |
|
revolution 01 Apr 2023, 11:42
Why must it have no value?
Code: DEBUG = 0 ; don't want debug ;... DEBUG = 1 ; gimme the debugs ;... |
|||
01 Apr 2023, 11:42 |
|
edfed 01 Apr 2023, 19:36
I want to put it anywhere, and don't need it to be defined if i don't want it in the code.
if i write a if VAR no error and for a mov eax,var error cause it is an internal compiler flag hem.. now it makes all sense, if i don't need a value for a label, how to react to a undefined value... |
|||
01 Apr 2023, 19:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.