Before Marine Lt. Col. Oliver L. North testified before the congressional Iran-contra committees, White House aides were confident that President Reagan would not be drawn deeper into the affair, believing that North's damaged credibility would be further undermined at the witness table.

But by week's end, Reagan aides admitted North has been an unexpectedly good witness who did exactly what they wanted to avoid: He renewed attention on the role of his superiors, particularly on whether Reagan knew of the diversion of profits from the U.S.-Iran arms sales to aid the Nicaraguan rebels.

The heart of Reagan's defense is his repeated assertion that he was unaware of the diversion, and North did not directly contradict that denial. But the central theme of the Marine's testimony all week was that everything he did was authorized by his superiors.

His testimony significantly increased the importance of the next witness before the committees, former national security adviser John M. Poindexter, who was North's immediate superior in the White House and the person between North and the president in the chain of command.

Congressional interrogators led North through a series of meetings and conversations with former boss Poindexter in which the two discussed the diversion. North testified he would not have gone ahead with the diversion as part of the Iranian arms sales without specific approval of the president.

Based on his conversations with Poindexter, North testified, he felt that Reagan had approved the diversion. Those conversations, if confirmed by Poindexter, could lead to Reagan, according to congressional sources.

North, in what some committee members described as his most surprising revelation, testified that after Poindexter gave him the green light he wrote five memos between February and October 1986 seeking Reagan's approval of operations that included a diversion of funds. Each of the five memos was for a planned Iranian arms sales, and three of the transactions described in the memos went through. Those sales took place in February, May and October 1986.

Until North's testimony, congressional investigators were aware of only one memo -- a draft dated April 1986 -- that sought presidential approval for the diversion. "If he didn't say five, we would have been operating on the assumption that there was only one," one congressional source said.

North's testimony laid the foundation for Poindexter's appearance. Committee officials hope to finish with North Monday and begin hearing from Poindexter the next day. Poindexter, who like North has received limited immunity from prosecution for his testimony, has already been interviewed extensively in private by congressional investigators.

While North turned out to be a gripping witness, the pipe-smoking Poindexter may seem dry by comparison. A career Navy man with the rank of rear admiral, Poindexter has a nasal voice and a tendency to answer questions in bureaucratic terms and unemotional tones.

However, the White House has always been concerned about Poindexter because, unlike North, he had regular access to the president. For example, Poindexter provided daily morning national security briefings to Reagan.

As part of their extraordinary preparation for Poindexter's testimony, Reagan aides have checked his every meeting with the president to see when the two met alone and with others. When others were present, aides have interviewed them to see whether Poindexter said anything about the diversion.

In an April 28 interview with six newspaper correspondents, Reagan was asked whether it was possible that North and Poindexter "got the idea that you approved of their actions and that they were acting with your authority."

"I wouldn't see how, no. No," Reagan said.

Asked in the interview whether he was concerned that Poindexter would in some way implicate him in the diversion, Reagan said, "No, John Poindexter's an honorable man." Asked how an aide who saw him daily failed to notify him of something so seemingly important, Reagan said, "Maybe he thought he was being, in some way, protective of me. I don't know."

During Poindexter's tenure as national security adviser from December 1985 through his resignation last Nov. 25, he displayed a penchant for secrecy.

For example, when Secretary of State George P. Shultz asked him in Tokyo in May 1986 if the Iranian arms sales were continuing, Poindexter lied and said there was not "a shred of truth" to the story.

Revelations surrounding the Iran-contra affair have also raised questions about his credibility. When North falsely told a House committee last Aug. 6 that he was not involved in contra military activities, Poindexter, in a computer message, told North, "Well done."

When the diversion was disclosed by Attorney General Edwin Meese III at a White House news conference last Nov. 25, Meese said Poindexter told him he "did not know the details" of the diversion.

Meese later said that Poindexter told him he had received "hints" of the diversion from North "but he did not want to look further into it."

North's testimony flatly contradicts Poindexter's statements to Meese. North said that before he began the diversions as part of a broader arms-for-hostage initiative he sought and received Poindexter's approval. "This had better never get out," North quoted Poindexter.

Poindexter was long viewed at the White House as a precise staff man who had little understanding of the political and public relations side of policy.

As North put it: "The admiral is not a hip-shooter, as I am accused of being."

On the contra issue, North's testimony has raised new questions about Reagan's role in administration efforts to support the rebels during a two-year congressional ban on most military aid.

Both the Tower report and congressional testimony have revealed that North was extensively involved in raising funds for the contras and provide military assistance to them during the ban.

Reagan has said conflicting things about the degree of his knowledge of North's activities. Originally, he portrayed himself as uninformed.

In testimony to the Tower review board in January, Reagan said he was unaware that NSC was involved in assisting the contras.

Two days before the congressional hearings began on May 5, Reagan said he had "no detailed knowledge" about efforts to raise military aid for the contras.

Ten days after the hearings began, Reagan reversed himself and said "there's no question about me being informed."

"I was very definitely involved in the decisions about support to the freedom fighters," Reagan said. "It was my idea to begin with."

North defended his contra activities by saying that they were legal because the NSC staff, unlike the Central Intelligence Agency and the Defense Department, was not covered by the Boland Amendment's provisions.

North statement contradicts earlier testimony from former National Security Adviser Robert McFarlane, who said that the NSC staff was covered by the Boland Amendment and that he specifically order his assitants not to raise funds for the contras. North said he never heard any such order.

Following McFarlane's testimony that Reagan discussed with King Fahd a secret Saudi donation to the contras, the White House offered a new legal interpetation that said the Boland Amendment could not bar Reagan from carrying out his constitutional responsibilities on foreign policy.

North's testimony also provided new evidence that Reagan knew from almost the beginning that the Iranian arms sales were a trade for the release of American hostages held in Lebannon.

North testified that he saw in Poindexter's office in late 1985 a copy of a an authorization, called a finding, signed by Reagan that exlicitly said that a November 1985 weapons shipment was an arms-for-hostages deal. If Reagan did sign the document, it undermines his many claims, from November through the spring of this year, that he did not intend to trade arms for hostages. A White House spokesman said Friday that Reagan does not recall signing the document.

Following North's dismissal last Nov. 25, North said the President telephoned him and "said tome words to the effect, 'I just didn't know' of the diversion.

Chief House Counsel John W. Nields Jr. later asked North if he recallled telling an aide, Marine Lt. Col. Robert L. Earl, that Reagan had said in the same conversation, "It's important that I not know", about the diversion. North said he did not recall telling that to Earl.

It is possible, North said, that he told Earl, "It's important that I, Col. North, understand that he (Reagan) did not know."