home *** CD-ROM | disk | FTP | other *** search
/ Boldly Go Collection / version40.iso / TS / 25D / SETMEM.ZIP / TRASHMEM.ASM < prev    next >
Encoding:
Assembly Source File  |  1992-04-03  |  832 b   |  54 lines

  1. ; This program fills memory from the end of the program to 9FFFF with
  2. ;  random values.  This can help when trying to track down uninitialized
  3. ;  variable problems.
  4. ; This program is public domain.
  5. ;  Joe Ahlgren  92/04/03  BBS 703-241-7980  CSID 70461,2340
  6. ;
  7. ;
  8.  assume cs:cseg,ds:cseg,es:cseg,ss:cseg
  9. cseg segment para public 'code'
  10. trashmem proc near
  11.  xor ax,ax
  12.  mov si,ax
  13.  mov ds,ax
  14.  mov cx,200h
  15.  cld
  16. seed:
  17.  rcl dx,1
  18.  rcl bx,1
  19.  lodsw
  20.  adc dx,ax
  21.  lodsw
  22.  adc bx,ax
  23.  loop seed
  24. ;
  25.  mov ax,dx
  26.  mov cx,es
  27.  add cx,(LastByte-Trashmem+255+15)/16
  28. NextPara:
  29.  xor di,di
  30.  mov es,cx
  31. OnePara:
  32.  mul cx
  33.  xchg ax,bx
  34.  add ax,dx
  35.  rcl ax,1
  36.  rcl bx,1
  37.  adc ax,0
  38.  stosw
  39.  cmp di,16
  40.  jb OnePara
  41.  inc cx
  42.  cmp cx,0a000h
  43.  jb NextPara
  44. ;
  45.  mov ax,4c00h
  46.  int 21h
  47. LastByte dw 0
  48. trashmem endp
  49. cseg ends
  50.  end
  51.  
  52.  
  53.  
  54.