diff --git a/lib/register/instruction.rb b/lib/register/instruction.rb index d2548e1b..17b9ccff 100644 --- a/lib/register/instruction.rb +++ b/lib/register/instruction.rb @@ -13,7 +13,6 @@ module Register # Branches fan out, Labels collect # Labels are the only valid branch targets class Instruction - include Positioned def initialize source , nekst = nil @source = source @@ -100,7 +99,7 @@ module Register end def set_position position , labels = [] - super(position) + Positioned.set_position(self,position) position += byte_length if self.next self.next.set_position(position , labels) diff --git a/lib/typed/parfait/object.rb b/lib/typed/parfait/object.rb index 2a56b9c5..4a75a3a1 100644 --- a/lib/typed/parfait/object.rb +++ b/lib/typed/parfait/object.rb @@ -30,8 +30,6 @@ module Parfait object end - include Positioned - # 1 -based index def get_internal_word(index) name = get_type().name_at(index) diff --git a/lib/typed/parfait/symbol_adapter.rb b/lib/typed/parfait/symbol_adapter.rb index 1e255d65..feeb43bf 100644 --- a/lib/typed/parfait/symbol_adapter.rb +++ b/lib/typed/parfait/symbol_adapter.rb @@ -1,6 +1,5 @@ class Symbol - include Positioned def has_type? true diff --git a/test/register/test_positioning.rb b/test/register/test_positioning.rb index 62a6ef6e..a77b1e22 100644 --- a/test/register/test_positioning.rb +++ b/test/register/test_positioning.rb @@ -1,9 +1,5 @@ require_relative "../helper" -class TestPosition - include Positioned -end - class TestPositioning < MiniTest::Test def setup Register.machine.boot unless Register.machine.booted @@ -38,4 +34,9 @@ class TestPositioning < MiniTest::Test test.set_position 12000 end end + + def test_pos_arm + mov = Arm::ArmMachine.mov :r1, 128 + mov.set_position(0) + end end