[STM8] When use memcpy() will copy the contents to the wrong address
When the destination memory block is locate in zero page which the address is often rang from 0x0 to 0xff. For instance, if a destination memory start address is 0x0, the memory() will copy the contents to address from 0x100. The memory() disassembly instructions like:
LDW X, &sharpLength
loop: LD A, (scr + X) LD (dst + X), A DECW X JRNE loop RETThe value of 'scr' and 'dst' is the address before 1 of start address of memory block. e.g. If the start address of 'destination parameter' of memcpy() is 0x80, then the 'dst' should be 0x7f, and if the start address of it is 0x0, the 'dst' will be 0xff, then the contents will copy to the memory from 0x100.
I thinks this should be a compiler issue.
#stm8-assembly #memcpy