MARRAKESH, Morocco (AP) _ Shaun Mellors collapsed on the job at a Cape Town hotel and was taken to a hospital. After a cursory examination, a doctor told him, ''You have AIDS and you have six months to live.''

The doctor was wrong, on both counts. While Mellors did have HIV, seven years later he has not developed AIDS.

Today, Mellors strives to teach black South Africans that AIDS does not just strike gay white men like himself. It's an urgent task in a country where the vast majority of AIDS cases are blacks who contracted the virus from heterosexual relations.

Many people are ignorant about how the disease is spread, he said.

''You still get people leaving food outside hospital rooms instead of going in, wearing gloves, taking your temperature,'' Mellors said in an interview at the 8th International Conference on AIDS in Africa, which ended Thursday.

Mellors, 28, was assistant food and beverage manager when he collapsed, suffering from swollen glands and diarrhea.

The doctor asked him if he was homosexual. ''I said yes.'' The answer prompted the immediate, and uninformed, diagnosis.

He lost the job.

Since then, he's been active in AIDS organizations and corporate education at oil firms, banks, airlines and universities.

Mellors says he stresses the AIDS can happen to anybody ''and that it's just as much up to HIV-negative people to protect themselves.''

He's had a form of pneumonia called PCP and takes the anti-PCP drug Bactrim while trying to pay for it.

''If you're unemployed in South Africa and HIV-positive, it's very difficult to get a disability grant,'' he said. ''I can't get a grant because I'm too healthy, and I can't get a job because I'm too sick.''

---

Wingstone Zulu is the sixth of 13 children. Two older brothers died three years ago of AIDS.

''It's a miracle I'm alive,'' he said.

The 29-year-old Zambian was diagnosed HIV-positive in 1990 after a scholarship to study in the former Soviet Union required him to take the test for the virus.

The result ''was a big embarrassment for my family. For a while they avoided me. My crime was not getting HIV, it was going public.''

Wingstone, a former computer archivist for the communist United National Independent Party, reacted much the same way when an old girlfriend died in 1989.

Rumor was she died of AIDS or had been bewitched. ''I chose the latter,'' Zulu said. ''I was more comfortable with it. I thought I was a good communist and wasn't supposed to be superstitious, but this time I was.''

A bout with polio when he was three left him with a severe limp. Otherwise he appears in good health, though last August his CD4 count, a measure of HIV infection, was a shocking 17. Less than 200 is considered advanced HIV infection. He can't afford costly AIDS drugs such as AZT on a government aid program that allots him $6 a year. Instead he takes painkillers and pills for diarrhea.

He lives in a large house in Lusaka shared with up to six other carriers of the human immunodeficiency virus - but they keep dying. George, Lawrence, Atha, Benson ... Wingstone counts them off.

''I've tried to make AIDS 'normal' in Zambia,'' he said. ''We replace posters that say 'AIDS Kills.' Teach people they're not dealing with death, that they shouldn't look at 'HIV people' as if they came from Mars.''

---

He asked to be called Karim. In Muslim Morocco, gays and HIV carriers risk great public shame and estrangement from friends and family for coming out.

Karim, a former civil servant who now runs a small business with a friend in his native Casablanca, has lived with AIDS since 1986.

He had unprotected sex while a student overseas in the early 1980s, when he believes he was infected.

''I tested myself because I had to find out, to know whether I could have a relationship, get married and have children,'' he said.

Karim acknowledges the relations he had were with men. ''But if I had had the chance to have a life with a woman, and have children, then I would have. Now I can't - I wouldn't let myself contaminate a woman.''

The standard medication doesn't always agree with him. He had a violent allergic reaction to Bactrim earlier this year, his skin peeling as if badly burned, and his fingernails falling out.

''I feel weak. I live in anguish of getting sick, of getting tuberculosis just from talking with someone.''

Karim's face is slightly gaunt but he has bright, piercing eyes. Jeans, loafers, a sports coat and smart silk tie add an aura of comfortable intellect.

His family doesn't know. ''I don't want to hurt them,'' he said.

They've long wondered why he's not married - his seven brothers and sisters are - but he always found excuses.

One brother knows of Karim's anguish, and Karim plans to tell two more siblings so they will understand - so many things will make sense then.

A month ago he formed a support group in Casablanca for Moroccans who like him had no one to talk to about their HIV. Through it he's met Moroccans who have been disowned by their families, even their family physicians.

Karim now hopes to organize prevention programs in Morocco. He also fervently hopes for more international cooperation and for specialists to concentrate on the afflicted as well as a cure.

''People must realize that if doctors are scientists, then we are science, and without each other we would get nowhere.''