hoglet wrote:
drogon wrote:
Has no effect in emulation mode.
So it ignored the attempted change to bank 1 and the subsequent write and wrote $55 to bank 0...
I think there is an error in your test case.
You are testing using the Direct-Page addressing mode, which doesn't use the data bank register.
If you changed the test to use the Absolute addressing mode, I expect you would see a different result.
Dave
Ah ... *thud*
Right. I'd overlooked that the OPs assembler was treating $0000 as an absolute address vs. zp/dp address. Doh!
This:
Code:
00002Ar 1 A9 AA lda #$AA
00002Cr 1 8D 00 00 sta a:$0000
00002Fr 1
00002Fr 1 AD 00 00 lda a:$0000 ; Read and print $00
000032r 1 20 AB FF jsr oHex8
000035r 1 20 8C FF jsr osNewl
000038r 1
000038r 1 A9 01 lda #$01 ; Bank 1
00003Ar 1 48 pha
00003Br 1 AB plb
00003Cr 1
00003Cr 1 A9 55 lda #$55 ; Store $55
00003Er 1 8D 00 00 sta a:$0000
000041r 1
000041r 1 A9 00 lda #$00 ; Bank 0
000043r 1 48 pha
000044r 1 AB plb
000045r 1
000045r 1 AD 00 00 lda a:$0000 ; Read and print $00
000048r 1 20 AB FF jsr oHex8
00004Br 1 20 8C FF jsr osNewl
00004Er 1 60 rts
Prints
Code:
AA
AA
the
a: in ca65 forces absolute mode.
and if I use my mem dump command to dump bank 1:
Code:
* md 1 0000
01.0000: 55 01 01 01:01 01 01 01:01 01 01 01:01 01 01 01 | U |
01.0010: 01 01 01 01:01 01 01 01:01 01 01 01:01 01 01 01 | |
...etc
then the $55 is where it ought to be.
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/