The basic way to do greater than, less than, etc. is to do comparisons;
One warning; Make sure you don't switch the logic up of the compare
(From doing LOTS of software testing and catching my own, mmm, "RARE",
bugs, this is a VERY popular mistake. Macros or a "cheat file" are good
here.)
Basic method depends on your quantities you're comparing (32 bit? 4
bit? <G>) so I'm using pseudocode here, sort of.
Basically, to do "if (A > B) goto GT else goto LE", do this;
Reg=A-B
if (Reg negative) goto LE /*Usual test people mess up on.*/
if (Reg zero) goto LE
goto GT
Alternately, less code but perhaps less clear - More "optimized":
Reg=B-A
if (Reg negative) goto GT /*Usual test people mess up on.*/
/*Treat Zero as 'positive' here.*/
goto LE
This should help, I hope <G>
Mark
Scott Beatty wrote:
{Quote hidden}>
> Hello All
>
> Some PICs like the 17C766 have >,< and = instructions. If a PIC
> does not have these instructions can the same opperations somehow be
> proformed on data. I also have a project that is using A/D conversion
> if the previous instructions cannot be used what would be the best way
> proform a function based on the digital data? There are several hundred
> functions.
>
> Thanks
> Scott
--
I re-ship for small US & overseas businesses, world-wide.
(For private individuals at cost; ask.)