When President Pieter W. Botha gives his much-anticipated address on South Africa's political future Thursday night, few people will be listening more intently than Tom Boya.

As the black mayor of this bleak township east of Johannesburg and a political moderate, Boya walks the thin knife's edge of apartheid. He is looking to Botha for help to keep from falling off.

Boya must cope with the deep and bitter grievances of the nearly 100,000 disenfranchised black people who live here. At the same time, he must deal with a white ruling establishment he says is often ignorant of or insensitive to the pain and humiliation its rigid system of racial segregation inflicts on his constituents.

Lately being mayor has become dangerous. Boya's house and car have been stoned, his life threatened, his 14-year-old daughter abducted and nearly raped. Boya himself has killed a man and watched others die. Three bodyguards stand watch over his home 24 hours a day.

The attacks have been perpetrated by activists who consider black officials like Boya collaborators with white minority rule. The houses of 14 mayors and 85 town councilmen were burned or destroyed, as were 35 of their businesses between last September, when political unrest first hit South Africa and May 28, when the government released its tally. At least 27 mayors or council chairmen and 240 council members have resigned.

The numbers have undoubtedly risen since then -- six council members outside the city of East London had their houses burned down just yesterday -- and the attacks have been cited by officials as a major factor in last month's declaration of a state of emergency. One recent study suggested all but five of the South Africa's 38 new town councils have ceased to function.

Despite intense local pressure and intimidation, Boya is hopeful that Botha will come through with the kind of major reforms that will vindicate his own moderation and reestablish him in the minds of his constituents as a legitimate leader.

"The person who can really save South Africa from the calamity it faces is P.W. Botha," Boya says. "He holds the cards. People must see that the government is prepared to dismantle this horrible system."

In the United States, Boya's fast-talking energy, penchant for deal-making and pragmatism might propel him into higher office. But in South Africa, he has at age 34 already achieved the highest office open to blacks.

He presides over a township not unlike the hundreds of others that dot the treeless landscape around South Africa's whites-only cities. Nearly 100,000 people live in Daveyton, crammed into 12,000 matchbox houses. At least 6,000 families are on waiting lists for housing that does not exist, and Boya says he knows of places where 20 people sleep in a three-room shack.

"People like me have made it very clear we would work hard to change the system from within," Boya says. "Some people say 'here's this sell-out; here's this puppet.' I just stand my ground."

Botha, like his white predecessors, has consistently refused to allot South Africa's 73 percent black majority any share of power on a national level. But in recent years the government has devised schemes to give urban blacks a measure of local autonomy.

The proposals have been widely denounced by many black leaders as a means to perpetuate apartheid. But a minority has gone along with them arguing, as Boya does, that they are a reasonable first step.

Designed to mollify urban blacks, the new town governments have ironically stimulated unrest. Burdened with a desperately thin tax base, the councils raised rent and utility rates in an attempt to raise funds for new development. The increases touched off a wave of violent resistance that has yet to abate.

Boya, a former furniture salesman, restaurant owner and father of five, first became mayor here six years ago. A 10-member town council serves in Daveyton despite the fact elections consistently draw less than 20 percent of registered voters.

Boya says he soon found the government had a lot less in mind than it had promised. Township property, including schools and revenue producers such as beer halls and liquor stores, remained in the hands of white-controlled development boards even after the revamped local authorities act took effect two years ago. So did the power to hire and fire employes.

The mayor says wresting these powers away from whites has been a tough struggle but that real progress has been made. His government now controls all township revenue and property, although it backed off a proposal to raise rents last year after strong community opposition.

Boya also says he was the first black mayor to fire white employes for noncooperation and replace them with blacks. Five white clerks at the town's administrative center were notorious for taking long breaks and ignoring lines of blacks waiting for assistance, says Boya. "I gave them two hours to clear out their desks."

The mayor's small office in a squat, fortified brick community center bustles with the kind of activity any Chicago wardheeler would find familiar. During a noon break yesterday, he saw the following people:

*A woman in a blue maid's uniform and faded green beret, crying because she had received a monthly water bill of nearly $100.

*A quick phone call from Boya ascertained a clerk had inadvertently placed an extra zero on the amount. She only owed $10.A recent widow in navy blue mourning clothes who was told by her landlord she must move out now that her husband has died. Boya checked her papers, determined she has a legal right to remain in Daveyton and promised to get her on a priority list for new housing.

*A thin young man in an oversized suit who needed a letter of reference for a job as an insurance salesman. Boya called his prospective employer and gave an endorsment, noting, "None of the chaps I've sent you so far have let you down."

The mayor says he treats his constituents with respect not only to gain their trust and support but because he himself has felt white insensitivity. Earlier this year he walked out of a meeting of 40 mayors, all but two of them white, after the whites pointedly avoided sitting at his table for lunch.

"It was pure racism," he recalls. "They were saying 'you, blackie, go get served in the kitchen.'"

But Boya has won few friends among Daveyton's young black activists. They acknowledge he has taken what they consider progressive stances in advocating the unconditional release of black nationalist Nelson Mandela and in endorsing student demands for better schools.

Nonetheless, they contend, he is hopelessly tainted by his participation in local government. One student leader, at a public meeting in April, described Boya as "a toothless dog serving its masters."

As a result, he has become a prime target for attack. After the April meeting he and his fellow councilmen were stoned by rioters and his car damaged because he refused to resign. In June two youths were shot dead by police guarding his home during an abortive gasoline bomb attack.

Boya himself has struck back. He was charged by the family of a local student activist with attacking their house, assaulting two people and smashing windows in retaliation for the April attack. He has denied the charge. At least eight other activists had their houses stoned, incidents Boya says he knows nothing about.

But the worst moment came in June when he says his 14-year-old daughter was abducted by a gang of four men. He found them dragging her toward an open field. In the confrontation that ensued, Boya stabbed to death a 22-year-old man.

In a brown paper wrapper in an office desk drawer, Boya still keeps the knife, which he says belonged to the dead man. Its blade is stained with blood.

Having become a combatant in South Africa's low-level war, the mayor gave his tacit approval to the emergency declaration, which he says has helped calm his troubled township. But he quickly adds that the government must now move on to offer real reforms or else the violence will erupt again.

The mayor refuses to be pessimistic despite reports Botha does not plan to offer precedent-shattering concessions. But, Boya says, if Botha doesn't deliver, "It's going to be tough for the government. It's going to be tough for all of us."