0% found this document useful (0 votes)
62 views1 page

Conditional Assembly

Conditional Assembly in a macro facility allows program control over code generation through commands like IF-ELSE-ENDIF, WHILE-ENDW, and GOTO. It also requires branch labels, comparison representations like EQ for = and NE for ≠, and logical operators. Additionally, string processing functions are needed, including those for working with comma separated lists (%NITEMS), getting the length (%LENGTH) or substrings (%SUBSTR) of parameters, and indexing into strings.

Uploaded by

Mohamed Med
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views1 page

Conditional Assembly

Conditional Assembly in a macro facility allows program control over code generation through commands like IF-ELSE-ENDIF, WHILE-ENDW, and GOTO. It also requires branch labels, comparison representations like EQ for = and NE for ≠, and logical operators. Additionally, string processing functions are needed, including those for working with comma separated lists (%NITEMS), getting the length (%LENGTH) or substrings (%SUBSTR) of parameters, and indexing into strings.

Uploaded by

Mohamed Med
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Conditional Assembly

Conditional Assembly in a macro facility refers to mechanisms for


providing program control over the code generation process. These
require the addition of macro facility commands such as

• IF-ELSE-ENDIF
• WHILE-ENDW
• GOTO

along with branch point labels (e.g., !EXIT) and representational


forms for comparison; e.g.,

EQ for = NE for ≠
LT for < LTE for <=
GT for > GTE for >=

and logical operators AND, OR, NOT with the usual parenthesis grouping.

Additionally, since the macro facility is essentially a text processor, it


is necessary to provide at least rudimentary string processing
capabilities, including system functions for

• working with comma separated lists (%NITEMS)


• length of input parameters (%LENGTH)
• substrings (%SUBSTR)
• indexing into a string (e.g., &MSG[0], or &INIT[2])

%NITEMS() is the number of parameters given by the programmer;


if a parameter &L is a comma separated list, then %NITEMS(&L)
gives the number of items in the list.

%LENGTH(&L) gives the length of &L as a text string.

%SUBSTR(&L, 3, 4) gives the (up to) length 4 substring of &L


starting from index 3.

&L[2] gives the character at index 2 of &L. &L[2,4] gives the


string consisting of the characters at indices 2 and 4 of &L.

You might also like