An opposition legislator said yesterday that thousands of persons - not 97 as reported by the government - were killed when soldiers opened fire on antishah demonstrators who defied martial law last Friday.

Ahmad Bani Ahmad, speaking in a confidence debate in the lower house of Parliament, poured scorn on the official toll.

"If you want a real figure, announce a day so that relatives come forward and give the names of those killed, but you will not do this," he told Prime Minister Jaafar Sharif-Emani.

Bani Ahmad's mention of a death toll concurred with a wide belief in Tehran that at least several hundred people - possibly as many as 3,000 - were killed when the soldiers shot into demonstrators in different parts of the capital Friday.

Bani Ahmad declared he would boycott the actual confidence vote on Sharif-Emami's 18-day-old government, expected today, but expressed opposition during the debate.

Sharif-Emami is expected to receive an overwhelming vote of confidence. The balloting is a consitutional requirement following his appointment last month amid mounting political unrest in Iran, including nine months of antigovernment demonstrations and a theater fire in which 377 people died.

Iranians have been following the proceedings in parliament on their televisions screens, watching such opposition attacks on the government in a manner unheard of in Iran.

Despite martial law and the repressions of street demontrations, newspapers and television cameras have been allowed to give unrestricted coverage of the debate leading to the vote of confidence.

Viewers saw and heard member of Parliament from the ultranationalist Pan-Iranist Party call the new prime minister incapable of resolving the crisis and charge that martial law was a "grave error."

Opposition speakers called for a purge of "old-fashioned" ministers and said the government was ridiculous to blame communists for eight months of rioting, which they said was due "solely to the people's discontent."

By allowing full coverage of the debate, the shah's government is trying to show that the liberal "springtime in Teheran is not finished," as Justice Minister Mohammad Baheri put it.