Reduced memory allocations
This commit is contained in:
@ -40,8 +40,8 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {
|
||||
case token.String:
|
||||
f.count.data++
|
||||
label := fmt.Sprintf("%s_data_%d", f.Name, f.count.data)
|
||||
value := t.Text()[1 : len(t.Bytes)-1]
|
||||
f.assembler.Data[label] = []byte(value)
|
||||
value := t.Bytes[1 : len(t.Bytes)-1]
|
||||
f.assembler.SetData(label, value)
|
||||
f.RegisterLabel(asm.MOVE, register, label)
|
||||
return nil
|
||||
|
||||
|
Reference in New Issue
Block a user