You don't mention what tools other than Nasm are involved (calling this stuff "portable" or "standardized" is... optimistic). Gnu C(++ ?) uses just "p", most other systems use "_p", Watcom uses "p_", I believe. You can alter your source to suit, but Nasm provides a feature which will allow you to assemble one source file for multiple Cs. You probably want, on the command line to Nasm, "--prefix _" for your case ("--postfix _" for Watcom tools).
The "++" introduces another complexity. C++ "decorates" (mutilates) external names to indicate "type" (how many parameters, etc.). This too varies from toolset to toolset. I believe the way to get around this is to add "C" (with the quotes, I think) where you define "p" in your .cpp file.
Hope this helps - I'm not very experienced with C, and less so with C++.
Best,
Frank
P.S. I see you figured this out... good!