Titokone
References
- Installation instruction and other references in Titokone project page.
Phased Titokone installation and use instructions
- Read the installation instructions and install Titokone in your Windows or Linux system. For example, in Windows systems, copy titokone.zip into a proper subdirectory (called, e.g., titokone) and unzip it there. If you install Titokone in the file server (e.g., fs-1), it will be usable from any departmental machine later on. If you copy the jar-file, you can start titokone just by clicking it (or possibly with right click and selecting java platform).
- Copy program sum.k91 from the ttk-91 example programs https://www.cs.helsinki.fi/group/nodes/kurssit/tito/esimerkit and store it into some convenient subdirectory (e.g., titokone/ttk91). If the browser adds on an extra file name suffix (.txt), remove it.
- Start Titokone. For example, in Windows systems double-click file titokone.bat in your Titokone subdirectory (e.g., titokone).
- Use Options/Set language (Asetukset/Aseta kieli) to select English user interface.
- Set both compilation options (Options/Set Compiling Options) on
- Empty the simulated ttk-91 machine memory with File/Erase memory.
- Choose symbolic assembly language program sum.k91 in use with File/Open command ()
- Compile sum.k91 with File/Compile command () into machine language program sum.b91. Compilation occurs one line at a time by clicking the button. Look at the comment printed after each line at the top line of the comment window. Finally, you can finish compiling the rest of the program with button.
- What are the values for symbols Done, KBD and Luku? In which memory location is the value for variable Summa stored at execution time? What is the initial value for variable Summa?
- Select from options (Options/Set running options) "Execute code line by line" () and "Show extra comments while executing" ().
- Execute the program with File/Run command (). Give input 5, 4, 3 and 0 one at a time in the KBD-window. Execute the program one instruction at a time with the button and observe, how each machine instruction changes the "state" of the machine by changing register or memory contents. When/if you get bored to executing line by line, you can finish the execution with button. The program execution will anyway stop always when the IN instruction needs to read a value from the keyboard KBD. What value was printed in the CRT window?
- Reset all other execution options but leave "Show animation while executing " () on.
- execute the program with input 444, 333 and 0. Before giving the first number in the KBD window, select animation speed "Slow" on the top of the Animator display. Then continue executing instructions line by line with the button. Notice, how for each instruction, the instruction is first fetched from memory into intruction register IR, from the memory location for that that instruction. What is the numeric value for instruction "LOAD R1, Summa" in register IR? What is the memory address for device "KBD " in MAR-register?
- Modify the program so, that instead of the sum of given values it computes the product of them. You ma edit the program directly in Titokone, or use any text editor outside Titokone. Notice, that in Titokone the original file is always written over!
- Congratulations! Now you can install Titokone into your own environment and execute ready-made ttk-91 programs on it. You can also make small changes into programs. In future, you will of course write your own programs.