From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 3 Sep 2010 16:36:12 -0400 Message-ID: Subject: Re: [9fans] 8086 Interpreter From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: 4e8e3334-ead6-11e9-9d60-3106f5b1d025 On Fri, Sep 3, 2010 at 3:21 PM, Akshat Kumar wrote: > I've recently had the need for a very simple 8086 interpreter, > with which I can do some assembly testing (so it should > allow me to enter the basic opcodes and their operands, > such as MOV AL, 0x21 =C2=A0etc.). I found 8i in contrib/rsc > which seems to have been taken from aki's 8i, I wrote 8i. If you keep poking around in contrib/rsc you'll also find 86a and 86b which are different variants of an 8086 assembler. vbe.c is just one example of setting up an execution environment and running code. You can write your own foo.c that sets things up the way you want (maybe it reads the code from a file) and run mk 8.foo. If you set cpu.trace =3D 1 you'll get lots of output about each step during the simulation. Russ