Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

instruction set translator

Status
Not open for further replies.

garimella

Full Member level 5
Joined
Aug 25, 2011
Messages
260
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
3,276
I am just doing small assignment where in I need to develop 8086 instruction translator on 8051. 8051 reads 8086 op-codes from eprom and executes instructions as though 8086 were present. Any ideas how it can be done.
 

The hard way I'm afraid. The codes are quite different, including that one is an 8-bit processor and the other is 16-bit.
You need to read the EPROM byte by byte and use software to look-up the instruction length so you know if it spans several addresses then emulate the full instruction in 8051 code. It is not a trivial task and you will need to create a 'virtual' 8086 model to mimic the operation of a real one. It isn't a 'small' assignment unless you are prepared to limit the instruction set significantly.

Brian.
 

This is probably not a small assignment.

It is easy for the 8086 to emulate the 8051.
It is very difficult for the 8051 to emulate the 8086.

If you already have the EPROM contents, only implement the needed instructions.
 

Hi,

and if you not only want to emulate "function" but also "timing", then it becomes even more difficult.

Klaus
 

I was wondering how emulator works. Commercial emulators claim to emulate variety of processors, how do they achieve timings?
 

They rely heavily on look-up tables. There will be a table for each instruction that tells it whether it is a single byte or multi-byte (or multi-word) instruction and how many cycles it takes to complete. The virtual processor model 'runs' the program with the cycles taken for each instruction, including possible different number of cycles for conditional instructions is accumulated. Knowing the clock frequency, the timing is calculated based on how many clock cycles per instruction cycle and how many instruction cycles it takes.

Brian.
 

any small scale reference design available?
 

... but good luck re-writing them to work on an 8051 system!

Brian.

Hello,
yes you are right :). The assumption to emulate more complicated CPU on smaller and simpler one is bad choice. But you can see how things are done in such examples.

Best regards
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top