6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Jul 02, 2024 12:55 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Jun 07, 2024 12:34 am 
Offline

Joined: Tue Sep 26, 2023 11:09 am
Posts: 53
c65 provides pseudo functions .STRING and .IDENT that let you convert a string literal to a symbol and vice versa. Can I do that in 64tass? Things like str, repr and format seem to operate on the *content* of the symbol, whereas I want its name.

e.g. if i have a symbol fubar and I want to generate .text "fubar" or conversely I have a string "fubar" (e.g. in a macro) and want to generate the symbol fubar.

note: the manual mentions macro text references via @1 which seems potentially relevant but this is gated to tasm-compatibility mode where a bunch of tass64 features I'm already using no longer work. But it gave me some hope that there would be some other way to do it in normal mode.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 08, 2024 12:57 pm 
Offline

Joined: Tue Sep 26, 2023 11:09 am
Posts: 53
Some progress: progress! some code browsing and experiments with `type` and `repr` helped me start to understand the 64tass type system. if I have code like:
Code:
foo: nop

then `foo` has `code` type, and `repr(foo)` uses its address, but the dot operator (mentioned once in passing in the doc) makes `.code` a symbol, and `str(.foo)` gives the literal `"foo"`. I still can't figure out how to go the other way, from the literal to the symbol, but this is enough for what I need. I thought maybe `."foo"` or an explicit `symbol("foo")` but doesn't seem like `symbol` is exposed like that


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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: