• Keine Ergebnisse gefunden

DEFINE AREA

Im Dokument DATA PROCESSING DIVISION (Seite 106-110)

1005 ASSEMBLY INSTRUCTIONS

ASSEMB LER-BO

4.9. EDIT INSTRUCTIONS

4.10.2. DEFINE AREA

SECTION:

Line 3: Define an In-Line Constant of XY(2 characters) to be assigned in the second and third characters of the jump instruction.

Line 4: Set the ILC to the address following the jump instruction.

NOTE: The value of $ as used in Line 2 differs from the value of $ as used in Line 4.

4.10.2. DEFINE AREA

1

Mnemonic: DA

LABEL OPERATION OPERAND 1 OPERAND 2

I. FIELD A ± INC. I. FIELD B ± INC. FIELD C ± INC.

A. A.

6 * 12 18

22 28 32 38

I

I I I I DIA I X XIX I

I

Function:

Allocate an area of working storage with a length as specified in Field A. Sub-tract the number of locations in the area from the value of the DLC. Use the new value + 1 of the DLC as the MSL of the area.

NOTE: This instruction will usually have a Label to be used for referencing by the programmer.

The loading of the Assembly program sets the initial value of the DLC to the last location of memory--R31/C31, B2 or R31/C31, B4. When an area of working

storage is required, the programmer uses the DA declarative to cause the Assembler program to allocate the required number of locations. This allocation begins at the last location of memory and proceeds toward the first location of memory by decrementing the value of the DLC by the size of the area required.

The number of locations to be allotted by the DA declarative is coded in columns 12, 13, and 14 of Field A. The maximum number of locations which can be allotted by a single DA instruction is 961.

The use of the DA declaratives to allocate working storage does not prevent the same locations from being assigned to instructions. In the event of a lengthy program, the assignment of instructions may increment the value of the ILC until it is greater than the value of the DLC. The programmer can recognize whether or not this situation has occurred by examination of the object printout from the Assembly processing.

The DA dec1aratives should be coded on a separate page of coding paper to en-able the programmer to obtain a "picture" of the full area of working storage.

It will also enable the programmer to assess the possibility of exceeding the

68

PAGE.

o

o

UP-4084

C-·

-.

c:'

1

UNIVAC 1005

ASSEMB LE R-SO

SECTION:

4

total memory capacity for working storage and instructions. Seven times the number of instructions (the maximum number of locations required for instructions) added to the ILC starting value will produce the ILC maximum value. The sum of the numbers in Field A of the DA and DC declaratives when subtracted from the starting DLC value will produce the lowest value of the DLC. The number of locations set aside for in-line constants and Indirect Address constant, if any, should be included.

The Define sub-field declarative is used in conjunction with the DA declarative to provide definition and labelling of sub-fields within the locations allocated by a DA declarative (See Section 4.10.2.1.)

The contents of the memory locations allocated by a DA declarative are not entered at object load time, and are not automatically set to blanks or zeroes.

Example 1:

Problem: Establish a working storage area of ten locations, to be used in the accumulation of a total.

LABEL OPERATION OPERAND 1 OPERAND 2

I. FIELD A ± INC. I. FIELD B ± INC. FIELD C ± INC.

A. A.

6 * 12 18 * 22 28 32 38

I

TIOITIAIL DIAl I 1101 I I I I I I I I I I J I

I

Solution: Assume that this is the first DA declarative to be assembled for an object program to be run on a two bank UNIVAC 1005. The loading of the Assembly program set the initial value of the DLC to l:l1922. The area TOTAL would be assigned to locations l:l1913 to l:l1922 inclusive. The label TOTAL is then used to specify the MSL of this 10 location area throughout the program.

The new value of the DLC is l:l1912 (l:l1922 minus 10).

4.10.2.1. DEFINE SUB-FIELD

The Define Sub-field declarative can only be used following a DA declarative.

The Define Sub-field declarative does not change the value of either the ILC or the DLC. It does not allocate memory.

The purpose of the Define Sub-field declarative is to establish labels for fields within an area that has been allocated by the immediately preceding DA declarative. The address assigned to th~ label of a Define Sub-field declarative is'determined by the Assembler pr9gram by calculating its location relative to the MSL of the area allocated by t~e ,DA declarative.

'\ I

The Define Sub-fie ld declarative is specified by placing a minus sign (-) in column 6. Complete specification of the Define sub-field declarative is as follows:

69

PAGE:

.... --~-- of defining sub-fields. Sub-fields may be overlapped, either partially or wholly, without producing inconsistent object code.

Example:

Given: A master card is to be read and transferred to working storage for the subsequent processing of detail cards.

Problem: Define an 8~ location area with sub-fields according to the following

UP-4084

4.10.2.2. Subfields of Specific Fixed Address Areas

There is a second use of the DA declarative which does not allocate working storage area. The purpose of this second use of the DA declarative is to enable the programmer to establish sub-fields for specific areas of memory.

Since these areas are "known" to the Assembler program, no allocation is made by the DA declarative.

The DA declarative specifies a known address (standard label, row column address or decimal address) in Field A, with or without an increment, and is followed by Define sub-field declaratives. The Define sub-field declaratives are used to define sub-fields within the area of the known address according to the

UP-4084 characters appearing on the constant continuatio~ card.

- - - -

Im Dokument DATA PROCESSING DIVISION (Seite 106-110)