diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2017-05-28 15:17:02 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2017-05-28 15:17:02 +0200 |
commit | 42a28d800ef7959e5dedc58ef8cbf1614f48da4a (patch) | |
tree | 096b686a70a00632733d5e0c9f103146c57244d7 /cmd | |
parent | 72103d06b5f2ef5670c029ed50a99525375dd62f (diff) |
package
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dump/main.go | 18 | ||||
-rw-r--r-- | cmd/eval/main.go | 13 |
2 files changed, 31 insertions, 0 deletions
diff --git a/cmd/dump/main.go b/cmd/dump/main.go new file mode 100644 index 0000000..451b934 --- /dev/null +++ b/cmd/dump/main.go @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" + + "dim13.org/j1" +) + +func main() { + body, err := j1.ReadBin("testdata/j1.bin") + if err != nil { + panic(err) + } + for i, v := range body { + inst := j1.Decode(v) + fmt.Printf("%0.4X %0.4X\t%s\n", 2*i, v, inst) + } +} diff --git a/cmd/eval/main.go b/cmd/eval/main.go new file mode 100644 index 0000000..14e2d53 --- /dev/null +++ b/cmd/eval/main.go @@ -0,0 +1,13 @@ +package main + +import "dim13.org/j1" + +func main() { + vm := new(j1.J1) + if err := vm.LoadFile("testdata/j1.bin"); err != nil { + panic(err) + } + for i := 0; i < 100; i++ { + vm.Eval() + } +} |