In the White House ceremony for the hostages Tuesday, President Reagan cited the 126th Psalm. The transcript published in yesterday's editions erroneously said the 125th.

Speaking against a backdrop of American flags and a hugeyellow ribbon, President Reagan warmly welcomed home the freed American hostages yesterday, and used the occasion to warn that future acts of terrorism will be followed by "swift and effective retribution."

Reagan's warning came during an emotional tribute on the South Lawn of the White House to 53 of the Americans who were taken captive in Iran almost 15months ago.

"Let terrorists be aware that when the rulesof international behavior are violated, our policy will be one of swift and effective retribution," Reagan said to the applause of 6,000 people, most of them employes of the Defense and State departments or members of the former hostages' families. ". . . We live in an era of limits to our powers. Well, let it be understood there are limits to our patience."

Members of the audience picked up the theme of the day, many carrying miniature red, white and blue flags and wearing yeallow ribbons. Color gurads from all the services stood at attention. A young boy shinnied up a camera platform and lustily joined in the singing of the national anthem and, later, in "God Bless America," with which Reagan closed the ceremony.

Reagan singled out one of the former hostages, Sgt. James Lopez of Glove, Ariz., about whom he told a patriotic story of capitivity in Iran.

"I'm told that Sgt. Lopez here put up a sign in his cell, a sign that normally would have been torn down by those guards," Reagan said. "Butthis one was written in Spanish, and his guards didn't knowthat 'Viva la roja, blanca y azul' means 'Long live the Red, White and Blue.' They may not understand what that means in Iran, but we do, Sgt. Lopez, and you've filled our hearts with pride. Muchas gracias."

The president's brief speechwas sprinkled with historical and biblical allusions.

Reagan likened the former hostages to the crew of the Pueblo and to the U.S. prisoners in four wars of this century. He quoted from the 126th psalm in the Old Testament: "We were like those who dreamed. Now our mouth is filled with laughterand our tongue with shouts of joy. The Lord has done greatthings for us. We are glad."

And, in honoring the eight Americans who were slain in the ill-fated rescue attempt in Iran last April, and without identifying the quotation, he paraphrased the words of Christ:

"Greater glory hath no manthan that he lay down his life for another."

Bruce Laingen, the former deputy chief of mission in Iran, responded to the president in behalf of all the hostages.

"Mr. President, I give you now 52 Americans supplemented by a 53rd today, Richard Queen sitting over here, overjoyed in reunion withour families, the real heroes in this crisis," Laingen said, struggling to control his emotions.

"The 53 of us proudtoday, this afternoon, and also to see and to meet with some of those families and Col. [charles] Beckwith and some of those who came back. Fifty-three Americans who will always have a love affair with this country -- and who join with mein prayer of thanksgiving for the way in which this crisis has strengthened the spirit and resilience and strength thatis the mark of a true, truly free society."

Laingen quoted from signs the hostages had seen since their return, saying that the best of them was one outside of West Point which read, "And the world will be better for this."

"We pray, Mr. President, that this will be so," Laingen said.

Reaganconcluded the outdoor ceremony under sullen skies, which promised rain but never produced it, by giving Laingen a rosewood box bearing a silver seal and containing a folded American flag. He repeated this procedure in the Blue Room afterward with evry former hostage. The freed Americans also willeach receive an American flag used in the South Lawn ceremony.

The president's warning that future acts of terrorismwould be met by swift retribution was the declaration of "broad policy" his aides had said Reagan would issue yesterday. But it was unclear what the precise implications are of this warning. White House officials say that the policy the United States would follow in the event diplomats are taken captive again is under review.

White House press secretary James S. Brady said Monday that about a dozen of the hostages were suffering from "severe problems," which, Brady said, were "mostly mental" in nature. Some of the hostages disputed this statement in a West Point news conference yesterday morning, and White House press aides declined to repeat Brady's statement of the day before.

The emotions of the Reagans during the day were high enough to match those of the hostages. The president and his wife, Nancy, watched from awindow of the White House family dining room as the hostages were driven up in their Metro-bus motorcade. "They both started to tear up," Brady said.

"Mrs. Reagan went to get a few more tissues," deputy chief of staff Michael K. Deavertold reporters.

In the Blue Room, where the Reagans welcomed the freed hostages before taking them out to the South Lawn, Mrs. Reagan kissed and hugged many of them.

There were lighter moments during the day. One came when the president, believing that the military bands were about to play the national anthem at the beginning of the South Lawn ceremony, stood at attention and put his hand over his heart. Theband played "Hail to the Chief."

Another relaxed moment came during the presentation of the rosewood mementos when the name of former hostage "Regis Ragan" was called.

"Cousin," the president said.

"Kissing cousin," Mrs. Reagan added.

"I didn't know he'd joined the family," Reagan rejoined.

In a reception for the former hostages and their families on the state floor of the White House, Reagan spoke to the hostages for two minutes, and joked that he was officially ordering them to have a good rest and spend some time with their families.

"We're all very happy to have you back where you belong," Reagan said. "And we're now going to go,and you have just received your second freedom."