• Please review our updated Terms and Rules here

Mos 6509 question?

Pet Rescue

Experienced Member
Joined
Dec 15, 2010
Messages
484
Location
Staffordshire, England
I have been reading up on computer systems when I stumbled across this excerpt in a book:-

"MOS Technology has announced the planned introduction of the 6509 IC which will combine the 6502 and 6530."

Is that what the 6509 actually is or are they mistaken?
 
As far as I remember, the 6508 matches that description.

The 6509 has an I/O port similar to the 6510, but also a modified instruction set to take advantage of banked memory. It can address 1Mb of RAM, in a very cumbersome way.

They didn't necessarily make a mistake. It could well be what some misinformed person at C= told them (or C= could have changed the specs after that was printed).
 
Cheers KC I find the MOS 6509 quite intriguing and have been reading up to try understand electronics more.
I just happened across a really informative book that had that small piece of text in it.
As I understand it the 6509 looks for the opcode instructions $B1/$91 and then selects which bank to use.
 
If I had time, I'd like to play around with the CBM II. I wonder what the KERNAL is like.
 
Cheers KC I find the MOS 6509 quite intriguing and have been reading up to try understand electronics more.
I just happened across a really informative book that had that small piece of text in it.
As I understand it the 6509 looks for the opcode instructions $B1/$91 and then selects which bank to use.

This was discussed at 6502.org so I just quote from there

6509 paging

Same as above, but $0000 and $0001 are used to set the 4-bit paging address lines (first 4 bits). Up to 16 pages of 64KB for a total of 1MB. Register $0000 is the code page (the page at which the code is located) and the $0001 register is the data page (from which page the data is manipulated). That works, but it means that one needs to write to $0000 and $0001.

As you pointed out, its only the two opcodes above, corresponding to LDA/STA (zp),Y instructions that are affected. And as I understand it, the zero/first page is not banked or affected. There also has to be some sort of trick in changing the code bank as the PC (program counter) would need to be modified unless you want to jump to a random location. I don't know how that is done in the 6509. Maybe by pushing new location into stack and having the instructions STA $0000 & RTS in zero page and go there by JMP?

I wonder what kind of tooling they used to do the layout of the 6509. And if the original intention was to make the LDA/STA (zp),Y instructions do 20-bit addressing directly.
 
Last edited:
If zero page is indeed the same across all banks (I didn't think it was), then the context switching routine can reside in zero page and handle the address problem from there very easily.

If not, the thing to do is write a context switching routine and copy it to the same location in every bank.
 
If zero page is indeed the same across all banks (I didn't think it was), then the context switching routine can reside in zero page and handle the address problem from there very easily.

If not, the thing to do is write a context switching routine and copy it to the same location in every bank.

There are multiple zero pages and multiple stacks. One in each memory bank that has actual memory installed. Commodore did provide bank transfer routines to aid you in calling kernal/basic routines from another bank. These can be found on the CBUG disks. Jim Butterfield wrote a nice article in Transactor magazine on how everything works. I suggest reading it ;-)

When you write to $00 from any bank you are immediately changing the bank that runs code, so you need to have synchronized code if you want to execute code from different banks. Generally though your executable code will reside in one bank and you use the $01 location to set the bank where the special opcodes store to, or fetch from, memory.

Steve
 
Back
Top