At least half a dozen times since 1952, Congress has left some government agencies technically broke for several hours or days by failing to enact the laws giving them money to spend. But until last year, no agency ever shut itself down for this reason, or believed such a drastic step was required.

That was because, until last year, no one paid any attention to an 1870 statute that tells government managers, in effect, "If Congress hasn't given you money, you can't spend it."

The law, known as the Antideficiency Act, was passed during the term of Ulysses S. Grant, rediscovered by congressional and Justice Department attorneys in the spring of 1980, and cited by the Reagan administration yesterday when it ordered much of the federal government to come to a halt.

But ever since the act was first rediscovered last year, top government officials have disagreed over how strictly it should be interpreted.

After the many lapses in funding over the past decade--often over tangential issues such as government funding for abortions and busing --former representative Gladys Noon Spellman (D-Md.) asked staffers to research her bill providing that all U.S. workers would continue to receive paychecks, even if funds for their agency were held up.

During the research, one of the staffers, Ron McCluskey, found the antideficiency statute, and Spellman wrote then-Comptroller General Elmer Staats, seeking his interpretation. Staats responded in March, 1980, that the law did indeed seem to require agencies to shut down when their appropriations ran out.

But, Staats said, Congress had generally agreed to pay any bills an agency incurred during a funding lapse, so "we do not believe that the Congress intends that federal agencies be closed during periods of expired appropriations."

Spellman then asked the Justice Department if Staats was correct as did the White House. Six weeks later, then-Attorney General Benjamin R. Civiletti decisively refuted Staats' opinion, saying that the Antideficiency Act requires that "federal agencies may incur no obligations that cannot lawfully be funded under prior appropriations" unless they could cover the obligations with other funds not dependent on congressional appropriations.

Civiletti added that he intended to back up his interpretation to the fullest: the law provides criminal penalties of $5,000 in fines and two years in jail for agency heads convicted of violations; the Justice Department, Civiletti said, would prosecute violators.

Civiletti's April 25 opinion was regarded as extremely strict by many government attorneys; it led to the one-day shutdown of the Federal Trade Commission on May 1, 1980 after lawmakers, deeply divided on the question of the FTC's mandate, failed to pass a new authorization bill for the agency before the old one expired.

On that day, all the FTC's 1,600 employes could do was cancel court dates, depositions and meetings, and pack up files as if they were shutting down. Most of May 2 was spent rescheduling these meetings and court dates and unpacking the files, according to a GAO study published last March 3. Total cost of the exercise, according to GAO: $700,000.

Seven months later, as fiscal 1981 was about to begin, the government for the first time teetered on the edge of a shutdown as Congress wrangled over budget legislation. The Office of Management and Budget issued a directive--backed by Civiletti--telling agencies they could continue to spend money protecting property and ensuring the safety of human life.

But arguments continued within the administration over Civiletti's strict interpretation of the law. In particular, Alonzo L. McDonald Jr., White House staff director under Hamilton Jordan, argued strenuously that what he saw as legal technicalities should not be the controlling factor when the issues affected tens of thousands of government workers and millions of dollars.

"That's just no way to run a railroad," McDonald said yesterday.

He tried to enlist the aid of White House counsel Lloyd Cutler to change Civiletti's opinion and give government managers more flexibility, but to no avail.

Civiletti did, however, substantially broaden his opinion on Jan. 16, 1981, saying the antideficiency act should be read along with other statutes, as well as the President's constitutional powers. The new interpretation allowed for much more government activity to continue at the president's directive.

It was that Jan. 16 opinion that the Reagan administration chose to abide by when it started planning for a possible shutdown of government this week. But Reagan officials also took the hard line that Civiletti took back in April, saying that violators of the antideficiency law could be subject to criminal penalties.

"The issue was never confronted before in those earlier situations before 1980 , and therefore Civiletti's rulings may have been a departure from prior practice," said John Harmon, another member of Carter's Office of Legal Counsel. But, he added, "that deadline's on the books because [Congress] put it there."