6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 23, 2024 3:26 am

All times are UTC




Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Tue May 23, 2023 5:00 am 
Offline

Joined: Tue Apr 11, 2017 5:28 am
Posts: 68
Removed by author


Last edited by Squonk on Tue Oct 03, 2023 7:29 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue May 23, 2023 5:44 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 23, 2023 10:00 am 
Offline

Joined: Tue Apr 11, 2017 5:28 am
Posts: 68
Removed by author


Last edited by Squonk on Tue Oct 03, 2023 7:29 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue May 23, 2023 10:18 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 23, 2023 10:38 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10802
Location: England
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.)


Top
 Profile  
Reply with quote  
PostPosted: Tue May 23, 2023 11:56 am 
Offline

Joined: Tue Apr 11, 2017 5:28 am
Posts: 68
Removed by author


Last edited by Squonk on Tue Oct 03, 2023 7:29 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue May 23, 2023 11:57 am 
Offline

Joined: Tue Apr 11, 2017 5:28 am
Posts: 68
Removed by author


Last edited by Squonk on Tue Oct 03, 2023 7:29 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue May 23, 2023 3:22 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 23, 2023 4:11 pm 
Offline

Joined: Tue Apr 11, 2017 5:28 am
Posts: 68
Removed by author


Last edited by Squonk on Tue Oct 03, 2023 7:30 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Fri May 26, 2023 7:43 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 691
Location: Potsdam, DE
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


Top
 Profile  
Reply with quote  
PostPosted: Fri May 26, 2023 10:07 pm 
Offline

Joined: Tue Apr 11, 2017 5:28 am
Posts: 68
Removed by author


Last edited by Squonk on Tue Oct 03, 2023 7:30 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sat May 27, 2023 4:22 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 691
Location: Potsdam, DE
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


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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: