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

Create successful ePaper yourself

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

Integer Math Instructions<br />

7.10 *D Multiply ACCU 1 and ACCU 2 as Double Integer<br />

(32-Bit)<br />

Format<br />

Description<br />

*D<br />

Status word<br />

Example<br />

*D (multiply 32-bit integer numbers) multiplies the contents of ACCU 2 by the<br />

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

integer numbers. The result is stored in accumulator 1 as a 32-bit integer number. If<br />

the status word bits are OV1 = 1 and OS = 1, the result is outside the range of a<br />

32-bit integer number.<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 />

Product = 0 0 0 0 -<br />

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

Product > 2147483647 1 0 1 1<br />

Product < -2147483648 0 1 1 1<br />

<strong>STL</strong> Explanation<br />

L ID10 //Load the value of ID10 into ACCU 1.<br />

L MD14 //Load contents of ACCU 1 into ACCU 2. Load contents of MD14 into ACCU<br />

1.<br />

*D //Multiply ACCU 2 and ACCU 1; store the result in ACCU 1.<br />

T DB1.DBD25 //The contents of ACCU 1 (result) are transferred to DBD25 in DB1.<br />

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

7-12 A5E00706960-01

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

Saved successfully!

Ooh no, something went wrong!