Added label type

This commit is contained in:
Eduard Urbach 2025-03-13 16:57:13 +01:00
parent f4b0020c49
commit 14a867bc8b
Signed by: eduard
GPG key ID: 49226B848C78F6C8
32 changed files with 102 additions and 63 deletions

View file

@ -1,9 +1,11 @@
package core
import "git.urbach.dev/cli/q/src/asm"
// AddBytes adds a sequence of bytes and returns its address as a label.
func (f *Function) AddBytes(value []byte) string {
func (f *Function) AddBytes(value []byte) asm.Label {
f.count.data++
label := f.CreateLabel("data", f.count.data)
f.Assembler.SetData(label, value)
label := f.CreateLabel("data", f.count.data, asm.DataLabel)
f.Assembler.SetData(label.Name, value)
return label
}