home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / driver6s / memtest.asm < prev    next >
Assembly Source File  |  1990-03-05  |  922b  |  23 lines

  1. ;written by Russell Nelson, improved by Jan Engvald to drain capacitive mem.
  2.  
  3. memory_test:
  4. ;enter with ax = segment of memory to test, cx = number of bytes to test.
  5. ;exit with ne, bx->failing byte if the memory test failed.
  6.         push    ds
  7.         mov     ds,ax
  8.         mov     bx,-1
  9. memory_test_1:
  10.         inc     bx
  11.         mov     al,ds:[bx]              ;get a copy of the location.
  12.         mov     ah,ds:[bx+2]            ;get a copy of the location.
  13.         not     al
  14.         mov     ds:[bx],al              ;try to store the complement.
  15.         mov     ds:[bx+2],ah            ;drain any capacitive memory
  16.         mov     ah,al
  17.         not     ah
  18.         cmp     ds:[bx],al              ;did the store work?
  19.         mov     ds:[bx],ah              ;(in any case, restore the original)
  20.         loope   memory_test_1           ;keep going if the store worked.
  21.         pop     ds
  22.         ret
  23.