Here's how I understand what you want.
Somewhere there's a table of addresses, called tab_pt_col,
for locations of lda # instructions in your code that you want
to alter depending on what you're doing now, and somewhere else
there's a table called tab_col_boss of values to stuff
in corresponding lda # locations (they correspond, therefore you
only need one index so the same index can be used for the
locations and their new values)
I'm not quite sure of the purpose of putting the tab_pt_col
table in zp and using X, I don't think it's faster but I didn't
count the cycles
Anyway, here's what I came up with
I split the tab_pt_col table in two, one for the low
byte and one for the high byte
And since you don't seem averse to self modifing code,
I used self modifing code.
With this code you pass a single byte base address parameter
in y. The parameter is the begining of the tab_col_boss table
and has to be somewhere in the tab_col_boss page
(so you can have more than one table as long as they're all
in the tab_col_boss page).
some where you have to initalize pt_col
Code:
lda #tab_col_boss_page
sta pt_col+1
and then you'd ldy parameter and jsr CHANGE_COL
Code:
CHANGE_COL
sty pt_col
ldy #$0B
LP_COL
lda tab_pt_col_lo,y
sta POINTER+1
lda tab_pt_col_hi,y
sta POINTER+2
lda (pt_col),y
POINTER
sta $0000
dey
bpl LP_COL
rts
Edit: it occurs to me that I may have introduced
a source of some slight confusion in that I reused the name
"pt_col" but it's used for something else. POINTER+1
and POINTER+2, ie the $0000 in the sta $0000 instruction,
take the place of pt_col of the original code