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
  • It is a call to memcpy().

    There are two 3-byte variables, one in R1,R2,R3 which is the address of _?ix1000 and one in R0,R4,R5 which is the address of count. The number of bytes to copy is in R6,R7 - just 4 bytes in this case.

    Whay all the pushing and popping? It looks totaly unnecessary and is presumably the way C51 chooses to do it.

    What is _?ix1000? Only Keil can help you although the preceeding underscore hints that this is a compiler generated label.

    You should be able to look at the opcodes and determine the actual values of the pointers. Refer to the manual for a detailed description of the 3-byte pointers - one byte indicates which type of memory and the other two bytes indicate a 16-bit address.

    You can use your map file to determine what it is that is being copied.

Reply
  • It is a call to memcpy().

    There are two 3-byte variables, one in R1,R2,R3 which is the address of _?ix1000 and one in R0,R4,R5 which is the address of count. The number of bytes to copy is in R6,R7 - just 4 bytes in this case.

    Whay all the pushing and popping? It looks totaly unnecessary and is presumably the way C51 chooses to do it.

    What is _?ix1000? Only Keil can help you although the preceeding underscore hints that this is a compiler generated label.

    You should be able to look at the opcodes and determine the actual values of the pointers. Refer to the manual for a detailed description of the 3-byte pointers - one byte indicates which type of memory and the other two bytes indicate a 16-bit address.

    You can use your map file to determine what it is that is being copied.

Children
More questions in this forum