|CaddyVM is a personal project in compiler and virtual machine design.
The VM is based on the Intel 8085 processor.
The 8-bit 8085 processor is a great learning CPU, which is why I chose to use
it as a base. The plan is to use a reduced instruction set based on the 8085's.
The purpose of the project is to learn more about assembly and compiler design
using a software simulated CPU that I am familiar with. The 8085 is commonly
used by colleges in basic microprocessor classes due to it's simple, yet
applicable design. The basic design and instruction set of the 8085 is VERY
similar to modern processors such as the Pentium, or Athlon, but more simple.
This project will consist of the following pieces: A Virtual Machine,
an Assembler, and a Compiler(based on C).
A great book to check out is
Intel Microprocessors Hardware, Software, and Applications by Roy W. Goody.
The project is very young with no documentation. I would recommend not bothering
with it until It's more mature.
10/6/2003 - 10:24pm|
I'm considering switching from the 8085 processor to the 8051 microcontroller for this project, or
perhaps branch the project. The 8051 used in many devices. It's also used by hobbists for any number of projects such as robotics, smart sensors, communications devices. I happen to have several here and plan
to work with them quite a bit.
9/2/2003 - 12:10am
I decided to go ahead and implement two more opcodes. (RET and CMP) I've updated my examples below to
9/1/2003 - 4:42pm
The basic virtual machine is up and running. It is able to read in .bin
files created by the assembler. Right now, only 3 instructions are implemented. (MOV, MVI, and ADD) All of the variations of these opcodes are implemented.. (such as Register to Register, Register to Memory, etc..)
The instruction set used was taken directly from the 8085 instruction set specification.
The assembler is capable of detecting syntax errors, and will print out the line number on which an
error has occured.
Since these are all command line applications at this point. There are no screenshots. So instead
take a look at a few other examples.|
Example assembly file: test.asm
Text representation of the .bin file: test.bin.txt
Example: CaddyVM.exe test.bin
CaddyVMAssembler <in filename> <out filename>
Example: CaddyVMAssembler.exe test.asm test.bin
CaddyVMCompiler <in filename>
Example: CaddyVMCompiler.exe test.c