• Aucun résultat trouvé

Systems Reference Library

N/A
N/A
Protected

Academic year: 2022

Partager "Systems Reference Library"

Copied!
76
0
0

Texte intégral

(1)

Systems Reference Library

IBM 1620 SPS III Programming System Reference Manual

This publication describes the specifications and operating procedures for both 1620 SPS III and 1620-1443 SPS III Pro- gramming Systems.

File No. 1620-21 Form C26-5793-0

(2)

This publication supersedes the following two publications:

IBM 1620 SPS III (Form C26-5749-1) IBM 1620 SPS III for IBM 1443 Printer (Form C26-5736-0)

Copies of this and other IBM publications can be obtained through IBM Branch Offices.

Comments concerning the contents of this publication may be addressed to:

IBM, Product Publications Department, San Jose, Calif. 95114

© 1963,1964 by International Business Machines Corporation

(3)

Contents

Page Page

IBM 1620 SPS III ... 1 1620 SPS III Processor Program . . . .. 52

Introduction ... 1 Storage Layout ... 52

Symbolic Programming ... 1 Paper Tape Processor Program ... 54

Coding Sheet ... 1 Card Processor ... 54

Statement Writing ... 4 Condensed Object Deck Alterations ... 59

Programming the 1620 Using SPS ... 10

Declarative Statements ... 10 Operating Procedures... 60

Imperative Statements ... 14

Processor Control Statements ... 22

Switches ... 60

Loading the Processor ... 60

1620 Subroutines ... 29

Subroutine Macro-Instructions ... 30

Processing the Source Program ... 61

Editing the Source Program ... 62

Floating Point Arithmetic ... . . .. 32 Error Messages ... 62

Description of 1620 Subroutines ... 34

Subroutine Error Messages ... 43

Adding Subroutines ... 44

Adding a Subroutine to a Card Deck '" . . . .. 44

1620-1443 SPS III Operating Procedures ... 64

Adding a Subroutine to Tape ... .'.. 46

Writing a Subroutine ... 48 Index ... 66

(4)

Preface

The Symbolic Programming System permits the pro- grammer to code in a symbolic language that is more meaningful and easy to handle than numerical machine language. SPS automatically assigns and keeps a record of storage locations and checks for coding errors. By relieving the programmer of these burdensome tasks,

SPS significantly reduces the amount of programming time and effort required.

This manual is intended to serve as a reference text for 1620 SPS III and 1620-1443 SPS III. It assumes the reader is familiar with the methods of data handling and the functions of instructions in the IBM 1620 Data Processing System. For those without such knowledge, information may be found in the following publications:

IBM 1620 Central Processing Unit, Modell (Form A26-5706)

IBM 1620 Central Processing Unit, Model 2 (Form . A26-5781)

IBM 1620 Input/Output Units (Form A26-5707)

IBM 1620 Data Processing System, Model 2 Binary Capabilities and Index Registers (Form A26-5764)

Machine Requirements

The minimum machine and special feature require- ments for assembling with 1620 SPS III are as follows:

1. 1620 Data Processing System with 20,000 positions of core storage.

2. 1621 Paper Tape Unit or 1622 Card Read-Punch.

3. Indirect Addressing (standard feature of 1620-2).

In addition to the above requirements, the 1443 Printer is required when assembling with 1620-1443 SPS III.

(5)

Introduction

The SPS III Programming System may be divided into the symbolic language used in writing a program, the library containing the subroutines and linkage instruc- tions (macro-instructions) that may be incorporated into the pr9gram, and the processor that is used to as- semble the user's programs.

Symbolic Language

Symbolic language is the notation used by the pro- grammer to write (code) the program. The program written in sps language is called a "source program."

This language provides the programmer with mne- monic operation codes, special characters, and other necessary symbols. The use of symbolic names (labels) makes a program independent of actual machine loca- tions. Programs and routines written in SPS language can be relocated and combined as desired. Routines within a program can be written independently with no loss of efficiency in the final program. Symbolic in- structions may be added or deleted without reassigning storage addresses.

Macro-instructions

The macro-instructions that are written in a source pro- gram are commands to the processor to generate the necessary linkage instructions. Linkage instructions provide the path to a subroutine and a return path to the user's program. These subroutines may be any of seventeen IBM Library subroutines like floating divide, square root, and arctangent; or special subroutines pre- pared by the user. The ability to proc~ss macro-instruc- tions simplifies programming and further reduces the time required to write a program.

Processor Program

After a source program is written, it is punched into cards or into paper tape. The source program is then assembled into a finished machine language program known as the object program.

Assembly is accomplished by the SPS III Processor program. The function of the processor is to translate the symbolic language of the programming system into the machine language of the 1620. The translation is one for one - the processor produces one machine language instruction for each source statement (except macro- instructions) .

IBM 1620 SPS III

Symbolic Programming

Symbolic programming may be defined as a method wherein names, characteristics of instructions, or closely related symbols are used in writing a program. The core of the symbolic language is the operation code. SPS per- mits the programmer to write (code) in a more simple, familiar language and does not require as detailed ma- chine knowledge because, in coding the program, the programmer uses operation codes that are in easily re- membered mnemonic form rather than in the numerical language of the machine. Operation codes are of three types: Declarative, Imperative, and Control.

Declarative Operation Codes

Declarative operation codes are used for assignment of core storage for input areas, output areas, and working areas. The assigned areas are utilized by the object pro- gram and may contain the data to be processed and/or the constants (numerical or alphameric characters) re- quired in the object program when the data is processed.

Declarative statements never generate instructions in the object program, but may generate constants that are assembled as part of the object program.

Imperative Operation Codes

Imperative operation codes specify the operations or instructions that the object program is to perform. In this group are included all arithmetic, branching, and input/ output statements. Most statements on the cod- ing sheet prepared by the programmer are of this type.

These statements are translated one for one and are assembled as the machine language instructions of the object program.

Control Operation Codes

Control operation codes are commands to the processor that prOvide the programmer with control over portions of the assembly process. Instructions of this type do not normally generate instructions in the object program.

The actual and mnemonic operation codes within these categories are presented under PROGRAMMING THE 1620 USING sPS.

Coding

Sheet

The programmer enters all information relevant to the coding of the source program and subsequent assembly

(6)

of the object program on coding sheet, Form X26-5627 (Figure 1). Figure 2 shows a sample input card, Form J59692. The format of the input card or paper tape record follows the headings on the coding sheet. In paper tape, the first punching position of a record is said to be column l. The card columns assigned to a single heading are referred to as a field. Following is an explanation of the headings in the order of their ap- pearance on the sheet.

Heading Line

Space is provided at the top of each page for the name of the Program, Routine, and Programmer, and for the date. This information does not constitute part of the source program language and is not punched.

Page Number (Columns 1-2)

A 2-digit page number is entered to maintain the order of the program sheets. This entry (normally numerical)

becomes the first two digits of each statement that is punched from the sheet.

Line Number (Columns 3-5)

A 3-digit line number is entered on the sheet to main- tain the sequence of the statements coded. The first 20 lines on each sheet are prenumbered 010, 020, 030, etc., through 200. At the bottom of the sheet, six nonnum- bered lines are provided for inserts or for continuing the line numbering. The inserted statement should be numbered so that it falls sequentially between the state- ments immed!ately preceding and following it. The arrangement of the prenumbered lines, 010, 020, etc., permits up to nine statements to be inserted between any two statements. After the cards for each of the lines are punched, they should be placed in correct numerical order.

IBr.,

1620/1710 Symbolic Programming System

Coding Sheet

Program: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Date: _ _ _ _ _ _ _ Page No. ~ of _ _ _

Routine: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Programmer: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Line Lobel bperation Operands & Remarks

3 5 6 11 12 15 16 20 25 30 35 40 45 50 55 60 65 70 75

o 1 0

· ·

0,2,0

· · · ·

0,3 0

· ·

I

o 4 0 I I

o 5 0 I

· · ·

o 6.0 I

·

I

o 7 0

· ·

o 8 0

· · ·

o I 0 0 9 0

·

I I I

I I

· . ·

1 I 0

·

I I -~

1 2 0

· · ·

I 3 0

· ·

1 4 0 I I I I I

I 5 0

·

I

. · ·

'-

I 6 0 I t

· · ·

.

I 7 0 ~. I I I

I 8 0

·

I I

1 9 0 I I I _J

2 0 0 I I ; I

·

, I I 1

· ·

1 1 I I I

·

I

· ·

I I

·

1 I I

·

I I I [ I 1 I I --L I I

.

I I --'

Figure 1. 1620/1710 SPS Coding Sheet

(7)

OPER. OPERANDS AND REMARKS

OPER. OPERANDS ANO REIIlARKS

000000000000000000000000000000000000000000000000000000000000000000000000000

12345'7"~"UUM~~U~"~~nn~~~nHH~~UU~~.n.H~~UU~U.UUUM~n~~ "~~M"~~~~~U"~Uh~nnnu~

111111111111111111111111111111111111111111111111111111111111111111111111111 222222222222222222222222222222222222222222222 33333333333 44444444444

5555555555555555555555555555555555555555555555555555555555555555555555~5555

999999999999999999999999999999999999999999999999999999999999999999999999999

1 2 3 4 5 6 7 • 9 10 11 12 13 14 15 16 11 .. 19 ~ ~ 222324 25 26 27 28 29 30 31 37 3J ~ 353& 37 38 39 40 41 4243 ~ 45 4& 47 4& 49 50 51 52 ~ ~ 55 ~ 57 58 5HO 61 62 &3 646566 67 68 69 10 1\ 72 lJ 74 75 .... J59fi92

Figure 2. SPS Source Program Card

Label (Columns 6-11)

The label ReId represents the machine location of either data or instructions. The ReId may be left blank or may be RIled with a symbolic address. Only the data or in- structions that are referred to elsewhere in the program need have a label.

A label may consist of up to six alphameric characters beginning at the left-most position in the label ReId. At least one of the characters must be alphabetic or one of four permissible special characters, namely, the equal sign (=), slash symbol (/), at sign (@), and period

(

.

).

The best labels to select are those that are mne- monically descriptive of the area or instruction to which they are assigned. Labels that have an obvious meanp iilg not only provide easily remembered references for the original programmer but also assist others who may assume responsibility for the program.

Operation (Columns 12-15)

The four-position operation ReId contains the actual two-digit numerical operation code or the mnemonic representation of the operation code to be performed.

If the Rrst character is numerical, no check of the oper- ation code occurs and the numerical parts of the two- digit internal representation of the Rrst two characters is taken as the operation code, that is, if the program- mer writes 4BNF, the resulting operation code is 42.

In either case, the Rrst character of the operation code must start in the lefbnost position, column 12, of the operation ReId. Listings of permissible mnemonic codes and actual operation codes are shown under PROGRAM- MING THE 1620 USING SPS.

Operands and Remarks (Columns 16-75)

The operands and remarks ReId is used to specify the information that is to be operated upon and may con- tain, if desired, any· additional remarks concerning the

statement.

For declarative operation statements, the Rrst oper- and usually deRnes the length. The remaining operands, if present, specify constants, an address, and remarks.

For imperative operation statements, the operands and remarks ReId contains, at most, four items: three of these are operands and the fourth, remarks. The Rrst two operands may be the symbolic or actual address of data or instructions, the P and

Q

portions of the in- struction. The third operand, which should be numeri- cal, is called the Hag indicator operand and is used to set Hags in the assembled instruction. The Rnal item consists of the remarks associated with each statement.

Imperative statements need not contain all four items.

Anyone or more than one may be omitted.

A control operation statement normally consists of only one operand.

(8)

Statement Writing

Certain rules must be observed in writing or coding the statements that make up the source program. This sec- tion contains rules that apply to the statements and their elements, rules governing the length and types of state- ments, use of special characters, the Hag indicator oper- and and immediate (Q) operand, types of addresses used as operands, and address adjustment by arithme- tic, a method that relieves the programmer of consid- erable eHort and reduces the number of symbols re- quired for a source program.

Statements

Symbolic statements are classed according to the oper- ation code they contain, and thus are designated De- clarative, Imperative, or Control statements. In addi- tion to the page and line number, a statement may con- tain a label, operation code, operands, and remarks.

No statement in the source program may exceed 75 characters in length. Since page number, line number, label, and operation require 15 positions, the operands, and remarks field may not exceed 60 characters. In the case of the paper tape sps, the end-of-line character is considered to be part of the operands and remarks field.

Use of Special Characters in Statement Writing

The comma, asterisk, end-of-line character, blank, at ( @) sign, and dollar sign are special characters which possess distinct meanings in the writing of source pro- grams. Their use as well as that of the special characters used as operators for address adjustment are explained in detail in this section.

COMMA

The comma is normally used to separate items in a statement. The term item refers here to parts of the operands and remarks field, such as the P and

Q

oper- ands, the Hag indicator operand, remarks, length, con- stants, etc. An imperative statement may consist of four items: the P and

Q

operands, the Hag indicator oper- and, and remarks, but need not contain all four items.

Anyone or more than one may be omitted.

If one item is omitted and more items follow, the comma that normally follows the omitted item must be present. For example, if the Hag indicator operand is omitted but remarks are present in the instruction, the format of the field will be:

Operands & Remarks

1$" 20 2S JO lS 40

All imperative statements that contain remarks must include three commas in the operands field, even when the operands are omitted. During assembly, the omitted P or

Q

operands will be replaced by zeros in the P or

Q

portion of the assembled instruction.

Commas indicating omission need not be present in statements in which the last item ( s) is omitted. For example, in the statement in which both the Hag indi- cator operand and remarks are omitted, no commas need be used follOWing the second operand.

Ope,ands & aomarks

2S JO .. 50

Examples

Statement 010 which is a halt operation requires three commas (, , ,) in front of the remarks, to take the place of the P, Q, and Hag indicator operands. In statement 020, the first two commas set oH the P and

Q

operands, whereas the third comma takes the place of the omitted Hag indicator operand. The number of commas required for declarative statements may be one or two as ex- plained under DECLARATIVE OPERATIONS.

ASTERISK

The asterisk has three uses: in writing comments (only), as an operand or term of an operand, and in address adjustment.

Lines of descriptive information may be inserted in the program by placing an asterisk (~) in column 6 of the label field. Comments then may be written in col- umns 7 through 75. Comments inserted in this way will appear in the symbolic output, but will not aHect in any way the operation of the program. A comment statement does not produce an entry in the object pro- gram.

so

(9)

Statements 010 and 020 are remarks that do not gener- ate instructions.

The asterisk is used as the first character or term of an operand in an imperative statement and is inter- preted by the program as the address of the high-order (leftmost) position of the address of the instruction. It may be used as any term of the operand to indicate the high-order (leftmost) position of the address of the

instruction.

When the asterisk is used in address adjustment as an operator, it indicates to the processor that a multiplica- tion must be performed in order to adjust the address.

PARENTHESES

Parentheses are used to enclose the integer that specifies which index register is to be used in modification of the operand.

Operand, & lema"',

NET

END-OF-LINE CHARACTER

An end-of-line character

®

is required on source statements that are to be processed on paper tape. Use of this character allows statements to be located on the

Line Lobel Operotiof1

-.l 5 6 11 12 15 16 ~ 25 30 3S

0,1.0 5)(2 8,

o

DDV.N.

.c)

tape immediately adjacent to each other, with no inter- vening blank characters. The statements are in "free"

form; that is, they are not assigned a fixed number of positions.

Source statements that are to be processed in punched card form do not require an end-of-line character; the remainder of the line is left blank and this is recognized by the processor as the end of the statement.

When the end-of-line character is punched in a card for off-line conversion to paper tape, it is represented by a 12, 5, 8 punch combination.

BLANK CHARACTER

A blank character in operands of the source statements is ignored by the processor except in DAC statements ( alphameric constants), in which blanks are considered valid characters. In effect, the statement is condensed before it is processed.

Because blanks are ignored by the processor, the pro- grammer, to achieve clarity on his coding sheets and output listing, may write his statements in modified

"fixed" fonn as shown in the example at the bottom of the page. In this example, columns 16, 36, and 57 are arbitrary choices for the locations of the operands. The comma following or replacing the P operand may be in any column from 16 through 35; the comma follow- ing or replacing the

Q

operand must be in column 56, the position preceding the flag indicator operand.

Operands & Remarles

.s SO 55

..,

6S 70 75

0.2.0 A, A RE.A. ",1'EJIJ',J -.4, " t, FOt F.H.E

1.,3,0 o • 0 ~, 1.No/,7 TF. 1 AI.l :X,s'UIN. Z,A,T I OJ'/. FOil 1 F.S1l8.0,J>..~ I ,.'p,E! I I I I

rA ___ x

I & I I I I I ' I I I .-1 I I I. I I I I I I ' --'

·

-'-

o 5 0

r.FH.

f.f,V,L T+ II ".4-

·

"LO

· ·

10,6.0 TJ),I( Sw'2+J, ,9

· · ·

I II 7 e TF Atc,H, ,liZ I

·

10 • 0 r.F TE,ItI,P3

.

,tiP E l T A,X

·

1 I

10 I 0 0

'.0

8. A. ill,S I,N,£ -T£H.P3 3" L .L _ TI.H.P.3.

· · ·

, 1 0 ODD,VN. A, 'A,c CIl", I I , . I • I I I I I I I "I1"aE.~P'J. I I t I I I I I I I I I I I I I I I

I.

I I I I I I I I

I.

, 2 • A X S lJBJI. t, r.lJrl.p.J.

· ·

-'

, 3 • C, ~ S fl8.N. , NIH,IS

·

L -'

1 • 0 8.N.H,

lA,S

Il'I.l- "' •• ,L. •

.

I I I I

1 S 0 'ftI.II.LT 'Ml'l ~,c~.tI.1f I

· ·

1 6 0 $F,

'.11

.L

·

(10)

Blanks are not permitted within a Bag indicator oper- and. For paper tape input, this operand must begin immediately following the second column and must be immediately followed by a comma or end-of-line char- acter. For card input, the Bag indicator operand can be followed by a comma, record mark, or blanks in the remainder of the card. A blank or blanks in the address operand of a declarative statement, when set off by commas, is interpreted by the processor as a zero ad- dress.

When the "at" sign (@) is used as part of a constant be- ing defined by a DC, DSC, or DAC statement, a record mark ( =F) is created by the processor and inserted into the constant in place of the @. Specific rules for use of the

@ are covered under DECLARATIVE OPERATIONS DOLLAR SIGN

The dollar sign ($) is used in an operand to instruct the processor that the symbolic address in an operand has a specific heading character. The $ is written between the heading character and the symbol. For example, in an operand the' heading character "5" and the symbol

"SUM" appear as 5$SUM. For additional information on the use of the $, refer to HEAD-HEADING in the Control Operations section.

Operands

FLAG INDICATOR OPERAND

The flag indicator operand specifies the positions that are to be Bagged in the assembled instruction. These positions are numbered from left to right, 0 through 11,

and must be listed sequentially. For example, if posi- tions 2, 7, and 10 are to be Bagged, the Bag indicator operand should be coded 2710, not 2107. All positions may be Bagged, if desired. The operand then will be coded 01234567891011 and must be written in that order.

Normally? no Bags are set when the Bag indicator op- erand is omitted. However, if the flag indicator operand is omitted from all immediate instructions, except TDM,

a flag is automatically set in position Q •. If the operand is present, only the positions indicated are flagged.

The flag indicator operand can be used to insert a Bag over the units position of the P and Q addresses, if the source program is written for a 1620 or 1710 that has Indirect Addressing.

IMMEDIATE ( Q OPERAND)

With immediate-type instructions such as Add Im- mediate (AM), Subtract Immediate (SM), and with actual operation codes that begin with the digit 1, the Q operand represents the actual data to be used by the

instruction. It may be absolute or symbolic as previous- ly defined. High-order zeros of absolute data may be eliminated.

During assembly, the processor automatically places a flag over position Q. of an immediate instruction un- less a Bag indicator operand indicates otherwise. For example, the statement

Operand. & Remark.

20 :IS )0

TOTI! L, 1002,3

causes the numbers 10023 to be subtracted from the field called TOTAL because the Bag that terminates the field to be subtracted is automatically placed over po- sition Q •. However, the statement

Operand. & Remark.

will cause only the number

23

to be subtracted from the field called TOTAL because the flag indicator oper- and directs that the field terminating Bag be placed over position QIO rather than Q •. There is one excep- tion to this rule: a Transmit Digit Immediate instruction

(TDM, code 15) does not require a Bag; therefore, none is automatically set by the processor.

MASK DIGIT OPERAND

A mask digit operand is required to specify the mask digit for the Branch on Mask and Branch on Bit in- structions. The D in the following examples shows the position of the mask operand in the source statement.

Operand. & Romark.

40 .,

which assembles to: 91 PPPPP DQQQQ

Operand. & ... ""

which assembles to: 90 PPPPP DQQQQ

The mask operand may be symbolic or absolute. The P, Q, and Bag operands are processed in the same man-

(11)

ner as for other instructions. If the mask operand is an absolute value, the units character replaces the Q7 character of the

Q

operand. For example:

Given:

line label Ps>-at .... Operand. & _ _ rIl.

'1 S , 1112

'" 20 H JO » 00 .S SO I.IA. Iffs ,12344

0.2.. lB. 11>.$ , .214-$'.'

will assemble to: 91 12344 13456

If the mask operand is a symbol, the units position of the symbolic address will be inserted in the Q. po- sition of the assembled instruction. For example:

Given:

Operands & Remark!

will assemble to: 91 12344 53456 Types of Addresses Used as Operands

Operands assembled by the processor may be of three types: actual, symbolic, and asterisk. The individual applications for a particular type of address are de- scribed in the section PROGRAMMING THE 1620 USING SPS.

ACTUAL ADDRESS

An actual address consists of five digits 00000-19999 for a standard capacity machine and is, as the name implies, the actual core storage address of a piece of data or an instruction. High-order zeros of an actual address may be eliminated. For example, the statement

Operand. & Remark.

368*".12251

causes the data in storage location 12251 to be added to the data in storage location 03684.

SYMBOLIC ADDRESS

A symbolic address is the name assigned by the pro- grammer to the location of an instruction or a piece of data. A symbolic address is valid only if it is defined (given an actual numerical value) by a declarative statement somewhere in the source program or if it is used as the label of an instruction. Symbolic addresses may contain from one to six characters (letters, digits, or special characters) with the follOWing restrictions:

a. At least one character must be nonnumerical.

b. The only permissible special characters are: equal sign (=), slash symbol (/), at sign (@), and period (.).

It should be noted that blanks have no meaning within a symbol because they are eliminated during assembly.

The example shown below contains both an actual address and a symbolic address.

Operand. & Remark, lS

.1225J

In this example, the data in the field whose actual address is 12251 is added to a field whose address is the symboliC name TOTAL.

ASTERISK ADDRESS

\Vhen the asterisk is used as the first character of an operand in an imperative operation, it is interpreted by the processor as meaning the address of the high- order (leftmost) position of the instruction itself. For example, the statement

Operands & Remarlts

indicates to the processor that the Q portion ~f the in- struction should contain the address of the instruction itself. This instruction is assembled as 44 01234 01876 where START equals 01234 and the address assigned to the instruction is 01876. Thus, when executed in the oh- ject program, this instruction examines its own leftmost position (01876) for a flag and either branches to the instruction at location 01234 or continues, on the hasis of the examination, to the next instruction located at . 01888.

(12)

When an asterisk (~) address is used with either declarative or control operations, it refers to the right- most position of storage last assigned by the location assignment counter of the processor - not to the left- most character of the instruction. For example, the statements

line label ~otion O!>orands & Remarlc.

3 5. " ' 2 IS 16 20 2S 30 lS

.. ..

SO

In 1 0 TFJt( 12o.4~, 70.0.0.0. ,

0,2,0 \D,c 1,1>, •

produce the instruction _ 16 12045 7000*

Since record marks can be defined only in declara- tive operations, an imperative statement should be fol- lowed by a DC statement when a record mark is re- (luired in the instruction. The rightmost position of the instruction is the rightmost position of storage last as- signed; therefore it is also the position where the

=4=

( constant) is stored.

Address Adiustment of Operands

Address adjustment is used to tell the processor to arithmetically adjust the addresses in operands. It is permitted with all types of addresses: actual, symbolic, and asterisk, and is used to refer to a location that is a given number of positions away from a specific ad- dress. Use of this feature of the l~nguage reduces the number of symbols necessary for a source program.

By writing a

+

(plus sign) for addition, - (minus sign) for subtraction, and 0 (asterisk) for multiplica- tion, immediately after the first or subsequent tenn of an operand (an asterisk as a term of an operand does not represent multiplication but means the address of the instruction, as previously explained), the program- mer indicates to the processor that the address is to be adjusted.

Arithmetically adjusted operands may take the form

(I, (I, #

of A -+- B -+- C -+- D, where the tenns A, B, C, and D may be numerical quantities. The number of terms in the operand is limited only by the size of the oper- and and remarks field. Thus the operand A

+

B 0 C - D may be further adjusted by writing after the last term another term, E, e.g., A

+

B • C - D

+

E.

In arithmetically adjusted operands, the opera- tion or operations of multiplication are -always per- formed first, followed by the addition and subtraction required to calculate the adjusted address. Intennedi- ate results that are greater than 10 digits, or a fin~l re-

suIt (adjusted address) that is over 5 digits, cannot be calculated by the processor.

In using address adjustment, the programmer should be careful that insertions or deletions do not affect the adjusted address. For example, if a P operand in a branch (B) instruction refers to an address as (I,

+

48 (i.e., branch to the instruction that follows the next three sequentially higher instructions), the program- mer must ensure that no new instructions are intro- duced within the three instructions to make the ~

+

48 incorrect. In this example the asterisk (~) is the left- most position of the instruction itself.

Examples

The operands shown will produce the adjusted ad- dresses, as indicated, provided the location 1000 has been aSSigned to the symbolic address ALPHA, the loca- tion 4 has been assigned the symbolic address L, and the instruction location «I,) is equivalent to 2000.

In some instructions such as the branch instruction, the

Q

address is not used, although a zero (00000) ad- dress is generated. Thus the instruction uses 12 storage positions. By using an (I, address in the following state- ments

Operands & Remarks IS •• III

the instructions are condensed, to eliminate four posi- tions of the unused (zero)

Q

address, and are stored as

49136680161204570000 whereas the statements

line loIN! b,.erafioo Operands & Remarks

I) S . 1111 .,. 10

" JO J5 '0 .5 50

0.' Ii. 13668 ' - ~

0.' N.EXT TFM 1t.O.r,70000 , ---'--"--'

(13)

are stored as

491366800000161204570000

because the unused

Q

address is not eliminated. In the first example, only four positions of storage are saved;

however, a considerable amount of storage can be saved in a program that contains many instructions where the Q or both the Q and P portions of instruc- tions are unused. Because the # in the DORG statement

(see CONTROL OPERATIONS) refers to the rightmost po- sition of storage last assigned (Ql 1 of the B instruc- tion), # -3 is the address where the next instruction starts.

By placing a minus sign in front of the first term of an operand, a Hag (minus sign) can be inserted over the units position of the adjusted address. This feature of address adjustment can be used for inserting Hags required for Indirect Addressing. However, an operand written as -0 (minus zero) does not insert the Hag in the units position over the zero. When the minus sign is written in front of the first term in order to set a Hag over the units position, other signs following the first term should be reversed so that the correct address is obtained.

Operand Modification with Index Registers

Any operand that can be indirectly addressed may be modified with an index register. The index register is specified by placing the number of the index register in parentheses, as shown in the following examples,

line label f:>perat;""

3 5 , 1111 lS16 ,.

" JO 3'

I .• A ADDR-5(3),5U8R(')

Oel.D A ADDR-S(A3),SUBR.(4')

either of which will be assembled as 21

XXXXx XXXXX

Operands & Remarks

..

., '"

The number in parentheses must be an integer from

o

to 7. The processor decodes the number and places the proper Hags over the operands. In the second ex- ample, the A in the index register portion of the P operand is ignored by the processor; however, it may be included by the programmer as an aid in keeping track of the index register band currently selected. The processor decodes the rightmost numerical character within the parentheses as the index register number.

(14)

Programming the 1620 Using SPS

This section describes the various steps to be followed in writing a program for the 1620 using sps. The material is divided into three categories: Declara- tive Statements, Imperative Statements, and Control Statements.

Declarative Statements

In programming the 1620, all records and any other data that is to be processed by the program must be assigned storage areas. Normally, all records and data to be processed consist of fields of known length and arrangement. Unless otherwise specified, areas are automatically assigned core storage locations in the order in which they appear in the source statements.

To assign addresses for instructions, constants, etc., the processor uses an address assignment counter. This counter is adjusted for .each assignment made by the processor. If an address is assigned by the program- mer, the counter is not adjusted.

The declarative statements provide the object pro- gram with the input/output areas, work areas, and constants it requires to accomplish its assigned task.

These statements do not produce instructions that are executed in the object program. The entries, DS, DSS, DAS, and DSB assign storage for work areas in the object program. The entries, DC, DSC, DAC, DSA, and DNB usually assign storage, and also produce, in the object program, both the machine address of the area assigned and the constants that are to be stored in this area. Constants are then loaded with the object program.

Declarative statements may be entered at any point in the source program. However, these statements are normally placed by themselves, preferably at the be- ginning or end of the program - not within the instruc- tion area. If not placed at the beginning or end, the programmer is required to branch around an area as- signed to data so the program will not attempt to exe- cute what is in a data area as an instruction.

The declarative mnemonic operation codes and their description are as follows:

Code Description

DS Define Symbol (Numerical)

DSS Define Special Symbol (Numerical)

DAS Define Alphameric Symbol

DC Define Constant (Numerical)

DSC Define Special Constant (Numerical)

DAC Define Alphameric Constant

DSA Define Symbolic Address

DSB Define Symbolic Block

DNB Define Numerical Blank

DS - Define Symbol (Numerical)

A DS statement may be used to define symbols used in the source program (i.e., to assign storage addresses or values to symbolic addresses or labels) and to assign storage for input, output, or working areas. A DS state- ment does not cause any data to be loaded with the object program.

The length of the field is defined by the first oper- and. This operand may be an absolute value or a sym- bolic name. If a symbolic name is used, the symbol must previously have been defined as an absolute value, that is, it must have appeared in the label field in a statement of the source program preceding the one in which it is used. Address adjustment may be used with this operand.

The address in core storage of the field being defined may be assigned by the programmer or the program- mer may let the processor assign the address. If the processor assigns the address, the statement is termi- nated after the first operand. If the programmer assigns the address, a second operand, which may be symbolic, asterisk, or actual, is used to establish the address of the field. Since data fields are addressed at their right- most (low-order) digit the processor assigns this po- sition as the address of the field. Address adjustment may be used with the second operand. If the second operand is symbolic, it also must previously have been defined. Addresses assigned by the programmer do not disrupt the sequence of addresses assigned by the processor.

A DS statement may also be used to define a symbol, without assigning any storage, i.e., to define it as an absolute value. In this case, the first operand is omitted (or written as 0) and the second operand represents the value (may not exceed five digits in length). The second operand may be an actual value or a previously defined symbol. To define storage which will not be referred to symbolically, the label of the DS statement may be omitted.

(15)

The following statements define the field length only.

When remarks are added to the statement, the field length must be followed by two commas.

line label ~i"" Operand ... rtu

5 . 1112 lSI' 1O 2$ JO l5 00 45 50

, D.EL rA}' lD.s 7

., DEL TA.>l OS 7 .•.• i.frl.O COilA-AS IlE(}.l/.! RoE/), ,F,oB- ,R,{ tM.!..,K,S, I

In the next example, the programmer assigns the address of the field and excludes the field length (the first operand) from the statement and replaces it with a comma. The following statements cause the processor to associate the address 12930 with the label SUM:

D

Again, in this example, two commas are required when remarks form part of the statement.

The following statement, which is similar to the one previously given, is assigned a value that is other than an address.

This statement defines the symbol FL as being equiv- alent to the value 17. Subsequent uses of this symbol are permitted because the symbol has been defined.

It should be noted that an area defined by the proc- essor for a DS statement is always addressed at the rightmost position. However, to use this area for in- put/ output, the leftmost digit must be addressed. This is done by using a DSS statement in place of a DS state- ment or by address adjustment with a DS statement, which subtracts a number that is one less than the length of the area from the address of the area. In a previous example, where DELTAX was defined as having a field length of 7, the operand of another instruction to read numerical data into the DELTAX field should be written as DELTAX-6.

DSS - Define Special Symbol (Numerical)

The DSS statement is similar to the DS statement with one exception: when the second operand is omitted,

the processor assigns the leftmost position as the ad- dress of the field. If a second operand is aSSigned by the programmer, this address is assumed to be equiv- alent to the leftmost position of the field. A DSS state- ment is normally used to define a storage area for in- put/ output. The data in such an area may be moved during execution of the object program by a Transmit Record instruction which requires that an address as- signed to an area be that of the leftmost position.

DAS - Define Alphameric Symbol

The DAS statement is similar to the DS statement with two exceptions:

Il

1. The length specified by the first operand is auto- matically doubled by the processor to allow for alphameric data. Each alphameric character re- quires two storage positions.

2. The address of the field, if generated by the pro- cessor, is the leftmost position of the field plus one.

The position is always odd-numbered, as it must be with any alphameric field.

The following example illustrates a DAS statement.

- - -

Line label Pr-ati<>'1 Operands & Remarks

5 . 1\1' 151, >0

" 1O " 00 ., 10

la '.0 T I T.L..{ j),AS iB.o ~

,

10.10 TI TL£ DA.S ~.O,J, ,R E/'tAR K S R EQ,U litE TW.O b,OHI1AS

This statement defines an area for input/output that can contain 30 alphameric characters. The processor assigns 60 positions in core storage to accommodate alphameric coding. The omission of the second operand causes the processor to assign an address. During in- ternal transmission of a field which utilizes an input/

output area that is defined with a DAS, the area must be addressed at its rightmost position. In the example, the address may be achieved through address adjustment, i.e:, TITLE+2°30-2.

DC - Define Constant (Numerical)

The DC statement may be used to enter numerical con- stants into the object program, and, for ease of refer- ence, to assign names to the constants. The lahel field contains the name by which the constant is known. DC

statements consist of three operands. The first operand indicates the length of the constant field; the second, the actual constant; the third, the storage address of the constant. The third operand is not used when the

(16)

programmer prefers to let the processor assign the storage address. The assigned address is the rightmost storage position of the constant. The leftmost storage position is the position over which the processor places a Hag.

Whenever remarks form part of a DC statement, three commas must be included in the statement. The first and third operands may be symbolic or actual. They are subject to address adjustment. A symbolic address must previously have been defined to be valid.

If the first operand (length of constant) is smaller than the constant, an invalid condition results. If it is larger than the constant, zeros are inserted to the left of the constant so that the number of zeros plus the number of positions in the constant equals the length of the field (first operand) .

A constant that is a positive number will be stored in the form of an unsigned integer; a negative number, in the form of a signed integer. A negative number has the minus sign written in front of the constant as part of the second operand. During assembly, a negative number produces a Bag (minus sign) over the units position of the constant.

If the constants 0100000 and -0004337769 are re- quired, they may be defined as follows:

Line Lobel p.-iOl1 Operonel. , Remark.

13 S , I I I ' 151' 20 7S 20 lS 40 .s SO

1 •. 1 •• It! ON.ST.J. be .7..100.000

~JA ic,o.N.S.T DC 7iJ 1 00000.,,1 3 COI'(lf.AS roON ,R,fI1.A,fK~.

030 CONST.2 DC J,O, ,,-,4.:3 37769 I I , I I I

I •• Ie.G'N-,s T.2 PC ILO,-.4.33..L7.6,9, ,,3, ,c,otfl1~..£.1,O& NlH,A,RKS

In both cases, constant 1 and constant 2, the length of field is greater than the constant, and the addresses of the constants are assigned by the processor. These constants will appear in the object program as

0100000 0004337769

A record mark may be used in a constant but must be in the units position and must be written as the character @. The follOWing example contains state- ments that:

1. Store a record mark by itself as a constant.

2. Store a constant 6 and record mark.

3. Store a minus 0773 and record mark.

,

These constants appear in the object program as:

6=t= =t=

0773 =t=

A constant

7

with a Bag

('7)

is generated by either of the following statements:

line Lobel ~o"on Operands & Remorks

1 S , 10 'S JO 40

I •. ' • C O,I{S T~zID.C 1, - 7, , S TQY_A.. ?_:~/J IfI..~~~ f J.AG~ ~ L~

, • • CO,N,S,T.2lP.C. Il.J,7,J".STO·iii A 7 :WI,TI!."A7j,A{t:~_:-:-:::::

A Bag is always placed over a one-digit constant (ex- cept a record mark), regardless of the sign. Therefore the programmer must use two positions to define a positive one-digit constant.

Constants may not exceed 50 characters. The follow- ing statement generates a constant containing 50 zeros.

, - - - - y - - - - r - - - - . - - - - . - - , - - - . - -- - - - Operands & Remorh

To store a zero with a Bag at location 00401, the fol- lowing statement can be used:

r-~--~~--- Operonds & Remarks

Because a label is not included in this statement, the actual address (00401) must be uSed by any other in- struction when referring to this constant.

DSC - Define Special Constant (Numerical)

The DSC statement is similar to the DC statement with two exceptions:

1. When the third operand is omitted, the address assigned by the processor to the field is that of the lefbnost position of the field. If the third operand is present, the address of the constant is assumed to be the leftmost position of the field, and the constant will be stored with its leftmost digit at this address when the object program is loaded.

2. A Hag is not placed in the leftmost position of the field.

(17)

DAC - Define Alphameric Constant

To define a constant consisting of alphameric data, the mnemonic DAC is used. The DAC statement is similar to the DC statement with three exceptions:

1. The first operand (length) is automatically doubled by the processor to allow two storage positions for each alphameric character.

2. The storage address of the constant is the address of the leftmost position plus one. This address must be an odd-numbered address to comply with the requirements for alphameric data stor- age. An odd-numbered address will automatically be assigned, if it is assigned by the processor. If it is specified by the programmer (as in line 020 of the following example), the processor assigns the specified address and provides that the con- stant is stored beginning one position to the left of the specified address. In the latter case, the processor makes no test of whether or not the address is odd-numbered or whether the address (or the position to the left) has been previously assigned.

3. High-order zeros are not automatically inserted in the constant by the processor, as in the case with a DC statement when the field length exceeds the number of characters. The number of char- acters including blank characters should not be greater or less than the specified length (first operand). When the rightmost position or posi- tions of the constant are blank characters, they should be followed by a comma or end-of-line character. For card input, the rightmost position must be followed by a comma or a record mark.

NOTE: Only DAC and DNB instructions may be used to insert blank characters into storage.

line label ~oti"" Operands & Remarks

1 5 ' 1112 151' 20 2S )0 )S 40 .$

10.I.oNOT£1 VA' J.7"DECH 3lf78 PUNCHED, ,ENp' !r1.£S!i.AG£

,901,STORE , ALPHA BlKS

0 1 0 'RMARI< ID,AC 1 " " , AL PH A, 1f~ F,OR OU,1~P,UT,

:A:R:E:C2

.. CDNST In,AC 13,D£LTAX=O.OOo~,,'s'iA~~ ~C.N'S'T,'R:M--,~_

In the example shown:

1. Statement 010 uses 34 storage positions to store the 17 -position constant (deck 3478 punched).

2. Statement 020 places 6 alphameric blanks into storage locations 00900 through 00911. Also, a Hag is set in location 00900.

3. Statement 030 records an alphameric record mark in storage.

4. Statement 040 places a 13-position constant, in- cluding a record mark, in storag~.

A 50-character alphameric constant (maximum allowable) occupies 100 positions of storage. A flag is set over the leftmost position of the field. Addressing this constant for internal field transmission requires the address OUTPUT +50 (t 2-2, where OUTPUT is the sym- bol (label) which represents the leftmost address plus one.

DSA - Define Symbolic Address

The DSA statement may be used to store a series of up to ten addresses as constants, as part of the object pro- gram. These addresses can be used for instruction modification or for setting up a table of addresses through which the programmer may index to modify a routine.

Each entry (symbolic or actual) in the operands field, with the exception of the last entry, is followed by a comma. The equivalent machine address of each entry is stored as a 5-digit constant. The constants are stored adjacent to each other with a flag over the high- order position of each. The label field of this state- ment must contain the symbolic name by which the table of constants may be referred to. An address at which this table is stored in core storage may not be assigned by the programmer nor may any remarks be included in the DSA statement. The address assigned by the processor is the address at which the rightmost digit of the first constant will be located.

NOTE: If the last operand is followed by a comma, an additional zero address (00000) is assembled in the table.

In the example that follows, symbols ALPHA, ORIGIN,

and OUTPUT are equivalent to addresses 01000, 00600, and 15000, respectively.

Operand. & Remarks

ORIGIN 1234 OUTPUT-50

The constants are stored as

01000006000123414950 (0120t)

1

(01204)

(18)

If the lefbnost digit of these four constants is located at 01200, then the address equivalent to TABLE will be 01204, the location of the rightmost digit of ALPHA.

DSB - Define Symbolic Block

A DSB statement is used to define an area of storage for storing a numerical array. A DSB statement does not cause any data to be loaded with the object program.

The label of this statement is converted to the address at which the first element of the array is stored (i.e., the righbnost position of the first element). The first operand indicates the size of each element, the second, the number of elements.

Either or both operands may be symbolic or actual.

If symbolic, the symbol must have been previously defined. A third operand is required if the programmer wishes to assign the address. For example, to store an array of 75 elements, each element containing 15 digits, the statements llsed would be:

Operands & R.marles

In this example, the array begins at location 01500 (lefbnost position of the first IS-digit element). ARRAY

is equivalent to 01514 (address of the first element).

DNB - Define Numerical Blank

A DNB statement is used to define a field of numerical blanks. (The 8-4 card code denotes a numerical blank.) Up to fifty blanks may be specified in each DNB state- ment. In addition to a label, two operands can be aSSigned by the programmer. The first of these specifies the number of blank characters desired (field length) and. the second, the rightmost address of the field where the blanks are stored in the object program.

If the second operand is omitted and the statement is labeled, the address assigned to the label by the processor is the rightmost storage position of the blank field. The blank field does not contain a Hag in its leftmost position.

If the programmer wishes to move a blank field in core storage, he must either define a single-digit con- stant with a Hag bit in the position in front of the left- most position of the blank field or a record mark in the position follOWing the rightmost position of the blank field.

If six numerical blanks are required, they may be defined as follows:

Operands & Remarles 3S

The processor assigns the storage address of the six blank positions to the label BLANKS. In the example that follows, the programmer assigns the storage address as 01625.

Operands & R.ma .... s

20 2S JO

625. STa1U s,)( LANHS

In a DNB statement, two commas are required when- ever remarks are included in the statement; the first after the length operand and the second after, or in place of, the address operand.

Summary of Declarative Statements

As stated earlier, areas being defined by the processor are assigned core storage locations in the order in which they are processed. To do this, the processor program uses a location assignment counter to keep track of the address of the last assigned storage loca- tion. Table 1 shows the amount added to the location assignment counter for each instruction and sum- marizes the coding and operation of each declarative operation. "Alpha Record Address" in the table refers to the leftmost position plus one of an alphameric field, whereas "Field Address" refers to the rightmost position of a field. The term "Numerical Record Ad- dress" refers to the leftmost position of a field.

Imperative Statements

This section describes the five classes of Imperative statements and· gives examples of statements in sym- bolic form. For a detailed description of the function of each instruction, refer to the appropriate machine reference manual.

Imperative statements are divided into five classes:

1. Arithmetic

2. Internal Data Transmission 3. Logic

4. Input/Output 5. Miscellaneous

Arithmetic Statements

Table 2 lists the Arithmetic statements, some of which pertain to special features. Since some features are

"speciar for the 1620 Model 1 and "standard" for the

Références

Documents relatifs

In below figure the pipe entrance

At the same time, 802.11 crackers commonly run their own wireless LANs (WLANs) and use their equipment for both cracking and home and community networking6. Attacks on GSM and

FINANCE: How the moneymen are moving in on Hollywood 40 , SCIENCE: DNAevidenceis upending our knowledge of early humans 42 ARTS:Met simulcasts are bringing live opera to Everyman

 Specific consultation: users must fill in the Carandell Economics Library special documents consulting application form, and can request a maximum of 3

We study the limiting behavior of a singularly perturbed Schrödinger- Poisson system describing a 3-dimensional electron gas strongly confined in the vicinity of a plane (x, y)

As a consequence we show that the Gaussian mollifier of the Wigner function, called Husimi function, converges in L 1 ( R 2n ) to the solution of the Liouville equation..

We describe a CHSH-Bell test where one photon of an entangled pair is amplified by a Measure and Prepare cloner and detected by using threshold detectors and a postselection

While a model with a single compartment and an average factor of reduction of social interactions predicts the extinction of the epidemic, a small group with high transmission factor