CAPE TOWN, SOUTH AFRICA, AUG. 13 -- President Pieter W. Botha accused western diplomats today of meddling in opposition politics and said South Africa might restrict their movements.

In his first major speech in two months, Botha launched an unusual attack on western embassies, telling Parliament some diplomats were abusing their posts.

Referring to U.S. curbs on the movement of some foreign diplomats, Botha said "similar steps can be considered in South Africa with regard to certain members of staff of specific embassies."

The United States does not restrict the movements of any western diplomats. It does, however, limit travel by representatives of Iran, Libya and the Soviet Union.

Botha said his government might consider "taking steps to bring the staff of embassies who are acting off-limits under control, or to restrict their movements."

The president complained specifically about foreign funding of a trip by white opponents of the system of segregation called apartheid to meet leaders of the black nationalist African National Congress in Dakar, Senegal, last month.

Botha said he viewed "in a very serious light the interference of foreign governments and their embassy personnel in the furtherance of extraparliamentary politics."

"No self-respecting government will allow its hospitality to be abused in this way," Botha said.

Botha said foreign governments funded the Institute for a Democratic Alternative for South Africa, which arranged the conference with the ANC, an organization fighting to end white domination in South Africa.

The president did not name any western country, but the wife of French President Francois Mitterrand played a role in arranging the Dakar talks.

South Africa's relations with its major western allies have deteriorated since a wave of antiapartheid riots erupted in black townships in 1984.

Botha threatened to withdraw the passports of South Africans "who collaborate with South Africa's enemies."

But he reiterated that the government might be prepared to talk to ANC leaders who renounce violence and dissociate themselves from communists in the organization.

Referring to the delegates to the Dakar meeting, he said, "The longer clumsy politicians and other rash victims woo the ANC, the longer it will take to get the ANC as an accountable and responsible party to join other South African interested parties around the negotiations table."

In his speech, Botha hinted his government might postpone whites-only general elections due in 1989 because the white minority voted in an early poll in May.

Botha said his National Party government, given a larger majority role in government in the May elections, will propose a constitutional amendment that would allow it to govern for a full five-year term.

A new constitution inaugurated in 1984 created junior parliamentary chambers for Indians and Coloreds, or people of mixed race, alongside the dominant white House of Assembly.