Exxon Corp. tried to make electronic typewriters, but all it seemed to come up with was red ink.

Atlantic Richfield Co. and Standard Oil Co. of Ohio went into mining and pulled a rock.

And after buying a department store, Mobil Corp. wished it had shopped elsewhere.

To use the industry's lingo, most of the attempts by oil companies to diversify out of the oil business have come up dry holes.

A decade after the industry, flush with cash from the first mushrooming of oil prices, began to diversify into other fields, most of the diversification efforts have been shut down, closed or put on the selling block. The oil companies have shifted their focus back to the oilfields, which is just as well, analysts say, because for all the attempts at diversification, the oil industry never found anything quite so profitable as oil itself.

Last week, Exxon said it was attempting to sell its electronic office equipment business, into which the company has poured more than $1 billion without significantly denting the market dominated by International Business Machines Corp., Xerox Corp. and other giants. A company source said Exxon may be forced to shut down the 2,300-employe division and take several hundred million dollars in write-offs.

Exxon's announcement came on the heels of Ashland Oil Inc.'s write-off of $270 million to cover the sale of an insurance subsidiary and Atlantic Richfield's $785 million write-off and sale of most of it metals and minerals operations, both this year. Other oil companies have similarly bailed out of frustrating investments in other businesses in recent years.

Meanwhile, Occidental Petroleum Corp. reportedly is trying to sell its Iowa Beef meatpacking division, Mobil is said to be looking for a buyer for its perpetually struggling Montgomery Ward retailing operation, and the future of Exxon's Reliance Electric business -- purchased five years ago to make a motor-control device that never materialized -- is considered clouded.

In each case, the cash-laden oil companies, worried about what happens when the oil runs out, plunged into new lines of business -- and got their heads handed to them.

"There have been a significant number of mistakes. There's no question about it," said Barry C. Good, an oil-industry analyst at Morgan Stanley.

The reasons for the oil industry to diversify are many, often quite sound. With oil supplies ultimately finite, the oil companies wanted to move into new businesses that would sustain them when the oil began to dry up. "The notion behind these acquisitions had merit, and that is that these are going concerns, with very long-lived outlooks, and they could see that the oil business itself is finite," says Sanford Margoshes, an analyst at Shearson Lehman American Express. "If you want to be ongoing, you have to move beyond a pure extractive industry where the economic resources are limited."

There was further incentive in the 1970s, when oil-industry regulation frustrated a lot of investment in the oil business and led oil executives to look outside the industry to spend their increasing hoards of money. To some extent, all that money was burning a hole in the industry's pocket. "I think the diversification was a luxury, a kind of sidetracking of the industry that came out of too much cash flow," says First Boston analyst William Randol. "They had too much earnings and cash flow, and they did some silly things with it."

Oil industry diversification had begun decades ago, when many companies logically spun petrochemical divisions out of their basic oil and gas business.

So far, so good. But the companies then tried to move into other fields: first, nuclear fuel -- a market that quickly dried up; then minerals and metals -- whose prices seemed to plateau and then fall as soon as the oil barons bought in; and then nonrelated businesses -- which brought both failure and public criticism that the companies weren't paying enough attention to the nation's energy needs. Probably the most notorious diversification attempt was Gulf Oil's unsuccessful pass at Ringling Bros. Barnum & Bailey Circus in the early 1970s.

At least the circus would have been more fun to watch than a lot of what the companies did buy. Anaconda lost nearly $800 million in the last four years under Arco's stewardship. Kennecott has lost about $400 million since Sohio bought it in 1980. Mobil has had to pump more than $1 billion into Montgomery Ward. And Exxon, which will lose more than $70 million this year on its office-systems operations, one year saw the division lose almost every penny of its nearly $200 million in revenue.

Just where the companies went wrong is the subject of a good deal of conjecture on Wall Street and in oil company headquarters. After all, companies in other industries have diversified without falling on their faces. But Big Oil, seemingly so omnipotent in many other things, can't seem to get the knack.

Analysts say oil-company management skills don't seem to transfer well to other industries, particularly those as far afield as retailing and high technology. "I think the experience of the oil industry calls into question the transferability of management skills to areas outside one's normal expertise," Margoshes says.

Many of the problems with Mobil's investment in Montgomery Ward and Exxon's office systems venture, for instance, are laid by analysts to the oil companies' inexperience in pure consumer marketing. Arguments that an ability to sell gasoline will help you sell anything don't hold much water with analysts, who point out that because integrated oil companies traditionally made their profits lifting crude oil from the ground, there was no incentive to make money at the pump, so that most gasoline retailing operations were run at a loss by the major oil companies.

But oil companies customarily have been run by engineers rather than marketing types, anyway. So surely oil executives should have some sort of a feel for technology businesses.

Not necessarily. The kind of technologies most oil executives are comfortable with are the kinds that are slow to develop. An oil company's investment in new technology in oil-drilling or in refining usually takes several years to implement and produce results. In the kind of high-technology electronics businesses Exxon dabbled in, by contrast, the technology equation could change radically in a matter of months.

Even in resources industries such as mining, which seem analogous to exploring for, producing and refining oil, the oil companies seem to have had problems, often because they overestimated the market they were entering.

Many of the industry's problems with diversification can be attributed to other poor choices. Exxon, for instance, jumped the gun on development of its motor control device, paying $1.2 billion -- twice book value -- for Reliance Electric only to discover the Reliance motor control wasn't commercially viable. And Mobil bought Montgomery Ward just as the retailing business went sour.

"I think these guys have a lot of cash lying around, and they are doing things that less affluent companies would not do," says Rosario Ilacqua, an analyst at L. F. Rothschild. "They've got bigger bundles, so they're pulling bigger boners."

For the most part, the diversification wave of the 1970s ended with the turn of the decade, as it became clear just how big some boners were. The result has been the string of write-offs and "For Sale" signs posted around the industry. "I think they're all getting religion," Ilacqua says. Similarly, Good says: "There's a great deal more sober point of view in the industry today."

Part of that is because the huge profits in the oil business, which seemed like they would go on forever, have disappeared, at least temporarily. Now, the softening of the worldwide oil market is forcing the oil companies to rededicate themselves to squeezing profit out of their basic business. This factor is causing the companies to cut back more than just nonoil operations: Texaco last week announced a $750 million write-off on discontinued parts of its oil business, and Chevron Corp. said it may have to terminate 10,000 jobs to return to efficiency in the wake of its merger with Gulf Corp.

"The oil business itself doesn't look that great," Randol says. "My feeling is that companies like Exxon and Texaco are kind of cleaning house for what could be a rocky couple of years here."

But as the companies retrench from their diversification fiascos, many of the factors that encouraged diversification in the first place continue to exist in one form or another -- particularly the companies' need to deal with the day the oil runs out.

As a result, many analysts believe the oil giants will someday move again to diversify, albeit into fields closer to home. Although some companies have dropped attempts to move into such areas as synthetic fuels and nuclear power, these areas and others will likely be major energy sources of the future. Some companies, notably Standard Oil Co. of Indiana, have stayed clear of diversification into nonenergy fields while pouring money into alternative energy forms, and most companies, even with the current belt-tightening, have interests in one form of alternative energy technology or another.

"Perhaps the companies are, in effect, sort of trimming themselves down and sort of reassessing their role, and we'll see some more efforts in energy -- in conventional energy and in some of the substitute energy resources," Margoshes says. "That is what they're good at, and there's nobody better at it."