Integer macros tests and defs

This commit is contained in:
2019-09-11 19:23:56 +03:00
parent e8bfb9a58c
commit 5ea91df4c1
10 changed files with 266 additions and 6 deletions

View File

@ -13,8 +13,9 @@ module Risc
class OperatorInstruction < Instruction
def initialize( source , operator , left , right )
super(source)
operator = operator.value if operator.is_a?(Vool::Constant)
@operator = operator
raise "unsuported operator :#{operator}:" unless Risc.operators.include?(operator)
raise "unsuported operator :#{operator}:#{operator.class}:" unless Risc.operators.include?(operator)
@left = left
@right = right
raise "Not register #{left}" unless RegisterValue.look_like_reg(left)