andresberejnoi / CPU_simulation

A virtual CPU (32-bit and 16-bit), simulated using C with a custom-made assembly-language

Repository from Github https://github.comandresberejnoi/CPU_simulationRepository from Github https://github.comandresberejnoi/CPU_simulation

Custom CPU Simulation

This project simulates a processor (16 and 32 bit) and it is a work in progress. The main goal of the project is to learn more about computer architecture. There are some sample assembly language programs as well as their assembled versions.

Generate CPU executable

Run make inside the CPU32 directory to generate the executable 'computer'

How to Assemble Code

To turn assembly into machine language, use the script asm_parser_vxxx.py (The x's represent versions):

python asm_parser_v0.4.py <source code> <output file>

How to run the CPU:

To run the simulation, simply do:

./computer <input assembled program>

About

A virtual CPU (32-bit and 16-bit), simulated using C with a custom-made assembly-language


Languages

Language:C 48.6%Language:Python 38.5%Language:Assembly 10.5%Language:C++ 1.3%Language:Makefile 1.0%Language:Shell 0.1%