How do I create a weak function via Keil Cx51?
If you really want to do it, then an alternative might be to simply have your code module contain a function to set a callback function pointer and call that function if (for example) non-null. OK, pointers in C51 aren't very efficient, but I suspect your application doesn't go for being ultra efficient.