|
IC8 -- a Simulator for an Imaginary Computer
Via this page you can run IC8, a simulator for
the imaginary computer that is presented in some of my books.
There are two versions of the simulator available. The new 1.1 version
provides better graphics and animation. I recommend that you try the new
version. Please, inform me
if you find an error in the new simulator version.
Select a link below to activate the IC8 simulator. Please,
open this page into another browser window if you want to simultaneously
use the simulator and read the instructions below. It is best to maximize
the size of your browser window when you run the simulator.
RUN
THE NEW IC8 v1.1 SIMULATOR
RUN THE IC8 v1.0 SIMULATOR
The imaginary computer is an extremely simple 8-bit computer
with which it is easy to learn the basics of computer technology. You can
get information of the imaginary computer if you print the sample pages
of Chapter 4 of my book A Natural Introduction
to Computer Programming with C#. Chapters 3 and 4 of the mentioned
book are provided freely, so that you can start your programming studies
with them.
IC8 is a simulator program which imitates the behavior
of the imaginary computer on a real computer. The IC8 simulator is a so-called
Java applet, a computer progarm that runs on an Internet page. To run the
simulator, you need a browser in which the execution of Java applets is
enabled. The new IC8 v1.1 requires a newer version 5 of the Java Runtime
Environment.
Here are some instructions for using the IC8 simulator:
By pressing the Load (Program) button, you can load an executable
program into the main memory of the imaginary computer. There are many
compiled ready-to-run executable programs built in the simulation program.
After a program has been loaded with the Load button, it
can be executed by pressing the Execute button. The Execute button transforms
to Pause button with which you can stop the execution temporarily. When
the program is stopped, this button is the Continue button with which you
can resume program execution.
The execution speed of the simulator v1.1 can be adjusted
with the 'leds' that you can find below the small screen. By clicking these
leds with the mouse, you can switch them on or off. The more leds are on,
the greater is the speed of the simulator. In the older v1.0 simulator,
the simulation speed is altered with the Slower and Faster buttons.
The Reset button loads value 00H to register PROGRAM POINTER
and value FFH to all other important processor registers. The INPUT READY
signal is set to 0. The screen is cleared, but the contents of the main
memory are not modified.
By clicking the Translate button, you can see a kind of textual
form of the program in the main memory. Re-click it for returning back
to the normal view.
With the Modify button you can put the simulator to a mode
in which you can modify the contents of the main memory. After the Modify
button has been pressed, you can click on memory locations with the mouse
and enter new values to the selected locations through the keyboard. You
must repress the Modify button to get back to the normal simulation mode.
By selecting one of the buttons with labels 16, 10, or 2,
you can choose the numbering system in which numbers are shown inside the
main memory and the registers. In the old v1.0 simulator, these buttons
are labeled HEX, BIN, and DEC. It is recommended that you select the hexadecimal
numbering system because that numbering system is used when the simulator
displays text lines while it is executing a program.
An important feature of the simulator is that if you click
with the mouse on an instruction in a memory location, when the simulator
is executing a program, the execution goes with maximum speed until the
clicked instruction, and continues then with the normal, selected speed.
(There is no Step button in IC8, but this feature can be used instead of
the Step button.)
When the new simulator v1.1 starts operating, it displays
some text lines and shows a red light on the Load button. This takes something
like 10 seconds. You can, however, begin using the simulator while these
starting ceremonies are going on.
While you are using the IC8 simulator program, you should
remember that it is a program that has not been widely tested, and there
may be errors in it. Although I do not know about any serious errors in
IC8, I cannot guarantee that it operates correctly. And most importantly,
I shall not assume any kind of responsibility for any kind of damages the
IC8 simulator (or the ICOM simulator) causes while you are using it. Because
IC8 is an applet, not a real application, it should not cause any serious
troubles on your computer.
If it seems that the IC8 simulator is not operating
properly, a wise thing to do is to first close your browser, restart the
browser, and then go back to the page of the simulator.
In the older IC8 1.0 version, a progarm must be loaded into
the main memory of the simulator before the Execute button can be pressed.
This means that if you want to create your own programs to the simulator
memory, you must first load an existing program, and then create a new
program by modifying (overwriting) the loaded program. In the new 1.1 version
you do not need to load a program before you press the execute button.
The new simulator stops if it finds an unknown instruction code in the
main memory.
When the simulator program is executing,, it is possible
that it is difficult to write a new Internet address into the address field
of your browser. To solve this problem, use first the Back button of your
browser to exit the simulator page. As the simulator is a computer program
that is being run when its page is open, it may be a good idea to exit
the simulator page when you are not actually using the simulator.
The executable programs that are built into the IC8 simulator
are also available as IML programs. You can find them, for example, here.
IML is a simple low level programming language that is presented in my
programming books.
You may use the IC8 simulator freely, but the Java programs
which it is made of are not public, and the Java .class files may not be
copied. The simulator has been designed by me, Kari Laitinen, and Mr. Jukka
Tervaskanto. Jukka is the original writer of many of the Java programs
that were needed for the simulator. He did really great work while writing
those programs.
IC8 is a useful tool for self study and in courses such
as Introduction to Computer Architectures or Basics of Computer
Technology. The architecture of the imaginary computer simulated by
IC8 is extremely simple. Thus the computer architecture should be easy
to learn. Yet it is possible to perform many traditional computing tasks
with this simple computer architecture. The traditional computing tasks
that IC8 can do include conditional jumps, loops, subroutine calls with
the help of stack, basic arithmetic and stack operations. Despite the small
size of the main memory, IC8 can run rather complicated programs. For example,
the simulator includes programs which perform software-based multiplication
operations.
Exercises with the IC8 simulator
by Kari Laitinen
In order to do the exercises below you need to have a
table of ASCII/Unicode character codes available. Such a table can be found,
for example, at the end of my C#
book.
Load program hello.iml into the main memory
and do the following:
Modify the program so that it prints "Hello?" instead of
"Hello!"
Modify the program so that it prints "Cheers".
Modify the program so that it adds an exclamation mark to
the end of the text and prints "Cheers!".
Load program hello_loop.iml into the main
memory and do the following::
Modify one (and only one) byte of the program so that it
prints "Hello?" instead of "Hello!".
Modify one (and only one) byte of the program so that it
prints "Hello" instead of "Hello?".
Modify the program so that it prints "Hello, world".
Load program abcde.iml into the main memory and do
the following::
Modify one (and only one) byte in the program so that it
prints "GHIJK" istead of "ABCDE".
Modify two bytes (one operand and one instruction) in the
program so that it prints the letters in reverse order so that instead
of "GHIJK" it prints "KJIHG".
Load program aaaabbbbcccc.iml into the main memory
and do the following::
Modify one (and only one) byte in the program so that it
prints "xxxxyyyyzzzz" instead of "aaaabbbbcccc".
Modify the subroutine of the program so that it prints the
given character five times, i.e., instead of "xxxxyyyyzzzz" the program
should print "xxxxxyyyyyzzzzz".
Modify the already modified subroutine by replacing the second
and fourth of the output_byte_from_register_a instructions with instructions
decrement_register_a and increment_register_a, respectively, so that the
whole program prints "xwxyxyzyz".
© 2005-2009 Kari Laitinen
To www.naturalprogramming.com main page.
Page created: August 25, 2004
May 2, 2008 A link to IC8 v1.1 was added.
Last modification: January 1, 2009
|