small assembler fix

This commit is contained in:
Torsten Ruger 2018-03-25 20:02:51 +03:00
parent 279fdcc1e2
commit 865a116f47
2 changed files with 2 additions and 3 deletions

View File

@ -38,7 +38,7 @@ module Risc
objekt.create_binary if objekt.is_a? Parfait::TypedMethod
binary = objekt.binary
Positioned.set_position(binary,at)
objekt.risc_instructions.set_position( at + 12) # BinaryCode header
objekt.cpu_instructions.set_position( at + 12) # BinaryCode header
len = 4 * 14
at += binary.padded_length
nekst = binary.next

View File

@ -14,10 +14,9 @@ module Risc
@assembler = Assembler.new(@machine , Collector.collect_space)
assert @machine.translate_arm
end
def test_write_fails
@assembler = Assembler.new(@machine , {})
assert_raises{ @assembler.assemble} #must translate first
assert_raises{ @assembler.write_as_string} #must translate first
end
def test_assemble_no_objects
@assembler = Assembler.new(@machine , {})