Skip to content

garzfaust/Emulator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Emulator

Small cpu emulator

You can add and edit assembler files in the Programs folder. The emulator translates the assembly files into binary files and then executes the binary instructions.

Instruction set:

add a1 a2 a3 #Add values in a1 and a2 and store the result in a3
sub a1 a2 a3 #Sub values in a1 and a2 and store the result in a3
mul a1 a2 a3 #Multiply values in a1 and a2 and store the result in a3
div a1 a2 a3 #Divide values in a1 and a2 and store the result in a3
addi a1 a2 number #Add value in a1 and number and store the result in a3
subi a1 a2 number #Sub value in a1 and number and store the result in a3
muli a1 a2 number #Multiply value in a1 and number and store the result in a3
divi a1 a2 number #Divide value in a1 and number and store the result in a3
LD a1 adr address #Load content stored at address into a1
ST a1 adr address #Store content of a1 into memory at addres


We haven a 256 byte memory, of which bytes 0-127 are reserved for the executable and bytes 128 - 255 for load and store operations. There are 8 registers: 7 genearal purpose register a1-a7 and one zero register x0.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 95.5%
  • Assembly 2.2%
  • CMake 1.7%
  • C 0.6%