Copying a memory block between different pages
4 days 3 hours ago - 4 days 3 hours ago #237
by ludojoey
Copying a memory block between different pages was created by ludojoey
Hello!
Is there a way to copy a block of memory from an area belonging to a given page to an area on another page?
I see that the memCpy and areaCpy functions don't allow specifying a different page number for the source and destination.
If not, is there another, faster way to do this than using a loop with peek/poke?
Is there a way to copy a block of memory from an area belonging to a given page to an area on another page?
I see that the memCpy and areaCpy functions don't allow specifying a different page number for the source and destination.
If not, is there another, faster way to do this than using a loop with peek/poke?
Last edit: 4 days 3 hours ago by ludojoey.
Please Log in or Create an account to join the conversation.
3 days 12 hours ago - 3 days 12 hours ago #239
by Franck
Replied by Franck on topic Copying a memory block between different pages
If the distance between the addresses is small enough (48Kib-size) you can place the window across the source and destination and copy in a single pass.
Otherwise the general practice is to copy to scratchpad first (blocs of 2KiB max) than from scratchpad to the destination. If larger than 2 KiB, you take the size and divide by 2048 to know how many copies you'll need and loop that many time. This is why the scratchpad is always visible.
Otherwise the general practice is to copy to scratchpad first (blocs of 2KiB max) than from scratchpad to the destination. If larger than 2 KiB, you take the size and divide by 2048 to know how many copies you'll need and loop that many time. This is why the scratchpad is always visible.
Last edit: 3 days 12 hours ago by Franck.
The following user(s) said Thank You: ludojoey
Please Log in or Create an account to join the conversation.
Time to create page: 0.160 seconds