Hello this is my test code:
LDX #$2000
LDY #$1000
LDD #$0000
la: ADDD #1
MOVB 1, X+, 1, Y+
TST -1, X <-- what do I check here?
BNE la
My question is what do I check with the TST -1,X? I know that TST checks if my register is 0 or negative. But what does -1, X mean?. When is this condition not true?
This is a copy function, possibly used for null terminated strings.
XandYare the 16 bit index registers used to hold addresses.With
MOVB 1, X+, 1, Y+you first move the data from addressXtoYand then post-increment both addresses.TST -1, Xchecks the contents of the address thatXhad before that post-increment. If not zero then loop, otherwise stop.