展开查看
以下是引用z100o在2014-06-02 09:28:27的发言 >5楼:多谢各位,那么请问下面的为什么要移位3位呢?
L #Adress_Drive // lade die Adresse
SLD 3 // schiebe die Byteadresse um 3 nach links
LAR1 // und ablegen ins Adressregister 1
L PIW [AR1,P#0.0] // lade 1. Pheripheriewort
T DBW 30 // und ablegen in RCV_PZD1_ZSW1
L PID [AR1,P#2.0] // lade 2.+3. Pheripheriewort
T DBD 32 // und ablegen in RCV_PZD2_3_HIW
左移3位就是把硬件配置地址转换成指针,比如说你的硬件地址是256,左移3位后就得到了P#256.0,再把它装载到AR1中,那你的PIW[AR1,P#0.0]地址实际就是PIW256.