The Dow and S&P cut early gains on Friday on strength in the U.S. dollar, while the Nasdaq turned negative after disappointing quarterly results from a semiconductor company pressured tech stocks.

National Semiconductor fell 4.5 percent to $14.60 a day after it posted results that prompted concerns about its ability to regain market share. The Philadelphia semiconductor index <.SOXX> fell 1.2 percent.

The markets initially opened higher after data showing stronger-than-expected retail sales in November raised hopes of a solid recovery.

Sales last month posted their biggest advance since August, while a separate report showed that consumer sentiment had improved in early December. The data eased some concerns about consumer spending, which makes up about two-thirds of the economy.

The S&P Retail index <.RLX> rose 0.7 percent, while the S&P Consumer Discretionary sector <.GSPD> rose 0.6 percent.

The data certainly suggests an improving picture, but investors will continue to be cautious on consumer spending until we see if good sales continue through the holidays, said Matt Kaufler, equity analyst at Clover Capital Management in Rochester, New York.

The Dow Jones industrial average <.DJI> added 42.55 points, or 0.41 percent, to 10,448.30. The Standard & Poor's 500 Index <.SPX> edged up 2.07 point, or 0.19 percent, at 1,104.42. The Nasdaq Composite Index <.IXIC> slipped 6.27 points, or 0.29 percent, to 2,184.58.

Indexes fell from highs as the data also lifted the U.S. dollar, which rose 0.7 percent against a basket of currencies and caused a headwind for equities. Stocks and the greenback have had an inverse relationship for about nine months.

That inverse correlation partly reflects the so-called carry trade, whereby investors borrow a currency cheaply in order to invest in higher-yielding assets. The unwinding of dollar carry-trades puts pressure on equities as investors sold high-yielding assets to cover short positions in the dollar.

United Technologies Corp rose 1.9 percent to $69.21 and provided the Dow's biggest lift after the company said it expects profits to rise about 10 percent in 2010 on cost cuts.

Mining stocks also advanced after JPMorgan lifted its price target on five companies in the sector, including Alcoa Inc and Freeport McMoRan .

Alcoa shares surged 7 percent to $14.43 and were the top percentage gainer among Dow components.

On the Nasdaq, Apple Inc fell 1.2 percent to $194.17 after the tech bellwether said it had filed a countersuit against Nokia Corp , claiming the cellphone maker was infringing upon Apple patents.

(Editing by Kenneth Barry)