Searching \ for 'Greater or less then?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=greater+less+then
Search entire site for: 'Greater or less then?'.

Truncated match.
PICList Thread
'Greater or less then?'
1999\12\19@152126 by spamdogg

flavicon
face
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

1999\12\20@035728 by Mark Willis

flavicon
face
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}

--
I re-ship for small US & overseas businesses, world-wide.
(For private individuals at cost; ask.)

1999\12\20@224906 by Peter van Hoof

flavicon
face
I didnt keep the original message so the thread doesnt really work here
I found a nice page for your 8 bit compares it has all forms you could ask
for
....
websites.ntl.com/~matthew.rowe/micros/virbook/logic.htm
It has routines from Andrew Warren

The root page http://websites.ntl.com/~matthew.rowe/micros/ has
even more interresting pic information


Scott Beatty (spam_OUTspamdoggTakeThisOuTspamwebbernet.net) wrote:

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

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...