22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

XATTR Instruction<br />

SCOPE<br />

►►──SCOPE(<br />

─┬─SECTION─<br />

┬─) ───────────────────────────────────────────►◄<br />

├─MODULE──┤<br />

├─LIBRARY─┤<br />

├─IMPORT──┤<br />

└─EXPORT──┘<br />

SCOPE(SECTION), abbreviation SCOPE(S)<br />

Instructs the assembler to set the binding scope to “Section.”<br />

SCOPE(MODULE), abbreviation SCOPE(M)<br />

Instructs the assembler to set the binding scope to “Module.”<br />

SCOPE(LIBRARY), abbreviation SCOPE(L)<br />

Instructs the assembler to set the binding scope to “Library.”<br />

SCOPE(IMPORT), abbreviation SCOPE(X)<br />

| Instructs the assembler to set the binding scope to “Export-Import” (see note<br />

| following this list).<br />

SCOPE(EXPORT), abbreviation SCOPE(X)<br />

Instructs the assembler to set the binding scope to “Export-Import.”<br />

| This statement indicates only that the name field symbol has the specified scope. A<br />

| symbol having SCOPE(X) will have IMPORT status only if declared in an EXTRN<br />

| statement, and will have EXPORT status only if declared explicitly in an ENTRY<br />

| statement, or declared implicitly as an entry on a CSECT or RSECT statement.<br />

| The SCOPE(IMPORT) or SCOPE(EXPORT) attribute is required for using Dynamic<br />

| Link Libraries under the <strong>Language</strong> Environment®. For details, refer to z/OS<br />

| V1R6.0 <strong>Language</strong> Environment Programming Guide (SA22-7561).<br />

| Association of Code and Data Areas (MVS and CMS)<br />

| To provide support for application program reentrancy and dynamic binding, the<br />

| assembler provides a way to associate read-only code and read-write data areas.<br />

| This is done by defining and accessing “associated data areas” called PSECTs. A<br />

| PSECT (Private or Prototype Control Section) when instantiated becomes the<br />

| non-shared working storage for an invocation of a shared reentrant program.<br />

| In the Program Object model, a PSECT is an element within the same section as<br />

| the element containing the shared code to which it belongs. The two classes<br />

| defining these elements will have attributes appropriate to their respective uses.<br />

| Typically, V-type and R-type address constants are used to provide code and<br />

| data-area addressability for a reentrant program using PSECTs.<br />

| Figure 61 on page 233 shows an example of two sections A and B, each with a<br />

| PSECT. When the program object AB containing A and B is instantiated, a single<br />

| copy of the reentrant CODE class is loaded into read-only storage, and a copy of<br />

| the PSECT class belonging to AB is loaded into read-write storage. The invoker of<br />

| A provides the address of A's PSECT so that A can address its own read-write<br />

| data. A later instantiation of AB would load only a new copy of the PSECT class.<br />

232 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!