NEW YORK -- U.S. stocks rose yesterday, led by Exxon Corp. and Texaco Inc. as heightened tension in the Middle East drove up crude prices.

The 30-stock Dow Jones industrial average came within 11 points of its all-time high of 5,778 but closed at 5,754.92, up 27.74. The energy-laden Dow average, which includes four oil-related companies, is up 12.5 percent this year, far better than the Standard & Poor's 500 index's 8.3 percent increase.

The Russell 2,000 index of small capitalization stocks rose 0.42 to 336.70; the Wilshire 5,000 index, comprising stocks on the New York, American and Nasdaq exchanges, gained 26.02 to 6,548.13; the American Stock Exchange market value index added 0.83 to 566.06; and the S&P midcap index increased 1.20 to 233.86.

About 377 million shares changed hands on the New York Stock Exchange. Advancing shares and declining shares were again closely matched. Those rising totaled 1,268, while 1,052 fell.

Oil-related stocks, which accounted for 16 points of yesterday's rise in the Dow industrials, rose as investors anticipated higher crude prices would translate into profit gains.

Texaco gained $1.875 to $94.625, a record. Chevron Corp. climbed $1.125 to $61.50; Exxon rose $1.50 to $84.875; and DuPont Co. rose 87.5 cents to $85.125. Chemical maker DuPont garnered more than two-fifths of its 1995 revenue from energy exploration and refining at its Conoco unit.

Crude oil contracts traded in New York for October delivery rose to $24.75 a barrel, up 63 cents. Among oil drillers who could benefit. Reading & Bates Corp. jumped $1.25 to $26.75; Global Marine Inc. climbed 62.5 cents to $16.125; and oil-service provider Halliburton Co. sprinted $1.50 to $55.875.

Motorola Inc. sank $1.50 to $49.25 after warning that slow chip sales and a price slump could result in disappointing earnings for a second straight quarter.

Lehman Brothers analyst Todd Koffman said Motorola's earnings would fall 25 percent below the average estimate of 55 cents a share for the current quarter. He cut his third-quarter profit forecast to 35 cents a share from 53 cents, and his full-year estimate to $2 from $2.45.

Other chip shares shrugged off Motorola's woes, focusing instead on a report on semiconductor sales released late yesterday suggesting that orders rebounded in August.

The book-to-bill ratio, which measures new orders for chips in North America against deliveries, rose to 0.90 percent from 0.86. A reading of 0.90 means that for every $100 of chips shipped, companies received $90 of orders.

Itron Inc. slumped $8 to $21 after it surprised investors by saying it expects to report a loss in the third quarter because utilities are ordering fewer electronic meter readers. Itron also said new-product development costs ate into profits.

Unilever NV rose $1.75 to $152.125 amid expectations that the company's new chairman will overhaul the company.