CPU Emulator implementation
Implementation of CPU
emulator and custom assembler
for it.
Third task in MIPT in the first year of education.
Motivation
The idea is to understand how CPU works, how CPU communicates with devices (input, output), how assembler works, how translation process is done, how CPU processes bytecode
, what is CPU microcode
and how it is implemented and some other intricacies of CPU, assembler.
Documentation
You can see the user documentation here
and developer documentation here
.
What does this project have?
This project has two main parts:
Supported assembler commands
- Data manipulating:
push
,pop
. - Arithmetic:
add
,sub
,mul
,div
,sqrt
. - Program flow control:
call
,ret
,jmp
,je
,jl
,jg
,jne
. - I/O:
out
,outc
,in
. - Logical:
cmp
.
Program architecture
Coming soon...
Implementation details
Coming soon...
Setting up
Clone the repository
git clone https://github.com/V13kv/CPU-Emulator;
cd CPU-Emulator
Compiling
make init;
make asm proc
Running
./asm.exe <path_to_vasm_file> <output_file_name>
./proc.exe <path_to_compiled_vasm_file>