SamCoVT / TaliForth2

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

should MARKER state really include BLK and SCR ? #75

Closed patricksurry closed 2 months ago

patricksurry commented 3 months ago

I was looking at the MARKER code and noticed it has hard-coded 4 and 40 constants relating to user table offset. I was going to add marker_state_start/end labels within cold_user_table in definitions.asm to avoid the magic numbers (like below). But then I wondered whether it should actually save/restore the two block variables - wouldn't this potentially mess up screen editing when you released the marker?

cold_user_table:
    .logical 0          ; make labels here offsets that we can add to 'up'
...
marker_state_start:
; Block variables
blk_offset:             .word 0         ; BLK
scr_offset:             .word 0         ; SCR
...
search_order_offset:
    .byte 0,0,0,0,0,0,0,0,0             ; SEARCH-ORDER (9 bytes to keep offsets even)
marker_state_end:
SamCoVT commented 3 months ago

I suspect this is an issue with using hard constants and the shuffling of things into the "RAM system variables". The comments seem to indicate the desire was to save CURRENT through the wordlists. It's also possible that I just can't count and used 4 as CURRENT is the 4th word in that location. This definitely should use labels and should not include BLK and SCR. I wrote this word, so it's my bad regardless of how it came to be - using labels should fix things.

SamCoVT commented 3 months ago

Do you want to fix MAKER or should I add it to my list?

patricksurry commented 3 months ago

I’m happy to do it. I’m working on a few things to streamline compilation a little so I’ll add to that.