Hi Guys
i been looking at this for a while and i cant see why i am getting the results i am
put simply i have an array of 6 words , which are cleared at the start
i copy a byte into lowbyte of word0 and a byte into highbyte of word0
the word0 result is as expect , and shows correctly on the terminal (84dec)
the word0 is also shown as high and low byte , which is also correct
to test the other word varables i copy the word0 to , word1,2,3,4,5
i then display the word 0-5 on the terminal as well as the high and low bytes of each word
problem i am seeing is that
word1 ,word3, word5 have the correct word value ,
however when showing the the high and lowbytes of that same word , in the same line the high byte and low byte is reversed
got me stumped
this is debug code as i have been seeing this same error on both the terminal and a graphics display
any advise
cheers
sheldon
[CODE]
if RXpayload_Code = 3 then ' RXpayload Code 3 variables for indexing
Gate_Firm_Rev[z] = 0 ' clear selected varable
Gate_Hard_Rev[z] = 0
Gate_Firm_Rev.lowbyte [z] = RX_payload[1] ' Indexed Gate Firmware revison lowbyte
Gate_Firm_Rev.highbyte[z] = RX_payload[2] ' Indexed Gate Firmware revison highbyte
Gate_Hard_Rev.lowbyte[z] = RX_payload[3] ' indexed gate hardware revision lowbyte
Gate_Hard_Rev.highbyte[z] = RX_payload[4] ' indexed gate hardware revision highbyte
HSEROUT ["z = ",dec z , " GateID_word[z] = ",dec GateID_word[z] ," Gate_Firm_Rev[z] = ",DEC Gate_Firm_Rev[z],13,10,10,10] 'debug
Gate_Firm_Rev[1] = Gate_Firm_Rev[0]
Gate_Firm_Rev[2] = Gate_Firm_Rev[0]
Gate_Firm_Rev[3] = Gate_Firm_Rev[0]
Gate_Firm_Rev[4] = Gate_Firm_Rev[0]
Gate_Firm_Rev[5] = Gate_Firm_Rev[0]
HSEROUT [" 0. GateID_word[0] = ",dec GateID_word[0] ," Gate_Firm_Rev[0] = ",DEC Gate_Firm_Rev[0]," Gate_Firm_Rev.highbyte[0] = ",DEC Gate_Firm_Rev.highbyte[0] ," Gate_Firm_Rev.lowbyte{0} = ",DEC Gate_Firm_Rev.lowbyte[0] ,13,10,10,10 ] 'debug
HSEROUT [" 1. GateID_word[1] = ",dec GateID_word[1] ," Gate_Firm_Rev[1] = ",DEC Gate_Firm_Rev[1]," Gate_Firm_Rev.highbyte[1] = ",DEC Gate_Firm_Rev.highbyte[1] ," Gate_Firm_Rev.lowbyte{1} = ",DEC Gate_Firm_Rev.lowbyte[1] ,13,10,10,10 ] 'debug
HSEROUT [" 2. GateID_word[2] = ",dec GateID_word[2] ," Gate_Firm_Rev[2] = ",DEC Gate_Firm_Rev[2]," Gate_Firm_Rev.highbyte[2] = ",DEC Gate_Firm_Rev.highbyte[2] ," Gate_Firm_Rev.lowbyte{2} = ",DEC Gate_Firm_Rev.lowbyte[2] ,13,10,10,10 ] 'debug
HSEROUT [" 3. GateID_word[3] = ",dec GateID_word[3] ," Gate_Firm_Rev[3] = ",DEC Gate_Firm_Rev[3]," Gate_Firm_Rev.highbyte[3] = ",DEC Gate_Firm_Rev.highbyte[3] ," Gate_Firm_Rev.lowbyte{3} = ",DEC Gate_Firm_Rev.lowbyte[3] ,13,10,10,10 ] 'debug
HSEROUT [" 4. GateID_word[4] = ",dec GateID_word[4] ," Gate_Firm_Rev[4] = ",DEC Gate_Firm_Rev[4]," Gate_Firm_Rev.highbyte[4] = ",DEC Gate_Firm_Rev.highbyte[4] ," Gate_Firm_Rev.lowbyte{4} = ",DEC Gate_Firm_Rev.lowbyte[4] ,13,10,10,10 ] 'debug
HSEROUT [" 5. GateID_word[5] = ",dec GateID_word[5] ," Gate_Firm_Rev[5] = ",DEC Gate_Firm_Rev[5]," Gate_Firm_Rev.highbyte[5] = ",DEC Gate_Firm_Rev.highbyte[5] ," Gate_Firm_Rev.lowbyte{5} = ",DEC Gate_Firm_Rev.lowbyte[5] ,13,10,10,10 ] 'debug
endif
/CODE]
Code:
z = 0 GateID_word[z] = 10 Gate_Firm_Rev[z] = 84
0. GateID_word[0] = 10 Gate_Firm_Rev[0] = 84 Gate_Firm_Rev.highbyte[0] = 0 Gate_Firm_Rev.lowbyte{0} = 84
1. GateID_word[1] = 0 Gate_Firm_Rev[1] = 84 Gate_Firm_Rev.highbyte[1] = 84 Gate_Firm_Rev.lowbyte{1} = 0
2. GateID_word[2] = 0 Gate_Firm_Rev[2] = 84 Gate_Firm_Rev.highbyte[2] = 0 Gate_Firm_Rev.lowbyte{2} = 84
3. GateID_word[3] = 0 Gate_Firm_Rev[3] = 84 Gate_Firm_Rev.highbyte[3] = 84 Gate_Firm_Rev.lowbyte{3} = 0
4. GateID_word[4] = 0 Gate_Firm_Rev[4] = 84 Gate_Firm_Rev.highbyte[4] = 0 Gate_Firm_Rev.lowbyte{4} = 84
5. GateID_word[5] = 0 Gate_Firm_Rev[5] = 84 Gate_Firm_Rev.highbyte[5] = 84 Gate_Firm_Rev.lowbyte{5} = 0
Bookmarks