D.C. Mayor Marion Barry, in tape-recorded testimony played at his trial yesterday, told a federal grand jury that he pursued innocent friendships and conducted only routine government business in the U.S. Virgin Islands and at the downtown Ramada Inn.

Barry's January 1989 grand jury testimony is the basis for the three counts of perjury against him, alleging that he lied in denying that he gave drugs to Lewis, that he received drugs from Lewis, and that he didn't know about Lewis's drug use.

In the testimony, over two days, Barry freely acknowledged his presence in many of the places, and with many of the people, through which the government is now presenting its case. But where prosecution witnesses this month have testified to the purchase and consumption of crack and powder cocaine, Barry described a busy schedule of official duties and the social life of a night owl interested in lawful entertainment.

At the downtown Ramada Inn, where the government alleges Barry gave crack to Charles Lewis and smoked it with him, Barry said he visited Lewis to cheer up a dispirited and unemployed friend.

Although Lewis spoke of buying a "working fifty," Barry said, he did not know what Lewis meant by the term. For his own part, Barry testified, he brought only government papers to the hotel, and he ingested nothing more intoxicating than Remy Martin cognac.

In a March 1988 trip to the Virgin Islands, which the government has portrayed as a three-day binge of womanizing and cocaine abuse, Barry said he spent nearly all his time working and in meetings. A sailing trip on the Caribbean, he said, brought little respite: He carried a briefcase full of memos to review.

Barry had little opportunity to reconcile his account with those of his accusers. Most of the witnesses against him had not come forward at the time of his grand jury testimony, and those who had done so had not made public their claims. Although Barry denied any drug use, he was not asked to confront specific evidence to the contrary.

The mayor's first account in his own words of the central issues of his trial will nevertheless probably be his last. All indications from those close to him are that Barry will not take the stand in his defense.

Assistant U.S. Attorney Richard W. Roberts, in his opening statement at the trial last week, referred to Barry's grand jury testimony when he said that jurors will hear that Barry "swears an oath to tell the truth, the whole truth and nothing but the truth, and he tells lies."

Barry's grand jury recordings followed several witnesses whose testimony often has been flatly at variance with Barry's.

Perjury is the only felony charged in the mayor's indictment, and the only charges he faces for which a prison term is unavoidable upon conviction.

Barry remained largely impassive as his amplified voice was broadcast from speakers and wireless headphones. In the jury box, the 12 jurors and six alternates followed suit, tracking what they heard against a transcript and giving scarcely a sign of their reactions.

"How are you enjoying the tape?" Barry asked reporters at the lunch-time break, beaming. Asked how the jury might respond to his account, the mayor replied only, "How do you think?"

Barry was the first to broach the subject of drugs in the grand jury excerpts made public yesterday.

Assistant U.S. Attorney Judith E. Retchin, who questioned Barry before the grand jury on Jan. 19, 1989, asked him whether Lewis had spoken at the Ramada "about any purchase he was thinking about making?"

Barry started and stopped his response four times. Finally, speaking of Lewis, Barry said:

"He said a friend of his was talking about a 'working fifty.' I said, 'What's that?' He didn't -- he didn't tell me what that was."

Retchin, who explained to the jury that a "working fifty" is a wholesale quantity of crack cocaine, was next heard on the tape asking 13 follow-up questions about Barry's understanding of the term.

Barry said variously that he did not know, that he thought it was a joke, and that he did not want to know what Lewis meant. Pressed further, Barry said it "might've been involved in some hot clothes or a woman or drugs, one of the three."

Finally, Retchin began an exchange that led directly to the first perjury charge of the mayor's indictment.

"Had you ever seen Mr. Lewis with anything that indicated he was involved with drugs of any sort?" she asked.

"No, I have not," Barry replied.

At times he answered rapidly and without ambiguity. At other times he paused at length, speaking haltingly and asking for clarification.

"What you mean by 'anything'?" he asked, responding to an inquiry about what he carried to Lewis's Ramada hotel room. "I've been around lawyers a long time, and I like to ask lawyers what they mean by certain questions."

At other times he joked with the grand jurors, who three times laughed at his jokes. "I've had affairs at his house," Barry said of James McWilliams, then added: "I've had political events at his house. Correct that very quickly."

Long portions of Barry's testimony centered on Dec. 22, 1988, the day that undercover D.C. police broke off a drug investigation of Lewis upon discovering that the mayor was in Lewis's hotel room.

Barry said he visited the Ramada twice that day. Responding to questions by Assistant U.S. Attorney Harry R. Benner, the mayor described a frenetic night of socializing and "damage control," in which he hopped from hotel to restaurant to private home, and did not retire until the early hours of the morning.

First he went to the J.W. Marriott hotel downtown for a visit with Doris Crenshaw. Next there came a foray to the Park Hyatt, where he dropped in on Willie Davis. Then the mayor said he went to Pardis restaurant in Georgetown, where owner Hassan Mohammadi invited him to his home.

Crenshaw is a former Barry girlfriend, and Davis is a friend of Barry's. They and Mohammadi have all been named by prosecutors as unindicted co-conspirators in Barry's alleged conspiracy to possess cocaine.

Barry testified that on that night he was "very upset" about forthcoming media reports. McWilliams -- then a friend, more recently a government witness -- was meanwhile calling repeatedly "to do some damage control," Barry testified. "He called me so many times I told him to stop calling me."

Barry himself was focusing his calls on the police department. In portions not played yesterday for the jury, Barry described "harsh words" for Isaac Fulwood Jr., then assistant police chief, when Fulwood did not return repeated calls. Barry said he also placed urgent calls to then-Chief Maurice T. Turner Jr. and other top police officials.

His object, he said, was to encourage them to "wrap this case up" while giving them "the widest possible range."