Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!TAURUS.BITNET!finkel From: finkel@TAURUS.BITNET Newsgroups: comp.sys.amiga.emulations Subject: Re: Emulator Mechanics (sorry long post) Message-ID: <2406@taurus.BITNET> Date: 9 Mar 91 21:26:03 GMT References: <4992@mindlink.UUCP> <1991Mar6.004247.8964@cpsc.ucalgary.ca> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: finkel%math.tau.ac.il@CUNYVM.CUNY.EDU (Udi Finkelstein) Organization: Tel-Aviv Univesity Math and CS school, Israel Lines: 41 as someone who wrote a 8085 emulator/disassembler/monitor for the C64 I would like to contribute my on thoughts on the subject. I have toyed the idea of writing an IBM PC program translator that would take an IBM program and 'translate' it to run on the amiga, but after careful examination of the idea I decided to drop it for a few reasons: 1. There is no way to find out at compile time which memory references are accessing special RAM areas such as the text/graphics video screen. 2. self modifying code breaks such schemes easily 3. code/data seperation can be tough. for example, it's very hard to detect if memory block contains code ( translate it) , data ( don't touch it) or worse - near or far pointers. (2) is rare, but (1) and (3) are common, so I guess many programs will break. even commercial systems claiming the ability to 'compile' PC binaries into UNIX programs such as XDOS (anyone heard of them lately??) aren't automatic. Instead, I decided to try concentating on the 'usual' type of emulators such as IBeM and Transofrmer. What caught my attention is that a large portion of the time an emulator is spending while emulating an instruction is to check whether a memory read/write accesses video memory. every address being written to memory must be checked whether it lies in the $BXXXXX range, and if it does, it should be written to the screen. What I really wanted to do if I had an MMU based machine is to write an emulator that will use the MMU to track such memory accesses. The emulator's memory will be referenced without translation, but every address in the range where the video memory is located will be caught by the MMU and special code will be run to handle it. This would speed things up. Udi