Sign in to follow this  
Followers 0
gruntstripe

Really Basic Data Logic Question

4 posts in this topic

Hi, My question is in the screenshot below. It's from Step7 lite. I understand that if you move, for example, a byte to a word the result will be padded out with zeros'. Or a word to a byte will be truncated. But I don't understand what is happening here. Thanks for any help.

Share this post


Link to post
Share on other sites
MW0 = MB0 AND MB1 MW1 = MB1 AND MB2 MW2 = MB2 AND MB3 etc Hope it helps? Steve

Share this post


Link to post
Share on other sites
Hi Steve, Yes I can follow what you're stating but I can't see why it is so. I would have thought MW0 = MB0 & MB1, MW1 = MB2 & MB3 and so on. Regards, gs

Share this post


Link to post
Share on other sites
Now that would have been really confusing.MW0 = MB0 + MB1 MW2 = MB2 + MB3 and MD0 = MW0 + MW2 = MB0 + MB1 + MB2 + MB3 MD4 = MW4 + MW6 = MB4 + MB5 + MB6 + MB7 with merker addresses in particular, you have to be very careful that you dont unintentionally cross boundaries between separate addresses. It is very easy to do for example MD10 = MD6 + MD8 which has two cases of crossing boundaries. For words, always use even addresses. For doublewords, use quad-even (not sure if that is the right term) adresses. i.e MD0, MD4, MD8, MD12, MD16 etc.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0