MAPUTO, Mozambique (AP) _ Parliament on Saturday passed a law granting amnesty to all rebels who surrender to authorities or international organizations by the end of 1988, the national AIM news agency reported.

The People's Assembly also approved a 1988 national budget with a projected deficit of $80 million and a program that includes a reduction in government subsidies for key foodstuffs.

The amnesty law is aimed at members of the Mozambique National Resistance, who have been fighting for 10 years to overthrow the Marxist government that took power after independence from Portugal in 1975.

The preamble to the amnesty law says many Mozambicans have been kidnapped or forcibly trained by the guerrillas and transformed ''against their will, into murderers,'' AIM said.

''We must not only show mercy to those who wish to rejoin society, we must also fight relentlessly against those who do not,'' President Joaquim Chissano said Thursday in proposing the new law.

Mozambique accuses South Africa of supplying, arming and training the guerrillas.

In a late-night session Friday, Prime Minister Mario Machungo presented the 1988 budget, which envisions a 6 percent growth in the gross national product and payment of at least 119 percent of export earnings to service foreign debt.

Mozambique, hit by drought and ravaged by war, has become increasingly dependent on international aid in the past few years.

The government twice this year devalued its currency, the metical, and imposed a series of price increases, contributing to an inflation rate of 166 percent for the year.

Machungo predicted inflation would not be that high in 1988, but gave no estimate.

He said priorities for 1988 would include supplying consumer goods to rural areas and restoring the rural trading network he said has been damaged by an exodus of Portuguese shopkeepers and the destruction of 4,000 shops by the guerrillas.

Machungo said the government would also reduce food subsidies - particularly for corn and rice - for which the government pays more than the consumer, and would strictly limit wage increases for state workers.

The national budget calls for 1988 expenditures of $342.5 million and receipts of $262.5 million. The deficit is to be covered by bank loans.

Education and health account for 14.6 percent of the expenditures, government structures 13.7 percent, subsidies 6.5 percent, debt servicing 23.4 percent, and the remaining 41.8 percent for everything else, including defense.

Machungo said paying interest on debts in 1988 will cost Mozambique as much as $175 million. Mozambique's 1988 exports are projected to earn $105 million, AIM reported.

The People's Assembly was elected this year in open village meetings throughout most of the country.