From Scott Dattalo
;inc incf high,f incfsz low,f decf high,f A downcounting version; ;dec movf low,f skpnz decf high,f decf low,f on the 18cxxx you can simplify these to: infsnz low,f incf high,f and tstfsz low,f decf high,f decf low,fThanks to Colin Smith for corrections to this page
Al Williams of AWC Says:
Slight typos in the 18F code above for decrement. TSTFSZ doesn't put a result anywhere, so no ,F is required. Also, should be testfsnz but that instruction doesn't exist!+
So in fact, you should use the 16F version for decrementing. Also, be aware that the Z flag may be set after this operation but the counter is not zero (just part of it).
Comments:
| file: /techref/microchip/math/incdec/best16.htm, 1KB, , updated: 2008/2/20 21:19, local time: 2009/1/9 16:27,
owner: AW-AWC-O86,
38.103.63.57:LOG IN
|
| ©2009 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? Please DO link to this page! Digg it! <A HREF="http://massmind.org/techref/microchip/math/incdec/best16.htm"> PIC Math Increment / Decrement Best 16Bit</A> |
| Did you find what you needed? |
Welcome to massmind.org! |
|
.