gruntstripe Posted January 28, 2007 Report Posted January 28, 2007 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. Quote
Moggie Posted January 28, 2007 Report Posted January 28, 2007 MW0 = MB0 AND MB1 MW1 = MB1 AND MB2 MW2 = MB2 AND MB3 etc Hope it helps? Steve Quote
gruntstripe Posted January 28, 2007 Author Report Posted January 28, 2007 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 Quote
JesperMP Posted January 29, 2007 Report Posted January 29, 2007 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.