It became a question of evil versus insanity, control versus compulsion Thursday as the first day of testimony began in the trial of Jeffrey Lionel Dahmer.

Dahmer`s lawyer, Gerald Boyle, said his client has been obsessed since age 14 by homosexual fantasies, curiosity about the internal organs and skeletal structures of animals, and a desire to have sex with a corpse.

The last, a mental disorder called necrophilia, was what drove Dahmer in the murder-dismemberment of 15 young men and boys in Milwaukee since 1988, Boyle said.

''His method of operation was to find a person who best fit his desire for body,'' Boyle said, emphasizing the last word. ''Whoever fit that description . . . was in harm`s way . . . if he could persuade that person to come back with him.''

Boyle revealed that Dahmer, in his desire for an inanimate body, once stole a male mannequin from a Milwaukee department store and, on another occasion, tried to retrieve a freshly buried body from a cemetery.

Dahmer, in displaying a growing tendency to retain skulls, heads and other body parts-some of which he would use as visual stimulation for sexual gratification-was building a shrine to himself, Boyle said. He was ''taking his victims from life to death, and then taking them back to his life''

through necrophilia.

A police detective who testified for the defense said Dahmer also engaged in cannibalism in at least one instance.

But prosecutor E. Michael McCann presented jurors with a picture of Dahmer as less interested in dead bodies than in total control.

''His first choice is a live body-he wants a totally compliant human being,'' McCann said. To achieve this, Dahmer lied to doctors to get prescriptions for Halcion, a popular sleeping sedative he would grind up and put in his victims` drinks.

McCann told jurors Dahmer enjoyed putting his ear to the chest or back of his drugged victims and listening to their hearts. He quoted from an interview with Dahmer by a prosecution psychiatrist: ''My consuming lust was to experience their bodies. I viewed them as objects, as strangers. If I knew them, I could not have done it.''

A lobotomy-like experiment that McCann said Dahmer tried on 14-year-old Konerak Sinthasomphone late last May illustrates his need for control. ''He wanted to keep them about as sex slaves,'' McCann added. Dahmer reportedly drilled holes in the heads of several victims and poured in fluids in an attempt to deaden a portion of their brains and render them compliant.

McCann said Dahmer managed to make it through six months of college and three years in the Army without killing anyone, even though he was surrounded by men his age.

''This is control. If he was out of control, there would be assaults,''

the prosecutor said.

The issue of control is central to the proceeding. For Dahmer to be found insane-Boyle`s goal-he must be found unable to appreciate the wrongfulness of his acts, and/or unable to conform to the requirements of the law-that is, to be out of control.

McCann sought to drive home his point by telling jurors that Dahmer never picked up anyone who had a car-abandoned cars draw police curiosity. Also, he killed only on weekends, McCann said, to allow him time to get rid of unwanted body parts before reporting to work Mondays at the Ambrosia Chocolate Co.

The prosecutor gave a chronology of Dahmer`s life from 1990 to 1991, which included seeing mental health specialists in between drugging and killing victims.

''Here is an opportunity to get help,'' McCann said of the counseling and group therapy sessions. ''He is totally uncooperative.''

Two Chicagoans became Dahmer`s victims last summer: Jeremiah Weinberger, 23, who disappeared July 6, 1991, and Matt Turner, 20 (also known as Donald Montrell), who disappeared June 30. He met Weinberger at Carol`s Speakeasy on Wells Street and Turner at the downtown Greyhound bus station.

Boyle said Dahmer identified with the all-controlling emperor figure in

''Return of the Jedi.'' He even went so far as to get yellow contact lenses, so his eyes would look like the emperor`s, said Boyle, who added that his client was also struck by the depiction of Satan in ''The Exorcist,'' but a short time later he discarded Satanism and the occult.