• Keine Ergebnisse gefunden

USER SWITCH COMMANDS AND FUNCTIONS

Im Dokument for the (Seite 173-181)

THE ASSEMBLY PROCESS

FROM LIBRARY

7.2 USER SWITCH COMMANDS AND FUNCTIONS

The user maintains library files through the use of switch commands. Functions which can be performed include object module deletion, insertion and replacement, library file creation, and listing of a library file's contents.

7.2.1 Command Syntax

LIBR accepts command strings in the following general format:

*dev:lib ,dey :list=dev :input/sl /s2/s3 where:

dey:

lib list input /sl, ...

represents a legal HT-II device specification represents the library file to be created or updated represents a listing me for the library's contents represents the filenames of the input object modules represents one or more of the switches listed in Table 7-1

Devices and fIlenames are specified by the user in the standard HT-ll command string syntax, with default exten-sions assigned as follows:

File list fIle:

library fIle:

input fIles:

Extension .LLD .OBJ .OBJ If no device is specified, the default device (DK:) is assumed.

Each input fIle is made up of one or more object modules, and is stored on a given device under a specific me-name and extension. Once an object module has been inserted into a library fIle, the module is no longer refer-enced by the name of the fIle of which it was a part, but by its individual module name. (This module name has been assigned by the assembler either via a .TITLE statement in the assembly source program, or, if no .TITLE statement is present, with the default name .MAIN.; see Chapter 5.) Thus, for example, the input fIle FORT~OBJ

may exist on DX1: and may contain an object module called ABC. Once the module is inserted into a library fIle, reference is made only to ABC (not FORT.OBJ).

7.2.2 LIBR Switch Commands

Table 7-1 summarizes the switches available for use under HT-l1 LIBR. Switches are explained in detail follow-ing the table.

Table 7-1 LIBR Switches Position In

Switch Command String Meaning

/C Any line Command continuation; the command is .JO long for the

but last current line and is continued on the next line /D lst line only Delete; delete modules from a library fIle

/G lst line only Global deletion; delete entry points from the library directory

/R lst line only Replace; replace modules in a library me

/U

lst line only Update; insert and replace modules in a library fIle

There is no switch to indicate module insertion. The function of inserting a module into a library me is assumed in the absence of other switches.

7.2.2.1 Command Continuation Switch - The Command Continuation switch is necessary whenever there is not enough room to enter a command string on one line and additional lines are needed. The /C switch is typed at the end of the current line and may be repeated at the end of subsequent command lines as often as necessary as long as memory is available; if memory is exceeded, an error message is output. A

IC

switch is not entered on the last line of input.

Command Format:

*dev:lib,dev:list=dev:inputl ,dev:input2, ... ,1C

*dev:inputn where:

dey: represents a device specification

lib represents the filename of the library to be created or updated

list represents the filename of a listing file containing the library file's contents input represents the filenames of the input modules to be inserted into the library

IC

represents the Continuation switch, indicating that the command is to be continued on the fol-lowing line

Examples:

*ALlB,L1BLST=DXl :MAIN,TEST,FXN/C

*DX1:TRACK

In this example, a library file is created on the default device (DK:) under the filename ALIB.OBJ; a listing of the library file's contents is created as LIBLST.LLD also on the default device; the filenames of the input modules are MAIN.OBJ, TEST.OBJ, FXN.OBJ, and TRACK.OBJ, all from DXl.

*BLlB=MAIN/C

*DX1:TEST/C

*PR:FXN/C

*DXl :TRACK

A library file is created on the default device, (DK:) under the name BLIB. No listing is produced. Input files are MAIN from the default device, TEST from DXl:, FXN from PR: and TRACK from DXl.

Another way of writing this command line is:

*BLlB=MAIN,DXl :TEST,PR :FXN/C

*DXl :TRACK

7.2.2.2 Creating a Library Fie - A library file is created whenever a fllename is indicated on the output side of a command line which does not represent a list file.

Command Format:

*dev:lib=dev:inputI, ... ,dev:inputn where:

dey: represents a device specification

lib represents the filename of the library to be created

input represents the filenames of the input modules to be inserted into the new library Example:

* NEW L I B=F I RST ,SECON D

A new library called NEWLIB.OBI is created on the default device (DK:). The modules which will make up this library file are in the files FIRST.OBI and SECOND.OBI, both on the default device.

Assume this command line is next entered:

*NEWLlB,LlST=THIRO,FOURTH

The already existing library file NEWLIB is destroyed when the new library file is created. A listing of the library file's contents is created under the filename LIST, and the object modules in the files THIRD and FOURTH are inserted into the library file NEWLIB.

7.2.2.3 Inserting Modules Into a Library - The Insert function is assumed whenever an input file does not have an associated switch; the modules in the file are inserted into the library file named on the output side of the com-mand string. Any number of input files are allowed. If an attempt is made to insert a file which contains an entry point or .CSECT having the same name as an entry point or .CSECT already existing in the library file, a warning message is printed. However, the library file is updated, ignoring the entry point or .CSECT in error, and control returns to the CSI; the user may enter another command string.

Although the user may insert object modules which exist under the same name (as assigned by the .TITLE state-ment) this practice is not recommended because of the difficulty involved when replacing or updating these modules (refer to Sections 7.2.2.4 and 7.2.2.7).

NOTE

The library operations of module insertion, replacement deletion, merge, and update are actually performed in conjunction with the library file creation operation.

Therefore, the library file to which the operation is directed must be indicated on both the input and out-put sides of the command line, since effectively a "new"

output library file is created each time the operation is performed. The library file must be specified first in the input field.

Command Format:

*dev:lib=dev:lib,dev:inputl, ... ,dev:inputn where:

dev: represents a device specification

lib represents the filename of an existing library file

input represents the filenames of the modules to be inserted into the library file Example:

*OXY=OXY,OXl :FA,FB,FC

The modules included in the files F A.OB], FB.OBI, and FC.OBI on DXI: are inserted into a library file named DXY.OBI on the default device. The library header and Entry Point Table of the library file are updated accord-ingly (see Section 7.4).

7.2.2.4 Replace Switch - The Replace function is used to replace modules in a library file. All modules con-tained in the file(s) indicated as input will replace existing modules of the same names in the library file specified as output.

An error message is printed and no modules are replaced if an old module does not exist under the same name as an input module, or if the user specifies the /R switch on a library file. /R must follow each input filename containing modules for replacement.

Command Format:

*dev:lib=dev:lib~nput1/R, ... ,dev:inputn/R where:

dey: represents a device specification

lib represents the filename of an existing library file

input represents the names of the files containing modules to be replaced /R represents the Replace switch

Examples:

*TFIL=TFIL,INA,INB/R,INC

This command line indicates that the modules in the me INB.OBJ are to replace existing modules of the same names in the library file TFIL.OBJ. The object modules in the mes INA.OBJ and INC.OBJ are to be added. All files are stored on the default device DK:.

*XFI L=TF IL,INA,INB/R,INC

The same operation occurs here as in the preceding example, except that this updated library file is assigned the new name XFIL.

7.2.2.5 Delete Switch The Delete switch deletes modules and all their associated entry points from the library.

Command Format:

*dev:lib=dev:lib/D where:

dey: represents the device on which the library file exists lib represents the filename of an existing library file

/D represents the Delete switch; may be positioned anywhere on the input side of the command line When the /D switch is used, the Librarian prints:

MOD NAME:

The user should respond with the name of the module to be deleted followed by a carriage return; he may continue until all modules to be deleted have been entered. Typing only a carriage return (either on a line by itself or immedi-ately after the MOD NAME: message) terminates input and initiates execution of the command line.

Examples:

*DX1 :TRAP=DX1 :TRAP/D MOD NAME:

SGN<CR>

TAN<CR>

<CR>

The modules SGN.OB] and T AN.DB] are deleted from the library file TRAP.DB] on DXl:.

*LlBFIL=LlBFIL/D,ABC/R,DEF MOD NAME:

FIRST<CR>

<CR>

The module FIRST. DB] is deleted from the library (LIBFIL); the module ABC.DB] replaces an old module of the same name in the library, and the modules in the me DEF.DB] are inserted into the library.

*LlBFI L=LlBFIL/D MOD NAME:

X<CR>

X<CR>

<CR>

Two modules of the same name are deleted from the library me LIBFIL (module names are assigned with the .TITLE statement as described in Section 7.2.1).

7.2.2.6 Delete Global Switch - The Delete Global switch gives the user the ability to delete a specific entry point from a library file's Entry Point Table.

Command Format:

*dev:lib=dev :lib /G where:

dev: represents the device on which the library me exists lib represents the mename of an existing library me

/G represents the Delete Global switch; may be positioned anywhere on the input side of the com-mand line

When the /G switch is used, the Librarian prints:

ENTRY POINT:

The user should respond with the name of the entry point to be deleted followed by a carriage return; he may con-tinue until all entry points to be deleted have been entered. Typing only a carriage return (either on a line by itself or immediately after the ENTRY POINT: message) terminates input and initiates execution of the command line.

Example:

*ROLL=ROLL/G ENTRY POINT:

NAMEA<CR>

NAMEB<CR>

<CR>

This command inst,ructs LIBR to delete the entry points NAMEA and NAMEB from the entry point table found in the library file ROLL.OBJ on DK:.

Since entry points are only deleted from the Entry Point Table (and not from the library itself) whenever a library file is updated, all entry points that were previously deleted are restored unless the /G switch is again used to delete them. This feature allows the user to recover from inadvertently deleting the wrong entry point.

7.2.2.7 Update Switch - The Update switch allows the user to update a library file by combining the insert and replace functions. If the object modules included in an input file in the command line already exist in the library file, they are replaced; if not, they are inserted. (No error messages are printed when using the Update function as might occur under the Insert and Replace functions.) /U must follow each input file containing modules to be updated.

Command Format:

*dev:lib=dev:lib,dev:inputl/U, ... ,dev:inputn/U where:

dev: represents a device specification

lib represents the fllename of an existing library file

input represents the names of files containing object modules to be updated /U represents the Update switch

Examples:

*BALlB=BALlB,FOL T/U,TAL,BART /U

This command line instructs LIBR to update the library file BALIB.OBJ on the default device. First the modules in FOLT.OBJ and BART.OBJ replace old modules of the same names in the library file, or if none already exist under their names, the modules are inserted. Then the modules from the me TAL.OBJ are inserted; an error mes-sage is printed if the name of the module in TAL.OBJ already exists.

*

XLI B=XLI BID ,Z/U/G MOD NAME:

X<CR>

X<CR>

<CR>

ENTRY POINT:

SEC<CR>

SEC1 <CR>

<CR>

There are two object modules of the same name (X) in both Z and XLIB; these are first deleted from XLIB. This ensures that both modules X in file Z are correctly placed into the library. Entry points SEC and SECl are also deleted from the Entry Point Table, but automatically return when the library (XLIB) is updated in the future.

7.2.2.8 Listing the Directory of a Library File - The user may specify that a listing of the contents of a library file be output by indicating both the library file and a list file in the command line. Since a library file is not being created or updated, it is not necessary to indicate the mename on the output side of the command line; however a comma must be used to designate a null output library me.

Command Formats:

*,LP:=dev:lib or

* ,dev:list=dev:lib where:

dey: represents a device specification

lib represents the file name of an existing library file

LP: indicates the listing is to be sent directly to the line printer list represents a list file of the library file's contents

Examples:

*,DX1: LlST=LlBFI L

This command line outputs to disk 1 as LIST.LLD a listing of the contents of the library file LIBFIL.OBJ on the default deVice.

*,LP:=FLlB

This command outputs on the line printer a listing of all modules in the library file FLIB.OBJ stored on the default device. Assuming this library is composed of modules STOP, WAIT, and IMUL, is 2 blocks long, was created on September 6, 1978, and the listing was requested on September 6, 1978, the directory format appears as follows:

HT-ll LIBRARIAN FLiB

MODULE STOP WAIT IMUL

X02-05 6-SEP-78 ENTRY/CSECT STP$

SWAIT MUI$IS MUI$SS

6-SEP-78 2 BLOCKS ENTRY/CSECT

MUI$MS

$MLI

ENTRY /CSECT

MUI$PS

7.2.2.9 Merging Library Files - Two or more library files may be merged under one filename by indicating all the library files to be merged in a single command line. The individual library files are not deleted following the merge.

Command Format:

*dev:lib=dev:inputl, ... ,dev:inputn

where:

dev: represents a device specification

lib represents the name of the library me which will contain all the merged mes (if a library file already exists under this name, it must also be indicated in the input side of the command line in order to be included in the merge)

input represents the library mes to be merged together Thus, the command:

*MAIN=MAIN,TRIG,STP,BAC

combines library files MAIN.OBJ, TRIG.OBJ, STP.OBJ, and BAC.OBJ under the existing library me name MAIN.OBJ; all mes are on the default device DK:.

*FORT=A,B,C

This command creates a library me named FORT.OBJ and merges existing library mes A.OBJ, B.OBJ, and C.OBJ under the filename FORT.OBJ.

NOTE

Library mes that have been combined under PIP are illegal as input to both the Librarian and the Linker.

Im Dokument for the (Seite 173-181)