CPU 1001 Simulator
This is a tool aiming to explain to general public how a processor
works. The tool accompanied the article in a newspaper. The story is
published in Daily News column 1001 in October 2014. The article in
Thai language is divided into two parts for a weekly consumption (I also
wrote it in English, see the link below). I will update this page
from time to time to refresh my general idea how to write for public
service.
Thai article in Daily News: 1st part
( pdf ), 2nd part ( pdf
)
How CPU 1001 works?
Table of instructions
Detailed explanation of the whole
instruction of CPU 1001 (including examples)
Here is a simple example for you to try. Copy and Paste the following
code into input box. The click "run". It will run single-step.
4,10,3,1,4,20,3,2,1,1,2,2,3,3,0
The program is
mvi 10 ; move constant 10
to ac
put r1 ; store ac to r1
mvi 20 ; move 20 to ac
put r2 ; store ac to r2
mov r1 ; move r1 to ac
add r2 ; add ac with r2
put r3 ; store to r3