Just what did President Truman know when he ordered the nuclear bomb dropped on Hiroshima?

What picture of Japan's invasion defense plans did he possess that made him sure a demonstration bomb would do no good? How much did he know about Russia's intentions?

The answers to these and the other great questions of World War II are literally being handed to us day by day in huge batches of code messages being declassified by the Pentagon.

"If I were writing a PhD, I'd rush over to Archives this minute," says Ronald Lewin, a British author whose book, "The American Magic," about how America broke the Japanese military and diplomatic codes, will appear in this country next February.

Lewin, who already has written "Ultra Goes to War," about Britain's cracking of Germany's vaunted Enigma cipher, is in town specifically to check out the new outpouring of decoded messages -- 40,000 in the last batch alone.

"Do you understand that the Americans had been reading the Japanese ciphers since 1921? That they had broken the Red system and used that knowledge to break the newer Purple system? That they were reading Purple consistently from early 1941 on through the war?" he asked.

Maybe it didn't actually win the war for us, he added, "but it certainly shortened it astronomically. Furthermore, the messages from all the Japanese embassies to Tokyo were being read, and these included vast amounts of information about the German plans."

In 1944, for instance, the Japanese were desperate to get some jet fighters, then being used experimentally by the Germans. The correspondence on that subject went straight to the Allies. And in the Pacific, it wasn't only at Midway that the United States benefited from knowing the Japanese naval code system JN25, but in all the battles, from Coral Sea to Leyte Gulf to the Marianas Turkey Shoot.

"Of course, every time the ciphers were changed they had to be rebroken," said Lewin. "Eventually the Americans got so good at this that they could anticipate the change when it came. But there were periods when you didn't have it: during the Guadalcanal invasion, for example, and through most of the Solomons operation. The Japanese army code wasn't broken until 1943."

The real story of ciphers is nothing at all like the romantic dramas presented in many recent books, says the 66-year-old BBC editor and writer. It is not a matter of one brilliant mind suddenly untangling a jumble of letters. The job takes many specially talented minds concentrating for weeks and months on tiny shifts in letter patterns, progressing in millimeters, then beginning all over again when the cipher is changed.

"Figuring out the settings of these cipher machines is what's really hard," Lewin notes, for the machines run each letter through a maze of alphabet wheels, and when, with each resetting, the wheels are shifted, the whole cipher changes. "Sometimes when a U-boat went out it carried advance settings for its machines, since it would be out of radio contact. When we captured one of these in '41, it enabled us to break the German naval code."

But breaking the code is only the first step, Lewin emphasizes: The message needs to be interpreted. In 1942 the Americans knew the Japanese were launching a huge attack, including an invasion force, at a target known only as "AF." Suspecting "AF" might be Midway Island, the Americans sent out a false message, in clear, that Midway's fresh-water plant had broken down. Two days later, the Americans' Magic machine decoded a report on the Purple network that "AF" was short of fresh water.

"The real tragedy of Pearl Harbor," says Lewin, "was that the Americans had the information about the attack but didn't know how to interpret it. Later, you developed a good method for this based on the British techniques. Remember, nothing in this game is simple. Purple was not one single code but a whole system of them."

He himself has been digging into codes for two years to write his new book. What he is finding in the flood of new material "makes all the war histories out of date." In 1945, for instance, Truman knew from decoded messages that Japan had massed a 2 million-man army to defend the mainland, that the peace party had been pushed into the background, that Soviet Russia couldn't be counted on.

Lewin has the messages reflecting this information. He also has the actual signal that gave away the flight plan for Adm. Yamamoto, which enabled our fliers to ambush him, thus eliminating Japan's most able strategist.

By the way: As an experienced researcher and writer of books on Rommel, Montgomery, Churchill, Slim, Wavell and others -- he served as an artilleryman throughout the war in North Africa and Europe -- Lewin was appalled at the working conditions in our Archives, whence so much priceless living history is issuing these days. He is astonished, he says, that America's archivists are able to work as well as they do in such cramped, tumbledown surroundings.

"The people are marvelous," he says. "The conditions are disgraceful."