RICHMOND -- The Mobil Oil Corp., saying recent amendments to Virginia's Petroleum Franchise Act are unconstitutional, has asked a federal court to bar their enforcement.

The legislation, enacted by the General Assembly earlier this year, is designed to protect retail gasoline dealers from competition with oil companies and to free them from control by refiners. The measure, which went into effect Sunday, was strongly supported by franchise dealers and opposed by oil companies.

In its suit, filed late last week in U.S. District Court here, Mobil said the legislation will reduce competition between stations, raise retail gasoline prices and prevent the company from enforcing provisions of some of its contracts.

It said the law is unconstitutional because Mobil will be unable to recover its "substantial investment in service station properties in Virginia, to maintain nationwide uniformity" of its marketing policies and franchise system, and to preserve the integrity of its federally registered trademark.

Mobil said the primary way it enforces such things as product quality, appearance, advertising, customer service and credit-card and operating-hour standards is through its franchising and distributor agreements.

Mobil said the legislation prevents it from requiring its franchise dealers to purchase minimum quantities of Mobil fuel and prohibits it from enforcing the contract requirements of some dealers to operate 24 hours a day.

The company said the prohibition on hours applies to 20 percent of the gasoline stations in the state, putting them at a competitive disadvantage with those not covered.

The suit says that as of Dec. 31, 1989, there were 176 Mobil-brand service stations in Virginia, among a total of 5,278 motor fuel retail outlets.

Mobil said that only the stations it owns and operates with its own employees -- which account for 32 percent of the Mobil fuel sold in the state -- would not be covered by the act. Franchise stations would be covered.