#include "hc12.asm"

*
************************************************************
* Memtest Constants/Variables
************************************************************
*
            ORG     $0900
#include "sci.asm"
#include "time.asm"
*
*******************************************************************************
*                       SUBROUTINE -  MEMTEST
* Description: Tests memory of working RAM address ranges
* Input         : None.
* Output        : None.
* Destroys      : None.
* Calls         : None.
*******************************************************************************
*
TEST        LDAA    #$00            ; turn off COP watchdog timer
            STAA    COPCTL

            LDS     #$0bff          ; init the stack pointer

            JSR     INITSCI         ; init SCI system

            LDAA    #0              ; init counter
            LDX     #250            ; init delay count
LOOP        STAA    $4000           ; write to port
            JSR     WAIT            ; wait
            INCA                    ; increment A
            BRA     LOOP
