- Assembly file extensions can be either .s or .asm
- To include another file in your assembly file:
.include "Defines.h" ; include "Defines.h" file for use in assembly file
- To label your code so CodeWarrior can debug it:
- To include other Assembly files for use and debugging:
Do Not use .include to include other assembly files that you want toe use and debug, because then you will not be able to run through the file with the step-by-step debugger. The actual program may work but you can not go through the included code line by line. You can include subroutines or any other label (i.e. variables) from one assembly file to be used in another file. Do remember though to add the .function and .text and other required assembly definitions.
Place the .import in the assembly file (at the top) from which you want to call the subroutine. Basically can look at it like placing the prototype of the function at the top of the assembly file.
.import My_Function
Then place the .export in the assembly file (at the top) that actually contains the subroutine that you want to call.
.export My_Function
Example:
In “MainSource.asm”
In “Other_File.asm”