Text preview for : J28-6186-32K-FAP.pdf part of IBM J28-6186-32K-FAP IBM 7090 J28-6186-32K-FAP.pdf
Back to : J28-6186-32K-FAP.pdf | Home
IBM 709 17090 DATA PROCESSING SYSTEMS BULLETIN
PRELIMINARY BULLETIN
FORTRAN ASSEMBLY PROGRAM-) FOR THE I B M 709 / 7090
- - (FAP
SUPPLEMENTARY INFORMATION FOR-
- THE 32K VERSION
-
T h i s bulletin was p r e p a r e d by IBM Applied P r o g r a m m i n g a s a supplement t o
the FORTRAN A s s e m b l y P r o g r a m ( F A P ) f o r t h e IBM 70917090, ( F o r m
J28-6098-I), and together with t h a t publication, p r o v i d e s c u r r e n t s p e c i f i c a t i o n s
f o r F A P p r o g r a m s t o be r u n on 32K 709 o r 7090 Data P r o c e s s i n g S y s t e m s ,
operating u n d e r e i t h e r the FORTRAN o r B a s i c Monitor (IBSYS).
Included h e r e i n a r e d e s c r i p t i o n s of new p s e u d o - o p e r a t i o n s , with s e c t i o n s on
t h o s e connected with m a c r o - o p e r a t i o n s and updating, and complete S y s t e m
Symbol and Combined Operations T a b l e s . F o r additional information on F A P
o p e r a t i n g u n d e r the B a s i c Monitor (IBSYS), t h e r e a d e r i s r e f e r r e d t o the IBM
p r e l i m i n a r y bulletin, B a s i c Monitor (IBSYS), ( F o r m J28- 8086).
Coding i s indicated throughout t h i s bulletin by the u s e of a l l c a p i t a l l e t t e r s
f o r a c t u a l coding; e . g . , CLA.
B e c a u s e of the p r e l i m i n a r y n a t u r e of t h i s bulletin, t h e m a t e r i a l i t c o n t a i n s ,
t o g e t h e r with a n y n e c e s s a r y additions and c o r r e c t i o n s , will be published i n a
m o r e complete f o r m a t a later date.
CONTENTS
The F A P M a c r o - O p e r a t i o n P r o c e s s o r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E x a m p l e s of P r o g r a m m e r M a c r o - O p e r a t i o n s . . . . . . . . . . . . . . . . . . . . .
Macro-Defining Pseudo.Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MACRO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Location F i e l d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The A r g u m e n t L i s t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extending The A r g u m e n t L i s t . . . . . . . . . . . . . . . . . . . . .
Alternative F o r m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Location F i e l d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Operation F i e l d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The V a r i a b l e F i e l d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nesting Macro-Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R e s t r i c t i o n s i n Macro-Definitions . . . . . . . . . . . . . . . . . . . . . . . . . .
Macro-Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Punctuation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Argument Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nested M a c r o-Ins t r u c tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The G e n e r a t e d C a r d s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CreatedSymbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
NOCRS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ORGCRS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IRP ..........................................................
RMT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Updating Symbolic F A P T a p e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
UPDATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
NUMBER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IGNORE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SKIPTO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ENDFIL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
REWIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
UNLOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SKPFIL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
UMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ENDUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tape Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Update E x a m p l e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Additional Symbol Defining P s e u d o - O p e r a t i o n . . . . . . . . . . . . . . . . . . . . . . . . . . 28
SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Additional P r o g r a m Linking P s e u d o - O p e r a t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 28
EXTERN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Additional List Control Pseudo-Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
NULL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Additional Conditional Assembly Pseudo - 0 p e r ation . . . . . . . . . . . . . . . . . . . . .
IFF ...........................................................
Revised Pseudo-Operations ..........................................
CALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ENTRY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LBL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LOG. ORG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PRINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
TAPENO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AdditionalRevisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix I: Combined Operations Table ............................. 35
Appendix 1 :
1 System Symbol Table. FORTRAN Monitor. . . . . . . . . . . . . . . . 45
Appendix 1 1
1: F A P Operating Under the Basic Monitor ................. 47
THE F A P MACRO-OPERATION PROCESSOR
A F A P m a c r o - o p e r a t i o n i s a type of pseudo-operation c r e a t e d by
t h e p r o g r a m m e r . The m o s t significant p r o p e r t y of a n i n s t r u c t i o n
- -
specifying a m a c r o - o p e r a t i o n ( a m a c r o - i n s t r u c t i o n ) i s that i t c a n
g e n e r a t e one o r m o r e c a r d i m a g e s . The contents of the c a r d
i m a g e s g e n e r a t e d a r e virtually u n r e s t r i c t e d and m a y include any
m a c h i n e operation, any pseudo-operation not r e s t r i c t e d t o the
f i r s t c a r d group ( e . g . , COUNT, ENTRY), o r any m a c r o - o p e r a t i o n ,
and any f i e l d p e r m i t t e d on a F A P s o u r c e c a r d .
A m a c r o - i n s t r u c t i o n c a n be r e g a r d e d a s a n abbreviation f o r a
sequence of c a r d i m a g e s . The sequence of c a r d i m a g e s g e n e r a t e d
by the m a c r o - i n s t r u c t i o n i s d e t e r m i n e d by the p a r t i c u l a r m a c r o -
definition c o r r e s p o n d i n g t o the m a c r o - i n s t r u c t i o n code. E a c h
m a c r o - o p e r a t i o n h a s i t s own definition, which c o n s i s t s of a head-
ing c a r d , a sequence of prototype c a r d i m a g e s , and a n END c a r d .
A prototype c a r d image h a s a s t a n d a r d F A P s o u r c e c a r d f o r m a t
with location f i e l d , operation code, and v a r i a b l e f i e l d . R e m a r k s
m a y a p p e a r on a prototype c a r d ; however, the r e m a r k s will not
n o r m a l l y a p p e a r following the v a r i a b l e f i e l d on the m a c r o -
g e n e r a t e d c a r d i m a g e . The f i e l d s of a prototype c a r d m a y con-
s i s t of: t e x t . which - w i l l be r e p r o d u c e d a s written; substitutable
a r g u m e n t s ; and ( s p e c i a l ) punctuation c h a r a c t e r s , which d e l i m i t
a r g u m e n t s and, like t e x t , a r e r e p r o d u c e d .
A f i e l d o r subfield i s text if i t i s longer than s i x c h a r a c t e r s o r if
i t i s a s t r i n g of one through s i x c h a r a c t e r s , delimited by punctuation
m a r k s , which d o e s not a p p e a r in the a r g u m e n t l i s t of the m a c r o -
o p e r a t i o n heading c a r d . A field o r subfield i s a substitutable
a r g u m e n t if i t i s a s t r i n g of one through s i x c h a r a c t e r s which
a p p e a r s i n the a r g u m e n t l i s t af the m a c r o - o p e r a t i o n heading c a r d .
A m a c r o - g e n e r a t e d sequence of c a r d i m a g e s c o n s i s t s of e a c h of the
prototype c a r d i m a g e s , with text and punctuation c h a r a c t e r s a s on
the prototype, but with substitutable a r g u m e n t s r e p l a c e d by
specific a r g u m e n t s t r i n g s (of u n r e s t r i c t e d length) whose position
i n the a r g u m e n t l i s t of the m a c r o - i n s t r u c t i o n c o r r e s p o n d s t o that
i n the a r g u m e n t l i s t of the macro-definition heading c a r d .
E x a m p l e s of P r o g r a m m e r Macro-Operations
Suppose that the p r o g r a m m e r h a s w r i t t e n a s o u r c e p r o g r a m which
will a s s e m b l e , including the following s e q u e n c e s of i n s t r u c t i o n s :
.a.
CLA FEDTAX
ADD S T A T AX
ST0 TOTTAX
1..
* a *
SUBCOM C C A
ADD
ST0
a*.
aaa
C LA PARTl
ADD PART2
ST0 TOTAL
The pattern 05 these t h r e e instructions might be designated by
s
some BCD name, say QSUM, which coslld then be defined as
follows:
t
QSUM MACRO VlrV2rV3 I
CLA V1
ADD V2 I
ST0 V3 I
QSUM END
J
The above sequence of five source c a r d s generates no binary
words in the object program, but constitutes the definition of the
macro-operation which the p r o g r a m m e r h a s chosen t o call
QSUM. The f i r s t c a r d i s the macro-definition heading c a r d . J;t.
includes the name of the macro-operation in the location field
and the argument l i s t in the variable field. The next t h r e e c a r d s
a r e the prototype, in which V1, V2, V3$ a r e substitutable a r - 3
guments<, identified in the heading c a r d argument l i s t . A31 of the
other fields, CLA, ADD, STO, a r e text, since they do not ap-
p e a r i the argument l i s t . The fifth c a r d (ENDIJm a r k s the end of
n
the range of the mmro-definition. It will not terminate assembly.
Once the macro-operation QSUM has been defined in the source
p r o g r a m , the sequence of CLA, ADD, STO, instructions m a y be
replae'ed by a macru-injstruction c a r d which. generates the se-
quenc& a$ instructions with their substitutable arguments replaced
by the arguments in the variable field of the maaro-instruction
QSUM:
*--
* a * I
..a
I
00127 QSUM FEDTAXISTATAXITOTTAX
a.
.a.
a
11
SUBCOM QSUM XSUBlrYSUBleZSUBl
.a. 1
.a.
QSUM P A R T 1 r.PART2, T O T A L I
Note, in the above example, the following points:
1. The string QSUM which appears in the location field of the
pseudo-operation MACRO is not a symbol, but a code for
the macro-operation to be defined, and a s such is entered
into the Combined Operations Table. It may be the same a s
a location symbol?qpearing anywhere in the assembly,
including symboEs\within the macro-definition.
The substitutable arguments V1, V2, V3, which appear in
the variable field of the macro-definition heading c a r d and
a l s o in various fields within the prototype, merely
characterize the order of the expressions and character
strings which may appear in the variable field of a l a t e r
macro-instruction using the given macro-operation. If, on
the macro-operation heading card, the order were to be
changed to V3, V1, V2, then the macro-instruction
QSUM TOTTAXsFEDTAXvSTATAX
would cause generation of the same c a r d images. Because
the substitutable arguments a r e dummy names, they may be
identical to strings used elsewhere in the program in
location, operation, or variable fields, a s symbols o r
operation codes, including the code for this or any other
macro-operation. The programmer should exercise caution
in constructing the prototype so the text will not be confused
with substitutable arguments, as every string of s i x o r
fewer characters, in any field, is compared with the argument
l i s t . Special c a r e should be taken with alphameric text, or
with fields of VFD, DEC, or OCT pseudo-operations.
In the simple example of the macro-definition given above, the
substitutable arguments appeared in address fields in the proto-
type and were replaced by symbols on the macro-generated
cards. In general, substitutable arguments may appear in the
location field, the operation field, in any of the subfields of the
variable field, or a s a heading character in any subfield. The
substitutable arguments may be replaced by any valid F A P ex-
pression or appropriate alphameric character strings.
If a substitutable argument appears in an operation field, i t may be
a string of one through six characters; however, the code which
replaces it must be a standard FAP operation code of three through
six characters.
F o r example, the following definition could be written:
I
QPOLY MACRO COEFFILOOPPDEGPT~OP
AXT
LDQ
DEG9T
COEFF
I
LOOP FNP
0P
GAMMA
COEFF+UEG+lpT
I
XCA I
TIX LOOPrTsl
QPOLY END I
Here mnemonic character strings have been chosen to represent
the substitutable arguments. Notice that LOOP appears in a
location field, OP in an, operation field, and that COEFF and DEG r
appear a s symbols and within, expressions in address subfields.
Notice also that GAMMA is text * - asymbol, and not a substitutable
dummy argument - and)presumably will be defined elsewhere in *
the program.. Any use of t h e code QPOLY in a macro-instruction
should be accompanied by a n argument l i s t of appropriate sub-
stitutions for the substitutable arguments. F o r example, LOOP
should be replaced by a symbol, which should not be multiply
defined, and OP should be replaced by a valid operation code.
A QPOLY macro-instruction might. be written:
I
02031 X015 QPOLY Cld4rFIRST95r4rFAD I
% . I
The macro-instruction would cause the following six c a r d images
to be generated:
I '
I
02031 0774 00 4 00005 AXT 594
02032 0560 0 0 0 06161 LDQ C1-4 I
92033 0260 00.0 00135 FIRST FMP GAMMA
02034 0300 00 0 06167 FA U C1-4+5+lt4 I
02035 ' 0 1 3 1 00 0 00000 XCA
02036 2 00001 4 02033 TIX FIRST9491 I
I
The symbol X015 i s defined a s the location in which the f i r s t in-
struction (AXT) appears; each of the substitutable argument s i s
replaced by the corresponding argument in the macro -instruction
argument l i s t . The expression arising f r o m the prototype a d d r e s s
C0EFFtDEG-t 1 i s equivaleht to C 1t 2 .
Use of the m a c r o-operation processor permits simulation o machine
f
instructions of another computer, o r extending the machine
operation vocabulary of 'the 709/7090.
F o r sxa&iple, S T 0 can be modified to dump the information stored r
on each execution:
I
0601 7 1 1 60000 *ST0 OPSYN ST0
M ST0 MACRO A I
*ST0 A
SXA *+294 I
TSX DUMP r 4
AX T ** 94 I
. ST0 END
1
The M flag, appearing in the left margin of the assembly listing to
point out a redefinition of a n existing code,does not indicate an
assembly e r r o r .
MACRO-DEFINING PSEUDO-OPERATIONS
MACRO
The pseudo-operation MACRO is used to name a macro-operation
and to identify the arguments in the succeeding prototype. The
constituents of the MACRO pseudo-instruction a r e :
1. Three to six-BCD c h a r a c t e r s (not all z e r o s ) , appearing in
the location' field;
."
2. The operation code MACRO, appearing in the operation field;
and
3. A l i s t o f substitutabledumrnyarguments, a p p e a r i n g i n t h e
variable field.
The Location Field
The c h a r a c t e r string in the location field is not a location symbol
and will subsequently be used a s a macro-operation code. If i t
i s the same a s any other machine ope'ration, pseudo-operation,
o r macro-operation, the pseudo-operation will be flagged, the
code will be redefined within the Combined Operations Table and
the f o r m e r definition lost.
. .
The Argument L i s t
The substitutable arguments in the macro-definition heading card
argument l'ist may be any Iegal FAP symbols, or may consist of
all numeric c h a r a c t e r s (excluding a l l z e r o s ) . The substitutable
arguments in a rnacko-definition may be separated by any of the
following punctuation characters:
and the argument l i s t i s terminated by the character "blank. 11
After a punctuation character, suceeding' punctuation c h a r a c t e r s
o r a n explicit z e r o a r e ignored and do not r e s u l t i n a substitutable
argument of z e r o .
Suggestive notation ib.a?macro-definition argument l i s t may be used.
y -
F o r ~ e x a m p l , in a macro-definition heading argument l i s t
e
\-
I . ALPHA MACRO, A(B+C)-USE I
I
i s identical with
1 --/
I ALPHA MACRO AIBPCIDVE I
Extending the Argument List
The argument l i s t of a macro-definition heading card may be ex-
tended by the use o the ETC pseudo-operation. In order that a
f
following ETC card be recognized, it is necessary that the follow- u
i q conventions apply to the preceding card:
1. An unmatched left parenthesis exists in the variable field; or, *
2. The variable field i s terminated by a $ immediately followed
by a blank or card column 73. This will not be confused with
the use of this character to signal a heading character o r a
transfer vector name, a s in neither o those cases w i u g h ~ t $
f
be immediately followed by a blank; or
3. The variable field extends to card column 7 2 ; . -
If a card with a n unmatched left parenthesis is not immediately
followed by an ETC card, an assembly e r r o r will be flagged. If a
card with a terminal $ is not followed by a n ETC, the terminal $
i s deleted from the macro-definition and ignored.
If the preceding card does not follow these conventions, an ETC
card will be treated a s the f i r s t card in the prototype, and an
assembly e r r o r w l usually result.
il
Alternative F o r m
An alternative form of the MACRO pseudo-instruction is the
following :
1. BXanks, appearing in the location field;
2. The operation code MACRO,', appearing in the operathxannf%&&
and
3. Blanks, a p p e a r i n g i n t h e v a r i a b l e f i e l d .
The above card is immediately followed by a c m & w i t h the=
fields:
1. A FAP symbol, appearing in the location fieldj;;
2, Three to six-BCD characters appearing in the operatiom
to be used a s the macro-operation code; and
3. A E s t of s ~ i t u t a b l e
arguments, appearing in the variable 3
field,
A symbol, which may appear in the location field of the second eard,
is considered to be a substitutable argument, and not a location
symbol. It i s replaced by the corresponding argument in the
location field of the macro-instruction card .This field i n the macro -
instruction i s a specific argument, and not a location symbol. If it
appears i n the variable field of a n instruction, it must be defined
elsewhere in the program.
MOP
The pseudo-operation MOP i s also used t o define a macro-operation.
The constituents of the MOP pseudo-instruction a r e :
1. Blanks, appearing in the location field;
2. The operation code MOP, appearing in the operation field;
and
3. The macro-operation code, followed by the argument list,
appearing in the variable field.
MOP is identical to MACRO except that the macro-operation code
being defined appears a s the f i r s t subfield in the variable field,
followed by a punctuation character and the argument l i s t .
The Prototype
The prototype follows the macro-definition heading c a r d . It
consists of a s e r i e s of F A P instructions which use the substitutable
arguments listed in the variable field of the preceding MACRO
o r M O P . The prototype must be followed by an END card with
the macro-operation code in i t s location field o r variable field,
o r with both the location field and the variable field blank.
To lend greater flexibility to macro-operations, parentheses and
the apostrophe have been included in the l i s t of special characters
which may be used within the various fields of the macro-definitions .
Thus, neither may be used a s p a r t of a substitutable argument.
Remarks cards with an asterisk in column 1, appearing within a
m a c r o -definition, will not appear in the expansions.
Heading characters in effect within the region in which the macro-
definition appears do not apply to the definition.
A substitutable argument or any F A P symbol may appeal: in the
location field of a prot;s$ype instruction.
The Operation Field
1
.J
The following may appear in the operation field of a prototype in-
s truction: any substitutable argument, any machine ope ration,
any pseudo-operation not restricted to the f i r s t card group ( e . g . ,
COUNT, ENTRY) ,or any macro-operation code.
The Variable Field
v
A blank, if encountered before card column 72 on a prototype
c a r d (except the c a r d s BCD, BCI, REM, TTL), is considered to
terminate the variable field, and any information o r commentary
to the right of the blank will not be included in the macro-definition.
If the blank appears following an unmatched left parenthesis, how-
ever, the blank does not terminate the scan. Blanks within
parenthesis a r e considered to be text. If a matching right
parenthesis i s not encountered before card column 73, an ETC
c a r d must follow. Unmatched parentheses cause a n assembly
error.
Alphameric cards a r e scanned in full for substitutable arguments.
I the variable field of BCD card (beginning in card column 12), o r
f
a BCI card (beginning in card column 12-16), commences with a
non-blank, non-numeric character, the f i r s t subfield should be a
substitutable argument for which a count will be substituted in the
macro -instruction argument l i s t .
The apostrophe (8-4 punch) may be used to concatenate (link)
partial subfields in the operation field o r in the variable field. It
i s possible to create a single subfield f r o m a combination of
arguments and text, a s delimits an argument in the macro-de-
finition prototype, but i s itself not included in the macro-
definition. The ! character cannot be used to concatenate sub-
fields of lower level nested macro-definitions. F o r example, to
delimit the count on a BCD prototype card, the following may be
used:
i
A L P H A MACRO AIB~C I
BCD A ' O ' 0 ' ERROR. CONDITION'C' IGNORED.
A L P H A END I
I
The macro-instruction
1
02233 ALPHA 7rFIELUv I
I
will cause the following card to be generated:
I
02233 006060263125 BCD 7 0 F I E L D ERROR* C O N U I T I O l \ IGNORED* I
The following illustrates macro-generation of a n o,peration code
by means of concatenation:
J TAPENO A6B
K TAPENOBlL
NAME4 MACRO AsBICSDSESFSG
A B'T'C'D E
SD'F 6
NAME4 END
NAME4 AXSWIDIJIILS**
AX WTDJ
SOL **
NAME4 AY~RSBISS~NSK
AY RTB 5
SDN K
If parentheses a r e to be used as a p a r t of text, the enclosed string
must not appear in the macro-definition heading argument list, o r
the string will be considered a substitutable argument.
If a heading character of the f o r m A$B is required, either A o r B
o r both may be substitutable arguments.
If a transfer vector name is required of the f o r m $NAME, NAME
may be a substitutable argument.
If a literal of the f o r m =A is required, A may be a substitutable
argument for which a valid f o r m of a literal must be substituted.
The variable field of any c a r d in the prototype may be extended by
the use of the ETC pseudo-operation. In order that a following
ETC c a r d be recognized, it is necessary to follow the conventions
stated for extending a macro-definition heading card argument
l i s t (page 6 ) . The programmer should exercise caution that a
macro-generated c a r d image which overflows column 7 2 has a
variable field which is properly extended by a n ETC card. Such
variable fields a r e limited to those of a macro-instruction card,
o r a nested macro-definition heading c a r d .
These conventions for ETC c a r d s a r e different f r o m those for
ETC cards following CALL o r VFD pseudo-instructions .
If a preceding card does not follow these conventions, an ETC
c a r d will be treated a s is any other card in the prototype, and will
be generated with arguments properly substituted. This ETC
c a r d may be used to extend the variable field of a CALL o r VFD
pseudo-instruction, provided i t follows the conventions f o r CALL
o r VFD.
The macro- operation compiler will generate ETC c a r d s , recognized
by the macro-operation processor only, t o follow any generated
instruction whose variable field overflows card column 7 2 .
Nesting Macro-Definitions
Macro-operation definitions may be nested by including a macro-
definition heading c a r d within a macro-definition prototype. The
various fields within the nested macro-operation will be scanned
for substitutable arguments in the argument l i s t of the outermost
macro-definition. Those arguments common to both the outer -
most macro-definition and the nested macro-definition will be
substitutable arguments for this inner macro-operation. Those
intended to be substitutable arguments in the nested macro-
ope ration, but not appearing in the outermost m a c r o-def inition
argument list, will be considerdd a s text within the outermost
prototype. A macro-instruction using the outermost code will
generate the nested macro-definition heading c a r d s and proto-
types of each of the macro-operations nested one level below,
with all outer level arguments properly substituted. The name of
the nested macro-operation may itself be an argument. This will
cause the definition of a lower level macro-operation, the proto-
type of which will be scanned for substitutable arguments in the
argument list of the current level definition, including those
substituted in the outer expansion. Lower level macro-operations
will not be defined until all higher level macro-operations within
which they a r e nested have been expanded.
If macro-definitions a r e nested, the ends of the lower level proto-
types must be marked with END cards bearing the name of the
macro-operation in the location or the variable field. If no name
appears in either field of the END card, the outermost macro-
definition i s terminated.
An example of nested macro-definitions i s a s follows:
-1
N E S T l MACRO ABBsC
N E S T 2 MACRO ASDIE
N E S T 3 MACRO
0.0
B~DIF I
***
N E S T 3 END
I
N E S T 2 END
N E S T l END
I
1
The prototype of a macro-definition may include macro-instructions,
the macro-operations of which have not yet been defined; however,
such lower level macro-operations must be defined p r i o r to an
appearance of the higher level macro-instruction. Circular
definitions, which will result in a loop within the macro- operation
processor, must be avoided by the programmer.
Restrictions on Macr o-Definitions
The following r e s trictions apply to all m a c r o-def initions:
1. When operating under the FORTRAN Monitor, a l l macro-
definitions should be a t the beginning of the program since
the E r r o r Records (which skip to END c a r d s ) may be confused
by mac ro-definition END cards.
The effective limit of the number of macro-definitions o r the
total length of all macro-definitions i s the length of tables
which these share. Macro-operation codes a r e inserted in the
Combined Operations Table, and the length of the Table must
not exceed 1024 operation codes. Approximately 400 names
a r e available to the programmer to i n s e r t macro-operation
codes, or codes defined by OPD, OPSYN, or OPVFD pseudo-
operations.
Macr o-definitions share core storage with the symbol table;
entries in one reduce the space available f o r the other. The
space taken by macro-definitions is l a t e r occupied if r e -
quired by the Symbolic Reference Table.
4. An argument l i s t longer than 63 arguments will be truncated,
but will not be flagged.
Macro-Instructions
A macro-instruction i s used to generate, in line, the sequence of
instructions given by the prototype,with substitutions for the argu-
ments. The constituents of a macro-instruction are:
1. A FAP symbol, appearing in the location field;
2. Apreviouslydefinedmacro-operation, a p p e a r i n g i n t h e
operation field; and
3. A l i s t of FAP symbols, expressions, alphameric character
strings, o r operation codes, appearing in the variable field.
The symbol in the location field of the macro-instruction will be
defined a s the location of the next instruction. A macro-instruction
should not appear within the range of a DUP.
MAC
An additional pseudo-operation i s available for use a s a macro-
instruction. The constituents of the MAC pseudo-instruction are:
1. A FAP symbol, appearing in the location field;
2. The operation code MAC, appearing in the operation field; and
3. The name of the macro-operation followed by the argument
l i s t appearing in the variable field.
MAC i s identical to a macro-instruction with the code in the
operation field, except that the code appears a s the f i r s t subfield
in the variable field, followed by a punctuation character and the
argument l i s t .
Punctuation
Only commas and parentheses may be used to separate arguments
in the macro-instruction argument list. A single comma following
3
a right parenthesis, or a single comma preceding a left parenthesis,
i s redundant and may be omitted. Consecutive commas define a
null argument string; an explicit zero, if s o desired, must appear
in the argument l i s t . A blank not within parentheses terminates
the argument list. A pair of parentheses surrounding a string of
characters in a macro-instruction argument string signifies that
everything within the parentheses is to be substituted f o r the c o r -
r e sponding argument in the macro-definition prototype. Within
such a pair of parentheses, nested parentheses, commas, and
blanks a r e considered to be p a r t of the string to be substituted. If
a matching right parenthesis i s not encountered before c a r d
column 73, a n ETC card must follow. Unmatched parentheses
cause a n assembly e r r o r .
Parentheses to be included a s p a r t of a field to be substituted in a
prototype must be enclosed within an outer pair of parentheses
which will be deleted in the macro-instruction expansion.
F o r example, given the macro-definition
CALLIOMACRO IOCOMtTltOPtLAQELtTZtUNITtPFXeERRET
TSX
PZ E
(TAPE)r4
IOCOMtTlrOP I
PZE
IFF
LABEL t T 2 t U N I T
OtERRET
I
PFX
C A L L 1 0 END
ERRET I
the corresponding macro-instruction could be
03072 CALL10 CITIO~~~((RBEP))~CITLB~~CITTAPI,, I
03072
03073
0074 00 4 73406
0 40004 2 06610
TSX
PZE
(TAPE) t 4
C I T I O t 2 t (RBEP)
I
03074 0 00004 0 06614 PZE CITLBttClTTAP I
IFF 01
Note that TAPE should not be a substitutable argument; (RBEP)
must be enclosed in an outer pair of parentheses; and that in the
macro-instruction argument l i s t , an explicit null argument
bounded by a comma appears corresponding in position to the
substitutable argument ERRET in the macro-definition argument
l i s t . This will cause the fourth word of the calling sequence to be
omitted (see I F F on page 3 1) .
As the character $ does not delimit a n argument in the macro-
instruction argument l i s t , i t may be used freely t o indicate a
heading character or a transfer vector symbol, to replace a
substitutable argument. If the character $ i s a t the end of the
argument list, a comma must be used to distinguish this f r o m the
character used to flag a following ETC c a r d . As the character =
does not delimit an argument in the macro-instruction argument
list, it may be used freely to indicate a l i t e r a l to replace a
substitutable argument.
Argument Strings
The specific argument s t r i n g s to be substituted must be given in
the s a m e o r d e r in the macro-instruction argument l i s t a s the
substitutable arguments appear i n the macro-definition heading
argument l i s t .
It i s not n e c e s s a r y to r e s t r i c t the length of an argument string
t o be substituted into a location field to six c h a r a c t e r s , o r into an
operation field t o seven. Even a n e n t i r e c a r d image may be in-
s e r t e d into any field. No blank will be i n s e r t e d following
a location field longer than six c h a r a c t e r s , and the operation field,
if any, will follow immediately.
Example :
t
NAME9 MACRO
XXX
XXX
REMARK
I
NAME9 END
I
04061 NAME9 (CLA B 1
04061 0500 00 0 06104 CLA B REMARK I
1
Nested Macro-Instructions
It is possible t o nest macro-instructions by including either a
macro-operation code o r a substitutable argument which will be
replaced by a macro-operation, within an operation field in the
prototype.
Example :
XXX
XXX
MACRO
END
I
COS MACRO OP I
OP
TSX SCOS94 I
COS END
04155 COS(COS(XXX) 1
I
04155 COS ( XXX 1
XXX
I
04155
04156
0074 00 4 00005
0074 00 4 00005
TSX
TSX
BCOSe4
SCOSe4
I
I
Note that the null macro-operation XXX will cause the generation
of no c a r d i m a g e s . The same effect could have been obtained by
writing :
.
I
-0 07774 0 04757 XXX OPSYN NULL
I
I
Note a l s o that the a s s e m b l e r will a s s u m e a comma o r an open
parenthesis immediately following the operation code, a s e a r l y
a s c a r d column 11, t o be the end of the operation field o r the be-
ginning of the variable field, respectively. Hence, suggestive
notation, such a s
I 1
may be used a s a string to replace a substitutable argument.
3
-J/
The argument and sub-argument l i s t of a macro-instruction may
be extended by the use of the ETC pseudo-operation. In order
that a following ETC card be recognized, i t i s necessary that the
preceding card follow the conventions stated for extending a
macro-definition heading card argument list (page 6 ) . ~f the
preceding c a r d does not follow these conventions, an ETC c a r d
will be treated a s the f i r s t card following the macro-generated
card sequence, which usually results in an assembly e r r o r .
The Generated Cards
The generated c a r d s a r e similar to the prototype cards, except
that the substitutable arguments in the prototype w i l l be replaced
with the arguments appearing in the macro-instruction argument
l i s t . The heading characters i n effect within the region in which
the macro-instruction appears will be prefixed to all symbols
shorter than six characters in the location and variable fields.
In the 7 0 9 / 7 0 9 0 mode, the macro-compiler will generate the
variable field beginning i n card column 16, except for the c a r d s
BCD, BCI, REM, TTL. In the 704 mode and for the c a r d s BCD,
BCI, REM, TTL, the variable field will begin in card column 12.
No note i s taken of the c a r d column in which the variable field
begins on a prototype card. At least one blank will separate the
variable field f r o m an operation code which extends beyond
2
these card columns.
Created Symbols
If arguments a r e missing f r o m the end of the argument l i s t of a
macro-instruction, symbols will be created to fill the vacancies.
. . .
These symbols take the f o r m of .001, .002, to .nnn, throughout
the program. An explicitly null argument terminated by a comma
will be treated a s null; created symbols will be supplied only a t
the end of the argument string.
F o r example, given the macro-definition heading c a r d
1
ALPHA MACRO AgBgC9D I
1
and the macr o-instruction card
1
ALPHA XI I I
I
each appearance of the substitutable argument A will be replaced
by X, each appearance of the substitutable argument B will be
omitted, a s the argument is explicitly void, and each appearance
of the substitutable arguments C and D will be replaced by the
symbols.. nnn created t o replace the omitted arguments a t the end.
3
If m o r e than9999 symbols a r e t o be created, the p r o g r a m m e r
m u s t r e -origin created symbols using the ORGCRS pseudo-
operation, or assembly will be terminated.
NOCRS
The pseudo-operation NOCRS is used to suppress the creation of
symbols to replace specific argument strings missing f r o m the
end of a macro-instruction argument l i s t . The constituents of
the NOCRS pseudo-instruction a r e :
1. Blanks, a p p e a r i n g i n t h e l o c a t i o n f i e l d ;
2. The operation code NOCRS, appearing in the operation field;
and
3. Blanks, appearing in the variable field.
ORGCRS
In o r d e r t o alter the f o r m of created symbols, the pseudo-operation
ORGCRS may be used. This pseudo-operation a l s o r e i n s t a t e s the
creation of symbols, if they had been suppressed by NOCRS. The
constituents of the ORGCRS pseudo-instruction a r e :
1. Blanks, appearing in the location field;
2. The operation code ORGCRS, appearing in the operation field;
and
3. Blanks o r one BCD c h a r a c t e r followed by t h r e e digits, ap-
pearing in the variable field.
The BCD c h a r a c t e r in the variable field, if any, will replace the
second dot (. Annn); the digits, if any, will be the origin of a new
s e t of created symbols. This origin will be one lower than the
f i r s t symbol actually c r e a t e d . If the BCD c h a r a c t e r is d e s i r e d ,
the t h r e e digits m u s t be stated explicitly: Annn; but if it is
not d e s i r e d , nnn i s sufficient.
MONSTR MACRO DAVID~ALLEN~ROBERTBSCOTT
CAL DAVID
TZE SCOTT
STA ROBERT
ALS 18
OAA ROBERT
SCOTT SLW ALLEN
RM1
ROBERT BSS 1
RM1
MONSTR END
In this macro-definition, the transfer address SCOTT and the 7
storage address ROBERT must be unique f o r each appearance of
the macro-operation i n a macro-instruction. However, neither
i s required outside of the resulting expansion. Hence the as-
sembler may be permitted t o assign a location symbol, by omit-
ting the corresponding arguments in the macro-instruction
argument l i s t . The pseudo-instruction ORGCRS is used to a l t e r
the format of the created symbol to Nnnn: .
I ORGCRS Nl5O I
I
04170 MONSTR MARLYNBHERB I
04170 -0500 00 0 00312 CAL MARLYN
04171 0100 00 0 04175 TZE a N152 I
04172 0621 00 0 06000 STA oN151
04173 0767 00 0 00022 ALS 18 I v
04174 -0501 00 0 06000 ORA aN151 I
04175 0602 00 0 00313 oN152 sLW HERB
I
The pseudo-operation BSS will be assembled later in the program
( s e e RMT below).
I
06000 oN151 BSS 1
I
I
IRP
The pseudo-operation IRP i s used within a prototype to iterate a
s e r i e s of instructions within the s e t of generated instructions.
constituents of the IRP pseudo-instruction a r e :
1. Blanks ap,pearing in the location field;
2. The operation code IRP, appearing in the operation field; and
3. A FAP symbol, appearing in the variable field.
The symbol in the variable field must be the name of a single
substitutable argument appearing in the macro-definition argu-
ment list. An IRP c a r d must precede the instructions t o be
iterated, and another IRP card with blank location and variable
fields must follow the instructions. Both IRP c a r d s must be with-
in the range of the prototype.
The argument to be substituted (appearing in the macro-instruction
argument list) i s a string of sub-arguments separated by commas
e
and enclosed in parentheses. The number of these sub-argument
strings will be the number of iterations of the enclosed c a r d s , and
each iteration will be made with the corresponding sub -argument
b
string substituted f o r the dummy argument. If no argument was
given in the variable field of the f i r s t IRP, no iterations will be
made; one argument causes one iteration, etc .
F o r example, to compute the sum of squares, the following m a c r o -
definition can be written:
SUMSQ MACRO T IB I
ST2 T I
IRP I3
LDQ
FMP
B
B
11
21
I
FAD T 3) I
ST0 T 4
IRP I
SUMSQ END I
The four instructions marked a r e to be iterated. To compute
A = X +Y +Z , the following coding could be used:
~
04234
04234 0600 00 0 06016
SUMSQ
STZ
AI(XIYIZ)
A
I
04235 0560 00 0 06062
IRP
LDQ
XIYIZ
X
I
04236 0260 00 0 06062 FMP X
04237 0300 00 0 06016 FAD A I
04240 0601 00 0 06016 ST0 A
04241 0