KMU - CPU Simulator

Based on the machine described in Appendix C (J. Glenn Brookshear, Computer Science: An Overview)

Central Processing Unit
Arithmetic/Logic Unit
Control Unit

Special Registers

PC
A0
IR
0000

General Purpose Registers (0-F)

Bus
Main Memory (00-FF)

Control Panel

Program Editor

Note: Program will be loaded starting at address 00. Data needs to be loaded manually.

Machine Cycle

Current Phase: Idle

Current Instruction: None

Load a program or press Reset. Set PC to A0 for example program.

Instruction Set

1RXY: LOAD Reg R <- Mem[XY]

2RXY: LOAD Reg R <- Immediate XY (Hex)

3RXY: STORE Reg R -> Mem[XY]

40RS: MOVE Reg R <- Reg S

5RST: ADD Reg R <- Reg S + Reg T (2's Comp)

6RST: SUB Reg R <- Reg S - Reg T (2's Comp)

7RST: OR Reg R <- Reg S | Reg T

8RST: AND Reg R <- Reg S & Reg T

9RST: XOR Reg R <- Reg S ^ Reg T

AR0X: ROTATE Reg R right X bits

BRXY: JUMP to XY if Reg R == Reg 0

C000: HALT

R, S, T = Register (0-F). XY = 8-bit Address (00-FF). X = Rotation amount (0-7).