...just forwarding this to the list. Please respond at http://www.piclist.com/techref/microchip/math/basic.htm or CC roger.froud@virgin.net Seems like somebody must have done this before.... --- 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: James Newton [mailto:james@massmind.org] Sent: Friday, July 10, 2893 15:44 To: James Newton Subject: Your page H:\techref\microchip\math\basic.htm mod by roger.froud@virgin.net 62.253.64.4 http://www.piclist.com/techref/microchip/math/basic.htm 62.253.64.4 mailto:roger.froud@virgin.net added 'Questions: I need signed 16bit compare and branch macros for PIC16F877 working on pseudo 16bit registers ACCaLO,ACCaHI like some Microchip application notes. There are heaps of 16bit subtract/add routines but none set any useful status bits that can be used to branch on the 8 possibilities (signed & unsigned) I have made a crude version of these using the status code boolean algebra found in a Motorola 68000 data book and it appears to work ok. I was rather hoping that someone (microchip)would have a thoroughly tested and more elegant version of this. Maths routines are not my speciality & surely this should be readily available. Doesn't anyone out there compare 2 signed numbers then branch if one is greater than the other? Any help ould be greatly appreciated. If anyone can improve on my code then they are most welcome to have it.' -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads