Update: 11/19/2021
Start Download CPU's

8 bit CPU simulation

Documents pdf:

Cutout example assembler - Windows version

Customization of the interface in the INI file (only Windows version).
Click on quick guide.

Source code of the simulation see download

Programming Windows version

- a German programming language)

When programming with
XProfan 11.2 Freeware Vollversion ( => local copy XProfan 11.2 Freeware Vollversion ),
things like headers, includes and Windows API calls were deliberately omitted to simplify a possible port to another language/platform.

The exe file was created with XProfan 11.2.

The program was structured as sensibly as possible and documented as far as possible.
With '{ ... '} any parts of the code can be folded in the XProfan editor.

A set of auxiliary procedures makes the entire source code clearer and avoids unnecessary repetitions.

Programming browser version

(JavaScript and three.js + comparison to Windows)

The web version is only available in English.

It was developed retrospectively based on the Windows version.

Due to the limitations of the browsers, not all functions could be adopted identically. However, the essential functionality is largely the same.

Not realized:

- dynamic tooltips
- representation of the cache
- rebugging
- selection of a command from the help list (only complete list as image)

Instead of saving to the local file system, the output file and the assembler program are copied to the clipboard. This is made clear by the user interface.

The simulation uses the 3D framework three.js for rendering.

Browsers are allergic to delays in program execution.
However, the simulation runs with selectable clock from single step with arbitrary delay to unbraked. To achieve this, timing control is implemented in the animate function.

This means that some assembler instructions have to be split into parts for display in the ALU. With simple instructions this is unproblematic. The multiplication by Booth contains various nestings, which make it already complicated. After some failed attempts, however, the decomposition worked.

If one compares the algorithms of the multiplication and division it becomes clear that it is almost impossible to decompose the division. In the web version, the preparations for display in the ALU are commented out, the calculation is done exclusively in JavaScript.

Due to the different event models in programming for Windows and for the browsers, no direct comparison of the source code is possible in this respect. Both variants have advantages - as well as disadvantages.

With the Windows program, there is a nesting of event loops in a closed program block.

With the browser, events for each element are handled individually with .addEventListener. This leads to fragmentation of the program logic and slightly different behavior in some places.

The format of the assembly programs is identical.

From the extensive framework three.js only quite few things are needed. Noteworthy is possibly the use of THREE.InstancedMesh for dynamic representation of CPU, RAM and MGA display and the use of a canvas texture for dynamic representation of the assembler commands and flags at the RAM cells.

04/16/2014 - simulation minimal 8 bit processor system - 256 byte RAM