President Mohammed Zia ul-Haq called today for the United States to convert its 1959 defense agreement with this country into a "friendship treaty" that would guarantee Pakistan's freedom and integrity.

Zia's bid to formalize the U.S.-Pakistan relationship in treaty form appeared to add a new dimension to Pakistan's desire for massive American military and economic aid to meet the threat represented by the presence of 100,000 Soviet combat troops in neighboring Afghanistan.

Asked specifically what he wants from the United States, Zia replied, "A good treaty of friendship and, in conjunction with others, economic and military assistance in that order of priority."

In his interview with American reporters, however, Zia rejected as "peanuts" a reported U.S. offer of a $400 million, two-year economic and military aid package.

"If this is true," he said, "it is terribly disappointing. Pakistan will not buy its security with $400 million. It will buy greater animosity from the Soviet Union, which is now more influential in this region than the United States."

Zia said his armed forces need modern planes as a defensive weapon, ground-to-air missiles, antitank weapons and better communcations equipment. Military experts here agree that most of Pakistan's military hardware is outdated.

The Pakistani leader was quick to add that he did not want any weapons "which would create a scare to our neighbors, particularly India." The Indians have complained that any weaponry supplied to Pakistan is likely to be used against them.

The two countries have fought three wars in the 32 years since they were carved from British India and given their independence. While Zia has been calling for greater friendship, Pakistan officials privately have voiced fears that India's new prime minister, Indira Gandhi, would provoke incidents to disturb eight years of gradually improving relations.

In mounting his argument for greater U.S. and Western support, Zia made it clear that Pakistan's nuclear program and the possibility of elections in the near future were not questions for discussion. Elections, he said, are a "luxury" Pakistan cannot afford.

In the interview held in the spacious living room of the house he occupies here through his position as Army chief of staff, Zia stressed that he was seeking the treaty relationship with the United States as a sign of a long-term U.S. commitment.

Saying he did not expect U.S. troops to be sent to Pakistan and would not allow U.S. bases here, Zia declared, "We are looking for a bilateral treaty in which the integrity and freedom of Pakistan is guaranteed."

A treaty, he said, would bind future governments of the United States to help Pakistan and American presidents would not require congressional approval to fulfill its obligations the way they do with an executive agreement, which is signed by the U.S. president but not ratified by the Senate.

He cited the 1971 friendship treaty between the Soviet Union and India as a possible model. Oddly enough, he also cited the recent Soviet-Afghan friedship treaty that Moscow used as the rationale for pouring troops into Afghanistan.

The 1959 agreement calls only for U.S.-Pakistani consultations in the event of communist agression here.

"I do not expect that the United States will send its troops to Pakistan," he said. "It would be foolish on my part to expect that the Americans or Chinese [who Zia in the past has called great friends of Pakistan] would come in to fight for the freedom of Pakistan. Pakistan will have to fight for its own freedom."

"All that we are trying to do," he said, "is enable us to stand on our own feet and fight for ourselves, and in case we need moral help put that hand on my back so that I can really put my chest out and say, 'No, I am not alone. We have friends in this world.'"

While Pakistan in the past allowed U.S. bases here, Zia said this would put Pakistan "in direct confrontation with the Soviet Union. You don't gain influence in an area by having bases, but by having friends in the region. g

Echoing the view expressed yesterday by his military commander on the frontier with Afghanistan. Zia said the western sector of Pakistan has bad roads and communications and no wireless or radar coverage for its armed forces.

"We are blind on our western border totally," said Zia. He refused to put a price tag on Pakistan's neds but did say it "requires more economic assistance than ever before."

Reminded that Pakistan had received great amounts of U.S. aid in the past, Zia replied, "Oh no, I wouldn't say that it's been enough. Otherwise, we wouldn't have been in bad economic trouble." When it was suggested that economic aid since 1948 totaled $5 billion, Zia looked surprised.

"Unfortunately, it hasn't been that effective, partially due to our own fault. Our own economic policies haven't been that effective," he said.

He agreed that the United States was "justified" in getting other nations to join in financing arms and economic aid to Pakistan, which Zia described as the only nation where the West still has influence in a broad crescent stretching "right from Turkey down to Vietnam."

"The sea, the whole regions of the [Persian] Gulf, of Iran, of Saudi Arabia are threatened," he said. "The back door is being wide open. Let us close it."

But he said he had not talked to any of the oil-rich countries of the gulf -- such as Iran and Saudi Arabia, who feel most directly threatened by the Soviet push into Afghanistan -- about aid.

"Saudi Arabia has been very active in waking up the Islamic world to realize the threat that exists now to the Moslem world [and] what has happened to a moslem country like Afghanistan. Saudi Arabia has played a very important role" in convening the Islamic foreign ministers' conference here next week. Zia said.

Zia made clear that he intends to discuss neither Pakistan's nuclear program -- which the United States insists is aimed at creating atomic weapons -- nor this martial law government's inability to stop a raging mob from burning the U.S. Embassy in Islamabad Nov. 21 during which two Americans were killed.

"If the United States can support 20 other countries which I won't name where there is no U.S. type of democracy, then I don't think we should undermine President Carter's intelligence that he will be asking me" about human rights, said Zia.

He said elections, postponed last October for the second time since Zia's Army-run government took over 2 1/2 years ago, "are not the remedy for Pakistan today" and will not be held "for at least a few years."

With 75 percent of Pakistanis illiterate, he said, it would be wrong to hold elections.

"How do you expect illiterates to decide for themselves what is good and what is bad for them?" he asked. "Somebody else has to tell them what is good and what is bad."

Until Pakistan improves its literacy and economic positions, he continued, it cannot afford "the luxuries of holding elections and this and that and all those things."