I have a problem. My program with inline work, but when I add Printf or Scanf it do nothing. If smbd have working project with inline #pragma asm ... and Printf Help me, Please.
No, I haven't - as you should be able to guess from my replies, I just would not do that!
And my advice to you is: Just Don't Do It!
You have already demonstrated for yourself that it can cause problems, and you haven't shown any reason to need it - so why do it?!
Instead of wasting effort on this (apparently) pointless excercise, your time would be far better spent in learning C51 more thoroughly - then, if you ever do have a real reason to do it, you will be in a position to understand what's going on!
Well, this sentence could be read as a hard requirement to do something with inline assembly:
I'd really like to get rid of inline ASM, but It's my task (I have a laboratory course in institute), [...]
Well, if it's coursework, he should be referring to his course notes, textbooks, teachers, etc...