first go at translating DynamicCall to risc

This commit is contained in:
Torsten Ruger
2018-03-21 11:51:10 +05:30
parent d9ce295b89
commit d98e55907e
2 changed files with 26 additions and 2 deletions

View File

@ -53,6 +53,20 @@ module Risc
end
# dynamic version of an Unconditional 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
end
# branch if two registers contain same value
class IsSame < Branch
attr_reader :left , :right