Convicted spy Christopher J. Boyce was tentatively sentenced yesterday to six years in prison and ordered to undergo a 90-day diagnostic study before final sentencing.

U.S. District Court Judge Robert J. Kelleher, saying that Boyce had presented himself "in a posture of total puzzlement," urged that the best federal facilities available be used to study Boyce's mental state.

The judge did not mention the six-year sentence in court but merely committed Boyce to the 90-day study under the same provision of the Young Adult Offenders Act. A tentative sentence is required for such a study to begin.

Boyce stood before the judge and made an emotional, sometimes tearful speech explaining how his disenchantment with the government led him to become a spy. He said he hoped that someday he could return to a useful role in society.

Sentencing was rescheduled for Sept. 12.

Attorneys for Boyce, 24, and codefendant Andrew Daulton, Lee, 25, were expected to argue for new trials. Boyce's grounds were that his confession to FBI agents was coerced.

Boyce, a documents clerk with a top-secret clearance at TRW Systems Inc., testified that he was blackmailed by Lee into stealing secrets for the Soviets. The government said the two received $70,000 for the documents.

Lee never testified, but his lawyers sought to prove that he thought he was working for the Central Intelligence Agency when he passed classified information to the Soviets.