In order to use assembler code in your GP2X games to squeeze out the maximum performance of the device, there are a few possibilities.

GNU Assembler

One approach is to use the GNU assembler. In this situation you put your assembler code in separate files. A disadvantage is uncomfortable access to variables and procedures defined in higher level languages, you have to keep their names and types consistent. Assembler code is not debuggable at the source level, however, using instruction stepping in gdb one can still debug it.

GCC inline assembler

GCC allows you to mix assembler code with C code by using inline assembler. The syntax for doing so is not very readable. It is mainly usefull for introducing short sequences of assembler in your code. C symbol access is troublesome, as is debugging.

Free Pascal BASM

The Free Pascal built-in assembler allows you to mix Pascal and assembler code in a comfortable way. Assembler code can be used in Pascal procedures by means of an "asm" statement, or procedures can be fully written in assembler. Pascal variable and procedure names are directly accessible from assembler code and assembler code is debuggable.

Personal tools