⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tx_232.asm

📁 用VC编辑的一个MD5算法
💻 ASM
字号:
;------------------------------------------------------------------------------
;  FILENAME:   Tx_232.asm
;   VERSION:   Rev B, 2002 May 24
;------------------------------------------------------------------------------
;  DESCRIPTION:
;     Tx_232 TX8 User Module API.
;------------------------------------------------------------------------------
;	Copyright (c) Cypress MicroSystems 2000-2002. All Rights Reserved.
;------------------------------------------------------------------------------

;-----------------------------------------------
; include instance specific register definitions
;-----------------------------------------------
include "m8c.inc"
include "Tx_232.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   Tx_232_EnableInt
export  _Tx_232_EnableInt
export   Tx_232_DisableInt
export  _Tx_232_DisableInt
export   Tx_232_Start
export  _Tx_232_Start
export   Tx_232_Stop
export  _Tx_232_Stop
export   Tx_232_SendData
export  _Tx_232_SendData
export   bTx_232_ReadTxStatus
export  _bTx_232_ReadTxStatus

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

;-----------------------------------------------------------------------------
;  FUNCTION NAME: Tx_232_EnableInt
;
;  DESCRIPTION:
;     Enables this Transmitter'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.
;
;-----------------------------------------------------------------------------
 Tx_232_EnableInt:
_Tx_232_EnableInt:
   M8C_EnableIntMask  Tx_232_INT_REG, bTx_232_INT_MASK
   ret	

	
;-----------------------------------------------------------------------------
;  FUNCTION NAME: Tx_232_DisableInt
;
;  DESCRIPTION:
;     Disables this TX8'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.
;
;-----------------------------------------------------------------------------
 Tx_232_DisableInt:
_Tx_232_DisableInt:
   M8C_DisableIntMask Tx_232_INT_REG, bTx_232_INT_MASK
   ret


;-----------------------------------------------------------------------------
;  FUNCTION NAME: Tx_232_Start(BYTE bParity)
;
;  DESCRIPTION:
;     Sets the start bit and parity in the Control register of this user module. 
;     The transmitter will begin transmitting if a byte has been written into the
;     transmit buffer.
;
;  ARGUMENTS:
;     BYTE bParity - parity of transmitted data.  Use defined masks.
;
;  RETURNS:
;     none.
;
;  SIDE EFFECTS:
;     none.
;
;  THEORY of OPERATION:  
;     Set the specified parity and start bits in the Control register.
;
;-----------------------------------------------------------------------------
 Tx_232_Start:
_Tx_232_Start:
   or    A, bfCONTROL_REG_START_BIT
   mov   REG[Tx_232_CONTROL_REG], A
   ret	


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


;-----------------------------------------------------------------------------
;  FUNCTION NAME: Tx_232_SendData
;
;  DESCRIPTION:
;     Disables TX8 operation.
;
;  ARGUMENTS:
;     BYTE  TxData - data to transmit.
;
;  RETURNS:
;     none.
;
;  SIDE EFFECTS:
;     none.
;
;  THEORY of OPERATION:  
;     Writes data to the TX buffer register.
;
;-----------------------------------------------------------------------------
 Tx_232_SendData:
_Tx_232_SendData:
	mov REG[Tx_232_TX_BUFFER_REG], A
	ret


;-----------------------------------------------------------------------------
;  FUNCTION NAME: bTx_232_ReadTxStatus
;
;  DESCRIPTION:
;     Reads the Tx Status bits in the Control/Status register.
;
;  ARGUMENTS:
;     none.
;
;  RETURNS:
;     BYTE  bTxStatus - transmit status data.  Use the following defined bits 
;                       masks: TX_COMPLETE and TX_BUFFER_EMPTY
;
;  SIDE EFFECTS:
;     none.
;
;  THEORY of OPERATION:  
;     Read the status and control register.
;
;-----------------------------------------------------------------------------
 bTx_232_ReadTxStatus:
_bTx_232_ReadTxStatus:
	mov A,  REG[Tx_232_CONTROL_REG]
	ret
   

;	end of TX8 API code

⌨️ 快捷键说明

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