fabs.s

来自「c编写的嵌入式程序源码」· S 代码 · 共 41 行

S
41
字号
;-----------------------------------------------------------------------;
; fabs.s: Floating-point absolute value function.
;
; This file is part of the compact math library for the dsPIC30.
; (c) Microchip Technology. 2003.
;
;-----------------------------------------------------------------------;
        .include "libm.inc"
	.section .libm,code
;-----------------------------------------------------------------------;

;-----------------------------------------------------------------------;
;
; fabs
;
;       Double-precision absolute value function.
;
; Input:
;
;       (w3:w0) Floating-point number x
;
; Output:
;
;       (w3:w0) Floating-point number |x|
;
; Description:
;
;       Computes the absolute value of the argument x.
;       
;-----------------------------------------------------------------------;

        .global _fabs
        .global _fabsl

_fabs:
_fabsl:
        bclr    w3,#15          ; |x|
        return                  ; Done
;-----------------------------------------------------------------------;
        .end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?