Rudy Wieser
;----------------------------
; 16-bit Subtraction-with-Borrow
; SourceH:SourceL - Number to be subtracted
; Carry - NOT( Borrow to be subtracted )
; DestH:DestL - Number to be subtracted FROM
;Out DestH:DestL - Result
; Carry - NOT( Borrow result)
movf SourceL,W
subwf DestL
movf SourceH,W
btfss STATUS,C
incfsz SourceH,W
subwf DestH ;dest = dest - source, WITH VALID CARRY
;(although the Z flag is not valid).
;----------------------------
Comments:
| file: /Techref/microchip/math/sub/16bb.htm, 1KB, , updated: 2009/12/28 15:26, local time: 2010/9/2 21:11,
38.107.191.83:LOG IN
|
| ©2010 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://www.massmind.org/techref/microchip/math/sub/16bb.htm"> PIC Microcontoller Math Method 16 bit subtraction with borrow</A> |
| Did you find what you needed? |
|
Enter the PICList design contest to win a free PCB from olimex.com! |
|
The only consistant, simple to use yet powerful development environment. It simulates real-world devices via virtual component "plugins" (LED,LCD,key,motor,TV,etc) in real time, has a syntax highlighting editor, macro assembler and disassembler. Regular updates and third-party plugins keep this software ahead of any other PIC IDE. |
.