Simplest subset of 6502
Re: Simplest subset of 6502
Removed by author
Last edited by Squonk on Tue Oct 03, 2023 7:29 pm, edited 1 time in total.
Re: Simplest subset of 6502
Squonk wrote:
With only absolute addressing, one would need to pass arguments to subroutine by reserving some fixed memory.
Re: Simplest subset of 6502
Removed by author
Last edited by Squonk on Tue Oct 03, 2023 7:29 pm, edited 1 time in total.
Re: Simplest subset of 6502
Squonk wrote:
Actually, with only absolute addressing, self-modifying code and access to the stack pointer, it is indeed possible (although not trivial!).
Re: Simplest subset of 6502
The thing to bear in mind about this topic
is that it always is going to be a tradeoff, landing somewhere in between a very-nearly-6502 and a single instruction tarpit.
(Each of us will be inclined to place that tradeoff at a different place. It's all very interesting, but not a good basis to argue over.)
Quote:
What's the simplest subset of the 6502 architecture that could still be reasonably useful?
(Each of us will be inclined to place that tradeoff at a different place. It's all very interesting, but not a good basis to argue over.)
Re: Simplest subset of 6502
Removed by author
Last edited by Squonk on Tue Oct 03, 2023 7:29 pm, edited 1 time in total.
Re: Simplest subset of 6502
Removed by author
Last edited by Squonk on Tue Oct 03, 2023 7:29 pm, edited 1 time in total.
Re: Simplest subset of 6502
Squonk wrote:
Even with self-modifying code, you need TXS to initialize the call stack.
Re: Simplest subset of 6502
Removed by author
Last edited by Squonk on Tue Oct 03, 2023 7:30 pm, edited 1 time in total.
Re: Simplest subset of 6502
But you can set the stack pointer to 0x1ff (well, 0xff) at reset, through hardware. Doesn't need a dedicated instruction unless you're going to get exciting in the program.
Neil
Neil
Re: Simplest subset of 6502
Removed by author
Last edited by Squonk on Tue Oct 03, 2023 7:30 pm, edited 1 time in total.
Re: Simplest subset of 6502
Well I'm kind of assuming you're emulating|designing|building a complete but minimal processor here, so it would seem that it's just a question of setting a register as part of the reset initialisation: to get the initial reset vector you have to jam the $fffc address onto the bus and then increment it after reading the value into the address register low and high. I don't know what mechanism you would choose to do that, but one could (e.g.)
- tick 0, issue a reset to a register counter
- tick 1, issue a decrement to it
and I feel these could happen in parallel with other required operations for the reset so wouldn't occupy any more time/ticks.
Neil
- tick 0, issue a reset to a register counter
- tick 1, issue a decrement to it
and I feel these could happen in parallel with other required operations for the reset so wouldn't occupy any more time/ticks.
Neil