By Benjamin Pimentel

The technology sector battled back into the black on Thursday, led by semiconductor shares, as the broader market also regained its positive momentum after news of higher profit from J.P. Morgan.

The Nasdaq Composite Index (RIXF) up 0.8% to 1,877, on track to close the week in the black. The tech-heavy index was up more than 6% for the week.

The Morgan Stanley High Tech 35 Index (MSH) gained 0.5%, while the Philadelphia Semiconductor Index (SOX) rose 1.6%.

The Dow Jones Industrial Average (DJI) gained more than 50 points on news that J.P. Morgan (JPM) posted a higher profit in the second quarter.

Xilinx Inc. (XLNX) weighed down the tech sector, as its shares fell more than 2% after the chip maker posted a steep drop in quarterly profit.

Meanwhile, SanDisk Corp. (SNDK) led the sector's gainers, rising more than 8%. Other advancers included Yahoo Inc. (YHOO), Hewlett-Packard (HPQ), eBay Inc. (EBAY) and Apple Inc. (AAPL).

Intel Corp. (INTC) rose 1.7%. On Tuesday, the chip giant reported upbeat second-quarter results that triggered a broad rally.

Shares of Polycom Inc. (PLCM) also soared more than 8% after the maker of audio and data conferencing products reported a 39% rise in profit.

Other tech giants were in the red, including Palm Inc. (PALM) and Sun Microsystems (JAVA).

Google Inc. (GOOG) was down a fraction. The Internet giant is expected to post slower growth when it reports quarterly results after the closing bell.

IBM Corp. (IBM) was up more than 2% as Big Blue gears up for its own second-quarter results after the closing bell. The company is expected to report mostly flat earnings on lower revenue.