SamCoVT / TaliForth2

A Subroutine Threaded Code (STC) ANSI-like Forth for the 65c02
Other
29 stars 5 forks source link

merge definiitions with relocatable tables to ease understanding and maintenance #56

Closed patricksurry closed 5 months ago

patricksurry commented 5 months ago

the extra asm pass is a good idea. This has no functional change, it just merges the definition and declaration of the relocatable zero page and user page tables which makes them much easier to understand and keep in sync.

The tables end up at the end of native words instead of just after cold but that doesn't change any behavior.

Let me know if you're OK with this approach before I make any changes to where variables live etc.

SamCoVT commented 5 months ago

I think this approach looks good. 64tass is way more powerful than Ophis (the assembler we were using previously), but we've really only used the conditional assembling up to this point. The only sad note is that this will be one more hurdle for people trying to port to a different assembler, but they should be able to recreate the labels without too much hassle and this will make less of a chance of oopsies by having the labels and starting values in two different places.

Let me know when you like this and I will merge it.

patricksurry commented 5 months ago

haha, that's funny I have no recollection of where it came from.

I've mostly used ca65 in the past which does a decent job with segments but needs a separate linker config file.

agree it'd be good to minimize use of special assembler features but this does seem worth it here.

I'm good with this as a place to build off.

SamCoVT commented 5 months ago

One note about the .logical and .virtual assembler directives (post merging):
This is apparently a new feature of 64tass - I had to upgrade for it to assemble with these new directives. I was on 1.54.1900 (did not work - I installed it in 2020) and am now on 1.56.2625 (assembles fine, this version released in 2021) by asking my package manager to install it for me (it's not the newest version, but is new enough). It might be worth adding 1.56.2625 as the minimum version for 64tass in the docs (I'll add it to my list of "not critical, but probably should do" updates for the docs).

patricksurry commented 5 months ago

Interesting. I’m new to this assembler so wasn’t thinking about recency. Iirc there’s a note in the doc that one of logical/virtual was renamed from some confusing legacy name which is now deprecated