Code:
void wrchar(char d)          //
   { 
     volatile char ascii=d;
fixed it, compiler optimised ascii var out