ext modifier to the rescue
Code:word_array var word[2] word_array_asbyte var byte ext @word_array_asbyte=word_array hserin 100,noreceived,[wait("#"),str word_array_asbyte\4]
ext modifier to the rescue
Code:word_array var word[2] word_array_asbyte var byte ext @word_array_asbyte=word_array hserin 100,noreceived,[wait("#"),str word_array_asbyte\4]
Warning I'm not a teacher
You need _ before PBP name, when used in ASM.
Aha! Thanks Richard.
pedja089, you mean instead of
@word_array_asbyte=word_array
be:
@ _word_array_asbyte= _word_array
right?
Ioannis
@ word_array_asbyte= _word_array
Warning I'm not a teacher
I am facing a problem with arrays.
The task is to grab 10bits of ADC result into array elements.
This works OK:
word_temp.byte0=adresl
word_temp.byte1=adresh
array[i]=word_temp
But this does not:
array.highbyte[i]=adresh
array.lowbyte[i]=adresl
Is something wrong with the above syntax?
Ioannis
array[i]=(adresh<<8)|adresl
or
using ext modifier
array_asbyte[i*2]=adresl
array_asbyte[i*2+1]=adresh
Warning I'm not a teacher
Thanks Richard.
Comparing the
array[i]=(adresh<<8)|adresl
takes about 10 words more on compilation than
word_temp.byte0=adresl
word_temp.byte1=adresh
array[i]=word_temp
Have not tested the EXT version yet.
Ioannis
Bookmarks