home *** CD-ROM | disk | FTP | other *** search
- ; *************
- ; * SWAKE.asm *
- ; *******************************************
- ; * Copyright TimeSlice, Inc. 1985, 86, 87. *
- ; *******************************************
- include ts.inc
- ;
- ;
- start_data
- end_data
- ;
- extrn __jmpint:far
- extrn __gus:far
- ;
- start_code
- ;
- ;*******
- ;* SWAKE()
- ;* This function is invoked to wake up the slicer. It decrements the
- ;* sleeping level of the slicer, and if it reaches zero, really
- ;* wakes up the slicer by modifying its first instruction so that
- ;* instead of jumping to original timer interrupt service routine,
- ;* it jumps to the next instruction.
- ;*******
- routine swake
- pushf ;save flags
- push es ;save es
- cli ;no interrupts, please
- dec _sslev ;decrement level of slicer sleep
- jnz sw1 ;if still asleep, return
- mov cx,offset __gus ;have jmpint point to the next instruction
- mov dx,seg __gus
- mov es,dx
- mov bx,offset __jmpint
- mov es:[bx].off,cx ;which is the begining of the slicer awake
- mov es:[bx].sgt,dx
- sw1: jg sw2 ;if _sslev reaches below zero, reset to zero
- xor ax,ax
- mov _sslev,ax
- sw2: pop es ;restore es
- popf ;restore flags
- return swake
- ;
- end_code
-
-
-