Hi,
What you need to do is create a printf function that will print the information into a string, then you can use stdwrt to display it in Xmath.
Then you tell the UCB linking process to compile and link with this version of printf.c
I am including the printf.c that we used to test the function you needed.
Hope this helps.