10/19/2011 9:50 AM | |
Posts: 270 Rating:
|
Hello ssmanku1699, this is the help about the code I can give you: 1) L P##DVC_StrtAddr - here you load pointer to the starting address of your stuff 2) LAR1 - this commands transfers the pointer to address register 1, so you can use it for addressing and load other stuff freely etc. 3) L W [AR1,P#0.0] - here you load word from the specified address which is being pointed by address register 1, which isoffsset by 0 bytes and0 bits(that p#0.0,which seemssilly here, but it comes in very handy in loops etd.) 4) T #DB_No - you store the loaded value into variable DB_No, whichidentifies data block you use 5)OPN DB [#DB_No] -now you open the specified datablock 6) L D [AR1,P#2.0] - sameway as before, you load from address register, but now you load double word and you offset the data by 2 bytes (so i.e. if the original address wasi.e. MD20, now you are loading from MD22 (which wouldn't make sense, but you loaded word before, so it'sallright:-]) 7) LAR1 - same as before 8)L DBD [AR1,P#0.0]- now you are loading double wordfrom the address specified inyour new value from addressregister, however you load this double fromyouropened datablock, with no offset |
This contribution was helpful to
1 thankful Users |
10/19/2011 12:39 PM | |
Joined: 10/7/2005 Last visit: 9/22/2023 Posts: 2987 Rating:
|
Hello ssmanku1699 here's my take on things onwhat your logic produces(assuming P##DVC_StrtAddr = P#db20.dbx6.0) L P##DVC_StrtAddr// load a value that points to start of the pointerinto accu 1 LAR1 // AR1 now points to the start address of the Pointer value (located in L memory of calling block, aka V memory) L W [AR1,P#0.0] // Load Pointers DB number fromV memory into accu 1 T #DB_No // Store DB number in variable OPN DB [#DB_No] // Open DB 20 L D [AR1,P#2.0] // Load Pointers address partfromV memory into accu 1 LAR1 // AR1 now contains the address part of the pointer (i.e.DBX6.0)
|
Cheers |
|
12/17/2011 11:52 AM | |
Posts: 9 Rating:
|
Could Any One Explain the Differences of Using SLD 2 SLD 3 SLD 4 SRD 2 SRD 3 SRD 4 On which Situation Which Instruction should we use. |
Follow us on