Stocks ended mixed Tuesday as investors weighed another batch of solid earnings reports against a drop in consumer confidence and rising crude oil prices.

The Dow Jones industrial average (search) slipped 16.71 points, or 0.16 percent, to end at 10,579.77. The Standard & Poor's 500 index (search) inched up 2.13 points, or 0.17 percent, to finish at 1,231.16. The technology-laced Nasdaq Composite Index (search) rose 9.25 points, or 0.43 percent, to 2,175.99.

Shares of Texas Instruments Inc. (TXN) helped drive up the S&P 500 after the world's largest mobile-phone chip maker reported better-than-expected earnings late Monday. Defense contractor Lockheed Martin Corp. (LMT) and network equipment maker Tellabs Inc. (TLAB) also released results that topped expectations.

"There are a lot of older line companies in the Dow that would appear to be growing more slowly than the overall economy," said Brian Barish, president of Denver-based Cambiar Investors. "As a consequence, the Dow has been a bit of an underperformer."

Texas Instruments shares advanced 4.5 percent to $31.97 and Lockheed Martin rose 2.4 percent to $64.01.

The major indexes wavered throughout the day as investors tracked fluctuations in crude oil futures, which settled at $59.12 a barrel, up 20 cents, on the New York Mercantile Exchange (search). Rising oil prices, which could lead to lower consumer spending and declining corporate earnings, have shadowed stocks for months and distracted investors Tuesday from the current crop of upbeat earnings reports.

After the closing bell, Amazon.com Inc. (AMZN) posted a lower quarterly profit, but reported revenue that exceeded analysts' expectations. Amazon's stock climbed to $41.06 on the Inet electronic brokerage from a Nasdaq close of $37.74.

The Conference Board (search) said its index of U.S. consumer confidence declined in July to 103.2, compared with expectations of a rise to 106 from June. The confidence number is closely watched because consumer spending represents the lion's share of U.S. economic activity.

"It surprised me that confidence is lower," said Scott Wren, senior equity strategist at A.G. Edwards & Sons Inc., of St. Louis. "But historically, what consumers say and what they do are two different things."

DuPont (DD) shares shed 6.6 percent to $41.15 on the New York Stock Exchange (search) after the company cut its outlook for the rest of the year. It was the biggest drag on the Dow, and also limited the S&P 500's gains.

"DuPont's clearly the black eye on the day. It put the kibosh on the Dow," said Jon Brorson, managing director of growth equities at Neuberger Berman in Chicago.

The stock market isn't reacting to solid earnings because "there's much more discounting of risk than there has been in the past; the risk of higher oil prices, the risk of higher interest rates," said Hans F. Olsen, managing director and chief investment officer at Bingham Legg Advisers, a private wealth management firm in Boston. "This has been buffeting the stock market for the better part of a the year."

Michael Strauss, chief economist at Commonfund, which manages about $34 billion for nonprofit institutions, said, "It doesn't look like earnings have the huge upside surprise to catapult the market higher. At the same time, the earnings are there, so it's hard to get any type of sustainable weakness either; hence, the continuation of a very narrow trading range with a slight upside bias."

Verizon Communications Inc. (VZ), the nation's largest phone company, rose 32 cents to $34.34 after second-quarter profit rose 19 percent. Earnings were boosted by the sale of the huge telephone company's operations in Hawaii and another powerful showing for Verizon Wireless.

Shares of Avaya Inc. (AV), a supplier of equipment that sends phone calls over the Internet, were also sharply higher, a day after the company posted higher earnings. Avaya shares rallied 16.4 percent, or $1.51, to $10.74 on the NYSE.

Shares of online DVD rental service Netflix Inc. (NFLX) jumped 12.1 percent, or $2.05, to $19.01 on Nasdaq a day after it reported a surprise profit in the second quarter, beating analysts' expectations by a wide margin.

ImClone Systems Inc. (IMCL) fell 2.4 percent, or 85 cents, to $34.23 on Nasdaq as it reported quarterly revenue that fell short of Wall Street's expectations.

Black & Decker Corp. (BDK), the power tools and home improvement products maker, beat expectations with a second-quarter profit that rose 27 percent. But its chief financial officer said on a conference call with investors the company was seeing "more cautious order patterns by retailers" and the stock fell $1.53 to $90.27.

General Motors Corp. (GM) climbed $1.09 to $36.96 after the company's GMAC financial services unit said it will sell up to $55 billion worth of car loan contracts to Bank of America Corp. over the next five years.

Advancing issues led decliners by more than 7 to 6 on the New York Stock Exchangewhere volume came to 168.13 million shares, up from 136.49 million at the same point Monday.

Trading was fairly active on the NYSE, with about 1.47 billion shares changing hands, slightly above last year's daily average of 1.46 billion, while on Nasdaq, the pace was moderate, with about 1.70 billion shares traded, less than last year's daily average of 1.81 billion.

Advancing stocks outnumbered declining ones by a ratio of about 3 to 2 on both the NYSE and the Nasdaq.

The Russell 2000 index of smaller companies rose 3.59, or 0.54 percent, to 674.58.

Overseas, Japan's Nikkei stock average fell 0.21 percent. In Europe, Britain's FTSE 100 was down 0.28 percent, France's CAC-40 slipped 0.03 percent for the session, and Germany's DAX index rose 0.02 percent in late trading.

Reuters and the Associated Press contributed to this report.