home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / crt0 / exit16.asm < prev    next >
Encoding:
Assembly Source File  |  1995-04-18  |  501 b   |  23 lines

  1. ; Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details
  2. ;-----------------------------------------------------------------------------
  3. ;  exit 16-bit helper
  4. ;
  5. ;  Used to clean up 32-bit arena on exit, so as to release as many
  6. ;  selectors and as much memory as possible.
  7. ;
  8. ;  Call with:    BX = 32-bit CS to free
  9. ;        SI:DI = 32-bit memory handle to free
  10. ;        DL = exit status
  11.  
  12.     .type    "bin"
  13.  
  14.     mov    ax, 0x0001
  15.     int    0x31
  16.  
  17.     mov    ax, 0x0502
  18.     int    0x31
  19.  
  20.     mov    al, dl
  21.     mov    ah, 0x4c
  22.     int    0x21
  23.