removes the asm from assemble signature (not used)

This commit is contained in:
Torsten Ruger 2014-04-25 11:56:53 +03:00
parent 93e4178017
commit d08e6702f0
9 changed files with 15 additions and 9 deletions

View File

@ -122,7 +122,7 @@ module Asm
def assemble(io)
@values.each do |obj|
obj.assemble io, self
obj.assemble io
end
end

View File

@ -8,7 +8,7 @@ module Asm
super(opcode,args)
end
def assemble(io, as)
def assemble(io)
s = @update_status_flag? 1 : 0
case opcode
when :b, :bl

View File

@ -40,7 +40,7 @@ module Asm
4
end
def assemble(io, as)
def assemble(io)
raise "Abstract class, should not be called/instantiated #{self.inspect}"
end
end

View File

@ -2,7 +2,6 @@ module Asm
class Label
def initialize(name , asm)
@@oh = 1
@name = name
@asm = asm
@position = nil
@ -23,7 +22,7 @@ module Asm
0
end
def assemble(io, as)
def assemble(io)
self.position = io.tell
end
def set!

View File

@ -69,7 +69,7 @@ module Asm
end
end
def assemble(io, as)
def assemble(io)
build
val = operand.is_a?(Register) ? operand.bits : operand
val |= (rd.bits << 12)

View File

@ -56,7 +56,7 @@ module Asm
end
end
def assemble(io, as)
def assemble(io)
build
#not sure about these 2 constants. They produce the correct output for str r0 , r1
# but i can't help thinking that that is because they are not used in that instruction and

View File

@ -26,7 +26,7 @@ module Asm
attr_accessor :cond, :inst_class, :pre_post_index, :up_down,
:update_status_flag, :write_base, :is_pop, :rn, :operand
def assemble(io, as)
def assemble(io)
build
cond = @cond.is_a?(Symbol) ? COND_CODES[@cond] : @cond
rn = reg "sp" # sp register

View File

@ -19,7 +19,7 @@ module Asm
def length
@string.length
end
def assemble(io, as)
def assemble(io)
io << @string
end
end

View File

@ -28,6 +28,13 @@ class NodesCase < MiniTest::Test
assert tree[:args].is_a? Vm::NumberExpression
assert_equal 42 , tree[:args].value
end
def test_arg_list
@parser = @parser.args
tree = parse "(42, foo)"
assert_equal Array , tree.class
assert_equal 42 , tree.first.value
assert_equal "foo" , tree.last.name
end
end