SAN FRANCISCO -- When the Digital Equipment Corp. entourage breezed away from Apple Computer Inc.'s MacWorld Expo in two stretch Cadillac limousines earlier this month, it presented a stark contrast to the T-shirt- and jeans-clad Apple Macintosh enthusiasts lined up outside the show -- a contrast reflected by Digital and Apple themselves.

Digital and Apple long have represented America's twin engineering cultures. Digital's home -- Rte. 128, the Boston area's high technology complex -- traditionally has offered a more cautious counterpoint to the wild-eyed visionaries of Silicon Valley, where Apple is based.

But Kenneth Olsen, the dour engineer who personifies the serious, scientific bent of Digital, had just joined John Sculley, Apple's chairman and consummate marketing man, at a news conference announcing a strategic alliance that is likely to strike directly where industry leader International Business Machines Corp. is most vulnerable.

The Digital-Apple marriage will use Apple's personal computers as desktop gateways to Digital's more powerful high-end processors. It is the strongest indication yet that the growing power of less expensive mini and personal computers presents an immediate challenge to the continued supremacy of room-sized mainframe computers. It is these multimillion-dollar machines, the lifeblood of all large corporations, that have given IBM its unparalleled control of the computer industry.

But now, as the explosion of desktop processing power in recent years has stalled IBM's three-decade record of impressive growth, upstarts like Digital and Apple, alone and in new alliances, are providing a serious challenge to IBM's supremacy in the computer industry. The new trend threatens to turn the computer world entirely upside down.

Apple and Digital aren't the only ones who are targeting Big Blue's grip on the corporate computing market. This month, American Telephone & Telegraph Co. and Silicon Valley computer work-station maker Sun Microsystems Inc. announced a technology-sharing agreement under which AT&T will acquire up to 20 percent of Sun during the next three years while the two companies develop powerful new computers.

The agreement calls for the two companies to develop computers based on AT&T's UNIX operating system and a supercharged microprocessor chip designed by Sun in an effort to create a new office and scientific engineering computing standard.

If the alliance with Sun proves successful, it will mean that after several years of stumbling, AT&T may be on the right track toward becoming a major player in the computer industry.

Until now, companies like Maynard, Mass.-based Digital, with $9 billion in sales, and Cupertino, Calif.-based Apple, with $2 billion in revenue, have not had the muscle to directly match IBM, with its $52 billion in annual sales.

The arrival of more powerful 32-bit microprocessors and computer networks -- which permit personal computers to break up large tasks into easily digestible chunks -- has changed all that.

Programs such as electronic mail and a new generation of software that is designed to permit corporate work groups to share data bases, graphics and documents, can function entirely without the intervention of larger mainframe computers.

As a result, the center of gravity in the computer industry is shifting.

IBM has had flat earnings since the end of 1985, and is losing the confidence of industry analysts. Even when the Armonk, N.Y.-based company announced a 50 percent fourth-quarter profit increase last week, Wall Street jeered: Analysts had expected the numbers to be even better. IBM stock plunged on the news.

The reason for IBM's problems, analysts say, is that the mainframe business, from which IBM draws most of its profits, is stagnating, while the minicomputer and microcomputer markets are more competitive and less profitable.

The technology challenge from Digital, Apple and others is forcing IBM to grapple with difficult choices. In the past, IBM has dominated computer markets through its unparalleled marketing, with a consistent emphasis on the importance of the mainframe. Now IBM is being forced to dig deeply into its substantial technology resources to maintain leadership. In doing so it is being forced to reconsider the primacy of the mainframe computer in its corporate strategy.

IBM's quandary is deepened by the fact that Digital and Apple are having their greatest success where the giant computer company has had the most difficulty in recent years: in connecting office computers to exchange electronic messages and share information as well as peripherals such as printers and disk drives.

IBM is backing its own communications system, called Systems Network Architecture, designed to allow all of its diverse computers to talk among each other. However, IBM's system has been slow in evolving, and is centered on the company's more expensive mainframe computers.

IBM's frustrations extend beyond hardware to software. IBM has stumbled in marketing an advanced operating system for its important new PS/2 computer line, which replaced the company's benchmark PC computers. Operating systems -- programs that handle a computer's basic housekeeping tasks -- are vital to extracting the full capability from any computer. But IBM did not ship the OS/2 system until early December, nearly eight months after the PS/2 was introduced.

And the late start has been compounded by the fact that the Presentation Manager component of the program -- needed to give IBM's machines the same ease-of-use now available from Apple's Macintosh -- won't be ready until the end of this year.

For its part, IBM says that its new line of personal computers has been well accepted -- in November, the computer maker said it had sold more than a million of the PS/2 machines. However, most of the sales have been of the low-end Model 30, a version of the new computer line that lacks many advanced features.

IBM spends more than $5 billion each year on research and development, and the company clearly has the technology resources to break with its reliance on the mainframe if it chooses. Company Chairman John Akers has apparently been listening closely to IBM engineers who run the company's advanced "skunk works" projects for superfast desktop computer work stations. Releasing such a machine, which has been rumored, could recast IBM's strategy overnight.