Posted: Wed Jan 07, 2015 7:17 pm Post subject: Inserting bytes into a word
I know i should probably know the answer to this, but its been awhile since I had done it.
I do know you can break a word down into two bytes by using Low() and High().
But what about the other way around? I have a byte array and I need to insert bytes at location 5, and 6 into a word variable. as bytes(5) and bytes(6) make up the low/high of a word.
If you need only word-spaced access, you can overlay the byte array with a word array, so wordarr(3) would access bytes(5) and (6).
Assumed CONFIG BASE<>0.
You won't be able to access for example bytes(4) and (5) as a word. And sure, Makeint() will work.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum