Two Greek Cypriots convicted of reduced charges growing out of the 1974 assassination of U.S. Ambassador Rodger Davies were given unexpectedly stiff sentences today of seven and five years.

The sentences - considered harsh for the reduced charges - indicated that the government of President Archbishop Makarios agreed with the U.S. position, pressed by both the Ford and the Carter administrations, that the trial should serve as an example to discourage future terrorist attacks against American diplomats.

Charges of murder against the two men were dismissed June 3, but Cypriot officials predicted that the court would impose stiff sentences for the lesser charge of violating laws covering the use of firearms.

The harsh sentences would be a sign, the sources said, that President makarios' government does not condone anti-American terrorism and wants to cooperate with Washington over the future of the Mediterranean island.

Ambassador Davies and an embassy secretary were killed by gunfire during a demonstration by Greek Cypriots protesting the failure of the United States to thwart a Turkish invasion of the island.

That invasion followed the ouster of President Makarios by rightist Greek. Cypriots supported by the military dictatorship then in power in Greece. The ultimate objective of the coup was said to be the union of Cyprus and Greece. The Turks said the invasion was launched to protect the welfare of the Turkish Cypriots on the ethnically divided island.

The two men sentenced today, Ioannis Ktimitis, 39, an Neopotolomous Leftis, 50, were among the score of armed men who apparently infiltrated the demonstration. The court said one of them belonged to the group that opened fire on the American embassy.

U.S. officials conducted their own investigation of the killing, and it convinced them that the convicted men played a role in the assault on the embassy.

Condemning the men's participation "in a riot that took the form of an attack" against the embassy, the three men court called this a "very serious offense." It added that it was especially abhorrent in Cyprus in view of the role violence played in the coup against Makarios and the ensuing Turkish invasion.

Today's stiff sentences, like the imprisonment of Nicos Sampson - leader of the extreme rightist EOKA-B group that led the coup - and the start today of the trial of Sampson's chief aide, are interpreted as a signal that the government intends to crack down on illegal violence, especially that carried out by rightist groups.

Rightists apparently feel threatened by the greater voting strength of the left.

Although both defendants denied that they belong to the EOKA-B underground, they shouted "Long live enosis " as they were led away by police. Enosis - the union of Greece and Cyprus - is the motto of EOKA-B.

In a note scribbled in English and handed to reporters after the sentencing, the convicted men said they had always been pro-American. (Leftist claims he served as a U.S. Marine in World War II.) They said that they were being made "scapegoats."

The two have claimed that they have been victimized because the government wants to convict rightists for political reasons but is unwilling to move against more important figures.