Iran's revolutionary government staged a large anti-American rally today in an apparent effort to shift attention from its domestic difficulties to safer foreign policy issues.

Revolutionary firing squads today executed another 13 Iranians including, for the first time. victims accused only of political activities. Among them were a parliamentary deputy who was a pro-shah Moslem cleric and two prominent news executives from the shah era.

The continued executions which are known to be carried out against the wishes of Prime Minister Mehdi Bazargan, suggested unresolved difficulties between the civilian Cabinet and more militant supporters of Ayatollah Ruhollah Khomeini.

Bazargan's new defense minister, Gen. Ahmad Madani, told a news conference here that the Cabinet was planning to ask Khomeini to issue a "general pardon" to members of the armed forces "except those responsible for shooting anti-shah demonstrators."

Today's rally started at Tehran University where perhaps 50,000 Iranians gathered to march peacefully to the Palestine Liberation Organization office -- until recently Israel's embassy -- and to the U.S. Embassy.

The crowd, which dwindled to some 20,000 by the time it reached the U.S. Embassy, heard anti- Israeli and anti-American speeches and burned two Israeli flags.

The rally and march were clearly government-organized and mini-buses leading the procession gave careful instructions about a similar demonstration Wednesday and called for all banners to be handed in.

PLO representative Hanni Hassan told the university crowd gathered to protest President Carter's Middle East mission that the United States dispatched the aircraft carrier Constellation to the Persian Gulf area "to destroy the Iranian revolution."

Today's executions of 11 men in Tehran and two in the provinces brings to 43 those killed by firing squad for alleged crimes committed under Shah Mohammad Reza Pahlavi. Sixteen other men have been executed for alleged sexual offenses. All have been tried in secret by revolutionary tribunals.

For the first time the victims went beyond the now standard list of generals, torturers and prison officials to include the following:

Parviz Nikkah. He tried to assassinate the shah in 1966, but was pardoned and rose to become news director of the government-controlled radio and television network. He was widely believed to be the author of the illfated letter published in Iranian newspapers in January, 1978, which attacked Khomeini and caused the first of many antigovernment demonstrations.

Mahmoud Jaffarian, sometimes called "the shah's Goebbels," an allusion to Hitler's propaganda chief. Jaffarian was a former Communist who was pardoned by the shah. He became deputy chief of the radio and television, managing director of the national Pars news agency and deputy of the shah's abortive Rastakhiz Party.

Among the generals executed were Nader Jahanbani, former deputy ground forces commander, and Vali Mohamed Zand-Karami, who once headed the prison system.

Meanwhile, Amir Entezam, the official government spokesman, accused Time magazine and other unnamed foreign publications of taking money from the shah's Court Ministry and other officials. Entezam charged that at the time of the American-backed coup d'etat which put the shah back on the Peacock Throne in 1953, Time magazine "got several million dollars."

Challenged by Time correspondent Roland Flamini to substantiate the charges, Entezam said the government would publish documents and even check numbers as supporting evidence based on "the secret lists kept by the court, the prime minister's office and the National Iranian Oil Company."

Entezam raised the issue in reply to news conference questions about a recent article in Time quoting Iran specialist James Bill as saying Entezam and Deputy Prime Minister Ibrahim Yazdi were "pro-American."

In post-revolutionary Iran such an epithet is considered virtually a kiss of death for politicians.

In another foreign policy-related issue, Entezam officially confirmed that Iran would withdraw from the long moribund Central Treaty Organization (CENTO).

Grouping Iran, Pakistan, Turkey, Britain -- and the United States as an associate member -- the organization never really recovered from the defection of Iraq, which withdrew when its monarchy was overthrown in 1958.

Former prime minister Shahpour Bakhtiar announced Iran's intention to withdraw in January, but Iran's timing now coincides with Pakistan's decision yesterday to leave CENTO.

Entezam justified the move as part of Iran's "general policy" to have "no commitment to superpowers" and said CENTO's "commitment to America also made it take a stand against another country," obviously the Soviet Union.

But observers noted that the crowdpleasing gestures such as staging a pro-PLO rally and withdrawing from CENTO did not mean that the government was about to denounce its bilateral defense pact with the United States.

"The Defense Ministry is at present studying this bilateral treaty along with other pacts," Entezam said, "and we shall let you know when they are finished."

In other words, even post-revolutionary Iran is not about to leave itself naked along its 1,600-mile common frontier with the Soviet Union at a time the Iranian Army has all but ceased to exist.