It is currently Tue Oct 16, 2018 1:52 pm

All times are UTC - 7 hours



Forum rules





Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Jan 20, 2018 2:08 am 
Offline

Joined: Fri Aug 01, 2014 3:13 pm
Posts: 31
I guess this is fairly trivial but I read the WLA documentation and used search engines and I can't understand were the problem is,
So, if someone is kind enough to tell me what is wrong with this I will be very glad.

So, I have an .ENUM inside a .SECTION like this:

Code:
.SECTION "section name" SEMIFREE
.ENUM $00
       _local_label dw
.ENDE

.ENDS


and then I have the same exact enum inside of another .SECTION

As far as I know the underscore makes the label local to the section were the .ENUM is,
So there shouldn't be any collisions with labels in other sections, yet WLA-DX says DIRECTIVE_ERROR: "_local_label" was defined for the second time.
Strangely enough, when using .ENUM, WLA-DX throws the DIRECTIVE_ERROR and doesn't generate any obj file, but if I use .DEFINE instead, it throws the same error but it does generate an object file ¿?

I also tried using @local_label and I got the same result.

There is anything I'm missing out?


Top
 Profile  
 
PostPosted: Mon Jan 22, 2018 1:58 am 
Offline

Joined: Fri Aug 01, 2014 3:13 pm
Posts: 31
OK, I think that I get it now
Underscore for local section labels only work with labels defined within the code.

Labels defined with .DEFINE( or .DEF .EQU .ENUM which are the same) are always in the module file scope,
labels defined with .DEF .EQU or .ENUM also do not show in the object symbol table unless you use .EXPORT
I can have the same .DEFINE in two different modules but not in the same one.

I guess I will have to use .RAMBANKS .STRUCT or whatever WLA has to offer, I wanted to use .ENUMS/.DEFINES thought,
as I only wanted to give names to the offset values of my local vars at to the stack.

Also if I understand it right, WLA Directives are a kind of minilanguage, is not like the C preprocessor that only expands text, C defines never show up on the symbol table since they are expanded out at preprocessing time( so just text expanding is performed)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: creaothceann and 5 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 Group