adding register_names to instruction protocol
This commit is contained in:
@ -17,6 +17,11 @@ module Risc
|
||||
end
|
||||
attr_accessor :register , :constant
|
||||
|
||||
# return an array of names of registers that is used by the instruction
|
||||
def register_names
|
||||
[register.symbol]
|
||||
end
|
||||
|
||||
def to_s
|
||||
class_source "#{register} <- #{constant}"
|
||||
end
|
||||
|
Reference in New Issue
Block a user