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


1.4
date	2006.05.28.15.26.33;	author arniml;	state Exp;
branches;
next	1.3;
commitid	794c4479c11f4567;

1.3
date	2006.05.28.13.35.23;	author arniml;	state Exp;
branches;
next	1.2;
commitid	523e4479a7144567;

1.2
date	2006.05.28.13.18.36;	author arniml;	state Exp;
branches;
next	1.1;
commitid	4af14479a31c4567;

1.1
date	2006.05.28.02.49.30;	author arniml;	state Exp;
branches;
next	;
commitid	46a344790fb54567;


desc
@@


1.4
log
@added macros for interrupt occurence checking
@
text
@	;; *******************************************************************
	;; $Id: int_macros.inc,v 1.3 2006/05/28 13:35:23 arniml Exp $
	;;
	;; Defines macros for interrupt tests.
	;;

	;; -------------------------------------------------------------------
	;; Save current A, M and C to M(3,15), M(3,14) and M(3,13).
	;;
save_a_m_c	MACRO
	xad	3, 15		; save A to M(3,15)

	x	0		; save current M
	xad	3, 14		; to M(3,14)

	smb	0x0		; save C
	skc			; to M(3,13)
	rmb     0x0		;
	x	0		;
	xad	3, 13		;
	ENDM


	;; -------------------------------------------------------------------
	;; Check SA against specified address
	;;
check_sa	MACRO	addr
	;; request nibble 0 of SA
	ogi	0x0
	inl
	;; check this nibble
	x	0
	clra
	IF	addr & 0xf <> 0
	aisc	addr & 0xf
	ENDIF
	ske
	jmp	fail

	;; request nibble 1 of SA
	ogi	0x1
	inl
	;; check this nibble
	x	0
	clra
	IF	addr & 0x0f0 <> 0
	aisc	(addr >> 4) & 0xf
	ENDIF
	ske
	jmp	fail

	;; request nibble 2 of SA
	ogi	0x2
	inl
	;; check this nibble
	x	0
	clra
	IF	addr & 0xf00 <> 0
	aisc	(addr >> 8) & 0xf
	ENDIF
	ske
	jmp	fail

	ENDM


	;; -------------------------------------------------------------------
	;; Restore C, M and A from M(3,13), M(3,14) and M(3,15)
	;;
restore_c_m_a	MACRO
	xad	3, 13		; restore C
	x	0		; from M(3,13)
	rc			;
	skmbz	0x0		;
	sc			;

	xad	3, 14		; restore current M
	x	0		; from M(3,14)

	xad	3, 15		; restore A
	ENDM


	;; -------------------------------------------------------------------
	;; Flag that interrupt occured in M(3,12).1
	;;
int_flag_set	MACRO
	clra
	aisc	0x1
	xad	3, 12
	ENDM

	;; -------------------------------------------------------------------
	;; Clear 'interrupt occured' flag
	;;
int_flag_clear	MACRO
	clra
	xad	3, 12
	ENDM

	;; -------------------------------------------------------------------
	;; Check interrupt occurence
	;;
int_flag_check	MACRO
	lbi	3, 12
	skmbz	0x0
	jp	+
	jmp	fail		; no interrupt!
+	lbi	0, 0
	ENDM
@


1.3
log
@rename save/restore macros
@
text
@d2 1
a2 1
	;; $Id: int_macros.inc,v 1.2 2006/05/28 13:18:36 arniml Exp $
d82 29
@


1.2
log
@enhance save and restore for A, M and C
@
text
@d2 1
a2 1
	;; $Id: int_macros.inc,v 1.1 2006/05/28 02:49:30 arniml Exp $
d10 1
a10 1
save_m_c	MACRO
d70 1
a70 1
restore_c_m	MACRO
@


1.1
log
@initial check-in
@
text
@d2 1
a2 1
	;; $Id$
d7 20
a27 1
	lbi	3, 15
d65 17
@

