home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / tame21.lzh / tame21.asm next >
Assembly Source File  |  1993-07-24  |  1KB  |  52 lines

  1. ; masm 5.10a
  2. ;
  3. ; masm tame21;
  4. ; link /tiny tame21;
  5. ;
  6. ; p.fitzsimmons 93/7/24
  7.  
  8. CSEG    SEGMENT PARA PUBLIC 'CODE'
  9.         ASSUME CS:CSEG
  10.         ORG 100H
  11.  
  12. begin:  jmp start
  13.         OLD_2F  dd      ?       ; this is in the code seg!
  14. isr0x2f proc near
  15.         pushf
  16.         cmp ax, 1680h
  17.         je  Mine
  18.         popf
  19.         jmp cs:[old_2f]         ; not for us.  Chain to next 2f handler.
  20. Mine:   popf
  21.         sti
  22.         xor     dx,dx
  23.         mov     ax,1            ; Number of milliseconds in DX:AX, a
  24.                                 ; value of 0 means that the current
  25.                                 ; timeslice is released.
  26.         hlt                     ; Call OS/2.
  27.         db      35h,0CAh        ; Signature to differentiate between a
  28.                                 ; normal HLT-instruction and the call to
  29.                                 ; DosSleep().
  30.         iret
  31. isr0x2f endp
  32.  
  33. start proc near
  34.  
  35.         mov ax,352fh  ;get int2f adr; returns in es:bx
  36.         int 21h
  37.         mov word ptr cs:OLD_2F+0, bx
  38.         mov word ptr cs:OLD_2F+2, es
  39.  
  40.         mov  dx, offset isr0x2f
  41.         mov  ax,252fh  ;set int2f adr to ds:dx
  42.         int  21h
  43.  
  44.         ; t&sr
  45.         mov dx, offset start
  46.         int 27h
  47.  
  48. start endp
  49.  
  50. CSEG    ENDS
  51. end     begin
  52.