As many as 40,000 heart patients a year can be saved by two methods that were given approval yesterday by the Food and Drug Administration, according to Health and Human Services Secretary Margaret M. Heckler.

Heckler announced that the FDA has approved a new, implantable computer-and-shock device that can monitor a patient's heart activity and deliver life-giving electric shocks when the heart fails suddenly.

The device is an internal and automatic version of the electrical paddles used by emergency teams to restart failed hearts.

It is estimated that 10,000 to 20,000 lives could be saved from sudden heart arrest every year if the device were widely available and if the patients who need it could be identified.

In the second announcement, the FDA declared that another 10,000 to 20,000 deaths from heart disease may be prevented each year if heart patients take one aspirin a day. The agency endorsed the labeling of aspirin as a preventive treatment for heart disease.

Agency officials said the use of aspirin to prevent heart problems in people without heart disease is not proven, but in theory it could have a positive effect. A major study is under way to determine if an aspirin a day will provide more benefit or harm to healthy people.

The new implantable device is placed under the skin in the abdomen, and has wires running from it into the inside of the heart and to a paddle-patch that cups the bottom of the heart. Weighing about a pound and a half, it is about the size of a pack of cigarettes and is both a monitor of heart function and a computer that calculates when the heart's rate is so irregular that the situation is deadly. In that situation, the device delivers a strong electric jolt to the heart to erase the abnormal electrical signals the heart uses to pace its beating. Such a jolt, in many cases, will allow the heart to restart with a normal electrical pulse and beat.

The machine was created by Dr. Michel Mirowski and assistant Morton Mower in the basement of the Sinai Hospital in Baltimore during the past decade.

About 300,000 or more people die suddenly every year from heart failure, most from the failure of electrical rhythms in the heart. When the electrical pacing fails, the heart fibrillates or quivers rapidly without actually pumping.

Such a seizure can be expected in patients with certain arrhythmias and who have had past attacks. But it is impossible to predict when they will occur.

The battery-powered automatic defibrillator recognizes and analyzes the failure in about seven seconds and can deliver a jolt of hundreds of volts.

About 800 patients around the world have had the device implanted on an experimental basis so far, Mirowski said. Among those patients, the rate of heart failure and death expected annually is 30 to 40 percent. With the $15,000 device implanted, less than 2 percent per year are dying because of heart failure.

The use of aspirin as preventive therapy for heart patients has been debated for a decade, but studies over the years have been inconclusive when taken separately.

Now, two things have changed, according to Robert J. Temple, director of the FDA's office of drug research and review, and the FDA is willing to state plainly that aspirin may prevent death in some heart patients.

The first important step was a "well-controlled and convincing" study at the Veterans Administration Hospital of Kansas City of 1,200 men with heart disease, Temple said. The second major step was the conclusion of a team of statistical experts led by British epidemiologist Richard Peto of Oxford University. The group took six major studies on the subject, with 12,000 patients in all, and combined their results.