6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Jun 24, 2024 12:42 pm

All times are UTC




Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
PostPosted: Sat Oct 24, 2020 2:21 pm 
Offline

Joined: Mon Oct 19, 2020 2:11 am
Posts: 16
BigDumbDinosaur wrote:
Uh...there is no PLK instruction. In fact there is no direct programmatic means by which PB[color=#000000] can be modified.


I think that's a typo for PLB, which is "pull data bank register from stack".

Thus, my suggestion of getting a value into A, pushing it, then popping it out into the PDR with the PLB instruction. Maybe this doesn't meet your definition of "direct". (What would?)

Chromatix wrote:
The new registers in the '816 - PBR, DBR, DPR - are active and effective even in Emulation mode. Their default values out of reset give the same behaviour as a 65C02, but if you change them, they take effect immediately, even if you haven't switched to Native mode.


Ahah! Thanks. I'm certain that I read that in emulation mode, the high 8 bits of instruction fetch addresses were forced to zero, ignoring PBR. But I can't find that now, so I must have made it up or misunderstood something.

Since A15 and A21 are swapped, in emulation mode 0x20 bank addresses will be the RAM that eventually appears in the 0x00 bank. I think, then, we can either plan the copy a little better or plan the jump a little better.

If that doesn't pan out, I think I'd rather write a "thunk" or "jump pad" to RAM from the mapped ROM. The ROM writes that code to RAM, then jumps to that code ... which enters native mode, finishes necessary initialization, and then re-enters the ROM code at the newly mapped location. This way, very few bytes need to be copied and startup can continue expediently.

Anyway, thanks for talking it through -- now that I finally understand that the program bank register is honoured in emulation mode, I've got a much better picture. I like your bank/select swapping idea, and I'm sure I'll implement something like it.


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 24, 2020 2:40 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
There are certainly ways of making this work! I can confirm that a long jump to a non-zero bank works in emulation mode. (But in that state you pretty much need to avoid interrupts, which only stack two bytes of PC.)


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 24, 2020 4:19 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8230
Location: Midwestern USA
mikeblas wrote:
Thus, my suggestion of getting a value into A, pushing it, then popping it out into the PDR with the PLB instruction.

What is a "PDR?"

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 27, 2020 3:52 am 
Offline

Joined: Mon Oct 19, 2020 2:11 am
Posts: 16
BigDumbDinosaur wrote:
What is a "PDR?"
A typo for the PBR. So very sorry to not perfectly enter my thoughts. We can look up the PLB instruction, though, and see that it's target is indeed the PBR. So at least I got it half right!


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 27, 2020 5:32 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8230
Location: Midwestern USA
mikeblas wrote:
BigDumbDinosaur wrote:
What is a "PDR?"
A typo for the PBR. So very sorry to not perfectly enter my thoughts. We can look up the PLB instruction, though, and see that it's target is indeed the PBR. So at least I got it half right!

You don't need to get defensive about it. However, I will say accuracy in technical writing is important, especially for the benefit of those who are just learning the 6502 assembly language. With that thought in mind, please note that the PLB instruction loads DB from the stack. There is no instruction that can do the same with PB.

Anyhow, what I do in my source code comments and technical writing is to use two-letter references for registers, which among other things, prevents them from being mistakenly read as a instruction mnemonic (which "PDR" could be mistaken as). In doing so, I'm merely following something that was established by Jim Butterfield in the 1970s:

Code:
REGISTER          SYMBOL  COMMENT
—————————————————————————————————————————————————————————————————————————————
Accumulator        .A     primary 8-bit accumulator in 65C816 ('m' bit = 1)
Accumulator        .B     secondary 8-bit accumulator in 65C816 ('m' bit = 1)
Accumulator        .C     16-bit accumulator in 65C816 ('m' bit = 0)
X-index            .X
Y-index            .Y
Data bank          DB     default data bank in 65C816
Direct page        DP     direct page pointer in 65C816
Program bank       PB     default program bank in 65C816
Program Counter    PC
Stack Pointer      SP
Status Register    SR
—————————————————————————————————————————————————————————————————————————————

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 27, 2020 7:21 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
(It's best to note a typo in a private message, of course, especially when the meaning is clear.)


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 14, 2021 12:04 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1084
Location: Albuquerque NM USA
Going through old posts and ran across this one. I've built a zero glue logic Z80 SBC (with I/O), now I wonder whether it is possible to build zero glue logic 6502? Has this been talked about? If not, I can start a new thread so not to derail this one.
Bill

Edit, I think it IS possible to build zero-glue 6502 SBC with I/O


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 14, 2021 12:29 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
Definitely a new thread!

Edit: thanks plasmo, new thread here.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC


Who is online

Users browsing this forum: No registered users and 80 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: