Patients with CD4 counts greater than or equal to 500 cells/mm3 are randomized to receive HIV-1 MN rgp160 (Immuno-AG) or control. Patients with CD4 counts 50-499 cells/mm3 receive didanosine (ddI) and are then randomized to receive ddI plus vaccine or control. Vaccine or control is given every 4 weeks for 7 injections, then every 8 weeks for 6-12 months or until 1 year after the last patient is randomized. AS PER AMENDMENT 11/12/96: Stratum 1 is composed of 16 subjects with CD4+ T cells greater than or equal to 500 mm3. These subjects are randomized to vaccine therapy or vaccine control. HIV-1 MN rgp160 vaccine or control is given every 4 weeks for 7 injections (Schedule 1), then every 8 weeks until 52 weeks after the last subject has been randomized to stratum 1 (Schedule 2). Stratum 1 patients receive ddI or d4T only if their CD4 cell count has a sustained decrease on 2 consecutive occasions 10-14 days apart and/or HIV/RNA plasma viral load increases to greater than 10,000 copies/ml on 2 consecutive occasions 10-14 days apart. Stratum 2 is composed of 30 subjects with CD4+ T cells 200-400/mm3; accrual to this stratum was activated based on preliminary results from stratum 1 (closed as of 4/5/97). Patients on stratum 2 (open as of 3/4/97) initially receive ritonavir at escalating doses for 2 weeks. Subjects then have ddI and d4T added to the regimen for 7 weeks. Subjects are then randomized to vaccine therapy or vaccine control every 4 weeks for 7 injections, with ritonavir/ddI/d4T continued during vaccine therapy.