Commit 0fccbeab authored by obscuren's avatar obscuren

No longer return a list, but raw bytes

parent 720521ed
...@@ -131,13 +131,14 @@ func Instr(instr string) (int, []string, error) { ...@@ -131,13 +131,14 @@ func Instr(instr string) (int, []string, error) {
// Script compilation functions // Script compilation functions
// Compiles strings to machine code // Compiles strings to machine code
func Assemble(instructions ...interface{}) (script []string) { func Assemble(instructions ...interface{}) (script []byte) {
script = make([]string, len(instructions)) //script = make([]string, len(instructions))
for i, val := range instructions { for _, val := range instructions {
instr, _ := CompileInstr(val) instr, _ := CompileInstr(val)
script[i] = string(instr) //script[i] = string(instr)
script = append(script, instr...)
} }
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment