Home Boards Poly-88 8813 Emulator Links Contact


The Poly Emulator Program

Welcome to PM, the PolyMorphic Emulator program. This version will run in any DOS-compatible environment, whether it's a true MS-DOS machine, a "DOS window" in Windows XP and earlier, or one of the DOS emulation tools such as DOSbox. More about those environments below.

PM does just about everything the Poly does. It provides a complete PolyMorphic environment in which any Poly programs will run, whether they were written in BASIC, assembly, or other languages. PM accomplishes this by emulating the hardware of the Poly, including the ROMs, memory map, interrupts, screen memory, and so on.

Poly Emulator screen shot

Poly-88 or 8813? There are small differences between the Poly-88 and the System 8813 hardware, memory map, and ROMs. PM defaults to being an 8813 emulator, but you can change this to make it emulate an '88 instead. We have some demo programs available for both.

This page (the one you're reading) provides the download files and general information about the emulator. You should also look at one (or both) of these other pages, which provide specific information about emulating the Poly‑88 and the System 8813:

System 8813 emulation
Poly-88 emulation


The download files

Create a directory for PM to run in, such as C:\PM. Right-click on any of the following ZIP files and save them to your PC, in the C:\PM directory.

This contains PM.EXE, the emulator program, and POLYDEV.DAT, the configuration file. You will need this in order to emulate either the Poly-88 or the 8813. PM.ZIP
This contains the *.CAS files, which are images of Poly-88 cassette tapes. It includes a README file describing the contents of each tape. You will need this in order to try out some Poly-88 programs. CAS.ZIP
This contains the *.PM files (vdisk files), which are images of 8813 floppy disks. It includes a README file describing the contents of each vdisk file. You will need this in order to boot the emulator in 8813 mode. You can find other vdisks on Ralph Kenyon's site. VDISK.ZIP

All of the ZIP files should be extracted into the same C:\PM folder.

Note: In Windows, right-click a ZIP file and select Extract All... This will give you the option of where to put the extracted files. The default is to create a new directory named after the ZIP file. For example, if you're extracting from CAS.ZIP and that file is in C:\PM, it will suggest a destination folder named C:\PM\CAS. Change this, and put all your extracted files in the same C:\PM directory.

Next, open up a DOS prompt and "CD" to the directory containing the files you extracted. Type PM and hit Enter. You'll see a screen like this one:

Screen shot of the Poly Emulator program


Commands at the [pm] prompt

While PM is emulating Poly instructions, you won't see a prompt in the bottom area of the screen. You will see a message telling you to Type: Alt-F1 and 'quit' to end.

Pressing Alt-F1 gets the [pm] prompt, at which you can type any of the following commands. (Obviously some of these are for advanced users.)

q or quit - exits from PM, returning to the DOS prompt.

r or run - continues running the emulator.

b or boot - reboots the emulator.

1 (the number one) - executes one emulated instruction, then dumps the registers.

d addr1 addr2 - dumps memory addresses addr1 through (optional) addr2.

g addr - emulates until the Poly's program counter reaches addr.

u addr1 addr2 - unassembles instructions from addr1 through (optional) addr2.


Command-line arguments

When you start PM by typing its name, you can also add various arguments (options) to the command line:

-88 runs in Poly-88 mode, instead of the default 8813 mode. See also the poly88 setting in the POLYDEV.DAT file (below).

-tbasic when used with the -88 flag, loads the Tiny BASIC ROMs into the 2nd and 3rd ROM sockets.

-norun keeps PM from starting to run immediately. This is handy if you want to start running with a breakpoint, for example.

-ops counts the number of opcodes per second (see the Speed of emulation section below).

Any other arguments given on the command line, if they don't start with a dash, are assumed to be the names of vdisk files to be loaded when the system boots.

Here are some examples:

pm -88 -tbasic runs the emulator in Poly-88 mode with Tiny BASIC loaded.

pm -norun starts the emulator in "paused" mode, so that you can then single-step it or tell it to run until a certain address is reached.

pm advent.pm starts the emulator and boots from the vdisk file advent.pm.


The POLYDEV.DAT file

This is a plain text file which configures certain settings automatically. You can edit this file with a text editor such as Notepad. Here are the commands which can be placed in that file:

drive N filename connects the Poly disk drive "N" to the vdisk named "filename." Valid drive numbers are 1 to 7. (Only useful when emulating the 8813.)

printer file connects the Poly's printer output to the PC file named "file." In a real MS-DOS system, you can use filenames like LPT1 or COM2. In XP or DOSbox, it's more likely to work if you connect this to a disk file name instead of a device name. (Only useful when emulating the 8813.)

colors FG1 BG1 FG2 BG2 sets the text colors. FG1/BG1 are the foreground and background colors of the Poly's 16x64 screen area. FG2/BG2 are the colors for the control area at the bottom. Color names like "white"' and "blue" are allowed, with a "b-" prefix meaning "bright."

font filename loads the specified font file. This only works if you're running a real MS-DOS version (not inside XP or an emulator). I've provided two font files, EGA.FNT and VGA.FNT, which will work with this command. Without this command, some of the Poly's special characters (Greek and graphics) won't display correctly, but it tries to use the closest available characters from the PC's standard character set.

fpb on sets the North Star Floating Point Board emulation on. The default is off. (Only useful when emulating the 8813.)

artc off disables the Adaptive Real Time Clock interrupt feature (see below). The default is on.

poly88 on sets the emulator into Poly-88 mode. The default is off.

Any line beginning with a semicolon is ignored. You can use this for comments or to temporarily remove lines from the file. Here is an example POLYDEV.DAT file:

drive 1 system.pm
drive 2 demo.pm
printer NUL
colors b-white blue white black
;artc off
;fpb on
;font vga.fnt


Running PM in DOS, Windows, and DOSbox

PM can run in these environments:

  • A true DOS machine
  • A DOS window in Windows XP
  • DOSbox (a DOS emulator for Windows)

The DOS window in Windows 7 does not run 16-bit programs. You can, however, run the DOS emulator called DOSbox. Assuming your PM files are in a directory called C:\PM, you would run DOSbox as follows:

  • Start DOSbox
  • Issue the commands:
            mount c c:\pm
            c:

The current version of DOSbox is available at: www.dosbox.com

With default settings, it will run, but slowly. You can improve performance by editing the configuration file, whose location is given in the status screen when DOSbox starts. In my system it's located at:

C:\Users\Bob\AppData\Local\DOSBox\dosbox-0.74.conf

Open this file with a text editor such as Notepad. Scroll down to the section marked [cpu] and within this section, find the line beginning with cycles=. Change it to read

cycles=max

This will improve performance significantly, by a factor of about 10 times.

While you're editing this file, you could also consider modifying the [autoexec] section. This will "point" the DOSbox C: prompt to the proper directory for running PM, so that you don't have to type the mount command each time you start DOSbox.

[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
mount c c:\pm
c:


Speed of emulation

You can ask PM to display the speed at which it emulates the 8080 CPU. To do this, issue the command:

pm –ops

This will display (in the bottom area of the screen) the average number of instructions emulated per second. It also displays the number of instructions executed in 1/60 of a second, used to adaptively tune the Poly’s 60 Hz real time clock emulation (see below for more).

On my test systems, I noted the following speeds:

DOSbox 0.74 on Windows 7: about 400,000 (with cycles=max; 40,000 using defaults)
DOS prompt in Windows XP (2.8 GHz): about 16,000,000
True DOS machine (Gateway 600 MHz): about 4,500,000

In a “real” Poly with a 1.8432 MHz clock, and assuming about 5 clocks per average instruction, the count would have been about 1,843,200 / 5 = 369,000 ops/second. So an old Gateway runs Poly programs at about 10x their original speed, and a DOSbox emulation runs about as fast as the original Poly. Not bad, all things considered.


Real-time clock interrupts

The Poly systems received 60 Hz interrupts derived from the power line. These were called Real-Time Clock or RTC interrupts. PM can emulate this in one of two ways. Most programs don’t care, but a few may look at the 60 Hz interrupt (and the RAM variables incremented by its ISR) to determine elapsed time.

In its simplest mode, PM looks at the PC’s 18.2 Hz clock (which increments a 32-bit value in PC memory at address 0x46c), and whenever this changes, will generate an RTC interrupt in the emulator. This will cause some programs to run more slowly, by a factor of 18.2 / 60 or about 30%. Again, few programs did this, but BASIC programs using the TIME function would be affected.

PM will also try to adaptively determine how fast its emulation is running (opcodes per second). This is dependent on exactly what’s executing, but it provides an average. By dividing that by 60, PM generates an RTC interrupt each time that many opcodes have been executed. This average is updated every 5 seconds.

This is called the “adaptive real time clock” or ARTC feature, and is enabled by default. If it appears to be causing a problem, you can force PM to return to 18.2 Hz interrupts by including the following line in your polydev.dat file:

artc off


Archive files

Other files, provided here mainly for archival purposes. These are not needed in order to run the PM program.

This contains the original Poly tape image files, copied from Poly-88 tapes and provided by Dwight Elvey. POLYTAPE.ZIP