gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

ASM > ASM TileStrip Copying

#64239 - QuantumDoja - Tue Dec 20, 2005 2:54 pm

Hi, I want to make my tile strip copying routine fast..

Which is my best option?:
- Straight C Code looping in a function
- Somesort of fast memory copying/ DMA
- ASM Code.

All I need to do is basically copy data from one array into another.

Also....this questions should probably go in another post but, Are the registers r0 to r14 used by my c code? or are they used only when coding in ASM?

Regards
_________________
Chris Davis

#64250 - poslundc - Tue Dec 20, 2005 5:30 pm

QuantumDoja wrote:
Hi, I want to make my tile strip copying routine fast..

Which is my best option?:
- Straight C Code looping in a function
- Somesort of fast memory copying/ DMA
- ASM Code.

All I need to do is basically copy data from one array into another.


My post in this thread lists off the various data-copying techniques in order of efficiency.

The general rule is don't optimize until you have to, and until you're sure everything already works. memcopy() is probably your best bet until then.

Quote:
Also....this questions should probably go in another post but, Are the registers r0 to r14 used by my c code? or are they used only when coding in ASM?

Regards


C code is converted to ASM code by your compiler, and yes, it uses the registers... the C code has to run on the same processor your ASM code does, after all.

You can see the intermediate assembly output generated by your compiler by passing the -S flag to it.

(And yes, the question really does belong in another post.)

Dan.