home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / pg / pg200 / memchk.src < prev    next >
Text File  |  2006-10-19  |  1KB  |  66 lines

  1. ;MEMCHK.CO by Paul Globman (c) 1988
  2. ;
  3. ;This is a non-destructive RAM test
  4. ;that tests all of RAM, including the
  5. ;locations where the program is loaded 
  6. ;to run.  It tests all bits in all RAM
  7. ;locations for reading and writing and
  8. ;will beep 5 times upon finding a bad
  9. ;RAM location.  If no problem RAM is 
  10. ;found, then 1 beep is sent.
  11. ;
  12. ;
  13. RAMSTA:    equ A000H    ;1st byte ram
  14. ALTLCD:    equ 63574    ;alt lcd buffer
  15. BEEP:    equ 4F45H    ;send beep
  16. ;
  17.     org altlcd
  18.     entry
  19. ;
  20.     jmp memchk
  21. MEMCH2:    lxi d,0        ;end of RAM + 1
  22. next2:    mov a,m        ;HL=adrs tested
  23.     mov b,a        ;byte in B
  24.     cma
  25.     mov c,a        ;complmnt in C
  26.     mov m,a        ;chnge RAM bits
  27.     mov a,m        ;look at byte
  28.     cmp c        ;bits chnge ok?
  29.     mov m,b        ;restore byte
  30.     jnz bad        ;no? error
  31.     mov a,m        ;look at byte
  32.     cmp b        ;bits chnge ok?
  33.     jnz bad        ;no? error
  34.     inx h        ;next address
  35.     rst 3        ;end of ram?
  36.     jnz next2
  37.     jmp done
  38. ;======================================
  39. MEMCHK:    lxi d, memchk
  40.     lxi h,ramsta
  41. next:    mov a,m        ;HL=adrs tested
  42.     mov b,a        ;byte in B
  43.     cma
  44.     mov c,a        ;complmnt in C
  45.     mov m,a        ;chnge RAM bits
  46.     mov a,m        ;look at byte
  47.     cmp c        ;bits chnge ok?
  48.     mov m,b        ;restore byte
  49.     jnz bad        ;no? error
  50.     mov a,m        ;look at byte
  51.     cmp b        ;bits chnge ok?
  52.     jnz bad        ;no? error
  53.     inx h        ;next address
  54.     rst 3        ;memchk yet?
  55.     jnz next
  56.     jmp memch2
  57. ;======================================
  58. bad:    call beep    ;5 beeps means
  59.     call beep    ;bad ram...
  60.     call beep
  61.     call beep    ;1 beep means
  62. done:    jmp beep    ;all is well
  63. ;
  64.     end
  65.  
  66.