home *** CD-ROM | disk | FTP | other *** search
- ;
- ; "Copyright 1993 John Hood. All rights reserved.";
- ;
-
-
- ; This driver is free software; you can redistribute it and/or
- ; modify it under the terms of the GNU General Public License as
- ; published by the Free Software Foundation; either version 1, or
- ; (at your option) any later version.
- ;
- ; As a special case, this driver may be incorporated in any OS kernel,
- ; whether the GNU General Public License applies to it or not.
- ;
- ; This driver is distributed in the hope that it will be useful,
- ; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ; GNU General Public License for more details.
- ;
- ; You may have received a copy of the GNU General Public License
- ; along with this driver; if not, write to the Free Software
- ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-
- ; Assembler code for Xenix/386
- ; This is hand-optimized C compiler code. Don't expect it to be
- ; pretty, or commented, or anything like that. It might get
- ; replaced at a sneeze.
-
- TITLE llstuff
-
- .386
-
- ifdef ASM
-
- DGROUP GROUP CONST, _BSS, _DATA
- PUBLIC _llstuff
- CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
- CONST ENDS
- _DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
- _DATA ENDS
- _BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
- _BSS ENDS
- _TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
- ASSUME CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
- EXTRN _spl7:NEAR
- EXTRN _outb:NEAR
- EXTRN _inb:NEAR
- EXTRN _splx:NEAR
-
- _llstuff PROC NEAR
- push ebp
- mov ebp, esp
- sub esp, 8
- push edi
- push esi
-
- ; reg esi = buf
- mov esi, dword ptr [ebp+12]
- ; reg edi = endbuf
- mov edi, dword ptr [ebp+16]
- ; reg ebx = portbase
- mov edx, dword ptr [ebp+8]
- ; spincount = 20
- ; reg ecx = inspincount
- ; loaded when needed in $wait
-
-
- cmp esi, edi
- jae SHORT $exit
-
- inc edx
-
- align 4
- $top:
- in al,edx
- test al, 128
- je SHORT $wait
- $ready:
- dec edx
- lodsb
- out edx,al
-
- out 132,al
-
- pushfd
-
- mov al,13
- lea edx, dword ptr [edx+2]
-
- cli
-
- out edx,al
-
- out 132,al
-
- mov al,12
- out edx,al
-
- popfd
- dec edx
-
- cmp esi, edi
- jb SHORT $top
-
- $exit:
- mov eax, esi
- pop esi
- pop edi
- leave
- ret
-
-
- $wait:
- mov ecx, DWORD PTR [ebp+20]
- $waitloop:
- in al,edx
- test al, 128
- jne SHORT $ready
- dec ecx
- jne SHORT $waitloop
- jmp short $exit
-
- _llstuff ENDP
-
- _TEXT ENDS
-
- endif ; ASM
-
-
- END
-