Added define operator
This commit is contained in:
parent
06d16b48da
commit
a4ecaf0622
9 changed files with 51 additions and 51 deletions
|
@ -2,7 +2,6 @@ package asm
|
|||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/build/arch/x64"
|
||||
"git.akyoto.dev/cli/q/src/build/config"
|
||||
|
@ -29,12 +28,12 @@ func (a *Assembler) Finalize() ([]byte, []byte) {
|
|||
for _, x := range a.Instructions {
|
||||
switch x.Mnemonic {
|
||||
case MOVE:
|
||||
code = x64.MoveRegNum32(code, uint8(x.Data.(RegisterNumber).Register), uint32(x.Data.(RegisterNumber).Number))
|
||||
code = x64.MoveRegNum32(code, uint8(x.Data.(*RegisterNumber).Register), uint32(x.Data.(*RegisterNumber).Number))
|
||||
|
||||
if x.Data.(RegisterNumber).IsPointer {
|
||||
if x.Data.(*RegisterNumber).IsPointer {
|
||||
pointers = append(pointers, Pointer{
|
||||
Position: Address(len(code) - 4),
|
||||
Address: Address(x.Data.(RegisterNumber).Number),
|
||||
Address: Address(x.Data.(*RegisterNumber).Number),
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -49,12 +48,6 @@ func (a *Assembler) Finalize() ([]byte, []byte) {
|
|||
}
|
||||
}
|
||||
|
||||
if config.Verbose {
|
||||
for _, x := range a.Instructions {
|
||||
fmt.Println("[asm]", x.String())
|
||||
}
|
||||
}
|
||||
|
||||
dataStart := config.BaseAddress + config.CodeOffset + Address(len(code))
|
||||
|
||||
for _, pointer := range pointers {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue