Stocks jumped 1 percent on Tuesday on strong earnings from IBM and Coca-Cola, offsetting investor disappointment in results from big financial firms.

The turnaround from Monday's losses over debt worries also came from unexpectedly strong U.S. housing data.

Dow component International Business Machines Corp added 4.3 percent to $182.84 a day after it said new business at its services division was up more than expected, raising hopes for the technology sector.

The S&P information technology sector <.GSPT> gained 1.9 percent, the top gainer among S&P sectors. Shares of Apple hit a 52-week high ahead of its report due after the closing bell.

I don't think it's going to be a surprise that Apple earnings are going to be very good, said Michael James, senior trader at regional investment bank Wedbush Morgan in Los Angeles. The stock might have a significant move tomorrow. How big it's going to be will depend on the guidance commentary that they give.

The Dow Jones industrial average <.DJI> was up 123.40 points, or 1.00 percent, at 12,508.56. The Standard & Poor's 500 Index <.SPX> was up 11.65 points, or 0.89 percent, at 1,317.09. The Nasdaq Composite Index <.IXIC> was up 42.21 points, or 1.53 percent, at 2,807.32.

The market has been preoccupied with corporate earnings, putting on the back burner wrangling in Washington over a deal to raise the debt ceiling. There is a growing sense that a last-ditch plan taking shape in Congress may be the only way to avoid a U.S. default.

However, all 10 S&P 500 sectors rose on Tuesday, even financials despite by declines in Goldman Sachs Group Inc and Bank of America following their results. After advancing in the morning, Bank of America fell 3 percent to $9.43. Goldman lost 2 percent, to $126.68.

Goldman is a bellwether of the rest of the banks, and it should set the tone for the rest of them, but I wouldn't be too pessimistic, said Robert Francello, head of equity trading for Apex in San Francisco.

Those losses were offset by a 4 percent rise in shares of Wells Fargo to $27.95 after it said profit rose 30 percent.

Housing starts topped forecasts in June to touch a six-month high, and permits for future construction unexpectedly increased, the government reported. Homebuilder D.R. Horton Inc climbed 4.16 percent to $11.76 and the PHLX Housing Index <.HGX> rose 2 percent.

Goldman's second-quarter net income fell short of lowered expectations as fixed income trading revenue dropped sharply. Bank of America recorded a second-quarter net loss of $8.8 billion after a big settlement with mortgage bond investors.

Coca-Cola Co posted slightly higher-than-expected profit on strength in emerging markets. Johnson & Johnson's earnings topped estimates on a turnaround in its prescription medicines and stabilizing sales of over-the-counter medicines.

Coke rose 3 percent to $69.36, while J&J was 1 percent lower at $66.37. Both stocks are Dow components.

(Additional reporting by Caroline Valetkevitch and Ryan Vlastelica; Editing by Kenneth Barry)