def div(a, b)
      @cycle += 3
      if b == 0
        @O.write(0)
        return 0
      else
        @O.write( ( (a << 16) / b) & 0xffff )
        return (a / b)
      end
    end
def div(a, b)
      @cycle += 3
      if b == 0
        @O.write(0)
        return 0
      else
        @O.write( ( (a << 16) / b) & 0xffff )
        return (a / b)
      end
    end
sets a to a/b, sets O to ((a<<16)/b)&0xffff. if b==0, sets a and O to 0 instead.