Technical information
Functions Written from Scratch A-5
move.w #$0400,a ; tmp <- #$0400
DO_DIV
move.w b,x0
bfclr #$0001,sr
rep #11
div x0,a
move.w a0,a
SET_DP
eor c1,y1 ; compare signs of realp and DP
bge SAME_SIGN ; if they have the same sign
neg a
SAME_SIGN
; a contains DP
UNWRAP
tst.w x:WRPFLG
bge next_2
jmpd final
clr c ; WRAP <- 0
clr d ; LASTDP <- 0
next_2
move.w x:WRAP,c ; c <- WRAP
move.w x:LASTDP,d ; d <- LASTDP
move.w #$0400,b ; b <- #$0400 [temp]
move.w b,x0 ; store #$0400 for further use
move.w #$fc00,y0 ; y0 <- #$fc00
sub a,d ; d <- LASTDP - DP
tgt y0,b ; if LASTDP - DP >0 then b <- #$fc00 [temp]
abs d ; d <- | LASTDP - DP|
clr y0
cmp.w d,x0 ; |DP - LASTDP| ? #$0400
tgt y0,b ; if |DP - LASTDP| < 0 then temp <- 0
sub b,c ; c <- WRAP - temp
move.w a,d ; LASTDP <- DP
add c,a ; DP <- DP + WRAP
final
move.w c,x:WRAP ; store WRAP
move.w d,x:LASTDP ; store LASTDP
End_RXEQERR
jmpd rx_next_task
move.w a,x:>DP ; store DP
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...