Sol Z. Rosen, the lawyer for accused murderer Bernard C. Welch, has agreed to a highly unusual arrangement that will permit him to take his legal fees out of the potential proceeds of a book contract that Welch has worked out with a New York writer, according to Welch and an informed source.

Welch, who goes on trial Wednesday in D.C. Superior Court for allegedly murdering cardiologist Michael Halberstam outside the physician's Northwest Washington home, disclosed Rosen's financial arrangement in an interview with The Washington Post last week.

The arrangement might violate the Code of Professional Responsibility, the disciplinary rules that lawyers in Washington must follow. D.C. Bar Counsel Fred Grabowsky said yesterday that his office has begun an investigation into the matter.

Rosen, 45, a tough-talking, Brooklyn-born attorney who has persistently complained about prejudicial pretrial publicity, declined to comment yesterday on the fee arrangement. "Frankly, I'm surprised Welch talked to them [The Post]," Rosen said of the interview that led to disclosure of the arrangement.

"It was without my consent or my knowledge. Frankly, I'm surprised." Thursday's interview with The Post was one of four Welch has granted since his arrest in December, including one to Life magazine that involved payment of $8,000 for pictures used with the story.

The book arrangement was first disclosed in press accounts last week. Martin Firestone, a Washington lawyer who is representing Welch's literary interests, negotiated the literary rights to Welch's story with New York writer Paul Sann.

The Internal Revenue Service has already filed $24 million in tax liens against Welch, and would undoubtedly claim the right to any future income he receives. Therefore, any proceeds generated by sales of the book will be paid to a trust fund set up for Welch's children, if not claimed by the IRS.

Another beneficiary of the arrangement, however, is Rosen, who will receive what one source described as an amount that would not exceed an agreed upon "five-figure" legal fee from the book proceeds.

Canon 5 of the lawyers' Code of Professional Responsibility, however, states in part that: "Prior to conclusion of all aspects of the matter giving rise to his employment, a lawyer shall not enter into any arrangement or understanding with a client or a prospective client by which he acquires an interest in publication rights with respect to the subject matter of his employment or proposed employment."

"A lawyer is required to represent his client zealously, to do the very best he can without any other interest affecting the lawyer's judgment," said one lawyer familiar with the disciplinary rules. The source said that the arrangement involving Rosen might lead to a perception that the lawyer's interest in selling books might color his perforamnce at the trial.

The announcement of the Welch book and his interview with The Post came the same week he gave an interview to the Associated Press.

During his two-hour interview with The Post, Welch denied that he as involved in the Dec. 5 Halberstam shooting or any of the burglaries for which he was charged in the District.

He complained of prison conditions, and said that he had been singled out for abusive treatment by some D.C. jail officials. He also claimed that adverse pretrial publicity would make his trial a farce.

"They [the press] have already found me guilty," Welch said. "I just don't believe I'll ever get a fair trial in the Washington area."

Welch said that he will not change his not guilty plea to an insanity plea, and has no intention of pleading guilty. "I'm going to trial. This is not my crime." He said he would like to testify at his trial but will not do so because his prior criminal record would come out.

Welch said that he shaved his head and face before a police lineup because he had dandruff, and not because he intended to thwart police.

Welch, who has been accused of hundreds of area burglaries, said he had followed a life of crime because it is a "form of excitement," and suggested that if he is sent back to jail after the Halberstam trial, he will "educate" other prisoners.

"Prison made me," said Welch. "When I was in there I furthered my education. If they send me to prison you can believe that I'll school everybody I can so they will do better when they get out."