rx8_1.asm

来自「Application Note Abstract This Applicat」· 汇编 代码 · 共 205 行

ASM
205
字号
;------------------------------------------------------------------------------
;  FILENAME:   RX8_1.asm
;   VERSION:   Rev B, 2002 Mar 30
;------------------------------------------------------------------------------
;  DESCRIPTION:
;     RX8_1 RX8 User Module API.
;------------------------------------------------------------------------------
;	Copyright (c) Cypress MicroSystems 2000-2002. All Rights Reserved.
;------------------------------------------------------------------------------

;-----------------------------------------------
; include instance specific register definitions
;-----------------------------------------------
include "m8c.inc"
include "RX8_1.inc"

area text (ROM, REL)

;-------------------------------------------------------------------
;  Declare the functions global for both assembler and C compiler.
;
;  Note that there are two names for each API. First name is 
;  assembler reference. Name with underscore is name refence for
;  C compiler.  Calling function in C source code does not require 
;  the underscore.
;-------------------------------------------------------------------
export   RX8_1_EnableInt
export  _RX8_1_EnableInt
export   RX8_1_DisableInt
export  _RX8_1_DisableInt
export   RX8_1_Start
export  _RX8_1_Start
export   RX8_1_Stop
export  _RX8_1_Stop
export  bRX8_1_ReadRxData
export _bRX8_1_ReadRxData
export  bRX8_1_ReadRxStatus
export _bRX8_1_ReadRxStatus

;-----------
;  EQUATES
;-----------
bfCONTROL_REG_START_BIT:   equ   1     ; Control register start bit 

;-----------------------------------------------------------------------------
;  FUNCTION NAME: RX8_1_EnableInt
;
;  DESCRIPTION:
;     Enables this receiver's interrupt by setting the interrupt enable mask 
;     bit associated with this User Module. Remember to call the global interrupt
;     enable function by using the macro: M8C_EnableGInt.
;
;  ARGUMENTS:
;     none.
;
;  RETURNS:
;     none.
;
;  SIDE EFFECTS:
;     none.
;
;  THEORY of OPERATION:  
;     Sets the specific user module interrupt enable mask bit.
;
;-----------------------------------------------------------------------------
 RX8_1_EnableInt:
_RX8_1_EnableInt:
   M8C_EnableIntMask RX8_1_INT_REG, bRX8_1_INT_MASK
   ret	

	
;-----------------------------------------------------------------------------
;  FUNCTION NAME: RX8_1_DisableInt
;
;  DESCRIPTION:
;     Disables this RX8's interrupt by clearing the interrupt enable mask bit
;     associated with this User Module. 
;
;  ARGUMENTS:
;     none.
;
;  RETURNS:
;     none.
;
;  SIDE EFFECTS:
;     none.
;
;  THEORY of OPERATION:  
;     Clears the specific user module interrupt enable mask bit.
;
;-----------------------------------------------------------------------------
 RX8_1_DisableInt:
_RX8_1_DisableInt:
   M8C_DisableIntMask RX8_1_INT_REG, bRX8_1_INT_MASK
   ret


;-----------------------------------------------------------------------------
;  FUNCTION NAME: RX8_1_Start(BYTE bParity)
;
;  DESCRIPTION:
;     Sets the start bit and parity in the Control register of this user module. 
;
;  ARGUMENTS:
;     BYTE bParity - parity of received data.  Use defined masks.
;     passed in A register.
;
;  RETURNS:
;     none.
;
;  SIDE EFFECTS:
;     none.
;
;  THEORY of OPERATION:  
;     Set the specified parity and start bits in the Control register.
;
;-----------------------------------------------------------------------------
 RX8_1_Start:
_RX8_1_Start:
   or    A, bfCONTROL_REG_START_BIT
   mov   REG[RX8_1_CONTROL_REG], A
   ret	


;-----------------------------------------------------------------------------
;  FUNCTION NAME: RX8_1_Stop
;
;  DESCRIPTION:
;     Disables RX8 operation.
;
;  ARGUMENTS:
;     none.
;
;  RETURNS:
;     none.
;
;  SIDE EFFECTS:
;     none.
;
;  THEORY of OPERATION:  
;     Clear the start bit in the Control register.
;
;-----------------------------------------------------------------------------
 RX8_1_Stop:
_RX8_1_Stop:
   and   REG[RX8_1_CONTROL_REG], ~bfCONTROL_REG_START_BIT
   ret	


;-----------------------------------------------------------------------------
;  FUNCTION NAME: bRX8_1_ReadRxData
;
;  DESCRIPTION:
;     Reads the RX buffer register.  Should check the status regiser to make
;     sure data is valid.
;
;  ARGUMENTS:
;     none.
;
;  RETURNS:
;     bRxData - returned in A.
;
;  SIDE EFFECTS:
;     none.
;
;  THEORY of OPERATION:  
;     none.
;
;-----------------------------------------------------------------------------
 bRX8_1_ReadRxData:
_bRX8_1_ReadRxData:
	mov A, REG[RX8_1_RX_BUFFER_REG]
	ret


;-----------------------------------------------------------------------------
;  FUNCTION NAME: bRX8_1_ReadRxStatus
;
;  DESCRIPTION:
;     Reads the RX Status bits in the Control/Status register.
;
;  ARGUMENTS:
;     none.
;
;  RETURNS:
;     BYTE  bRXStatus - transmit status data.  Use the following defined bits 
;                       masks: RX_COMPLETE and RX_BUFFER_EMPTY
;     returned in A.
;
;  SIDE EFFECTS:
;     none.
;
;  THEORY of OPERATION:  
;     Read the status and control register.
;
;-----------------------------------------------------------------------------
 bRX8_1_ReadRxStatus:
_bRX8_1_ReadRxStatus:
	mov A,  REG[RX8_1_CONTROL_REG]
	ret
   

;	end of RX8 API code

⌨️ 快捷键说明

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