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.11 /D Divide ACCU 2 by ACCU 1 as Double Integer<br />

(32-Bit)<br />

Format<br />

Description<br />

/D<br />

Status word<br />

/D (divide 32-bit integer numbers) divides the contents of ACCU 2 by the contents of<br />

ACCU 1. The contents of ACCU 1 and ACCU 2 are interpreted as 32-bit integer<br />

numbers. The result of the instruction is stored in accumulator 1. The result gives<br />

only the quotient and not the remainder. (The instruction MOD can be used to get the<br />

remainder.)<br />

The instruction is executed without regard to, and without affecting, the RLO. The<br />

status word bits CC 1, CC 0, OS, and OV are set as a function of the result of the<br />

instruction.<br />

The contents of accumulator 2 remain unchanged for CPUs with two ACCUs.<br />

The contents of accumulator 3 are copied into accumulator 2, and the contents of<br />

accumulator 4 are copied into accumulator 3 for CPUs with four ACCUs. The<br />

contents of accumulator 4 remain unchanged.<br />

See also Evaluating the Bits of the Status Word with Integer Math Instructions.<br />

BR CC 1 CC 0 OV OS OR STA RLO /FC<br />

writes: - x x x x - - - -<br />

Status bit generation CC 1 CC 0 OV OS<br />

Quotient = 0 0 0 0 -<br />

-2147483648 = Quotient > 0 1 0 0 -<br />

Quotient = 2147483648 1 0 1 1<br />

Division by zero 1 1 1 1<br />

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

A5E00706960-01 7-13

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

Saved successfully!

Ooh no, something went wrong!