Michael M. Smith of Williamsburg yesterday became the first person to appeal his death sentence under Virginia's new capital punishment law.

Smith, 31, was convicted of the rape and murder of Audrey J. Weller, 35, on a York River beach in James City County on May 23, 1977, 37 days before essential provisions in the state's capital punishment statute became effective.

His lawyer, David F. Pugh, argued to the Virginia Supreme Court of Appeals that execution of Smith for the crime would violate the constitutional guarantee against trying persons for crimes under laws enacted after the alleged offense.

When the murder occurred, Pugh said, "Mr. Smith did not know what to expect as punishment." He added, "There was great uncertainty with respect to capital punishment in all the states at that time. He was not forewarned."

Assistant Attorney General James E. Kulp argued that the changes in the capital punishment statute that took effect after the crime were merly procedural changes that benefited Smith.

"Virginia has had a capital punishment statute on the books at least since 1796," Kulp said. "Between 1908 and 1962 (the date of the last execution), the records show that 236 persons were executed for murder or rape." He said these facts amounted to sufficient forewarning that murder can be punished by death.

At the time of the crime, Virginia law imposed a mandatory death sentence for murders committed in connection with a rape. Although the Virginia statute never was declared unconstitutional, the U.S. Supreme Court in 1975 struck down similar mandatory death sentence laws.

Then-attorney general Andrew P. Miller concluded that the old Virginia statute would be found defective if tested, and on his recommendation former Gov. Mills E. Godwin commuted the death sentence of several inmates on death row to life imprisonment.

At its next session, the General Assembly revised the capital punishment statute, to make it conform to procedures approved by the U.S Supreme Court in other cases.

The new law provides for a two-part trial in which the judge or jury first determines whether the defendant is guilty and then, in a second proceeding, decides whether the penalty should be death or imprisonment. Imposition of a death penalty requires evidence that the defendant poses a continuing threat to society and is likely to commit similar crimes again.

Kulp argued that these were changes in trial procedure that became effective before Smith's trial. He cited a U.S. Supreme Court ruling that procedural changes can be applied in trials for crimes committed before the changes became effective.

Pugh argued that the changes were substantive, not merely procedural. "What could be more substantive than a provision which determines whether a man shall live or die?" he asked the seven justices.

Even if the court rules that athe capital punishment changes were only procedural or remedial, he said, it should be guided by another Virginia statute providing that all acts of the General Assembly are to be applied only to events that take place after their effective date.

Although yesterday's arguments focused primarily on the application of the capital punishment law to Smith, Pugh also argued that the James City County judge who presided at his jury trial made several errors.

He said the judge erred by prohibiting testimony about the general reputation of the victim, by permitting what he called "inflammatory" testimony by the victim's daughter and by excusing a prospective juror who first indicated she was opposed to capital punishment but then said she could approve of it in some cases.