class Rips::Instructions::Sub
Attributes
length[R]
variables[R]
Public Class Methods
new()
click to toggle source
@variables: types of instruction's variables @length: length in bits for each variable
Calls superclass method
Rips::Instructions::Instruction::new
# File lib/rips/instructions/sub.rb, line 12 def initialize super("sub",Formats::DFormat.new(0b0011)) @variables = [Variables::Register.new, Variables::Register.new, Variables::Register.new] @length = {r3:4, r2:4, r1:4, op:4} end
Public Instance Methods
set_arguments(args)
click to toggle source
Swap subtractor
Calls superclass method
Rips::Instructions::Instruction#set_arguments
# File lib/rips/instructions/sub.rb, line 19 def set_arguments (args) args[1], args[2] = args[2], args[1] super end