views:

119

answers:

3

Hi,

I've found an emulator for 80x86 created by using Java,

and I want know, how I can create an emulator 80x86 by Java? where I can found tutorials and documentation? etc ...

Thanks very much!

+5  A: 

The 8086 has a pretty complicated architecture. For your first forays into writing emulators, I'd suggest a much simpler 8-bit chip such as the 8090/8085 family. I once wrote an simulator for the 8080 in FORTRAN in about a week, complete with assembler, debugger etc.

The way an emulator works is pretty simple - you have an array representing memory, which you fill with the correct machine code or your program. You then walk through this memory interpreting the machine code at the simulated programming counter as you go, and adjusting the program counter according to the opcode being executed. To do this you will need the spec of the processor, and a reasonably good understanding of assembly/machine code, and the processor architecture.

anon
@Neil - Interesting. Was that a personal project? Have you ever thought of making the Fortran source code available? As an ex-Fortan IV programmer I'd be curious to see it.
Simon Knights
@Simon It was for the Polytechnic I was then working for (mid 1980s), ran on DEC-10, VAX and IBM 4381, and used on courses teaching assembly programming. I no longer have the code, unfortunately.
anon
@Neil OK. I remember the IBM 4300 series well - all EBCDIC machines of course. Did most of my IBM Assembly programming on those.
Simon Knights
Thank you!now I can understand a basic concept.
+4  A: 

It seems you're talking about JPC. You can download its source code; hopefully it will be well-documented and -commented. You could also try asking for documentation in its source forge support forums.

Michael Borgwardt
Yes, I've source for JPC and dioscuri.
A: 

There is open-source 80x86 emulator called "DosBox". You can probably use its source as a reference.

yk4ever