From 48b33e5f9de017c542baeda56421bbef677afa40 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sat, 30 Aug 2014 16:57:34 +0300 Subject: [PATCH] add position to instruction (for relative calculations) --- lib/register/assembler.rb | 1 + lib/register/instruction.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/register/assembler.rb b/lib/register/assembler.rb index 84b0524d..dec3cdc5 100644 --- a/lib/register/assembler.rb +++ b/lib/register/assembler.rb @@ -29,6 +29,7 @@ module Register @objects.each do |id , slot| next unless slot.object.is_a? Virtual::CompiledMethod slot.position = at + slot.object.set_position at at += slot.length end @objects.each do |id , slot| diff --git a/lib/register/instruction.rb b/lib/register/instruction.rb index 9b6326ed..0bdb7179 100644 --- a/lib/register/instruction.rb +++ b/lib/register/instruction.rb @@ -17,6 +17,7 @@ module Register @attributes = options end attr_reader :attributes + attr_accessor :position def opcode @attributes[:opcode] end