def assemble(io)
      arg = @left
      arg = arg.symbol if( arg.is_a? ::Risc::RegisterValue )
      is_reg = arg.is_a?(::Risc::RegisterValue)
      is_reg = (arg.to_s[0] == "r") if( arg.is_a?(Symbol) and not is_reg)

      raise "invalid operand argument #{arg.inspect} #{inspect}" unless (is_reg )
      operand = get_operand

      #not sure about these 2 constants. They produce the correct output for str r0 , r1
      # but i can't help thinking that that is because they are not used in that instruction and
      # so it doesn't matter. Will see
      if (operand.is_a?(Symbol) or operand.is_a?(::Risc::RegisterValue))
        val = reg_code(operand)
        i = 1  # not quite sure about this, but it gives the output of as. read read read.
      else
        i = 0 #I flag (third bit)
        val = operand
      end
      # testing against gnu as, setting the flag produces correct output
      # but gnu as produces same output for auto_inc or not, so that seems broken
      # luckily auto_inc is not used and even if it clobbers unused reg in soml, but still

      val = shift(val , 0 )
      val |= shift(reg_code(arg) ,  16)
      val |= shift(i ,              25)
      write_val(val, io)
    end
def assemble(io)
      arg = @left
      arg = arg.symbol if( arg.is_a? ::Risc::RegisterValue )
      is_reg = arg.is_a?(::Risc::RegisterValue)
      is_reg = (arg.to_s[0] == "r") if( arg.is_a?(Symbol) and not is_reg)

      raise "invalid operand argument #{arg.inspect} #{inspect}" unless (is_reg )
      operand = get_operand

      #not sure about these 2 constants. They produce the correct output for str r0 , r1
      # but i can't help thinking that that is because they are not used in that instruction and
      # so it doesn't matter. Will see
      if (operand.is_a?(Symbol) or operand.is_a?(::Risc::RegisterValue))
        val = reg_code(operand)
        i = 1  # not quite sure about this, but it gives the output of as. read read read.
      else
        i = 0 #I flag (third bit)
        val = operand
      end
      # testing against gnu as, setting the flag produces correct output
      # but gnu as produces same output for auto_inc or not, so that seems broken
      # luckily auto_inc is not used and even if it clobbers unused reg in soml, but still

      val = shift(val , 0 )
      val |= shift(reg_code(arg) ,  16)
      val |= shift(i ,              25)
      write_val(val, io)
    end
str / ldr are _serious instructions. With BIG possibilities not half are implemented
 don't overwrite instance variables, to make assembly repeatable
TODO better test, this operand integer (register) does not work.