MOS6510 ...
Question. SYNC in MOS6510 ?
Question. SYNC in MOS6510 ?
Is possible to obtain the SYNC signal in processor that does not have it
MOS6510 ...
MOS6510 ...
Re: Question. SYNC in MOS6510 ?
I think you have to build a little instruction decoder state machine - Jeff's territory really - which is then a little more complicated if you also have to deal with RDY.
Actually, I think you can give yourself a bit of an assist by also monitoring the address bus - otherwise you have to compute things like page crossing penalty cycles. And in a system with interrupts you'd also need to know the exact cycles in which interrupts are taken.
This is sounding complicated! Would it be enough to get it nearly right?
Actually, I think you can give yourself a bit of an assist by also monitoring the address bus - otherwise you have to compute things like page crossing penalty cycles. And in a system with interrupts you'd also need to know the exact cycles in which interrupts are taken.
This is sounding complicated! Would it be enough to get it nearly right?
Re: Question. SYNC in MOS6510 ?
This is idea.
I think for example. On AVR microcontroller which followed the instructions to the CPU.
I would like to simulate the MOS 6509 on 6510.
Or maybe just enough to catch opcodes $ B1 / $ 91?
But how?
viewtopic.php?t=2023
I think for example. On AVR microcontroller which followed the instructions to the CPU.
I would like to simulate the MOS 6509 on 6510.
Or maybe just enough to catch opcodes $ B1 / $ 91?
But how?
viewtopic.php?t=2023
Re: Question. SYNC in MOS6510 ?
That's an idea! Using a cycle-accurate simulation on a microcontroller is a lot more practical than building a 6502 in logic.
But for detecting just two specific opcodes which use (zp),Y addressing, it might not be too difficult to build a finite state machine which detects the two zero page accesses after seeing the specific opcode on the databus followed by an operand, and then counts cycles. Here's a trace:
http://visual6502.org/JSSim/expert.html ... eab122eaea
There are probably not very many ways of getting two consecutive accesses to zero page, other than it being the fetch of an operand for indirect addressing. Or jumping into zero page, but you could just say "don't do that!" Or you could say that a jump into zero page will be preceded by a read of 00 on the database, and ensure that isn't the case.
But for detecting just two specific opcodes which use (zp),Y addressing, it might not be too difficult to build a finite state machine which detects the two zero page accesses after seeing the specific opcode on the databus followed by an operand, and then counts cycles. Here's a trace:
http://visual6502.org/JSSim/expert.html ... eab122eaea
There are probably not very many ways of getting two consecutive accesses to zero page, other than it being the fetch of an operand for indirect addressing. Or jumping into zero page, but you could just say "don't do that!" Or you could say that a jump into zero page will be preceded by a read of 00 on the database, and ensure that isn't the case.
Re: Question. SYNC in MOS6510 ?
It's probably really hard.
If I had SYNC (or know when it ends the previous owner) I could recognize opcodes $ B1 / $ 91 and replace them on the fly and turn into BRK interrupt.
If I had SYNC (or know when it ends the previous owner) I could recognize opcodes $ B1 / $ 91 and replace them on the fly and turn into BRK interrupt.
Re: Question. SYNC in MOS6510 ?
grzeg wrote:
I would like to simulate the MOS 6509 on 6510.
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Question. SYNC in MOS6510 ?
That's right, I wanted to run a CBM-II system on my C64 with 16 MB of RAM.
viewtopic.php?f=4&t=2989
viewtopic.php?f=4&t=2989
Re: Question. SYNC in MOS6510 ?
Alright, then -- 6509 simulation it is. And, the flaw I mentioned probably could be fixed without breaking compatibility.
I have to go now, but I will have more time to talk later.
-- Jeff
I have to go now, but I will have more time to talk later.
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Question. SYNC in MOS6510 ?
It might be that a GODIL or similar FPGA board would substitute for the 6510, in which case you can put in a 6502 core and then it can be tweaked as necessary.
Or, maybe the idea is to arrange this trick by connecting only to the cartridge port?
I do quite like the idea of spotting the two special instructions by observing bus activity. The pattern to match is something like
1 - read, returning B1 or 91
2 - read from the following address, this is the operand, a zero page address
3 - read of that given zero page address
4 - read from the following address, being the high byte of the pointer
(At this point you commit to a banked data access, or two of them.)
5 - read of the (banked) destination address, supposing no overflow from the Y addition
6 - write (if it's a STA) of the (banked) destination address, or a read if it's a LDA and there was a page crossing, or a read of the (unbanked) next instruction if it was LDA without a page cross.
It's easy to pick off the STA case. The LDA case is tricky because you don't know if there will be a page crossing. You do know the value of PC though, so you can see from the address whether cycle 6 is an unbanked fetch or a banked read.
Edit: but note that with this approach you can't tell at the time of the initial fetch that it was a fetch, so you can't substitute the opcode with a BRK. You have to have banking hardware ready to switch in during cycles 5 and possibly 6.
Or, maybe the idea is to arrange this trick by connecting only to the cartridge port?
I do quite like the idea of spotting the two special instructions by observing bus activity. The pattern to match is something like
1 - read, returning B1 or 91
2 - read from the following address, this is the operand, a zero page address
3 - read of that given zero page address
4 - read from the following address, being the high byte of the pointer
(At this point you commit to a banked data access, or two of them.)
5 - read of the (banked) destination address, supposing no overflow from the Y addition
6 - write (if it's a STA) of the (banked) destination address, or a read if it's a LDA and there was a page crossing, or a read of the (unbanked) next instruction if it was LDA without a page cross.
It's easy to pick off the STA case. The LDA case is tricky because you don't know if there will be a page crossing. You do know the value of PC though, so you can see from the address whether cycle 6 is an unbanked fetch or a banked read.
Edit: but note that with this approach you can't tell at the time of the initial fetch that it was a fetch, so you can't substitute the opcode with a BRK. You have to have banking hardware ready to switch in during cycles 5 and possibly 6.
Re: Question. SYNC in MOS6510 ?
This is a schema of the extension of RAM.
The addition of two registers 6509 is possible.
The addition of two registers 6509 is possible.
- Attachments
-
- simm72do.pdf
- (78.71 KiB) Downloaded 104 times
Re: Question. SYNC in MOS6510 ?
Hardware is ready swich bank during one cycle
Re: Question. SYNC in MOS6510 ?
grzeg wrote:
Is possible to obtain the SYNC signal in processor that does not have it
MOS6510 ...
MOS6510 ...
Edit: The "E" variants -- 6809E and 6309E -- feature a signal called LIC, or Last Instruction Cycle. LIC differs somewhat from SYNC but it does reveal when the opcode fetch takes place.
For 6510, you guys have cited some good alternatives:
- use an FPGA cpu core to be the 6510, modified in regard to $91 & $B1 opcodes (which are used by 6509 programs for banked addressing)
- detect $91 & $B1 opcodes running on a real 6510 by simultaneously running a 6510 simulator on an AVR
- detect $91 & $B1 opcodes running on a real 6510 by watching R/W and signals on the buses
-- Jeff
Last edited by Dr Jefyll on Fri Jan 06, 2017 8:26 pm, edited 1 time in total.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
-
White Flame
- Posts: 704
- Joined: 24 Jul 2012
Re: Question. SYNC in MOS6510 ?
Another alternative (even though this is the hardware forum) would be software emulation via code analysis. Given that this is a very short-lived architecture, you could suppose that the software you'd run on it was well-behaved in terms of accessing the new hardware features. For instance, assume that $00/$01 access was all done by straight LDA/STA zp instructions, and detect those in the code stream.
If you do have 16MB, and are emulating a 1MB architecture, and are willing to give up timing accuracy (BRK substitution already does that), then you should have plenty of elbow room for tables & analysis. This is the sort of things that emulators on the PC do with JIT'ing chains of instructions, but in this case no JIT transformation is required because the instruction sets are compatible.
I think it would be more work than a hardware solution, but if the hardware solution isn't feasible it is an alternative.
If you do have 16MB, and are emulating a 1MB architecture, and are willing to give up timing accuracy (BRK substitution already does that), then you should have plenty of elbow room for tables & analysis. This is the sort of things that emulators on the PC do with JIT'ing chains of instructions, but in this case no JIT transformation is required because the instruction sets are compatible.
I think it would be more work than a hardware solution, but if the hardware solution isn't feasible it is an alternative.
Re: Question. SYNC in MOS6510 ?
You could even use the 6502 and add registers as in 6509 and 6510.
Now, I think it would be the easiest.
Now, I think it would be the easiest.
Re: Question. SYNC in MOS6510 ?
Dr Jefyll wrote:
(The scheme used by the 6509 is flawed, IMO.)
-- Jeff
-- Jeff