From 280ea8a8c4ae31f886f3c74e4048d0476d80f9f2 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Mon, 16 Jul 2018 19:19:49 +0300 Subject: [PATCH] remove resolve_to_register which was, quite simply, from another era when more than message was pinned --- lib/risc/builder.rb | 16 ---------------- lib/risc/instructions/byte_to_reg.rb | 2 -- 2 files changed, 18 deletions(-) diff --git a/lib/risc/builder.rb b/lib/risc/builder.rb index 6b8c60cf..038924bc 100644 --- a/lib/risc/builder.rb +++ b/lib/risc/builder.rb @@ -170,22 +170,6 @@ module Risc end - # if a symbol is given, it may be the message or the new_message. - # These are mapped to register references. - # The valid symbols (:message,:new_message) are the same that are returned - # by the slots. All data (at any time) is in one of the instance variables of these two - # objects. Risc defines module methods with the same names (and _reg) - def self.resolve_to_register( reference ) - return reference if reference.is_a?(RegisterValue) - case reference - when :message - return message_reg - when :new_message - return new_message_reg - else - raise "not recognized register reference #{reference} #{reference.class}" - end - end class CodeBuilder < Builder diff --git a/lib/risc/instructions/byte_to_reg.rb b/lib/risc/instructions/byte_to_reg.rb index 200a30fc..82cd47b9 100644 --- a/lib/risc/instructions/byte_to_reg.rb +++ b/lib/risc/instructions/byte_to_reg.rb @@ -13,8 +13,6 @@ module Risc # from and to are translated (from symbol to register if neccessary) # but index is left as is. def self.byte_to_reg( source , array , index , to) - array = resolve_to_register( array) - to = resolve_to_register( to) ByteToReg.new( source , array , index , to) end end