I also started with marks code too.
my compiler takes the source and compiles it to byte code.
the compiler is not fully developed yet. the vm will take the byte codes and executed it. so its interpreted.
label for labels, jmp for jump, what does the jz stand for.
So with this background info I can tell how labels work in BlitzScript3D. The compiler outputs an instruction called BSCVM_OP_LABEL and a operand that is the ID of that Label. When the VM loads the compiled script and comes across the BSCVM_OP_LABEL instuction, it creates a label, assigns it the id and stores the Instruction Pointer value to the label.
When the VM executes each instructoin stored in the Instruction Array. Instruction Pointer is incremented to the next instruction. So when the VM runs across the BSCVM_OP_LABEL, BSCVM_OP_JZ or BSCVM_OP_JMP instructions, the it accesses the Label's ID and sets the Intruction Pointer valued stored in the Label.
can you explain this a little bit more.
my compiler takes the source and compiles it to byte code.
the compiler is not fully developed yet. the vm will take the byte codes and executed it. so its interpreted.
label for labels, jmp for jump, what does the jz stand for.
So with this background info I can tell how labels work in BlitzScript3D. The compiler outputs an instruction called BSCVM_OP_LABEL and a operand that is the ID of that Label. When the VM loads the compiled script and comes across the BSCVM_OP_LABEL instuction, it creates a label, assigns it the id and stores the Instruction Pointer value to the label.
When the VM executes each instructoin stored in the Instruction Array. Instruction Pointer is incremented to the next instruction. So when the VM runs across the BSCVM_OP_LABEL, BSCVM_OP_JZ or BSCVM_OP_JMP instructions, the it accesses the Label's ID and sets the Intruction Pointer valued stored in the Label.
can you explain this a little bit more.