assemble risc to it's position (not itself)

So in the next step the interpreter can use positions as program counter
and would be much more like the real thing
This commit is contained in:
Torsten Ruger
2018-05-17 09:49:01 +03:00
parent 49c4d170ce
commit 37d62d298e
6 changed files with 15 additions and 34 deletions

View File

@ -19,10 +19,11 @@ module Risc
4
end
def assemble(io)
io.write_unsigned_int_32(self)
pos = Position.get(self).at
io.write_unsigned_int_32(pos)
end
class Branch < Instruction
def first
def first #some logging assumes arm
self
end
end

View File

@ -62,7 +62,7 @@ module Risc
case object
when Parfait::BinaryCode
CodePosition.new(object,at , extra)
when Arm::Instruction , Risc::Label
when Arm::Instruction , Risc::Instruction
InstructionPosition.new(object,at , extra)
else
ObjectPosition.new(at,object)