OpenCores
URL https://opencores.org/ocsvn/t400/t400/trunk

Subversion Repositories t400

[/] [t400/] [trunk/] [sw/] [verif/] [black_box/] [skt/] [test.asm] - Rev 176

Go to most recent revision | Compare with Previous | Blame | View Log

        ;; *******************************************************************
        ;; $Id: test.asm,v 1.1 2006-05-20 02:46:20 arniml Exp $
        ;;
        ;; Checks the SKT instruction.
        ;;

        ;; the cpu type is defined on asl's command line

        org     0x00
        clra

        ;; timer not elapsed right after power-on reset
        skt
        jp      ok_1
        jmp     fail
ok_1:


        ;; preload timeout value
        stii    0x4
        stii    0x0
        stii    0x0

        ;; *******************************************************************
        ;; Poll for timer flag with and time out after a while.
        ;;
poll_loop:
        ;; decrement timeout counter
        lbi     0, 2
        sc
        clra
        aisc    0x1
        casc                    ; M(0, 2) - 1
        jp      proc_digit_1
        x       0
        jp      dec_finished

proc_digit_1:
        xds     0                ; A loads 0 from M
        sc
        aisc    0x1
        casc                    ; M(0, 1) - 1
        jp      proc_digit_0
        x       0
        jp      dec_finished

proc_digit_0:
        xds     0                ; A loads 0 from M
        sc
        aisc    0x1
        casc                    ; M(0, 0) - 1
        jmp     fail            ; TIMEOUT!
        x       0
dec_finished:

        ;; poll timer flag
        skt
        jp      poll_loop

        ;; check that last skt cleared the flag
        skt
        jp      ok_2
        jmp     fail
ok_2:


        jmp     pass

        include "pass_fail.asm"

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.