aboutsummaryrefslogtreecommitdiff
path: root/vm/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm/main.c')
-rw-r--r--vm/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/vm/main.c b/vm/main.c
index 005b61e..db9e313 100644
--- a/vm/main.c
+++ b/vm/main.c
@@ -56,7 +56,16 @@ int main(int argc, char *argv[])
const char *filename = "out.bin";
if (argc >= 2)
filename = argv[1];
- inst_t instructions[] = {INST_HALT};
+
+ inst_t instructions[] = {
+ INST_PUSH(BYTE, 0), INST_MOV(BYTE, 0),
+
+ INST_PUSH_REG(BYTE, 0), INST_PUSH(BYTE, 1), INST_PLUS(BYTE),
+ INST_MOV(BYTE, 0),
+
+ INST_PUSH_REG(BYTE, 0), INST_PUSH(BYTE, 5), INST_EQ(BYTE),
+ INST_NOT(BYTE), INST_JUMP_IF(BYTE, 2), INST_HALT,
+ };
assemble_instructions(instructions, ARR_SIZE(instructions), filename);
return interpret_bytecode(filename);
}