26.10.2012 Views

Statement List (STL) - DCE FEL ČVUT v Praze

Statement List (STL) - DCE FEL ČVUT v Praze

Statement List (STL) - DCE FEL ČVUT v Praze

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.

Integer Math Instructions<br />

7.2 Evaluating the Bits of the Status Word with Integer Math<br />

Instructions<br />

Description<br />

The integer math instructions influence the following bits in the Status word: CC1<br />

and CC0, OV and OS.<br />

The following tables show the signal state of the bits in the status word for the results<br />

of instructions with Integers (16 and 32 bits):<br />

Valid Range for the Result CC 1 CC 0 OV OS<br />

0 (zero) 0 0 0 *<br />

16 bits: -32 768 0 (positive number)<br />

32 bits: 2 147 483 647 >= result > 0 (positive number)<br />

1 0 0 *<br />

* The OS bit is not affected by the result of the instruction.<br />

Invalid Range for the Result A1 A0 OV OS<br />

Underflow (addition)<br />

16 bits: result = -65536<br />

32 bits: result = -4 294 967 296<br />

0 0 1 1<br />

Underflow (multiplication)<br />

16 bits: result < -32 768 (negative number)<br />

32 bits: result < -2 147 483 648 (negative number)<br />

0 1 1 1<br />

Overflow (addition, subtraction)<br />

16 bits: result > 32 767 (positive number)<br />

32 bits: result > 2 147 483 647 (positive number)<br />

0 1 1 1<br />

Overflow (multiplication, division)<br />

16 bits: result > 32 767 (positive number)<br />

32 bits: result > 2 147 483 647 (positive number)<br />

1 0 1 1<br />

Underflow (addition, subtraction)<br />

16 bits: result < -32. 768 (negative number)<br />

32 bits: result < -2 147 483 648 (negative number)<br />

1 0 1 1<br />

Division by 0 1 1 1 1<br />

Operation A1 A0 OV OS<br />

+D: result = -4 294 967 296 0 0 1 1<br />

/D or MOD: division by 0 1 1 1 1<br />

<strong>Statement</strong> <strong>List</strong> (<strong>STL</strong>) for S7-300 and S7-400 Programming<br />

7-2 A5E00706960-01

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

Saved successfully!

Ooh no, something went wrong!