identified issue with single instruction linking in vm

This commit is contained in:
Irmen de Jong 2019-03-12 21:59:40 +01:00
parent ce40f6f862
commit 1aaf854ef7
2 changed files with 8 additions and 1 deletions

View File

@ -18,7 +18,7 @@ fun stackVmMain(args: Array<String>) {
}
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 {

View File

@ -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()