stop including positioned
This commit is contained in:
parent
fafcd15ce8
commit
cd474f66f6
@ -13,7 +13,6 @@ module Register
|
|||||||
# Branches fan out, Labels collect
|
# Branches fan out, Labels collect
|
||||||
# Labels are the only valid branch targets
|
# Labels are the only valid branch targets
|
||||||
class Instruction
|
class Instruction
|
||||||
include Positioned
|
|
||||||
|
|
||||||
def initialize source , nekst = nil
|
def initialize source , nekst = nil
|
||||||
@source = source
|
@source = source
|
||||||
@ -100,7 +99,7 @@ module Register
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set_position position , labels = []
|
def set_position position , labels = []
|
||||||
super(position)
|
Positioned.set_position(self,position)
|
||||||
position += byte_length
|
position += byte_length
|
||||||
if self.next
|
if self.next
|
||||||
self.next.set_position(position , labels)
|
self.next.set_position(position , labels)
|
||||||
|
@ -30,8 +30,6 @@ module Parfait
|
|||||||
object
|
object
|
||||||
end
|
end
|
||||||
|
|
||||||
include Positioned
|
|
||||||
|
|
||||||
# 1 -based index
|
# 1 -based index
|
||||||
def get_internal_word(index)
|
def get_internal_word(index)
|
||||||
name = get_type().name_at(index)
|
name = get_type().name_at(index)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
class Symbol
|
class Symbol
|
||||||
include Positioned
|
|
||||||
|
|
||||||
def has_type?
|
def has_type?
|
||||||
true
|
true
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
require_relative "../helper"
|
require_relative "../helper"
|
||||||
|
|
||||||
class TestPosition
|
|
||||||
include Positioned
|
|
||||||
end
|
|
||||||
|
|
||||||
class TestPositioning < MiniTest::Test
|
class TestPositioning < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Register.machine.boot unless Register.machine.booted
|
Register.machine.boot unless Register.machine.booted
|
||||||
@ -38,4 +34,9 @@ class TestPositioning < MiniTest::Test
|
|||||||
test.set_position 12000
|
test.set_position 12000
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_pos_arm
|
||||||
|
mov = Arm::ArmMachine.mov :r1, 128
|
||||||
|
mov.set_position(0)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user