1)
# = identifier for Immediate mode. LDA #$00 will put the actual value of $00 inside of A. LDA $00 (no # symbol) means Zero Page mode, which will read from address $0000 and will put whatever is there in A
$ = identifier for hexadecimal numbering
LDA $00 is the same as LDA 0
LDA $0A is the same as LDA 10 (10 decimal = $0A hexadecimal)
LDA #$0A is the same as LDA #10
2)
The '$' symbol prefixed before a number indicates that the number is in hex. Likewise there is the '%' symbol for binary. Lack of any symbol usually defaults to decimal. ie: "LDA $80" is the same as "LDA %10000000" is the same as "LDA 128"
Binary coded decimal (BCD) can be several different things. Somtimes it's where each digit of a byte represents a decimal number and not a hexadecimal number. For example $99 would actually be ninety-nine (99 decimal, $63). However doing math in this method of numbering is not supported natively by the NES, so games typically don't use this ever.
Other forms of BCD are where the game stores each digit of a large number in it's own byte for ease of drawing later. For example if the player had a score of 5623 points, the game might keep it in the following manner:
05 06 02 03 <--- each digit in its own byte.
This method is pretty common in many games. You'll be able to recognize it by how the code handles the numbers.
3)
AND works similar to ORA and EOR. I explained EOR in another post. AND is very similar, but works with different logic.
0 AND 0 = 0
0 AND 1 = 0
1 AND 0 = 0
1 AND 1 = 1
Therefore $63 AND $46 would result in $42... because:
Code:
$63=%0110 0011
$46=%0100 0110
--------------
$42=%0100 0010
LDA #$63
AND #$46 ; A now contains $42
AND is typically used for "masking out" bits. Or flipping off certain bits. For example, if you're only interested in a specific bit of a value, you could AND the value with that bit to turn off all other bits, leaving just the bit you're interested in.
4)
ADC performs addition. ADC #$03 will add 3 to whatever is in A. It may also add an additional 1 if the C flag is set before ADC is executed. Also note the difference between "#$03" and "$03", as one is immediate mode and the other is zero page mode (see my response to your first question)
5)
ROL "rotates" bits left 1. This works similar to ASL, only the carry flag is used for the bit that gets shifted in.
"ROL $02" uses Zero Page mode. This means that whatever is at address $0002 will be rotated left. A and other registers (except for the status flags) are completely unaffected.
"ROL #03" is impossible, as you cannot use immediate mode with ROL.
EDIT -- wouldn't you know that by the time I finish my post, 3 other people have posted? haw XD
EDIT again:
WedNESday wrote:
*Eventually Stops Laughing*
We were all learning at one time. He's in the newbie forum, if you don't want to see newbie questions, stay out. It's that simple. No need to be a jerk.