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 > Status bits cycle time question...

#11414 - regularkid - Sun Oct 05, 2003 8:14 pm

If I add on the extra "s" to my command in ARM mode to set the status bits when the command is executed, does this take extra cycles?

Also, if I use a conditional within my command, such as "addlt", which adds only if the status bits currently set correspond to "less than", does this take extra cycle times?

Thanks!
_________________
- RegularKid

#11415 - DekuTree64 - Sun Oct 05, 2003 8:36 pm

No, and no. I think 1-cycle instructions like mov, add, cmp, etc. still take one cycle if they don't execute, but things like ldr, which takes 3 cycles + wait states will only take one cycle as well if it isn't executed.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#11421 - regularkid - Mon Oct 06, 2003 3:19 am

Cool, thanks!
_________________
- RegularKid

#11423 - torne - Mon Oct 06, 2003 11:41 am

BTW Deku is right about conditionals; all instructions take a minimum of 1 cycle if they are not executed. The gbatek document lists cycle times for the different instructions.