VRScript 🔗
A simple compiler for vr-asm written in Python, being the highest in the abstraction order of computing. On the contrary this runs on x64 and not on vr16-isa.
VRScript is the name of language for which “software” to be developed on the CPU.
Features 🔗
- Comments can be made using “ `` “ (double backtick).
- Register assignments:
<register> = <int>- onlyr0,r1,r2,r3are valid left-hand sides. - Arithmetic calls:
<instruction>(<store_at>, <operand_one>, <operand_two>)- supported instructions areadd,sub,mul,div. - For loops:
for <var> in <n> { <reg> <op> <value> }- runs the bodyntimes.<n>must be an integer in range0..VR16_MAX_FOR_LOOP_ITERATIONS(default max:10000) to prevent huge compile-time unroll output.- Supported loop body operators:
++→addi--→subi**→muli//→divi
- Example:
for i in 4 { r3 ++ 2 }emitsaddi r3, 2;four times.
Working 🔗
compiler.pyRuns in a similar fashion to the assembler.- Line by line is parsed.
- `` are comments.
extractor.py- Based on opcode, an extractor function is chosen.
- This function further rights the correct assembly code in to a
.asmfile.