MIX Builder 98
by Bill Menees
Copyright © 1998 Bill Menees
bmenees@home.com
http://members.home.net/bmenees
System Requirements
MIX Builder is a Win32 program that should run on any Windows 95, 98, or NT4 system. It may also run in
some emulated Win32 environments, but I'm not sure about that. The only thing that is required is the
MIXBuilder.exe file. For best viewing, MIX Builder needs a high-color display driver for showing faded background
colors in the debugger. It should work on a 256-color system, but the colors won't look as good.
Overview
MIX Builder is a MIXAL assembler and MIX simulator and debugger rolled into one. It is based on the
mythical MIX machine defined in Donald Knuth's legendary The Art of Computer Programming series. See TAOCP
sections 1.3.1 and 1.3.2 for in-depth information.
Although the differences in MIX between editons of TAOCP are minor, MIX Builder is based on the 3rd
edition of the text. Some of the subtle changes in the 3rd edition are two different characters in the character set and
a dedicated device 20 for the paper tape. However, for the most part, MIX can be considered the same regardless of
which edition of the book you're using.
Implementation Details
I'm assuming that if you're reading this you're a programmer and you don't need simple things explained to
you. So I'll only discuss a few non-obvious details of MIX Builder here.
There's a new "register" in the CPU window for location counter: LC. You can edit this register in the IDE
to change which instruction will be executed next, but you can't refer to the register explicitly in a program. Within a
program, LC can only be changed by a jump operation or by being incremented after executing a non-jump
instruction.
When you change a memory location that corresponds to an assembled line of source, the debugger will
indicate this by italicizing the text in that row. This is useful for determining if you're setting the J register correctly
when calling subroutines and to tell if you're accidentally overwriting code with data.
The CPU, Memory, and Devices windows can't be docked in the main window, but they can be set to stay on
top of the main window. Typically, I layout my windows in a non-overlapping grid, with the main window (taking
up most of the space) in the top left, the Devices in the bottom left, the CPU on the top right, and the Memory on the
bottom right. An example of this layout can be seen in the screenshot on my web site.
Differences From The Standard
This section lists implementation details that don't quite match the standard that Knuth defined. In most
cases I did things the way I did because they made my life a whole lot easier. However, in one case (the MIX
character set) I added things to the standard to make everyone's life easier and because Knuth did it himself in his
MIX/360 implementation.
Inserted Constants
When you assemble your first program with literal constants or undefined symbols, you'll see that I insert the
new CON operations after the END card instead of immediately before it as Knuth specified. This made things a
little cleaner in the assembler code, and I couldn't think of a single reason not to do it. Because the END card doesn't
assemble to an instruction, it shouldn't make any difference. If someone does think of a way that it could make a
difference, I can always change it.
Negative Zero
Dealing with -0 really sucks because Intel's integer operations don't support it. As a concept, I hate the fact
that MIX supports -0 even though it has instructions like CMP where -0 == +0. Also, when rA contains -0, what
should the JAN instruction do? The MIX documentation doesn't discuss this case, so in my implementation, it doesn't
jump. Other implementations may vary.