;=====================================================================================
; 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.0
;================================================================================
; 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