Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CPU EMULATOR

Processor Architecture Emulator (College project)

This project implements an emulator for a custom processor architecture. The processor's programming model includes the following features:

๐Ÿ”น Four 64-bit general-purpose registers
๐Ÿ”น A program counter
๐Ÿ”น A 64-bit address space
๐Ÿ”น 1-byte length for the content of each memory address

Instruction Set

The instruction set of the emulator includes:

Basic Arithmetic Operations:
    ๐Ÿ”น ADD (Addition)
    ๐Ÿ”น SUB (Subtraction)
    ๐Ÿ”น MUL (Multiplication)
    ๐Ÿ”น DIV (Division)

Basic Bitwise Logical Operations:
    ๐Ÿ”น AND (Bitwise AND)
    ๐Ÿ”น OR (Bitwise OR)
    ๐Ÿ”น NOT (Bitwise NOT)
    ๐Ÿ”น XOR (Bitwise XOR)

Data Transfer Instructions:
    ๐Ÿ”น MOV (Move) with support for both direct and indirect addressing

Branching Instructions:
    ๐Ÿ”น JMP (Unconditional Jump)
    ๐Ÿ”น JE (Jump if Equal)
    ๐Ÿ”น JNE (Jump if Not Equal)
    ๐Ÿ”น JGE (Jump if Greater or Equal)
    ๐Ÿ”น JL (Jump if Less)
    ๐Ÿ”น CMP (Compare) with support for both direct and indirect branching

I/O Routines:
    ๐Ÿ”น Read a character from the keyboard into a register
    ๐Ÿ”น Output a character from a register to the screen

Processor Control:
    ๐Ÿ”น HALT (Stop Processor)
    ๐Ÿ”น RESUME (Resume Processor)

Example of usage

You can write text file that utilizes commands described above and save it to src/java/main/input directory. There are 2 example files already. You can than load them in application using file load command:

fl file_name.txt

Now you can step through each line of code using step(s) command, or just run entire program using run command.

Using help command, you can see other useful commands.

About

Processor Architecture emulator

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages