Page 2 of 2

Re: Маленький баг в macros.inc

Posted: Sun Jan 18, 2015 9:53 pm
by Anton_K
e-andrew wrote:".." генерирует метку с уникальным именем.

Code: Select all

macro test {
        ..test_label:

        jmp     ..test_label
}

test
test   
Получаем ошибку: "symbol already defined". Я что-то упустил?

Re: Маленький баг в macros.inc

Posted: Sun Jan 18, 2015 9:55 pm
by e-andrew
Хм, посмотрел в мануале, это действительно не так.

Я так понял, для генерации уникальных меток нужно добавлять local

Re: Маленький баг в macros.inc

Posted: Sun Jan 18, 2015 9:55 pm
by hidnplayr
Anton_K wrote:Why "..jumpaddr:"? This labels should be marked as local with "local" directive. For now they are global (".." marks global labels) and macros can be used only once bacause of name collision of the label.
A respected programmer told me they are unique, clearly I'm an idiot for not double checking.

Re: Маленький баг в macros.inc

Posted: Sun Jan 18, 2015 9:57 pm
by e-andrew
"respected programmer told me they are unique" - сразу говорю, что не я, сам прочитал это где-то.

Re: Маленький баг в macros.inc

Posted: Sun Jan 18, 2015 9:58 pm
by Anton_K
e-andrew wrote:Я так понял, для генерации уникальных меток нужно добавлять local
Да, именно так.

Re: Маленький баг в macros.inc

Posted: Sun Jan 18, 2015 9:58 pm
by yogev_ezra
hidnplayr wrote:
Anton_K wrote:Why "..jumpaddr:"? This labels should be marked as local with "local" directive. For now they are global (".." marks global labels) and macros can be used only once bacause of name collision of the label.
A respected programmer told me they are unique, clearly I'm an idiot for not double checking.
This programmer is no longer respected for watching our forum all the time and commenting about it on the IRC, but not having courage for commenting on the forum anymore.