Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Assets/Patterns/10. Bytecode/Scripts/VM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ public void Interpret(int[] bytecode)
}
case Instruction.INST_LITERAL:
{
//Important that this i++ is not inside bytecode[i++] or it will not jump to next i
i++;

int value = bytecode[i];

Push(value);
////Important that this i++ is not inside bytecode[i++] or it will not jump to next i
//i++;
//int value = bytecode[i];
//Push(value);

//this can be a oneliner
//in this case bytecode will use i+1 bytecode element
Push(bytecode[++i]);
break;
}
case Instruction.INST_GET_HEALTH:
Expand Down