On Tue, Feb 20, 2018 at 5:30 PM, dwight via cctalk <cctalk at classiccmp.org>
wrote:
In order to connect to the outside world, you need a
way to queue event
based on cycle counts, execution of particular address or particular
instructions. This allows you to connect to the outside world. Other than
that it is just looking up instructions in an instruction table.
Dwight
What I've always wondered about was how the heck cycle-accurate emulation
is done. In the past I've always felt overwhelmed looking in the sources of
emulators like that to see how they do it, but maybe it's time I tried
again.
Another more-complex thing done by some emulators is compiling, on the fly,
a series of emulated machine instructions into native host machine code, to
boost performance. That's also what the Java virtual machine does.
________________________________
From: cctalk <cctalk-bounces at classiccmp.org> on behalf of Pontus Pihlgren
via cctalk <cctalk at classiccmp.org>
Sent: Tuesday, February 20, 2018 11:22:32 AM
To: Adrian Stoness; General Discussion: On-Topic and Off-Topic Posts
Subject: Writing emulators [Was: Re: VCF PNW 2018: Pictures!]
On Mon, Feb 19, 2018 at 06:36:13PM -0600, Adrian Stoness via cctalk wrote:
whats invovled in makin an emulator?
i have a chunk of stuff for the phillips p1000
I would say it depends a lot on how complex your target machine is. But
in essense you will have to write code for each device you wish to
emulate mapping their functionality over to your host machine, the one
running the emulator.
As a minimum you will write code for the CPU and some sort of output
device, such as a serial console. For some machines you might need
images of ROM code in order to be fully compatible with existing
software.
I wrote a PDP-8 emulator for fun. The basic CPU and serial was done in a
few hours. I then hardcoded the paper tape loader in memory and allowed
input to be read from an image file.
Adding extended memory support and running conformance tests has taken
the bulk of the time.
/P
--
Eric Christopherson