Quote:
As far as I can tell that branch will *never* be taken. Am I missing something, or is that just something he left in by mistake?
Code:
LDA SAVY ; ?? not sure what these two lines are for...
BEQ LERROR ; ?? afaict SAVY will never be 0, so why check?
It looks like this location you've called SAVY is used a couple of times to save Y but also used for a couple of other purposes. At this point in the code, it's saving which of LSV is the current command. (If there were more commands, we'd also have got into this area, but by this point we know we are running an L command.) So, I agree, this looks like a remnant. If the check for L failed, the code presently branches to an error handler, but that check could have allowed the handling of more commands. So I think it's a remnant, which isn't even quite in the right place any more.
As for the loop, perhaps at one point it might have been copying more, or might have had the potential to need to copy more.
Pretty much everyone makes mistakes - it's more a question of whether they've all been found and fixed by time someone else sees the code. Until every last byte has been squeezed, even evidence that some byte-squeezing has been done doesn't mean that all the dead code has gone. Working on something as large as this, you need a lot of context in your head. Some parts will be more familiar than others, even if you wrote it yourself. So, you'll squeeze something which is close to hand, or close to mind - you won't carefully review every line, because there's no need.
This kind of archaeology is fascinating! You may be aware that we found odd bits of nonsense layout in the 6502 when looking over visual6502 - even a chip which had to be squeezed is not clear of oddities, because the work stops when it's good enough, and small enough.