;/*=============================================*/
;/* STUB.ASM	 				*/
;/*=============================================*/
;/*						*/
;/*  Developed by Rich Peters,			*/
;/*  1994 by Micro-Magic 			*/
;/*  asm stub for OS/2 device drivers written 	*/
;/*  in C /C++.  You might have to rename _DATA	*/
;/*  to DATA for some compilers			*/
;/*=============================================*/

_DATA           segment dword public 'DATA'
_DATA           ends

CONST           segment dword public 'CONST'
CONST           ends

_BSS            segment dword public 'BSS'
_BSS            ends

Code            segment dword public 'CODE'
Code            ends

_TEXT           segment dword public 'CODE'
_TEXT           ends

S_TEXT           segment dword public 'CODE'
S_TEXT           ends

DGROUP          group   CONST, _BSS, _DATA
StaticGroup     group   Code, S_TEXT,_TEXT

_TEXT           segment dword public 'CODE'
assume cs:_TEXT
public Strat1, Interrupt0, Interrupt1, TimerHandler
public SaveFlags, RestoreFlags, BreakPoint

extrn Strategy:near
extrn Int0:near
extrn Int1:near
extrn TimerInt:near

Strat1 proc far
	push	es
	push	bx
	call	Strategy
	ret
Strat1 endp

Interrupt0 proc far
	call	Int0
	clc
	ret
Interrupt0 endp

Interrupt1 proc far
	call	Int1
	clc
	ret
Interrupt1 endp

TimerHandler proc far
.386
	push	es
	pushad
	call	TimerInt
	popad	
	pop	es
	sti
	ret
TimerHandler endp

SaveFlags	proc near
	pushf	
	pop	ax
	cli
	ret
SaveFlags	endp

RestoreFlags	proc near
	push	bp
	mov	ax, [bp+4]
	push	ax
	popf
	pop	bp
	ret
RestoreFlags	endp

BreakPoint proc near
	int	3
	ret
BreakPoint endp


_TEXT           ends
        end
