Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!mintaka!geech.ai.mit.edu!rjc From: rjc@geech.ai.mit.edu (Ray Cromwell) Newsgroups: comp.sys.amiga.emulations Subject: Emulator Mechanics Message-ID: <1991Mar7.093149.18707@mintaka.lcs.mit.edu> Date: 7 Mar 91 09:31:49 GMT Sender: daemon@mintaka.lcs.mit.edu (Lucifer Maleficius) Organization: None Lines: 47 I got an idea. How about combining both methods? (compile and interpret) First compile the executable with flow analysis into 68k code. Any instruction that tries to touch a hardware register will become a trap instruction(or use an MMU to trap it) to emulate the hardware. Where does the interpreter come in? Any code that tries to self modify or do a change of state (table lookup, indirect jumps, etc) with be interpreted. Sounds hard? You bet. The easier solution of all is to throw faster CPUs at the problem. Now for another question: Why doesn't AMAX multitask? It should be EASY to run multiple copies of the Mac ROM as a task (since its a rom, its mostly pure code, except each task would need to alter where the ROM things the system memory is.) For things like the Atari emulator, or another 68000 emulator, the compile technique should work great! Just recompile the parts of the code that bang on the hardware, or use an MMU to trap them. The whole compilation process is made easier when the machine your trying to emulate has an object code format that contains seperate data and code chunks, and perhaps some relocation data. Further more, if the machine has rules against self modifying code, and a device independent OS it becomes trivial. Could someone run SI or dhrystone on IBeM and tell me how it performs? Itis said that SoftPC on a Mac @25mhz 68030 runs at 6mhz AT speed. Does anyone know if IBM code uses self modifying code, or jump tables? What kind of code does their compilers produce? And, does the IBM has a special object code format that seperates code and data? The compilation technique could work well, but the compiler would have to be VERY smart in its flow analysis of detecting code/data, jump tables, self modifying code, PC counter and stack manipulation, etc. I'll clairfy my thoughts tommorow, it's going on 4:30am here, and I need to get some well deserved sleep. :-)