Stocks managed slight gains by midday on Thursday as Broadcom's upbeat guidance and a turnaround in Apple shares helped lift technology stocks, while investors monitored news from Washington for signs of progress on the "fiscal cliff" negotiations.

Apple erased initial losses of as much as 3.7 percent at the open, which briefly brought the market capitalization of the world's largest publicly traded company below $500 billion. By midday, Apple's stock was up 2.3 percent at $551.35 - a day after its worst drop in four years.

Tech stocks also got a lift from chipmaker Broadcom , up 2.2 percent at $33.06 a day after it forecast fourth-quarter revenue at the high end of its target range, citing slightly better-than-expected sales in its mobile business.

The S&P technology index gained 1 percent and ranked as the best performer among the S&P 500's 10 major sectors. The PHLX semiconductor index rose 0.9 percent.

But budget discussions commanded center stage for investors. President Barack Obama said there could be a quick deal to avert the "fiscal cliff" - huge tax hikes and spending cuts set to begin in January, possibly driving the U.S. economy back into recession next year - if Republican leaders agree to raise tax rates for those making more than $250,000 a year.

While Republican leaders in the U.S. House of Representatives insist that raising tax rates on the rich is not negotiable, some GOP lawmakers now see it as inevitable to avoid the fiscal cliff.

"It's really being held hostage to (the fiscal cliff negotiations) and the stock action of Apple," said Bruce Zaro, chief technical strategist at Delta Global Asset Management in Boston.

"We're back in the mode of there's a direct correlation between the market and Apple - traders seems to be focused on the movement of Apple, and what its impact is on the indices."

Without action from Congress in the next few weeks, tax cuts on capital gains and dividends will expire at the end of 2012.

The Dow Jones industrial average gained 8.64 points, or 0.07 percent, to 13,043.13. The Standard & Poor's 500 Index added 2.66 points, or 0.19 percent, to 1,411.94. The Nasdaq Composite Index climbed 19.82 points, or 0.67 percent, to 2,993.52.

Apple Inc's rank in China's smartphone market fell to No.6 in the third quarter as it faces tougher competition from Chinese brands, research firm IDC said on Thursday. Apple's 6.4 percent drop on Wednesday was its worst daily performance since December 2008 and dragged the Nasdaq Composite Index down 0.8 percent for the day.

Sirius XM Radio shares rose 1.8 percent to $2.83 after its board approved a $2 billion stock repurchase and declared a special dividend, giving a big payout to its largest shareholder, Liberty Media .

Garmin shares rose 4.7 percent to $41.56 after Standard & Poor's said it would add the navigation device maker to the S&P 500 index. Garmin will replace R.R. Donnelley & Sons after the close of trading on December 11.

(Reporting by Chuck Mikolajczak; Editing by Jan Paschal)