tonyrocks wrote:I'm a little confused on what sta $200,y does and how to convert to vic-20 asm.
STA $0200,Y writes the value of the accumulator A into the address defined by adding the Y index register to $0200. In BASIC, the command
POKE 512+Y,A (with A,Y = 0..255) would be the direct equivalent. Whether thrashing bytes in the range $0200..$02FF on the VIC-20 is a good idea, is altogether another matter - but that's what the instruction also does on the VIC-20's 6502, regardless.
Your example endlessly writes to $0200..$05FF ever increasing values (derived from the X register by TXA) to every second byte, leaving a gap of 4 bytes should the low byte of the addresses become equal to either 16 (with an implied # in the CMP instruction), or the value in address 16 (if the instruction CMP 16 is meant as is). As complicated as this sounds, this routine IMO serves no conceivable use. You might be better off looking for routines, that have been written with an actual (machine independent) use for the 65xx series in mind.
http://6502.org might serve as a useful start point.
If you find compelling examples of 6502 routines written for the VIC-20, we can of course also discuss them here in Denial.