9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 8086 Interpreter
@ 2010-09-03 19:21 Akshat Kumar
  2010-09-03 20:10 ` ron minnich
  2010-09-03 20:36 ` Russ Cox
  0 siblings, 2 replies; 5+ messages in thread
From: Akshat Kumar @ 2010-09-03 19:21 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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  etc.). I found 8i in contrib/rsc
which seems to have been taken from aki's 8i, but that just
seems like a basic VBE debugging tool - does anyone have
any knowledge as to whether it can be used as an 8086
interpreter somehow? Perhaps it's just a matter of adding
some parsing at the interface for the commands?

dosbox would be nice to have on Plan 9 - any similar projects
around? Any hints as to what would be required in order to
port that thing?


Thanks,
ak



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 8086 Interpreter
  2010-09-03 19:21 [9fans] 8086 Interpreter Akshat Kumar
@ 2010-09-03 20:10 ` ron minnich
  2010-09-03 20:36 ` Russ Cox
  1 sibling, 0 replies; 5+ messages in thread
From: ron minnich @ 2010-09-03 20:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I've used bochs to do bios debugging. You have to enable a few things
but you can get an assembly trace.

Another option is qemu with a gdb port set up.

The turnaround on assembling and running is fast enough that you may
not really need an interpreter.

ron



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 8086 Interpreter
  2010-09-03 19:21 [9fans] 8086 Interpreter Akshat Kumar
  2010-09-03 20:10 ` ron minnich
@ 2010-09-03 20:36 ` Russ Cox
  2010-09-03 21:43   ` Akshat Kumar
  1 sibling, 1 reply; 5+ messages in thread
From: Russ Cox @ 2010-09-03 20:36 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Sep 3, 2010 at 3:21 PM, Akshat Kumar
<akumar@mail.nanosouffle.net> 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  etc.). 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 = 1 you'll get lots of output about
each step during the simulation.

Russ


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 8086 Interpreter
  2010-09-03 20:36 ` Russ Cox
@ 2010-09-03 21:43   ` Akshat Kumar
  2010-09-04 12:29     ` Russ Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Akshat Kumar @ 2010-09-03 21:43 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Sep 3, 2010 at 1:36 PM, Russ Cox <rsc@swtch.com> wrote:
> 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.

Ah, I'm sorry for miscrediting!
I grabbed both 86a and 86b - it seems that some code is
missing from 86a: main.c:52 reads "resolve const names".
I only need really simple assembly, so even 86b (which
seems to be simpler) should suffice.  However, it seems
that the code in 86b/inst.c has not yet been used with
the rest of the program, so it doesn't do much more than
just parse input (or whatever the job of y.tab.c is).
In theory, with these I would simply get a binary file from
the assembly, which I could then run on, say, dosbox in
8086 mode in Windows?


Thanks,
ak



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 8086 Interpreter
  2010-09-03 21:43   ` Akshat Kumar
@ 2010-09-04 12:29     ` Russ Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Russ Cox @ 2010-09-04 12:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> In theory, with these I would simply get a binary file from
> the assembly, which I could then run on, say, dosbox in
> 8086 mode in Windows?

You'd get a raw file with instructions in it.
It would be up to you to turn that into an
appropriate executable.  (If you renamed it
foo.com that would probably be enough for DOS.)

Russ


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-04 12:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-03 19:21 [9fans] 8086 Interpreter Akshat Kumar
2010-09-03 20:10 ` ron minnich
2010-09-03 20:36 ` Russ Cox
2010-09-03 21:43   ` Akshat Kumar
2010-09-04 12:29     ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).