File:  [RetroPC.NET] / np2 / mem / x86 / dmax86.x86
Revision 1.2: download - view: text, annotated - select for diffs
Wed Mar 16 12:53:45 2005 JST (20 years, 9 months ago) by yui
Branches: MAIN
CVS tags: HEAD
fix 80286 clock (jcc, test, leave) (T.Yui)


%include	'../mem/x86/dmax86.inc'

section .text

	global	_dmax86
	extern	@i286_memoryread@4
	extern	@i286_memorywrite@8


				align	16
_dmax86:		cmp		byte [_dmac + dmac_t.working], byte 0
				je		short dmap_nowork
				mov		eax, _dmac + dmac_t.dmach
				mov		cl, 1
dmap_sea:		test	[_dmac + dmac_t.working], cl
				jne		short dmap_hit
				add		cl, cl
				add		eax, dmach_t.size
				and		cl, 15
				jne		short dmap_sea
dmap_nowork:	ret

dmap_hit:		push	edi
				sub		word [eax + dmach_t.leng], byte 1
				mov		edi, eax
				jnc		short dmap_exec
				or		[_dmac + dmac_t.stat], cl
				not		cl
				and		[_dmac + dmac_t.working], cl
				mov		ecx, DMAEXT_END
				call	dword [edi + dmach_t.extproc]
dmap_exec:		mov		al, [edi + dmach_t.mode]
				and		al, 0ch
				je		short dmap_verify
				cmp		al, 04h
				je		short dmap_port2mem
				mov		ecx, [edi + dmach_t.adrs]
				call	@i286_memoryread@4
				mov		cl, al
				call	dword [edi + dmach_t.outproc]
				jmp		short dmap_inccnt
dmap_verify:	call	dword [edi + dmach_t.inproc]
				jmp		short dmap_inccnt
dmap_port2mem:	call	dword [edi + dmach_t.inproc]
				mov		ecx, [edi + dmach_t.adrs]
				mov		dl, al
				call	@i286_memorywrite@8
dmap_inccnt:	test	byte [edi + dmach_t.mode], 20h
				jne		short dmap_adrsdec
				inc		dword [edi + dmach_t.adrs]
				pop		edi
				ret
dmap_adrsdec:	dec		dword [edi + dmach_t.adrs]
				pop		edi
				ret

	ends


RetroPC.NET-CVS <cvs@retropc.net>