in reply to how do I use s///e

If you want to compute the replacements based on the item replaced, s///e is very convenient.
s/(?<!0x)([1-9]\d*)/sprintf "0x%X", $1/eg

I haven't tested this thoroughly, but this should convert any decimal constant in your source into a C/Perl-style hexadecimal constant. It doesn't handle underscores or floating-point well, but it should skip any already-hexadecimal or already-octal numbers.

--
[ e d @ h a l l e y . c c ]