nano_code
- 6 Devlogs
- 17 Total hours
nano_code is a small bytecode written in pure assembly and designed to be fast. The main goal is just to enjoy programming in x64, arm and risc-v assembly and also to try to beat the JVM on the speed.
nano_code is a small bytecode written in pure assembly and designed to be fast. The main goal is just to enjoy programming in x64, arm and risc-v assembly and also to try to beat the JVM on the speed.
I think I am done with this project… I hope it´s fine to ship it.
Okay so I finished the bytecode, all is working great! I started a language for it which is closer to assembly. I do it with customASM. On the image you can see the Fibonacci algorithm
Okay so I added memory operations from 8 bits to 32 bits. I also did the syscall system but for now I just have one syscall which is print (the same as the write syscall on linux).
All operations on registers are done. It´s faster than JVM for 100 numbers of Fibonacci. So now I just have to make the memory operations and the syscall system. Then the core will be done.
Last three days I added a lot of instructions. We can perform arithmetic expressions and jump with and without conditions. So I think my VM is turing complete isn´t it?
Today I did a fibonacci test and I beat the JVM.
Last days I worked on a small and simple project called nano_code. It´s a bytecode written in pure assembly and designed to be fast. I hope I can beat the JVM on modern PC.
So what did I do?
Actually I did the hardest part of this project by making the loop (fetch-decode-execute). Now I just need to implement the instructions one by one.
Oh and I don´t load bytecode from a file for now so I have to implement it later.
I already implemented movr and movi (r = register and i = immediate), and I am currently making the arithmetic operations like add, sub, mul, div, and mod which is modulo of course. All of these instructions have two version : one with a register and an immediate value and the other one with two register as the operands.
Of course in the future I will need to make a small assembler to write easily code for that VM.
Thanks for reading, see you soon.