Simulator
This is a simulator of my processor that I built out of 2000 transistors.
If you want to know the explanation of this program go to Hello world. If you want to know controls or processor details scroll down.
0
0
0
0
0
0
Processor details
The simulator simulates my processor which I made:
The above assembly code is really simple and could be made much better (for example by introducing loops), but it shows the essance of the processor.
Remember my processor uses 2 words per instruction so there always have to be 2 words per instruction... These are all supported instructions:
Data moving
--------------
SP2ACC 0 move SP to ACC
ACC2SP 0 move ACC to SP
PC2ACC 0 move PC to ACC
ACC2PC 0 move ACC to PC
Loading:
--------------
STA2SP 0 store ACC to top of stack
STA addr store ACC to addr
LDAFS 0 load ACC from top of stack
LDA addr load ACC from addr
LDAI val load val to ACC
Branching:
--------------
B label jump to label
BNEQ label jump to label if not ZERO flag
BEQ label jump to label if ZERO flag
ALU ops
--------------
ADD addr add value on addr to ACC
ADDI val add val to ACC
ADDISP val ACC = SP + val
NOT 0 negate ACC
NAND addr NAND value at addr with ACC
IO
--------------
PRINT val send val to LCD
READ 0 read keyboard to ACC
As you can see it actually can implement functions and we go through that example in functions. It has accumulator architecture and I go through it here.
Controls
You write your assembly in the left text box. It is automatically checked for syntax and the errors will show on the right.
If there are no error and the program is runnable memory representation will appear and you will be able to press "Run". You can also copy the memory representation but that is if you want to run it on the actual processor.