URL
https://opencores.org/ocsvn/t400/t400/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 176 |
Rev 179 |
;; *******************************************************************
|
;; *******************************************************************
|
;; $Id: test.asm,v 1.1 2006-05-20 02:46:20 arniml Exp $
|
;; $Id: test.asm 179 2009-04-01 19:48:38Z arniml $
|
;;
|
;;
|
;; Checks the SKT instruction.
|
;; Checks the SKT instruction.
|
;;
|
;;
|
|
|
;; the cpu type is defined on asl's command line
|
;; the cpu type is defined on asl's command line
|
|
|
org 0x00
|
org 0x00
|
clra
|
clra
|
|
|
;; timer not elapsed right after power-on reset
|
;; timer not elapsed right after power-on reset
|
skt
|
skt
|
jp ok_1
|
jp ok_1
|
jmp fail
|
jmp fail
|
ok_1:
|
ok_1:
|
|
|
|
|
;; preload timeout value
|
;; preload timeout value
|
stii 0x4
|
stii 0x4
|
stii 0x0
|
stii 0x0
|
stii 0x0
|
stii 0x0
|
|
|
;; *******************************************************************
|
;; *******************************************************************
|
;; Poll for timer flag with and time out after a while.
|
;; Poll for timer flag with and time out after a while.
|
;;
|
;;
|
poll_loop:
|
poll_loop:
|
;; decrement timeout counter
|
;; decrement timeout counter
|
lbi 0, 2
|
lbi 0, 2
|
sc
|
sc
|
clra
|
clra
|
aisc 0x1
|
aisc 0x1
|
casc ; M(0, 2) - 1
|
casc ; M(0, 2) - 1
|
jp proc_digit_1
|
jp proc_digit_1
|
x 0
|
x 0
|
jp dec_finished
|
jp dec_finished
|
|
|
proc_digit_1:
|
proc_digit_1:
|
xds 0 ; A loads 0 from M
|
xds 0 ; A loads 0 from M
|
sc
|
sc
|
aisc 0x1
|
aisc 0x1
|
casc ; M(0, 1) - 1
|
casc ; M(0, 1) - 1
|
jp proc_digit_0
|
jp proc_digit_0
|
x 0
|
x 0
|
jp dec_finished
|
jp dec_finished
|
|
|
proc_digit_0:
|
proc_digit_0:
|
xds 0 ; A loads 0 from M
|
xds 0 ; A loads 0 from M
|
sc
|
sc
|
aisc 0x1
|
aisc 0x1
|
casc ; M(0, 0) - 1
|
casc ; M(0, 0) - 1
|
jmp fail ; TIMEOUT!
|
jmp fail ; TIMEOUT!
|
x 0
|
x 0
|
dec_finished:
|
dec_finished:
|
|
|
;; poll timer flag
|
;; poll timer flag
|
skt
|
skt
|
jp poll_loop
|
jp poll_loop
|
|
|
;; check that last skt cleared the flag
|
;; check that last skt cleared the flag
|
skt
|
skt
|
jp ok_2
|
jp ok_2
|
jmp fail
|
jmp fail
|
ok_2:
|
ok_2:
|
|
|
|
|
jmp pass
|
jmp pass
|
|
|
include "pass_fail.asm"
|
include "pass_fail.asm"
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.