em180

em180 is an emulator for the Hitachi 64180, the CPU for the Single Board Computer used in the MCP course taught at the Department of Computer Science, University of York.

It is an update of the em80 program used in CTS. It supports all of the 64180 instructions, and has some support for the 64180 serial port system (ASCI). It also has a few other features that make it a bit easier to work with than em80. em180 was written in order to test mathematical functions used in my MCP project - it can't test the MCP hardware, but it can test the really tricky bits of the software.

New features in em180 (version 1.3a)

  • You can turn on ASCI emulation in em180. This means that when your program writes to a serial port on the 64180, it will appear on screen.
    (Enter set sbcmode to activate this feature)
  • You can pipe instructions into em180 and they will work properly.
  • You can set the number of instructions that em180 will execute when you type "run". em80 fixed this limit at 10000.
    (Enter set max <number> to change this limit)
  • All HALT instructions are treated as breakpoints.
  • MLT, IN0 and OUT0 instructions will work.
  • Some of the case sensitivity has been removed. "RAM" and "ram" now mean the same thing, and "set PC" is equivalent to "set pc".

How to get em180 (version 1.3a)

  • First, note that this software is unofficial and there is no warranty whatsoever. I don't claim this software is bug free (I didn't write much of it) and if you use it to test your code you really should test it on the actual machine. I realise this is obvious, but you can't blame me if the failure of this program messes up your MCP project.
  • You can download the source code and compile it yourself.
  • Or download a precompiled Linux i386 binary (dynamically linked for libc6)
  • Then read the instructions below to learn about the new features.

How to use em180 to test your code

I'm using em180 to test my code using a script, like this one:
ram 0000h ffffh
load btest.out 8000h
set pc 8000h
set sbcmode
set max 100000000
run

I run em180 with the command em180 <script, which runs em180 with the above code as input. It runs through each command and prints the output on screen. The test is totally automatic: all I do is write the code, compile it and run that command, and it tells me whether I screwed up or not. :)

More about em180

em180 was hacked together in an evening by Jack Whitham from original em80 source code by Don Goodeve and Marat Fayzullin. I've put it up on the web in case anyone else finds it useful. I certainly do: I can write code at home now and don't have to come into the lab for testing.

The original em80 source code can be downloaded in two parts: Z80 emulator and em80 source. It is free for non-commercial use as long as the original authors (Don Goodeve, and Marat Fayzullin) are credited. See the README in the source for further details.