tests for mom check instructions

This commit is contained in:
2019-09-15 19:57:15 +03:00
parent 5ab021de5a
commit b46512a1b8
7 changed files with 145 additions and 27 deletions

View File

@ -31,32 +31,6 @@ module Risc
end
end
# dynamic version of an Branch that jumps to the contents
# of a register instead of a hardcoded address
# As Branches jump to Labels, this is not derived from Branch
# PS: to conditionally jump to a dynamic adddress we do a normal branch
# over the dynamic one and then a dynamic one. Save us having all types of branches
# in two versions
class DynamicJump < Instruction
def initialize( source , register )
super(source)
@register = register
end
attr_reader :register
def to_s
class_source( register.to_s)
end
end
# A Dynamic yield is very much like a DynamicJump, especially in it's idea
#
# The implentation differes slightly, as we use a chache entry in the DynamicJump
# but a block in the DynamicYield.
# Using means that we assume the register to be ready loaded with a Block
class DynamicYield < DynamicJump
end
class IsZero < Branch
end

View File

@ -0,0 +1,27 @@
module Risc
# dynamic version of an Branch that jumps to the contents
# of a register instead of a hardcoded address
# As Branches jump to Labels, this is not derived from Branch
# PS: to conditionally jump to a dynamic adddress we do a normal branch
# over the dynamic one and then a dynamic one. Save us having all types of branches
# in two versions
class DynamicJump < Instruction
def initialize( source , register )
super(source)
@register = register
end
attr_reader :register
def to_s
class_source( register.to_s)
end
end
# A Dynamic yield is very much like a DynamicJump, especially in it's idea
#
# The implentation differes slightly, as we use a chache entry in the DynamicJump
# but a block in the DynamicYield.
# Using means that we assume the register to be ready loaded with a Block
class DynamicYield < DynamicJump
end
end