6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Jul 02, 2024 6:32 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Dec 04, 2011 12:25 pm 
Offline

Joined: Sun Dec 04, 2011 12:19 pm
Posts: 8
I'm writting MCS6502 emulator, and i want to know how this processor is dealing with devices like keyboard, display, hard drive or other.
I know it's using memory mapped to device registers, but i want to know how reading from keyboard or writting to screen is accomplished by programmer.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Dec 04, 2011 3:47 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3366
Location: Ontario, Canada
Welcome to the forum! The MCS6500 Family Hardware Manual and Software Manual will give you a good education in the basics of how the processor deals with external devices. But this is general information. The interfaces for keyboard, display, and hard drive vary widely between all the different 6502 computers, so eventually you will need to be specific about what machine you wish to emulate. (You didn't mention.)

cheers,

Jeff


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Dec 04, 2011 4:06 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8462
Location: Southern California
How it deals with those things will depend entirely on the I/O ICs you go through and how the keyboard, display, and other things are connected to those ICs. Their various registers are seen by the processor as if they were just memory locations though. For example, LDA $4000 might read from RAM on one computer, or read from port B of a 65c22 Versatile Interface Adapter IC on another, and from ROM on yet another computer. The processor doesn't care. And on the one that has the 65c22 VIA there, what's connected to port B might be the rows of a keyboard, the data lines of a printer port, and/or a lot of other things.


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 04, 2011 10:56 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8237
Location: Midwestern USA
jarlfenrir wrote:
I'm writting MCS6502 emulator, and i want to know how this processor is dealing with devices like keyboard, display, hard drive or other.

I know it's using memory mapped to device registers, but i want to know how reading from keyboard or writting to screen is accomplished by programmer.

You should download and play with a copy of the Kowalski simulator to get some ideas on how you might proceed. The K-sim simulates the 6502 (or 65C02) and has an I/O "console," as well as the ability to generate regularly spaced (jiffy) IRQs. It doesn't emulate a particular machine however.

I guess the question you will have to settle is exactly what you want the finish product to do.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 05, 2011 7:23 pm 
Offline

Joined: Sun Dec 04, 2011 12:19 pm
Posts: 8
Thanks for answers. Of course programming manual i've read already. What system i want to emulate? I don't care - i want user to specify where he wants to put wich device.


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

All times are UTC


Who is online

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