• Aucun résultat trouvé

WXTRN--Identify Weak External symbol

The WXTRN statement allows you to identify symbols referred to in a source module but defined in another source module. The WXTRN instruction differs from the EXTRN instruction as follows:

• The EXTRN instruction causes the linkage editor to make an automatic search of libraries to find the module that contains the external symbols that you identify in its operand field. If the module is found, linkage addresses are resolved; the module is then linked to your module, which contains the EXTRN instruction.

• The WXTRN instruction suppresses this automatic search of libraries. The linkage editor will only resolve the linkage addresses if the external symbols that you identify in the WXTRN operand field are defined:

In a module that is linked and loaded along with the object module assembled from your source module, or In a module brought in from a library because of the presence of an EXTRN instruction in another module linked and loaded with yours.

The format of the WXTRN instruction is:

Name operation Operand

A sequence WXTRN one or more relocatable

symbol or blank symbols separated by

commas

The external symbols identified by a WXTRN instruction have the same properties as the external symbols identified by the EXTRN instruction. However, the type code assigned to these external symbols differs.

Note:

If a symbol, specified in a V-type address constant, is also identified by a WXTRN instruction, it is assigned the same type code as the symbol in the WXTRN instruction.

If an external symbol is identified by both an EXTRN and WXTRN instruction in the same source module, the first declaration takes precedence, and subsequent declarations are flagged with warning messages.

Chapter 3. Addressing, Program Sectioning, and Linking 67

CHAPTER 4. MACHINE INSTRUCTION STATEMENTS

GENERAL INSTRUCTIONS

DECIMAL INSTRUCTIONS

This chapter introduces the main functions of the machine

instructions and provides general rules for coding them in their symbolic assembler language format. For the complete

specifications of machine instructions, their object code

format, their coding specifications, and their use of registers and virtual storage areas, see the appropriate principles of operation manual for your processor.

At assembly time, the assembler converts the symbolic assembler language representation of the machine instructions to the corresponding object code. It is this object code that the computer processes at execution time. Thus, the functions described in this section can be called execution time functions.

Also at assembly time, the assembler creates the object code of the data constants and reserves storage for the areas you

specify in your DC and DS assembler instructions (see "Data Definition Instructions" on page 90). At execution time, the machine instructions can refer to these constants and areas, but the constants themselves are not executed.

As defined in the appropriate principles of operation manual, there are five categories of machine instructions:

• General instructions

• Decimal instructions

Floating-Point instructions Control instructions

• Input/Output operations

Each is discussed in the following sections.

You use general instructions to manipulate data that resides in general registers or in storage, or that is introduced from the

instruction stream. These instructions include fixed-point, logical, and branching instructions; in addition, they include unprivileged status-switching instructions. Some general

instructions operate on data that resides in the PSW or the TOD clock.

The general instructions treat data as being of four types:

signed binary integers, unsigned binary integers, unstructured logical data, and decimal data. Data is treated as decimal by the conversion, packing, and unpacking instructions.

For further information, see "General Instructions" in the appropriate principles of operation manual.

You use the decimal instructions when you wish to perform arithmetic and editing operations on data that has the binary equivalent of decimal representation, either in packed or zoned form. These instructions treat all numbers as integers. For example, 3.14, 31.4, and 314 are all processed as 314. You must keep track of the decimal point yourself.

Additional operations on decimal data are provided by several of the instructions in "General Instructions" in the appropriate 68 Assembler H Version 2 Application Programming: Language Reference

o

o

o

o

principles of operation manual. Decimal operands always reside in storage, and all decimal instructions use the SS format.

For further info~ation, see "Decimal Inst,-uctions" in the appropriate principles of operation manual.

FLOATING-POINT INSTRUCTIONS

CONTROL INSTRUCTIONS

You use floating-point instructions when you wish to perform arithmetic operations on binary data that represents both

integers and fractions. Thus, you do not have to keep track of the decimal point in your computations. Floating-point

instructions also allow you to perform arithmetic operations on both very large numbers and very small numbers, with greater precision than with fixed-point instructions.

For further information, see "Floating-Point Instructions" in the appropriate principles of operation manual.

Control instructions include all privileged and semiprivileged machine instructions, except the input/output instructions (see below).

Privileged instructions may be executed only when the processor is in the supervisor state. An attempt to execute an installed privileged instruction in' the problem state generates a

privileged-operation exception.

Semi·privileged instructions are those instructions that can be executed in the problem state when certain authority

requirements are met. An attempt to execute an installed semiprivileged instruction in the problem state when the authority requirements are not met generates a

privileged-operation exception or some other

program-interruption condition depending on the particular requirement that is violated.

For further details, see "Control Instructions" in the appropriate principles of operation manual.

INPUT/OUTPUT OPERATIONS

You can use the input/output instructions (instead of the

IBM-suppled system macro instructions) when you wish to control your input and output operations more closely.

The input or output instructions allow you to identify the channel or the device on which the input or output operation is to be performed. However, these are privileged instructions, and you can use them only when the processor is in the

supervisor state but not when it is in the problem state.

For more information, see "Input/Output Operations" in the appropriate principles of operation manual.

BRANCHING WITH EXTENDED MNEMONIC CODES

The branching instructions described below allow you to specify a mnemonic code for the condition on which a branch is to occur.

Thus, you avoid having to specify the mask value required by the BC and BCR branching instructions. The assembler translates the mnemonic code that represents the condition into the mask value, which is then assembled in the object code of the machine

instruction.

Chapter 4. Machine Instruction Statements 69

STATEMENT FORMATS

The extended mnemonic codes are given in Figure 17 on page 71.

They can be used as operation codes for branching instructions, replacing the BC and BCR machine instruction codes (see (1) in Figure 17). Note that the first operand (see (2) in Figure 17) of the BC and BCR instructions must not be present in the

operand field (see (3) in Figure 17) of the extended mnemonic branching instructions.

Note:

The addresses represented are explicit addresses (see (4) in Figure 17); however, implicit addresses can also be used in this type of instruction.

Machine instructions are assembled into object code according to one of the formats given below: