The .IN directive allows you to split the complete source text of your program into different modules, which are loaded and interpreted one by one to form the total source of your assembly program.
In Version 3 of the SB-Assembler this directive will perform a boundary sync.
Splitting a large job into smaller sub-jobs makes program management and the total overview a lot easier. This is also true for creating programs in assembly. In DOS the maximum source file size the SB-Assembler can handle is only limited by your favourite text editor and free memory. The maximum source file size in other operating systems is sheer unlimited. However shorter files, each dedicated to a specific task, are much easier to maintain.
The main source file is opened when you start the SB-Assembler. This main source file may open as many include files as you like. Preferably the main source file should only contain some initialization directives like .CR and .OR and all references to the required .INclude files.
The .IN directive requires a filename as parameter.
This filename may be preceded by a path name, and possibly a drive letter for Microsoft systems.
The extension .ext is optional.
If the extension is omitted the default extension .asm is used.
Wirh Version 2 of the SB-Assembler the maximum total length of path and file name may not exceed 122 characters. The length limit for Version 3 is only dictated by the operating system you run the assembler on.
Please note that file names on some operating systems are case sensitive.
An include file will be closed when the assembler reaches the end of that include file.
Assembly will then continue in the main source file on the line following the line that opened the include file.
Please notice that all include files are opened and closed twice during the 2 pass assembly process.
With Version 2 of the SB-Assembler it is not possible to nest include files.
This means that you can not open another include file from within an include file.
With Version 3 it is now possible to nest include files, which means that an include file can open another include file. When such a nested include file is closed the calling include file will proceed on the line following the directive which called the just terminated include file.
Please note that it is technically possible to create an endless loop this way. The assembler checks if the new include file name is the same as a still open include or chained file name, giving you a *** Fatal Error: Recursive opening of source file is not allowed error if does.
Line numbers in list files are preceded with an 'I' to indicate that they originate from an include file. Line numbers are reset to 1 every time a new include file is opened.
.IN declare Include declaration module (extension .asm) .IN C:\LIB\MACRO.LIB Include Macro library (extesion .lib) .IN INIT Include initialization module (extension .asm)