        NAM    MEMCON3
*SHORT MEMORY ADDRESS CONVERGENCE TEST
*FOR SWTPC 6800 COMPUTER SYSTEMS
*MIKBUG AND SWTBUG COMPATIBLE

LOMEM   EQU    $A002     STARTING ADDRESS
HIMEM   EQU    $A004     ENDING ADDRESS
OUTEEE  EQU    $E1D1     CHARACTER OUTPUT

        ORG    $A014
START   STA B  BSTORE    STORE ACCCB
        LDX    LOMEM     LOAD LOW MEMORY ADDRESS
LOOP1   STA B  0,X
        CPX    HIMEM     END OF MEMORY?
        BEQ    CHECK     CHECK IF FINISHED
        INX
        INC B
        BRA    LOOP1
CHECK   LDA B  BSTORE    CHECKS ALL LOCATIONS FOR CORR
        LDX    LOMEM
LOOP2   CMP B  0,X
        BNE    ERROR
        CPX    HIMEM
        BRA    JUMP

        ORG    $A048
        FDB    START
JUMP    BEQ    CYCLE
        INX
        INC B
        BRA    LOOP2
ERROR   LDA A #'x       PRINT X IF ERROR FOUND
        JSR    OUTEEE
        BRA    START    START OVER
CYCLE   LDA A  #'#      PRINT # FOR CORRECT CYCLE
        JSR    OUTEEE
        DEC B
        BRA    START
BSTORE  FCB 0
        END        





