diff --git a/src/asm/Finalize.go b/src/asm/Finalize.go index d60556d..0e3b3e2 100644 --- a/src/asm/Finalize.go +++ b/src/asm/Finalize.go @@ -291,13 +291,13 @@ func (a Assembler) Finalize(dlls dll.List) ([]byte, []byte) { 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) + code = x64.StoreDynamicNumber(code, operands.Address.Base, operands.Address.OffsetRegister, operands.Address.Length, operands.Number) } case *MemoryRegister: 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) + code = x64.StoreDynamicRegister(code, operands.Address.Base, operands.Address.OffsetRegister, operands.Address.Length, operands.Register) } } diff --git a/src/x64/StoreDynamicOffset.go b/src/x64/StoreDynamic.go similarity index 78% rename from src/x64/StoreDynamicOffset.go rename to src/x64/StoreDynamic.go index c070aca..0fdeb9c 100644 --- a/src/x64/StoreDynamicOffset.go +++ b/src/x64/StoreDynamic.go @@ -6,8 +6,8 @@ import ( "git.akyoto.dev/cli/q/src/cpu" ) -// StoreDynamicOffsetNumber stores a number into the memory address at `destination` with a register offset. -func StoreDynamicOffsetNumber(code []byte, destination cpu.Register, offset cpu.Register, length byte, number int) []byte { +// StoreDynamicNumber stores a number into the memory address at `destination` with a register offset. +func StoreDynamicNumber(code []byte, destination cpu.Register, offset cpu.Register, length byte, number int) []byte { var ( w = byte(0) r = byte(0) @@ -69,8 +69,8 @@ func StoreDynamicOffsetNumber(code []byte, destination cpu.Register, offset cpu. return append(code, byte(number)) } -// StoreDynamicOffsetRegister stores the contents of the `source` register into the memory address at `destination` with a register offset. -func StoreDynamicOffsetRegister(code []byte, destination cpu.Register, offset cpu.Register, length byte, source cpu.Register) []byte { +// StoreDynamicRegister stores the contents of the `source` register into the memory address at `destination` with a register offset. +func StoreDynamicRegister(code []byte, destination cpu.Register, offset cpu.Register, length byte, source cpu.Register) []byte { var ( w = byte(0) r = byte(0) diff --git a/src/x64/StoreDynamicOffset_test.go b/src/x64/StoreDynamic_test.go similarity index 96% rename from src/x64/StoreDynamicOffset_test.go rename to src/x64/StoreDynamic_test.go index dfb72b3..0ff1f82 100644 --- a/src/x64/StoreDynamicOffset_test.go +++ b/src/x64/StoreDynamic_test.go @@ -8,7 +8,7 @@ import ( "git.akyoto.dev/go/assert" ) -func TestStoreDynamicOffsetNumber(t *testing.T) { +func TestStoreDynamicNumber(t *testing.T) { usagePatterns := []struct { RegisterTo cpu.Register Offset cpu.Register @@ -84,12 +84,12 @@ func TestStoreDynamicOffsetNumber(t *testing.T) { for _, pattern := range usagePatterns { t.Logf("store %dB [%s+%s], %d", pattern.Length, pattern.RegisterTo, pattern.Offset, pattern.Number) - code := x64.StoreDynamicOffsetNumber(nil, pattern.RegisterTo, pattern.Offset, pattern.Length, pattern.Number) + code := x64.StoreDynamicNumber(nil, pattern.RegisterTo, pattern.Offset, pattern.Length, pattern.Number) assert.DeepEqual(t, code, pattern.Code) } } -func TestStoreDynamicOffsetRegister(t *testing.T) { +func TestStoreDynamicRegister(t *testing.T) { usagePatterns := []struct { RegisterTo cpu.Register Offset cpu.Register @@ -165,7 +165,7 @@ func TestStoreDynamicOffsetRegister(t *testing.T) { for _, pattern := range usagePatterns { t.Logf("store %dB [%s+%s], %s", pattern.Length, pattern.RegisterTo, pattern.Offset, pattern.RegisterFrom) - code := x64.StoreDynamicOffsetRegister(nil, pattern.RegisterTo, pattern.Offset, pattern.Length, pattern.RegisterFrom) + code := x64.StoreDynamicRegister(nil, pattern.RegisterTo, pattern.Offset, pattern.Length, pattern.RegisterFrom) assert.DeepEqual(t, code, pattern.Code) } }