should I use assembly
should I use assembly
I was wondering if many people are using assembly with C to make their games. Should I learn assembly or should I just use C? I do not know if people still use assembly to make games using devkitARM.
Re: should I use assembly
If you are asking this question then no you should not use assembly. Generally, assembly is used to optimize slow yet high usage areas. So, at this point you would most likely not be able to do better then the c compiler. Should you learn arm assembly? If you have the time and the inclination then I would say yes. arm processors seem likely to stay around for awhile.
Re: should I use assembly
There are other things you can do to optimize code.
First, if you are using any significant amount of multiplication or division, build as ARM code instead of THUMB code. GCC generates really bad THUMB code for math heavy code, but it's better for ARM mode.
Second, there's a trick to write a function that efficiently returns two 32-bit ints. It involves unions and structs, but generates the best possible code for returning two ints.
Third, don't use the standard library's memset and memcpy, use replacement ASM versions that properly use ldmia/stmia loops.
First, if you are using any significant amount of multiplication or division, build as ARM code instead of THUMB code. GCC generates really bad THUMB code for math heavy code, but it's better for ARM mode.
Second, there's a trick to write a function that efficiently returns two 32-bit ints. It involves unions and structs, but generates the best possible code for returning two ints.
Third, don't use the standard library's memset and memcpy, use replacement ASM versions that properly use ldmia/stmia loops.
Who is online
Users browsing this forum: Google [Bot] and 1 guest