flat assembler
Message board for the users of flat assembler.
Index
> Main > restore label Goto page 1, 2 Next |
Author |
|
Overclick 23 Aug 2020, 09:22
Hi
How to get it work? Code: SomeLabel: ... restore SomeLabel ... jmp SomeLabel ... SomeLabel: ;jump needed to here It seems to work but it's not. |
|||
23 Aug 2020, 09:22 |
|
revolution 23 Aug 2020, 09:24
You can't undo assembler labels.
Either use a new name (perhaps with local), or use anonymous labels @@, @b, @f. |
|||
23 Aug 2020, 09:24 |
|
Roman 23 Aug 2020, 10:09
Or change sources Fasmw and write you own Fasmw version.
|
|||
23 Aug 2020, 10:09 |
|
revolution 23 Aug 2020, 10:12
Roman wrote: Or change sources Fasmw and write you own Fasmw version. |
|||
23 Aug 2020, 10:12 |
|
Roman 23 Aug 2020, 10:14
It be nice if this done Tomas
I am about this Code: SomeLabel: ... restore SomeLabel ... jmp SomeLabel ... SomeLabel: And this: Code: ;introduce more symbols for @f\@@. For example % or & %0: inc dword [ParamsA] jmp %1 ParamsA: dd 0,0,0,0 %1: cmp dword [ParamsA],10 jbe %0 %0: dec dword [ParamsA] cmp dword [ParamsA],1 ja %0 Or this label without ':': Code: jmp 1% 1% jmp 2% 2% Or jmp %1 %1 jmp %2 %2 Last edited by Roman on 23 Aug 2020, 11:20; edited 4 times in total |
|||
23 Aug 2020, 10:14 |
|
Overclick 23 Aug 2020, 10:18
I want to jump to unknown label as @F by macro. As It works fine when label declared later seems I have to numerate them. Actually I just thinking about possibility to change @@ @F to different names. I mean completely rewrite macros for all jump instructions with universal labels. That idea I have after Roman's thread where he cannot use @ symbols. Without "restore" it will be harder, but I see it possible.
For own use it can be new ability like @F2 @F3...@Fn It will shorter result code and jumps quantity. I'll think about it... Code: jmp @F2 ... @@: ... @@: ; destination Last edited by Overclick on 23 Aug 2020, 10:22; edited 2 times in total |
|||
23 Aug 2020, 10:18 |
|
Roman 23 Aug 2020, 10:21
Good but some time symbol @@ using macro or code:
Code: ;in this case some part(other) code may jump incorrectly @@ ! macro UnMacro { cmp eax,19 jbe @f mov eax,1 @@: } jmp @f UnMacro Datas dd 10,20,30 @@: mov ecx,10 loop @b Or i want jump second @@ Code: jmp @f Datas dd 10,20,30 @@: mov ecx,10 loop @b @@: Last edited by Roman on 23 Aug 2020, 10:29; edited 2 times in total |
|||
23 Aug 2020, 10:21 |
|
Overclick 23 Aug 2020, 10:25
Roman look at previous message )
|
|||
23 Aug 2020, 10:25 |
|
revolution 23 Aug 2020, 10:28
|
|||
23 Aug 2020, 10:28 |
|
Roman 23 Aug 2020, 10:30
revolution
Quote: Deja vu No ! People want more good features in Fasm ! Overclick Quote: look at previous post No ! Look at my post Last edited by Roman on 23 Aug 2020, 10:33; edited 2 times in total |
|||
23 Aug 2020, 10:30 |
|
Overclick 23 Aug 2020, 10:32
Quote:
Hmm, did you made it then? |
|||
23 Aug 2020, 10:32 |
|
Overclick 23 Aug 2020, 10:34
I almost done this macro for Romans thread but 'restore' changed my dreams ))
Have to rewrite with calculator of labels... Last edited by Overclick on 23 Aug 2020, 10:35; edited 1 time in total |
|||
23 Aug 2020, 10:34 |
|
Roman 23 Aug 2020, 10:35
Thanks man
|
|||
23 Aug 2020, 10:35 |
|
Overclick 23 Aug 2020, 10:52
Code: macro New@@ { purge @@ macro @@ \{ calc=calc+1 Last#calc=$ \} purge jmp macro jmp [param] \{ if `param='@F' dest=calc+1 jmp Last#dest elseif `param='@F2' dest=calc+2 jmp Last#dest ... else jmp param ... Just for example ps. Using match scaring me )) |
|||
23 Aug 2020, 10:52 |
|
DimonSoft 23 Aug 2020, 11:14
If the there’s another anonymous label between the target one and the jump source, it’s absolutely natural that there’s a perfectly valid meaningful name for at least one of the labels. local allows to reuse the same name in multiple places for macro-generated code by appending a unique sequence of characters. This solution makes code pieces fully movable between parts of a program without the need to fix anything. Why decrease code readability and maintainability in a language that is already hard enough by its nature?
|
|||
23 Aug 2020, 11:14 |
|
Overclick 23 Aug 2020, 11:24
It is just example. Final version can have some difficult name as local actually does. In this case you cannot use local as you don't know what name will be generated next time. Make difficult key-part of the label name by yourself.
|
|||
23 Aug 2020, 11:24 |
|
DimonSoft 24 Aug 2020, 08:50
Easily solvable by storing the information in a symbolic constant and retrieving it later. But I was more concerned about attempts to extend the anonymous labels feature and the consequences for the maintainability of the code that uses such extensions.
|
|||
24 Aug 2020, 08:50 |
|
Roman 24 Aug 2020, 09:14
Quote:
For this reason we need old style @f and @@ And new style %0 or %1 or %10000 Old code work fine because used old style @f and @@. New code work good because used new style % PS: And all happy And i test now in fasmw 1.73 this: Code:
%2:
jmp %2
Work fine. But not work if: Code: %2: jmp %2 %2: jmp %2 Last edited by Roman on 24 Aug 2020, 09:34; edited 3 times in total |
|||
24 Aug 2020, 09:14 |
|
Roman 24 Aug 2020, 09:26
My proposition create special fasm list of labels !
a b c this is a usual fasm macro. Its look like this: Code: llabels (%1\a 1,2\%2\b 4,%2\%3\c) Its generate this: Code: %1: a 1,2 %2: b 4,%2 %3: c cmp eax,10 ;this i write jbe %1 |
|||
24 Aug 2020, 09:26 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.