please dont rip this site

PIC Microcontoller Subtraction Math Method

16-bit subtract routine for PIC16 instruction set. valid C and Z



if you can do better (smaller), tell me! this is the best I could do.


;------------------------------
;19/6/2006
;code by Christian Blondin
;]b[e]l[t]o[i]d[9]7[@s@p@a@m@]e[m]a[i]l.c]o[m -> delete the [][][[] @spam@
;rsc-mirror3.netfirms.com/pic.html -> coming up.
;
;code is for PIC16 instruction set (PIC10F, 12F, 16F...)
;remove the last two lines if you don't need a valid zero flag.
;performs [f01|f00] = [f01|f00] - [f03|f02] while keeping f03|f02 intact.
;(f00 and f02 being the low-bytes, f01 and f03 the hi-bytes)
;briefly tested in MPSIM ("special cases" only)

	movf	f02,W
	subwf	f00,F		;f00-f02 (STATUS,C=!BORROW)
	movf	f03,W
	btfss	STATUS,C	;skip if borrow=0 (C=1)
	addlw	01
	subwf	f01,F		;f01-f03	STATUS,C=!BRW
	btfsc	STATUS,Z	;skip if MSbyte<>zero
	movf	f00,F		;else, check LSbyte for zero.
;------------------------------

Comments:


file: /Techref/microchip/math/sub/16bsubCZ.htm, 1KB, , updated: 2010/10/12 14:35, local time: 2024/12/30 09:38, owner: csblondin-sympatico-,
TOP NEW HELP FIND: 
3.145.70.108:LOG IN

 ©2024 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! / MAKE!

<A HREF="http://sxlist.com/techref/microchip/math/sub/16bsubCZ.htm"> 16-bit substract with carry &amp; zero</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .