F21 Simulator and Emulator Updates

The simulator and emulator are for different things. The simulator is slower and simpler and provides some timing information not calculated in the Emulator. The simulator is written in high level Forth so it is easier to modify for experiments. The emulator is very fast and provides fast video emulation.

For more emulator documentation go to f21emu

ROMs for emulator version 3, 10/5/00

Two zip files that contain copies of F21.ROM that run on version three of the emulator were added to this page 10/5/00. These two roms simply display a graphic image on the RBG display and move the arrow sprite over it. The demo rom file wwwdemo.zip uses an image of the UltraTechnology homepage and the demo rom file foxdemo.zip uses a 15 color version of the Courier and Ives 1872 Lithograph The Puzzled Fox from the UltraTechnology Art Galery.

New Versions 2.0 and 3.0 3/8/00

The latest versions of the F21 emulator are faster than ever. I got 6.3 simulated F21 mips on one test program on a 120MHz Pentium machine. They also provide support for simlating 768x482 video, at least the center 640x480 portion of the F21 video display on a VGA 640x480 display on the PC. With a small change these versions can also emulate the other new video modes I have tested with 480,525,540, or 576 pixel horizontal lines. Version 2 and version 3 of the emulator both start with video emulation enabled. If you are not testing a program that generates video in these formats use the "T" key to toggle video emulation off before using the "G", Go, command. For programs that generate video with 384 or 320 pixels per line use version 1.2 of the emulator.

Version 3.0 3/8/2000

Version 3 has been modified to support the mouse interface that I added in my F21 in a Mouse. I simply mounted the four leads from the mouse wheel encoders in the mouse to four bits on the Parallel Port of F21. Mouse buttons can be run to other bits, although it is simulated I haven't run the wires in the mouse yet or written any software that uses mouse buttons. The first demos are with a "zero button mouse" that uses a "Point" interface rather than a "Point and Click" interface. In version 3 I modified the meaning of the arrow keys when in graphics mode to simulate mouse movements and the "," "." and "/" keys as left, right, and no mouse buttons pushed. This allows me to run the second ROM demo and move the mouse pointer in the emulation with the arrow keys using the same program in the simulated F21 that reads the mouse wheel encoder and buttons on the pport.

The F21 simulator and emulator can simulate more than just the CPU or even F21 coprocessors by adding code to simulate hardware connected to an F21. In the case of version 3 I have simulated a mouse wheel and mouse buttons. Perhaps I will make a version 4 that uses the PC mouse input as the simulated mouse input for F21 rather than some keys. But version 3 will run on a PC under DOS and does not require a mouse. Like earlier versions of the emulator EMM is still required. In Windows 95 and 98 it is easy to configure DOS windows to get as much EMM as they ask for automatically. You may also setup a shortcut with 10MB of EMM provided for the emulator. Without sufficient EMM available the F21 emu will not run. Windows NT does not provide DOS programs with EMM without third party software.

ROMs for emulator versions 2 and 3

Both versions 2 and 3 come with demonstration ROMs run on F21d prototype chips. The ROM code boots a program and data image from ROM to DRAM and configures the CPU memory and speed control registers. Then the CPU writes instructions for the video coprocessor to generate 768x482 RGB video, 640x440 only visible on TVs. The program then starts an application which are simulated virtual osciloscope demos. A real (virtual) osciloscope that uses the analog coprocessor would require a bit more code than these simple animated demos.

Versions 2 and 3 provide a mechanism to save a modified ROM image. So one can compile source code for programs in DRAM as you did before, then pack the image into ROM in the format the ROM uses at boot and ROMs may be written that will boot up and run on F21 chips just as they do on the emulator only much faster.

If a F21.ROM file is present when the emulator starts it will load the file into memory and begin processing at the 1AAAAA boot address in ROM. If a source file name is given on the command line as before as in F21 TEST (TEST.SEQ will be assumed) then source will be compiled into DRAM and tested without using the ROM boot image.

In both versions 2 and 3 the emulator defaults to video emulation. So to runs the demos just start "F21" from the command line or by an icon and hit "G" to Go into the simulated application.

Demo ROMs

SCOPEDEM.ZIP is intended for use with version 2 of the emulator and will unzip to make a F21.ROM file. That file contains a simple simulated virtual osciloscope demo. No program input is used. It simply bit blits a number of graphic images to the screen with some delays and loops. If this ROM image is present with either version 2 or 3 of the emulator it will run the same demo on the PC in VGA 640x480 graphic mode.

SCOPE.ZIP is intended for use with version 3 of the emulator and will unzip to make a F21.ROM file. This program reads the parallel port to get input from a mouse and runs a simple desktop and demo application. The program starts and takes a few seconds (on the emulator) to boot from ROM and setup video. Then it puts an icon of a scope on the desktop. Point to it with the arrow sprite and it launches a large scope image. Pointing to the "Return" button returns to the desktop. Pointing to the "start" button on the scope starts an animation on the scope display. The program supports a 768x482 pixel display and allow the arrow sprite to move to the left and right beyond the range of the 640 pixels displayed by the emulator. Be careful not to move the arrow sprite cursor off the screen where you can't see it or the program will be harder to control.

The whole program, boot from ROM code, CPU initialization, video coprocessor code setup, bitblock transfer, mouse driver and the arrow sprite are less than 1K without all the extra nops there to make the prototype chips I have been testing happy and less than 2K with those extra nops. The application itself is only a couple of hundred words and was coded in a matter of minutes as a demo. This distribution is the ROM image. I will distribute the source with more complete mouse support soon.

For those who wish to edit source code and compile new versions I have included the version of FPC that I use to compile F21. The version uploaded prior to 10/5/00 was not correct and failed on ASM.386. The current version of F.EXE includes the assembler and works with the MAKEEXE.BAT batch file that creates the F21.EXE file.


New downloads 3/8/2000:

f21emu3.zip Emulator Version 3.0 with 640x480 video and mouse support S.P. & J.F. (140k)

osciloscope icon
scope.zip f21.rom virtual osciloscope demo w/ mouse input for Emulator Version 3.0 J.F. (40k)

f21emu2.zip Emulator Version 2.0 with 640x480 video support S.P. & J.F. (140k)

osciloscope icon
scopedem.zip f21.rom virtual osciloscope demo for Emulator Version 2.0 J.F. (40k)

bmp2.zip BMP file display demo on 640x480 display S.P. (180k)

fpc.zip FPC version for compiling emulators (110k) updated 10/5/00


Older Versions 1.2 and 1.1 and demos 9/1998

bmp demo 9/22/1998 emubmp1.zip BMP file display demo S.P.
Version 1.2

The F21 emulator version 1.2 gets 5.7 simulated F21 mips on my 120mhz Pentium machine. A fast PC will run the emulator at close to the typical 20 mips rate of a real F21 when running code out of DRAM and generating video at the same time. The maximum speed for a real F21 in SRAM with no video being generated is 222mips.

To run a demo download and unzip the demo file then run F21 DEMO.SEQ or START.BAT at the DOS command line or from an icon in windows.

F21.ROM exists it will be loaded into the F21 ROM address space and execution will start at address 1AAAAA (cold boot) in F21 ROM.

In F21EMU enter T T G to turn on Video emulation and GO into the emulation.

9/22/1998 emubmp1.zip BMP file display demo S.P.
8/29/1998 EMUDEMO4.ZIP very simple GPUT animation demo version 2. J.F.
EMUDEMO4 version 1 posted 8/27/1998
8/24/1998 EMUDEMO2.ZIP GPUT GAND GOR GXOR demo J.F.
8/22/1998 EMUDEMO1.ZIP painting background demo J.F.

F21 Emulator Releases:
3/8/2000 3-0 Released (max 6.3M F21 ops on 120mhz Pentium, 640 video, mouse
3/8/2000 2-0 Released (max 6.3M F21 ops on 120mhz Pentium, 640 video
11/2/1998 1-2 Released (max 5.7M F21 ops on 120mhz Pentium)
8/20/1998 1-1 Released (max 3.8M F21 ops on 120mhz Pentium)
8/19/1998 1-0 Released (max 600K F21 ops on 120mhz Pentium)
8/19/1998 This document created

Just click on the references here and save a copy then unzip and use them on your system.

Downloadable examples are available as zip files. They an be downloaded, unzipped and run using the command F21.EXE DEMO.SEQ or START.BAT

The original 1.0 release of the F21 emulator that was here as the 499KB zip file from 8/17/1998 that was distributed on diskette was replaced by the 495KB zip file f21emu.zip version 1.1 on 8/20/1998. The latest version is The 1.2 release of the F21 emulator is now here as the 357KB zip file posted on 11/2/1998

F21Emu is written in FPC. You can get a copy of the complete package at the www.Forth.org


F21 Simulator

The latest version of the simulator is F21sim 1.1 it includes a new list of features for compatibility with the F21 emulator.

To run a demo download and unzip the demo file then run F21 DEMO.SEQ or START.BAT at the DOS command line or from an icon in windows. In F21sim enter G to start the simulation. Use V to View the simulated Video display.

The F21sim 1.1 release includes list of features for compatibility with the F21 emulator. This list includes:
1. Q quit command added
2. help updated w/ Q listed
3. command prompt includes Q
4. number interpretter accepts 21 bits w/o a dot ie. 12345 vs 12345.
5. Load, assemble source file at start like emulator
6. GO can be used in source code
7. _G fixed when trace is off (had a bug)
8. EMPTY added use at the start of the main source file
9. CONSTANT creates FPC word to put CONSTANT on FPC stack
use:
12345 CONSTANT myconst
myconst # over and dup etc
ie # must be used with CONSTANTs ..

Version 1.1 replaces the original 1.0 release of the F21 simulator that was here as a 612KB zip file from 8/17/1998 that was distributed on diskette

.