summaryrefslogtreecommitdiff
path: root/vm1
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2023-09-04 16:58:15 +0200
committerMarc Vertes <mvertes@free.fr>2023-09-04 16:58:15 +0200
commit4241593b42bffac2f8fcb63f1e88621fe025e360 (patch)
tree48680879982947524e1b028e179608bb5cbcda23 /vm1
parent8feddd9b3eefb920c4a0c7a5b4c3b8ae160f3c71 (diff)
codegen: add interpreter tests
Also simplify project structure. The executable is now produced in the root directory. Work in progress.
Diffstat (limited to 'vm1')
-rw-r--r--vm1/vm.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm1/vm.go b/vm1/vm.go
index 572a171..01bba83 100644
--- a/vm1/vm.go
+++ b/vm1/vm.go
@@ -2,6 +2,7 @@ package vm1
import (
"fmt" // for tracing only
+ "log" // for tracing only
"reflect" // for optional CallX only
"strconv" // for tracing only
)
@@ -79,7 +80,7 @@ func (m *Machine) Run() (err error) {
op3 = strconv.Itoa(int(c[3]))
}
}
- fmt.Printf("ip:%-4d sp:%-4d fp:%-4d op:[%-9s %-4s %-4s] mem:%v\n", ip, sp, fp, strop[c[1]], op2, op3, mem)
+ log.Printf("ip:%-4d sp:%-4d fp:%-4d op:[%-9s %-4s %-4s] mem:%v\n", ip, sp, fp, strop[c[1]], op2, op3, mem)
}
for {