19
C,,,.~,:c" ,L.m~,u~¢,.,c,. ~,~i ' pp '~5 ~ " ,30~-055t "S 1)50I-O~to5SO_" 013 I) (~ Pergamon Prc'-.~. L~,z i*'~ Prmt~-J :n Gr.'at Br:ta:n MAKING MACROSPACE EFFECTIVE IVAN FLORES* Baruch College, City Uni~ersit? o[" New York (Receiced 9 March 1977: in revised form l I J,dy 1977: receiced for publication [ September 1977) Abstract--Macros can provide an important assembly language feature which makes the power of assembly language when multiple levels of nesting are permitted, comparable to that of procedure oriented languages. The problem with macros is that each time one is invoked, it produces a considerable amount of code when anything complicated is done. To retain the power of the macro while at the same time eliminating most of the space consuming property, closed subroutines are nested within the macro. A minimum amount of code is required for the closed subroutine, specifically its calling sequence and housekeeping functions. It is possible to reduce the length of code for the macro which is necessary in the caller's control section by moving the closed subroutine to an entirely different control section. These functions taken together enable the assembly language programmer to keep his modules compact so that a minimum of base register, allocation and manipulation is required. Macros Closed subroutines Open subroutines Assembly language programming Nest- ing Program space INTRODUCTION THIS PAPER shows a way long and complex macros which contain great power can be used effectively by the assembly language programmer without consuming inordinate quantities of space and without having the space which is used interfere with the plan- ning and efficiency of his program. In the first section macros are defined and their functions explained. The purpose here is to provide consistency for the remainder of the paper. The closed subroutine is next described, followed by an examination of how to place such a routine into a macrodefinition. The specific problems of the IBM System 370 with regard to addressability and control sections are examined, and it is shown why it is attractive to keep the closed subroutines belonging to all macros in one control section which is used exclusively for that purpose. The method for defining a macro which contains a closed subroutine is then examined. Nesting, an important feature, can be maintained and effectively used with this tool. The coding of two macros, each of which includes a closed subroutine stored in the special control section, is presented and annotated; and, it is shown how nesting is compatible with this technique. The approach is summarized in the conclusion. THE MACRO HAS THREE ASPECTS The macro was developed to make assembly languages more powerful by providing assembly language shorthand for a set of codes: The programmer places the macroname in his program and the assembler substitutes for it the set of codes which the program- mer has defined. Thus, "macro" is itself shorthand for four different entities: (1) The macroname is the name which the programmer uses for the set of codes; (2) The macrodefinition is the definition of the code to be substituted; (3) The macrocall is the means by which the programmer requests the substitution in his program; (4) The macroexpansion is the code produced by the assembler to substitute the macrocall (sometimes called macrogeneration). * Professor of Statistics. 95

Making macrospace effective

Embed Size (px)

Citation preview

Page 1: Making macrospace effective

C,,,.~,:c" ,L.m~,u~¢,.,c,. ~,~i ' pp '~5 ~ " , 3 0 ~ - 0 5 5 t "S 1)50I-O~to5SO_" 013 I) (~ P e r g a m o n Prc'-.~. L~,z i * ' ~ Prmt~-J : n Gr. 'a t Br: ta :n

M A K I N G M A C R O S P A C E E F F E C T I V E

IVAN FLORES*

Baruch College, City Uni~ersit? o[" New York

(Receiced 9 March 1977: in revised form l I J,dy 1977: receiced for publication [ September 1977)

Abstract--Macros can provide an important assembly language feature which makes the power of assembly language when multiple levels of nesting are permitted, comparable to that of procedure oriented languages. The problem with macros is that each time one is invoked, it produces a considerable amount of code when anything complicated is done. To retain the power of the macro while at the same time eliminating most of the space consuming property, closed subroutines are nested within the macro. A minimum amount of code is required for the closed subroutine, specifically its calling sequence and housekeeping functions. It is possible to reduce the length of code for the macro which is necessary in the caller's control section by moving the closed subroutine to an entirely different control section. These functions taken together enable the assembly language programmer to keep his modules compact so that a minimum of base register, allocation and manipulation is required.

Macros Closed subroutines Open subroutines Assembly language programming Nest- ing Program space

INT RODUCTION

THIS PAPER shows a way long and complex macros which contain great power can be used effectively by the assembly language p rogrammer without consuming inordinate quantities of space and without having the space which is used interfere with the plan- ning and efficiency of his program.

In the first section macros are defined and their functions explained. The purpose here is to provide consistency for the remainder of the paper. The closed subroutine is nex t described, followed by an examinat ion of how to place such a routine into a macrodefinition.

The specific problems of the IBM System 370 with regard to addressabili ty and control sections are examined , and it is shown why it is attractive to keep the closed subroutines belonging to all macros in one control section which is used exc lus i ve l y for that purpose. The method for defining a macro which contains a closed subrout ine is then examined. Nesting, an impor tan t feature, can be maintained and effectively used with this tool.

The coding of two macros, each of which includes a closed subrout ine stored in the special control section, is presented and anno ta ted ; and, it is shown how nesting is compat ible with this technique. The approach is summarized in the conclusion.

THE MACRO HAS THREE ASPECTS

The macro was developed to make assembly languages more powerful by providing assembly language shor thand for a set of codes: The p rog rammer places the macroname in his p rogram and the assembler substitutes for it the set of codes which the program- mer has defined. Thus, "macro" is itself shor thand for four different entities:

(1) The macroname is the name which the p rog rammer uses for the set of codes; (2) The macrodefinit ion is the definition of the code to be substi tuted; (3) The macrocall is the means by which the p rogrammer requests the substitution

in his p rogram; (4) The macroexpansion is the code produced by the assembler to substitute the

macrocall (sometimes called macrogeneration).

* Professor of Statistics.

95

Page 2: Making macrospace effective

96 [ v .,,.,," FLORES

In this paper, the assembly language examples provided use BAL. the assembly lan- guage for the System 370.

The macrodefinirion

Figure l is an example of a macrodefinition. The definition begins with the header containing only the word MACRO, which is a communication to the assembler that what follows is a macrodefinition. This appears on line number 6 of Fig. 1 (thereafter the number in parentheses will refer to the line in the figure).

The prototype statement (7) follows. The first field of this statement may convey a label to one of the statements that follows. The next field contains the macroname, the name by which this set of codes will be known thereafter. The next field is a series of parameter names, distinguished by beginning with "&". Parameter names may be used in any of the model statements which follow, and each indicates where a par- ameter value supplied in the macrocall will be entered in the resulting macroexpansion.

A set of model statements (8-32) now appears. These will become the expansion when the macro is called, with, perhaps, the substitution of the parameter value for a parameter name which might appear in any one of these statements.

The macrodefinition ends with the trailer statement, MEND, which conveys to the assembler that the macrodefinition is now complete.

tOC O a a ~ ( r COOE . . . . i D 0 4 l AOO*t2" ~T .T $O01tCE S T I T ~ . E N r

I * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 0 0 0 | 0 0 0 0

S 3 * * * * * Se~T.TFST*SR ¢ * * e ~ CG&3CO~

5 P R I N T N~GFN

? £N ESOqT C~U~,~ROOT,~£qe ,C ITE~- I5 GOOOZO00 R t s I F o . g m l l ~ gFT ml~ t m f l o ~ q LKq Z,O Y 30GC~GO t~ L T ~ o . ~ O? [ m o n s ~ o | 1 6~ £ F q q NEG* CPe 000060OO

13 C ¢ 2 . = ~ ' 1 * s i t CGOGSGCO

~6 ~f Z I ~ 6 I Z * ~OU~L = ~ C l I G h O 17 P EICSYSND~ ~ 0 C~OlZGGO

1 o e $ C e V T N ~ r~ r ~ CCtI~COC

2 1 C $ £ S ¥ ¢ N n Y P~ r,~ ouCI6ooo

23 ~ c o a , Z X/V GGOI6000

2~ n¢ a , = ¢ ' 2 ' l / 2 ~ ( l / ~ - Y l CbC2GOO0

; 7 l P r q ~ , 4 ~BS V~LIIE O~ INCP/~{C ~ ~ 2 2 ~ 0

~9 m ~ N~$~SYSN~X YE~* P© O002q~O0

. . . . . . . . . . . . . . . . . . . . ~ . . . . . . . . . ~ T L . ; . C ~ O l . . . . . . . . . S I L 'oE ~ U L L . . . . - u C U 2 ? 0 0 ~

t { L L ~ J l l C I C ( " . ~r r a t AI*IR2 ~ l ~ l SoL;~E¢ STATFqf~;T A¢~ v v r - l t . . C o l b ~ l Z / 7 5 . . . . . . . . . . . . . . . . . . . . . . . . .

u U ~ } ; ~ 77 = SE ,,~ ( . ;~Ge6000 77 ¢ ~ " ~ T ~N . . . . . . . . . . . . . . . (,~dg~3QflQ-

O 0 ~ I A 3~2~. 7 ~ 2 + L ~ ~ , C Y 6 1 - 0 0 0 0 9

C~5~?C

5 O t ~ - ~

O G u ~

7o7 • ~f= ~ , ? _ _ _ X l -.Y=.Y.

~ o o * IF. ~e~ NcN T ~gL* LPFR 4 . ~ AF~ VILU c 9¢ |NCP/~FC9

8 ~ PqI*JT NOGEPJ ~9 ~ k r ~ ~71

C 1 - O O O 1 9 ~ 1 - 6 C O l O O 1 " O O O 2 1

.C,1 -..6 C O ; i~ t I " ( ; ( , 0 2 3

. . . . . . . . . L2- .~ t lO 2~._ ~1- '00315 C,L-dDC26 C 1-CG027

._ _ "Jl-'~OO2JI G | - .OOOZq

. . . . . . . . . . e I .-Of~a3D_ &I*CQC31 C1-£1G032 O00qqO00 OC 1 ~OCb4D 001~10©0

Fig. 1. A macrodefinition.

Fig. 2. A macrocall and its expansion.

Page 3: Making macrospace effective

Making macrospace effective 97

The macrocall

The macrocall is a directive to the assembler to enter, at this point, the code corre- sponding to the macrocall definition which has appeared earlier, substituting the par- ameter values supplied in the call for occurrences of the parameter names in the defini- tion. An example of such a call appears in Fig. 2 (780). The call consists of the mac- roname followed, in order, by the values of the parameters which are to be substituted.

The macroexpansion

The macrocall in Fig. 2 (780) does not itself produce any code but is a request for substitution of code. Hence, to the left of this line. no code appears. The code which follows (78[-805) is that which is generated by the assembler in response to the macrocall. All statements produced in the expansion have + following the statement number to indicate that this is not the original code supplied by the programmer. but one substituted by the assembler.

At this point it is interesting to compare the macrodefinition with the macroexpansion in order to see where substitutions are provided by the assembler and where commands are duplicated in toto. When operand locations are numerical, symbolic or literal, they are maintained; when a parameter name appears (names prefixed with an ampersand), then a substitution is made.

The reader may be concerned about another substitution which appears in the figure. This substitution is performed by the assembler and enables the programmer to provide unique labels in expansions when the same macro is called several times in the program. For example, the label in line 18 is AS&SYSNDX. The assembler removes the suffix &SYSNDX and substitutes a numeric value unique to this particular macrocall. Thus on line 791 in the expansion is found the label A50057 where the 0057 is provided by the assembler. The number 57 is the ordinal number of this macrocall as encountered by the assembler in reviewing this program with reference to all macrocalls which have appeared so far.

T H E C O M P A C T C L O S E D S U B R O U T I N E (CSR)

The advantage of the closed subroutine (CSR) over the macro is that CSR appears only once in the program regardless of how many times it is used. This provides a tremendous space saving for a routine which is used many times. Figure 3 shows in a graph form how the procedure works. A closed subroutine is placed at the end of

CALLI

R

CALL2,

R 2

-t0-0 i "-s u~-~m~-~i.i n~-~ -J"

Fig. 3. Only one copy of the closed subroutine is in the program and control goes back and forth to it when it is called.

C.L 3 2--C

Page 4: Making macrospace effective

98 IVAN FLORES

C...A L L I LA 14, RTI LA 1 5 , S R ~ ~ u ~ ,,~s~ , - ' ~ DC A(X) / SR LR IX: A(Y} ( [ ...

oc .(z, ; I ' "

V_J/ CALL2 LA 14,RT2

BALR 1,15 ~ / . , ,

RT2 ST 5,XYZ..I--'- " ~ "~

5'15 I

14 I

Fig. 4. Subroutine linkage and the calling sequence.

the user's program. A request is made for the CSR at CALLI. At this point, the program is left by the path called L! and goes to the CSR which is executed; then return is made by path 1R to approximately the point of departure in the program. Another request is made in the program at CALL2 for the same CSR. It is now entered by PATH 2L and return made by PATH 2R.

Two important features appear in assembly language to expedite the use of the CSR:

• linkage enables the closed routine to return to the place in the program where it is requested; • calling sequence provides parameters or data for the closed routine to operate on.

Figure 4 shows an example of how the routine, called SR, is linked to and data furnished to SR. The calling sequence portion begins by making the routine available by loading the return point into register 14 and the entry point into register 15. The programmer can leave the program for the subroutine with the command BAL. Follow- ing this are the parameter addresses which comprise the calling sequences. These are accessible to the CSR because register 1 points to them. When the CSR has finished, the linkages are maintained and a branch is taken back to the cal!er, referencing register 14, which contains the return point. It is easy to see that the same technique can be supplied earlier in the program, as for instance at CALL2, thus making the CSR reusable and conserving space.

P U T T I N G THE CSR INTO THE M A C R O

The advantage of the macro is its ease of use; its disadvantage is the amount of space it occupies. The disadvantage can be reduced of even eliminated by incorporating

CALl MACSR A,B,C

c col~g ~q~ce linkage

'

° . o

CAL2 MACSR X,Y,Z

c I

Fig. 5. Code produced by a macrocall for a definition which includes a closed subroutine, showing two instances.

Page 5: Making macrospace effective

Making macrospace effective 99

the CSR into the definition of the macro. The philosophy is to put the major code in the CSR and to produce the CSR selectively (that is, only once), which produces vestigel codes for each macrocall, since the main code is in the CSR.

Figure 5 provides a picture of the desired goal. The name of the macro is arbitrarily MASSR, and it is assumed that the first request for the expansion occurs at CALL Expansion produces three segments:

C is the calling sequences and linkage section; SR is the closed subroutine; E is the epilogue containing cleanup operations. The next time that MACSR is needed at CALL a new and different copy of C

and E is produced. However, no copy of SR is required; the existing copy is used. Hence, at the end of the segment C. a command links the program to the closed subroutine in a dot dashed line. It is executed and return is made from the subroutine to the segment E produced at CAL2. Register 14 provides the linkage mechanism.

Definition

Figure 6 illustrates a possible definition of a macro which includes a closed subroutine. The calling sequence segment takes the parameters from the call and enters them into the calling sequences, which provides linkage to the major segment containing the main code and named CSR in the figure. The address of this segment is entered into Register 15 with the LA command.

Notice the AIF statement at the end of segment C. Its purpose is to produce one and only one copy of the closed subroutine. The assembler examines the switch, &SW, which is initially set to 0. If the switch is set to 1, the assembler eliminates the entire segment and resumes assembly at segment E. The first command of this segment is prefixed by the sequence symbol "'.E". Notice that the first command executed by the assembler is to set the switch on, which will inhibit future production of the main segment, SR.

Returning to Fig. 5, the programmer sees that the macrodefinition requests expansion of the call at CALL1 into the three segments C, SR and E, while at CALL2 only the two segments C and E are produced.

CONTROL SECTIONS FOR SYSTEM 370

When an assembly language program is submitted to the assembler, the machine language output produced is called the object module. However, the smallest unit of independent code is the control section. Thus in Fig. 7 the assembler working on Program I to produce an object module of three control sections labeled A, B and C. For Program II, the assembler produces another object module containing the control sections (CSECT) labeled P, Q, R, and S. The fact that each control section is an independent

SR

BN

C &N

CSR

E .E 8~SW

MACRO MACSR 8~PI, 8~P2,&P5

. . .

LA 15, CSR BALR 1,15

Kt~ (~SW),E

LR 5ol5 o . ,

ANOP SETB I

. , .

. . .

MEND

Fig. 6. Definition of MACSR containing the closed subroutine. CSR.

Page 6: Making macrospace effective

100 IVAN FLORES

Object Module I ~.~embly lar~uacJe

ONect Module 11" Assembly ta~jua~e ~ / prcxjrarn "in"

Looct Module

R

M ~ Other modules on user's load library

Fig. 7. Control sections in object modules produced by two assemblies and how the linkage editor produces the load module of selected control sections.

entity means that a selection of control sections can be assembled together to make a running program. The utility which does this is called the linkage editor. In the figure the linkage editor has for input the two modules produced by Programs I and II respect- ively and other modules in the user library. Upon directions, the linkage editor produces a load module which is runable. In the figure this load module is composed of A, B, R, and M.

Addressability

The structure of the System 370 command provides addressability of only 4 K bytes. This unit of storage can be called a paoe. Each page requires a separate base register to make it accessible to the rest of the program. It is the programmer's responsibility to assign base registers for each page of his program and to notify the assembler of this assignment by employing the USING statement. The programmer must also fill the register with the proper runtime address at the top of the page to which it is assigned.

Communication between pages requires the establishment and filling of base registers corresponding to each page, which is illustrated in Fig. 8. The communication referred to means the availability of a command on one page to reference data stored in another page.

A control section has its own base registers assigned and filled and provides communi- cation among all its pages when necessary. Occasionally, a very large control section may require the reuse of base registers, which will put limits on the number of pages which compromise the control section.

MEMORY

I ,

Pages

Fig. 8. Base register allocations are required for each page of each control section.

Page 7: Making macrospace effective

Making macrospace effective 101

Communication.between different CSECTS is provided by mechanisms discussed else- where. These are familiarly referred to as variable address constants or VCONS.

KEEPING ALL CLOSED SUBROUTINES IN ONE CSECT

It is very useful to assemble all the closed subroutines from all macrocalls regardless of where they were issued in the program and place them in a single CSECT. Otherwise, when a macro is called, it produces a continuous and large set of codes and these codes are all placed in the caller's CSECT. This causes the CSECT to grow. Recall that the CSECT requires the establishment and maintenance of base register for each of its pages. The larger the CSECT. the more base registers must be allocated and monitored. Placing a portion of the code produced by the macro outside the caller's CSECT allows a limitation of the size of the CSECT and improve the maintenance of the base registers, because fewer may be required.

Plan

Figure 9 conveys a portion of a program, namely three of its control sections. There are two main control sections, named IF1 and IF2, and an auxiliary control section, MSECT, containing all closed subroutines from macroexpansions regardless of from where they are called. The closed subroutine named SR is found in MSECT, but it is accessible to callers in any CSECT. In the figure, IF1 calls out macro MACSR at two points, CALl and CAL2; IF2 has a call at CAL3 for MACSR. It is not important which of these calls the assembler encounters first. However, the first call encountered causes the creation of SR in MSECT. Of course, no duplicate of SR is required and will not be created. Shown in the figure is an entire closed subroutine labeled SR2, which goes with some other call, and which merely conveys that MSECT is used to hold all such closed subroutines.

D E F I N I N G M A C R O S WITH C L O S E D S U B R O U T I N E S IN A

SEPARATE C O N T R O L S E C T I O N

Figure l0 gives some idea how the macrodefiner will set up the definition to comply with the needs described. As before, the first part of the definition contains the calling sequence, and the linkage section labeled C will be produced for each call. It terminates with the AIF statement which references the switch &SW, so that the subroutine code SR will be produced once and only once.

IF1 csE.cr ] CALl M~SR A,e,C I ~ M S E C T CSECr

222 sR

• . . I , '" / _ ~ BR 14 CAL2 ~csR x,¥,z I / ..'11- .'/I /

I :. ../ s . 2

Fig. 9. Removing the closed subroutines from the macroexpansions and putting them in a single exclusive control section.

Page 8: Making macrospace effective

It)" IVAN FLORES

M~CRO BN MACSR 8PI, BP2, BP3

L IS,=V(CSR) L )4,RT BALR I, 15 AIF (8,SW), E

SR [ MSECT CSECT ENTRY CSR

CSR BALR I0,0 USING ",I0 . . .

BR 14

E ~SYSECT CSECT .E ANOP

~SW , . ,

MEND

Fig. 10. Defining MACSR which contains the closed subroutine called CSR which is put in the CSECT called MSECT.

The subroutine proper, SR, begins with the command CSECT; CSECT directs the assembler to put the code which follows in the named CSECT, which appears as the label for the CSECT command. On the next line appears ENTRY. Its purpose is to name CSR as the entry point for this subroutine, which is necessary to distinguish different subroutines which occupy MSECT. Recall that this is a foreign CSECT, and the mechanism for making communication possible is ENTRY. Only labels thus dis- tinguished can be referenced from the caller's CSECT.

The two statements which follow, BALR and USING, establish and fill a base register just for the use of this subroutine. Following them are the model statements which comprise the subroutine and which are indicated only by dots in the figure. The sub- routine terminates, following the linkage convention, with the BR command which goes back to the caller's code.

The epilogue, E, which is produced for every call, begins with a CSECT statement to tell the assembler to place the subsequent commands in the caller's CSECT. The problem, however, is that this macrodefinition could be used by a caller from any control section. Therefore, the writer of the definition cannot name a particular control section;if, for instance, he names IFI and the macro is called by IF2, then C is produced in IF2, SR in MSECT, and E in IF1. To facilitate matters and make expansion indepen- dent of the name of the caller's CSECT the assembler is equipped with a mechanism for keeping track of the CSECT which issues a macrocaller's name.

Figure i0 reminds the programmer that the SETB command appears in the epilogue, E, to set the switch &SW so that the next time any CSECT issues a call, the middle portion of code will not be generated.

N E S T I N G

Nesting, which is the inclusion of one subroutine within another, is an extremely powerful tool facilitating the creation of larger and larger amounts of code with a single name. Nesting is described here for a macrodefinition which contains one or more macrocalls. Many levels of nesting may occur which are not immediately obvious to the observer. The macrodefinition for some call (the inner macro), which itself appears in a macrodefinition (of the outer macro), may itself contain macrocalls. Thus the defini- tion of MACA (outer macro) contains a call to MACB (second level), MACB contains call to MACC (third level), and so for th--MACC is nested into MACB which is nested into MACA.

The principle of breaking out closed subroutines and placing them elsewhere holds even when nesting takes place. It is useful to have a picture of how this procedure takes place.

Page 9: Making macrospace effective

Making macrospace effective 103

l MSECT CSECT

N 14

Fig. It. Simple nesting of MACII and MACI2 into O1SR, the closed subroutine produced by MACO1.

¢

Simple case

A simple case is illustrated in Fig. 11, where the macrodefinition for MACOI contains a closed subroutine called SRO1. Nested in this subroutine are calls to two macros, namely MACI and MAC2. Each of these is a simple macro which does not contain any closed subroutines; they may contain macrocalls to other simple (no CSRs) macros.

Figure t l shows the expansion of MACO1, which creates a calling sequence and an epilogue in the user's control section. The closed subroutine SRO1 appears in another control section (MSECT) and is reached by the linkage in OIC. The inner macrocalls are expanded, and all the resulting calls are incorporated in OISR and kept in MSECT as shown in the figure.

Complex example

The reader can now consider a more complicated case which refers to two macros named MACO (outer) and MACI (inner), where MACI is called within MACO. Further, MACI has a non-nesting definition; that is, MACI does not contain macrocalls. However, since MACI is large, it is defined so as to contain a closed subroutine kept in a separate control section.

MACO is a user macro which contains a closed subroutine. Within this closed subrou- tine, there is a call to MACI which is hence said to be nested within the definition of MACO.

Notice that MACI can be called alone (without involving MACO). For example, the main CSECT may issue a call as appears at CAL6 in Fig. 12. Since this is a non-nesting macro, the call produces the calling sequence IC and the epilogue IE, both in the caller's CSECT as shown in the figure. The call also produces a closed subroutine SRI in MSECT, and if it were not yet produced, linkage occurs to and from this routine.

When MACO is called at CALL the calling sequence and epilogue OC and OE are produced. The closed subroutine SRO for MACO appears in MSECT (in the upper

MSECT CSECT I S ~ . , .

~CI ~X, ~Y

BR 14

SRI -,.

6&" ,4

Fig. 12. Complex nesting.

CSR for MACO

Page 10: Making macrospace effective

104 IVAN FLORES

right-hand corner of Fig. 12). This closed subroutine has a call to MACI. and this call produces a calling sequence and epilogue SROIC and SROIE in the subroutine SRO. This provides linkage back and forth to the closed subroutine portion of MACI which also resides in MSECT.

EXAMPLE

An example is presented here to clarify the concepts and to show how they are employed in a BAL program. Two macrodefinitions were designed. One of these simply takes the square root of a floating point number using the Newton-Rapheson approxi- mation formula and is called ESQ.

The other macro is called EQD and finds the roots of a quadratic equation.

ax 2 + bx + c = O. (1)

The two roots, (r ~ and r 2) are found using the two formulas

rl = [ - b + esq(b 2 - 4ac)]/2a (2)

r2 = [ - b - esq(b 2 - 4ac)]/2a. (3)

Here "esq" stands for the square root function which in turn is provided by the macro, ESQ. In other words, the macrodefinition for EQD contains a call to the square root macro ESQ.

The macrodefinitions and the subsequent calls appear in the very long accompanying figure designated as Fig. 13. In referring to this figure, the numbers in parentheses indicate the statement(s) which are pertinent in the .discussion.

The definition of EQD begins with the pseudo MACRO (I). Of special interest is the global switch &SW2 (3). It controls the production of the closed subroutine placed in the control section designated MSECT (27).

Production of this control section (30) begins by setting up an entry point named CSRQD (31). This entry point was entered into GPRI5 in the calling sequence (13) and the return point to the end sequence is similarly set up (14). The closed subroutine belonging to EQD contains a call to ESQ (72). Since the assembler removes the macro- call when it prints the expansion, documentation is needed to point this up (71, 73).

When the closed subroutine has been produced, the remaining code is to be placed in the caller's control section (113). An assembly branch sequence symbol for skipping the closed subroutine is provided just before this (I 12), which is the object of the AIF statement (27). The first action performed in this segment is to set the global switch (114). The remainder of the macrodefinition contains several commands which print results. Some of these use the system macro, PUT, while others use a special printing command, LOC.

Definition of ESQ

This macrodefinition begins as usual (152). It uses the global switch &SW1 (154). Loading of registers is done in the calling sequence (162, 163) and then the closed subroutine is established just as we saw with EQD (174, 177). The rest of the definition should be self-evident.

Calls

The caller's control section is named $MAIN (245). We noticed the first call (262) and its expansion (263) which is placed in a callers module at location 22 (as noted in the LOC column). When the special control section, MSECT, begins (287), we see that it is created way down in the program at location D40. The call to EQD has been deleted by the assembler, but the documentation makes us aware of its presence (315). Since the caller is the closed subroutine, the linkage appears in MSECT. The closed subroutine for ESQ will be directed up to MSECT (339). Return from this closed subroutine continues to produce code in MSECT (392). Return from the closed subrou-

Page 11: Making macrospace effective

Making macrospace effective 105

60~ O l J t C Y t o g (

kO( O I J I C ! COOl

a O 0 ; l | aOOR~ S T m T ~IU~NCL STITE ' t~T

2 Ct. a~SC L=U J GOL9 4 CC6C

0 &t 4ClC Sr~

1$ ST

12 •

14 X.A 15 ~'wO~

t Ill OC ~(L+) l g OC a(l~) ~e 0~ at&C) 21 t~C a t S ~ l ) 22 OC ~t (LR2) 23 05 ~S 24 SAVW$$~$m, O I ~C IOFi~e

27 Art"

~+1 • • + 311 ~stcr Jl

3~ CS~t~IU

~4

30 &COU~I~ ~lG

a | +

42 *R~.VtF |N DIIUP I I 4~ U~[NG 11|5

4~ L [ | * IA ( | UPPi~.'~. ) 40 UIIUP 1~ 41 USLNG TOPPaGI:, I l 411 •

4g ~111 $~L~StC CA ~t ~av 1E~lYqNOa~ ~l ST ..1,II ( | 31 5+ ST l ]~$+y l&3+~mU/e*4

& l # & q l & C l l R l l ~ m 2 ~MOIOT++E S f a l E + k m r

~ OtCta~k &K LOCALS

]f3AWOl~Y~mO I F~R+im~ +d|mTcm

~*SaVG&3Y3~uIe*4 ~&C~V6~ #0~Nf~d IJ+SaYG&3TSNUI ¢~[NT TU Omm SAVt A.~l

~5~IV(CSNE~C) ~OIU C . ~ . ~ . (mTWv ~ [ ~ t IN ~1~

~4 CU~[ PUL~ oOdU a U ~ $ F(N CIS l

~ 0 0 ~ ! ¢OOR2 STaY

04

04

9UUflC( 3lAi(mKmT

163"2).C0NT TkSV IF lSY C~L ~NO ~s$,R+ CUO~ 3~0UC~ 0¢ #~UOU(kU

• * CkOStO 5~8~OUTl~k * * * • . t • , ~ k ~ T ~ d 3 1 ~ . +taCLO lm ;omr+oc st~r ~ T R ¥ CSWLgO ~OEGT ~QU • [~T~Y PUgeT

BACR | l l ~ C 0 1 0 t U OR|GAqILKV l~ PStCT USING **11 UIStO 0~ GL~#AC $,0 T151

BY LSr C . S , ~ , T~ 8 [ ~ tREU ST" 14,12,12(13} $6V~ GP~rS UF CA~GE~ $ ( r u l a~u ,~tos(c

V0~ t.r~v ~Ot ~M0. o ( ~ I m ~ uV c a c t i - mUSt m [ u t P l m E ~ U O . t $ 1 * + I L I T r

25 m~+ / 7

L J + V ( l l k 4,4(|) C 5~1(1) k O ~ 1 2 ( 1 ! ; ? ~ 1 0 ( I )

Ol CTtR 2,2 62 UZ ad&$~$sOx b3 • 64 +

+~ C~ +#+(4)

Oe ~[ 2re(m41 69 SEw ~ 2 Z~ ST~ e,015C Z | • • • Z2 k ~ u l $ C , ~ O t 7 J •

~4 kTW I ~ + I ~ 7~ +mZ nUM~&$VSm~

77 ~( Wl I~I21 ?e LL 2.V(41 7~ LCt~ 2~2 8e k(~ 4e2 e l a( 2,~O~T

8J STt ~ , V ( ~ )

4~ $~ 4.ff0OT

IZ $?t ~ , ~ [ Z )

09

9 J •

g l $T¢ W.d(Ol go k l L 5 , 4

g+ mOmLl~Y~NOl C I J I ~ A V l E S V ~ U I . I 4

I ¢ + ST I b , l O ( I J J I01 L+ 14 ,12 ,12 (1J ) IH~ 8R t 4

I ~ UT$C 03 L

TG d ~ 0 s 0 11 f ~ q

(N fkH B&CA~ARU PQ~NI~ ~h OWN " SAVt &A{ i

2~ ~AY Z7

~rb~ &UO~$, UF Ssv¢ *Nt* FbX - NkSILU ~&~t

I 00~$ , UP • I n VPd~ 4 U O ~ ~F H 1~ G ~ 4

IF A • ~ , d~a~C~ ;U }P (C IaL CAke.

' OISC~L~INa~/ Ca~C, •

~ U L I I ~ L ~ a e~ C ~ U C / I P L ~ ~ U C T ~f 4

StOm~ N t S u t f L~ O~$~

CALC COUL0 ~Of e( O ~ t LUAU • |f l h#~e MULIIPkY A ~Y 2 LUAU n t~ ~PR2

O~v lb t ~V ~

0 1 r i O t ~v ~

CALL. , M ~ S u V kUaU ~ L~ F#~d ;¢T "C

31ONL $1N;LL ~UOT I s ~1 ~tT xeC I • • fO | M O I C l t t ~ X ~ L L

NgOf POONO ~040 d l g K l l a l l PGI~ r t~ I~

~ s L k ~ e 3 SaV~ s~Ea 0 U h l f " A ~ t r0 11~5Av¢ v H . t :

Fig. 13. An example with macrodefinitions and macroexpansions illustrating principles presented in the paper.

Page 12: Making macrospace effective

106 IVAN FLORES

~OC OI~ECT CQot

~OC OIJ iCT COO[

ADOPt aDVRV STaY SQUN~;F. SYar(,q~qr 2~ Jeay /7

IV~ ~0or ~3 L IVO Savt&Sv$~OX 05 p~r |~7 k~C I8~*V ~ I d a LTUu~

l l V • • • * • * • • * * * • * • * , • . • L I | * I I ~ ,Cu~r aqOP l l J &SYS(CY C~CT 114 &$~2 SET~

110 * l i p *

t i e t ¢ $ { l t I I V a i r 12V tK SEt t 121 ~CO~YU t~C@ 122 &~ SETC

I~0 H T & 8 ~ D X ~ t 1~6 ~T 127 ST 1~6 La

12~ eL,LUC LCC 13P t J t 8 1~2 U 13J 1~4 PUT

l J ~ e 130 ~OTUt~YSqOI ~U7

137 ~OC 13e e ~ U ¢O~Fi iYI~OX ~ { 14~ *

14) u S 143 I&V~&$YSPOZ OC ~d4 M ~ I G ~ Y ~ I ~C 1a5 MEI2eSYSNOX UC 140 * 147 FZ~&$Y$SDX L |48 ~m 140 * I S P ~E~O

aOowl aOoR~ SfET

SLY U [ ~ T OP ~aBLk [U BE U~EU (PI&L~B~ b~ 6~J~CO~TU I~ ~Ee~ T~t~ ~ G~t~ I

J ,O{13) $avt ad~a I~av~S3YS~UXe •4 Ua~4~4gO ~OJ~f~d 13~$avke|YS~U/ GP~I~ WU|~TtO TO SAV~ aM~a

*Ca ~UC l A , & e ~ i ~ P~Z*TOOr COIFpICIg~I$

~U~Fe$YSkU~ ~U tZCE~TIQ~ ~OT~ISY$~DX O~L~ I ~ U t PdUnO P~TN*ME~2&$YS~X P~lqY "L$$aGE YpJr ~UUI8 a~E "

~ lP le$~8~ox PHTR~ML~|~YS~UX P N ~ T ~ 6 A G ~ T ~ r U ~ I

t ~ ! ~PI~T 8 1 ~ L ~ ~OOt ~ I~ I&eY|~Ua

eF ldFoV* C~IJ3JV~OT UU~UR6T~C * O~LY ! ~OOY~ ~LI33~|~OOTS ~R( CO~P~t! ge 1-aGl~a~Y*

LJ~vgeSYS~UXeg4 ~g lqT 6aC~ TO C ~ E ~ 84v( aNEa

|QURCE OT iTE" (kT

l S J &Ha~E

1~0 S H a ~ t 16o • 107 t o e • l a g 166 161 • 142 l e J 164

160 • • J67 16e 16V 8AVe&$Ye~X lTe

17~ * • 173 * •

1 7 0 * 170 * * * * 177 ~8ECT

l T g GOMEIU t e e

164 * l i 4 roP~a~L l e o e ~ U U i ~ G 160

lee * |69 *~kU~P|N

IVJ

1¥0 • IqO •

19e IgV a~v

2 v J *

~&CRO ESG &~U~&MOOt P~OTOrf~k $raYE~t~T GObB & $ u | , & ~ O U ~ k ~ Z~IT, G~OdAL du lYg~ 8T~ | 4 ~ t g , 1 2 ( l J ) $avt V P ~ I ~ ¢ a ~ ( n

~a J ~ S a v S & ~ l ~ l f O q e 6 ~ P O ~ r ~ R ~d |Y J~ i (13J Ca~E~S $~Vt avca 8T I J tSaV~ i JY l kUX•e4 l a C ~ u l i U #O|k |~d [& I J~$aV l&gY l4U t @Q|~T YU Oe~ ~aVL 4.£a

I~.xV(C$~E$~J LUaU ~ . e , d , E~TdY P o 1 ~ r 1~ AI~

~IKN 1 l ~ 5 £~Tt~ CIb~ 8E~, au~e. a ~ U~a~Cn TO C•6e~*

UC 4(~NU~| AUCG~6 PO~

US d~

~TU~G

• * ~ 0 8 ( U ~U~UUTI~E • * * • • • * * • * * *

~ T N Y C S ~ | Q |~ U ~ ¢flNY~dk 4L~T e

t a ~ l l ~ d ~UIUte e ~ I G ~ I ~ Y 1~ ~$LCY U81~G *#11 e & l t 0 0~ ~KUM6~ 900 IK~T

I~ 16! ~ ,~•No TU I t t ~ T t ~ t ~ 3T~ 1 4 , ~ * L 2 ( I J ) Savt ~ * $ UF ¢aKGL~

aGU ,~08EG FO~ L~TM~ ~U? ~#0 m B k ~ | ~ l ~ dR CdEcr *

~UST ~tUkP1~{ i U O N ~ I S I I [ L I Y ~

USL~G • a l $ TG ~k~04~ 11 ~NOq ~T~ 1 4 # l i o l ~ t l J J ~Jv t GV~$ Or G ~ g ~

IAfeiCTOPPaGL) LG4U ea~L ~&G, I ! O~bP 1~ ~ 1 ~ | I ] M P A ~ | # I | N & I I I I G ~ dAdL ~t~v I I

~YL~ 2*V Y~sr ~ e l f l P P ~ F~q f j o

Fig. 13. (Contd).

Page 13: Making macrospace effective

Making macrospace effecti~e 107

~GC UWJICT C=UE

hOG OIJECT COOL

t l l l l l

l l l l O I l O C I g i l l i e

i l t l l l l i k e 019¢

:.",:t1 ' " " . 2 , I V l O d i l l

I I I I l & I l O i CC2S I l l l l [ 4 | 0 1 C¢2E

i l l 1 2 2 l i E { OOOC

t 1 1 1 1 4 4 [ ~ 1 C I I 2 ; l l l ~ I I ~ O I l i a I I I l i { l l O t C l l l t t 1 1 1 ~ 4 ~ i C l~2

I l l l l l I I ~ i { l i e I l l l l l 4 | { 0 COl2 I I I 1 | {

11113 ( 9 ~ 7

:::::I.....¢,c e e e e l c e l

~ 1 4 1 i l i i l { 1 4 I14~14{ i I I i l ¢ l C I I I I i i l i t l l { A i t 1 1 1 1 4 l g e : : ~ , l l , l l l l l d l V l e i V

J l l l l l I t l l i l l i

1 1 1 0 4 i

I I 1 0 4 1 ~11049 1611 i 1 1 0 4 ~

I I 1 0 4 2 I i ( ¢ D I IC l O l 0 4 E 4 [ ~ 1 i 1 9 { i l l 0 4 A J e l l e l l a

I l l 0 4 [ S l O e 1 1 1 2

e e e o ~ 2 4 8 o e V I l E

aOOfll a O ~ 2

i l i l C E l {SO i V i E d

dV~34 OVCSV

tVVe~

V i i 9 4 d e v i l i l i g i I i 1 9 4

I i l A I J J U J l

O i l S | OIE(U O l l l d

i l E { V

I t - r i~V~{L | t i t L , k ~ t

~v4 ~( ~ e i ~ l ~ t

|VV A TaVlOt I~Ua

| | l I d ~ i l ~ l ~ U i k l 4 ~ | t

21e SL~ v ~ |17 ML~ " ~ l

iS2 ~( V ~ I ~ I | i ( e 4 1 S i J i ~ * i T Q R i l ? i ~ I 214 • i l l i ~T 4 ~ l O O T i l T l ~ O l l i d i T u M l S T i ~ O I ~ a i d ( | | ~ | l l i e 2 , v ( 9 ) |SO ~ ige~ S | ! ~ O ~ I S T $ ~ l IT | l o l l ( E l )

231 | q hA ZJ~ ~TUR~

2SA * • * * * • * • • * 230 *COqt ANO~ 2Sd &S?SECT ~$ tC r 2J ; l S ~ I SEt* l

~SI VT I~SN0X 231 ~T | I ~ I l V l l l Y S N U X * * 4 15~1~(13]

241 *

IT~T 2QU~¢E 8 1 k i [ ~ N f

~44 PH~T NOCEN ~49 I ~ a ~ START 240 ENTRY ~A~NIt~a~N2 247 Ma|N| 6ah~ 12el 24N USING •~12 ~At OP(N (PNTRe{OUTPgT)J 259 St~ IA#l~el2LIJJ 2S0 ka JeOiVEMIIN

29A ST |~egAVE~a~h*a

29d ~A | 3 1 $ a V t M a ~

| l M~t #7

UU 1~ t l k S t ~ L m t FEd 1~S~,

l J~ g i l l | 2 • q ~

** g~V|~E X R~ t([) * IU IT m f ( ~ | e• fOAL ~ALP

Ok| i l l , V l ; U t P~d ;O~fl t~oTAC e

( ~ F e k ~ , FL~k~hkkU~SX~! ~gO~

A~OdS, d~ i d i o t tg VP~9 SIO~| C ~ k l l ( O d o l t l o t R I C I I J I kd EACk~T~QNI OQ NOT mA~? TU U~gAV~ O~d|§

a ~ T ~ T0 C*~kLA

• • * • * * * *

[OOE | l P~.ACJ:IJ | '~ C l ~ k | N C I |~T RESET G~.Oe~k I ~ | t g ~ |U CODE

~;Lt . ~*or dE ~I&PdOUUC|g ~ 'o~,r re ¢ak!,.EltS SAVE AREA

laY& WtC, CUO£ FNU'~ EdV U s l a ~ t sE~9

2d ~ T 77

I ~ A ~ ENTRY PUgeT4 * [ ~ ANU a l iSON g~R|2 6AlE RIG

laVE 9¥1TE~ REGIOfE~9 PUT fOOaaRO laVE ARIa PQ~NTEM

[~TU S/ET&M l I V E A l l & E~TEO eaCKuA~U Poz~rE~

~N I~aZS LaVE IdEa ENTIR SAV E aREA P U | N T ~ VPR| I

262 g 6 ~ k i

2~4* * 249*

~97" 2614 24N*• 27V* 2 7 | * Z / 2 * 27J*

2ZA*• 279* 270- 277* 2 7 l *

21e* 2 i l * E A V g i e d 2 2 1 2 . 2O3 S IS* * 249* * 2 4 4 * • • 247 .~92¢T 2 4 1 . 299*¢$REQO 29N* S t l * 2 9 2 * • 29J*TOPPAGE 294* * 299* 294 .

l e T *

LUg a | # O l e [ l , w i l ~ R ; 2 l i t ~ a ~ FO~ LQU FROM I ~ I I N STM | d m | 2 j 1 2 ( l l J 8AVE GWNe$ OF CAl lER

LA SfSAYGIMI2 FOd~aMO VOZNTtN ST S ~ I ( | ] ) TU GaLkER8 laVE ANEa ST | S e E i V Q l i l S e 4 EaGRmARD PO~MTEN ha | J e l A V O I l l 2 ~O~N~ TU OWN l a Y ( A~EA

k | l e l V ( C I R E Q O ) LUNg C,EeH e ENTNV POINT 1W KI~ LA | 4 e R T d i | 2 PUT R&TURN POINT AN GPR|4 C~O~ 224 FQRCE F U ~ IO~O AOONI FUR Ge l * I A ~ 1 , 1 9 (NTEfl C a ~ lEO, SOftS I ANU

6dANC~ ~O Co l ,Re

OC A | a | ) AOCC~$ eO~ OC ALO|) C , $ , R I ~C ~|C~) PARaMETERd OC A (RL I ) OC A (R |~ ) O l OF DC | e F * d l LTONG

* v ( c s ~ ( O 0 |

• * • CLGSNO SUB~OUILNk * * • • • * e • CSECT C . ~ t d * Pk~g[O ~ CU~TRUk 8ECT EkTRY CEREO0 e l E C t " (GU • ENTRY PQ|NT 8&kN | l e g L0a0ED QR|E|NA~L¥ |N ~IECT US|NO • a l l BalE0 O~ GLOBAL lUm TEET

Of l i r C•$.W e t~ l ( EkT(RED STM 1 4 , 1 2 , | 2 ( 1 ~ ) laVE GPRe$ O~ CakL£e ~ I 3~SAV| IQI2 PUT ~ ON~&NO LaVE Idea POIN~E~ ST 3~4113) |~Tg C a k k k ~ l l a Y [ 4MLa 8T | l e l a V L i l i ~ * 4 (NT~fl BICKlaOU PQ|NtER IN Omk

LAVE aREa ha | S e l I V | l l l 2 ENTER aOO~$, OF 5aVE AAEa FUR

N l l t ( O ~aLL

Fig. 13. (Contd).

Page 14: Making macrospace effective

tO8 [VAN" FLORES

~OC OBJECt C ~ E ~00RI *DO~

i l l O O i IS11 8 i i i #d i34 I I 1 0 1 ~ 14~i ees! 8 i811 111081 ~ lOt t81¢ i ~ i l ~ I l l O # ~ 5 e l i e i18 1 7 1 I t

( 4 l O O l 7833 * l i e I l i i i l i e d e r 3222 I I i O l O 4788 0174 i8¢~0

I I l O l i #114 d i l l I d i 8 8 I l l O l l i ~ i i l l l O l i 7¢25 Wi le 8 ~ i l 8 l i l o # ~ I C I i l i 0 6 t i u l 8

111084 ~@li l i g G el[Of

I l l O i O I t~C Ot lC l i l l C

l l i O l ¢ l i l t #ee l t S l O l I l l O l l l I J O l l O | P # i l e l g l O l l ~ i ~ l l o l l 8#~B4 l l l O l e i l O i I IOE Id+OI

I l i O i C ~ l l l B i § I tSU/~ l | l O i 8 4 l t l b l 3 e l l ¢ # O I l e O i i I # i i

l l l O l # 151 l

I I l O i l i l l l l L O e l l l O I C l l l l l l O ¢ l l l O e l # l l O i i i l i l i i t l l t 3 e l l i p I l I O P I l l l O f 4 4 1 i l l t i i l i l O l C M i t e * l i t

l i l 0 4 i

I l l | l i

I I 1 [ 1 1 I l l [ l l l i t ~ Dole l l l [ i l l i O i fd~O

1 0 1 0 4 2

l i e | B e ~131 8 i l l l l l [ l ~ # i i ~ V i i #

LOC O~d(Ct ¢OUE

OOOEI8 ~23V I l l [ l + 4708 u i0~ l i l l l 4 f i l l i 118 l i l l l l 4 1 l i #11¢

I I I E I [ i l l , ,118

l i l t l l # i18 ~ l l ~ l l l ( 1 4 4141 #iE~ l i l l i ~ J s l l l i i [ l ¢ i l t 8 #OFI I O I l l l #Cte 8 t i t

I g 1 ( 3 4 l l 4 1 t i l l

I I I l ~ e #083 t i S I 111[3C 3031 l l l t 3 [ ~8V2 I l l E i i 3482

# l l l 1 2 J i O i

l i O E i 4 ~s ie * l i E 8 6 7981 .132 l l O l 4 1 47~t # I IM

I I I E i l 4648 #IF8 g i l E S 2 515 i 8 i V i I l i E e ~ # i i ~ * I l l I l l l ~ l 4 I l l i l l 8 l l l ( ~ ! ~8#0 i l l * I l l l ~ l 9eEc Oi iC l l l [ # ~ 8##i l i i l # e i i l [ l l O l i U i U i l l e I [ # C 4 1 1 i l 8 0 8 l l i l l l 4 1 1 1 e l i 8 I l l ~ # l JCI IGI&~

e o l o i l 110[#8 l l l i , + 7 j tO lET¢ ~ l t ~ 8 i l l I 11 (88 l l t C ~18~

O i l | J 4 121l l i l t S # i l l l 8188 l o l l S * 18t3 i V * 8 I O I [ S L #C#e e l se l l l l l l l o l l v i o l l i e [ i e J a i l l i l l Y 8 J842 111(81 / i l t e l i l I l l [ i + 4U21

t e s l t 8@8¢e

aO0~i IObR3

t i & l ~ l i l l e i@t~ t

I I i # ~ e~t3e

8ieeP

~ v e w

S?~f SOURCE 5 T I t E ~ t ~ T 2~ ~ t 77

3 1 l * t 0~12(1) i~OwO. UF Wl l~ ~ i o 3V2. L 7 t l o C l ] IO0~$, U~ w2 i~ G,R7 3 ~ J * " J i 4 * L[ 2~8(J ) LU40 i L~ FP~2 i S : * LTL" 2 ,2 IF ~ * 8, 8~l+~C~ rb

3 ¢ I * *

J l l * ~k~ 81~ $0UIW~ $ t l i ~k l l ~ l S ) ~U~II#~V I ~Y ~12 i " ( l l 1 ¢ 1 4 1 " ~ I l P ~ I Ik3ULT ~Y • 3 | 3 . $~k e l 2 5UBT~, mtSUkl ~O~ 8 -8~ . J l 4 * $t~ z , O I $ C STGWt ~L$~kT l~ u15C 3 ~ : * * * • Cik~ E$~ ( l l i U + ~ m t 3 . O i 3 { i uu( i r ) l+W 3 ~ , wUUT { ILC * 3LO/ 3 l~ 1 4 i 1 2 i 1 2 ( 1 3 } S i t { UPt I$ Ol ~ i LL~ I ~ l # 1 * ~lO t ~l } i ~ & ¥ ~ 8 8 8 3 PUI*AIO vo l~ rLw lC J18* ST 3 i O ( I J ) C i~k tw3 3~Vt i v k l ~ l i i ~ l i ~ t l&V~ tdS~e4 O l ~ l l l l ~ P U I N I t . J 2 i * L i 13131v~i88J POINT TO 0 ~ 3 i V ( l ~ i ~23** ~ i ~ I } * i V ( C 3 W ~ ) ~UiU { l ~ , w , (NT~V PUINT ~N WI~ 324, Li l i i l l s @ i ) PUt WiTUIN ~0iNT IN b~W 14 ~2~i C~Ol 3,4 FO/~E F~LL -OWU A~OI~ FU~ C*$ i 320- ~ i~k l t 1 5 ENTtR ~L 3 t O , *ON$ I ~ I

J 3 1 * * * 328+ 0C A(015C} ICCUN$ bO~ J28+ OC ~(RUOI) C$~ PI~I~tTt~5 O O l * S A V S ~ i 3 03 ~P 331+ OC l e l l S I 331+ LTOWG 3JJ e ~ * 4 i 334 IVCg3RRSMJ 33=* * * 3 ~ 0 * * * 3 J l + * 3 3 ~ * * * * * * * CLO$(;~ OU~;r~UT[N[ * * * * * • * * • * , ,

34~+ I[kT~Y CORtOQ IN Oah CUNt~QL $~¢T, .14|+CSN~[$U ~OU • ~.mTMY POINT 34~e OMOP l | bOT&ULISP T ~ P I 015( H~G, 34,~* U3I~G * , L ~ tO RELO~U il F~O,

~e~6~ 34=* t. l l , I I (YOPP~GEJ L0~O Bi$1: ~[G, I I J4~* O~O~ I~ 3 4 7 . U$I~G TUP~&GI;~II W~i331b~ 845b ~ , LI J 4 ~ * * ,s4g** * * P~UCE$$Iqd COOt * * JDi+ ~ ~ l e ( l } &OO~$* O~ &hUM Pbt l~ IPd3 3SI* LL e~e(3) LOiO r,~U~ iN PPRI

312+ t t k w 2ee TESt h ~ . I~ PPW2 PU~ Z*"

354* . L A [ : ~ 8 Wf. TuN~, ~ I H NU 3 ~ * 8 MO~P.et~J Pt~WIM~< vWUCE531NG $"o** ~l~ l leZTSTi l l l l l3 UZ STOWICS~J ~RINCM ~NO SYONt. ROCT IF • l 35e '** 3~g+ C( 2 # i t * l * t t O r ~'0,( ,MUt.E ,w~. O~ ~,~,r. 10Be ~ / (+WA~k+~3 ~0 fO [W&4Iw~NI PtIW /'RAT.. JO l * "E~ 2~2 IqT OUt$3 t'*Ll* uF NU ~ , 303" U T~Y~MM3 ]6JeFRAt;MdMJ ~ 3~1~12 * | q t GUbS$ ~ * NUH, 304.* 48D*TR¥~8*~J L~ 41 l~ ~P~4 Skl TU ~*OUP ~ . l u l t t~ I~

3 ~ # , ) N O O r i ~ 8 3 t.t ~ 1 0 ( 3 ) LOJU ~,~U ~ PU~ SUaW0(JI ~.a~.(. 3bee 0ER ~12 * * UIV~UE X BT t ( l ) 3~¥* SER e82 * SU~T', V(IJ 3 7 e * HEll t l , d * * T I ~ E naL*

J / J * * 374. LPF.~ ~ , ~ GET A~3, V&~Ut PUN t*OHHI:C~I{,,

~I~.74 J T : * CE ~Ol l~ . l l 8 t -O* (~U~V,~.0NR[CeFI[,Tu ¢P~<U~ L I ~ , • ~f.~;t 370e 6N~, OtOHSMM$ EFP,L I~ , FULPII.I .P.O,LIII t.OOP

3 7 # + * ~M(;.~G .~7¢i* t~T 41RUUT~;I.~ LOOP TU t*0NT~.NUI: ~4LC, VL'V~4 37Ve3TUN~t#3 L 514L [ ) AUUH$* (JP &NUUT TO G~w~ ~ e e ~ 38~* STE 2+*~t5) $TO~t CU~PUTt.U RUOt M~;d8e 38 | * L* I~l,c, $~.t W*Cil lS~ ~+0 P. I C t P T I 0 ~ $ • M ~ ¢ ~R3e~O~bSe~3 qt 15110(13J OU NUt *ANT IU UN~iv~ ~15 81~i,~ ~ J S J * t~ 14~13, |2( l .~J

304* H~ 14 ~f. TUHN FU L~LLkR 38~* + LTOWG 3~0 I& ( T O~P&Gi( ) 48/ *¢*1 ~ 3~8 I t * 2 * 38V *~ * 18f.*~ * 3 9 d * * J g i * * * * * * * * * * * * * * * * * * . . 4~3* ' *Stg f CSP.~t tOUt IS P l . * r t o 1~ git.l.t.+l CSL(,T

~ O f l 4 t lJ#$1VSW~dJ*4 PUINT TO CALLtW~ 5~VL l ~ L l e t l e ld S f I . ' ~ l O i l 3 J $I¥i~ N i G , C(JUE PRU ~ bOO d ~ 8 ~ L~ 14*~,3e13(13J U ~ a V t WtG~

3g~*NtedeJ J~4*

J to+* $9 / *o

deft. SVV* ~ l ~ U ~ Cagg ~UuLO ,,nT ~t UC~t

#,'P2e 4,1|* .k ~,a~12 I NuLl~tt A o¥ 2

4~J* tL~k 2,a ~k f -. 4*~48 L ~ 4~2 =AV~ eO V A L ~ ~ ~PW4

Fig. 13. (Contd).

2~ MJt /#

Page 15: Making macrospace effective

Making macrospace effective 109

~ C 0 l i E g E C¢OL * u ~ l *0~12

e e e t J e CJCI+40JPL~300C3 lOllJe ~IPI4M404W414WWW | 0 1 0 4 0 ¢~14440444WldWd 101441 CIF14dId4WdMWWWd l O l l l l Ol~lF|ddWdWU4VWW IOIIU C]OICBCO#O;WFVF+ 10141V OtFIF~4d4ldd4ddW 111600 w e + r e v e l

BOIIVl

1114+C a iJO CBI~ wae l~ | l i B E l ~OJO 9 0 i 4 w~vOe 111174 0001 ~B|E ee02d

+ l 1 0 7 1 4100 G i l l W+9tC 00017~ ~700 900# w~wew OOOlll 0997 C2E+ C97E W++E+ eOVeW 100010 9~C~ C3Bi ~e35c l l l l l l 00+7 0110 C910 WV+E~ 09000 100401 0707 C21~ ¢301 w0~90 99~9w :::::t +,010'0+ , . , . 0 . . 9 . . . . . .

101111 4110 G2IE w009e 101492 $lFv C B l i weO~+ 111401 lB(F l l l 4 1 4 9 7 F I +GIE e+oOe l l l l l ( O V l i d e i l + i : : : : ~ 47de WOOd W99,W

0~ |0 ~ P ~ l w ~ dW2F6 WeWRW I11011 4010 COlt aWk6~ 110401 0++9 C351 wu+BC 1 1 1 4 £ | 0 1 i 7 CgEC COlE I I 2 E L 9dYgd ~ I I I C I 0717 C 3 I ( C2BE 90200 9 ~ g v l l l l ~ | 0~03 C~OL C e l l W0299 WdCBC | 01004 VTll 111101 411V C2It we29w l l l l O l +lOw C412 W+OE+ l l l i O l lO|F

~ I I I E I 4 7 ~ i CGE+ cUBE+ 0 1 4 | 4 10011001"

l l O l l l 470W r o l l OHM@d 10041{ 0210 CBFO lOeB d g V B BOwie l t l l f ~ 41EI C|Wl W~10* 011404 e3¢~ C35£ 9v35C l l l l P l 0947 C2~C COgO ¥V+EE o+gge ~00710 0707 G~IE C21E 0929~ ~0299 1111711 01d3 COil C~IE Wd+Be 9009e l e o ? r e e7o0 IIHITIE 4111 CaBE VW29w eel;l~ ~1~0 c 7 ~ w~7~c

hoe OBJECT C C ~ E ~ O R I .OO~

0007~1 0~1F 0 0 0 7 t 1 47F0 CTIE w0729 10171~ 60601080 loathe 47V0 d i d o W~OUW |007~9 ~210 C ~ B 10~0 vd2Fe 9++ww Ol I7+ l 46[1 C104 d+ |61 1007~( SIF8 CSFB VW~FB 11173+ 47FF C7+4 Wd/30 1017~1 ~7~0 CtBC d~ /9~ 1117~A 4770 C740 9~7~w 00173( 4 [ [ I CII2 U~ l l4 ~0 |743 4 | i V CBE7 wewEv

00746 ~|FO I138 w¢~0w 0174~ 10(F

I I 1 7 4 C 4170 COBC d000~ 101700 Wile CII~ WW|A4 I H 7 0 4 4100 CO62 W~864 111701 t 1 ~ 0 1930 w~dJw

| 0070¢ 06 [F 01710 4711 0000 ddWOd

| 00712 ~ C 5 CJBI wwJSC 10714 O t t 7 C2EC cggE dV2EE d~U~W

I l e l T I C 0707 C2iE C 2 I ( V9~91 Wm2g+ 111772 0213 C2iE CCA2 e0299 WeCAL 101774 1708 01177& 411V C2B+ w+2gw 10077 ( ~BF9 C706 w~/Ba 000112 01(F 111714 47F0 I7BA w+7el 001711 v d n w a g 10171C 4701 0011 wevee 000700 021D G2FO IVgi W92FO ~WgW 100710 4$01 CI64 Wel6* ~JlTl& dTFd C06C vWg6t J l i T g E 4781 d i l l dde ld 1117a2 0lW7 C2E3 C01o +0210 #+V£W 100711 9ICI C351 W+4~C 00~710 0~07 ~2EC C99E d~2Ek d ~ V ~ ~1171~ 07+7 C~B~ C~eE l i n g 9 ~OQ+ iliTii U20~ C24E CC~2 W~29~ W ~ I 4 0 0 |701 l l O T l t 4119 ~281 mo~9+ 101702 919V C7C£ +.,ICC 1017~0 WBEF 0117¢1 47Fd CT~E W~?~W ~107CC v v t v w v e i 111701 4710 900~ ~WZ+ 111704 O+lO C+PO l+Od d~2F8 wmW9¢ 111701 4BEv CI6O .210~ eIOTOE ~SC~ C 3 ~ eu3~C 8017E2 02~7 C2tC cgAE 9U2EE .~VB~ l ~ 1 7 k l 0717 C21E C28E ew~gw e¢~g+ I I I T E ~ 0293 C2BE CC~O +L29~ ~¢C,~ 111774 d79W 111796 a l t o C261 +029~

eJW ~ e ~ L e + ~ A ~ L ~ G f 04~ ~ L o ~ L o 04~ a C ~ d ' ~ t 04~ I ~ L g ' C L t ew j +CLe '~ l l~ e ,4 ~ g e ' C Q t ~ d ~ v Z t 64~ RCge'~12 ~

441*e "

* ~Ut kUC U~e*Ck2k~C ~,0P BSV* ~C O~Ta~ , *CLB~kgkUCI

801 . ~vC ~ 1 $ ~ . e C k U * ~ 2 *

464+ C~0~ 2~4

8600 k 1 ~ , * * 1 ~ 4070 +ILm 140|5 VOW* 0 u~Fwd20 060* OC YLUN+LTCw¥)

67~+ ~ k 14~U~PUY 07~* ~v I ONVa~*IOO~CtL + 074* my C 0 ~ Y m l I C L U I ~ 2 1

8770 C~0P 2~4 070* k~ Z~0H~ 070* k I~*+19 88U* B~Lk 14+|5 091* 0 U~F9027 Qg~# O~ V|UNF~TENV) 903-U~FW~27 ~0~ 804+ ~VC 01V~k(JW)~W~l ) 085+ Bak lW~OqPUT eBB+ ~VI U~VaL*I~d~CIE I cuP, ~VC U~0v~,eCke*C2+ B~4~ xC QR~K~QOIK 9WV+ ~VC 0 t ~ ( 4 J # C 2 9gw+ C~0P 2~d

Bg2+ L I ~ , * l W

0T~t OU~RC~ OT~tE~ENT 20 ~IY 77

093* Bak" 14~15 894# ~ ~NFd929 Bg3+ 0C V(UNFLTCN¥) 900*UNFWW28 ~0P 9 d97 . ~vC U H V ~ L ( 3 e ) ~ L ( I ) 0196 ~&k 14#UIPUI 899* L 15,$ayGd~24910 ILSTURE H , ~ , l ~ GP11~ g~W+ B * e 4 { l ~ ) O~ANCH 10 ~ l~OkE 9a$EU 0~ t ~ C . 9 1 l * H CUEFSO2d kO ~ZCkPI IU~ 9~2* ~ ~0TUU0~4 0hkT L HU01F0U~U g~J+ ka I~PHTR kOWU PIMB~LT~H REU 1 gWW* LA e l M k ~ O l 2 d LOaD PIRA~ET~I R~G d g ~ + k $5~1B(~#|) LOAU PU T I O U t I ~ £ a~O~, ggO# 6 ~ 140|~ ~INK |U PU~ ~ U U Y [ ~ 9d ;+ 0 F I N | 0 9 2 4 99~*~Ql~dW~4 LI I~P~TR LOAD PA~6e~TLt REG l Beg+ ks ~ * ~ $ 1 9 0 2 4 LOAD PaflI~ETER RLG 9 91~* k [ 5 , 4 1 ( 9 , 1 ) kUaO P~T I O U I ~ t AUU~, OIL* 8~k~ 14~15 k I k ~ |0 PUT RuuT[N~ g l 2 * NOP O gtJ+ ~VI O ~ a k * 1 0 9 ~ C l ~ l 914* mVC OmSY,.mCLW'~21' 91~* XC 0R*~#0R~K 9[0* MvC 0 1 ~ ( 4 } ~ R 2 [ 917 • CN0P 214 91~* kA ~ I 0 ~ R glg* k 150**1~ 82++ 6 1 L I 14115 921* B uNFud~4 g229 ~E V(U~FLTC~VJ g23*UN~U~J4 ~ P 0 124* ~¥C O~vak(3v).Wtl~ 925+ Oa~ 14+~HIUT 920* 0 FLN~W24 927e~O~dO~4 hOP d g2W* "VC D~T~G~eCL~ICUEFdW~ 4= g2W* "¥~ 01VAL*IOW*C~EI 9~d+ ~VC 0 ~ B Y ~ * S C L ~ t ~ ~ g J l * XC D ~ O R - ~ g32* ~VC 0 0 ~ ( 4 ) ~ 1 2 L 93$* Ch~O 2~4 934+ k~ I , O H ~

9~0+ ~ALm |4#L0 gJT+ B u~FeH$6 gJe* OC ~(uNFLTC~V| 939*~J~F~30 ~OP VWd+ ~vC O~vaL(Jg)*~LIJ g a l * ~ak 14~01PUT 94~+ ~¥1 ~NVA~+LWWICI~I 143* ~vC O~BY~+ICLOIH22 ~

14~* ~vC 0 " . ~ ( 4 ) . R 2 2 g40* C~U~ 2e4 g47 . k l 1 # 0 ~

Fig. 13. (Contd).

Page 16: Making macrospace effective

I I 0 [VAN FLORES

~*OC Oi.,)ECT CUUE ll,~Ok+l aUUq2 STY! !IUU*~CE STATI~PI~.P+T

i l l ( A S PV2~ w e e evvev ArT* STf 2 * ~ ( ~ ) STCM~ lq l ~OUT [~ i l l 4~0+*

i l l [ A 4 l i l y e l g i +il&O~ 4VV+ ~( 4)IIUOT ~UmT ~IU, ~l* UF U[~CM~* e IISSaS J04V ALe+ U*.~ ~#e UIvlUk O~ 2+1 SOi(&A 7 i 4 7 VOVi ~VVdd 4|14 STE 41+(71 ~TQmlI¢. ~qU "OUT

a124* 4 l J + , * * P U L r ~ U ~ L C~*L.C l i +.Ol*Pk,

(Sllll 4 IpV 4+II d~d~ i 4144 L A l~ ,V SEt m,C,e+ mU &zC~'rl~ml E l S l i l 4 / F I l i l l e VVlP.Cd 41':)<' q ~Umr,.VVll

AIO+! 4174* CALC* ~ E ~ • • d

I I I [ S e leg ` ) v o l e vv'vue 41o+~vvev2 I, .E d f O ( J ) I..04'0 C 1~ PPO~O I l l ( l * `)`) le 41V+ ~C~4 V~t GP.T *C l l t ( i C 7094 V i i i Vk*i~4 A2V+ ~E d e e ( 4 ] U~VIUE -L eY k+ lil({i P i e ( l o v e v v v ( e Agt* ~lff: i~i(6} ero~tt, .SUwGt.E +~our +,~ ~I

d22" I . l 1~,4 SET qeC* ! 4 TU INU|CAT[ $le*GL A IS lEC4 41P i r i d 4 dVVI4 * IIOUT PUU~U

42J i~O~LMVi2 ~ |J*SAVIMIIII2'44 I. UAU UiC~.'A*IU PU~.r~T&H TU X I S l ( ~ l S i O i UIA2 V4~(4 * C A ~ k R I I SAY( a ~ A IOIIGC A l t o r i l l lV41e 4 + 4 , ,St l i , $ i ( l S ) UUmlT q&Nr TO UPISIV I' l~Pl'tlO IOSIgl 9e(C OoeC VIv@C A2o* I.m I A , I + , L Z ( I + J u*+AsAv+. CAU.[m'S ,"COS l l l ( O 4 iT~E 4~0* ~R 14 I E t U ~ TO (;A~.t~.~

427"~

l lilgl 42O+U15[ ~$ SI (O¢ 42V*~00 | 05

Oil(ll 43~4,$AY | V V V 2 0 e iF g i l l i e l i V i l i l l i v i V i V i V 431 . DC II~FIUI I O S F I I 4`)2* LTO4G OSOFI| 4 l l l i i l l 4~`) e~.* ~*

4`)4(* + aSS** * , * * * * + * + + * * ,, * + 4`)0+,

; O l l l l 4 ` ) 7 * S ~ 4 ~ C + E C T COUE II PkACEU |~ CALLEr CSECT 4 ` ) i * * 4`)e** Cg'~4~A~'E*lA~'E CALLI~qG ~A ik / WII~ 4AVA+ tLOC e FUR {:ALL* fO I.UC 44; .)* 442++ RETUNN CO|tO PROm C , S , I ,

I 0 1 1 1 4 4131 CASs VV4S{ 4a`)*HTiVV2 L4 ` )+SIVLdi+2 t~Oi l lRU V0 i~Yk~ [O CAL l .E l i I O I i l l 6 i ~ 0 e l l a V i V i d 444+ S! . t i e ( l , ) ) l l v l A~*'£ iOO01¢ I I O S C 4 t l V i 4 4 i 44~* l 1 I ` ) ,$AV~dMSI iA I¢4CM+IIAVU POINTER

440+ CA I`)+$AVLViV2 GPR|`) PuINTkO TO eAVE Af f ( l X OS0011 4tOM C a l l v i45C * SUN kUC

44741 * • • * • * * . + * • * * * * * * * * * * * * * 444* * IN( L0C ~ACF*O wILL PRINT rN~. CO~TE~TS UP ALL oAra F£E~."S ~'m,.st~T 44~4 . IN ITS PARAMkTER ~lSTe TWU PAt¢AMLIEN TTP(S ARi~ Ai.~.OnAVLL ee 4SV** 4~ |+1 4 5 2 * * 4~3** 4~44"

450** 4S7+* 4 S l * *

LOC O I J ( C l C O 0 E *OOll ~UUR2 5T~T euuvC[

l o l l S + t i l l C41[ d V i i C 7e7 . ~ O | i I G i g ( F 781+ I O O i O l 4 ~ 1 C i i E V V i | d 7eVe

S i d l e O I I O S i S l 79V+ 04~1 4710 i l S l V I l l i 7g leUNPi42~

000414 0110 CIF4 14 iV 4v2Ye r i d g e 792 . O l i V I A 4 I ( S C l i i Vd i4A 7g`)* i l O 4 1 I l l { e C3SA vv`)SC 794* OOIIOI 0 1 | 7 GIEC C4SL Vi+[E veoov 79~+ l l l 4 + l ~ 1 7 C + I | C~S[ l i ~ g l VO2gU 79~* S I l l S ( 0+V3 C l i L ¢ ¢ 9 ( VV+iV VH¢AV 7g /+

I:1:11 . ,s . , , . . 4111 C~eE e l e g y 7gg* I l l 4 3 & + iFv C44~ r e44+ eVV+ O I 0 4 I ( VStF e e l + 001441 dTfS C l i o V044V eV~* | 1 1 4 4 4 I O i I O U S l e l ` ) * 011444 4110 W i l l V i V i V e v 4 + u . * l l + ` ) 00144¢ SOlO C~F4 |VU4 IV2FS VVVi4 61S* 11146+ l O L l c L I i V V [ i l l e O *

O i l * * l i v e S 4 4 7 F i CS&C VUDA~ O i t * I I O I ~ ¢ e~9*

l i l A C i l i l i i O 4 1 i i l S i V d 8 | V + i A V L i V i + O04i~ ~ S O 0 0 0 ( 3 4 v O i [ 4 4 | i | 1 4 ~ ( I L i l i ~

1 I I ~ 2 S FIOOOGOG(SE~ivCI e|~iM~I~4VV2 i t ` ) + *

OOOOA( i l i a C i e i VerSA e t A * F I e l d e r 2 OIOOI+ ilEC OOl~ V+VgC SIS+

e l o * ,

I I PQi~I IU~&~ +ARIMETkRe • l ~ t EYmdCLIC Nam~ UF • OAT+ FiEkU • A ~EO i IT (~ ~UMVER OR ITS [UUI IEO ~fMtOb

g) ~[¥"URU P4RA~ETE4~ " TN~ US( QF T~L ik¥~ORO PARA~EIER R&GSIA~k ~ Ib~

CAUSE T~k CUNr[NTS QF 4 ~ GE~kRA~ PURPle( R[G~efERS TO v~ L I S r [ O

- ~H| US[ OF Tff~ ~kYw040 ffARA~[TEN FkT4(~SIU wILL ¢&U$[ TrE CU~TE~Te OF A ~ FLOATING # o l k r ~E~ZB~AV$

~TATE~E~T

8~LA 1441~ O U~FV~22 0C ¥(U~FLTC~¥) NOP V

UAL |4~URPUT M¥~ U4V&~4|M~#{ IEI ~V~ ORSY~IC~e°4$~ ~ XC ON~KIOR~R

C~OP 2~4 LA l ~ O ~ L 15+**11

UC V(u~FLTC~V~ ~UP V ~VC UMV~L( ` )V ) *~ ( I ] eA~ I4,ORVUT

B P l ~ | l i O 2 U+ O~ UC I e F ~ * 0C Ckl`)`)~o~0r u u * o i ~ Y Z c * o~kv t 4 o u r * UC CL|`)31i~OOTe ARk COmPlEX UR l ~ A ~ A ~ V f

~`)~eAVOi iA~t4 POINT eACA |0 CA~E4 ~4V~ AlE4 k~ |4~12~1~{1`)J U~eAVE R(GSe

eLY CL2 lOOSed SOEC O~IC u e V ~ a lV *CL2

e~V+*

~ i i l i 4 41`)0 CS(e 4 l i E U 121* i SS IE S l ] O I l i l VVVOV 1 2 2 .

OOOOC~ O i O i ~SEA vv~EC e~`)+ OOISCi 41~V CSEi VV~(V 024*

V25+* IOSSC: SIFV C~40 1 ~ 4 V V2V+ OOOSC( 4~E2 C i IA VV~iC V ~ O01O02 B2U*

e2g* |OSOg~ VSlP *

I ` )V+* 101S04 I v v i v ~ i e e ~ l + OOIgOS eo ig i~EC e e z . Ossooc oevveCOl i`)~* ~Oi~E( SiUOIC44 1344 O01S&4 +iUMvGAe eS~+ S l l g t l I`)O+ O O l i t e VVVIOV le lVV+ lV+v V+/+3&V+V+24 i OS i ` ) l e`)v+

ku0 A2qO2~C2WN~ZwR~2 2~U CALL FU~ (G~ F ~ N dPalN Sr~ 1 4 , 1 2 e 1 2 ( 1 3 J l i v e G ¥ ~ S U# G a L k t l

;A J , S A v ~ I v 2 4 ~ON41NU PO|~ I tN Sr 3wO¢lJ ) TO C ~ L k ~ SAVE AM~A ST | J fSAYQ~I24*4 BAC~uARD POL~TL~ LA I`) ,$AvUVV24 POINT TU O*N eiVE A lL=

L I544¥(CS l tOOJ LU*O C , S ~ , ENTVT PU|~T I~ r I O kA |dsHTOi24 PUT ~LTUR~ POI~T IN GPRI4 CNOV ~44 ~O~CE ~U~L IUNU AOOVS ~OA ~eSf BALi 1~1~ E~T(R CILL ~E~, ALVA, A~U

O~4hK~ TU ~ l l d |

OC A L ~ 2 1 C , $ , k , OG 41C2J ~ l ~ a ~ r E R ~

UC l ( R 2 2 J US ~F

~TUkG

2~ M * v , r 7

2~ M*T 77

Fig. 13. (Contd).

Page 17: Making macrospace effective

Making macrospace effectbe

kOC O t J t ~ l CC~L ~UU~I ~ i l ~ ~T~T ~ U ~ k ~

S i S T # l = o l d L ~ t l ~vlO('4 t 4 ~ * ' O O S T ~ VS~ V i i i I d S O i i i l l s LeO0 o,'=¢o g~d*

l l d e i 4 4 7 1 i I ##~ # , ' I c l t ~ l t , J ~ l l l t ~ / IOSOiC V i i 0 C l#0 l l l l ~ i f a d l i ; l i t ~ l * 4 d S S l l 45EV C I t e ~ , l # l t S i °

953+* S i l S l a 47#d Cgoc d~VS¢ ~5=o i O I I l C 9 5 1 . | l i l l e d V l V d l ~ l t i i d O d ~ 9 5 0 * S i V L ~ 2 4 | e l l i s # 1 0 b 0 O l l i i 0 0 l i C l g S V i ~ E S i d i l a l e i l t O t i D t U O O I L ~ E I L d C I V ~ i * ~ l S l # @ 2 4

9 0 1 . * t i i g v E SOOt CSEi I~=EC VO2*P|N id~24 l l i l # l VeLC O/OC I ~ l t ~ 90~*

g O 4 * °

$ i l i E ~ l

~C VlU~P~TC~vI ',OP

5A~ ~ 4 s ~ U T

US t f ~C l # F i l l OC C k l J J I d ~ O l UUaUXt l I ~ " ~ Y 1 I U ~ I t ~C C~ IJJ IV lOCT$ I l l ~0 *~LE I UI l l l i l ~ i a l l

L~ i 4 1 1 l l l 2 ( l S i ~ I V L IEOS,

| | | 9 1 5 SOld CgUV I O | t T i i ; / v C iU I l l l i i d e l l l i i C J O J F I ! S O O C ~ 4 i I t l i l l t S C l l l i l i l l i l l l l i l l l i l l i ~ l l l i l i ~ i 4 t i l i i l i l l l l l S l l l l 4 i 4 1 4 i i i i l 4 1 f i l i a l 0 t l i l l i l i i 4 d d d i t I I I l i S C l ~ i ¢ l C i l i l d l l l 4 l l l l l i ~ l l l l 4 i 4 i i t i l i V t l l l S S l i i l l i l i

l i l O s c t 0 L F

d~tO0 dilVOC

g o 0 * g07 L | ~ l l V ( l i ~ l l l 9~e P L i h l 9 0 t L ; ~ i l l ICLUICL iLbC I 97 i I ~ L f f i i l l g # i i [ L o l U l i V74 I ~ L # i ~ l l 974 I C L o ' # 2 1 * gT~ *CLOICOE¢~2 ° l VTI I C L # I ~ 2 2 * 977 I v ( i ~ l l l

iS0 ° l o s * 051 °

0** L I~A i~E TU i l U x P~0P i ~ i i ~ e° °

I l f c l k l , . l l ~ l , lu ~ * u i

i O l i S { 9iEC UOIC V~V~C

l i l l l i i l l s C0~I d iVE4 i q l i l 4 So l0 e l l s i i i # i H i i c / 8 i 0 i C i E S i l t E I I O I I C ( 410# C e i l V # t l i

l i l t 0 1 ~ l l s CAlL d l A 3 d O l t 0 i 4 1 i i CA32 d # i ~ 4

I I I I I A

I g l t 0 i l o l l

l l i l 0 l i i l i i C l 4

LOG OSJECT COOL IOUl l AUOII

f O l i O S IVvv iCAC l l l l l 4 I l l l l 4 i l t i i i # l d i i i 0 1 t l I I l I i l l l l i S t I l i i l t t i

I l l i i l t l l i ~ 4 I I 0 V ~9~0 I U I L 4 l l l 6 1 S 0 r I O v i l e V i l l i l l l l l C giEC OdIC I l i ~

943 ~ I N 2 9 S 4 1 ~ a l ~ 2

y O G i

iOTA OOS6 g 8 9 ~ g i r l * 9 0 1 * 9 9 2 - 9 g J * 9 9 4 i

g O ~ ' * * V¥~ i

$T~1 3 0 ~ C E

go#* 0~V*SAVSIUJ8 9 i l l

i I V d l l l l l l l l l t / i i i ~ a ' o - l i ~ 4 * l l & l l l ~ d b ~ l l i I J # i i l O o l i ~ l l

[ 0 0 X l l i l 10T C I ~ f ~ ~S~ r ~ $~AIN 3 r~ 1 4 , 1 1 1 1 2 ( I J I SAVE GV~'$ O# C a ~ L ¢ ~

LA J iSlVOdVSV fOK**RU VOINIEk TO ST 3 i S ( i S ) CILLCNO O~V¢ iVE~ IT l ~ l l A V l S i ~ 6 i 4 # A C I i A I O # 0 1 ~ T ~ L i l S l S l V ~ d i ~ l POI~T TU 011 OiVE AREA

L 10 , iV (CSR~$~) LUIU C tS iV * EflT~V #UI~T I~ d iO LA I l L , l O E S S PUT # I I u R N POINT iN SIR l i CNOP 2 t 4 IORCt FULL oO#O AOO~S FOR C,3 ! b i L ~ 1 i 15 ( k l ( V CaLL 3LQI &OtiS* ANU

OIINCH TO C i V i l I

OC v i l l i IOC0~S lO~

OC ~ ( V l ) CSN P I H I ~ i T l l l 03 t# 0C l l l l l I LT0~G

Iv IC$#ESG)

CSLGT COUE 18 P~aCbO l ~ CaLLE~ CikG? k l ~ l S l V S V d ~ 4 ~ i PuI~T ?0 C i L L I N 8 SAVE A ~ l i 3T 10, I O C I J I 3ave HAG, COU[ # R G I ESl L~ 1 4 / 1 2 / 1 2 ( i 3 ) UI01VE HEG0

i d i d S S | i 4 S O i l y CC7~ ~t'CT~ l i l l

l d t l I l i i l L SV#d ~C7~ ¢ ~ 7 ~ iV2# l i l l S l I I # F l i l t # l l i O 4 47iV C l i o d e l l a I ~ l V

i I I l I S 4 7 l i ~iO~ # W I l l iV3= lVJe ~ 1

PWI~T ~O~Eh ST 12,LGC01VL2 SAVE O I l 15 F~OI Ik~CI 0U~BING LOC Xl P~I~T OUT ~ U ~ L d

15,LOCOa~b~ R E S I O ~ 15 ~ In 15115 TLSI dLru~N CUO¢ OL U~l PUT ~ T H ; ~ t S O i ~ PH|~T E~ROR ~($SA~E

~¢C ~ l P ~ T OuT CaLC t 8~ I ~UUT

laSS C0~TUl LOG l i S a S i ViLC UdIC ~ l # ~ i C O ~ l ~ l Sf~

l # S O l i OO0&UL 41J~ ~ i F { ¢ 7 ~ P ~ 7 e ~ i I l i i t 2 OcJ~ w i i 8 I : ' ¢ ~ t l i s t - 0?

l l d l t i 4 1 ~ e C I I ( i v o l ~ l # = i " L l I~=I*o

i l l e l i I . c f t e ~ a v b d 6 4 = f~$ I l i O * ~ t l i v t ~ c c ~ t , . ; @ , ' , , I ~ / w * kC

d l i ~ = i U l ~ l r l i l i f i e i ~ 4 ( l~#J 0 0 I ~ : ~ t V l l d l 4 1 4 1 4 l i 4 , 1 4 ~ 1~74

1~71* * *

l e d b o 4 =ec:, ~o,2 > ~. ' . l , ' 7 t . . ? ¢ . ' 4 5 i.

l l21Yi l 2NO CAt.t. fOi.t t i e p~dM | ~ a I N t a i i 2 r i 2 ( t . l ) 3 *vL 5,W'~I$ Ui' Clt.l,.LA

3e$AV$~VA~ ~ a ~ u POI~TLl l TO 3sPJ( t .q ) CaLt .L~$ S i r e lV t . i I J e 0 a i $ 1 d A ~ * 4 daC~*a~tJ PUI ' i l LN l ~ e S i v S I / 4 ~ #UINT TU ~ i I 0 iV L i ~ ( l

l = , l i l C S k i $ ~ l k u l u C . S . I . i t . f i l l PUll,iT I - I~lo 1 4 i l l d t 4 5 P~I l t . l ~ l t e POINI l ~ 6PI 14 l i d f i l l e t lUL l . ~01l l i ~ # I 0 I U I ~ l S t l l l b t ' , i L k S a i l 0C~, OUt31 11~

i ( x ~ l 60LL~b PO~ • l V l l CSk #a,~l - r . l l l ~

1ot ~, *

s~Le*U~ l ~

• v ( !.+Sl,iE3 q J

CCuL IS ~LACt~ 1~ ~ A L L t " CSL~! | ~ , S s v ~ ¢ . , g ~ * 4 c U i ~ ? TU L a L ~ ¢ ~ S $ J v t AMEJ

Fig. 13. (Contd).

I l l

2~ ~Av J#

| 0 HAT 1'7

Page 18: Making macrospace effective

112 IVAN FLORES

t l l l i l 511~ l d l 4 l i I L i l i O i * $0081C ¥1t~ I 1 4 I ~ t l ~ k i l l *

J i l l * *

l l l l # 2 ~ l # l ~C#t li1~74 14t0 |woo

l o l l 1 1 5 I l l loll i ~ # o l l ~ l t l l l i l l l t l l i t i t l l $ i l l # t l ~ C I a~uCl 11#3

IL41 I I I IG5 47~p ; i t 4 i ~ i 111¥

l l l l

112/ I l l s

I l i l l l 5 IC i C¢31 i t , l l I I I C i 2 I I ( ~ ~i2¢ I ~ l i ~ 112t l l l ¢ l l I # t l l l ~ i l i l ¢ l l t i l l 111¢i2 i 7#2414 i4 i 414 i41 t132 I l i ¢ l i 080282424141141t l i ~ I l l ¢ i 5 { l l l l l l i l i i i i i i l l l ~ l

l i l l o l l lJO

I l l i t l 18 i v 113# 111181 i l + t l i l i t i g i l l D2iC l l i 2 ¢ t i l l l l l i O l i i ~ l iC l$ i l U t # l l i l l i t i l l Sl3C i218 i t i l i 11i2

t i l l l l SO01 l o l l iIU[C 1144

I11181 i l O i 4¢95 i | U ( I

11 | | 94 l i t { 0 i l k

111114 J i l l 1145 I l l l l l t i 3 0 l i i l n i l / 1 6 i o l 4141 t11174 i l G i 4141

l l l l l l l l l l 4 i l l l l l i # l 4111 t i l l

LOt OiJlCl ¢OGI

111192

l l l l 2 1 i § l l

H I l l 4 i l l l l i l i l l l l l l n l i l l l ¢ l l l l 2 C l i i l | [ 4 1 l l l l l l n i l l l l l l l l i t l i i l i i t $ 1 l i l i O l I l l l l l n l l l i l i i l l i l l i l l l l l l l l l l l l l i i i i l l i l

|01100

i e i $ ¢

i l l O e t i t l e l i l l e I l t l l

411 ( i i 11 (4

IOCl l iOUI2

111114 413 i 4241 i1394 l l l l l i te3o i i l l v v v e i I i 111¢ SlOl i l 4 l t i l l +

I t i l f t 4101 i141 i l i l 4 t l l l l i i l i i v i i i l l i l l l l l l f l O l i7 l l ( l 1 l i e i l l ( 0 I l l d t l l l l l l I l l 0 c l l i l i l S ¢ I t l i i 1 l l l l I I 1 { ~ l l ( I v i { ( i l $ # i l l l i t i 0111 l l l i C l i i l i l t 1 l i i 0 t l i l l t ! 0113 t i l l I { [ $ i l l t i 1 1 I l l

i l l i l 4 t i l l i1114 411 l C2 i l i l 2 t i

l l l l l i + l i t 10CI i1224 l i l l l l I S l l

g i l l ! ,,...84"' . . . . , . , n i l l l i l l l i i i i t i i l i H I I t ~ 01to C1 l i 101t i l l f l i l i l l l l l l l l 4111 ¢144 l i l i i l i l l l l I1~8 l l s i v i l l i I l l l l i 0 i l l G I l l 1418 i l i l t l l ~ # l I l l l l i O i l / l l i i k i l l l l l S i i l l l i l l l l i i 0113 k i l l IC(4 i i 2 S I i113¢ l l l l i ~ l l i l 111141 411 i ¢21[ l i l l l t i | I 0 1 ~ l f l 4 i l l i l I S I # l l l t i i l ( l l l l l l i 471 l i l l ( V i l l i I I i l i ¢ l l i i l l l i l i l l i t t i l l I l i l l i i l l I I I l i l O110 CI14 l l i i 412¥4 I l t l i 11114! 4111 l l l i i i l i l O l l l i ( I I ~S C]SJ vi39¢ l l l l / l 0117 ¢28C 142l i i 2 ( 2 i t 0 6 1

s r l t ~ L ~ l

k~ l i e l l , 1 2 ( i ~ l W~i/V{ i l l ~

2S MI+ 17

gT i S I L ~ k l l l ~ l | I ¥ [ I l l 15 I I U ! I~UCI I U I I l I G ~ L2 #Mlml UUT NV~

18ek0k$1~2 R i l l 0 1 | 19 I I 1~118 l t$1 i ( / U l ~ CUGi

IU l # l l l l l l S l l i [ l # l l ~ l t ~ / ~ l l i 1 2 4 1 i ! ~1t1818 ~ ¢ f2 P~l~/ CU? EIL t I l l ~0~1

#

!. [ ~i~l 3'T $ ** ~ l l l 84Cl r~ 3 t i t ( l i . !

L I J t t l v t ~ l l ~ * 4 L0IU 84~ l l ldO POI~TLN IQ I l S r t l l l i i 4114

L ~ 1 4 1 1 2 1 1 l l l J I ~k l l¥~ $¥1?t n RIGS, dl I l l l T ~ l ~ kG~Tdqk TG TPI 5 ¥ 5 T i i LTO~G

i ~ L # l O i l l ICLSlT~l

i l U l CSE~T ~8Tl5~15~ l~Of~t~ ccIrMcL l | C , ~ T ~ 4UXl U i ~ | 8 ~ F~k~ ik@ i S l ~ i h G ~ | i i 4 | 2 ~tG ~Sl~@ l / l l I I l i U I 8 l l 1 4 1 l l + l l l i ] ) 8 4 i t 2 l l l l i l I tG8 k i 3 i l l V ~ l ~ l PUT I G I I i R 0 | i V l & I l l PO|NT(H ST 3 1 i ( 1 3 ) [ * i 0 11411 24V2 t i l l IT 13 i84Vk IU I i 4 ( t l i l 51¢1,410 # 0 l i l t + I I •

I l U l 34V[ i l l l L l l ~ , 5 1 ¥ t I U I ~ I l l l 011 I l V t I I 4 1 I U l l f t l *

I I GPtI~

1141 e l~ l kL~ LGO 43 i83ek l l l i l iN i2 l I T k i l l #01 i l l # IU I 24iX l l l t / l [ ¢ i L L ~ Sl~ 14e12i12(13) l iVE lO l lS Ot ¢ i k k l l t i l t + * l i s t * k l 31SIVIMIS2 1 0 1 . 4 t l # 0 1 1 I l l i151* IT 2i11131 TO G i L L I t l 14¥1 4 I l l l l O l l I1 l l l 2 1 V l l H l l 4 14C11410 # 0 1 1 l t l l l S J i k l l l e 2 4 V l l i g l 1011l To O i l 11¥2 l i t 4 1 i 54 . * i i 5~+ L k I l t i l v i C I l t G 0 l LUA0 ~ t l l l l t l l l l POIIT I I I I 0 ll~#* 1 4 ~ T i l 8 2 pUI l t I 0 1 I POINT IN I#111 ST~I 80U~CI 811lt~LNT I I lAY Y7

115#* CNUP i l l FOAI! FOLk IONO 400~1 FOI k i l l 1180* e i k t 1118 2NT[ I k i l l Sgl . 40181 4NO 2 " i | t i N I N IU ~ l l i l + 1188** i 1 8 i * OC, 4¢14) 10C010 tOM l l t l i 0¢ 11931 e l ] e l I 1162- UC t i l l ) P l I I I I T ( l l t i 6 J . o¢ l ( 1 3 i l 1164i OC l l l J l l I l l S + 09 IF l l #S iS lVQ i l ~2 0¢ 111111 1167+ klCtG l iOe IvckSI IOOl I159** I IP I+SIUX ¢+~GI COO( I I PLiCkC I I C iLL I~ CI(¢T i l # l * * [112** C0 I¢ I I tNAT | kiLLING L i | i ~ I ITH 1173** ILOC~ #01 l l k k lO ~OC 11#4** | i l l * * I t T U I # l O I l l #IOM C i | l l i l i f O * l i V i d 2 L4 3 1 S i i L I I S 1 # O l l l l O POINT(I IO CTLL(IO i t / I t IT J I 0 ( 1 3 I 14Vl l t t l 1118" IT 1 3 t l l i L I I I i i 4 I I C l i i l 0 l O I l l l l I t# i+ kl 13iIIVLIIS2 i+A|3 PUINTkO TO 2 1 i t l l ( l 5

" . #OR kOC IISOiRtCiLLUC hOP l l l l + I¥C 1 l i i l l k L 2 l l + ¢ i L L 0 k l i l i l + l ¥ I 0 1 ¥ 1 L i l l i t ¢ t l i l l t J * l i e 0 l $ l l l l k k s l l ] l l l l i i XC O l l l / O l l l l l t ~ MvC 011 t (4 )+43 l i e 6 . ~NOV 2~4 [ i 4 7 * L4 l l 0 l i ~ i l O l * L l S l * * l l l l i t * l i l t i l , iS l l g i * 6 UkPIIS4 l t O i * OC VIUNILTCNV) t l g t i O N P l l ~ i NOP 5 l i t l + ~VC O~¥1L{~ lJ lO( IJ |194* OiL I4#ONPUT | l i t + MV| 0 l i l ~ i | i l l ~ l t ! I l l 0 1 I¥C D R I Y # I I C L I l I ~ I | i l l * l C O l l l / O t l l 1158* M¥C 01 i1 (4 )183 f l i t + CMC# 214 l i l Y * t l l tONil i~01+ k 1 8 i * I 1 5 l l l l * B i l l 141IS 1~13* 6 U I / I I 6 5 ~2i4+ O~ VLU~LTGNVl I~SiUN#~tSS NCP | l l i * lVC I¥1~C31115(11 i217- 61L 14iOIPUT l l t l i I ¥ I 0 1 ¥ 1 ~ i i l l i k l I I 121l+ I¥C O l l l l l l k L S I l ~ l

Fig . 13. ( C o n t d ) .

Page 19: Making macrospace effective

Making macrospace effective t 13

tine for EQD 1426t is made via register 14. The remainder of EQD is put in the main caller's control section {4371. A lot of code is produced for the LOC macro which has been removed. The next call of EQD appears immediately after the previous one (8181. It consists of the calling sequence and linkage. The closed subroutine is absent: we pick up the third portion of the code produced by EQD (848). Terminal processing follows.

Call of EQD i, another control section

After the second call of EQD. the main program gives control to another control section (966-98l). We see this control section established (1136) and another call of EQD is issued here {l 147). E(en though this call appears in the control section named SAL'X. it refers to the same code next produced should be in SAUX (I170).

Call of ESO

Although so far ESQ has been appearing as a call within EQD, it is essential that we be able to use it as a stand-alone routine. To make sure that this is possible, we issue a call to ESQ in SMAIN (983). The linkage and calling sequence is produced in SMAIN (986-999). The closed subroutine which was produced for the call of ESQ which appeared within EQD will be reused for this call (991). Upon return from the closed subroutine, the remaining code is placed in SMAIN (1004-1008).

C O N C L U S I O N

This paper has presented a method for writing very large macrodefinitions which, at the same time, conserve space in the program and produce little or no interference with the programmer's main code. Each control section will be smaller, which in turn reduces the number of base registers involved in the construction of each control section.

R E F E R E N C E S

1. I. Flores, Assemblers and BAL, p. 420. Prentice-Hall, Englewood Cliffs, N.J. (197l). 2. W. G. Rudd, Assembly hlnyuaye Proyrammin~l and the IBM 360 and 370 Computers, p. 553. Prentice-Hall,

Englewood cliffs. N.J. 11976). 3. IBM, system' 370 Assembler Language, Form GC33-4010. 4. IBM. System 370 Principles of Operation, Form GA22-7000. 5. IBM. Assembler Programmer's Guide, Form GC33-4021.

About the Author--lvAx FLORES holds a B.A. from Brooklyn College, an M.A. from Columbia University and a Ph.D. from New York University. He has been working in the computer field since 1950. In 1960 he established Flores Associates, which has done consulting in computer design, programming, software and systems design for many firms, large and small, including Ford. Raytheon, United Aircraft, AMF, NCR, CAI and IBM. He has taught in the Electrical Engineering Department of Polytechnic Institute of Brooklyn, New York University and Stevens Institute of Technology, and is now Professor of Statistics at the Baruch College, City University of New York where he has been teaching Computer Methodology since 1967.

Author of almost fifty papers, he has done research in many areas of computer science, including mass memories, the latter being supported by a grant from the Atomic Energy Com- mission. He has published fourteen texts on both hardware and software. Titles for Prentice-Hall and Allyn and Bacon include The Logic of Computer Arithmetic, Computer Software, Computer Proyramminy, Computer Design, Computer Sortino, and Computer Organization, Data Structure and Manayement, Assemblers and BAL, Job Control Lan(juaye and File Definition, OS/MVT and Peripheral Devices.

Dr. Flores has been a reviewer for many scholarly journals in the computer field and was a consultant to the U.S. Army Scientific Advisory Panel. He is listed in many directories includ- ing American Men of Science, Who's Who in the East and Contemporary Authors. Professor Flores is a member of Sigma XI and a fellow of the British Computer Society. He was sent to India by the United Nations to assist them with their computerized Water Resources Simula- tion project.

~ L . 3 2 L~