home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l040 / 13.ddi / RTLSYS.ZIP / LAST.ASM < prev    next >
Encoding:
Assembly Source File  |  1992-10-28  |  1.1 KB  |  61 lines

  1.  
  2. ; *******************************************************
  3. ; *                            *
  4. ; *     Turbo Pascal Run-time Library                   *
  5. ; *    Data Segment Initialization            *
  6. ; *                            *
  7. ; *     Copyright (c) 1988,92 Borland International     *
  8. ; *                            *
  9. ; *******************************************************
  10.  
  11.     TITLE    LAST
  12.  
  13. ; This module must be the last one linked into the System unit. That
  14. ; way, the ConstEnd and DataEnd symbols will mark the end of the
  15. ; initialized and uninitialized portions of the data segment.
  16.  
  17. CONST    SEGMENT    WORD PUBLIC
  18.  
  19. ; End of initialized portion of data segment
  20.  
  21. ConstEnd    LABEL    WORD
  22.  
  23. CONST    ENDS
  24.  
  25. DATA    SEGMENT WORD PUBLIC
  26.  
  27. ; End of uninitialized portion of data segment
  28.  
  29. DataEnd        LABEL    WORD
  30.  
  31. DATA    ENDS
  32.  
  33. DGROUP    GROUP    CONST,DATA
  34.  
  35. CODE    SEGMENT    BYTE PUBLIC
  36.  
  37.     ASSUME    CS:CODE,DS:DGROUP
  38.  
  39. ; Publics
  40.  
  41.     PUBLIC    ClearDSeg
  42.  
  43. ; Clear uninitialized data segment
  44.  
  45. ClearDSeg:
  46.  
  47.     MOV    DI,OFFSET ConstEnd
  48.     PUSH    DS
  49.     POP    ES
  50.     MOV    CX,OFFSET DataEnd
  51.     SUB    CX,DI
  52.     SHR    CX,1
  53.     XOR    AX,AX
  54.     CLD
  55.     REP    STOSW
  56.     RET
  57.  
  58. CODE    ENDS
  59.  
  60.     END
  61.