nic_write.asm

来自「zilog z80f91单片机的网络接口函数」· 汇编 代码 · 共 83 行

ASM
83
字号
;********************************************************************************
; Copyright 2001, Metro Link, Inc.												*
; All Rights Reserved															*
;																				*
; This is UNPUBLISHED PROPRIETARY SOURCE CODE of Metro Link, Inc. and may		*
; contain proprietary, confidential and trade secret information of				*
; Metro Link, Inc. and/or its partners.											*
;																				*
; The contents of this file may not be disclosed to third parties, copied or	*
; duplicated in any form, in whole or in part, without the prior written		*
; permission of Metro Link, Inc.												*
;
; Copyright 2004, ZiLOG Inc.													*
; All Rights Reserved															*
;																				*
; This is UNPUBLISHED PROPRIETARY SOURCE CODE of ZiLOG Inc., and might			*
; contain proprietary, confidential and trade secret information of				*
; ZiLOG, our partners and parties from which this code has been licensed.		*
;																				*
; The contents of this file may not be disclosed to third parties, copied or	*
; duplicated in any form, in whole or in part, without the prior written		*
; permission of ZiLOG Inc.														*
;																				*
; Copyright 2001, Metro Link, Inc.												*
; All Rights Reserved															*
;																				*
;********************************************************************************

	.assume ADL=1
	.extern p_emac_base
	.def	_nic_write
_nic_write:
	push 	ix
	ld		ix, 0
	add		ix, sp
	.if 	!ZDS1

	ld		de, 0
	ld 		e, (ix+6)
	ld 		d, (ix+7)
	ld		hl, (ix+9)
	ld		bc, (ix+12)
	.endif
	;***	Input Parameters:
	;		DE	Copy length in bytes
	;		HL Source buffer
	;		BC IOBase (Ext 16-bit IO device)
	

	;***	Determine number of Word transfers
	;		= (DE+1)/2
	inc		de
	or		a, a
	rr		d
	rr		e


	;***	Check for read length of 0
	ld		a, e
	or		a, d
	jr		z, done_write

write_again:
									; Number of Cycles
	outi2							; 5
	inc		b						; 1
	ld		a, (hl)					; 2
	out		(bc), a					; 3
	dec		c						; 1
	inc		hl						; 1	= 13

	dec		de						; 1
	ld		a, e					; 1
	or		a, d					; 1
	jr		nz, write_again			; 3

done_write:
	ld		sp, ix
	pop		ix
	ret


⌨️ 快捷键说明

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