2/7/2010 12:37 PM | |||||||||||||||||||||||||
Joined: 10/7/2005 Last visit: 9/23/2023 Posts: 2987 Rating:
|
Hello Mudong it is actually neither MD nor DBD in the particular example of Entry ID 5498301. So called "area-crossing indirect addressing" is usedwhich is a fancy way for saying that the memory area (e.g. DB, M, I , Q etc.)is contained in the most significant Byte of the (4 Byte long) Adress Register,rather than being explicitly specified in the instruction. Here is (a bit of a silly) example to outline the differences between "Area-crossing" and "Area-internal"addressing: LAR1 P#I 7.0 // Load AR1 with Area-crossing pointer to I 7.0 LAR2 P#7.1 // Load AR2 with Area-internalpointer toaddress 7.1 A [AR1,P#0.0] //= "A I 7.0" (AR1value is "I 7.0") AI [AR2,P#0.0] // = "A I 7.1" (AR2 value is"7.1", "I" is part of instruction) = Q [AR2,P#0.0] // = "= Q 7.1" (AR2value is"7.1", "Q" is part of instruction) =Q [AR1,P#0.0] // = "= Q 7.0" (even though AR1 contains value of "I 7.0",the instruction explictly specifies "Q" which "overrules" the "I" memory area in AR1) And here are the hex values in use to nominate the Memory area(inthe most significant Byte of the Adress Register):
And now to the question which D is used in your example: Since "Address" is declared as an INparameter of type Pointer for a Function,it is actually the so called "V" memory area (Local data of the calling block) to which the access take place (the Pointer values are stored in "invisible" TEMP variables of the Block from which you call your Function). So I guess you would have to call it "VD" even though this does NOT exist as a direct instruction. I hope this helps |
||||||||||||||||||||||||
Last edited by: fritz at: 2/7/2010 12:41 PMCheers |
|||||||||||||||||||||||||
This contribution was helpful to
7 thankful Users |
8/6/2010 3:37 PM | |
Posts: 35 Rating:
|
Hi , Can you please explain what that whole instruction mean and does? L D [AR1, P#2.0] |
8/7/2010 3:20 PM | |
Joined: 10/7/2005 Last visit: 9/23/2023 Posts: 2987 Rating:
|
Hello Juergen |
Cheers |
|
This contribution was helpful to
2 thankful Users |
Follow us on