The Supreme Court ruled 5 to 4 yesterday that the constitutional guarantee of freedom of the press did not prevent the Federal Communications Commission from warning a broadcaster of possible penalties for having broadcast seven words that crudely depict sexual and excretory organs and activities.

Seeking "to emphasize the narrowness of our holding." Justice John Paul Stevens wrote in the decision that "rested entirely on a nuisance rationale in which context is all-important." I also took into account "a host of variables," including the time of day when the words were broadcast and the composition of the audience, he said.

Stevens went back to 1926 to recall that Justice George Sutherland had written that a "nuisance may be merely a right thing in the wrong place - like a big in the parlor instead of the barnyard. We simply hold that when the commission finds that a pig has entered the parlor, the exercise of its regulatory power does not depend on proof that the pig is obscene."

That light note, struck on the final day of the court's term, wasn't echoed by the National Association of Broadcasters.

The decision is "a harsh blow to the freedom of expression of every person in this country," said NAB President Vincent T. Wasiliewski. He stressed that his organization "in no way apporves of indencent language on the air as such," but fear that the FCC "will not stop with the seven dirty words."

At the commission, however, Chairman Charles D. Ferris told a reporter that he, and, he believes, his fellow commissioners have "a very strong reluctance" to involve the FCC in program content or to "get into any form of censorship."

Ferris also emphasized the narrowness of the holding saying, for example, that the saw no clear signal that ABC-TV could not do again what it did last Wednesday night; carry a much-praised documentary on juvenile crime that included strong street language hitherto not heard on television.

The case began before an audience in a California theater, where satiric humorist George Carthy recorded a 12-minute monologue entitled "filthy Words." He began by referring to his thoughts about "the words you couldn't say on the public, ah, airwaves, um, the ones you definitely wouldn't say, ever."

Carlin went on to list the words, which consist of three to 12 lettes each, and to repeat them again and again in what Stevens termed "a variety of colloquialisms." The transcript, which indicates frequent laughter from the audience, is appended to the court's opinion.

At about 2 p.m. on Oct. 30, 1973, New York City radio station WBAI, owned by the listener-financed Pacifica Foundation, played excerpts of "Filthy Words" as part of seris on social attitudes toward language - after suggesting that some of te audience might care to switch to another station for about 15 minutes because it was going to air regards "offensive."

A man and his young son heard the broadcast on a car radio. The father, identified by ABC News yesterday as John Douglas, complained to the FCC. The agency investigated and, in February 1975, told Pacifica that it "could have been the subject of administrative sanctions," and that its order in the case would go into the file.