The Virginia General Assembly's leadership late today reached an agreement on a budget that would restore more than 90 percent of the cuts in public education aid proposed last month by Gov. Charles S. Robb.

But a computer breakdown prevented printing the final budget compromise and forced the legislature to postpone its scheduled adjournment and call for an extraordinary Sunday session to wrap up its 1983 session.

What forced the legislature to adjourn last night was the breakdown of a computer at the Division of Motor Vehicles that is used to print copies of legislation. When it broke officials were unable to find any state workers to fix it and, after a conference with Gov. Charles S. Robb, the lawmakers agreed to return Sunday morning after the computer is fixed.

On what was supposed to be the legislature's final day, its leaders, with Robb's support, found a way to avoid painful cuts in local school aid and avert a freeze on state employee salaries, all without raising taxes.

Earlier today, the legislature narrowly approved a mild reform of the state's ethics laws but deadlocked on a proposal to create an intermediate court of appeals.

Overall, with the pressure of fall elections facing them, Virginia's 140 legislators managed to skirt most significant issues during their 46-day session. It was, said Sen. Joseph V. Gartlan Jr. (D-Fairfax), "a really bland session."

"I'd say we did a better than average job putting off major decisions until next year when we see how good a governor Robb really is," said Del. Ford Quillen (D-Scott).

The issues that drew the high-priced lobbyists, such as building a coal slurry pipeline and permitting uranium mining, were postponed for further study. Many controversial proposals, such as making Martin Luther King Jr.'s birthday a state holiday and banning disposable bottles and cans, were killed.

And a push to increase the legal age for buying beer from 18 to 21, backed by Robb and grass-roots organizations across the state, ended in a compromise that will raise the drinking age to 19.

The state's 1983-1984 budget, buffeted by a poor economy, remained a central issue of the session and, typically, was the last to reach the floor. Last month, Robb moved to forestall an anticipated $175 million shortfall by proposing a second round of 6 percent cuts in state agency spending and a $20 million reduction in aid to public schools.

Today after three days of negotiations, six senior legislators came up with an agreement that closely resembles the House budget bill released three weeks ago. That agreement would give state employes a minimum increase in take-home pay of 5 percent, achieved by the state's assumption of employee contributions to the retirement system--estimated to cost $30 million.

It would also set the minimum state per pupil payment in public schools at $1,464--only $3 less than the amount originally requested by the House, and $9 more than the Senate proposal. Robb had proposed a $1,426 per pupil minimum.

The compromise budget would also reduce proposed cuts at Virginia's colleges and universities from 6 percent to 4.8 percent, a victory for legislators who argued that higher education had born an unfair brunt of Robb's cuts. The legislature rejected a proposal to defer a $3,000 increase in their $8,000 a year salaries, accepting instead a plan to cut their per diem allowance from $100 to $75.

To pay for the restored funds in education and other areas, the legislature used $16.4 million raised through an escalation of prepaid taxes from corporations and individuals.

The budget debate was marked by competition. For the first time in decades, the Senate Finance Committee moved in on the House Appropriations Committee's turf, introducing its own version of the budget and setting the stage for a behind-the-scenes struggle over the state's fiscal affairs.

Also for the first time, administration officials were barred from the conference because, said one source, "the conflict was so strong that they didn't want anyone outside the immediate family involved."

The Senate held out against full restoration of the $20 million cut in public education--the House's original position--on the theory that schools should not be totally exempt from budget cuts. In all, the conferees' report would retore 30 percent of Robb's proposed cuts in state spending next year, legislators said.

"I think they did a heck of a good job," said Dick Pulley, a lobbyist for the Virginia Education Association.

Secretary of Administration Wayne Anderson called the legislature's action "wise and commendable. We couldn't have asked for a better package of decisions."

The legislature did approve a revision of the state's conflict-of-interest laws, fashioning a compromise on the final day that satisfied the bill's sponsor, Sen. Adelard L. Brault (D-Fairfax). The ethics law, intended to prevent legislators and other public officials from using their positions for private gain, encountered the usual obstacles from skeptical delegates but emerged with some provisions intact.

Brault today succeeded in narrowing what critics had called a major loophole in the House version of his bill, a provision that would have shielded local officials from prosecution if they had violated the ethics act after securing advise from a local government lawyer. The compromise, sent to Robb for his approval, would give immunity after the officials had disclosed all the fact in a case and received approval from an elected prosecutor or the state attorney general.

"We've come out of the General Assembly with more than I ever expected," said Brault, the 72-year-old dean of the Fairfax delegation who will now retire after 18 years in the Senate. "We did strengthen the law."

The law, approved 23-to-17 in the Senate's crucial vote and 86-to-3 in the House, does not in fact tighten the code of behavior for legislators, some of whom have been criticized in recent years for proposing and supporting bills to help themselves or their clients. It does strengthen the law for local officials, and it also creates for the first time a semi-independent, advisory ethics panel that may pass judgment on delegates' behavior.

Robb this year submitted a modest package of proposals, saving his major initiatives for next year's longer session, but he won points from some legislators for improved relations with legislators that led to passage of most of his crime package. That package, drafted by Democratic Attorney General Gerald L. Baliles, would broaden prosecutors' ability to act on evidence gathered in wiretaps and establish multijurisdictional grand juries that could pursue drug investigations across county lines. The legislature approved both.

The assembly also approved a bill to permit the early release of repeat non-violent offenders, a measure intended to make room for violent criminals in the state's crowded prisons.

Robb lobbied hard to convince the legislature to create a 12-judge intermediate court of appeals in Virginia, the largest state without such a panel. Robb argued that only litigants with "extraordinary patience or fat wallets" currently can afford to appeal a case to the state Supreme Court.

Opponents argued that the appeals court, which would begin hearing cases in 1985 at an estimated annual cost of $2.5 million, would impose an additional layer of bureaucracy, enriching only lawyers.

Asked to assess the legislature's accomplishments this year, Sen. Robert Scott (D-Newport News) said: "I think the Commonwealth survived. We didn't do very much."