President Mohammed Zia ul-Haq has tightened his control over Pakistan's Army in recent days by placing some of his most loyal supporters in key positions.

But he failed to broaden the base of his martial-law government by bringing in more civilians, and his popularity remains low, according to diplomatic and Pakistani sources.

"There is more open grumbling about his government among Pakistanis now than I remember a month ago," said one non-American diplomat who has just returned here after a short vacation.

This view is backed in casual conversations with Pakistanis who appear less reluctant than before to make critical comments about Zia and his band of generals, who have been running the country since they overthrew former prime minister Zulfiqar Ali Bhutto in a coup in July 1977.

One shopkeeper referred to Zia derisively as "the bandmaster," while in the bazaar of the neighboring city of Rawalpindi merchants make crude puns in Urdu and Punjabi about his name.

Nonetheless, Zia appears fimly in control of the country -- especially after moves over the past two days in which he quietly extended his term as chief of staff of the Army, took the command of troops from the country's four military governors and two Cabinet ministers and promoted one of his most loyal supporters to head the military units stationed around the capital.

He said that separating the jobs of corps commander and provincial governor would lead to civilian rule, but observers noted that the governors are still in the Army. The only difference is that they no longer command troops.

Zia reportedly has been trying to get the governors to retire from the Army. Thus this appears to be a compromise solution.

At the same time, Zia promoted six officers to lieutenant general in a move expected to help Army morale by freeing up posts farther down the ranks.

"Clearly Zia won this round with the generals," said one foreign analyst here. "But he has not moved to the real problem of giving his government legitimacy. He had been headed toward a civilian government and Cabinet, but he apparently couldn't get enough people with good qualifications to join."

A Pakistani source agreed, but added, "He will have to fight more rounds" with his peers in the Army, who are the real source of Zia's power in the country.

These moves had been under way long before reports began surfacing of a plot against him, which most diplomats here do not take seriously. They also feel those reports had little if anything to do with the changes.

On Tuesday, Lt. Gens. F. A. Chisti and Ghulam Hassan, who had been replaced as military corps commanders but still held Cabinet posts, let it be known that they plan to retire from the Army at the end of this month. There were also reports that they planned to resign their Cabinet posts.

Chisti, a close friend of Zia's, had commanded the key military garrison in Rawalpindi, which is charged with protecting the capital.

According to reports circulating here, that post has been given to one of the six newly promoted lieutenant generals, Khalis Mahmoud Arif, who was discribed as "a superloyalist" to Zia.

Zia has made himself extremely visible around the country over the past few days while these changes were being made. But knowledgeable observers here said his security has been tightened. They said there were between 500 to 1,000 plainclothes security men around the National Assembly building here for his weekend appearances -- about twice as many as usual.

Meanwhile, there have been student demonstrations over the past three days in Rawalpindi and in Lahore that diplomats believe may be partly aimed at the government, although that has not been their announced purpose.

In Lahore Monday, authorities moved quickly to quash anti-Soviet demonstrations on two Punjab University campuses. The authorities also stopped a demonstration at Gordon College in Rawalpindi.

There are posters up here calling for an anti-Soviet demonstration Friday, but observers doubt it will be allowed to take place.

Since Zia banned all political activity last October, there has been no effective organized opposition to his rule. But, observers here say, his hold remains tenuous, and few would be surprised if some incident such as a student demonstration provided a spark that could lead to his overthrow.