I am trying to understand pointer in S7 and come across the following code :
//Assume an integer symbol named index exists that contain the index into the table.
L index //load a variable index into the table
SLD 3 // shift left 3 bits to crate an index pointer
L P#20.0 // Load the pointer to the start of the table
+D // Add index pointer to start of table pointer
T MD100 // store the indexd pointer in MD100
L MB[MD100] // read the table element into the accumulator
My question is how shift left 3 bits create an index pointer.
If anybody please explain it will be great help.
Thanks
//Assume an integer symbol named index exists that contain the index into the table.
L index //load a variable index into the table
SLD 3 // shift left 3 bits to crate an index pointer
L P#20.0 // Load the pointer to the start of the table
+D // Add index pointer to start of table pointer
T MD100 // store the indexd pointer in MD100
L MB[MD100] // read the table element into the accumulator
My question is how shift left 3 bits create an index pointer.
If anybody please explain it will be great help.
Thanks