rename left to first in instruction and started on logic instruction cleanup
This commit is contained in:
@ -81,11 +81,11 @@ module Vm
|
||||
# defaults gets merged into the instructions options hash, ie passed on to the (machine specific)
|
||||
# Instruction constructor and as such can be used to influence that classes behaviour
|
||||
def define_instruction(inst , clazz , defaults = {} )
|
||||
create_method(inst) do |left , options|
|
||||
create_method(inst) do |first , options|
|
||||
options = {} if options == nil
|
||||
options.merge defaults
|
||||
options[:opcode] = inst
|
||||
clazz.new(left , options)
|
||||
clazz.new(first , options)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -25,8 +25,8 @@ module Vm
|
||||
# Make hash attributes to object attributes
|
||||
include Support::HashAttributes
|
||||
|
||||
def initialize left , options
|
||||
@left = left
|
||||
def initialize first , options
|
||||
@first = first
|
||||
@attributes = options
|
||||
end
|
||||
end
|
||||
@ -44,7 +44,7 @@ module Vm
|
||||
class MoveInstruction < Instruction
|
||||
end
|
||||
class CallInstruction < Instruction
|
||||
def initialize left , options
|
||||
def initialize first , options
|
||||
super
|
||||
opcode = @attributes[:opcode].to_s
|
||||
if opcode.length == 3 and opcode[0] == "b"
|
||||
|
@ -63,11 +63,11 @@ module Vm
|
||||
CMachine.instance.integer_less_or_equal block , self , right
|
||||
end
|
||||
|
||||
def plus block , left , right
|
||||
CMachine.instance.integer_plus block , self , left , right
|
||||
def plus block , first , right
|
||||
CMachine.instance.integer_plus block , self , first , right
|
||||
end
|
||||
def minus block , left , right
|
||||
CMachine.instance.integer_minus block , self , left , right
|
||||
def minus block , first , right
|
||||
CMachine.instance.integer_minus block , self , first , right
|
||||
end
|
||||
|
||||
def load block , right
|
||||
|
Reference in New Issue
Block a user