I'll leave the memory map questions to others (not hard to explain, just don't have the energy), and I'll answer this one:
nes12 wrote:
3. I diassambled the battle city, and i see this insruction:
01: $874A LDA #$35 @ $879B (just illustration!)
@ $879B what is this ? I dont find on the WEB...
The disassembler you're using is doing something ridiculous (e.g. bug or very bad design), or you've made a typo when entering the actual instuctions/operand in your post here.
LDA #$35 loads the immediate value $35 (hexadecimal) into the accumulator. There's no addressing mode involved that would expand to an actual 16-bit PC address (e.g. $879B).
I've loaded up Battle City and I can't find this instructions at $874A. I know you said "just illustration!", so rather than illustration I'll show you some actual code in FCEUX:
Code:
00:876B:20 DD D6 JSR $D6DD
00:876E:AE 09 01 LDX $0109 = #$00
00:8771:B5 00 LDA $00,X @ $0000 = #$C0
JSR $D6DD is a jump-to-subroutine call that executes code starting at $D6DD.
LDX $0109 loads an 8-bit value from memory location $0109 into the X register.
At the moment this disassembly was generated, memory location $0109 contained value $00 (zero).
If the game was running while generating this disassembly, then it's very likely a subsequent disassembly or trace in real-time could show another value. (It's very easy to get lost/confused when in FCEUX in this regard -- you have to know what you're doing / be paying attention).
LDA $00,X loads an 8-bit value from a zero page location $00 (e.g. $0000) plus the content of the X register. In this case, X was $00 (zero), so $00 + $00 = load from $00. FCEUX does the math for you -- that's what the
@ $0000 part means. For example, take the following code:
Code:
LDX #$16
LDA $10,X
FCEUX would show the 2nd instruction as
LDA $10,X @ $0026 (because $10 + $16 = $26). Another example showing the nature of this:
Code:
LDX #$03
LDA $FF,X
FCEUX would show the 2nd instruction as
LDA $FF,X @ $0002 because this addressing mode is zero page only (8-bit).
FCEUX always shows the calculated effective address as a 16-bit address,
even if the addressing mode of the instruction only supports zero page (8-bit) addresses. This can be confusing, I know; that's purely an "FCEUX-ism". Other emulators or realtime debuggers might show things more appropriate (i.e.
LDA $FF,X @ $02 would make more sense).
There are other addressing modes that do support 16-bit addresses at runtime, e.g. zero page indirect indexed Y:
LDA ($nn),Y.
I suggest reading about 6502 addressing modes and some of this will become more clear. The
@ $nnnn thing, though, is a "feature" of FCEUX or whatever disassembler you're using. If it truly showed
LDA #$35 @ $879B then I classify that as a major bug.
P.S. -- Why did you pick this thread to ask this question? It has nothing to do with the original question asked (how to select a PRG/CHR page with mapper 1). You're asking basic 6502 questions, which deserves its own thread.