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.

Floating-Point Math Instructions<br />

8.4.7 TAN Generate the Tangent of Angles as Floating-Point<br />

Numbers (32-Bit)<br />

Format<br />

TAN<br />

Description of instruction<br />

Result<br />

Example<br />

TAN (generate the tangent of angles as floating-point numbers, 32-bit, IEEE-FP)<br />

calculates the tangent of an angle specified as a radian measure. The angle must be<br />

present as a floating-point number in ACCU 1. The result is stored in accumulator 1.<br />

The instruction influences the CC 1, CC 0, OV, and OS status word bits.<br />

The contents of accumulator 2 (and the contents of accumulator 3 and accumulator<br />

4 for CPUs with four ACCUs) remain unchanged.<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 />

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

L MD10 //The value from memory double word MD10 is loaded into ACCU 1. (This<br />

value must be in the floating-point format.)<br />

TAN //Calculate the tangent of the floating-point number (32-bit, IEEE-FP)<br />

in ACCU 1. Store the result in ACCU 1.<br />

AN OV //Scan the OV bit in the status word for "0."<br />

JC OK //If no error occurred during the TAN instruction, jump to the OK jump<br />

label.<br />

BEU //Block end unconditional, if an error occurred during the TAN<br />

instruction.<br />

OK: T MD20 //Transfer the result from ACCU 1 to memory double word MD20.<br />

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

8-16 A5E00706960-01

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

Saved successfully!

Ooh no, something went wrong!