This sections gives a brief outline of how to download, install, and run the Sim8 microcomputer simulation. For more detailed information on the use of Sim8, see the documentation index.
Step1: Install Java on your computer
In order to run Sim8 you need to have the Java runtime environment installed on your computer. This guide does not explain how to download and install Java.
Step2: Download the Sim8 software
Get one of these files:
If you have any trouble let me know.Step3: Run the simulator and load a program
This will bring up the main Sim8 "Console" on your screen. The console contains a display of all the CPU registers, and it has several buttons on it, including buttons that say "Power", "Load", and "Run." Near the top of the console are two menus labeled "Settings" and "Information."
Notice that all memory locations start out as zero.
# This program counts from 1 to 10 !locdec !valbin # lda 0 000:00011100 001:00000000 #loop add 1 002:00111100 003:00000001 # out 004:11110001 # cmp 10 005:10101100 006:00001010 # jlt loop 007:00001101 008:00000010 # halt 009:11111111Some comments about the load file format: First, any lines that start with the "#" character are treated as comments by the loader. The comments in the file above contain "mnemonic" representations of the machine language instructions, i.e. assembly language.
The lines that have the form "number:number" provide the data which is actually loaded into Sim8 memory. The number before the ":" is the memory location which is to be loaded. The number after the ":" is the value which is to be loaded into that location.
The line "!locdec" tells the loader that the location field in this load file is specified in decimal. The "!valbin" line indicates that the value field is binary. It's convenient to specify machine language instructions in binary because it makes it easy to encode and decode the various bit fields.