Let's assemble the main.asm file.
The following image shows main.asm file.
The main.asm file starts assembling.
The following image shows the result of assembling of main.asm file.
The project window provides information about the assembly process or generates error messages if the assembly was unsuccessful. In this case, the A2309 File not found error message is generated. As the following image displays, if you right-click on the text containing the error message, a context menu appears.
Select Help on "file not found" and help for the A2309 error message appears, as the following image displays.
You know that the file exists because it is included in the Sources folder that you imported into the project directory. The help message for the A2309 error states that the Assembler is looking for this "missing" include file first in the current directory and then in the directory specified by the GENPATH environment variable. This suggests that the GENPATH environment variable should specify the location of the derivative.inc include file.
To fix this error:
The path to the derivative.inc file " D:\Projects\Model T\Sources" appears in the area below the Add button.
An asterisk appears in the title bar of the Assembler window, so save the change to the configuration.
The asterisk disappears.
The new path is updated in the derivative.inc file.
Now that you have supplied the path to the derivative.inc file, assemble the main.asm file again.
Select File > Assemble and again navigate to the main.asm file and click Open. However, the A2309 error message reappears but this time for a different include file - mc9s08ac128.inc.
Fix this by repeating the GENPATH routine for the other include file. The mc9s08ac128.inc file is located at this path:
<CWInstallDir>\MCU\lib\hc08c\device\asm_include
CWInstallDir is the directory in which the CodeWarrior software is installed.
The asm_include folder is the typical place for missing include files.
After the GENPATH is set up for the second include file and saved as before, you can try to assemble the main.asm file for the third time.
The Macro Assembler indicates successful assembling and indicated that the Code Size was 39 bytes. The message *** 0 error(s), indicates that the main.asm file assembled without errors. Do not forget to save the configuration one additional time.
The Assembler also generated a main.dbg file (for use with the Simulator/Debugger), a main.o object file (for further processing with the Linker), and a main.lst output listing file in the project directory. The binary object-code file has the same name as the input module, but with the *.o extension - main.o. The debug file has the same name as the input module, but with the *.dbg extension - main.dbg and the assembly output listing file has the *.lst extension. The following image displays the project directory after the successful assembly of the project.
The ERR.TXT file is present in the project directory because of the earlier failed attempts at assembling. The ERR.TXT file is empty after a successful assembly. You can delete this file. The following listing shows the project.ini file.
[AHC08_Assembler] StatusbarEnabled=1 ToolbarEnabled=1 WindowPos=0,1,-32000,-32000,-1,-1,290,513,903,833 EditorType=4 Options=-F2 -L=%(TEXTPATH)\%n.lst -Li CurrentCommandLine=""D:\Projects\Model T\Sources\main.asm"" RecentCommandLine0=""D:\Projects\Model T\Sources\main.asm"" RecentCommandLine1=D:\Workspace\test\Sources\main.asm [Environment Variables] GENPATH=C:\Freescale\CW MCU v10.3\MCU\lib\hc08c\device\asm_include;D:\Projects\Model T\Sources OBJPATH= TEXTPATH= ABSPATH= LIBPATH=
The haphazard running of this project was intentionally designed to fail to illustrate what occurs if the path of any include file is not properly configured. Be aware that include files may be included by either *.asm or *.inc files. In addition, remember that the lib folder in the CodeWarrior installation contains several derivative-specific include and prm files available for inclusion into your projects.