If Charles Dickens had chronicled the tale of two industries -- computers and semiconductors -- this past year, he might have written, "It was the worst of times, it was the worst of times."

Bankruptcies, layoffs, shutdowns and torrents of red ink mingling with broken expectations turned 1985 into a year that left those industries with no place to go but up.

And that is what most analysts are forecasting for 1986.

Indeed, some of the prognostication is downright bullish.

To the astonishment of many of its members who have suffered through the worst year in their history, the Semiconductor Industry Association forecast an 18 percent growth rate this year in the $20 billion business. Semiconducters are the silicon chips that store and manipulate computer data.

That prediction sparked derisive laughter at an SIA meeting this past winter. Most semiconductor firms count on a far more modest 10 percent growth rate this year, trusting that expenditures for computers and electronic equipment will outpace the 1985 level significantly.

In one effort to relieve their problems, U.S. companies last year filed a formal complaint charging their Japanese competition with unfair trade practices such as dumping, or selling their products here below costs to capture markets. The International Trade Commission has made a preliminary finding that there is cause to question the pricing practices of Japanese semiconductor manufacturers, and the Commerce Department recently launched an investigation of Japanese companies in the multibillion dollar memory chip market. The outcome of these industry and government initiated investigations could help shape the fortune of the U.S. industry.

In computers, everyone is watching IBM, itself coming off a very disappointing year. Earnings were flat or down in each of the first three quarters of the year. IBM's new chairman, John Akers, is counting on a big fourth quarter to salvage 1985 as a year of overall profit growth for the $50 billion a year computer giant.

Key to IBM's ambitions is its new "Sierra" 3090 mainframe computer, which it began shipping in the last quarter of 1985 -- three months earlier than originally expected. Some analysts said the move was done to boost the year's earnings.

This year, IBM is expected to ship an enhanced version of its basic Sierra plus another successor to its workhorse 308X line. Mainframe computers are the company's most profitable products. Some analysts argue, in fact, that IBM's disappointing growth was due less to soggy economic conditions than to the company's transition from one set of mainframes to another.

"The key for IBM is that this will be a good year for mainframes," said Francis R. Gens, an analyst with International Data Corp. "It's going to be a bull year for them. I don't think the rest of the industry is going to have as big a bounceback as IBM."

Based on user surveys, IDC sees data processing expenditures growing a relatively modest 8 percent to 10 percent -- barely half the industry's historic growth rate.

In many respects, assert Gens and other analysts, this year will be one of transition as customers decide what mix of data processing technologies -- mainframes, superminis, minis, local area networks, personal computers -- is best suited to their needs.

A topic of major concern to the industry this year is whether the traditional price drops for computer hardware will be enough to continue driving growth -- or whether marketing, software and applications efforts have to be more innovative and useful to create new growth.

Minicomputer and superminicomputer companies, that serve customers who don't need traditional big mainframe computers, are particularly concerned because their segment of the market has become increasingly competitive. New venture funded companies such as Alliant and Encore offer new computer designs to compete with established minicomputer industry giants like Digital Equipment Corp. and Data General -- consequently many analysts predict a shakeout.