fifo_wt_pd.asm

来自「USB CDC and HID composite unit.」· 汇编 代码 · 共 67 行

ASM
67
字号
;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.5.5 #1236 (Apr  6 2006)
; This file generated Tue Jul 18 05:11:08 2006
;--------------------------------------------------------
	.module FIFO_WT_PD
	.optsdcc -mmcs51 --model-small
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl _FIFO_Write_pdata_PARM_3
	.globl _FIFO_Write_pdata_PARM_2
	.globl _FIFO_Write_pdata
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
	.area RSEG    (DATA)
_USB0ADR	=	0x0096
_USB0DAT	=	0x0097
;--------------------------------------------------------
; overlayable register banks
;--------------------------------------------------------
	.area REG_BANK_0	(REL,OVR,DATA)
	.ds 8
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
	.area DSEG    (DATA)
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
	.area	OSEG    (OVR,DATA)
_FIFO_Write_pdata_PARM_2::
	.ds 1
_FIFO_Write_pdata_PARM_3::
	.ds 1
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG    (CODE)
;------------------------------------------------------------
;  void FIFO_Write_pdata( BYTE fifo_adr, BYTE n, BYTE pdata * ptr  )
;
;fifo_adr                  Allocated to registers dpl
;n                         Allocated with name '_FIFO_Write_pdata_PARM_2'
;ptr                       Allocated with name '_FIFO_Write_pdata_PARM_3'
;------------------------------------------------------------

_FIFO_Write_pdata:
	mov	a,_FIFO_Write_pdata_PARM_2
	jz	00109$
	mov	a,#0x3F
	anl	a,dpl
	mov	_USB0ADR,a
	mov	r2,_FIFO_Write_pdata_PARM_2
	mov	r0,_FIFO_Write_pdata_PARM_3
00104$:
	movx	a,@r0
	mov	_USB0DAT,a
	inc	r0
00101$:
	mov	a,_USB0ADR
	jb	acc.7,00101$
	djnz	r2,00104$
00109$:
	ret

⌨️ 快捷键说明

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