All operations from entry of a program to its execution are identical with the real KUE-CHIP2 educational CPU board. However, following four points differ from it.
This KUE-CHIP2 simulator consists mainly of two subsystems.
You can see the conditions of simulator on the display subsystem at upper half of display area, and operate it through the control subsystem at lower half of that. You can also invoke some utilities, such as Memory Editor, from the control subsystem.
Applet Edition displays a menu as a separated window at startup. This is because applet cannot have a menu bar. If the menu window appears at wrong size, please resize it manually into appropriate size.
Stand-alone Eition has a menu at the top of a window.
Display subsystem has following LEDs and seven-segment displays.
Display Device | Function |
---|---|
OP (LED) | Light up when a program is running |
P0~P4 (LED) | Execution clock phase |
CF,VF,NF,ZF (LED) | Indicate conditions of Flags. If the flag is set, the corresponding LED will light up. |
INF, IN (LED) | The input value by IN instruction in binary format |
OUTF, OUT (LED) | The output value by OUT instruction in binary format |
PC (7-segment) | Program Counter (PC) in hex format |
IR (7-segment) | Instruction Register (IR) in hex format |
ACC (7-segment) | ACC register in hex format |
IX (7-segment) | IX register in hex format |
MAR (7-segment) | Memory Address Register (MAR) in hex format |
Address (7-segment) | Accessing address in hex format |
Control subsystem has following buttons.
Control Button | SS |
Run a program until HALT instruction. If you push this button while a program is running, the simulator will stop before fetching the next instruction. |
SI | Step only one instruction of the program. | |
SP | Step only one clock phase of the program. | |
RESET |
Reset KUE-CHIP2 simulator into initial state. All registers and flags will be set to zero. |
|
CLOCK | Clock speed can be set in five steps by pull-down menu. | |
Tool Button | MEMORY | Toggles display of memory editor window. |
BLOCK | Toggles display of block diagram window. | |
LOG | Toggles display of log window. | |
Instruction | Displays the current instruction in mnemonic form. | |
Total Phase | Displays total number of phases from beginning of the program. | |
Total Instruction | Displays total number of instructions from beginning of the program. | |
State |
Displays current status of the simulator.
It is represented as following four status.
|
Use Memory Editor to enter a program. When you press MEMORY button on Control subsystem, Memory Editor will appear as a window which is separated from your browser. You can input your program into arbitrary address in byte by byte using this window.
Program code must be in hex format. First, click a value by mouse to reverse it. You have to reverse only one byte. After that, you may type new value in hex format with keyboard.
In this way, you will enter the program in byte by byte.
You may import a program from a text file. Specify the program file in a dialog box after selecting [File]-[Open..] menu.
A text file which contains a program must be written in following format.
(10) 11, 22, 33-44:55@44
Address | 010H | 011H | 012H | 013H | 014H | 015H |
---|---|---|---|---|---|---|
Data | 11H | 22H | 33H | 44H | 55H | 44H |
(00)6c 60
You can entry data into memory as entry of program.
In Stand-alone Edition, you can import data from a text file. You must specify a target address by "[]" in the file.
Executing program is follow the same sequence as KUE-CHIP2 educational CPU board. First, push RESET button to reset all internal conditions of the simulator. Next, use SS, SI and SP buttons to step the program.
The dialog box on the right will appear when you select [Operation...] from [Memory] menu. You can modify memory by following three operations from this dialog box. Select one of three radio buttons.
|
![]() |
In Stand-alone Edition, you can save all memory into a file by selecting [Save Memory...] from [File] menu. This file is read into memory by selecting [Open...] from [File] menu. |
You can set a breakpoint separately for each register (PC, IR, MAR, ACC, and IX). A program will stop at the breakpoint when its condition is satisfied.
For example, if you set break condition to 03H for PC, the program will stop when PC reaches 03H. At the time, BREAK will be displayed in the State: column.
Break condition is set on a small seven-segment display beside a seven-segment of each register. The small seven-segment will be highlighted after you click it by the mouse. Then you can enter a value in hex format from the keyboard.
If you want enable this break condition, select [Break point on] from [Control] menu. Then the menu item will be changed into [Break point off]. Also, you can disable a breakpoint by selecting [Break point off] even if you have already set a value as a breakpoint.
Click a value and type "-" (hyphen) from the keyboard to disable (reset) the value.
First, click a LOG button on the control subsystem to open a Log Window. To begin logging, select [Start Log] from [Log] menu on the window. All execution histories will be displayed in the window. The menu item changes into [Stop Log] while the logging. You can stop the logging by clicking [Stop Log].
You can clear all contents of the log window by selecting [Clear Log] from [Log] menu.
In Stand-alone Edition, you can save the contents of the log window by selecting [Save Log...] from [File] menu.