diff --git a/compiler/src/prog8/StackVmMain.kt b/compiler/src/prog8/StackVmMain.kt index 757972e19..10302a8c7 100644 --- a/compiler/src/prog8/StackVmMain.kt +++ b/compiler/src/prog8/StackVmMain.kt @@ -18,7 +18,7 @@ fun stackVmMain(args: Array) { } val program = Program.load(args.first()) - val vm = StackVm(traceOutputFile = null) + val vm = StackVm(traceOutputFile = "trace.txt") // TODO null val dialog = ScreenDialog() vm.load(program, dialog.canvas) EventQueue.invokeLater { diff --git a/compiler/src/prog8/stackvm/Program.kt b/compiler/src/prog8/stackvm/Program.kt index b664caf66..b4d9a7270 100644 --- a/compiler/src/prog8/stackvm/Program.kt +++ b/compiler/src/prog8/stackvm/Program.kt @@ -275,6 +275,13 @@ class Program (val name: String, private fun connect() { + + // TODO: because of JUMP instructions, the below doesn't work + // you cannot link instructions with just 1 instruction flow + // because JUMPS to another place will cause a RETURN to return back to different locations depending on what's called it... + // probably just need a real instruction pointer (based on index?) and call stack. + + val it1 = program.iterator() val it2 = program.iterator() it2.next()