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

What is this asm code doing??

Hi all

Can anyone tell what is this asm code doing?? what is the _?ix1000 doing??

MOV R3,#0FFH
MOV R2,#HIGH _?ix1000
MOV R1,#LOW _?ix1000
PUSH AR3
PUSH AR2
PUSH AR1
MOV R3,#00H
MOV R2,#HIGH count
MOV R1,#LOW count
MOV R0,AR1
MOV R4,AR2
MOV R5,AR3
POP AR1
POP AR2
POP AR3
MOV R6,#00H
MOV R7,#04H
LCALL ?C?COPY

Thanks a lot

Parents
  • unsigned char count[4]={0};
    
    Yes, that would account for it. This is one of the ways that memcpy() can get into a project even when you don't use it explicitly. This can be a bit of a problem because memcpy() is designed for speed and is actually quite large.

    It would be helpful for many projects if there was a compiler option for slow but compact versions of the string.h functions.

    Also, calls to memcpy() can be very inefficient - as you have noted above. It would be nice if C51 could generate in-line code to copy small amounts of memory to and from fixed addresses. This really ought to be easy as, for example, an assignment of a long does not invoke memcpy().

    memcpy() can get called to copy a very small structures. If you are using bitfields, a structure can be as small as a single byte!

    Keil: how about some improvement?

    (It is possible I am out-of-date on this, it has been a while since I last looked.)

Reply
  • unsigned char count[4]={0};
    
    Yes, that would account for it. This is one of the ways that memcpy() can get into a project even when you don't use it explicitly. This can be a bit of a problem because memcpy() is designed for speed and is actually quite large.

    It would be helpful for many projects if there was a compiler option for slow but compact versions of the string.h functions.

    Also, calls to memcpy() can be very inefficient - as you have noted above. It would be nice if C51 could generate in-line code to copy small amounts of memory to and from fixed addresses. This really ought to be easy as, for example, an assignment of a long does not invoke memcpy().

    memcpy() can get called to copy a very small structures. If you are using bitfields, a structure can be as small as a single byte!

    Keil: how about some improvement?

    (It is possible I am out-of-date on this, it has been a while since I last looked.)

Children
No data