Make Operands an array
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package asm
|
||||
|
||||
import "fmt"
|
||||
import "strings"
|
||||
|
||||
import "github.com/firestuff/subcoding/vm"
|
||||
import "github.com/pkg/errors"
|
||||
@@ -28,7 +29,11 @@ func disassembleFunction(fnc *vm.Function) ([]byte, error) {
|
||||
}
|
||||
|
||||
func disassembleInstruction(in *vm.Instruction) ([]byte, error) {
|
||||
fmt.Printf("%s\n", nameByOpCode[in.OpCode])
|
||||
parts := []string{
|
||||
nameByOpCode[in.OpCode],
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
encoded := fmt.Sprintf("[%s]", strings.Join(parts, ", "))
|
||||
|
||||
return []byte(encoded), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user