Added label type
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
package asmc
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.urbach.dev/cli/q/src/asm"
|
||||
"git.urbach.dev/cli/q/src/x86"
|
||||
)
|
||||
@ -25,13 +23,13 @@ func (c *compiler) move(x asm.Instruction) {
|
||||
position := end - 4
|
||||
opSize := position - start
|
||||
|
||||
if strings.HasPrefix(operands.Label, "data ") {
|
||||
if operands.Label.Type == asm.DataLabel {
|
||||
c.dataPointers = append(c.dataPointers, &pointer{
|
||||
Position: position,
|
||||
OpSize: uint8(opSize),
|
||||
Size: uint8(4),
|
||||
Resolve: func() Address {
|
||||
destination, exists := c.dataLabels[operands.Label]
|
||||
destination, exists := c.dataLabels[operands.Label.Name]
|
||||
|
||||
if !exists {
|
||||
panic("unknown label")
|
||||
@ -48,7 +46,7 @@ func (c *compiler) move(x asm.Instruction) {
|
||||
OpSize: uint8(opSize),
|
||||
Size: uint8(4),
|
||||
Resolve: func() Address {
|
||||
destination, exists := c.codeLabels[operands.Label]
|
||||
destination, exists := c.codeLabels[operands.Label.Name]
|
||||
|
||||
if !exists {
|
||||
panic("unknown label")
|
||||
|
Reference in New Issue
Block a user