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.

Floating-Point Math Instructions<br />

8.3.4 /R Divide ACCU 2 by ACCU 1 as a Floating-Point Number (32-Bit<br />

IEEE-FP)<br />

Format<br />

/R<br />

Description of instruction<br />

Result<br />

Status word<br />

Example<br />

/R (divide 32-bit IEEE floating-point numbers) divides the contents of accumulator 2<br />

by the contents of accumulator 1. The contents of accumulator 1 and accumulator 2<br />

are interpreted as 32-bit IEEE floating-point numbers. The instruction is executed<br />

without regard to, and without affecting, the RLO. The status bits CC 1, CC 0, OS,<br />

and OV are set as a function of the result of the 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.<br />

The result in ACCU 1 is CC 1 CC 0 OV OS Note<br />

+qNaN 1 1 1 1<br />

+infinite 1 0 1 1 Overflow<br />

+normalized 1 0 0 -<br />

+denormalized 0 0 1 1 Underflow<br />

+zero 0 0 0 -<br />

-zero 0 0 0 -<br />

-denormalized 0 0 1 1 Underflow<br />

-normalized 0 1 0 -<br />

-infinite 0 1 1 1 Overflow<br />

-qNaN 1 1 1 1<br />

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

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

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

OPN DB10<br />

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

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

1.<br />

/R //Divide ACCU 2 by ACCU 1; store the result in ACCU 1.<br />

T DBD20 //The content of ACCU 1 (result) is transferred to DBD20 in DB10.<br />

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

8-8 A5E00706960-01

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

Saved successfully!

Ooh no, something went wrong!