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 15:35, local time: 2024/8/31 16:35,
owner: csblondin-sympatico-,
3.144.2.61: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? <A HREF="http://piclist.com/techref/microchip/math/sub/16bsubCZ.htm"> 16-bit substract with carry & zero</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Welcome to piclist.com! |
.