|
|
| version 1.2, 2005/03/16 03:53:45 | version 1.3, 2005/03/16 23:26:37 |
|---|---|
| Line 1 | Line 1 |
| %include '../mem/x86/dmax86.inc' | %include '../io/x86/iocore.inc' |
| section .text | section .text |
| Line 10 section .text | Line 10 section .text |
| align 16 | align 16 |
| _dmax86: cmp byte [_dmac + dmac_t.working], byte 0 | _dmax86: cmp byte [_dmac + dmac_t.working], byte 0 |
| je short dmap_nowork | je short .nowork |
| mov eax, _dmac + dmac_t.dmach | |
| mov cl, 1 | mov cl, 1 |
| dmap_sea: test [_dmac + dmac_t.working], cl | mov eax, _dmac + dmac_t.dmach |
| jne short dmap_hit | .sea: test [_dmac + dmac_t.working], cl |
| jne short .hit | |
| add cl, cl | add cl, cl |
| add eax, dmach_t.size | add eax, byte dmach_t.size |
| and cl, 15 | test cl, 15 |
| jne short dmap_sea | jne short .sea |
| dmap_nowork: ret | .nowork: ret |
| dmap_hit: push edi | .hit: push edi |
| sub word [eax + dmach_t.leng], byte 1 | sub word [eax + dmach_t.leng], byte 1 |
| mov edi, eax | mov edi, eax |
| jnc short dmap_exec | jnc short .exec |
| or [_dmac + dmac_t.stat], cl | or [_dmac + dmac_t.stat], cl |
| not cl | not cl |
| and [_dmac + dmac_t.working], cl | and [_dmac + dmac_t.working], cl |
| mov ecx, DMAEXT_END | mov ecx, DMAEXT_END |
| call dword [edi + dmach_t.extproc] | call dword [edi + dmach_t.extproc] |
| dmap_exec: mov al, [edi + dmach_t.mode] | .exec: mov al, [edi + dmach_t.mode] |
| and al, 0ch | and al, 0x0c |
| je short dmap_verify | je short .verify |
| cmp al, 04h | cmp al, 0x04 |
| je short dmap_port2mem | je short .port2mem |
| mov ecx, [edi + dmach_t.adrs] | mov ecx, [edi + dmach_t.adrs] |
| call @i286_memoryread@4 | call @i286_memoryread@4 |
| mov cl, al | mov cl, al |
| call dword [edi + dmach_t.outproc] | call dword [edi + dmach_t.outproc] |
| jmp short dmap_inccnt | jmp short .inccnt |
| dmap_verify: call dword [edi + dmach_t.inproc] | .verify: call dword [edi + dmach_t.inproc] |
| jmp short dmap_inccnt | jmp short .inccnt |
| dmap_port2mem: call dword [edi + dmach_t.inproc] | .port2mem: call dword [edi + dmach_t.inproc] |
| mov ecx, [edi + dmach_t.adrs] | mov ecx, [edi + dmach_t.adrs] |
| mov dl, al | mov dl, al |
| call @i286_memorywrite@8 | call @i286_memorywrite@8 |
| dmap_inccnt: test byte [edi + dmach_t.mode], 20h | .inccnt: test byte [edi + dmach_t.mode], 0x20 |
| jne short dmap_adrsdec | jne short .adrsdec |
| inc dword [edi + dmach_t.adrs] | inc dword [edi + dmach_t.adrs] |
| pop edi | pop edi |
| ret | ret |
| dmap_adrsdec: dec dword [edi + dmach_t.adrs] | .adrsdec: dec dword [edi + dmach_t.adrs] |
| pop edi | pop edi |
| ret | ret |