NEW YORK, AUG. 10 -- The Dow Jones industrial average fell 42 points in largely program-dominated trading today. In the process, the average erased the better part of its 48-point gain over the previous two sessions.

Visions of a prolonged stalemate between Iraqi ground forces and U.S. air and sea units around the Persian Gulf took its toll on investor psychology, keeping buyers at bay while index arbitrageurs flexed their muscles.

In the commodities markets, a rise in September crude oil futures and a surge in August gold futures exacerbated anxieties over the Middle East crisis and its potential effects on the U.S. economy and budget deficit.

A new tumble in the bond market, where the 30-year Treasury bond fell as much as 1 1/4 points before rebounding in late trading, only taunted the bulls further.

Technically today's action was hardly encouraging, traders said. On Wednesday and Thursday, the Dow had risen a cumulative 48.27 points, yet had only retraced 25 percent of its loss since the Iraqi invasion of Kuwait on Aug 2. Today, the combination of repeated index-arbitrage program trading and weak demand in the cash market sent the Dow to as much as a 54-point loss by early afternoon.

While premiums in key index futures progressively deteriorated throughout the morning, allowing program sellers to keep pressure on cash prices, few institutional investors were willing to bargain-hunt for fear of quick losses if the Middle East crisis worsens over the weekend.

Moreover, short-term traders, equally reluctant to hold stocks over the weekend, were preoccupied with squaring positions throughout the morning.

The predominantly program-driven decline stopped in its tracks, however, shortly after the Dow posted a 50-point loss at 1:38 p.m., when the New York Stock Exchange activated its program-trading curb. The Dow bottomed minutes later near the 2704 level, and a halfhearted rally trimmed some losses.

While traders and investors remained extremely nervous about the uncertain direction of developments on the Arabian Peninsula, market-watchers stressed that the general anxiety translated into a dearth of bidding, not a disposition to sell outright.

At the close, the Dow stood at 2716.58, down 42.33, while declines outpaced Big Board advances by a ratio of more than 2 to 1 on moderate volume of 146 million shares.

Among Dow components, full-point losses were widespread, encompassing such issues as Alcoa, Boeing, General Motors, International Paper, Merck and Woolworth. Chevron rose 1 1/8 to 78, Texaco gained 1/4 to 63 1/8, but Exxon slipped 1/4 to 51 5/8 as large integrated oil companies traded mostly, albeit narrowly, higher. The Dow transports tumbled 23.36 to 974.82, assisted by a 6 1/4 loss to 107 1/2 in UAL Corp. The utilities fell 1.39 to 203.09.

Among broad stock indexes, the Standard & Poor's 500 was down 4.42 at 335.52, the NYSE Composite down 2.09 at 184.15, the Value Line down 2.34 at 262.26, the Amex Market Value down 2.17 at 339.32 and the Nasdaq Composite down 4.94 at 408.04.