[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Assembler code



"sanjaya" <pererasanjaya@gmail.com> wrote in message 
95bec359.0501142038.7cf17bad@posting.google.com">news:95bec359.0501142038.7cf17bad@posting.google.com...
>> >>can someone help me with the assembler code to move memory contents
>> >>from $DA00-$DBFF (Bank 1 main memory) to $8000-$81ff (main memory).
>> >>
>> >>thanks,
>> >>sanjaya
>> >
>> >
>
> Don't we have to activate soft switches to copy from Bank 1, Main meory?
>
> thanks,
> sanjaya

Yes.
On powerup bank 2 is switched in. Reading $C08B (TWICE) sets $D000-$DFFF to 
bank 1 read/write

lda $DA00  ;get byte in bank 2
sta  $300  ;save byte
bit   $C08B
bit   $C08B  ;switch in bank 1
lda  $DA00  ;get byte in bank 1
sta  $301    ; save byte
bit  $C083
bit  $C083 ; switch bank 2 back in
lda  $DA00
cmp $300
bne  ERROR