From ba2b9c8a1bb1876b6eb4c9783fde798b19de4418 Mon Sep 17 00:00:00 2001 From: stefan Date: Wed, 24 May 2023 08:32:08 -0400 Subject: init --- vm/main.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 vm/main.go (limited to 'vm/main.go') diff --git a/vm/main.go b/vm/main.go new file mode 100644 index 0000000..61aeebb --- /dev/null +++ b/vm/main.go @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "os" +) + +func main() { + + if (len(os.Args) != 2) { + fmt.Fprintf(os.Stderr, "usage: %s bytecode.bin\n") + os.Exit(1) + } + + b, err := os.ReadFile(os.Args[1]) + + if err != nil { + fmt.Fprintf(os.Stderr, "failed to open file: %s\n", os.Args[1]) + os.Exit(1) + } + + vm := NewEvm(b) + + vm.Start() +} + -- cgit v1.2.3