Code:
; 16bit by 8bit unsigned multiply ; by Martin Sturm 2010 ; tested over all input combinations ; ; Nothing special, just a modified version of 16x16 code on piclist.com ; ; if t is a temp ; W * bH:bL -> r3:r2:r1 ; 19 cycles, 85-125, 105 average ; ; else, comment out MOVWF t ; t * bH:bL -> r3:r2:r1 (t is modified) ; 18 cycles, 84-124, 104 average ; MULT_16x8_SMALL MACRO bH,bL, t, r3,r2,r1 LOCAL m1, m2 CLRF r3 CLRF r2 CLRF r1 MOVWF t ; optionally comment out BSF r1,7 m1: RRF t,F SKPC GOTO m2 MOVFW bL ADDWF r2,F MOVFW bH SKPNC INCFSZ bH,W ADDWF r3,F m2: RRF r3,F RRF r2,F RRF r1,F SKPC GOTO m1 ENDM
file: /Techref/microchip/math/mul/m16x8mds2.htm, 1KB, , updated: 2010/4/12 20:53, local time: 2024/11/8 15:29,
owner: MDS-gmail-IE8,
18.224.54.148:LOG IN ©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!
|
©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://www.piclist.com/techref/microchip/math/mul/m16x8mds2.htm"> PIC Microcontoller Math Method 16x8 multiply from Martin Sturm</A> |
Did you find what you needed? |
PICList 2024 contributors:
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. |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.