From: Tony Nixon
; ------------------------------------------ ; SUBROUTINE - 24 BIT DIVISION ; numerator: nratorH nratorM nratorL ; denominator: denomH denomM denomL ; ; result: nratorH nratorM nratorL ; remainder: remainH remainM remainL ; ; 54 instructions about 974 cycles divizn mov W, #24 mov BCount, W mov W, nratorH mov shiftH, W mov W, nratorM mov shiftM, W mov W, nratorL mov shiftL, W clr nratorH clr nratorM clr nratorL ; clr remainH clr remainM clr remainL dloop clrb C rl shiftL rl shiftM rl shiftH rl remainL rl remainM rl remainH mov W, denomH mov W, remainH-w sb Z jmp nochk ; mov W, denomM mov W, remainM-w sb Z jmp nochk ; mov W, denomL mov W, remainL-w nochk sb C jmp nogo ; mov W, denomL sub remainL, W sb C dec remainM mov W, remainM xor W, #$ff snb Z dec remainH mov W, denomM sub remainM, W sb C dec remainH mov W, denomH sub remainH, W setb C nogo rl nratorL rl nratorM rl nratorH decsz BCount jmp dloop ; ret
| file: /techref/scenix/lib/math/div/24by24tn_sx.htm, 1KB, , updated: 2004/6/10 13:40, local time: 2008/12/5 04:29,
38.103.63.58:LOG IN
|
| ©2008 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.piclist.com/techref/scenix/lib/math/div/24by24tn_sx.htm"> SX Microcontroller Math Method - 24 BIT DIVISION</A> |
| Did you find what you needed? |
|
o List host: MIT, Site host massmind.org, Top posters @20081205 Apptech, Jinx, Xiaofan Chen, olin piclist, Vitaliy, William \Chops\ Westfield, Tamas Rudnai, JonnyMac, Alan B. Pearce, Gerhard Fiedler, * 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: Shultz Electronics, Timothy Weber, on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
|
.