Updated again. --- James Newton (PICList Admin #3) mailto:jamesnewton@piclist.com 1-619-652-0593 PIC/PICList FAQ: http://www.piclist.com or .org -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Scott Dattalo Sent: Wednesday, April 11, 2001 15:52 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: 16-bit 16c7xx comparison code On Wed, 11 Apr 2001, M Core wrote: > Hi Scott, > Just looking at that code again - I'm not sure now that your incfsz will > even fix it. For example if you have the number: > > x0201 = X and xff02 = Y > then we will get to the incfsz point in the code and > the ff MSB will be incremented to 0, and the subtraction is skipped, > then it checks the C bit - which the incfsz instruction does not set - so > there is still problems with that code because the C bit is set from the LSB > previous subtraction still, but we are looking at the MSB now... Sigh, there are two mistakes (so far) in that snippet. ;XH:XL YH:YL movf yl,w subwf xl,w movf yh,w skpc ;(was skpz) incfsz yh,w ;(was incf) subwf xh,w skpnc goto x_is_greater_than_or_equal_to_y There are 8 instructions, so there may be 6 more mistakes! -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads