6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 3:21 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Nov 21, 2023 1:40 am 
Offline

Joined: Tue Jan 19, 2021 11:37 pm
Posts: 5
Hello,
I've been looking at starting a project based on Drass' [url]c74project.com[/url], and I'm trying to do a bit of footwork. I'd like to take what he has done and redo it as an educational project for my girls. A bit of background, I have made CPUs in the past on silicon; however, those are intractable as a teaching tool. I'm not going for speed, but going basically for LEDs. I missed the era of 8-bit computing, but the 6502 allows one to be able to get intimate with the hardware as there's not cache and the whole system is actually tractable.

To this end, I'd like to expose the states of the A, S, X, Y, and PC and the "state count" of the decoded instruction. I decided the I can just scan this out from a parallel->serial interface and then have a little MCU show the values on a 7-segment LED. My question is if any of the other internal registers would be worth exposing, as there that temporary register, instruction register and data pointer?

Another question I have is if it would be worth adding some additional hardware to do a "single step" on PC compare. I haven't looked carefully on how I'd implement this as far as clocks, but on most CPUs I have a trap register that I can use to halt the execution of the processor at a certain point when a PC is reached, much like a breakpoint for hardware. They usually cost me almost nothing and are useful, but I wanted other opinions.

I realize that this is all vague, as I'm trying to sketch something out, and I'd appreciate as much feedback as I can get.


--bpd


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 6:17 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I think it depends on what you are trying to teach, or what explorations you're wanting the student to be able to make.

Understanding that a computer running an application is actually (as a model!) following simple instructions one by one, and what those simple instructions achieve individually, is one educational goal. Too much detail would, in my amateur view, be too much.

Personally, I don't think exposing more than the programmer-visible registers will help much - too much detail, and an extra level of abstraction below the execution of a program. The 6502 as a programmer sees it is an abstraction, a mild form of fiction, and the details of a specific implementation don't help us understand the way a 6502 program makes progress. I am, personally, deeply interested in the internals of CPUs, 6502s included, but I think that deep interest is a step beyond the first necessary step, which is how does a computer run a program.

As such, I think single-instruction stepping, with the states of PC, A, X, Y, S, is a good goal, which is a first step in understanding how things work. Possibly the IR would be interesting too. But you always have the problem, I think, that understanding an instruction means holding in mind the previous and also the subsequent state of the machine.

If you really do want to single-cycle step... well maybe yes, seeing the inputs and outputs of the ALU would be useful.

Perhaps have a play with visual6502 in expert mode, which the chip display off, and see the effect of the "trace more" and "trace less" buttons when you re-run an example. Perhaps write up some tabulations, and review those, to design the physical interface that will be of most value. (visual6502 can step by single cycles or by single instructions)
http://visual6502.org/JSSim/expert.html ... f&steps=30


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 33 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:  
cron