Per Pixel Lighing - old HW (help!!)

I used to have the gloss map in the normal map alpha channel, but now i want to use a doom3 approach, having them in a separete texture… but for attenuated-per pixel-cubemmaped lights, im having problems to make it work in NV20 and R200 HW, since the number of registers…does anybody has some RC code and ATI fragment program code?