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

getting vriable address

how do i get variable address defined in C inside assembly instructions while writing some assembly instructions between C code.

Ashutosh Tiwari
Bangalore

Parents
  • "i want to reduce the time reqired to execute a routine which is taking more time while written in C"

    As Hans-Bernhard Broeker said, this is almost certainly the wrong approach!

    The first thing you must do is to determine precisely why your current 'C' routine is taking "too long" - and quantify how much "too long" it is.

    If it's taking "too long" simply because your 'C' is badly written and inefficient, then you need to re-write the 'C' - not bodge it with inline assembler
    See http://www.keil.com/support/man/docs/c51/c51_xc.htm for tips

    Remember that Assembly is just another language - it won't magically turn you into a better programmer.
    You need to be a skilled, experienced Assembly programmer to write tight, fast assembly code - it is more than likely that the C51 compiler can do a better job than a novice Assembly programmer...

    On the other hand, if it's taking "too long" because your fucntion is just too complicated - then not even assembler can help you there!

Reply
  • "i want to reduce the time reqired to execute a routine which is taking more time while written in C"

    As Hans-Bernhard Broeker said, this is almost certainly the wrong approach!

    The first thing you must do is to determine precisely why your current 'C' routine is taking "too long" - and quantify how much "too long" it is.

    If it's taking "too long" simply because your 'C' is badly written and inefficient, then you need to re-write the 'C' - not bodge it with inline assembler
    See http://www.keil.com/support/man/docs/c51/c51_xc.htm for tips

    Remember that Assembly is just another language - it won't magically turn you into a better programmer.
    You need to be a skilled, experienced Assembly programmer to write tight, fast assembly code - it is more than likely that the C51 compiler can do a better job than a novice Assembly programmer...

    On the other hand, if it's taking "too long" because your fucntion is just too complicated - then not even assembler can help you there!

Children