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

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

?? arith.asm

?? PIC系列單片機典型應用程序集: arith
?? ASM
?? 第 1 頁 / 共 3 頁
字號:
;                            :   183 (SIGNED :excluding CALL & RETURN)
;
;       Note : The above timing is the worst case timing, when the
;               register ACCb = FFFF. The speed may be improved if
;               the register ACCb contains a number ( out of the two
;               numbers ) with less number of 1s.
;
;               The performance specs are for Unsigned arithmetic ( i.e,
;               with "SIGNED equ  FALSE ").
;
;               Upon return from subroutine, the input registers
;
;
;**********************************************************
;               Multiplication Macro
;**********************************************************
;
mulMac  MACRO
	variable i

	i = 0

	#if SIGNED
	  .while i < 15
	#else
	  .while i < 16
	#endif
	     .if i < 8
		btfss      ACCbLO,i        ; test low byte
	     .else
		btfss      ACCbHI,i-8      ; test high byte
	     .fi
		goto    NoAdd#v(i)      ; LSB is 0, so no need to addwf
		movfp    ACCaLO,wreg
		addwf     ACCdLO           ;addwf lsb
		movfp    ACCaHI,wreg
		addwfc    ACCdHI           ;addwf msb
NoAdd#v(i)
		rrcf     ACCdHI
		rrcf     ACCdLO
		rrcf     ACCcHI
		rrcf     ACCcLO
		bcf      _carry
		i = i+1
	  .endw
	#if SIGNED
		rrcf     ACCdHI
		rrcf     ACCdLO
		rrcf     ACCcHI
		rrcf     ACCcLO
		bcf     _carry
	#endif
;
	ENDM
;
	PAGE
;***************************************************************
;                       Double Precision Negate Macros
;***************************************************************
AltNegMac       MACRO   fileRegLo,fileRegHi
			movfp    fileRegLo,wreg
			negw     fileRegLo
			movfp    fileRegHi,wreg
			clrf     fileRegHi
			subwfb    fileRegHi
		ENDM

;
negMac  MACRO   fileRegLo, fileRegHi
	comf    fileRegLo       ; negate FileReg ( -FileReg -> FileReg )
	incf     fileRegLo
	btfsc      _z
	decf     fileRegHi
	comf    fileRegHi
	ENDM
;
NegMac32        MACRO   x3,x2,x1,x0
	movfp   x3,wreg
	negw    x3
	movfp   x2,wreg
	clrf    x2
	subwfb  x2
	movfp   x1,wreg
	clrf    x1
	subwfb  x1
	movfp   x0,wreg
	clrf    x0
	subwfb  x0
		ENDM
;
	PAGE
;*******************************************************************;
;               Double Precision Multiply ( 16x16 -> 32 )
;         ( ACCb*ACCa -> ACCb,ACCc ) : 32 bit output with high word
;  in ACCd ( ACCdHI,ACCdLO ) and low word in ACCc ( ACCcHI,ACCcLO ).
;
D_mpyF                          ;results in ACCd(16 msb's) and ACCc(16 lsb's)
;
     #if   SIGNED
;
	movfp    ACCaHI,wreg
	xorwf     ACCbHI,w
	movwf     sign
	btfss      ACCbHI,MSB        ; if MSB set go & negate ACCb
	goto    chek_A_MSB_MPY
;
	negMac  ACCbLO,ACCbHI
;
chek_A_MSB_MPY
	btfss      ACCaHI,MSB        ; if MSB set go & negate ACCa
	goto    continue_MPY
	negMac  ACCaLO,ACCaHI
;
     #endif
;
continue_MPY
	clrf    ACCdHI
	clrf    ACCdLO
	bcf     _carry

;
; use the mulMac macro 16 times
;
	mulMac
;
    #if SIGNED
	btfss   sign,MSB        ; negate (ACCc,ACCd)
	return
	NegMac32 ACCcHI,ACCcLO,ACCdHI, ACCdLO
	return
    #else
	return
    #endif
;
	PAGE
;*******************************************************************
;                       Double Precision Division
;
;               ( Optimized for Code : Looped Code )
;
;*******************************************************************;
;   Division : ACCb(16 bits) / ACCa(16 bits) -> ACCb(16 bits) with
;                                               Remainder in ACCc (16 bits)
;      (a) Load the Denominator in location ACCaHI & ACCaLO ( 16 bits )
;      (b) Load the Numerator in location ACCbHI & ACCbLO ( 16 bits )
;      (c) CALL D_div
;      (d) The 16 bit result is in location ACCbHI & ACCbLO
;      (e) The 16 bit Remainder is in locations ACCcHI & ACCcLO
;
;   Performance :
;            Program Memory  :   31 (UNSIGNED)
;                                39 (SIGNED)
;               Clock Cycles    : 300 (UNSIGNED : excluding CALL & RETURN)
;                               : 312 (SIGNED : excluding CALL & RETURN)
;
;       NOTE :
;               The performance specs are for Unsigned arithmetic ( i.e,
;               with "SIGNED equ  FALSE ").
;
;*******************************************************************
;       Double Precision Divide ( 16/16 -> 16 )
;
;         ( ACCb/ACCa -> ACCb with remainder in ACCc ) : 16 bit output
; with Quotiont in ACCb (ACCbHI,ACCbLO) and Remainder in ACCc (ACCcHI,ACCcLO).
;
;               B/A = (Q) + (R)/A
;       or      B = A*Q + R
;
;                       where   B :     Numerator
;                               A :     Denominator
;                               Q :     Quotiont (Integer Result)
;                               R :     Remainder
;
;       Note :  Check for ZERO Denominator or Numerator is not performed
;               A ZERO Denominator will produce incorrect results
;
;       SIGNED Arithmetic :
;                       In case of signed arithmetic, if either
;  numerator or denominator is negative, then both Q & R are
;  represented as negative numbers
;               -(B/A) = -(Q) + (-R)/A
;       or      -B = (-Q)*A + (-R)
;
;*******************************************************************
;
D_divS
;
	bsf      _fs0
	bsf      _fs1            ; set no auto-incrment for fsr0

     #if    SIGNED
	CALL    S_SIGN
     #endif
;
	clrf     count
	bsf      count,4         ; set count = 16
	clrf     ACCcHI
	clrf     ACCcLO
	clrf     ACCdLO
	clrf     ACCdHI
;
;  Looped code
;
divLoop
	bcf      _carry
	rlcf     ACCbLO
	rlcf     ACCbHI
	rlcf     ACCcLO
	rlcf     ACCcHI
	movfp    ACCaHI,wreg
	subwf     ACCcHI,w          ;check if a>c
	btfss      _z
	goto    notz
	movfp    ACCaLO,wreg
	subwf     ACCcLO,w        ; if msb equal then check lsb
notz
	btfss      _carry    ; carry set if c>a
	goto    nosub           ; if c < a
subca
	movfp    ACCaLO,wreg     ; c-a into c
	subwf     ACCcLO
	movfp    ACCaHI,wreg
	subwfb    ACCcHI
	bsf      _carry              ;shift a 1 into d (result)
nosub
	rlcf     ACCdLO
	rlcf     ACCdHI
	decfsz     count
	goto    divLoop

;
    #if SIGNED
	btfss      sign,MSB
	return
	movlw    ACCcLO
	movwf     fsr0
	call    negate
	movlw    ACCdLO
	movwf     fsr0
	call    negate
	return
    #else
	return
    #endif
;
	PAGE
;*******************************************************************
;                       Double Precision Division
;
;               ( Optimized for Speed : straight Line Code )
;
;*******************************************************************;
;   Division : ACCb(16 bits) / ACCa(16 bits) -> ACCb(16 bits) with
;                                               Remainder in ACCc (16 bits)
;
;      (a) Load the Denominator in location ACCaHI & ACCaLO ( 16 bits )
;      (b) Load the Numerator in location ACCbHI & ACCbLO ( 16 bits )
;      (c) CALL D_div
;      (d) The 16 bit result is in location ACCbHI & ACCbLO
;      (e) The 16 bit Remainder is in locations ACCcHI & ACCcLO
;
;               B/A = (Q) + (R)/A
;       or      B = A*Q + R
;
;                       where   B :     Numerator
;                               A :     Denominator
;                               Q :     Quotiont (Integer Result)
;                               R :     Remainder
;
;       Note :  Check for ZERO Denominator or Numerator is not performed
;               A ZERO Denominator will produce incorrect results
;
;       SIGNED Arithmetic :
;                       In case of signed arithmetic, if either
;  numerator or denominator is negative, then both Q & R are
;  represented as negative numbers
;               -(B/A) = -(Q) + (-R)/A
;       or      -B = (-Q)*A + (-R)
;
;   Performance :
;            Program Memory  :   325 (UNSIGNED)
;                                354 (SIGNED)
;               Clock Cycles    : 250 (UNSIGNED : excluding CALL & RETURN)
;                               : 260 (SIGNED : excluding CALL & RETURN)
;
;*******************************************************************;
;       division macro
;
divMac  MACRO
	variable i

       i = 0
      .while i < 16
;
		bcf      _carry
		rlcf     ACCbLO
		rlcf     ACCbHI
		rlcf     ACCcLO
		rlcf     ACCcHI
		movfp    ACCaHI,wreg
		subwf     ACCcHI,w          ;check if a>c
		btfss      _z
		goto    notz#v(i)
		movfp    ACCaLO,wreg
		subwf     ACCcLO,w        ;if msb equal then check lsb
notz#v(i)       btfss     _carry    ;carry set if c>a
		goto    nosub#v(i)           ; if c < a
subca#v(i)      movfp    ACCaLO,wreg        ;c-a into c
		subwf     ACCcLO
		movfp    ACCaHI,wreg
		subwfb    ACCcHI
		bsf      _carry            ;shift a 1 into d (result)
nosub#v(i)      rlcf     ACCdLO
		rlcf     ACCdHI
       i=i+1
      .endw
;
	ENDM
;
	PAGE
;*******************************************************************
;       Double Precision Divide ( 16/16 -> 16 )
;
;         ( ACCb/ACCa -> ACCb with remainder in ACCc ) : 16 bit output
; with Quotiont in ACCb (ACCbHI,ACCbLO) and Remainder in ACCc (ACCcHI,ACCcLO).
;
;   NOTE  :  Before calling this routine, the user should make sure that
;            the Numerator(ACCb) is greater than Denominator(ACCa). If
;            the case is not true, the user should scale either Numerator
;            or Denominator or both such that Numerator is greater than
;            the Denominator.
;
;
;*******************************************************************
;
D_divF
;
     #if   SIGNED
	movfp    ACCaHI,wreg
	xorwf     ACCbHI,w
	movwf     sign
	btfss      ACCbHI,MSB        ; if MSB set go & negate ACCb
	goto    chek_A_MSB_DIV
;
	negMac  ACCbLO,ACCbHI
;
chek_A_MSB_DIV
	btfss   ACCaHI,MSB        ; if MSB set go & negate ACCa
	goto    continue_DIV
	negMac  ACCaLO,ACCaHI

     #endif
;
continue_DIV
	clrf     ACCcHI
	clrf     ACCcLO
	clrf     ACCdLO
	clrf     ACCdHI

;
; straight line code : using the macro divMac
;
	divMac
;
    #if SIGNED
	btfss   sign,MSB        ; negate (ACCc,ACCd)
	return
	negMac  ACCcLO,ACCcHI
	negMac  ACCdLO,ACCdHI
	return
    #else
	return
    #endif
;
	PAGE
;*******************************************************************
;
;            Square Root By Newton Raphson Method
;
;    This routine computes the square root of a 16 bit number(with
;  low byte in NumLo & high byte in NumHi ). After loading NumLo &
;  NumHi with the desired number whose square root is to be computed,
;  branch to location Sqrt ( by "GOTO  Sqrt" ). " CALL  Sqrt" cannot
;  be issued because the Sqrt function makes calls to Math routines
;  and the stack is completely used up.
;       The result = sqrt(NumHi,NumLo) is returned in location SqrtLo.
;  The total number of iterations is set to ten. If more iterations
;  are desired, change "LupCnt equ .10" to the desired value. Also,
;  the initial guess value of the square root is given set as
;  input/2 ( in subroutine "init" ). The user may modify this scheme
;  if a better initial approximation value is known. A good initial
;  guess will help the algorithm converge at a faster rate and thus
;  less number of iterations required.
;       Two utility math routines are used by this program : D_divS
;  and D_add. These two routines are listed as seperate routines
;  under double precision Division and double precision addition
;  respectively.
;
;  Note : If square root of an 8 bit number is desired, it is probably
;         better to have a table look scheme rather than using numerical
;         methods.
;               This method is computationally quite intensive and
;         slow, but very accurate and the convergence rate is high

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品人在线二区三区| 精品国产乱码久久久久久1区2区 | 久久影院视频免费| 日韩三级在线观看| 欧美一级高清片在线观看| 9191精品国产综合久久久久久| 在线免费一区三区| 欧美三区免费完整视频在线观看| 91高清视频免费看| 欧美一区二区三级| 日韩亚洲欧美中文三级| 精品国内片67194| 久久综合国产精品| 中文字幕在线不卡| 亚洲三级电影网站| 视频一区中文字幕国产| 久久99日本精品| 激情欧美一区二区| caoporen国产精品视频| 色婷婷综合久久久中文一区二区 | 91视视频在线观看入口直接观看www | 国产成人av在线影院| 99久久久久久| 7777精品伊人久久久大香线蕉的| 日韩亚洲欧美综合| 中文字幕中文字幕中文字幕亚洲无线| 一区二区久久久| 老司机免费视频一区二区| 国产成人av福利| 91久久人澡人人添人人爽欧美| 欧美久久高跟鞋激| 中文字幕国产精品一区二区| 亚洲高清不卡在线观看| 国产综合色产在线精品| 91免费在线视频观看| 日韩视频在线观看一区二区| 1区2区3区国产精品| 日韩黄色在线观看| 97久久人人超碰| 欧美一级日韩不卡播放免费| 中文字幕一区二区在线播放| 热久久一区二区| 在线观看视频一区二区 | 成人黄色a**站在线观看| 欧美日韩在线三区| 国产日韩精品一区二区三区| 亚洲福利视频一区| 粉嫩一区二区三区在线看| 欧美日本国产一区| 亚洲嫩草精品久久| 紧缚捆绑精品一区二区| 欧美日本国产视频| 亚洲精品写真福利| 成人免费精品视频| 久久综合视频网| 欧美96一区二区免费视频| 99国产精品久久久久久久久久久| 久久午夜老司机| 免费日本视频一区| 欧美日韩久久一区| 亚洲电影激情视频网站| 91片在线免费观看| 最新日韩在线视频| 国产91富婆露脸刺激对白| 久久综合九色综合欧美亚洲| 久99久精品视频免费观看| 欧美日韩在线亚洲一区蜜芽| 亚洲综合激情另类小说区| 色综合天天综合网国产成人综合天 | 婷婷综合另类小说色区| 欧洲av一区二区嗯嗯嗯啊| 亚洲女同ⅹxx女同tv| 99re热这里只有精品免费视频| 国产日韩成人精品| 成人午夜av在线| 国产精品天干天干在线综合| 成人一区在线观看| 中文字幕在线免费不卡| 91麻豆蜜桃一区二区三区| 亚洲人妖av一区二区| 色综合天天在线| 夜夜亚洲天天久久| 欧美色中文字幕| 视频一区二区三区入口| 欧美一级在线视频| 久久国产精品无码网站| 久久久久久久久久久电影| 成人免费看视频| 亚洲美腿欧美偷拍| 欧美美女网站色| 另类中文字幕网| 欧美激情一区二区三区全黄| 成人aaaa免费全部观看| 亚洲一区二区三区免费视频| 欧美男女性生活在线直播观看| 免费成人在线观看| 久久嫩草精品久久久精品一| www.亚洲免费av| 亚洲综合在线第一页| 日韩一区二区三区在线视频| 国产精品18久久久| 亚洲综合另类小说| 久久影院电视剧免费观看| 91亚洲午夜精品久久久久久| 午夜国产精品影院在线观看| 久久久久久**毛片大全| 97超碰欧美中文字幕| 日本成人在线网站| 国产精品福利一区二区三区| 欧美精选一区二区| av一区二区三区四区| 午夜精品国产更新| 国产精品久久久久婷婷| 4438成人网| 色老头久久综合| 国产一二精品视频| 无吗不卡中文字幕| 国产精品午夜免费| 日韩一区二区三区视频| 91视频在线看| 国产高清在线观看免费不卡| 视频在线观看一区二区三区| 中文字幕精品三区| 精品欧美乱码久久久久久1区2区| 色综合天天综合网天天狠天天| 精品伊人久久久久7777人| 亚洲国产aⅴ成人精品无吗| 国产日韩视频一区二区三区| 欧美一区二区视频在线观看2022| 91美女视频网站| 国产成人a级片| 国产综合久久久久影院| 蜜臀91精品一区二区三区| 一区二区三区四区乱视频| 欧美极品aⅴ影院| 精品美女被调教视频大全网站| 欧美日韩三级在线| 色噜噜狠狠成人网p站| 99热在这里有精品免费| 国产精品88888| 另类综合日韩欧美亚洲| 日韩成人午夜精品| 亚洲va天堂va国产va久| 亚洲国产精品一区二区尤物区| 国产精品丝袜在线| 亚洲国产电影在线观看| 国产欧美精品一区二区色综合朱莉| 欧美精品一区二区三| 日韩欧美在线综合网| 欧美一区二区黄色| 欧美大片顶级少妇| 精品卡一卡二卡三卡四在线| 日韩色在线观看| 精品久久久影院| 精品日韩av一区二区| 日韩你懂的电影在线观看| 91精品国产麻豆国产自产在线| 欧美精选一区二区| 欧美成人精品1314www| 久久夜色精品国产噜噜av| 日韩精品中文字幕在线一区| 欧美电影免费观看完整版| 2024国产精品| 国产亚洲精品bt天堂精选| 国产精品美女久久久久aⅴ| 国产精品欧美综合在线| 国产精品国产馆在线真实露脸| 综合欧美亚洲日本| 亚洲成在线观看| 久久精品国产亚洲5555| 国产精品456| 91同城在线观看| 91精品国产乱| 国产欧美一区二区精品秋霞影院| 日本一区二区电影| 亚洲另类春色校园小说| 日本一道高清亚洲日美韩| 国产一区二区美女| 91在线观看免费视频| 欧美日韩国产影片| 久久久三级国产网站| 亚洲欧美aⅴ...| 久久99久久99精品免视看婷婷| 成人网男人的天堂| 欧美日韩在线播放一区| 精品国产露脸精彩对白| 亚洲私人黄色宅男| 免费观看日韩电影| 国产·精品毛片| 在线成人高清不卡| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 日韩欧美美女一区二区三区| 国产日韩欧美高清| 亚洲妇熟xx妇色黄| 成人午夜伦理影院| 日韩亚洲欧美在线观看| 亚洲女子a中天字幕| 国产精品99久久久久久似苏梦涵| 欧美中文字幕一区二区三区| 久久免费偷拍视频|