home *** CD-ROM | disk | FTP | other *** search
- Alab Assembler,Compiler and Linker Configuration Files Documentation.
- =====================================================================
-
- Alab has been rewritten to allow users to have full control of the
- assembler and linker setup. That is, the user can edit these
- configuration files to their most suitable. Each .CFG-file in the "ASM\"
- directory contains information about one assembler, and each .CFG-file
- in the "LINK\" directory holds one linker setup. In addition, because of
- this general setup, Alab can now also support different compilers. I
- have therefore included C language syntax highlighting, made the
- different tools compatible with C source code, and included Watcom C/C++
- compiler support. Each .CFG-file in the "COMPILER\" directory holds
- information about one compiler.
-
- In this documentation file I explain how the configuration files is
- built up. When I write "program", I mean "assembler/linker or compiler",
- since the configuration files has excactly the same syntax.
- Each CFG-file contains information about the program, such as the calling
- syntax, various switches to it, and error presentation (how the program
- shows the errors).
-
- The configuration files is built up by directives, and data which goes
- to this directive. All directives are optional, and they can come in any
- order.
-
- When you shall create a new CFG-file, I suggest that you copy one of the
- old ones to the new one, and then make the desired changes to the new
- one.
-
- Here follows a description of the various directives in a .CFG-file:
-
- *"Name= ..."
- The name typed here is the name shown in the program setup dialog
- used for selecting between different assemblers/linkers/compilers.
-
- *"Parameters= ..."
- Here you specify how the command line is built up. The program is
- called with this parameter line. There are some macros which Alab
- recognizes, and exchanges with other information.
-
- The macros for the assembler/compiler configuration files is:
-
- $OPTIONS_ = All options set in the assembler setup.
- $SOURCE_ = The filename of the file in the current edit window.
- $OBJECT_ = The name of the object file. ($SOURCE_ without ext.)
- $EDNAME_ = Name of file in current edit window (without ext.).
- $EDNAMEEXT_ = Name+Extension of file in current edit window.
- $OBJEDNAME_ = Name of file in current edit window (without ext.),
- with directory replaced by Options|Dirs.../Object dir.
- $EXEEDNAME_ = Name of file in current edit window (without ext.),
- with directory replaced by Options|Dirs.../Exe dir.
-
- The macros for the linker configuration files is:
-
- $OPTIONS_ = All options set in the linker setup.
- $OBJFILES_ = Object files to be linked. This includes the external
- object files defined in the linker setup.
- "objfile objfile objfile ..."
- $OBJFILES1_ = "objfile objfile objfile ..." (same as $OBJFILES_)
- $OBJFILES2_ = "objfile+objfile+objfile ..."
- $OBJFILES3_ = "objfile,objfile,objfile ..."
- $EXEFILE_ = The name of the exefile to be generated.
- $LIBFILES_ = Library files to be linked (defined in linker setup).
-
- *"Calltype="
- Alab currenctly supports 3 different methods of calling the
- programs. 1 is to pass the whole command line as normal, 2 is to
- write the parameters into an environment variable, and then call the
- programs with the environment variable as a parameter (with an '@'
- in front). The 3 is to write the parameters into a file, and call the
- programs with the file as a parameter (with an '@' in front).
- 0=Parameters,1=Environment variable,2=File
-
-
- *"Options="
-
- Here you specify which switches is to be represented in the program
- setup for the programs. The radio buttons comes later (where you have
- multiple choices and can choose only one of them).
- The syntax for the switches is as follows:
- SWITCH WHATITDOES (they must be separated by 1 or more spaces)
- example:
- /a Alphabetic segment ordering
- /s Source-code segment ordering
-
- NB! You can have a maximum of 16 different options.
-
- *"Radio buttons="
-
- Here you specify which radio buttons is to be represented in the
- program setup for the programs. You use radio buttons when you have
- multiple choices, but can choose only one of them. For example, you can
- specify case sensitivity as EITHER "None", "Globals" or "All" with Turbo
- Assembler. You have the switch "/mu" for None, "/mx" for Globals, and
- "/ml" for All, but can use only one of them. Ofcourse you can put these
- 3 in the option list, and then check one of them in the Miscellaneous
- box, but it's more convenient to specify it as a Radio Button. The
- syntax for a Radio Button is as follows:
-
- Header
- switch Option 1
- switch Option 2
- ...
- switch Option n
-
- You can specify a maximum of 6 radio buttons.
-
-
- Error configuration
- ===================
-
- Now we have come to the error configuration. This is where you specify
- how the errors in the asm/c/??? source file is presented by the
- program. Currently Alab supports 3 different error presentations:
- - The errors is output directly to the screen by the program.
- In this case Alab reads a redirected file to get the errors.
- This is the most usual method used, and almost all programs
- supports this method. It is recommended that you use this method
- if the program supports it.
- E.g. : Turbo Assembler, Microsoft Assembler, Watcom assembler.
-
- - The program creates a special error file where all the errors
- are listed. This file is typically called sourcefilename.ERR. In this
- case Alab ofcourse reads this file.
- E.g. : Watcom assembler.
-
- - The program writes the errors directly into the sourcefile.
- The sourcefile is either saved with an other extension, or the
- source file with the errors is saved with an other extension.
- E.g. : A86
-
- You must first specify which of these methods is used by this program.
- You do this by assigning a number to the ErrorType directive.
-
- *"ErrorType="
- Here you specify which one of the methods listed above the program
- uses. 0=to screen,1=to errorfile,2=into source.
- If the program is a linker, ErrorType must be 0 or 1 (btw; I don't
- know about any linkers which supports 1).
-
- *"ErrorFileExtension="
- Here you can specify the extention of the error file created. The
- default is ".ERR".
-
- *"IntoSourceExtension="
- When the program writes the errors directly into the source, the
- program can sometimes save the source with the errors as something
- else, so the source is never overwritten. Then you must specify an
- extension for it, and you do that here. For example: If you use A86
- with the "+E" switch, A86 saves the source with the errors as
- sourcefilename.ERR. You then must specify ".ERR" as the extension
- here. The default is ".ASM" (errors written directly into source).
- Not needed in linker config.
-
- *"IntoSourceNumbHeaderLines="
- When the program writes the errors directly into the source, the
- program sometimes creates a header before the source starts. Alab
- needs to know how many lines this is in order to get the correct
- error linenumbers.
- Not needed in linker config.
-
- *"IntoSourceEachErrNumbLines="
- Alab currently only supports 1 error presentation syntax (that means
- that each error is presented on 1 line). But some programs uses
- several lines for each error message. In this case you must specify
- how many lines the program uses for each error.
- Not needed in linker config.
- For example: A86 uses 2 lines:
-
- int 10h
- thisgeneratatesanerror
- 1 ~^
- 2 #ERROR 01: Unknown Mnemonic @@@@#
- mov ax, 4c00h
- int 21h
-
- *"ErrorfileOutput="
- Then, there are 3 different possibilities to where the program
- writes the error file (if it generates an error file). To the
- program directory, to the current directory or to the directory
- where the file is.
- 0=to program directory,1=to current dir,2=to file dir
-
-
- Error message syntax
- ====================
-
- Then you must specify how each error is presented.
- You do this by just writing the error on the line following the
- ErrorSyntax directive.
- Everything which is changeable in the error presentation (such as the
- filename, the errorline number and the error message) you exchange with
- a macro defined below:
-
- $FILENAME_ This means the name of the file just assembled
- $ERRORNUMBER_ The number of the error
- $ERRORLINE_ This is the line in which the error is
- $ERRORMESSAGE_ Here comes the error message
-
- If there are multiple spaces between 2 words, you can cut it down to
- just 1.
- For example... I assemble the file GSNAKE.ASM, and the output by the
- assembler is as follows:
-
- ;
- ; Turbo Assembler Version 3.2 Copyright (c) 1988, 1992 Borland International
- ;
- ; Assembling file: GSNAKE.ASM
- ; *Warning* GSNAKE.ASM(32) Argument needs type override
- ; **Error** GSNAKE.ASM(33) Undefined symbol: PUSH
- ; **Error** GSNAKE.ASM(58) Constant too large
- ; Error messages: 2
- ; Warning messages: 1
- ; Passes: 1
- ; Remaining memory: 490k
- ;
-
- We here see clearly how the error/warning messages is built up. Let's
- take the error messages first. First there always comes the word
- "**Error**", followed by the filename just assembled. Then there comes
- a "(", the line number in which the error is, and a ")". And then the
- error message follows. We then get:
-
- **Error** $FILENAME_($ERRORLINE_) $ERRORMESSAGE_
-
- We do the same with the warning messages, and perhaps other error
- messages.
-
- NB! When the errors is written directly into the source, Alab always
- assumes that the error is on the line *above* the error message.
-
- Error message syntax macros (these macros you use in both the
- assembler/linker and compiler setup):
-
- $FILENAME_ This means the name of the file just assembled
- $ERRORNUMBER_ The number of the error
- $ERRORLINE_ This is the line in which the error is
- $ERRORMESSAGE_ Here comes the error message
-
-