home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols100 / vol141 / bgmemtst.asm < prev    next >
Encoding:
Assembly Source File  |  1994-07-13  |  1.9 KB  |  124 lines

  1. ;        BGMEMTST.ASM
  2. ;       Background memory test
  3. ;
  4. ;Version 1.1 - 5/31/81
  5. ;
  6. ;From Lifelines pg 18 & 19  May 1981
  7. ;
  8. ;Program created & written and
  9. ;Credit should be given to:  Al Rich
  10. ;                 Soft Warehouse
  11. ;                 Honolulu, HI
  12. ;
  13. ;Mods/fixes (in reverse order to minimize reading time)
  14. ;
  15. ;    5/31/81
  16. ;Cleaned up file.  Keith Petersen, W8SDZ
  17. ;
  18. ;    5/30/81
  19. ;All I did was to type this in & make sure that
  20. ;I didn't introduce any typing errors.  As of
  21. ;5/30/81 I have patched this into my CP/M I/O
  22. ;and it seems to run.  I.e. there are no un-explained
  23. ;hangups.
  24. ;    Henry B. Rothberg
  25. ;    1 Laticrete Park North
  26. ;    Bethany, CT 06525
  27. ;
  28. ;
  29. ;This is a 'constantly running' memory test that
  30. ;is inserted into your CP/M I/O drivers at CONIN
  31. ;
  32. ;Change the jump table in CP/M to jump to CONIN0
  33. ;instead of CONIN.
  34. ;
  35. ;Whenever your sytem is waiting for a character
  36. ;to be input from the terminal, the computer will
  37. ;be testing memory.
  38. ;
  39. ;
  40. CONIN0    CALL    TEST
  41. ;
  42. CONIN    IN    CSTAT
  43.     ANI    IMASK
  44.     JZ    CONIN0
  45.     IN    CDATA
  46.     ANI    7FH    ;strip parity
  47.     RET        ;use this ret many times
  48. ;
  49. ;
  50. ;Test routine to constantly test memory
  51. ;
  52. TEST    push    h
  53.     lhld    tstpt
  54.     inx    h
  55.     mov    a,h
  56.     cpi    $/100h
  57.     jnz    test1
  58.     lxi    h,0
  59. ;
  60. test1    shld    tstpt
  61.     mov    a,m
  62.     cma
  63.     mov    m,a
  64.     cmp    m
  65.     jz    test2
  66.     xra    m
  67.     push    psw
  68.     call    prtstr
  69.     db    0dh,0ah,'*** ',0
  70.     pop    psw
  71.     push    psw
  72.     call    prthx
  73.     call    prtstr
  74.     db    ' Bits BAD at: ',0
  75.     mov    a,h
  76.     call    prthx
  77.     mov    a,l
  78.     call    prthx
  79.     pop    psw
  80. ;
  81. test2    cma
  82.     mov    m,a
  83.     pop    h
  84.     ret
  85. ;
  86. prthx    push    psw
  87.     rrc
  88.     rrc
  89.     rrc
  90.     rrc
  91.     call    prthx1
  92.     pop    psw
  93. ;
  94. prthx1    ani    0fh
  95.     cpi    10
  96.     jc    prthx2
  97.     adi    7
  98. ;
  99. prthx2    adi    '0'
  100. ;
  101. outpt    push    b
  102.     mov    c,a
  103.     call    conout
  104.     pop    b
  105.     ret
  106. ;
  107. prtstr    xthl
  108.     push    psw
  109.     call    prt
  110.     pop    psw
  111.     xthl
  112.     ret
  113. ;
  114. prt    mov    a,m
  115.     inx    h
  116.     ana    a
  117.     rz
  118.     call    outpt
  119.     jmp    prt
  120. ;
  121. tstpt    dw    0
  122. ;
  123. ;End of constant memory test
  124.