NeonVM is a small simple pcode VM that assembles source files into a byte code and is then executed by a built in small VM, in this project works by taking the asm style source code and breaking it up into tokens skipping any comments and blank lines it then sorts out any label locations that we use for jumps and finaley parsers it into a byte code into a int list that is then executed by the VM,
At the moment there is only one data type that is Integer, it supports 25 variables of single letter A..Z, next update I am going to change this to support real variable names, it supports Jumps calls a non-returning functions every at this point as in regard to variables are global next update should support local also and I hope to add a few other things as I proceed with the project. any comments are welcome no matter what they are.
Here is a little example project you can test I also left others in the debug folder.
Times Table Lister
Loop exampleCode:iconst 1 store a iconst 12 store b call table loop: load a load t imul store r load r syscall 1 load a iconst 1 iadd store a load a load b le Jump_True loop halt table: iconst 32 iconst 'e' iconst 'l' iconst 'b' iconst 'a' iconst 'T' syscall 2 syscall 2 syscall 2 syscall 2 syscall 2 syscall 2 syscall 3 store t ret
DownloadCode:iconst 0 store a iconst 10 store b loop: load a syscall 1 inc a load a load b le Jump_True loop halt
NeonVM.zip


Reply With Quote
