I stayed with the tutorials on Random's website for a couple of hours and got to lesson 12 understanding most of what I was doing but I found myself constantly confused at some portions of the code I would be looking at.
While the tutorial I'm currently going through is good, and very informative, I feel it was missing some key elements/just brush over them with minor detail that I still need to study up on and get clarification on as well. The following information I feel should have been the first thing taught and really hammered into the student, if you have a solid understanding of the following, I feel the rest will come very easily.
From my current understanding, which could be incorrect as I am still learning, the 6502 has 3 registers (I consider them variables, but that is just how I think about it) that you can us, A, X, and Y. The operations you have for each variable is as follows:
sta <- store a into the following
lda <- load a with the following
ina <- increment value stored in variable a
dea <- decrement value stored in variable a
A has other oprerations as well, and as the author discribed it, its the "workhorse" of the 3 registers available on the 6502 (really the 6507) CPU.
stx <- store x into the following
ldx <- load a with the following
inx <- increment value stored in variable x
dex <- decrement value stored in variable x
sty <- store x in the following
ldy <- load x with the following
iny <- increment value stored in variable y
dey <- decrement value stored in variable y
The other thing I'm still trying to wrap my mind around completed is how you use these registers with the registers from vcs.h. Such as the following:
ldx #0 stx COLUBK
I guess for me I have to reverse my thinking of how these registers work. I'll explain with the following example:
ldx #0 really means the following in x = 0 stx COLUBK really means the following COLUBK = x
However in my mind, I would think ldx would be used to retrieve the value of x. Same thing for the stx which really means "store x in" and is used to take the value in the register x and put it int he following register COLUBK, in my mind it would be reverse, I want to think of it as storing a value into x.
While this might seem minor and trivial, it was a small yet important concept for me to wrap my head around last night and this morning. I guess this just shows how I have to learn different from others which is fine.
The more I think about trying to program in machine language, the more I'm applying natural language to each statement to help me retain this information in my memory.
ldx is "load x with the following"
stx is "store x in the following"
I'm thinking of going through my books tonight to learn how loops, if statements and other basic operations that are pretty much universal in all languages, meaning Java, BASIC, C, Assembly all have IF statements its just learning the way the specific language requires you to setup the statement, before I continue with the rest of the 2600 programming tutorial on Randoms website. I think I will have a stronger grasp of the Machine Language if I go about it in this manor.
If I've made any glaring errors in this please let me know so I can correct myself and learn!