Implemented dynamic array indices
This commit is contained in:
@ -3,6 +3,7 @@ package asm
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"math"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@ -287,9 +288,17 @@ func (a Assembler) Finalize(dlls dll.List) ([]byte, []byte) {
|
||||
case STORE:
|
||||
switch operands := x.Data.(type) {
|
||||
case *MemoryNumber:
|
||||
code = x64.StoreNumber(code, operands.Address.Base, operands.Address.Offset, operands.Address.Length, operands.Number)
|
||||
if operands.Address.OffsetRegister == math.MaxUint8 {
|
||||
code = x64.StoreNumber(code, operands.Address.Base, operands.Address.Offset, operands.Address.Length, operands.Number)
|
||||
} else {
|
||||
code = x64.StoreDynamicOffsetNumber(code, operands.Address.Base, operands.Address.OffsetRegister, operands.Address.Length, operands.Number)
|
||||
}
|
||||
case *MemoryRegister:
|
||||
code = x64.StoreRegister(code, operands.Address.Base, operands.Address.Offset, operands.Address.Length, operands.Register)
|
||||
if operands.Address.OffsetRegister == math.MaxUint8 {
|
||||
code = x64.StoreRegister(code, operands.Address.Base, operands.Address.Offset, operands.Address.Length, operands.Register)
|
||||
} else {
|
||||
code = x64.StoreDynamicOffsetRegister(code, operands.Address.Base, operands.Address.OffsetRegister, operands.Address.Length, operands.Register)
|
||||
}
|
||||
}
|
||||
|
||||
case SYSCALL:
|
||||
|
Reference in New Issue
Block a user