U.S. stocks rose on Wednesday as the U.S. dollar's weakness lifted shares of natural resources companies, while Morgan Stanley and Yahoo Inc added to optimism about corporate profits.

Commodity shares were a standout, underpinned by higher metal and crude oil prices.

U.S. front-month crude briefly hit $82 a barrel on the New York Mercantile Exchange, while spot gold rose above $1,060 an ounce as the euro soared above $1.50 for the first time since August 2008.

Dollar weakness has resulted in money going into equities and shorting the dollar, said Michael James, senior trader at regional investment bank Wedbush Morgan in Los Angeles. Money is going into commodity and energy names that benefit from a weaker dollar. When that trend continues, people continue to press the dollar short.

The Dow Jones industrial average <.DJI> rose 34.99 points, or 0.35 percent, to 10,076.47. The Standard & Poor's 500 Index <.SPX> gained 6.39 points, or 0.59 percent, to 1,097.45. The Nasdaq Composite Index <.IXIC> climbed 14.40 points, or 0.67 percent, to 2,177.87.

The S&P 500 is now up 62 percent from the 12-year low it hit in early March.

Shares of Exxon Mobil Corp rose 1.7 percent to $74.24, while Chevron Corp gained 1.6 percent to $78.25, and the S&P energy index <.GSPE> advanced 1.7 percent.

Freeport-McMoRan Copper & Gold Inc shares shot up nearly 5 percent to $82.47 after the mining company's quarterly profit topped analysts' expectations. The S&P materials index <.GSPM> added 0.4 percent.

Shares of Morgan Stanley shot up 7.1 percent to $34.84 after the bank posted a quarterly profit above Wall Street's forecasts before the bell.

The stock of Internet media company Yahoo Inc gained 3.7 percent to $17.81, following the company's release of reported stronger-than-expected third-quarter results after Tuesday's closing bell. S&P Equity research raised the stock to a buy.

Apple Inc was another highlight, hitting an all-time intraday high, two days after the iPhone and MacBook computer maker posted earnings that eclipsed Wall Street's forecasts. Apple was up 4.2 percent at $207.18 on Nasdaq, where it rose as high as $208.71 earlier.

(Editing by Jan Paschal)