22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AIF Instruction<br />

You cannot branch from open code into a macro definition or between macro<br />

definitions, regardless of nested calls to other macro definitions.<br />

The following macro definition generates the statements needed to move a fullword<br />

fixed-point number from one storage area to another. The statements are<br />

generated only if the type attribute of both storage areas is the letter F.<br />

MACRO<br />

&N MOVE &T,&F<br />

AIF (T'&T NE T'&F).END Statement 1<br />

AIF (T'&T NE 'F').END Statement 2<br />

&N ST 2,SAVEAREA Statement 3<br />

L<br />

2,&F<br />

ST<br />

2,&T<br />

L<br />

2,SAVEAREA<br />

.END MEND Statement 4<br />

The logical expression in the operand field of Statement 1 has the value true if the<br />

type attributes of the two macro instruction operands are not equal. If the type<br />

attributes are equal, the expression has the logical value false.<br />

Therefore, if the type attributes are not equal, Statement 4 (the statement named<br />

by the sequence symbol .END) is the next statement processed by the assembler.<br />

If the type attributes are equal, Statement 2 (the next sequential statement) is<br />

processed.<br />

The logical expression in the operand field of Statement 2 has the value true if the<br />

type attribute of the first macro instruction operand is not the letter F. If the type<br />

attribute is the letter F, the expression has the logical value false.<br />

Therefore, if the type attribute is not the letter F, Statement 4 (the statement named<br />

by the sequence symbol .END) is the next statement processed by the assembler.<br />

If the type attribute is the letter F, Statement 3 (the next sequential statement) is<br />

processed.<br />

Extended AIF Instruction<br />

The extended AIF instruction combines several successive AIF statements into one<br />

statement.<br />

►►──┬─────────────────┬──AIF────────────────────────────────────────►<br />

└─sequence_symbol─┘<br />

┌─,─────────────────────────────────┐<br />

►─── ▼ (logical_expression)sequence_symbol┴───────────────────────────►◄<br />

sequence_symbol<br />

is a sequence symbol<br />

logical_expression<br />

is a logical expression the assembler evaluates during conditional assembly<br />

time to determine if it is true or false. If the expression is true (logical value=1),<br />

the statement named by the sequence symbol in the operand field is the next<br />

statement processed by the assembler. If the expression is false (logical<br />

value=0), the next logical expression is evaluated.<br />

Chapter 9. How to Write Conditional Assembly Instructions 391

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

Saved successfully!

Ooh no, something went wrong!