Stocks were little changed on Friday, but commodity-related shares rose on energy and gold prices, while Hewlett-Packard dragged on the Dow industrials.

Hewlett-Packard's shares tumbled 20.1 percent to a six-year low, a day after the company said it may spin off its PC business, the biggest in the world, and lowered its outlook.

Major indices swung between positive and negative from the open, reflecting the volatility that has rocked markets in the past weeks.

The S&P 500 bounced off a session low of 1,130, a key resistance level during last summer that is becoming strong support. Analysts see the next support at 1,100.

If there are a lot of shorts out there, they might want to cover, said Joe Saluzzi, co-manager of trading at Themis Trading in Chatham, New Jersey.

After Thursday's 4.5 percent decline on the S&P 500 -- the sixth time in the past two weeks that the S&P 500 has moved by 4 percent or more -- investors have eased back a bit, he said.

Commodity prices rose as the U.S. dollar weakened, with U.S. crude futures rising 0.5 percent to $82.88 a barrel. Exxon Mobil Corp was up 0.6 percent at $71.30 and ConocoPhillips gained 0.7 percent to $64.26.

The S&P materials index was up 0.7 percent.

The Dow Jones industrial average was down 8.47 points, or 0.08 percent, at 10,982.11. The Standard & Poor's 500 Index was up 1.86 points, or 0.16 percent, at 1,142.51. The Nasdaq Composite Index was up 12.13 points, or 0.51 percent, at 2,392.56.

Intuit helped the Nasdaq, with its 10.1 percent rise to $44.34, a day after it said it expected net income per share to rise by as much as 24 percent for fiscal year 2012.

Hewlett-Packard's 20 percent drop left shares at $23.55.

(Reporting by Caroline Valetkevitch, additional reporting by Ashley Lau and Rodrigo Campos)