Strength in the dollar balanced Wall Street worries about the Iranian situation today as the stock market ended a three-day slide with a mixed performance.

"The bulls would say that's not a bad performance," said Larry Wachtel, an analyst at Bache Halsey Stuart Shields. "The bears would say the jury's still out, you're still unsure about the Iranian situation, there are still some travails ahead."

The dollar posted a good showing on foreign exchanges at home and abroad Wednesday, setting highs for the year against many currencies and surviving even the selloff by some central banks of the large quantities of dollars they bought last year in attempts to shore up the beleaguered currency.

The dollar's rise offset the return to Iran of opposition religious leader Ayatullah Rumollah Khomeini, who came back from a 15-year exile to enthusiastic rallies.

But his presence leaves experts with mixed feelings about Iran's future because of the possibility of civil war over Khomeini's role in the strifetorn nation and his anti-American stance. The recent political disputes in Iran have cut off the nation's production of crude oil, leading to warnings of possible rationing of oil and gasoline in the United States this spring.

The Dow Jones average meandered for much of the day on the conflicting news, finishing with a 1.65-point rise to 840.87. It had lost nearly 20 points in the previous three session.

But losers led gainers 7-6 on the New York Stock Exchange, where the composite index of more than 1,500 common stocks rose.01 to 56.00. Standard & Poor's index of 400 industrial issues gained.08 to 111.40, and the S&P 500-stock composite rose.03 to 99.96.

Volume on the NYSE was a moderate 27.93 million shares against 30.33 million in the previous session.

Nationwide turnover in NYSE-listed issues, including trades in those stocks on regional exchanges and in the over-the-counter market, came to 31.58 million shares.

The most active issue was McGraw-Hill, up 1 1/8 to 29. The company has spurned a $40-a-share merger with American Express Co., an action which cost the stock 3 7/8 points in trading after the NYSE close Wednesday. American Express, which left the offer open, rose 1/4 to 29 3/4.

Carrier Corp., also active, rose 3/8 to 27 1/4. A court ruling allowed United Technologies to resume purchases of Carrier Stock.

White Consolidated Industries rose 2 1/8 to 21 3/4. It agreed to buy General Motors' Frigidaire division, which would make White Consolidated the third largest U.S. appliance maker. GM rose 1/8 to 56 1/2.

Jos. Schlitz Brewing rose 1 1/2 to 12 3/8 after announcing plans to test-market a new premium beer.

Earnings news also had its effect on stock prices. General Dynamics rose 2 1/4 to 86 1/4 and Scott Paper went up 1/4 to 17 1/4 on good earnings reports; KLM Royal Dutch Airlines fell 3 to 54 1/2 on poor earnings news.

At the American Stock Exchange the market value index fell.46 to 158.78. The NASDAQ composite index of over-the-counter issues fell.06 to 125.76.