#define ASM
#include <vstypes.h>
#include <vs1005h.h>


	.sect code,interrupts
	.export _TouchIntAsm
_TouchIntAsm:
	.import _TouchIntC
	sty mr0,(i6)+1; stx i7,(i6)
	stx lr1,(i6); sty lr0,(i6)+1
	stx a2,(i6); sty b2,(i6)+1
	stx c2,(i6); sty d2,(i6)+1

	stx a1,(i6); sty a0,(i6)+1
	add null,p,a; stx i5,(i6)+1
	stx a1,(i6)+1; sty a0,(i6)
	call _TouchIntC
	ldc MR_INT,mr0

	ldx (i6),a1; ldy (i6)-1,a0
	resp a0,a1
	ldx (i6)-1,i5
	ldx (i6),a1; ldy (i6)-1,a0
	ldc INT_GLOB_ENA,i7
	ldx (i6),c2; ldy (i6)-1,d2
	ldx (i6),a2; ldy (i6)-1,b2
	ldx (i6),lr1; ldy (i6)-1,lr0
	ldy (i6),mr0
	reti
	sty i7,(i7); ldx (i6)-1,i7


	.end
