home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MANTSR.ZIP / MARK.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-02-14  |  1.6 KB  |  45 lines

  1. ;MARK.ASM - mark a position in memory,
  2. ;           above which TSRs will later be cleared by RELEASE.PAS/COM
  3. ;           MARK can be called multiple times, each RELEASE will clear
  4. ;           above the last MARK called
  5. ;
  6. ; written for CHASM (CHeap ASseMbler)
  7. ; by Kim Kokkonen, TurboPower Software
  8. ; telephone: 408-378-3672, Compuserve 72457,2131
  9. ;
  10. mark   proc    near
  11.        jmp     install
  12.  
  13. idstr  db      'MARK PARAMETER BLOCK FOLLOWS' ;used to find this TSR
  14. dummy  db      0               ;puts vector table on an even paragraph boundary
  15. vector ds      400H,0          ;holds vector table (0..FF)*4 at invocation
  16.  
  17. ;store the interrupt vector table
  18. install
  19.        push    ds
  20.        cli                     ;interrupts of
  21.        cld                     ;copy up
  22.        mov     cx,200H         ;512 integers to store
  23.        xor     ax,ax
  24.        mov     ds,ax           ;source address segment 0
  25.        xor     si,si           ;offset 0
  26.        mov     di,offset(vector) ;destination offset, es=cs already
  27.        rep
  28.        movsw                   ;copy vectors to our table
  29.        sti                     ;interrupts on
  30.  
  31. ;print message and TSR
  32.        pop     ds
  33.        mov     dx,offset(didit) ;get end of code
  34.        mov     ah,9
  35.        int     21H             ;write success message
  36.        mov     cx,4
  37.        shr     dx,cl           ;convert to paragraphs
  38.        inc     dx              ;round up
  39.        mov     ax,3100H
  40.        int     21H             ;terminate and stay resident
  41.  
  42. ;used to mark end of this TSR
  43. didit  db      13,10,'Marked current memory position',13,10,36
  44.        endp
  45.