AceOfHearts
New Member
Hi,
Basically, my microcontroller is receiving a serial byte, then i have to compare the byte to see if it is between certain ranges. For example,
If the received byte is between 1-20 do this action
if between 20-40 do that action
40-60
and so forth say upto 200.
This sounds simple to do in theory and I know in C one could just ues 'if' statements to do it....but Im stuck here as I am using assembly and I can seem to find a a way other than comparing the bye 200 times with each number, first with 1, then with 2, 3 4, etc.....that's laborious coding.
Im sure theres another way thats easier? I will appreciate help from any good assembly programmer out there.
Many thanks.
Basically, my microcontroller is receiving a serial byte, then i have to compare the byte to see if it is between certain ranges. For example,
If the received byte is between 1-20 do this action
if between 20-40 do that action
40-60
and so forth say upto 200.
This sounds simple to do in theory and I know in C one could just ues 'if' statements to do it....but Im stuck here as I am using assembly and I can seem to find a a way other than comparing the bye 200 times with each number, first with 1, then with 2, 3 4, etc.....that's laborious coding.
Im sure theres another way thats easier? I will appreciate help from any good assembly programmer out there.
Many thanks.
Last edited: