亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? arith.asm

?? PIC系列單片機典型應用程序集: arith
?? ASM
?? 第 1 頁 / 共 3 頁
字號:
;
;   Performance :
;               Program Memory  :   22 (excluding D_divS subroutine)
;               Clock Cycles    :   3000 (approximately,with 10 iterations)
;
;       The #of cycles depends on Number of Iterations Selected.
; In a lot of cases 5 or less iterations may be sufficient
;
;
;*******************************************************************
;               Newton-Raphson Method
;*************************************************************

Sqrt
	call    SqrtInit            ; compute initial sqrt = Num/2
nextIter
   #if MODE_FAST
	movfp    NumLo,ACCbLO
	movfp    NumHi,ACCbHI
   #else
	movfp    NumLo,wreg
	movwf     ACCbLO
	movfp    NumHi,wreg
	movwf     ACCbHI
   #endif
;
	call    D_divS          ; double precision division
				; double precision addition
	movfp    ACCdLO,wreg     ; ACCd + ACCa -> ACCd
	addwf     ACCaLO           ;addwf lsb
	movfp    ACCdHI,wreg
	addwfc    ACCaHI           ;addwf msb
				; now divide by 2
	bcf      _carry
	rrcf     ACCaHI
	rrcf     ACCaLO
;
	decfsz     iterCnt
	goto    nextIter
	return                     ; End Sqrt
;
SqrtInit
	movlw    _LUPCNT
	movwf     iterCnt         ; set number of iterations
  #if MODE_FAST
	movfp    NumHi,ACCaHI
	movfp    NumLo,ACCaLO
  #else
	movfp    NumHi,wreg
	movwf     ACCaHI
	movfp    NumLo,wreg         ; set initial guess root = NUM/2
	movwf     ACCaLO
  #endif
	bcf      _carry
	rrcf     ACCaHI
	rrcf     ACCaLO      ; set initial sqrt = Num/2
	return
;
	PAGE
;*******************************************************************
;                   8x8 Software Multiplier
;               ( Fast Version : Straight Line Code )
;
;   The 16 bit result is stored in 2 bytes
;
; Before calling the subroutine " mpy ", the multiplier should
; be loaded in location " mulplr ", and the multiplicand in
; " mulcnd " . The 16 bit result is stored in locations
; H_byte & L_byte.
;
;       Performance :
;                    Program Memory  :  36 words
;                    # of cycles     :  36       (excluding call & return)
;                    Scratch RAM     :   0 locations
;                    W Register      :  Used
;
;  This routine is optimized for speed efficiency ( straight line code )
;  For code efficiency, refer to "mult8x8S.asm" ( looped code )
;*******************************************************************
;     Define a macro for adding & right shifting
;
multiply    MACRO
	variable  i ;
	  i = 0
	  .while i < 8
		btfsc     mulplr,i
		addwf    H_byte
		rrcf    H_byte
		rrcf    L_byte
	    i = i+1 ;
	  .endw
	ENDM                    ; End of macro
;
;
mpy8x8_F
	clrf     H_byte
	clrf     L_byte
	movfp    mulcnd,wreg     ; move the multiplicand to W reg.
	bcf      _carry          ; Clear the carry bit in the status Reg.
;
	multiply
;
	return
;
	PAGE
;*******************************************************************
;                   8x8 Software Multiplier
;               ( Code Efficient : Looped Code )
;
;   The 16 bit result is stored in 2 bytes
;
; Before calling the subroutine " mpy ", the multiplier should
; be loaded in location " mulplr ", and the multiplicand in
; " mulcnd " . The 16 bit result is stored in locations
; H_byte & L_byte.
;
;       Performance :
;                    Program Memory  :  13 words (excluding call & return)
;                    # of cycles     :  69       (excluding call & return)
;                    Scratch RAM     :  1 byte
;                    W Register      :  Used
;
;  This routine is optimized for code efficiency ( looped code )
;  For time efficiency code refer to "mult8x8F.asm" ( straight line code )
;*******************************************************************
;
mpy8x8_S
	clrf     H_byte
	clrf     L_byte
	clrf     count
	bsf      count,3         ; set count = 8
	movfp    mulcnd,wreg
	bcf     _carry    ; Clear the carry bit in the status Reg.
loop
	btfsc      mulplr,0
	addwf     H_byte
	rrcf     H_byte
	rrcf     L_byte
	rrncf      mulplr
	decfsz     count
	goto    loop
;
	return
;
	PAGE
;*******************************************************************
;                       Numerical Differenciation
;
;       The so called "Three-Point Formula" is implemented to
; differenciate a sequence of points (uniformly sampled).
;       The eqn implemented is :
;             f'(Xn) = [ f(Xn - 2h) - 4*f(Xn - h) + 3*f(Xn)]*0.5/h
;    where Xn is the present sample and 'h' is the step size.
;
;       The above formula may be rewritten as :
;
;         f'(Xn) = [ 0.5*f(Xn -2) - 2*f(Xn - 1) + 0.5*3*f(Xn)]*1/DiffK
;  where DiffK = h = Step Size
;
;   This differenciation routine can be used very effectively
; in the computation of the differential component part in
; a PID Loop calculation in Motor Control Applications
;
;       Double precision arithmetic is used throught
;  The present sample value is assumed to be in locations
; (XnHi, XnLo). The past two values are assumed to be in locations
; (Xn_1_Hi, Xn_1_Lo) & (Xn_2_Hi, Xn_2_Lo).
;       The output value is located in DiffHi & DiffLo. No overflow
; checking mechanism is implemented. If the values are limited
; to 12 bits, then the user need not worry about overflows
;
;  It is user's responsibility to update the past values with the
; present values before calling this routine.
;  After computation, the present value Xn is not moved to Xn_1
; because the user may want these values to be intact for other
; computations ( say numerical integration)
;       Also it is user's responsibility to set past 2 values
; (Xn_1 & Xn_2) values to be zero on initialization.
;
;*******************************************************************
;
Diff
	movfp    Xn_2_Lo,wreg
	addwf     XnLo,w
	movwf     ACCbLO
	movfp    Xn_2_Hi,wreg
	addwfc    XnHi,w
	movwf     ACCbHI          ; Y = f(Xn-2) + f(Xn)
;
	movfp    XnLo,wreg
	addwf     ACCbLO
	movfp    XnHi,wreg
	addwfc    ACCbHI
	movfp    XnLo,wreg
	addwf     ACCbLO
	movfp    XnHi,wreg
	addwfc    ACCbHI    ; Y = f(Xn-2) + 3*f(Xn)
;
	bcf      _carry
	rrcf     ACCbHI
	rrcf     ACCbLO    ; Y = 0.5*[ f(Xn-2) + 3*f(Xn) ]

;
	movfp    Xn_1_Lo,wreg
	subwf     ACCbLO
	movfp    Xn_1_Hi,wreg
	subwfb    ACCbHI
	movfp    Xn_1_Lo,wreg
	subwf     ACCbLO
	movfp    Xn_1_Hi,wreg
	subwfb    ACCbHI    ; Y = 0.5*[f(Xn-2) + 3*f(Xn)] - 2*f(Xn-1)
;
	movfp    DiffKLo,wreg
	movwf     ACCaLO
	movfp    DiffKHi,wreg
	movwf     ACCaHI
;
	call    D_divS
	movfp    ACCbLO,wreg
	movwf     DiffLo
	movfp    ACCbHI,wreg
	movwf     DiffHi          ; result = Y/h
;
	return
;
	PAGE
;*******************************************************************
;
;                       Numerical Integration
;
;
;       Simpson's Three-Eighths Rule is implemented
;
;       Y(n) = [ f(X0) + 3*f(X1) + 3*f(X2) + f(X3)]*3*h/8
;
;  where 'h' is the step size and the integral is over the
;  range X0 to X3
;       The above equation can be rewritten as
;
;       Y(n) = [ f(X0) + 3*f(X1) + 3*f(X2) + f(X3)]*IntgK
;
;   where IntgK = 3*h/8 (in locations (IntgKHi, IntgKHi)
;
;   This Integration routine can be used very effectively
; in the computation of the integral component part in
; a PID Loop calculation in Motor Control Applications
;
;       Double precision arithmetic is used throught
;  The three input values over which the integral is to be computed
; are assumed to be in locations (X0Lo,X0Hi), (X1Lo,X1Hi) , (X2Lo,X2Hi)
; and (X3Lo,X3Hi)
;       The output value is located in IntgHi & IntgLo. No overflow
; checking mechanism is implemented. If the values are limited
; to 12 bits, then the user need not worry about overflows
;
;  It is user's responsibility to update the past values with the
; present values before calling this routine.
;  After computation, the present value Xn is not moved to Xn_1
; because the user may want these values to be intact for other
; computations ( say numerical integration)
;       Also it is user's responsibility to set past 2 values
; (Xn_1 & Xn_2) values to be zero on initialization.
;
;
;*******************************************************************
;
Integrate
	movfp    X0Lo,wreg
	addwf     X3Lo,w
	movwf     ACCbLO
	movfp    X0Hi,wreg
	addwfc    X3Hi,w
	movwf     ACCbHI          ; Intg = f(X0) + f(X3)
;
	movfp    X1Lo,wreg
	addwf     ACCbLO
	movfp    X1Hi,wreg
	addwfc    ACCbHI   ; Intg = f(X0) + f(X3) +X1
	movfp    X1Lo,wreg
	addwf     ACCbLO
	movfp    X1Hi,wreg
	addwfc    ACCbHI   ; Intg = f(X0) + f(X3) +2*X1
	movfp    X1Lo,wreg
	addwf     ACCbLO
	movfp    X1Hi,wreg
	addwfc    ACCbHI   ; Intg = f(X0) + f(X3) +3*X1
;
	movfp    X2Lo,wreg
	addwf     ACCbLO
	movfp    X2Hi,wreg
	addwfc    ACCbHI   ; Intg = f(X0) + f(X3) +3*X1 + X2
	movfp    X2Lo,wreg
	addwf     ACCbLO
	movfp    X2Hi,wreg
	addwfc    ACCbHI   ; Intg = f(X0) + f(X3) +3*X1 + 2*X2
	movfp    X2Lo,wreg
	addwf     ACCbLO
	movfp    X2Hi,wreg
	addwfc    ACCbHI   ; Intg = f(X0) + f(X3) +3*X1 + 3*X2
;
	movfp    IntgKLo,wreg
	movwf     ACCaLO
	movfp    IntgKHi,wreg
	movwf     ACCaHI          ;  ACCa = IntgK (prepare for multiplication)
;
	call    D_mpyS          ; make sure to set for either SIGNED or UNSIGNED
	movfp    ACCdLO,wreg
	movwf     IntgLo          ; 32 bit result in ACCd & ACCc
	movfp    ACCdHI,wreg
	movwf     IntgHi          ; upper 16 bits = result
;
	return
;
	PAGE
;*******************************************************************
;
;                       Random Number Generator
;
; This routine generates a 16 Bit Pseudo Sequence Random Generator
; It is based on Linear shift register feedback. The sequence
; is generated by (Q15 xorwf Q14 xorwf Q12 xorwf Q3 )
;
;    The 16 bit random number is in location RandHi(high byte)
;  & RandLo (low byte)
;
;       Before calling this routine, make sure the initial values
; of RandHi & RandLo are NOT ZERO
;       A good chiose of initial random number is 0x3045
;*******************************************************************
;
Random16
	rlcf     RandHi,w
	xorwf     RandHi,w
	rlcf     wreg            ; carry bit = xorwf(Q15,14)
;
	swapf    RandHi
	swapf    RandLo,w
	rlncf      wreg
	xorwf     RandHi,w        ; LSB = xorwf(Q12,Q3)
	swapf    RandHi
	andlw   0x01
	rlcf     RandLo
	xorwf     RandLo
	rlcf     RandHi
	return
;
	PAGE
;*******************************************************************
;                       Gaussian Noise Generator
;
; This routine generates a 16 Bit Gaussian distributed random
; points. This routine calls the routine "Random16", which
; generates a psuedo random noise sequence. Gaussian noise
; is computed using the CENTRAL LIMIT THEOREM.
;       The Central Limit Theorem states that the average weighted
; sum of uncorelated samples tends to have a Gaussian distribution
; For practical purposes, the sum could be over a sample size
; of 32 Random numbers. Better results could result if a larger
; sample size is desired. For faster results, a sum over 16 samples
; would also be adequate ( say, for applications like Speech synthesis,
; channel simulations, etc).
;
;       The 16 bit Gaussian distributed point is in locations
; GaussHi & GaussLo
;
;       Before calling this routine, the initial seed of Random
; number should be NON ZERO ( refer to notes on "Random16" routine
;
;*******************************************************************
;
Gauss
	clrf     count
	bsf      count,5         ; set Sample size = 32
	clrf     GaussLo
	clrf     GaussHi
	clrf     GaussTmp
;
NextGauss
	call    Random16        ; get a random value
	movfp    RandLo,wreg
	addwf     GaussLo
	movfp    RandHi,wreg
	addwfc    GaussHi
	clrf     wreg
	addwfc    GaussTmp
	decfsz     count
	goto    NextGauss       ; sum 16 random numbers
;
	movlw    5
GaussDiv16
	rrcf     GaussTmp
	rrcf     GaussHi
	rrcf     GaussLo           ; weghted average
	decfsz     wreg              ; divide by 32
	goto    GaussDiv16
;
	return
;

	END                       ; End Of arith.asm

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久高清一区二区三区| 《视频一区视频二区| 久久久久久久久一| 亚洲天堂久久久久久久| 亚洲午夜免费福利视频| 国产精品18久久久久久vr| 欧美中文字幕不卡| 国产视频视频一区| 国产精品亚洲午夜一区二区三区 | 秋霞av亚洲一区二区三| 国产成人精品一区二区三区四区 | 日韩一区二区三区在线视频| 国产精品成人免费在线| 激情五月激情综合网| 欧美日韩不卡视频| 综合欧美亚洲日本| 国产成人免费9x9x人网站视频| 欧美一区二区在线免费观看| 一区二区三区欧美日韩| 成人综合婷婷国产精品久久| 26uuu亚洲综合色欧美| 日韩av一级片| 欧美精三区欧美精三区| 亚洲精品国产精华液| 91亚洲永久精品| 国产麻豆午夜三级精品| 欧洲国产伦久久久久久久| 国产精品天干天干在线综合| 国产剧情av麻豆香蕉精品| 日韩三级精品电影久久久| 天使萌一区二区三区免费观看| 色噜噜狠狠色综合中国| 亚洲欧美日韩在线播放| www.亚洲激情.com| 国产精品国产三级国产aⅴ入口| 国产精品一卡二| 国产日韩欧美高清| 成人丝袜高跟foot| 中文字幕免费一区| 成人av在线播放网址| 国产精品入口麻豆九色| 99久久伊人久久99| 亚洲男人天堂av| 色综合激情久久| 午夜精品久久久久久久久久| 欧美日韩国产a| 日本三级韩国三级欧美三级| 欧美成人精品高清在线播放 | 国产一区二区三区| 久久久久久久久久久久久久久99| 国模无码大尺度一区二区三区| 国产亚洲综合在线| 91婷婷韩国欧美一区二区| 亚洲男人天堂一区| 91精品国产综合久久福利软件| 日本少妇一区二区| 欧美国产亚洲另类动漫| 99国产精品国产精品毛片| 一区二区视频在线| 欧美一区二区三区四区久久| 国内精品国产成人国产三级粉色| 中文字幕不卡一区| 欧美日韩久久不卡| 久草这里只有精品视频| 国产精品久久福利| 欧美色图激情小说| 国产一区二区三区久久悠悠色av| 亚洲日穴在线视频| 日韩欧美一卡二卡| 99视频在线精品| 亚洲18色成人| 国产婷婷色一区二区三区在线| 一本高清dvd不卡在线观看| 青娱乐精品视频| 亚洲欧洲精品一区二区三区| 欧美巨大另类极品videosbest | 午夜精品久久久久久| 久久噜噜亚洲综合| 在线观看区一区二| 国产精品一区二区男女羞羞无遮挡| 国产精品国产三级国产aⅴ原创| 91精品国模一区二区三区| 国产成人精品免费在线| 亚洲成av人片在线| 国产精品久久久久久久久搜平片| 欧美精选一区二区| 色婷婷av一区二区三区大白胸| 美女国产一区二区三区| 亚洲精品视频自拍| 国产日产欧美一区二区视频| 91精品国产91综合久久蜜臀| 色综合久久久网| 福利一区在线观看| 久久99精品久久久| 五月综合激情婷婷六月色窝| 国产精品毛片a∨一区二区三区| 欧美一区日本一区韩国一区| 欧美中文字幕一二三区视频| 99精品偷自拍| 国产成人精品午夜视频免费| 麻豆精品一二三| 日日夜夜精品视频免费| 亚洲影院理伦片| 亚洲欧美综合网| 国产区在线观看成人精品| 精品少妇一区二区三区免费观看| 欧美中文一区二区三区| 日本韩国精品在线| 色综合中文字幕国产 | 精品一区二区三区不卡| 亚洲成人先锋电影| 亚洲综合免费观看高清完整版在线 | 日韩精品91亚洲二区在线观看| 一区二区三区成人在线视频| 亚洲私人影院在线观看| 中文字幕一区视频| 国产精品久久久久aaaa樱花| 中文字幕亚洲区| 日韩美女精品在线| 亚洲欧美区自拍先锋| 亚洲视频一二区| 亚洲精品欧美激情| 亚洲尤物视频在线| 亚洲成人免费影院| 日韩国产成人精品| 麻豆精品在线观看| 极品少妇一区二区| 国产成人亚洲综合a∨婷婷| 国产成人一区二区精品非洲| 国产a级毛片一区| 99v久久综合狠狠综合久久| 97精品久久久午夜一区二区三区| 色综合久久综合中文综合网| 欧美日韩国产美女| 日韩欧美国产综合一区 | 欧美伊人久久大香线蕉综合69| 在线视频综合导航| 欧美一卡二卡在线观看| 久久久亚洲欧洲日产国码αv| 欧美韩国日本综合| 一区二区三区四区中文字幕| 丝瓜av网站精品一区二区 | 一区二区在线电影| 日本不卡不码高清免费观看| 精品一区二区三区在线播放| 丁香婷婷深情五月亚洲| 一本色道久久综合亚洲aⅴ蜜桃| 欧美日韩1234| 久久久综合视频| 一区二区三区加勒比av| 久久av资源网| a级精品国产片在线观看| 欧美午夜电影在线播放| 亚洲精品在线观看视频| 中文字幕一区二区不卡| 青青草国产精品亚洲专区无| 高潮精品一区videoshd| 欧美日韩不卡在线| 国产精品久久久久久久久晋中 | 91电影在线观看| 日韩一区二区精品葵司在线 | 国产成人午夜高潮毛片| 欧美色图第一页| 国产精品嫩草99a| 日韩影院在线观看| av动漫一区二区| 日韩欧美一区电影| 一区二区三区四区亚洲| 国产在线国偷精品免费看| 在线观看不卡视频| 国产午夜精品在线观看| 日韩国产精品久久久久久亚洲| 成人性生交大片免费看在线播放 | 日韩一区二区三区av| 亚洲另类中文字| 国产乱码一区二区三区| 777xxx欧美| 亚洲激情自拍视频| 粉嫩蜜臀av国产精品网站| 91精品久久久久久久91蜜桃 | 国产精品人人做人人爽人人添| 天天av天天翘天天综合网色鬼国产| 成人免费看视频| 26uuu国产日韩综合| 日日欢夜夜爽一区| 欧美亚洲综合色| 亚洲欧洲制服丝袜| 成人午夜激情在线| 久久久久88色偷偷免费| 美脚の诱脚舐め脚责91| 91精品国产手机| 亚洲第一主播视频| 欧美日韩五月天| 亚洲sss视频在线视频| 欧美在线一区二区| 一区二区三区毛片| 91国产免费观看| 一区二区高清免费观看影视大全| jlzzjlzz亚洲日本少妇| 国产午夜精品久久久久久久|