removes the asm from assemble signature (not used)
This commit is contained in:
parent
93e4178017
commit
d08e6702f0
@ -122,7 +122,7 @@ module Asm
|
||||
|
||||
def assemble(io)
|
||||
@values.each do |obj|
|
||||
obj.assemble io, self
|
||||
obj.assemble io
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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!
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -19,7 +19,7 @@ module Asm
|
||||
def length
|
||||
@string.length
|
||||
end
|
||||
def assemble(io, as)
|
||||
def assemble(io)
|
||||
io << @string
|
||||
end
|
||||
end
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user