File ChangingEmulator.html    Author McKeeman    Copyright © 2007    index

Changing the Emulator

Preliminary

Read about the Intel x86 emulator.

In MATLAB in the mxcom directory, try

   >> help Emulatex86.m

and

   >> xcom -interactive x:=1

and

   >> xcom -exeTrace x:=1

Small Changes to the x86 Emulator

What normally initiates a change to the emulator is a bad run. The emulator should error if it is asked to carry out an instruction that has not yet been implemented. The partial run together with

 >> xcom -asmTrace xxx.m

usually makes it clear what is missing. The emulator is a switch of switches; a missing case needs to be filled in. The Intel 486 book is the final reference although usually one can figure out what needs to be done by reasoning and analogy.

Adding a builtin function to X is a special case. The emulator must also independently implement the builtin since the calling sequence into C would take the emulator in unknown territory.

An Emulator for New Hardware

Supporting new hardware requires a brand new emulator. That will be a lot of work.