WORD(0).HIGHBYTE = X doesnt work. Not functional for arrays?
sccoupe
Posts: 118
I need to set highbyte and lowbyte of a word in an array on a BS2 and it doesnt seem to like it.
WORD.HIGHBYTE = X works fine, but
WORD(0).HIGHBYTE = X does not.
I havent been able to to set bits this way in byte arrays either. Am I using ti wrong and can this not be done with arrays?
Thanks
Jason
EDIT: I thought that WORD.HIGHBYTE(0) = X worked, as the compiler didnt complain, but it WORD(0) always = 0 when sent to debug. I did try WORD(0) = 1 and it was actually 1 when sent to debug. Whats going on here?
Thanks
WORD.HIGHBYTE = X works fine, but
WORD(0).HIGHBYTE = X does not.
I havent been able to to set bits this way in byte arrays either. Am I using ti wrong and can this not be done with arrays?
Thanks
Jason
EDIT: I thought that WORD.HIGHBYTE(0) = X worked, as the compiler didnt complain, but it WORD(0) always = 0 when sent to debug. I did try WORD(0) = 1 and it was actually 1 when sent to debug. Whats going on here?
Thanks
Comments
aWord.LOWBYTE(0) is the least significant byte of aWord and aWord.LOWBYTE(1) is the most significant byte of aWord and is the same as aWord.HIGHBYTE
You can also write aWord.BIT0(n) to access the nth bit of aWord starting at the least significant bit.