BitWise wrote:
BigEd wrote:
It is a bit of a gotcha though, well spotted.
It depends. In the WDC CC startup code MVN is used to copy the initialised data to its RAM area leaving DBR set to correct block to access it.
If only Iwas using the WDC C compiler and looking at the output..
BitWise wrote:
If you are using it as a general purpose block copy then yes save the original DBR before copying and then restore it.
I've still not found reference to it in the David Eyes and Ron Lichty book, however after re-reading the WDC Datasheet for the 65C816S, on page 20 I've found:
Quote:
The second byte of the block move instructions is also loaded into the Data Bank Register.
And there is mention of it on page 54 too.
I suspect it alternates the DBR with source bank (read a byte) then destination bank (write a byte) and it therefore ends up containing the destination bank number.
So after reading the fine programming book and finding nothing, I had to go back and read the fine data sheet. Ah well.
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/