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: 2024/12/22 16:16,
3.22.27.41: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://sxlist.com/techref/scenix/lib/math/div/24by24tn_sx.htm"> SX Microcontroller Math Method - 24 BIT DIVISION</A> |
Did you find what you needed? |
Welcome to sxlist.com!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! |
.