By Benjamin Pimentel, MarketWatch

SAN FRANCISCO (MarketWatch) -- Shares of Hewlett-Packard rallied Tuesday on a J.P. Morgan Chase & Co. upgrade, while Facebook Inc. gained on news that it is conducting a test on video ads, but the tech sector was weighed down by losses in shares of Twitter Inc. and Apple Inc.

H-P (HPQ) was up 3% after J.P. Morgan analyst Mark Moskowitz raised his rating to buy, telling clients in a note that while "challenges remain" for the Palo Alto, Calif.-based tech giant, they "are easing."

For example, Moskowitz said the personal computer market appears to be stabilizing, and he also pointed to signs of improvement in the printer market.

Facebook (FB) also was up 2% after the social network announced that it was conducting a test of video ads this week, confirming speculation that it was considering rolling out the ad format seen by analysts as a potentially rich revenue source.

Other gains came from Intel Corp. (INTC) which was up 1%, while Cisco Systems (CSCO) climbed 1.6%. But the tech sector was weighed down by shares of Twitter Inc.(TWTR) which shed 2% and Apple Inc. (AAPL) which was off 0.2%.

The Nasdaq Composite Index (RIXF) was mostly flat, last trading down 0.1% to 4,026. The Morgan Stanley High Tech 35 Index (MSH) was up 0.4%, while the Philadelphia Semiconductor Index (SOX) was up nearly 1%.

More MarketWatch technology stories

Facebook to test user reactions to video ads

Apple says Beyonce surprise album fastest-selling ever on iTunes

Subscribe to WSJ: http://online.wsj.com?mod=djnwires

HP (NYSE:HPQ)
Historical Stock Chart
Von Jun 2024 bis Jul 2024 Click Here for more HP Charts.
HP (NYSE:HPQ)
Historical Stock Chart
Von Jul 2023 bis Jul 2024 Click Here for more HP Charts.