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
What is this asm code doing?? Did you write code you do not know what is doing? Trying to decipher uncommented code usually imples theft Erik
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.
Thanks all Sorry, I just found this code in my liker map after I complier my source code ,I just to be inquisitive about why kiel c will add these code into my code ,I see the source code just like this unsigned char count[4]={0}; I think it is inefficiency code !! So I just study and ask ,I am not a thief,ok!! Thanks a lot
unsigned char count[4]={0};