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.

Examples<br />

Shift and Rotate Instructions<br />

Contents ACCU1-H ACCU1-L<br />

Bit 31 . . . . . . . . . . 16 15 . . . . . . . . . . 0<br />

before execution of SSD 7 1000 1111 0110 0100 0101 1101 0011 1011<br />

after execution of SSD 7 1111 1111 0001 1110 1100 1000 1011 1010<br />

Example 1<br />

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

L MD4 //Load value into ACCU 1.<br />

SSD 7 //Shift bits in ACCU 1 seven places to the right, according to the sign.<br />

T MD8 //Transfer result to MD8.<br />

Example 2<br />

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

L +3 //Load value +3 into ACCU 1.<br />

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

SSD //Shift number is value of ACCU 2- L- L => Shift bits with sign in ACCU 1 three<br />

places to the right, fill free places with state of sign bit.<br />

JP NEXT //Jump to NEXT jump label if the bit shifted out last ( CC 1) = 1.<br />

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

A5E00706960-01 11-5

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

Saved successfully!

Ooh no, something went wrong!