This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Movx command in Keil

Hello all,
I'm using Keil uVision2 Version 7.05, and everything seems to be OK. However, there is one thing I don't quite understand, thus I'm posting here asking for your ideas/opinions.
When I run "Hello" example in Keil\Example directory and I found something that puzzled me. The assembly code Keil generated in Disamsembly window as well as in list file always have MOVX command eventhough I don't use external ram at all. I did set memory model to small and I only use IDATA but it still does the same. I even use disamsembler to translate the hex file Keil generated back to assembly source and still get the same result. Can someone spend some times explain this for me? Any inputs would be greatly appreciated. Have a nice weekend.

Best Regards,
T.L

Parents
  • Dear Hans and Dan,
    Thank you very much for your kind explanations. I'll try as your suggestions. It might take me a while to understand the whole process of linking, compiling, and calling library ...etc and so on. As Erik used to say: "It's bible time". I think I have to read more Keil C manual and try do digest it as much as I can. Besides, I'm also reading "C51 Primer", and "The Final Word on the 8051". Hopefully, after reading all this I'll get a better grasp of C programming for 8051.
    Once again thanks for your attentions. Have a great day.
    Best Regards,
    T.L

Reply
  • Dear Hans and Dan,
    Thank you very much for your kind explanations. I'll try as your suggestions. It might take me a while to understand the whole process of linking, compiling, and calling library ...etc and so on. As Erik used to say: "It's bible time". I think I have to read more Keil C manual and try do digest it as much as I can. Besides, I'm also reading "C51 Primer", and "The Final Word on the 8051". Hopefully, after reading all this I'll get a better grasp of C programming for 8051.
    Once again thanks for your attentions. Have a great day.
    Best Regards,
    T.L

Children
  • Wow!!!!
    I tried the puts instead of printf as Dan said, and the code went from 1186 bytes down to 251 bytes. It's amazing.
    One more question here forks: Is there any penalty for doing this? Because I see the "Hello World" print out on the screen seem to be a little bit slower than using printf. Is it just my feeling or it's something else that I don't know of?
    Thank you all.
    Best Regards,
    T.L

  • "I tried the puts instead of printf as Dan said, and the code went from 1186 bytes down to 251 bytes. It's amazing."

    It shouldn't be in the least amazing at all!

    Look at the description of printf in the Manual - it runs to five pages!
    It should thus be obvious that printf is an extrmely powerful and complex function - it should come as no surprise that it takes a lot of code to implement all that stuff!!

    See: http://www.keil.com/forum/docs/thread2741.asp