Page 1 of 1
Data Bank (B) register woes (attn: koitsu, byuu)
Posted: Mon Aug 08, 2016 9:29 am
by Ramsis
So whenever I attempt to change B, the Data Bank register, to a different value using code like this (assume A = 8 bit):
... then B apparently isn't updated to $XX immediately, unlike with Direct Page register changes. The tracelog tells me that several, even dozens of absolute (i.e., 16-bit operand) instructions that use the old data bank may pass before it switches to the new one.
Is this normal? Or what am I doing wrong?
Thanks for any advice!

Re: Data Bank (B) register woes (attn: koitsu, byuu)
Posted: Mon Aug 08, 2016 10:08 am
by Revenant
plb definitely should be updating DB immediately. What are you using to generate the tracelog?
Re: Data Bank (B) register woes (attn: koitsu, byuu)
Posted: Mon Aug 08, 2016 10:34 am
by Ramsis
... I'm a dumb**s.
Right after posting this, I realized that I was staring at DP (Direct Page) instructions instead of absolute ones like I thought I used in my code ... and DP is always in bank $00, right? So yeah, my mistake. Don't bother with it.

Re: Data Bank (B) register woes (attn: koitsu, byuu)
Posted: Mon Aug 08, 2016 10:52 am
by Drew Sebastino
Ramsis wrote:DP is always in bank $00, right?
I've been using DP as an index register when I've ran out, so this is very good to know, because if anything I'm trying to point to isn't in bank $00 (which I don't think my object table with as many entries as I want will fit in the ram there) then I'm going to have a problem.