President Carter assured Panamanian President Aristides Royo yesterday that the administration will fight attempts in Congress to change the provisions of the Panama Canal treaties in ways unacceptable to Panama.

The two leaders met at the White House to discuss an impending vote by the House on legislation to implement treaty provisions for transferring the canal to Panamanian control.

Opponents of the arrangement already have succeeded in modifying the legislation to retain greater U.S. control over the canal, and even that substantially amended bill faces a close vote in the House. That has caused Royo and other Panamanian leaders to warn of possible serious consequences if Congress violates "the spirit" of the canal treaties.

Before yesterday's meeting, Carter told reporters he is determined to ensure that any legislation is "compatible with the letter and spirit of the treaties." Following their hour-long talk, the two leaders issued a joint statement that used adjectives lavishly in an effort to underscore the "atmosphere of sincere and cordial friendship" between the two countries.

The most important passage said the two had "pledged their best efforts to ensure that both nations carry out the treaties, faithfully respecting both their letter and spirit."

However, the administration's attempt to move forward with the controversial treaties, which were approved by a single vote in the Senate last year, has run into a new wave of anti-Panama congressional sentiment. In addition to its wholesale amending of the canal legislation, the House has voted by lopsided margins to cut $11.5 million in economic aid and $2.5 million in military assistance for Panama.

That prompted Royo to come here for two days of talks with Carter, Secretary of State Cyrus R. Vance and congressional leaders. His message, unveiled in a speech Wednesday night before the Organization of American States, was to warn that Panama "will not allow [the treaties] to become embroiled in conflict or controversy."

The administration also has mounted a determined lobbying effort to influence congressional opinion in favor of the implementing legislation. Carter had approximately 400 members of the House at the White House Tuesday night for dinner and a hard-sell appeal for support.

In addition, White House and State Department officials have targeted from 150 to 200 members and their key staffers for detailed briefings and lobbying on the canal issue. Carter and Vance also have met with key House leaders in an effort to convince them that legislation acceptable to Panama is necessary for continued trouble-free operation of the canal and good relations with Latin America. CAPTION: Picture, Panamanian President Royo with President Carter. UPI