Here is some code to illustrate what I'm talking about.
; Code to be assembled with ASM6
; This is a routine which will handle all of my text writing.
- lda __, x ; this line is what I need help with.
cmp #$ff ; ff is a line terminator. When ff is reached, the text line is finished.
Is there a way I can make the LDA __,X above have an address that changes, so it will read a given line when I set it to it?
The only thing I can think of are the LDA Indirect opcodes, but I researched them, and I wasn't sure if they would do the trick. I know that I can read a value that is stored in an address, and get output that way, but I was just wondering if it is possible to change the table address that is read by the LDA, so I can use this routine for any line of text?
For instance, if I have:
LDA text_line1, x
Later on, I want to change that text_line1 to text_line2. Can that be done using the indirect LDA?