The government prepared for possible shutdown of most nonessential operations at midday today as the Senate moved toward passage of a catchall spending bill and the House balked at further emergency funding measures.

Government employes were told to report for work as usual this morning and await further instructions, which officials said probably would come by noon. By then, officials said, they hoped to know whether Congress is moving toward approval of a spending bill acceptable to President Reagan.

"There is a distinct possibility there may have to be a shutdown," Office of Management and Budget spokesman Edwin L. Dale Jr. said.

Meanwhile, yesterday, as the 98th Congress groped uncertainly toward its planned weekend adjournment, with the Senate struggling past midnight on the spending bill and technically missing the deadline for continued government funding:

*The Senate rejected, 57 to 42, a proposal to halt funding of military or paramilitary assistance to antigovernment rebels in Nicaragua but provide $6 million in "phase-out" funds for withdrawal and resettlement.

The action, in connection with the catchall funding bill called a continuing resolution, put the Senate on a collision course with the House, which has voted to ban further aid to the so-called "contras."

*An administration request for $110.2 million to strengthen security for U.S. embassies in the wake of the latest Beirut bombing was approved by the Senate. The Senate rejected a Democratic-proposed condition that the president would have to certify the funds were sufficient to ensure adequate security.

*The Senate voted, 54 to 44, to continue restricting Medicaid financing of abortions to cases in which the life of a woman is at stake, reversing a voice vote last week to expand government financing of abortions to cases of rape and incest.

The action was taken in connection with the government funding measure, now certain to include the more restrictive language because the House has voted to permit abortion aid only when a woman's life is jeopardized.

*The Senate gave what is expected to be final approval to a new American Conservation Corps to employ thousands of disadvantaged young people in projects on federal, state, local and Indian lands. The program, patterned after the Civilian Conservation Corps of the 1930s, was approved last year by the House, which is expected to approve Senate modifications and send the measure to Reagan for signature.

*The House, by a vote of 238 to 179, brushed aside an effort by Republicans to force a showdown over a proposed balanced budget amendment to the Constitution, which is backed by President Reagan. The move came only a day after House Democrats won approval of legislation to require the president to submit a balanced budget plan with any budget that is unbalanced. Republicans interpreted this as a ploy to divert attention from the amendment.

*The House passed a package of trade measures, including a Democratic plan that could force major steel companies to reinvest and modernize in exchange for import relief. The measure will go to a House-Senate conference, and the White House has threatened a veto.

*The House also approved a compromise with the Senate on legislation strengthening controls on hazardous-waste disposal. And it approved a Senate compromise on a measure to provide compensation for veterans exposed to toxic Agent Orange or atomic radiation.

The latest crisis over government funding arose when the new fiscal year dawned Monday with Congress having passed only four of its 13 regular appropriations bills, without completing action on a continuing resolution to cover the rest.

It came to a head yesterday when Senate Majority Leader Howard H. Baker Jr. (R-Tenn.) told colleagues that Congress could not finish by today and that there were no plans for passage of another short-term extension of current funding levels.

The Monday deadline was missed because Senate delays due largely to a civil-rights legislation dispute that resulted in scuttling of the measure. But the government was spared disruptions when the two chambers passed a three-day stopgap spending measure, in effect deferring the deadline for action until 12:01 a.m. today.

This time, as the stopgap funding was about to run out, the Democratic-controlled House ran out of patience with what it regards as dawdling over the measure by the Republican-run Senate.

Baker said yesterday morning that he would confer with House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) about another short-term extension but returned a few hours later to tell the Senate that none would be considered.

Other sources said an extension might be considered at some point but only after maximum pressure, including steps toward a partial government shutdown, was exerted on the Senate to act with unaccustomed swiftness on the measure.

"Beginning Thursday , the process for shutting down the government will begin," said Baker, with no discernible impact on the Senate's slow pace, which was expected to result in an all-night session.

A similar point was made in an OMB directive sent to executives of affected agencies, including the departments of agriculture, defense, interior, labor, health and human services, education, transportation and treasury, along with the Office of Personnel Management and General Services Administration.

These departments and agencies, exclusive of military personnel, cover roughly two-thirds of the federal work force, according to the OMB.

Although the Justice Department's interpretation of existing law requires shutdown of nonessential services at agencies whose funding is not extended at the start of a new fiscal year, the government sometimes stretches the point if a funding agreement is in sight.

It did so again in summoning employes to work this morning, noting that Senate progress on the measure indicated that it might finish sometime yesterday, a prediction that turned out to be overly optimistic.

But it said it would be "prudent" for department and agency heads to undertake "contingency planning and full preparedness to implement agency shutdown plans, perhaps as early as tomorrow Thursday ."

This was necessary, the memorandum said, because of possible further Senate delays, the likelihood of "serious policy differences" in a House-Senate conference on the measure and "the fact that the conference bill may in the end be unacceptable to the president."

It noted that the House measure, passed last month, included spending levels and "extraneous provisions" that were "unacceptable to the administration."

Among them are 53 water and flood control projects, costing $139 million this year. The Senate has approved a smaller number of projects but also more than the administration wants.

The last time the government was shut down in a dispute over spending levels was in November 1981, when Reagan vetoed a continuing resolution and forced Congress to agree to a compromise.

The Senate's vote to give at least tacit sanction to continued aid to contra rebels in Nicaragua was consistent with its earlier position on the issue, although it had voted against additional assistance earlier this year when confronted with a choice between the contra aid and summer jobs at home.

The 15-vote margin represented a slight decrease in support for the contra program since the Senate last voted on the issue in connection with the defense authorization bill in June, when it rejected a similar proposal, 58 to 38. But it still represents a strong bargaining position for the Senate as it goes into conference on the spending bill with the House, which has taken an equally strong position in favor of a ban on further aid to the contras.

The issue could become a major sticking point in the conference, which also will be confronted with scores of domestic issues when it starts work.

The Senate's spending bill includes no specific outlay for the contra program, at least in its unclassified sections, although sources said it contemplates as much as $28 million in aid this year, as recommended by the Senate Select Committee on Intelligence.

Both Senate attempts to phase out the program were made by Sen. Daniel K. Inouye (D-Hawaii), who argued yesterday that it amounted to a "tragic distraction from the regular business of this nation" and put "great strain on the credibility" of the U.S. government and its intelligence agencies.

But conservatives said the aid program is a bulwark against communist expansion in Central America and insurance against threats to stability of the moderate government in El Salvador.

"If we don't support the contras, we support the communists," argued Sen. Malcolm Wallop (R-Wyo.), who called the idea of phase-out money "atrociously obnoxious."

After voting against stopping the contra aid, the Senate refused, 53 to 46, to specify that none of the money could be used to subsidize "acts of terrorism" against Nicaragua.

In other action as the Senate struggled through the spending bill, it approved by voice vote a proposal from Sen. Christopher J. Dodd (D-Conn.) to cut off aid to El Salvador if its elected president is deposed by a military coup.

It rejected, 54 to 46, a proposal from Sen. David H. Pryor (D-Ark.) to cut $211.5 million from the $695 million recommended by the Senate Appropriations Committee for military assistance grants for countries other than Israel, Eqypt and those of Central America.

A proposal by Sen. Alan Cranston (D-Calif.) to suspend future military aid to Pakistan if it continues efforts to produce a nuclear bomb, unless the president certifies that continued aid is essential to U.S. security, was ruled out of order on procedural grounds.

The Senate also approved, 97 to 0, a resolution calling on the federal government to support "effectively" the people of Afghanistan in their fight against Soviet occupation.

Rejected on procedural grounds were proposals to ban armor-piercing "cop-killer" bullets and to finance a study of the comparable worth of jobs held by men and women in the federal work force.