function.asm

来自「TI公司24X系列DSP控制永磁同步电机PMSM」· 汇编 代码 · 共 52 行

ASM
52
字号
;=====================================================================================
; File name:        Function.ASM                     
;                    
; Originator:	Digital Control Systems Group
;			Texas Instruments
;
; Description:                                 
; This file contains source for a basic function accessing a single argument.
;=====================================================================================
; History:
;-------------------------------------------------------------------------------------
; 9-15-2000	Release	Rev 1.00
;================================================================================
; Applicability: F240,F241,C242,F243,F24xx.  (Peripheral Independant).
;
;
;================================================================================
; Routine Name: Generic function.        Routine Type: C Callable
;
; Description:
;  
;  C prototype : int function(int p)
;================================================================================
                .def        _function
;================================================================================

__function_framesize .set 0001h
;================================================================================
_function:
                     POPD        *+
                SAR        AR0,*+
                SAR        AR1,*
                LARK        AR0,__function_framesize
                LAR        AR0,*0+,AR0

;================================================================================
                SBRK        #3        ; Point AR0 to the first argument.
;--------------------------------------------------------------------------------
                LACL        *        ; get the argument.

;--------------------------------------------------------------------------------
__function_exit:
                MAR     *,AR1   ; can be removed if this condition is met on
                                ; every path to this code.
                        
                SBRK        #(__function_framesize+1)
                LAR        AR0,*-
                PSHD        *
                RET


⌨️ 快捷键说明

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