22.07.2013 Views

Step7 Basic operations, program blocks - DCE FEL ČVUT v Praze

Step7 Basic operations, program blocks - DCE FEL ČVUT v Praze

Step7 Basic operations, program blocks - 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.

• Pointer ‐ 32 bits<br />

• Address registers AR1, AR2<br />

• Indirect addressing<br />

– Memory‐based … T QW[MD12] –write an output word to an address<br />

given by the value of MD12<br />

– Register‐based … T QW[AR1,P#2.0] –write an output word to an<br />

address given by the sum of address register AR1 and 2<br />

• Operations with address registers<br />

– LAR1, LAR2 … load ACCU1 to address register<br />

– LAR1 MD12, LAR1 P#M0.0 … load value to address reg.<br />

– TAR1, TAR2 … transfer value from address register<br />

IMPORTANT<br />

Pointer to address area: P#M0.0 BYTE 20, P#DB1.DBX0.0 BYTE 20<br />

• Area and out‐of‐area addressing<br />

Indirect addressing<br />

A space in the<br />

DB must be<br />

allocated, i.e.<br />

ARRAY<br />

Indirect addressing<br />

– Area … L MW[AR1,P#0.0] –the address space is part of the operand<br />

– Out‐of‐area … L W[AR1,P#0.0] –the address space is given by the<br />

address register<br />

• Examples<br />

– Memory indirect addressing with the area pointer<br />

L P#30.0<br />

T MD12<br />

L MW[MD12]<br />

– Memory indirect addressing with a value –to address counters, timers<br />

and <strong>blocks</strong><br />

L 133<br />

T MW20<br />

OPN DB[MW20]<br />

SE T[MW20]<br />

3.10.2012<br />

9

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

Saved successfully!

Ooh no, something went wrong!