RMA
Member
Has anybody got a routine handy that will take an INT as input (1 - 21) and convert it to the Byte.Bit format that is needed to add to a basic Pointer Offset to access a list of BOOLS in a DB.
At first I thought it was going to be easy using
L #Module_Nr
L1
SLD
or something similar, but of course that only works up to 7, never mind the problems relating to Byte position in the DWORD! I'm sure there must be a relatively elegant way to achieve this, but I'm blowed if I can think of it!
Just thought about it a bit more.
If the worst comes to the worst I suppose since I've only got to go up to 21, I could always break it down into Bytes to use the SLW instruction and adjust the Pointer starting position accordingly. Doing that 6 times is a bit much spaghetti though, even for me! So if anybody has any better solutions, I'm still in the market!
Edit:
Further thoughts, If I divide the the Module Number by 8 and save the remainder somehwere, then I've got my Byte address in AKKU1 Low. Then clear AKKU1 High and I've got the Basis for my Pointer, SLD3 and add the remainder, ought to do it, or have I forgotten something?
Off to check the STL handbook and see if my memory is serving correctly on how /I works.
At first I thought it was going to be easy using
L #Module_Nr
L1
SLD
or something similar, but of course that only works up to 7, never mind the problems relating to Byte position in the DWORD! I'm sure there must be a relatively elegant way to achieve this, but I'm blowed if I can think of it!
Just thought about it a bit more.
If the worst comes to the worst I suppose since I've only got to go up to 21, I could always break it down into Bytes to use the SLW instruction and adjust the Pointer starting position accordingly. Doing that 6 times is a bit much spaghetti though, even for me! So if anybody has any better solutions, I'm still in the market!
Edit:
Further thoughts, If I divide the the Module Number by 8 and save the remainder somehwere, then I've got my Byte address in AKKU1 Low. Then clear AKKU1 High and I've got the Basis for my Pointer, SLD3 and add the remainder, ought to do it, or have I forgotten something?
Off to check the STL handbook and see if my memory is serving correctly on how /I works.
Last edited: