head	1.1;
access;
symbols
	rel_1_1:1.1
	rel_1_0:1.1
	rel_0_1_beta:1.1;
locks; strict;
comment	@;; @;


1.1
date	2006.05.20.02.46.20;	author arniml;	state Exp;
branches;
next	;
commitid	2641446e82fa4567;


desc
@@


1.1
log
@initial check-in
@
text
@	;; *******************************************************************
	;; $Id$
	;;
	;; 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"
@
