Stocks rose sharply on Thursday as multinational companies such as IBM and Juniper Networks Inc. reported earnings that beat forecasts, shifting investors' focus back to corporate profits and away from subprime credit worries.

The Nasdaq Composite index hit a 6 1/2-year intraday high.

International Business Machines Corp., the world's largest technology services company, also raised its 2007 earnings forecast late on Wednesday.

The multinationals are doing well because of the weak dollar. That certainly helps, said Frank Lesh, a futures analyst and broker at FuturePath Trading LLC in Chicago.

The Dow Jones industrial average was up 58.78 points, or 0.42 percent, at 13,977.00. The Standard & Poor's 500 Index was up 3.86 points, or 0.25 percent, at 1,550.03. The Nasdaq Composite Index was up 12.79 points, or 0.47 percent, at 2,712.28 after hitting 2,721 earlier.

Shares of IBM rose 3.8 percent to $115.30 on the NYSE.

Juniper boosted the Nasdaq index after the network equipment maker posted higher quarterly profit and lifted its full-year earnings outlook.

Shares of Juniper shot up 11.8 percent to $29.87 on the


Hewlett-Packard Co. shares climbed after research reports from Gartner and IDC showed worldwide personal computer sales posted robust second-quarter growth, with HP in the lead.

HP shares were up 3.5 percent to $48.80 on the NYSE.

Stocks were knocked lower on Wednesday by concern over spreading subprime mortgage losses after Bear Stearns Cos Inc. said two hedge funds with big bets on the sector were nearly worthless.

Federal Reserve Chairman Ben Bernanke told a Senate committee subprime losses could reach $100 billion. He repeated testimony he gave to a House panel on Wednesday in which he said inflation was a top concern and the slowdown in housing would likely crimp growth for some time.

The Fed will also issue minutes from its June monetary policy meeting at 2 p.m. (1800 GMT).

Shares of online auction company eBay Inc. were down 1.8 percent at $33.43 after the company left its 2007 earnings outlook unchanged late on Wednesday, disappointing investors.