Page 3 of 3

Re: Simplest subset of 6502

Posted: Tue May 23, 2023 5:00 am
by Squonk
Removed by author

Re: Simplest subset of 6502

Posted: Tue May 23, 2023 5:44 am
by Arlet
Squonk wrote:
With only absolute addressing, one would need to pass arguments to subroutine by reserving some fixed memory.
With only absolute addressing, you would not be able to pass arguments on the stack anyway.

Re: Simplest subset of 6502

Posted: Tue May 23, 2023 10:00 am
by Squonk
Removed by author

Re: Simplest subset of 6502

Posted: Tue May 23, 2023 10:18 am
by Arlet
Squonk wrote:
Actually, with only absolute addressing, self-modifying code and access to the stack pointer, it is indeed possible (although not trivial!).
If you permit self modifying code, you could build your own data stack in data memory, and then you wouldn't need TSX/TXS at all.

Re: Simplest subset of 6502

Posted: Tue May 23, 2023 10:38 am
by BigEd
The thing to bear in mind about this topic
Quote:
What's the simplest subset of the 6502 architecture that could still be reasonably useful?
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.)

Re: Simplest subset of 6502

Posted: Tue May 23, 2023 11:56 am
by Squonk
Removed by author

Re: Simplest subset of 6502

Posted: Tue May 23, 2023 11:57 am
by Squonk
Removed by author

Re: Simplest subset of 6502

Posted: Tue May 23, 2023 3:22 pm
by Arlet
Squonk wrote:
Even with self-modifying code, you need TXS to initialize the call stack.
No, that was my point. You can start the stack at any random point, and it will just wrap around the page boundary, giving you 256 usable bytes.

Re: Simplest subset of 6502

Posted: Tue May 23, 2023 4:11 pm
by Squonk
Removed by author

Re: Simplest subset of 6502

Posted: Fri May 26, 2023 7:43 pm
by barnacle
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

Re: Simplest subset of 6502

Posted: Fri May 26, 2023 10:07 pm
by Squonk
Removed by author

Re: Simplest subset of 6502

Posted: Sat May 27, 2023 4:22 pm
by barnacle
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