Stocks gained on Monday, lifted by expectations the Federal Reserve will add liquidity to strengthen the economy when it meets on Tuesday, while shares of Hewlett-Packard fell after the chief executive's resignation.

The Fed, while widely expected to renew its vow to keep interest rates near zero for an extended period, may indicate it is prepared to print more money to boost the economy as signs point to a slowing recovery.

The central bank's options include reinvesting maturing or prepaying mortgage-back securities in its portfolio. It could also say it will stop paying interest on banks' excess reserves at the Fed to lower long-term rates and encourage lending.

Hewlett-Packard was the biggest drag on the Dow industrials, with shares sliding 7 percent after CEO Mark Hurd resigned late on Friday. His resignation following an investigation into sexual harassment charges brought by a female contractor sent the company's shares down 10 percent in extended trade on Friday .

HP's stock fell another 7.2 percent to $42.99, although some analysts saw the sell-off as a chance to buy the shares.

We do not see this changing our thesis, and depending on the extent and duration of the sell-off, this might be a good opportunity to add shares of the stock, said Hank Smith, chief investment officer at Haverford Trust Co. in Philadelphia, which owns the stock. We're certainly not contemplating selling it.

He said Hurd was successful at improving margins and earnings at HP, but the board might use his resignation as an opportunity to bring in more of a technology visionary to run the company.

Among the Dow's top advancers, McDonald's Corp's shares hit a lifetime high at $73.33 after the world's biggest hamburger chain reported a stronger-than-expected 7 percent increase in global same-store sales in July. At midday, the stock was up 1.73 percent at $72.98.

The Dow Jones industrial average <.DJI> rose 34.14 points, or 0.32 percent, at 10,687.70. The Standard & Poor's 500 Index <.SPX> was up 4.41 points, or 0.39 percent, at 1,126.05. The Nasdaq Composite Index <.IXIC> gained 11.97 points, or 0.52 percent, at 2,300.44.

Friday's weaker-than-expected July jobs report was the latest to suggest the U.S. recovery was losing momentum.

On Monday, Goldman Sachs cut its year-end target for the S&P 500 index to 1,200 from 1,250, reflecting a lower U.S. growth forecast.

The central bank is expected to release its statement at 2:15 p.m. (1815 GMT) on Tuesday.

I would expect the market to watch for commentary on quantitative easing, and (the market) could actually be quite volatile, said Subodh Kumar, chief investment strategist, Subodh Kumar & Associates in Toronto.

I think the markets are begrudgingly accepting things are not as calm (in the economy) as they hoped for, despite the good earnings.

U.S.-listed shares of Research in Motion Ltd gained 3.7 percent to $55.43 after a Saudi official said the BlackBerry maker and Saudi mobile firms were testing three servers to send communications and data through Saudi Arabia before Canada to address Riyadh's concerns over security.

(Reporting by Caroline Valetkevitch; Editing by Kenneth Barry)