Board.KolibriOS.org

Official KolibriOS board
It is currently Fri Apr 19, 2019 3:42 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 21 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Sun Jan 18, 2015 9:53 pm 
Offline
User avatar

Joined: Thu Nov 27, 2014 1:24 am
Posts: 71
e-andrew wrote:
".." генерирует метку с уникальным именем.

Code:
macro test {
        ..test_label:

        jmp     ..test_label
}

test
test   


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


Top
   
PostPosted: Sun Jan 18, 2015 9:55 pm 
Offline
User avatar

Joined: Sat Oct 05, 2013 9:32 pm
Posts: 386
Хм, посмотрел в мануале, это действительно не так.

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


Last edited by e-andrew on Sun Jan 18, 2015 9:56 pm, edited 1 time in total.

Top
   
PostPosted: Sun Jan 18, 2015 9:55 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1247
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.

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Top
   
PostPosted: Sun Jan 18, 2015 9:57 pm 
Offline
User avatar

Joined: Sat Oct 05, 2013 9:32 pm
Posts: 386
"respected programmer told me they are unique" - сразу говорю, что не я, сам прочитал это где-то.


Top
   
PostPosted: Sun Jan 18, 2015 9:58 pm 
Offline
User avatar

Joined: Thu Nov 27, 2014 1:24 am
Posts: 71
e-andrew wrote:
Я так понял, для генерации уникальных меток нужно добавлять local

Да, именно так.


Top
   
PostPosted: Sun Jan 18, 2015 9:58 pm 
Offline
Public Relations
User avatar

Joined: Mon Jun 07, 2010 12:01 pm
Posts: 1879
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 21 posts ]  Go to page Previous 1 2

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited