How should I structure my CUSP assembly code to make it more readable? Should data go first, or instructions?
You should put all your instructions at the top of your .csp file, with the first instruction at M[$000]. Doing so makes it easier to run your program because you know that it always starts at M[$000]. Place all your variables/data below the last instruction, preferrably in another section of memory. So if your instructions go from M[$000] to M[$1A6], start your Data section at M[$200] or so, using .equ @,$200 to place your data there. Another option is to have your data at the very top of your program, starting at M[$001], reserving M[$000] for a JMP to your program’s main. This can be accomplished with the following assembly code: M[$000]: JMP MAIN VAR1: ….
Related Questions
- Am I required to specify in the ISBT 128 product code data structure (data structure 003) whether the unit is autologous, directed, or designated?
- How should I structure my CUSP assembly code to make it more readable? Should data go first, or instructions?
- When using inline assembly instructions on the TI C compiler, why does the code break at run-time?