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.

SETA Instruction<br />

SRA<br />

SRL<br />

Example<br />

After the following statements &VAR contains the arithmetic value +4.<br />

Name Operation Operand<br />

&OP1 SETA 1<br />

&OP2 SETA 2<br />

&VAR SETA (&OP1 SLL &OP2)<br />

Format: Logical-expression<br />

Operands: Arithmetic<br />

Output: The 31-bit numeric part of the signed first operand is shifted right the<br />

number of bits specified in the rightmost six bits of the second operand. The<br />

sign of the first operand remains unchanged. Bits shifted out of bit position 31<br />

are lost. Bits equal to the sign are used to fill the vacated bit positions on the<br />

left.<br />

Examples<br />

After the following statements &VAR contains the arithmetic value +2.<br />

Name Operation Operand<br />

&OP1 SETA 1<br />

&OP2 SETA 2<br />

&VAR SETA (&OP1 SRA &OP2)<br />

After the following statements &VAR contains the arithmetic value −1.<br />

Name Operation Operand<br />

&OP1 SETA -344<br />

&OP2 SETA 4<br />

&VAR SETA (&OP1 SRA &OP2)<br />

Compare this result with the result in the second example under SRL below.<br />

Format: Logical-expression<br />

Operands: Arithmetic<br />

Output: The 32-bit first operand is shifted right the number of bits specified in<br />

the rightmost six bits of the second operand. Bits shifted out of bit position 31<br />

are lost. Zeros are used to fill the vacated bit positions on the left.<br />

Examples<br />

After the following statements &VAR contains the arithmetic value +2.<br />

Name Operation Operand<br />

&OP1 SETA 1<br />

&OP2 SETA 2<br />

&VAR SETA (&OP1 SRL &OP2)<br />

After the following statements &VAR contains the arithmetic value .<br />

Chapter 9. How to Write Conditional Assembly Instructions 357

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

Saved successfully!

Ooh no, something went wrong!