Short Tutorial to Introduce in FoldMaster ----------------------------------------- This short tutorial is written for FoldMaster version 1.54. Using an older version is not recommended, so if you are not up to date go to ww.foldmaster.de and download the current version of FoldMaster. If you use a newer version some pictures may differ. 1) Setting up a new syntax filter Setting up a new syntax filter for your programming language is easy. This is only necessary if no corresponding filter exists. - click in the menu on Options => Syntax... => New - enter a name for the new syntax filter - click OK. Fill out the following tabs to tell FoldMaster the details of the new syntax filter: Tab Name - In the field >Name of the filter< you can enter a name for the new syntax filter (same as above). - In the >Assigned file extensions< field enter the extensions the filter will be valid for, for example .src - More than one extensions may separated by semicolons, for example .src;.asm - Selecting >Show filter in file dialogs< makes the filter visible in the file dialogs. Tab Template - Enter the name and path for the template file, (for example C:\PROGRAMS\FMASTER\Template\ass51.tpl). A template file is optional, so you do not need to enter a filename at the moment. You will find more information about the template file in the online help. Tab Options - In the field >Characters of a comment at start< enter the character(s) which introduce a comment in your language (for example ;). FoldMaster uses this comment when you add folds to your source code. - In the field >... at end< enter the character(s) which terminates a comment (or leave it blank if not required). - In the >Special characters in words< field you can enter character(s) which may be allowed in labels (for example _ or $). - In the >Symbols< field you can enter the symbols separated by spaces. - If the syntax filter should be case sensitive, select the appropriate check box. - If you never want to replace the tab characters by spaces at loading of a file so select the appropriate check box. - >OEM mode< uses an OEM font to display the file. This feature allows you to edit older DOS files. - >Wrap lines while loading< wraps lines longer as the (Options => Views => Tab View) >page margin< in new lines. This is useful for any text file, for example reports. Tab Details - Enter the character which frame a string in your language (for example " or '). Deactivate this feature by simply leave this field blank. - In the field >Escape character in strings< enter the this character for your language. For example in C/C++ enter the '\' character. - In the >Alternate Comment Start / End< fields you may enter a second start / end for comments. - Under >valid number format< you may select the format used for numbers, select >no< if you don't want to highlight any numbers. Tab Res. Words - Normal Enter all reserved words of your language in this field. The words may be separated with spaces and/or line wraps. - Aux Enter auxiliary reserved words of your language in this field. The words may be separated with spaces and/or line wraps. You can give them a different color. Click on OK. Ready! Please remember that in the demo version of FoldMaster you only can set up one User defined syntax filter. 2) Implementing an assembler: - click in the menu on Options => Tools => Add Fill out the following tabs to tell FoldMaster the details of the new tool: Tab Name/Path: - In the field >Tool name< you can enter a name for the new tool. For example ASM56k for Motorola DSP assembler. - In the >Name and path of executable file< field enter the name and path of the assembler program. Browsing through the directories with the browse button avoids typing errors. Please do not enter any required parameters here! - In the field >Start-up directory< you can enter a path for it. FoldMaster normally determines the needed path automatically. Do not enter any path here except FoldMaster fails to determine the right directory. - In the field >Command line arguments< it may be a little bit complicated. Enter here all needed parameters for your assembler. For example a Motorola DSP563xx assembler need the following parameters: -B -G -L -Os,cre $NAME($EDNAME) the transfermacro $NAME($EDNAME) thereby will be replaced with the filename without extension of the processed file. More information on transfermacros you will find in the online help. Pay attention to the way your assembler need the filename (with or without extension), parameter first or behind, etc. Tab Type: - In the class section select >Transfer tool<. - Select the syntax filter for which the tool shall be used for (use the pre defined filter ASM or a User defined filter). - In the field >File extensions< enter the extensions the tool will be used for (for example .asm;.src). - In the field >Description< you may enter a description (for example DSP56k Assembler). Tab Target: - Don't enter anything in the field >Name of destination file<. This field is only used if a number of source files create only one destination file (for example if the tool is a linker). More information you will find in the online help. - Enter the file extension which will be created by the assembler in the >Specify file extension instead< field (normally this would be that of the object file .obj or .cln in the DSP56k case). This is important for the integrated make of FoldMaster. Tab Options: - Select >Capture output< in the options field. If you detect any problems executing the assembler you may try the other selections. - In the >More options< field you may select the >Call via CMD shell< if you detect any problems calling an old 16 bit DOS assembler. If your assembler only uses short filenames please select the >Use short names< option. FoldMaster then passes only the short aliasnames of files and directories to the tool. - In the >Capture to< field you select the destination of the message output (warnings, errors, etc.). Select the >Message window< this will redirect all outputs of the assembler to the message window (menu: Window => Messages) of FoldMaster. Advanced users select the >Filter-Macro< or the >Filter-String< check box to redirect the outputs to a macro. In the case of the DSP56k assembler select Filter-String. FoldMaster will be able to locate an error in the source file by double clicking on the message window. For more information refer to the online help. Tab Connect/ExitCode: - Define the exit code for successful completion of the tool. 0 is normal, but some assemblers may return a one if any warnings are detected. - Selecting the >Connect to< field allows you to call another tool after successful completion of the actual tool. Please do NOT enter the linker here! Tab Filter: - Advanced users may select a filter macro to analyze the messages of the assembler. For the DSP56k assembler >**** %* [%f %l]: %w --- %t< searches the output for >****<, then analyzes the rest of the line to get all the information needed to know where the error is. If you are not sure, do not enter anything here at the moment. For more information refer to the online help. Click on OK. Ready! Now the assembler is integrated as a tool in FoldMaster. 3) The project file: - All source files and tools (like linker and HEX2BIN converter) are managed in a project file. - To create a project file first close all open windows in FoldMaster. - Click the icon >New project< located under the menu >file< in the upper left. - Enter a name for the new project and/or first browse to a directory of your choice. - Click on the button >open<. The project window will appear on the FoldMaster desktop. - Drag and drop all files needed in this project from the Windows explorer direct into the FoldMaster project window. Alternative you may be select in the menu => Project => Add file to project and mark up the files to insert into the project file via the >Add to< button. The window will not be closed to allow the insertion of additional files from different directories. Click on the >Close< button or the >X< to close the window. - Check the properties of the files (modules) by clicking with the right mouse button on each module and select the >Properties of module< option. In the >Type< field should appear the correct syntax filter of the module. If not select it from the pull down menu (this may happen if more than one filter fits the file extension). - In the >Compiler< field you may select the default compiler or assembler for this module. This is only necessary if you have two or more different compilers for this module. Normally selects the corresponding compiler. - At the >Replace Tabs<, >OEM Charset mode< and >Wrap lines< selections you may override the choices made at the syntax filter only for this module. - With the >Read only< selection asserted the file is write protected and could only viewed. Click OK to continue. - Make some empty lines by typing in the project window. - Create a make fold by selecting in the menu Folds => Insert new fold/item => Make Fold. You can give this fold a title (like any other fold). - Open the make fold by double click on the title. - Pull all source modules (NOT the includes) into the make fold by drag and drop them on the icon on the left side of the project window. - Save the project file by clicking the save button. 4) The linker: - The linker must be positioned behind all source modules in the make fold. The make fold is worked off from top to bottom. Reaching the linker after translation of all source modules! - Therefore create some empty lines at the end INSIDE the make fold by typing . Make sure the cursor is inside the fold. - Create a new tool inside the fold by selecting in the menu Folds => Insert new fold/item => Executable tool. - Act in the same way as described in the section >Implementing an assembler< above. Except: enter in the field >Command line arguments< the linker control file. Note: FoldMaster is able to create a list of all modules included inside the make fold using the transfer macro $MLIST. Another possibility is the automatic creation of the linker control file using the macro language of FoldMaster. An example how such a macro looks like can be found on the FoldMaster website in the section Macros & Tips => Integration of compilers => makelink.pas. This macro is for a Motorola DSP linker but can be easily adapted to any other linker. For more information about the macro language refer to the online help. Implement the macro into the make fold between the source modules and the linker (select from the menu Folds => Insert new fold/item => Macro File). - At the tab >Target< you may enter the destination file instead of the file extension (for example test.hex or test.bin). - You may add additional tools like a HEX2BIN converter in the same way. - Save the project file by clicking the save button. 5) Call and Test: - Double clicking on a module in the project window opens the file for editing. - Open the FoldMaster message window (menu Window => Messages). - Click with the right mouse button inside the file or on the module in the project window and select >Compile => your assembler<. - The assembler will be invoked by FoldMaster. All messages should be appear in the message window. You may need to select the corresponding tab at the bottom of the message window. - To make use of the integrated make of FoldMaster place the cursor on the title of the make fold. By clicking the right mouse button and selecting from the pop up menu the item >Make all<. All files which are older than their object files will be processed by the assembler. At the end the linker will be invoked. This may enough for the moment. For more information please refer to the online help.