home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / MEMORIA / MEMUTL11.ZIP / WATCHMEM.ASM < prev    next >
Encoding:
Assembly Source File  |  1991-01-09  |  974 b   |  60 lines

  1. ;
  2. ; watchmem : Add user comments to the WATCHMEM buffer
  3. ;
  4. ; C interface : void far PASCAL watchmem(char far *comments)
  5. ;
  6.  
  7.         .MODEL LARGE, PASCAL
  8.         .CODE
  9.         .LALL
  10.  
  11. IDName        db    'SC3WATCH'
  12.  
  13. add_user_info    dw    5
  14. user_info_seg    dw    0
  15. user_info_off    dw    0
  16.  
  17. watchmem    PROC FAR USES AX BX CX SI DS ES, comments:PTR BYTE
  18.  
  19. ; Do we have a valid int 2F vector?
  20.         mov    ah, 035h
  21.         mov    al, 02Fh
  22.         int    21h
  23.         ; int 2F vector now in ES:BX
  24.         mov    ax, es
  25.         cmp    ax, 00000h
  26.         je    watchdone
  27.         cmp    ax, 0F000h
  28.         je    watchdone
  29.  
  30. ; Does the TSR exist?
  31.         push    ds
  32.         mov    ax, 5453h
  33.         mov    bx, 0000h
  34.         mov    cx, 0000h
  35.         push    cs
  36.         pop    ds
  37.         mov    si, OFFSET IDName
  38.         int    2Fh
  39.         pop    ds
  40.         cmp    ax, 0FFFFh
  41.         jne    watchdone
  42.  
  43. ; TSR exists!  TSR ID value in CX, send the string!
  44.         les    di, comments
  45.         mov    user_info_seg, es
  46.         mov    user_info_off, di
  47.         mov    ax, 5453h
  48.         mov    bx, 0020h
  49.         push    cs
  50.         pop    es
  51.         mov    di, OFFSET add_user_info
  52.         int    2Fh
  53.  
  54. watchdone:    ret
  55.  
  56. watchmem    ENDP
  57.  
  58.         END
  59.  
  60.