flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
revolution 23 Apr 2025, 13:50
Make sure there aren't any non-dot labels in between the local labels.
Code: label1: .local1: ; label1.local1 label_other: .local2: ; label_other.local2 |
|||
![]() |
|
FoXx 23 Apr 2025, 16:11
revolution wrote: Make sure there aren't any non-dot labels in between the local labels. Code: proc MyFunc _MyFuck: ; init one .local_label1: ... {asm code} ... .local_labelN: endp Will this syntax work correctly? |
|||
![]() |
|
AsmGuru62 23 Apr 2025, 16:20
So, how many lines in the procedure?
I am currently writing the IDE, so just curious to know. |
|||
![]() |
|
revolution 23 Apr 2025, 16:27
"proc MyFunc" is a wrapper that defines a label "MyFunc".
Then there is a new label "_MyFuck" that defines a new label. This new label "_MyFuck" will restart a new set of local labels. I suggest you rename "_MyFuck" to ".._MyFuck". Putting the double dots won't start a new label set. |
|||
![]() |
|
macomics 23 Apr 2025, 16:41
The error message shows a label without a dot, with which the name is joined with a dot (HTTPRequest.find_first). Such a name (without a dot) can be in the code before the jmp command, and not before the label is declared.
|
|||
![]() |
|
FoXx 23 Apr 2025, 17:25
revolution, thanks for the tip. I just noticed that the name "_MyFunc" was autocorrected to something else.
![]() macomics wrote: The error message shows a label without a dot, with which the name is joined with a dot (HTTPRequest.find_first). Such a name (without a dot) can be in the code before the jmp command, and not before the label is declared. This is the name of the procedure and there is no other Code: proc HTTPRequest ... .find_first: ... .find_next: ... endp If you declare a local variable an error "lpBuffer.scan" Code:
proc MyProc
Local lpBuffer dd ?
...
.scan:
...
endp |
|||
![]() |
|
macomics 23 Apr 2025, 17:36
This means that the jmp command is in the right place, but the label is declared in the wrong place. Try running the
Code: .find_first: jmp .undefined_name Code: error: undefined symbol 'XXXX.undefined_name'. ; XXXX - That's the name that's causing you problems. Most likely, such an announcement is added by some kind of macro. ADD: You don't give the whole procedure code so that you can poke your nose. But now EW is interfering with telepathy. |
|||
![]() |
|
FoXx 24 Apr 2025, 06:08
revolution and macomics, thank you for your good work.
It's not just the variable names that I'm making mistakes in. There's an unnecessary global label defined in the code. Quote: The basic rule for defining labels: do not mix global and local labels in a procedure. Code: proc MyFunc .local_label1: ; MyFunc.local_label1 correctly ... local_lable2: ; local_lable2.local_label1 this is not a local label ... .local_labelN: ; local_lable2.local_labelN change label name endp |
|||
![]() |
|
revolution 24 Apr 2025, 06:22
FoXx wrote:
Code: local_lable2: ; local_lable2 this is not a local label |
|||
![]() |
|
FoXx 24 Apr 2025, 09:50
revolution, isn't «local_lable2» without a dot a global label?
|
|||
![]() |
|
revolution 24 Apr 2025, 09:55
FoXx wrote: revolution, isn't «local_lable2» without a dot a global label? |
|||
![]() |
|
FoXx 24 Apr 2025, 14:28
I thought there were absolute and relative labels. Absolute ones are visible everywhere. Relative ones complement absolute ones. If you declare a label without a dot, it will be visible everywhere. Local label will change after each global label. Did I understand correctly?
|
|||
![]() |
|
revolution 24 Apr 2025, 14:46
Labels never change. All labels are visible everywhere.
Code: a: .b: ; a.b .c: ; a.c d: .e: ; d.e .f: ; d.f jmp a ; valid jmp a.b ; valid jmp .b ; invalid, no label d.b jmp .f ; valid d.f jmp d.f ; valid |
|||
![]() |
|
macomics 24 Apr 2025, 14:58
FoXx wrote: Did I understand correctly? When you declare a struct <name>, no labels appear. But after the instance is declared, the label name appears, which is concatenated to all the "local" names in the struct. This will only happen with the name without the dot. Code: struc A { .a db ? .b db ? } C A ; C.a db ? ; C.b db ? .Z A ; first .Z binds to C.b -> C.b.Z ; C.b.Z.a db ? ; C.b.Z.b db ? mov ah, [C.a] ; C.a mov al, [C.b] ; C.b mov bl, [.Z.a] ; C.b.Z.a mov bh, [.Z.b] ; C.b.Z.b mov ch, [C.b.Z.a]; C.b.Z.a mov cl, [C.b.Z.b]; C.b.Z.b D A ; D.a db ? ; D.b db ? .Y A ; first .Y binds to D.b -> D.b.Y ; D.b.Y.a db ? ; D.b.Y.b db ? mov ah, [C.a] ; C.a mov al, [C.b] ; C.b mov bl, [.Y.a] ; D.b.Y.a mov bh, [.Y.b] ; D.b.Y.b mov ch, [D.b.Y.a]; D.b.Y.a mov cl, [D.b.Y.b]; D.b.Y.b mov dh, [C.b.Z.a]; C.b.Z.a mov dl, [C.b.Z.b]; C.b.Z.b And there is no more labels process going on. In proc macros, all basic types are overloaded as struc to specify local in the procedure body. That's all that changes. That is, there is no declaration of a real byte instead of db, but simply 1 is added to the stack to local variables. ADD: Now there is a namespace in fasmg. |
|||
![]() |
|
FoXx 27 Apr 2025, 07:15
macomics, I have another question.
Code: proc MyFunction .local_1: ..sub_local: ; MyFunction.local_1.sub_local .local_2: endp |
|||
![]() |
|
revolution 27 Apr 2025, 07:23
Code: proc MyFunction .local_1: .local_1.sub_local: ; MyFunction.local_1.sub_local |
|||
![]() |
|
macomics 27 Apr 2025, 08:17
or
Code: macro global name { if 0 label name end if } proc MyFunction .local_1: global MyFunction.local_1 .sub_local: ; MyFunction.local_1.sub_local global MyFunction .local_2: ; MyFunction.local_2 endp |
|||
![]() |
|
FoXx 27 Apr 2025, 09:47
revolution, I understand. An interesting option.
macomics, is it possible to declare a label twice? |
|||
![]() |
|
revolution 27 Apr 2025, 09:54
The double dot (..) is to declare a non-local label without changing the base label. It is a special syntax specifically to support that.
Code: a: ; a ..b: ; ..b, doesn't change the base label a .b: ; a.b |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.