318,48 → 318,52 |
dec ecx |
js irqover |
|
mov dx,[esi] ; 2+ |
movzx edx, word [esi] ; 2+ |
|
cmp dx,0 ; 1 |
test edx, edx ; 1 |
jz irqover |
cmp [esi+3],byte 1 ; 2 ; byte read |
jne noirqbyte ; 4-11 |
|
in al,dx |
|
mov edx,[edi] |
cmp edx,4000 |
mov ebx, [edi] ; address of begin of buffer in edi ; + 0x0 dword - data size |
mov eax, 4000 ; + 0x4 dword - data begin offset |
cmp ebx, eax |
je irqfull |
mov ebx,edi |
add ebx,0x10 |
add ebx,edx |
mov [ebx],al |
inc edx |
mov [edi],edx |
add ebx, [edi + 0x4] ; add data size to data begin offset |
cmp ebx, eax ; if end of buffer, begin cycle again |
jb @f |
|
add esi,4 |
jmp irqnewread |
xor ebx, ebx |
|
noirqbyte: |
@@: |
add ebx, edi |
movzx eax, byte[esi + 3] ; get type of data being received 1 - byte, 2 - word |
dec eax |
jz irqbyte |
dec eax |
jnz noirqword |
|
in ax,dx |
cmp ebx, 3999 ; check for address odd in the end of buffer |
jne .odd |
mov [ebx + 0x10], ax |
jmp .add_size |
.odd: |
mov [ebx + 0x10], al ; I could make mistake here :) |
mov [edi + 0x10], ah |
.add_size: |
add dword [edi], 2 |
jmp nextport |
|
cmp [esi+3],byte 2 ; word read |
jne noirqword |
|
in ax,dx |
|
mov edx,[edi] |
cmp edx,4000 |
je irqfull |
mov ebx,edi |
add ebx,0x10 |
add ebx,edx |
mov [ebx],ax |
add edx,2 |
mov [edi],edx |
irqbyte: |
in al,dx |
mov [ebx + 0x10],al |
inc dword [edi] |
nextport: |
add esi,4 |
jmp irqnewread |
|
|
noirqword: |
irqfull: |
irqover: |